Unifcy a chunk of Hellfire's code pathts

This commit is contained in:
Anders Jenbo 2020-12-28 01:11:25 +01:00
commit d20eddf48e
36 changed files with 10 additions and 367 deletions

View file

@ -19,9 +19,7 @@ int icursW28;
int icursH28;
/** Cursor images CEL */
BYTE *pCursCels;
#ifdef HELLFIRE
BYTE *pCursCels2;
#endif
/** inv_item value */
char pcursinvitem;
@ -68,14 +66,12 @@ const int InvItemWidth[] = {
2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28,
2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28,
2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28,
#ifdef HELLFIRE
1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28,
1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28,
1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28,
2 * 28, 2 * 28, 1 * 28, 1 * 28, 1 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28,
2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28,
2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28
#endif
// clang-format on
};
@ -102,14 +98,12 @@ const int InvItemHeight[] = {
3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28,
3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28,
3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28,
#ifdef HELLFIRE
1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28,
1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28,
1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28, 1 * 28,
2 * 28, 2 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28,
3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28,
3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28
#endif
// clang-format on
};
@ -126,9 +120,7 @@ void InitCursor()
void FreeCursor()
{
MemFreeDbg(pCursCels);
#ifdef HELLFIRE
MemFreeDbg(pCursCels2);
#endif
ClearCursor();
}
@ -427,15 +419,9 @@ void CheckCursMove()
cursmx = mx;
cursmy = my;
}
#ifdef HELLFIRE
if (pcursmonst != -1 && monster[pcursmonst]._mFlags & MFLAG_GOLEM && !(monster[pcursmonst]._mFlags & MFLAG_BERSERK)) {
pcursmonst = -1;
}
#else
if (pcursmonst != -1 && monster[pcursmonst]._mFlags & MFLAG_GOLEM) {
pcursmonst = -1;
}
#endif
if (pcursmonst != -1) {
return;
}
@ -501,15 +487,9 @@ void CheckCursMove()
cursmx = mx;
cursmy = my;
}
#ifdef HELLFIRE
if (pcursmonst != -1 && monster[pcursmonst]._mFlags & MFLAG_GOLEM && !(monster[pcursmonst]._mFlags & MFLAG_BERSERK)) {
pcursmonst = -1;
}
#else
if (pcursmonst != -1 && monster[pcursmonst]._mFlags & MFLAG_GOLEM) {
pcursmonst = -1;
}
#endif
} else {
if (!flipflag && mx + 1 < MAXDUNX && dMonster[mx + 1][my] > 0) {
pcursmonst = dMonster[mx + 1][my] - 1;
@ -677,15 +657,9 @@ void CheckCursMove()
cursmx = mx;
cursmy = my;
}
#ifdef HELLFIRE
if (pcursmonst != -1 && monster[pcursmonst]._mFlags & MFLAG_GOLEM && !(monster[pcursmonst]._mFlags & MFLAG_BERSERK)) {
pcursmonst = -1;
}
#else
if (pcursmonst != -1 && monster[pcursmonst]._mFlags & MFLAG_GOLEM) {
pcursmonst = -1;
}
#endif
}
DEVILUTION_END_NAMESPACE