ScummVM API documentation
efh.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 EFH_H
23 #define EFH_H
24 
25 #include "audio/softsynth/pcspk.h"
26 #include "audio/mixer.h"
27 #include "common/file.h"
28 #include "common/rect.h"
29 #include "common/events.h"
30 #include "common/serializer.h"
31 #include "common/text-to-speech.h"
32 
33 #include "engines/advancedDetector.h"
34 #include "engines/engine.h"
35 #include "graphics/surface.h"
36 
37 #include "efh/constants.h"
38 
39 namespace Common {
40 class RandomSource;
41 }
42 
57 namespace Efh {
58 
59 static const uint8 kSavegameVersion = 1;
60 #define EFH_SAVE_HEADER MKTAG('E', 'F', 'H', 'S')
61 
62 enum EfhDebugChannels {
63  kDebugEngine = 1,
64  kDebugUtils,
65  kDebugGraphics,
66  kDebugScript,
67  kDebugFight,
68 };
69 
71 public:
73  EfhGraphicsStruct(int8 **lineBuf, int16 x, int16 y, int16 width, int16 height);
74 
75  int8 **_vgaLineBuffer;
76  uint16 _shiftValue;
77  uint16 _width;
78  uint16 _height;
79  Common::Rect _area;
80 
81  void copy(EfhGraphicsStruct *src);
82 };
83 
84 struct InvObject {
85  int16 _ref;
86  uint8 _stat1; // abbb bbbb - a: equipped b: uses left
87  uint8 _curHitPoints;
88 
89  void init();
90  bool isEquipped();
91  int8 getUsesLeft();
92 };
93 
95  uint8 _placeId;
96  uint8 _posX;
97  uint8 _posY;
98  uint8 _triggerType; // 0xFD = Check inventory 0xFE = Check Character in team 0xFF Display description <= 0x77 = check score (all values in this case in data are <= 0xF)
99  uint8 _triggerValue;
100  uint16 _field5_textId;
101  uint16 _field7_textId;
102 
103  void init();
104 };
105 
106 struct FrameList {
107  int8 _subFileId[4];
108 
109  void init();
110 };
111 struct AnimInfo {
112  uint16 _posX[10];
113  uint8 _posY[10];
114  FrameList _frameList[15];
115 
116  void init();
117 };
118 
119 struct ItemStruct {
120  char _name[15];
121  uint8 _damage;
122  uint8 _defense;
123  uint8 _attacks;
124  uint8 _uses;
125  int8 _agilityModifier; // data contains values from -8 to +8
126  uint8 _range;
127  uint8 _attackType;
128  uint8 _specialEffect;
129  uint8 _defenseType;
130  uint8 _exclusiveType;
131  uint8 _field19_mapPosX_or_maxDeltaPoints;
132  uint8 _mapPosY;
133 
134  void init();
135 };
136 
137 struct NPCStruct {
138  char _name[11];
139  uint8 fieldB_textId;
140  uint8 field_C;
141  uint8 field_D;
142  uint8 fieldE_textId;
143  uint8 field_F;
144  uint8 field_10;
145  uint8 field11_NpcId;
146  uint16 field12_textId;
147  uint16 field14_textId;
148  uint32 _xp;
149  uint8 _activeScore[15];
150  uint8 _passiveScore[11];
151  uint8 _infoScore[11];
152  uint8 field_3F;
153  uint8 field_40;
154  InvObject _inventory[10];
155  uint8 _possessivePronounSHL6;
156  uint8 _speed;
157  uint8 field_6B;
158  uint8 field_6C;
159  uint8 field_6D;
160  uint8 _defaultDefenseItemId;
161  uint8 field_6F;
162  uint8 field_70;
163  uint8 field_71;
164  uint8 field_72;
165  uint8 field_73;
166  int16 _hitPoints;
167  int16 _maxHP;
168  uint8 field_78;
169  uint16 field_79;
170  uint16 field_7B;
171  uint8 field_7D;
172  uint8 field_7E;
173  uint8 field_7F;
174  uint8 field_80;
175  uint8 field_81;
176  uint8 field_82;
177  uint8 field_83;
178  uint8 field_84;
179  uint8 field_85;
180 
181  void init();
182  uint8 getPronoun();
183  void synchronize(Common::Serializer &s);
184 };
185 
186 struct FontDescr {
187  const uint8 *_widthArray;
188  const uint8 *_extraLines;
189  const Font *_fontData;
190  uint8 _charHeight;
191  uint8 _extraVerticalSpace;
192  uint8 _extraHorizontalSpace;
193 };
194 
195 struct BufferBM {
196  uint8 *_dataPtr;
197  uint16 _width;
198  uint16 _startX;
199  uint16 _startY;
200  uint16 _height;
201  uint16 _lineDataSize;
202  uint8 _paletteTransformation;
203  uint16 _fieldD;
204 };
205 
206 struct CharStatus {
207  int16 _type;
208  int16 _duration;
209 };
210 
211 struct MapMonster {
212  uint8 _possessivePronounSHL6; // aabb bbbb aa:Possessive Pronoun, bb bbbb: unknown
213  uint8 _npcId;
214  uint8 _fullPlaceId; // unsigned? Magic values are 0xFF and 0xFE
215  uint8 _posX;
216  uint8 _posY;
217  uint8 _weaponItemId;
218  uint8 _maxDamageAbsorption;
219  uint8 _monsterRef;
220  uint8 _additionalInfo; // abbb cddd a: special move flag, bbb: Pct modifier for random move, c aggressiveness, ddd move type
221  uint8 _talkTextId;
222  uint8 _groupSize;
223  int16 _hitPoints[9];
224 
225  uint8 getPronoun();
226 };
227 
229  int16 _id;
230  int16 _initiative;
231 
232  void init();
233 };
234 
236  uint8 _status;
237  uint8 _tileId;
238 
239  void init();
240 };
241 
242 struct TeamChar {
243  int16 _id;
244  CharStatus _status;
245  int16 _pctVisible;
246  int16 _pctDodgeMiss;
247  int16 _nextAttack;
248  int16 _lastInventoryUsed;
249  int16 _lastAction;
250 
251  void init();
252 };
253 
254 struct TeamMonster {
255  int16 _id;
256  CharStatus _mobsterStatus[9];
257 
258  void init();
259 };
260 
261 enum TTSMenuRestriction {
262  kNoRestriction,
263  kLowStatusMenu,
264  kMenu
265 };
266 
267 enum EFHAction {
268  kActionNone,
269  kActionQuit,
270  kActionSkipVideo,
271  kActionSkipSong,
272  kActionSkipSongAndIntro,
273  kActionSave,
274  kActionLoad,
275  kActionMoveUp,
276  kActionMoveDown,
277  kActionMoveLeft,
278  kActionMoveRight,
279  kActionMoveUpLeft,
280  kActionMoveUpRight,
281  kActionMoveDownLeft,
282  kActionMoveDownRight,
283  kActionCharacter1Status,
284  kActionCharacter2Status,
285  kActionCharacter3Status,
286  kActionYes,
287  kActionNo,
288  kActionCharacter1,
289  kActionCharacter2,
290  kActionCharacter3,
291  kActionCancelCharacterSelection,
292  kActionStartFight,
293  kActionLeave,
294  kActionStatus,
295  kActionTalk,
296  kActionAttack,
297  kActionDefend,
298  kActionHide,
299  kActionRun,
300  kActionTeamStatus,
301  kActionTerrain,
302  kActionEnemy1,
303  kActionEnemy2,
304  kActionEnemy3,
305  kActionEnemy4,
306  kActionEnemy5,
307  kActionCancelEnemySelection,
308  kActionreset,
309  kActionExitStatusMenu,
310  kActionActive,
311  kActionDrop,
312  kActionEquip,
313  kActionGive,
314  kActionInfo,
315  kActionPassive,
316  kActionTrade,
317  kActionUse,
318  kActionSelect,
319  kActionScrollDown,
320  kActionScrollUp,
321  kActionExitSubMenu,
322  kActionOption1,
323  kActionOption2,
324  kActionOption3,
325  kActionOption4,
326  kActionOption5,
327  kActionOption6,
328  kActionOption7,
329  kActionOption8,
330  kActionOption9,
331  kActionOption10,
332  kActionOption11,
333  kActionOption12,
334  kActionOption13,
335  kActionOption14,
336  kActionSound13,
337  kActionSound14,
338  kActionSound15,
339  kActionSound5,
340  kActionSound10,
341  kActionSound9,
342  kActionSound16,
343 };
344 
346  EFHAction _action;
347  int8 _id;
348 };
349 
350 static const EfhSelectionAction _efhEnemySelectionCodes[] = {
351  { kActionEnemy1, 0 },
352  { kActionEnemy2, 1 },
353  { kActionEnemy3, 2 },
354  { kActionEnemy4, 3 },
355  { kActionEnemy5, 4 },
356 };
357 
358 static const EfhSelectionAction _efhTeamSelectionCodes[] = {
359  { kActionCharacter1, 0 },
360  { kActionCharacter2, 1 },
361  { kActionCharacter3, 2 },
362 };
363 
364 static const EfhSelectionAction _efhStatusMenuSubMenuCodes[] = {
365  { kActionOption1, 0 },
366  { kActionOption2, 1 },
367  { kActionOption3, 2 },
368  { kActionOption4, 3 },
369  { kActionOption5, 4 },
370  { kActionOption6, 5 },
371  { kActionOption7, 6 },
372  { kActionOption8, 7 },
373  { kActionOption9, 8 },
374  { kActionOption10, 9 },
375  { kActionOption11, 10 },
376  { kActionOption12, 11 },
377  { kActionOption13, 12 },
378  { kActionOption14, 13 },
379 };
380 
381 enum EfhKeymapCode {
382  kKeymapDefault,
383  kKeymapMenu,
384  kKeymapSkipVideo,
385  kKeymapSkipSong,
386  kKeymapStatusMenu,
387  kKeymapStatusMenuNavigation,
388  kKeymapStatusMenuSubMenu,
389  kKeymapInteraction,
390  kKeymapFight,
391  kKeymapCharacterSelection,
392  kKeymapEnemySelection,
393  kKeymapDeathMenu,
394 };
395 
396 struct EfhKeymap {
397  EfhKeymapCode _keymap;
398  const char *_id;
399 };
400 
401 static const EfhKeymap _efhKeymaps[] = {
402  { kKeymapDefault, "efh-default" },
403  { kKeymapMenu, "menu" },
404  { kKeymapSkipVideo, "skip-video" },
405  { kKeymapSkipSong, "skip-song" },
406  { kKeymapStatusMenu, "status-menu" },
407  { kKeymapStatusMenuNavigation, "status-menu-navigation" },
408  { kKeymapStatusMenuSubMenu, "status-menu-submenu" },
409  { kKeymapInteraction, "interaction" },
410  { kKeymapFight, "fight" },
411  { kKeymapCharacterSelection, "character-selection" },
412  { kKeymapEnemySelection, "enemy-selection" },
413  { kKeymapDeathMenu, "death-menu" },
414 };
415 
416 class EfhEngine : public Engine {
417 public:
418  EfhEngine(OSystem *syst, const ADGameDescription *gd);
419  ~EfhEngine() override;
420 
421  Graphics::Surface *_mainSurface;
422  Common::RandomSource *_rnd;
423 
424  const ADGameDescription *_gameDescription;
425 
426  // metaengine.cpp
427  void initGame(const ADGameDescription *gd);
428  uint32 getFeatures() const;
429  const char *getGameId() const;
430  Common::Platform getPlatform() const;
431  bool hasFeature(EngineFeature f) const override;
432  const char *getCopyrightString() const;
433 
434  // savegames.cpp
435  Common::String getSavegameFilename(int slot);
436  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
437  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
438  Common::Error loadGameState(int slot) override;
439  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
440 
441 protected:
442  int _lastTime;
443  // Engine APIs
444  Common::Error run() override;
445 
446 private:
447  Common::Platform _platform;
448  int _loadSaveSlot;
449  bool _saveAuthorized;
450 
451  void initialize();
452  void playIntro();
453  void initEngine();
454  void initMapMonsters();
455  void saveAnimImageSetId();
456  int16 getEquipmentDefense(int16 charId);
457  uint16 getEquippedExclusiveType(int16 charId, int16 exclusiveType, bool flag);
458  void displayLowStatusScreen(bool flag);
459  void loadImageSetToTileBank(int16 bankId, int16 setId);
460  void restoreAnimImageSetId();
461  void checkProtection();
462  void loadEfhGame();
463  void copyCurrentPlaceToBuffer(int16 id);
464  uint8 getMapTileInfo(int16 mapPosX, int16 mapPosY);
465  uint16 getStringWidth(const Common::String &str) const;
466  void setTextPos(int16 textPosX, int16 textPosY);
467  void drawGameScreenAndTempText(bool flag);
468  void drawMap(bool largeMapFl, int16 mapPosX, int16 mapPosY, int16 mapSize, bool drawHeroFl, bool drawMonstersFl);
469  void displaySmallMap(int16 posX, int16 posY);
470  void displayLargeMap(int16 posX, int16 posY);
471  void drawScreen();
472  void removeObject(int16 charId, int16 objectId);
473  void totalPartyKill();
474  void removeCharacterFromTeam(int16 teamMemberId);
475  void refreshTeamSize();
476  bool isNpcATeamMember(int16 id);
477  void handleWinSequence();
478  bool giveItemTo(int16 charId, int16 objectId, int16 fromCharId);
479  int16 chooseCharacterToReplace();
480  int16 handleCharacterJoining();
481  void drawText(uint8 *srcPtr, int16 posX, int16 posY, int16 maxX, int16 maxY, bool flag);
482  void displayMiddleLeftTempText(uint8 *impArray, bool flag);
483  void transitionMap(int16 centerX, int16 centerY);
484  void setSpecialTechZone(int16 unkId, int16 centerX, int16 centerY);
485  int16 findMapSpecialTileIndex(int16 posX, int16 posY);
486  bool isPosOutOfMap(int16 mapPosX, int16 mapPosY);
487  void goSouth();
488  void goNorth();
489  void goEast();
490  void goWest();
491  void goNorthEast();
492  void goSouthEast();
493  void goNorthWest();
494  void goSouthWest();
495  void showCharacterStatus(uint8 character);
496  void handleNewRoundEffects();
497  void resetGame();
498  void computeMapAnimation();
499  void handleAnimations();
500  void handleEvents();
501  int8 checkMonsterMoveCollisionAndTileTexture(int16 monsterId);
502  bool moveMonsterAwayFromTeam(int16 monsterId);
503  bool moveMonsterTowardsTeam(int16 monsterId);
504  bool moveMonsterGroupOther(int16 monsterId, int16 direction);
505  bool moveMonsterGroupRandom(int16 monsterId);
506  int16 computeMonsterGroupDistance(int16 monsterId);
507  bool checkWeaponRange(int16 monsterId, int16 weaponId);
508  bool checkMonsterMovementType(int16 id, bool teamFlag);
509  bool checkTeamWeaponRange(int16 monsterId);
510  bool checkIfMonsterOnSameLargeMapPlace(int16 monsterId);
511  bool checkMonsterWeaponRange(int16 monsterId);
512  void handleMapMonsterMoves();
513  bool checkMapMonsterAvailability(int16 monsterId);
514  void displayMonsterAnim(int16 monsterId);
515  int16 countAliveMonsters(int16 id);
516  bool checkMonsterGroupDistance1OrLess(int16 monsterId);
517  bool handleTalk(int16 monsterId, int16 arg2, int16 itemId);
518  void startTalkMenu(int16 monsterId);
519  void displayImp1Text(int16 textId);
520  bool handleInteractionText(int16 mapPosX, int16 mapPosY, int16 charId, int16 itemId, int16 arg8, int16 imageSetId);
521  int8 checkTileStatus(int16 mapPosX, int16 mapPosY, bool teamFl);
522  void computeInitiatives();
523  void redrawScreenForced();
524  int16 countMonsterGroupMembers(int16 monsterGroup);
525  uint16 getXPLevel(uint32 xp);
526  bool isItemCursed(int16 itemId);
527  bool hasObjectEquipped(int16 charId, int16 objectId);
528  void setMapMonsterAggressivenessAndMovementType(int16 id, uint8 mask);
529  bool isMonsterActive(int16 groupId, int16 id);
530  int16 getTileFactId(int16 mapPosX, int16 mapPosY);
531  void setCharacterObjectToBroken(int16 charId, int16 objectId);
532  int16 selectOtherCharFromTeam();
533  bool checkMonsterCollision();
534 
535  // Fight
536  bool handleFight(int16 monsterId);
537  void handleFight_checkEndEffect(int16 charId);
538  void handleFight_lastAction_A(int16 teamCharId);
539  void handleFight_lastAction_D(int16 teamCharId);
540  void handleFight_lastAction_H(int16 teamCharId);
541  bool handleFight_lastAction_U(int16 teamCharId);
542  void handleFight_MobstersAttack(int groupId);
543  bool isTPK();
544  bool isMonsterAlreadyFighting(int16 monsterId, int16 teamMonsterId);
545  void createOpponentList(int16 monsterTeamId);
546  void resetTeamMonsterEffects();
547  void initFight(int16 monsterId);
548  void resetTeamMonsterIdArray();
549  bool isTeamMemberStatusNormal(int16 id);
550  void getDeathTypeDescription(int16 victimId, int16 attackerId);
551  int16 determineTeamTarget(int16 charId, int16 unkFied18Val, bool checkDistanceFl);
552  bool getTeamAttackRoundPlans();
553  void drawCombatScreen(int16 charId, bool whiteFl, bool drawFl);
554  void getXPAndSearchCorpse(int16 charId, Common::String namePt1, Common::String namePt2, int16 monsterId);
555  bool characterSearchesMonsterCorpse(int16 charId, int16 monsterId);
556  void addReactionText(int16 id);
557  void displayEncounterInfo(bool WhiteFl);
558  int16 getWeakestMobster(int16 groupNumber);
559  int16 getCharacterScore(int16 charId, int16 itemId);
560  bool checkSpecialItemsOnCurrentPlace(int16 itemId);
561  bool hasAdequateDefense(int16 monsterId, uint8 attackType);
562  bool hasAdequateDefenseNPC(int16 charId, uint8 attackType);
563  void addNewOpponents(int16 monsterId);
564  int16 getTeamMonsterAnimId();
565  int16 selectMonsterGroup();
566  void redrawCombatScreenWithTempText(int16 charId);
567  void handleDamageOnArmor(int16 charId, int16 damage);
568 
569  // Files
570  int32 readFileToBuffer(const Common::Path &filename, uint8 *destBuffer);
571  void readAnimInfo();
572  void findMapFile(int16 mapId);
573  void rImageFile(const Common::Path &filename, uint8 *targetBuffer, uint8 **subFilesArray, uint8 *packedBuffer);
574  void readItems();
575  void readImpFile(int16 id, bool techMapFl);
576  void loadNewPortrait();
577  void loadAnimImageSet();
578  void loadHistory();
579  void loadTechMapImp(int16 fileId);
580  void loadPlacesFile(uint16 fullPlaceId, bool forceReloadFl);
581  void readTileFact();
582  void loadNPCS();
583  void preLoadMaps();
584 
585  // Graphics
586  void initPalette();
587  void drawLeftCenterBox();
588  void displayNextAnimFrame();
589  void displayAnimFrame();
590  void displayAnimFrames(int16 animId, bool displayMenuBoxFl);
591  void displayFctFullScreen();
592  void copyDirtyRect(int16 minX, int16 minY, int16 maxX, int16 maxY);
593  void copyGraphicBufferFromTo(EfhGraphicsStruct *efh_graphics_struct, EfhGraphicsStruct *efh_graphics_struct1, const Common::Rect &rect, int16 min_x, int16 min_y);
594  void displayBufferBmAtPos(BufferBM *bufferBM, int16 posX, int16 posY);
595  void drawRect(int16 minX, int16 minY, int16 maxX, int16 maxY);
596  void drawColoredRect(int16 minX, int16 minY, int16 maxX, int16 maxY, int16 color);
597  void clearScreen(int16 color);
598  void displayRawDataAtPos(uint8 *imagePtr, int16 posX, int16 posY);
599  void drawString(const Common::String &str, int16 startX, int16 startY, uint16 textColor);
600  void displayCenteredString(const Common::String &str, int16 minX, int16 maxX, int16 posY);
601  void displayMenuAnswerString(const Common::String &str, int16 minX, int16 maxX, int16 posY);
602  void drawMapWindow();
603  void displayGameScreen();
604  void drawUpperLeftBorders();
605  void drawUpperRightBorders();
606  void drawBottomBorders();
607  void drawChar(uint8 curChar, int16 posX, int16 posY);
608  void setTextColorWhite();
609  void setTextColorRed();
610  void setTextColorGrey();
611  void displayStringAtTextPos(const Common::String &message);
612  void clearBottomTextZone(int16 color);
613  void clearBottomTextZone_2(int16 color);
614  void setNextCharacterPos();
615  void displayCharAtTextPos(char character);
616  void displayWindow(uint8 *buffer, int16 posX, int16 posY, uint8 *dest);
617  void displayColoredMenuBox(int16 minX, int16 minY, int16 maxX, int16 maxY, int16 color);
618 
619  // Menu
620  int16 displayBoxWithText(const Common::String &str, int16 menuType, int16 displayOption, bool displayTeamWindowFl, bool voiceText = true);
621  bool handleDeathMenu();
622  void displayCombatMenu(int16 charId);
623  void displayMenuItemString(int16 menuBoxId, int16 thisBoxId, int16 minX, int16 maxX, int16 minY, const char *str);
624  void displayStatusMenu(int16 windowId);
625  void prepareStatusRightWindowIndexes(int16 menuId, int16 charId);
626  void displayCharacterSummary(int16 curMenuLine, int16 npcId);
627  void displayCharacterInformationOrSkills(int16 curMenuLine, int16 npcId);
628  void displayStatusMenuActions(int16 menuId, int16 curMenuLine, int16 npcId);
629  void prepareStatusMenu(int16 windowId, int16 menuId, int16 curMenuLine, int16 charId, bool refreshFl);
630  void displayWindowAndStatusMenu(int16 charId, int16 windowId, int16 menuId, int16 curMenuLine);
631  int16 displayStringInSmallWindowWithBorder(const Common::String &str, bool delayFl, int16 charId, int16 windowId, int16 menuId, int16 curMenuLine);
632  int16 handleStatusMenu(int16 gameMode, int16 charId);
633  void unequipItem(int16 charId, int16 objectId, int16 windowId, int16 menuId, int16 curMenuLine);
634  void tryToggleEquipped(int16 charId, int16 objectId, int16 windowId, int16 menuId, int16 curMenuLine);
635  int16 useObject(int16 charId, int16 objectId, int16 teamMonsterId, int16 menuId, int16 curMenuLine, int16 gameMode);
636 
637  // Savegames
638  void synchronize(Common::Serializer &s);
639 
640  // Script
641  const uint8 *script_readNumberArray(const uint8 *buffer, int16 destArraySize, int16 *destArray);
642  const uint8 *script_getNumber(const uint8 *srcBuffer, int16 *retBuf);
643  int16 script_parse(Common::String str, int16 posX, int16 posY, int16 maxX, int16 maxY, bool scriptExecuteFlag);
644 
645  // Sound
646  void songDelay(int delay);
647  void playNote(int frequencyIndex, int totalDelay);
648  Common::CustomEventType playSong(uint8 *buffer);
649  void generateSound1(int lowFreq, int highFreq, int duration);
650  void generateSound2(int startFreq, int endFreq, int speed);
651  void generateSound3();
652  void generateSound4(int repeat);
653  void generateSound5(int repeat);
654  void generateSound(int16 soundType);
655  void genericGenerateSound(int16 soundType, int16 repeatCount);
656  void sayText(const Common::String &text, TTSMenuRestriction menuRestriction, Common::TextToSpeechManager::Action action = Common::TextToSpeechManager::QUEUE) const;
657  void stopTextToSpeech() const;
658 
659  // Utils
660  void decryptImpFile(bool techMapFl);
661  void loadImageSet(int16 imageSetId, uint8 *buffer, uint8 **subFilesArray, uint8 *destBuffer);
662  uint32 uncompressBuffer(uint8 *compressedBuf, uint8 *destBuf);
663  int16 getRandom(int16 maxVal);
664  Common::CustomEventType getLastCharAfterAnimCount(int16 delay, bool waitForTTS = true);
665  Common::CustomEventType getInput(int16 delay);
666  Common::CustomEventType waitForKey();
667  Common::CustomEventType handleAndMapInput(bool animFl);
668  bool getValidationFromUser();
669  uint32 ROR(uint32 val, uint8 shiftVal);
670  Common::String getArticle(int pronoun);
671  void setKeymap(EfhKeymapCode keymapCode);
672 
673  // Actions
674  void handleActionSave();
675  void handleActionLoad();
676 
677  uint8 _videoMode;
678  uint8 _bufferCharBM[128];
679  int8 *_vgaLineBuffer[200];
680  EfhGraphicsStruct *_vgaGraphicsStruct1;
681  EfhGraphicsStruct *_vgaGraphicsStruct2;
682  EfhGraphicsStruct *_graphicsStruct;
683  uint8 _tileBank[3][12000];
684  uint8 _circleImageBuf[40100];
685  uint8 _portraitBuf[25000];
686  uint8 _decompBuf[40100];
687  uint8 _menuBuf[12500];
688  uint8 _windowWithBorderBuf[1500];
689  uint8 _mapArr[19][7000];
690  uint8 _places[12000];
691  uint8 _curPlace[24][24];
692  NPCStruct _npcBuf[100];
693  uint8 _imp1[13000];
694  uint8 _imp2[10000];
695  uint8 _titleSong[1024];
696  ItemStruct _items[300];
697  TileFactStruct _tileFact[432];
698  AnimInfo _animInfo[100];
699  uint8 _history[256];
700  uint8 _techDataArr[19][4100];
701  Common::String _enemyNamePt1;
702  Common::String _enemyNamePt2;
703  Common::String _characterNamePt1;
704  Common::String _characterNamePt2;
705  Common::String _nameBuffer;
706  Common::String _attackBuffer;
707  Common::String _messageToBePrinted;
708 
709  struct BitmapRef {
710  int8 _setId1;
711  int8 _setId2;
712  };
713 
714  BitmapRef _mapBitmapRefArr[19];
715 
716  MapSpecialTileStruct _mapSpecialTiles[19][100];
717  MapMonster _mapMonsters[19][64];
718  uint8 _mapGameMaps[19][64][64];
719 
720  uint8 _defaultBoxColor;
721  FontDescr _fontDescr;
722 
723  bool _introDoneFl;
724  uint16 _textColor;
725 
726  int16 _oldAnimImageSetId;
727  int16 _animImageSetId;
728  uint8 _paletteTransformationConstant;
729  uint8 *_circleImageSubFileArray[12];
730  uint8 *_tileBankSubFilesArray[216];
731  BufferBM _imageDataPtr;
732  int16 _currentTileBankImageSetId[3];
733  int16 _unkRelatedToAnimImageSetId;
734  int16 _techId;
735  int16 _currentAnimImageSetId;
736  uint8 *_portraitSubFilesArray[20];
737  int16 _unkAnimRelatedIndex;
738  uint8 *_imp1PtrArray[100];
739  uint8 *_imp2PtrArray[432];
740  uint16 _fullPlaceId;
741  int16 _guessAnimationAmount;
742  uint16 _largeMapFlag; // CHECKME: bool?
743  int16 _textPosX;
744  int16 _textPosY;
745 
746  Common::Rect _initRect;
747  bool _engineInitPending;
748  bool _protectionPassed;
749 
750  int16 _alertDelay;
751  int16 _teamSize;
752  int16 _word2C872;
753  bool _checkTileDisabledByScriptFl;
754  bool _redrawNeededFl;
755  bool _drawHeroOnMapFl;
756  bool _drawMonstersOnMapFl;
757  bool _textBoxDisabledByScriptFl;
758 
759  int16 _imageSetSubFilesIdx;
760  int16 _oldImageSetSubFilesIdx;
761 
762  int16 _mapPosX, _mapPosY;
763  int16 _oldMapPosX, _oldMapPosY;
764  int16 _techDataId_MapPosX, _techDataId_MapPosY;
765  uint16 _lastMainPlaceId;
766 
767  uint16 _tempTextDelay;
768  uint8 *_tempTextPtr;
769 
770  bool _ongoingFightFl;
771  bool _statusMenuActive;
772  int16 _menuStatItemArr[15];
773  int16 _menuDepth;
774  int16 _menuItemCounter;
775  int16 _selectedMenuBox;
776  bool _sayMenu;
777  bool _sayLowStatusScreen;
778  bool _initiatedTalkByMenu;
779 
780  TeamChar _teamChar[3];
781  TeamMonster _teamMonster[5];
782 
783  InitiativeStruct _initiatives[8];
784 
785  int16 _regenCounter;
786 
787  Audio::PCSpeaker *_speaker;
788 };
789 
790 } // End of namespace Efh
791 
792 #endif
Definition: str.h:59
Definition: efh.h:416
Definition: surface.h:67
EngineFeature
Definition: engine.h:260
Definition: error.h:81
Definition: efh.h:345
Definition: efh.h:242
Definition: advancedDetector.h:164
Definition: random.h:44
Definition: constants.h:27
Definition: efh.h:186
Definition: rect.h:524
Definition: path.h:52
Definition: efh.h:106
uint32 CustomEventType
Definition: events.h:204
Definition: efh.h:137
Definition: serializer.h:79
Definition: efh.h:70
Definition: efh.h:254
Out copy(In first, In last, Out dst)
Definition: algorithm.h:52
Definition: efh.h:396
Definition: ustr.h:57
Definition: efh.h:119
Definition: efh.h:206
Definition: efh.h:235
Definition: efh.h:84
Definition: constants.h:57
Definition: algorithm.h:29
Definition: efh.h:111
Definition: efh.h:228
Definition: system.h:163
Definition: efh.h:94
Definition: efh.h:211
Definition: engine.h:146
Definition: pcspk.h:34
Definition: efh.h:195
Platform
Definition: platform.h:46