2001-10-09 14:30:12 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
|
|
|
* Copyright (C) 2001 Ludvig Strigeus
|
2003-03-06 21:46:56 +00:00
|
|
|
* Copyright (C) 2001-2003 The ScummVM project
|
2001-10-09 14:30:12 +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
|
|
|
|
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
2001-11-06 20:00:47 +00:00
|
|
|
* $Header$
|
2001-10-09 14:30:12 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2002-05-14 19:11:20 +00:00
|
|
|
#ifndef SCUMM_H
|
|
|
|
#define SCUMM_H
|
|
|
|
|
2002-09-08 01:08:12 +00:00
|
|
|
#include "common/engine.h"
|
2002-11-06 16:01:36 +00:00
|
|
|
#include "common/gameDetector.h"
|
2002-09-13 12:20:55 +00:00
|
|
|
#include "common/file.h"
|
2002-12-24 16:10:31 +00:00
|
|
|
#include "common/map.h"
|
|
|
|
#include "common/str.h"
|
|
|
|
#include "common/timer.h"
|
2002-12-01 14:57:50 +00:00
|
|
|
#include "common/util.h"
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2002-12-25 21:04:47 +00:00
|
|
|
class CharsetRenderer;
|
2002-04-12 10:34:46 +00:00
|
|
|
class GameDetector;
|
2002-07-05 17:00:18 +00:00
|
|
|
class NewGui;
|
2002-09-19 21:45:56 +00:00
|
|
|
class Dialog;
|
2002-12-15 00:39:33 +00:00
|
|
|
class ConsoleDialog;
|
2002-03-20 17:51:07 +00:00
|
|
|
class Scumm;
|
2002-04-14 18:13:08 +00:00
|
|
|
class IMuse;
|
2002-09-29 07:08:31 +00:00
|
|
|
class IMuseDigital;
|
2002-05-14 23:35:28 +00:00
|
|
|
class Actor;
|
2002-08-29 23:45:15 +00:00
|
|
|
class Sound;
|
2002-09-13 12:20:55 +00:00
|
|
|
class Bundle;
|
2002-12-15 00:39:33 +00:00
|
|
|
class ScummDebugger;
|
2002-12-11 01:25:15 +00:00
|
|
|
class Serializer;
|
2002-07-16 21:03:14 +00:00
|
|
|
struct FindObjectInRoom;
|
2002-03-06 19:58:06 +00:00
|
|
|
|
2002-12-24 16:10:31 +00:00
|
|
|
typedef ScummVM::Map<ScummVM::String, int> ObjectIDMap;
|
|
|
|
|
2002-08-18 17:48:18 +00:00
|
|
|
// Use g_scumm from error() ONLY
|
2002-04-12 10:34:46 +00:00
|
|
|
extern Scumm *g_scumm;
|
|
|
|
|
2001-11-14 18:40:39 +00:00
|
|
|
/* System Wide Constants */
|
|
|
|
enum {
|
2002-05-05 17:44:39 +00:00
|
|
|
NUM_SCRIPT_SLOT = 40,
|
2001-11-26 19:57:57 +00:00
|
|
|
NUM_LOCALSCRIPT = 60,
|
|
|
|
NUM_SHADOW_PALETTE = 8,
|
2002-08-25 18:40:23 +00:00
|
|
|
KEY_SET_OPTIONS = 3456 // WinCE
|
2001-11-14 18:40:39 +00:00
|
|
|
};
|
2001-10-26 17:34:50 +00:00
|
|
|
|
2002-03-08 17:05:09 +00:00
|
|
|
struct ScummPoint {
|
2002-07-06 12:57:51 +00:00
|
|
|
int x, y;
|
2003-03-06 17:58:13 +00:00
|
|
|
bool operator == (const ScummPoint &p) const
|
2002-12-15 20:53:11 +00:00
|
|
|
{
|
|
|
|
return p.x == x && p.y == y;
|
|
|
|
}
|
2003-03-06 17:58:13 +00:00
|
|
|
bool operator != (const ScummPoint &p) const
|
2002-12-15 20:53:11 +00:00
|
|
|
{
|
|
|
|
return p.x != x || p.y != y;
|
|
|
|
}
|
2001-10-09 14:30:12 +00:00
|
|
|
};
|
|
|
|
|
2002-11-06 16:44:57 +00:00
|
|
|
#include "gfx.h"
|
|
|
|
#include "boxes.h"
|
|
|
|
|
2001-12-11 13:34:15 +00:00
|
|
|
struct MemBlkHeader {
|
|
|
|
uint32 size;
|
|
|
|
};
|
|
|
|
|
2002-11-29 15:13:49 +00:00
|
|
|
struct VerbSlot;
|
2001-11-11 16:54:45 +00:00
|
|
|
|
2002-12-25 21:42:22 +00:00
|
|
|
struct ObjectData {
|
2002-12-26 20:37:49 +00:00
|
|
|
uint32 OBIMoffset;
|
|
|
|
uint32 OBCDoffset;
|
2002-04-19 08:21:56 +00:00
|
|
|
int16 walk_x, walk_y;
|
2001-11-11 16:54:45 +00:00
|
|
|
uint16 obj_nr;
|
|
|
|
int16 x_pos;
|
|
|
|
int16 y_pos;
|
2001-11-26 19:57:57 +00:00
|
|
|
uint16 width;
|
2001-11-11 16:54:45 +00:00
|
|
|
uint16 height;
|
|
|
|
byte actordir;
|
|
|
|
byte parent;
|
|
|
|
byte parentstate;
|
2001-11-26 19:57:57 +00:00
|
|
|
byte state;
|
2001-11-11 16:54:45 +00:00
|
|
|
byte fl_object_index;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ScriptSlot {
|
|
|
|
uint32 offs;
|
|
|
|
int32 delay;
|
|
|
|
uint16 number;
|
2002-08-25 11:35:13 +00:00
|
|
|
uint16 delayFrameCount;
|
2001-11-11 16:54:45 +00:00
|
|
|
byte status;
|
2001-11-12 20:50:36 +00:00
|
|
|
byte where;
|
2002-12-09 01:27:40 +00:00
|
|
|
byte unk1, unk2, freezeCount;
|
|
|
|
bool didexec;
|
2001-11-11 16:54:45 +00:00
|
|
|
byte cutsceneOverride;
|
|
|
|
};
|
2001-10-10 10:02:33 +00:00
|
|
|
|
2001-11-11 16:54:45 +00:00
|
|
|
struct NestedScript {
|
|
|
|
uint16 number;
|
2001-11-12 20:50:36 +00:00
|
|
|
uint8 where;
|
2001-11-11 16:54:45 +00:00
|
|
|
uint8 slot;
|
|
|
|
};
|
2003-01-16 00:40:19 +00:00
|
|
|
|
|
|
|
struct BlastText {
|
|
|
|
int16 xpos, ypos;
|
2003-04-07 16:04:30 +00:00
|
|
|
int16 left, right, top, bottom;
|
2003-01-16 00:40:19 +00:00
|
|
|
byte color;
|
|
|
|
byte charset;
|
|
|
|
bool center;
|
|
|
|
byte text[256];
|
|
|
|
};
|
|
|
|
|
2001-11-05 19:21:49 +00:00
|
|
|
enum ResTypes {
|
2001-11-10 19:12:32 +00:00
|
|
|
rtFirst = 1,
|
2001-11-05 19:21:49 +00:00
|
|
|
rtRoom = 1,
|
|
|
|
rtScript = 2,
|
|
|
|
rtCostume = 3,
|
|
|
|
rtSound = 4,
|
|
|
|
rtInventory = 5,
|
|
|
|
rtCharset = 6,
|
|
|
|
rtString = 7,
|
|
|
|
rtVerb = 8,
|
|
|
|
rtActorName = 9,
|
|
|
|
rtBuffer = 10,
|
|
|
|
rtScaleTable = 11,
|
|
|
|
rtTemp = 12,
|
|
|
|
rtFlObject = 13,
|
|
|
|
rtMatrix = 14,
|
|
|
|
rtBox = 15,
|
|
|
|
rtObjectName = 16,
|
2002-07-04 15:48:17 +00:00
|
|
|
rtRoomScripts = 17,
|
|
|
|
rtLast = 17,
|
|
|
|
rtNumTypes = 18
|
2001-11-12 20:50:36 +00:00
|
|
|
};
|
2001-11-05 19:21:49 +00:00
|
|
|
|
2002-07-13 14:07:37 +00:00
|
|
|
enum {
|
|
|
|
LIGHTMODE_dark = 0,
|
|
|
|
LIGHTMODE_actor_base = 1,
|
|
|
|
LIGHTMODE_screen = 2,
|
|
|
|
LIGHTMODE_flashlight = 4,
|
|
|
|
LIGHTMODE_actor_color = 8
|
|
|
|
};
|
|
|
|
|
2001-11-14 20:09:39 +00:00
|
|
|
enum {
|
|
|
|
MBS_LEFT_CLICK = 0x8000,
|
|
|
|
MBS_RIGHT_CLICK = 0x4000,
|
2002-07-13 11:56:04 +00:00
|
|
|
MBS_MOUSE_MASK = (MBS_LEFT_CLICK | MBS_RIGHT_CLICK),
|
2001-11-14 20:09:39 +00:00
|
|
|
MBS_MAX_KEY = 0x0200
|
|
|
|
};
|
|
|
|
|
2003-03-01 22:04:48 +00:00
|
|
|
enum ScummGameId {
|
|
|
|
GID_TENTACLE = GID_SCUMM_FIRST,
|
|
|
|
GID_MONKEY2,
|
|
|
|
GID_INDY4,
|
|
|
|
GID_MONKEY,
|
|
|
|
GID_SAMNMAX,
|
|
|
|
GID_MONKEY_EGA,
|
|
|
|
GID_LOOM256,
|
|
|
|
GID_ZAK256,
|
|
|
|
GID_INDY3_256,
|
2003-04-06 19:41:34 +00:00
|
|
|
GID_INDY3,
|
2003-03-01 22:04:48 +00:00
|
|
|
GID_LOOM,
|
|
|
|
GID_FT,
|
|
|
|
GID_DIG,
|
|
|
|
GID_MONKEY_VGA,
|
|
|
|
GID_CMI,
|
|
|
|
GID_MANIAC,
|
|
|
|
GID_ZAK,
|
|
|
|
//GID_MANIAC64,
|
|
|
|
//GID_ZAK64,
|
|
|
|
GID_PUTTDEMO
|
|
|
|
};
|
|
|
|
|
2001-11-05 19:21:49 +00:00
|
|
|
#define _maxRooms res.num[rtRoom]
|
|
|
|
#define _maxScripts res.num[rtScript]
|
|
|
|
#define _maxCostumes res.num[rtCostume]
|
|
|
|
#define _maxInventoryItems res.num[rtInventory]
|
|
|
|
#define _maxCharsets res.num[rtCharset]
|
|
|
|
#define _maxStrings res.num[rtString]
|
|
|
|
#define _maxVerbs res.num[rtVerb]
|
|
|
|
#define _maxActorNames res.num[rtActorName]
|
|
|
|
#define _maxBuffer res.num[rtBuffer]
|
|
|
|
#define _maxScaleTable res.num[rtScaleTable]
|
|
|
|
#define _maxTemp res.num[rtTemp]
|
|
|
|
#define _maxFLObject res.num[rtFlObject]
|
|
|
|
#define _maxMatrixes res.num[rtMatrix]
|
|
|
|
#define _maxBoxes res.num[rtBox]
|
|
|
|
|
|
|
|
#define _baseRooms res.address[rtRoom]
|
|
|
|
#define _baseScripts res.address[rtScript]
|
|
|
|
#define _baseInventoryItems res.address[rtInventory]
|
|
|
|
#define _baseFLObject res.address[rtFlObject]
|
|
|
|
#define _baseArrays res.address[rtString]
|
|
|
|
|
|
|
|
#define _roomFileOffsets res.roomoffs[rtRoom]
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2001-10-16 10:01:48 +00:00
|
|
|
#define ARRAY_HDR_SIZE 6
|
|
|
|
struct ArrayHeader {
|
|
|
|
int16 dim1_size;
|
|
|
|
int16 type;
|
|
|
|
int16 dim2_size;
|
|
|
|
byte data[1];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SentenceTab {
|
2003-04-28 03:13:49 +00:00
|
|
|
byte verb;
|
2002-07-06 12:57:51 +00:00
|
|
|
byte unk2;
|
|
|
|
uint16 unk4;
|
|
|
|
uint16 unk3;
|
2002-12-09 01:27:40 +00:00
|
|
|
uint8 freezeCount;
|
2001-10-16 10:01:48 +00:00
|
|
|
};
|
|
|
|
|
2002-09-22 01:17:53 +00:00
|
|
|
// TODO / FIXME: next time save game format changes, Fingolfin would like to
|
|
|
|
// revise StringTab. In particular, all t_* fields can be removed, making some
|
|
|
|
// code a bit cleaner & easier to understand.
|
2001-10-16 10:01:48 +00:00
|
|
|
struct StringTab {
|
2001-11-07 18:10:52 +00:00
|
|
|
int16 t_xpos, t_ypos;
|
|
|
|
int16 t_right;
|
2001-10-16 10:01:48 +00:00
|
|
|
int16 xpos, ypos;
|
2001-11-07 18:10:52 +00:00
|
|
|
int16 right;
|
|
|
|
byte color, t_color;
|
|
|
|
byte charset, t_charset;
|
|
|
|
bool center, t_center;
|
|
|
|
bool overhead, t_overhead;
|
2002-07-13 11:56:04 +00:00
|
|
|
bool no_talk_anim, t_no_talk_anim;
|
2001-10-16 10:01:48 +00:00
|
|
|
};
|
|
|
|
|
2001-11-12 20:50:36 +00:00
|
|
|
enum WhereIsObject {
|
|
|
|
WIO_NOT_FOUND = -1,
|
|
|
|
WIO_INVENTORY = 0,
|
|
|
|
WIO_ROOM = 1,
|
|
|
|
WIO_GLOBAL = 2,
|
|
|
|
WIO_LOCAL = 3,
|
2002-03-10 07:48:01 +00:00
|
|
|
WIO_FLOBJECT = 4
|
2001-11-12 20:50:36 +00:00
|
|
|
};
|
|
|
|
|
2001-12-27 17:51:58 +00:00
|
|
|
enum MouseButtonStatus {
|
|
|
|
msDown = 1,
|
2002-03-10 07:48:01 +00:00
|
|
|
msClicked = 2
|
|
|
|
};
|
|
|
|
|
2003-02-14 16:01:55 +00:00
|
|
|
struct langIndexNode {
|
|
|
|
char tag[9];
|
|
|
|
int32 offset;
|
|
|
|
};
|
|
|
|
|
2002-08-14 10:18:03 +00:00
|
|
|
class Scumm : public Engine {
|
2003-02-08 00:38:17 +00:00
|
|
|
friend class ScummDebugger;
|
2003-03-17 12:32:46 +00:00
|
|
|
friend class SmushPlayer;
|
2003-03-07 15:38:11 +00:00
|
|
|
void errorString(const char *buf_input, char *buf_output);
|
2002-03-20 17:51:07 +00:00
|
|
|
public:
|
2002-04-12 21:26:59 +00:00
|
|
|
/* Put often used variables at the top.
|
|
|
|
* That results in a shorter form of the opcode
|
|
|
|
* on some architectures. */
|
2002-04-14 18:13:08 +00:00
|
|
|
IMuse *_imuse;
|
2002-09-29 07:08:31 +00:00
|
|
|
IMuseDigital *_imuseDigital;
|
2002-04-12 21:26:59 +00:00
|
|
|
uint32 _features;
|
|
|
|
VerbSlot *_verbs;
|
|
|
|
ObjectData *_objs;
|
|
|
|
ScummDebugger *_debugger;
|
2003-02-08 01:27:21 +00:00
|
|
|
Bundle *_bundle;
|
|
|
|
Timer *_timer;
|
|
|
|
Sound *_sound;
|
2001-10-09 14:30:12 +00:00
|
|
|
|
|
|
|
struct {
|
2001-11-10 19:12:32 +00:00
|
|
|
byte mode[rtNumTypes];
|
|
|
|
uint16 num[rtNumTypes];
|
|
|
|
uint32 tags[rtNumTypes];
|
|
|
|
const char *name[rtNumTypes];
|
|
|
|
byte **address[rtNumTypes];
|
|
|
|
byte *flags[rtNumTypes];
|
|
|
|
byte *roomno[rtNumTypes];
|
|
|
|
uint32 *roomoffs[rtNumTypes];
|
2001-10-09 14:30:12 +00:00
|
|
|
} res;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
uint32 cutScenePtr[5];
|
|
|
|
byte cutSceneScript[5];
|
|
|
|
int16 cutSceneData[5];
|
|
|
|
int16 cutSceneScriptIndex;
|
|
|
|
byte cutSceneStackPointer;
|
2001-10-26 17:34:50 +00:00
|
|
|
ScriptSlot slot[NUM_SCRIPT_SLOT];
|
2001-10-09 14:30:12 +00:00
|
|
|
NestedScript nest[15];
|
2003-01-15 16:23:04 +00:00
|
|
|
int32 localvar[NUM_SCRIPT_SLOT][26];
|
2001-10-09 14:30:12 +00:00
|
|
|
} vm;
|
|
|
|
|
|
|
|
struct {
|
2002-07-13 11:56:04 +00:00
|
|
|
int16 x, y;
|
2001-10-09 14:30:12 +00:00
|
|
|
} mouse;
|
|
|
|
|
2003-02-08 01:27:21 +00:00
|
|
|
// Constructor / Destructor
|
|
|
|
Scumm(GameDetector *detector, OSystem *syst);
|
|
|
|
virtual ~Scumm();
|
2002-03-21 00:40:18 +00:00
|
|
|
|
2003-02-08 01:27:21 +00:00
|
|
|
// Init functions
|
2002-12-29 19:54:11 +00:00
|
|
|
void scummInit();
|
|
|
|
void initScummVars();
|
2003-02-08 01:27:21 +00:00
|
|
|
virtual void setupScummVars();
|
2002-12-29 19:54:11 +00:00
|
|
|
|
2003-02-08 01:27:21 +00:00
|
|
|
// Startup functions
|
|
|
|
void main();
|
|
|
|
void parseCommandLine(int argc, char **argv);
|
|
|
|
void showHelpAndExit();
|
|
|
|
bool detectGame();
|
2002-12-29 19:54:11 +00:00
|
|
|
void launch();
|
|
|
|
void go();
|
|
|
|
|
2003-02-08 01:27:21 +00:00
|
|
|
// Scumm main loop
|
|
|
|
void mainRun();
|
|
|
|
int scummLoop(int delta);
|
2003-03-06 17:58:13 +00:00
|
|
|
|
2003-02-08 01:27:21 +00:00
|
|
|
// Event handling
|
2003-03-17 12:32:46 +00:00
|
|
|
void parseEvents();
|
2002-12-29 19:54:11 +00:00
|
|
|
void waitForTimer(int msec_delay);
|
2003-02-08 01:27:21 +00:00
|
|
|
void processKbd();
|
|
|
|
int checkKeyHit();
|
|
|
|
void convertKeysToClicks();
|
|
|
|
int getKeyInput();
|
2002-12-29 19:54:11 +00:00
|
|
|
|
2003-02-08 01:27:21 +00:00
|
|
|
// Misc utility functions
|
|
|
|
void checkRange(int max, int min, int no, const char *str);
|
|
|
|
const char *getExeName() const { return _exe_name; }
|
|
|
|
const char *getGameDataPath() const { return _gameDataPath; }
|
|
|
|
|
|
|
|
// Cursor/palette
|
2002-12-29 19:54:11 +00:00
|
|
|
void updateCursor();
|
|
|
|
void animateCursor();
|
|
|
|
void updatePalette();
|
|
|
|
|
2002-03-25 12:26:37 +00:00
|
|
|
/* _insane vars */
|
2002-12-25 16:55:43 +00:00
|
|
|
int _smushFrameRate;
|
2002-10-08 00:29:32 +00:00
|
|
|
bool _insaneState;
|
|
|
|
bool _videoFinished;
|
2003-03-17 12:32:46 +00:00
|
|
|
bool _smushPlay;
|
2002-03-25 12:26:37 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
void pauseGame(bool user);
|
|
|
|
void shutDown(int i);
|
|
|
|
void setOptions(void);
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2003-04-30 13:23:31 +00:00
|
|
|
#ifdef __PALM_OS__
|
|
|
|
bool _quit; // try to exit properly
|
|
|
|
#endif
|
2002-09-19 21:45:56 +00:00
|
|
|
// GUI
|
|
|
|
NewGui *_newgui;
|
|
|
|
|
|
|
|
Dialog *_pauseDialog;
|
|
|
|
Dialog *_optionsDialog;
|
|
|
|
Dialog *_saveLoadDialog;
|
2002-12-27 00:38:32 +00:00
|
|
|
// Debugger access this one, too...
|
2002-12-15 00:39:33 +00:00
|
|
|
ConsoleDialog *_debuggerDialog;
|
2002-09-19 21:45:56 +00:00
|
|
|
|
2002-11-10 14:59:15 +00:00
|
|
|
int runDialog(Dialog *dialog);
|
2002-09-19 21:45:56 +00:00
|
|
|
void pauseDialog();
|
|
|
|
void saveloadDialog();
|
|
|
|
void optionsDialog();
|
2003-01-02 10:36:17 +00:00
|
|
|
char displayError(bool showCancel, const char *message, ...);
|
2002-09-19 21:45:56 +00:00
|
|
|
|
2003-02-08 00:38:17 +00:00
|
|
|
protected:
|
2003-02-08 01:27:21 +00:00
|
|
|
byte _fastMode;
|
2003-01-16 12:47:34 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
/* Random number generation */
|
2002-12-01 14:57:50 +00:00
|
|
|
RandomSource _rnd;
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2003-02-08 00:38:17 +00:00
|
|
|
public:
|
2002-03-20 17:51:07 +00:00
|
|
|
/* Core variable definitions */
|
|
|
|
byte _gameId;
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
/* Core class/array definitions */
|
2001-10-26 17:34:50 +00:00
|
|
|
Gdi gdi;
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2003-02-08 00:38:17 +00:00
|
|
|
protected:
|
2002-12-23 23:30:14 +00:00
|
|
|
Actor *_actors; // Has NUM_ACTORS elements
|
2002-03-20 17:51:07 +00:00
|
|
|
|
|
|
|
uint16 *_inventory;
|
|
|
|
byte *_arrays;
|
|
|
|
uint16 *_newNames;
|
2003-02-08 00:38:17 +00:00
|
|
|
public:
|
2003-05-08 15:48:50 +00:00
|
|
|
// VAR is a wrapper around scummVar, which attempts to include additional
|
|
|
|
// useful information should an illegal var access be detected.
|
|
|
|
#define VAR(x) scummVar(x, #x, __FILE__, __LINE__)
|
|
|
|
inline int32& scummVar(byte var, const char *varName, const char *file, int line)
|
|
|
|
{
|
|
|
|
if (var == 0xFF)
|
|
|
|
warning("Illegal access to variable %s in file %s, line %d", varName, file, line);
|
|
|
|
return _scummVars[var];
|
|
|
|
}
|
|
|
|
|
2003-02-08 00:38:17 +00:00
|
|
|
protected:
|
2002-03-20 17:51:07 +00:00
|
|
|
int16 _varwatch;
|
2003-05-08 15:48:50 +00:00
|
|
|
int32 *_scummVars;
|
2002-03-20 17:51:07 +00:00
|
|
|
byte *_bitVars;
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
/* Global resource tables */
|
|
|
|
int _numVariables, _numBitVariables, _numLocalObjects;
|
|
|
|
int _numGlobalObjects, _numArray, _numVerbs, _numFlObject;
|
|
|
|
int _numInventory, _numRooms, _numScripts, _numSounds;
|
2003-02-08 00:38:17 +00:00
|
|
|
int _numCharsets, _numNewNames, _numGlobalScripts;
|
2002-03-20 17:51:07 +00:00
|
|
|
int NUM_ACTORS;
|
2003-02-08 00:38:17 +00:00
|
|
|
public:
|
|
|
|
int _numCostumes; // FIXME - should be protected, used by Actor::remapActorPalette
|
|
|
|
|
2002-10-11 08:35:12 +00:00
|
|
|
char *_audioNames;
|
|
|
|
int32 _numAudioNames;
|
|
|
|
|
2003-02-08 00:38:17 +00:00
|
|
|
protected:
|
2002-03-20 17:51:07 +00:00
|
|
|
/* Current objects - can go in their respective classes */
|
|
|
|
byte _curActor;
|
|
|
|
int _curVerb;
|
|
|
|
int _curVerbSlot;
|
|
|
|
int _curPalIndex;
|
2003-02-08 00:38:17 +00:00
|
|
|
public:
|
2002-03-20 17:51:07 +00:00
|
|
|
byte _currentRoom;
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2003-02-08 00:38:17 +00:00
|
|
|
bool _egoPositioned; // Used by Actor::putActor, hence public
|
|
|
|
protected:
|
2002-03-20 17:51:07 +00:00
|
|
|
int _keyPressed;
|
2001-10-09 14:30:12 +00:00
|
|
|
uint16 _lastKeyHit;
|
2002-03-20 17:51:07 +00:00
|
|
|
uint16 _mouseButStat;
|
|
|
|
byte _leftBtnPressed, _rightBtnPressed;
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2002-12-25 14:46:39 +00:00
|
|
|
int16 _virtual_mouse_x, _virtual_mouse_y;
|
|
|
|
int _bootParam;
|
2003-04-20 14:28:25 +00:00
|
|
|
bool _dumpScripts, _hexdumpScripts;
|
|
|
|
int _showStack;
|
2002-12-04 22:31:36 +00:00
|
|
|
uint16 _debugMode, _soundCardType;
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
/* Not sure where this stuff goes */
|
2003-01-29 08:07:10 +00:00
|
|
|
uint16 _language;
|
2002-03-20 17:51:07 +00:00
|
|
|
void startScene(int room, Actor *a, int b);
|
|
|
|
byte *_objectOwnerTable, *_objectRoomTable, *_objectStateTable;
|
2002-12-24 16:10:31 +00:00
|
|
|
ObjectIDMap _objectIDMap;
|
2002-03-20 17:51:07 +00:00
|
|
|
byte _numObjectsInRoom;
|
|
|
|
int8 _userPut;
|
|
|
|
int _resourceHeaderSize;
|
|
|
|
void clearClickedStatus();
|
|
|
|
void startManiac();
|
2001-11-05 19:21:49 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
/* GUI class */
|
|
|
|
void drawString(int a);
|
2001-11-09 18:54:15 +00:00
|
|
|
|
2003-02-08 01:27:21 +00:00
|
|
|
protected:
|
2002-03-20 17:51:07 +00:00
|
|
|
/* Save/Load class - some of this may be GUI */
|
|
|
|
byte _saveLoadFlag, _saveLoadSlot;
|
2002-12-13 03:23:17 +00:00
|
|
|
uint32 _lastSaveTime;
|
2002-03-20 17:51:07 +00:00
|
|
|
bool _saveLoadCompatible;
|
2001-11-09 18:54:15 +00:00
|
|
|
char _saveLoadName[32];
|
|
|
|
|
2002-12-17 01:15:13 +00:00
|
|
|
bool saveState(int slot, bool compat, SaveFileManager *mgr);
|
|
|
|
bool loadState(int slot, bool compat, SaveFileManager *mgr);
|
2003-03-06 17:58:13 +00:00
|
|
|
bool saveState(int slot, bool compat) {
|
2002-12-17 01:15:13 +00:00
|
|
|
SaveFileManager *mgr = _system->get_savefile_manager();
|
|
|
|
bool result = saveState(slot, compat, mgr);
|
|
|
|
delete mgr;
|
|
|
|
return result;
|
|
|
|
}
|
2003-03-06 17:58:13 +00:00
|
|
|
bool loadState(int slot, bool compat) {
|
2002-12-17 01:15:13 +00:00
|
|
|
SaveFileManager *mgr = _system->get_savefile_manager();
|
|
|
|
bool result = loadState(slot, compat, mgr);
|
|
|
|
delete mgr;
|
|
|
|
return result;
|
|
|
|
}
|
2002-12-13 03:23:17 +00:00
|
|
|
void saveOrLoad(Serializer *s, uint32 savegameVersion);
|
2001-11-14 18:40:39 +00:00
|
|
|
|
2003-02-08 01:27:21 +00:00
|
|
|
public:
|
2002-12-17 01:15:13 +00:00
|
|
|
bool getSavegameName(int slot, char *desc, SaveFileManager *mgr);
|
2002-03-20 17:51:07 +00:00
|
|
|
void makeSavegameName(char *out, int slot, bool compatible);
|
|
|
|
void saveLoadResource(Serializer *ser, int type, int index);
|
2002-12-17 01:15:13 +00:00
|
|
|
void listSavegames(bool *marks, int num, SaveFileManager *mgr);
|
2003-02-08 01:27:21 +00:00
|
|
|
|
|
|
|
void requestSave(int slot, const char *name);
|
|
|
|
void requestLoad(int slot);
|
2001-10-16 10:01:48 +00:00
|
|
|
|
2003-02-08 01:27:21 +00:00
|
|
|
protected:
|
2002-03-20 17:51:07 +00:00
|
|
|
/* Heap and memory management */
|
|
|
|
uint32 _maxHeapThreshold, _minHeapThreshold;
|
|
|
|
void lock(int type, int i);
|
|
|
|
void unlock(int type, int i);
|
|
|
|
void heapClear(int mode);
|
|
|
|
void unkHeapProc2(int a, int b);
|
2002-03-16 05:33:25 +00:00
|
|
|
|
2003-02-06 21:32:20 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
/* Script VM - should be in Script class */
|
|
|
|
uint32 _localScriptList[NUM_LOCALSCRIPT];
|
2003-02-06 21:32:20 +00:00
|
|
|
byte *_scriptPointer, *_scriptOrgPointer;
|
2002-03-20 17:51:07 +00:00
|
|
|
byte _opcode, _numNestedScripts, _currentScript;
|
|
|
|
uint16 _curExecScript;
|
|
|
|
byte **_lastCodePtr;
|
|
|
|
int _resultVarNumber, _scummStackPos;
|
2002-12-25 14:46:39 +00:00
|
|
|
int _localParamList[16], _scummStack[150];
|
2003-02-08 01:27:21 +00:00
|
|
|
int _keyScriptKey, _keyScriptNo;
|
2002-03-20 17:51:07 +00:00
|
|
|
|
2002-12-16 12:12:31 +00:00
|
|
|
virtual void setupOpcodes() = 0;
|
|
|
|
virtual void executeOpcode(int i) = 0;
|
|
|
|
virtual const char *getOpcodeDesc(int i) = 0;
|
|
|
|
|
2002-12-25 14:46:39 +00:00
|
|
|
void initializeLocals(int slot, int *vars);
|
2002-03-20 17:51:07 +00:00
|
|
|
int getScriptSlot();
|
2003-02-06 21:32:20 +00:00
|
|
|
|
|
|
|
public:
|
2002-12-25 14:46:39 +00:00
|
|
|
void runScript(int script, int a, int b, int *lvarptr);
|
2002-03-20 17:51:07 +00:00
|
|
|
void stopScriptNr(int script);
|
2003-02-06 21:32:20 +00:00
|
|
|
|
|
|
|
protected:
|
2002-03-20 17:51:07 +00:00
|
|
|
void runScriptNested(int script);
|
|
|
|
void executeScript();
|
|
|
|
void updateScriptPtr();
|
|
|
|
void getScriptBaseAddress();
|
|
|
|
void getScriptEntryPoint();
|
|
|
|
byte fetchScriptByte();
|
2002-12-23 00:23:36 +00:00
|
|
|
virtual uint fetchScriptWord();
|
|
|
|
virtual int fetchScriptWordSigned();
|
2002-03-20 17:51:07 +00:00
|
|
|
void ignoreScriptWord() { fetchScriptWord(); }
|
|
|
|
void ignoreScriptByte() { fetchScriptByte(); }
|
2003-05-04 02:27:22 +00:00
|
|
|
virtual void getResultPos();
|
2002-03-20 17:51:07 +00:00
|
|
|
void setResult(int result);
|
|
|
|
void push(int a);
|
|
|
|
int pop();
|
2003-02-06 21:32:20 +00:00
|
|
|
public:
|
2003-02-08 00:38:17 +00:00
|
|
|
virtual int readVar(uint var); // FIXME - should be protected, used in scumm/dialogs.cpp
|
2003-02-06 21:32:20 +00:00
|
|
|
protected:
|
2002-12-23 18:30:12 +00:00
|
|
|
virtual void writeVar(uint var, int value);
|
2002-03-20 17:51:07 +00:00
|
|
|
void runHook(int i);
|
|
|
|
bool isScriptInUse(int script);
|
|
|
|
|
|
|
|
void freezeScripts(int scr);
|
|
|
|
void unfreezeScripts();
|
|
|
|
void runAllScripts();
|
2002-12-25 14:46:39 +00:00
|
|
|
void cutscene(int *args);
|
2002-03-20 17:51:07 +00:00
|
|
|
void endCutscene();
|
2003-02-08 00:38:17 +00:00
|
|
|
void exitCutscene();
|
2002-03-20 17:51:07 +00:00
|
|
|
void runExitScript();
|
|
|
|
void runEntryScript();
|
|
|
|
|
|
|
|
void beginOverride();
|
|
|
|
void endOverride();
|
2002-12-25 20:29:40 +00:00
|
|
|
void killAllScriptsExceptCurrent();
|
2002-03-20 17:51:07 +00:00
|
|
|
void killScriptsAndResources();
|
2002-12-09 01:27:40 +00:00
|
|
|
void checkAndRunSentenceScript();
|
2002-03-20 17:51:07 +00:00
|
|
|
void decreaseScriptDelay(int amount);
|
2003-02-06 21:32:20 +00:00
|
|
|
public:
|
2003-02-08 00:38:17 +00:00
|
|
|
bool isScriptRunning(int script); // FIXME - should be protected, used by Sound::startTalkSound
|
2003-02-06 21:32:20 +00:00
|
|
|
protected:
|
2002-03-20 17:51:07 +00:00
|
|
|
bool isRoomScriptRunning(int script);
|
2002-12-28 01:57:19 +00:00
|
|
|
void copyScriptString(byte *dst);
|
|
|
|
int resStrLen(const byte *src) const;
|
2002-03-20 17:51:07 +00:00
|
|
|
void doSentence(int c, int b, int a);
|
2002-12-16 12:12:31 +00:00
|
|
|
void setStringVars(int i);
|
2002-03-20 17:51:07 +00:00
|
|
|
|
|
|
|
/* Script VM or Object class? */
|
|
|
|
void stopObjectCode();
|
|
|
|
void stopObjectScript(int script);
|
|
|
|
|
|
|
|
/* Should be in Resource class */
|
|
|
|
byte _encbyte;
|
2002-09-10 07:34:27 +00:00
|
|
|
File _fileHandle;
|
2002-03-20 17:51:07 +00:00
|
|
|
uint32 _fileOffset;
|
2002-10-28 09:03:02 +00:00
|
|
|
char *_exe_name; // This is the name we use for opening resource files
|
|
|
|
char *_game_name; // This is the game the user calls it, so use for saving
|
2002-03-20 17:51:07 +00:00
|
|
|
bool _dynamicRoomOffsets;
|
|
|
|
byte _resourceMapper[128];
|
|
|
|
uint32 _allocatedSize;
|
|
|
|
byte _expire_counter;
|
2002-03-16 05:33:25 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
void allocateArrays();
|
2001-10-09 14:30:12 +00:00
|
|
|
void openRoom(int room);
|
2002-12-22 21:58:16 +00:00
|
|
|
void closeRoom();
|
2001-10-09 14:30:12 +00:00
|
|
|
void deleteRoomOffsets();
|
|
|
|
void readRoomsOffsets();
|
2003-01-02 10:36:17 +00:00
|
|
|
void askForDisk(const char *filename, int disknum);
|
2001-10-09 14:30:12 +00:00
|
|
|
bool openResourceFile(const char *filename);
|
2003-02-08 00:38:17 +00:00
|
|
|
|
2003-03-07 21:38:46 +00:00
|
|
|
protected:
|
2002-03-20 17:51:07 +00:00
|
|
|
void loadPtrToResource(int type, int i, byte *ptr);
|
2001-10-09 14:30:12 +00:00
|
|
|
void readResTypeList(int id, uint32 tag, const char *name);
|
2002-04-26 14:13:39 +00:00
|
|
|
char *resTypeFromId(int id);
|
2001-10-09 14:30:12 +00:00
|
|
|
void allocResTypeData(int id, uint32 tag, int num, const char *name, int mode);
|
|
|
|
byte *createResource(int type, int index, uint32 size);
|
2003-03-07 21:38:46 +00:00
|
|
|
int loadResource(int type, int i);
|
2002-03-20 17:51:07 +00:00
|
|
|
void nukeResource(int type, int i);
|
2003-03-07 21:38:46 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
bool isGlobInMemory(int type, int index);
|
|
|
|
bool isResourceLoaded(int type, int index);
|
2001-10-09 14:30:12 +00:00
|
|
|
byte *getResourceAddress(int type, int i);
|
2001-10-24 20:12:52 +00:00
|
|
|
byte *getStringAddress(int i);
|
2002-04-21 19:38:00 +00:00
|
|
|
byte *getStringAddressVar(int i);
|
2001-10-09 14:30:12 +00:00
|
|
|
void ensureResourceLoaded(int type, int i);
|
|
|
|
int getResourceRoomNr(int type, int index);
|
2003-03-07 21:38:46 +00:00
|
|
|
|
|
|
|
protected:
|
2001-10-09 14:30:12 +00:00
|
|
|
int readSoundResource(int type, int index);
|
2002-09-21 13:48:03 +00:00
|
|
|
int readSoundResourceSmallHeader(int type, int index);
|
2001-11-05 19:21:49 +00:00
|
|
|
void setResourceCounter(int type, int index, byte flag);
|
2002-09-25 03:04:28 +00:00
|
|
|
bool validateResource(const char *str, int type, int index);
|
2002-03-20 17:51:07 +00:00
|
|
|
void increaseResourceCounter();
|
|
|
|
bool isResourceInUse(int type, int i);
|
|
|
|
void initRoomSubBlocks();
|
2003-01-26 10:57:01 +00:00
|
|
|
void clearRoomObjects();
|
2002-03-20 17:51:07 +00:00
|
|
|
void loadRoomObjects();
|
2002-12-26 21:50:13 +00:00
|
|
|
void loadRoomObjectsSmall();
|
2003-04-12 02:09:00 +00:00
|
|
|
void loadRoomObjectsOldBundle();
|
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
void readArrayFromIndexFile();
|
2003-03-07 21:38:46 +00:00
|
|
|
virtual void readMAXS();
|
2002-03-23 22:03:35 +00:00
|
|
|
virtual void readIndexFile();
|
2002-03-25 02:09:05 +00:00
|
|
|
virtual void loadCharset(int i);
|
2002-03-20 17:51:07 +00:00
|
|
|
void nukeCharset(int i);
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2003-03-07 21:38:46 +00:00
|
|
|
int _lastLoadedRoom;
|
|
|
|
public:
|
|
|
|
int _roomResource; // FIXME - should be protected but Sound::pauseSounds accesses it
|
2002-03-20 17:51:07 +00:00
|
|
|
byte *findResourceData(uint32 tag, byte *ptr);
|
|
|
|
int getResourceDataSize(byte *ptr);
|
2003-04-30 11:15:11 +00:00
|
|
|
void dumpResource(char *tag, int index, byte *ptr, int length = -1);
|
2003-03-06 17:58:13 +00:00
|
|
|
|
2003-03-07 21:38:46 +00:00
|
|
|
protected:
|
2002-03-20 17:51:07 +00:00
|
|
|
int getArrayId();
|
|
|
|
void nukeArray(int a);
|
|
|
|
int defineArray(int a, int b, int c, int d);
|
|
|
|
int readArray(int array, int index, int base);
|
|
|
|
void writeArray(int array, int index, int base, int value);
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
void resourceStats();
|
|
|
|
void expireResources(uint32 size);
|
|
|
|
void freeResources();
|
|
|
|
void destroy();
|
|
|
|
|
2003-03-07 21:38:46 +00:00
|
|
|
public:
|
2002-03-20 17:51:07 +00:00
|
|
|
/* Should be in Object class */
|
|
|
|
byte OF_OWNER_ROOM;
|
|
|
|
int getInventorySlot();
|
|
|
|
void SamInventoryHack(int obj); // FIXME: Sam and Max hack
|
|
|
|
int findInventory(int owner, int index);
|
|
|
|
int getInventoryCount(int owner);
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2002-12-27 14:36:28 +00:00
|
|
|
void setupRoomObject(ObjectData *od, byte *room, byte *searchptr = NULL);
|
2002-03-20 17:51:07 +00:00
|
|
|
void removeObjectFromRoom(int obj);
|
|
|
|
void loadFlObject(uint object, uint room);
|
|
|
|
void nukeFlObjects(int min, int max);
|
|
|
|
int findFlObjectSlot();
|
2003-01-12 07:30:17 +00:00
|
|
|
int findLocalObjectSlot();
|
2002-03-20 17:51:07 +00:00
|
|
|
void addObjectToInventory(uint obj, uint room);
|
|
|
|
void fixObjectFlags();
|
2001-10-09 14:30:12 +00:00
|
|
|
bool getClass(int obj, int cls);
|
|
|
|
void putClass(int obj, int cls, bool set);
|
|
|
|
int getState(int obj);
|
|
|
|
void putState(int obj, int state);
|
2002-03-20 17:51:07 +00:00
|
|
|
void setObjectState(int obj, int state, int x, int y);
|
2001-10-09 14:30:12 +00:00
|
|
|
int getOwner(int obj);
|
|
|
|
void putOwner(int obj, int owner);
|
2002-03-20 17:51:07 +00:00
|
|
|
void setOwnerOf(int obj, int owner);
|
|
|
|
void clearOwnerOf(int obj);
|
2001-11-26 19:57:57 +00:00
|
|
|
int getObjectRoom(int obj);
|
2002-03-20 17:51:07 +00:00
|
|
|
int getObjX(int obj);
|
|
|
|
int getObjY(int obj);
|
2002-07-16 18:51:27 +00:00
|
|
|
void getObjectXYPos(int object, int &x, int &y) { int dir; getObjectXYPos(object, x, y, dir); }
|
|
|
|
void getObjectXYPos(int object, int &x, int &y, int &dir);
|
2002-03-20 17:51:07 +00:00
|
|
|
int getObjOldDir(int obj);
|
|
|
|
int getObjNewDir(int obj);
|
|
|
|
int getObjectIndex(int object);
|
|
|
|
int whereIsObject(int object);
|
|
|
|
int findObject(int x, int y);
|
|
|
|
void findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint object, uint room);
|
2002-07-16 18:51:27 +00:00
|
|
|
int getObjectOrActorXY(int object, int &x, int &y); // Object and Actor...
|
2002-03-20 17:51:07 +00:00
|
|
|
int getObjActToObjActDist(int a, int b); // Not sure how to handle
|
|
|
|
byte *getObjOrActorName(int obj); // these three..
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
void addObjectToDrawQue(int object);
|
|
|
|
void clearDrawObjectQueue();
|
|
|
|
void processDrawQue();
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
uint32 getOBCDOffs(int object);
|
|
|
|
byte *getOBCDFromObject(int obj);
|
|
|
|
int getDistanceBetween(bool is_obj_1, int b, int c, bool is_obj_2, int e, int f);
|
2001-10-09 14:30:12 +00:00
|
|
|
|
|
|
|
|
2003-02-08 00:38:17 +00:00
|
|
|
protected:
|
2002-03-20 17:51:07 +00:00
|
|
|
/* Should be in Verb class */
|
2002-05-07 18:44:34 +00:00
|
|
|
uint16 _verbMouseOver;
|
|
|
|
int _inventoryOffset;
|
2002-03-20 17:51:07 +00:00
|
|
|
void redrawVerbs();
|
|
|
|
void checkExecVerbs();
|
|
|
|
void verbMouseOver(int verb);
|
|
|
|
int checkMouseOver(int x, int y);
|
|
|
|
void drawVerb(int verb, int mode);
|
|
|
|
void runInputScript(int a, int cmd, int mode);
|
|
|
|
void restoreVerbBG(int verb);
|
2002-08-14 09:53:34 +00:00
|
|
|
void drawVerbBitmap(int verb, int x, int y);
|
2001-10-09 14:30:12 +00:00
|
|
|
int getVerbEntrypoint(int obj, int entry);
|
|
|
|
int getVerbSlot(int id, int mode);
|
|
|
|
void killVerb(int slot);
|
2002-12-25 14:46:39 +00:00
|
|
|
void runVerbCode(int script, int entry, int a, int b, int *vars);
|
2001-11-06 20:00:47 +00:00
|
|
|
void setVerbObject(uint room, uint object, uint verb);
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2003-02-08 00:38:17 +00:00
|
|
|
public:
|
2002-03-20 17:51:07 +00:00
|
|
|
/* Should be in Actor class */
|
2002-05-14 23:35:28 +00:00
|
|
|
Actor *derefActor(int id);
|
2001-10-09 14:30:12 +00:00
|
|
|
Actor *derefActorSafe(int id, const char *errmsg);
|
2002-03-20 17:51:07 +00:00
|
|
|
void showActors();
|
2001-10-09 19:02:28 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
uint32 *_classData;
|
2001-10-09 19:02:28 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
int getAngleFromPos(int x, int y);
|
2001-10-16 10:01:48 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
void walkActors();
|
|
|
|
void playActorSounds();
|
2002-09-17 12:52:53 +00:00
|
|
|
void setActorRedrawFlags(bool fg, bool bg);
|
2002-03-20 17:51:07 +00:00
|
|
|
void resetActorBgs();
|
|
|
|
void processActors();
|
2003-02-27 10:17:29 +00:00
|
|
|
void processUpperActors();
|
2002-03-20 17:51:07 +00:00
|
|
|
int getActorFromPos(int x, int y);
|
2001-10-16 10:01:48 +00:00
|
|
|
void actorFollowCamera(int act);
|
2002-03-20 17:51:07 +00:00
|
|
|
|
|
|
|
bool isCostumeInUse(int i);
|
2001-10-16 10:01:48 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
/* Actor talking stuff */
|
|
|
|
byte _actorToPrintStrFor;
|
|
|
|
int _sentenceNum;
|
2002-09-22 01:17:53 +00:00
|
|
|
SentenceTab _sentence[6];
|
|
|
|
StringTab _string[6];
|
2002-03-20 17:51:07 +00:00
|
|
|
void actorTalk();
|
2003-02-08 01:27:21 +00:00
|
|
|
void stopTalk();
|
|
|
|
|
|
|
|
// Costume class
|
|
|
|
void cost_decodeData(Actor *a, int frame, uint usemask);
|
|
|
|
int cost_frameToAnim(Actor *a, int frame);
|
2002-04-12 10:34:46 +00:00
|
|
|
|
2003-02-08 01:27:21 +00:00
|
|
|
// Akos Class
|
2002-04-12 10:34:46 +00:00
|
|
|
bool akos_increaseAnims(byte *akos, Actor *a);
|
|
|
|
bool akos_increaseAnim(Actor *a, int i, byte *aksq, uint16 *akfo, int numakfo);
|
|
|
|
void akos_queCommand(byte cmd, Actor *a, int param_1, int param_2);
|
|
|
|
bool akos_compare(int a, int b, byte cmd);
|
|
|
|
void akos_decodeData(Actor *a, int frame, uint usemask);
|
|
|
|
int akos_frameToAnim(Actor *a, int frame);
|
|
|
|
bool akos_hasManyDirections(Actor *a);
|
2001-10-16 10:01:48 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
/* Should be in Graphics class? */
|
|
|
|
uint16 _screenB, _screenH;
|
2003-05-10 21:49:59 +00:00
|
|
|
int _roomHeight, _roomWidth, _screenHeight, _screenWidth;
|
2002-03-20 17:51:07 +00:00
|
|
|
VirtScreen virtscr[4]; // Virtual screen areas
|
|
|
|
CameraData camera; // 'Camera' - viewport
|
|
|
|
ColorCycle _colorCycle[16]; // Palette cycles
|
2001-10-16 10:01:48 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
uint32 _ENCD_offs, _EXCD_offs;
|
2002-12-08 16:14:29 +00:00
|
|
|
uint32 _CLUT_offs;
|
2002-03-20 17:51:07 +00:00
|
|
|
uint32 _IM00_offs, _PALS_offs;
|
2001-10-16 10:01:48 +00:00
|
|
|
|
2002-05-14 18:14:16 +00:00
|
|
|
//ender: fullscreen
|
2003-02-08 02:00:22 +00:00
|
|
|
bool _fullRedraw, _BgNeedsRedraw, _verbRedraw;
|
2002-03-20 17:51:07 +00:00
|
|
|
bool _screenEffectFlag, _completeScreenRedraw;
|
2001-10-16 10:01:48 +00:00
|
|
|
|
2002-12-04 22:31:36 +00:00
|
|
|
struct {
|
|
|
|
int hotspotX, hotspotY, width, height;
|
|
|
|
byte animate, animateIndex;
|
|
|
|
int8 state;
|
|
|
|
} _cursor;
|
2002-12-25 03:48:27 +00:00
|
|
|
byte _grabbedCursor[8192];
|
2002-12-04 13:36:27 +00:00
|
|
|
byte _currentCursor;
|
2001-10-16 10:01:48 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
byte _newEffect, _switchRoomEffect2, _switchRoomEffect;
|
|
|
|
bool _doEffect;
|
2002-08-19 17:23:48 +00:00
|
|
|
|
2002-11-10 17:19:43 +00:00
|
|
|
struct {
|
|
|
|
int x, y, w, h;
|
|
|
|
byte *buffer;
|
|
|
|
} _flashlight;
|
2002-08-20 02:20:40 +00:00
|
|
|
uint16 _flashlightXStrips, _flashlightYStrips;
|
|
|
|
bool _flashlightIsDrawn;
|
2001-10-16 10:01:48 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
void getGraphicsPerformance();
|
|
|
|
void initScreens(int a, int b, int w, int h);
|
2002-10-20 01:02:52 +00:00
|
|
|
void initVirtScreen(int slot, int number, int top, int width, int height, bool twobufs, bool scrollable);
|
2002-04-23 23:58:31 +00:00
|
|
|
void initBGBuffers(int height);
|
2002-03-20 17:51:07 +00:00
|
|
|
void initCycl(byte *ptr); // Color cycle
|
2002-04-19 15:02:16 +00:00
|
|
|
|
2002-04-19 13:57:18 +00:00
|
|
|
void createSpecialPalette(int16 a, int16 b, int16 c, int16 d, int16 e, int16 colorMin, int16 colorMax);
|
2001-11-26 19:57:57 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
void drawObject(int obj, int arg);
|
|
|
|
void drawRoomObjects(int arg);
|
|
|
|
void drawRoomObject(int i, int arg);
|
|
|
|
void drawBox(int x, int y, int x2, int y2, int color);
|
|
|
|
|
2002-11-29 15:13:49 +00:00
|
|
|
void restoreBG(int left, int top, int right, int bottom, byte backColor = 0);
|
2002-03-20 17:51:07 +00:00
|
|
|
void redrawBGStrip(int start, int num);
|
2002-04-17 20:34:10 +00:00
|
|
|
void redrawBGAreas();
|
2001-11-05 19:21:49 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
void moveCamera();
|
|
|
|
void cameraMoved();
|
|
|
|
void setCameraAtEx(int at);
|
|
|
|
void setCameraAt(int pos_x, int pos_y);
|
|
|
|
void panCameraTo(int x, int y);
|
|
|
|
void setCameraFollows(Actor *a);
|
|
|
|
void clampCameraPos(ScummPoint *pt);
|
2001-11-06 20:00:47 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
byte *getPalettePtr();
|
2003-05-03 20:49:53 +00:00
|
|
|
void setupEGAPalette();
|
2002-03-20 17:51:07 +00:00
|
|
|
void setPalette(int pal);
|
|
|
|
void setPaletteFromPtr(byte *ptr);
|
|
|
|
void setPaletteFromRes();
|
|
|
|
void setPalColor(int index, int r, int g, int b);
|
|
|
|
void setDirtyColors(int min, int max);
|
|
|
|
byte *findPalInPals(byte *pal, int index);
|
|
|
|
void swapPalColors(int a, int b);
|
2002-09-23 15:43:29 +00:00
|
|
|
void copyPalColor(int dst, int src);
|
2002-03-20 17:51:07 +00:00
|
|
|
void cyclePalette();
|
|
|
|
void stopCycle(int i);
|
2002-09-13 11:54:59 +00:00
|
|
|
void palManipulateInit(int start, int end, int string_id, int time);
|
2002-03-20 17:51:07 +00:00
|
|
|
void palManipulate();
|
|
|
|
int remapPaletteColor(int r, int g, int b, uint threshold);
|
|
|
|
void moveMemInPalRes(int start, int end, byte direction);
|
2002-12-09 02:14:17 +00:00
|
|
|
void setupShadowPalette(int slot, int redScale, int greenScale, int blueScale, int startColor, int endColor);
|
|
|
|
void setupShadowPalette(int redScale, int greenScale, int blueScale, int startColor, int endColor);
|
|
|
|
void darkenPalette(int redScale, int greenScale, int blueScale, int startColor, int endColor);
|
2003-03-13 02:23:55 +00:00
|
|
|
void desaturatePalette(int hueScale, int satScale, int lightScale, int startColor, int endColor);
|
2001-11-06 20:00:47 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
void setCursor(int cursor);
|
|
|
|
void setCursorImg(uint img, uint room, uint imgindex);
|
2003-04-26 13:28:34 +00:00
|
|
|
void setCursorHotspot(int x, int y);
|
2002-03-20 17:51:07 +00:00
|
|
|
void grabCursor(int x, int y, int w, int h);
|
|
|
|
void grabCursor(byte *ptr, int width, int height);
|
|
|
|
void makeCursorColorTransparent(int a);
|
2002-12-04 22:31:36 +00:00
|
|
|
void setupCursor() { _cursor.animate = 1; }
|
2001-11-06 20:00:47 +00:00
|
|
|
void decompressDefaultCursor(int index);
|
2002-03-20 17:51:07 +00:00
|
|
|
void useIm01Cursor(byte *im, int w, int h);
|
|
|
|
void useBompCursor(byte *im, int w, int h);
|
2001-11-06 21:41:56 +00:00
|
|
|
|
2001-11-07 18:10:52 +00:00
|
|
|
|
2003-01-14 10:06:56 +00:00
|
|
|
void updateDirtyRect(int virt, int left, int right, int top, int bottom, int dirtybit);
|
2002-03-20 17:51:07 +00:00
|
|
|
void setDirtyRange(int slot, int a, int height);
|
|
|
|
void drawDirtyScreenParts();
|
|
|
|
void updateDirtyScreen(int slot);
|
2001-11-09 18:54:15 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
VirtScreen *findVirtScreen(int y);
|
2002-10-24 06:28:54 +00:00
|
|
|
void setVirtscreenDirty(VirtScreen *vs, int left, int top, int right, int bottom);
|
2001-11-09 18:54:15 +00:00
|
|
|
|
2003-02-08 01:27:21 +00:00
|
|
|
byte isMaskActiveAt(int l, int t, int r, int b, byte *mem);
|
|
|
|
|
2002-08-19 17:23:48 +00:00
|
|
|
void drawFlashlight();
|
|
|
|
|
2002-07-13 14:07:37 +00:00
|
|
|
void fadeIn(int effect);
|
2002-08-19 17:23:48 +00:00
|
|
|
void fadeOut(int effect);
|
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
void unkScreenEffect5(int a);
|
2002-08-31 21:23:28 +00:00
|
|
|
void unkScreenEffect6();
|
2002-08-31 13:29:10 +00:00
|
|
|
void transitionEffect(int a);
|
|
|
|
void dissolveEffect(int width, int height);
|
|
|
|
void scrollEffect(int dir);
|
2001-11-11 16:54:45 +00:00
|
|
|
|
2002-08-31 19:26:04 +00:00
|
|
|
void blit(byte *dst, byte *src, int w, int h);
|
|
|
|
|
2002-11-06 14:19:50 +00:00
|
|
|
// bomp
|
2002-03-20 17:51:07 +00:00
|
|
|
void decompressBomp(byte *dst, byte *src, int w, int h);
|
2002-11-06 15:29:49 +00:00
|
|
|
void drawBomp(BompDrawData *bd, int decode_mode, int mask);
|
|
|
|
int32 setupBompScale(byte *scalling, int32 size, byte scale);
|
|
|
|
void bompScaleFuncX(byte *line_buffer, byte *scalling_x_ptr, byte skip, int32 size);
|
|
|
|
int32 bompDecodeLineMode0(byte *src, byte *line_buffer, int32 size);
|
|
|
|
int32 bompDecodeLineMode1(byte *src, byte *line_buffer, int32 size);
|
|
|
|
int32 bompDecodeLineMode3(byte *src, byte *line_buffer, int32 size);
|
|
|
|
void bompApplyMask(byte *line_buffer, byte *mask_out, byte bits, int32 size);
|
|
|
|
void bompApplyShadow0(byte *line_buffer, byte *dst, int32 size);
|
|
|
|
void bompApplyShadow1(byte *line_buffer, byte *dst, int32 size);
|
|
|
|
void bompApplyShadow3(byte *line_buffer, byte *dst, int32 size);
|
|
|
|
void bompApplyActorPalette(byte *line_buffer, int32 size);
|
|
|
|
|
2002-11-06 14:19:50 +00:00
|
|
|
int32 _bompScaleRight, _bompScaleBottom;
|
2002-11-06 15:29:49 +00:00
|
|
|
byte *_bompScallingXPtr, *_bompScallingYPtr;
|
|
|
|
byte *_bompMaskPtr;
|
|
|
|
byte *_bompActorPalletePtr;
|
2002-11-06 14:19:50 +00:00
|
|
|
|
2003-02-08 02:00:22 +00:00
|
|
|
bool _shakeEnabled;
|
2002-03-20 17:51:07 +00:00
|
|
|
uint _shakeFrame;
|
2003-02-08 02:00:22 +00:00
|
|
|
void setShake(int mode);
|
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
int _screenStartStrip, _screenEndStrip;
|
|
|
|
int _screenLeft, _screenTop;
|
2003-01-16 00:40:19 +00:00
|
|
|
|
|
|
|
int _blastObjectQueuePos;
|
|
|
|
BlastObject _blastObjectQueue[128];
|
|
|
|
|
|
|
|
int _blastTextQueuePos;
|
2003-01-19 03:25:59 +00:00
|
|
|
BlastText _blastTextQueue[32]; // FIXME - how many blast texts can there be at once?
|
2003-01-16 00:40:19 +00:00
|
|
|
|
|
|
|
void enqueueText(byte *text, int x, int y, byte color, byte charset, bool center);
|
|
|
|
void drawBlastTexts();
|
2003-04-07 16:04:30 +00:00
|
|
|
void removeBlastTexts();
|
2001-11-11 16:54:45 +00:00
|
|
|
|
2002-11-06 15:29:49 +00:00
|
|
|
void enqueueObject(int objectNumber, int objectX, int objectY, int objectWidth,
|
2002-12-26 21:50:13 +00:00
|
|
|
int objectHeight, int scaleX, int scaleY, int image, int mode);
|
2003-01-16 00:40:19 +00:00
|
|
|
void clearEnqueue() { _blastObjectQueuePos = 0; }
|
2002-04-21 21:20:32 +00:00
|
|
|
void drawBlastObjects();
|
|
|
|
void drawBlastObject(BlastObject *eo);
|
|
|
|
void removeBlastObjects();
|
|
|
|
void removeBlastObject(BlastObject *eo);
|
2001-11-14 18:40:39 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
int _drawObjectQueNr;
|
|
|
|
byte _drawObjectQue[200];
|
2002-09-24 15:46:09 +00:00
|
|
|
byte _palManipStart, _palManipEnd;
|
|
|
|
uint16 _palManipCounter;
|
|
|
|
byte *_palManipPalette;
|
|
|
|
byte *_palManipIntermediatePal;
|
2002-12-15 23:40:37 +00:00
|
|
|
|
2003-01-14 10:06:56 +00:00
|
|
|
/* For each of the 410 screen strips, gfxUsageBits contains a
|
|
|
|
* bitmask. The lower 80 bits each correspond to one actor and
|
|
|
|
* signify if any part of that actor is currently contained in
|
|
|
|
* that strip.
|
|
|
|
*
|
|
|
|
* If the leftmost bit is set, the strip (background) is dirty
|
|
|
|
* needs to be redrawn.
|
|
|
|
*
|
|
|
|
* The second leftmost bit is set by removeBlastObject() and
|
|
|
|
* restoreBG(), but I'm not yet sure why.
|
2002-12-15 23:40:37 +00:00
|
|
|
*/
|
2003-01-14 10:06:56 +00:00
|
|
|
uint32 gfxUsageBits[410 * 3];
|
2002-12-15 23:40:37 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
byte *_shadowPalette;
|
|
|
|
int _shadowPaletteSize;
|
2002-11-06 15:29:49 +00:00
|
|
|
byte _currentPalette[3 * 256];
|
2002-04-19 15:02:16 +00:00
|
|
|
|
2002-04-19 12:38:03 +00:00
|
|
|
byte _proc_special_palette[256];
|
2002-03-20 17:51:07 +00:00
|
|
|
int _palDirtyMin, _palDirtyMax;
|
2001-11-26 19:57:57 +00:00
|
|
|
|
2002-08-14 20:43:56 +00:00
|
|
|
byte _haveMsg;
|
|
|
|
bool _useTalkAnims;
|
|
|
|
uint16 _defaultTalkDelay;
|
|
|
|
bool _use_adlib;
|
|
|
|
int tempMusic;
|
2003-01-24 06:41:10 +00:00
|
|
|
bool _silentDigitalImuse, _noDigitalSamples;
|
2002-08-14 20:43:56 +00:00
|
|
|
int _saveSound;
|
2002-12-04 22:31:36 +00:00
|
|
|
int current_cd_sound;
|
2001-11-26 19:57:57 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
/* Walkbox / Navigation class */
|
2002-03-22 03:30:57 +00:00
|
|
|
int _maxBoxVertexHeap, _boxPathVertexHeapIndex, _boxMatrixItem;
|
2002-12-29 21:14:28 +00:00
|
|
|
byte *_boxPathVertexHeap, *_boxMatrixPtr1, *_boxMatrixPtr3;
|
2001-11-26 19:57:57 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
uint16 _extraBoxFlags[65];
|
2001-11-26 19:57:57 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
PathNode *unkMatrixProc2(PathVertex *vtx, int i);
|
|
|
|
bool areBoxesNeighbours(int i, int j);
|
|
|
|
void addToBoxMatrix(byte b);
|
2002-07-13 11:56:04 +00:00
|
|
|
bool compareSlope(int X1, int Y1, int X2, int Y2, int X3, int Y3);
|
2002-03-20 17:51:07 +00:00
|
|
|
void *addToBoxVertexHeap(int size);
|
|
|
|
PathVertex *addPathVertex();
|
|
|
|
bool checkXYInBoxBounds(int box, int x, int y);
|
|
|
|
uint distanceFromPt(int x, int y, int ptx, int pty);
|
|
|
|
ScummPoint closestPtOnLine(int ulx, int uly, int llx, int lly, int x, int y);
|
|
|
|
void getBoxCoordinates(int boxnum, BoxCoords *bc);
|
|
|
|
byte getMaskFromBox(int box);
|
|
|
|
Box *getBoxBaseAddr(int box);
|
|
|
|
byte getBoxFlags(int box);
|
|
|
|
int getBoxScale(int box);
|
2003-03-06 17:58:13 +00:00
|
|
|
|
2003-01-13 01:29:45 +00:00
|
|
|
int getScale(int box, int x, int y);
|
|
|
|
void setScaleItem(int slot, int a, int b, int c, int d);
|
|
|
|
|
|
|
|
// V8 scaling stuff: should be in V8 class
|
|
|
|
struct ScaleSlot {
|
|
|
|
int x1, y1, scale1;
|
|
|
|
int x2, y2, scale2;
|
|
|
|
};
|
|
|
|
ScaleSlot _scaleSlots[20]; // FIXME - not sure if this limit is right, but based on my observations it is
|
|
|
|
void setScaleSlot(int slot, int x1, int y1, int scale1, int x2, int y2, int scale2);
|
2003-01-13 14:04:41 +00:00
|
|
|
void setBoxScaleSlot(int box, int slot);
|
2003-01-13 01:29:45 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
byte getNumBoxes();
|
|
|
|
byte *getBoxMatrixBaseAddr();
|
|
|
|
int getPathToDestBox(byte from, byte to);
|
2002-08-12 16:05:14 +00:00
|
|
|
bool findPathTowards(Actor *a, byte box, byte box2, byte box3, int16 &foundPathX, int16 &foundPathY);
|
|
|
|
void findPathTowardsOld(Actor *a, byte box, byte box2, byte box3, ScummPoint gateLoc[5]);
|
2002-07-15 21:50:51 +00:00
|
|
|
void getGates(int trap1, int trap2, ScummPoint gateA[2], ScummPoint gateB[2]);
|
2002-03-20 17:51:07 +00:00
|
|
|
bool inBoxQuickReject(int box, int x, int y, int threshold);
|
|
|
|
AdjustBoxResult getClosestPtOnBox(int box, int x, int y);
|
2002-04-25 08:53:10 +00:00
|
|
|
int getSpecialBox(int param1, int param2);
|
2002-03-20 17:51:07 +00:00
|
|
|
|
|
|
|
void setBoxFlags(int box, int val);
|
|
|
|
void setBoxScale(int box, int b);
|
|
|
|
void createBoxMatrix();
|
2001-11-26 19:57:57 +00:00
|
|
|
|
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
/* String class */
|
2002-12-25 21:04:47 +00:00
|
|
|
CharsetRenderer *_charset;
|
2002-03-20 17:51:07 +00:00
|
|
|
byte _charsetColor;
|
2002-12-26 00:21:19 +00:00
|
|
|
byte _charsetColorMap[16];
|
2002-04-26 18:52:33 +00:00
|
|
|
byte _charsetData[15][16];
|
2002-12-25 21:04:47 +00:00
|
|
|
|
2002-12-26 00:21:19 +00:00
|
|
|
int _charsetBufPos;
|
|
|
|
byte _charsetBuffer[512];
|
|
|
|
|
|
|
|
bool _noSubtitles; // Skip all subtitles?
|
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
void initCharset(int charset);
|
|
|
|
void restoreCharsetBg();
|
2003-05-12 21:35:56 +00:00
|
|
|
bool hasCharsetMask(int x, int y, int x2, int y2);
|
2002-03-20 17:51:07 +00:00
|
|
|
void CHARSET_1();
|
2002-10-06 07:23:08 +00:00
|
|
|
void drawDescString(byte *msg);
|
2002-03-20 17:51:07 +00:00
|
|
|
byte *addMessageToStack(byte *msg);
|
2002-09-16 23:48:42 +00:00
|
|
|
void addIntToStack(int var);
|
|
|
|
void addVerbToStack(int var);
|
|
|
|
void addNameToStack(int var);
|
|
|
|
void addStringToStack(int var);
|
2002-03-20 17:51:07 +00:00
|
|
|
void unkMessage1();
|
|
|
|
void unkMessage2();
|
|
|
|
void clearMsgQueue();
|
2002-12-25 21:04:47 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
int _numInMsgStack;
|
2002-12-25 21:04:47 +00:00
|
|
|
byte *_msgPtrToAdd;
|
2002-03-20 17:51:07 +00:00
|
|
|
byte *_messagePtr;
|
|
|
|
int16 _talkDelay;
|
|
|
|
bool _keepText;
|
2002-09-17 09:18:47 +00:00
|
|
|
bool _existLanguageFile;
|
|
|
|
char *_languageBuffer;
|
2003-02-14 16:01:55 +00:00
|
|
|
struct langIndexNode *_languageIndex;
|
|
|
|
int _languageStrCount;
|
2002-09-17 09:18:47 +00:00
|
|
|
void loadLanguageBundle();
|
2002-11-06 14:19:50 +00:00
|
|
|
void translateText(byte *text, byte *trans_buff);
|
2003-02-02 12:50:56 +00:00
|
|
|
byte _transText[500];
|
2001-11-26 19:57:57 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
#if defined(SCUMM_LITTLE_ENDIAN)
|
2002-10-21 13:23:25 +00:00
|
|
|
uint32 fileReadDword() { return _fileHandle.readUint32LE(); }
|
2002-03-20 17:51:07 +00:00
|
|
|
#elif defined(SCUMM_BIG_ENDIAN)
|
2002-10-21 13:23:25 +00:00
|
|
|
uint32 fileReadDword() { return _fileHandle.readUint32BE(); }
|
2002-03-20 17:51:07 +00:00
|
|
|
#endif
|
2001-11-27 17:56:04 +00:00
|
|
|
|
2003-01-14 10:06:56 +00:00
|
|
|
void upgradeGfxUsageBits();
|
|
|
|
void setGfxUsageBit(int strip, int bit);
|
|
|
|
void clearGfxUsageBit(int strip, int bit);
|
|
|
|
bool testGfxUsageBit(int strip, int bit);
|
|
|
|
bool testGfxAnyUsageBits(int strip);
|
|
|
|
bool testGfxOtherUsageBits(int strip, int bit);
|
|
|
|
|
2002-12-16 12:12:31 +00:00
|
|
|
/* Scumm Vars */
|
2003-01-29 04:38:55 +00:00
|
|
|
byte VAR_LANGUAGE;
|
2002-12-21 12:34:17 +00:00
|
|
|
byte VAR_KEYPRESS;
|
2002-12-16 12:12:31 +00:00
|
|
|
byte VAR_EGO;
|
|
|
|
byte VAR_CAMERA_POS_X;
|
|
|
|
byte VAR_HAVE_MSG;
|
|
|
|
byte VAR_ROOM;
|
|
|
|
byte VAR_OVERRIDE;
|
|
|
|
byte VAR_MACHINE_SPEED;
|
|
|
|
byte VAR_ME;
|
|
|
|
byte VAR_NUM_ACTOR;
|
|
|
|
byte VAR_CURRENT_LIGHTS;
|
2002-12-31 17:28:51 +00:00
|
|
|
byte VAR_CURRENTDRIVE; // How about merging this with VAR_CURRENTDISK?
|
2002-12-26 01:15:25 +00:00
|
|
|
byte VAR_CURRENTDISK;
|
2002-12-16 12:12:31 +00:00
|
|
|
byte VAR_TMR_1;
|
|
|
|
byte VAR_TMR_2;
|
|
|
|
byte VAR_TMR_3;
|
2003-05-01 00:04:05 +00:00
|
|
|
byte VAR_MUSIC_TIMER;
|
2002-12-16 12:12:31 +00:00
|
|
|
byte VAR_ACTOR_RANGE_MIN;
|
|
|
|
byte VAR_ACTOR_RANGE_MAX;
|
|
|
|
byte VAR_CAMERA_MIN_X;
|
|
|
|
byte VAR_CAMERA_MAX_X;
|
|
|
|
byte VAR_TIMER_NEXT;
|
|
|
|
byte VAR_VIRT_MOUSE_X;
|
|
|
|
byte VAR_VIRT_MOUSE_Y;
|
|
|
|
byte VAR_ROOM_RESOURCE;
|
|
|
|
byte VAR_LAST_SOUND;
|
|
|
|
byte VAR_CUTSCENEEXIT_KEY;
|
|
|
|
byte VAR_OPTIONS_KEY;
|
|
|
|
byte VAR_TALK_ACTOR;
|
|
|
|
byte VAR_CAMERA_FAST_X;
|
|
|
|
byte VAR_SCROLL_SCRIPT;
|
|
|
|
byte VAR_ENTRY_SCRIPT;
|
|
|
|
byte VAR_ENTRY_SCRIPT2;
|
|
|
|
byte VAR_EXIT_SCRIPT;
|
|
|
|
byte VAR_EXIT_SCRIPT2;
|
|
|
|
byte VAR_VERB_SCRIPT;
|
|
|
|
byte VAR_SENTENCE_SCRIPT;
|
|
|
|
byte VAR_HOOK_SCRIPT;
|
|
|
|
byte VAR_CUTSCENE_START_SCRIPT;
|
|
|
|
byte VAR_CUTSCENE_END_SCRIPT;
|
|
|
|
byte VAR_CHARINC;
|
|
|
|
byte VAR_WALKTO_OBJ;
|
|
|
|
byte VAR_DEBUGMODE;
|
|
|
|
byte VAR_HEAPSPACE;
|
|
|
|
byte VAR_RESTART_KEY;
|
|
|
|
byte VAR_PAUSE_KEY;
|
|
|
|
byte VAR_MOUSE_X;
|
|
|
|
byte VAR_MOUSE_Y;
|
|
|
|
byte VAR_TIMER;
|
|
|
|
byte VAR_TMR_4;
|
|
|
|
byte VAR_SOUNDCARD;
|
|
|
|
byte VAR_VIDEOMODE;
|
|
|
|
byte VAR_SAVELOADDIALOG_KEY;
|
|
|
|
byte VAR_FIXEDDISK;
|
|
|
|
byte VAR_CURSORSTATE;
|
|
|
|
byte VAR_USERPUT;
|
|
|
|
byte VAR_SOUNDRESULT;
|
|
|
|
byte VAR_TALKSTOP_KEY;
|
|
|
|
byte VAR_59;
|
2003-03-06 17:58:13 +00:00
|
|
|
|
2002-12-16 12:12:31 +00:00
|
|
|
byte VAR_SOUNDPARAM;
|
|
|
|
byte VAR_SOUNDPARAM2;
|
|
|
|
byte VAR_SOUNDPARAM3;
|
|
|
|
byte VAR_MOUSEPRESENT;
|
|
|
|
byte VAR_PERFORMANCE_1;
|
|
|
|
byte VAR_PERFORMANCE_2;
|
|
|
|
byte VAR_ROOM_FLAG;
|
|
|
|
byte VAR_GAME_LOADED;
|
|
|
|
byte VAR_NEW_ROOM;
|
|
|
|
byte VAR_VERSION;
|
|
|
|
|
|
|
|
byte VAR_V5_TALK_STRING_Y;
|
|
|
|
|
|
|
|
byte VAR_V6_SCREEN_WIDTH;
|
|
|
|
byte VAR_V6_SCREEN_HEIGHT;
|
|
|
|
byte VAR_V6_EMSSPACE;
|
|
|
|
byte VAR_V6_RANDOM_NR;
|
|
|
|
|
|
|
|
byte VAR_STRING2DRAW;
|
|
|
|
byte VAR_CAMERA_POS_Y;
|
|
|
|
|
|
|
|
byte VAR_CAMERA_MIN_Y;
|
|
|
|
byte VAR_CAMERA_MAX_Y;
|
|
|
|
byte VAR_CAMERA_THRESHOLD_X;
|
|
|
|
byte VAR_CAMERA_THRESHOLD_Y;
|
|
|
|
byte VAR_CAMERA_SPEED_X;
|
|
|
|
byte VAR_CAMERA_SPEED_Y;
|
|
|
|
byte VAR_CAMERA_ACCEL_X;
|
|
|
|
byte VAR_CAMERA_ACCEL_Y;
|
|
|
|
|
|
|
|
byte VAR_CAMERA_DEST_X;
|
|
|
|
|
|
|
|
byte VAR_CAMERA_DEST_Y;
|
|
|
|
|
|
|
|
byte VAR_CAMERA_FOLLOWED_ACTOR;
|
|
|
|
|
|
|
|
byte VAR_LEFTBTN_DOWN;
|
|
|
|
byte VAR_RIGHTBTN_DOWN;
|
|
|
|
byte VAR_LEFTBTN_HOLD;
|
|
|
|
byte VAR_RIGHTBTN_HOLD;
|
2002-12-29 15:29:12 +00:00
|
|
|
byte VAR_MOUSE_BUTTONS;
|
2003-01-01 02:56:22 +00:00
|
|
|
byte VAR_MOUSE_HOLD;
|
2002-12-16 12:12:31 +00:00
|
|
|
byte VAR_UNK_SCRIPT;
|
|
|
|
byte VAR_UNK_SCRIPT_2;
|
|
|
|
|
|
|
|
byte VAR_DEFAULT_TALK_DELAY;
|
|
|
|
byte VAR_CHARSET_MASK;
|
|
|
|
|
|
|
|
byte VAR_CUSTOMSCALETABLE;
|
|
|
|
byte VAR_V6_SOUNDMODE;
|
|
|
|
};
|
|
|
|
|
2002-08-31 13:29:10 +00:00
|
|
|
// This is a constant lookup table of reverse bit masks
|
2001-10-09 14:30:12 +00:00
|
|
|
extern const byte revBitMask[8];
|
2002-04-17 20:34:10 +00:00
|
|
|
|
2002-07-22 18:11:48 +00:00
|
|
|
/* Direction conversion functions (between old dir and new dir format) */
|
|
|
|
int newDirToOldDir(int dir);
|
|
|
|
int oldDirToNewDir(int dir);
|
|
|
|
|
|
|
|
int normalizeAngle(int angle);
|
|
|
|
int fromSimpleDir(int dirtype, int dir);
|
|
|
|
int toSimpleDir(int dirtype, int dir);
|
|
|
|
|
|
|
|
|
2002-05-14 19:11:20 +00:00
|
|
|
#endif
|