From fbd642f909c2ac0542de1fbe38b9d0f04309dd81 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Wed, 29 Nov 2006 23:03:43 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@753 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/rendergl.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/source/src/rendergl.cpp b/source/src/rendergl.cpp index c57167d0..2618567d 100644 --- a/source/src/rendergl.cpp +++ b/source/src/rendergl.cpp @@ -71,6 +71,8 @@ void cleangl() { }; +VAR(warnqual, 0, 0, 1); + GLuint installtex(const char *texname, int &xs, int &ys, bool clamp) { SDL_Surface *s = IMG_Load(texname); @@ -95,21 +97,16 @@ GLuint installtex(const char *texname, int &xs, int &ys, bool clamp) ys = s->h; if(maxtexsize) while(xs>maxtexsize || ys>maxtexsize) { xs /= 2; ys /= 2; }; int mode = s->format->BitsPerPixel==24 ? GL_RGB : GL_RGBA; - uchar *scaledimg = (uchar *)s->pixels; if(xs!=s->w) { - conoutf("warning: quality loss: scaling %s", texname); // for voodoo cards under linux - scaledimg = new uchar[xs*ys*s->format->BitsPerPixel/8]; - if(gluScaleImage(mode, s->w, s->h, GL_UNSIGNED_BYTE, s->pixels, xs, ys, GL_UNSIGNED_BYTE, scaledimg)) + 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)) { xs = s->w; ys = s->h; - delete[] scaledimg; - scaledimg = (uchar *)s->pixels; }; }; - if(gluBuild2DMipmaps(GL_TEXTURE_2D, mode, xs, ys, mode, GL_UNSIGNED_BYTE, scaledimg)) fatal("could not build mipmaps"); - if(xs!=s->w) delete[] scaledimg; + if(gluBuild2DMipmaps(GL_TEXTURE_2D, mode, xs, ys, mode, GL_UNSIGNED_BYTE, s->pixels)) fatal("could not build mipmaps"); SDL_FreeSurface(s); return tnum; };