From 1d61d90f98e6d32a1c0d97cf92ceb4dba8fa8e0d Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Fri, 1 Dec 2006 00:25:22 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@756 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/rendergl.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/source/src/rendergl.cpp b/source/src/rendergl.cpp index 2618567d..597ef8d1 100644 --- a/source/src/rendergl.cpp +++ b/source/src/rendergl.cpp @@ -93,20 +93,19 @@ GLuint installtex(const char *texname, int &xs, int &ys, bool clamp) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - xs = s->w; - ys = s->h; - if(maxtexsize) while(xs>maxtexsize || ys>maxtexsize) { xs /= 2; ys /= 2; }; + int w = (xs = s->w), h = (ys = s->h); + if(maxtexsize) while(w>maxtexsize || h>maxtexsize) { w /= 2; h /= 2; }; int mode = s->format->BitsPerPixel==24 ? GL_RGB : GL_RGBA; - if(xs!=s->w) + if(w!=s->w) { if(warnqual) conoutf("warning: quality loss: scaling %s", texname); // for voodoo cards under linux - if(gluScaleImage(mode, s->w, s->h, GL_UNSIGNED_BYTE, s->pixels, xs, ys, GL_UNSIGNED_BYTE, s->pixels)) + if(gluScaleImage(mode, s->w, s->h, GL_UNSIGNED_BYTE, s->pixels, w, h, GL_UNSIGNED_BYTE, s->pixels)) { - xs = s->w; - ys = s->h; + w = s->w; + h = s->h; }; }; - if(gluBuild2DMipmaps(GL_TEXTURE_2D, mode, xs, ys, mode, GL_UNSIGNED_BYTE, s->pixels)) fatal("could not build mipmaps"); + if(gluBuild2DMipmaps(GL_TEXTURE_2D, mode, w, h, mode, GL_UNSIGNED_BYTE, s->pixels)) fatal("could not build mipmaps"); SDL_FreeSurface(s); return tnum; };