Browse Source

Avoid some arrays being of predefined size

This makes it easier to change the array size via content
pull/691/head
Anders Jenbo 6 years ago
parent
commit
cab3ebddf5
  1. 4
      Source/control.cpp
  2. 2
      Source/spelldat.cpp
  3. 2
      Source/spelldat.h
  4. 92
      Source/trigs.cpp

4
Source/control.cpp

@ -35,7 +35,7 @@ BOOL talkbtndown[3];
int pSpell; int pSpell;
BYTE *pManaBuff; BYTE *pManaBuff;
char infoclr; char infoclr;
int sgbPlrTalkTbl; // should be char [4] int sgbPlrTalkTbl;
BYTE *pGBoxBuff; BYTE *pGBoxBuff;
BYTE *pSBkBtnCel; BYTE *pSBkBtnCel;
char tempstr[256]; char tempstr[256];
@ -152,7 +152,7 @@ const BYTE gbFontTransTbl[256] = {
'A', 'A', 'A', 'A', 'A', 'A', 'A', 'C', 'E', 'E', 'E', 'E', 'I', 'I', 'I', 'I', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'C', 'E', 'E', 'E', 'E', 'I', 'I', 'I', 'I',
'D', 'N', 'O', 'O', 'O', 'O', 'O', 'X', '0', 'U', 'U', 'U', 'U', 'Y', 'b', 'B', 'D', 'N', 'O', 'O', 'O', 'O', 'O', 'X', '0', 'U', 'U', 'U', 'U', 'Y', 'b', 'B',
'a', 'a', 'a', 'a', 'a', 'a', 'a', 'c', 'e', 'e', 'e', 'e', 'i', 'i', 'i', 'i', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'c', 'e', 'e', 'e', 'e', 'i', 'i', 'i', 'i',
'o', 'n', 'o', 'o', 'o', 'o', 'o', '/', '0', 'u', 'u', 'u', 'u', 'y', 'b', 'y' 'o', 'n', 'o', 'o', 'o', 'o', 'o', '/', '0', 'u', 'u', 'u', 'u', 'y', 'b', 'y',
// clang-format on // clang-format on
}; };

2
Source/spelldat.cpp

@ -1,7 +1,7 @@
#include "all.h" #include "all.h"
/** Data related to each spell ID. */ /** Data related to each spell ID. */
SpellData spelldata[MAX_SPELLS] = { SpellData spelldata[] = {
// clang-format off // clang-format off
// sName, sManaCost, sType, sNameText, sSkillText, sBookLvl, sStaffLvl, sTargeted, sTownSpell, sMinInt, sSFX, sMissiles[3], sManaAdj, sMinMana, sStaffMin, sStaffMax, sBookCost, sStaffCost // sName, sManaCost, sType, sNameText, sSkillText, sBookLvl, sStaffLvl, sTargeted, sTownSpell, sMinInt, sSFX, sMissiles[3], sManaAdj, sMinMana, sStaffMin, sStaffMax, sBookCost, sStaffCost
{ SPL_NULL, 0, 0, NULL, NULL, 0, 0, FALSE, FALSE, 0, 0, { 0, 0, 0 }, 0, 0, 40, 80, 0, 0 }, { SPL_NULL, 0, 0, NULL, NULL, 0, 0, FALSE, FALSE, 0, 0, { 0, 0, 0 }, 0, 0, 40, 80, 0, 0 },

2
Source/spelldat.h

@ -2,6 +2,6 @@
#ifndef __SPELLDAT_H__ #ifndef __SPELLDAT_H__
#define __SPELLDAT_H__ #define __SPELLDAT_H__
extern SpellData spelldata[MAX_SPELLS]; extern SpellData spelldata[];
#endif /* __SPELLDAT_H__ */ #endif /* __SPELLDAT_H__ */

92
Source/trigs.cpp

@ -6,84 +6,20 @@ int numtrigs;
TriggerStruct trigs[MAXTRIGGERS]; TriggerStruct trigs[MAXTRIGGERS];
int TWarpFrom; int TWarpFrom;
int TownDownList[11] = { 716, 715, 719, 720, 721, 723, 724, 725, 726, 727, -1 }; int TownDownList[] = { 716, 715, 719, 720, 721, 723, 724, 725, 726, 727, -1 };
int TownWarp1List[13] = { int TownWarp1List[] = { 1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1181, 1183, 1185, -1 };
1171, int L1UpList[] = { 127, 129, 130, 131, 132, 133, 135, 137, 138, 139, 140, -1 };
1172, int L1DownList[] = { 106, 107, 108, 109, 110, 112, 114, 115, 118, -1 };
1173, int L2UpList[] = { 266, 267, -1 };
1174, int L2DownList[] = { 269, 270, 271, 272, -1 };
1175, int L2TWarpUpList[] = { 558, 559, -1 };
1176, int L3UpList[] = { 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, -1 };
1177, int L3DownList[] = { 162, 163, 164, 165, 166, 167, 168, 169, -1 };
1178, int L3TWarpUpList[] = { 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, -1 };
1179, int L4UpList[] = { 82, 83, 90, -1 };
1181, int L4DownList[] = { 120, 130, 131, 132, 133, -1 };
1183, int L4TWarpUpList[] = { 421, 422, 429, -1 };
1185, int L4PentaList[] = { 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, -1 };
-1
};
int L1UpList[12] = { 127, 129, 130, 131, 132, 133, 135, 137, 138, 139, 140, -1 };
int L1DownList[10] = { 106, 107, 108, 109, 110, 112, 114, 115, 118, -1 };
int L2UpList[3] = { 266, 267, -1 };
int L2DownList[5] = { 269, 270, 271, 272, -1 };
int L2TWarpUpList[3] = { 558, 559, -1 };
int L3UpList[15] = {
170,
171,
172,
173,
174,
175,
176,
177,
178,
179,
180,
181,
182,
183,
-1
};
int L3DownList[9] = { 162, 163, 164, 165, 166, 167, 168, 169, -1 };
int L3TWarpUpList[14] = { 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, -1 };
int L4UpList[4] = { 82, 83, 90, -1 };
int L4DownList[6] = { 120, 130, 131, 132, 133, -1 };
int L4TWarpUpList[4] = { 421, 422, 429, -1 };
int L4PentaList[33] = {
353,
354,
355,
356,
357,
358,
359,
360,
361,
362,
363,
364,
365,
366,
367,
368,
369,
370,
371,
372,
373,
374,
375,
376,
377,
378,
379,
380,
381,
382,
383,
384,
-1
};
#ifndef SPAWN #ifndef SPAWN
void InitNoTriggers() void InitNoTriggers()

Loading…
Cancel
Save