ScummVM API documentation
draci.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 DRACI_DRACI_H
23 #define DRACI_DRACI_H
24 
25 #include "engines/engine.h"
26 #include "common/random.h"
27 #include "draci/console.h"
28 
29 struct ADGameDescription;
30 
31 class MidiDriver;
32 class OSystem;
33 
42 namespace Draci {
43 
44 enum DRACIAction {
45  kActionNone,
46  kActionEscape,
47  kActionMap,
48  kActionShowWalkMap,
49  kActionToggleWalkSpeed,
50  kActionInventory,
51  kActionOpenMainMenu,
52  kActionTogglePointerItem,
53  kActionInvRotatePrevious,
54  kActionInvRotateNext
55 };
56 
57 #ifdef USE_TTS
58 
60  uint8 voiceID;
61  bool male;
62 };
63 
64 static const CharacterDialogData characterDialogData[] = {
65  { 0, true }, // Bert
66  { 1, true }, // Narrator
67  { 2, true }, // Giant
68  { 3, true }, // Captured dwarf
69  { 4, true }, // Troll
70  { 0, false }, // Berta
71  { 5, true }, // Herbert
72  { 1, false }, // Evelyn
73  { 1, false }, // Evelyn
74  { 2, false }, // Karmela
75  { 6, true }, // King
76  { 7, true }, // Wind
77  { 8, true }, // Worm
78  { 9, true }, // Pub dwarf
79  { 10, true }, // Card player 2
80  { 11, true }, // Card player 1
81  { 12, true }, // Barkeeper
82  { 13, true }, // Lazy man
83  { 14, true }, // Goblin 1
84  { 15, true }, // Goblin 2
85  { 3, false }, // Chronicle
86  { 16, true }, // Beggar
87  { 17, true }, // Horn-blower
88  { 18, true }, // Herbert
89  { 19, true }, // Wizard
90  { 20, true }, // Comedian
91  { 21, true }, // Darter
92  { 4, true }, // Troll
93  { 21, true }, // Darter
94  { 0, true }, // Skull
95  { 22, true }, // Canary
96  { 23, true }, // Oak-tree
97  { 24, true }, // Beech-tree
98  { 4, false }, // Agatha
99  { 5, false }, // Eulanie
100  { 25, true }, // Knight
101  { 1, false }, // Evelyn
102  { 20, true }, // Comedian
103  { 1, true }, // Narrator
104 };
105 
106 #endif
107 
108 static const int kBertID = 0;
109 static const int kNarratorID = 1;
110 
111 class Screen;
112 class Mouse;
113 class Game;
114 class Script;
115 class AnimationManager;
116 class Sound;
117 class MusicPlayer;
118 class Font;
119 class BArchive;
120 class SoundArchive;
121 
122 class DraciEngine : public Engine {
123 public:
124  DraciEngine(OSystem *syst, const ADGameDescription *gameDesc);
125  ~DraciEngine() override;
126 
127  int init();
128  Common::Error run() override;
129 
130  Common::Language getLanguage() const;
131 
132  bool hasFeature(Engine::EngineFeature f) const override;
133  void pauseEngineIntern(bool pause) override;
134  void syncSoundSettings() override;
135 
136  void handleEvents();
137 
138  static Common::String getSavegameFile(int saveGameIdx);
139  Common::String getSaveStateName(int slot) const override { return getSavegameFile(slot); }
140  Common::Error loadGameState(int slot) override;
141  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
142  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
143  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
144 
145  void sayText(const Common::String &text, bool isSubtitle = false);
146  void stopTextToSpeech();
147  void setTTSVoice(int characterID) const;
148 #ifdef USE_TTS
149  Common::U32String convertText(const Common::String &text) const;
150 #endif
151 
152  const ADGameDescription *_gameDescription;
153 
154  Screen *_screen;
155  Mouse *_mouse;
156  Game *_game;
157  Script *_script;
158  AnimationManager *_anims;
159  Sound *_sound;
160  MusicPlayer *_music;
161 
162  Font *_smallFont;
163  Font *_bigFont;
164 
165  Common::String _previousSaid;
166 
167  BArchive *_iconsArchive;
168  BArchive *_objectsArchive;
169  BArchive *_spritesArchive;
170  BArchive *_paletteArchive;
171  BArchive *_roomsArchive;
172  BArchive *_overlaysArchive;
173  BArchive *_animationsArchive;
174  BArchive *_walkingMapsArchive;
175  BArchive *_itemsArchive;
176  BArchive *_itemImagesArchive;
177  BArchive *_initArchive;
178  BArchive *_stringsArchive;
179 
180  SoundArchive *_soundsArchive;
181  SoundArchive *_dubbingArchive;
182 
183  bool _showWalkingMap;
184 
186 
187  int32 _pauseStartTime;
188 };
189 
190 enum {
191  kDraciGeneralDebugLevel = 1,
192  kDraciBytecodeDebugLevel,
193  kDraciArchiverDebugLevel,
194  kDraciLogicDebugLevel,
195  kDraciAnimationDebugLevel,
196  kDraciSoundDebugLevel,
197  kDraciWalkingDebugLevel,
198 };
199 
200 } // End of namespace Draci
201 
202 #endif // DRACI_DRACI_H
Definition: mouse.h:45
Definition: font.h:54
Common::String getSaveStateName(int slot) const override
Definition: draci.h:139
Definition: draci.h:122
Definition: str.h:59
EngineFeature
Definition: engine.h:260
Definition: error.h:81
Definition: draci.h:59
Definition: advancedDetector.h:164
Definition: animation.h:176
Definition: random.h:44
Definition: mididrv.h:311
Definition: sound.h:182
Definition: script.h:93
Definition: music.h:33
Definition: ustr.h:57
Definition: barchive.h:48
Definition: screen.h:39
Definition: game.h:190
Definition: animation.h:30
Definition: system.h:163
Definition: engine.h:146
Definition: sound.h:66
Language
Definition: language.h:45