Skip to content

Commit 91d0caa

Browse files
committed
tr_image: do not rely on previously set data for cinematic, numberize and rename as $name
1 parent 01d7e72 commit 91d0caa

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/engine/renderer/tr_image.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2787,9 +2787,14 @@ void R_CreateBuiltinImages()
27872787
imageParams.bits = IF_NOPICMIP;
27882788
imageParams.wrapType = wrapTypeEnum_t::WT_CLAMP;
27892789

2790+
// Don't reuse previously set data, we test the values for selecting the upload format.
2791+
memset( data, 255, sizeof( data ) );
2792+
2793+
size_t numCinematicImages = 0;
27902794
for ( image_t * &image : tr.cinematicImage )
27912795
{
2792-
image = R_CreateImage( "_cinematic", ( const byte ** ) &dataPtr, 1, 1, 1, imageParams );
2796+
std::string name = Str::Format( "$cinematic%d", numCinematicImages++ );
2797+
image = R_CreateImage( name.c_str(), ( const byte ** ) &dataPtr, 1, 1, 1, imageParams );
27932798
}
27942799

27952800
R_CreateFogImage();

0 commit comments

Comments
 (0)