ScummVM API documentation
scripts.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef ACCESS_SCRIPTS_H
23 #define ACCESS_SCRIPTS_H
24 
25 #include "common/scummsys.h"
26 #include "common/memstream.h"
27 #include "access/data.h"
28 
29 namespace Access {
30 
31 class AccessEngine;
32 class Scripts;
33 
34 #define SCRIPT_START_BYTE 0xE0
35 #define ROOM_SCRIPT 2000
36 
37 typedef void(Scripts::*ScriptMethodPtr)();
38 
39 class Scripts : public Manager {
40 private:
41  int _specialFunction;
42 
43  void clearWatch();
44  void printWatch();
45 
46 protected:
47  Resource *_resource;
49  ScriptMethodPtr COMMAND_LIST[100];
50 
51  virtual void executeSpecial(int commandIndex, int param1, int param2) = 0;
52  virtual void executeCommand(int commandIndex);
53 
54  void charLoop();
55 
60 
61  void cmdObject();
62  void cmdEndObject();
63  void cmdJumpLook();
64  void cmdJumpHelp();
65  void cmdJumpGet();
66  void cmdJumpMove();
67  void cmdJumpUse();
68  void cmdJumpTalk();
69  void cmdNull();
70  void cmdPrint_v1();
71  void cmdPrint_v2();
72  void cmdAnim();
73  void cmdSetFlag();
74  void cmdCheckFlag();
75 
79  void cmdGoto();
80 
81  void cmdAddScore();
82  void cmdSetInventory();
83  void cmdCheckInventory();
84  void cmdSetTex();
85  void cmdNewRoom();
86  void cmdConverse();
87  void cmdCheckFrame();
88  void cmdCheckAnim();
89  void cmdSnd();
90  void cmdRetNeg();
91  void cmdCheckLoc();
92  void cmdSetAnim();
93  void cmdDispInv_v1();
94  void cmdDispInv_v2();
95  void cmdSetAbout();
96  void cmdSetTimer();
97  void cmdCheckTimer();
98  void cmdJumpGoto();
99  void cmdSetTravel();
100  void cmdSetVideo();
101  void cmdPlayVideo();
102  void cmdPlotImage();
103  void cmdSetDisplay();
104  void cmdSetBuffer();
105  void cmdSetScroll();
106  void cmdSaveRect();
107  void cmdVideoEnded();
108  void cmdSetBufVid();
109  void cmdPlayBufVid();
110  void cmdRemoveLast();
111  void cmdDoTravel();
112  void cmdCheckAbout();
113  void cmdSpecial();
114  void cmdSetCycle();
115  void cmdCycle();
116  void cmdCharSpeak();
117  void cmdTexSpeak();
118  void cmdTexChoice();
119  void cmdWait();
120  void cmdSetConPos();
121  void cmdCheckVFrame();
122  void cmdJumpChoice();
123  void cmdReturnChoice();
124  void cmdClearBlock();
125  void cmdLoadSound();
126  void cmdSetVideoSound();
127  void cmdPlayVideoSound();
128  void cmdPrintWatch();
129  void cmdDispAbout();
130  void cmdPushLocation();
131  void cmdCheckTravel();
132  void cmdBlock();
133  void cmdPlayerOff();
134  void cmdPlayerOn();
135  void cmdDead();
136  void cmdFadeOut();
137  void cmdEndVideo();
138  void cmdHelp_v1();
139  void cmdHelp_v2();
140  void cmdCycleBack();
141  void cmdSetHelp();
142 public:
143  int _sequence;
144  bool _endFlag;
145  int _returnCode;
146  int _scriptCommand;
147  int _choice;
148  int32 _choiceStart;
149  Common::Point _charsOrg, _texsOrg;
150 
151 public:
152  Scripts(AccessEngine *vm);
153 
154  virtual ~Scripts();
155 
156  void setOpcodes();
157  void setOpcodes_v2();
158 
159  void setScript(Resource *data, bool restartFlag = false);
160 
161  void freeScriptData();
162 
163  void searchForSequence();
164 
165  int executeScript();
166 
167  void findNull();
168  void doCmdPrint_v1(Common::String msg);
169 
173  void printString(const Common::String &msg);
174 
175  // Script commands that need to be public
176  void cmdFreeSound();
177  void cmdRetPos();
178  void converse1(int val);
179 };
180 
181 } // End of namespace Access
182 
183 #endif /* ACCESS_SCRIPTS_H */
void printString(const Common::String &msg)
Definition: str.h:59
Definition: data.h:37
Definition: access.h:84
Definition: scripts.h:39
Definition: stream.h:745
Definition: files.h:54
Definition: rect.h:45
Common::String readString()
Definition: access.h:62