Skip to content

Commit 9e09abf

Browse files
committed
renderer: simplify builtin color image name parsing, rename as $name, forget about unused aliases
1 parent 0b6351e commit 9e09abf

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

src/engine/renderer/tr_image.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2745,34 +2745,34 @@ void R_CreateBuiltinImages()
27452745
imageParams.filterType = filterType_t::FT_LINEAR;
27462746
imageParams.wrapType = wrapTypeEnum_t::WT_REPEAT;
27472747

2748-
tr.whiteImage = R_CreateImage( "_white", ( const byte ** ) &dataPtr, 1, 1, 1, imageParams );
2748+
tr.whiteImage = R_CreateImage( "$white", ( const byte ** ) &dataPtr, 1, 1, 1, imageParams );
27492749

27502750
// we use a solid black image instead of disabling texturing
27512751
memset( data, 0, sizeof( data ) );
27522752

2753-
tr.blackImage = R_CreateImage( "_black", ( const byte ** ) &dataPtr, 1, 1, 1, imageParams );
2753+
tr.blackImage = R_CreateImage( "$black", ( const byte ** ) &dataPtr, 1, 1, 1, imageParams );
27542754

27552755
// red
27562756
Vector4Set( data, 255, 0, 0, 255 );
27572757

2758-
tr.redImage = R_CreateImage( "_red", ( const byte ** ) &dataPtr, 1, 1, 1, imageParams );
2758+
tr.redImage = R_CreateImage( "$red", ( const byte ** ) &dataPtr, 1, 1, 1, imageParams );
27592759

27602760
// green
27612761
Vector4Set( data, 0, 255, 0, 255 );
27622762

2763-
tr.greenImage = R_CreateImage( "_green", ( const byte ** ) &dataPtr, 1, 1, 1, imageParams );
2763+
tr.greenImage = R_CreateImage( "$green", ( const byte ** ) &dataPtr, 1, 1, 1, imageParams );
27642764

27652765
// blue
27662766
Vector4Set( data, 0, 0, 255, 255 );
27672767

2768-
tr.blueImage = R_CreateImage( "_blue", ( const byte ** ) &dataPtr, 1, 1, 1, imageParams );
2768+
tr.blueImage = R_CreateImage( "$blue", ( const byte ** ) &dataPtr, 1, 1, 1, imageParams );
27692769

27702770
// generate a default normalmap with a fully opaque heightmap (no displacement)
27712771
Vector4Set( data, 128, 128, 255, 255 );
27722772

27732773
imageParams.bits = IF_NOPICMIP | IF_NORMALMAP;
27742774

2775-
tr.flatImage = R_CreateImage( "_flat", ( const byte ** ) &dataPtr, 1, 1, 1, imageParams );
2775+
tr.flatImage = R_CreateImage( "$flat", ( const byte ** ) &dataPtr, 1, 1, 1, imageParams );
27762776

27772777
imageParams.bits = IF_NOPICMIP;
27782778
imageParams.wrapType = wrapTypeEnum_t::WT_CLAMP;

src/engine/renderer/tr_shader.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,24 +1434,19 @@ static bool LoadMap( shaderStage_t *stage, const char *buffer, stageType_t type,
14341434
return true;
14351435
}
14361436

1437-
if ( !Q_stricmp( token, "$whiteimage" ) || !Q_stricmp( token, "$white" ) || !Q_stricmp( token, "_white" ) ||
1438-
!Q_stricmp( token, "*white" ) )
1437+
// Quake III backward compatibility.
1438+
if ( !Q_stricmp( token, "$whiteimage" ) || !Q_stricmp( token, "*white" ) )
14391439
{
14401440
stage->bundle[ bundleIndex ].image[ 0 ] = tr.whiteImage;
14411441
return true;
14421442
}
1443-
else if ( !Q_stricmp( token, "$blackimage" ) || !Q_stricmp( token, "$black" ) || !Q_stricmp( token, "_black" ) ||
1444-
!Q_stricmp( token, "*black" ) )
1443+
1444+
// Old Daemon backward compatibility.
1445+
if ( !Q_stricmp( token, "$blackimage" ) )
14451446
{
14461447
stage->bundle[ bundleIndex ].image[ 0 ] = tr.blackImage;
14471448
return true;
14481449
}
1449-
else if ( !Q_stricmp( token, "$flatimage" ) || !Q_stricmp( token, "$flat" ) || !Q_stricmp( token, "_flat" ) ||
1450-
!Q_stricmp( token, "*flat" ) )
1451-
{
1452-
stage->bundle[ bundleIndex ].image[ 0 ] = tr.flatImage;
1453-
return true;
1454-
}
14551450

14561451
else if ( !Q_stricmp( token, "$lightmap" ) )
14571452
{

0 commit comments

Comments
 (0)