From 7aef3bf2584f24942dced06b6d4920843723b648 Mon Sep 17 00:00:00 2001 From: g-cont Date: Mon, 7 Nov 2016 00:00:00 +0300 Subject: [PATCH] 07 Nov 2016 --- engine/client/cl_cmds.c | 13 ++++++++----- engine/client/gl_image.c | 3 +-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/engine/client/cl_cmds.c b/engine/client/cl_cmds.c index 0c7ec45b..879a8c38 100644 --- a/engine/client/cl_cmds.c +++ b/engine/client/cl_cmds.c @@ -135,15 +135,14 @@ void CL_PlayCDTrack_f( void ) CL_ScreenshotGetName ================== */ -void CL_ScreenshotGetName( int lastnum, char *filename ) +qboolean CL_ScreenshotGetName( int lastnum, char *filename ) { int a, b, c, d; if( lastnum < 0 || lastnum > 9999 ) { - // bound - Q_sprintf( filename, "scrshots/%s/!error.bmp", clgame.mapname ); - return; + MsgDev( D_ERROR, "unable to write screenshot\n" ); + return false; } a = lastnum / 1000; @@ -155,6 +154,8 @@ void CL_ScreenshotGetName( int lastnum, char *filename ) d = lastnum; Q_sprintf( filename, "scrshots/%s_shot%i%i%i%i.bmp", clgame.mapname, a, b, c, d ); + + return true; } /* @@ -216,7 +217,9 @@ void CL_ScreenShot_f( void ) // scan for a free filename for( i = 0; i < 9999; i++ ) { - CL_ScreenshotGetName( i, checkname ); + if( !CL_ScreenshotGetName( i, checkname )) + return; // no namespace + if( !FS_FileExists( checkname, false )) break; } diff --git a/engine/client/gl_image.c b/engine/client/gl_image.c index e4fcde86..14c4b72e 100644 --- a/engine/client/gl_image.c +++ b/engine/client/gl_image.c @@ -726,8 +726,7 @@ static void GL_SetTextureDimensions( gltexture_t *tex, int width, int height, in tex->srcWidth = width; tex->srcHeight = height; - // NOTE: normalmaps must be power of two or software mip generator will stop working - if(( tex->flags & TF_NORMALMAP ) || !GL_Support( GL_ARB_TEXTURE_NPOT_EXT )) + if( !GL_Support( GL_ARB_TEXTURE_NPOT_EXT )) { #if 0 // find nearest power of two, rounding down if desired