32 #include "engines/engine.h" 33 #include "graphics/surface.h" 34 #include "common/random.h" 35 #include "common/error.h" 36 #include "toon/resource.h" 37 #include "toon/script.h" 38 #include "toon/script_func.h" 39 #include "toon/state.h" 40 #include "toon/picture.h" 41 #include "toon/anim.h" 42 #include "toon/movie.h" 43 #include "toon/font.h" 44 #include "toon/text.h" 45 #include "toon/audio.h" 46 #include "toon/console.h" 49 class MemoryWriteStreamDynamic;
54 #define TOON_DAT_VER_MAJ 0 // 1 byte 55 #define TOON_DAT_VER_MIN 4 // 1 byte 56 #define TOON_SAVEGAME_VERSION 6 57 #define DATAALIGNMENT 4 58 #define MAX_SAVE_SLOT 99 60 #define TOON_SCREEN_WIDTH 640 61 #define TOON_SCREEN_HEIGHT 400 62 #define TOON_BACKBUFFER_WIDTH 1280 63 #define TOON_BACKBUFFER_HEIGHT 400 78 kActionStopCurrentVoice,
92 enum ToonDebugChannels {
94 kDebugCharacter = 1 << 1,
96 kDebugHotspot = 1 << 3,
100 kDebugPicture = 1 << 7,
101 kDebugResource = 1 << 8,
102 kDebugState = 1 << 9,
103 kDebugTools = 1 << 10,
127 char **_locationDirNotVisited;
128 char **_locationDirVisited;
129 char **_specialInfoLine;
132 bool showMainMenu(
bool &loadedGame);
134 bool showQuitConfirmationDialogue();
138 void unloadTextsVariants(
char **texts);
139 void unloadToonDat();
140 void setPaletteEntries(uint8 *palette, int32 offset, int32 num);
141 void fixPaletteEntries(uint8 *palette,
int num);
142 void flushPalette(
bool deferFlushToNextRender =
true);
146 void setFont(
bool alternative);
147 void loadScene(int32 SceneId,
bool forGameLoad =
false);
150 void setCursor(int32 type,
bool inventory =
false, int32 offsetX = 0,
int offsetY = 0);
151 void loadAdditionalPalette(
const Common::Path &fileName, int32 mode);
152 void setupGeneralPalette();
154 void update(int32 timeIncrement);
156 void updateAnimationSceneScripts(int32 timeElapsed);
157 void updateCharacters(int32 timeElapsed);
158 void setSceneAnimationScriptUpdate(
bool enable);
159 bool isUpdatingSceneAnimation();
160 int32 getCurrentUpdatingSceneAnimation();
161 int32 randRange(int32 minStart, int32 maxStart);
162 void selectHotspot();
164 int32 runEventScript(int32 x, int32 y, int32 mode, int32
id, int32 scriptId);
167 void drawConversationLine();
168 const char *getLocationString(int32 locationId,
bool alreadyVisited);
169 int32 getScaleAtPoint(int32 x, int32 y);
170 int32 getZAtPoint(int32 x, int32 y);
171 int32 getLayerAtPoint(int32 x, int32 y);
172 int32 characterTalk(int32 dialogid,
bool blocking =
true);
173 int32 simpleCharacterTalk(int32 dialogid);
174 void sayLines(
int numLines,
int dialogId);
175 void haveAConversation(int32 convId);
176 void processConversationClick(
Conversation *conv, int32 status);
177 int32 runConversationCommand(int16 **command);
178 void prepareConversations();
179 void drawConversationIcons();
180 void simpleUpdate(
bool waitCharacterToTalk =
false);
181 int32 waitTicks(int32 numTicks,
bool breakOnMouseClick);
182 void copyToVirtualScreen(
bool updateScreen =
true);
183 void getMouseEvent();
184 int32 showInventory();
186 void addItemToInventory(int32 item);
187 void deleteItemFromInventory(int32 item);
188 void replaceItemFromInventory(int32 item, int32 destItem);
189 void rearrangeInventory();
190 void createMouseItem(int32 item);
191 void deleteMouseItem();
196 void playSoundWrong();
197 void playSFX(int32
id, int32 volume);
198 void storeRifFlags(int32 location);
199 void restoreRifFlags(int32 location);
200 void getTextPosition(int32 characterId, int32 *retX, int32 *retY);
201 int32 getConversationFlag(int32 locationId, int32 param);
202 int32 getSpecialInventoryItem(int32 item);
203 Character *getCharacterById(int32 charId);
205 bool loadGame(int32 slot);
207 void fadeIn(int32 numFrames);
208 void fadeOut(int32 numFrames);
209 void initCharacter(int32 characterId, int32 animScriptId, int32 animToPlayId, int32 sceneAnimationId);
210 int32 handleInventoryOnFlux(int32 itemId);
211 int32 handleInventoryOnInventory(int32 itemDest, int32 itemSrc);
212 int32 handleInventoryOnDrew(int32 itemId);
213 int32 pauseSceneAnimationScript(int32 animScriptId, int32 tickToWait);
214 void updateTimer(int32 timeIncrement);
216 void createShadowLUT();
217 void playTalkAnimOnCharacter(int32 animID, int32 characterId,
bool talker);
218 void updateScrolling(
bool force, int32 timeIncrement);
219 void enableTimer(int32 timerId);
220 void setTimer(int32 timerId, int32 timerWait);
221 void disableTimer(int32 timerId);
223 void makeLineNonWalkable(int32 x, int32 y, int32 x2, int32 y2);
224 void makeLineWalkable(int32 x, int32 y, int32 x2, int32 y2);
225 void renderInventory();
226 void viewInventoryItem(
const Common::Path &str, int32 lineId, int32 itemDest);
228 void restorePalette();
229 const char *getSpecialConversationMusic(int32 locationId);
230 void playRoomMusic();
231 void waitForScriptStep();
232 void doMagnifierEffect();
233 void drawCustomText(int16 x, int16 y,
const char *line,
Graphics::Surface *frame, byte color);
234 bool showConversationText()
const;
237 void pauseEngineIntern(
bool pause)
override;
238 void syncSoundSettings()
override;
249 return *_mainSurface;
257 return _currentPicture;
261 return _animationManager;
264 Movie *getMoviePlayer() {
269 return &_sceneAnimations[id];
273 return &_sceneAnimationScripts[id];
285 return _characters[charId];
288 uint8 *getShadowLUT() {
292 int32 getCurrentLineToSay() {
293 return _currentTextLineId;
296 int32 getCurrentCharacterTalking() {
297 return _currentTextLineCharacterId;
308 int32 getTickLength() {
312 int32 getOldMilli() {
317 return _audioManager;
320 int32 getScriptRegionNested() {
321 return _currentScriptRegion;
336 bool isEnglishDemo() {
337 return _isEnglishDemo;
342 bool shouldQuitGame()
const {
356 (f == kSupportsSubtitleOptions) ||
357 (f == kSupportsReturnToLauncher) ||
358 (f == kSupportsLoadingDuringRuntime) ||
359 (f == kSupportsSavingDuringRuntime);
362 void dirtyAllScreen();
363 void addDirtyRect(int32 left, int32 top, int32 right, int32 bottom);
364 void clearDirtyRects();
372 uint8 *_finalPalette;
373 uint8 *_backupPalette;
374 uint8 *_additionalPalette1;
375 uint8 *_additionalPalette2;
376 bool _additionalPalette2Present;
377 uint8 *_cutawayPalette;
378 uint8 *_universalPalette;
380 uint8 *_roomScaleData;
392 int32 _currentScriptRegion;
398 int32 _lastProcessedSceneScript;
399 bool _animationSceneScriptRunFlag;
400 bool _updatingSceneScriptRunFlag;
414 int32 _cursorOffsetX;
415 int32 _cursorOffsetY;
417 char *_currentTextLine;
418 int32 _currentTextLineId;
419 int32 _currentTextLineX;
420 int32 _currentTextLineY;
421 int32 _currentTextLineCharacterId;
423 int32 _oldScrollValue;
432 int32 _currentHotspotItem;
440 int32 _lastMouseButton;
444 int32 _lastRenderTime;
460 int16 *_conversationData;
465 bool _showConversationText;
467 bool _useAlternativeFont;
468 bool _needPaletteFlush;
Failed to read a file (permission denied?).
Definition: error.h:62
EngineFeature
Definition: engine.h:253
Definition: conversation.h:37
Definition: advancedDetector.h:163
No error occurred.
Definition: error.h:48
Definition: memstream.h:194
Definition: script_func.h:41
Common::Error loadGameState(int slot) override
Definition: toon.h:350
bool hasFeature(EngineFeature f) const override
Definition: toon.h:354
Definition: resource.h:80
Definition: algorithm.h:29
Definition: character.h:58
Failure to write data - disk full?
Definition: error.h:63
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave=false) override
Definition: toon.h:346
Language
Definition: language.h:45