/* try to find an existing shader */
for ( i = 0; i < numBSPShaders; i++ )
{
- /* ydnar: handle custom surface/content flags */
+ /* if not Smokin'Guns like tex file */
+ if ( !game->texFile )
+ {
- /* ydnar: handle custom surface/content flags */
- if ( surfaceFlags != NULL && bspShaders[ i ].surfaceFlags != *surfaceFlags ) {
- continue;
- }
- if ( contentFlags != NULL && bspShaders[ i ].contentFlags != *contentFlags ) {
- continue;
++ /* ydnar: handle custom surface/content flags */
+ if ( surfaceFlags != NULL && bspShaders[ i ].surfaceFlags != *surfaceFlags ) {
+ continue;
+ }
+ if ( contentFlags != NULL && bspShaders[ i ].contentFlags != *contentFlags ) {
+ continue;
+ }
++ }
+ if ( !doingBSP ){
+ si = ShaderInfoForShader( shader );
+ if ( si->remapShader && si->remapShader[ 0 ] ) {
+ shader = si->remapShader;
}
}
-
/* compare name */
if ( !Q_stricmp( shader, bspShaders[ i ].shader ) ) {
return i;
numBSPShaders++;
strcpy( bspShaders[ i ].shader, shader );
bspShaders[ i ].surfaceFlags = si->surfaceFlags;
+
+ if ( game->texFile )
+ {
+ /* Smokin'Guns like tex file */
+ bspShaders[ i ].surfaceFlags |= GetSurfaceParm(si->shader);
+ }
+
bspShaders[ i ].contentFlags = si->contentFlags;
- /* handle custom content/surface flags */
- if ( surfaceFlags != NULL ) {
- bspShaders[ i ].surfaceFlags = *surfaceFlags;
- }
- if ( contentFlags != NULL ) {
- bspShaders[ i ].contentFlags = *contentFlags;
- }
+ /* if not Smokin'Guns like tex file */
+ if ( !game->texFile )
+ {
+ /* handle custom content/surface flags */
+ if ( surfaceFlags != NULL ) {
+ bspShaders[ i ].surfaceFlags = *surfaceFlags;
+ }
+ if ( contentFlags != NULL ) {
+ bspShaders[ i ].contentFlags = *contentFlags;
+ }
+ }
/* recursively emit any damage shaders */
if ( si->damageShader != NULL && si->damageShader[ 0 ] != '\0' ) {