ScummVM API documentation
scumm_v2.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_V2_H
23#define SCUMM_SCRIPT_V2_H
24
25#include "scumm/scumm_v3.h"
26
27namespace Scumm {
28
33protected:
35 Common::Rect rect;
36 byte color;
37 byte hicolor;
38 };
39
40 V2MouseoverBox _mouseOverBoxesV2[7];
41 int8 _mouseOverBoxV2;
42
43 Common::String _sentenceBuf;
44 uint16 _inventoryOffset;
45
46public:
47 ScummEngine_v2(OSystem *syst, const DetectorResult &dr);
48
49 void resetScumm() override;
50
51 void checkV2MouseOver(Common::Point pos);
52 int checkV2Inventory(int x, int y);
53 void redrawV2Inventory();
54
55protected:
56 byte _hiLiteColorVerbArrow = 0x0E;
57 byte _hiLiteColorInvSentence = 0x0E;
58
59protected:
60 void setupOpcodes() override;
61
62 void setupScummVars() override;
63 void resetScummVars() override;
64 void decodeParseString() override;
65
66 void saveLoadWithSerializer(Common::Serializer &s) override;
67 int checkSoundEngineSaveDataSize(Serializer &s) override;
68 void terminateSaveMenuScript() override;
69
70 void processKeyboard(Common::KeyState lastKeyHit) override;
71
72 void readIndexFile() override;
73 void readClassicIndexFile(); // V1
74 void readEnhancedIndexFile(); // V2
75 void readGlobalObjects() override;
76 void loadCharset(int no) override;
77
78 void runInputScript(int clickArea, int val, int mode) override;
79 void runInventoryScript(int) override;
80 void runInventoryScriptEx(int) override;
81
82 int getVar() override;
83
84 void getResultPosIndirect();
85 void getResultPos() override;
86
87 int readVar(uint var) override;
88 void writeVar(uint var, int value) override;
89
90protected:
91 virtual int getActiveObject();
92 void ifStateZeroCommon(byte type);
93 void ifStateNotZeroCommon(byte type);
94 void setStateCommon(byte type);
95 void clearStateCommon(byte type);
96 void stopScriptCommon(int script);
97
98 void drawSentence() override;
99 void resetSentence() override;
100 void setUserState(byte state);
101
102 void beginCutscene(int *args) override { o2_cutscene(); }
103 void endCutscene() override { o2_endCutscene(); }
104
105 void handleMouseOver(bool updateInventory) override;
106 void checkExecVerbs() override;
107 void initV2MouseOver();
108 void initNESMouseOver();
109
110 void setBuiltinCursor(int index) override;
111 void setSnailCursor() override;
112 void adaptCursorToVideoMode();
113
114 void drawPreposition(int index);
115
116 void walkActorToObject(int actor, int obj);
117
118 /* Version 2 script opcodes */
119 void o2_actorFromPos();
120 void o2_actorOps();
121 void o2_add();
122 void o2_addIndirect();
123 void o2_assignVarByte();
124 void o2_assignVarWordIndirect();
125 void o2_beginOverride();
126 void o2_chainScript();
127 void o2_setStateUnpickupable();
128 void o2_setStateTouchable();
129 void o2_setStateUnlocked();
130 void o2_setStateIntrinsicOff();
131 void o2_cursorCommand();
132 void o2_cutscene();
133 void o2_delay();
134 void o2_doSentence();
135 void o2_drawObject();
136 void o2_drawSentence();
137 void o2_dummy();
138 void o2_endCutscene();
139 void o2_findObject();
140 void o2_getActorWalkBox();
141 void o2_getActorX();
142 void o2_getActorY();
143 void o2_getBitVar();
144 void o2_getObjPreposition();
145 void o2_ifClassOfIs();
146 void o2_ifStatePickupable();
147 void o2_ifStateUntouchable();
148 void o2_ifStateLocked();
149 void o2_ifStateIntrinsicOn();
150 void o2_ifStateUnpickupable();
151 void o2_ifStateTouchable();
152 void o2_ifStateUnlocked();
153 void o2_ifStateIntrinsicOff();
154 void o2_isGreater();
155 void o2_isGreaterEqual();
156 void o2_isLess();
157 void o2_isLessEqual();
158 void o2_lights();
159 void o2_loadRoomWithEgo();
160 void o2_panCameraTo();
161 void o2_pickupObject();
162 void o2_putActor();
163 void o2_putActorAtObject();
164 void o2_putActorInRoom();
165 void o2_resourceRoutines();
166 void o2_restart();
167 void o2_roomOps();
168 void o2_getActorElevation();
169 void o2_setActorElevation();
170 void o2_setBitVar();
171 void o2_setCameraAt();
172 void o2_setObjPreposition();
173 void o2_setOwnerOf();
174 void o2_setStatePickupable();
175 void o2_setStateUntouchable();
176 void o2_setStateLocked();
177 void o2_setStateIntrinsicOn();
178 void o2_startScript();
179 void o2_stopScript();
180 void o2_subtract();
181 void o2_subIndirect();
182 void o2_switchCostumeSet();
183 void o2_verbOps();
184 void o2_waitForActor();
185 void o2_waitForMessage();
186 void o2_waitForSentence();
187 void o2_walkActorTo();
188 void o2_walkActorToObject();
189
190 byte VAR_SENTENCE_VERB;
191 byte VAR_SENTENCE_OBJECT1;
192 byte VAR_SENTENCE_OBJECT2;
193 byte VAR_SENTENCE_PREPOSITION;
194 byte VAR_BACKUP_VERB;
195
196 byte VAR_CLICK_AREA;
197 byte VAR_CLICK_VERB;
198 byte VAR_CLICK_OBJECT;
199};
200
201
202} // End of namespace Scumm
203
204#endif
Definition: serializer.h:80
Definition: str.h:59
Definition: system.h:166
Definition: scumm_v2.h:32
Definition: scumm_v3.h:58
Definition: serializer.h:33
Definition: actor.h:30
Definition: keyboard.h:294
Definition: rect.h:144
Definition: rect.h:536
Definition: detection.h:144
Definition: scumm_v2.h:34