Skip to content

Commit

Permalink
KYRA: Make more static data tables const.
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Schickel committed Nov 19, 2012
1 parent 6437aa2 commit dd551c4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion engines/kyra/chargen.cpp
Expand Up @@ -1206,7 +1206,7 @@ void CharacterGenerator::finish() {
static const int8 itemList1[] = { 1, 2, 0, 17, -1, 0, 0 };
static const int8 itemList2[] = { 2, 56, 1, 17, 31, 0, 1, 23, 1, 17, 31, 0, 1 };
static const int8 itemList3[] = { 2, 1, 1, 17, 31, 1, 1, 1, 0, 17, 31, 2, 1 };
static const int8 *itemList[] = { itemList0, itemList1, itemList2, itemList3 };
static const int8 *const itemList[] = { itemList0, itemList1, itemList2, itemList3 };

for (int i = 0; i < 4; i++) {
EoBCharacter *c = &_characters[i];
Expand Down
8 changes: 4 additions & 4 deletions engines/kyra/darkmoon.h
Expand Up @@ -83,10 +83,10 @@ friend class DarkmoonSequenceHelper;
const DarkMoonAnimCommand **_animFinale;
const DarkMoonShapeDef **_shapesFinale;

static const char *_palFilesIntroVGA[];
static const char *_palFilesIntroEGA[];
static const char *_palFilesFinaleVGA[];
static const char *_palFilesFinaleEGA[];
static const char *const _palFilesIntroVGA[];
static const char *const _palFilesIntroEGA[];
static const char *const _palFilesFinaleVGA[];
static const char *const _palFilesFinaleEGA[];

// Ingame sequence
void seq_nightmare();
Expand Down
2 changes: 1 addition & 1 deletion engines/kyra/scene_eob.cpp
Expand Up @@ -100,7 +100,7 @@ void EoBCoreEngine::loadLevel(int level, int sub) {
void EoBCoreEngine::readLevelFileData(int level) {
Common::String file;
Common::SeekableReadStream *s = 0;
static const char *suffix[] = { "INF", "DRO", "ELO", 0 };
static const char *const suffix[] = { "INF", "DRO", "ELO", 0 };

for (const char *const *sf = suffix; *sf && !s; sf++) {
file = Common::String::format("LEVEL%d.%s", level, *sf);
Expand Down
4 changes: 2 additions & 2 deletions engines/kyra/sequences_hof.cpp
Expand Up @@ -572,8 +572,8 @@ void SeqPlayer_HOF::setupCallbacks() {
#endif
static const SeqProc nestedSeqCallbacksLoLDemo[] = { 0 };

static const SeqProc *seqCallbacks[] = { seqCallbacksHoF, seqCallbacksHoFDemo, seqCallbacksLoLDemo};
static const SeqProc *nestedSeqCallbacks[] = { nestedSeqCallbacksHoF, nestedSeqCallbacksHoFDemo, nestedSeqCallbacksLoLDemo};
static const SeqProc *const seqCallbacks[] = { seqCallbacksHoF, seqCallbacksHoFDemo, seqCallbacksLoLDemo};
static const SeqProc *const nestedSeqCallbacks[] = { nestedSeqCallbacksHoF, nestedSeqCallbacksHoFDemo, nestedSeqCallbacksLoLDemo};

int tmpSize = 0;
delete _config;
Expand Down
18 changes: 9 additions & 9 deletions engines/kyra/staticres_eob.cpp
Expand Up @@ -465,13 +465,13 @@ void EoBCoreEngine::initStaticResource() {
// EOB I doesn't have load and save menus, because there is only one single
// save slot. Instead of emulating this we provide a menu similiar to EOB II.

static const char *saveLoadStrings[3][4] = {
static const char *const saveLoadStrings[3][4] = {
{ "Cancel", "Empty Slot", "Save Game", "Load Game" },
{ "Abbr.", "Leerer Slot", "Speichern", " Laden" },
{ 0, 0, 0, 0 }
};

static const char *errorSlotEmptyString[3] = {
static const char *const errorSlotEmptyString[3] = {
"There is no game\rsaved in that slot!",
"Hier ist noch kein\rSpiel gespeichert!",
0
Expand Down Expand Up @@ -1096,7 +1096,7 @@ void EoBEngine::initStaticResource() {
p->dmgModifierEvade = *ps++;
}

static const char *errorSlotNoNameString[3] = {
static const char *const errorSlotNoNameString[3] = {
" You must specify\r a name for your\r save game!",
" Spielstaende mues-\r sen einen Namen\r haben!",
0
Expand Down Expand Up @@ -1249,7 +1249,7 @@ void DarkMoonEngine::initStaticResource() {
_wallOfForceDsNumH = _staticres->loadRawData(kEoB2WallOfForceNumH, temp);
_wallOfForceShpId = _staticres->loadRawData(kEoB2WallOfForceShpId, temp);

static const char *errorSlotNoNameString[3] = {
static const char *const errorSlotNoNameString[3] = {
" You must specify\r a name for your\r save game!",
" Spielst[nde m]ssen\r einen Namen haben!",
0
Expand All @@ -1258,7 +1258,7 @@ void DarkMoonEngine::initStaticResource() {
_errorSlotNoNameString = errorSlotNoNameString[(_flags.lang == Common::EN_ANY) ? 0 : ((_flags.lang == Common::DE_DEU) ? 1 : 2)];

// ScummVM specific
static const char *transferStringsScummVM[3][5] = {
static const char *const transferStringsScummVM[3][5] = {
{
"\r We cannot find any EOB save game\r file. Please make sure that the\r save game file with the party\r you wish to transfer is located\r in your ScummVM save game\r directory. If you have set up\r multiple save directories you\r have to copy the EOB save file\r into your EOB II save directory.\r Do you wish to try again?",
"Game ID",
Expand Down Expand Up @@ -1300,23 +1300,23 @@ void DarkMoonEngine::initSpells() {
}
}

const char *DarkMoonEngine::_palFilesIntroVGA[] = {
const char *const DarkMoonEngine::_palFilesIntroVGA[] = {
"PALETTE1.PAL",
"PALETTE3.PAL",
"PALETTE2.PAL",
"PALETTE4.PAL",
0
};

const char *DarkMoonEngine::_palFilesIntroEGA[] = {
const char *const DarkMoonEngine::_palFilesIntroEGA[] = {
"PALETTE0.PAL",
"PALETTE3.PAL",
"PALETTE2.PAL",
"PALETTE4.PAL",
0
};

const char *DarkMoonEngine::_palFilesFinaleVGA[] = {
const char *const DarkMoonEngine::_palFilesFinaleVGA[] = {
"FINALE_0.PAL",
"FINALE_0.PAL",
"FINALE_1.PAL",
Expand All @@ -1329,7 +1329,7 @@ const char *DarkMoonEngine::_palFilesFinaleVGA[] = {
0
};

const char *DarkMoonEngine::_palFilesFinaleEGA[] = {
const char *const DarkMoonEngine::_palFilesFinaleEGA[] = {
"FINALE_0.PAL",
"FINALE_0.PAL",
"FINALE_1.PAL",
Expand Down

0 comments on commit dd551c4

Please sign in to comment.