ScummVM API documentation
eob.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#ifdef ENABLE_EOB
23
24#ifndef KYRA_EOB1_H
25#define KYRA_EOB1_H
26
27#include "kyra/engine/eobcommon.h"
28
29namespace Kyra {
30
31class SegaCDResource;
32class SegaSequencePlayer;
33class EoBEngine : public EoBCoreEngine {
34friend class GUI_EoB;
35friend class GUI_EoB_SegaCD;
36friend class EoBSeqPlayerCommon;
37friend class EoBIntroPlayer;
38friend class EoBPC98FinalePlayer;
39friend class EoBAmigaFinalePlayer;
40friend class TextDisplayer_SegaCD;
41friend class SegaSequencePlayer;
42public:
43 EoBEngine(OSystem *system, const GameFlags &flags);
44 ~EoBEngine() override;
45
46private:
47 // Init
48 Common::Error init() override;
49 void initStaticResource();
50 void initSpells() override;
51 void loadItemsAndDecorationsShapes() override;
52 Common::SeekableReadStreamEndian *getItemDefinitionFile(int index) override;
53
54 // Main Menu
55 int mainMenu() override;
56 int mainMenuLoop();
57 int _menuChoiceInit;
58
59 struct RenderModePalFile {
60 int renderMode;
61 char filename[12];
62 };
63
64 struct TitleScreenConfig {
65 const Common::Platform platform;
66 const Common::Language lang;
67 const char bmpFile[12];
68 const RenderModePalFile *palFiles;
69 const int pc98PaletteID;
70 const int page;
71 const bool fade;
72 const int menu1X, menu1Y, menu1W, menu1H, menu1col1, menu1col2, menu1col3;
73 const int menu2X, menu2Y, menu2W, menu2H, menu2col1, menu2col2, menu2col3;
74 const int versionStrYOffs;
75 };
76
77 static const RenderModePalFile _renderModePalFiles[3];
78 static const TitleScreenConfig _titleConfig[5];
79 const TitleScreenConfig *_ttlCfg;
80
81 // Main loop
82 void startupNew() override;
83 void startupLoad() override;
84 void startupReset() override;
85
86 // Intro/Outro/Sequence Playback
87 enum IntroPart {
88 kOnlyCredits = 0,
89 kOnlyIntro,
90 kCreditsAndIntro
91 };
92
93 void seq_playIntro(int part);
94 void seq_playFinale() override;
95 void seq_xdeath() override;
96
97 void seq_segaOpeningCredits(bool jumpToTitle);
98 void seq_segaFinalCredits();
99 void seq_segaShowStats();
100
101 void seq_segaSetupSequence(int sequenceId);
102 void seq_segaRestoreAfterSequence();
103 bool seq_segaPlaySequence(int sequenceId, bool setupScreen = false);
104 void seq_segaPausePlayer(bool pause) override;
105
106 const char *const *_finBonusStrings;
107 SegaSequencePlayer *_seqPlayer;
108 bool _xdth;
109
110 // characters
111 void drawNpcScene(int npcIndex) override;
112 void encodeDrawNpcSeqShape(int npcIndex, int drawX, int drawY);
113 void runNpcDialogue(int npcIndex) override;
114
115 const uint8 *_npcShpData;
116 const uint8 *_npcSubShpIndex1;
117 const uint8 *_npcSubShpIndex2;
118 const uint8 *_npcSubShpY;
119 const char *const *_npcStrings[11];
120
121 // items
122 void updateUsedCharacterHandItem(int charIndex, int slot) override;
123
124 // Monsters
125 void loadMonsterShapes(const char *filename, int monsterIndex, bool hasDecorations, int encodeTableIndex) override;
126 void replaceMonster(int unit, uint16 block, int d, int dir, int type, int shpIndex, int mode, int h2, int randItem, int fixedItem) override;
127 bool killMonsterExtra(EoBMonsterInPlay *m) override;
128 void updateScriptTimersExtra() override;
129
130 // Level
131 void readLevelFileData(int level) override;
132 void loadVcnData(const char *file, const uint8 *cgaMapping) override;
133 Common::SeekableReadStreamEndian *getVmpData(const char *file) override;
134 const uint8 *getBlockFileData(int level) override;
135 Common::SeekableReadStreamEndian *getDecDefinitions(const char *decFile) override;
136 void loadDecShapesToPage3(const char *shpFile) override;
137 const uint8 *loadDoorShapes(const char *filename, int doorIndex, const uint8 *shapeDefs) override { return 0; }
138 void loadDoorShapes(int doorType1, int shapeId1, int doorType2, int shapeId2) override;
139 void drawDoorIntern(int type, int index, int x, int y, int w, int wall, int mDim, int16 y1, int16 y2) override;
140 void setLevelPalettes(int level) override;
141
142 const int16 *_dscDoorCoordsExt;
143 const uint8 *_dscDoorScaleMult4;
144 const uint8 *_dscDoorScaleMult5;
145 const uint8 *_dscDoorScaleMult6;
146 const uint8 *_dscDoorY3;
147 const uint8 *_dscDoorY4;
148 const uint8 *_dscDoorY5;
149 const uint8 *_dscDoorY6;
150 const uint8 *_dscDoorY7;
151
152 const uint8 *_doorShapeEncodeDefs;
153 const uint8 *_doorSwitchShapeEncodeDefs;
154 const uint8 *_doorSwitchCoords;
155
156 const uint8 *const *_doorShapesSrc;
157 const uint8 *const *_doorSwitchShapesSrc;
158
159 int _dcrResCur;
160
161 // Fight
162 void playStrikeAnimation(uint8 pos, Item itm) override;
163
164 const uint8 *_redGrid;
165 const uint8 **_strikeAnimShapes[7];
166 static const uint8 _monsterAcHitChanceTbl1[];
167 static const uint8 _monsterAcHitChanceTbl2[];
168
169 // Magic
170 void turnUndeadAuto() override;
171 void turnUndeadAutoHit() override;
172
173 const char *const *_turnUndeadString;
174 const uint8 *_scrYellow;
175
176 // Sound
177 void snd_loadAmigaSounds(int level, int) override;
178 void snd_playLevelScore() override;
179 void snd_updateLevelScore() override;
180
181 int _levelCurTrack;
182
183 // Misc
184 void displayParchment(int id) override;
185 const uint8 **makePortalShapes() override;
186 bool checkPartyStatusExtra() override;
187 int resurrectionSelectDialogue() override;
188 void healParty();
189
190 int _sceneShakeOffsetX;
191 int _sceneShakeOffsetY;
192 uint8 *_shakeBackBuffer1;
193 uint8 *_shakeBackBuffer2;
194
195 // Resource
196 SegaCDResource *_sres;
197
198 // GUI
199 int clickedCamp(Button *button) override;
200
201 void gui_drawPlayField(bool refresh, bool screenUpdt = true) override;
202 void gui_setupPlayFieldHelperPages(bool keepText = false) override;
203 void gui_drawWeaponSlotStatus(int x, int y, int status) override;
204 void gui_printInventoryDigits(int x, int y, int val) override;
205 void gui_drawCharacterStatsPage() override;
206 void gui_displayMap() override;
207 void gui_drawSpellbook() override;
208 void gui_updateAnimations() override;
209 void gui_resetAnimations();
210
211 void makeNameShapes(int charId = -1) override;
212 void makeFaceShapes(int charId = -1) override;
213 void printStatsString(const char *str, int x, int y);
214 void printSpellbookString(uint16 *dst, const char *str, uint16 ntbl);
215 void drawMapButton(const char *str, int x, int y);
216 void drawMapPage(int level);
217 void drawMapSpots(int level, int animState);
218 void drawDialogueButtons() override;
219
220 const KyraRpgGUISettings *guiSettings() const override;
221 void useMainMenuGUISettings(bool toggle) override { _useMainMenuGUISettings = toggle; }
222
223 int _compassDirection2;
224 int _compassAnimDest;
225 int _compassAnimPhase;
226 int _compassAnimStep;
227 int _compassAnimDelayCounter;
228 bool _compassAnimSwitch;
229 bool _compassAnimDone;
230 bool _compassTilesRestore;
231 uint8 *_compassData;
232
233 const char *const *_mapStrings1;
234 const char *const *_mapStrings2;
235 const char *const *_mapStrings3;
236 const uint8 **_invSmallDigits;
237 const uint8 **_weaponSlotShapes;
238 const uint16 *_addrTbl1;
239 const uint16 *_textFieldPattern;
240 const uint16 *_playFldPattern1;
241 const uint16 *_invPattern;
242 const uint16 *_statsPattern;
243 const uint8 *_charTilesTable;
244 uint16 *_playFldPattern2;
245 uint16 *_tempPattern;
246
247 static const KyraRpgGUISettings _guiSettingsVGA;
248 static const KyraRpgGUISettings _guiSettingsEGA;
249 static const KyraRpgGUISettings _guiSettingsPC98;
250 static const KyraRpgGUISettings _guiSettingsAmiga;
251 static const KyraRpgGUISettings _guiSettingsAmigaMainMenu;
252 static const KyraRpgGUISettings _guiSettingsSegaCD;
253 static const uint8 _egaDefaultPalette[];
254 static const uint8 _redGridTile[8];
255 static const int8 _sceneShakeOffsets[66];
256 static const uint16 _dlgButtonPosX_Sega[18];
257 static const uint8 _dlgButtonPosY_Sega[18];
258 bool _useMainMenuGUISettings;
259};
260
261} // End of namespace Kyra
262
263#endif
264
265#endif // ENABLE_EOB
Definition: input.h:69
Definition: error.h:81
Definition: stream.h:944
Definition: system.h:166
Language
Definition: language.h:45
Platform
Definition: platform.h:93
Definition: detection.h:27