2014-08-06 03:23:49 +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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ACCESS_SCRIPTS_H
|
|
|
|
#define ACCESS_SCRIPTS_H
|
|
|
|
|
|
|
|
#include "common/scummsys.h"
|
2014-08-09 20:31:23 +00:00
|
|
|
#include "common/memstream.h"
|
2014-08-06 03:23:49 +00:00
|
|
|
|
|
|
|
namespace Access {
|
|
|
|
|
|
|
|
class AccessEngine;
|
2014-08-08 02:53:02 +00:00
|
|
|
class Scripts;
|
|
|
|
|
2014-08-09 20:31:23 +00:00
|
|
|
typedef void(Scripts::*ScriptMethodPtr)();
|
2014-08-06 03:23:49 +00:00
|
|
|
|
|
|
|
class Scripts {
|
2014-08-09 20:31:23 +00:00
|
|
|
private:
|
|
|
|
const byte *_rawData;
|
|
|
|
Common::MemoryReadStream *_data;
|
2014-08-06 03:23:49 +00:00
|
|
|
protected:
|
|
|
|
AccessEngine *_vm;
|
2014-08-08 13:19:38 +00:00
|
|
|
|
2014-08-09 20:31:23 +00:00
|
|
|
virtual void executeCommand(int commandIndex);
|
|
|
|
void CMDOBJECT();
|
|
|
|
void CMDENDOBJECT();
|
|
|
|
void cmdJumpLook();
|
|
|
|
void cmdJumpHelp();
|
|
|
|
void cmdJumpGet();
|
|
|
|
void cmdJumpMove();
|
|
|
|
void cmdJumpUse();
|
|
|
|
void cmdJumpTalk();
|
|
|
|
void cmdNull();
|
|
|
|
void CMDPRINT();
|
|
|
|
void cmdRetPos();
|
2014-08-11 02:25:30 +00:00
|
|
|
void cmdAnim();
|
2014-08-09 20:31:23 +00:00
|
|
|
void cmdSetFlag();
|
2014-08-09 23:18:10 +00:00
|
|
|
void cmdCheckFlag();
|
2014-08-08 13:30:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Jump to another script
|
|
|
|
*/
|
2014-08-09 20:31:23 +00:00
|
|
|
void cmdGoto();
|
2014-08-08 13:30:16 +00:00
|
|
|
|
2014-08-09 21:57:34 +00:00
|
|
|
void cmdSetInventory();
|
|
|
|
void cmdCheckInventory();
|
2014-08-09 20:31:23 +00:00
|
|
|
void CMDSETTEX();
|
|
|
|
void CMDNEWROOM();
|
|
|
|
void CMDCONVERSE();
|
2014-08-11 21:03:49 +00:00
|
|
|
void cmdCheckFrame();
|
2014-08-09 23:44:24 +00:00
|
|
|
void cmdCheckAnim();
|
2014-08-09 20:31:23 +00:00
|
|
|
void CMDSND();
|
2014-08-10 15:49:44 +00:00
|
|
|
void cmdRetNeg();
|
2014-08-09 20:31:23 +00:00
|
|
|
void cmdCheckLoc();
|
|
|
|
void cmdSetAnim();
|
|
|
|
void CMDDISPINV();
|
|
|
|
void CMDSETTIMER();
|
|
|
|
void CMDCHECKTIMER();
|
2014-08-10 22:52:03 +00:00
|
|
|
void cmdSetTravel();
|
2014-08-09 20:31:23 +00:00
|
|
|
void CMDSETVID();
|
|
|
|
void CMDPLAYVID();
|
2014-08-10 15:49:44 +00:00
|
|
|
void cmdPlotImage();
|
|
|
|
void cmdSetDisplay();
|
2014-08-11 21:43:27 +00:00
|
|
|
void cmdSetBuffer();
|
2014-08-10 22:52:03 +00:00
|
|
|
void cmdSetScroll();
|
2014-08-09 20:31:23 +00:00
|
|
|
void CMDSAVERECT();
|
|
|
|
void CMDSETBUFVID();
|
|
|
|
void CMDPLAYBUFVID();
|
2014-08-11 21:43:27 +00:00
|
|
|
void cmdRemoveLast();
|
2014-08-09 20:31:23 +00:00
|
|
|
void CMDSPECIAL();
|
|
|
|
void CMDSETCYCLE();
|
|
|
|
void CMDCYCLE();
|
|
|
|
void CMDCHARSPEAK();
|
|
|
|
void CMDTEXSPEAK();
|
|
|
|
void CMDTEXCHOICE();
|
|
|
|
void CMDWAIT();
|
|
|
|
void CMDSETCONPOS();
|
|
|
|
void CMDCHECKVFRAME();
|
2014-08-11 21:43:27 +00:00
|
|
|
void cmdJumpChoice();
|
|
|
|
void cmdReturnChoice();
|
2014-08-09 20:31:23 +00:00
|
|
|
void CMDCLEARBLOCK();
|
|
|
|
void CMDLOADSOUND();
|
|
|
|
void CMDFREESOUND();
|
|
|
|
void CMDSETVIDSND();
|
|
|
|
void CMDPLAYVIDSND();
|
|
|
|
void CMDPUSHLOCATION();
|
|
|
|
void cmdPlayerOff();
|
|
|
|
void cmdPlayerOn();
|
|
|
|
void CMDDEAD();
|
2014-08-09 23:44:24 +00:00
|
|
|
void cmdFadeOut();
|
2014-08-09 20:31:23 +00:00
|
|
|
void CMDENDVID();
|
|
|
|
void CMDHELP();
|
|
|
|
void CMDCYCLEBACK();
|
|
|
|
void CMDCHAPTER();
|
|
|
|
void CMDSETHELP();
|
|
|
|
void CMDCENTERPANEL();
|
|
|
|
void cmdMainPanel();
|
|
|
|
void CMDRETFLASH();
|
2014-08-06 03:23:49 +00:00
|
|
|
public:
|
|
|
|
int _sequence;
|
2014-08-08 02:53:02 +00:00
|
|
|
bool _endFlag;
|
|
|
|
int _returnCode;
|
|
|
|
int _scriptCommand;
|
2014-08-11 21:43:27 +00:00
|
|
|
int _choice;
|
|
|
|
int32 _choiceStart;
|
2014-08-06 03:23:49 +00:00
|
|
|
public:
|
|
|
|
Scripts(AccessEngine *vm);
|
|
|
|
|
2014-08-06 12:28:20 +00:00
|
|
|
virtual ~Scripts();
|
|
|
|
|
2014-08-09 20:31:23 +00:00
|
|
|
void setScript(const byte *data, int size);
|
|
|
|
|
2014-08-06 12:28:20 +00:00
|
|
|
void freeScriptData();
|
2014-08-08 02:53:02 +00:00
|
|
|
|
2014-08-09 20:31:23 +00:00
|
|
|
void searchForSequence();
|
2014-08-08 02:53:02 +00:00
|
|
|
|
2014-08-08 13:19:38 +00:00
|
|
|
int executeScript();
|
2014-08-06 03:23:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Access
|
|
|
|
|
|
|
|
#endif /* ACCESS_SCRIPTS_H */
|