2003-09-11 10:32:15 +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
|
2003-09-11 10:32:15 +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.
|
2003-09-11 10:32:15 +00:00
|
|
|
*
|
2006-02-11 09:55:41 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2003-09-11 10:32:15 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SCRIPT_H
|
|
|
|
#define SCRIPT_H
|
|
|
|
|
2003-09-18 02:07:18 +00:00
|
|
|
#include "base/engine.h"
|
2003-09-11 10:32:15 +00:00
|
|
|
|
2003-10-03 18:33:57 +00:00
|
|
|
namespace Scumm {
|
2003-09-11 10:32:15 +00:00
|
|
|
|
2005-10-21 22:49:59 +00:00
|
|
|
/**
|
|
|
|
* The number of script slots, which determines the maximal number
|
|
|
|
* of concurrently running scripts.
|
|
|
|
* WARNING: Do NOT changes this value unless you really have to, as
|
|
|
|
* this will break savegame compatibility if done carelessly. If you
|
|
|
|
* have to change it, make sure you update saveload.cpp accordingly!
|
|
|
|
*/
|
2003-09-11 10:32:15 +00:00
|
|
|
enum {
|
|
|
|
NUM_SCRIPT_SLOT = 80
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Script status type (slot.status) */
|
|
|
|
enum {
|
|
|
|
ssDead = 0,
|
|
|
|
ssPaused = 1,
|
|
|
|
ssRunning = 2
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ScriptSlot {
|
|
|
|
uint32 offs;
|
|
|
|
int32 delay;
|
|
|
|
uint16 number;
|
|
|
|
uint16 delayFrameCount;
|
|
|
|
bool freezeResistant, recursive;
|
|
|
|
bool didexec;
|
|
|
|
byte status;
|
|
|
|
byte where;
|
|
|
|
byte freezeCount;
|
|
|
|
byte cutsceneOverride;
|
2005-02-28 13:23:10 +00:00
|
|
|
byte cycle;
|
2003-09-11 10:32:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct NestedScript {
|
|
|
|
uint16 number;
|
|
|
|
uint8 where;
|
|
|
|
uint8 slot;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct VirtualMachineState {
|
|
|
|
uint32 cutScenePtr[5];
|
|
|
|
byte cutSceneScript[5];
|
|
|
|
int16 cutSceneData[5];
|
|
|
|
int16 cutSceneScriptIndex;
|
|
|
|
byte cutSceneStackPointer;
|
|
|
|
ScriptSlot slot[NUM_SCRIPT_SLOT];
|
|
|
|
int32 localvar[NUM_SCRIPT_SLOT][26];
|
|
|
|
|
|
|
|
NestedScript nest[15];
|
|
|
|
byte numNestedScripts;
|
|
|
|
};
|
|
|
|
|
2003-10-03 18:33:57 +00:00
|
|
|
} // End of namespace Scumm
|
2003-09-11 10:32:15 +00:00
|
|
|
|
|
|
|
#endif
|