- Exhumed: use dynamic arrays for the palette backup in DrawView.

This commit is contained in:
Christoph Oelckers 2021-11-11 23:34:03 +01:00
parent 2e3c212444
commit d70e76e5c6

View file

@ -337,9 +337,10 @@ void DrawView(double smoothRatio, bool sceneonly)
if (nFreeze != 3) if (nFreeze != 3)
{ {
static uint8_t sectorFloorPal[MAXSECTORS]; TArray<uint8_t> paldata(numsectors * 2 + numwalls, true);
static uint8_t sectorCeilingPal[MAXSECTORS]; uint8_t* sectorFloorPal = &paldata[0];
static uint8_t wallPal[MAXWALLS]; uint8_t* sectorCeilingPal = &paldata[numsectors];
uint8_t* wallPal = &paldata[2*numsectors];
int const viewingRange = viewingrange; int const viewingRange = viewingrange;
int const vr = xs_CRoundToInt(65536. * tan(r_fov * (pi::pi() / 360.))); int const vr = xs_CRoundToInt(65536. * tan(r_fov * (pi::pi() / 360.)));