Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove iV_DrawImageScaled, made unnecessary by more modern iV_DrawIma…

…ge2()
  • Loading branch information...
commit f58dd9357e4eb812a29662314ef79b2284a430f0 1 parent 9549a68
@perim perim authored
View
30 lib/ivis_opengl/pieblitfunc.cpp
@@ -341,14 +341,14 @@ static Vector2i makePieImage(IMAGEFILE *imageFile, unsigned id, PIERECT *dest =
return pieImage;
}
-void iV_DrawImage2(QString filename, int x, int y)
+void iV_DrawImage2(const QString &filename, float x, float y, float width, float height)
{
ImageDef *image = iV_GetImage(filename, x, y);
const GLfloat invTextureSize = image->invTextureSize;
const int tu = image->Tu;
const int tv = image->Tv;
- const int w = image->Width;
- const int h = image->Height;
+ const int w = width > 0 ? width : image->Width;
+ const int h = height > 0 ? height : image->Height;
x += image->XOffset;
y += image->YOffset;
pie_SetTexturePage(image->textureId);
@@ -357,13 +357,13 @@ void iV_DrawImage2(QString filename, int x, int y)
glTexCoord2f(tu * image->invTextureSize, tv * invTextureSize);
glVertex2f(x, y);
- glTexCoord2f((tu + w) * invTextureSize, tv * invTextureSize);
+ glTexCoord2f((tu + image->Width) * invTextureSize, tv * invTextureSize);
glVertex2f(x + w, y);
- glTexCoord2f(tu * invTextureSize, (tv + h) * invTextureSize);
+ glTexCoord2f(tu * invTextureSize, (tv + image->Height) * invTextureSize);
glVertex2f(x, y + h);
- glTexCoord2f((tu + w) * invTextureSize, (tv + h) * invTextureSize);
+ glTexCoord2f((tu + image->Width) * invTextureSize, (tv + image->Height) * invTextureSize);
glVertex2f(x + w, y + h);
glEnd();
pie_SetRendMode(REND_ALPHA);
@@ -465,24 +465,6 @@ void iV_DrawImageRepeatY(IMAGEFILE *ImageFile, UWORD ID, int x, int y, int Heigh
}
}
-void iV_DrawImageScaled(IMAGEFILE *ImageFile, UWORD ID, int x, int y, int w, int h)
-{
- if (!assertValidImage(ImageFile, ID))
- {
- return;
- }
-
- PIERECT dest;
- Vector2i pieImage = makePieImage(ImageFile, ID, &dest, x, y);
- dest.w = w;
- dest.h = h;
-
- pie_SetRendMode(REND_ALPHA);
- pie_SetAlphaTest(true);
-
- pie_DrawImage(ImageFile, ID, pieImage, &dest);
-}
-
bool pie_InitRadar(void)
{
radarGfx = new GFX(GFX_TEXTURE, GL_TRIANGLE_STRIP, 2);
View
4 lib/ivis_opengl/pieblitfunc.h
@@ -108,15 +108,13 @@ extern void iV_Line(int x0, int y0, int x1, int y1, PIELIGHT colour);
extern void iV_Box(int x0,int y0, int x1, int y1, PIELIGHT colour);
extern void pie_BoxFill(int x0,int y0, int x1, int y1, PIELIGHT colour);
extern void iV_DrawImage(IMAGEFILE *ImageFile, UWORD ID, int x, int y);
-void iV_DrawImage2(QString filename, int x, int y);
+void iV_DrawImage2(const QString &filename, float x, float y, float width = -0.0f, float height = -0.0f);
void iV_DrawImageTc(Image image, Image imageTc, int x, int y, PIELIGHT colour);
void iV_DrawImageRepeatX(IMAGEFILE *ImageFile, UWORD ID, int x, int y, int Width);
void iV_DrawImageRepeatY(IMAGEFILE *ImageFile, UWORD ID, int x, int y, int Height);
-void iV_DrawImageScaled(IMAGEFILE *ImageFile, UWORD ID, int x, int y, int w, int h);
static inline void iV_DrawImage(Image image, int x, int y) { iV_DrawImage(image.images, image.id, x, y); }
static inline void iV_DrawImageTc(IMAGEFILE *imageFile, unsigned id, unsigned idTc, int x, int y, PIELIGHT colour) { iV_DrawImageTc(Image(imageFile, id), Image(imageFile, idTc), x, y, colour); }
-static inline void iV_DrawImageScaled(Image image, int x, int y, int w, int h) { iV_DrawImageScaled(image.images, image.id, x, y, w, h); }
extern void iV_TransBoxFill(float x0, float y0, float x1, float y1);
extern void pie_UniTransBoxFill(float x0, float y0, float x1, float y1, PIELIGHT colour);
View
2  src/frontend.cpp
@@ -1595,7 +1595,7 @@ static void displayTitleBitmap(WZ_DECL_UNUSED WIDGET *psWidget, WZ_DECL_UNUSED U
// show warzone logo
static void displayLogo(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset)
{
- iV_DrawImageScaled(FrontImages, IMAGE_FE_LOGO, xOffset + psWidget->x(), yOffset + psWidget->y(), psWidget->width(), psWidget->height());
+ iV_DrawImage2("image_fe_logo.png", xOffset + psWidget->x(), yOffset + psWidget->y(), psWidget->width(), psWidget->height());
}
Please sign in to comment.
Something went wrong with that request. Please try again.