2009-07-11 06:33:19 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
// We place selector vocab name tables here for any game that doesn't have
|
|
|
|
// them. This includes the King's Quest IV Demo and LSL3 Demo.
|
|
|
|
|
|
|
|
#include "sci/engine/kernel.h"
|
|
|
|
|
|
|
|
namespace Sci {
|
|
|
|
|
|
|
|
struct SelectorRemap {
|
|
|
|
const char *name;
|
|
|
|
uint32 slot;
|
|
|
|
};
|
2009-08-28 14:33:26 +00:00
|
|
|
|
|
|
|
const int handleIndex = 41;
|
|
|
|
const int canBeHereIndex = 54;
|
|
|
|
|
2009-08-29 06:03:56 +00:00
|
|
|
static const char * const selectorNamesFirstPart[] = {
|
|
|
|
"y", "x", "view", "loop", "cel", // 0 - 4
|
|
|
|
"underBits", "nsTop", "nsLeft", "nsBottom", "nsRight", // 5 - 9
|
|
|
|
"lsTop", "lsLeft", "lsBottom", "lsRight", "signal", // 10 - 14
|
|
|
|
"illegalBits", "brTop", "brLeft", "brBottom", "brRight", // 15 - 19
|
|
|
|
"name", "key", "time", "text", "elements", // 20 - 25
|
|
|
|
"color", "back", "mode", "style", "state", // 25 - 29
|
|
|
|
"font", "type", "window", "cursor", "max", // 30 - 34
|
2009-08-28 14:33:26 +00:00
|
|
|
"mark", "who", "message", "edit", "play", // 35 - 39
|
2009-08-30 15:08:27 +00:00
|
|
|
"number", "handle", "client", "dx", "dy", // 40 - 44
|
2009-08-28 14:33:26 +00:00
|
|
|
"b-moveCnt", "b-i1", "b-i2", "b-di", "b-xAxis", // 45 - 49
|
|
|
|
"b-incr", "xStep", "yStep", "moveSpeed", "canBeHere", // 50 - 54
|
|
|
|
"heading", "mover", "doit", "isBlocked", "looper", // 55 - 59
|
|
|
|
"priority", "modifiers", "replay", "setPri", "at", // 60 - 64
|
|
|
|
"next", "done", "width", "wordFail", "syntaxFail", // 65 - 69
|
|
|
|
"semanticFail", "pragmaFail", "said", "claimed", "value", // 70 - 74
|
|
|
|
"save", "restore", "title", "button", "icon", // 75 - 79
|
|
|
|
"draw", "delete", "z" // 80 - 82
|
|
|
|
};
|
|
|
|
|
|
|
|
void createFirstPart(Common::StringList &names, int offset, bool hasCantBeHere, bool hasNodePtr) {
|
|
|
|
int count = ARRAYSIZE(selectorNamesFirstPart) + offset;
|
|
|
|
int i;
|
|
|
|
names.resize(count);
|
|
|
|
|
|
|
|
for (i = 0; i < offset; i++)
|
2009-08-29 06:04:21 +00:00
|
|
|
names[i].clear();
|
2009-08-28 14:33:26 +00:00
|
|
|
|
|
|
|
for (i = offset; i < count; i++) {
|
|
|
|
names[i] = selectorNamesFirstPart[i - offset];
|
|
|
|
if (hasNodePtr && i == handleIndex + offset)
|
|
|
|
names[i] = "nodePtr";
|
|
|
|
if (hasCantBeHere && i == canBeHereIndex + offset)
|
|
|
|
names[i] = "cantBeHere";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-07-11 06:33:19 +00:00
|
|
|
// Taken from King's Quest IV (Full Game)
|
2009-08-28 14:33:26 +00:00
|
|
|
// offset: 3, hascantbehere: false, hasNodePtr: false
|
2009-07-11 06:33:19 +00:00
|
|
|
static const SelectorRemap kq4_demo_selectors[] = {
|
2009-08-28 14:33:26 +00:00
|
|
|
{ "init", 87 }, { "dispose", 88 }, { "size", 96 },
|
|
|
|
{ "caller", 119 }, { "cue", 121 }, { "owner", 130 },
|
|
|
|
{ "completed", 158 }, { "motionCue", 161 }, { "cycler", 165 },
|
2009-08-31 20:21:52 +00:00
|
|
|
{ "moveDone", 169 }, { "setCursor", 253 }
|
2009-07-11 06:33:19 +00:00
|
|
|
};
|
2009-08-28 14:33:26 +00:00
|
|
|
|
|
|
|
// Taken from Codename: Iceman (Full Game)
|
|
|
|
// offset: 3, hascantbehere: false, hasNodePtr: false
|
|
|
|
static const SelectorRemap iceman_demo_selectors[] = {
|
|
|
|
{ "init", 87 }, { "dispose", 88 }, { "size", 96 },
|
|
|
|
{ "caller", 119 }, { "cue", 121 }, { "owner", 130 },
|
|
|
|
{ "completed", 159 }, { "motionCue", 162 }, { "cycler", 164 },
|
2009-08-31 20:21:52 +00:00
|
|
|
{ "moveDone", 170 }, { "distance", 173 }, { "setCursor", 254 },
|
2009-08-28 14:33:26 +00:00
|
|
|
{ "points", 316 }, { "flags", 368 }
|
|
|
|
};
|
|
|
|
|
2009-07-11 06:33:19 +00:00
|
|
|
// Taken from Leisure Suit Larry 1 VGA (Full Game)
|
2009-08-28 14:33:26 +00:00
|
|
|
// offset: 3, hascantbehere: true, hasNodePtr: true
|
2009-07-11 06:33:19 +00:00
|
|
|
static const SelectorRemap lsl1_demo_selectors[] = {
|
2009-08-28 14:33:26 +00:00
|
|
|
{ "parseLang", 86 }, { "printLang", 87 }, { "subtitleLang", 88 },
|
|
|
|
{ "size", 89 }, { "points", 90 }, { "palette", 91 },
|
|
|
|
{ "dataInc", 92 }, { "handle", 93 }, { "min", 94 },
|
|
|
|
{ "sec", 95 }, { "frame", 96 }, { "vol", 97 },
|
|
|
|
{ "pri", 98 }, { "moveDone", 100 }, { "flags", 102 },
|
|
|
|
{ "init", 104 }, { "dispose", 105 }, { "caller", 134 },
|
|
|
|
{ "cue", 136 }, { "owner", 150 }, { "setVol", 156 },
|
2009-08-31 20:21:52 +00:00
|
|
|
{ "setCursor", 183 }, { "completed", 210 }, { "cycler", 215 },
|
|
|
|
{ "distance", 224 }, { "canBeHere", 232 }, { "syncTime", 247 },
|
|
|
|
{ "syncCue", 248 }
|
2009-07-11 06:33:19 +00:00
|
|
|
};
|
|
|
|
|
2009-08-31 20:21:52 +00:00
|
|
|
// Taken from KQ6 floppy
|
|
|
|
// offset: 0, hascantbehere: true, hasNodePtr: true
|
|
|
|
static const SelectorRemap christmas1992_selectors[] = {
|
|
|
|
{ "parseLang", 83 }, { "printLang", 84 }, { "subtitleLang", 85 },
|
|
|
|
{ "size", 86 }, { "points", 87 }, { "palette", 88 },
|
|
|
|
{ "dataInc", 89 }, { "handle", 90 }, { "min", 91 },
|
|
|
|
{ "sec", 92 }, { "frame", 93 }, { "vol", 94 },
|
|
|
|
{ "pri", 95 }, { "moveDone", 97 }, { "flags", 99 },
|
|
|
|
{ "init", 110 }, { "dispose", 111 }, { "caller", 143 },
|
|
|
|
{ "cue", 145 }, { "owner", 166 }, { "setVol", 172 },
|
|
|
|
{ "setCursor", 197 }, { "completed", 242 }, { "cycler", 247 },
|
|
|
|
{ "distance", 256 }, { "canBeHere", 264 }, { "syncTime", 279 },
|
|
|
|
{ "syncCue", 280 }
|
2009-08-20 18:25:55 +00:00
|
|
|
};
|
|
|
|
|
2009-07-11 06:33:19 +00:00
|
|
|
// A macro for loading one of the above tables in the function below
|
|
|
|
#define USE_SELECTOR_TABLE(x) \
|
2009-08-28 14:33:26 +00:00
|
|
|
for (uint32 i = 0; i < ARRAYSIZE(x); i++) { \
|
|
|
|
if (x[i].slot >= names.size()) \
|
|
|
|
names.resize(x[i].slot + 1); \
|
|
|
|
names[x[i].slot] = x[i].name; \
|
|
|
|
}
|
2009-07-11 06:33:19 +00:00
|
|
|
|
|
|
|
Common::StringList Kernel::checkStaticSelectorNames() {
|
|
|
|
Common::StringList names;
|
2009-08-23 21:57:30 +00:00
|
|
|
if (!g_engine)
|
|
|
|
return names;
|
|
|
|
|
|
|
|
Common::String gameID = ((SciEngine*)g_engine)->getGameID();
|
|
|
|
|
2009-08-28 14:33:26 +00:00
|
|
|
if (gameID == "kq4sci") {
|
|
|
|
createFirstPart(names, 3, false, false);
|
2009-07-11 06:33:19 +00:00
|
|
|
USE_SELECTOR_TABLE(kq4_demo_selectors);
|
2009-08-28 14:33:26 +00:00
|
|
|
} else if (gameID == "lsl3" || gameID == "iceman") { // identical, except iceman has "flags"
|
|
|
|
createFirstPart(names, 3, false, false);
|
2009-07-11 06:33:19 +00:00
|
|
|
USE_SELECTOR_TABLE(iceman_demo_selectors);
|
2009-08-31 20:21:52 +00:00
|
|
|
} else if (gameID == "christmas1992" || gameID == "laurabow2") {
|
2009-08-28 14:33:26 +00:00
|
|
|
createFirstPart(names, 0, true, true);
|
2009-07-11 06:33:19 +00:00
|
|
|
USE_SELECTOR_TABLE(christmas1992_selectors);
|
2009-08-31 20:21:52 +00:00
|
|
|
} else if (gameID == "lsl1sci" || gameID == "lsl5") {
|
2009-08-28 14:33:26 +00:00
|
|
|
createFirstPart(names, 3, true, true);
|
2009-07-11 06:33:19 +00:00
|
|
|
USE_SELECTOR_TABLE(lsl1_demo_selectors);
|
2009-08-28 14:33:26 +00:00
|
|
|
}
|
|
|
|
|
2009-07-11 06:33:19 +00:00
|
|
|
return names;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // End of namespace Sci
|