diff options
author | Benjamin Haisch | 2008-05-05 10:45:11 +0000 |
---|---|---|
committer | Benjamin Haisch | 2008-05-05 10:45:11 +0000 |
commit | b6c7385eb4fea90dd315124fe5bffe874430eb48 (patch) | |
tree | 2ac22b5cafe9b9e5bbb7cbf616f0e5c41b34ba64 /engines/made/script.cpp | |
parent | 665caae8b4e06a8a87ab41de0f2361bba4c7cf4f (diff) | |
download | scummvm-rg350-b6c7385eb4fea90dd315124fe5bffe874430eb48.tar.gz scummvm-rg350-b6c7385eb4fea90dd315124fe5bffe874430eb48.tar.bz2 scummvm-rg350-b6c7385eb4fea90dd315124fe5bffe874430eb48.zip |
- Renamed XmidiResource to GenericResource
- Added MIDI resource type
- Added ScriptFunctionsLgop2 and ScriptFunctionsMhne (for Leather Goddesses of Phobos 2 and The Manhole: New and Enhanced, resp.)
- Many changes for LGOP2 and The Manhole: N&E
Note about the new ScriptFunctions classes:
I copied the ScriptFunctionsRtz class and so duplicated a lot of code. Most of the opcode functions are the same in all games but there might be differences. Once all common opcode functions have been figured out, they'll be moved to a common place (like the ScriptFunctions class).
svn-id: r31871
Diffstat (limited to 'engines/made/script.cpp')
-rw-r--r-- | engines/made/script.cpp | 119 |
1 files changed, 12 insertions, 107 deletions
diff --git a/engines/made/script.cpp b/engines/made/script.cpp index ded516c8b8..74dc9e0d9f 100644 --- a/engines/made/script.cpp +++ b/engines/made/script.cpp @@ -33,110 +33,6 @@ namespace Made { - -const char *extendFuncNames[] = { - "SYSTEM", - "INITGRAF", - "RESTOREGRAF", - "DRAWPIC", - "CLS", - "SHOWPAGE", - "EVENT", - "EVENTX", - "EVENTY", - "EVENTKEY", - "VISUALFX", - "PLAYSND", - "PLAYMUS", - "STOPMUS", - "ISMUS", - "TEXTPOS", - "FLASH", - "PLAYNOTE", - "STOPNOTE", - "PLAYTELE", - "STOPTELE", - "HIDECURS", - "SHOWCURS", - "MUSICBEAT", - "SCREENLOCK", - "ADDSPRITE", - "FREEANIM", - "DRAWSPRITE", - "ERASESPRITES", - "UPDATESPRITES", - "GETTIMER", - "SETTIMER", - "RESETTIMER", - "ALLOCTIMER", - "FREETIMER", - "PALETTELOCK", - "FONT", - "DRAWTEXT", - "HOMETEXT", - "TEXTRECT", - "TEXTXY", - "DROPSHADOW", - "TEXTCOLOR", - "OUTLINE", - "LOADCURSOR", - "SETGROUND", - "RESTEXT", - "CLIPAREA", - "SETCLIP", - "ISSND", - "STOPSND", - "PLAYVOICE", - "CDPLAY", - "STOPCD", - "CDSTATUS", - "CDTIME", - "CDPLAYSEG", - "PRINTF", - "MONOCLS", - "SNDENERGY", - "CLEARTEXT", - "ANIMTEXT", - "TEXTWIDTH", - "PLAYMOVIE", - "LOADSND", - "LOADMUS", - "LOADPIC", - "MUSICVOL", - "RESTARTEVENTS", - "PLACESPRITE", - "PLACETEXT", - "DELETECHANNEL", - "CHANNELTYPE", - "SETSTATE", - "SETLOCATION", - "SETCONTENT", - "EXCLUDEAREA", - "SETEXCLUDE", - "GETSTATE", - "PLACEANIM", - "SETFRAME", - "GETFRAME", - "GETFRAMECOUNT", - "PICWIDTH", - "PICHEIGHT", - "SOUNDRATE", - "DRAWANIMPIC", - "LOADANIM", - "READTEXT", - "READMENU", - "DRAWMENU", - "MENUCOUNT", - "SAVEGAME", - "LOADGAME", - "GAMENAME", - "SHAKESCREEN", - "PLACEMENU", - "SETVOLUME", - "WHATSYNTH", - "SLOWSYSTEM" -}; - /* ScriptStack */ ScriptStack::ScriptStack() { @@ -275,8 +171,16 @@ ScriptInterpreter::ScriptInterpreter(MadeEngine *vm) : _vm(vm) { }; _commands = commandProcs; _commandsMax = ARRAYSIZE(commandProcs) + 1; - - _functions = new ScriptFunctionsRtz(_vm); + + if (_vm->getGameID() == GID_RTZ) + _functions = new ScriptFunctionsRtz(_vm); + else if (_vm->getGameID() == GID_LGOP2) + _functions = new ScriptFunctionsLgop2(_vm); + else if (_vm->getGameID() == GID_MANHOLE) + _functions = new ScriptFunctionsMhne(_vm); + else + error("Unsupported GameID"); + _functions->setupExternalsTable(); #undef COMMAND @@ -679,7 +583,8 @@ void ScriptInterpreter::cmd_extend() { byte argc = readByte(); int16 *argv = _stack.getStackPtr(); - debug(4, "func = %d (%s); argc = %d\n", func, extendFuncNames[func], argc); + //debug(4, "func = %d (%s); argc = %d\n", func, extendFuncNames[func], argc); + debug(4, "func = %d; argc = %d\n", func, argc); for (int i = 0; i < argc; i++) debug(4, "argv[%02d] = %04X (%d)\n", i, argv[i], argv[i]); |