♻️ Store CEL width with the sprite itself

Instead of passing the CEL sprite width when drawing, store the CEL
width at load time in the new `CelSprite` struct.

Implemented for most sprites except towners, missiles, or monsters.
This commit is contained in:
Gleb Mazovetskiy 2021-05-01 17:05:55 +01:00 committed by Anders Jenbo
commit 1b8b62a8c2
41 changed files with 746 additions and 713 deletions

View file

@ -19,19 +19,19 @@ int seed_index;
int level_seeds[NUMLEVELS + 1];
int seed_table[DEBUGSEEDS];
BYTE *pSquareCel;
std::optional<CelSprite> pSquareCel;
char dMonsDbg[NUMLEVELS][MAXDUNX][MAXDUNY];
char dFlagDbg[NUMLEVELS][MAXDUNX][MAXDUNY];
void LoadDebugGFX()
{
if (visiondebug)
pSquareCel = LoadFileInMem("Data\\Square.CEL", nullptr);
pSquareCel = LoadCel("Data\\Square.CEL", 64);
}
void FreeDebugGFX()
{
MemFreeDbg(pSquareCel);
pSquareCel = std::nullopt;
}
void CheckDungeonClear()