Fix interpolation bitmap OOB issue

This commit is contained in:
nukeykt 2019-07-24 22:58:45 +09:00 committed by Christoph Oelckers
parent 065cf13945
commit 2762044313
2 changed files with 10 additions and 8 deletions

View file

@ -117,11 +117,13 @@ VIEW predictFifo[256];
int gInterpolate;
int nInterpolations;
char gInterpolateSprite[512];
char gInterpolateWall[1024];
char gInterpolateSector[128];
char gInterpolateSprite[(kMaxSprites+7)>>3];
char gInterpolateWall[(kMaxWalls+7)>>3];
char gInterpolateSector[(kMaxSectors+7)>>3];
INTERPOLATE gInterpolation[4096];
#define kMaxInterpolations 16384
INTERPOLATE gInterpolation[kMaxInterpolations];
int gViewXCenter, gViewYCenter;
int gViewX0, gViewY0, gViewX1, gViewY1;
@ -903,7 +905,7 @@ void viewClearInterpolations(void)
void viewAddInterpolation(void *data, INTERPOLATE_TYPE type)
{
if (nInterpolations == 4096)
if (nInterpolations == kMaxInterpolations)
ThrowError("Too many interpolations");
INTERPOLATE *pInterpolate = &gInterpolation[nInterpolations++];
pInterpolate->pointer = data;

View file

@ -84,9 +84,9 @@ extern int gScreenTilt;
extern int deliriumTilt, deliriumTurn, deliriumPitch;
extern int gScreenTiltO, deliriumTurnO, deliriumPitchO;
extern int gShowFrameRate;
extern char gInterpolateSprite[512];
extern char gInterpolateWall[1024];
extern char gInterpolateSector[128];
extern char gInterpolateSprite[];
extern char gInterpolateWall[];
extern char gInterpolateSector[];
extern LOCATION gPrevSpriteLoc[kMaxSprites];
extern int gViewSize;
extern CGameMessageMgr gGameMessageMgr;