use String64 for shaderInfo_s::skyParmsImageBase
add variadic template operator to StringFixedSize for inline strings creation
This commit is contained in:
parent
da3b05728c
commit
9590d602d3
|
|
@ -52,8 +52,14 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
StringFixedSize& operator=( const char* string ){
|
StringFixedSize& operator=( const char* string ){
|
||||||
|
return (*this)( string );
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename ... Args>
|
||||||
|
StringFixedSize& operator()( const Args& ... args ){
|
||||||
clear();
|
clear();
|
||||||
write( string, strlen( string ) );
|
using expander = int[];
|
||||||
|
(void)expander{ 0, ( (void)( *this << args ), 0 ) ... };
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -765,7 +765,7 @@ typedef struct shaderInfo_s
|
||||||
|
|
||||||
float vertexScale; /* vertex light scale */
|
float vertexScale; /* vertex light scale */
|
||||||
|
|
||||||
char skyParmsImageBase[ MAX_QPATH ]; /* ydnar: for skies */
|
String64 skyParmsImageBase; /* ydnar: for skies */
|
||||||
|
|
||||||
char editorImagePath[ MAX_QPATH ]; /* use this image to generate texture coordinates */
|
char editorImagePath[ MAX_QPATH ]; /* use this image to generate texture coordinates */
|
||||||
char lightImagePath[ MAX_QPATH ]; /* use this image to generate color / averageColor */
|
char lightImagePath[ MAX_QPATH ]; /* use this image to generate color / averageColor */
|
||||||
|
|
@ -1700,7 +1700,7 @@ void AddEntitySurfaceModels( entity_t *e );
|
||||||
mapDrawSurface_t *DrawSurfaceForSide( entity_t *e, brush_t *b, side_t *s, winding_t *w );
|
mapDrawSurface_t *DrawSurfaceForSide( entity_t *e, brush_t *b, side_t *s, winding_t *w );
|
||||||
mapDrawSurface_t *DrawSurfaceForMesh( entity_t *e, parseMesh_t *p, mesh_t *mesh );
|
mapDrawSurface_t *DrawSurfaceForMesh( entity_t *e, parseMesh_t *p, mesh_t *mesh );
|
||||||
mapDrawSurface_t *DrawSurfaceForFlare( int entNum, vec3_t origin, vec3_t normal, vec3_t color, const char *flareShader, int lightStyle );
|
mapDrawSurface_t *DrawSurfaceForFlare( int entNum, vec3_t origin, vec3_t normal, vec3_t color, const char *flareShader, int lightStyle );
|
||||||
mapDrawSurface_t *DrawSurfaceForShader( char *shader );
|
mapDrawSurface_t *DrawSurfaceForShader( const char *shader );
|
||||||
void ClipSidesIntoTree( entity_t *e, tree_t *tree );
|
void ClipSidesIntoTree( entity_t *e, tree_t *tree );
|
||||||
void MakeDebugPortalSurfs( tree_t *tree );
|
void MakeDebugPortalSurfs( tree_t *tree );
|
||||||
void MakeFogHullSurfs( entity_t *e, tree_t *tree, char *shader );
|
void MakeFogHullSurfs( entity_t *e, tree_t *tree, char *shader );
|
||||||
|
|
|
||||||
|
|
@ -1240,11 +1240,11 @@ static void ParseShaderFile( const char *filename ){
|
||||||
|
|
||||||
/* ignore bogus paths */
|
/* ignore bogus paths */
|
||||||
if ( !strEqual( token, "-" ) && !striEqual( token, "full" ) ) {
|
if ( !strEqual( token, "-" ) && !striEqual( token, "full" ) ) {
|
||||||
strcpy( si->skyParmsImageBase, token );
|
si->skyParmsImageBase = token;
|
||||||
|
|
||||||
/* use top image as sky light image */
|
/* use top image as sky light image */
|
||||||
if ( strEmpty( si->lightImagePath ) ) {
|
if ( strEmpty( si->lightImagePath ) ) {
|
||||||
sprintf( si->lightImagePath, "%s_up.tga", si->skyParmsImageBase );
|
sprintf( si->lightImagePath, "%s_up.tga", si->skyParmsImageBase.c_str() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -882,7 +882,6 @@ mapDrawSurface_t *DrawSurfaceForSide( entity_t *e, brush_t *b, side_t *s, windin
|
||||||
bool indexed;
|
bool indexed;
|
||||||
byte shaderIndexes[ 256 ];
|
byte shaderIndexes[ 256 ];
|
||||||
float offsets[ 256 ];
|
float offsets[ 256 ];
|
||||||
char tempShader[ MAX_QPATH ];
|
|
||||||
|
|
||||||
|
|
||||||
/* ydnar: don't make a drawsurf for culled sides */
|
/* ydnar: don't make a drawsurf for culled sides */
|
||||||
|
|
@ -922,18 +921,8 @@ mapDrawSurface_t *DrawSurfaceForSide( entity_t *e, brush_t *b, side_t *s, windin
|
||||||
/* ydnar: sky hack/fix for GL_CLAMP borders on ati cards */
|
/* ydnar: sky hack/fix for GL_CLAMP borders on ati cards */
|
||||||
if ( skyFixHack && !strEmpty( si->skyParmsImageBase ) ) {
|
if ( skyFixHack && !strEmpty( si->skyParmsImageBase ) ) {
|
||||||
//% Sys_FPrintf( SYS_VRB, "Enabling sky hack for shader %s using env %s\n", si->shader, si->skyParmsImageBase );
|
//% Sys_FPrintf( SYS_VRB, "Enabling sky hack for shader %s using env %s\n", si->shader, si->skyParmsImageBase );
|
||||||
sprintf( tempShader, "%s_lf", si->skyParmsImageBase );
|
for( const auto suffix : { "_lf", "_rt", "_ft", "_bk", "_up", "_dn" } )
|
||||||
DrawSurfaceForShader( tempShader );
|
DrawSurfaceForShader( String64()( si->skyParmsImageBase, suffix ) );
|
||||||
sprintf( tempShader, "%s_rt", si->skyParmsImageBase );
|
|
||||||
DrawSurfaceForShader( tempShader );
|
|
||||||
sprintf( tempShader, "%s_ft", si->skyParmsImageBase );
|
|
||||||
DrawSurfaceForShader( tempShader );
|
|
||||||
sprintf( tempShader, "%s_bk", si->skyParmsImageBase );
|
|
||||||
DrawSurfaceForShader( tempShader );
|
|
||||||
sprintf( tempShader, "%s_up", si->skyParmsImageBase );
|
|
||||||
DrawSurfaceForShader( tempShader );
|
|
||||||
sprintf( tempShader, "%s_dn", si->skyParmsImageBase );
|
|
||||||
DrawSurfaceForShader( tempShader );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ydnar: gs mods */
|
/* ydnar: gs mods */
|
||||||
|
|
@ -1284,7 +1273,7 @@ mapDrawSurface_t *DrawSurfaceForFlare( int entNum, vec3_t origin, vec3_t normal,
|
||||||
creates a bogus surface to forcing the game to load a shader
|
creates a bogus surface to forcing the game to load a shader
|
||||||
*/
|
*/
|
||||||
|
|
||||||
mapDrawSurface_t *DrawSurfaceForShader( char *shader ){
|
mapDrawSurface_t *DrawSurfaceForShader( const char *shader ){
|
||||||
int i;
|
int i;
|
||||||
shaderInfo_t *si;
|
shaderInfo_t *si;
|
||||||
mapDrawSurface_t *ds;
|
mapDrawSurface_t *ds;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user