mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 11:35:05 +08:00
engine: imagelib: rename mips variable to mipmaps, to avoid clash with some MIPS compilers
While here, reduce some variables scope.
This commit is contained in:
@@ -1509,21 +1509,25 @@ void Image_GenerateMipmaps( const byte *source, int width, int height, byte *mip
|
||||
{ width / 4, height / 4 },
|
||||
{ width / 8, height / 8 }
|
||||
};
|
||||
byte *mips[3] = { mip1, mip2, mip3 };
|
||||
int m, mw, mh, step, y, x;
|
||||
byte *mipmaps[3] = { mip1, mip2, mip3 };
|
||||
int m;
|
||||
|
||||
for( m = 0; m < 3; ++m )
|
||||
{
|
||||
if( !mips[m] )
|
||||
int mw, mh, step, y;
|
||||
|
||||
if( !mipmaps[m] )
|
||||
continue;
|
||||
mw = sizes[m][0];
|
||||
mh = sizes[m][1];
|
||||
step = 1 << ( m + 1 );
|
||||
for( y = 0; y < mh; ++y )
|
||||
{
|
||||
int x;
|
||||
|
||||
for( x = 0; x < mw; ++x )
|
||||
{
|
||||
mips[m][y * mw + x] = source[( y * step ) * width + ( x * step )];
|
||||
mipmaps[m][y * mw + x] = source[( y * step ) * width + ( x * step )];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user