ScummVM
kyra_mr.cpp
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 #include "kyra/engine/kyra_mr.h"
24 #include "kyra/graphics/wsamovie.h"
25 #include "kyra/text/text_mr.h"
26 #include "kyra/graphics/vqa.h"
27 #include "kyra/engine/timer.h"
28 #include "kyra/gui/debugger.h"
29 #include "kyra/gui/gui_mr.h"
30 #include "kyra/resource/resource.h"
32 
33 #include "common/system.h"
34 #include "common/config-manager.h"
35 
36 namespace Kyra {
37 
38 const KyraEngine_v2::EngineDesc KyraEngine_MR::_mrEngineDesc = {
39  // Generic shape related
40  248,
42 
43  // Scene script
44  9,
45 
46  // Animation script specific
47  9,
48 
49  // Item specific
50  71
51 };
52 
53 KyraEngine_MR::KyraEngine_MR(OSystem *system, const GameFlags &flags) : KyraEngine_v2(system, flags, _mrEngineDesc) {
54  _soundDigital = 0;
55  _musicSoundChannel = -1;
56  _menuAudioFile = "TITLE1";
57  _lastMusicCommand = -1;
59  _scoreFile = 0;
60  _cCodeFile = 0;
61  _scenesFile = 0;
62  _itemFile = 0;
63  _gamePlayBuffer = 0;
65  _costPalBuffer = 0;
66  memset(_sceneShapes, 0, sizeof(_sceneShapes));
68  _gfxBackUpRect = 0;
69  _paletteOverlay = 0;
70  _sceneList = 0;
72  _mainCharacter.height = 0x4C;
77  _nextAnimItem = 0;
78  _text = 0;
79  _commandLineY = 189;
80  _inventoryState = false;
82  _overwriteSceneFacing = false;
84  _sceneStrings = 0;
86  _mainCharX = _mainCharY = -1;
87  _animList = 0;
88  _drawNoShapeFlag = false;
89  _wasPlayingVQA = false;
90  _lastCharPalLayer = -1;
91  _charPalUpdate = false;
92  _runFlag = false;
93  _unk5 = 0;
94  _unkSceneScreenFlag1 = false;
95  _noScriptEnter = true;
97  _savedMouseState = -1;
98  _unk4 = 0;
99  _loadingState = false;
100  _noStartupChat = false;
101  _pathfinderFlag = 0;
102  _talkObjectList = 0;
104  memset(&_chatScriptData, 0, sizeof(_chatScriptData));
105  _voiceSoundChannel = -1;
108  _useActorBuffer = false;
109  _curStudioSFX = 283;
110  _badConscienceShown = false;
111  _currentChapter = 1;
114  _cnvFile = _dlgBuffer = 0;
116  _isStartupDialog = 0;
117  _stringBuffer = 0;
118  _menu = 0;
119  _menuAnim = 0;
124  _malcolmsMood = 1;
125  _nextIdleAnim = 0;
126  _nextIdleType = false;
128  _invWsa = 0;
129  _invWsaFrame = -1;
130  _score = 0;
132  _mainButtonData = 0;
133  _mainButtonList = 0;
135  _enableInventory = true;
136  _goodConscienceShown = false;
137  _goodConscienceAnim = -1;
138  _goodConsciencePosition = false;
139  _menuDirectlyToLoad = false;
140  _optionsFile = 0;
141  _actorFile = 0;
142  _chatAltFlag = false;
143  _albumChatActive = false;
144  memset(&_album, 0, sizeof(_album));
145  _configHelium = false;
147  memset(_scaleTable, 0, sizeof(_scaleTable));
148 }
149 
151  uninitMainMenu();
152 
153  delete _screen;
154  delete _soundDigital;
155 
156  delete[] _itemBuffer1;
157  delete[] _itemBuffer2;
158  delete[] _scoreFile;
159  delete[] _cCodeFile;
160  delete[] _scenesFile;
161  delete[] _itemFile;
162  delete[] _actorFile;
163  delete[] _gamePlayBuffer;
164  delete[] _interface;
165  delete[] _interfaceCommandLine;
166  delete[] _costPalBuffer;
167 
168  for (uint i = 0; i < ARRAYSIZE(_sceneShapes); ++i)
169  delete[] _sceneShapes[i];
170 
171  for (uint i = 0; i < ARRAYSIZE(_sceneAnimMovie); ++i)
172  delete _sceneAnimMovie[i];
173 
174  delete[] _gfxBackUpRect;
175  delete[] _paletteOverlay;
176 
177  for (ShapeMap::iterator i = _gameShapes.begin(); i != _gameShapes.end(); ++i) {
178  delete[] i->_value;
179  i->_value = 0;
180  }
181  _gameShapes.clear();
182 
183  delete[] _sceneStrings;
184  delete[] _talkObjectList;
185 
187  delete *i;
189 
190  delete _cnvFile;
191  delete _dlgBuffer;
192  delete[] _stringBuffer;
193  delete _invWsa;
194  delete[] _mainButtonData;
195  delete _gui;
196  delete[] _optionsFile;
197 
198  delete _album.wsa;
199  delete _album.leftPage.wsa;
200  delete _album.rightPage.wsa;
201 }
202 
204  _screen = new Screen_MR(this, _system);
205  assert(_screen);
207 
208  setDebugger(new Debugger_v2(this));
209 
212 
213  _soundDigital = new SoundDigital_MR(this, _mixer);
214  assert(_soundDigital);
216  assert(_text);
217  _gui = new GUI_MR(this);
218  assert(_gui);
219  _gui->initStaticData();
220 
222  _screen->loadFont(Screen::FID_8_FNT, "8FAT.FNT");
223  _screen->loadFont(Screen::FID_BOOKFONT_FNT, "BOOKFONT.FNT");
225  _screen->setAnimBlockPtr(3500);
226  _screen->setScreenDim(0);
227 
228  _screen->loadPalette("PALETTE.COL", _screen->getPalette(0));
230 
231  return Common::kNoError;
232 }
233 
235  bool running = true;
236  preinit();
237  _screen->hideMouse();
238  initMainMenu();
239 
240  _screen->clearPage(0);
241  _screen->clearPage(2);
242 
243  const bool firstTimeGame = !saveFileLoadable(0);
244 
245  if (firstTimeGame) {
246  playVQA("K3INTRO");
247  _wasPlayingVQA = false;
248  }
249 
250  if (_gameToLoad != -1 || firstTimeGame) {
251  while (!_screen->isMouseVisible())
252  _screen->showMouse();
253 
254  uninitMainMenu();
255  _musicSoundChannel = -1;
256  startup();
257  runLoop();
258  running = false;
259  }
260 
261  while (running && !shouldQuit()) {
262  _screen->_curPage = 0;
263  _screen->clearPage(0);
264 
266 
268 
269  for (int i = 0; i < 64 && !shouldQuit(); ++i) {
270  uint32 nextRun = _system->getMillis() + 3 * _tickLength;
271  _menuAnim->displayFrame(i, 0, 0, 0, 0, 0, 0);
273  delayUntil(nextRun);
274  }
275 
276  for (int i = 64; i > 29 && !shouldQuit(); --i) {
277  uint32 nextRun = _system->getMillis() + 3 * _tickLength;
278  _menuAnim->displayFrame(i, 0, 0, 0, 0, 0, 0);
280  delayUntil(nextRun);
281  }
282 
283  _eventList.clear();
284 
285  switch (_menu->handle(3)) {
286  case 2:
287  _menuDirectlyToLoad = true;
288  // fall through
289 
290  case 0:
291  uninitMainMenu();
292 
293  fadeOutMusic(60);
294  _screen->fadeToBlack(60);
295  _musicSoundChannel = -1;
296  startup();
297  runLoop();
298  running = false;
299  break;
300 
301  case 1:
302  playVQA("K3INTRO");
303  _wasPlayingVQA = false;
304  _screen->hideMouse();
305  break;
306 
307  case 3:
308  fadeOutMusic(60);
309  _screen->fadeToBlack(60);
310  uninitMainMenu();
311  quitGame();
312  running = false;
313  break;
314 
315  default:
316  break;
317  }
318  }
319 
320  if (_showOutro && !shouldQuit())
321  playVQA("CREDITS");
322 
323  return Common::kNoError;
324 }
325 
327  _menuAnim = new WSAMovie_v2(this);
328  _menuAnim->open("REVENGE.WSA", 1, &_screen->getPalette(0));
329  _screen->getPalette(0).fill(0, 1, 0);
330 
331  _menu = new MainMenu(this);
332  MainMenu::StaticData data = {
334  { 0x01, 0x04, 0x0C, 0x04, 0x00, 0x80, 0xFF },
335  { 0x16, 0x19, 0x1A, 0x16 },
336  Screen::FID_8_FNT, 240
337  };
338 
339  if (_flags.lang == Common::ES_ESP) {
340  for (int i = 0; i < 4; ++i)
341  data.strings[i] = _mainMenuSpanishFan[i];
342  } else if (_flags.lang == Common::IT_ITA) {
343  for (int i = 0; i < 4; ++i)
344  data.strings[i] = _mainMenuItalianFan[i];
345  }
346 
347  MainMenu::Animation anim;
348  anim.anim = _menuAnim;
349  anim.startFrame = 29;
350  anim.endFrame = 63;
351  anim.delay = 2;
352 
353  _menu->init(data, anim);
354 }
355 
357  delete _menuAnim;
358  _menuAnim = 0;
359  delete _menu;
360  _menu = 0;
361 }
362 
363 void KyraEngine_MR::playVQA(const char *name) {
364  VQAMovie vqa(this, _system);
365 
367 
368  if (vqa.open(filename.c_str())) {
369  for (int i = 0; i < 4; ++i) {
370  if (i != _musicSoundChannel)
372  }
373 
374  _screen->hideMouse();
375  _screen->copyPalette(1, 0);
376  fadeOutMusic(60);
377  _screen->fadeToBlack(60);
378  _screen->clearPage(0);
379 
380  vqa.play();
381  vqa.close();
382 
384  _screen->showMouse();
385 
386  // Taken from original, it used '1' here too
387  _screen->getPalette(0).fill(0, 256, 1);
389  _screen->clearPage(0);
390  _screen->copyPalette(0, 1);
391  _wasPlayingVQA = true;
392  }
393 }
394 
395 #pragma mark -
396 
399  return;
400 
402 }
403 
404 void KyraEngine_MR::snd_playWanderScoreViaMap(int track, int force) {
406  force = 1;
407  else if (_musicSoundChannel == -1)
408  force = 1;
409 
410  if (track == _lastMusicCommand && !force)
411  return;
412 
413  stopMusicTrack();
414 
415  if (_musicSoundChannel == -1) {
416  assert(track < _soundListSize && track >= 0);
417 
419  }
420 
421  _lastMusicCommand = track;
422 }
423 
427 
428  _lastMusicCommand = -1;
429  _musicSoundChannel = -1;
430 }
431 
433  if (_musicSoundChannel >= 0) {
436  _lastMusicCommand = -1;
437  }
438 }
439 
441  if (_sfxFileMap[item*2+0] != 0xFF) {
442  assert(_sfxFileMap[item*2+0] < _sfxFileListSize);
444  uint8 priority = _sfxFileMap[item*2+1];
445 
447  }
448 }
449 
451  snd_playVoiceFile(high * 1000 + low);
452 }
453 
456 
457  if (speechEnabled())
459 }
460 
463 }
464 
466  if (_voiceSoundChannel != -1)
468 }
469 
470 void KyraEngine_MR::playStudioSFX(const char *str) {
471  if (!_configStudio)
472  return;
473 
474  if (_rnd.getRandomNumberRng(1, 2) != 2)
475  return;
476 
477  const int strSize = strlen(str) - 1;
478  if (str[strSize] != '?' && str[strSize] != '!')
479  return;
480 
482 
483  if (_curStudioSFX > 291)
484  _curStudioSFX = 283;
485 }
486 
487 #pragma mark -
488 
490  _itemBuffer1 = new int8[72];
491  _itemBuffer2 = new int8[144];
492  initMouseShapes();
493  initItems();
494 
496 }
497 
499  uint8 *data = _res->fileData("MOUSE.SHP", 0);
500  assert(data);
501  for (int i = 0; i <= 6; ++i)
502  _gameShapes[i] = _screen->makeShapeCopy(data, i);
503  delete[] data;
504 }
505 
507  _album.wsa = new WSAMovie_v2(this);
508  assert(_album.wsa);
509  _album.leftPage.wsa = new WSAMovie_v2(this);
510  assert(_album.leftPage.wsa);
511  _album.rightPage.wsa = new WSAMovie_v2(this);
512  assert(_album.rightPage.wsa);
513 
514  _gamePlayBuffer = new uint8[64000];
515 
516  _interface = new uint8[17920];
517  _interfaceCommandLine = new uint8[3840];
518 
520 
521  _stringBuffer = new char[500];
522  allocAnimObjects(1, 16, 50);
523 
524  memset(_sceneShapes, 0, sizeof(_sceneShapes));
525  _screenBuffer = new uint8[64000];
526 
527  if (!loadLanguageFile("ITEMS.", _itemFile))
528  error("Couldn't load ITEMS");
529  if (!loadLanguageFile("SCORE.", _scoreFile))
530  error("Couldn't load SCORE");
531  if (!loadLanguageFile("C_CODE.", _cCodeFile))
532  error("Couldn't load C_CODE");
533  if (!loadLanguageFile("SCENES.", _scenesFile))
534  error("Couldn't load SCENES");
535  if (!loadLanguageFile("OPTIONS.", _optionsFile))
536  error("Couldn't load OPTIONS");
537  if (!loadLanguageFile("_ACTOR.", _actorFile))
538  error("couldn't load _ACTOR");
539 
540  openTalkFile(0);
541  _currentTalkFile = 0;
542  openTalkFile(1);
543  loadCostPal();
544 
545  for (int i = 0; i < 16; ++i) {
546  _sceneAnims[i].flags = 0;
547  _sceneAnimMovie[i] = new WSAMovie_v2(this);
548  assert(_sceneAnimMovie[i]);
549  }
550 
551  _screen->_curPage = 0;
552 
553  _talkObjectList = new TalkObject[88];
554  memset(_talkObjectList, 0, sizeof(TalkObject)*88);
555  for (int i = 0; i < 88; ++i)
556  _talkObjectList[i].sceneId = 0xFF;
557 
558  _gfxBackUpRect = new uint8[_screen->getRectSize(32, 32)];
559  initItemList(50);
560  resetItemList();
561 
562  loadShadowShape();
567  initMainButtonList(true);
570 
571  _screen->loadPalette("PALETTE.COL", _screen->getPalette(0));
572  _paletteOverlay = new uint8[256];
574 
575  loadInterface();
576 
578 
579  _scoreMax = 0;
580  for (int i = 0; i < _scoreTableSize; ++i) {
581  if (_scoreTable[i] > 0)
582  _scoreMax += _scoreTable[i];
583  }
584 
587 
588  _sceneList = new SceneDesc[98];
589  assert(_sceneList);
590  memset(_sceneList, 0, sizeof(SceneDesc)*98);
591  _sceneListSize = 98;
592 
593  runStartupScript(1, 0);
594  _res->exists("MOODOMTR.WSA", true);
595  _invWsa = new WSAMovie_v2(this);
596  assert(_invWsa);
597  _invWsa->open("MOODOMTR.WSA", 1, 0);
598  _invWsaFrame = 6;
599  saveGameStateIntern(0, "New Game", 0);
600  if (_gameToLoad == -1)
602  else
604 
607 
609  _screen->showMouse();
610 
613 }
614 
616  _res->exists("_COSTPAL.DAT", true);
617  uint32 size = 0;
618  _costPalBuffer = _res->fileData("_COSTPAL.DAT", &size);
619  assert(_costPalBuffer);
620  assert(size == 864);
621 }
622 
624  _screen->loadBitmap("SHADOW.CSH", 3, 3, 0);
625  addShapeToPool(_screen->getCPagePtr(3), 421, 0);
626 }
627 
629  _screen->loadBitmap("EXTRAS.CSH", 3, 3, 0);
630  for (int i = 0; i < 20; ++i)
631  addShapeToPool(_screen->getCPagePtr(3), i+433, i);
632  addShapeToPool(_screen->getCPagePtr(3), 453, 20);
633  addShapeToPool(_screen->getCPagePtr(3), 454, 21);
634 }
635 
637  _screen->loadBitmap("INTRFACE.CSH", 3, 3, 0);
638  for (int i = 422; i <= 432; ++i)
639  addShapeToPool(_screen->getCPagePtr(3), i, i-422);
640 }
641 
643  _screen->loadBitmap("INTRFACE.CPS", 3, 3, 0);
644  memcpy(_interface, _screen->getCPagePtr(3), 17920);
646 }
647 
649  _screen->loadBitmap("ITEMS.CSH", 3, 3, 0);
650 
651  for (int i = 248; i <= 319; ++i)
652  addShapeToPool(_screen->getCPagePtr(3), i, i-248);
653 
654  _screen->loadBitmap("ITEMS2.CSH", 3, 3, 0);
655 
656  for (int i = 320; i <= 397; ++i)
657  addShapeToPool(_screen->getCPagePtr(3), i, i-320);
658 
659  uint32 size = 0;
660  uint8 *itemsDat = _res->fileData("_ITEMS.DAT", &size);
661 
662  assert(size >= 72+144);
663 
664  memcpy(_itemBuffer1, itemsDat , 72);
665  memcpy(_itemBuffer2, itemsDat+72, 144);
666 
667  delete[] itemsDat;
668 
669  _screen->_curPage = 0;
670 }
671 
673  EMCState state;
674  EMCData data;
675  memset(&state, 0, sizeof(state));
676  memset(&data, 0, sizeof(data));
677  char filename[13];
678  strcpy(filename, "_START0X.EMC");
679  filename[7] = (script % 10) + '0';
680 
681  _emc->load(filename, &data, &_opcodes);
682  _emc->init(&state, &data);
683  _emc->start(&state, 0);
684  state.regs[6] = unk1;
685 
686  while (_emc->isValid(&state))
687  _emc->run(&state);
688 
689  _emc->unload(&data);
690 }
691 
693  char talkFilename[16];
694 
695  if (file == 0) {
696  strcpy(talkFilename, "ANYTALK.TLK");
697  } else {
698  if (_currentTalkFile > 0) {
699  sprintf(talkFilename, "CH%dTALK.TLK", _currentTalkFile);
700  _res->unloadPakFile(talkFilename);
701  }
702  sprintf(talkFilename, "CH%dTALK.TLK", file);
703  }
704 
706  if (!_res->loadPakFile(talkFilename)) {
707  if (speechEnabled()) {
708  warning("Couldn't load voice file '%s', falling back to text only mode", talkFilename);
709  _configVoice = 0;
710 
711  // Sync the config manager with the new settings
712  writeSettings();
713  }
714  }
715 }
716 
717 #pragma mark -
718 
720  static const uint8 numberOffset[] = { 3, 3, 4, 4, 3, 3 };
721  static const uint8 startShape[] = { 0x32, 0x58, 0x78, 0x98, 0xB8, 0xD8 };
722  static const uint8 endShape[] = { 0x57, 0x77, 0x97, 0xB7, 0xD7, 0xF7 };
723  static const char *const filenames[] = {
724  "MSW##.SHP",
725  "MTA##.SHP",
726  "MTFL##.SHP",
727  "MTFR##.SHP",
728  "MTL##.SHP",
729  "MTR##.SHP"
730  };
731 
732  for (int i = 50; i <= 247; ++i) {
733  if (i == 87)
734  continue;
735 
736  ShapeMap::iterator iter = _gameShapes.find(i);
737  if (iter != _gameShapes.end()) {
738  delete[] iter->_value;
739  iter->_value = 0;
740  }
741  }
742 
743  const char lowNum = (newShapes % 10) + '0';
744  const char highNum = (newShapes / 10) + '0';
745 
746  for (int i = 0; i < 6; ++i) {
747  char filename[16];
748  strcpy(filename, filenames[i]);
749  filename[numberOffset[i]+0] = highNum;
750  filename[numberOffset[i]+1] = lowNum;
751  _res->exists(filename, true);
753  for (int j = startShape[i]; j <= endShape[i]; ++j) {
754  if (j == 87)
755  continue;
756  addShapeToPool(_screenBuffer, j, j-startShape[i]);
757  }
758  }
759 
760  _characterShapeFile = newShapes;
762 }
763 
770 }
771 
772 #pragma mark -
773 
775  return _mainCharacter.walkspeed;
776 }
777 
780  int facing = _mainCharacter.facing;
781 
782  if (table) {
783  if (table[0] != table[-1] && table[1] == table[-1]) {
784  facing = getOppositeFacingDirection(table[-1]);
785  table[0] = table[-1];
786  }
787  }
788 
789  if (facing) {
790  if (facing == 7 || facing == 1) {
791  if (_characterAnimTable[0] > 2)
792  facing = 0;
794  } else if (facing == 4) {
795  ++_characterAnimTable[1];
796  } else if (facing == 5 || facing == 3) {
797  if (_characterAnimTable[1] > 2)
798  facing = 4;
800  }
801  } else {
802  ++_characterAnimTable[0];
803  }
804 
805  switch (facing) {
806  case 0:
809  break;
810 
811  case 1: case 2: case 3:
814  break;
815 
816  case 4:
819  break;
820 
821  case 5: case 6: case 7:
824  break;
825 
826  default:
827  break;
828  }
829 
831 }
832 
834  int layer = _screen->getLayer(_mainCharacter.x1, _mainCharacter.y1) - 1;
835  const uint8 *src = _costPalBuffer + _characterShapeFile * 72;
836  Palette &dst = _screen->getPalette(0);
837  const int8 *sceneDatPal = &_sceneDatPalette[layer * 3];
838 
839  if (layer != _lastCharPalLayer && unk1) {
840  for (int i = 144; i < 168; ++i) {
841  for (int j = 0; j < 3; ++j) {
842  uint8 col = dst[i * 3 + j];
843  int subCol = src[(i - 144) * 3 + j] + sceneDatPal[j];
844  subCol = CLIP(subCol, 0, 63);
845  subCol = (col - subCol) / 2;
846  dst[i * 3 + j] -= subCol;
847  }
848  }
849 
850  _charPalUpdate = true;
852  _lastCharPalLayer = layer;
853  } else if (_charPalUpdate || !unk1) {
854  dst.copy(_costPalBuffer, _characterShapeFile * 24, 24, 144);
855 
856  for (int i = 144; i < 168; ++i) {
857  for (int j = 0; j < 3; ++j) {
858  int col = dst[i * 3 + j] + sceneDatPal[j];
859  dst[i * 3 + j] = CLIP(col, 0, 63);
860  }
861  }
862 
864  _charPalUpdate = false;
865  }
866 }
867 
870  int width = (scale * 37) >> 8;
871  int height = (scale * 76) >> 8;
872 
873  int x1 = _mainCharacter.x1 - width/2;
874  int x2 = _mainCharacter.x1 + width/2;
875  int y1 = _mainCharacter.y1 - height;
876  int y2 = _mainCharacter.y1;
877 
878  if (x >= x1 && x <= x2 && y >= y1 && y <= y2)
879  return true;
880  return false;
881 }
882 
883 #pragma mark -
884 
886  // Initialize debugger since how it should be fully usable
887  static_cast<Debugger_v2 *>(getDebugger())->initialize();
888 
889  _eventList.clear();
890 
891  _runFlag = true;
892  while (_runFlag && !shouldQuit()) {
893  if (_deathHandler >= 0) {
894  removeHandItem();
895  delay(5);
896  _drawNoShapeFlag = 0;
897  _gui->optionsButton(0);
898  _deathHandler = -1;
899 
900  if (!_runFlag || shouldQuit())
901  break;
902  }
903 
904  if (_system->getMillis() >= _nextIdleAnim)
905  showIdleAnim();
906 
907  int inputFlag = checkInput(_mainButtonList, true);
908  removeInputTop();
909 
910  update();
911  _timer->update();
912 
913  if (inputFlag == 198 || inputFlag == 199) {
915  Common::Point mouse = getMousePos();
916  handleInput(mouse.x, mouse.y);
917  }
918 
919  _system->delayMillis(10);
920  }
921 }
922 
924  if (_inventoryState)
925  return;
927 
928  if (_unk5) {
929  _unk5 = 0;
930  return;
931  }
932 
933  if (!_screen->isMouseVisible())
934  return;
935 
936  if (_savedMouseState == -3) {
937  snd_playSoundEffect(0x0D, 0x80);
938  return;
939  }
940 
942 
943  int skip = 0;
944 
945  if (checkCharCollision(x, y) && _savedMouseState >= -1 && runSceneScript2()) {
946  return;
947  } else if (_itemInHand != 27 && pickUpItem(x, y, 1)) {
948  return;
949  } else if (checkItemCollision(x, y) == -1) {
950  resetGameFlag(1);
951  skip = runSceneScript1(x, y);
952 
953  if (queryGameFlag(1)) {
954  resetGameFlag(1);
955  return;
956  } else if (_unk5) {
957  _unk5 = 0;
958  return;
959  }
960  }
961 
962  if (_deathHandler >= 0)
963  skip = 1;
964 
965  if (skip)
966  return;
967 
968  if (checkCharCollision(x, y)) {
969  if (runSceneScript2())
970  return;
971  } else if (_itemInHand >= 0 && _savedMouseState >= 0) {
972  if (_itemInHand == 27) {
974  } else if (y <= 187) {
975  if (_itemInHand == 43)
976  removeHandItem();
977  else
978  dropItem(0, _itemInHand, x, y, 1);
979  }
980  return;
981  } else if (_savedMouseState == -3) {
982  return;
983  } else {
984  if (y > 187 && _savedMouseState > -4)
985  return;
986  if (_unk5) {
987  _unk5 = 0;
988  return;
989  }
990  }
991 
992  inputSceneChange(x, y, 1, 1);
993 }
994 
995 int KyraEngine_MR::inputSceneChange(int x, int y, int unk1, int unk2) {
996  uint16 curScene = _mainCharacter.sceneId;
997  _pathfinderFlag = 15;
998 
1000  if (_savedMouseState == -4) {
1001  if (_sceneList[curScene].exit4 != 0xFFFF) {
1002  x = 4;
1003  y = _sceneEnterY4;
1004  _pathfinderFlag = 7;
1005  }
1006  } else if (_savedMouseState == -6) {
1007  if (_sceneList[curScene].exit2 != 0xFFFF) {
1008  x = 316;
1009  y = _sceneEnterY2;
1010  _pathfinderFlag = 7;
1011  }
1012  } else if (_savedMouseState == -7) {
1013  if (_sceneList[curScene].exit1 != 0xFFFF) {
1014  x = _sceneEnterX1;
1015  y = _sceneEnterY1 - 2;
1016  _pathfinderFlag = 14;
1017  }
1018  } else if (_savedMouseState == -5) {
1019  if (_sceneList[curScene].exit3 != 0xFFFF) {
1020  x = _sceneEnterX3;
1021  y = 191;
1022  _pathfinderFlag = 11;
1023  }
1024  }
1025  }
1026 
1027  if (ABS(_mainCharacter.x1 - x) < 4 && ABS(_mainCharacter.y1 - y) < 2) {
1028  _pathfinderFlag = 0;
1029  return 0;
1030  }
1031 
1032  int x1 = _mainCharacter.x1 & (~3);
1033  int y1 = _mainCharacter.y1 & (~1);
1034  x &= ~3;
1035  y &= ~1;
1036 
1037  int size = findWay(x1, y1, x, y, _movFacingTable, 600);
1038  _pathfinderFlag = 0;
1039 
1040  if (!size || size == 0x7D00)
1041  return 0;
1042 
1043  return trySceneChange(_movFacingTable, unk1, unk2);
1044 }
1045 
1047  updateInput();
1048 
1050  updateMouse();
1054 
1055  _screen->updateScreen();
1056 }
1057 
1059  updateInput();
1060 
1061  updateMouse();
1065 
1066  restorePage3();
1067  drawAnimObjects();
1068  if (_chatTextEnabled && _chatText) {
1069  int curPage = _screen->_curPage;
1070  _screen->_curPage = 2;
1072  _screen->_curPage = curPage;
1073  }
1074  refreshAnimObjects(0);
1075 
1076  _screen->updateScreen();
1077 }
1078 
1080  int shape = 0, offsetX = 0, offsetY = 0;
1081  Common::Point mouse = getMousePos();
1082  bool hasItemCollision = checkItemCollision(mouse.x, mouse.y) != -1;
1083 
1084  if (mouse.y > 187) {
1085  bool setItemCursor = false;
1086  if (_mouseState == -6) {
1087  if (mouse.x < 311)
1088  setItemCursor = true;
1089  } else if (_mouseState == -5) {
1090  if (mouse.x < _sceneMinX || mouse.x > _sceneMaxX)
1091  setItemCursor = true;
1092  } else if (_mouseState == -4) {
1093  if (mouse.x > 8)
1094  setItemCursor = true;
1095  }
1096 
1097  if (setItemCursor) {
1099  return;
1100  }
1101  }
1102 
1103  if (_inventoryState) {
1104  if (mouse.y >= 144)
1105  return;
1106  hideInventory();
1107  }
1108 
1109  if (hasItemCollision && _mouseState < -1 && _itemInHand < 0) {
1112  _screen->setMouseCursor(0, 0, _gameShapes[0]);
1113  }
1114 
1115  int type = 0;
1116  if (mouse.y <= 199) {
1117  if (mouse.x <= 8) {
1118  if (_sceneExit4 != 0xFFFF) {
1119  type = -4;
1120  shape = 4;
1121  offsetX = 0;
1122  offsetY = 0;
1123  }
1124  } else if (mouse.x >= 311) {
1125  if (_sceneExit2 != 0xFFFF) {
1126  type = -6;
1127  shape = 2;
1128  offsetX = 13;
1129  offsetY = 8;
1130  }
1131  } else if (mouse.y >= 171) {
1132  if (_sceneExit3 != 0xFFFF) {
1133  if (mouse.x >= _sceneMinX && mouse.x <= _sceneMaxX) {
1134  type = -5;
1135  shape = 3;
1136  offsetX = 8;
1137  offsetY = 13;
1138  }
1139  }
1140  } else if (mouse.y <= 8) {
1141  if (_sceneExit1 != 0xFFFF) {
1142  type = -7;
1143  shape = 1;
1144  offsetX = 8;
1145  offsetY = 0;
1146  }
1147  }
1148  }
1149 
1150  for (int i = 0; i < _specialExitCount; ++i) {
1151  if (checkSpecialSceneExit(i, mouse.x, mouse.y)) {
1152  switch (_specialExitTable[20+i]) {
1153  case 0:
1154  type = -7;
1155  shape = 1;
1156  offsetX = 8;
1157  offsetY = 0;
1158  break;
1159 
1160  case 2:
1161  type = -6;
1162  shape = 2;
1163  offsetX = 13;
1164  offsetY = 8;
1165  break;
1166 
1167  case 4:
1168  type = -5;
1169  shape = 3;
1170  offsetX = 8;
1171  offsetY = 13;
1172  break;
1173 
1174  case 6:
1175  type = -4;
1176  shape = 4;
1177  offsetX = 0;
1178  offsetY = 8;
1179  break;
1180 
1181  default:
1182  break;
1183  }
1184  }
1185  }
1186 
1187  if (type != 0 && type != _mouseState && !hasItemCollision) {
1188  _mouseState = type;
1189  _screen->setMouseCursor(offsetX, offsetY, _gameShapes[shape]);
1190  } else if (type == 0 && _mouseState != _itemInHand && mouse.x > 8 && mouse.x < 311 && mouse.y < 171 && mouse.y > 8) {
1192  } else if (mouse.y > 187 && _mouseState > -4 && type == 0 && !_inventoryState) {
1193  showInventory();
1194  }
1195 }
1196 
1197 #pragma mark -
1198 
1200  if (_mainCharacter.x1 > _mouseX)
1201  _mainCharacter.facing = 5;
1202  else
1203  _mainCharacter.facing = 3;
1204  // _mainCharacter.facing can not be 0xFF here, so this is safe.
1208 }
1209 
1210 #pragma mark -
1211 
1213  int layer = _screen->getLayer(x, y) - 1;
1214  layer = _sceneDatLayerTable[layer];
1215  return MAX(0, MIN(layer, 6));
1216 }
1217 
1218 int KyraEngine_MR::getScale(int x, int y) {
1219  return _scaleTable[_screen->getLayer(x, y) - 1];
1220 }
1221 
1222 #pragma mark -
1223 
1226 }
1227 
1230 }
1231 
1232 #pragma mark -
1233 
1235  delete[] buffer;
1236  buffer = 0;
1237 
1238  uint32 size = 0;
1239  Common::String nBuf = file;
1240  nBuf += _languageExtension[_lang];
1241  buffer = _res->fileData(nBuf.c_str(), &size);
1242 
1243  return buffer ? size : 0;
1244 }
1245 
1247  uint16 tableEntries = READ_LE_UINT16(buffer);
1248  const uint16 *indexTable = (const uint16 *)(buffer + 2);
1249  const uint16 *offsetTable = indexTable + tableEntries;
1250 
1251  int num = 0;
1252  while (id != READ_LE_UINT16(indexTable)) {
1253  ++indexTable;
1254  ++num;
1255  }
1256 
1257  return buffer + READ_LE_UINT16(offsetTable + num);
1258 }
1259 
1261  stream->seek(0, SEEK_SET);
1262  uint16 tableEntries = stream->readUint16LE();
1263 
1264  int num = 0;
1265  while (id != stream->readUint16LE())
1266  ++num;
1267 
1268  stream->seek(2+tableEntries*2+num*2, SEEK_SET);
1269  stream->seek(stream->readUint16LE(), SEEK_SET);
1270  char c = 0;
1271  while ((c = stream->readByte()) != 0)
1272  *dst++ = c;
1273  *dst = 0;
1274 }
1275 
1276 #pragma mark -
1277 
1279  for (int i = 0; i < 88; ++i) {
1280  if (_talkObjectList[i].sceneId == _mainCharacter.sceneId)
1281  return true;
1282  }
1283 
1284  return false;
1285 }
1286 
1287 #pragma mark -
1288 
1289 bool KyraEngine_MR::updateScore(int scoreId, int strId) {
1290  int scoreIndex = (scoreId >> 3);
1291  int scoreBit = scoreId & 7;
1292  if ((_scoreFlagTable[scoreIndex] & (1 << scoreBit)) != 0)
1293  return false;
1294 
1296  _scoreFlagTable[scoreIndex] |= (1 << scoreBit);
1297 
1298  strcpy(_stringBuffer, (const char *)getTableEntry(_scoreFile, strId));
1299  strcat(_stringBuffer, ": ");
1300 
1301  assert(scoreId < _scoreTableSize);
1302 
1303  int count = _scoreTable[scoreId];
1304  if (count > 0)
1306 
1308  return true;
1309 }
1310 
1311 void KyraEngine_MR::scoreIncrease(int count, const char *str) {
1312  int drawOld = 1;
1313  _screen->hideMouse();
1314 
1315  showMessage(str, 0xFF, 0xF0);
1316  const int x = getScoreX(str);
1317 
1318  for (int i = 0; i < count; ++i) {
1319  int oldScore = _score;
1320  int newScore = ++_score;
1321 
1322  if (newScore > _scoreMax) {
1323  _score = _scoreMax;
1324  break;
1325  }
1326 
1327  drawScoreCounting(oldScore, newScore, drawOld, x);
1328  if (_inventoryState)
1329  drawScore(0, 215, 191);
1330  _screen->updateScreen();
1331  delay(20, true);
1332 
1333  snd_playSoundEffect(0x0E, 0xC8);
1334  drawOld = 0;
1335  }
1336 
1337  _screen->showMouse();
1338 }
1339 
1340 #pragma mark -
1341 
1342 void KyraEngine_MR::changeChapter(int newChapter, int sceneId, int malcolmShapes, int facing) {
1343  resetItemList();
1344 
1345  _currentChapter = newChapter;
1346  runStartupScript(newChapter, 0);
1348 
1349  _malcolmsMood = 1;
1351 
1352  if (malcolmShapes >= 0)
1353  loadCharacterShapes(malcolmShapes);
1354 
1355  enterNewScene(sceneId, facing, 0, 0, 0);
1356 }
1357 
1358 #pragma mark -
1359 
1361  if (!_configSkip)
1362  return false;
1363  return KyraEngine_v2::skipFlag();
1364 }
1365 
1366 void KyraEngine_MR::resetSkipFlag(bool removeEvent) {
1367  if (!_configSkip) {
1368  if (removeEvent)
1369  _eventList.clear();
1370  return;
1371  }
1372  KyraEngine_v2::resetSkipFlag(removeEvent);
1373 }
1374 
1375 #pragma mark -
1376 
1379 
1380  // Most settings already have sensible defaults. This one, however, is
1381  // specific to the Kyra engine.
1382  ConfMan.registerDefault("walkspeed", 5);
1383  ConfMan.registerDefault("studio_audience", true);
1384  ConfMan.registerDefault("skip_support", true);
1385  ConfMan.registerDefault("helium_mode", false);
1386  // 0 - best, 1 - mid, 2 - low
1387  ConfMan.registerDefault("video_quality", 0);
1388 }
1389 
1391  switch (_lang) {
1392  case 1:
1394  break;
1395 
1396  case 2:
1398  break;
1399 
1400  case 0:
1401  default:
1403  }
1404 
1407 
1408  ConfMan.set("language", Common::getLanguageCode(_flags.lang));
1409 
1410  ConfMan.setBool("studio_audience", _configStudio);
1411  ConfMan.setBool("skip_support", _configSkip);
1412  ConfMan.setBool("helium_mode", _configHelium);
1413 
1415 }
1416 
1419 
1420  _configStudio = ConfMan.getBool("studio_audience");
1421  _configSkip = ConfMan.getBool("skip_support");
1422  _configHelium = ConfMan.getBool("helium_mode");
1423  _configVQAQuality = CLIP(ConfMan.getInt("video_quality"), 0, 2);
1424 }
1425 
1426 } // End of namespace Kyra
Kyra::KyraEngine_MR::_mrEngineDesc
static const EngineDesc _mrEngineDesc
Definition: kyra_mr.h:67
Kyra::KyraEngine_v1::resetSkipFlag
virtual void resetSkipFlag(bool removeEvent=true)
Definition: kyra_v1.cpp:504
Kyra::KyraEngine_MR::restorePage3
void restorePage3() override
Definition: animator_mr.cpp:31
Kyra::KyraEngine_v2::_showOutro
bool _showOutro
Definition: kyra_v2.h:89
Kyra::KyraEngine_MR::loadButtonShapes
void loadButtonShapes()
Definition: gui_mr.cpp:36
Kyra::KyraEngine_v2::AnimObj::width
int16 width
Definition: kyra_v2.h:117
Kyra::KyraEngine_MR::_configSkip
bool _configSkip
Definition: kyra_mr.h:71
Kyra::KyraEngine_MR::_talkObjectList
TalkObject * _talkObjectList
Definition: kyra_mr.h:412
Kyra
This is the namespace of the Kyra engine.
Definition: chargen.cpp:37
Kyra::VQAMovie
Definition: vqa.h:143
Kyra::GameFlags::fanLang
Common::Language fanLang
Definition: kyra_v1.h:114
Kyra::KyraEngine_MR::_conversationState
int8 _conversationState[30][30]
Definition: kyra_mr.h:440
Kyra::KyraEngine_MR::KyraEngine_MR
KyraEngine_MR(OSystem *system, const GameFlags &flags)
Definition: kyra_mr.cpp:53
Kyra::SoundDigital_MR::stopSound
void stopSound(int channel)
Stop the playback of a sound in the given channel.
Definition: sound_digital_mr.cpp:209
Kyra::Screen::FID_BOOKFONT_FNT
Definition: screen.h:386
Kyra::KyraEngine_v2::SceneAnim::flags
uint16 flags
Definition: kyra_v2.h:200
Common::Array::end
iterator end()
Definition: array.h:256
Kyra::KyraEngine_MR::_charPalUpdate
bool _charPalUpdate
Definition: kyra_mr.h:392
Kyra::KyraEngine_v1::_mouseState
int _mouseState
Definition: kyra_v1.h:348
Kyra::KyraEngine_MR::_goodConscienceShown
bool _goodConscienceShown
Definition: kyra_mr.h:484
Kyra::KyraEngine_v1::_deathHandler
int8 _deathHandler
Definition: kyra_v1.h:316
Common::SeekableReadStream
Interface for a seekable & readable data stream.
Definition: stream.h:569
Kyra::KyraEngine_MR::fadeOutMusic
void fadeOutMusic(int ticks)
Definition: kyra_mr.cpp:432
Kyra::KyraEngine_MR::_mainMenuStrings
const char *const * _mainMenuStrings
Definition: kyra_mr.h:185
Kyra::KyraEngine_MR::getScale
int getScale(int x, int y) override
Definition: kyra_mr.cpp:1218
Kyra::KyraEngine_v2::SceneDesc
Definition: kyra_v2.h:165
Kyra::KyraEngine_MR::updateCharAnimFrame
void updateCharAnimFrame(int *table) override
Definition: kyra_mr.cpp:778
Kyra::EMCInterpreter::start
bool start(EMCState *script, int function)
Definition: script.cpp:155
MIN
T MIN(T a, T b)
Definition: util.h:49
Kyra::KyraEngine_MR::ShapeDesc::height
uint8 height
Definition: kyra_mr.h:326
Kyra::KyraEngine_MR::playVoice
void playVoice(int high, int low)
Definition: kyra_mr.cpp:450
Kyra::KyraEngine_v2::checkSpecialSceneExit
bool checkSpecialSceneExit(int num, int x, int y)
Definition: kyra_v2.cpp:166
Kyra::KyraEngine_MR::_commandLineY
int _commandLineY
Definition: kyra_mr.h:241
Kyra::KyraEngine_MR::_actorFile
uint8 * _actorFile
Definition: kyra_mr.h:273
Kyra::KyraEngine_MR::_menuDirectlyToLoad
bool _menuDirectlyToLoad
Definition: kyra_mr.h:98
Kyra::KyraEngine_MR::initMainButtonList
void initMainButtonList(bool disable)
Definition: staticres.cpp:1912
Glk::Level9::scale
int scale
Definition: level9_main.cpp:117
Kyra::KyraEngine_MR::_curStudioSFX
int _curStudioSFX
Definition: kyra_mr.h:138
Kyra::KyraEngine_MR::readSettings
void readSettings() override
Definition: kyra_mr.cpp:1417
Kyra::VQAMovie::close
void close()
Definition: vqa.cpp:611
Kyra::KyraEngine_MR::objectChatPrintText
void objectChatPrintText(const char *text, int object)
Definition: text_mr.cpp:279
Kyra::KyraEngine_v2::allocAnimObjects
void allocAnimObjects(int actors, int anims, int items)
Definition: animator_v2.cpp:28
Kyra::KyraEngine_v1::removeInputTop
void removeInputTop()
Definition: kyra_v1.cpp:491
Kyra::KyraEngine_MR::handleInput
void handleInput(int x, int y)
Definition: kyra_mr.cpp:923
Kyra::MainMenu::init
void init(StaticData data, Animation anim)
Definition: gui_v1.cpp:423
Kyra::EMCInterpreter::init
void init(EMCState *scriptState, const EMCData *data)
Definition: script.cpp:147
Kyra::KyraEngine_MR::stopMusicTrack
void stopMusicTrack()
Definition: kyra_mr.cpp:424
Kyra::KyraEngine_MR::_nextIdleAnim
uint32 _nextIdleAnim
Definition: kyra_mr.h:177
Audio::Mixer::kSpeechSoundType
Definition: mixer.h:60
Kyra::KyraEngine_MR::Album::rightPage
PageMovie rightPage
Definition: kyra_mr.h:549
Kyra::Screen::showMouse
void showMouse()
Definition: screen.cpp:2984
Kyra::KyraEngine_v2::_movFacingTable
int _movFacingTable[600]
Definition: kyra_v2.h:267
Kyra::Resource::unloadPakFile
void unloadPakFile(Common::String filename, bool remFromCache=false)
Definition: resource.cpp:257
Kyra::KyraEngine_v2::Character::animFrame
uint16 animFrame
Definition: kyra_v2.h:322
Kyra::GameFlags::replacedLang
Common::Language replacedLang
Definition: kyra_v1.h:115
Kyra::KyraEngine_MR::_scoreMax
int _scoreMax
Definition: kyra_mr.h:524
Kyra::KyraEngine_MR::_shapeDescs
static const ShapeDesc _shapeDescs[]
Definition: kyra_mr.h:329
kyra_mr.h
Kyra::EMCInterpreter::run
bool run(EMCState *script)
Definition: script.cpp:181
x
x
Definition: soft_render_surface.inl:123
Kyra::KyraEngine_MR::_newSceneDlgState
byte _newSceneDlgState[40]
Definition: kyra_mr.h:439
Common::Array::begin
iterator begin()
Definition: array.h:252
Common::EN_ANY
Definition: language.h:43
Kyra::KyraEngine_MR::loadCharacterShapes
void loadCharacterShapes(int newShapes) override
Definition: kyra_mr.cpp:719
gui_mr.h
Kyra::KyraEngine_MR::updateWithText
void updateWithText() override
Definition: kyra_mr.cpp:1058
Kyra::Resource::fileData
uint8 * fileData(const char *file, uint32 *size)
Definition: resource.cpp:293
vqa.h
Kyra::KyraEngine_v1::loadGameStateCheck
void loadGameStateCheck(int slot)
Definition: saveload.cpp:257
Kyra::KyraEngine_MR::_scoreTableSize
int _scoreTableSize
Definition: kyra_mr.h:527
Kyra::KyraEngine_MR::preinit
void preinit()
Definition: kyra_mr.cpp:489
Kyra::KyraEngine_v1::getOppositeFacingDirection
int getOppositeFacingDirection(int dir)
Definition: scene_v1.cpp:252
Kyra::Screen_v2::getRectSize
int getRectSize(int w, int h) override
Definition: screen_v2.cpp:270
Kyra::KyraEngine_MR::loadInterface
void loadInterface()
Definition: kyra_mr.cpp:642
Kyra::KyraEngine_MR::clearAnimObjects
void clearAnimObjects() override
Definition: animator_mr.cpp:35
Kyra::Screen::setAnimBlockPtr
void setAnimBlockPtr(int size)
Definition: screen.cpp:1285
Kyra::KyraEngine_v2::_chatScriptState
EMCState _chatScriptState
Definition: kyra_v2.h:353
Kyra::KyraEngine_MR::registerDefaultSettings
void registerDefaultSettings() override
Definition: kyra_mr.cpp:1377
wsamovie.h
Kyra::KyraEngine_v1::_configWalkspeed
uint8 _configWalkspeed
Definition: kyra_v1.h:299
Kyra::KyraEngine_v2::_mainCharX
int _mainCharX
Definition: kyra_v2.h:331
Kyra::KyraEngine_v2::_animObjects
AnimObj * _animObjects
Definition: kyra_v2.h:124
Kyra::KyraEngine_MR::_opcodesDialog
Common::Array< const Opcode * > _opcodesDialog
Definition: kyra_mr.h:466
Common::SeekableReadStream::seek
virtual bool seek(int32 offset, int whence=SEEK_SET)=0
Sets the stream position indicator for the stream.
Kyra::KyraEngine_MR::update
void update() override
Definition: kyra_mr.cpp:1046
Kyra::GameFlags
Definition: kyra_v1.h:110
Kyra::KyraEngine_v1::_emc
EMCInterpreter * _emc
Definition: kyra_v1.h:268
Kyra::KyraEngine_MR::_inventoryScrollSpeed
int _inventoryScrollSpeed
Definition: kyra_mr.h:245
Kyra::KyraEngine_MR::makeCharFacingMouse
void makeCharFacingMouse()
Definition: kyra_mr.cpp:1199
Engine::shouldQuit
static bool shouldQuit()
Return whether the ENGINE should quit respectively should return to the launcher.
Definition: engine.cpp:791
Kyra::KyraEngine_MR::refreshAnimObjects
void refreshAnimObjects(int force) override
Definition: animator_mr.cpp:142
Kyra::SoundDigital_MR
Digital audio output device.
Definition: sound_digital_mr.h:47
Kyra::KyraEngine_v2::_unkSceneScreenFlag1
bool _unkSceneScreenFlag1
Definition: kyra_v2.h:361
Engine::_system
OSystem * _system
Definition: engine.h:62
Kyra::KyraEngine_v2::_sceneListSize
int _sceneListSize
Definition: kyra_v2.h:175
int8
signed char int8
Definition: cdtypes.h:31
Kyra::KyraEngine_v2::_mainCharacter
Character _mainCharacter
Definition: kyra_v2.h:330
Engine::setDebugger
void setDebugger(GUI::Debugger *debugger)
Sets the engine's debugger.
Definition: engine.h:196
Kyra::KyraEngine_MR::_cCodeFile
uint8 * _cCodeFile
Definition: kyra_mr.h:269
Kyra::KyraEngine_MR::go
Common::Error go() override
Definition: kyra_mr.cpp:234
Kyra::KyraEngine_MR::updateItemAnimations
void updateItemAnimations()
Definition: animator_mr.cpp:185
Common::String
Simple string class for ScummVM.
Definition: str.h:49
Supernova::CLIP
Definition: msn_def.h:132
Common::Point::x
int16 x
The horizontal part of the point.
Definition: rect.h:38
Kyra::KyraEngine_v2::Character::sceneId
uint16 sceneId
Definition: kyra_v2.h:318
Kyra::KyraEngine_MR::_curDlgIndex
int _curDlgIndex
Definition: kyra_mr.h:447
Kyra::KyraEngine_MR::_enterNewSceneLock
int _enterNewSceneLock
Definition: kyra_mr.h:346
height
uint16 height
Definition: thumbnail.cpp:41
Kyra::KyraEngine_v2::_chatObject
int _chatObject
Definition: kyra_v2.h:347
READ_LE_UINT16
uint16 READ_LE_UINT16(const void *ptr)
Definition: endian.h:509
config-manager.h
Kyra::KyraEngine_v2::_runFlag
bool _runFlag
Definition: kyra_v2.h:88
DS::col
u8 col
Definition: main.cpp:93
Kyra::KyraEngine_v2::_specialExitCount
int _specialExitCount
Definition: kyra_v2.h:181
Kyra::KyraEngine_MR::_dlgBuffer
Common::SeekableReadStream * _dlgBuffer
Definition: kyra_mr.h:446
uint32
unsigned int uint32
Definition: cdtypes.h:26
Kyra::KyraEngine_v2::_pathfinderFlag
int _pathfinderFlag
Definition: kyra_v2.h:268
Kyra::KyraEngine_MR::updateScore
bool updateScore(int scoreId, int strId)
Definition: kyra_mr.cpp:1289
Kyra::KyraEngine_v2::Character::x1
int16 x1
Definition: kyra_v2.h:325
Kyra::KyraEngine_v2::_sceneList
SceneDesc * _sceneList
Definition: kyra_v2.h:174
Kyra::VQAMovie::open
bool open(const char *filename)
Definition: vqa.cpp:604
Common::Error
An Error instance pairs an error code with string description providing more details about the error.
Definition: error.h:77
Kyra::KyraEngine_v2::_overwriteSceneFacing
bool _overwriteSceneFacing
Definition: kyra_v2.h:185
Kyra::KyraEngine_v1::_configVoice
uint8 _configVoice
Definition: kyra_v1.h:303
Kyra::KyraEngine_MR::_noStartupChat
bool _noStartupChat
Definition: kyra_mr.h:358
Kyra::KyraEngine_v1::resetGameFlag
int resetGameFlag(int flag)
Definition: kyra_v1.cpp:527
Kyra::KyraEngine_MR::runSceneScript2
int runSceneScript2()
Definition: scene_mr.cpp:728
error
void NORETURN_PRE error(const char *s,...)
Definition: textconsole.cpp:67
Kyra::KyraEngine_MR::_itemBuffer1
int8 * _itemBuffer1
Definition: kyra_mr.h:281
Kyra::TimerManager::update
void update()
Definition: timer.cpp:109
Kyra::KyraEngine_MR::_goodConsciencePosition
bool _goodConsciencePosition
Definition: kyra_mr.h:486
Kyra::KyraEngine_v2::Character::height
uint8 height
Definition: kyra_v2.h:320
Kyra::KyraEngine_MR::_scoreTable
const uint8 * _scoreTable
Definition: kyra_mr.h:526
Kyra::MainMenu
Definition: gui_v1.h:146
Kyra::KyraEngine_MR::_gamePlayBuffer
uint8 * _gamePlayBuffer
Definition: kyra_mr.h:192
Kyra::KyraEngine_v1::_text
TextDisplayer * _text
Definition: kyra_v1.h:265
Kyra::MainMenu::Animation::anim
Movie * anim
Definition: gui_v1.h:154
Kyra::KyraEngine_MR::_screen
Screen_MR * _screen
Definition: kyra_mr.h:82
Kyra::KyraEngine_MR::drawScore
void drawScore(int page, int x, int y)
Definition: gui_mr.cpp:366
Kyra::Screen::loadPalette
virtual bool loadPalette(const char *filename, Palette &pal)
Definition: screen.cpp:3263
Kyra::KyraEngine_v1::_opcodes
Common::Array< const Opcode * > _opcodes
Definition: kyra_v1.h:328
Kyra::KyraEngine_MR::_soundList
const char *const * _soundList
Definition: kyra_mr.h:116
Kyra::KyraEngine_v2::_animList
AnimObj * _animList
Definition: kyra_v2.h:131
Kyra::KyraEngine_v2::_itemInHand
int _itemInHand
Definition: kyra_v2.h:299
Glk::AGT::buffer
static uchar * buffer
Definition: util.cpp:518
Kyra::KyraEngine_MR::changeChapter
void changeChapter(int newChapter, int sceneId, int malcolmShapes, int facing)
Definition: kyra_mr.cpp:1342
Kyra::MainMenu::StaticData
Definition: gui_v1.h:160
Kyra::KyraEngine_MR::_mainButtonList
Button * _mainButtonList
Definition: kyra_mr.h:145
Kyra::KyraEngine_v2::_gameShapes
ShapeMap _gameShapes
Definition: kyra_v2.h:256
Kyra::KyraEngine_v1::readSettings
virtual void readSettings()
Definition: kyra_v1.cpp:567
width
uint16 width
Definition: thumbnail.cpp:41
Kyra::KyraEngine_MR::_scenesFile
uint8 * _scenesFile
Definition: kyra_mr.h:270
Kyra::Palette::copy
void copy(const Palette &source, int firstCol=0, int numCols=-1, int dstStart=-1)
Copy data from another palette.
Definition: screen.cpp:3887
Kyra::KyraEngine_MR::_maskPageMaxY
int _maskPageMaxY
Definition: kyra_mr.h:363
Kyra::Screen::clearPage
void clearPage(int pageNum)
Definition: screen.cpp:557
Kyra::KyraEngine_MR::_sceneMinX
int _sceneMinX
Definition: kyra_mr.h:362
Kyra::KyraEngine_MR::_characterAnimTable
int8 _characterAnimTable[2]
Definition: kyra_mr.h:387
Kyra::KyraEngine_v2::_chatScriptData
EMCData _chatScriptData
Definition: kyra_v2.h:352
Kyra::KyraEngine_v1::_lastMusicCommand
int16 _lastMusicCommand
Definition: kyra_v1.h:361
Kyra::KyraEngine_MR::_optionsFile
uint8 * _optionsFile
Definition: kyra_mr.h:272
Kyra::KyraEngine_MR::dropItem
bool dropItem(int unk1, Item item, int x, int y, int unk2)
Definition: items_mr.cpp:102
Kyra::KyraEngine_MR::_menuAudioFile
const char * _menuAudioFile
Definition: kyra_mr.h:114
Kyra::KyraEngine_MR::getDrawLayer
int getDrawLayer(int x, int y)
Definition: kyra_mr.cpp:1212
Kyra::KyraEngine_MR::_configHelium
bool _configHelium
Definition: kyra_mr.h:72
Kyra::KyraEngine_v1::_flags
GameFlags _flags
Definition: kyra_v1.h:324
Kyra::KyraEngine_v1::queryGameFlag
int queryGameFlag(int flag) const
Definition: kyra_v1.cpp:522
Kyra::KyraEngine_v1::_res
Resource * _res
Definition: kyra_v1.h:263
Kyra::KyraEngine_v1::registerDefaultSettings
virtual void registerDefaultSettings()
Definition: kyra_v1.cpp:554
Kyra::KyraEngine_v1::getMousePos
Common::Point getMousePos()
Definition: kyra_v1.cpp:214
Kyra::KyraEngine_MR::Album::PageMovie::wsa
WSAMovie_v2 * wsa
Definition: kyra_mr.h:543
Kyra::KyraEngine_v1::init
virtual Common::Error init()
Definition: kyra_v1.cpp:93
Common::ReadStream::readByte
byte readByte()
Read an unsigned byte from the stream and return it.
Definition: stream.h:318
Kyra::KyraEngine_v2::_unk5
int _unk5
Definition: kyra_v2.h:360
Kyra::KyraEngine_MR::resetSkipFlag
void resetSkipFlag(bool removeEvent=true) override
Definition: kyra_mr.cpp:1366
Kyra::KyraEngine_MR::_charBackUpWidth
int _charBackUpWidth
Definition: kyra_mr.h:214
Kyra::KyraEngine_MR::_interface
uint8 * _interface
Definition: kyra_mr.h:227
Kyra::MainMenu::Animation::startFrame
int startFrame
Definition: gui_v1.h:155
Common::IT_ITA
Definition: language.h:53
Kyra::KyraEngine_MR::drawScoreCounting
void drawScoreCounting(int oldScore, int newScore, int drawOld, const int x)
Definition: gui_mr.cpp:383
uint8
unsigned char uint8
Definition: cdtypes.h:28
Kyra::Screen::FID_8_FNT
Definition: screen.h:382
Kyra::KyraEngine_v2::AnimObj::height
int16 height
Definition: kyra_v2.h:117
Kyra::KyraEngine_MR::loadShadowShape
void loadShadowShape()
Definition: kyra_mr.cpp:623
Kyra::KyraEngine_MR::initStaticResource
void initStaticResource()
Definition: staticres.cpp:1016
Kyra::MainMenu::StaticData::strings
const char * strings[5]
Definition: gui_v1.h:161
Kyra::KyraEngine_MR::_soundDigital
SoundDigital_MR * _soundDigital
Definition: kyra_mr.h:83
Kyra::KyraEngine_MR::_sceneStrings
uint8 * _sceneStrings
Definition: kyra_mr.h:275
Kyra::KyraEngine_v2::updateSpecialSceneScripts
void updateSpecialSceneScripts()
Definition: scene_v2.cpp:39
Kyra::KyraEngine_MR::talkObjectsInCurScene
bool talkObjectsInCurScene()
Definition: kyra_mr.cpp:1278
warning
void warning(const char *s,...)
Print a warning message to the text console (stderr).
Definition: textconsole.cpp:49
Kyra::KyraEngine_v1::skipFlag
virtual bool skipFlag() const
Definition: kyra_v1.cpp:496
Kyra::KyraEngine_v2::delay
void delay(uint32 time, bool update=false, bool isMainLoop=false) override
Definition: kyra_v2.cpp:149
Kyra::KyraEngine_v2::_sceneEnterX1
int _sceneEnterX1
Definition: kyra_v2.h:179
debugger.h
Kyra::KyraEngine_MR::initMainMenu
void initMainMenu()
Definition: kyra_mr.cpp:326
Kyra::KyraEngine_v2::_savedMouseState
int _savedMouseState
Definition: kyra_v2.h:300
state
u8 state
Definition: ps2kbd.h:101
Kyra::Screen::loadFont
virtual bool loadFont(FontId fontId, const char *filename)
Definition: screen.cpp:1315
Kyra::KyraEngine_MR::~KyraEngine_MR
~KyraEngine_MR() override
Definition: kyra_mr.cpp:150
Kyra::Screen::getCPagePtr
const uint8 * getCPagePtr(int pageNum) const
Definition: screen.cpp:545
Kyra::KyraEngine_MR::_badConscienceShown
bool _badConscienceShown
Definition: kyra_mr.h:475
Kyra::KyraEngine_MR::_gui
GUI_MR * _gui
Definition: kyra_mr.h:142
Kyra::KyraEngine_MR::updateMalcolmShapes
void updateMalcolmShapes()
Definition: kyra_mr.cpp:764
Kyra::Screen::setFont
FontId setFont(FontId fontId)
Definition: screen.cpp:1342
Kyra::KyraEngine_MR::_album
struct Kyra::KyraEngine_MR::Album _album
Graphics::Surface
An arbitrary graphics surface, which can be the target (or source) of blit operations,...
Definition: surface.h:42
Kyra::KyraEngine_v1::delayUntil
virtual void delayUntil(uint32 timestamp, bool updateGameTimers=false, bool update=false, bool isMainLoop=false)
Definition: kyra_v1.cpp:533
Kyra::MainMenu::Animation::delay
int delay
Definition: gui_v1.h:157
Kyra::KyraEngine_v2::_sceneEnterY1
int _sceneEnterY1
Definition: kyra_v2.h:179
Kyra::KyraEngine_v1::writeSettings
virtual void writeSettings()
Definition: kyra_v1.cpp:597
Kyra::KyraEngine_MR::_lastCharPalLayer
int _lastCharPalLayer
Definition: kyra_mr.h:391
Kyra::KyraEngine_MR::_musicSoundChannel
int _musicSoundChannel
Definition: kyra_mr.h:112
Ultima::Std::memset
void memset(void *data, byte val, size_t count)
Definition: misc.cpp:29
Kyra::KyraEngine_v2::initItemList
void initItemList(int size)
Definition: items_v2.cpp:28
Kyra::KyraEngine_MR::updateCharacterAnim
void updateCharacterAnim(int charId) override
Definition: animator_mr.cpp:233
Neverhood::x1
int16 x1
Definition: module1400_sprites.cpp:667
Kyra::KyraEngine_v2::_sceneExit3
uint16 _sceneExit3
Definition: kyra_v2.h:178
Kyra::KyraEngine_MR::showIdleAnim
void showIdleAnim()
Definition: animator_mr.cpp:432
Kyra::KyraEngine_v1::checkInput
int checkInput(Button *buttonList, bool mainLoop=false, int eventFlag=0x8000)
Definition: kyra_v1.cpp:246
Kyra::KyraEngine_v2::_sceneAnims
SceneAnim _sceneAnims[16]
Definition: kyra_v2.h:210
Kyra::Resource::loadPakFile
bool loadPakFile(Common::String filename)
Definition: resource.cpp:165
Kyra::KyraEngine_MR::_characterFrameTable
static const uint8 _characterFrameTable[]
Definition: kyra_mr.h:388
Kyra::KyraEngine_v1::saveFileLoadable
bool saveFileLoadable(int slot)
Definition: saveload.cpp:242
Kyra::KyraEngine_v2::Debugger_v2
friend class Debugger_v2
Definition: kyra_v2.h:55
Kyra::Screen::fadeToBlack
void fadeToBlack(int delay=0x54, const UpdateFunctor *upFunc=0)
Definition: screen.cpp:758
Kyra::KyraEngine_MR::_wasPlayingVQA
bool _wasPlayingVQA
Definition: kyra_mr.h:658
Engine::quitGame
static void quitGame()
Request the engine to quit.
Definition: engine.cpp:784
Kyra::KyraEngine_MR::_scoreFile
uint8 * _scoreFile
Definition: kyra_mr.h:268
OSystem::delayMillis
virtual void delayMillis(uint msecs)=0
Delay/sleep for the specified amount of milliseconds.
Kyra::KyraEngine_MR::_voiceSoundChannel
int _voiceSoundChannel
Definition: kyra_mr.h:131
Kyra::KyraEngine_MR::showMessage
void showMessage(const char *string, uint8 c0, uint8 c1)
Definition: gui_mr.cpp:105
Kyra::KyraEngine_MR::checkCharCollision
bool checkCharCollision(int x, int y)
Definition: kyra_mr.cpp:868
Kyra::GameFlags::lang
Common::Language lang
Definition: kyra_v1.h:111
Engine::_mixer
Audio::Mixer * _mixer
Definition: engine.h:63
Kyra::KyraEngine_v2::_sceneExit1
uint16 _sceneExit1
Definition: kyra_v2.h:178
Kyra::Palette::fill
void fill(int firstCol, int numCols, uint8 value)
Fill the given indexes with the given component value.
Definition: screen.cpp:3881
Kyra::KyraEngine_MR::init
Common::Error init() override
Definition: kyra_mr.cpp:203
Kyra::KyraEngine_v1::_timer
TimerManager * _timer
Definition: kyra_v1.h:267
Kyra::KyraEngine_MR::_maskPageMinY
int _maskPageMinY
Definition: kyra_mr.h:363
OSystem::getMillis
virtual uint32 getMillis(bool skipRecord=false)=0
Get the number of milliseconds since the program was started.
Kyra::MainMenu::handle
int handle(int dim)
Definition: gui_v1.cpp:476
Kyra::Resource::loadFileToBuf
bool loadFileToBuf(const char *file, void *buf, uint32 maxSize)
Definition: resource.cpp:326
Kyra::KyraEngine_MR::snd_voiceIsPlaying
bool snd_voiceIsPlaying() override
Definition: kyra_mr.cpp:461
Kyra::KyraEngine_MR::_dialogSceneAnim
int _dialogSceneAnim
Definition: kyra_mr.h:457
Kyra::Screen::setScreenDim
void setScreenDim(int dim)
Definition: screen.cpp:506
Kyra::KyraEngine_MR::startup
void startup()
Definition: kyra_mr.cpp:506
Kyra::KyraEngine_MR::_invWsa
WSAMovie_v2 * _invWsa
Definition: kyra_mr.h:264
Kyra::KyraEngine_MR::runLoop
void runLoop()
Definition: kyra_mr.cpp:885
OPL::DOSBox::DBOPL::volume
Bitu volume
Definition: dbopl.h:66
Kyra::Palette
A class that manages KYRA palettes.
Definition: screen.h:231
Kyra::WSAMovie_v2::open
int open(const char *filename, int unk1, Palette *palette) override
Definition: wsamovie.cpp:364
Kyra::GUI_MR::optionsButton
int optionsButton(Button *button)
Definition: gui_mr.cpp:1141
Kyra::Screen::setResolution
virtual void setResolution()
Definition: screen.cpp:273
Kyra::KyraEngine_MR::getCharacterWalkspeed
int getCharacterWalkspeed() const override
Definition: kyra_mr.cpp:774
MAX
T MAX(T a, T b)
Definition: util.h:50
Kyra::KyraEngine_v2::removeHandItem
void removeHandItem() override
Definition: items_v2.cpp:93
Kyra::KyraEngine_MR::_mainMenuSpanishFan
static const char *const _mainMenuSpanishFan[]
Definition: kyra_mr.h:188
Kyra::KyraEngine_MR::_nextIdleType
bool _nextIdleType
Definition: kyra_mr.h:219
Common::String::format
static String format(const char *fmt,...) GCC_PRINTF(1
Print formatted data into a String object.
Definition: str.cpp:641
Kyra::EMCInterpreter::isValid
bool isValid(EMCState *script)
Definition: script.cpp:175
Kyra::KyraEngine_MR::_dialogSceneScript
int _dialogSceneScript
Definition: kyra_mr.h:458
Kyra::KyraEngine_v1::speechEnabled
bool speechEnabled()
Definition: kyra_v1.cpp:633
Neverhood::x2
int16 x2
Definition: module1400_sprites.cpp:667
Kyra::KyraEngine_MR::writeSettings
void writeSettings() override
Definition: kyra_mr.cpp:1390
Kyra::KyraEngine_MR::_text
TextDisplayer_MR * _text
Definition: kyra_mr.h:657
Kyra::KyraEngine_v2::addShapeToPool
void addShapeToPool(const uint8 *data, int realIndex, int shape)
Definition: kyra_v2.cpp:173
Kyra::KyraEngine_MR::_noScriptEnter
bool _noScriptEnter
Definition: kyra_mr.h:342
Kyra::KyraEngine_MR::TextDisplayer_MR
friend class TextDisplayer_MR
Definition: kyra_mr.h:44
Kyra::VQAMovie::play
void play()
Definition: vqa.cpp:617
Kyra::Screen_v2::makeShapeCopy
uint8 * makeShapeCopy(const uint8 *src, int index)
Definition: screen_v2.cpp:235
Kyra::KyraEngine_MR::_sceneDatLayerTable
int8 _sceneDatLayerTable[15]
Definition: kyra_mr.h:369
Kyra::KyraEngine_MR::_dialogScriptFuncStart
int _dialogScriptFuncStart
Definition: kyra_mr.h:459
Kyra::KyraEngine_MR::_mainButtonData
Button * _mainButtonData
Definition: kyra_mr.h:144
Kyra::KyraEngine_MR::Album::leftPage
PageMovie leftPage
Definition: kyra_mr.h:549
Kyra::KyraEngine_MR::_languageExtension
static const char *const _languageExtension[]
Definition: kyra_mr.h:662
Kyra::Screen_MR
Definition: screen_mr.h:32
ABS
T ABS(T x)
Definition: util.h:48
Kyra::KyraEngine_MR::loadInterfaceShapes
void loadInterfaceShapes()
Definition: kyra_mr.cpp:636
Kyra::KyraEngine_MR::Album::wsa
WSAMovie_v2 * wsa
Definition: kyra_mr.h:539
Common::Array::clear
void clear()
Definition: array.h:217
Kyra::KyraEngine_MR::loadExtrasShapes
void loadExtrasShapes()
Definition: kyra_mr.cpp:628
Kyra::KyraEngine_MR::hideInventory
void hideInventory()
Definition: gui_mr.cpp:240
Kyra::KyraEngine_MR::playStudioSFX
void playStudioSFX(const char *str)
Definition: kyra_mr.cpp:470
Kyra::Screen::setScreenPalette
virtual void setScreenPalette(const Palette &pal)
Definition: screen.cpp:891
Kyra::KyraEngine_MR::_configStudio
bool _configStudio
Definition: kyra_mr.h:70
uint
unsigned int uint
Definition: scummsys.h:440
Glk::Alan2::low
static CodeValue low
Definition: decode.cpp:56
Kyra::KyraEngine_MR::updateCommandLine
void updateCommandLine()
Definition: gui_mr.cpp:143
Kyra::KyraEngine_v2::Character::facing
uint8 facing
Definition: kyra_v2.h:321
text_mr.h
Kyra::KyraEngine_MR::_sfxFileList
const char *const * _sfxFileList
Definition: kyra_mr.h:128
Kyra::Screen::copyBlockToPage
void copyBlockToPage(int pageNum, int x, int y, int w, int h, const uint8 *src)
Definition: screen.cpp:1058
Kyra::KyraEngine_MR::_cnvFile
Common::SeekableReadStream * _cnvFile
Definition: kyra_mr.h:445
Kyra::KyraEngine_MR::_fadeOutMusicChannel
int _fadeOutMusicChannel
Definition: kyra_mr.h:113
Ultima::Std::memcpy
void * memcpy(void *destination, const void *source, size_t num)
Definition: misc.cpp:37
Kyra::KyraEngine_MR::setItemMouseCursor
void setItemMouseCursor()
Definition: items_mr.cpp:94
Kyra::KyraEngine_MR::_dialogScriptFuncEnd
int _dialogScriptFuncEnd
Definition: kyra_mr.h:459
Kyra::KyraEngine_MR::_isStartupDialog
bool _isStartupDialog
Definition: kyra_mr.h:452
Kyra::KyraEngine_MR::_shapeDescsSize
static const int _shapeDescsSize
Definition: kyra_mr.h:330
Kyra::KyraEngine_v1::updateInput
void updateInput()
Definition: kyra_v1.cpp:446
Kyra::EMCState
Definition: script.h:47
Kyra::SoundDigital_MR::playSound
int playSound(const char *filename, uint8 priority, Audio::Mixer::SoundType type, int volume=255, bool loop=false, int channel=-1)
Plays a sound.
Definition: sound_digital_mr.cpp:115
Common::Point
Simple class for handling both 2D position and size.
Definition: rect.h:37
Kyra::MainMenu::Animation
Definition: gui_v1.h:151
Kyra::KyraEngine_MR::scoreIncrease
void scoreIncrease(int count, const char *str)
Definition: kyra_mr.cpp:1311
Kyra::KyraEngine_MR::backUpGfxRect32x32
void backUpGfxRect32x32(int x, int y)
Definition: kyra_mr.cpp:1224
Kyra::KyraEngine_MR::_nextAnimItem
int _nextAnimItem
Definition: kyra_mr.h:224
Kyra::KyraEngine_v2::_chatTextEnabled
bool _chatTextEnabled
Definition: kyra_v2.h:350
Kyra::KyraEngine_MR::_curDlgLang
int _curDlgLang
Definition: kyra_mr.h:447
Kyra::KyraEngine_MR::snd_playSoundEffect
void snd_playSoundEffect(int item, int volume) override
Definition: kyra_mr.cpp:440
Kyra::KyraEngine_MR::_menu
MainMenu * _menu
Definition: kyra_mr.h:164
size
u32 size
Definition: cdaudio.cpp:39
Audio::Mixer::kSFXSoundType
Definition: mixer.h:59
Kyra::KyraEngine_MR::_sfxFileListSize
int _sfxFileListSize
Definition: kyra_mr.h:129
Kyra::KyraEngine_MR::_invWsaFrame
int _invWsaFrame
Definition: kyra_mr.h:265
Kyra::KyraEngine_MR::_curDlgChapter
int _curDlgChapter
Definition: kyra_mr.h:447
Kyra::kItemNone
Constant for invalid item.
Definition: item.h:36
Kyra::KyraEngine_MR::skipFlag
bool skipFlag() const override
Definition: kyra_mr.cpp:1360
priority
static const struct @143 priority[]
Kyra::KyraEngine_MR::_itemFile
uint8 * _itemFile
Definition: kyra_mr.h:271
Kyra::KyraEngine_MR::enterNewScene
void enterNewScene(uint16 scene, int facing, int unk1, int unk2, int unk3) override
Definition: scene_mr.cpp:32
Kyra::KyraEngine_MR::ShapeDesc::yOffset
int8 yOffset
Definition: kyra_mr.h:327
Kyra::EMCInterpreter::load
bool load(const char *filename, EMCData *data, const Common::Array< const Opcode * > *opcodes)
Definition: script.cpp:98
Kyra::KyraEngine_MR::runStartupScript
void runStartupScript(int script, int unk1)
Definition: kyra_mr.cpp:672
Kyra::KyraEngine_MR::_enableInventory
bool _enableInventory
Definition: kyra_mr.h:149
Kyra::KyraEngine_MR::playMenuAudioFile
void playMenuAudioFile()
Definition: kyra_mr.cpp:397
Kyra::KyraEngine_MR::_itemBuffer2
int8 * _itemBuffer2
Definition: kyra_mr.h:282
Kyra::SoundDigital_MR::isPlaying
bool isPlaying(int channel)
Checks if a given channel is playing a sound.
Definition: sound_digital_mr.cpp:197
flags
u16 flags
Definition: zipreader.h:215
type
uint32 type
Definition: mididrv.cpp:83
Kyra::KyraEngine_MR::playVQA
void playVQA(const char *name)
Definition: kyra_mr.cpp:363
Kyra::KyraEngine_v2::_drawNoShapeFlag
bool _drawNoShapeFlag
Definition: kyra_v2.h:130
Kyra::KyraEngine_MR::showInventory
void showInventory()
Definition: gui_mr.cpp:162
Kyra::KyraEngine_v2::Character::y1
int16 y1
Definition: kyra_v2.h:325
Kyra::KyraEngine_MR::_currentChapter
int _currentChapter
Definition: kyra_mr.h:508
Common::List::clear
void clear()
Definition: list.h:193
Kyra::KyraEngine_MR::_interfaceCommandLine
uint8 * _interfaceCommandLine
Definition: kyra_mr.h:228
Kyra::KyraEngine_MR::_currentTalkFile
int _currentTalkFile
Definition: kyra_mr.h:338
Kyra::KyraEngine_MR::_sceneDatPalette
int8 _sceneDatPalette[45]
Definition: kyra_mr.h:368
Kyra::KyraEngine_v2::_sceneEnterX3
int _sceneEnterX3
Definition: kyra_v2.h:179
Glk::AGT::script
void script(uchar onp)
Definition: interface.cpp:962
Kyra::KyraEngine_MR::GUI_MR
friend class GUI_MR
Definition: kyra_mr.h:45
Kyra::KyraEngine_v2::_unk4
int _unk4
Definition: kyra_v2.h:360
Kyra::KyraEngine_MR::_malcolmShapeXOffset
int _malcolmShapeXOffset
Definition: kyra_mr.h:323
Kyra::Screen::isMouseVisible
bool isMouseVisible() const
Definition: screen.cpp:2998
Kyra::SoundDigital_MR::beginFadeOut
void beginFadeOut(int channel, int ticks)
Makes the sound in a given channel fading out.
Definition: sound_digital_mr.cpp:225
Kyra::Screen::updateScreen
void updateScreen()
Definition: screen.cpp:339
Kyra::KyraEngine_v2::_chatText
const char * _chatText
Definition: kyra_v2.h:346
Kyra::KyraEngine_MR::_configVQAQuality
int _configVQAQuality
Definition: kyra_mr.h:73
Kyra::KyraEngine_v2::_sceneEnterY2
int _sceneEnterY2
Definition: kyra_v2.h:179
Kyra::KyraEngine_MR::_dialogScriptData
EMCData _dialogScriptData
Definition: kyra_mr.h:455
Kyra::KyraEngine_MR::setNextIdleAnimTimer
void setNextIdleAnimTimer()
Definition: timer_mr.cpp:97
Kyra::KyraEngine_MR::_malcolmShapeYOffset
int _malcolmShapeYOffset
Definition: kyra_mr.h:323
Kyra::KyraEngine_v2::findWay
int findWay(int curX, int curY, int dstX, int dstY, int *moveTable, int moveTableSize) override
Definition: scene_v2.cpp:83
Kyra::KyraEngine_MR::_dialogScriptState
EMCState _dialogScriptState
Definition: kyra_mr.h:456
Kyra::KyraEngine_MR::_charBackUpHeight2
int _charBackUpHeight2
Definition: kyra_mr.h:213
Kyra::KyraEngine_MR::saveGameStateIntern
Common::Error saveGameStateIntern(int slot, const char *saveName, const Graphics::Surface *thumbnail) override
Definition: saveload_mr.cpp:33
Kyra::KyraEngine_MR::_albumChatActive
bool _albumChatActive
Definition: kyra_mr.h:432
Common::Point::y
int16 y
The vertical part of the point.
Definition: rect.h:39
Kyra::KyraEngine_MR::snd_playVoiceFile
void snd_playVoiceFile(int file) override
Definition: kyra_mr.cpp:454
Common::FR_FRA
Definition: language.h:48
Common::ReadStream::readUint16LE
uint16 readUint16LE()
Read an unsigned 16-bit word stored in little endian (LSB first) order from the stream and return it.
Definition: stream.h:341
Kyra::KyraEngine_MR::_sceneShapes
uint8 * _sceneShapes[20]
Definition: kyra_mr.h:333
Kyra::KyraEngine_MR::_loadingState
bool _loadingState
Definition: kyra_mr.h:205
Kyra::KyraEngine_v2::Character::dlgIndex
int16 dlgIndex
Definition: kyra_v2.h:319
system.h
Kyra::KyraEngine_v2::_sceneExit4
uint16 _sceneExit4
Definition: kyra_v2.h:178
Kyra::KyraEngine_v2::Character::walkspeed
byte walkspeed
Definition: kyra_v2.h:323
y
y
Definition: soft_render_surface.inl:124
Kyra::KyraEngine_MR::initMouseShapes
void initMouseShapes()
Definition: kyra_mr.cpp:498
Kyra::KyraEngine_v2::_characterShapeFile
int _characterShapeFile
Definition: kyra_v2.h:263
Kyra::KyraEngine_MR::restoreGfxRect32x32
void restoreGfxRect32x32(int x, int y)
Definition: kyra_mr.cpp:1228
Kyra::KyraEngine_MR::_activeItemAnim
ActiveItemAnim _activeItemAnim[10]
Definition: kyra_mr.h:223
Kyra::KyraEngine_v1::_tickLength
uint16 _tickLength
Definition: kyra_v1.h:312
Kyra::KyraEngine_MR::_goodConscienceAnim
int _goodConscienceAnim
Definition: kyra_mr.h:485
Kyra::Screen::_curPage
int _curPage
Definition: screen.h:539
Kyra::KyraEngine_MR::loadLanguageFile
int loadLanguageFile(const char *file, uint8 *&buffer)
Definition: kyra_mr.cpp:1234
Kyra::KyraEngine_v1::_rnd
Common::RandomSource _rnd
Definition: kyra_v1.h:205
Ultima::Std::strlen
size_t strlen(const char *str)
Definition: misc.cpp:45
Kyra::KyraEngine_v2::_specialExitTable
uint16 _specialExitTable[25]
Definition: kyra_v2.h:182
Kyra::KyraEngine_v2::refreshAnimObjectsIfNeed
void refreshAnimObjectsIfNeed()
Definition: animator_v2.cpp:115
count
u32 count
Definition: disc_io.c:107
Kyra::KyraEngine_MR::snd_playWanderScoreViaMap
void snd_playWanderScoreViaMap(int track, int force) override
Definition: kyra_mr.cpp:404
Engine::getDebugger
virtual GUI::Debugger * getDebugger()
Return the engine's debugger instance, if any.
Definition: engine.h:190
Common::getLanguageCode
const char * getLanguageCode(Language id)
Definition: language.cpp:91
Kyra::KyraEngine_MR::_paletteOverlay
uint8 * _paletteOverlay
Definition: kyra_mr.h:505
OSystem
Interface for ScummVM backends.
Definition: system.h:114
Kyra::KyraEngine_v2::_sceneExit2
uint16 _sceneExit2
Definition: kyra_v2.h:178
Common::kNoError
No error occurred.
Definition: error.h:45
Kyra::KyraEngine_v1::_eventList
Common::List< Event > _eventList
Definition: kyra_v1.h:288
Kyra::KyraEngine_MR::trySceneChange
int trySceneChange(int *moveTable, int unk1, int unk2) override
Definition: scene_mr.cpp:599
Kyra::KyraEngine_MR::_mainButtonListInitialized
bool _mainButtonListInitialized
Definition: kyra_mr.h:146
Kyra::KyraEngine_MR::snd_stopVoice
void snd_stopVoice() override
Definition: kyra_mr.cpp:465
Kyra::KyraEngine_v2::_sceneAnimMovie
WSAMovie_v2 * _sceneAnimMovie[16]
Definition: kyra_v2.h:211
Kyra::KyraEngine_MR::ShapeDesc::width
uint8 width
Definition: kyra_mr.h:326
Kyra::KyraEngine_MR::_sceneShapeDescs
SceneShapeDesc _sceneShapeDescs[20]
Definition: kyra_mr.h:377
Kyra::MainMenu::Animation::endFrame
int endFrame
Definition: gui_v1.h:156
Common::DE_DEU
Definition: language.h:49
Kyra::KyraEngine_MR::TalkObject
Definition: kyra_mr.h:403
Kyra::EMCInterpreter::unload
void unload(EMCData *data)
Definition: script.cpp:135
Kyra::Screen::copyPalette
void copyPalette(const int dst, const int src)
Definition: screen.cpp:3062
Kyra::KyraEngine_MR::_mainMenuItalianFan
static const char *const _mainMenuItalianFan[]
Definition: kyra_mr.h:189
Kyra::KyraEngine_MR::_useActorBuffer
bool _useActorBuffer
Definition: kyra_mr.h:506
Kyra::Screen::getPalette
Palette & getPalette(int num)
Definition: screen.cpp:3057
Kyra::KyraEngine_v2::_screenBuffer
uint8 * _screenBuffer
Definition: kyra_v2.h:162
Kyra::KyraEngine_MR::_chatAltFlag
bool _chatAltFlag
Definition: kyra_mr.h:441
Kyra::KyraEngine_MR::_scoreFlagTable
int8 _scoreFlagTable[26]
Definition: kyra_mr.h:529
Kyra::KyraEngine_v2::_mainCharY
int _mainCharY
Definition: kyra_v2.h:331
Common::UNK_LANG
Definition: language.h:68
Kyra::KyraEngine_v2::_unkHandleSceneChangeFlag
bool _unkHandleSceneChangeFlag
Definition: kyra_v2.h:362
Kyra::KyraEngine_MR::_malcolmsMood
int _malcolmsMood
Definition: kyra_mr.h:396
Kyra::WSAMovie_v2
Definition: wsamovie.h:113
Kyra::KyraEngine_MR::updateMouse
void updateMouse()
Definition: kyra_mr.cpp:1079
Kyra::KyraEngine_MR::pickUpItem
bool pickUpItem(int x, int y, int runScript)
Definition: items_mr.cpp:342
Glk::Alan2::high
static CodeValue high
Definition: decode.cpp:56
Kyra::KyraEngine_v1::_mouseX
int _mouseX
Definition: kyra_v1.h:276
Kyra::Button::buttonCallback
Callback buttonCallback
Definition: gui.h:89
Kyra::KyraEngine_MR::runSceneScript1
int runSceneScript1(int x, int y)
Definition: scene_mr.cpp:709
Kyra::KyraEngine_MR::_stringBuffer
char * _stringBuffer
Definition: kyra_mr.h:521
Kyra::KyraEngine_MR::_scaleTable
int _scaleTable[15]
Definition: kyra_mr.h:382
uint16
unsigned short uint16
Definition: cdtypes.h:27
Kyra::WSAMovie_v2::displayFrame
void displayFrame(int frameNum, int pageNum, int x, int y, uint16 flags, const uint8 *table1, const uint8 *table2) override
Definition: wsamovie.h:118
Kyra::GUI_MR::initStaticData
void initStaticData() override
Definition: staticres.cpp:1951
Glk::Level9::exit1
void exit1(L9BYTE *d4, L9BYTE *d5p, L9BYTE d6, L9BYTE d7)
Definition: level9_main.cpp:2025
Kyra::Screen::hideMouse
void hideMouse()
Definition: screen.cpp:2979
Kyra::KyraEngine_MR::_menuAnim
WSAMovie_v2 * _menuAnim
Definition: kyra_mr.h:165
resource.h
Kyra::KyraEngine_v1::_gameToLoad
int _gameToLoad
Definition: kyra_v1.h:389
Kyra::Screen::setMouseCursor
virtual void setMouseCursor(int x, int y, const byte *shape)
Definition: screen.cpp:3009
Kyra::KyraEngine_v2::resetItemList
void resetItemList()
Definition: items_v2.cpp:72
timer.h
Kyra::KyraEngine_MR::_costPalBuffer
uint8 * _costPalBuffer
Definition: kyra_mr.h:504
Kyra::KyraEngine_MR::_charBackUpHeight
int _charBackUpHeight
Definition: kyra_mr.h:214
Kyra::KyraEngine_MR::inputSceneChange
int inputSceneChange(int x, int y, int unk1, int unk2) override
Definition: kyra_mr.cpp:995
Kyra::KyraEngine_MR::updateCharPal
void updateCharPal(int unk1)
Definition: kyra_mr.cpp:833
Glk::JACL::file
FILE * file
Kyra::KyraEngine_MR::setWalkspeed
void setWalkspeed(uint8) override
Definition: timer_mr.cpp:82
Kyra::KyraEngine_MR::_sfxFileMap
const uint8 * _sfxFileMap
Definition: kyra_mr.h:126
Kyra::KyraEngine_MR::_gfxBackUpRect
uint8 * _gfxBackUpRect
Definition: kyra_mr.h:517
Kyra::KyraEngine_MR::uninitMainMenu
void uninitMainMenu()
Definition: kyra_mr.cpp:356
name
char name[4]
Definition: cdaudio.cpp:37
Kyra::KyraEngine_MR::ShapeDesc::xOffset
int8 xOffset
Definition: kyra_mr.h:327
Kyra::EMCData
Definition: script.h:36
Kyra::KyraEngine_MR::getTableEntry
uint8 * getTableEntry(uint8 *buffer, int id)
Definition: kyra_mr.cpp:1246
Kyra::KyraEngine_MR::_inventoryState
bool _inventoryState
Definition: kyra_mr.h:244
sound_digital_mr.h
Kyra::KyraEngine_MR::_charBackUpWidth2
int _charBackUpWidth2
Definition: kyra_mr.h:213
Common::ES_ESP
Definition: language.h:63
Audio::Mixer::kMusicSoundType
Definition: mixer.h:58
Kyra::Screen_MR::getLayer
int getLayer(int x, int y) override
Definition: screen_mr.cpp:35
Kyra::KyraEngine_MR::_score
int _score
Definition: kyra_mr.h:523
Kyra::Screen_v2::generateOverlay
uint8 * generateOverlay(const Palette &pal, uint8 *buffer, int color, uint weight, int maxColor=-1)
Definition: screen_v2.cpp:39
filename
Common::String filename
Definition: action.cpp:1197
Kyra::KyraEngine_v2::_lang
int _lang
Definition: kyra_v2.h:95
Kyra::SoundDigital_MR::stopAllSounds
void stopAllSounds()
Stops playback of all sounds.
Definition: sound_digital_mr.cpp:218
Kyra::KyraEngine_MR::_dialogScriptFuncProc
int _dialogScriptFuncProc
Definition: kyra_mr.h:459
Kyra::KyraEngine_MR::drawAnimObjects
void drawAnimObjects() override
Definition: animator_mr.cpp:81
Common::RandomSource::getRandomNumberRng
uint getRandomNumberRng(uint min, uint max)
Generates a random unsigned integer in the interval [min, max].
Definition: random.cpp:58
Kyra::KyraEngine_MR::getScoreX
int getScoreX(const char *str)
Definition: gui_mr.cpp:417
Kyra::Screen::FID_6_FNT
Definition: screen.h:381
Kyra::KyraEngine_MR::checkItemCollision
int checkItemCollision(int x, int y)
Definition: items_mr.cpp:49
Kyra::KyraEngine_MR::loadCostPal
void loadCostPal()
Definition: kyra_mr.cpp:615
Kyra::KyraEngine_MR::initItems
void initItems()
Definition: kyra_mr.cpp:648
Kyra::KyraEngine_v2::_sceneEnterY4
int _sceneEnterY4
Definition: kyra_v2.h:179
Kyra::KyraEngine_MR::openTalkFile
void openTalkFile(int file)
Definition: kyra_mr.cpp:692
Kyra::KyraEngine_v2
Definition: kyra_v2.h:54
Common::String::c_str
const char * c_str() const
Definition: str.h:206
Kyra::Screen::copyRegionToBuffer
void copyRegionToBuffer(int pageNum, int x, int y, int w, int h, uint8 *dest)
Definition: screen.cpp:1021
Kyra::Resource::exists
bool exists(const char *file, bool errorOutOnFail=false)
Definition: resource.cpp:308
Kyra::KyraEngine_MR::_sceneMaxX
int _sceneMaxX
Definition: kyra_mr.h:362
Kyra::Screen::loadBitmap
virtual void loadBitmap(const char *filename, int tempPage, int dstPage, Palette *pal, bool skip=false)
Definition: screen.cpp:3214