2004-04-09 12:36:06 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
2006-01-18 17:39:49 +00:00
|
|
|
* Copyright (C) 2004-2006 The ScummVM project
|
2004-04-09 12:36:06 +00:00
|
|
|
*
|
|
|
|
* 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
|
2005-01-09 16:06:29 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2004-04-09 12:36:06 +00:00
|
|
|
* 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
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2004-04-09 12:36:06 +00:00
|
|
|
*
|
2006-02-09 12:19:53 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2004-04-09 12:36:06 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KYRA_H
|
|
|
|
#define KYRA_H
|
|
|
|
|
|
|
|
#include "base/engine.h"
|
2005-10-05 16:40:51 +00:00
|
|
|
#include "common/rect.h"
|
2005-10-12 19:15:32 +00:00
|
|
|
|
2005-08-19 22:12:09 +00:00
|
|
|
namespace Kyra {
|
|
|
|
|
2006-01-22 09:34:12 +00:00
|
|
|
class Movie;
|
|
|
|
class Sound;
|
2006-05-17 18:07:02 +00:00
|
|
|
class SoundDigital;
|
2006-01-22 09:34:12 +00:00
|
|
|
class SeqPlayer;
|
|
|
|
class Resource;
|
|
|
|
class PAKFile;
|
|
|
|
class Screen;
|
|
|
|
class Sprites;
|
|
|
|
class ScriptHelper;
|
|
|
|
class Debugger;
|
|
|
|
class ScreenAnimator;
|
|
|
|
class TextDisplayer;
|
|
|
|
class KyraEngine;
|
2006-03-18 14:43:18 +00:00
|
|
|
class StaticResource;
|
2006-01-22 09:34:12 +00:00
|
|
|
|
|
|
|
struct ScriptState;
|
|
|
|
struct ScriptData;
|
|
|
|
|
2004-10-15 06:06:47 +00:00
|
|
|
enum {
|
2005-10-18 19:59:51 +00:00
|
|
|
GF_FLOPPY = 1 << 0,
|
|
|
|
GF_TALKIE = 1 << 1,
|
|
|
|
GF_AUDIOCD = 1 << 2, // FM-Towns versions seems to use audio CD
|
|
|
|
GF_DEMO = 1 << 3,
|
|
|
|
GF_ENGLISH = 1 << 4,
|
|
|
|
GF_FRENCH = 1 << 5,
|
|
|
|
GF_GERMAN = 1 << 6,
|
|
|
|
GF_SPANISH = 1 << 7,
|
2006-05-04 11:19:48 +00:00
|
|
|
GF_ITALIAN = 1 << 8,
|
2005-10-18 19:59:51 +00:00
|
|
|
// other languages here
|
2006-05-12 23:57:53 +00:00
|
|
|
GF_LNGUNK = 1 << 16, // also used for multi language in kyra3
|
2006-03-14 19:48:08 +00:00
|
|
|
GF_AMIGA = 1 << 17 // this is no special version flag yet!
|
2004-11-11 13:37:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
2006-05-01 00:25:41 +00:00
|
|
|
GI_KYRA1 = 0,
|
2006-05-12 23:57:53 +00:00
|
|
|
GI_KYRA2 = 1,
|
|
|
|
GI_KYRA3 = 2
|
2004-10-15 06:06:47 +00:00
|
|
|
};
|
|
|
|
|
2006-02-14 01:19:30 +00:00
|
|
|
// TODO: this is just the start of makeing the debug output of the kyra engine a bit more useable
|
|
|
|
// in the future we maybe merge some flags and/or create new ones
|
|
|
|
enum kDebugLevels {
|
|
|
|
kDebugLevelScriptFuncs = 1 << 0, // prints debug output of cmd_* functions
|
|
|
|
kDebugLevelScript = 1 << 1, // prints debug output of "ScriptHelper" functions
|
|
|
|
kDebugLevelSprites = 1 << 2, // prints debug output of "Sprites" functions
|
|
|
|
kDebugLevelScreen = 1 << 3, // prints debug output of "Screen" functions
|
|
|
|
kDebugLevelSound = 1 << 4, // prints debug output of "Sound" functions
|
|
|
|
kDebugLevelAnimator = 1 << 5, // prints debug output of "ScreenAnimator" functions
|
|
|
|
kDebugLevelMain = 1 << 6, // prints debug output of common "KyraEngine*" functions && "TextDisplayer" functions
|
|
|
|
kDebugLevelGUI = 1 << 7, // prints debug output of "KyraEngine*" gui functions
|
|
|
|
kDebugLevelSequence = 1 << 8, // prints debug output of "SeqPlayer" functions
|
|
|
|
kDebugLevelMovie = 1 << 9 // prints debug output of movie specific funtions
|
|
|
|
};
|
|
|
|
|
2005-09-09 21:13:43 +00:00
|
|
|
struct Character {
|
|
|
|
uint16 sceneId;
|
|
|
|
uint8 height;
|
|
|
|
uint8 facing;
|
|
|
|
uint16 currentAnimFrame;
|
|
|
|
uint8 inventoryItems[10];
|
|
|
|
int16 x1, y1, x2, y2;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Shape {
|
2005-10-29 18:37:40 +00:00
|
|
|
uint8 imageIndex;
|
|
|
|
int8 xOffset, yOffset;
|
2005-09-09 21:13:43 +00:00
|
|
|
uint8 x, y, w, h;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Room {
|
2005-10-29 18:37:40 +00:00
|
|
|
uint8 nameIndex;
|
2005-09-10 00:15:40 +00:00
|
|
|
uint16 northExit;
|
|
|
|
uint16 eastExit;
|
|
|
|
uint16 southExit;
|
|
|
|
uint16 westExit;
|
|
|
|
uint8 itemsTable[12];
|
2005-10-29 18:37:40 +00:00
|
|
|
uint16 itemsXPos[12];
|
|
|
|
uint8 itemsYPos[12];
|
2006-01-03 23:41:52 +00:00
|
|
|
uint8 needInit[12];
|
2005-10-03 20:21:18 +00:00
|
|
|
};
|
|
|
|
|
2005-10-29 18:37:40 +00:00
|
|
|
struct Rect {
|
2005-10-03 20:21:18 +00:00
|
|
|
int x, y;
|
2005-10-29 18:37:40 +00:00
|
|
|
int x2, y2;
|
2005-09-09 21:13:43 +00:00
|
|
|
};
|
|
|
|
|
2005-10-29 18:37:40 +00:00
|
|
|
struct Item {
|
|
|
|
uint8 unk1;
|
|
|
|
uint8 height;
|
|
|
|
uint8 unk2;
|
|
|
|
uint8 unk3;
|
|
|
|
};
|
|
|
|
|
2005-08-19 22:12:09 +00:00
|
|
|
struct SeqLoop {
|
|
|
|
const uint8 *ptr;
|
|
|
|
uint16 count;
|
|
|
|
};
|
|
|
|
|
2005-10-29 18:37:40 +00:00
|
|
|
struct SceneExits {
|
2005-11-09 22:26:12 +00:00
|
|
|
uint16 northXPos;
|
|
|
|
uint8 northYPos;
|
|
|
|
uint16 eastXPos;
|
|
|
|
uint8 eastYPos;
|
|
|
|
uint16 southXPos;
|
|
|
|
uint8 southYPos;
|
|
|
|
uint16 westXPos;
|
|
|
|
uint8 westYPos;
|
2005-10-29 18:37:40 +00:00
|
|
|
};
|
|
|
|
|
2006-01-06 10:45:42 +00:00
|
|
|
struct BeadState {
|
|
|
|
int16 x;
|
|
|
|
int16 y;
|
|
|
|
int16 width;
|
|
|
|
int16 height;
|
|
|
|
int16 dstX;
|
|
|
|
int16 dstY;
|
|
|
|
int16 width2;
|
|
|
|
int16 unk8;
|
|
|
|
int16 unk9;
|
|
|
|
int16 tableIndex;
|
|
|
|
};
|
|
|
|
|
2005-11-11 22:17:06 +00:00
|
|
|
struct Timer {
|
2006-01-03 23:41:52 +00:00
|
|
|
uint8 active;
|
2005-12-09 14:52:31 +00:00
|
|
|
int32 countdown;
|
2005-11-11 22:17:06 +00:00
|
|
|
uint32 nextRun;
|
|
|
|
void (KyraEngine::*func)(int timerNum);
|
|
|
|
};
|
2004-04-09 12:36:06 +00:00
|
|
|
|
2005-12-24 18:00:35 +00:00
|
|
|
struct Button {
|
|
|
|
Button *nextButton;
|
|
|
|
uint16 specialValue;
|
|
|
|
// uint8 unk[4];
|
|
|
|
uint8 process0;
|
|
|
|
uint8 process1;
|
|
|
|
uint8 process2;
|
|
|
|
// uint8 unk
|
|
|
|
uint16 flags;
|
2006-03-15 13:32:35 +00:00
|
|
|
typedef int (KyraEngine::*ButtonCallback)(Button*);
|
2005-12-24 18:00:35 +00:00
|
|
|
// using 6 pointers instead of 3 as in the orignal here (safer for use with classes)
|
|
|
|
uint8 *process0PtrShape;
|
|
|
|
uint8 *process1PtrShape;
|
|
|
|
uint8 *process2PtrShape;
|
|
|
|
ButtonCallback process0PtrCallback;
|
|
|
|
ButtonCallback process1PtrCallback;
|
|
|
|
ButtonCallback process2PtrCallback;
|
|
|
|
uint16 dimTableIndex;
|
|
|
|
uint16 x;
|
|
|
|
uint16 y;
|
|
|
|
uint16 width;
|
|
|
|
uint16 height;
|
|
|
|
// uint8 unk[8];
|
|
|
|
uint32 flags2;
|
|
|
|
ButtonCallback buttonCallback;
|
|
|
|
// uint8 unk[8];
|
|
|
|
};
|
|
|
|
|
2006-01-22 09:34:12 +00:00
|
|
|
struct MenuItem {
|
|
|
|
bool enabled;
|
|
|
|
uint16 field_1;
|
|
|
|
uint8 field_3;
|
|
|
|
const char *itemString;
|
|
|
|
int16 x;
|
2006-01-22 16:48:13 +00:00
|
|
|
int16 field_9;
|
2006-01-22 09:34:12 +00:00
|
|
|
uint16 y;
|
|
|
|
uint16 width;
|
|
|
|
uint16 height;
|
|
|
|
uint8 textColor;
|
|
|
|
uint8 highlightColor;
|
2006-01-22 16:48:13 +00:00
|
|
|
int16 field_12;
|
2006-01-22 09:34:12 +00:00
|
|
|
uint8 field_13;
|
|
|
|
uint8 bgcolor;
|
|
|
|
uint8 color1;
|
|
|
|
uint8 color2;
|
|
|
|
int (KyraEngine::*callback)(Button*);
|
|
|
|
int16 field_1b;
|
|
|
|
const char *labelString;
|
2006-03-08 13:15:13 +00:00
|
|
|
uint16 labelX;
|
|
|
|
uint8 labelY;
|
2006-01-22 09:34:12 +00:00
|
|
|
uint8 field_24;
|
|
|
|
uint32 field_25;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Menu {
|
|
|
|
int16 x;
|
|
|
|
int16 y;
|
|
|
|
uint16 width;
|
|
|
|
uint16 height;
|
|
|
|
uint8 bgcolor;
|
|
|
|
uint8 color1;
|
|
|
|
uint8 color2;
|
|
|
|
const char *menuName;
|
|
|
|
uint8 textColor;
|
|
|
|
int16 field_10;
|
|
|
|
uint16 field_12;
|
2006-01-22 22:06:34 +00:00
|
|
|
uint16 highlightedItem;
|
2006-01-22 09:34:12 +00:00
|
|
|
uint8 nrOfItems;
|
|
|
|
int16 scrollUpBtnX;
|
|
|
|
int16 scrollUpBtnY;
|
|
|
|
int16 scrollDownBtnX;
|
|
|
|
int16 scrollDownBtnY;
|
|
|
|
MenuItem item[6];
|
|
|
|
};
|
|
|
|
|
2006-01-27 08:23:53 +00:00
|
|
|
struct KeyboardEvent {
|
|
|
|
bool pending;
|
|
|
|
uint32 repeat;
|
|
|
|
uint8 ascii;
|
|
|
|
};
|
|
|
|
|
2004-04-09 12:36:06 +00:00
|
|
|
class KyraEngine : public Engine {
|
2005-09-11 14:35:34 +00:00
|
|
|
friend class MusicPlayer;
|
2005-12-09 14:52:31 +00:00
|
|
|
friend class Debugger;
|
2006-01-02 22:58:59 +00:00
|
|
|
friend class ScreenAnimator;
|
2004-10-15 06:06:47 +00:00
|
|
|
public:
|
2004-04-09 12:36:06 +00:00
|
|
|
|
2005-09-11 14:35:34 +00:00
|
|
|
enum {
|
|
|
|
MUSIC_INTRO = 0
|
|
|
|
};
|
2005-09-08 19:09:52 +00:00
|
|
|
|
2006-04-15 20:36:41 +00:00
|
|
|
KyraEngine(OSystem *system);
|
2005-08-19 22:12:09 +00:00
|
|
|
~KyraEngine();
|
2006-05-03 13:40:21 +00:00
|
|
|
|
|
|
|
virtual int setupGameFlags() = 0;
|
2005-08-19 22:12:09 +00:00
|
|
|
|
|
|
|
void errorString(const char *buf_input, char *buf_output);
|
2004-10-15 06:06:47 +00:00
|
|
|
|
2005-08-19 22:12:09 +00:00
|
|
|
Resource *resource() { return _res; }
|
|
|
|
Screen *screen() { return _screen; }
|
2006-01-02 22:58:59 +00:00
|
|
|
ScreenAnimator *animator() { return _animator; }
|
|
|
|
TextDisplayer *text() { return _text; }
|
2006-01-13 23:06:04 +00:00
|
|
|
Sound *sound() { return _sound; }
|
2006-03-18 14:43:18 +00:00
|
|
|
StaticResource *staticres() { return _staticres; }
|
2006-01-03 19:03:09 +00:00
|
|
|
uint32 tickLength() const { return _tickLength; }
|
2006-05-16 16:04:24 +00:00
|
|
|
virtual Movie *createWSAMovie();
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2005-08-19 22:12:09 +00:00
|
|
|
uint8 game() const { return _game; }
|
2005-10-13 21:12:47 +00:00
|
|
|
uint32 features() const { return _features; }
|
2006-02-09 07:37:19 +00:00
|
|
|
|
|
|
|
uint8 **shapes() { return _shapes; }
|
2006-02-11 08:31:13 +00:00
|
|
|
Character *currentCharacter() { return _currentCharacter; }
|
|
|
|
Character *characterList() { return _characterList; }
|
|
|
|
uint16 brandonStatus() { return _brandonStatusBit; }
|
2004-10-15 06:06:47 +00:00
|
|
|
|
2005-12-10 15:52:38 +00:00
|
|
|
int _paletteChanged;
|
2006-02-11 08:31:13 +00:00
|
|
|
Common::RandomSource _rnd;
|
|
|
|
int16 _northExitHeight;
|
2005-11-10 14:08:50 +00:00
|
|
|
|
2005-09-08 19:09:52 +00:00
|
|
|
typedef void (KyraEngine::*IntroProc)();
|
2005-10-29 18:37:40 +00:00
|
|
|
typedef int (KyraEngine::*OpcodeProc)(ScriptState *script);
|
2005-09-08 19:09:52 +00:00
|
|
|
|
2006-04-09 00:44:08 +00:00
|
|
|
const char * const*seqWSATable() { return _seq_WSATable; }
|
|
|
|
const char * const*seqCPSTable() { return _seq_CPSTable; }
|
|
|
|
const char * const*seqCOLTable() { return _seq_COLTable; }
|
|
|
|
const char * const*seqTextsTable() { return _seq_textsTable; }
|
2005-12-22 18:14:52 +00:00
|
|
|
|
2006-04-09 00:44:08 +00:00
|
|
|
const uint8 * const*palTable1() { return &_specialPalettes[0]; }
|
|
|
|
const uint8 * const*palTable2() { return &_specialPalettes[29]; }
|
2005-10-06 11:57:02 +00:00
|
|
|
|
|
|
|
bool seq_skipSequence() const;
|
2006-05-08 15:40:30 +00:00
|
|
|
void delayUntil(uint32 timestamp, bool updateGameTimers = false, bool update = false, bool isMainLoop = false);
|
|
|
|
void delay(uint32 millis, bool update = false, bool isMainLoop = false);
|
2005-11-10 14:08:50 +00:00
|
|
|
void quitGame();
|
2005-10-06 11:57:02 +00:00
|
|
|
void loadBitmap(const char *filename, int tempPage, int dstPage, uint8 *palData);
|
|
|
|
|
|
|
|
void snd_playTheme(int file, int track = 0);
|
2005-10-12 19:15:32 +00:00
|
|
|
void snd_playVoiceFile(int id);
|
2006-01-13 23:06:04 +00:00
|
|
|
void snd_voiceWaitForFinish(bool ingame = true);
|
2005-11-10 14:08:50 +00:00
|
|
|
void snd_playSoundEffect(int track);
|
2006-01-12 14:53:23 +00:00
|
|
|
void snd_playWanderScoreViaMap(int command, int restart);
|
2005-10-06 11:57:02 +00:00
|
|
|
|
2006-03-18 14:43:18 +00:00
|
|
|
void drawSentenceCommand(const char *sentence, int unk1);
|
|
|
|
void updateSentenceCommand(const char *str1, const char *str2, int unk1);
|
2005-12-09 14:52:31 +00:00
|
|
|
void updateTextFade();
|
2005-10-06 11:57:02 +00:00
|
|
|
|
2005-11-11 22:17:06 +00:00
|
|
|
void updateGameTimers();
|
|
|
|
void clearNextEventTickCount();
|
2005-12-09 14:52:31 +00:00
|
|
|
void setTimerCountdown(uint8 timer, int32 countdown);
|
2005-12-09 23:48:52 +00:00
|
|
|
void setTimerDelay(uint8 timer, int32 countdown);
|
2005-11-11 22:17:06 +00:00
|
|
|
int16 getTimerDelay(uint8 timer);
|
|
|
|
void enableTimer(uint8 timer);
|
|
|
|
void disableTimer(uint8 timer);
|
|
|
|
|
2005-12-24 18:00:35 +00:00
|
|
|
void delayWithTicks(int ticks);
|
2005-10-22 00:24:07 +00:00
|
|
|
|
2005-12-10 17:51:40 +00:00
|
|
|
void saveGame(const char *fileName, const char *saveName);
|
|
|
|
void loadGame(const char *fileName);
|
|
|
|
|
2005-10-22 00:24:07 +00:00
|
|
|
int mouseX() { return _mouseX; }
|
|
|
|
int mouseY() { return _mouseY; }
|
2005-10-29 18:37:40 +00:00
|
|
|
|
|
|
|
// all opcode procs (maybe that is somehow useless atm)
|
|
|
|
int cmd_magicInMouseItem(ScriptState *script);
|
|
|
|
int cmd_characterSays(ScriptState *script);
|
|
|
|
int cmd_pauseTicks(ScriptState *script);
|
|
|
|
int cmd_drawSceneAnimShape(ScriptState *script);
|
|
|
|
int cmd_queryGameFlag(ScriptState *script);
|
|
|
|
int cmd_setGameFlag(ScriptState *script);
|
|
|
|
int cmd_resetGameFlag(ScriptState *script);
|
|
|
|
int cmd_runNPCScript(ScriptState *script);
|
|
|
|
int cmd_setSpecialExitList(ScriptState *script);
|
|
|
|
int cmd_blockInWalkableRegion(ScriptState *script);
|
|
|
|
int cmd_blockOutWalkableRegion(ScriptState *script);
|
|
|
|
int cmd_walkPlayerToPoint(ScriptState *script);
|
|
|
|
int cmd_dropItemInScene(ScriptState *script);
|
|
|
|
int cmd_drawAnimShapeIntoScene(ScriptState *script);
|
|
|
|
int cmd_createMouseItem(ScriptState *script);
|
|
|
|
int cmd_savePageToDisk(ScriptState *script);
|
|
|
|
int cmd_sceneAnimOn(ScriptState *script);
|
|
|
|
int cmd_sceneAnimOff(ScriptState *script);
|
|
|
|
int cmd_getElapsedSeconds(ScriptState *script);
|
|
|
|
int cmd_mouseIsPointer(ScriptState *script);
|
|
|
|
int cmd_destroyMouseItem(ScriptState *script);
|
|
|
|
int cmd_runSceneAnimUntilDone(ScriptState *script);
|
|
|
|
int cmd_fadeSpecialPalette(ScriptState *script);
|
|
|
|
int cmd_playAdlibSound(ScriptState *script);
|
|
|
|
int cmd_playAdlibScore(ScriptState *script);
|
|
|
|
int cmd_phaseInSameScene(ScriptState *script);
|
|
|
|
int cmd_setScenePhasingFlag(ScriptState *script);
|
|
|
|
int cmd_resetScenePhasingFlag(ScriptState *script);
|
|
|
|
int cmd_queryScenePhasingFlag(ScriptState *script);
|
|
|
|
int cmd_sceneToDirection(ScriptState *script);
|
|
|
|
int cmd_setBirthstoneGem(ScriptState *script);
|
|
|
|
int cmd_placeItemInGenericMapScene(ScriptState *script);
|
|
|
|
int cmd_setBrandonStatusBit(ScriptState *script);
|
|
|
|
int cmd_pauseSeconds(ScriptState *script);
|
|
|
|
int cmd_getCharactersLocation(ScriptState *script);
|
|
|
|
int cmd_runNPCSubscript(ScriptState *script);
|
|
|
|
int cmd_magicOutMouseItem(ScriptState *script);
|
|
|
|
int cmd_internalAnimOn(ScriptState *script);
|
|
|
|
int cmd_forceBrandonToNormal(ScriptState *script);
|
|
|
|
int cmd_poisonDeathNow(ScriptState *script);
|
|
|
|
int cmd_setScaleMode(ScriptState *script);
|
|
|
|
int cmd_openWSAFile(ScriptState *script);
|
|
|
|
int cmd_closeWSAFile(ScriptState *script);
|
|
|
|
int cmd_runWSAFromBeginningToEnd(ScriptState *script);
|
|
|
|
int cmd_displayWSAFrame(ScriptState *script);
|
|
|
|
int cmd_enterNewScene(ScriptState *script);
|
|
|
|
int cmd_setSpecialEnterXAndY(ScriptState *script);
|
|
|
|
int cmd_runWSAFrames(ScriptState *script);
|
|
|
|
int cmd_popBrandonIntoScene(ScriptState *script);
|
|
|
|
int cmd_restoreAllObjectBackgrounds(ScriptState *script);
|
|
|
|
int cmd_setCustomPaletteRange(ScriptState *script);
|
|
|
|
int cmd_loadPageFromDisk(ScriptState *script);
|
|
|
|
int cmd_customPrintTalkString(ScriptState *script);
|
|
|
|
int cmd_restoreCustomPrintBackground(ScriptState *script);
|
|
|
|
int cmd_hideMouse(ScriptState *script);
|
|
|
|
int cmd_showMouse(ScriptState *script);
|
|
|
|
int cmd_getCharacterX(ScriptState *script);
|
|
|
|
int cmd_getCharacterY(ScriptState *script);
|
|
|
|
int cmd_changeCharactersFacing(ScriptState *script);
|
2005-11-18 23:55:31 +00:00
|
|
|
int cmd_copyWSARegion(ScriptState *script);
|
2005-10-29 18:37:40 +00:00
|
|
|
int cmd_printText(ScriptState *script);
|
|
|
|
int cmd_random(ScriptState *script);
|
|
|
|
int cmd_loadSoundFile(ScriptState *script);
|
|
|
|
int cmd_displayWSAFrameOnHidPage(ScriptState *script);
|
|
|
|
int cmd_displayWSASequentialFrames(ScriptState *script);
|
|
|
|
int cmd_drawCharacterStanding(ScriptState *script);
|
|
|
|
int cmd_internalAnimOff(ScriptState *script);
|
|
|
|
int cmd_changeCharactersXAndY(ScriptState *script);
|
|
|
|
int cmd_clearSceneAnimatorBeacon(ScriptState *script);
|
|
|
|
int cmd_querySceneAnimatorBeacon(ScriptState *script);
|
|
|
|
int cmd_refreshSceneAnimator(ScriptState *script);
|
|
|
|
int cmd_placeItemInOffScene(ScriptState *script);
|
|
|
|
int cmd_wipeDownMouseItem(ScriptState *script);
|
|
|
|
int cmd_placeCharacterInOtherScene(ScriptState *script);
|
|
|
|
int cmd_getKey(ScriptState *script);
|
|
|
|
int cmd_specificItemInInventory(ScriptState *script);
|
|
|
|
int cmd_popMobileNPCIntoScene(ScriptState *script);
|
|
|
|
int cmd_mobileCharacterInScene(ScriptState *script);
|
|
|
|
int cmd_hideMobileCharacter(ScriptState *script);
|
|
|
|
int cmd_unhideMobileCharacter(ScriptState *script);
|
|
|
|
int cmd_setCharactersLocation(ScriptState *script);
|
|
|
|
int cmd_walkCharacterToPoint(ScriptState *script);
|
|
|
|
int cmd_specialEventDisplayBrynnsNote(ScriptState *script);
|
|
|
|
int cmd_specialEventRemoveBrynnsNote(ScriptState *script);
|
|
|
|
int cmd_setLogicPage(ScriptState *script);
|
|
|
|
int cmd_fatPrint(ScriptState *script);
|
|
|
|
int cmd_preserveAllObjectBackgrounds(ScriptState *script);
|
|
|
|
int cmd_updateSceneAnimations(ScriptState *script);
|
|
|
|
int cmd_sceneAnimationActive(ScriptState *script);
|
|
|
|
int cmd_setCharactersMovementDelay(ScriptState *script);
|
|
|
|
int cmd_getCharactersFacing(ScriptState *script);
|
|
|
|
int cmd_bkgdScrollSceneAndMasksRight(ScriptState *script);
|
|
|
|
int cmd_dispelMagicAnimation(ScriptState *script);
|
|
|
|
int cmd_findBrightestFireberry(ScriptState *script);
|
|
|
|
int cmd_setFireberryGlowPalette(ScriptState *script);
|
|
|
|
int cmd_setDeathHandlerFlag(ScriptState *script);
|
|
|
|
int cmd_drinkPotionAnimation(ScriptState *script);
|
|
|
|
int cmd_makeAmuletAppear(ScriptState *script);
|
|
|
|
int cmd_drawItemShapeIntoScene(ScriptState *script);
|
|
|
|
int cmd_setCharactersCurrentFrame(ScriptState *script);
|
|
|
|
int cmd_waitForConfirmationMouseClick(ScriptState *script);
|
|
|
|
int cmd_pageFlip(ScriptState *script);
|
|
|
|
int cmd_setSceneFile(ScriptState *script);
|
|
|
|
int cmd_getItemInMarbleVase(ScriptState *script);
|
|
|
|
int cmd_setItemInMarbleVase(ScriptState *script);
|
|
|
|
int cmd_addItemToInventory(ScriptState *script);
|
|
|
|
int cmd_intPrint(ScriptState *script);
|
|
|
|
int cmd_shakeScreen(ScriptState *script);
|
|
|
|
int cmd_createAmuletJewel(ScriptState *script);
|
|
|
|
int cmd_setSceneAnimCurrXY(ScriptState *script);
|
2005-12-09 14:52:31 +00:00
|
|
|
int cmd_poisonBrandonAndRemaps(ScriptState *script);
|
2005-10-29 18:37:40 +00:00
|
|
|
int cmd_fillFlaskWithWater(ScriptState *script);
|
|
|
|
int cmd_getCharactersMovementDelay(ScriptState *script);
|
|
|
|
int cmd_getBirthstoneGem(ScriptState *script);
|
|
|
|
int cmd_queryBrandonStatusBit(ScriptState *script);
|
|
|
|
int cmd_playFluteAnimation(ScriptState *script);
|
|
|
|
int cmd_playWinterScrollSequence(ScriptState *script);
|
|
|
|
int cmd_getIdolGem(ScriptState *script);
|
|
|
|
int cmd_setIdolGem(ScriptState *script);
|
|
|
|
int cmd_totalItemsInScene(ScriptState *script);
|
|
|
|
int cmd_restoreBrandonsMovementDelay(ScriptState *script);
|
|
|
|
int cmd_setMousePos(ScriptState *script);
|
|
|
|
int cmd_getMouseState(ScriptState *script);
|
|
|
|
int cmd_setEntranceMouseCursorTrack(ScriptState *script);
|
|
|
|
int cmd_itemAppearsOnGround(ScriptState *script);
|
|
|
|
int cmd_setNoDrawShapesFlag(ScriptState *script);
|
|
|
|
int cmd_fadeEntirePalette(ScriptState *script);
|
|
|
|
int cmd_itemOnGroundHere(ScriptState *script);
|
|
|
|
int cmd_queryCauldronState(ScriptState *script);
|
|
|
|
int cmd_setCauldronState(ScriptState *script);
|
|
|
|
int cmd_queryCrystalState(ScriptState *script);
|
|
|
|
int cmd_setCrystalState(ScriptState *script);
|
|
|
|
int cmd_setPaletteRange(ScriptState *script);
|
|
|
|
int cmd_shrinkBrandonDown(ScriptState *script);
|
|
|
|
int cmd_growBrandonUp(ScriptState *script);
|
|
|
|
int cmd_setBrandonScaleXAndY(ScriptState *script);
|
|
|
|
int cmd_resetScaleMode(ScriptState *script);
|
|
|
|
int cmd_getScaleDepthTableValue(ScriptState *script);
|
|
|
|
int cmd_setScaleDepthTableValue(ScriptState *script);
|
|
|
|
int cmd_message(ScriptState *script);
|
|
|
|
int cmd_checkClickOnNPC(ScriptState *script);
|
|
|
|
int cmd_getFoyerItem(ScriptState *script);
|
|
|
|
int cmd_setFoyerItem(ScriptState *script);
|
|
|
|
int cmd_setNoItemDropRegion(ScriptState *script);
|
|
|
|
int cmd_walkMalcolmOn(ScriptState *script);
|
|
|
|
int cmd_passiveProtection(ScriptState *script);
|
|
|
|
int cmd_setPlayingLoop(ScriptState *script);
|
|
|
|
int cmd_brandonToStoneSequence(ScriptState *script);
|
|
|
|
int cmd_brandonHealingSequence(ScriptState *script);
|
|
|
|
int cmd_protectCommandLine(ScriptState *script);
|
|
|
|
int cmd_pauseMusicSeconds(ScriptState *script);
|
|
|
|
int cmd_resetMaskRegion(ScriptState *script);
|
|
|
|
int cmd_setPaletteChangeFlag(ScriptState *script);
|
|
|
|
int cmd_fillRect(ScriptState *script);
|
|
|
|
int cmd_dummy(ScriptState *script);
|
2006-01-12 13:16:42 +00:00
|
|
|
int cmd_vocUnload(ScriptState *script);
|
|
|
|
int cmd_vocLoad(ScriptState *script);
|
2005-10-06 11:57:02 +00:00
|
|
|
|
2004-04-09 12:36:06 +00:00
|
|
|
protected:
|
2005-08-19 22:12:09 +00:00
|
|
|
|
2006-05-16 16:04:24 +00:00
|
|
|
virtual int go();
|
|
|
|
virtual int init();
|
2004-04-09 12:36:06 +00:00
|
|
|
|
2005-09-10 00:15:40 +00:00
|
|
|
void startup();
|
|
|
|
void mainLoop();
|
2005-11-10 14:08:50 +00:00
|
|
|
int initCharacterChat(int8 charNum);
|
|
|
|
int8 getChatPartnerNum();
|
|
|
|
void backupChatPartnerAnimFrame(int8 charNum);
|
|
|
|
void restoreChatPartnerAnimFrame(int8 charNum);
|
|
|
|
void endCharacterChat(int8 charNum, int16 arg_4);
|
2006-03-18 14:43:18 +00:00
|
|
|
void waitForChatToFinish(int16 chatDuration, const char *str, uint8 charNum);
|
|
|
|
void characterSays(const char *chatStr, int8 charNum, int8 chatDuration);
|
2005-11-10 14:08:50 +00:00
|
|
|
|
2005-10-29 18:37:40 +00:00
|
|
|
void setCharactersPositions(int character);
|
|
|
|
int setGameFlag(int flag);
|
|
|
|
int queryGameFlag(int flag);
|
|
|
|
int resetGameFlag(int flag);
|
|
|
|
|
|
|
|
void enterNewScene(int sceneId, int facing, int unk1, int unk2, int brandonAlive);
|
2005-12-09 23:02:16 +00:00
|
|
|
void transcendScenes(int roomIndex, int roomName);
|
2005-12-22 19:31:38 +00:00
|
|
|
void setSceneFile(int roomIndex, int roomName);
|
2005-10-29 18:37:40 +00:00
|
|
|
void moveCharacterToPos(int character, int facing, int xpos, int ypos);
|
|
|
|
void setCharacterPositionWithUpdate(int character);
|
2005-11-09 22:26:12 +00:00
|
|
|
int setCharacterPosition(int character, int *facingTable);
|
|
|
|
void setCharacterPositionHelper(int character, int *facingTable);
|
2005-10-29 18:37:40 +00:00
|
|
|
int getOppositeFacingDirection(int dir);
|
|
|
|
void loadSceneMSC();
|
|
|
|
void startSceneScript(int brandonAlive);
|
2005-12-08 17:19:18 +00:00
|
|
|
void setupSceneItems();
|
2005-10-29 18:37:40 +00:00
|
|
|
void initSceneData(int facing, int unk1, int brandonAlive);
|
|
|
|
void clearNoDropRects();
|
|
|
|
void addToNoDropRects(int x, int y, int w, int h);
|
|
|
|
byte findFreeItemInScene(int scene);
|
|
|
|
byte findItemAtPos(int x, int y);
|
|
|
|
void placeItemInGenericMapScene(int item, int index);
|
|
|
|
void initSceneObjectList(int brandonAlive);
|
2005-11-10 14:08:50 +00:00
|
|
|
void initSceneScreen(int brandonAlive);
|
2005-10-29 18:37:40 +00:00
|
|
|
int findDuplicateItemShape(int shape);
|
2005-11-01 14:19:50 +00:00
|
|
|
int findWay(int x, int y, int toX, int toY, int *moveTable, int moveTableSize);
|
|
|
|
int findSubPath(int x, int y, int toX, int toY, int *moveTable, int start, int end);
|
|
|
|
int getFacingFromPointToPoint(int x, int y, int toX, int toY);
|
|
|
|
void changePosTowardsFacing(int &x, int &y, int facing);
|
|
|
|
bool lineIsPassable(int x, int y);
|
|
|
|
int getMoveTableSize(int *moveTable);
|
2005-11-09 22:26:12 +00:00
|
|
|
int handleSceneChange(int xpos, int ypos, int unk1, int frameReset);
|
|
|
|
int processSceneChange(int *table, int unk1, int frameReset);
|
|
|
|
int changeScene(int facing);
|
2005-11-18 23:55:31 +00:00
|
|
|
void createMouseItem(int item);
|
|
|
|
void destroyMouseItem();
|
|
|
|
void setMouseItem(int item);
|
|
|
|
void wipeDownMouseItem(int xpos, int ypos);
|
2005-12-28 21:34:40 +00:00
|
|
|
void setBrandonPoisonFlags(int reset);
|
|
|
|
void resetBrandonPoisonFlags();
|
2005-12-23 17:49:14 +00:00
|
|
|
|
2005-11-18 23:55:31 +00:00
|
|
|
void processInput(int xpos, int ypos);
|
|
|
|
int processInputHelper(int xpos, int ypos);
|
|
|
|
int clickEventHandler(int xpos, int ypos);
|
2005-12-08 17:19:18 +00:00
|
|
|
void clickEventHandler2();
|
2005-12-13 15:10:20 +00:00
|
|
|
void updateMousePointer(bool forceUpdate = false);
|
2005-12-09 19:49:47 +00:00
|
|
|
bool hasClickedOnExit(int xpos, int ypos);
|
2005-12-09 23:02:16 +00:00
|
|
|
int checkForNPCScriptRun(int xpos, int ypos);
|
|
|
|
void runNpcScript(int func);
|
2005-10-29 18:37:40 +00:00
|
|
|
|
2005-12-08 17:19:18 +00:00
|
|
|
int countItemsInScene(uint16 sceneId);
|
2005-12-09 19:49:47 +00:00
|
|
|
int processItemDrop(uint16 sceneId, uint8 item, int x, int y, int unk1, int unk2);
|
2005-12-08 17:19:18 +00:00
|
|
|
void exchangeItemWithMouseItem(uint16 sceneId, int itemIndex);
|
|
|
|
void addItemToRoom(uint16 sceneId, uint8 item, int itemIndex, int x, int y);
|
|
|
|
int checkNoDropRects(int x, int y);
|
|
|
|
int isDropable(int x, int y);
|
|
|
|
void itemDropDown(int x, int y, int destX, int destY, byte freeItem, int item);
|
2005-12-09 19:49:47 +00:00
|
|
|
void dropItem(int unk1, int item, int x, int y, int unk2);
|
2005-12-22 18:14:52 +00:00
|
|
|
void itemSpecialFX(int x, int y, int item);
|
|
|
|
void itemSpecialFX1(int x, int y, int item);
|
|
|
|
void itemSpecialFX2(int x, int y, int item);
|
2005-12-23 17:49:14 +00:00
|
|
|
void magicOutMouseItem(int animIndex, int itemPos);
|
2005-12-28 21:34:40 +00:00
|
|
|
void magicInMouseItem(int animIndex, int item, int itemPos);
|
2005-12-23 17:49:14 +00:00
|
|
|
void specialMouseItemFX(int shape, int x, int y, int animIndex, int tableIndex, int loopStart, int maxLoops);
|
|
|
|
void processSpecialMouseItemFX(int shape, int x, int y, int tableValue, int loopStart, int maxLoops);
|
|
|
|
void updatePlayerItemsForScene();
|
|
|
|
void redrawInventory(int page);
|
2005-12-08 17:19:18 +00:00
|
|
|
|
2005-12-26 14:53:51 +00:00
|
|
|
void drawJewelPress(int jewel, int drawSpecial);
|
|
|
|
void drawJewelsFadeOutStart();
|
|
|
|
void drawJewelsFadeOutEnd(int jewel);
|
|
|
|
void setupShapes123(const Shape *shapeTable, int endShape, int flags);
|
|
|
|
void freeShapes123();
|
2006-01-06 10:45:42 +00:00
|
|
|
|
2005-09-10 06:40:20 +00:00
|
|
|
void seq_demo();
|
2005-08-19 22:12:09 +00:00
|
|
|
void seq_intro();
|
|
|
|
void seq_introLogos();
|
2005-09-08 19:09:52 +00:00
|
|
|
void seq_introStory();
|
2005-10-18 19:59:51 +00:00
|
|
|
void seq_introMalcolmTree();
|
2005-09-08 19:09:52 +00:00
|
|
|
void seq_introKallakWriting();
|
2005-10-18 19:59:51 +00:00
|
|
|
void seq_introKallakMalcolm();
|
2005-12-24 18:00:35 +00:00
|
|
|
void seq_createAmuletJewel(int jewel, int page, int noSound, int drawOnly);
|
2005-12-26 14:53:51 +00:00
|
|
|
void seq_brandonHealing();
|
2005-12-28 21:34:40 +00:00
|
|
|
void seq_brandonHealing2();
|
|
|
|
void seq_poisonDeathNow(int now);
|
|
|
|
void seq_poisonDeathNowAnim();
|
|
|
|
void seq_playFluteAnimation();
|
2005-12-29 22:18:40 +00:00
|
|
|
void seq_winterScroll1();
|
|
|
|
void seq_winterScroll2();
|
|
|
|
void seq_makeBrandonInv();
|
|
|
|
void seq_makeBrandonNormal();
|
|
|
|
void seq_makeBrandonNormal2();
|
|
|
|
void seq_makeBrandonWisp();
|
|
|
|
void seq_dispelMagicAnimation();
|
2005-12-31 17:25:47 +00:00
|
|
|
void seq_fillFlaskWithWater(int item, int type);
|
2006-03-18 04:41:34 +00:00
|
|
|
void seq_playDrinkPotionAnim(int item, int unk2, int flags);
|
2006-01-06 10:45:42 +00:00
|
|
|
int seq_playEnd();
|
|
|
|
void seq_brandonToStone();
|
2006-01-07 23:55:50 +00:00
|
|
|
void seq_playEnding();
|
|
|
|
void seq_playCredits();
|
2006-02-11 08:31:13 +00:00
|
|
|
void updateKyragemFading();
|
2006-01-07 23:55:50 +00:00
|
|
|
|
2005-10-29 18:37:40 +00:00
|
|
|
static OpcodeProc _opcodeTable[];
|
|
|
|
static const int _opcodeTableSize;
|
|
|
|
|
2005-12-10 19:02:56 +00:00
|
|
|
void waitForEvent();
|
2005-10-03 20:21:18 +00:00
|
|
|
void loadPalette(const char *filename, uint8 *palData);
|
2005-10-22 00:24:07 +00:00
|
|
|
void loadMouseShapes();
|
2005-10-29 18:37:40 +00:00
|
|
|
void loadCharacterShapes();
|
|
|
|
void loadSpecialEffectShapes();
|
|
|
|
void loadItems();
|
2005-12-24 18:00:35 +00:00
|
|
|
void loadButtonShapes();
|
|
|
|
void initMainButtonList();
|
2006-01-03 23:41:52 +00:00
|
|
|
void loadMainScreen(int page = 3);
|
2005-10-29 18:37:40 +00:00
|
|
|
void setCharactersInDefaultScene();
|
2006-01-06 10:45:42 +00:00
|
|
|
void setupPanPages();
|
|
|
|
void freePanPages();
|
|
|
|
void closeFinalWsa();
|
|
|
|
int handleMalcolmFlag();
|
|
|
|
int handleBeadState();
|
|
|
|
void initBeadState(int x, int y, int x2, int y2, int unk1, BeadState *ptr);
|
|
|
|
int processBead(int x, int y, int &x2, int &y2, BeadState *ptr);
|
2005-11-11 22:17:06 +00:00
|
|
|
|
2005-11-18 23:55:31 +00:00
|
|
|
void setTimer19();
|
2005-11-11 22:17:06 +00:00
|
|
|
void setupTimers();
|
|
|
|
void timerUpdateHeadAnims(int timerNum);
|
|
|
|
void timerSetFlags1(int timerNum);
|
|
|
|
void timerSetFlags2(int timerNum);
|
2005-12-29 22:18:40 +00:00
|
|
|
void timerSetFlags3(int timerNum);
|
2005-11-11 22:17:06 +00:00
|
|
|
void timerCheckAnimFlag1(int timerNum);
|
|
|
|
void timerCheckAnimFlag2(int timerNum);
|
2005-12-09 14:52:31 +00:00
|
|
|
void checkAmuletAnimFlags();
|
2005-11-11 22:17:06 +00:00
|
|
|
void timerRedrawAmulet(int timerNum);
|
2005-12-09 14:52:31 +00:00
|
|
|
void timerFadeText(int timerNum);
|
2005-12-29 22:18:40 +00:00
|
|
|
void updateAnimFlag1(int timerNum);
|
|
|
|
void updateAnimFlag2(int timerNum);
|
2005-11-11 22:17:06 +00:00
|
|
|
void drawAmulet();
|
2005-12-09 14:52:31 +00:00
|
|
|
void setTextFadeTimerCountdown(int16 countdown);
|
2006-03-08 13:15:13 +00:00
|
|
|
void setWalkspeed(uint8 newSpeed);
|
|
|
|
|
2005-12-24 18:00:35 +00:00
|
|
|
int buttonInventoryCallback(Button *caller);
|
2005-12-26 14:53:51 +00:00
|
|
|
int buttonAmuletCallback(Button *caller);
|
2006-01-13 03:27:01 +00:00
|
|
|
int buttonMenuCallback(Button *caller);
|
2006-01-22 09:34:12 +00:00
|
|
|
int drawBoxCallback(Button *button);
|
|
|
|
int drawShadedBoxCallback(Button *button);
|
|
|
|
void calcCoords(Menu &menu);
|
2006-04-25 11:58:21 +00:00
|
|
|
void initMenu(Menu &menu);
|
2006-04-23 14:43:16 +00:00
|
|
|
void setGUILabels();
|
|
|
|
|
2005-12-24 18:00:35 +00:00
|
|
|
Button *initButton(Button *list, Button *newButton);
|
|
|
|
void processButtonList(Button *list);
|
|
|
|
void processButton(Button *button);
|
2006-01-22 09:34:12 +00:00
|
|
|
void processMenuButton(Button *button);
|
|
|
|
void processAllMenuButtons();
|
|
|
|
|
2006-01-27 08:23:53 +00:00
|
|
|
const char *getSavegameFilename(int num);
|
2006-01-22 09:34:12 +00:00
|
|
|
void setupSavegames(Menu &menu, int num);
|
2006-01-27 08:23:53 +00:00
|
|
|
int getNextSavegameSlot();
|
2006-01-22 09:34:12 +00:00
|
|
|
|
|
|
|
int gui_resumeGame(Button *button);
|
|
|
|
int gui_loadGameMenu(Button *button);
|
2006-01-27 08:23:53 +00:00
|
|
|
int gui_saveGameMenu(Button *button);
|
2006-03-08 13:15:13 +00:00
|
|
|
int gui_gameControlsMenu(Button *button);
|
2006-01-22 09:34:12 +00:00
|
|
|
int gui_quitPlaying(Button *button);
|
|
|
|
int gui_quitConfirmYes(Button *button);
|
|
|
|
int gui_quitConfirmNo(Button *button);
|
|
|
|
int gui_loadGame(Button *button);
|
2006-01-27 08:23:53 +00:00
|
|
|
int gui_saveGame(Button *button);
|
|
|
|
int gui_savegameConfirm(Button *button);
|
|
|
|
int gui_cancelSubMenu(Button *button);
|
2006-01-22 09:34:12 +00:00
|
|
|
int gui_scrollUp(Button *button);
|
|
|
|
int gui_scrollDown(Button *button);
|
2006-03-08 13:15:13 +00:00
|
|
|
int gui_controlsChangeMusic(Button *button);
|
|
|
|
int gui_controlsChangeSounds(Button *button);
|
|
|
|
int gui_controlsChangeWalk(Button *button);
|
|
|
|
int gui_controlsChangeText(Button *button);
|
|
|
|
int gui_controlsChangeVoice(Button *button);
|
2006-01-22 09:34:12 +00:00
|
|
|
|
|
|
|
bool gui_quitConfirm(const char *str);
|
|
|
|
void gui_getInput();
|
2006-01-22 22:06:34 +00:00
|
|
|
void gui_redrawText(Menu menu);
|
|
|
|
void gui_redrawHighlight(Menu menu);
|
|
|
|
void gui_processHighlights(Menu &menu);
|
2006-01-27 08:23:53 +00:00
|
|
|
void gui_updateSavegameString();
|
|
|
|
void gui_redrawTextfield();
|
2006-01-28 05:09:39 +00:00
|
|
|
void gui_fadePalette();
|
|
|
|
void gui_restorePalette();
|
2006-03-08 13:15:13 +00:00
|
|
|
void gui_setupControls(Menu &menu);
|
2006-01-22 09:34:12 +00:00
|
|
|
|
2005-08-19 22:12:09 +00:00
|
|
|
uint8 _game;
|
|
|
|
bool _quitFlag;
|
2006-02-09 12:19:53 +00:00
|
|
|
bool _skipFlag;
|
2005-08-19 22:12:09 +00:00
|
|
|
bool _skipIntroFlag;
|
2005-10-03 20:21:18 +00:00
|
|
|
bool _abortIntroFlag;
|
2006-01-27 08:23:53 +00:00
|
|
|
bool _menuDirectlyToLoad;
|
2005-12-13 15:10:20 +00:00
|
|
|
bool _abortWalkFlag;
|
|
|
|
bool _abortWalkFlag2;
|
2005-12-24 18:00:35 +00:00
|
|
|
bool _mousePressFlag;
|
2006-03-15 13:32:35 +00:00
|
|
|
int8 _mouseWheel;
|
2005-10-29 18:37:40 +00:00
|
|
|
uint8 _flagsTable[53];
|
|
|
|
uint8 *_shapes[377];
|
2005-10-03 20:21:18 +00:00
|
|
|
uint16 _gameSpeed;
|
2005-11-11 22:17:06 +00:00
|
|
|
uint16 _tickLength;
|
2005-10-13 21:12:47 +00:00
|
|
|
uint32 _features;
|
2005-10-22 00:24:07 +00:00
|
|
|
int _mouseX, _mouseY;
|
2005-12-10 17:51:40 +00:00
|
|
|
int8 _itemInHand;
|
2005-11-18 23:55:31 +00:00
|
|
|
int _mouseState;
|
|
|
|
bool _handleInput;
|
2005-12-24 18:00:35 +00:00
|
|
|
bool _changedScene;
|
2005-12-13 16:56:33 +00:00
|
|
|
int _unkScreenVar1, _unkScreenVar2, _unkScreenVar3;
|
2006-01-06 10:45:42 +00:00
|
|
|
int _beadStateVar;
|
2005-12-26 14:53:51 +00:00
|
|
|
int _unkAmuletVar;
|
2006-02-11 08:31:13 +00:00
|
|
|
|
2006-01-06 10:45:42 +00:00
|
|
|
int _malcolmFlag;
|
|
|
|
int _endSequenceSkipFlag;
|
|
|
|
int _endSequenceNeedLoading;
|
|
|
|
int _unkEndSeqVar2;
|
|
|
|
uint8 *_endSequenceBackUpRect;
|
|
|
|
int _unkEndSeqVar4;
|
|
|
|
int _unkEndSeqVar5;
|
|
|
|
int _lastDisplayedPanPage;
|
|
|
|
uint8 *_panPagesTable[20];
|
|
|
|
Movie *_finalA, *_finalB, *_finalC;
|
|
|
|
|
2006-01-02 13:20:02 +00:00
|
|
|
Movie *_movieObjects[10];
|
|
|
|
|
2005-10-29 18:37:40 +00:00
|
|
|
uint16 _entranceMouseCursorTracks[8];
|
|
|
|
uint16 _walkBlockNorth;
|
|
|
|
uint16 _walkBlockEast;
|
|
|
|
uint16 _walkBlockSouth;
|
|
|
|
uint16 _walkBlockWest;
|
|
|
|
|
|
|
|
int32 _scaleMode;
|
2005-11-01 14:19:50 +00:00
|
|
|
int16 _scaleTable[145];
|
2005-10-29 18:37:40 +00:00
|
|
|
|
|
|
|
Rect _noDropRects[11];
|
|
|
|
|
2005-12-31 15:41:37 +00:00
|
|
|
int8 _birthstoneGemTable[4];
|
|
|
|
int8 _idolGemsTable[3];
|
2005-10-29 18:37:40 +00:00
|
|
|
|
2005-12-31 15:41:37 +00:00
|
|
|
int8 _marbleVaseItem;
|
|
|
|
int8 _foyerItemTable[3];
|
2005-10-29 18:37:40 +00:00
|
|
|
|
2005-12-31 15:41:37 +00:00
|
|
|
int8 _cauldronState;
|
2005-12-31 17:25:47 +00:00
|
|
|
int8 _crystalState[2];
|
2005-12-31 15:41:37 +00:00
|
|
|
|
2005-10-29 18:37:40 +00:00
|
|
|
uint16 _brandonStatusBit;
|
2006-01-03 23:41:52 +00:00
|
|
|
uint8 _brandonStatusBit0x02Flag;
|
|
|
|
uint8 _brandonStatusBit0x20Flag;
|
2006-01-02 22:58:59 +00:00
|
|
|
uint8 _brandonPoisonFlagsGFX[256];
|
2005-12-26 14:53:51 +00:00
|
|
|
uint8 _deathHandler;
|
2006-01-03 23:41:52 +00:00
|
|
|
int16 _brandonInvFlag;
|
|
|
|
uint8 _poisonDeathCounter;
|
2005-10-29 18:37:40 +00:00
|
|
|
int _brandonPosX;
|
|
|
|
int _brandonPosY;
|
2005-11-10 14:08:50 +00:00
|
|
|
|
|
|
|
uint16 _currentChatPartnerBackupFrame;
|
|
|
|
uint16 _currentCharAnimFrame;
|
2005-10-29 18:37:40 +00:00
|
|
|
|
|
|
|
int8 *_sceneAnimTable[50];
|
|
|
|
|
|
|
|
Item _itemTable[145];
|
2005-12-08 17:19:18 +00:00
|
|
|
int _lastProcessedItem;
|
|
|
|
int _lastProcessedItemHeight;
|
2005-10-29 18:37:40 +00:00
|
|
|
|
2005-11-13 19:35:01 +00:00
|
|
|
int16 *_exitListPtr;
|
|
|
|
int16 _exitList[11];
|
2005-10-29 18:37:40 +00:00
|
|
|
SceneExits _sceneExits;
|
2005-10-03 20:21:18 +00:00
|
|
|
uint16 _currentRoom;
|
2005-12-09 23:02:16 +00:00
|
|
|
int _scenePhasingFlag;
|
2005-10-29 18:37:40 +00:00
|
|
|
uint8 *_maskBuffer;
|
|
|
|
|
2005-11-09 22:26:12 +00:00
|
|
|
int _sceneChangeState;
|
|
|
|
int _loopFlag2;
|
|
|
|
|
2005-11-01 14:19:50 +00:00
|
|
|
int _pathfinderFlag;
|
|
|
|
int _pathfinderFlag2;
|
2005-10-29 18:37:40 +00:00
|
|
|
int _lastFindWayRet;
|
|
|
|
int *_movFacingTable;
|
|
|
|
|
2005-12-09 14:52:31 +00:00
|
|
|
int8 _talkingCharNum;
|
2005-11-10 14:08:50 +00:00
|
|
|
int8 _charSayUnk2;
|
2005-11-10 18:58:44 +00:00
|
|
|
int8 _charSayUnk3;
|
2005-12-09 14:52:31 +00:00
|
|
|
int8 _currHeadShape;
|
|
|
|
uint8 _currSentenceColor[3];
|
|
|
|
int8 _startSentencePalIndex;
|
|
|
|
bool _fadeText;
|
2005-11-10 14:08:50 +00:00
|
|
|
|
2006-03-08 13:15:13 +00:00
|
|
|
uint8 _configTextspeed;
|
|
|
|
uint8 _configWalkspeed;
|
|
|
|
bool _configMusic;
|
|
|
|
bool _configSounds;
|
|
|
|
uint8 _configVoice;
|
|
|
|
|
2005-10-29 18:37:40 +00:00
|
|
|
int _curMusicTheme;
|
|
|
|
int _newMusicTheme;
|
2006-01-12 14:53:23 +00:00
|
|
|
int16 _lastMusicCommand;
|
2005-08-19 22:12:09 +00:00
|
|
|
|
|
|
|
Resource *_res;
|
|
|
|
Screen *_screen;
|
2006-01-02 22:58:59 +00:00
|
|
|
ScreenAnimator *_animator;
|
2006-01-13 23:06:04 +00:00
|
|
|
Sound *_sound;
|
2005-10-06 11:57:02 +00:00
|
|
|
SeqPlayer *_seq;
|
2005-10-03 20:21:18 +00:00
|
|
|
Sprites *_sprites;
|
2006-01-02 22:58:59 +00:00
|
|
|
TextDisplayer *_text;
|
2005-10-29 18:37:40 +00:00
|
|
|
ScriptHelper *_scriptInterpreter;
|
2005-12-09 14:52:31 +00:00
|
|
|
Debugger *_debugger;
|
2006-03-18 14:43:18 +00:00
|
|
|
StaticResource *_staticres;
|
2005-12-10 17:51:40 +00:00
|
|
|
Common::SaveFileManager *_saveFileMan;
|
|
|
|
|
2005-10-29 18:37:40 +00:00
|
|
|
ScriptState *_scriptMain;
|
2005-12-09 23:02:16 +00:00
|
|
|
|
|
|
|
ScriptState *_npcScript;
|
2005-10-29 18:37:40 +00:00
|
|
|
ScriptData *_npcScriptData;
|
|
|
|
|
2005-12-09 23:02:16 +00:00
|
|
|
ScriptState *_scriptClick;
|
2005-10-29 18:37:40 +00:00
|
|
|
ScriptData *_scriptClickData;
|
|
|
|
|
|
|
|
Character *_characterList;
|
2006-02-11 08:31:13 +00:00
|
|
|
Character *_currentCharacter;
|
2005-10-03 20:21:18 +00:00
|
|
|
|
2005-12-24 18:00:35 +00:00
|
|
|
Button *_buttonList;
|
2006-01-22 09:34:12 +00:00
|
|
|
Button *_menuButtonList;
|
|
|
|
bool _displayMenu;
|
|
|
|
bool _menuRestoreScreen;
|
2006-01-27 08:23:53 +00:00
|
|
|
bool _displaySubMenu;
|
|
|
|
bool _cancelSubMenu;
|
2006-03-07 14:16:52 +00:00
|
|
|
uint8 _toplevelMenu;
|
2006-01-22 09:34:12 +00:00
|
|
|
int _savegameOffset;
|
|
|
|
int _gameToLoad;
|
2006-01-27 08:23:53 +00:00
|
|
|
char _savegameName[31];
|
|
|
|
const char *_specialSavegameString;
|
|
|
|
KeyboardEvent _keyboardEvent;
|
2006-01-22 09:34:12 +00:00
|
|
|
|
2006-02-11 08:31:13 +00:00
|
|
|
struct KyragemState {
|
|
|
|
uint16 nextOperation;
|
|
|
|
uint16 rOffset;
|
|
|
|
uint16 gOffset;
|
|
|
|
uint16 bOffset;
|
|
|
|
uint32 timerCount;
|
|
|
|
} _kyragemFadingState;
|
|
|
|
|
2006-03-18 14:43:18 +00:00
|
|
|
// TODO: get rid of all variables having pointers to the static resources if possible
|
|
|
|
// i.e. let them directly use the _staticres functions
|
|
|
|
void initStaticResource();
|
|
|
|
|
|
|
|
const uint8 *_seq_Forest;
|
|
|
|
const uint8 *_seq_KallakWriting;
|
|
|
|
const uint8 *_seq_KyrandiaLogo;
|
|
|
|
const uint8 *_seq_KallakMalcolm;
|
|
|
|
const uint8 *_seq_MalcolmTree;
|
|
|
|
const uint8 *_seq_WestwoodLogo;
|
|
|
|
const uint8 *_seq_Demo1;
|
|
|
|
const uint8 *_seq_Demo2;
|
|
|
|
const uint8 *_seq_Demo3;
|
|
|
|
const uint8 *_seq_Demo4;
|
|
|
|
const uint8 *_seq_Reunion;
|
|
|
|
|
2006-04-09 00:44:08 +00:00
|
|
|
const char * const*_seq_WSATable;
|
|
|
|
const char * const*_seq_CPSTable;
|
|
|
|
const char * const*_seq_COLTable;
|
|
|
|
const char * const*_seq_textsTable;
|
2005-10-18 19:59:51 +00:00
|
|
|
|
|
|
|
int _seq_WSATable_Size;
|
|
|
|
int _seq_CPSTable_Size;
|
|
|
|
int _seq_COLTable_Size;
|
|
|
|
int _seq_textsTable_Size;
|
2005-10-12 19:15:32 +00:00
|
|
|
|
2006-04-09 00:44:08 +00:00
|
|
|
const char * const*_itemList;
|
|
|
|
const char * const*_takenList;
|
|
|
|
const char * const*_placedList;
|
|
|
|
const char * const*_droppedList;
|
|
|
|
const char * const*_noDropList;
|
|
|
|
const char * const*_putDownFirst;
|
|
|
|
const char * const*_waitForAmulet;
|
|
|
|
const char * const*_blackJewel;
|
|
|
|
const char * const*_poisonGone;
|
|
|
|
const char * const*_healingTip;
|
|
|
|
const char * const*_thePoison;
|
|
|
|
const char * const*_fluteString;
|
|
|
|
const char * const*_wispJewelStrings;
|
|
|
|
const char * const*_magicJewelString;
|
|
|
|
const char * const*_flaskFull;
|
|
|
|
const char * const*_fullFlask;
|
|
|
|
const char * const*_veryClever;
|
|
|
|
const char * const*_homeString;
|
2006-04-23 14:43:16 +00:00
|
|
|
const char * const*_newGameString;
|
2005-12-14 14:08:30 +00:00
|
|
|
|
2006-04-23 14:43:16 +00:00
|
|
|
const char *_voiceTextString;
|
|
|
|
const char *_textSpeedString;
|
|
|
|
const char *_onString;
|
|
|
|
const char *_offString;
|
|
|
|
|
2005-12-14 14:08:30 +00:00
|
|
|
int _itemList_Size;
|
|
|
|
int _takenList_Size;
|
|
|
|
int _placedList_Size;
|
|
|
|
int _droppedList_Size;
|
|
|
|
int _noDropList_Size;
|
2005-12-26 14:53:51 +00:00
|
|
|
int _putDownFirst_Size;
|
|
|
|
int _waitForAmulet_Size;
|
|
|
|
int _blackJewel_Size;
|
|
|
|
int _poisonGone_Size;
|
|
|
|
int _healingTip_Size;
|
2005-12-28 21:34:40 +00:00
|
|
|
int _thePoison_Size;
|
|
|
|
int _fluteString_Size;
|
2005-12-29 22:18:40 +00:00
|
|
|
int _wispJewelStrings_Size;
|
|
|
|
int _magicJewelString_Size;
|
2005-12-31 17:25:47 +00:00
|
|
|
int _flaskFull_Size;
|
|
|
|
int _fullFlask_Size;
|
2006-01-07 23:55:50 +00:00
|
|
|
int _veryClever_Size;
|
|
|
|
int _homeString_Size;
|
2006-04-23 14:43:16 +00:00
|
|
|
int _newGameString_Size;
|
2005-12-14 14:08:30 +00:00
|
|
|
|
2006-04-09 00:44:08 +00:00
|
|
|
const char * const*_characterImageTable;
|
2005-10-29 18:37:40 +00:00
|
|
|
int _characterImageTableSize;
|
2006-04-23 14:43:16 +00:00
|
|
|
|
|
|
|
const char * const*_guiStrings;
|
|
|
|
int _guiStringsSize;
|
|
|
|
|
|
|
|
const char * const*_configStrings;
|
|
|
|
int _configStringsSize;
|
2005-10-29 18:37:40 +00:00
|
|
|
|
|
|
|
Shape *_defaultShapeTable;
|
|
|
|
int _defaultShapeTableSize;
|
|
|
|
|
2006-03-18 14:43:18 +00:00
|
|
|
const Shape *_healingShapeTable;
|
2005-12-26 14:53:51 +00:00
|
|
|
int _healingShapeTableSize;
|
2006-03-18 14:43:18 +00:00
|
|
|
const Shape *_healingShape2Table;
|
2005-12-26 14:53:51 +00:00
|
|
|
int _healingShape2TableSize;
|
|
|
|
|
2006-03-18 14:43:18 +00:00
|
|
|
const Shape *_posionDeathShapeTable;
|
2005-12-28 21:34:40 +00:00
|
|
|
int _posionDeathShapeTableSize;
|
|
|
|
|
2006-03-18 14:43:18 +00:00
|
|
|
const Shape *_fluteAnimShapeTable;
|
2005-12-28 21:34:40 +00:00
|
|
|
int _fluteAnimShapeTableSize;
|
|
|
|
|
2006-03-18 14:43:18 +00:00
|
|
|
const Shape *_winterScrollTable;
|
2005-12-29 22:18:40 +00:00
|
|
|
int _winterScrollTableSize;
|
2006-03-18 14:43:18 +00:00
|
|
|
const Shape *_winterScroll1Table;
|
2005-12-29 22:18:40 +00:00
|
|
|
int _winterScroll1TableSize;
|
2006-03-18 14:43:18 +00:00
|
|
|
const Shape *_winterScroll2Table;
|
2005-12-29 22:18:40 +00:00
|
|
|
int _winterScroll2TableSize;
|
|
|
|
|
2006-03-18 14:43:18 +00:00
|
|
|
const Shape *_drinkAnimationTable;
|
2005-12-29 22:18:40 +00:00
|
|
|
int _drinkAnimationTableSize;
|
|
|
|
|
2006-03-18 14:43:18 +00:00
|
|
|
const Shape *_brandonToWispTable;
|
2005-12-29 22:18:40 +00:00
|
|
|
int _brandonToWispTableSize;
|
|
|
|
|
2006-03-18 14:43:18 +00:00
|
|
|
const Shape *_magicAnimationTable;
|
2005-12-29 22:18:40 +00:00
|
|
|
int _magicAnimationTableSize;
|
|
|
|
|
2006-03-18 14:43:18 +00:00
|
|
|
const Shape *_brandonStoneTable;
|
2005-12-29 22:18:40 +00:00
|
|
|
int _brandonStoneTableSize;
|
|
|
|
|
2005-10-29 18:37:40 +00:00
|
|
|
Room *_roomTable;
|
2006-03-18 14:43:18 +00:00
|
|
|
int _roomTableSize;
|
2006-04-09 00:44:08 +00:00
|
|
|
const char * const*_roomFilenameTable;
|
2005-10-29 18:37:40 +00:00
|
|
|
int _roomFilenameTableSize;
|
2005-12-20 12:42:22 +00:00
|
|
|
|
2006-03-18 14:43:18 +00:00
|
|
|
const uint8 *_amuleteAnim;
|
2005-12-22 18:14:52 +00:00
|
|
|
|
2006-04-09 00:44:08 +00:00
|
|
|
const uint8 * const*_specialPalettes;
|
2005-11-11 22:17:06 +00:00
|
|
|
|
|
|
|
Timer _timers[34];
|
|
|
|
uint32 _timerNextRun;
|
2006-02-27 22:39:55 +00:00
|
|
|
static const char *_musicFiles[];
|
|
|
|
static const int _musicFilesCount;
|
2005-10-29 18:37:40 +00:00
|
|
|
|
|
|
|
static const int8 _charXPosTable[];
|
2005-11-01 14:19:50 +00:00
|
|
|
static const int8 _addXPosTable[];
|
2005-10-29 18:37:40 +00:00
|
|
|
static const int8 _charYPosTable[];
|
2005-11-01 14:19:50 +00:00
|
|
|
static const int8 _addYPosTable[];
|
2005-11-11 22:17:06 +00:00
|
|
|
|
2005-12-23 17:49:14 +00:00
|
|
|
// positions of the inventory
|
2005-12-24 18:00:35 +00:00
|
|
|
static const uint16 _itemPosX[];
|
|
|
|
static const uint8 _itemPosY[];
|
|
|
|
|
|
|
|
static Button _buttonData[];
|
|
|
|
static Button *_buttonDataListPtr[];
|
2006-01-22 09:34:12 +00:00
|
|
|
static Button _menuButtonData[];
|
|
|
|
static Button _scrollUpButton;
|
|
|
|
static Button _scrollDownButton;
|
|
|
|
|
2006-03-15 13:32:35 +00:00
|
|
|
bool _haveScrollButtons;
|
|
|
|
|
2006-01-22 09:34:12 +00:00
|
|
|
static Menu _menu[];
|
2005-12-23 17:49:14 +00:00
|
|
|
|
|
|
|
static const uint8 _magicMouseItemStartFrame[];
|
|
|
|
static const uint8 _magicMouseItemEndFrame[];
|
|
|
|
static const uint8 _magicMouseItemStartFrame2[];
|
|
|
|
static const uint8 _magicMouseItemEndFrame2[];
|
|
|
|
|
2005-11-11 22:17:06 +00:00
|
|
|
static const uint16 _amuletX[];
|
|
|
|
static const uint16 _amuletY[];
|
2005-12-24 18:00:35 +00:00
|
|
|
static const uint16 _amuletX2[];
|
|
|
|
static const uint16 _amuletY2[];
|
2004-04-09 12:36:06 +00:00
|
|
|
};
|
|
|
|
|
2006-05-01 00:25:41 +00:00
|
|
|
class KyraEngine_v1 : public KyraEngine {
|
2006-05-03 13:40:21 +00:00
|
|
|
public:
|
|
|
|
KyraEngine_v1(OSystem *system);
|
|
|
|
~KyraEngine_v1();
|
|
|
|
|
|
|
|
int setupGameFlags();
|
2006-05-01 00:25:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class KyraEngine_v2 : public KyraEngine {
|
2006-05-03 13:40:21 +00:00
|
|
|
public:
|
|
|
|
KyraEngine_v2(OSystem *system);
|
|
|
|
~KyraEngine_v2();
|
|
|
|
|
|
|
|
int setupGameFlags() { return 0; }
|
2006-05-01 00:25:41 +00:00
|
|
|
|
|
|
|
int go();
|
|
|
|
};
|
|
|
|
|
2006-05-16 16:31:23 +00:00
|
|
|
// maybe subclass KyraEngine_v2 later
|
2006-05-12 23:57:53 +00:00
|
|
|
class KyraEngine_v3 : public KyraEngine {
|
|
|
|
public:
|
|
|
|
KyraEngine_v3(OSystem *system);
|
|
|
|
~KyraEngine_v3();
|
2006-05-16 16:04:24 +00:00
|
|
|
|
|
|
|
Movie *createWSAMovie();
|
2006-05-17 18:07:02 +00:00
|
|
|
|
|
|
|
SoundDigital *soundDigital() { return _soundDigital; }
|
2006-05-12 23:57:53 +00:00
|
|
|
|
2006-05-16 17:38:04 +00:00
|
|
|
int setupGameFlags() { _game = GI_KYRA3; return 0; }
|
2006-05-12 23:57:53 +00:00
|
|
|
|
|
|
|
int go();
|
2006-05-17 18:07:02 +00:00
|
|
|
private:
|
|
|
|
int init();
|
|
|
|
|
|
|
|
SoundDigital *_soundDigital;
|
|
|
|
|
|
|
|
// sound specific
|
|
|
|
private:
|
|
|
|
void playMenuAudioFile();
|
|
|
|
|
|
|
|
int _musicSoundChannel;
|
|
|
|
const char *_menuAudioFile;
|
2006-05-12 23:57:53 +00:00
|
|
|
};
|
|
|
|
|
2004-04-09 12:36:06 +00:00
|
|
|
} // End of namespace Kyra
|
|
|
|
|
|
|
|
#endif
|