diff --git a/tools/quake3/common/stringfixedsize.h b/tools/quake3/common/stringfixedsize.h index 3b4e2bf2..f1a19387 100644 --- a/tools/quake3/common/stringfixedsize.h +++ b/tools/quake3/common/stringfixedsize.h @@ -52,7 +52,7 @@ public: } StringFixedSize& operator=( const char* string ){ - return (*this)( string ); + return operator()( string ); } template diff --git a/tools/quake3/q3map2/shaders.cpp b/tools/quake3/q3map2/shaders.cpp index b8d037f5..ad34e876 100644 --- a/tools/quake3/q3map2/shaders.cpp +++ b/tools/quake3/q3map2/shaders.cpp @@ -519,8 +519,8 @@ shaderInfo_t *CustomShader( shaderInfo_t *si, const char *find, char *replace ){ } /* error check */ - if ( ( strlen( mapName ) + 1 + 32 ) > MAX_QPATH ) { - Error( "Custom shader name length (%d) exceeded. Shorten your map name.\n", MAX_QPATH ); + if ( ( strlen( mapName ) + 1 + 32 ) >= MAX_QPATH ) { + Error( "Custom shader name length (%d) exceeded. Shorten your map name.\n", MAX_QPATH - 1 ); } /* do some bad find-replace */ diff --git a/tools/quake3/q3map2/surface.cpp b/tools/quake3/q3map2/surface.cpp index 7ad8c0b8..bb81767b 100644 --- a/tools/quake3/q3map2/surface.cpp +++ b/tools/quake3/q3map2/surface.cpp @@ -787,7 +787,6 @@ byte GetShaderIndexForPoint( indexMap_t *im, vec3_t eMins, vec3_t eMaxs, vec3_t shaderInfo_t *GetIndexedShader( shaderInfo_t *parent, indexMap_t *im, int numPoints, byte *shaderIndexes ){ int i; byte minShaderIndex, maxShaderIndex; - char shader[ MAX_QPATH ]; shaderInfo_t *si; @@ -821,16 +820,10 @@ shaderInfo_t *GetIndexedShader( shaderInfo_t *parent, indexMap_t *im, int numPoi } } - /* make a shader name */ - if ( minShaderIndex == maxShaderIndex ) { - sprintf( shader, "textures/%s_%d", im->shader, maxShaderIndex ); - } - else{ - sprintf( shader, "textures/%s_%dto%d", im->shader, minShaderIndex, maxShaderIndex ); - } - /* get the shader */ - si = ShaderInfoForShader( shader ); + si = ShaderInfoForShader( ( minShaderIndex == maxShaderIndex )? + String64()( "textures/", im->shader, '_', int(maxShaderIndex) ): + String64()( "textures/", im->shader, '_', int(minShaderIndex), "to", int(maxShaderIndex) ) ); /* inherit a few things from parent shader */ if ( parent->globalTexture ) {