2007-08-24 20:14:51 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2008-07-11 13:06:28 +00:00
|
|
|
#include "parallaction/exec.h"
|
2008-05-14 14:34:01 +00:00
|
|
|
#include "parallaction/input.h"
|
2007-08-24 20:14:51 +00:00
|
|
|
#include "parallaction/parallaction.h"
|
|
|
|
#include "parallaction/sound.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace Parallaction {
|
|
|
|
|
2008-01-28 00:14:17 +00:00
|
|
|
#define INST_ON 1
|
2007-08-24 20:14:51 +00:00
|
|
|
#define INST_OFF 2
|
|
|
|
#define INST_X 3
|
|
|
|
#define INST_Y 4
|
|
|
|
#define INST_Z 5
|
|
|
|
#define INST_F 6
|
|
|
|
#define INST_LOOP 7
|
|
|
|
#define INST_ENDLOOP 8
|
|
|
|
#define INST_SHOW 9
|
|
|
|
#define INST_INC 10
|
|
|
|
#define INST_DEC 11
|
|
|
|
#define INST_SET 12
|
|
|
|
#define INST_PUT 13
|
|
|
|
#define INST_CALL 14
|
|
|
|
#define INST_WAIT 15
|
|
|
|
#define INST_START 16
|
|
|
|
#define INST_SOUND 17
|
|
|
|
#define INST_MOVE 18
|
2007-09-15 12:16:43 +00:00
|
|
|
#define INST_ENDSCRIPT 19
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-06-01 14:05:39 +00:00
|
|
|
#define SetOpcodeTable(x) table = &x;
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-07-11 13:06:28 +00:00
|
|
|
typedef Common::Functor0Mem<void, CommandExec_ns> OpcodeV1;
|
|
|
|
#define COMMAND_OPCODE(op) table->push_back(new OpcodeV1(this, &CommandExec_ns::cmdOp_##op))
|
|
|
|
#define DECLARE_COMMAND_OPCODE(op) void CommandExec_ns::cmdOp_##op()
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-07-11 13:06:28 +00:00
|
|
|
typedef Common::Functor0Mem<void, ProgramExec_ns> OpcodeV2;
|
|
|
|
#define INSTRUCTION_OPCODE(op) table->push_back(new OpcodeV2(this, &ProgramExec_ns::instOp_##op))
|
|
|
|
#define DECLARE_INSTRUCTION_OPCODE(op) void ProgramExec_ns::instOp_##op()
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-07-28 08:25:06 +00:00
|
|
|
extern const char *_instructionNamesRes_ns[];
|
2007-08-24 20:14:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
DECLARE_INSTRUCTION_OPCODE(on) {
|
2008-07-11 13:36:22 +00:00
|
|
|
InstructionPtr inst = *_ctxt.inst;
|
2007-08-25 11:45:05 +00:00
|
|
|
|
|
|
|
inst->_a->_flags |= kFlagsActive;
|
|
|
|
inst->_a->_flags &= ~kFlagsRemove;
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_INSTRUCTION_OPCODE(off) {
|
2008-07-11 13:36:22 +00:00
|
|
|
(*_ctxt.inst)->_a->_flags |= kFlagsRemove;
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_INSTRUCTION_OPCODE(loop) {
|
2008-07-11 13:36:22 +00:00
|
|
|
InstructionPtr inst = *_ctxt.inst;
|
2007-08-25 11:45:05 +00:00
|
|
|
|
2008-07-11 13:36:22 +00:00
|
|
|
_ctxt.program->_loopCounter = inst->_opB.getRValue();
|
|
|
|
_ctxt.program->_loopStart = _ctxt.inst;
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_INSTRUCTION_OPCODE(endloop) {
|
2008-07-11 13:36:22 +00:00
|
|
|
if (--_ctxt.program->_loopCounter > 0) {
|
|
|
|
_ctxt.inst = _ctxt.program->_loopStart;
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DECLARE_INSTRUCTION_OPCODE(inc) {
|
2008-07-11 13:36:22 +00:00
|
|
|
InstructionPtr inst = *_ctxt.inst;
|
2007-08-25 11:45:05 +00:00
|
|
|
int16 _si = inst->_opB.getRValue();
|
|
|
|
|
|
|
|
if (inst->_flags & kInstMod) { // mod
|
|
|
|
int16 _bx = (_si > 0 ? _si : -_si);
|
2008-07-11 13:36:22 +00:00
|
|
|
if (_modCounter % _bx != 0) return;
|
2007-08-24 20:14:51 +00:00
|
|
|
|
|
|
|
_si = (_si > 0 ? 1 : -1);
|
|
|
|
}
|
|
|
|
|
2007-08-25 11:45:05 +00:00
|
|
|
int16* lvalue = inst->_opA.getLValue();
|
|
|
|
|
|
|
|
if (inst->_index == INST_INC) {
|
|
|
|
*lvalue += _si;
|
|
|
|
} else {
|
|
|
|
*lvalue -= _si;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (inst->_opA._flags & kParaLocal) {
|
2008-05-09 01:42:25 +00:00
|
|
|
inst->_opA._local->wrap();
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_INSTRUCTION_OPCODE(set) {
|
2008-07-11 13:36:22 +00:00
|
|
|
InstructionPtr inst = *_ctxt.inst;
|
2007-08-25 11:45:05 +00:00
|
|
|
|
|
|
|
int16 _si = inst->_opB.getRValue();
|
|
|
|
int16 *lvalue = inst->_opA.getLValue();
|
|
|
|
|
|
|
|
*lvalue = _si;
|
2007-08-24 20:14:51 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_INSTRUCTION_OPCODE(put) {
|
2008-07-11 13:36:22 +00:00
|
|
|
InstructionPtr inst = *_ctxt.inst;
|
2007-08-24 20:14:51 +00:00
|
|
|
Graphics::Surface v18;
|
2007-08-25 11:45:05 +00:00
|
|
|
v18.w = inst->_a->width();
|
|
|
|
v18.h = inst->_a->height();
|
|
|
|
v18.pixels = inst->_a->getFrameData(inst->_a->_frame);
|
|
|
|
|
|
|
|
int16 x = inst->_opA.getRValue();
|
|
|
|
int16 y = inst->_opB.getRValue();
|
2008-01-12 10:46:51 +00:00
|
|
|
bool mask = (inst->_flags & kInstMaskedPut) == kInstMaskedPut;
|
2007-08-25 11:45:05 +00:00
|
|
|
|
2008-07-11 13:06:28 +00:00
|
|
|
_vm->_gfx->patchBackground(v18, x, y, mask);
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DECLARE_INSTRUCTION_OPCODE(null) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
DECLARE_INSTRUCTION_OPCODE(invalid) {
|
2008-07-11 13:36:22 +00:00
|
|
|
error("Can't execute invalid opcode %i", (*_ctxt.inst)->_index);
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DECLARE_INSTRUCTION_OPCODE(call) {
|
2008-07-11 13:36:22 +00:00
|
|
|
_vm->callFunction((*_ctxt.inst)->_immediate, 0);
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_INSTRUCTION_OPCODE(wait) {
|
|
|
|
if (_engineFlags & kEngineWalking)
|
2008-07-11 13:36:22 +00:00
|
|
|
_ctxt.suspend = true;
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_INSTRUCTION_OPCODE(start) {
|
2008-07-11 13:36:22 +00:00
|
|
|
(*_ctxt.inst)->_a->_flags |= (kFlagsActing | kFlagsActive);
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_INSTRUCTION_OPCODE(sound) {
|
2008-07-11 13:36:22 +00:00
|
|
|
_vm->_activeZone = (*_ctxt.inst)->_z;
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_INSTRUCTION_OPCODE(move) {
|
2008-07-11 13:36:22 +00:00
|
|
|
InstructionPtr inst = (*_ctxt.inst);
|
2007-08-25 11:45:05 +00:00
|
|
|
|
|
|
|
int16 x = inst->_opA.getRValue();
|
|
|
|
int16 y = inst->_opB.getRValue();
|
|
|
|
|
2008-07-11 13:06:28 +00:00
|
|
|
_vm->_char.scheduleWalk(x, y);
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
2007-09-15 12:16:43 +00:00
|
|
|
DECLARE_INSTRUCTION_OPCODE(endscript) {
|
2008-07-11 13:36:22 +00:00
|
|
|
if ((_ctxt.anim->_flags & kFlagsLooping) == 0) {
|
|
|
|
_ctxt.anim->_flags &= ~kFlagsActing;
|
|
|
|
_vm->_cmdExec->run(_ctxt.anim->_commands, _ctxt.anim);
|
|
|
|
_ctxt.program->_status = kProgramDone;
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
2008-07-11 13:36:22 +00:00
|
|
|
_ctxt.program->_ip = _ctxt.program->_instructions.begin();
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-07-11 13:36:22 +00:00
|
|
|
_ctxt.suspend = true;
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_COMMAND_OPCODE(invalid) {
|
2008-07-11 13:36:22 +00:00
|
|
|
error("Can't execute invalid command '%i'", _ctxt.cmd->_id);
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DECLARE_COMMAND_OPCODE(set) {
|
2008-07-11 13:36:22 +00:00
|
|
|
if (_ctxt.cmd->u._flags & kFlagsGlobal) {
|
|
|
|
_ctxt.cmd->u._flags &= ~kFlagsGlobal;
|
|
|
|
_commandFlags |= _ctxt.cmd->u._flags;
|
2007-08-24 20:14:51 +00:00
|
|
|
} else {
|
2008-07-11 13:36:22 +00:00
|
|
|
_vm->setLocationFlags(_ctxt.cmd->u._flags);
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_COMMAND_OPCODE(clear) {
|
2008-07-11 13:36:22 +00:00
|
|
|
if (_ctxt.cmd->u._flags & kFlagsGlobal) {
|
|
|
|
_ctxt.cmd->u._flags &= ~kFlagsGlobal;
|
|
|
|
_commandFlags &= ~_ctxt.cmd->u._flags;
|
2007-08-24 20:14:51 +00:00
|
|
|
} else {
|
2008-07-11 13:36:22 +00:00
|
|
|
_vm->clearLocationFlags(_ctxt.cmd->u._flags);
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_COMMAND_OPCODE(start) {
|
2008-07-11 13:36:22 +00:00
|
|
|
_ctxt.cmd->u._zone->_flags |= kFlagsActing;
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_COMMAND_OPCODE(speak) {
|
2008-07-21 06:08:30 +00:00
|
|
|
if ((_ctxt.cmd->u._zone->_type & 0xFFFF) == kZoneSpeak) {
|
|
|
|
_vm->enterDialogueMode(_ctxt.cmd->u._zone);
|
|
|
|
} else {
|
|
|
|
_vm->_activeZone = _ctxt.cmd->u._zone;
|
|
|
|
}
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_COMMAND_OPCODE(get) {
|
2008-07-11 13:36:22 +00:00
|
|
|
_ctxt.cmd->u._zone->_flags &= ~kFlagsFixed;
|
|
|
|
_vm->runZone(_ctxt.cmd->u._zone);
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_COMMAND_OPCODE(location) {
|
2008-07-11 13:36:22 +00:00
|
|
|
_vm->scheduleLocationSwitch(_ctxt.cmd->u._string);
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_COMMAND_OPCODE(open) {
|
2008-07-11 13:36:22 +00:00
|
|
|
_ctxt.cmd->u._zone->_flags &= ~kFlagsClosed;
|
|
|
|
if (_ctxt.cmd->u._zone->u.door->gfxobj) {
|
|
|
|
_vm->updateDoor(_ctxt.cmd->u._zone);
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_COMMAND_OPCODE(close) {
|
2008-07-11 13:36:22 +00:00
|
|
|
_ctxt.cmd->u._zone->_flags |= kFlagsClosed;
|
|
|
|
if (_ctxt.cmd->u._zone->u.door->gfxobj) {
|
|
|
|
_vm->updateDoor(_ctxt.cmd->u._zone);
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-13 03:30:14 +00:00
|
|
|
void CommandExec_ns::updateGetZone(ZonePtr z, bool visible) {
|
|
|
|
if (!z) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((z->_type & 0xFFFF) == kZoneGet) {
|
|
|
|
_vm->_gfx->showGfxObj(z->u.get->gfxobj, visible);
|
|
|
|
}
|
|
|
|
}
|
2007-08-24 20:14:51 +00:00
|
|
|
|
|
|
|
DECLARE_COMMAND_OPCODE(on) {
|
2008-07-11 13:36:22 +00:00
|
|
|
ZonePtr z = _ctxt.cmd->u._zone;
|
2008-07-13 03:30:14 +00:00
|
|
|
|
2008-04-06 05:40:02 +00:00
|
|
|
if (z) {
|
2008-01-28 12:20:53 +00:00
|
|
|
z->_flags &= ~kFlagsRemove;
|
|
|
|
z->_flags |= kFlagsActive;
|
2008-07-13 03:30:14 +00:00
|
|
|
updateGetZone(z, true);
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_COMMAND_OPCODE(off) {
|
2008-07-13 03:30:14 +00:00
|
|
|
ZonePtr z = _ctxt.cmd->u._zone;
|
|
|
|
|
|
|
|
if (z) {
|
|
|
|
_ctxt.cmd->u._zone->_flags |= kFlagsRemove;
|
|
|
|
updateGetZone(z, false);
|
|
|
|
}
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_COMMAND_OPCODE(call) {
|
2008-07-11 13:36:22 +00:00
|
|
|
_vm->callFunction(_ctxt.cmd->u._callable, &_ctxt.z);
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_COMMAND_OPCODE(toggle) {
|
2008-07-11 13:36:22 +00:00
|
|
|
if (_ctxt.cmd->u._flags & kFlagsGlobal) {
|
|
|
|
_ctxt.cmd->u._flags &= ~kFlagsGlobal;
|
|
|
|
_commandFlags ^= _ctxt.cmd->u._flags;
|
2007-08-24 20:14:51 +00:00
|
|
|
} else {
|
2008-07-11 13:36:22 +00:00
|
|
|
_vm->toggleLocationFlags(_ctxt.cmd->u._flags);
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_COMMAND_OPCODE(drop){
|
2008-07-11 13:36:22 +00:00
|
|
|
_vm->dropItem( _ctxt.cmd->u._object );
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_COMMAND_OPCODE(quit) {
|
|
|
|
_engineFlags |= kEngineQuit;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_COMMAND_OPCODE(move) {
|
2008-07-11 13:36:22 +00:00
|
|
|
_vm->_char.scheduleWalk(_ctxt.cmd->u._move.x, _ctxt.cmd->u._move.y);
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_COMMAND_OPCODE(stop) {
|
2008-07-11 13:36:22 +00:00
|
|
|
_ctxt.cmd->u._zone->_flags &= ~kFlagsActing;
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-11-18 21:32:22 +00:00
|
|
|
void Parallaction_ns::drawAnimations() {
|
2008-07-21 06:08:30 +00:00
|
|
|
debugC(9, kDebugExec, "Parallaction_ns::drawAnimations()\n");
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-01-28 16:52:41 +00:00
|
|
|
uint16 layer = 0;
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-05-05 11:02:40 +00:00
|
|
|
for (AnimationList::iterator it = _location._animations.begin(); it != _location._animations.end(); it++) {
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-07-28 08:56:37 +00:00
|
|
|
AnimationPtr anim = *it;
|
|
|
|
GfxObj *obj = anim->gfxobj;
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-07-28 14:22:44 +00:00
|
|
|
// Validation is performed here, so that every animation is affected, instead that only the ones
|
|
|
|
// who *own* a script. In fact, some scripts can change values in other animations.
|
|
|
|
// The right way to do this would be to enforce validation when any variable is modified from
|
|
|
|
// a script.
|
|
|
|
anim->validateScriptVars();
|
|
|
|
|
2008-07-28 08:56:37 +00:00
|
|
|
if ((anim->_flags & kFlagsActive) && ((anim->_flags & kFlagsRemove) == 0)) {
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-07-28 08:56:37 +00:00
|
|
|
if (anim->_flags & kFlagsNoMasked)
|
2008-01-28 16:52:41 +00:00
|
|
|
layer = 3;
|
2007-08-24 20:14:51 +00:00
|
|
|
else
|
2008-07-28 08:56:37 +00:00
|
|
|
layer = _gfx->_backgroundInfo.getLayer(anim->_top + anim->height());
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-02-02 13:57:29 +00:00
|
|
|
if (obj) {
|
|
|
|
_gfx->showGfxObj(obj, true);
|
2008-07-28 08:56:37 +00:00
|
|
|
obj->frame = anim->_frame;
|
|
|
|
obj->x = anim->_left;
|
|
|
|
obj->y = anim->_top;
|
|
|
|
obj->z = anim->_z;
|
2008-02-02 13:57:29 +00:00
|
|
|
obj->layer = layer;
|
|
|
|
}
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
2008-07-28 08:56:37 +00:00
|
|
|
if (((anim->_flags & kFlagsActive) == 0) && (anim->_flags & kFlagsRemove)) {
|
|
|
|
anim->_flags &= ~kFlagsRemove;
|
|
|
|
anim->_oldPos.x = -1000;
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
2008-07-28 08:56:37 +00:00
|
|
|
if ((anim->_flags & kFlagsActive) && (anim->_flags & kFlagsRemove)) {
|
|
|
|
anim->_flags &= ~kFlagsActive;
|
|
|
|
anim->_flags |= kFlagsRemove;
|
2008-02-02 13:57:29 +00:00
|
|
|
if (obj) {
|
|
|
|
_gfx->showGfxObj(obj, false);
|
|
|
|
}
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-21 06:08:30 +00:00
|
|
|
debugC(9, kDebugExec, "Parallaction_ns::drawAnimations done()\n");
|
|
|
|
|
2007-08-24 20:14:51 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-07-11 13:06:28 +00:00
|
|
|
void ProgramExec::runScripts(ProgramList::iterator first, ProgramList::iterator last) {
|
2007-11-19 20:23:01 +00:00
|
|
|
if (_engineFlags & kEnginePauseJobs) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-02-02 21:22:05 +00:00
|
|
|
debugC(9, kDebugExec, "runScripts");
|
|
|
|
|
2008-07-11 13:06:28 +00:00
|
|
|
for (ProgramList::iterator it = first; it != last; it++) {
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-04-06 05:40:02 +00:00
|
|
|
AnimationPtr a = (*it)->_anim;
|
2007-08-24 20:14:51 +00:00
|
|
|
|
|
|
|
if (a->_flags & kFlagsCharacter)
|
|
|
|
a->_z = a->_top + a->height();
|
|
|
|
|
|
|
|
if ((a->_flags & kFlagsActing) == 0)
|
|
|
|
continue;
|
|
|
|
|
2008-02-03 14:58:16 +00:00
|
|
|
InstructionList::iterator inst = (*it)->_ip;
|
2007-08-24 20:14:51 +00:00
|
|
|
while (((*inst)->_index != INST_SHOW) && (a->_flags & kFlagsActing)) {
|
|
|
|
|
2008-02-09 22:07:51 +00:00
|
|
|
(*it)->_status = kProgramRunning;
|
|
|
|
|
2008-07-28 08:25:06 +00:00
|
|
|
debugC(9, kDebugExec, "anim: %s, inst[%02i]: %s", a->_name, (*inst)->_index, _instructionNames[(*inst)->_index - 1]);
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-07-11 13:36:22 +00:00
|
|
|
_ctxt.inst = inst;
|
|
|
|
_ctxt.anim = AnimationPtr(a);
|
|
|
|
_ctxt.program = *it;
|
|
|
|
_ctxt.suspend = false;
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-07-11 13:06:28 +00:00
|
|
|
(*_opcodes[(*inst)->_index])();
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-07-11 13:36:22 +00:00
|
|
|
inst = _ctxt.inst; // handles endloop correctly
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-07-11 13:36:22 +00:00
|
|
|
if (_ctxt.suspend)
|
2007-08-24 20:14:51 +00:00
|
|
|
goto label1;
|
|
|
|
|
|
|
|
inst++;
|
|
|
|
}
|
|
|
|
|
2008-02-03 14:58:16 +00:00
|
|
|
(*it)->_ip = ++inst;
|
2007-08-24 20:14:51 +00:00
|
|
|
|
|
|
|
label1:
|
|
|
|
if (a->_flags & kFlagsCharacter)
|
|
|
|
a->_z = a->_top + a->height();
|
|
|
|
}
|
|
|
|
|
2008-07-11 13:36:22 +00:00
|
|
|
_modCounter++;
|
2007-08-24 20:14:51 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-07-29 12:59:55 +00:00
|
|
|
void CommandExec::runList(CommandList::iterator first, CommandList::iterator last) {
|
2007-11-18 13:22:38 +00:00
|
|
|
|
2008-07-13 03:39:42 +00:00
|
|
|
uint32 useFlags = 0;
|
|
|
|
bool useLocalFlags;
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-07-29 12:59:55 +00:00
|
|
|
_ctxt.suspend = false;
|
|
|
|
|
|
|
|
for ( ; first != last; first++) {
|
2007-08-24 20:14:51 +00:00
|
|
|
if (_engineFlags & kEngineQuit)
|
|
|
|
break;
|
|
|
|
|
2008-07-29 12:59:55 +00:00
|
|
|
CommandPtr cmd = *first;
|
2008-07-13 03:39:42 +00:00
|
|
|
|
2007-08-24 20:14:51 +00:00
|
|
|
if (cmd->_flagsOn & kFlagsGlobal) {
|
2008-07-13 03:39:42 +00:00
|
|
|
useFlags = _commandFlags | kFlagsGlobal;
|
|
|
|
useLocalFlags = false;
|
|
|
|
} else {
|
|
|
|
useFlags = _vm->getLocationFlags();
|
|
|
|
useLocalFlags = true;
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
2008-07-13 03:39:42 +00:00
|
|
|
bool onMatch = (cmd->_flagsOn & useFlags) == cmd->_flagsOn;
|
|
|
|
bool offMatch = (cmd->_flagsOff & ~useFlags) == cmd->_flagsOff;
|
|
|
|
|
|
|
|
debugC(3, kDebugExec, "runCommands[%i] (on: %x, off: %x), (%s = %x)", cmd->_id, cmd->_flagsOn, cmd->_flagsOff,
|
|
|
|
useLocalFlags ? "LOCALFLAGS" : "GLOBALFLAGS", useFlags);
|
2008-07-11 13:06:28 +00:00
|
|
|
|
2008-07-13 03:39:42 +00:00
|
|
|
if (!onMatch || !offMatch) continue;
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-07-29 12:59:55 +00:00
|
|
|
_ctxt.z = _execZone;
|
2008-07-11 13:36:22 +00:00
|
|
|
_ctxt.cmd = cmd;
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-07-11 13:06:28 +00:00
|
|
|
(*_opcodes[cmd->_id])();
|
2008-07-29 12:59:55 +00:00
|
|
|
|
|
|
|
if (_ctxt.suspend) {
|
|
|
|
createSuspendList(++first, last);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void CommandExec::run(CommandList& list, ZonePtr z) {
|
|
|
|
if (list.size() == 0) {
|
|
|
|
debugC(3, kDebugExec, "runCommands: nothing to do");
|
|
|
|
return;
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
2008-07-29 12:59:55 +00:00
|
|
|
_execZone = z;
|
|
|
|
|
|
|
|
debugC(3, kDebugExec, "runCommands starting");
|
|
|
|
runList(list.begin(), list.end());
|
2007-09-16 08:43:34 +00:00
|
|
|
debugC(3, kDebugExec, "runCommands completed");
|
2008-07-29 12:59:55 +00:00
|
|
|
}
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-07-29 12:59:55 +00:00
|
|
|
void CommandExec::createSuspendList(CommandList::iterator first, CommandList::iterator last) {
|
|
|
|
if (first == last) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
debugC(3, kDebugExec, "CommandExec::createSuspendList()");
|
|
|
|
|
|
|
|
_suspendedCtxt.valid = true;
|
|
|
|
_suspendedCtxt.first = first;
|
|
|
|
_suspendedCtxt.last = last;
|
|
|
|
_suspendedCtxt.zone = _execZone;
|
|
|
|
}
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-07-29 12:59:55 +00:00
|
|
|
void CommandExec::cleanSuspendedList() {
|
|
|
|
debugC(3, kDebugExec, "CommandExec::cleanSuspended()");
|
|
|
|
|
|
|
|
_suspendedCtxt.valid = false;
|
|
|
|
_suspendedCtxt.first = _suspendedCtxt.last;
|
|
|
|
_suspendedCtxt.zone = nullZonePtr;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CommandExec::runSuspended() {
|
|
|
|
if (_engineFlags & kEngineWalking) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_suspendedCtxt.valid) {
|
|
|
|
debugC(3, kDebugExec, "CommandExec::runSuspended()");
|
|
|
|
|
|
|
|
_execZone = _suspendedCtxt.zone;
|
|
|
|
runList(_suspendedCtxt.first, _suspendedCtxt.last);
|
|
|
|
cleanSuspendedList();
|
|
|
|
}
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
2008-07-11 13:06:28 +00:00
|
|
|
CommandExec_ns::CommandExec_ns(Parallaction_ns* vm) : _vm(vm) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
CommandExec_ns::~CommandExec_ns() {
|
|
|
|
|
|
|
|
}
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2007-11-22 21:19:44 +00:00
|
|
|
//
|
|
|
|
// ZONE TYPE: EXAMINE
|
|
|
|
//
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-07-22 09:00:39 +00:00
|
|
|
void Parallaction::enterCommentMode(ZonePtr z) {
|
2008-07-28 23:21:03 +00:00
|
|
|
if (!z) {
|
2008-07-22 09:00:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
_commentZone = z;
|
|
|
|
|
|
|
|
ExamineData *data = _commentZone->u.examine;
|
|
|
|
|
2007-11-22 21:51:33 +00:00
|
|
|
if (!data->_description) {
|
|
|
|
return;
|
|
|
|
}
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-07-29 03:14:35 +00:00
|
|
|
// TODO: move this balloons stuff into DialogueManager and BalloonManager
|
|
|
|
if (getGameType() == GType_Nippon) {
|
|
|
|
int id;
|
|
|
|
if (data->_filename) {
|
|
|
|
if (data->_cnv == 0) {
|
|
|
|
data->_cnv = _disk->loadStatic(data->_filename);
|
|
|
|
}
|
2008-01-06 19:29:41 +00:00
|
|
|
|
2008-07-29 03:14:35 +00:00
|
|
|
_gfx->setHalfbriteMode(true);
|
|
|
|
_balloonMan->setSingleBalloon(data->_description, 0, 90, 0, 0);
|
|
|
|
Common::Rect r;
|
|
|
|
data->_cnv->getRect(0, r);
|
|
|
|
id = _gfx->setItem(data->_cnv, 140, (_screenHeight - r.height())/2);
|
|
|
|
_gfx->setItemFrame(id, 0);
|
|
|
|
id = _gfx->setItem(_char._head, 100, 152);
|
|
|
|
_gfx->setItemFrame(id, 0);
|
|
|
|
} else {
|
|
|
|
_balloonMan->setSingleBalloon(data->_description, 140, 10, 0, 0);
|
|
|
|
id = _gfx->setItem(_char._talk, 190, 80);
|
|
|
|
_gfx->setItemFrame(id, 0);
|
2008-01-06 20:42:28 +00:00
|
|
|
}
|
2008-07-29 03:14:35 +00:00
|
|
|
} else
|
|
|
|
if (getGameType() == GType_BRA) {
|
|
|
|
_balloonMan->setSingleBalloon(data->_description, 0, 0, 1, 0);
|
|
|
|
int id = _gfx->setItem(_char._talk, 10, 80);
|
2008-01-06 19:29:41 +00:00
|
|
|
_gfx->setItemFrame(id, 0);
|
2007-11-22 21:51:33 +00:00
|
|
|
}
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-05-14 14:34:01 +00:00
|
|
|
_input->_inputMode = Input::kInputModeComment;
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
2008-07-22 09:00:39 +00:00
|
|
|
void Parallaction::exitCommentMode() {
|
|
|
|
_input->_inputMode = Input::kInputModeGame;
|
|
|
|
|
|
|
|
hideDialogueStuff();
|
|
|
|
_gfx->setHalfbriteMode(false);
|
|
|
|
|
|
|
|
_cmdExec->run(_commentZone->_commands, _commentZone);
|
|
|
|
_commentZone = nullZonePtr;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Parallaction::runCommentFrame() {
|
|
|
|
if (_input->_inputMode != Input::kInputModeComment) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_input->getLastButtonEvent() == kMouseLeftUp) {
|
|
|
|
exitCommentMode();
|
|
|
|
}
|
|
|
|
}
|
2007-08-24 20:14:51 +00:00
|
|
|
|
|
|
|
|
2008-04-17 09:32:57 +00:00
|
|
|
uint16 Parallaction::runZone(ZonePtr z) {
|
2008-01-08 20:32:29 +00:00
|
|
|
debugC(3, kDebugExec, "runZone (%s)", z->_name);
|
2007-08-24 20:14:51 +00:00
|
|
|
|
|
|
|
uint16 subtype = z->_type & 0xFFFF;
|
|
|
|
|
2007-09-16 08:43:34 +00:00
|
|
|
debugC(3, kDebugExec, "type = %x, object = %x", subtype, (z->_type & 0xFFFF0000) >> 16);
|
2007-08-24 20:14:51 +00:00
|
|
|
switch(subtype) {
|
|
|
|
|
|
|
|
case kZoneExamine:
|
2008-07-22 09:00:39 +00:00
|
|
|
enterCommentMode(z);
|
|
|
|
return 0;
|
2007-08-24 20:14:51 +00:00
|
|
|
|
|
|
|
case kZoneGet:
|
|
|
|
if (z->_flags & kFlagsFixed) break;
|
|
|
|
if (pickupItem(z) != 0) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
z->_flags |= kFlagsRemove;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kZoneDoor:
|
|
|
|
if (z->_flags & kFlagsLocked) break;
|
|
|
|
z->_flags ^= kFlagsClosed;
|
2008-01-28 12:20:53 +00:00
|
|
|
updateDoor(z);
|
2007-08-24 20:14:51 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kZoneHear:
|
|
|
|
_soundMan->playSfx(z->u.hear->_name, z->u.hear->_channel, (z->_flags & kFlagsLooping) == kFlagsLooping, 60);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kZoneSpeak:
|
2008-07-21 06:08:30 +00:00
|
|
|
enterDialogueMode(z);
|
|
|
|
return 0;
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
2007-09-16 08:43:34 +00:00
|
|
|
debugC(3, kDebugExec, "runZone completed");
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-07-11 13:06:28 +00:00
|
|
|
_cmdExec->run(z->_commands, z);
|
2007-11-18 13:22:38 +00:00
|
|
|
|
2007-08-24 20:14:51 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// ZONE TYPE: DOOR
|
|
|
|
//
|
2008-04-17 09:32:57 +00:00
|
|
|
void Parallaction::updateDoor(ZonePtr z) {
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-01-28 12:20:53 +00:00
|
|
|
if (z->u.door->gfxobj) {
|
|
|
|
uint frame = (z->_flags & kFlagsClosed ? 0 : 1);
|
|
|
|
// z->u.door->gfxobj->setFrame(frame);
|
|
|
|
z->u.door->gfxobj->frame = frame;
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// ZONE TYPE: GET
|
|
|
|
//
|
|
|
|
|
2008-04-17 09:32:57 +00:00
|
|
|
int16 Parallaction::pickupItem(ZonePtr z) {
|
2007-08-24 20:14:51 +00:00
|
|
|
int r = addInventoryItem(z->u.get->_icon);
|
2008-01-28 12:20:53 +00:00
|
|
|
if (r != -1) {
|
|
|
|
_gfx->showGfxObj(z->u.get->gfxobj, false);
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
2008-01-28 12:20:53 +00:00
|
|
|
return (r == -1);
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-04-06 05:40:02 +00:00
|
|
|
ZonePtr Parallaction::hitZone(uint32 type, uint16 x, uint16 y) {
|
2007-08-24 20:14:51 +00:00
|
|
|
// printf("hitZone(%i, %i, %i)", type, x, y);
|
|
|
|
|
|
|
|
uint16 _di = y;
|
|
|
|
uint16 _si = x;
|
|
|
|
|
2008-05-05 11:02:40 +00:00
|
|
|
for (ZoneList::iterator it = _location._zones.begin(); it != _location._zones.end(); it++) {
|
2007-08-24 20:14:51 +00:00
|
|
|
// printf("Zone name: %s", z->_name);
|
|
|
|
|
2008-04-06 05:40:02 +00:00
|
|
|
ZonePtr z = *it;
|
2007-08-24 20:14:51 +00:00
|
|
|
|
|
|
|
if (z->_flags & kFlagsRemove) continue;
|
|
|
|
|
|
|
|
Common::Rect r;
|
|
|
|
z->getRect(r);
|
|
|
|
r.right++; // adjust border because Common::Rect doesn't include bottom-right edge
|
|
|
|
r.bottom++;
|
|
|
|
|
|
|
|
r.grow(-1); // allows some tolerance for mouse click
|
|
|
|
|
|
|
|
if (!r.contains(_si, _di)) {
|
|
|
|
|
|
|
|
// out of Zone, so look for special values
|
|
|
|
if ((z->_left == -2) || (z->_left == -3)) {
|
|
|
|
|
|
|
|
// WORKAROUND: this huge condition is needed because we made TypeData a collection of structs
|
|
|
|
// instead of an union. So, merge->_obj1 and get->_icon were just aliases in the original engine,
|
|
|
|
// but we need to check it separately here. The same workaround is applied in freeZones.
|
|
|
|
if ((((z->_type & 0xFFFF) == kZoneMerge) && (((_si == z->u.merge->_obj1) && (_di == z->u.merge->_obj2)) || ((_si == z->u.merge->_obj2) && (_di == z->u.merge->_obj1)))) ||
|
|
|
|
(((z->_type & 0xFFFF) == kZoneGet) && ((_si == z->u.get->_icon) || (_di == z->u.get->_icon)))) {
|
|
|
|
|
|
|
|
// special Zone
|
|
|
|
if ((type == 0) && ((z->_type & 0xFFFF0000) == 0))
|
|
|
|
return z;
|
|
|
|
if (z->_type == type)
|
|
|
|
return z;
|
|
|
|
if ((z->_type & 0xFFFF0000) == type)
|
|
|
|
return z;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (z->_left != -1)
|
|
|
|
continue;
|
2008-04-06 05:40:02 +00:00
|
|
|
if (_si < _char._ani->_left)
|
2007-08-24 20:14:51 +00:00
|
|
|
continue;
|
2008-04-06 05:40:02 +00:00
|
|
|
if (_si > (_char._ani->_left + _char._ani->width()))
|
2007-08-24 20:14:51 +00:00
|
|
|
continue;
|
2008-04-06 05:40:02 +00:00
|
|
|
if (_di < _char._ani->_top)
|
2007-08-24 20:14:51 +00:00
|
|
|
continue;
|
2008-04-06 05:40:02 +00:00
|
|
|
if (_di > (_char._ani->_top + _char._ani->height()))
|
2007-08-24 20:14:51 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// normal Zone
|
|
|
|
if ((type == 0) && ((z->_type & 0xFFFF0000) == 0))
|
|
|
|
return z;
|
|
|
|
if (z->_type == type)
|
|
|
|
return z;
|
|
|
|
if ((z->_type & 0xFFFF0000) == type)
|
|
|
|
return z;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int16 _a, _b, _c, _d, _e, _f;
|
2008-05-05 11:02:40 +00:00
|
|
|
for (AnimationList::iterator ait = _location._animations.begin(); ait != _location._animations.end(); ait++) {
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-04-06 05:40:02 +00:00
|
|
|
AnimationPtr a = *ait;
|
2007-08-24 20:14:51 +00:00
|
|
|
|
|
|
|
_a = (a->_flags & kFlagsActive) ? 1 : 0; // _a: active Animation
|
|
|
|
_e = ((_si >= a->_left + a->width()) || (_si <= a->_left)) ? 0 : 1; // _e: horizontal range
|
|
|
|
_f = ((_di >= a->_top + a->height()) || (_di <= a->_top)) ? 0 : 1; // _f: vertical range
|
|
|
|
|
2008-01-28 00:14:17 +00:00
|
|
|
_b = ((type != 0) || (a->_type == kZoneYou)) ? 0 : 1; // _b: (no type specified) AND (Animation is not the character)
|
|
|
|
_c = (a->_type & 0xFFFF0000) ? 0 : 1; // _c: Animation is not an object
|
2007-08-24 20:14:51 +00:00
|
|
|
_d = ((a->_type & 0xFFFF0000) != type) ? 0 : 1; // _d: Animation is an object of the same type
|
|
|
|
|
|
|
|
if ((_a != 0 && _e != 0 && _f != 0) && ((_b != 0 && _c != 0) || (a->_type == type) || (_d != 0))) {
|
|
|
|
|
|
|
|
return a;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2008-04-06 05:40:02 +00:00
|
|
|
return nullZonePtr;
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-07-11 13:06:28 +00:00
|
|
|
void CommandExec_ns::init() {
|
|
|
|
Common::Array<const Opcode*> *table = 0;
|
|
|
|
|
|
|
|
SetOpcodeTable(_opcodes);
|
|
|
|
COMMAND_OPCODE(invalid);
|
|
|
|
COMMAND_OPCODE(set);
|
|
|
|
COMMAND_OPCODE(clear);
|
|
|
|
COMMAND_OPCODE(start);
|
|
|
|
COMMAND_OPCODE(speak);
|
|
|
|
COMMAND_OPCODE(get);
|
|
|
|
COMMAND_OPCODE(location);
|
|
|
|
COMMAND_OPCODE(open);
|
|
|
|
COMMAND_OPCODE(close);
|
|
|
|
COMMAND_OPCODE(on);
|
|
|
|
COMMAND_OPCODE(off);
|
|
|
|
COMMAND_OPCODE(call);
|
|
|
|
COMMAND_OPCODE(toggle);
|
|
|
|
COMMAND_OPCODE(drop);
|
|
|
|
COMMAND_OPCODE(quit);
|
|
|
|
COMMAND_OPCODE(move);
|
|
|
|
COMMAND_OPCODE(stop);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ProgramExec_ns::init() {
|
2007-08-24 20:14:51 +00:00
|
|
|
|
2008-06-01 14:05:39 +00:00
|
|
|
Common::Array<const Opcode*> *table = 0;
|
|
|
|
|
2008-07-11 13:06:28 +00:00
|
|
|
SetOpcodeTable(_opcodes);
|
2008-06-01 14:05:39 +00:00
|
|
|
INSTRUCTION_OPCODE(invalid);
|
|
|
|
INSTRUCTION_OPCODE(on);
|
|
|
|
INSTRUCTION_OPCODE(off);
|
|
|
|
INSTRUCTION_OPCODE(set); // x
|
|
|
|
INSTRUCTION_OPCODE(set); // y
|
|
|
|
INSTRUCTION_OPCODE(set); // z
|
|
|
|
INSTRUCTION_OPCODE(set); // f
|
|
|
|
INSTRUCTION_OPCODE(loop);
|
|
|
|
INSTRUCTION_OPCODE(endloop);
|
|
|
|
INSTRUCTION_OPCODE(null);
|
|
|
|
INSTRUCTION_OPCODE(inc);
|
|
|
|
INSTRUCTION_OPCODE(inc); // dec
|
|
|
|
INSTRUCTION_OPCODE(set);
|
|
|
|
INSTRUCTION_OPCODE(put);
|
|
|
|
INSTRUCTION_OPCODE(call);
|
|
|
|
INSTRUCTION_OPCODE(wait);
|
|
|
|
INSTRUCTION_OPCODE(start);
|
|
|
|
INSTRUCTION_OPCODE(sound);
|
|
|
|
INSTRUCTION_OPCODE(move);
|
|
|
|
INSTRUCTION_OPCODE(endscript);
|
|
|
|
|
2007-08-24 20:14:51 +00:00
|
|
|
}
|
|
|
|
|
2008-07-11 13:06:28 +00:00
|
|
|
ProgramExec_ns::ProgramExec_ns(Parallaction_ns *vm) : _vm(vm) {
|
2008-07-28 08:25:06 +00:00
|
|
|
_instructionNames = _instructionNamesRes_ns;
|
2008-07-11 13:36:22 +00:00
|
|
|
}
|
2008-07-11 13:06:28 +00:00
|
|
|
|
|
|
|
ProgramExec_ns::~ProgramExec_ns() {
|
|
|
|
}
|
2007-08-24 20:14:51 +00:00
|
|
|
|
|
|
|
} // namespace Parallaction
|