Skip to content

Commit 310cb74

Browse files
committed
tr_image: do not rely on previously set data for cinematic, numberize and rename as *name
1 parent a93c99e commit 310cb74

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
@@ -2796,9 +2796,14 @@ void R_CreateBuiltinImages()
27962796
imageParams.bits = IF_NOPICMIP;
27972797
imageParams.wrapType = wrapTypeEnum_t::WT_CLAMP;
27982798

2799+
// Don't reuse previously set data, we test the values for selecting the upload format.
2800+
memset( data, 255, sizeof( data ) );
2801+
2802+
size_t numCinematicImages = 0;
27992803
for ( image_t * &image : tr.cinematicImage )
28002804
{
2801-
image = R_CreateImage( "_cinematic", ( const byte ** ) &dataPtr, 1, 1, 1, imageParams );
2805+
std::string name = Str::Format( "*cinematic%d", numCinematicImages++ );
2806+
image = R_CreateImage( name.c_str(), ( const byte ** ) &dataPtr, 1, 1, 1, imageParams );
28022807
}
28032808

28042809
R_CreateFogImage();

0 commit comments

Comments
 (0)