Skip to content

Commit ebaf453

Browse files
committed
renderer: simplify builtin color image name parsing, rename as $name, forget about unused aliases
1 parent f243bf9 commit ebaf453

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
@@ -2736,34 +2736,34 @@ void R_CreateBuiltinImages()
27362736
imageParams.filterType = filterType_t::FT_LINEAR;
27372737
imageParams.wrapType = wrapTypeEnum_t::WT_REPEAT;
27382738

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

27412741
// we use a solid black image instead of disabling texturing
27422742
memset( data, 0, sizeof( data ) );
27432743

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

27462746
// red
27472747
Vector4Set( data, 255, 0, 0, 255 );
27482748

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

27512751
// green
27522752
Vector4Set( data, 0, 255, 0, 255 );
27532753

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

27562756
// blue
27572757
Vector4Set( data, 0, 0, 255, 255 );
27582758

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

27612761
// generate a default normalmap with a fully opaque heightmap (no displacement)
27622762
Vector4Set( data, 128, 128, 255, 255 );
27632763

27642764
imageParams.bits = IF_NOPICMIP | IF_NORMALMAP;
27652765

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

27682768
imageParams.bits = IF_NOPICMIP;
27692769
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)