X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=radiant%2Ftexmanip.cpp;h=03196c3cd30c9da23978ca60cfabab06a8bd31bb;hb=70f4daf16c16a2ccb6c222f1a8c5724d123fad81;hp=1c6752521f41f97aeab29cfb4e5d574417b71c19;hpb=830125fad042fad35dc029b6eb57c8156ad7e176;p=xonotic%2Fnetradiant.git diff --git a/radiant/texmanip.cpp b/radiant/texmanip.cpp index 1c675252..03196c3c 100644 --- a/radiant/texmanip.cpp +++ b/radiant/texmanip.cpp @@ -29,13 +29,15 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "stdafx.h" -#include "str.h" +#include "texmanip.h" + +#include +#include "stream/textstream.h" static byte *row1 = NULL, *row2 = NULL; static int rowsize = 0; -void R_ResampleTextureLerpLine( byte *in, byte *out, int inwidth, int outwidth, int bytesperpixel ){ +void R_ResampleTextureLerpLine( const byte *in, byte *out, int inwidth, int outwidth, int bytesperpixel ){ int j, xi, oldx = 0, f, fstep, endx, lerp; #define LERPBYTE( i ) out[i] = (byte) ( ( ( ( row2[i] - row1[i] ) * lerp ) >> 16 ) + row1[i] ) @@ -89,8 +91,9 @@ void R_ResampleTextureLerpLine( byte *in, byte *out, int inwidth, int outwidth, } } } - else{ - Sys_Printf( "R_ResampleTextureLerpLine: unsupported bytesperpixel %i\n", bytesperpixel ); + else + { + globalOutputStream() << "R_ResampleTextureLerpLine: unsupported bytesperpixel " << bytesperpixel << "\n"; } } @@ -99,7 +102,7 @@ void R_ResampleTextureLerpLine( byte *in, byte *out, int inwidth, int outwidth, R_ResampleTexture ================ */ -void R_ResampleTexture( void *indata, int inwidth, int inheight, void *outdata, int outwidth, int outheight, int bytesperpixel ){ +void R_ResampleTexture( const void *indata, int inwidth, int inheight, void *outdata, int outwidth, int outheight, int bytesperpixel ){ if ( rowsize < outwidth * bytesperpixel ) { if ( row1 ) { free( row1 ); @@ -115,7 +118,7 @@ void R_ResampleTexture( void *indata, int inwidth, int inheight, void *outdata, if ( bytesperpixel == 4 ) { int i, j, yi, oldy, f, fstep, lerp, endy = ( inheight - 1 ), inwidth4 = inwidth * 4, outwidth4 = outwidth * 4; - byte *inrow, *out; + byte *inrow, *out; out = (byte *)outdata; fstep = (int) ( inheight * 65536.0f / outheight ); #define LERPBYTE( i ) out[i] = (byte) ( ( ( ( row2[i] - row1[i] ) * lerp ) >> 16 ) + row1[i] ) @@ -210,7 +213,7 @@ void R_ResampleTexture( void *indata, int inwidth, int inheight, void *outdata, } else if ( bytesperpixel == 3 ) { int i, j, yi, oldy, f, fstep, lerp, endy = ( inheight - 1 ), inwidth3 = inwidth * 3, outwidth3 = outwidth * 3; - byte *inrow, *out; + byte *inrow, *out; out = (byte *)outdata; fstep = (int) ( inheight * 65536.0f / outheight ); #define LERPBYTE( i ) out[i] = (byte) ( ( ( ( row2[i] - row1[i] ) * lerp ) >> 16 ) + row1[i] ) @@ -295,8 +298,9 @@ void R_ResampleTexture( void *indata, int inwidth, int inheight, void *outdata, } } } - else{ - Sys_Printf( "R_ResampleTexture: unsupported bytesperpixel %i\n", bytesperpixel ); + else + { + globalOutputStream() << "R_ResampleTexture: unsupported bytesperpixel " << bytesperpixel << "\n"; } } @@ -361,8 +365,9 @@ void GL_MipReduce( byte *in, byte *out, int width, int height, int destwidth, in in += nextrow; // skip a line } } - else{ - Sys_Printf( "GL_MipReduce: desired size already achieved\n" ); + else + { + globalOutputStream() << "GL_MipReduce: desired size already achieved\n"; } } }