2014-08-05 23:23:49 -04: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 16:31:23 -04:00
|
|
|
#include "common/memstream.h"
|
2014-08-05 23:23:49 -04:00
|
|
|
|
|
|
|
namespace Access {
|
|
|
|
|
|
|
|
class AccessEngine;
|
2014-08-07 22:53:02 -04:00
|
|
|
class Scripts;
|
|
|
|
|
2014-08-09 16:31:23 -04:00
|
|
|
typedef void(Scripts::*ScriptMethodPtr)();
|
2014-08-05 23:23:49 -04:00
|
|
|
|
|
|
|
class Scripts {
|
2014-08-09 16:31:23 -04:00
|
|
|
private:
|
|
|
|
const byte *_rawData;
|
|
|
|
Common::MemoryReadStream *_data;
|
2014-08-13 22:23:08 -04:00
|
|
|
int _specialFunction;
|
2014-08-17 22:32:26 -04:00
|
|
|
|
|
|
|
void printString(const Common::String &msg);
|
2014-08-05 23:23:49 -04:00
|
|
|
protected:
|
|
|
|
AccessEngine *_vm;
|
2014-08-08 09:19:38 -04:00
|
|
|
|
2014-08-13 22:23:08 -04:00
|
|
|
virtual void executeSpecial(int commandIndex, int param1, int param2) = 0;
|
2014-08-09 16:31:23 -04:00
|
|
|
virtual void executeCommand(int commandIndex);
|
|
|
|
void CMDOBJECT();
|
2014-08-17 22:32:26 -04:00
|
|
|
void cmdEndObject();
|
2014-08-09 16:31:23 -04:00
|
|
|
void cmdJumpLook();
|
|
|
|
void cmdJumpHelp();
|
|
|
|
void cmdJumpGet();
|
|
|
|
void cmdJumpMove();
|
|
|
|
void cmdJumpUse();
|
|
|
|
void cmdJumpTalk();
|
|
|
|
void cmdNull();
|
2014-08-16 20:26:17 -04:00
|
|
|
void cmdPrint();
|
2014-08-09 16:31:23 -04:00
|
|
|
void cmdRetPos();
|
2014-08-10 22:25:30 -04:00
|
|
|
void cmdAnim();
|
2014-08-09 16:31:23 -04:00
|
|
|
void cmdSetFlag();
|
2014-08-09 19:18:10 -04:00
|
|
|
void cmdCheckFlag();
|
2014-08-08 09:30:16 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Jump to another script
|
|
|
|
*/
|
2014-08-09 16:31:23 -04:00
|
|
|
void cmdGoto();
|
2014-08-08 09:30:16 -04:00
|
|
|
|
2014-08-09 17:57:34 -04:00
|
|
|
void cmdSetInventory();
|
|
|
|
void cmdCheckInventory();
|
2014-08-17 22:42:28 +02:00
|
|
|
void cmdSetTex();
|
2014-08-09 16:31:23 -04:00
|
|
|
void CMDNEWROOM();
|
|
|
|
void CMDCONVERSE();
|
2014-08-11 23:03:49 +02:00
|
|
|
void cmdCheckFrame();
|
2014-08-10 01:44:24 +02:00
|
|
|
void cmdCheckAnim();
|
2014-08-11 23:57:06 +02:00
|
|
|
void cmdSnd();
|
2014-08-10 17:49:44 +02:00
|
|
|
void cmdRetNeg();
|
2014-08-09 16:31:23 -04:00
|
|
|
void cmdCheckLoc();
|
|
|
|
void cmdSetAnim();
|
2014-08-17 11:16:31 +02:00
|
|
|
void cmdDispInv();
|
2014-08-09 16:31:23 -04:00
|
|
|
void CMDSETTIMER();
|
|
|
|
void CMDCHECKTIMER();
|
2014-08-11 00:52:03 +02:00
|
|
|
void cmdSetTravel();
|
2014-08-09 16:31:23 -04:00
|
|
|
void CMDSETVID();
|
|
|
|
void CMDPLAYVID();
|
2014-08-10 17:49:44 +02:00
|
|
|
void cmdPlotImage();
|
|
|
|
void cmdSetDisplay();
|
2014-08-11 23:43:27 +02:00
|
|
|
void cmdSetBuffer();
|
2014-08-11 00:52:03 +02:00
|
|
|
void cmdSetScroll();
|
2014-08-09 16:31:23 -04:00
|
|
|
void CMDSAVERECT();
|
|
|
|
void CMDSETBUFVID();
|
|
|
|
void CMDPLAYBUFVID();
|
2014-08-11 23:43:27 +02:00
|
|
|
void cmdRemoveLast();
|
2014-08-17 22:42:28 +02:00
|
|
|
void cmdSpecial();
|
2014-08-09 16:31:23 -04:00
|
|
|
void CMDSETCYCLE();
|
|
|
|
void CMDCYCLE();
|
2014-08-17 21:49:07 +02:00
|
|
|
void cmdCharSpeak();
|
|
|
|
void cmdTexSpeak();
|
2014-08-09 16:31:23 -04:00
|
|
|
void CMDTEXCHOICE();
|
|
|
|
void CMDWAIT();
|
2014-08-17 21:49:07 +02:00
|
|
|
void cmdSetConPos();
|
2014-08-09 16:31:23 -04:00
|
|
|
void CMDCHECKVFRAME();
|
2014-08-11 23:43:27 +02:00
|
|
|
void cmdJumpChoice();
|
|
|
|
void cmdReturnChoice();
|
2014-08-17 11:16:31 +02:00
|
|
|
void cmdClearBlock();
|
2014-08-09 16:31:23 -04:00
|
|
|
void CMDLOADSOUND();
|
|
|
|
void CMDFREESOUND();
|
|
|
|
void CMDSETVIDSND();
|
|
|
|
void CMDPLAYVIDSND();
|
|
|
|
void CMDPUSHLOCATION();
|
|
|
|
void cmdPlayerOff();
|
|
|
|
void cmdPlayerOn();
|
|
|
|
void CMDDEAD();
|
2014-08-10 01:44:24 +02:00
|
|
|
void cmdFadeOut();
|
2014-08-09 16:31:23 -04:00
|
|
|
void CMDENDVID();
|
|
|
|
void CMDHELP();
|
|
|
|
void CMDCYCLEBACK();
|
|
|
|
void CMDCHAPTER();
|
2014-08-17 11:16:31 +02:00
|
|
|
void cmdSetHelp();
|
|
|
|
void cmdCenterPanel();
|
2014-08-09 16:31:23 -04:00
|
|
|
void cmdMainPanel();
|
|
|
|
void CMDRETFLASH();
|
2014-08-05 23:23:49 -04:00
|
|
|
public:
|
|
|
|
int _sequence;
|
2014-08-07 22:53:02 -04:00
|
|
|
bool _endFlag;
|
|
|
|
int _returnCode;
|
|
|
|
int _scriptCommand;
|
2014-08-11 23:43:27 +02:00
|
|
|
int _choice;
|
|
|
|
int32 _choiceStart;
|
2014-08-17 21:49:07 +02:00
|
|
|
Common::Point _charsOrg, _texsOrg;
|
2014-08-05 23:23:49 -04:00
|
|
|
public:
|
|
|
|
Scripts(AccessEngine *vm);
|
|
|
|
|
2014-08-06 08:28:20 -04:00
|
|
|
virtual ~Scripts();
|
|
|
|
|
2014-08-09 16:31:23 -04:00
|
|
|
void setScript(const byte *data, int size);
|
|
|
|
|
2014-08-06 08:28:20 -04:00
|
|
|
void freeScriptData();
|
2014-08-07 22:53:02 -04:00
|
|
|
|
2014-08-09 16:31:23 -04:00
|
|
|
void searchForSequence();
|
2014-08-07 22:53:02 -04:00
|
|
|
|
2014-08-08 09:19:38 -04:00
|
|
|
int executeScript();
|
2014-08-17 21:49:07 +02:00
|
|
|
|
|
|
|
void findNull();
|
2014-08-05 23:23:49 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Access
|
|
|
|
|
|
|
|
#endif /* ACCESS_SCRIPTS_H */
|