Skip to content

Commit f7d9627

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

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
@@ -2815,9 +2815,14 @@ void R_CreateBuiltinImages()
28152815
imageParams.bits = IF_NOPICMIP;
28162816
imageParams.wrapType = wrapTypeEnum_t::WT_CLAMP;
28172817

2818+
// Don't reuse previously set data, we test the values for selecting the upload format.
2819+
memset( data, 255, sizeof( data ) );
2820+
2821+
size_t numCinematicImages = 0;
28182822
for ( image_t * &image : tr.cinematicImage )
28192823
{
2820-
image = R_CreateImage( "_cinematic", ( const byte ** ) &dataPtr, 1, 1, 1, imageParams );
2824+
std::string name = Str::Format( "*cinematic%d", numCinematicImages++ );
2825+
image = R_CreateImage( name.c_str(), ( const byte ** ) &dataPtr, 1, 1, 1, imageParams );
28212826
}
28222827

28232828
R_CreateFogImage();

0 commit comments

Comments
 (0)