ScummVM API documentation
scumm_v5.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 SCUMM_SCRIPT_V5_H
23 #define SCUMM_SCRIPT_V5_H
24 
25 #include "scumm/scumm.h"
26 
27 namespace Scumm {
28 
29 class ScummEngine_v5 : public ScummEngine {
30 protected:
31  uint16 _cursorImages[4][17];
32  byte _cursorHotspots[2 * 4];
33 
34  struct {
35  int x, y, w, h;
36  byte *buffer;
37  uint16 xStrips, yStrips;
38  bool eraseFlag;
39  } _flashlight;
40 
41  char _saveLoadVarsFilename[256];
42 
43  enum {
44  PARAM_1 = 0x80,
45  PARAM_2 = 0x40,
46  PARAM_3 = 0x20
47  };
48 
49  int _resultVarNumber;
50 
51 public:
52  ScummEngine_v5(OSystem *syst, const DetectorResult &dr);
53 
54  void clearFlashlight();
55 
56  void resetCursors() override;
57 
58 protected:
59  void setupOpcodes() override;
60 
61  void scummLoop_handleActors() override;
62  void scummLoop_handleSaveLoad() override;
63 
64  void setupScummVars() override;
65  void resetScummVars() override;
66  virtual void decodeParseString();
67  void decodeParseStringTextString(int textSlot);
68  void printPatchedMI1CannibalString(int textSlot, const byte *ptr);
69 
70  void saveLoadWithSerializer(Common::Serializer &s) override;
71 
72  void readMAXS(int blockSize) override;
73 
74  int getWordVararg(int *ptr);
75 
76  virtual int getVar();
77  virtual int getVarOrDirectByte(byte mask);
78  virtual int getVarOrDirectWord(byte mask);
79 
80  virtual void getResultPos();
81  void setResult(int result);
82 
83  void animateCursor() override;
84 
85  void setBuiltinCursor(int index) override;
86  void redefineBuiltinCursorFromChar(int index, int chr);
87  void redefineBuiltinCursorHotspot(int index, int x, int y);
88 
89  void drawFlashlight();
90 
91  void walkActorToActor(int actor, int toActor, int dist);
92 
97  void jumpRelative(bool cond);
98 
99  /* Version 5 script opcodes */
100  void o5_actorFollowCamera();
101  void o5_actorFromPos();
102  void o5_actorOps();
103  void o5_add();
104  void o5_and();
105  void o5_animateActor();
106  void o5_breakHere();
107  void o5_chainScript();
108  void o5_cursorCommand();
109  void o5_cutscene();
110  void o5_debug();
111  void o5_decrement();
112  void o5_delay();
113  void o5_delayVariable();
114  void o5_divide();
115  void o5_doSentence();
116  void o5_drawBox();
117  void o5_drawObject();
118  void o5_dummy();
119  void o5_endCutscene();
120  void o5_equalZero();
121  void o5_expression();
122  void o5_faceActor();
123  void o5_findInventory();
124  void o5_findObject();
125  void o5_freezeScripts();
126  void o5_getActorCostume();
127  void o5_getActorElevation();
128  void o5_getActorFacing();
129  void o5_getActorMoving();
130  void o5_getActorRoom();
131  void o5_getActorScale();
132  void o5_getActorWalkBox();
133  void o5_getActorWidth();
134  void o5_getActorX();
135  void o5_getActorY();
136  void o5_getAnimCounter();
137  void o5_getClosestObjActor();
138  void o5_getDist();
139  void o5_getInventoryCount();
140  void o5_getObjectOwner();
141  void o5_getObjectState();
142  void o5_getRandomNr();
143  void o5_getStringWidth();
144  void o5_getVerbEntrypoint();
145  void o5_ifClassOfIs();
146  void o5_increment();
147  void o5_isActorInBox();
148  void o5_isEqual();
149  void o5_isGreater();
150  void o5_isGreaterEqual();
151  void o5_isLess();
152  void o5_isLessEqual();
153  void o5_isNotEqual();
154  void o5_isScriptRunning();
155  void o5_isSoundRunning();
156  void o5_jumpRelative();
157  void o5_lights();
158  void o5_loadRoom();
159  void o5_loadRoomWithEgo();
160  void o5_matrixOps();
161  void o5_move();
162  void o5_multiply();
163  void o5_notEqualZero();
164  void o5_or();
165  void o5_beginOverride();
166  void o5_panCameraTo();
167  void o5_pickupObject();
168  void o5_print();
169  void o5_printEgo();
170  void o5_pseudoRoom();
171  void o5_putActor();
172  void o5_putActorAtObject();
173  void o5_putActorInRoom();
174  void o5_systemOps();
175  void o5_resourceRoutines();
176  void o5_roomOps();
177  void o5_saveRestoreVerbs();
178  void o5_setCameraAt();
179  void o5_setClass();
180  void o5_setObjectName();
181  void o5_setOwnerOf();
182  void o5_setState();
183  void o5_setVarRange();
184  void o5_soundKludge();
185  void o5_startMusic();
186  void o5_startObject();
187  void o5_startScript();
188  void o5_startSound();
189  void o5_stopMusic();
190  void o5_stopObjectCode();
191  void o5_stopObjectScript();
192  void o5_stopScript();
193  void o5_stopSound();
194  void o5_stringOps();
195  void o5_subtract();
196  void o5_verbOps();
197  void o5_wait();
198  void o5_walkActorTo();
199  void o5_walkActorToActor();
200  void o5_walkActorToObject();
201 };
202 
203 
204 } // End of namespace Scumm
205 
206 #endif
Definition: scumm_v5.h:29
Definition: serializer.h:79
Definition: scumm.h:518
void jumpRelative(bool cond)
Definition: system.h:161
Definition: actor.h:30
Definition: detection.h:131