ScummVM
kyra_mr.h
Go to the documentation of this file.
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
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (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, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef KYRA_KYRA_MR_H
24 #define KYRA_KYRA_MR_H
25 
26 #include "kyra/engine/kyra_v2.h"
28 #include "kyra/script/script.h"
29 #include "kyra/gui/gui_mr.h"
30 
31 #include "common/hashmap.h"
32 #include "common/list.h"
33 
34 namespace Kyra {
35 
36 class SoundDigital_MR;
37 class Screen_MR;
38 class MainMenu;
39 class WSAMovie_v2;
40 class TextDisplayer_MR;
41 struct Button;
42 
43 class KyraEngine_MR : public KyraEngine_v2 {
44 friend class TextDisplayer_MR;
45 friend class GUI_MR;
46 public:
49 
50  // Regarding pausing of the engine:
51  // Idle animation time, item animations and album animations should be taken
52  // care of, but since those would just produce minor glitches it's not that
53  // important.
54 
55  Screen *screen() { return _screen; }
56  Screen_v2 *screen_v2() const { return _screen; }
57  GUI *gui() const { return _gui; }
59  int language() const { return _lang; }
60  bool heliumMode() const { return _configHelium; }
61 
62  Common::Error go();
63 
64  void playVQA(const char *name);
65 
66 private:
67  static const EngineDesc _mrEngineDesc;
68 
69  // config
74 
76  void writeSettings();
77  void readSettings();
78 
79  void initStaticResource();
80 
81  // --
84 
86 
87  void preinit();
88  void startup();
89  void runStartupScript(int script, int unk1);
90 
91  void setupOpcodeTable();
92 
93  // input
94  bool skipFlag() const;
95  void resetSkipFlag(bool removeEvent = true);
96 
97  // run
99 
100  void runLoop();
101  void handleInput(int x, int y);
102  int inputSceneChange(int x, int y, int unk1, int unk2);
103 
104  void update();
105  void updateWithText();
106  void updateMouse();
107 
108  // sound specific
109 private:
110  void playMenuAudioFile();
111 
114  const char *_menuAudioFile;
115 
116  const char *const *_soundList;
118 
119  void snd_playWanderScoreViaMap(int track, int force);
120  void stopMusicTrack();
121 
122  void fadeOutMusic(int ticks);
123 
124  void snd_playSoundEffect(int item, int volume);
125 
128  const char *const *_sfxFileList;
130 
132 
133  void playVoice(int high, int low);
134  void snd_playVoiceFile(int file);
135  bool snd_voiceIsPlaying();
136  void snd_stopVoice();
137 
139  void playStudioSFX(const char *str);
140 
141  // gui
143 
147  void initMainButtonList(bool disable);
148 
150  int buttonInventory(Button *button);
151  int buttonMoodChange(Button *button);
152  int buttonShowScore(Button *button);
153  int buttonJesterStaff(Button *button);
154 
155  void loadButtonShapes();
156  int callbackButton1(Button *button);
157  int callbackButton2(Button *button);
158  int callbackButton3(Button *button);
159 
160  // -> main menu
161  void initMainMenu();
162  void uninitMainMenu();
163 
166 
167  // timer
168  void setupTimers();
169 
170  void setWalkspeed(uint8);
171  void setCommandLineRestoreTimer(int secs);
172 
173  void timerRestoreCommandLine(int arg);
174  void timerRunSceneScript7(int arg);
175  void timerFleaDeath(int arg);
176 
178  void setNextIdleAnimTimer();
179 
180  // pathfinder
181  bool lineIsPassable(int x, int y);
182 
183 private:
184  // main menu
185  const char *const *_mainMenuStrings;
187 
188  static const char *const _mainMenuSpanishFan[];
189  static const char *const _mainMenuItalianFan[];
190 
191  // animator
193  void restorePage3();
194 
195  void clearAnimObjects();
196 
197  void animSetupPaletteEntry(AnimObj *anim);
198 
199  void drawAnimObjects();
200  void drawSceneAnimObject(AnimObj *obj, int x, int y, int drawLayer);
201  void drawCharacterAnimObject(AnimObj *obj, int x, int y, int drawLayer);
202 
203  void refreshAnimObjects(int force);
204 
206  void updateItemAnimations();
207  void updateCharacterAnim(int charId);
208 
209  void updateSceneAnim(int anim, int newFrame);
210  void setupSceneAnimObject(int anim, uint16 flags, int x, int y, int x2, int y2, int w, int h, int unk10, int specialSize, int unk14, int shape, const char *filename);
211  void removeSceneAnimObject(int anim, int refresh);
212 
215 
216  void setCharacterAnimDim(int w, int h);
217  void resetCharacterAnimDim();
218 
220  void showIdleAnim();
221 
225 
226  // interface
229 
230  void loadInterfaceShapes();
231  void loadInterface();
232 
233  void showMessage(const char *string, uint8 c0, uint8 c1);
234  void showMessageFromCCode(int string, uint8 c0, int);
235  void updateItemCommand(Item item, int str, uint8 c0);
236 
237  void updateCommandLine();
238  void restoreCommandLine();
239  void updateCLState();
240 
242  const char *_shownMessage;
246 
247  void showInventory();
248  void hideInventory();
249 
250  void drawMalcolmsMoodText();
251  void drawMalcolmsMoodPointer(int frame, int page);
252  void drawJestersStaff(int type, int page);
253 
254  void drawScore(int page, int x, int y);
255  void drawScoreCounting(int oldScore, int newScore, int drawOld, const int x);
256  int getScoreX(const char *str);
257 
258  static const uint8 _inventoryX[];
259  static const uint8 _inventoryY[];
260  void redrawInventory(int page);
261  void clearInventorySlot(int slot, int page);
262  void drawInventorySlot(int page, Item item, int slot);
263 
266 
267  // localization
276 
277  uint8 *getTableEntry(uint8 *buffer, int id);
278  void getTableEntry(Common::SeekableReadStream *stream, int id, char *dst);
279 
280  // items
283 
284  static const Item _trashItemList[];
285  void removeTrashItems();
286 
287  void initItems();
288 
289  int checkItemCollision(int x, int y);
290 
291  bool dropItem(int unk1, Item item, int x, int y, int unk2);
292  bool processItemDrop(uint16 sceneId, Item item, int x, int y, int unk1, int unk2);
293  void itemDropDown(int startX, int startY, int dstX, int dstY, int itemSlot, Item item, int remove);
294  void exchangeMouseItem(int itemPos, int runScript);
295  bool pickUpItem(int x, int y, int runScript);
296 
297  bool isDropable(int x, int y);
298 
300  bool itemListMagic(Item handItem, int itemSlot);
301  bool itemInventoryMagic(Item handItem, int invSlot);
302 
305  static const uint8 _itemStringPickUp[];
306  static const uint8 _itemStringDrop[];
307  static const uint8 _itemStringInv[];
308 
312 
313  // -> hand item
314  void setItemMouseCursor();
315  void setMouseCursor(Item item);
316 
317  // shapes
318  void initMouseShapes();
319 
320  void loadCharacterShapes(int newShapes);
321  void updateMalcolmShapes();
322 
324 
325  struct ShapeDesc {
328  };
329  static const ShapeDesc _shapeDescs[];
330  static const int _shapeDescsSize;
331 
332  // scene animation
334 
335  void freeSceneShapes();
336 
337  // voice
339  void openTalkFile(int file);
340 
341  // scene
343  void enterNewScene(uint16 scene, int facing, int unk1, int unk2, int unk3);
344  void enterNewSceneUnk1(int facing, int unk1, int unk2);
345  void enterNewSceneUnk2(int unk1);
347 
348  void unloadScene();
349 
350  void loadScenePal();
351  void loadSceneMsc();
352  void initSceneScript(int unk1);
353  void initSceneAnims(int unk1);
354  void initSceneScreen(int unk1);
355 
356  int runSceneScript1(int x, int y);
357  int runSceneScript2();
359  void runSceneScript4(int unk1);
360  void runSceneScript8();
361 
364 
365  int trySceneChange(int *moveTable, int unk1, int unk2);
366  int checkSceneChange();
367 
370  struct SceneShapeDesc {
371  // the original saves those variables, we don't, since
372  // they are just needed on scene load
373  /*int x, y;
374  int w, h;*/
375  int drawX, drawY;
376  };
378 
379  int getDrawLayer(int x, int y);
380 
381  int getScale(int x, int y);
382  int _scaleTable[15];
383 
384  // character
385  int getCharacterWalkspeed() const;
386  void updateCharAnimFrame(int *table);
388  static const uint8 _characterFrameTable[];
389 
390  void updateCharPal(int unk1);
393 
394  bool checkCharCollision(int x, int y);
395 
397 
398  void makeCharFacingMouse();
399 
400  int findFreeInventorySlot();
401 
402  // talk object
403  struct TalkObject {
404  char filename[13];
410  };
411 
413 
414  bool talkObjectsInCurScene();
415 
416  // chat
417  int chatGetType(const char *text);
418  int chatCalcDuration(const char *text);
419 
420  void objectChat(const char *text, int object, int vocHigh, int vocLow);
421  void objectChatInit(const char *text, int object, int vocHigh, int vocLow);
422  void objectChatPrintText(const char *text, int object);
423  void objectChatProcess(const char *script);
424  void objectChatWaitToFinish();
425 
426  void badConscienceChat(const char *str, int vocHigh, int vocLow);
428 
429  void goodConscienceChat(const char *str, int vocHigh, int vocLow);
431 
433  void albumChat(const char *str, int vocHigh, int vocLow);
434  void albumChatInit(const char *str, int object, int vocHigh, int vocLow);
435  void albumChatWaitToFinish();
436 
438 
442  void setDlgIndex(int index);
443  void updateDlgIndex();
444 
448  void updateDlgBuffer();
449  void loadDlgHeader(int &vocHighBase, int &vocHighIndex, int &index1, int &index2);
450 
451  static const uint8 _vocHighTable[];
453  void processDialog(int vocHighIndex, int vocHighBase, int funcNum);
454 
460 
461  void dialogStartScript(int object, int funcNum);
462  void dialogEndScript(int object);
463 
464  void npcChatSequence(const char *str, int object, int vocHigh, int vocLow);
465 
467 
468  int o3d_updateAnim(EMCState *script);
469  int o3d_delay(EMCState *script);
470 
471  void randomSceneChat();
472  void doDialog(int dlgIndex, int funcNum);
473 
474  // conscience
478 
480 
481  void showBadConscience();
482  void hideBadConscience();
483 
487 
489 
490  void showGoodConscience();
491  void hideGoodConscience();
492 
493  // special script code
495 
496  int o3a_setCharacterFrame(EMCState *script);
497  int o3a_playSoundEffect(EMCState *script);
498 
499  // special shape code
500  int initAnimationShapes(uint8 *filedata);
501  void uninitAnimationShapes(int count, uint8 *filedata);
502 
503  // unk
507 
509  void changeChapter(int newChapter, int sceneId, int malcolmShapes, int facing);
510 
511  static const uint8 _chapterLowestScene[];
512 
513  void loadCostPal();
514  void loadShadowShape();
515  void loadExtrasShapes();
516 
518  void backUpGfxRect32x32(int x, int y);
519  void restoreGfxRect32x32(int x, int y);
520 
522 
523  int _score;
525 
528 
530  bool updateScore(int scoreId, int strId);
531  void scoreIncrease(int count, const char *str);
532 
533  void eelScript();
534 
535  // Album
536  struct Album {
541 
542  struct PageMovie {
544  int curFrame;
545  int maxFrame;
547  };
548 
549  PageMovie leftPage, rightPage;
550 
551  int curPage, nextPage;
552  bool running;
553  bool isPage14;
554  } _album;
555 
556  static const int8 _albumWSAX[];
557  static const int8 _albumWSAY[];
558 
559  void showAlbum();
560 
561  void loadAlbumPage();
562  void loadAlbumPageWSA();
563 
564  void printAlbumPageText();
565  void printAlbumText(int page, const char *str, int x, int y, uint8 c0);
566 
567  void processAlbum();
568 
569  void albumNewPage();
570  void albumUpdateAnims();
571  void albumAnim1();
572  void albumAnim2();
573 
574  void albumBackUpRect();
575  void albumRestoreRect();
576  void albumUpdateRect();
577 
578  void albumSwitchPages(int oldPage, int newPage, int srcPage);
579 
580  int albumNextPage(Button *caller);
581  int albumPrevPage(Button *caller);
582  int albumClose(Button *caller);
583 
584  // save/load
585  Common::Error saveGameStateIntern(int slot, const char *saveName, const Graphics::Surface *thumbnail);
586  Common::Error loadGameState(int slot);
587 
588  // opcodes
589  int o3_getMalcolmShapes(EMCState *script);
590  int o3_setCharacterPos(EMCState *script);
591  int o3_defineObject(EMCState *script);
592  int o3_refreshCharacter(EMCState *script);
593  int o3_getMalcolmsMood(EMCState *script);
595  int o3_setCharacterFacing(EMCState *script);
596  int o3_showSceneFileMessage(EMCState *script);
598  int o3_showBadConscience(EMCState *script);
599  int o3_hideBadConscience(EMCState *script);
600  int o3_showAlbum(EMCState *script);
601  int o3_setInventorySlot(EMCState *script);
602  int o3_getInventorySlot(EMCState *script);
603  int o3_addItemToInventory(EMCState *script);
604  int o3_addItemToCurScene(EMCState *script);
605  int o3_objectChat(EMCState *script);
606  int o3_resetInventory(EMCState *script);
609  int o3_npcChatSequence(EMCState *script);
610  int o3_badConscienceChat(EMCState *script);
611  int o3_wipeDownMouseItem(EMCState *script);
612  int o3_setMalcolmsMood(EMCState *script);
613  int o3_updateScore(EMCState *script);
614  int o3_makeSecondChanceSave(EMCState *script);
615  int o3_setSceneFilename(EMCState *script);
616  int o3_removeItemsFromScene(EMCState *script);
617  int o3_disguiseMalcolm(EMCState *script);
618  int o3_drawSceneShape(EMCState *script);
619  int o3_drawSceneShapeOnPage(EMCState *script);
620  int o3_checkInRect(EMCState *script);
621  int o3_updateConversations(EMCState *script);
622  int o3_removeItemSlot(EMCState *script);
623  int o3_setSceneDim(EMCState *script);
625  int o3_removeItemInstances(EMCState *script);
626  int o3_disableInventory(EMCState *script);
627  int o3_enableInventory(EMCState *script);
628  int o3_enterNewScene(EMCState *script);
629  int o3_switchScene(EMCState *script);
630  int o3_setMalcolmPos(EMCState *script);
631  int o3_stopMusic(EMCState *script);
632  int o3_playSoundEffect(EMCState *script);
633  int o3_getScore(EMCState *script);
634  int o3_daggerWarning(EMCState *script);
635  int o3_blockOutWalkableRegion(EMCState *script);
637  int o3_showGoodConscience(EMCState *script);
638  int o3_goodConscienceChat(EMCState *script);
639  int o3_hideGoodConscience(EMCState *script);
640  int o3_defineSceneAnim(EMCState *script);
641  int o3_updateSceneAnim(EMCState *script);
642  int o3_runActorScript(EMCState *script);
643  int o3_doDialog(EMCState *script);
644  int o3_setConversationState(EMCState *script);
645  int o3_getConversationState(EMCState *script);
646  int o3_changeChapter(EMCState *script);
647  int o3_countItemInstances(EMCState *script);
648  int o3_dialogStartScript(EMCState *script);
649  int o3_dialogEndScript(EMCState *script);
650  int o3_customChat(EMCState *script);
651  int o3_customChatFinish(EMCState *script);
652  int o3_setupSceneAnimObject(EMCState *script);
653  int o3_removeSceneAnimObject(EMCState *script);
654  int o3_dummy(EMCState *script);
655 
656  // misc
659 
660  // resource specific
661 private:
662  static const char *const _languageExtension[];
663  static const int _languageExtensionSize;
664 
665  int loadLanguageFile(const char *file, uint8 *&buffer);
666 };
667 
668 } // End of namespace Kyra
669 
670 #endif
int _malcolmShapeXOffset
Definition: kyra_mr.h:323
bool snd_voiceIsPlaying()
Definition: kyra_mr.cpp:462
static const uint8 _goodConscienceFrameTable[]
Definition: kyra_mr.h:488
void objectChatPrintText(const char *text, int object)
Definition: text_mr.cpp:278
int _mainMenuStringsSize
Definition: kyra_mr.h:186
const uint8 * _itemMagicTable
Definition: kyra_mr.h:299
int _malcolmShapeYOffset
Definition: kyra_mr.h:323
bool _badConsciencePosition
Definition: kyra_mr.h:477
void enterNewSceneUnk1(int facing, int unk1, int unk2)
Definition: scene_mr.cpp:167
int o3_getCharacterFrameFromFacing(EMCState *script)
Definition: script_mr.cpp:92
unsigned short uint16
Definition: cdtypes.h:27
uint32 _nextIdleAnim
Definition: kyra_mr.h:177
int albumNextPage(Button *caller)
Definition: gui_mr.cpp:1011
uint8 * _gamePlayBuffer
Definition: kyra_mr.h:192
void setMouseCursor(Item item)
Definition: items_mr.cpp:78
uint8 * _paletteOverlay
Definition: kyra_mr.h:505
static const uint8 _itemStringInv[]
Definition: kyra_mr.h:307
void albumUpdateAnims()
Definition: gui_mr.cpp:871
int o3d_updateAnim(EMCState *script)
Definition: script_mr.cpp:1108
int o3_setCharacterFacing(EMCState *script)
Definition: script_mr.cpp:97
static const ShapeDesc _shapeDescs[]
Definition: kyra_mr.h:329
static const int8 _albumWSAY[]
Definition: kyra_mr.h:557
void restoreCommandLine()
Definition: gui_mr.cpp:150
int o3_setupSceneAnimObject(EMCState *script)
Definition: script_mr.cpp:1063
void objectChatProcess(const char *script)
Definition: text_mr.cpp:297
const char * _menuAudioFile
Definition: kyra_mr.h:114
unsigned int uint32
Definition: cdtypes.h:26
int o3_setConversationState(EMCState *script)
Definition: script_mr.cpp:939
void playVoice(int high, int low)
Definition: kyra_mr.cpp:451
uint8 * _interface
Definition: kyra_mr.h:227
void handleInput(int x, int y)
Definition: kyra_mr.cpp:924
int count
Definition: voc.cpp:116
void makeCharFacingMouse()
Definition: kyra_mr.cpp:1200
bool _goodConsciencePosition
Definition: kyra_mr.h:486
int o3_showSceneStringsMessage(EMCState *script)
Definition: script_mr.cpp:816
void drawCharacterAnimObject(AnimObj *obj, int x, int y, int drawLayer)
Digital audio output device.
const uint8 * _scoreTable
Definition: kyra_mr.h:526
Screen * screen()
Definition: kyra_mr.h:55
Screen_MR * _screen
Definition: kyra_mr.h:82
int o3a_setCharacterFrame(EMCState *script)
Definition: script_mr.cpp:1085
void drawScoreCounting(int oldScore, int newScore, int drawOld, const int x)
Definition: gui_mr.cpp:383
static const uint8 _itemStringDrop[]
Definition: kyra_mr.h:306
signed char int8
Definition: cdtypes.h:31
int o3_removeItemSlot(EMCState *script)
Definition: script_mr.cpp:583
int findFreeInventorySlot()
Definition: items_mr.cpp:41
void openTalkFile(int file)
Definition: kyra_mr.cpp:693
int o3_showAlbum(EMCState *script)
Definition: script_mr.cpp:130
void setWalkspeed(uint8)
Definition: timer_mr.cpp:82
int o3_setSceneAnimPosAndFrame(EMCState *script)
Definition: script_mr.cpp:597
int o3_updateSceneAnim(EMCState *script)
Definition: script_mr.cpp:892
u16 flags
Definition: zipreader.h:215
void loadButtonShapes()
Definition: gui_mr.cpp:36
void timerFleaDeath(int arg)
Definition: timer_mr.cpp:60
uint8 * _gfxBackUpRect
Definition: kyra_mr.h:517
Common::SeekableReadStream * _dlgBuffer
Definition: kyra_mr.h:446
int o3_makeSecondChanceSave(EMCState *script)
Definition: script_mr.cpp:285
void initSceneScreen(int unk1)
Definition: scene_mr.cpp:553
void goodConscienceChat(const char *str, int vocHigh, int vocLow)
Definition: text_mr.cpp:422
bool _menuDirectlyToLoad
Definition: kyra_mr.h:98
bool itemInventoryMagic(Item handItem, int invSlot)
Definition: items_mr.cpp:460
uint8 * _actorFile
Definition: kyra_mr.h:273
bool itemListMagic(Item handItem, int itemSlot)
Definition: items_mr.cpp:385
int y
Definition: dialogs.cpp:409
Definition: input.h:70
int o3_addItemToCurScene(EMCState *script)
Definition: script_mr.cpp:159
FILE * file
int callbackButton3(Button *button)
Definition: gui_mr.cpp:90
int o3_showBadConscience(EMCState *script)
Definition: script_mr.cpp:118
void randomSceneChat()
Definition: text_mr.cpp:830
unsigned char uint8
Definition: cdtypes.h:28
static CodeValue high
Definition: decode.cpp:56
int callbackButton2(Button *button)
Definition: gui_mr.cpp:75
void doDialog(int dlgIndex, int funcNum)
Definition: text_mr.cpp:849
GUI * gui() const
Definition: kyra_mr.h:57
int o3_daggerWarning(EMCState *script)
Definition: script_mr.cpp:725
void snd_playVoiceFile(int file)
Definition: kyra_mr.cpp:455
struct Kyra::KyraEngine_MR::Album _album
int o3_disguiseMalcolm(EMCState *script)
Definition: script_mr.cpp:318
int o3_runActorScript(EMCState *script)
Definition: script_mr.cpp:899
bool _goodConscienceShown
Definition: kyra_mr.h:484
static const int8 _albumWSAX[]
Definition: kyra_mr.h:556
int o3_setMalcolmPos(EMCState *script)
Definition: script_mr.cpp:695
int callbackButton1(Button *button)
Definition: gui_mr.cpp:60
int o3_customChatFinish(EMCState *script)
Definition: script_mr.cpp:1055
static const char *const _mainMenuSpanishFan[]
Definition: kyra_mr.h:188
void updateMalcolmShapes()
Definition: kyra_mr.cpp:765
void albumChatWaitToFinish()
Definition: text_mr.cpp:556
KyraEngine_MR(OSystem *system, const GameFlags &flags)
Definition: kyra_mr.cpp:53
void setCharacterAnimDim(int w, int h)
uint8 * _optionsFile
Definition: kyra_mr.h:272
void initMainButtonList(bool disable)
Definition: staticres.cpp:1887
void clearInventorySlot(int slot, int page)
Definition: gui_mr.cpp:454
void drawMalcolmsMoodText()
Definition: gui_mr.cpp:303
int o3_countInventoryItemInstances(EMCState *script)
Definition: script_mr.cpp:215
bool processItemDrop(uint16 sceneId, Item item, int x, int y, int unk1, int unk2)
Definition: items_mr.cpp:125
int o3_defineObject(EMCState *script)
Definition: script_mr.cpp:52
int o3_switchScene(EMCState *script)
Definition: script_mr.cpp:684
bool updateScore(int scoreId, int strId)
Definition: kyra_mr.cpp:1289
Common::Array< const Opcode * > _opcodesDialog
Definition: kyra_mr.h:466
int8 * _itemBuffer1
Definition: kyra_mr.h:281
bool talkObjectsInCurScene()
Definition: kyra_mr.cpp:1278
static const uint8 _chapterLowestScene[]
Definition: kyra_mr.h:511
int o3_addItemToInventory(EMCState *script)
Definition: script_mr.cpp:147
Common::Error init()
Definition: kyra_mr.cpp:203
int o3a_playSoundEffect(EMCState *script)
Definition: script_mr.cpp:1100
void playStudioSFX(const char *str)
Definition: kyra_mr.cpp:471
void drawScore(int page, int x, int y)
Definition: gui_mr.cpp:366
bool _badConscienceShown
Definition: kyra_mr.h:475
int o3_drawSceneShapeOnPage(EMCState *script)
Definition: script_mr.cpp:347
int o3_stopMusic(EMCState *script)
Definition: script_mr.cpp:708
uint8 * _sceneStrings
Definition: kyra_mr.h:275
void setItemMouseCursor()
Definition: items_mr.cpp:94
Common::SeekableReadStream * _cnvFile
Definition: kyra_mr.h:445
int getItemCommandStringDrop(uint16 item)
Definition: items_mr.cpp:518
byte _newSceneDlgState[40]
Definition: kyra_mr.h:439
int o3_showSceneFileMessage(EMCState *script)
Definition: script_mr.cpp:103
int chatCalcDuration(const char *text)
Definition: text_mr.cpp:189
int o3_setMalcolmsMood(EMCState *script)
Definition: script_mr.cpp:275
int inputSceneChange(int x, int y, int unk1, int unk2)
Definition: kyra_mr.cpp:996
int _dialogScriptFuncEnd
Definition: kyra_mr.h:459
int o3_objectChat(EMCState *script)
Definition: script_mr.cpp:188
void drawInventorySlot(int page, Item item, int slot)
Definition: gui_mr.cpp:464
int8 _characterAnimTable[2]
Definition: kyra_mr.h:387
void animSetupPaletteEntry(AnimObj *anim)
Definition: animator_mr.cpp:70
void changeChapter(int newChapter, int sceneId, int malcolmShapes, int facing)
Definition: kyra_mr.cpp:1342
void timerRestoreCommandLine(int arg)
Definition: timer_mr.cpp:43
Button * _mainButtonList
Definition: kyra_mr.h:145
void updateCharAnimFrame(int *table)
Definition: kyra_mr.cpp:779
int albumPrevPage(Button *caller)
Definition: gui_mr.cpp:1020
bool checkCharCollision(int x, int y)
Definition: kyra_mr.cpp:869
void showInventory()
Definition: gui_mr.cpp:162
const char *const * _mainMenuStrings
Definition: kyra_mr.h:185
int _inventoryScrollSpeed
Definition: kyra_mr.h:245
void albumChatInit(const char *str, int object, int vocHigh, int vocLow)
Definition: text_mr.cpp:497
void showMessageFromCCode(int string, uint8 c0, int)
Definition: gui_mr.cpp:122
void registerDefaultSettings()
Definition: kyra_mr.cpp:1377
void snd_playWanderScoreViaMap(int track, int force)
Definition: kyra_mr.cpp:405
int getCharacterWalkspeed() const
Definition: kyra_mr.cpp:775
int o3_goodConscienceChat(EMCState *script)
Definition: script_mr.cpp:828
int o3_customChat(EMCState *script)
Definition: script_mr.cpp:1037
void loadShadowShape()
Definition: kyra_mr.cpp:624
void updateItemCommand(Item item, int str, uint8 c0)
Definition: gui_mr.cpp:126
int8 _sceneDatPalette[45]
Definition: kyra_mr.h:368
EMCState _dialogScriptState
Definition: kyra_mr.h:456
int o3_doDialog(EMCState *script)
Definition: script_mr.cpp:933
void showMessage(const char *string, uint8 c0, uint8 c1)
Definition: gui_mr.cpp:105
void objectChatWaitToFinish()
Definition: text_mr.cpp:319
void resetSkipFlag(bool removeEvent=true)
Definition: kyra_mr.cpp:1366
int o3_defineSceneAnim(EMCState *script)
Definition: script_mr.cpp:842
uint32 type
Definition: mididrv.cpp:60
void albumSwitchPages(int oldPage, int newPage, int srcPage)
Definition: gui_mr.cpp:953
const char * _shownMessage
Definition: kyra_mr.h:242
int initAnimationShapes(uint8 *filedata)
void badConscienceChat(const char *str, int vocHigh, int vocLow)
Definition: text_mr.cpp:366
int o3_drawSceneShape(EMCState *script)
Definition: script_mr.cpp:325
int o3_wipeDownMouseItem(EMCState *script)
Definition: script_mr.cpp:248
bool heliumMode() const
Definition: kyra_mr.h:60
char name[4]
Definition: cdaudio.cpp:49
void refreshAnimObjects(int force)
int o3_removeItemsFromScene(EMCState *script)
Definition: script_mr.cpp:298
static const char *const _languageExtension[]
Definition: kyra_mr.h:662
void runStartupScript(int script, int unk1)
Definition: kyra_mr.cpp:673
int buttonShowScore(Button *button)
Definition: gui_mr.cpp:588
int _dialogScriptFuncStart
Definition: kyra_mr.h:459
void playMenuAudioFile()
Definition: kyra_mr.cpp:398
int o3_badConscienceChat(EMCState *script)
Definition: script_mr.cpp:240
void setCommandLineRestoreTimer(int secs)
Definition: timer_mr.cpp:91
void updateCommandLine()
Definition: gui_mr.cpp:143
int _fadeOutMusicChannel
Definition: kyra_mr.h:113
int o3_hideBadConscience(EMCState *script)
Definition: script_mr.cpp:124
uint8 * _scoreFile
Definition: kyra_mr.h:268
int o3_disableInventory(EMCState *script)
Definition: script_mr.cpp:654
void setDlgIndex(int index)
Definition: text_mr.cpp:650
int o3_countItemInstances(EMCState *script)
Definition: script_mr.cpp:1004
void initSceneScript(int unk1)
Definition: scene_mr.cpp:345
void enterNewSceneUnk2(int unk1)
Definition: scene_mr.cpp:263
int getItemCommandStringInv(uint16 item)
Definition: items_mr.cpp:530
int buttonMoodChange(Button *button)
Definition: gui_mr.cpp:521
uint8 * _scenesFile
Definition: kyra_mr.h:270
static const int _shapeDescsSize
Definition: kyra_mr.h:330
void setupSceneAnimObject(int anim, uint16 flags, int x, int y, int x2, int y2, int w, int h, int unk10, int specialSize, int unk14, int shape, const char *filename)
int o3_changeChapter(EMCState *script)
Definition: script_mr.cpp:998
int o3_setSceneFilename(EMCState *script)
Definition: script_mr.cpp:291
const uint8 * _itemStringMap
Definition: kyra_mr.h:303
int getScale(int x, int y)
Definition: kyra_mr.cpp:1218
void timerRunSceneScript7(int arg)
Definition: timer_mr.cpp:48
void backUpGfxRect32x32(int x, int y)
Definition: kyra_mr.cpp:1224
uint8 * _sceneShapes[20]
Definition: kyra_mr.h:333
void updateCLState()
Definition: gui_mr.cpp:155
Common::String filename
Definition: action.cpp:479
void redrawInventory(int page)
Definition: gui_mr.cpp:429
int o3_getConversationState(EMCState *script)
Definition: script_mr.cpp:969
void scoreIncrease(int count, const char *str)
Definition: kyra_mr.cpp:1311
int8 _sceneDatLayerTable[15]
Definition: kyra_mr.h:369
int o3_hideGoodConscience(EMCState *script)
Definition: script_mr.cpp:836
SceneIndex index
Definition: action.cpp:432
Button * _mainButtonData
Definition: kyra_mr.h:144
int o3_removeInventoryItemInstances(EMCState *script)
Definition: script_mr.cpp:205
InventoryItem item
Definition: action.cpp:650
bool dropItem(int unk1, Item item, int x, int y, int unk2)
Definition: items_mr.cpp:102
static const uint8 _vocHighTable[]
Definition: kyra_mr.h:451
int getDrawLayer(int x, int y)
Definition: kyra_mr.cpp:1212
Common::Error saveGameStateIntern(int slot, const char *saveName, const Graphics::Surface *thumbnail)
Definition: saveload_mr.cpp:33
void loadAlbumPageWSA()
Definition: gui_mr.cpp:720
An Error instance pairs an error code with string description providing more details about the error...
Definition: error.h:77
void playVQA(const char *name)
Definition: kyra_mr.cpp:364
void enterNewScene(uint16 scene, int facing, int unk1, int unk2, int unk3)
Definition: scene_mr.cpp:32
char * _stringBuffer
Definition: kyra_mr.h:521
SoundDigital_MR * _soundDigital
Definition: kyra_mr.h:83
const uint8 * _sfxFileMap
Definition: kyra_mr.h:126
int loadLanguageFile(const char *file, uint8 *&buffer)
Definition: kyra_mr.cpp:1234
This is the namespace of the Kyra engine.
Definition: chargen.cpp:37
int o3_dialogEndScript(EMCState *script)
Definition: script_mr.cpp:1031
An arbitrary graphics surface, which can be the target (or source) of blit operations, font rendering, etc.
Definition: surface.h:42
void dialogEndScript(int object)
Definition: text_mr.cpp:778
int chatGetType(const char *text)
Definition: text_mr.cpp:169
void loadCharacterShapes(int newShapes)
Definition: kyra_mr.cpp:720
MainMenu * _menu
Definition: kyra_mr.h:164
void goodConscienceChatWaitToFinish()
Definition: text_mr.cpp:439
int16 Item
Definition: item.h:30
void hideInventory()
Definition: gui_mr.cpp:240
int o3_blockOutWalkableRegion(EMCState *script)
Definition: script_mr.cpp:800
int getItemCommandStringPickUp(uint16 item)
Definition: items_mr.cpp:524
bool pickUpItem(int x, int y, int runScript)
Definition: items_mr.cpp:342
void itemDropDown(int startX, int startY, int dstX, int dstY, int itemSlot, Item item, int remove)
Definition: items_mr.cpp:229
void dialogStartScript(int object, int funcNum)
Definition: text_mr.cpp:758
static const int _languageExtensionSize
Definition: kyra_mr.h:663
Screen_v2 * screen_v2() const
Definition: kyra_mr.h:56
const char *const * _sfxFileList
Definition: kyra_mr.h:128
void malcolmSceneStartupChat()
Definition: text_mr.cpp:598
int o3_resetInventory(EMCState *script)
Definition: script_mr.cpp:199
void updateSceneAnim(int anim, int newFrame)
void loadDlgHeader(int &vocHighBase, int &vocHighIndex, int &index1, int &index2)
Definition: text_mr.cpp:642
WSAMovie_v2 * _invWsa
Definition: kyra_mr.h:264
int _dialogScriptFuncProc
Definition: kyra_mr.h:459
virtual TextDisplayer * text()
Definition: kyra_v1.h:197
#define system
Definition: sdl-sys.h:224
int o3_checkInRect(EMCState *script)
Definition: script_mr.cpp:357
Interface for ScummVM backends.
Definition: system.h:113
int o3_removeItemInstances(EMCState *script)
Definition: script_mr.cpp:626
void loadInterfaceShapes()
Definition: kyra_mr.cpp:637
static const Item _trashItemList[]
Definition: kyra_mr.h:284
int buttonJesterStaff(Button *button)
Definition: gui_mr.cpp:611
TextDisplayer_MR * _text
Definition: kyra_mr.h:657
int8 * _itemBuffer2
Definition: kyra_mr.h:282
void printAlbumPageText()
Definition: gui_mr.cpp:744
signed short int16
Definition: cdtypes.h:30
Common::Error go()
Definition: kyra_mr.cpp:235
int o3_npcChatSequence(EMCState *script)
Definition: script_mr.cpp:231
uint8 * _interfaceCommandLine
Definition: kyra_mr.h:228
int o3_enterNewScene(EMCState *script)
Definition: script_mr.cpp:666
static const uint8 _characterFrameTable[]
Definition: kyra_mr.h:388
static const uint8 _inventoryY[]
Definition: kyra_mr.h:259
void initSceneAnims(int unk1)
Definition: scene_mr.cpp:438
bool isDropable(int x, int y)
Definition: items_mr.cpp:371
void setNextIdleAnimTimer()
Definition: timer_mr.cpp:97
void runSceneScript4(int unk1)
Definition: scene_mr.cpp:733
bool _mainButtonListInitialized
Definition: kyra_mr.h:146
ActiveItemAnim _activeItemAnim[10]
Definition: kyra_mr.h:223
int o3_updateScore(EMCState *script)
Definition: script_mr.cpp:280
void npcChatSequence(const char *str, int object, int vocHigh, int vocLow)
Definition: text_mr.cpp:793
void removeTrashItems()
Definition: items_mr.cpp:30
const char *const * _soundList
Definition: kyra_mr.h:116
static const uint8 _itemStringPickUp[]
Definition: kyra_mr.h:305
int o3_removeSceneAnimObject(EMCState *script)
Definition: script_mr.cpp:1072
int language() const
Definition: kyra_mr.h:59
EMCData _dialogScriptData
Definition: kyra_mr.h:455
void fadeOutMusic(int ticks)
Definition: kyra_mr.cpp:433
void initMouseShapes()
Definition: kyra_mr.cpp:499
int o3_refreshCharacter(EMCState *script)
Definition: script_mr.cpp:66
static const uint8 _inventoryX[]
Definition: kyra_mr.h:258
int checkItemCollision(int x, int y)
Definition: items_mr.cpp:49
bool skipFlag() const
Definition: kyra_mr.cpp:1360
void albumRestoreRect()
Definition: gui_mr.cpp:944
void albumUpdateRect()
Definition: gui_mr.cpp:948
void drawMalcolmsMoodPointer(int frame, int page)
Definition: gui_mr.cpp:335
static const char *const _mainMenuItalianFan[]
Definition: kyra_mr.h:189
int runSceneScript1(int x, int y)
Definition: scene_mr.cpp:701
int o3_setSceneDim(EMCState *script)
Definition: script_mr.cpp:590
void objectChatInit(const char *text, int object, int vocHigh, int vocLow)
Definition: text_mr.cpp:235
uint8 frame
Definition: trainline.cpp:37
int o3_playSoundEffect(EMCState *script)
Definition: script_mr.cpp:714
void loadExtrasShapes()
Definition: kyra_mr.cpp:629
int o3_dummy(EMCState *script)
Definition: script_mr.cpp:1078
void updateDlgBuffer()
Definition: text_mr.cpp:621
void drawSceneAnimObject(AnimObj *obj, int x, int y, int drawLayer)
int o3_setCharacterPos(EMCState *script)
Definition: script_mr.cpp:36
void loadAlbumPage()
Definition: gui_mr.cpp:702
int o3_getInventorySlot(EMCState *script)
Definition: script_mr.cpp:142
uint8 * getTableEntry(uint8 *buffer, int id)
Definition: kyra_mr.cpp:1246
void restoreGfxRect32x32(int x, int y)
Definition: kyra_mr.cpp:1228
int o3d_delay(EMCState *script)
Definition: script_mr.cpp:1115
uint8 * _itemFile
Definition: kyra_mr.h:271
void albumBackUpRect()
Definition: gui_mr.cpp:940
int trySceneChange(int *moveTable, int unk1, int unk2)
Definition: scene_mr.cpp:591
void badConscienceChatWaitToFinish()
Definition: text_mr.cpp:383
void exchangeMouseItem(int itemPos, int runScript)
Definition: items_mr.cpp:313
SceneShapeDesc _sceneShapeDescs[20]
Definition: kyra_mr.h:377
int buttonInventory(Button *button)
Definition: gui_mr.cpp:474
Common::Error loadGameState(int slot)
Load a game state.
int o3_getMalcolmShapes(EMCState *script)
Definition: script_mr.cpp:31
int albumClose(Button *caller)
Definition: gui_mr.cpp:1029
int o3_dialogStartScript(EMCState *script)
Definition: script_mr.cpp:1025
void newFrame(Stack theStack, Aint noOfLocals)
Definition: stack.cpp:111
int o3_showGoodConscience(EMCState *script)
Definition: script_mr.cpp:822
bool _restoreCommandLine
Definition: kyra_mr.h:243
int o3_getScore(EMCState *script)
Definition: script_mr.cpp:720
void uninitAnimationShapes(int count, uint8 *filedata)
uint8 * _costPalBuffer
Definition: kyra_mr.h:504
int o3_enableInventory(EMCState *script)
Definition: script_mr.cpp:660
int8 _scoreFlagTable[26]
Definition: kyra_mr.h:529
Interface for a seekable & readable data stream.
Definition: stream.h:561
int getScoreX(const char *str)
Definition: gui_mr.cpp:417
static const EngineDesc _mrEngineDesc
Definition: kyra_mr.h:67
const ItemAnimDefinition * _itemAnimDefinition
Definition: kyra_mr.h:222
int8 _conversationState[30][30]
Definition: kyra_mr.h:440
bool lineIsPassable(int x, int y)
Definition: scene_mr.cpp:753
uint8 * _cCodeFile
Definition: kyra_mr.h:269
int o3_setCharacterAnimFrameFromFacing(EMCState *script)
Definition: script_mr.cpp:109
int o3_setInventorySlot(EMCState *script)
Definition: script_mr.cpp:136
uint32 _actorFileSize
Definition: kyra_mr.h:274
SoundDigital_MR * soundDigital()
Definition: kyra_mr.h:58
void removeSceneAnimObject(int anim, int refresh)
void albumChat(const char *str, int vocHigh, int vocLow)
Definition: text_mr.cpp:478
int _scaleTable[15]
Definition: kyra_mr.h:382
WSAMovie_v2 * _menuAnim
Definition: kyra_mr.h:165
int o3_getMalcolmsMood(EMCState *script)
Definition: script_mr.cpp:87
static CodeValue low
Definition: decode.cpp:56
void updateCharacterAnim(int charId)
void processDialog(int vocHighIndex, int vocHighBase, int funcNum)
Definition: text_mr.cpp:698
int o3_updateConversations(EMCState *script)
Definition: script_mr.cpp:379
void drawJestersStaff(int type, int page)
Definition: gui_mr.cpp:355
unsigned char byte
Definition: portdefs.h:57
void updateCharPal(int unk1)
Definition: kyra_mr.cpp:834
void objectChat(const char *text, int object, int vocHigh, int vocLow)
Definition: text_mr.cpp:193
void snd_playSoundEffect(int item, int volume)
Definition: kyra_mr.cpp:441
void printAlbumText(int page, const char *str, int x, int y, uint8 c0)
Definition: gui_mr.cpp:768
TalkObject * _talkObjectList
Definition: kyra_mr.h:412
static const uint8 _badConscienceFrameTable[]
Definition: kyra_mr.h:479