use safe string for shaderInfo_t.shader
This commit is contained in:
parent
3578370061
commit
da3b05728c
84
tools/quake3/common/stringfixedsize.h
Normal file
84
tools/quake3/common/stringfixedsize.h
Normal file
|
|
@ -0,0 +1,84 @@
|
||||||
|
/*
|
||||||
|
Copyright (C) 2001-2006, William Joseph.
|
||||||
|
All Rights Reserved.
|
||||||
|
|
||||||
|
This file is part of GtkRadiant.
|
||||||
|
|
||||||
|
GtkRadiant is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
GtkRadiant is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with GtkRadiant; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if !defined( INCLUDED_STRINGFIXESIZE_H )
|
||||||
|
#define INCLUDED_STRINGFIXESIZE_H
|
||||||
|
|
||||||
|
#include "stream/textstream.h"
|
||||||
|
#include "string/string.h"
|
||||||
|
#include "cmdlib.h"
|
||||||
|
|
||||||
|
|
||||||
|
/// \brief A TextOutputStream which writes to a null terminated fixed lenght char array.
|
||||||
|
/// Similar to std::stringstream.
|
||||||
|
template<std::size_t SIZE>
|
||||||
|
class StringFixedSize : public TextOutputStream
|
||||||
|
{
|
||||||
|
char m_string[SIZE];
|
||||||
|
std::size_t m_length;
|
||||||
|
public:
|
||||||
|
StringFixedSize() {
|
||||||
|
clear();
|
||||||
|
}
|
||||||
|
std::size_t write( const char* buffer, std::size_t length ) override {
|
||||||
|
if( m_length + length < SIZE ){
|
||||||
|
for( auto i = length; i != 0; --i )
|
||||||
|
m_string[m_length++] = *buffer++;
|
||||||
|
strClear( &m_string[m_length] );
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
Error( "String '%s%.*s' overflow: length >= %d.", m_string, length, buffer, SIZE );
|
||||||
|
}
|
||||||
|
|
||||||
|
return length;
|
||||||
|
}
|
||||||
|
|
||||||
|
StringFixedSize& operator=( const char* string ){
|
||||||
|
clear();
|
||||||
|
write( string, strlen( string ) );
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
operator const char*() const {
|
||||||
|
return c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool empty() const {
|
||||||
|
return strEmpty( m_string );
|
||||||
|
}
|
||||||
|
const char* c_str() const {
|
||||||
|
return m_string;
|
||||||
|
}
|
||||||
|
void clear() {
|
||||||
|
strClear( m_string );
|
||||||
|
m_length = 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<std::size_t SIZE, typename T>
|
||||||
|
inline StringFixedSize<SIZE>& operator<<( StringFixedSize<SIZE>& ostream, const T& t ) {
|
||||||
|
return ostream_write( ostream, t );
|
||||||
|
}
|
||||||
|
|
||||||
|
using String64 = StringFixedSize<64>;
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -2976,7 +2976,7 @@ int inflate_blocks(inflate_blocks_statef *s, z_streamp z, int r)
|
||||||
DUMPBITS(14)
|
DUMPBITS(14)
|
||||||
s->sub.trees.index = 0;
|
s->sub.trees.index = 0;
|
||||||
Tracev(("inflate: table sizes ok\n"));
|
Tracev(("inflate: table sizes ok\n"));
|
||||||
s->mode = BTREE;
|
s->mode = BTREE; // fall through
|
||||||
case BTREE:
|
case BTREE:
|
||||||
while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10))
|
while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10))
|
||||||
{
|
{
|
||||||
|
|
@ -2999,7 +2999,7 @@ int inflate_blocks(inflate_blocks_statef *s, z_streamp z, int r)
|
||||||
}
|
}
|
||||||
s->sub.trees.index = 0;
|
s->sub.trees.index = 0;
|
||||||
Tracev(("inflate: bits tree ok\n"));
|
Tracev(("inflate: bits tree ok\n"));
|
||||||
s->mode = DTREE;
|
s->mode = DTREE; // fall through
|
||||||
case DTREE:
|
case DTREE:
|
||||||
while (t = s->sub.trees.table,
|
while (t = s->sub.trees.table,
|
||||||
s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))
|
s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))
|
||||||
|
|
|
||||||
|
|
@ -270,7 +270,7 @@ static void ConvertShader( FILE *f, bspShader_t *shader, int shaderNum ){
|
||||||
strcpy( filename, si->shaderImage->filename );
|
strcpy( filename, si->shaderImage->filename );
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
sprintf( filename, "%s.tga", si->shader );
|
sprintf( filename, "%s.tga", si->shader.c_str() );
|
||||||
}
|
}
|
||||||
for ( c = filename; *c; c++ )
|
for ( c = filename; *c; c++ )
|
||||||
if ( *c == '/' ) {
|
if ( *c == '/' ) {
|
||||||
|
|
|
||||||
|
|
@ -226,7 +226,7 @@ static void ConvertBrushFast( FILE *f, int num, bspBrush_t *brush, vec3_t origin
|
||||||
bspBrushSide_t *side;
|
bspBrushSide_t *side;
|
||||||
side_t *buildSide;
|
side_t *buildSide;
|
||||||
bspShader_t *shader;
|
bspShader_t *shader;
|
||||||
char *texture;
|
const char *texture;
|
||||||
plane_t *buildPlane;
|
plane_t *buildPlane;
|
||||||
vec3_t pts[ 3 ];
|
vec3_t pts[ 3 ];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,7 @@ static void ConvertShaderToMTL( FILE *f, bspShader_t *shader, int shaderNum ){
|
||||||
strcpy( filename, si->shaderImage->filename );
|
strcpy( filename, si->shaderImage->filename );
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
sprintf( filename, "%s.tga", si->shader );
|
sprintf( filename, "%s.tga", si->shader.c_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* blender hates this, so let's not do it
|
/* blender hates this, so let's not do it
|
||||||
|
|
|
||||||
|
|
@ -526,14 +526,14 @@ void CreateSurfaceLights( void ){
|
||||||
|
|
||||||
/* sunlight? */
|
/* sunlight? */
|
||||||
if ( si->sun != NULL && !nss ) {
|
if ( si->sun != NULL && !nss ) {
|
||||||
Sys_FPrintf( SYS_VRB, "Sun: %s\n", si->shader );
|
Sys_FPrintf( SYS_VRB, "Sun: %s\n", si->shader.c_str() );
|
||||||
CreateSunLight( si->sun );
|
CreateSunLight( si->sun );
|
||||||
si->sun = NULL; /* FIXME: leak! */
|
si->sun = NULL; /* FIXME: leak! */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sky light? */
|
/* sky light? */
|
||||||
if ( si->skyLightValue > 0.0f ) {
|
if ( si->skyLightValue > 0.0f ) {
|
||||||
Sys_FPrintf( SYS_VRB, "Sky: %s\n", si->shader );
|
Sys_FPrintf( SYS_VRB, "Sky: %s\n", si->shader.c_str() );
|
||||||
CreateSkyLights( si->color, si->skyLightValue, si->skyLightIterations, si->lightFilterRadius, si->lightStyle );
|
CreateSkyLights( si->color, si->skyLightValue, si->skyLightIterations, si->lightFilterRadius, si->lightStyle );
|
||||||
si->skyLightValue = 0.0f; /* FIXME: hack! */
|
si->skyLightValue = 0.0f; /* FIXME: hack! */
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1797,7 +1797,7 @@ static bool ParseMapEntity( bool onlyLights, bool noCollapseGroups ){
|
||||||
char shader[ MAX_QPATH ];
|
char shader[ MAX_QPATH ];
|
||||||
sprintf( shader, "textures/%s", value );
|
sprintf( shader, "textures/%s", value );
|
||||||
celShader = ShaderInfoForShader( shader );
|
celShader = ShaderInfoForShader( shader );
|
||||||
Sys_Printf( "Entity %d (%s) has cel shader %s\n", mapEnt->mapEntityNum, classname, celShader->shader );
|
Sys_Printf( "Entity %d (%s) has cel shader %s\n", mapEnt->mapEntityNum, classname, celShader->shader.c_str() );
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
celShader = !strEmpty( globalCelShader ) ? ShaderInfoForShader( globalCelShader ) : NULL;
|
celShader = !strEmpty( globalCelShader ) ? ShaderInfoForShader( globalCelShader ) : NULL;
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,8 @@
|
||||||
#include "png.h"
|
#include "png.h"
|
||||||
#include "md4.h"
|
#include "md4.h"
|
||||||
|
|
||||||
|
#include "stringfixedsize.h"
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
@ -694,7 +696,7 @@ implicitMap_t;
|
||||||
|
|
||||||
typedef struct shaderInfo_s
|
typedef struct shaderInfo_s
|
||||||
{
|
{
|
||||||
char shader[ MAX_QPATH ];
|
String64 shader;
|
||||||
int surfaceFlags;
|
int surfaceFlags;
|
||||||
int contentFlags;
|
int contentFlags;
|
||||||
int compileFlags;
|
int compileFlags;
|
||||||
|
|
|
||||||
|
|
@ -392,7 +392,7 @@ void WriteMapShaderFile( void ){
|
||||||
num++;
|
num++;
|
||||||
|
|
||||||
/* print it to the file */
|
/* print it to the file */
|
||||||
fprintf( file, "%s%s\n", si->shader, si->shaderText );
|
fprintf( file, "%s%s\n", si->shader.c_str(), si->shaderText );
|
||||||
//Sys_Printf( "%s%s\n", si->shader, si->shaderText ); /* FIXME: remove debugging code */
|
//Sys_Printf( "%s%s\n", si->shader, si->shaderText ); /* FIXME: remove debugging code */
|
||||||
|
|
||||||
Sys_FPrintf( SYS_VRB, "." );
|
Sys_FPrintf( SYS_VRB, "." );
|
||||||
|
|
@ -515,7 +515,7 @@ shaderInfo_t *CustomShader( shaderInfo_t *si, const char *find, char *replace ){
|
||||||
"\t\trgbGen identity\n"
|
"\t\trgbGen identity\n"
|
||||||
"\t}\n"
|
"\t}\n"
|
||||||
"}\n",
|
"}\n",
|
||||||
si->shader );
|
si->shader.c_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* error check */
|
/* error check */
|
||||||
|
|
@ -556,8 +556,8 @@ shaderInfo_t *CustomShader( shaderInfo_t *si, const char *find, char *replace ){
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clone the existing shader and rename */
|
/* clone the existing shader and rename */
|
||||||
memcpy( csi, si, sizeof( shaderInfo_t ) );
|
*csi = *si;
|
||||||
strcpy( csi->shader, shader );
|
csi->shader = shader;
|
||||||
csi->custom = true;
|
csi->custom = true;
|
||||||
|
|
||||||
/* store new shader text */
|
/* store new shader text */
|
||||||
|
|
@ -625,7 +625,8 @@ static shaderInfo_t *AllocShaderInfo( void ){
|
||||||
numShaderInfo++;
|
numShaderInfo++;
|
||||||
|
|
||||||
/* ydnar: clear to 0 first */
|
/* ydnar: clear to 0 first */
|
||||||
memset( si, 0, sizeof( shaderInfo_t ) );
|
// memset( si, 0, sizeof( shaderInfo_t ) );
|
||||||
|
new (si) shaderInfo_t{}; // placement new
|
||||||
|
|
||||||
/* set defaults */
|
/* set defaults */
|
||||||
ApplySurfaceParm( "default", &si->contentFlags, &si->surfaceFlags, &si->compileFlags );
|
ApplySurfaceParm( "default", &si->contentFlags, &si->surfaceFlags, &si->compileFlags );
|
||||||
|
|
@ -763,7 +764,7 @@ static void LoadShaderImages( shaderInfo_t *si ){
|
||||||
if ( si->shaderImage == NULL ) {
|
if ( si->shaderImage == NULL ) {
|
||||||
si->shaderImage = ImageLoad( DEFAULT_IMAGE );
|
si->shaderImage = ImageLoad( DEFAULT_IMAGE );
|
||||||
if ( warnImage && !strEqual( si->shader, "noshader" ) ) {
|
if ( warnImage && !strEqual( si->shader, "noshader" ) ) {
|
||||||
Sys_Warning( "Couldn't find image for shader %s\n", si->shader );
|
Sys_Warning( "Couldn't find image for shader %s\n", si->shader.c_str() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -774,7 +775,7 @@ static void LoadShaderImages( shaderInfo_t *si ){
|
||||||
si->normalImage = ImageLoad( si->normalImagePath );
|
si->normalImage = ImageLoad( si->normalImagePath );
|
||||||
if ( si->normalImage != NULL ) {
|
if ( si->normalImage != NULL ) {
|
||||||
Sys_FPrintf( SYS_VRB, "Shader %s has\n"
|
Sys_FPrintf( SYS_VRB, "Shader %s has\n"
|
||||||
" NM %s\n", si->shader, si->normalImagePath );
|
" NM %s\n", si->shader.c_str(), si->normalImagePath );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -850,7 +851,7 @@ shaderInfo_t *ShaderInfoForShader( const char *shaderName ){
|
||||||
si = &shaderInfo[ i ];
|
si = &shaderInfo[ i ];
|
||||||
if ( striEqual( shader, si->shader ) ) {
|
if ( striEqual( shader, si->shader ) ) {
|
||||||
/* check if shader is deprecated */
|
/* check if shader is deprecated */
|
||||||
if ( deprecationDepth < MAX_SHADER_DEPRECATION_DEPTH && si->deprecateShader && si->deprecateShader[ 0 ] ) {
|
if ( deprecationDepth < MAX_SHADER_DEPRECATION_DEPTH && !strEmptyOrNull( si->deprecateShader ) ) {
|
||||||
/* override name */
|
/* override name */
|
||||||
strcpy( shader, si->deprecateShader );
|
strcpy( shader, si->deprecateShader );
|
||||||
StripExtension( shader );
|
StripExtension( shader );
|
||||||
|
|
@ -877,7 +878,7 @@ shaderInfo_t *ShaderInfoForShader( const char *shaderName ){
|
||||||
|
|
||||||
/* allocate a default shader */
|
/* allocate a default shader */
|
||||||
si = AllocShaderInfo();
|
si = AllocShaderInfo();
|
||||||
strcpy( si->shader, shader );
|
si->shader << shader;
|
||||||
LoadShaderImages( si );
|
LoadShaderImages( si );
|
||||||
FinishShader( si );
|
FinishShader( si );
|
||||||
|
|
||||||
|
|
@ -963,7 +964,7 @@ void Parse1DMatrixAppend( char *buffer, int x, vec_t *m ){
|
||||||
static void ParseShaderFile( const char *filename ){
|
static void ParseShaderFile( const char *filename ){
|
||||||
int i, val;
|
int i, val;
|
||||||
shaderInfo_t *si;
|
shaderInfo_t *si;
|
||||||
char *suffix, temp[ 1024 ];
|
char temp[ 1024 ];
|
||||||
char shaderText[ 8192 ]; /* ydnar: fixme (make this bigger?) */
|
char shaderText[ 8192 ]; /* ydnar: fixme (make this bigger?) */
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -995,13 +996,12 @@ static void ParseShaderFile( const char *filename ){
|
||||||
|
|
||||||
/* shader name is initial token */
|
/* shader name is initial token */
|
||||||
si = AllocShaderInfo();
|
si = AllocShaderInfo();
|
||||||
strcpy( si->shader, token );
|
|
||||||
|
|
||||||
/* ignore ":q3map" suffix */
|
/* ignore ":q3map" suffix */
|
||||||
suffix = strIstr( si->shader, ":q3map" );
|
if( striEqualSuffix( token, ":q3map" ) )
|
||||||
if ( suffix != NULL ) {
|
si->shader << StringRange( token, token + strlen( token ) - strlen( ":q3map" ) );
|
||||||
strClear( suffix );
|
else
|
||||||
}
|
si->shader << token;
|
||||||
|
|
||||||
/* handle { } section */
|
/* handle { } section */
|
||||||
if ( !GetTokenAppend( shaderText, true ) ) {
|
if ( !GetTokenAppend( shaderText, true ) ) {
|
||||||
|
|
@ -1010,7 +1010,7 @@ static void ParseShaderFile( const char *filename ){
|
||||||
if ( !strEqual( token, "{" ) ) {
|
if ( !strEqual( token, "{" ) ) {
|
||||||
if ( si != NULL ) {
|
if ( si != NULL ) {
|
||||||
Error( "ParseShaderFile(): %s, line %d: { not found!\nFound instead: %s\nLast known shader: %s\nFile location be: %s\n",
|
Error( "ParseShaderFile(): %s, line %d: { not found!\nFound instead: %s\nLast known shader: %s\nFile location be: %s\n",
|
||||||
filename, scriptline, token, si->shader, g_strLoadedFileLocation );
|
filename, scriptline, token, si->shader.c_str(), g_strLoadedFileLocation );
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
Error( "ParseShaderFile(): %s, line %d: { not found!\nFound instead: %s\nFile location be: %s\n",
|
Error( "ParseShaderFile(): %s, line %d: { not found!\nFound instead: %s\nFile location be: %s\n",
|
||||||
|
|
@ -1178,7 +1178,7 @@ static void ParseShaderFile( const char *filename ){
|
||||||
si->implicitMap = IM_OPAQUE;
|
si->implicitMap = IM_OPAQUE;
|
||||||
GetTokenAppend( shaderText, false );
|
GetTokenAppend( shaderText, false );
|
||||||
if ( strEqual( token, "-" ) ) {
|
if ( strEqual( token, "-" ) ) {
|
||||||
sprintf( si->implicitImagePath, "%s.tga", si->shader );
|
sprintf( si->implicitImagePath, "%s.tga", si->shader.c_str() );
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
strcpy( si->implicitImagePath, token );
|
strcpy( si->implicitImagePath, token );
|
||||||
|
|
@ -1189,7 +1189,7 @@ static void ParseShaderFile( const char *filename ){
|
||||||
si->implicitMap = IM_MASKED;
|
si->implicitMap = IM_MASKED;
|
||||||
GetTokenAppend( shaderText, false );
|
GetTokenAppend( shaderText, false );
|
||||||
if ( strEqual( token, "-" ) ) {
|
if ( strEqual( token, "-" ) ) {
|
||||||
sprintf( si->implicitImagePath, "%s.tga", si->shader );
|
sprintf( si->implicitImagePath, "%s.tga", si->shader.c_str() );
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
strcpy( si->implicitImagePath, token );
|
strcpy( si->implicitImagePath, token );
|
||||||
|
|
@ -1200,7 +1200,7 @@ static void ParseShaderFile( const char *filename ){
|
||||||
si->implicitMap = IM_MASKED;
|
si->implicitMap = IM_MASKED;
|
||||||
GetTokenAppend( shaderText, false );
|
GetTokenAppend( shaderText, false );
|
||||||
if ( strEqual( token, "-" ) ) {
|
if ( strEqual( token, "-" ) ) {
|
||||||
sprintf( si->implicitImagePath, "%s.tga", si->shader );
|
sprintf( si->implicitImagePath, "%s.tga", si->shader.c_str() );
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
strcpy( si->implicitImagePath, token );
|
strcpy( si->implicitImagePath, token );
|
||||||
|
|
@ -1354,10 +1354,10 @@ static void ParseShaderFile( const char *filename ){
|
||||||
strcpy( temp, si->shader );
|
strcpy( temp, si->shader );
|
||||||
|
|
||||||
/* copy shader */
|
/* copy shader */
|
||||||
memcpy( si, si2, sizeof( *si ) );
|
*si = *si2;
|
||||||
|
|
||||||
/* restore name and set to unfinished */
|
/* restore name and set to unfinished */
|
||||||
strcpy( si->shader, temp );
|
si->shader = temp;
|
||||||
si->shaderWidth = 0;
|
si->shaderWidth = 0;
|
||||||
si->shaderHeight = 0;
|
si->shaderHeight = 0;
|
||||||
si->finished = false;
|
si->finished = false;
|
||||||
|
|
|
||||||
|
|
@ -2518,7 +2518,7 @@ void EmitDrawIndexes( mapDrawSurface_t *ds, bspDrawSurface_t *out ){
|
||||||
if ( bspDrawIndexes[ numBSPDrawIndexes ] < 0 || bspDrawIndexes[ numBSPDrawIndexes ] >= ds->numVerts ) {
|
if ( bspDrawIndexes[ numBSPDrawIndexes ] < 0 || bspDrawIndexes[ numBSPDrawIndexes ] >= ds->numVerts ) {
|
||||||
Sys_Warning( "%d %s has invalid index %d (%d)\n",
|
Sys_Warning( "%d %s has invalid index %d (%d)\n",
|
||||||
numBSPDrawSurfaces,
|
numBSPDrawSurfaces,
|
||||||
ds->shaderInfo->shader,
|
ds->shaderInfo->shader.c_str(),
|
||||||
bspDrawIndexes[ numBSPDrawIndexes ],
|
bspDrawIndexes[ numBSPDrawIndexes ],
|
||||||
i );
|
i );
|
||||||
bspDrawIndexes[ numBSPDrawIndexes ] = 0;
|
bspDrawIndexes[ numBSPDrawIndexes ] = 0;
|
||||||
|
|
@ -3747,7 +3747,7 @@ void FilterDrawsurfsIntoTree( entity_t *e, tree_t *tree ){
|
||||||
Sys_Printf( "\n" );
|
Sys_Printf( "\n" );
|
||||||
Sys_Warning( "Potentially bad %s surface (%d: %d, %d)\n %s\n",
|
Sys_Warning( "Potentially bad %s surface (%d: %d, %d)\n %s\n",
|
||||||
surfaceTypes[ ds->type ],
|
surfaceTypes[ ds->type ],
|
||||||
numBSPDrawSurfaces - 1, out->numVerts, out->numIndexes, si->shader );
|
numBSPDrawSurfaces - 1, out->numVerts, out->numIndexes, si->shader.c_str() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -255,7 +255,7 @@ void WriteSurfaceExtraFile( const char *path ){
|
||||||
|
|
||||||
/* shader */
|
/* shader */
|
||||||
if ( se->si != NULL ) {
|
if ( se->si != NULL ) {
|
||||||
fprintf( sf, "\tshader %s\n", se->si->shader );
|
fprintf( sf, "\tshader %s\n", se->si->shader.c_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* parent surface number */
|
/* parent surface number */
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ int EmitShader( const char *shader, int *contentFlags, int *surfaceFlags ){
|
||||||
|
|
||||||
/* recursively emit any damage shaders */
|
/* recursively emit any damage shaders */
|
||||||
if ( !strEmptyOrNull( si->damageShader ) ) {
|
if ( !strEmptyOrNull( si->damageShader ) ) {
|
||||||
Sys_FPrintf( SYS_VRB, "Shader %s has damage shader %s\n", si->shader, si->damageShader );
|
Sys_FPrintf( SYS_VRB, "Shader %s has damage shader %s\n", si->shader.c_str(), si->damageShader );
|
||||||
EmitShader( si->damageShader, NULL, NULL );
|
EmitShader( si->damageShader, NULL, NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user