2001-10-09 14:30:12 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
|
|
|
* Copyright (C) 2001 Ludvig Strigeus
|
2006-01-18 17:39:49 +00:00
|
|
|
* Copyright (C) 2001-2006 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
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2001-10-09 14:30:12 +00:00
|
|
|
*
|
2006-02-11 09:55:41 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2001-10-09 14:30:12 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2002-05-14 19:11:20 +00:00
|
|
|
#ifndef SCUMM_H
|
|
|
|
#define SCUMM_H
|
|
|
|
|
2003-09-18 02:07:18 +00:00
|
|
|
#include "base/engine.h"
|
2006-03-29 15:59:37 +00:00
|
|
|
#include "common/endian.h"
|
2002-09-13 12:20:55 +00:00
|
|
|
#include "common/file.h"
|
2003-05-15 21:57:38 +00:00
|
|
|
#include "common/rect.h"
|
2002-12-24 16:10:31 +00:00
|
|
|
#include "common/str.h"
|
2005-05-09 00:09:01 +00:00
|
|
|
#include "graphics/surface.h"
|
2003-06-15 01:42:19 +00:00
|
|
|
|
2003-09-07 16:16:19 +00:00
|
|
|
#include "scumm/gfx.h"
|
2006-03-19 17:25:13 +00:00
|
|
|
#include "scumm/plugin.h"
|
2003-09-11 10:32:15 +00:00
|
|
|
#include "scumm/script.h"
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2005-12-30 14:18:21 +00:00
|
|
|
#include "sound/mididrv.h"
|
|
|
|
|
2003-11-10 23:40:48 +00:00
|
|
|
namespace GUI {
|
|
|
|
class Dialog;
|
|
|
|
}
|
|
|
|
using GUI::Dialog;
|
2005-05-10 23:17:38 +00:00
|
|
|
namespace Common {
|
|
|
|
class InSaveFile;
|
|
|
|
class OutSaveFile;
|
|
|
|
}
|
2004-01-10 05:20:15 +00:00
|
|
|
|
2003-10-03 18:33:57 +00:00
|
|
|
namespace Scumm {
|
|
|
|
|
|
|
|
class Actor;
|
2005-03-27 01:07:22 +00:00
|
|
|
class BaseCostumeLoader;
|
2003-10-03 18:33:57 +00:00
|
|
|
class BaseCostumeRenderer;
|
2005-04-10 12:59:17 +00:00
|
|
|
class BaseScummFile;
|
2003-10-03 18:33:57 +00:00
|
|
|
class CharsetRenderer;
|
2002-04-14 18:13:08 +00:00
|
|
|
class IMuse;
|
2002-09-29 07:08:31 +00:00
|
|
|
class IMuseDigital;
|
2003-12-06 05:47:24 +00:00
|
|
|
class Insane;
|
2006-03-05 12:15:39 +00:00
|
|
|
class SmushMixer;
|
2003-09-07 16:16:19 +00:00
|
|
|
class MusicEngine;
|
2003-10-02 22:42:03 +00:00
|
|
|
class ScummEngine;
|
2002-12-15 00:39:33 +00:00
|
|
|
class ScummDebugger;
|
2002-12-11 01:25:15 +00:00
|
|
|
class Serializer;
|
2003-06-25 23:25:52 +00:00
|
|
|
class Sound;
|
2003-07-02 13:47:03 +00:00
|
|
|
|
|
|
|
struct Box;
|
|
|
|
struct BoxCoords;
|
2002-07-16 21:03:14 +00:00
|
|
|
struct FindObjectInRoom;
|
2002-03-06 19:58:06 +00:00
|
|
|
|
2002-08-18 17:48:18 +00:00
|
|
|
// Use g_scumm from error() ONLY
|
2003-10-02 22:42:03 +00:00
|
|
|
extern ScummEngine *g_scumm;
|
2002-04-12 10:34:46 +00:00
|
|
|
|
2001-11-14 18:40:39 +00:00
|
|
|
/* System Wide Constants */
|
|
|
|
enum {
|
2003-05-18 23:46:30 +00:00
|
|
|
NUM_SENTENCE = 6,
|
2005-04-20 19:59:18 +00:00
|
|
|
NUM_SHADOW_PALETTE = 8
|
2001-11-14 18:40:39 +00:00
|
|
|
};
|
2001-10-26 17:34:50 +00:00
|
|
|
|
2005-04-03 22:10:10 +00:00
|
|
|
/**
|
|
|
|
* SCUMM feature flags define for every game which specific set of engine
|
|
|
|
* features are used by that game.
|
|
|
|
* Note that some of them could be replaced by checks for the SCUMM version.
|
|
|
|
*/
|
2003-06-15 01:42:19 +00:00
|
|
|
enum GameFeatures {
|
2005-04-03 22:10:10 +00:00
|
|
|
/** Games with the new camera system (ScummEngine_v7 and subclasses). */
|
2003-06-15 01:42:19 +00:00
|
|
|
GF_NEW_CAMERA = 1 << 1,
|
2005-04-03 22:10:10 +00:00
|
|
|
|
2005-07-23 15:48:54 +00:00
|
|
|
/** Games with the AKOS costume system (ScummEngine_v7 and subclasses, HE games). */
|
2003-06-15 01:42:19 +00:00
|
|
|
GF_NEW_COSTUMES = 1 << 2,
|
2005-04-03 22:10:10 +00:00
|
|
|
|
2005-07-23 15:48:54 +00:00
|
|
|
/** Games with digital iMUSE (ScummEngine_v7 and subclasses). */
|
2003-06-15 01:42:19 +00:00
|
|
|
GF_DIGI_IMUSE = 1 << 3,
|
2005-04-03 22:10:10 +00:00
|
|
|
|
|
|
|
/** Games using XOR encrypted data files. */
|
2003-06-15 01:42:19 +00:00
|
|
|
GF_USE_KEY = 1 << 4,
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2005-04-03 22:10:10 +00:00
|
|
|
/** Small header games (ScummEngine_v4 and subclasses). */
|
2005-04-20 01:59:09 +00:00
|
|
|
GF_SMALL_HEADER = 1 << 5,
|
2005-04-03 22:10:10 +00:00
|
|
|
|
|
|
|
/** Old bundle games (ScummEngine_v3old and subclasses). */
|
2005-04-20 01:59:09 +00:00
|
|
|
GF_OLD_BUNDLE = 1 << 6,
|
2005-04-03 22:10:10 +00:00
|
|
|
|
|
|
|
/** EGA games. */
|
2005-04-20 01:59:09 +00:00
|
|
|
GF_16COLOR = 1 << 7,
|
2005-04-03 22:10:10 +00:00
|
|
|
|
2005-04-20 19:59:18 +00:00
|
|
|
/** VGA versions of V3 games. Equivalent to (version == 3 && not GF_16COLOR) */
|
2005-04-20 01:59:09 +00:00
|
|
|
GF_OLD256 = 1 << 8,
|
2005-04-03 22:10:10 +00:00
|
|
|
|
|
|
|
/** Games which have Audio CD tracks. */
|
2005-04-20 01:59:09 +00:00
|
|
|
GF_AUDIOTRACKS = 1 << 9,
|
2005-04-03 22:10:10 +00:00
|
|
|
|
|
|
|
/** Games without actor scaling (ScummEngine_v3 and subclasses). */
|
2005-04-20 01:59:09 +00:00
|
|
|
GF_NO_SCALING = 1 << 10,
|
2005-04-03 22:10:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Games using only very few local variables in scripts.
|
|
|
|
* Apparently that is only the case for 256 color version of Indy3.
|
|
|
|
*/
|
2005-04-20 01:59:09 +00:00
|
|
|
GF_FEW_LOCALS = 1 << 11,
|
2005-04-03 22:10:10 +00:00
|
|
|
|
2005-04-27 07:57:28 +00:00
|
|
|
/** HE games for which localized versions exist */
|
2005-05-01 14:22:00 +00:00
|
|
|
GF_HE_LOCALIZED = 1 << 13,
|
|
|
|
|
2005-07-30 21:11:48 +00:00
|
|
|
/**
|
2005-05-10 22:31:48 +00:00
|
|
|
* HE Games with more global scripts and different sprite handling
|
|
|
|
* i.e. read it as HE version 9.85. Used for HE98 only.
|
|
|
|
*/
|
2005-10-15 11:03:32 +00:00
|
|
|
GF_HE_985 = 1 << 14,
|
2005-05-10 22:31:48 +00:00
|
|
|
|
2005-05-01 14:22:00 +00:00
|
|
|
/** HE games with 16 bit color */
|
2005-05-10 22:31:48 +00:00
|
|
|
GF_16BIT_COLOR = 1 << 15,
|
2005-04-27 05:05:10 +00:00
|
|
|
|
2005-10-15 11:03:32 +00:00
|
|
|
/** HE games which use sprites for subtitles */
|
|
|
|
GF_HE_NOSUBTITLES = 1 << 16,
|
|
|
|
|
2005-04-20 18:21:30 +00:00
|
|
|
/** A demo, not a full blown game. */
|
2005-10-28 11:41:07 +00:00
|
|
|
GF_DEMO = 1 << 17
|
2003-06-15 01:42:19 +00:00
|
|
|
};
|
|
|
|
|
2004-01-10 05:20:15 +00:00
|
|
|
/* SCUMM Debug Channels */
|
|
|
|
void CDECL debugC(int level, const char *s, ...);
|
|
|
|
|
|
|
|
struct dbgChannelDesc {
|
|
|
|
const char *channel, *desc;
|
|
|
|
uint32 flag;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
2004-01-10 11:01:47 +00:00
|
|
|
DEBUG_GENERAL = 1 << 0, // General debug
|
|
|
|
DEBUG_SCRIPTS = 1 << 2, // Track script execution (start/stop/pause)
|
|
|
|
DEBUG_OPCODES = 1 << 3, // Track opcode invocations
|
|
|
|
DEBUG_VARS = 1 << 4, // Track variable changes
|
|
|
|
DEBUG_RESOURCE = 1 << 5, // Track resource loading / allocation
|
|
|
|
DEBUG_IMUSE = 1 << 6, // Track iMUSE events
|
|
|
|
DEBUG_SOUND = 1 << 7, // General Sound Debug
|
2004-02-18 05:20:47 +00:00
|
|
|
DEBUG_ACTORS = 1 << 8, // General Actor Debug
|
2004-08-22 09:14:19 +00:00
|
|
|
DEBUG_INSANE = 1 << 9, // Track INSANE
|
|
|
|
DEBUG_SMUSH = 1 << 10 // Track SMUSH
|
2004-01-10 05:20:15 +00:00
|
|
|
};
|
|
|
|
|
2005-10-17 15:00:23 +00:00
|
|
|
/**
|
|
|
|
* Internal header for any memory block allocated by the resource manager.
|
|
|
|
*
|
|
|
|
* @todo Hide MemBlkHeader; no code outside the resource manager should
|
|
|
|
* have to use it, ever. Currently script code needs it to detect whether
|
|
|
|
* some scripts have moved (in fetchScriptByte()).
|
|
|
|
*/
|
2001-12-11 13:34:15 +00:00
|
|
|
struct MemBlkHeader {
|
|
|
|
uint32 size;
|
|
|
|
};
|
|
|
|
|
2002-11-29 15:13:49 +00:00
|
|
|
struct VerbSlot;
|
2003-09-11 10:32:15 +00:00
|
|
|
struct ObjectData;
|
2003-01-16 00:40:19 +00:00
|
|
|
|
2002-07-13 14:07:37 +00:00
|
|
|
enum {
|
2006-03-14 14:06:44 +00:00
|
|
|
/**
|
|
|
|
* Lighting flag that indicates whether the normal palette, or the 'dark'
|
|
|
|
* palette shall be used to draw actors.
|
|
|
|
* Apparantly only used in very old games (so far only NESCostumeRenderer
|
|
|
|
* checks it).
|
|
|
|
*/
|
|
|
|
LIGHTMODE_actor_use_base_palette = 1 << 0,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Lighting flag that indicates whether the room is currently lit. Normally
|
|
|
|
* always on. Used for rooms in which the light can be switched "off".
|
|
|
|
*/
|
|
|
|
LIGHTMODE_room_lights_on = 1 << 1,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Lighting flag that indicates whether a flashlight like device is active.
|
|
|
|
* Used in Loom (flashlight follows the actor) and Indy 3 (flashlight
|
|
|
|
* follows the mouse). Only has any effect if the room lights are off.
|
|
|
|
*/
|
|
|
|
LIGHTMODE_flashlight_on = 1 << 2,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Lighting flag that indicates whether actors are to be drawn with their
|
|
|
|
* own custom palette, or using a fixed 'dark' palette. This is the
|
|
|
|
* modern successor of LIGHTMODE_actor_use_base_palette.
|
|
|
|
* Note: It is tempting to 'merge' these two flags, but since flags can
|
|
|
|
* check their values, this is probably not a good idea.
|
|
|
|
*/
|
|
|
|
LIGHTMODE_actor_use_colors = 1 << 3
|
|
|
|
//
|
2002-07-13 14:07:37 +00:00
|
|
|
};
|
|
|
|
|
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 {
|
2006-01-22 20:10:13 +00:00
|
|
|
GID_CMI,
|
|
|
|
GID_DIG,
|
|
|
|
GID_FT,
|
2003-04-06 19:41:34 +00:00
|
|
|
GID_INDY3,
|
2006-01-22 20:10:13 +00:00
|
|
|
GID_INDY4,
|
2003-03-01 22:04:48 +00:00
|
|
|
GID_LOOM,
|
|
|
|
GID_MANIAC,
|
2006-01-22 20:10:13 +00:00
|
|
|
GID_MONKEY_EGA,
|
|
|
|
GID_MONKEY_VGA,
|
|
|
|
GID_MONKEY,
|
|
|
|
GID_MONKEY2,
|
|
|
|
GID_PASS,
|
|
|
|
GID_SAMNMAX,
|
|
|
|
GID_TENTACLE,
|
2003-03-01 22:04:48 +00:00
|
|
|
GID_ZAK,
|
2006-01-22 20:10:13 +00:00
|
|
|
|
2004-06-03 01:28:22 +00:00
|
|
|
GID_HEGAME, // Generic name for all HE games with default behaviour
|
2005-12-03 00:58:33 +00:00
|
|
|
GID_PUTTDEMO,
|
2003-12-30 05:39:57 +00:00
|
|
|
GID_FBEAR,
|
2004-09-17 05:43:37 +00:00
|
|
|
GID_FUNPACK,
|
2005-12-03 00:58:33 +00:00
|
|
|
GID_WATER,
|
2005-05-10 22:31:48 +00:00
|
|
|
GID_PUTTRACE,
|
2005-05-12 01:21:04 +00:00
|
|
|
GID_FUNSHOP, // Used for all three funshops
|
2006-02-12 13:45:57 +00:00
|
|
|
GID_FOOTBALL,
|
|
|
|
GID_SOCCER
|
2003-03-01 22:04:48 +00:00
|
|
|
};
|
|
|
|
|
2001-10-16 10:01:48 +00:00
|
|
|
struct SentenceTab {
|
2003-04-28 03:13:49 +00:00
|
|
|
byte verb;
|
2003-05-22 14:10:20 +00:00
|
|
|
byte preposition;
|
2003-05-16 02:16:59 +00:00
|
|
|
uint16 objectA;
|
|
|
|
uint16 objectB;
|
2002-12-09 01:27:40 +00:00
|
|
|
uint8 freezeCount;
|
2001-10-16 10:01:48 +00:00
|
|
|
};
|
|
|
|
|
2004-04-03 19:41:31 +00:00
|
|
|
struct StringSlot {
|
|
|
|
int16 xpos;
|
|
|
|
int16 ypos;
|
2001-11-07 18:10:52 +00:00
|
|
|
int16 right;
|
2005-03-18 15:04:37 +00:00
|
|
|
int16 height;
|
2004-04-03 19:41:31 +00:00
|
|
|
byte color;
|
|
|
|
byte charset;
|
|
|
|
bool center;
|
|
|
|
bool overhead;
|
|
|
|
bool no_talk_anim;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct StringTab : StringSlot {
|
2004-04-05 23:54:58 +00:00
|
|
|
// The 'default' values for this string slot. This is used so that the
|
|
|
|
// string slot can temporarily be set to different values, and then be
|
|
|
|
// easily reset to a previously set default.
|
|
|
|
StringSlot _default;
|
2004-04-03 19:41:31 +00:00
|
|
|
|
2004-04-05 23:54:58 +00:00
|
|
|
void saveDefault() {
|
2004-04-03 19:41:31 +00:00
|
|
|
StringSlot &s = *this;
|
2004-04-05 23:54:58 +00:00
|
|
|
_default = s;
|
2004-04-03 19:41:31 +00:00
|
|
|
}
|
|
|
|
|
2004-04-05 23:54:58 +00:00
|
|
|
void loadDefault() {
|
2004-04-03 19:41:31 +00:00
|
|
|
StringSlot &s = *this;
|
2004-04-05 23:54:58 +00:00
|
|
|
s = _default;
|
2004-04-03 19:41:31 +00:00
|
|
|
}
|
2001-10-16 10:01:48 +00:00
|
|
|
};
|
|
|
|
|
2004-04-03 19:41:31 +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
|
|
|
};
|
|
|
|
|
2004-09-18 00:36:17 +00:00
|
|
|
struct AuxBlock {
|
|
|
|
bool visible;
|
|
|
|
Common::Rect r;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2005-05-15 09:46:34 +00:00
|
|
|
void reset() {
|
|
|
|
visible = false;
|
|
|
|
r.left = r.top = 0;
|
|
|
|
r.right = r.bottom = -1;
|
|
|
|
}
|
2004-09-18 00:36:17 +00:00
|
|
|
};
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-09-18 00:36:17 +00:00
|
|
|
struct AuxEntry {
|
|
|
|
int actorNum;
|
|
|
|
int subIndex;
|
|
|
|
};
|
|
|
|
|
2005-10-17 15:00:23 +00:00
|
|
|
// TODO: Rename InfoStuff to something more descriptive
|
2005-10-01 21:13:38 +00:00
|
|
|
struct InfoStuff {
|
|
|
|
uint32 date;
|
|
|
|
uint16 time;
|
|
|
|
uint32 playtime;
|
|
|
|
};
|
|
|
|
|
2006-01-29 17:47:05 +00:00
|
|
|
/**
|
|
|
|
* A list of resource types.
|
|
|
|
* WARNING: Do not change the order of these, as the savegame format relies
|
|
|
|
* on it; any change made here will break savegame compatibility!
|
|
|
|
*/
|
2005-10-17 15:00:23 +00:00
|
|
|
enum ResTypes {
|
|
|
|
rtFirst = 1,
|
|
|
|
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,
|
|
|
|
rtRoomScripts = 17,
|
|
|
|
rtRoomImage = 18,
|
|
|
|
rtImage = 19,
|
|
|
|
rtTalkie = 20,
|
2006-01-05 07:06:47 +00:00
|
|
|
rtSpoolBuffer = 21,
|
|
|
|
rtLast = 21,
|
|
|
|
rtNumTypes = 22
|
2005-10-17 15:00:23 +00:00
|
|
|
};
|
|
|
|
|
2006-02-25 17:36:32 +00:00
|
|
|
|
|
|
|
|
2006-02-20 16:35:37 +00:00
|
|
|
/**
|
|
|
|
* The 'resource manager' class. Currently doesn't really deserve to be called
|
|
|
|
* a 'class', at least until somebody gets around to OOfying this more.
|
|
|
|
*/
|
2005-03-31 21:39:31 +00:00
|
|
|
class ResourceManager {
|
2006-09-09 18:20:28 +00:00
|
|
|
//friend class ScummDebugger;
|
|
|
|
//friend class ScummEngine;
|
2005-03-31 21:39:31 +00:00
|
|
|
protected:
|
|
|
|
ScummEngine *_vm;
|
|
|
|
|
|
|
|
public:
|
|
|
|
byte mode[rtNumTypes];
|
|
|
|
uint16 num[rtNumTypes];
|
|
|
|
uint32 tags[rtNumTypes];
|
|
|
|
const char *name[rtNumTypes];
|
|
|
|
byte **address[rtNumTypes];
|
2005-10-17 15:00:23 +00:00
|
|
|
protected:
|
2005-03-31 21:39:31 +00:00
|
|
|
byte *flags[rtNumTypes];
|
2006-01-27 00:27:57 +00:00
|
|
|
byte *status[rtNumTypes];
|
2005-10-17 15:00:23 +00:00
|
|
|
public:
|
2005-03-31 21:39:31 +00:00
|
|
|
byte *roomno[rtNumTypes];
|
|
|
|
uint32 *roomoffs[rtNumTypes];
|
|
|
|
uint32 *globsize[rtNumTypes];
|
|
|
|
|
2006-09-09 18:20:28 +00:00
|
|
|
protected:
|
2005-03-31 21:39:31 +00:00
|
|
|
uint32 _allocatedSize;
|
|
|
|
uint32 _maxHeapThreshold, _minHeapThreshold;
|
|
|
|
byte _expireCounter;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ResourceManager(ScummEngine *vm);
|
2006-09-09 18:20:28 +00:00
|
|
|
~ResourceManager();
|
2005-03-31 21:39:31 +00:00
|
|
|
|
2006-09-09 18:20:28 +00:00
|
|
|
void setHeapThreshold(int min, int max);
|
2005-03-31 21:39:31 +00:00
|
|
|
|
2006-09-09 18:20:28 +00:00
|
|
|
void allocResTypeData(int id, uint32 tag, int num, const char *name, int mode);
|
2005-03-31 21:39:31 +00:00
|
|
|
void freeResources();
|
|
|
|
|
2006-09-09 18:20:28 +00:00
|
|
|
byte *createResource(int type, int index, uint32 size);
|
|
|
|
void nukeResource(int type, int i);
|
|
|
|
|
2005-03-31 21:39:31 +00:00
|
|
|
bool isResourceLoaded(int type, int index) const;
|
|
|
|
|
|
|
|
void lock(int type, int i);
|
|
|
|
void unlock(int type, int i);
|
2005-10-17 15:00:23 +00:00
|
|
|
bool isLocked(int type, int i) const;
|
2005-03-31 21:39:31 +00:00
|
|
|
|
2006-01-27 00:27:57 +00:00
|
|
|
void setModified(int type, int i);
|
|
|
|
bool isModified(int type, int i) const;
|
|
|
|
|
2006-09-09 18:20:28 +00:00
|
|
|
void increaseExpireCounter();
|
2005-03-31 21:39:31 +00:00
|
|
|
void setResourceCounter(int type, int index, byte flag);
|
|
|
|
void increaseResourceCounter();
|
2005-04-06 17:31:35 +00:00
|
|
|
|
|
|
|
void resourceStats();
|
2006-09-09 18:20:28 +00:00
|
|
|
|
|
|
|
//protected:
|
2005-10-17 15:00:23 +00:00
|
|
|
bool validateResource(const char *str, int type, int index) const;
|
2006-09-09 18:20:28 +00:00
|
|
|
protected:
|
|
|
|
void expireResources(uint32 size);
|
2005-03-31 21:39:31 +00:00
|
|
|
};
|
|
|
|
|
2006-02-20 16:35:37 +00:00
|
|
|
/**
|
|
|
|
* Base class for all SCUMM engines.
|
|
|
|
*/
|
2003-10-02 22:42:03 +00:00
|
|
|
class ScummEngine : 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-12-06 05:47:24 +00:00
|
|
|
friend class Insane;
|
2004-01-08 21:21:40 +00:00
|
|
|
friend class CharsetRenderer;
|
2005-04-06 17:31:35 +00:00
|
|
|
friend class ResourceManager;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2006-09-16 19:31:23 +00:00
|
|
|
GUI::Debugger *getDebugger();
|
2003-03-07 15:38:11 +00:00
|
|
|
void errorString(const char *buf_input, char *buf_output);
|
2006-09-16 19:31:23 +00:00
|
|
|
|
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;
|
2003-09-07 16:16:19 +00:00
|
|
|
MusicEngine *_musicEngine;
|
2003-06-25 23:25:52 +00:00
|
|
|
Sound *_sound;
|
2006-03-05 12:15:39 +00:00
|
|
|
SmushMixer *_smixer;
|
2003-06-25 23:25:52 +00:00
|
|
|
|
|
|
|
VerbSlot *_verbs;
|
|
|
|
ObjectData *_objs;
|
2005-10-14 02:13:33 +00:00
|
|
|
ObjectData *_storedFlObjects;
|
2003-06-25 23:25:52 +00:00
|
|
|
ScummDebugger *_debugger;
|
2003-06-04 23:03:23 +00:00
|
|
|
|
2003-10-13 12:56:53 +00:00
|
|
|
// Core variables
|
2006-04-08 08:23:33 +00:00
|
|
|
GameSettings _game;
|
2004-09-10 12:13:03 +00:00
|
|
|
uint8 _gameMD5[16];
|
2003-10-13 12:56:53 +00:00
|
|
|
|
|
|
|
/** Random number generator */
|
|
|
|
Common::RandomSource _rnd;
|
|
|
|
|
|
|
|
/** Graphics manager */
|
|
|
|
Gdi gdi;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2003-10-13 12:56:53 +00:00
|
|
|
/** Central resource data. */
|
2005-03-31 21:39:31 +00:00
|
|
|
ResourceManager res;
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2006-04-29 12:44:06 +00:00
|
|
|
// Misc utility functions
|
|
|
|
uint32 _debugFlags; // Used by the debugger
|
|
|
|
|
2005-03-31 21:39:31 +00:00
|
|
|
protected:
|
2003-09-11 10:32:15 +00:00
|
|
|
VirtualMachineState vm;
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2003-06-25 23:25:52 +00:00
|
|
|
public:
|
2003-02-08 01:27:21 +00:00
|
|
|
// Constructor / Destructor
|
2006-04-23 17:33:16 +00:00
|
|
|
ScummEngine(OSystem *syst, const DetectorResult &dr);
|
2003-10-02 22:42:03 +00:00
|
|
|
virtual ~ScummEngine();
|
2002-03-21 00:40:18 +00:00
|
|
|
|
2005-04-10 01:23:33 +00:00
|
|
|
/** Startup function, main loop. */
|
2004-11-23 00:03:25 +00:00
|
|
|
int go();
|
2004-09-20 22:04:06 +00:00
|
|
|
|
2003-02-08 01:27:21 +00:00
|
|
|
// Init functions
|
2006-04-15 20:36:41 +00:00
|
|
|
int init();
|
2004-09-20 22:04:06 +00:00
|
|
|
|
2006-04-29 12:44:06 +00:00
|
|
|
protected:
|
2006-04-29 16:24:39 +00:00
|
|
|
virtual void setupScumm();
|
|
|
|
virtual void resetScumm();
|
|
|
|
|
2003-02-08 01:27:21 +00:00
|
|
|
virtual void setupScummVars();
|
2006-04-29 16:24:39 +00:00
|
|
|
virtual void resetScummVars();
|
2002-12-29 19:54:11 +00:00
|
|
|
|
2006-04-29 16:24:39 +00:00
|
|
|
void setupCharsetRenderer();
|
|
|
|
void setupCostumeRenderer();
|
2004-09-20 22:04:06 +00:00
|
|
|
|
2006-04-29 16:24:39 +00:00
|
|
|
virtual void loadLanguageBundle() {}
|
2004-09-20 22:04:06 +00:00
|
|
|
void loadCJKFont();
|
|
|
|
void setupMusic(int midi);
|
2006-04-29 23:09:40 +00:00
|
|
|
void updateSoundSettings();
|
2006-05-13 17:30:04 +00:00
|
|
|
void setTalkspeed(int talkspeed);
|
|
|
|
int getTalkspeed();
|
2002-12-29 19:54:11 +00:00
|
|
|
|
2006-04-29 12:44:06 +00:00
|
|
|
protected:
|
|
|
|
// Scumm main loop & helper functions.
|
2003-02-08 01:27:21 +00:00
|
|
|
int scummLoop(int delta);
|
2006-04-29 12:44:06 +00:00
|
|
|
virtual void scummLoop_updateScummVars();
|
|
|
|
virtual void scummLoop_handleSaveLoad();
|
|
|
|
virtual void scummLoop_handleDrawing();
|
2006-04-29 13:01:35 +00:00
|
|
|
virtual void scummLoop_handleActors() = 0;
|
2006-04-29 12:44:06 +00:00
|
|
|
virtual void scummLoop_handleEffects();
|
|
|
|
virtual void scummLoop_handleSound();
|
2003-03-06 17:58:13 +00:00
|
|
|
|
2003-02-08 01:27:21 +00:00
|
|
|
// Event handling
|
2006-04-29 12:44:06 +00:00
|
|
|
public:
|
|
|
|
void parseEvents(); // Used by IMuseDigital::startSound
|
|
|
|
protected:
|
2002-12-29 19:54:11 +00:00
|
|
|
void waitForTimer(int msec_delay);
|
2004-01-25 12:20:59 +00:00
|
|
|
void processKbd(bool smushMode);
|
2003-05-13 23:33:01 +00:00
|
|
|
void clearClickedStatus();
|
2002-12-29 19:54:11 +00:00
|
|
|
|
2003-02-08 01:27:21 +00:00
|
|
|
// Cursor/palette
|
2002-12-29 19:54:11 +00:00
|
|
|
void updateCursor();
|
2004-09-18 20:29:13 +00:00
|
|
|
virtual void animateCursor() {}
|
2005-04-07 10:43:51 +00:00
|
|
|
virtual void updatePalette();
|
2002-12-29 19:54:11 +00:00
|
|
|
|
2004-06-27 21:06:04 +00:00
|
|
|
/**
|
|
|
|
* Flag which signals that the SMUSH video playback should end now
|
|
|
|
* (e.g. because it was aborted by the user or it's simply finished).
|
|
|
|
*/
|
|
|
|
bool _smushVideoShouldFinish;
|
|
|
|
/** This flag is a hack to allow the pause dialog to pause SMUSH playback, too. */
|
2003-12-25 02:55:00 +00:00
|
|
|
bool _smushPaused;
|
2006-04-29 12:44:06 +00:00
|
|
|
public:
|
2004-06-27 21:06:04 +00:00
|
|
|
/** This flag tells IMuseDigital that INSANE is running. */
|
2006-04-29 12:44:06 +00:00
|
|
|
bool _insaneRunning; // Used by IMuseDigital::flushTracks()
|
2004-06-20 21:01:32 +00:00
|
|
|
|
2004-06-27 21:06:04 +00:00
|
|
|
protected:
|
|
|
|
Insane *_insane;
|
|
|
|
|
|
|
|
public:
|
2003-06-02 02:25:24 +00:00
|
|
|
void pauseGame();
|
|
|
|
void restart();
|
|
|
|
void shutDown();
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2003-06-08 12:11:14 +00:00
|
|
|
/** We keep running until this is set to true. */
|
|
|
|
bool _quit;
|
|
|
|
|
2003-07-28 01:36:16 +00:00
|
|
|
protected:
|
2002-09-19 21:45:56 +00:00
|
|
|
Dialog *_pauseDialog;
|
2004-07-20 11:30:15 +00:00
|
|
|
Dialog *_versionDialog;
|
2003-11-03 23:26:13 +00:00
|
|
|
Dialog *_mainMenuDialog;
|
2002-09-19 21:45:56 +00:00
|
|
|
|
2003-09-11 10:32:15 +00:00
|
|
|
int runDialog(Dialog &dialog);
|
2005-04-17 22:40:45 +00:00
|
|
|
void confirmExitDialog();
|
|
|
|
void confirmRestartDialog();
|
2002-09-19 21:45:56 +00:00
|
|
|
void pauseDialog();
|
2004-07-20 11:30:15 +00:00
|
|
|
void versionDialog();
|
2003-11-03 23:26:13 +00:00
|
|
|
void mainMenuDialog();
|
2005-04-17 22:40:45 +00:00
|
|
|
|
2004-03-28 13:28:44 +00:00
|
|
|
char displayMessage(const char *altButton, const char *message, ...);
|
2002-09-19 21:45:56 +00:00
|
|
|
|
2003-02-08 01:27:21 +00:00
|
|
|
byte _fastMode;
|
2003-01-16 12:47:34 +00:00
|
|
|
|
2005-04-17 22:40:45 +00:00
|
|
|
byte _numActors;
|
2003-05-13 23:42:41 +00:00
|
|
|
Actor *_actors; // Has _numActors elements
|
2005-04-30 22:01:16 +00:00
|
|
|
Actor **_sortedActors;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-08-01 13:57:00 +00:00
|
|
|
byte *_arraySlot;
|
2002-03-20 17:51:07 +00:00
|
|
|
uint16 *_inventory;
|
|
|
|
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__)
|
2003-05-24 22:17:45 +00:00
|
|
|
int32& scummVar(byte var, const char *varName, const char *file, int line)
|
2003-05-08 15:48:50 +00:00
|
|
|
{
|
2003-05-13 23:33:01 +00:00
|
|
|
if (var == 0xFF) {
|
2004-03-15 03:36:18 +00:00
|
|
|
error("Illegal access to variable %s in file %s, line %d", varName, file, line);
|
2003-05-13 23:33:01 +00:00
|
|
|
}
|
2003-05-08 15:48:50 +00:00
|
|
|
return _scummVars[var];
|
|
|
|
}
|
2004-01-08 21:21:40 +00:00
|
|
|
int32 scummVar(byte var, const char *varName, const char *file, int line) const
|
|
|
|
{
|
|
|
|
if (var == 0xFF) {
|
2004-03-15 03:36:18 +00:00
|
|
|
error("Illegal access to variable %s in file %s, line %d", varName, file, line);
|
2004-01-08 21:21:40 +00:00
|
|
|
}
|
|
|
|
return _scummVars[var];
|
|
|
|
}
|
2003-05-08 15:48:50 +00:00
|
|
|
|
2003-02-08 00:38:17 +00:00
|
|
|
protected:
|
2002-03-20 17:51:07 +00:00
|
|
|
int16 _varwatch;
|
2004-08-26 23:15:39 +00:00
|
|
|
int32 *_roomVars;
|
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;
|
2004-09-04 23:35:14 +00:00
|
|
|
int _numInventory;
|
2003-12-26 23:11:35 +00:00
|
|
|
int _numNewNames, _numGlobalScripts;
|
2004-10-24 06:58:41 +00:00
|
|
|
int _numRoomVariables;
|
2004-10-04 02:23:02 +00:00
|
|
|
int _numPalettes, _numSprites, _numTalkies, _numUnk;
|
2005-10-14 02:13:33 +00:00
|
|
|
int _numStoredFlObjects;
|
2005-05-05 14:30:37 +00:00
|
|
|
int _HEHeapSize;
|
2003-02-08 00:38:17 +00:00
|
|
|
public:
|
2004-09-17 05:43:37 +00:00
|
|
|
int _numLocalScripts, _numImages, _numRooms, _numScripts, _numSounds; // Used by HE games
|
2003-02-08 00:38:17 +00:00
|
|
|
int _numCostumes; // FIXME - should be protected, used by Actor::remapActorPalette
|
2003-12-26 23:11:35 +00:00
|
|
|
int _numCharsets; // FIXME - should be protected, used by CharsetRenderer
|
2003-06-05 02:44:18 +00:00
|
|
|
|
2005-03-27 01:07:22 +00:00
|
|
|
BaseCostumeLoader *_costumeLoader;
|
|
|
|
BaseCostumeRenderer *_costumeRenderer;
|
2005-03-13 23:18:59 +00:00
|
|
|
|
2005-03-16 03:20:32 +00:00
|
|
|
int _NESCostumeSet;
|
2005-03-24 03:22:32 +00:00
|
|
|
void NES_loadCostumeSet(int n);
|
|
|
|
byte *_NEScostdesc, *_NEScostlens, *_NEScostoffs, *_NEScostdata;
|
|
|
|
byte _NESPatTable[2][4096];
|
|
|
|
byte _NESPalette[2][16];
|
2005-03-16 03:20:32 +00:00
|
|
|
byte _NESBaseTiles;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2005-03-24 03:22:32 +00:00
|
|
|
int _NESStartStrip;
|
|
|
|
|
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;
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2003-05-24 22:17:45 +00:00
|
|
|
public:
|
|
|
|
byte _currentRoom; // FIXME - should be protected but Actor::isInCurrentRoom uses it
|
|
|
|
int _roomResource; // FIXME - should be protected but Sound::pauseSounds uses it
|
2003-02-08 00:38:17 +00:00
|
|
|
bool _egoPositioned; // Used by Actor::putActor, hence public
|
2003-05-24 22:17:45 +00:00
|
|
|
|
2006-04-23 17:33:16 +00:00
|
|
|
FilenamePattern _filenamePattern;
|
|
|
|
|
|
|
|
Common::String generateFilename(const int room) const;
|
2005-01-29 17:58:47 +00:00
|
|
|
|
2003-02-08 00:38:17 +00:00
|
|
|
protected:
|
2002-03-20 17:51:07 +00:00
|
|
|
int _keyPressed;
|
2001-10-09 14:30:12 +00:00
|
|
|
uint16 _lastKeyHit;
|
2003-12-05 00:02:01 +00:00
|
|
|
bool _keyDownMap[512]; // FIXME - 512 is a guess. it's max(kbd.ascii)
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2003-10-02 17:43:02 +00:00
|
|
|
Common::Point _mouse;
|
|
|
|
Common::Point _virtualMouse;
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2005-04-20 23:33:35 +00:00
|
|
|
uint16 _mouseAndKeyboardStat;
|
2003-05-13 23:33:01 +00:00
|
|
|
byte _leftBtnPressed, _rightBtnPressed;
|
2001-11-05 19:21:49 +00:00
|
|
|
|
2003-06-06 22:51:33 +00:00
|
|
|
/** The bootparam, to be passed to the script 1, the bootscript. */
|
|
|
|
int _bootParam;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2003-05-13 23:33:01 +00:00
|
|
|
// Various options useful for debugging
|
|
|
|
bool _dumpScripts;
|
|
|
|
bool _hexdumpScripts;
|
|
|
|
bool _showStack;
|
|
|
|
uint16 _debugMode;
|
2001-11-09 18:54:15 +00:00
|
|
|
|
2003-05-24 22:17:45 +00:00
|
|
|
// Save/Load class - some of this may be GUI
|
2002-03-20 17:51:07 +00:00
|
|
|
byte _saveLoadFlag, _saveLoadSlot;
|
2002-12-13 03:23:17 +00:00
|
|
|
uint32 _lastSaveTime;
|
2004-01-31 22:12:35 +00:00
|
|
|
bool _saveTemporaryState;
|
2001-11-09 18:54:15 +00:00
|
|
|
char _saveLoadName[32];
|
|
|
|
|
2004-06-25 21:48:12 +00:00
|
|
|
bool saveState(int slot, bool compat);
|
|
|
|
bool loadState(int slot, bool compat);
|
2005-10-22 22:54:59 +00:00
|
|
|
virtual void saveOrLoad(Serializer *s);
|
2003-12-27 00:10:20 +00:00
|
|
|
void saveLoadResource(Serializer *ser, int type, int index); // "Obsolete"
|
|
|
|
void saveResource(Serializer *ser, int type, int index);
|
|
|
|
void loadResource(Serializer *ser, int type, int index);
|
2005-03-15 21:20:44 +00:00
|
|
|
void makeSavegameName(char *out, int slot, bool temporary);
|
2001-11-14 18:40:39 +00:00
|
|
|
|
2003-12-05 00:02:01 +00:00
|
|
|
int getKeyState(int key);
|
|
|
|
|
2003-02-08 01:27:21 +00:00
|
|
|
public:
|
2004-06-25 22:39:21 +00:00
|
|
|
bool getSavegameName(int slot, char *desc);
|
|
|
|
void listSavegames(bool *marks, int num);
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2005-03-15 21:20:44 +00:00
|
|
|
void requestSave(int slot, const char *name, bool temporary = false);
|
2003-02-08 01:27:21 +00:00
|
|
|
void requestLoad(int slot);
|
2001-10-16 10:01:48 +00:00
|
|
|
|
2005-10-01 21:13:38 +00:00
|
|
|
// thumbnail + info stuff
|
2005-05-09 00:09:01 +00:00
|
|
|
public:
|
|
|
|
Graphics::Surface *loadThumbnailFromSlot(int slot);
|
2005-10-01 21:13:38 +00:00
|
|
|
bool loadInfosFromSlot(int slot, InfoStuff *stuff);
|
2005-05-09 00:09:01 +00:00
|
|
|
|
|
|
|
protected:
|
2005-05-10 23:17:38 +00:00
|
|
|
Graphics::Surface *loadThumbnail(Common::InSaveFile *file);
|
2005-10-01 21:13:38 +00:00
|
|
|
bool loadInfos(Common::InSaveFile *file, InfoStuff *stuff);
|
2005-05-10 23:17:38 +00:00
|
|
|
void saveThumbnail(Common::OutSaveFile *file);
|
2005-10-01 21:13:38 +00:00
|
|
|
void saveInfos(Common::OutSaveFile* file);
|
|
|
|
|
|
|
|
int32 _engineStartTime;
|
|
|
|
int32 _dialogStartTime;
|
2005-05-09 00:09:01 +00:00
|
|
|
|
2003-02-08 01:27:21 +00:00
|
|
|
protected:
|
2002-03-20 17:51:07 +00:00
|
|
|
/* Script VM - should be in Script class */
|
2005-04-29 15:08:31 +00:00
|
|
|
uint32 _localScriptOffsets[1024];
|
2003-05-21 16:28:02 +00:00
|
|
|
const byte *_scriptPointer, *_scriptOrgPointer;
|
2003-09-11 10:32:15 +00:00
|
|
|
byte _opcode, _currentScript;
|
2004-04-05 00:24:26 +00:00
|
|
|
const byte * const *_lastCodePtr;
|
2002-03-20 17:51:07 +00:00
|
|
|
int _resultVarNumber, _scummStackPos;
|
2004-01-08 20:37:26 +00:00
|
|
|
int _vmStack[150];
|
2003-02-08 01:27:21 +00:00
|
|
|
int _keyScriptKey, _keyScriptNo;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2002-12-16 12:12:31 +00:00
|
|
|
virtual void setupOpcodes() = 0;
|
2003-05-14 20:37:53 +00:00
|
|
|
virtual void executeOpcode(byte i) = 0;
|
|
|
|
virtual const char *getOpcodeDesc(byte i) = 0;
|
2002-12-16 12:12:31 +00:00
|
|
|
|
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
|
|
|
|
2003-05-13 23:33:01 +00:00
|
|
|
void startScene(int room, Actor *a, int b);
|
|
|
|
void startManiac();
|
|
|
|
|
2003-02-06 21:32:20 +00:00
|
|
|
public:
|
2005-02-28 13:23:10 +00:00
|
|
|
void runScript(int script, bool freezeResistant, bool recursive, int *lvarptr, int cycle = 0);
|
2003-05-20 20:58:26 +00:00
|
|
|
void stopScript(int script);
|
2005-04-05 11:06:03 +00:00
|
|
|
void nukeArrays(byte scriptSlot);
|
2003-02-06 21:32:20 +00:00
|
|
|
|
|
|
|
protected:
|
2005-02-28 13:23:10 +00:00
|
|
|
void runObjectScript(int script, int entry, bool freezeResistant, bool recursive, int *vars, int slot = -1, int cycle = 0);
|
2002-03-20 17:51:07 +00:00
|
|
|
void runScriptNested(int script);
|
2003-05-24 22:17:45 +00:00
|
|
|
void executeScript();
|
2002-03-20 17:51:07 +00:00
|
|
|
void updateScriptPtr();
|
2005-04-20 23:53:29 +00:00
|
|
|
virtual void runInventoryScript(int i);
|
2005-10-02 01:26:53 +00:00
|
|
|
void inventoryScript();
|
2003-05-24 22:17:45 +00:00
|
|
|
void checkAndRunSentenceScript();
|
|
|
|
void runExitScript();
|
|
|
|
void runEntryScript();
|
|
|
|
void runAllScripts();
|
|
|
|
void freezeScripts(int scr);
|
|
|
|
void unfreezeScripts();
|
|
|
|
|
2003-06-25 23:25:52 +00:00
|
|
|
bool isScriptInUse(int script) const;
|
|
|
|
bool isRoomScriptRunning(int script) const;
|
2004-08-22 09:38:18 +00:00
|
|
|
bool isScriptRunning(int script) const;
|
2003-05-24 22:17:45 +00:00
|
|
|
|
|
|
|
void killAllScriptsExceptCurrent();
|
|
|
|
void killScriptsAndResources();
|
|
|
|
void decreaseScriptDelay(int amount);
|
|
|
|
|
|
|
|
void stopObjectCode();
|
|
|
|
void stopObjectScript(int script);
|
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
void getScriptBaseAddress();
|
|
|
|
void getScriptEntryPoint();
|
2003-05-24 22:17:45 +00:00
|
|
|
int getVerbEntrypoint(int obj, int entry);
|
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
byte fetchScriptByte();
|
2002-12-23 00:23:36 +00:00
|
|
|
virtual uint fetchScriptWord();
|
|
|
|
virtual int fetchScriptWordSigned();
|
2006-02-11 00:44:04 +00:00
|
|
|
uint fetchScriptDWord();
|
|
|
|
int fetchScriptDWordSigned();
|
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-05-13 23:33:01 +00:00
|
|
|
virtual int readVar(uint var);
|
2002-12-23 18:30:12 +00:00
|
|
|
virtual void writeVar(uint var, int value);
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2003-05-20 20:58:26 +00:00
|
|
|
void beginCutscene(int *args);
|
2002-03-20 17:51:07 +00:00
|
|
|
void endCutscene();
|
2003-05-20 20:58:26 +00:00
|
|
|
void abortCutscene();
|
2002-03-20 17:51:07 +00:00
|
|
|
void beginOverride();
|
|
|
|
void endOverride();
|
2003-05-24 22:17:45 +00:00
|
|
|
|
2004-09-05 09:36:51 +00:00
|
|
|
void copyScriptString(byte *dst);
|
2002-12-28 01:57:19 +00:00
|
|
|
int resStrLen(const byte *src) const;
|
2002-03-20 17:51:07 +00:00
|
|
|
void doSentence(int c, int b, int a);
|
|
|
|
|
|
|
|
/* Should be in Resource class */
|
2005-03-30 21:59:12 +00:00
|
|
|
BaseScummFile *_fileHandle;
|
2002-03-20 17:51:07 +00:00
|
|
|
uint32 _fileOffset;
|
2004-07-26 17:14:57 +00:00
|
|
|
public:
|
|
|
|
/** The name of the (macintosh/rescumm style) container file, if any. */
|
|
|
|
Common::String _containerFile;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2006-04-23 17:39:31 +00:00
|
|
|
bool openFile(BaseScummFile &file, const Common::String &filename, bool resourceFile = false);
|
2004-07-26 17:14:57 +00:00
|
|
|
|
|
|
|
protected:
|
2003-05-13 23:33:01 +00:00
|
|
|
int _resourceHeaderSize;
|
2002-03-20 17:51:07 +00:00
|
|
|
byte _resourceMapper[128];
|
2005-02-14 03:12:41 +00:00
|
|
|
byte *_heV7DiskOffsets;
|
2004-09-18 23:48:48 +00:00
|
|
|
uint32 *_heV7RoomIntOffsets;
|
2004-06-23 01:36:57 +00:00
|
|
|
const byte *_resourceLastSearchBuf; // FIXME: need to put it to savefile?
|
|
|
|
uint32 _resourceLastSearchSize; // FIXME: need to put it to savefile?
|
2002-03-16 05:33:25 +00:00
|
|
|
|
2005-02-20 13:07:57 +00:00
|
|
|
virtual 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();
|
2005-04-03 22:56:02 +00:00
|
|
|
virtual void readRoomsOffsets();
|
2006-04-23 17:33:16 +00:00
|
|
|
void askForDisk(const char *filename, int disknum); // TODO: Use Common::String
|
2006-04-23 17:39:31 +00:00
|
|
|
bool openResourceFile(const Common::String &filename, byte encByte); // TODO: Use Common::String
|
2003-02-08 00:38:17 +00:00
|
|
|
|
2003-05-21 18:09:49 +00:00
|
|
|
void loadPtrToResource(int type, int i, const byte *ptr);
|
2006-02-25 02:22:17 +00:00
|
|
|
virtual void readResTypeList(int id, const char *name);
|
2006-09-09 18:20:28 +00:00
|
|
|
// void allocResTypeData(int id, uint32 tag, int num, const char *name, int mode);
|
2005-04-06 17:31:35 +00:00
|
|
|
// byte *createResource(int type, int index, uint32 size);
|
2003-03-07 21:38:46 +00:00
|
|
|
int loadResource(int type, int i);
|
2005-07-30 21:11:48 +00:00
|
|
|
// void nukeResource(int type, int i);
|
2003-07-21 21:28:47 +00:00
|
|
|
int getResourceSize(int type, int idx);
|
2003-03-07 21:38:46 +00:00
|
|
|
|
|
|
|
public:
|
2001-10-09 14:30:12 +00:00
|
|
|
byte *getResourceAddress(int type, int i);
|
2005-04-09 20:22:31 +00:00
|
|
|
virtual 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);
|
2003-06-25 23:49:54 +00:00
|
|
|
bool isResourceInUse(int type, int i) const;
|
2006-04-29 16:24:39 +00:00
|
|
|
|
|
|
|
virtual void setupRoomSubBlocks();
|
|
|
|
virtual void resetRoomSubBlocks();
|
|
|
|
|
2005-10-14 02:13:33 +00:00
|
|
|
void storeFlObject(int slot);
|
|
|
|
void restoreFlObjects();
|
2006-04-29 16:24:39 +00:00
|
|
|
|
|
|
|
void clearRoomObjects();
|
|
|
|
virtual void resetRoomObjects();
|
|
|
|
virtual void resetRoomObject(ObjectData *od, const byte *room, const byte *searchptr = NULL);
|
2003-04-12 02:09:00 +00:00
|
|
|
|
2004-01-19 20:27:31 +00:00
|
|
|
virtual void readArrayFromIndexFile();
|
2005-04-09 20:26:51 +00:00
|
|
|
virtual void readMAXS(int blockSize) = 0;
|
2005-04-03 23:53:34 +00:00
|
|
|
virtual void readGlobalObjects();
|
2002-03-23 22:03:35 +00:00
|
|
|
virtual void readIndexFile();
|
2005-04-17 22:59:43 +00:00
|
|
|
virtual void readIndexBlock(uint32 block, uint32 itemsize);
|
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:
|
2003-05-28 20:01:47 +00:00
|
|
|
const byte *findResourceData(uint32 tag, const byte *ptr);
|
2004-06-23 01:36:57 +00:00
|
|
|
const byte *findResource(uint32 tag, const byte *ptr);
|
2003-05-26 13:14:57 +00:00
|
|
|
int getResourceDataSize(const byte *ptr) const;
|
2003-05-28 20:01:47 +00:00
|
|
|
void dumpResource(const char *tag, int index, const byte *ptr, int length = -1);
|
2003-03-06 17:58:13 +00:00
|
|
|
|
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();
|
|
|
|
int findInventory(int owner, int index);
|
|
|
|
int getInventoryCount(int owner);
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2003-05-13 23:33:01 +00:00
|
|
|
protected:
|
|
|
|
byte *_objectOwnerTable, *_objectRoomTable, *_objectStateTable;
|
2004-09-06 05:50:32 +00:00
|
|
|
int _numObjectsInRoom;
|
2003-05-13 23:33:01 +00:00
|
|
|
|
2005-04-30 15:04:16 +00:00
|
|
|
public:
|
|
|
|
uint32 *_classData;
|
|
|
|
|
|
|
|
protected:
|
2004-01-11 20:42:40 +00:00
|
|
|
void markObjectRectAsDirty(int obj);
|
2002-03-20 17:51:07 +00:00
|
|
|
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);
|
2005-04-27 14:30:32 +00:00
|
|
|
void updateObjectStates();
|
2003-05-13 23:33:01 +00:00
|
|
|
public:
|
2003-06-25 23:25:52 +00:00
|
|
|
bool getClass(int obj, int cls) const; // Used in actor.cpp, hence public
|
2003-05-13 23:33:01 +00:00
|
|
|
protected:
|
2001-10-09 14:30:12 +00:00
|
|
|
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);
|
2003-06-25 23:25:52 +00:00
|
|
|
int getOwner(int obj) const;
|
2001-10-09 14:30:12 +00:00
|
|
|
void putOwner(int obj, int owner);
|
2002-03-20 17:51:07 +00:00
|
|
|
void setOwnerOf(int obj, int owner);
|
|
|
|
void clearOwnerOf(int obj);
|
2003-06-25 23:25:52 +00:00
|
|
|
int getObjectRoom(int obj) const;
|
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);
|
2003-06-25 23:25:52 +00:00
|
|
|
int getObjectIndex(int object) const;
|
2004-06-21 02:33:23 +00:00
|
|
|
int getObjectImageCount(int object);
|
2003-06-25 23:25:52 +00:00
|
|
|
int whereIsObject(int object) const;
|
2002-03-20 17:51:07 +00:00
|
|
|
int findObject(int x, int y);
|
2005-07-30 21:11:48 +00:00
|
|
|
void findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint object, uint room);
|
2003-05-13 23:33:01 +00:00
|
|
|
public:
|
|
|
|
int getObjectOrActorXY(int object, int &x, int &y); // Used in actor.cpp, hence public
|
|
|
|
protected:
|
2002-03-20 17:51:07 +00:00
|
|
|
int getObjActToObjActDist(int a, int b); // Not sure how to handle
|
2003-05-31 12:17:58 +00:00
|
|
|
const byte *getObjOrActorName(int obj); // these three..
|
2004-03-17 01:50:15 +00:00
|
|
|
void setObjectName(int obj);
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
void addObjectToDrawQue(int object);
|
2004-09-06 01:10:31 +00:00
|
|
|
void removeObjectFromDrawQue(int object);
|
2002-03-20 17:51:07 +00:00
|
|
|
void clearDrawObjectQueue();
|
|
|
|
void processDrawQue();
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2005-04-28 22:34:56 +00:00
|
|
|
virtual void clearDrawQueues();
|
|
|
|
|
2003-06-25 23:25:52 +00:00
|
|
|
uint32 getOBCDOffs(int object) const;
|
|
|
|
byte *getOBCDFromObject(int obj);
|
2005-06-23 14:10:52 +00:00
|
|
|
const byte *getOBIMFromObjectData(const ObjectData &od);
|
2003-06-26 01:46:41 +00:00
|
|
|
const byte *getObjectImage(const byte *ptr, int state);
|
2005-04-17 23:19:16 +00:00
|
|
|
virtual int getObjectIdFromOBIM(const byte *obim);
|
2003-06-26 01:46:41 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
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;
|
2003-05-13 23:33:01 +00:00
|
|
|
int _inventoryOffset;
|
|
|
|
int8 _userPut;
|
2003-05-21 07:22:43 +00:00
|
|
|
uint16 _userState;
|
2003-05-13 23:33:01 +00:00
|
|
|
|
2006-03-02 12:14:06 +00:00
|
|
|
int _activeInventory;
|
2005-09-14 08:20:37 +00:00
|
|
|
int _activeObject;
|
2006-03-05 08:22:39 +00:00
|
|
|
int _activeVerb;
|
2005-09-14 08:20:37 +00:00
|
|
|
|
2005-04-28 01:04:42 +00:00
|
|
|
virtual void handleMouseOver(bool updateInventory);
|
2005-09-24 10:15:17 +00:00
|
|
|
virtual void redrawVerbs();
|
|
|
|
virtual void checkExecVerbs();
|
2005-04-28 01:04:42 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
void verbMouseOver(int verb);
|
2004-09-26 07:30:29 +00:00
|
|
|
int findVerbAtPos(int x, int y) const;
|
2005-05-26 16:39:40 +00:00
|
|
|
virtual void drawVerb(int verb, int mode);
|
2006-03-02 01:17:41 +00:00
|
|
|
virtual void runInputScript(int a, int cmd, int mode);
|
2002-03-20 17:51:07 +00:00
|
|
|
void restoreVerbBG(int verb);
|
2002-08-14 09:53:34 +00:00
|
|
|
void drawVerbBitmap(int verb, int x, int y);
|
2003-06-25 23:49:54 +00:00
|
|
|
int getVerbSlot(int id, int mode) const;
|
2001-10-09 14:30:12 +00:00
|
|
|
void killVerb(int slot);
|
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:
|
2006-01-18 11:53:07 +00:00
|
|
|
bool isValidActor(int id) const;
|
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
/* Should be in Actor class */
|
2003-06-25 23:49:54 +00:00
|
|
|
Actor *derefActor(int id, const char *errmsg = 0) const;
|
|
|
|
Actor *derefActorSafe(int id, const char *errmsg) const;
|
2001-10-09 19:02:28 +00:00
|
|
|
|
2003-06-25 23:25:52 +00:00
|
|
|
int getAngleFromPos(int x, int y) const;
|
2001-10-16 10:01:48 +00:00
|
|
|
|
2003-05-24 22:17:45 +00:00
|
|
|
protected:
|
2002-03-20 17:51:07 +00:00
|
|
|
void walkActors();
|
|
|
|
void playActorSounds();
|
2005-04-02 14:24:43 +00:00
|
|
|
void redrawAllActors();
|
2003-05-30 00:55:21 +00:00
|
|
|
void setActorRedrawFlags();
|
2004-07-05 06:25:01 +00:00
|
|
|
void putActors();
|
2003-05-24 22:17:45 +00:00
|
|
|
void showActors();
|
2006-04-29 16:24:39 +00:00
|
|
|
void resetV1ActorTalkColor();
|
2002-03-20 17:51:07 +00:00
|
|
|
void resetActorBgs();
|
2005-04-28 00:45:06 +00:00
|
|
|
virtual void processActors();
|
2003-02-27 10:17:29 +00:00
|
|
|
void processUpperActors();
|
2005-07-30 05:58:48 +00:00
|
|
|
virtual int getActorFromPos(int x, int y);
|
2004-09-18 00:36:17 +00:00
|
|
|
|
2003-05-24 22:17:45 +00:00
|
|
|
public:
|
2002-03-20 17:51:07 +00:00
|
|
|
/* Actor talking stuff */
|
2004-10-12 14:40:32 +00:00
|
|
|
byte _actorToPrintStrFor, _V1TalkingActor;
|
2002-03-20 17:51:07 +00:00
|
|
|
int _sentenceNum;
|
2003-05-18 23:46:30 +00:00
|
|
|
SentenceTab _sentence[NUM_SENTENCE];
|
2002-09-22 01:17:53 +00:00
|
|
|
StringTab _string[6];
|
2006-03-12 00:53:30 +00:00
|
|
|
byte _haveMsg;
|
2003-05-25 00:47:36 +00:00
|
|
|
int16 _talkDelay;
|
2005-03-25 00:37:14 +00:00
|
|
|
int _NES_lastTalkingActor;
|
|
|
|
int _NES_talkColor;
|
|
|
|
|
2005-04-28 22:17:23 +00:00
|
|
|
virtual void actorTalk(const byte *msg);
|
2003-02-08 01:27:21 +00:00
|
|
|
void stopTalk();
|
2004-03-15 03:33:08 +00:00
|
|
|
int getTalkingActor(); // Wrapper around VAR_TALK_ACTOR for V1 Maniac
|
|
|
|
void setTalkingActor(int variable);
|
2004-01-16 10:45:56 +00:00
|
|
|
|
2005-03-15 21:48:06 +00:00
|
|
|
// Generic costume code
|
|
|
|
bool isCostumeInUse(int i) const;
|
|
|
|
|
2004-09-04 10:29:06 +00:00
|
|
|
Common::Rect _actorClipOverride;
|
2004-09-04 08:13:48 +00:00
|
|
|
|
2003-05-25 00:47:36 +00:00
|
|
|
protected:
|
2002-03-20 17:51:07 +00:00
|
|
|
/* Should be in Graphics class? */
|
|
|
|
uint16 _screenB, _screenH;
|
2003-05-25 00:47:36 +00:00
|
|
|
public:
|
2004-09-25 23:14:09 +00:00
|
|
|
int _roomHeight, _roomWidth;
|
2003-05-25 00:47:36 +00:00
|
|
|
int _screenHeight, _screenWidth;
|
2002-03-20 17:51:07 +00:00
|
|
|
VirtScreen virtscr[4]; // Virtual screen areas
|
|
|
|
CameraData camera; // 'Camera' - viewport
|
2004-09-29 21:45:52 +00:00
|
|
|
|
|
|
|
int _screenStartStrip, _screenEndStrip;
|
|
|
|
int _screenTop;
|
|
|
|
|
2005-02-20 00:17:22 +00:00
|
|
|
Common::RenderMode _renderMode;
|
|
|
|
|
2003-05-25 00:47:36 +00:00
|
|
|
protected:
|
2002-03-20 17:51:07 +00:00
|
|
|
ColorCycle _colorCycle[16]; // Palette cycles
|
2005-11-01 02:43:54 +00:00
|
|
|
uint8 _colorUsedByCycle[256];
|
2001-10-16 10:01:48 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
uint32 _ENCD_offs, _EXCD_offs;
|
2004-08-22 06:16:16 +00:00
|
|
|
uint32 _CLUT_offs, _EPAL_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
|
2004-09-18 22:42:45 +00:00
|
|
|
bool _fullRedraw, _bgNeedsRedraw;
|
2002-03-20 17:51:07 +00:00
|
|
|
bool _screenEffectFlag, _completeScreenRedraw;
|
2006-06-21 10:28:09 +00:00
|
|
|
bool _disableFadeInEffect;
|
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;
|
2004-09-05 15:44:29 +00:00
|
|
|
|
2004-01-08 21:21:40 +00:00
|
|
|
public:
|
|
|
|
bool isLightOn() const;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2006-03-14 12:06:37 +00:00
|
|
|
byte _currentLights;
|
|
|
|
int getCurrentLights() const;
|
|
|
|
|
2004-01-08 21:21:40 +00:00
|
|
|
protected:
|
2004-01-04 14:49:14 +00:00
|
|
|
void initScreens(int b, int h);
|
2005-04-26 15:52:55 +00:00
|
|
|
void initVirtScreen(VirtScreenNumber slot, int top, int width, int height, bool twobufs, bool scrollable);
|
2002-04-23 23:58:31 +00:00
|
|
|
void initBGBuffers(int height);
|
2003-05-28 20:01:47 +00:00
|
|
|
void initCycl(const byte *ptr); // Color cycle
|
2002-04-19 15:02:16 +00:00
|
|
|
|
2005-03-16 03:20:32 +00:00
|
|
|
void decodeNESBaseTiles();
|
|
|
|
|
2005-07-30 21:11:48 +00:00
|
|
|
void drawObject(int obj, int arg);
|
2002-03-20 17:51:07 +00:00
|
|
|
void drawRoomObjects(int arg);
|
|
|
|
void drawRoomObject(int i, int arg);
|
|
|
|
void drawBox(int x, int y, int x2, int y2, int color);
|
|
|
|
|
2006-06-21 06:50:50 +00:00
|
|
|
void moveScreen(int dx, int dy, int height);
|
|
|
|
|
2005-03-24 03:22:32 +00:00
|
|
|
void restoreBG(Common::Rect rect, byte backcolor = 0);
|
2005-07-30 21:11:48 +00:00
|
|
|
void redrawBGStrip(int start, int num);
|
2004-09-03 17:27:40 +00:00
|
|
|
virtual void redrawBGAreas();
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
void cameraMoved();
|
|
|
|
void setCameraAtEx(int at);
|
2003-05-29 12:55:28 +00:00
|
|
|
virtual void setCameraAt(int pos_x, int pos_y);
|
2006-03-18 10:30:47 +00:00
|
|
|
virtual void setCameraFollows(Actor *a, bool setCamera = false);
|
2003-05-29 23:44:24 +00:00
|
|
|
virtual void moveCamera();
|
|
|
|
virtual void panCameraTo(int x, int y);
|
2003-10-02 17:43:02 +00:00
|
|
|
void clampCameraPos(Common::Point *pt);
|
2003-05-29 12:55:28 +00:00
|
|
|
void actorFollowCamera(int act);
|
2001-11-06 20:00:47 +00:00
|
|
|
|
2004-10-04 04:04:37 +00:00
|
|
|
const byte *getPalettePtr(int palindex, int room);
|
2006-04-29 16:24:39 +00:00
|
|
|
|
|
|
|
void setC64Palette();
|
|
|
|
void setNESPalette();
|
|
|
|
void setAmigaPalette();
|
|
|
|
void setHercPalette();
|
|
|
|
void setCGAPalette();
|
|
|
|
void setEGAPalette();
|
|
|
|
void setV1Palette();
|
|
|
|
|
|
|
|
void resetPalette();
|
|
|
|
|
2005-04-17 12:55:42 +00:00
|
|
|
void setPalette(int pal);
|
|
|
|
void setRoomPalette(int pal, int room);
|
2005-04-07 10:43:51 +00:00
|
|
|
virtual void setPaletteFromPtr(const byte *ptr, int numcolor = -1);
|
|
|
|
virtual void setPalColor(int index, int r, int g, int b);
|
2002-03-20 17:51:07 +00:00
|
|
|
void setDirtyColors(int min, int max);
|
2003-05-28 20:01:47 +00:00
|
|
|
const byte *findPalInPals(const byte *pal, int index);
|
2002-03-20 17:51:07 +00:00
|
|
|
void swapPalColors(int a, int b);
|
2005-04-07 10:43:51 +00:00
|
|
|
virtual void copyPalColor(int dst, int src);
|
2002-03-20 17:51:07 +00:00
|
|
|
void cyclePalette();
|
|
|
|
void stopCycle(int i);
|
2003-12-17 17:12:09 +00:00
|
|
|
virtual void palManipulateInit(int resID, int start, int end, int time);
|
2002-03-20 17:51:07 +00:00
|
|
|
void palManipulate();
|
2003-05-25 00:47:36 +00:00
|
|
|
public:
|
2004-09-21 13:54:30 +00:00
|
|
|
int remapPaletteColor(int r, int g, int b, int threshold); // Used by Actor::remapActorPalette
|
2003-05-25 00:47:36 +00:00
|
|
|
protected:
|
2002-03-20 17:51:07 +00:00
|
|
|
void moveMemInPalRes(int start, int end, byte direction);
|
2006-04-29 16:24:39 +00:00
|
|
|
void setShadowPalette(int slot, int redScale, int greenScale, int blueScale, int startColor, int endColor);
|
|
|
|
void setShadowPalette(int redScale, int greenScale, int blueScale, int startColor, int endColor, int start, int end);
|
2005-04-07 10:43:51 +00:00
|
|
|
virtual void darkenPalette(int redScale, int greenScale, int blueScale, int startColor, int endColor);
|
2001-11-06 20:00:47 +00:00
|
|
|
|
2005-07-19 17:53:55 +00:00
|
|
|
void setCursorFromBuffer(const byte *ptr, int width, int height, int pitch);
|
2001-11-07 18:10:52 +00:00
|
|
|
|
2003-05-25 00:47:36 +00:00
|
|
|
public:
|
2004-01-08 03:24:41 +00:00
|
|
|
void markRectAsDirty(VirtScreenNumber virt, int left, int right, int top, int bottom, int dirtybit = 0);
|
2004-09-30 23:49:46 +00:00
|
|
|
void markRectAsDirty(VirtScreenNumber virt, const Common::Rect& rect, int dirtybit = 0) {
|
2004-01-08 03:24:41 +00:00
|
|
|
markRectAsDirty(virt, rect.left, rect.right, rect.top, rect.bottom, dirtybit);
|
|
|
|
}
|
2003-05-25 00:47:36 +00:00
|
|
|
protected:
|
2005-03-25 01:27:28 +00:00
|
|
|
// Screen rendering
|
|
|
|
byte *_compositeBuf;
|
|
|
|
byte *_herculesBuf;
|
2005-04-28 22:34:56 +00:00
|
|
|
virtual void drawDirtyScreenParts();
|
2004-01-03 22:45:23 +00:00
|
|
|
void updateDirtyScreen(VirtScreenNumber slot);
|
2005-03-25 01:27:28 +00:00
|
|
|
void drawStripToScreen(VirtScreen *vs, int x, int w, int t, int b);
|
2005-03-28 20:18:36 +00:00
|
|
|
void ditherCGA(byte *dst, int dstPitch, int x, int y, int width, int height) const;
|
|
|
|
void ditherHerc(byte *src, byte *hercbuf, int srcPitch, int *x, int *y, int *width, int *height) const;
|
2001-11-09 18:54:15 +00:00
|
|
|
|
2003-05-25 00:47:36 +00:00
|
|
|
public:
|
2002-03-20 17:51:07 +00:00
|
|
|
VirtScreen *findVirtScreen(int y);
|
2003-06-01 14:30:26 +00:00
|
|
|
byte *getMaskBuffer(int x, int y, int z);
|
2003-02-08 01:27:21 +00:00
|
|
|
|
2003-05-25 00:47:36 +00:00
|
|
|
protected:
|
2002-07-13 14:07:37 +00:00
|
|
|
void fadeIn(int effect);
|
2002-08-19 17:23:48 +00:00
|
|
|
void fadeOut(int effect);
|
2006-06-19 04:09:39 +00:00
|
|
|
void setScrollBuffer();
|
2002-08-19 17:23:48 +00:00
|
|
|
|
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-11-06 14:19:50 +00:00
|
|
|
// bomp
|
2003-05-25 00:47:36 +00:00
|
|
|
public:
|
2003-05-28 21:28:30 +00:00
|
|
|
byte *_bompActorPalettePtr;
|
2003-06-01 13:09:30 +00:00
|
|
|
void drawBomp(const BompDrawData &bd, bool mirror);
|
2002-11-06 15:29:49 +00:00
|
|
|
|
2003-05-30 19:00:33 +00:00
|
|
|
protected:
|
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 _drawObjectQueNr;
|
2003-12-30 06:24:47 +00:00
|
|
|
byte _drawObjectQue[200];
|
2005-07-30 21:11:48 +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.
|
2005-07-30 21:11:48 +00:00
|
|
|
*
|
2003-01-14 10:06:56 +00:00
|
|
|
* If the leftmost bit is set, the strip (background) is dirty
|
|
|
|
* needs to be redrawn.
|
2005-07-30 21:11:48 +00:00
|
|
|
*
|
2003-01-14 10:06:56 +00:00
|
|
|
* 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];
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2003-05-25 00:47:36 +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);
|
|
|
|
|
|
|
|
public:
|
2003-10-12 17:33:29 +00:00
|
|
|
byte _roomPalette[256];
|
2002-03-20 17:51:07 +00:00
|
|
|
byte *_shadowPalette;
|
2005-04-28 00:45:06 +00:00
|
|
|
bool _skipDrawObject;
|
2005-03-12 00:47:17 +00:00
|
|
|
int _voiceMode;
|
2003-08-13 15:37:28 +00:00
|
|
|
|
2006-01-05 07:06:47 +00:00
|
|
|
// HE specific
|
|
|
|
byte _HEV7ActorPalette[256];
|
|
|
|
uint8 *_hePalettes;
|
|
|
|
|
2003-05-25 00:47:36 +00:00
|
|
|
protected:
|
2002-03-20 17:51:07 +00:00
|
|
|
int _shadowPaletteSize;
|
2002-11-06 15:29:49 +00:00
|
|
|
byte _currentPalette[3 * 256];
|
2005-04-19 04:12:49 +00:00
|
|
|
byte _darkenPalette[3 * 256];
|
2002-04-19 15:02:16 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
int _palDirtyMin, _palDirtyMax;
|
2001-11-26 19:57:57 +00:00
|
|
|
|
2004-01-25 12:20:59 +00:00
|
|
|
byte _palManipStart, _palManipEnd;
|
|
|
|
uint16 _palManipCounter;
|
|
|
|
byte *_palManipPalette;
|
|
|
|
byte *_palManipIntermediatePal;
|
|
|
|
|
2005-11-02 21:47:44 +00:00
|
|
|
bool _haveActorSpeechMsg;
|
2002-08-14 20:43:56 +00:00
|
|
|
bool _useTalkAnims;
|
|
|
|
uint16 _defaultTalkDelay;
|
2004-09-20 22:04:06 +00:00
|
|
|
int _tempMusic;
|
2002-08-14 20:43:56 +00:00
|
|
|
int _saveSound;
|
2003-10-02 14:37:40 +00:00
|
|
|
bool _native_mt32;
|
2005-04-13 00:11:49 +00:00
|
|
|
bool _enable_gs;
|
2005-12-30 14:18:21 +00:00
|
|
|
MidiDriverFlags _musicType;
|
2003-12-11 06:08:43 +00:00
|
|
|
bool _copyProtection;
|
2003-10-05 17:32:38 +00:00
|
|
|
bool _confirmExit;
|
2001-11-26 19:57:57 +00:00
|
|
|
|
2003-05-25 00:47:36 +00:00
|
|
|
public:
|
2002-03-20 17:51:07 +00:00
|
|
|
uint16 _extraBoxFlags[65];
|
2001-11-26 19:57:57 +00:00
|
|
|
|
2003-05-25 00:47:36 +00:00
|
|
|
byte getNumBoxes();
|
|
|
|
byte *getBoxMatrixBaseAddr();
|
|
|
|
int getPathToDestBox(byte from, byte to);
|
2003-10-02 17:43:02 +00:00
|
|
|
void getGates(int trap1, int trap2, Common::Point gateA[2], Common::Point gateB[2]);
|
2003-05-25 00:47:36 +00:00
|
|
|
bool inBoxQuickReject(int box, int x, int y, int threshold);
|
2003-07-02 13:47:03 +00:00
|
|
|
int getClosestPtOnBox(int box, int x, int y, int16& outX, int16& outY);
|
2003-05-25 00:47:36 +00:00
|
|
|
int getSpecialBox(int param1, int param2);
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2003-05-25 00:47:36 +00:00
|
|
|
void setBoxFlags(int box, int val);
|
|
|
|
void setBoxScale(int box, int b);
|
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
bool checkXYInBoxBounds(int box, int x, int y);
|
|
|
|
uint distanceFromPt(int x, int y, int ptx, int pty);
|
|
|
|
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);
|
2004-11-05 05:13:56 +00:00
|
|
|
int getScaleFromSlot(int slot, int x, int y);
|
2003-01-13 01:29:45 +00:00
|
|
|
|
2003-05-25 00:47:36 +00:00
|
|
|
protected:
|
2003-09-09 16:55:25 +00:00
|
|
|
// Scaling slots/items
|
2003-01-13 01:29:45 +00:00
|
|
|
struct ScaleSlot {
|
|
|
|
int x1, y1, scale1;
|
|
|
|
int x2, y2, scale2;
|
|
|
|
};
|
2003-09-09 16:55:25 +00:00
|
|
|
ScaleSlot _scaleSlots[20];
|
2003-01-13 01:29:45 +00:00
|
|
|
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-09-09 16:55:25 +00:00
|
|
|
void convertScaleTableToScaleSlot(int slot);
|
2003-01-13 01:29:45 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
void createBoxMatrix();
|
2003-05-25 00:47:36 +00:00
|
|
|
bool areBoxesNeighbours(int i, int j);
|
2001-11-26 19:57:57 +00:00
|
|
|
|
2002-03-20 17:51:07 +00:00
|
|
|
/* String class */
|
2004-01-08 21:21:40 +00:00
|
|
|
public:
|
2002-12-25 21:04:47 +00:00
|
|
|
CharsetRenderer *_charset;
|
2002-12-26 00:21:19 +00:00
|
|
|
byte _charsetColorMap[16];
|
2003-05-25 00:47:36 +00:00
|
|
|
protected:
|
2004-01-25 12:20:59 +00:00
|
|
|
byte _charsetColor;
|
2006-03-26 09:06:44 +00:00
|
|
|
byte _charsetData[23][16];
|
2002-12-25 21:04:47 +00:00
|
|
|
|
2002-12-26 00:21:19 +00:00
|
|
|
int _charsetBufPos;
|
|
|
|
byte _charsetBuffer[512];
|
|
|
|
|
2004-04-04 00:29:13 +00:00
|
|
|
bool _keepText;
|
|
|
|
|
2005-05-05 13:16:50 +00:00
|
|
|
virtual void initCharset(int charset);
|
2004-01-08 21:21:40 +00:00
|
|
|
|
2004-09-18 20:50:15 +00:00
|
|
|
void printString(int m, const byte *msg);
|
|
|
|
|
2005-11-02 21:47:44 +00:00
|
|
|
virtual bool handleNextCharsetCode(Actor *a, int *c);
|
2002-03-20 17:51:07 +00:00
|
|
|
void CHARSET_1();
|
2004-03-15 03:09:48 +00:00
|
|
|
void drawString(int a, const byte *msg);
|
2005-06-13 07:09:12 +00:00
|
|
|
void debugMessage(const byte *msg);
|
2004-11-22 22:32:46 +00:00
|
|
|
void showMessageDialog(const byte *msg);
|
2004-04-04 00:29:13 +00:00
|
|
|
|
2006-09-01 12:04:40 +00:00
|
|
|
virtual int convertMessageToString(const byte *msg, byte *dst, int dstSize);
|
2005-05-26 14:14:32 +00:00
|
|
|
int convertIntMessage(byte *dst, int dstSize, int var);
|
|
|
|
int convertVerbMessage(byte *dst, int dstSize, int var);
|
|
|
|
int convertNameMessage(byte *dst, int dstSize, int var);
|
|
|
|
int convertStringMessage(byte *dst, int dstSize, int var);
|
2004-04-04 00:29:13 +00:00
|
|
|
|
2003-05-25 20:38:44 +00:00
|
|
|
public:
|
2005-04-28 22:17:23 +00:00
|
|
|
Common::Language _language; // Accessed by a hack in NutRenderer::loadFont
|
|
|
|
|
|
|
|
// Used by class ScummDialog:
|
|
|
|
virtual void translateText(const byte *text, byte *trans_buff);
|
2003-06-04 14:37:43 +00:00
|
|
|
|
|
|
|
// Somewhat hackish stuff for 2 byte support (Chinese/Japanese/Korean)
|
2004-09-18 22:42:45 +00:00
|
|
|
bool _useCJKMode;
|
2003-06-04 14:37:43 +00:00
|
|
|
int _2byteHeight;
|
|
|
|
int _2byteWidth;
|
|
|
|
byte *get2byteCharPtr(int idx);
|
2003-06-14 11:52:34 +00:00
|
|
|
|
2003-05-25 00:47:36 +00:00
|
|
|
protected:
|
2003-06-14 11:52:34 +00:00
|
|
|
byte *_2byteFontPtr;
|
2003-05-25 00:47:36 +00:00
|
|
|
|
|
|
|
public:
|
2003-01-14 10:06:56 +00:00
|
|
|
|
2002-12-16 12:12:31 +00:00
|
|
|
/* Scumm Vars */
|
2002-12-21 12:34:17 +00:00
|
|
|
byte VAR_KEYPRESS;
|
2004-01-09 22:10:32 +00:00
|
|
|
byte VAR_SYNC;
|
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;
|
2005-04-20 23:13:11 +00:00
|
|
|
byte VAR_CURRENTDRIVE;
|
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;
|
2003-06-14 12:23:30 +00:00
|
|
|
byte VAR_INVENTORY_SCRIPT;
|
2002-12-16 12:12:31 +00:00
|
|
|
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;
|
2003-11-03 23:26:13 +00:00
|
|
|
byte VAR_MAINMENU_KEY;
|
2002-12-16 12:12:31 +00:00
|
|
|
byte VAR_FIXEDDISK;
|
|
|
|
byte VAR_CURSORSTATE;
|
|
|
|
byte VAR_USERPUT;
|
|
|
|
byte VAR_SOUNDRESULT;
|
|
|
|
byte VAR_TALKSTOP_KEY;
|
2004-07-24 04:36:54 +00:00
|
|
|
byte VAR_FADE_DELAY;
|
2003-06-12 16:38:43 +00:00
|
|
|
byte VAR_NOSUBTITLES;
|
2003-03-06 17:58:13 +00:00
|
|
|
|
2005-04-20 23:13:11 +00:00
|
|
|
// V5+
|
2002-12-16 12:12:31 +00:00
|
|
|
byte VAR_SOUNDPARAM;
|
|
|
|
byte VAR_SOUNDPARAM2;
|
|
|
|
byte VAR_SOUNDPARAM3;
|
2006-08-20 00:43:34 +00:00
|
|
|
byte VAR_INPUTMODE;
|
2004-07-24 11:15:59 +00:00
|
|
|
byte VAR_MEMORY_PERFORMANCE;
|
|
|
|
byte VAR_VIDEO_PERFORMANCE;
|
2002-12-16 12:12:31 +00:00
|
|
|
byte VAR_ROOM_FLAG;
|
|
|
|
byte VAR_GAME_LOADED;
|
|
|
|
byte VAR_NEW_ROOM;
|
|
|
|
|
2005-04-20 23:13:11 +00:00
|
|
|
// V4/V5
|
2002-12-16 12:12:31 +00:00
|
|
|
byte VAR_V5_TALK_STRING_Y;
|
|
|
|
|
2005-04-20 23:13:11 +00:00
|
|
|
// V6+
|
2004-10-04 14:28:43 +00:00
|
|
|
byte VAR_ROOM_WIDTH;
|
|
|
|
byte VAR_ROOM_HEIGHT;
|
2005-05-09 02:38:58 +00:00
|
|
|
byte VAR_SUBTITLES;
|
2002-12-16 12:12:31 +00:00
|
|
|
byte VAR_V6_EMSSPACE;
|
|
|
|
|
2005-04-20 23:13:11 +00:00
|
|
|
// V7/V8 (=GF_NEW_CAMERA) specific variables
|
2002-12-16 12:12:31 +00:00
|
|
|
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;
|
|
|
|
|
2005-04-20 23:13:11 +00:00
|
|
|
// V7/V8 specific variables
|
|
|
|
byte VAR_VERSION_KEY;
|
2002-12-16 12:12:31 +00:00
|
|
|
byte VAR_DEFAULT_TALK_DELAY;
|
2005-04-20 23:13:11 +00:00
|
|
|
byte VAR_CUSTOMSCALETABLE;
|
|
|
|
byte VAR_BLAST_ABOVE_TEXT;
|
|
|
|
byte VAR_VOICE_MODE;
|
|
|
|
byte VAR_MUSIC_BUNDLE_LOADED;
|
|
|
|
byte VAR_VOICE_BUNDLE_LOADED;
|
|
|
|
|
2005-11-10 23:09:20 +00:00
|
|
|
byte VAR_LEFTBTN_DOWN; // V7/V8
|
|
|
|
byte VAR_RIGHTBTN_DOWN; // V7/V8
|
|
|
|
byte VAR_LEFTBTN_HOLD; // V6/V72HE/V7/V8
|
|
|
|
byte VAR_RIGHTBTN_HOLD; // V6/V72HE/V7/V8
|
2005-04-20 23:13:11 +00:00
|
|
|
byte VAR_SAVELOAD_SCRIPT; // V6/V7 (not HE)
|
|
|
|
byte VAR_SAVELOAD_SCRIPT2; // V6/V7 (not HE)
|
|
|
|
|
2006-01-05 07:06:47 +00:00
|
|
|
// V6/V7 specific variables (FT & Sam & Max specific)
|
2002-12-16 12:12:31 +00:00
|
|
|
byte VAR_CHARSET_MASK;
|
|
|
|
|
2005-04-20 23:13:11 +00:00
|
|
|
// V6 specific variables
|
2002-12-16 12:12:31 +00:00
|
|
|
byte VAR_V6_SOUNDMODE;
|
2003-05-17 06:14:08 +00:00
|
|
|
|
2005-04-20 23:13:11 +00:00
|
|
|
// V1/V2 specific variables
|
2003-05-18 23:37:44 +00:00
|
|
|
byte VAR_CHARCOUNT;
|
2003-05-17 18:42:31 +00:00
|
|
|
byte VAR_VERB_ALLOWED;
|
|
|
|
byte VAR_ACTIVE_VERB;
|
|
|
|
byte VAR_ACTIVE_OBJECT1;
|
|
|
|
byte VAR_ACTIVE_OBJECT2;
|
2004-02-20 15:04:51 +00:00
|
|
|
|
2005-04-20 23:13:11 +00:00
|
|
|
// HE specific variables
|
2006-01-16 11:36:16 +00:00
|
|
|
byte VAR_REDRAW_ALL_ACTORS; // Used in setActorRedrawFlags()
|
|
|
|
byte VAR_SKIP_RESET_TALK_ACTOR; // Used in setActorCostume()
|
2006-01-14 10:09:50 +00:00
|
|
|
|
2006-01-16 11:36:16 +00:00
|
|
|
byte VAR_SOUND_CHANNEL; // Used in o_startSound()
|
|
|
|
byte VAR_TALK_CHANNEL; // Used in startHETalkSound()
|
|
|
|
byte VAR_SOUNDCODE_TMR; // Used in processSoundCode()
|
|
|
|
byte VAR_RESERVED_SOUND_CHANNELS; // Used in findFreeSoundChannel()
|
2004-09-10 10:39:10 +00:00
|
|
|
|
2006-01-16 11:36:16 +00:00
|
|
|
byte VAR_MAIN_SCRIPT; // Used in scummLoop()
|
2006-01-14 10:09:50 +00:00
|
|
|
|
2006-01-16 11:36:16 +00:00
|
|
|
byte VAR_SCRIPT_CYCLE; // Used in runScript()/runObjectScript()
|
|
|
|
byte VAR_NUM_SCRIPT_CYCLES; // Used in runAllScripts()
|
2005-02-28 13:23:10 +00:00
|
|
|
|
2006-01-16 11:36:16 +00:00
|
|
|
byte VAR_KEY_STATE; // Used in parseEvents()
|
|
|
|
byte VAR_MOUSE_STATE; // Used in checkExecVerbs();
|
2005-04-20 23:13:11 +00:00
|
|
|
|
|
|
|
// Exists both in V7 and in V72HE:
|
|
|
|
byte VAR_NUM_GLOBAL_OBJS;
|
2002-12-16 12:12:31 +00:00
|
|
|
};
|
|
|
|
|
2003-10-03 18:33:57 +00:00
|
|
|
} // End of namespace Scumm
|
2002-07-22 18:11:48 +00:00
|
|
|
|
2002-05-14 19:11:20 +00:00
|
|
|
#endif
|