ScummVM
staticres.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/resource/resource.h"
24 #include "kyra/engine/kyra_lok.h"
25 #include "kyra/engine/kyra_hof.h"
26 #include "kyra/engine/kyra_mr.h"
27 #include "kyra/graphics/screen.h"
31 #include "kyra/gui/gui_lok.h"
32 #include "kyra/gui/gui_hof.h"
33 #include "kyra/gui/gui_mr.h"
36 
37 #include "common/endian.h"
38 #include "common/md5.h"
39 
40 namespace Kyra {
41 
42 #define RESFILE_VERSION 94
43 
44 namespace {
45 bool checkKyraDat(Common::SeekableReadStream *file) {
46  if (!file)
47  return false;
48 
49  uint32 size = file->size() - 16;
50  uint8 digest[16];
51  file->seek(size, SEEK_SET);
52  if (file->read(digest, 16) != 16)
53  return false;
54 
55  uint8 digestCalc[16];
56  file->seek(0, SEEK_SET);
57  if (!Common::computeStreamMD5(*file, digestCalc, size))
58  return false;
59 
60  for (int i = 0; i < 16; ++i)
61  if (digest[i] != digestCalc[i])
62  return false;
63  return true;
64 }
65 
66 struct IndexTable {
67  int type;
68  int value;
69 
70  bool operator==(int t) const {
71  return (type == t);
72  }
73 };
74 
75 const IndexTable iGameTable[] = {
76  { GI_KYRA1, 0 },
77  { GI_KYRA2, 1 },
78  { GI_KYRA3, 2 },
79  { GI_EOB1, 3 },
80  { GI_EOB2, 4 },
81  { GI_LOL, 5 },
82  { -1, -1 }
83 };
84 
85 byte getGameID(const GameFlags &flags) {
86  return Common::find(iGameTable, ARRAYEND(iGameTable) - 1, flags.gameID)->value;
87 }
88 
89 const IndexTable iLanguageTable[] = {
90  { Common::EN_ANY, 1 },
91  { Common::FR_FRA, 2 },
92  { Common::DE_DEU, 3 },
93  { Common::ES_ESP, 4 },
94  { Common::IT_ITA, 5 },
95  { Common::JA_JPN, 6 },
96  { Common::RU_RUS, 7 },
97  { -1, -1 }
98 };
99 
100 byte getLanguageID(const GameFlags &flags) {
101  return Common::find(iLanguageTable, ARRAYEND(iLanguageTable) - 1, flags.lang)->value;
102 }
103 
104 const IndexTable iPlatformTable[] = {
105  { Common::kPlatformDOS, 0 },
106  { Common::kPlatformAmiga, 1 },
108  { Common::kPlatformPC98, 3 },
109  { Common::kPlatformMacintosh, 0 }, // HACK: Should be type "4", but as long as we can't extract Macintosh data, we need to use DOS data.
110  { -1, -1 }
111 };
112 
113 byte getPlatformID(const GameFlags &flags) {
114  return Common::find(iPlatformTable, ARRAYEND(iPlatformTable) - 1, flags.platform)->value;
115 }
116 
117 byte getSpecialID(const GameFlags &flags) {
118  if (flags.isOldFloppy)
119  return 4;
120  else if (flags.isDemo && flags.isTalkie)
121  return 3;
122  else if (flags.isDemo)
123  return 2;
124  else if (flags.isTalkie)
125  return 1;
126  else
127  return 0;
128 }
129 
130 } // end of anonymous namespace
131 
133  Resource *res = _vm->resource();
134 
135  if (res->isInCacheList(staticDataFilename()))
136  return true;
137 
138  Common::ArchiveMemberList kyraDatFiles;
139  res->listFiles(staticDataFilename(), kyraDatFiles);
140 
141  bool foundWorkingKyraDat = false;
142  for (Common::ArchiveMemberList::iterator i = kyraDatFiles.begin(); i != kyraDatFiles.end(); ++i) {
143  Common::SeekableReadStream *file = (*i)->createReadStream();
144  if (!checkKyraDat(file)) {
145  delete file;
146  continue;
147  }
148 
149  delete file; file = 0;
150 
151  if (!res->loadPakFile(staticDataFilename(), *i))
152  continue;
153 
154  if (tryKyraDatLoad()) {
155  foundWorkingKyraDat = true;
156  break;
157  }
158 
159  res->unloadPakFile(staticDataFilename(), true);
160  unloadId(-1);
161  }
162 
163  if (!foundWorkingKyraDat) {
164  Common::String errorMessage = "You're missing the '" + StaticResource::staticDataFilename() + "' engine data file or it got corrupted.";
165  GUIErrorMessage(errorMessage);
166  error("%s", errorMessage.c_str());
167  }
168 
169  return true;
170 }
171 
173  Common::SeekableReadStream *index = _vm->resource()->createReadStream("INDEX");
174  if (!index)
175  return false;
176 
177  const uint32 version = index->readUint32BE();
178 
179  if (version != RESFILE_VERSION) {
180  delete index;
181  return false;
182  }
183 
184  const uint32 includedGames = index->readUint32BE();
185 
186  if (includedGames * 2 + 8 != (uint32)index->size()) {
187  delete index;
188  return false;
189  }
190 
191  const GameFlags &flags = _vm->gameFlags();
192  const byte game = getGameID(flags) & 0xF;
193  const byte platform = getPlatformID(flags) & 0xF;
194  const byte special = getSpecialID(flags) & 0xF;
195  const byte lang = getLanguageID(flags) & 0xF;
196 
197  const uint16 gameDef = (game << 12) | (platform << 8) | (special << 4) | (lang << 0);
198 
199  bool found = false;
200  for (uint32 i = 0; i < includedGames; ++i) {
201  if (index->readUint16BE() == gameDef) {
202  found = true;
203  break;
204  }
205  }
206 
207  delete index;
208  index = 0;
209 
210  if (!found)
211  return false;
212 
213  // load the ID map for our game
214  const Common::String filenamePattern = Common::String::format("0%01X%01X%01X000%01X", game, platform, special, lang);
215  Common::SeekableReadStream *idMap = _vm->resource()->createReadStream(filenamePattern);
216  if (!idMap)
217  return false;
218 
219  uint16 numIDs = idMap->readUint16BE();
220  while (numIDs--) {
221  uint16 id = idMap->readUint16BE();
222  uint8 type = idMap->readByte();
223  uint32 filename = idMap->readUint32BE();
224 
225  _dataTable[id] = DataDescriptor(filename, type);
226  }
227 
228  const bool fileError = idMap->err();
229  delete idMap;
230  if (fileError)
231  return false;
232 
233  // load all tables for now
234  if (!prefetchId(-1))
235  return false;
236 
237  return true;
238 }
239 
241 #define proc(x) &StaticResource::x
242  static const FileType fileTypeTable[] = {
243  { kStringList, proc(loadStringTable), proc(freeStringTable) },
244  { StaticResource::kRoomList, proc(loadRoomTable), proc(freeRoomTable) },
245  { kShapeList, proc(loadShapeTable), proc(freeShapeTable) },
246  { kAmigaSfxTable, proc(loadAmigaSfxTable), proc(freeAmigaSfxTable) },
247  { kRawData, proc(loadRawData), proc(freeRawData) },
248 
249  { k2SeqData, proc(loadHoFSequenceData), proc(freeHoFSequenceData) },
250  { k2SeqItemAnimData, proc(loadHoFSeqItemAnimData), proc(freeHoFSeqItemAnimData) },
251  { k2ItemAnimDefinition, proc(loadItemAnimDefinition), proc(freeItemAnimDefinition) },
252 
253 #ifdef ENABLE_LOL
254  { kLoLCharData, proc(loadCharData), proc(freeCharData) },
255  { kLoLSpellData, proc(loadSpellData), proc(freeSpellData) },
256  { kLoLCompassData, proc(loadCompassData), proc(freeCompassData) },
257  { kLoLFlightShpData, proc(loadFlyingObjectData), proc(freeFlyingObjectData) },
258 #else
259  { kLoLCharData, proc(loadDummy), proc(freeDummy) },
260  { kLoLSpellData, proc(loadDummy), proc(freeDummy) },
261  { kLoLCompassData, proc(loadDummy), proc(freeDummy) },
262  { kLoLFlightShpData, proc(loadDummy), proc(freeDummy) },
263 #endif
264 #if defined(ENABLE_EOB) || defined(ENABLE_LOL)
265  { kRawDataBe16, proc(loadRawDataBe16), proc(freeRawDataBe16) },
266  { kRawDataBe32, proc(loadRawDataBe32), proc(freeRawDataBe32) },
267 #endif
268 #ifdef ENABLE_LOL
269  { kLoLButtonData, proc(loadButtonDefs), proc(freeButtonDefs) },
270 #else
271  { kLoLButtonData, proc(loadDummy), proc(freeDummy) },
272 #endif
273 
274 #ifdef ENABLE_EOB
275  { kEoB2SequenceData, proc(loadEoB2SeqData), proc(freeEoB2SeqData) },
276  { kEoB2ShapeData, proc(loadEoB2ShapeData), proc(freeEoB2ShapeData) },
277  { kEoBNpcData, proc(loadEoBNpcData), proc(freeEoBNpcData) },
278 #endif
279 
280  { 0, 0, 0 }
281  };
282 #undef proc
283  _fileLoader = fileTypeTable;
284 
285  return loadStaticResourceFile();
286 }
287 
289  unloadId(-1);
290 }
291 
292 const char *const *StaticResource::loadStrings(int id, int &strings) {
293  return (const char *const *)getData(id, kStringList, strings);
294 }
295 
296 const uint8 *StaticResource::loadRawData(int id, int &size) {
297  return (const uint8 *)getData(id, kRawData, size);
298 }
299 
300 const Shape *StaticResource::loadShapeTable(int id, int &entries) {
301  return (const Shape *)getData(id, kShapeList, entries);
302 }
303 
304 const AmigaSfxTable *StaticResource::loadAmigaSfxTable(int id, int &entries) {
305  return (const AmigaSfxTable *)getData(id, kAmigaSfxTable, entries);
306 }
307 
308 const Room *StaticResource::loadRoomTable(int id, int &entries) {
309  return (const Room *)getData(id, StaticResource::kRoomList, entries);
310 }
311 
312 const HoFSeqData *StaticResource::loadHoFSequenceData(int id, int &entries) {
313  return (const HoFSeqData *)getData(id, k2SeqData, entries);
314 }
315 
317  return (const HoFSeqItemAnimData *)getData(id, k2SeqItemAnimData, entries);
318 }
319 
321  return (const ItemAnimDefinition *)getData(id, k2ItemAnimDefinition, entries);
322 }
323 
325  if (id == -1) {
326  for (DataMap::const_iterator i = _dataTable.begin(); i != _dataTable.end(); ++i) {
327  if (!prefetchId(i->_key))
328  return false;
329  }
330  return true;
331  }
332 
333  const void *ptr = 0;
334  int type = -1, size = -1;
335 
336  if (checkResList(id, type, ptr, size))
337  return true;
338 
339  DataMap::const_iterator dDesc = _dataTable.find(id);
340  if (dDesc == _dataTable.end())
341  return false;
342 
343  const FileType *filetype = getFiletype(dDesc->_value.type);
344  if (!filetype)
345  return false;
346 
347  ResData data;
348  data.id = id;
349  data.type = dDesc->_value.type;
350  Common::SeekableReadStream *fileStream = _vm->resource()->createReadStream(Common::String::format("%08X", dDesc->_value.filename));
351  if (!fileStream)
352  return false;
353 
354  if (!(this->*(filetype->load))(*fileStream, data.data, data.size)) {
355  delete fileStream;
356  return false;
357  }
358  delete fileStream;
359  _resList.push_back(data);
360 
361  return true;
362 }
363 
365  Common::List<ResData>::iterator pos = _resList.begin();
366  for (; pos != _resList.end();) {
367  if (pos->id == id || id == -1) {
368  const FileType *filetype = getFiletype(pos->type);
369  (this->*(filetype->free))(pos->data, pos->size);
370  pos = _resList.erase(pos);
371  if (id != -1)
372  break;
373  } else {
374  ++pos;
375  }
376  }
377 }
378 
379 bool StaticResource::checkResList(int id, int &type, const void *&ptr, int &size) {
380  Common::List<ResData>::iterator pos = _resList.begin();
381  for (; pos != _resList.end(); ++pos) {
382  if (pos->id == id) {
383  size = pos->size;
384  type = pos->type;
385  ptr = pos->data;
386  return true;
387  }
388  }
389  return false;
390 }
391 
393  if (!_fileLoader)
394  return 0;
395 
396  for (int i = 0; _fileLoader[i].load; ++i) {
397  if (_fileLoader[i].type == type)
398  return &_fileLoader[i];
399  }
400 
401  return 0;
402 }
403 
404 const void *StaticResource::getData(int id, int requesttype, int &size) {
405  const void *ptr = 0;
406  int type = -1;
407  size = 0;
408 
409  if (checkResList(id, type, ptr, size)) {
410  if (type == requesttype)
411  return ptr;
412  return 0;
413  }
414 
415  if (!prefetchId(id))
416  return 0;
417 
418  if (checkResList(id, type, ptr, size)) {
419  if (type == requesttype)
420  return ptr;
421  }
422 
423  return 0;
424 }
425 
427  return true;
428 }
429 
431  uint32 count = stream.readUint32BE();
432  size = count;
433  char **output = new char *[count];
434  assert(output);
435 
436  for (uint32 i = 0; i < count; ++i) {
437  Common::String string;
438  char c = 0;
439  while ((c = (char)stream.readByte()) != 0)
440  string += c;
441 
442  output[i] = new char[string.size() + 1];
443  strcpy(output[i], string.c_str());
444  }
445 
446  ptr = output;
447  return true;
448 }
449 
451  ptr = new uint8[stream.size()];
452  stream.read(ptr, stream.size());
453  size = stream.size();
454  return true;
455 }
456 
458  uint32 count = stream.readUint32BE();
459  size = count;
460  Shape *loadTo = new Shape[count];
461  assert(loadTo);
462 
463  for (uint32 i = 0; i < count; ++i) {
464  loadTo[i].imageIndex = stream.readByte();
465  loadTo[i].x = stream.readByte();
466  loadTo[i].y = stream.readByte();
467  loadTo[i].w = stream.readByte();
468  loadTo[i].h = stream.readByte();
469  loadTo[i].xOffset = stream.readSByte();
470  loadTo[i].yOffset = stream.readSByte();
471  }
472 
473  ptr = loadTo;
474  return true;
475 }
476 
478  size = stream.readUint32BE();
479  AmigaSfxTable *loadTo = new AmigaSfxTable[size];
480  assert(loadTo);
481 
482  for (int i = 0; i < size; ++i) {
483  loadTo[i].note = stream.readByte();
484  loadTo[i].patch = stream.readByte();
485  loadTo[i].duration = stream.readUint16BE();
486  loadTo[i].volume = stream.readByte();
487  loadTo[i].pan = stream.readByte();
488  }
489 
490  ptr = loadTo;
491  return true;
492 }
493 
495  uint32 count = stream.readUint32BE();
496  size = count;
497  Room *loadTo = new Room[count];
498  assert(loadTo);
499 
500  for (uint32 i = 0; i < count; ++i) {
501  loadTo[i].nameIndex = stream.readByte();
502  loadTo[i].northExit = stream.readUint16BE();
503  loadTo[i].eastExit = stream.readUint16BE();
504  loadTo[i].southExit = stream.readUint16BE();
505  loadTo[i].westExit = stream.readUint16BE();
506  memset(&loadTo[i].itemsTable[0], 0xFF, sizeof(byte) * 6);
507  memset(&loadTo[i].itemsTable[6], 0, sizeof(byte) * 6);
508  memset(loadTo[i].itemsXPos, 0, sizeof(uint16) * 12);
509  memset(loadTo[i].itemsYPos, 0, sizeof(uint8) * 12);
510  memset(loadTo[i].needInit, 0, sizeof(loadTo[i].needInit));
511  }
512 
513  ptr = loadTo;
514  return true;
515 }
516 
518  int numSeq = stream.readUint16BE();
519  uint32 offset = 2;
520  HoFSequence *tmp_s = new HoFSequence[numSeq];
521 
522  size = sizeof(HoFSeqData) + numSeq * (sizeof(HoFSequence) + 28);
523 
524  for (int i = 0; i < numSeq; i++) {
525  stream.seek(offset, SEEK_SET); offset += 2;
526  stream.seek(stream.readUint16BE(), SEEK_SET);
527 
528  tmp_s[i].flags = stream.readUint16BE();
529  tmp_s[i].wsaFile = new char[14];
530  stream.read(const_cast<char *>(tmp_s[i].wsaFile), 14);
531  tmp_s[i].cpsFile = new char[14];
532  stream.read(const_cast<char *>(tmp_s[i].cpsFile), 14);
533  tmp_s[i].fadeInTransitionType = stream.readByte();
534  tmp_s[i].fadeOutTransitionType = stream.readByte();
535  tmp_s[i].stringIndex1 = stream.readUint16BE();
536  tmp_s[i].stringIndex2 = stream.readUint16BE();
537  tmp_s[i].startFrame = stream.readUint16BE();
538  tmp_s[i].numFrames = stream.readUint16BE();
539  tmp_s[i].duration = stream.readUint16BE();
540  tmp_s[i].xPos = stream.readUint16BE();
541  tmp_s[i].yPos = stream.readUint16BE();
542  tmp_s[i].timeout = stream.readUint16BE();
543  }
544 
545  stream.seek(offset, SEEK_SET); offset += 2;
546  int numSeqN = stream.readUint16BE();
547  HoFNestedSequence *tmp_n = new HoFNestedSequence[numSeqN];
548  size += (numSeqN * (sizeof(HoFNestedSequence) + 14));
549 
550  for (int i = 0; i < numSeqN; i++) {
551  stream.seek(offset, SEEK_SET); offset += 2;
552  stream.seek(stream.readUint16BE(), SEEK_SET);
553 
554  tmp_n[i].flags = stream.readUint16BE();
555  tmp_n[i].wsaFile = new char[14];
556  stream.read(const_cast<char *>(tmp_n[i].wsaFile), 14);
557  tmp_n[i].startframe = stream.readUint16BE();
558  tmp_n[i].endFrame = stream.readUint16BE();
559  tmp_n[i].frameDelay = stream.readUint16BE();
560  tmp_n[i].x = stream.readUint16BE();
561  tmp_n[i].y = stream.readUint16BE();
562  uint16 ctrlOffs = stream.readUint16BE();
563  tmp_n[i].fadeInTransitionType = stream.readUint16BE();
564  tmp_n[i].fadeOutTransitionType = stream.readUint16BE();
565 
566  if (ctrlOffs) {
567  stream.seek(ctrlOffs, SEEK_SET);
568  int num_c = stream.readByte();
569  FrameControl *tmp_f = new FrameControl[num_c];
570 
571  for (int ii = 0; ii < num_c; ii++) {
572  tmp_f[ii].index = stream.readUint16BE();
573  tmp_f[ii].delay = stream.readUint16BE();
574  }
575 
576  tmp_n[i].wsaControl = (const FrameControl *)tmp_f;
577  size += (num_c * sizeof(FrameControl));
578 
579  } else {
580  tmp_n[i].wsaControl = 0;
581  }
582  }
583 
584  HoFSeqData *loadTo = new HoFSeqData;
585  assert(loadTo);
586 
587  loadTo->seq = tmp_s;
588  loadTo->nestedSeq = tmp_n;
589  loadTo->numSeq = numSeq;
590  loadTo->numNestedSeq = numSeqN;
591 
592  ptr = loadTo;
593  return true;
594 }
595 
597  size = stream.readByte();
599  assert(loadTo);
600 
601  for (int i = 0; i < size; i++) {
602  loadTo[i].itemIndex = stream.readSint16BE();
603  loadTo[i].y = stream.readUint16BE();
604  uint16 *tmp_f = new uint16[20];
605  for (int ii = 0; ii < 20; ii++)
606  tmp_f[ii] = stream.readUint16BE();
607  loadTo[i].frames = tmp_f;
608  }
609 
610  ptr = loadTo;
611  return true;
612 }
613 
615  size = stream.readByte();
617  assert(loadTo);
618 
619  for (int i = 0; i < size; i++) {
620  loadTo[i].itemIndex = stream.readSint16BE();
621  loadTo[i].numFrames = stream.readByte();
622  FrameControl *tmp_f = new FrameControl[loadTo[i].numFrames];
623  for (int ii = 0; ii < loadTo[i].numFrames; ii++) {
624  tmp_f[ii].index = stream.readUint16BE();
625  tmp_f[ii].delay = stream.readUint16BE();
626  }
627  loadTo[i].frames = tmp_f;
628  }
629 
630  ptr = loadTo;
631  return true;
632 }
633 
634 void StaticResource::freeDummy(void *&ptr, int &size) {
635 }
636 
637 void StaticResource::freeRawData(void *&ptr, int &size) {
638  uint8 *data = (uint8 *)ptr;
639  delete[] data;
640  ptr = 0;
641  size = 0;
642 }
643 
644 void StaticResource::freeStringTable(void *&ptr, int &size) {
645  char **data = (char **)ptr;
646  while (size--)
647  delete[] data[size];
648  delete[] data;
649  ptr = 0;
650  size = 0;
651 }
652 
653 void StaticResource::freeShapeTable(void *&ptr, int &size) {
654  Shape *data = (Shape *)ptr;
655  delete[] data;
656  ptr = 0;
657  size = 0;
658 }
659 
660 void StaticResource::freeAmigaSfxTable(void *&ptr, int &size) {
661  AmigaSfxTable *data = (AmigaSfxTable *)ptr;
662  delete[] data;
663  ptr = 0;
664  size = 0;
665 }
666 
667 void StaticResource::freeRoomTable(void *&ptr, int &size) {
668  Room *data = (Room *)ptr;
669  delete[] data;
670  ptr = 0;
671  size = 0;
672 }
673 
675  HoFSeqData *h = (HoFSeqData *)ptr;
676 
677  for (int i = 0; i < h->numSeq; i++) {
678  delete[] h->seq[i].wsaFile;
679  delete[] h->seq[i].cpsFile;
680  }
681  delete[] h->seq;
682 
683  for (int i = 0; i < h->numNestedSeq; i++) {
684  delete[] h->nestedSeq[i].wsaFile;
685  delete[] h->nestedSeq[i].wsaControl;
686  }
687  delete[] h->nestedSeq;
688 
689  delete h;
690  ptr = 0;
691  size = 0;
692 }
693 
696  for (int i = 0; i < size; i++)
697  delete[] d[i].frames;
698  delete[] d;
699  ptr = 0;
700  size = 0;
701 }
702 
705  for (int i = 0; i < size; i++)
706  delete[] d[i].frames;
707  delete[] d;
708  ptr = 0;
709  size = 0;
710 }
711 
712 #pragma mark -
713 
715  int temp = 0;
716  _seq_Forest = _staticres->loadRawData(k1ForestSeq, temp);
717  _seq_KallakWriting = _staticres->loadRawData(k1KallakWritingSeq, temp);
718  _seq_KyrandiaLogo = _staticres->loadRawData(k1KyrandiaLogoSeq, temp);
719  _seq_KallakMalcolm = _staticres->loadRawData(k1KallakMalcolmSeq, temp);
720  _seq_MalcolmTree = _staticres->loadRawData(k1MalcolmTreeSeq, temp);
721  _seq_WestwoodLogo = _staticres->loadRawData(k1WestwoodLogoSeq, temp);
722  _seq_Demo1 = _staticres->loadRawData(k1Demo1Seq, temp);
723  _seq_Demo2 = _staticres->loadRawData(k1Demo2Seq, temp);
724  _seq_Demo3 = _staticres->loadRawData(k1Demo3Seq, temp);
725  _seq_Demo4 = _staticres->loadRawData(k1Demo4Seq, temp);
726  _seq_Reunion = _staticres->loadRawData(k1OutroReunionSeq, temp);
727 
728  _seq_WSATable = _staticres->loadStrings(k1IntroWSAStrings, _seq_WSATable_Size);
729  _seq_CPSTable = _staticres->loadStrings(k1IntroCPSStrings, _seq_CPSTable_Size);
730  _seq_COLTable = _staticres->loadStrings(k1IntroCOLStrings, _seq_COLTable_Size);
731  _seq_textsTable = _staticres->loadStrings(k1IntroStrings, _seq_textsTable_Size);
732 
733  _itemList = _staticres->loadStrings(k1ItemNames, _itemList_Size);
734  _takenList = _staticres->loadStrings(k1TakenStrings, _takenList_Size);
735  _placedList = _staticres->loadStrings(k1PlacedStrings, _placedList_Size);
736  _droppedList = _staticres->loadStrings(k1DroppedStrings, _droppedList_Size);
737  _noDropList = _staticres->loadStrings(k1NoDropStrings, _noDropList_Size);
738  _putDownFirst = _staticres->loadStrings(k1PutDownString, _putDownFirst_Size);
739  _waitForAmulet = _staticres->loadStrings(k1WaitAmuletString, _waitForAmulet_Size);
740  _blackJewel = _staticres->loadStrings(k1BlackJewelString, _blackJewel_Size);
741  _poisonGone = _staticres->loadStrings(k1PoisonGoneString, _poisonGone_Size);
742  _healingTip = _staticres->loadStrings(k1HealingTipString, _healingTip_Size);
743  _thePoison = _staticres->loadStrings(k1ThePoisonStrings, _thePoison_Size);
744  _fluteString = _staticres->loadStrings(k1FluteStrings, _fluteString_Size);
745  _wispJewelStrings = _staticres->loadStrings(k1WispJewelStrings, _wispJewelStrings_Size);
746  _magicJewelString = _staticres->loadStrings(k1MagicJewelStrings, _magicJewelString_Size);
747  _flaskFull = _staticres->loadStrings(k1FlaskFullString, _flaskFull_Size);
748  _fullFlask = _staticres->loadStrings(k1FullFlaskString, _fullFlask_Size);
749  _veryClever = _staticres->loadStrings(k1VeryCleverString, _veryClever_Size);
750  _homeString = _staticres->loadStrings(k1OutroHomeString, _homeString_Size);
751  _newGameString = _staticres->loadStrings(k1NewGameString, _newGameString_Size);
752 
753  _healingShapeTable = _staticres->loadShapeTable(k1Healing1Shapes, _healingShapeTableSize);
754  _healingShape2Table = _staticres->loadShapeTable(k1Healing2Shapes, _healingShape2TableSize);
755  _posionDeathShapeTable = _staticres->loadShapeTable(k1PoisonDeathShapes, _posionDeathShapeTableSize);
756  _fluteAnimShapeTable = _staticres->loadShapeTable(k1FluteShapes, _fluteAnimShapeTableSize);
757  _winterScrollTable = _staticres->loadShapeTable(k1Winter1Shapes, _winterScrollTableSize);
758  _winterScroll1Table = _staticres->loadShapeTable(k1Winter2Shapes, _winterScroll1TableSize);
759  _winterScroll2Table = _staticres->loadShapeTable(k1Winter3Shapes, _winterScroll2TableSize);
760  _drinkAnimationTable = _staticres->loadShapeTable(k1DrinkShapes, _drinkAnimationTableSize);
761  _brandonToWispTable = _staticres->loadShapeTable(k1WispShapes, _brandonToWispTableSize);
762  _magicAnimationTable = _staticres->loadShapeTable(k1MagicAnimShapes, _magicAnimationTableSize);
763  _brandonStoneTable = _staticres->loadShapeTable(k1BranStoneShapes, _brandonStoneTableSize);
764 
765  _characterImageTable = _staticres->loadStrings(k1CharacterImageFilenames, _characterImageTableSize);
766 
767  _roomFilenameTable = _staticres->loadStrings(k1RoomFilenames, _roomFilenameTableSize);
768 
769  _amuleteAnim = _staticres->loadRawData(k1AmuleteAnimSeq, temp);
770 
771  const uint8 **palTable = new const uint8 *[k1SpecialPalette33 - k1SpecialPalette1 + 1];
772  for (int i = k1SpecialPalette1; i <= k1SpecialPalette33; ++i)
773  palTable[i - k1SpecialPalette1] = _staticres->loadRawData(i, temp);
774  _specialPalettes = palTable;
775 
776  _guiStrings = _staticres->loadStrings(k1GUIStrings, _guiStringsSize);
777  _configStrings = _staticres->loadStrings(k1ConfigStrings, _configStringsSize);
778 
779  _storyStrings = _staticres->loadStrings(k1PC98StoryStrings, _storyStringsSize);
780 
781  // room list
782  const Room *tempRoomList = _staticres->loadRoomTable(k1RoomList, _roomTableSize);
783 
784  if (_roomTableSize > 0) {
785  _roomTable = new Room[_roomTableSize];
786  assert(_roomTable);
787 
788  memcpy(_roomTable, tempRoomList, _roomTableSize * sizeof(Room));
789  tempRoomList = 0;
790 
791  _staticres->unloadId(k1RoomList);
792  }
793 
794  // default shape table
795  const Shape *tempShapeTable = _staticres->loadShapeTable(k1DefaultShapes, _defaultShapeTableSize);
796 
797  if (_defaultShapeTableSize > 0) {
798  _defaultShapeTable = new Shape[_defaultShapeTableSize];
799  assert(_defaultShapeTable);
800 
801  memcpy(_defaultShapeTable, tempShapeTable, _defaultShapeTableSize * sizeof(Shape));
802  tempShapeTable = 0;
803 
804  _staticres->unloadId(k1DefaultShapes);
805  }
806 
807  // audio resource assignment
808  int soundFilesSize;
809  const char *const *soundFiles = _staticres->loadStrings(k1AudioTracks, soundFilesSize);
810  int soundFilesIntroSize = 0;
811  int cdaTableSize = 0;
812 
813  const char *const *soundFilesIntro = _staticres->loadStrings(k1AudioTracksIntro, soundFilesIntroSize);
814  const int32 *cdaTable = (const int32 *)_staticres->loadRawData(k1TownsCDATable, cdaTableSize);
815 
816  // FIXME: It seems Kyra1 MAC CD includes AdLib and MIDI music and sfx, thus we enable
817  // support for those for now. (Based on patch #2767489 "Support for Mac Kyrandia 1 CD" by satz).
818  if (_flags.platform == Common::kPlatformDOS || _flags.platform == Common::kPlatformMacintosh) {
819  SoundResourceInfo_PC resInfoIntro(soundFilesIntro, soundFilesIntroSize);
820  SoundResourceInfo_PC resInfoIngame(soundFiles, soundFilesSize);
821  _sound->initAudioResourceInfo(kMusicIntro, &resInfoIntro);
822  _sound->initAudioResourceInfo(kMusicIngame, &resInfoIngame);
823  } else if (_flags.platform == Common::kPlatformFMTowns) {
824  SoundResourceInfo_Towns resInfoIntro(soundFiles, soundFilesSize, cdaTable, cdaTableSize);
825  SoundResourceInfo_Towns resInfoIngame(soundFiles, soundFilesSize, cdaTable, cdaTableSize);
826  _sound->initAudioResourceInfo(kMusicIntro, &resInfoIntro);
827  _sound->initAudioResourceInfo(kMusicIngame, &resInfoIngame);
828  } else if (_flags.platform == Common::kPlatformPC98) {
829  SoundResourceInfo_PC98 resInfoIntro("INTRO%d.DAT");
830  SoundResourceInfo_PC98 resInfoIngame("KYRAM%d.DAT");
831  _sound->initAudioResourceInfo(kMusicIntro, &resInfoIntro);
832  _sound->initAudioResourceInfo(kMusicIngame, &resInfoIngame);
833  }
834 }
835 
837  _screen->loadBitmap("MOUSE.CPS", 3, 3, 0);
838  _screen->_curPage = 2;
839  _shapes[0] = _screen->encodeShape(0, 0, 8, 10, 0);
840  _shapes[1] = _screen->encodeShape(0, 0x17, 0x20, 7, 0);
841  _shapes[2] = _screen->encodeShape(0x50, 0x12, 0x10, 9, 0);
842  _shapes[3] = _screen->encodeShape(0x60, 0x12, 0x10, 11, 0);
843  _shapes[4] = _screen->encodeShape(0x70, 0x12, 0x10, 9, 0);
844  _shapes[5] = _screen->encodeShape(0x80, 0x12, 0x10, 11, 0);
845  _shapes[6] = _screen->encodeShape(0x90, 0x12, 0x10, 10, 0);
846  _shapes[360] = _screen->encodeShape(0x28, 0, 0x10, 13, 0);
847  _screen->setMouseCursor(1, 1, 0);
848  _screen->setMouseCursor(1, 1, _shapes[0]);
849  _screen->setShapePages(5, 3);
850 }
851 
853  int curImage = 0xFF;
854  int videoPage = _screen->_curPage;
855  _screen->_curPage = 2;
856  for (int i = 0; i < 115; ++i) {
857  assert(i < _defaultShapeTableSize);
858  Shape *shape = &_defaultShapeTable[i];
859  if (shape->imageIndex == 0xFF) {
860  _shapes[i + 7] = 0;
861  continue;
862  }
863  if (shape->imageIndex != curImage) {
864  assert(shape->imageIndex < _characterImageTableSize);
865  _screen->loadBitmap(_characterImageTable[shape->imageIndex], 3, 3, 0);
866  curImage = shape->imageIndex;
867  }
868  _shapes[i + 7] = _screen->encodeShape(shape->x << 3, shape->y, shape->w << 3, shape->h, 1);
869  }
870  _screen->_curPage = videoPage;
871 }
872 
874  _screen->loadBitmap("EFFECTS.CPS", 3, 3, 0);
875  _screen->_curPage = 2;
876 
877  int currShape;
878  for (currShape = 173; currShape < 183; currShape++)
879  _shapes[currShape] = _screen->encodeShape((currShape - 173) * 24, 0, 24, 24, 1);
880 
881  for (currShape = 183; currShape < 190; currShape++)
882  _shapes[currShape] = _screen->encodeShape((currShape - 183) * 24, 24, 24, 24, 1);
883 
884  for (currShape = 190; currShape < 201; currShape++)
885  _shapes[currShape] = _screen->encodeShape((currShape - 190) * 24, 48, 24, 24, 1);
886 
887  for (currShape = 201; currShape < 206; currShape++)
888  _shapes[currShape] = _screen->encodeShape((currShape - 201) * 16, 106, 16, 16, 1);
889 }
890 
892  int shape;
893 
894  _screen->loadBitmap("JEWELS3.CPS", 3, 3, 0);
895  _screen->_curPage = 2;
896 
897  _shapes[323] = 0;
898 
899  for (shape = 1; shape < 6; shape++)
900  _shapes[323 + shape] = _screen->encodeShape((shape - 1) * 32, 0, 32, 17, 0);
901 
902  for (shape = 330; shape <= 334; shape++)
903  _shapes[shape] = _screen->encodeShape((shape - 330) * 32, 102, 32, 17, 0);
904 
905  for (shape = 335; shape <= 339; shape++)
906  _shapes[shape] = _screen->encodeShape((shape - 335) * 32, 17, 32, 17, 0);
907 
908  for (shape = 340; shape <= 344; shape++)
909  _shapes[shape] = _screen->encodeShape((shape - 340) * 32, 34, 32, 17, 0);
910 
911  for (shape = 345; shape <= 349; shape++)
912  _shapes[shape] = _screen->encodeShape((shape - 345) * 32, 51, 32, 17, 0);
913 
914  for (shape = 350; shape <= 354; shape++)
915  _shapes[shape] = _screen->encodeShape((shape - 350) * 32, 68, 32, 17, 0);
916 
917  for (shape = 355; shape <= 359; shape++)
918  _shapes[shape] = _screen->encodeShape((shape - 355) * 32, 85, 32, 17, 0);
919 
920 
921  _screen->loadBitmap("ITEMS.CPS", 3, 3, 0);
922  _screen->_curPage = 2;
923 
924  for (int i = 0; i < 107; i++) {
925  shape = findDuplicateItemShape(i);
926 
927  if (shape != -1)
928  _shapes[216 + i] = _shapes[216 + shape];
929  else
930  _shapes[216 + i] = _screen->encodeShape((i % 20) * 16, i / 20 * 16, 16, 16, 0);
931  }
932 
933  _res->loadFileToBuf("_ITEM_HT.DAT", &_itemHtDat, sizeof(_itemHtDat));
934 }
935 
937  _screen->loadBitmap("BUTTONS2.CPS", 3, 3, 0);
938  _screen->_curPage = 2;
939  _gui->_scrollUpButton.data0ShapePtr = _screen->encodeShape(0, 0, 24, 14, 1);
940  _gui->_scrollUpButton.data1ShapePtr = _screen->encodeShape(24, 0, 24, 14, 1);
941  _gui->_scrollUpButton.data2ShapePtr = _screen->encodeShape(48, 0, 24, 14, 1);
942  _gui->_scrollDownButton.data0ShapePtr = _screen->encodeShape(0, 15, 24, 14, 1);
943  _gui->_scrollDownButton.data1ShapePtr = _screen->encodeShape(24, 15, 24, 14, 1);
944  _gui->_scrollDownButton.data2ShapePtr = _screen->encodeShape(48, 15, 24, 14, 1);
945  _screen->_curPage = 0;
946 }
947 
949  _screen->clearPage(page);
950 
951  if (((_flags.lang == Common::EN_ANY || _flags.lang == Common::RU_RUS) && !_flags.isTalkie && _flags.platform == Common::kPlatformDOS) || _flags.platform == Common::kPlatformAmiga)
952  _screen->loadBitmap("MAIN15.CPS", page, page, &_screen->getPalette(0));
953  else if (_flags.lang == Common::EN_ANY || _flags.lang == Common::JA_JPN || (_flags.isTalkie && _flags.lang == Common::IT_ITA))
954  _screen->loadBitmap("MAIN_ENG.CPS", page, page, 0);
955  else if (_flags.lang == Common::FR_FRA)
956  _screen->loadBitmap("MAIN_FRE.CPS", page, page, 0);
957  else if (_flags.lang == Common::DE_DEU)
958  _screen->loadBitmap("MAIN_GER.CPS", page, page, 0);
959  else if (_flags.lang == Common::ES_ESP)
960  _screen->loadBitmap("MAIN_SPA.CPS", page, page, 0);
961  else if (_flags.lang == Common::IT_ITA)
962  _screen->loadBitmap("MAIN_ITA.CPS", page, page, 0);
963  else
964  warning("no main graphics file found");
965 
966  _screen->copyRegion(0, 0, 0, 0, 320, 200, page, 0, Screen::CR_NO_P_CHECK);
967 
968  if (_flags.platform == Common::kPlatformAmiga) {
969  _screen->copyPalette(1, 0);
970  _screen->setInterfacePalette(_screen->getPalette(1), 0x3F, 0x3F, 0x3F);
971 
972  // TODO: Move this to a better place
973  _screen->enableInterfacePalette(true);
974  }
975 }
976 
978  _ingamePakList = _staticres->loadStrings(k2IngamePakFiles, _ingamePakListSize);
979  _ingameSoundList = _staticres->loadStrings(k2IngameSfxFiles, _ingameSoundListSize);
980  _ingameSoundIndex = (const uint16 *)_staticres->loadRawData(k2IngameSfxIndex, _ingameSoundIndexSize);
981  _musicFileListIntro = _staticres->loadStrings(k2SeqplayIntroTracks, _musicFileListIntroSize);
982  _musicFileListIngame = _staticres->loadStrings(k2IngameTracks, _musicFileListIngameSize);
983  _musicFileListFinale = _staticres->loadStrings(k2SeqplayFinaleTracks, _musicFileListFinaleSize);
984  _cdaTrackTableIntro = _staticres->loadRawData(k2SeqplayIntroCDA, _cdaTrackTableIntroSize);
985  _cdaTrackTableIngame = _staticres->loadRawData(k2IngameCDA, _cdaTrackTableIngameSize);
986  _cdaTrackTableFinale = _staticres->loadRawData(k2SeqplayFinaleCDA, _cdaTrackTableFinaleSize);
987  _ingameTalkObjIndex = (const uint16 *)_staticres->loadRawData(k2IngameTalkObjIndex, _ingameTalkObjIndexSize);
988  _ingameTimJpStr = _staticres->loadStrings(k2IngameTimJpStrings, _ingameTimJpStrSize);
989  _itemAnimDefinition = _staticres->loadItemAnimDefinition(k2IngameShapeAnimData, _itemAnimDefinitionSize);
990 
991  // assign music data
992  if (_flags.platform == Common::kPlatformDOS) {
993  SoundResourceInfo_PC resInfoIntro(_musicFileListIntro, _musicFileListIntroSize);
994  SoundResourceInfo_PC resInfoIngame(_musicFileListIngame, _musicFileListIngameSize);
995  SoundResourceInfo_PC resInfoFinale(_musicFileListFinale, _musicFileListFinaleSize);
996  _sound->initAudioResourceInfo(kMusicIntro, &resInfoIntro);
997  _sound->initAudioResourceInfo(kMusicIngame, &resInfoIngame);
998  _sound->initAudioResourceInfo(kMusicFinale, &resInfoFinale);
999  } else if (_flags.platform == Common::kPlatformFMTowns) {
1000  SoundResourceInfo_TownsPC98V2 resInfoIntro(0, 0, "intro%d.twn", (const uint16*)_cdaTrackTableIntro, _cdaTrackTableIntroSize >> 1);
1001  SoundResourceInfo_TownsPC98V2 resInfoIngame(0, 0, "km%02d.twn", (const uint16*)_cdaTrackTableIngame, _cdaTrackTableIngameSize >> 1);
1002  SoundResourceInfo_TownsPC98V2 resInfoFinale(0, 0, "finale%d.twn", (const uint16*)_cdaTrackTableFinale, _cdaTrackTableFinaleSize >> 1);
1003  _sound->initAudioResourceInfo(kMusicIntro, &resInfoIntro);
1004  _sound->initAudioResourceInfo(kMusicIngame, &resInfoIngame);
1005  _sound->initAudioResourceInfo(kMusicFinale, &resInfoFinale);
1006  } else if (_flags.platform == Common::kPlatformPC98) {
1007  SoundResourceInfo_TownsPC98V2 resInfoIntro(0, 0, "intro%d.86", 0, 0);
1008  SoundResourceInfo_TownsPC98V2 resInfoIngame(0, 0, "km%02d.86", 0, 0);
1009  SoundResourceInfo_TownsPC98V2 resInfoFinale(0, 0, "finale%d.86", 0, 0);
1010  _sound->initAudioResourceInfo(kMusicIntro, &resInfoIntro);
1011  _sound->initAudioResourceInfo(kMusicIngame, &resInfoIngame);
1012  _sound->initAudioResourceInfo(kMusicFinale, &resInfoFinale);
1013  }
1014 }
1015 
1017  int tmp = 0;
1018  _mainMenuStrings = _staticres->loadStrings(k3MainMenuStrings, _mainMenuStringsSize);
1019  _soundList = _staticres->loadStrings(k3MusicFiles, _soundListSize);
1020  _scoreTable = _staticres->loadRawData(k3ScoreTable, _scoreTableSize);
1021  _sfxFileList = _staticres->loadStrings(k3SfxFiles, _sfxFileListSize);
1022  _sfxFileMap = _staticres->loadRawData(k3SfxMap, _sfxFileMapSize);
1023  _itemAnimDefinition = _staticres->loadItemAnimDefinition(k3ItemAnimData, tmp);
1024  _itemMagicTable = _staticres->loadRawData(k3ItemMagicTable, tmp);
1025  _itemStringMap = _staticres->loadRawData(k3ItemStringMap, _itemStringMapSize);
1026 }
1027 
1028 const uint8 Screen_LoK_16::_palette16[48] = {
1029  0x00, 0x00, 0x00, 0x02, 0x07, 0x0B, 0x0C, 0x06, 0x04,
1030  0x0E, 0x09, 0x07, 0x00, 0x06, 0x03, 0x00, 0x0C, 0x07,
1031  0x0A, 0x0A, 0x0A, 0x08, 0x03, 0x03, 0x02, 0x02, 0x02,
1032  0x08, 0x0B, 0x0E, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x0A,
1033  0x05, 0x05, 0x05, 0x00, 0x0F, 0x0F, 0x0F, 0x0D, 0x00,
1034  0x0F, 0x0F, 0x0F
1035 };
1036 
1038  { 0x00, 0x00, 0x28, 0xC8, 0x0F, 0x0C, 0x00, 0x00 },
1039  { 0x08, 0x48, 0x18, 0x38, 0x0F, 0x0C, 0x00, 0x00 },
1040  { 0x01, 0x08, 0x26, 0x80, 0x0F, 0x0C, 0x00, 0x00 },
1041  { 0x00, 0xC2, 0x28, 0x06, 0x0F, 0x0C, 0x00, 0x00 },
1042  { 0x00, 0x90, 0x28, 0x38, 0x04, 0x0C, 0x00, 0x00 },
1043  { 0x01, 0x94, 0x26, 0x30, 0x04, 0x1B, 0x00, 0x00 },
1044  { 0x00, 0x90, 0x28, 0x38, 0x0F, 0x0D, 0x00, 0x00 },
1045  { 0x01, 0x96, 0x26, 0x32, 0x0F, 0x0D, 0x00, 0x00 },
1046  { 0x00, 0x00, 0x28, 0x88, 0x0F, 0x0C, 0x00, 0x00 },
1047  { 0x01, 0x20, 0x26, 0x80, 0x0F, 0x0C, 0x00, 0x00 },
1048  { 0x03, 0x28, 0x22, 0x46, 0x0F, 0x0D, 0x00, 0x00 }
1049 };
1050 
1051 const int Screen_LoK::_screenDimTableCount = ARRAYSIZE(Screen_LoK::_screenDimTable);
1052 
1054  { 0x00, 0x00, 0x28, 0xC8, 0xC7, 0xCF, 0x00, 0x00 },
1055  { 0x08, 0x48, 0x18, 0x38, 0xC7, 0xCF, 0x00, 0x00 },
1056  { 0x00, 0x00, 0x28, 0x90, 0xC7, 0xCF, 0x00, 0x00 },
1057  { 0x00, 0xC2, 0x28, 0x06, 0xC7, 0xCF, 0x00, 0x00 },
1058  { 0x00, 0x90, 0x28, 0x38, 0x96, 0xCF, 0x00, 0x00 },
1059  { 0x01, 0x94, 0x26, 0x30, 0x96, 0x1B, 0x00, 0x00 },
1060  { 0x00, 0x90, 0x28, 0x38, 0xC7, 0xCC, 0x00, 0x00 },
1061  { 0x01, 0x96, 0x26, 0x32, 0xC7, 0xCC, 0x00, 0x00 },
1062  { 0x00, 0x00, 0x28, 0x88, 0xC7, 0xCF, 0x00, 0x00 },
1063  { 0x00, 0x08, 0x28, 0xB8, 0xC7, 0xCF, 0x00, 0x00 },
1064  { 0x01, 0x28, 0x26, 0x46, 0xC7, 0xCC, 0x00, 0x00 },
1065  { 0x0A, 0x96, 0x14, 0x30, 0x19, 0xF0, 0x00, 0x00 } // menu, just present for current menu code
1066 };
1067 
1068 const int Screen_HoF::_screenDimTableCount = ARRAYSIZE(Screen_HoF::_screenDimTable);
1069 
1071  { 0x00, 0x00, 0x28, 0xC8, 0xFF, 0xF0, 0x00, 0x00 },
1072  { 0x08, 0x48, 0x18, 0x38, 0xFF, 0xF0, 0x00, 0x00 },
1073  { 0x00, 0x00, 0x28, 0xBC, 0xFF, 0xF0, 0x00, 0x00 },
1074  { 0x0A, 0x96, 0x14, 0x30, 0x19, 0xF0, 0x00, 0x00 }
1075 };
1076 
1077 const int Screen_MR::_screenDimTableCount = ARRAYSIZE(Screen_MR::_screenDimTable);
1078 
1080  4, 4, 0, -4, -4, -4, 0, 4
1081 };
1082 
1084  0, -2, -2, -2, 0, 2, 2, 2
1085 };
1086 
1088  0, 4, 4, 4, 0, -4, -4, -4
1089 };
1090 
1092  -2, -2, 0, 2, 2, 2, 0, -2
1093 };
1094 
1096  95, 115, 135, 155, 175, 95, 115, 135, 155, 175
1097 };
1098 
1099 const uint8 KyraEngine_LoK::_itemPosY[] = {
1100  160, 160, 160, 160, 160, 181, 181, 181, 181, 181
1101 };
1102 
1104  GUI_V1_BUTTON(_scrollUpButton, 0x12, 1, 1, 1, 0x483, 0, 0, 0, 0x18, 0x0F, 0);
1105  GUI_V1_BUTTON(_scrollDownButton, 0x13, 1, 1, 1, 0x483, 0, 0, 0, 0x18, 0x0F, 0);
1106 
1107  GUI_V1_BUTTON(_menuButtonData[0], 0x0C, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0);
1108  GUI_V1_BUTTON(_menuButtonData[1], 0x0D, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0);
1109  GUI_V1_BUTTON(_menuButtonData[2], 0x0E, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0);
1110  GUI_V1_BUTTON(_menuButtonData[3], 0x0F, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0);
1111  GUI_V1_BUTTON(_menuButtonData[4], 0x10, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0);
1112  GUI_V1_BUTTON(_menuButtonData[5], 0x11, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0);
1113 
1114  delete[] _menu;
1115  _menu = new Menu[6];
1116  assert(_menu);
1117 
1118  Button::Callback quitPlayingFunctor = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::quitPlaying);
1119  Button::Callback loadGameMenuFunctor = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::loadGameMenu);
1120  Button::Callback cancelSubMenuFunctor = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::cancelSubMenu);
1121 
1122  GUI_V1_MENU(_menu[0], -1, -1, 0x100, 0x8B, 248, 249, 250, 0, 251, -1, 8, 0, 5, -1, -1, -1, -1);
1123  GUI_V1_MENU_ITEM(_menu[0].item[0], 1, 0, 0, 0, -1, -1, 0x1E, 0xDC, 0x0F, 252, 253, -1, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
1124  GUI_V1_MENU_ITEM(_menu[0].item[1], 1, 0, 0, 0, -1, -1, 0x2F, 0xDC, 0x0F, 252, 253, -1, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
1125  GUI_V1_MENU_ITEM(_menu[0].item[2], 1, 0, 0, 0, -1, -1, 0x40, 0xDC, 0x0F, 252, 253, -1, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
1126  GUI_V1_MENU_ITEM(_menu[0].item[3], 1, 0, 0, 0, -1, -1, 0x51, 0xDC, 0x0F, 252, 253, -1, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
1127  GUI_V1_MENU_ITEM(_menu[0].item[4], 1, 0, 0, 0, -1, 0, 0x6E, 0xDC, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, 0, 0, 0, 0, 0);
1128  _menu[0].item[0].callback = loadGameMenuFunctor;
1129  _menu[0].item[1].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::saveGameMenu);
1130  _menu[0].item[2].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::gameControlsMenu);
1131  _menu[0].item[3].callback = quitPlayingFunctor;
1132  _menu[0].item[4].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::resumeGame);
1133 
1134  GUI_V1_MENU(_menu[1], -1, -1, 0x140, 0x38, 248, 249, 250, 0, 254, -1, 8, 0, 2, -1, -1, -1, -1);
1135  GUI_V1_MENU_ITEM(_menu[1].item[0], 1, 0, 0, 0, 0x18, 0, 0x1E, 0x48, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, 0, 0, 0, 0, 0);
1136  GUI_V1_MENU_ITEM(_menu[1].item[1], 1, 0, 0, 0, 0xD8, 0, 0x1E, 0x48, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, 0, 0, 0, 0, 0);
1137  _menu[1].item[0].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::quitConfirmYes);
1138  _menu[1].item[1].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::quitConfirmNo);
1139 
1140  GUI_V1_MENU(_menu[2], -1, -1, 0x120, 0xA0, 248, 249, 250, 0, 251, -1, 8, 0, 6, 132, 22, 132, 124);
1141  GUI_V1_MENU_ITEM(_menu[2].item[0], 1, 0, 0, 0, -1, 255, 0x27, 0x100, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
1142  GUI_V1_MENU_ITEM(_menu[2].item[1], 1, 0, 0, 0, -1, 255, 0x38, 0x100, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
1143  GUI_V1_MENU_ITEM(_menu[2].item[2], 1, 0, 0, 0, -1, 255, 0x49, 0x100, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
1144  GUI_V1_MENU_ITEM(_menu[2].item[3], 1, 0, 0, 0, -1, 255, 0x5A, 0x100, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
1145  GUI_V1_MENU_ITEM(_menu[2].item[4], 1, 0, 0, 0, -1, 255, 0x6B, 0x100, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
1146  GUI_V1_MENU_ITEM(_menu[2].item[5], 1, 0, 0, 0, 0xB8, 0, 0x86, 0x58, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, 0, 0, 0, 0, 0);
1147  _menu[2].item[5].callback = cancelSubMenuFunctor;
1148 
1149  GUI_V1_MENU(_menu[3], -1, -1, 288, 67, 248, 249, 250, 0, 251, -1, 8, 0, 2, -1, -1, -1, -1);
1150  GUI_V1_MENU_ITEM(_menu[3].item[0], 1, 0, 0, 0, 24, 0, 44, 85, 15, 252, 253, -1, 255, 248, 249, 250, -1, 0, 0, 0, 0, 0);
1151  GUI_V1_MENU_ITEM(_menu[3].item[1], 1, 0, 0, 0, 179, 0, 44, 85, 15, 252, 253, -1, 255, 248, 249, 250, -1, 0, 0, 0, 0, 0);
1152  _menu[3].item[0].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::savegameConfirm);
1153  _menu[3].item[1].callback = cancelSubMenuFunctor;
1154 
1155  GUI_V1_MENU(_menu[4], -1, -1, 0xD0, 0x4C, 248, 249, 250, 0, 251, -1, 8, 0, 2, -1, -1, -1, -1);
1156  GUI_V1_MENU_ITEM(_menu[4].item[0], 1, 0, 0, 0, -1, -1, 0x1E, 0xB4, 0x0F, 252, 253, -1, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
1157  GUI_V1_MENU_ITEM(_menu[4].item[1], 1, 0, 0, 0, -1, -1, 0x2F, 0xB4, 0x0F, 252, 253, -1, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
1158  _menu[4].item[0].callback = loadGameMenuFunctor;
1159  _menu[4].item[1].callback = quitPlayingFunctor;
1160 
1161  GUI_V1_MENU(_menu[5], -1, -1, 0x130, 0x99, 248, 249, 250, 0, 251, -1, 8, 0, 6, -1, -1, -1, -1);
1162  GUI_V1_MENU_ITEM(_menu[5].item[0], 1, 0, 0, 0, 0xA5, 0, 0x1E, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0x10, 0x20, 0, 0);
1163  GUI_V1_MENU_ITEM(_menu[5].item[1], 1, 0, 0, 0, 0xA5, 0, 0x2F, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0x10, 0x31, 0, 0);
1164  GUI_V1_MENU_ITEM(_menu[5].item[2], 1, 0, 0, 0, 0xA5, 0, 0x40, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0x10, 0x42, 0, 0);
1165  GUI_V1_MENU_ITEM(_menu[5].item[3], 1, 0, 0, 0, 0xA5, 0, 0x51, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0x10, 0x53, 0, 0);
1166  GUI_V1_MENU_ITEM(_menu[5].item[4], 1, 0, 0, 0, 0xA5, 0, 0x62, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0x10, 0x65, 0, 0);
1167  GUI_V1_MENU_ITEM(_menu[5].item[5], 1, 0, 0, 0, -1, 0, 0x7F, 0x6C, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, 0, 0, 0, 0, 0);
1168  _menu[5].item[0].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::controlsChangeMusic);
1169  _menu[5].item[1].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::controlsChangeSounds);
1170  _menu[5].item[2].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::controlsChangeWalk);
1171  _menu[5].item[4].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::controlsChangeText);
1172  _menu[5].item[5].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::controlsApply);
1173 
1174  // The AMIGA version uses different colors, due to its 32 color nature. We did setup the 256 color version
1175  // colors above, so we need to overwrite those with the correct values over here.
1176  if (_vm->gameFlags().platform == Common::kPlatformAmiga) {
1177  for (int i = 0; i < 6; ++i) {
1178  _menu[i].bkgdColor = 17;
1179  _menu[i].color1 = 31;
1180  _menu[i].color2 = 18;
1181 
1182  for (int j = 0; j < _menu[i].numberOfItems; ++j) {
1183  _menu[i].item[j].bkgdColor = 17;
1184  _menu[i].item[j].color1 = 31;
1185  _menu[i].item[j].color2 = 18;
1186  }
1187  }
1188  }
1189 }
1190 
1192  delete[] _buttonData;
1193  delete[] _buttonDataListPtr;
1194 
1195  _buttonData = new Button[15];
1196  assert(_buttonData);
1197  _buttonDataListPtr = new Button *[15];
1198  assert(_buttonDataListPtr);
1199 
1200  GUI_V1_BUTTON(_buttonData[1], 0x01, 1, 1, 1, 0x0487, 0, 0x009, 0xA4, 0x36, 0x1E, 0);
1201  _buttonData[1].buttonCallback = BUTTON_FUNCTOR(GUI_LoK, _gui, &GUI_LoK::buttonMenuCallback);
1202 
1204  for (int i = 2; i <= 10; ++i)
1205  _buttonData[i].buttonCallback = inventoryFunctor;
1206  _buttonData[0].buttonCallback = inventoryFunctor;
1207  GUI_V1_BUTTON(_buttonData[0], 0x02, 0, 0, 0, 0x0400, 0, 0x05D, 0x9E, 0x13, 0x13, 0);
1208  GUI_V1_BUTTON(_buttonData[2], 0x03, 0, 0, 0, 0x0400, 0, 0x071, 0x9E, 0x13, 0x14, 0);
1209  GUI_V1_BUTTON(_buttonData[3], 0x04, 0, 0, 0, 0x0400, 0, 0x085, 0x9E, 0x13, 0x14, 0);
1210  GUI_V1_BUTTON(_buttonData[4], 0x05, 0, 0, 0, 0x0400, 0, 0x099, 0x9E, 0x13, 0x14, 0);
1211  GUI_V1_BUTTON(_buttonData[5], 0x06, 0, 0, 0, 0x0400, 0, 0x0AD, 0x9E, 0x13, 0x14, 0);
1212  GUI_V1_BUTTON(_buttonData[6], 0x07, 0, 0, 0, 0x0400, 0, 0x05D, 0xB3, 0x13, 0x14, 0);
1213  GUI_V1_BUTTON(_buttonData[7], 0x08, 0, 0, 0, 0x0400, 0, 0x071, 0xB3, 0x13, 0x14, 0);
1214  GUI_V1_BUTTON(_buttonData[8], 0x09, 0, 0, 0, 0x0400, 0, 0x085, 0xB3, 0x13, 0x14, 0);
1215  GUI_V1_BUTTON(_buttonData[9], 0x0A, 0, 0, 0, 0x0400, 0, 0x099, 0xB3, 0x13, 0x14, 0);
1216  GUI_V1_BUTTON(_buttonData[10], 0x0B, 0, 0, 0, 0x0400, 0, 0x0AD, 0xB3, 0x13, 0x14, 0);
1217 
1219  GUI_V1_BUTTON(_buttonData[11], 0x15, 1, 1, 1, 0x0487, 0, 0x0FD, 0x9C, 0x1A, 0x12, 0);
1220  GUI_V1_BUTTON(_buttonData[12], 0x16, 1, 1, 1, 0x0487, 0, 0x0E7, 0xAA, 0x1A, 0x12, 0);
1221  GUI_V1_BUTTON(_buttonData[13], 0x17, 1, 1, 1, 0x0487, 0, 0x0FD, 0xB5, 0x1A, 0x12, 0);
1222  GUI_V1_BUTTON(_buttonData[14], 0x18, 1, 1, 1, 0x0487, 0, 0x113, 0xAA, 0x1A, 0x12, 0);
1223  for (int i = 11; i <= 14; ++i)
1224  _buttonData[i].buttonCallback = amuletFunctor;
1225 
1226  for (int i = 1; i < 15; ++i)
1227  _buttonDataListPtr[i - 1] = &_buttonData[i];
1228  _buttonDataListPtr[14] = 0;
1229 }
1230 
1232  0xAD, 0xB7, 0xBE, 0x00
1233 };
1234 
1236  0xB1, 0xB9, 0xC2, 0x00
1237 };
1238 
1240  0xB2, 0xBA, 0xC3, 0x00
1241 };
1242 
1244  0xB6, 0xBD, 0xC8, 0x00
1245 };
1246 
1247 const uint16 KyraEngine_LoK::_amuletX[] = { 231, 275, 253, 253 };
1248 const uint16 KyraEngine_LoK::_amuletY[] = { 170, 170, 159, 181 };
1249 
1250 const uint16 KyraEngine_LoK::_amuletX2[] = { 0x000, 0x0FD, 0x0E7, 0x0FD, 0x113, 0x000 };
1251 const uint16 KyraEngine_LoK::_amuletY2[] = { 0x000, 0x09F, 0x0AA, 0x0B5, 0x0AA, 0x000 };
1252 
1254  -1, 0, -1, 1, 0, 3, 0, 2,
1255  0, 4, 1, 2, 1, 3, 1, 4,
1256  1, 92, 1, 6, 1, 7, 2, 2,
1257  2, 3, 2, 4, 2, 5, 2, 6,
1258  2, 7, 3, 3, 3, 4, 1, 8,
1259  1, 9, 4, 2, 4, 3, 4, 4,
1260  4, 5, 4, 6, 4, 7, 4, 8,
1261  1, 11, 1, 12, 1, 14, 1, 13,
1262  4, 9, 5, 12, 6, 2, 6, 6,
1263  6, 7, 6, 8, 6, 9, 6, 3,
1264  6, 4, 6, 5, 7, 2, 7, 3,
1265  7, 4, 7, 5, 7, 6, 7, 7,
1266  7, 8, 7, 9, 8, 2, 8, 3,
1267  8, 4, 8, 5, 6, 11, 5, 11
1268 };
1269 
1270 const int KyraEngine_LoK::_dosTrackMapSize = ARRAYSIZE(KyraEngine_LoK::_dosTrackMap);
1271 
1273  0, 1, 32, 26, 31, 30, 33, 33,
1274  32, 17, 27, 32, 25, 29, 25, 24,
1275  23, 26, 26, 30, 28, 21, 21, 15,
1276  3, 15, 23, 25, 33, 21, 30, 22,
1277  15, 3, 33, 11, 12, 13, 14, 22,
1278  22, 22, 3, 3, 3, 23, 3, 3,
1279  23, 3, 3, 3, 3, 3, 3, 33
1280 };
1281 
1282 const int KyraEngine_LoK::_amigaTrackMapSize = ARRAYSIZE(KyraEngine_LoK::_amigaTrackMap);
1283 
1284 // kyra engine v2 static data
1285 
1286 const int GUI_v2::_sliderBarsPosition[] = {
1287  0x92, 0x1F, 0x92, 0x30, 0x92, 0x41, 0x92, 0x52
1288 };
1289 
1290 // kyra 2 static res
1291 
1292 const char *const KyraEngine_HoF::_languageExtension[] = {
1293  "ENG",
1294  "FRE",
1295  "GER",/*,
1296  "ITA", Italian and Spanish were never included
1297  "SPA"*/
1298  "JPN",
1299 };
1300 
1301 const char *const KyraEngine_HoF::_scriptLangExt[] = {
1302  "EMC",
1303  "FMC",
1304  "GMC",/*,
1305  "IMC", Italian and Spanish were never included
1306  "SMC"*/
1307  "JMC"
1308 };
1309 
1311  0x19, 0x09, 0x09, 0x12, 0x12, 0x12, 0x09, 0x09
1312 };
1313 
1314 const int KyraEngine_HoF::_inventoryX[] = {
1315  0x4F, 0x63, 0x77, 0x8B, 0x9F, 0x4F, 0x63, 0x77, 0x8B, 0x9F
1316 };
1317 
1318 const int KyraEngine_HoF::_inventoryY[] = {
1319  0x95, 0x95, 0x95, 0x95, 0x95, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA
1320 };
1321 
1323  2, 2, 0, 0, 2, 2, 2, 0,
1324  2, 2, 0, 0, 0, 2, 0, 0,
1325  0, 0, 0, 0, 2, 0, 0, 0,
1326  0, 1, 0, 2, 2, 2, 2, 0,
1327  3, 0, 3, 2, 2, 2, 3, 2,
1328  2, 2, 0, 0, 0, 0, 0, 0,
1329  0, 0, 0, 0, 2, 0, 0, 0,
1330  0, 0, 0, 0, 0, 2, 0, 0,
1331  2, 0, 0, 0, 0, 0, 0, 2,
1332  2, 0, 0, 0, 2, 2, 2, 2,
1333  2, 2, 2, 2, 2, 2, 2, 2,
1334  2, 2, 2, 2, 2, 2, 2, 0,
1335  2, 2, 2, 0, 0, 1, 3, 2,
1336  2, 2, 2, 2, 2, 0, 0, 0,
1337  0, 2, 2, 1, 0, 1, 2, 0,
1338  0, 0, 0, 0, 0, 2, 2, 2,
1339  2, 2, 2, 2, 0, 2, 2, 2,
1340  2, 3, 2, 0, 0, 0, 0, 1,
1341  2, 0, 0, 0, 0, 0, 0, 0,
1342  0, 0, 0, 0, 0, 0, 0, 0,
1343  2, 2, 0, 0, 0, 0, 0, 2,
1344  0, 2, 0, 0, 0, 0, 0, 0
1345 };
1346 
1347 const int KyraEngine_HoF::_itemStringMapSize = ARRAYSIZE(KyraEngine_HoF::_itemStringMap);
1348 
1350  -1, 0, -1, 1, 9, 6, 5, 4,
1351  8, 3, -2, 0, -2, 0, 2, 3,
1352  -2, 0, -2, 0, -2, 0, -2, 0,
1353  0, 2, 0, 3, 1, 2, 1, 3,
1354  2, 2, 2, 0, 3, 2, 3, 3,
1355  3, 4, 4, 2, 5, 2, 5, 3,
1356  5, 4, 6, 2, 6, 3, 6, 4,
1357  6, 5, 6, 6, 6, 7, 6, 8,
1358  6, 0, 6, 9, 7, 2, 7, 3,
1359  7, 4, 7, 5, 8, 6, 7, 6,
1360  7, 7, 7, 8, 7, 9, 8, 2,
1361  14, 2, 8, 4, 8, 7, 8, 8,
1362  8, 9, 9, 2, 9, 3, 9, 4,
1363  9, 5, 9, 7, 9, 8, 9, 9,
1364  10, 2, 10, 3, 10, 4, 10, 5,
1365  10, 6, 10, 7, 11, 2, 11, 3,
1366  11, 4, 11, 5, 11, 6, 11, 7,
1367  11, 8, 11, 9, 12, 2, 12, 3,
1368  12, 4, 12, 5, 12, 6, 12, 7,
1369  12, 8, 12, 9, 13, 2, 4, 7,
1370  14, 3, 14, 4, 14, 5, 4, 2,
1371  4, 3, 4, 4, 4, 5, 4, 6
1372 };
1373 
1374 const int KyraEngine_HoF::_dosTrackMapSize = ARRAYSIZE(KyraEngine_HoF::_dosTrackMap);
1375 
1377  -1, -1, -1, -1, -1, -1, -1, -1,
1378  -1, -1, -1, 49, 27, 5, 36, 13,
1379  -1, -1, 68, 55, 37, 73, 43, 61,
1380  49, -1, 56, -1, 62, 38, -1, -1,
1381  61, -1, -1, 31, 70, 2, 45, -1,
1382  45, -1, -1, -1, 10, 14, 24, 25,
1383  -1, -1, 59, 9, 26, -1, 71, 79,
1384  12, 9, -1, -1, 61, -1, -1, 65,
1385  66, 50, 27, 24, 29, 29, 15, 16,
1386  17, 18, 19, 20, 21, 57, -1, -1,
1387  34, 3, -1, 56, 56, -1, -1, 50,
1388  43, 68, 32, 33, 67, 25, 60, 40,
1389  39, 11, 24, 2, 60, 3, 46, 54,
1390  1, 8, -1, -1, 41, 42, 37, 74,
1391  69, 62, 58, 27, -1, -1, -1, -1,
1392  48, 4, -1, 25, 39, 40, 24, 58,
1393  35, 4, 4, 4, -1, 50, -1, 6,
1394  8, -1, -1, -1, -1, -1, 53, 52,
1395  -1, 63, 47, -1, -1, -1, 53, -1,
1396  29, -1, -1, 79, -1, 41, 12, -1,
1397  -1, -1, 26, -1, 7, 27, 72, 51,
1398  23, 51, 64, -1, -1, -1, 27, 76,
1399  77, 78, 28, 47, -1, -1, 53, -1,
1400  -1, -1, -1, -1, 2, 22, -1, 51,
1401  58, -1, -1, 30, -1, 79, -1, -1,
1402  22, 36, 1, -1, 12, 1, -1, -1,
1403  41, -1, 76, 77, 47
1404 };
1405 
1406 const int KyraEngine_HoF::_mt32SfxMapSize = ARRAYSIZE(KyraEngine_HoF::_mt32SfxMap);
1407 
1408 const int8 KyraEngine_HoF::_gmSfxMap[] = {
1409  -1, -1, -1, -1, -1, -1, -1, -1,
1410  -1, -1, -1, 31, 25, 19, 12, 4,
1411  -1, -1, 46, 18, -1, 21, 15, -1,
1412  31, -1, -1, -1, -1, -1, 47, -1,
1413  33, -1, 36, -1, -1, 23, 48, -1,
1414  48, -1, -1, 49, -1, 50, 22, 24,
1415  51, -1, 52, 20, -1, -1, 22, 53,
1416  3, 20, 47, 54, 33, -1, 55, 56,
1417  57, 33, -1, 51, 58, -1, 5, 6,
1418  7, 8, 9, 10, 11, 22, -1, -1,
1419  -1, 24, -1, 26, 17, -1, -1, 33,
1420  15, -1, 23, 23, -1, 22, -1, 23,
1421  24, 21, 22, -1, -1, 24, 16, -1,
1422  1, 48, -1, -1, 13, 14, -1, 29,
1423  64, -1, -1, 25, -1, -1, -1, -1,
1424  -1, 2, 13, 24, 23, 23, 22, -1,
1425  60, 2, 2, 2, -1, 33, -1, 61,
1426  48, 62, -1, 39, -1, -1, 28, 63,
1427  33, -1, 17, -1, 45, 45, 28, 55,
1428  34, -1, -1, 34, 55, 13, -1, 47,
1429  54, -1, -1, 33, 44, 25, -1, -1,
1430  -1, 32, -1, -1, -1, -1, 25, 37,
1431  37, 37, 26, 43, -1, 42, 24, -1,
1432  -1, -1, -1, -1, 23, 32, -1, 32,
1433  -1, -1, -1, 27, 41, 34, -1, 40,
1434  32, -1, 16, 40, -1, 16, 38, 39,
1435  13, -1, 37, 28, 33
1436 };
1437 
1438 const int KyraEngine_HoF::_gmSfxMapSize = ARRAYSIZE(KyraEngine_HoF::_gmSfxMap);
1439 
1441  -1, -1, -1, -1, -1, -1, -1, -1,
1442  -1, -1, -1, 0, 1, 2, 3, 4,
1443  5, 6, -1, 7, 8, 9, 10, -1,
1444  6, -1, -1, 11, -1, 12, -1, -1,
1445  -1, -1, -1, 13, -1, 39, 14, 15,
1446  3, 16, 16, -1, -1, -1, 17, 18,
1447  5, -1, -1, -1, -1, -1, 19, 20,
1448  21, -1, 22, 23, -1, -1, -1, -1,
1449  -1, -1, 39, -1, 24, 24, 25, 26,
1450  27, 28, 29, 30, 31, 32, -1, -1,
1451  -1, 2, -1, -1, -1, -1, -1, 21,
1452  10, -1, -1, -1, -1, 17, -1, 17,
1453  40, -1, 18, 38, -1, 40, 33, -1,
1454  34, 35, 36, 37, 38, 39, 40, 41,
1455  -1, -1, -1, -1, -1, -1, -1, -1,
1456  -1, -1, 42, 43, 44, 45, -1, -1,
1457  -1, -1, -1, -1, 46, -1, 5, 47,
1458  48, -1, -1, -1, -1, -1, 49, 50,
1459  -1, 40, -1, 24, -1, -1, 43, -1,
1460  -1, 38, -1, -1, -1, 51, -1, -1,
1461  -1, -1, -1, -1, -1, 9, -1, 52,
1462  53, 40, -1, -1, -1, -1, -1, -1,
1463  -1, -1, 50, -1, -1, -1, 11, 54,
1464  5, -1, -1, -1, -1, 11, 7, 55,
1465  8, 36, -1, -1, -1, -1, -1, -1,
1466  11, -1, -1, -1, -1, -1, -1, -1,
1467  -1, -1, -1, -1, 24
1468 };
1469 
1470 const int KyraEngine_HoF::_pcSpkSfxMapSize = ARRAYSIZE(KyraEngine_HoF::_pcSpkSfxMap);
1471 
1473  delete[] _inventoryButtons;
1474 
1475  _inventoryButtons = new Button[15];
1476  assert(_inventoryButtons);
1477 
1478  GUI_V2_BUTTON(_inventoryButtons[0], 0x1, 0x4F, 0, 1, 1, 1, 0x4487, 0, 0x00A, 0x95, 0x39, 0x1D, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
1479  _inventoryButtons[0].buttonCallback = BUTTON_FUNCTOR(GUI_HoF, _gui, &GUI_HoF::optionsButton);
1480 
1481  GUI_V2_BUTTON(_inventoryButtons[1], 0x2, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x104, 0x90, 0x3C, 0x2C, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
1482  _inventoryButtons[1].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::cauldronButton);
1483 
1484  GUI_V2_BUTTON(_inventoryButtons[2], 0x5, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x0FA, 0x90, 0x0A, 0x2C, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
1485  _inventoryButtons[2].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::cauldronClearButton);
1486 
1487  GUI_V2_BUTTON(_inventoryButtons[3], 0x3, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x0CE, 0x90, 0x2C, 0x2C, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
1488  _inventoryButtons[3].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::bookButton);
1489 
1490  GUI_V2_BUTTON(_inventoryButtons[4], 0x4, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x0B6, 0x9D, 0x18, 0x1E, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
1491  _inventoryButtons[4].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::scrollInventory);
1492 
1494  GUI_V2_BUTTON(_inventoryButtons[5], 0x6, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x04D, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
1495  GUI_V2_BUTTON(_inventoryButtons[6], 0x7, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x061, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
1496  GUI_V2_BUTTON(_inventoryButtons[7], 0x8, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x075, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
1497  GUI_V2_BUTTON(_inventoryButtons[8], 0x9, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x089, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
1498  GUI_V2_BUTTON(_inventoryButtons[9], 0xA, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x09D, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
1499  GUI_V2_BUTTON(_inventoryButtons[10], 0xB, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x04D, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
1500  GUI_V2_BUTTON(_inventoryButtons[11], 0xC, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x061, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
1501  GUI_V2_BUTTON(_inventoryButtons[12], 0xD, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x075, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
1502  GUI_V2_BUTTON(_inventoryButtons[13], 0xE, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x089, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
1503  GUI_V2_BUTTON(_inventoryButtons[14], 0xF, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x09D, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
1504 
1505  for (int i = 5; i <= 14; ++i)
1506  _inventoryButtons[i].buttonCallback = inventoryCallback;
1507 
1508  _buttonList = &_inventoryButtons[0];
1509  for (int i = 1; i < 15; ++i)
1510  _buttonList = _gui->addButtonToList(_buttonList, &_inventoryButtons[i]);
1511 }
1512 
1514  GUI_V2_BUTTON(_scrollUpButton, 0x17, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x18, 0x0F, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
1515  GUI_V2_BUTTON(_scrollDownButton, 0x18, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x18, 0x0F, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
1516 
1517  for (int i = 0; i < 4; ++i)
1518  GUI_V2_BUTTON(_sliderButtons[0][i], 0x18 + i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x0A, 0x0E, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
1519  for (int i = 0; i < 4; ++i)
1520  GUI_V2_BUTTON(_sliderButtons[1][i], 0x1C + i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x0A, 0x0E, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
1521  for (int i = 0; i < 4; ++i)
1522  GUI_V2_BUTTON(_sliderButtons[2][i], 0x20 + i, 0, 0, 0, 0, 0, 0x2200, 0, 0, 0, 0x6E, 0x0E, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
1523 
1524  for (uint i = 0; i < ARRAYSIZE(_menuButtons); ++i)
1525  GUI_V2_BUTTON(_menuButtons[i], 0x10 + i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0, 0, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
1526 
1527  Button::Callback clickLoadSlotFunctor = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::clickLoadSlot);
1528  Button::Callback clickSaveSlotFunctor = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::clickSaveSlot);
1529  Button::Callback clickLoadMenuFunctor = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::loadMenu);
1530  Button::Callback clickQuitGameFunctor = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::quitGame);
1531  Button::Callback clickQuitOptionsFunctor = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::quitOptionsMenu);
1532 
1533  const uint16 *menuStr = _vm->gameFlags().isTalkie ? _menuStringsTalkie : _menuStringsOther;
1534 
1535  GUI_V2_MENU(_mainMenu, -1, -1, 0x100, 0xAC, 0xF8, 0xF9, 0xFA, menuStr[0 * 8], 0xFB, -1, 8, 0, 7, -1, -1, -1, -1);
1536  GUI_V2_MENU_ITEM(_mainMenu.item[0], 1, 0x02, -1, 0x1E, 0xDC, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1537  _mainMenu.item[0].callback = clickLoadMenuFunctor;
1538  GUI_V2_MENU_ITEM(_mainMenu.item[1], 1, 0x03, -1, 0x2F, 0xDC, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1539  _mainMenu.item[1].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::saveMenu);
1540  GUI_V2_MENU_ITEM(_mainMenu.item[2], 1, 0x23, -1, 0x40, 0xDC, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1541  _mainMenu.item[2].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::deleteMenu);
1542  GUI_V2_MENU_ITEM(_mainMenu.item[3], 1, 0x04, -1, 0x51, 0xDC, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1543  _mainMenu.item[3].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::gameOptionsTalkie);
1544  GUI_V2_MENU_ITEM(_mainMenu.item[4], 1, 0x25, -1, 0x62, 0xDC, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1545  _mainMenu.item[4].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::audioOptions);
1546  GUI_V2_MENU_ITEM(_mainMenu.item[5], 1, 0x05, -1, 0x73, 0xDC, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1547  _mainMenu.item[5].callback = clickQuitGameFunctor;
1548  GUI_V2_MENU_ITEM(_mainMenu.item[6], 1, 0x06, -1, 0x90, 0xDC, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1549  _mainMenu.item[6].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::resumeGame);
1550  for (int i = 0; i < 7; ++i)
1551  _mainMenu.item[i].itemId = menuStr[0 * 8 + i + 1];
1552 
1553  if (!_vm->gameFlags().isTalkie) {
1554  _mainMenu.height = 0x9C;
1555  _mainMenu.numberOfItems = 6;
1556  _mainMenu.item[6].enabled = false;
1557  for (int i = 4; i < 6; ++i)
1558  _mainMenu.item[i].callback = _mainMenu.item[i + 1].callback;
1559  _mainMenu.item[3].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::gameOptions);
1560  _mainMenu.item[6].callback = Button::Callback();
1561  _mainMenu.item[5].y = 0x7F;
1562  }
1563 
1564  GUI_V2_MENU(_gameOptions, -1, -1, 0x120, 0x88, 0xF8, 0xF9, 0xFA, menuStr[1 * 8], 0xFB, -1, 8, 4, 4, -1, -1, -1, -1);
1565  if (_vm->gameFlags().isTalkie) {
1566  GUI_V2_MENU_ITEM(_gameOptions.item[0], 1, 0, 0xA0, 0x1E, 0x74, 0x0F, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0x15, 8, 0x20, 0);
1567  _gameOptions.item[0].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::toggleWalkspeed);
1568  GUI_V2_MENU_ITEM(_gameOptions.item[1], 1, 0, 0xA0, 0x2F, 0x74, 0x0F, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0x26, 8, 0x31, 0);
1569  _gameOptions.item[1].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::changeLanguage);
1570  GUI_V2_MENU_ITEM(_gameOptions.item[2], 1, 0, 0xA0, 0x40, 0x74, 0x0F, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0x16, 8, 0x42, 0);
1571  _gameOptions.item[2].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::toggleText);
1572  GUI_V2_MENU_ITEM(_gameOptions.item[3], 1, 0x10, -1, 0x6E, 0x6C, 0x0F, 0xFD, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1573  _gameOptions.item[3].callback = clickQuitOptionsFunctor;
1574  } else {
1575  _gameOptions.numberOfItems = 5;
1576  GUI_V2_MENU_ITEM(_gameOptions.item[0], 0, 0x2B, 0xA0, 0x1E, 0x74, 0x0F, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0x1F, 0x10, 0x20, 0);
1577  GUI_V2_MENU_ITEM(_gameOptions.item[1], 0, 0x2C, 0xA0, 0x2F, 0x74, 0x0F, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0x20, 0x10, 0x31, 0);
1578  GUI_V2_MENU_ITEM(_gameOptions.item[2], 0, 0x2D, 0xA0, 0x40, 0x74, 0x0F, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0x1D, 0x10, 0x42, 0);
1579  GUI_V2_MENU_ITEM(_gameOptions.item[3], 0, 0x2E, 0xA0, 0x51, 0x74, 0x0F, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0x1E, 0x10, 0x53, 0);
1580  GUI_V2_MENU_ITEM(_gameOptions.item[4], 1, 0x18, -1, 0x6E, 0x6C, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1581  _gameOptions.item[4].callback = clickQuitOptionsFunctor;
1582  }
1583 
1584  for (int i = _gameOptions.numberOfItems; i <= 6; ++i)
1585  _gameOptions.item[i].enabled = false;
1586  for (int i = 0; i < 7; ++i)
1587  _gameOptions.item[i].itemId = menuStr[1 * 8 + i + 1];
1588 
1589  GUI_V2_MENU(_audioOptions, -1, -1, 0x120, 0x88, 0xF8, 0xF9, 0xFA, menuStr[2 * 8], 0xFB, -1, 8, 3, 4, -1, -1, -1, -1);
1590  GUI_V2_MENU_ITEM(_audioOptions.item[0], 0, 0, 0xA0, 0x1E, 0x74, 0x0F, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0x17, 8, 0x20, 0);
1591  GUI_V2_MENU_ITEM(_audioOptions.item[1], 0, 0, 0xA0, 0x2F, 0x74, 0x0F, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0x18, 8, 0x31, 0);
1592  GUI_V2_MENU_ITEM(_audioOptions.item[2], 0, 0, 0xA0, 0x40, 0x74, 0x0F, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0x27, 8, 0x42, 0);
1593  GUI_V2_MENU_ITEM(_audioOptions.item[3], 1, 0x10, -1, 0x6E, 0x5C, 0x0F, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1594  _audioOptions.item[3].callback = clickQuitOptionsFunctor;
1595  for (int i = 4; i <= 6; ++i)
1596  _audioOptions.item[i].enabled = false;
1597  for (int i = 0; i < 7; ++i)
1598  _audioOptions.item[i].itemId = menuStr[2 * 8 + i + 1];
1599 
1600  GUI_V2_MENU(_choiceMenu, -1, -1, 0x140, 0x38, 0xF8, 0xF9, 0xFA, 0, 0xFE, -1, 8, 0, 2, -1, -1, -1, -1);
1601  GUI_V2_MENU_ITEM(_choiceMenu.item[0], 1, 0x14, 0x18, 0x1E, 0x48, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1602  _choiceMenu.item[0].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::choiceYes);
1603  GUI_V2_MENU_ITEM(_choiceMenu.item[1], 1, 0x13, 0xD8, 0x1E, 0x48, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1604  _choiceMenu.item[1].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::choiceNo);
1605  for (int i = 2; i <= 6; ++i)
1606  _choiceMenu.item[i].enabled = false;
1607  for (int i = 0; i < 7; ++i)
1608  _choiceMenu.item[i].itemId = menuStr[3 * 8 + i + 1];
1609 
1610  GUI_V2_MENU(_loadMenu, -1, -1, 0x120, 0xA0, 0xF8, 0xF9, 0xFA, menuStr[4 * 8], 0xFB, -1, 8, 0, 6, 0x84, 0x16, 0x84, 0x7C);
1611  GUI_V2_MENU_ITEM(_loadMenu.item[0], 1, 0x29, -1, 0x27, 0x100, 0xF, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1612  GUI_V2_MENU_ITEM(_loadMenu.item[1], 1, 0x2A, -1, 0x38, 0x100, 0xF, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1613  GUI_V2_MENU_ITEM(_loadMenu.item[2], 1, 0x2B, -1, 0x49, 0x100, 0xF, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1614  GUI_V2_MENU_ITEM(_loadMenu.item[3], 1, 0x2C, -1, 0x5A, 0x100, 0xF, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1615  GUI_V2_MENU_ITEM(_loadMenu.item[4], 1, 0x2D, -1, 0x6B, 0x100, 0xF, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1616  for (int i = 0; i <= 4; ++i)
1617  _loadMenu.item[i].callback = clickLoadSlotFunctor;
1618  GUI_V2_MENU_ITEM(_loadMenu.item[5], 1, 0x0B, 0xB8, 0x86, 0x58, 0xF, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1619  _loadMenu.item[5].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::cancelLoadMenu);
1620  _loadMenu.item[6].enabled = false;
1621  for (int i = 0; i < 7; ++i)
1622  _loadMenu.item[i].itemId = menuStr[4 * 8 + i + 1];
1623 
1624  GUI_V2_MENU(_saveMenu, -1, -1, 0x120, 0xA0, 0xF8, 0xF9, 0xFA, menuStr[5 * 8], 0xFB, -1, 8, 0, 6, 0x84, 0x16, 0x84, 0x7C);
1625  GUI_V2_MENU_ITEM(_saveMenu.item[0], 1, 0x29, -1, 0x27, 0x100, 0xF, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1626  GUI_V2_MENU_ITEM(_saveMenu.item[1], 1, 0x2A, -1, 0x38, 0x100, 0xF, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1627  GUI_V2_MENU_ITEM(_saveMenu.item[2], 1, 0x2B, -1, 0x49, 0x100, 0xF, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1628  GUI_V2_MENU_ITEM(_saveMenu.item[3], 1, 0x2C, -1, 0x5A, 0x100, 0xF, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1629  GUI_V2_MENU_ITEM(_saveMenu.item[4], 1, 0x2D, -1, 0x6B, 0x100, 0xF, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1630  for (int i = 0; i <= 4; ++i)
1631  _saveMenu.item[i].callback = clickSaveSlotFunctor;
1632  GUI_V2_MENU_ITEM(_saveMenu.item[5], 1, 0x0B, 0xB8, 0x86, 0x58, 0xF, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1633  _saveMenu.item[5].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::cancelSaveMenu);
1634  _saveMenu.item[6].enabled = false;
1635  for (int i = 0; i < 7; ++i)
1636  _saveMenu.item[i].itemId = menuStr[5 * 8 + i + 1];
1637 
1638  GUI_V2_MENU(_savenameMenu, -1, -1, 0x140, 0x43, 0xF8, 0xF9, 0xFA, menuStr[6 * 8], 0xFB, -1, 8, 0, 2, -1, -1, -1, -1);
1639  GUI_V2_MENU_ITEM(_savenameMenu.item[0], 1, 0xD, 0x18, 0x2C, 0x58, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1640  _savenameMenu.item[0].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::finishSavename);
1641  GUI_V2_MENU_ITEM(_savenameMenu.item[1], 1, 0xB, 0xD0, 0x2C, 0x58, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1642  _savenameMenu.item[1].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::cancelSavename);
1643  for (int i = 2; i <= 6; ++i)
1644  _savenameMenu.item[i].enabled = false;
1645  for (int i = 0; i < 7; ++i)
1646  _savenameMenu.item[i].itemId = menuStr[6 * 8 + i + 1];
1647 
1648  GUI_V2_MENU(_deathMenu, -1, -1, 0xD0, 0x4C, 0xF8, 0xF9, 0xFA, menuStr[7 * 8], 0xFB, -1, 8, 0, 2, -1, -1, -1, -1);
1649  GUI_V2_MENU_ITEM(_deathMenu.item[0], 1, 2, -1, 0x1E, 0xB4, 0x0F, 0xFC, 0xFD, 8, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1650  _deathMenu.item[0].callback = clickLoadMenuFunctor;
1651  GUI_V2_MENU_ITEM(_deathMenu.item[1], 1, 5, -1, 0x2F, 0xB4, 0x0F, 0xFC, 0xFD, 8, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
1652  _deathMenu.item[1].callback = clickQuitGameFunctor;
1653  for (int i = 2; i <= 6; ++i)
1654  _deathMenu.item[i].enabled = false;
1655  for (int i = 0; i < 2; ++i)
1656  _deathMenu.item[i].itemId = menuStr[7 * 8 + i + 1];
1657 }
1658 
1660  0x001, 0x002, 0x003, 0x023, 0x004, 0x025, 0x005, 0x006, // Main Menu String IDs
1661  0x025, 0x000, 0x000, 0x000, 0x010, 0x000, 0x000, 0x000, // Options Menu String IDs
1662  0x007, 0x000, 0x000, 0x000, 0x010, 0x000, 0x000, 0x000, // Audio Menu String IDs
1663  0x000, 0x014, 0x013, 0x000, 0x000, 0x000, 0x000, 0x000, // Menu3 Menu String IDs
1664  0x008, 0x029, 0x02A, 0x02B, 0x02C, 0x02D, 0x00B, 0x000, // Load Menu String IDs
1665  0x009, 0x029, 0x02A, 0x02B, 0x02C, 0x02D, 0x00B, 0x000, // Save Menu String IDs
1666  0x00C, 0x00D, 0x00B, 0x000, 0x000, 0x000, 0x000, 0x000, // Menu6 Menu String IDs
1667  0x00E, 0x002, 0x005, 0x000, 0x000, 0x000, 0x000, 0x000 // Death Menu String IDs
1668 };
1669 
1671  0x009, 0x00A, 0x00B, 0x001, 0x00C, 0x00D, 0x00E, 0x000, // Main Menu String IDs
1672  0x00F, 0x02B, 0x02C, 0x02D, 0x02E, 0x018, 0x000, 0x000, // Options Menu String IDs
1673  0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, // Dummy
1674  0x000, 0x01C, 0x01B, 0x000, 0x000, 0x000, 0x000, 0x000, // Menu3 Menu String IDs
1675  0x010, 0x02F, 0x030, 0x031, 0x032, 0x033, 0x013, 0x000, // Load Menu String IDs
1676  0x011, 0x02F, 0x030, 0x031, 0x032, 0x033, 0x013, 0x000, // Save Menu String IDs
1677  0x014, 0x015, 0x013, 0x3E8, 0x000, 0x000, 0x000, 0x000, // Menu6 String IDs
1678  0x016, 0x00A, 0x00D, 0x000, 0x000, 0x000, 0x000, 0x000 // Death Menu String IDs
1679 };
1680 
1682  0x0D, 0x0A, 0x0B, 0,
1683  0x0D, 0x0B, 0x0A, 0,
1684  0x0D, 0x38, 0x37, 0,
1685  0x0D, 0x37, 0x38, 0,
1686  0x0D, 0x35, 0x36, 0,
1687  0x0D, 0x36, 0x35, 0,
1688  0x34, 0x27, 0x33, 0,
1689  0x41, 0x29, 0x49, 0,
1690  0x45, 0x29, 0x4A, 1,
1691  0x46, 0x29, 0x4A, 1,
1692  0x3C, 0x29, 0x4B, 1,
1693  0x34, 0x29, 0x4C, 0,
1694  0x3C, 0x49, 0x3B, 1,
1695  0x41, 0x4B, 0x3B, 0,
1696  0x3C, 0x4A, 0x3B, 1,
1697  0x34, 0x49, 0x3B, 0,
1698  0x41, 0x4C, 0x3B, 0,
1699  0x45, 0x4C, 0x3B, 1,
1700  0x46, 0x4C, 0x3B, 1,
1701  0x34, 0x4A, 0x3B, 0,
1702  0x0D, 0x67, 0x68, 0,
1703  0x0D, 0x68, 0x67, 0,
1704  0x0D, 0x69, 0x6A, 0,
1705  0x0D, 0x6A, 0x69, 0,
1706  0x0D, 0x6B, 0x6C, 0,
1707  0x0D, 0x6C, 0x6B, 0,
1708  0x0D, 0x88, 0x87, 0,
1709  0x0D, 0x87, 0x88, 0,
1710  0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF
1711 };
1712 
1713 const int KyraEngine_HoF::_bookPageYOffset[] = {
1714  0, 0, 2, 2,
1715  0, 0, 2, 2,
1716  0, 0, 2, 2
1717 };
1718 
1720  0x00, 0xC7, 0xCF, 0x00
1721 };
1722 
1724  0x07, 0x0D, 0x47, 0x48,
1725  0x29, 0x1A, 0x1C, 0x6D,
1726  0x4D, 0x3A, 0x0E, 0x0F,
1727  0x10, 0x11, 0x26, 0x3E,
1728  0x35, 0x40, 0x42, 0xA6,
1729  0xA4, 0xA5, 0x91, 0x95,
1730  0x99, 0xAC, 0xAE, 0xAF,
1731  0x8A, 0x79, 0x61, -1
1732 };
1733 
1735  0x0027, 0x0029,
1736  0x0028, 0x0029,
1737  0x0033, 0x0029,
1738  0x0049, 0x0029,
1739  0x004A, 0x0029,
1740  0x004B, 0x0029,
1741  0x004C, 0x0029,
1742  0x003B, 0x0029,
1743  0x0034, 0x0034,
1744  -1, -1
1745 };
1746 
1748  0x0, 0x16, 0x2, 0x1A,
1749  0x7, 0xA4, 0x5, 0x4D,
1750  0x1, 0xA5, 0x3, 0xA6,
1751  0x6, 0x6D, 0x4, 0x91,
1752  0xA, 0x99, 0xC, 0x95,
1753  0x9, 0xAC, -1, -1
1754 };
1755 
1757  0x0, 0x16, 0x2, 0x1A,
1758  0x7, 0xAB, 0x5, 0x4D,
1759  0x1, 0xAE, 0x3, 0xAF,
1760  0x6, 0x6D, 0x4, 0x91,
1761  0xA, 0x99, 0xC, 0x95,
1762  0x9, 0xAC, -1, -1
1763 };
1764 
1766  3, 1, 3, 1, 1, 4, 4, 2,
1767  3, 1, 1, 3, 1, 3, 3, 3,
1768  3, 3, 3, 3, 3, 3, 3
1769 };
1770 
1772  0x19, 0x14, 0x15, 0x16, 0x17, 0x18, 0x34,
1773  0x1B, 0x39, 0x1A, 0x3A, 0x4D, 0x72, kItemNone
1774 };
1775 
1777  0x02, 0xA9, 0x9E, 0x75, 0x73, 0x17, 0x00, 0xA0,
1778  0x08, 0x01, 0x19, 0x9F, 0x66, 0x05, 0x22, 0x7D,
1779  0x20, 0x25, 0x1D, 0x64, 0xA0, 0x78, 0x85, 0x3B,
1780  0x3C, 0x5E, 0x38, 0x45, 0x8F, 0x61, 0xA1, 0x71,
1781  0x47, 0x77, 0x86, 0x41, 0xA2, 0x5F, 0x03, 0x72,
1782  0x83, 0x9E, 0x84, 0x8E, 0xAD, 0xA8, 0x04, 0x79,
1783  0xAA, 0xA3, 0x06, 0x27, 0x8F, 0x9F, 0x0A, 0x76,
1784  0x46, 0x1E, 0x24, 0x63, 0x18, 0x69, 0x39, 0x1F,
1785  0x7E, 0xAD, 0x28, 0x60, 0x67, 0x21, 0x84, 0x34
1786 };
1787 
1788 // kyra 3 static res
1789 
1790 const char *const KyraEngine_MR::_languageExtension[] = {
1791  "TRE",
1792  "TRF",
1793  "TRG"/*,
1794  "TRI", Italian and Spanish were never included, the supported fan translations are using
1795  "TRS" English/French extensions thus overwriting these languages */
1796 };
1797 
1798 const int KyraEngine_MR::_languageExtensionSize = ARRAYSIZE(KyraEngine_MR::_languageExtension);
1799 
1800 const char *const KyraEngine_MR::_mainMenuSpanishFan[] = {
1801  "Nueva Partida",
1802  "Ver Intro",
1803  "Restaurar",
1804  "Finalizar"
1805 };
1806 
1807 const char *const KyraEngine_MR::_mainMenuItalianFan[] = {
1808  "Nuova Partita",
1809  "Introduzione",
1810  "Carica una partita",
1811  "Esci dal gioco"
1812 };
1813 
1815  { 57, 91, -31, -82 },
1816  { 57, 91, -31, -82 },
1817  { 57, 91, -31, -82 },
1818  { 57, 91, -31, -82 },
1819  { 57, 91, -31, -82 },
1820  { 82, 96, -43, -86 },
1821  { 57, 91, -31, -82 },
1822  { 57, 91, -31, -82 },
1823  { 57, 91, -31, -82 },
1824  { 69, 91, -31, -82 },
1825  { 57, 91, -31, -82 },
1826  { 57, 91, -31, -82 }
1827 };
1828 
1829 const int KyraEngine_MR::_shapeDescsSize = ARRAYSIZE(KyraEngine_MR::_shapeDescs);
1830 
1832  0x36, 0x35, 0x35, 0x33, 0x32, 0x32, 0x34, 0x34
1833 };
1834 
1836  0x13, 0x13, 0x13, 0x18, 0x13, 0x13, 0x13, 0x13,
1837  0x13, 0x13, 0x13, 0x10, 0x13, 0x13, 0x13, 0x13,
1838  0x13, 0x13, 0x13, 0x18, 0x13, 0x13, 0x13, 0x13,
1839  0x15, 0x15, 0x14, 0x18, 0x14, 0x14, 0x14, 0x14,
1840  0x24, 0x24, 0x24, 0x24, 0x24, 0x1D, 0x1D, 0x1D
1841 };
1842 
1844  0x13, 0x13, 0x13, 0x13, 0x13,
1845  0x13, 0x13, 0x13, 0x13, 0x13,
1846  0x13, 0x13, 0x13, 0x13, 0x13,
1847  0x15, 0x15, 0x15, 0x15, 0x15,
1848  0x1E, 0x1E, 0x1E, 0x1E, 0x1E
1849 };
1850 
1852  0x00, 0x00, 0x19, 0x2B, 0x33, 0x3B
1853 };
1854 
1856  0x64, 0x76, 0x82, 0x83, 0x92
1857 };
1858 
1860  0x45, 0x61, 0x7D, 0x99, 0xB5,
1861  0x45, 0x61, 0x7D, 0x99, 0xB5
1862 };
1863 
1865  0x9C, 0x9C, 0x9C, 0x9C, 0x9C,
1866  0xB2, 0xB2, 0xB2, 0xB2, 0xB2
1867 };
1868 
1870  0x1E, 0x1D, 0x1C, 0x1F, 0x0F, 0x05, 0x04, 0x00,
1871  0x03, 0x22, 0x0B, 0x20, 0x21, 0x10, 0x11, 0x3A,
1872  0x39, 0x40, 0x3E, 0x3D, 0x3C, 0x3F, kItemNone
1873 };
1874 
1876  0x4, 0x7, 0x0, 0xA
1877 };
1878 
1880  0x5, 0x8, 0x1, 0xB
1881 };
1882 
1884  0x6, 0x9, 0x2, 0xC
1885 };
1886 
1888  if (!_mainButtonListInitialized) {
1889  _mainButtonData = new Button[14];
1890  assert(_mainButtonData);
1891 
1892  GUI_V2_BUTTON(_mainButtonData[0], 1, 0, 0, 4, 4, 4, 0x4487, 0, 5, 162, 50, 25, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
1893  _mainButtonData[0].buttonCallback = BUTTON_FUNCTOR(GUI_MR, _gui, &GUI_MR::optionsButton);
1894  GUI_V2_BUTTON(_mainButtonData[1], 2, 0, 0, 1, 1, 1, 0x4487, 0, 245, 156, 69, 33, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
1895  _mainButtonData[1].buttonCallback = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::buttonMoodChange);
1896  GUI_V2_BUTTON(_mainButtonData[2], 3, 0, 0, 1, 1, 1, 0x4487, 0, 215, 191, 24, 9, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
1897  _mainButtonData[2].buttonCallback = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::buttonShowScore);
1898  GUI_V2_BUTTON(_mainButtonData[3], 4, 0, 0, 1, 1, 1, 0x4487, 0, 215, 155, 25, 36, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
1899  _mainButtonData[3].buttonCallback = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::buttonJesterStaff);
1900 
1902  for (int i = 0; i < 5; ++i) {
1903  GUI_V2_BUTTON(_mainButtonData[i + 4], i + 5, 0, 0, 0, 0, 0, 0x1100, 0, 67 + i * 28, 155, 27, 21, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
1904  _mainButtonData[i + 4].buttonCallback = buttonInventoryFunctor;
1905  }
1906 
1907  for (int i = 0; i < 5; ++i) {
1908  GUI_V2_BUTTON(_mainButtonData[i + 9], i + 10, 0, 0, 0, 0, 0, 0x1100, 0, 67 + i * 28, 177, 27, 21, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
1909  _mainButtonData[i + 9].buttonCallback = buttonInventoryFunctor;
1910  }
1911 
1912  for (int i = 0; i < 14; ++i)
1913  _mainButtonList = _gui->addButtonToList(_mainButtonList, &_mainButtonData[i]);
1914 
1915  _mainButtonListInitialized = true;
1916  }
1917 
1918  for (int i = 0; i < 14; ++i) {
1919  if (disable)
1920  _gui->flagButtonDisable(&_mainButtonData[i]);
1921  else
1922  _gui->flagButtonEnable(&_mainButtonData[i]);
1923  }
1924 }
1925 
1927  GUI_V2_BUTTON(_scrollUpButton, 22, 0, 0, 4, 4, 4, 0x4487, 0, 0, 0, 0x18, 0x0F, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
1928  GUI_V2_BUTTON(_scrollDownButton, 23, 0, 0, 4, 4, 4, 0x4487, 0, 0, 0, 0x18, 0x0F, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
1929 
1930  for (int i = 0; i < 4; ++i)
1931  GUI_V2_BUTTON(_sliderButtons[0][i], 0x18 + i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x0A, 0x0E, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
1932  for (int i = 0; i < 4; ++i)
1933  GUI_V2_BUTTON(_sliderButtons[1][i], 0x1C + i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x0A, 0x0E, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
1934  for (int i = 0; i < 4; ++i)
1935  GUI_V2_BUTTON(_sliderButtons[2][i], 0x20 + i, 0, 0, 0, 0, 0, 0x2200, 0, 0, 0, 0x6E, 0x0E, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
1936 
1937  for (uint i = 0; i < ARRAYSIZE(_menuButtons); ++i)
1938  GUI_V2_BUTTON(_menuButtons[i], 0x0F + i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0, 0, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
1939 
1940  Button::Callback clickLoadSlotFunctor = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::clickLoadSlot);
1941  Button::Callback clickSaveSlotFunctor = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::clickSaveSlot);
1942  Button::Callback clickLoadMenuFunctor = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::loadMenu);
1943  Button::Callback clickQuitOptionsFunctor = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::quitOptionsMenu);
1944 
1945  GUI_V2_MENU(_mainMenu, -1, -1, 256, 172, 0xD0, 0xD1, 0xCF, 1, 0xBD, -1, 8, 0, 7, -1, -1, -1, -1);
1946  GUI_V2_MENU_ITEM(_mainMenu.item[0], 1, 2, -1, 30, 220, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
1947  _mainMenu.item[0].callback = clickLoadMenuFunctor;
1948  GUI_V2_MENU_ITEM(_mainMenu.item[1], 1, 3, -1, 47, 220, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
1949  _mainMenu.item[1].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::saveMenu);
1950  GUI_V2_MENU_ITEM(_mainMenu.item[2], 1, 35, -1, 64, 220, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
1951  _mainMenu.item[2].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::deleteMenu);
1952  GUI_V2_MENU_ITEM(_mainMenu.item[3], 1, 4, -1, 81, 220, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
1953  _mainMenu.item[3].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::gameOptions);
1954  GUI_V2_MENU_ITEM(_mainMenu.item[4], 1, 37, -1, 98, 220, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
1955  _mainMenu.item[4].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::audioOptions);
1956  GUI_V2_MENU_ITEM(_mainMenu.item[5], 1, 5, -1, 115, 220, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
1957  _mainMenu.item[5].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::quitGame);
1958  GUI_V2_MENU_ITEM(_mainMenu.item[6], 1, 6, -1, 144, 220, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
1959  _mainMenu.item[6].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::resumeGame);
1960 
1961  GUI_V2_MENU(_audioOptions, -1, -1, 288, 136, 0xD0, 0xD1, 0xCF, 37, 0xBD, -1, 8, 4, 5, -1, -1, -1, -1);
1962  GUI_V2_MENU_ITEM(_audioOptions.item[0], 0, 0, 160, 30, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 23, 8, 32, 0x0000);
1963  GUI_V2_MENU_ITEM(_audioOptions.item[1], 0, 0, 160, 47, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 24, 8, 49, 0x0000);
1964  GUI_V2_MENU_ITEM(_audioOptions.item[2], 0, 0, 160, 64, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 39, 8, 66, 0x0000);
1965  GUI_V2_MENU_ITEM(_audioOptions.item[3], 1, 0, 152, 81, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 47, 8, 83, 0x0000);
1966  _audioOptions.item[3].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::toggleHeliumMode);
1967  GUI_V2_MENU_ITEM(_audioOptions.item[4], 1, 16, -1, 110, 92, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
1968  _audioOptions.item[4].callback = clickQuitOptionsFunctor;
1969  for (int i = 5; i < 7; ++i)
1970  _audioOptions.item[i].enabled = false;
1971 
1972  GUI_V2_MENU(_gameOptions, -1, -1, 288, 154, 0xD0, 0xD1, 0xCF, 7, 0xBD, -1, 8, 0, 6, -1, -1, -1, -1);
1973  GUI_V2_MENU_ITEM(_gameOptions.item[0], 1, 0, 160, 30, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 21, 8, 32, 0x0000);
1974  _gameOptions.item[0].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::toggleWalkspeed);
1975  GUI_V2_MENU_ITEM(_gameOptions.item[1], 1, 0, 160, 47, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 26, 8, 49, 0x0000);
1976  _gameOptions.item[1].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::changeLanguage);
1977  GUI_V2_MENU_ITEM(_gameOptions.item[2], 1, 0, 160, 64, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 40, 8, 66, 0x0000);
1978  _gameOptions.item[2].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::toggleStudioSFX);
1979  GUI_V2_MENU_ITEM(_gameOptions.item[3], 1, 0, 160, 81, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 46, 8, 83, 0x0000);
1980  _gameOptions.item[3].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::toggleSkipSupport);
1981  GUI_V2_MENU_ITEM(_gameOptions.item[4], 1, 0, 160, 98, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 22, 8, 100, 0x0000);
1982  _gameOptions.item[4].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::toggleText);
1983  GUI_V2_MENU_ITEM(_gameOptions.item[5], 1, 16, -1, 127, 125, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
1984  _gameOptions.item[5].callback = clickQuitOptionsFunctor;
1985  _gameOptions.item[6].enabled = false;
1986 
1987  GUI_V2_MENU(_choiceMenu, -1, -1, 320, 56, 0xD0, 0xD1, 0xCF, 0, 0xBA, -1, 8, 0, 2, -1, -1, -1, -1);
1988  GUI_V2_MENU_ITEM(_choiceMenu.item[0], 1, 20, 24, 30, 72, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
1989  _choiceMenu.item[0].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::choiceYes);
1990  GUI_V2_MENU_ITEM(_choiceMenu.item[1], 1, 19, 216, 30, 72, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
1991  _choiceMenu.item[1].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::choiceNo);
1992  for (int i = 2; i < 7; ++i)
1993  _choiceMenu.item[i].enabled = false;
1994 
1995  GUI_V2_MENU(_loadMenu, -1, -1, 288, 160, 0xD0, 0xD1, 0xCF, 8, 0xBD, -1, 8, 0, 6, 132, 22, 132, 124);
1996  GUI_V2_MENU_ITEM(_loadMenu.item[0], 1, 41, -1, 39, 256, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
1997  GUI_V2_MENU_ITEM(_loadMenu.item[1], 1, 42, -1, 56, 256, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
1998  GUI_V2_MENU_ITEM(_loadMenu.item[2], 1, 43, -1, 73, 256, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
1999  GUI_V2_MENU_ITEM(_loadMenu.item[3], 1, 44, -1, 90, 256, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
2000  GUI_V2_MENU_ITEM(_loadMenu.item[4], 1, 45, -1, 107, 256, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
2001  for (int i = 0; i <= 4; ++i)
2002  _loadMenu.item[i].callback = clickLoadSlotFunctor;
2003  GUI_V2_MENU_ITEM(_loadMenu.item[5], 1, 11, 184, 134, 88, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
2004  _loadMenu.item[5].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::cancelLoadMenu);
2005  _loadMenu.item[6].enabled = false;
2006 
2007  GUI_V2_MENU(_saveMenu, -1, -1, 288, 160, 0xD0, 0xD1, 0xCF, 9, 0xBD, -1, 8, 0, 6, 132, 22, 132, 124);
2008  GUI_V2_MENU_ITEM(_saveMenu.item[0], 1, 41, -1, 39, 256, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
2009  GUI_V2_MENU_ITEM(_saveMenu.item[1], 1, 42, -1, 56, 256, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
2010  GUI_V2_MENU_ITEM(_saveMenu.item[2], 1, 43, -1, 73, 256, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
2011  GUI_V2_MENU_ITEM(_saveMenu.item[3], 1, 44, -1, 90, 256, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
2012  GUI_V2_MENU_ITEM(_saveMenu.item[4], 1, 45, -1, 107, 256, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
2013  for (int i = 0; i <= 4; ++i)
2014  _saveMenu.item[i].callback = clickSaveSlotFunctor;
2015  GUI_V2_MENU_ITEM(_saveMenu.item[5], 1, 11, 184, 134, 88, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
2016  _saveMenu.item[5].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::cancelSaveMenu);
2017  _saveMenu.item[6].enabled = false;
2018 
2019  GUI_V2_MENU(_savenameMenu, -1, -1, 320, 67, 0xD0, 0xD1, 0xCF, 12, 0xBD, -1, 8, 0, 2, -1, -1, -1, -1);
2020  GUI_V2_MENU_ITEM(_savenameMenu.item[0], 1, 13, 24, 44, 88, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
2021  _savenameMenu.item[0].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::finishSavename);
2022  GUI_V2_MENU_ITEM(_savenameMenu.item[1], 1, 11, 208, 44, 88, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
2023  _savenameMenu.item[1].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::cancelSavename);
2024  for (int i = 2; i < 7; ++i)
2025  _savenameMenu.item[i].enabled = false;
2026 
2027  GUI_V2_MENU(_deathMenu, -1, -1, 208, 76, 0xD0, 0xD1, 0xCF, 14, 0xBD, -1, 8, 0, 2, -1, -1, -1, -1);
2028  GUI_V2_MENU_ITEM(_deathMenu.item[0], 1, 2, -1, 30, 180, 15, 0xFA, 0xFF, 8, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
2029  _deathMenu.item[0].callback = clickLoadMenuFunctor;
2030  GUI_V2_MENU_ITEM(_deathMenu.item[1], 1, 38, -1, 47, 180, 15, 0xFA, 0xFF, 8, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
2031  _deathMenu.item[1].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::loadSecondChance);
2032  for (int i = 2; i < 7; ++i)
2033  _deathMenu.item[i].enabled = false;
2034 }
2035 
2036 const int8 KyraEngine_MR::_albumWSAX[] = {
2037  0, 77, -50, 99, -61, 82, -58, 85,
2038  -64, 80, -63, 88, -63, 88, -64, 0
2039 };
2040 
2041 const int8 KyraEngine_MR::_albumWSAY[] = {
2042  0, -1, 3, 0, -1, 0, -2, 0,
2043  -1, -2, 2, 2, -6, -6, -6, 0
2044 };
2045 
2046 } // End of namespace Kyra
int quitConfirmNo(Button *button)
Definition: gui_lok.cpp:853
int quitConfirmYes(Button *button)
Definition: gui_lok.cpp:845
static const uint8 _goodConscienceFrameTable[]
Definition: kyra_mr.h:488
int choiceYes(Button *caller)
Definition: gui_v2.cpp:865
int gameOptionsTalkie(Button *caller)
Definition: gui_hof.cpp:931
#define GUI_V1_BUTTON(button, a, b, c, d, e, f, g, h, i, j, k)
Definition: gui_lok.h:31
unsigned short uint16
Definition: cdtypes.h:27
static const int _itemStringMapSize
Definition: kyra_hof.h:235
static const int8 _dosTrackMap[]
Definition: kyra_lok.h:519
for(;bottom<=top;++bottom) YYFPRINTF(stderr
signed int int32
Definition: cdtypes.h:29
static const byte _bookTextColorMap[]
Definition: kyra_hof.h:277
Simple string class for ScummVM.
Definition: str.h:49
uint8 w
Definition: kyra_lok.h:54
static const uint8 _itemStringInv[]
Definition: kyra_mr.h:307
int scrollInventory(Button *button)
Definition: gui_hof.cpp:159
void freeShapeTable(void *&ptr, int &size)
Definition: staticres.cpp:653
static const ShapeDesc _shapeDescs[]
Definition: kyra_mr.h:329
static const int8 _albumWSAY[]
Definition: kyra_mr.h:557
platform
Definition: sysvar.cpp:36
unsigned int uint32
Definition: cdtypes.h:26
uint16 westExit
Definition: kyra_lok.h:62
void loadMainScreen(int page=3)
Definition: staticres.cpp:948
int count
Definition: voc.cpp:116
static const uint8 _palette16[48]
Definition: screen_lok.h:108
uint8 x
Definition: kyra_lok.h:54
void freeHoFSeqItemAnimData(void *&ptr, int &size)
Definition: staticres.cpp:694
int clickSaveSlot(Button *caller)
Definition: gui_v2.cpp:633
#define ARRAYEND(x)
Compute a pointer to one past the last element of an array.
Definition: util.h:71
void freeRoomTable(void *&ptr, int &size)
Definition: staticres.cpp:667
uint8 imageIndex
Definition: kyra_lok.h:52
static const int _pcSpkSfxMapSize
Definition: kyra_hof.h:87
#define assert(s)
Definition: portdefs.h:77
static const uint8 _itemStringDrop[]
Definition: kyra_mr.h:306
signed char int8
Definition: cdtypes.h:31
iterator end()
Definition: list.h:218
byte id
Definition: action.cpp:1401
int gameOptions(Button *caller)
Definition: gui_hof.cpp:886
static const int8 _charAddYPosTable[]
Definition: kyra_v1.h:383
static const int8 _charAddXPosTable[]
Definition: kyra_v1.h:382
static const int _sliderBarsPosition[]
Definition: gui_v2.h:180
static const int16 _cauldronProtectedItems[]
Definition: kyra_hof.h:302
static const Common::String staticDataFilename()
Definition: resource.h:1031
static const int8 _addXPosTable[]
Definition: kyra_v1.h:377
FORCEINLINE int8 readSByte()
Read a signed byte from the stream and return it.
Definition: stream.h:322
int cauldronButton(Button *button)
Definition: gui_hof.cpp:574
bool operator==(const Iterator< T > &a, const ConstIterator< T > &b)
Definition: list_intern.h:158
void warning(const char *s,...)
Definition: textconsole.cpp:49
const char * cpsFile
Definition: sequences_hof.h:32
int bookButton(Button *button)
Definition: gui_hof.cpp:294
u16 flags
Definition: zipreader.h:215
int cancelSavename(Button *caller)
Definition: gui_v2.cpp:808
Simple double linked list, modeled after the list template of the standard C++ library.
Definition: list.h:35
const AmigaSfxTable * loadAmigaSfxTable(int id, int &entries)
Definition: staticres.cpp:304
uint16 eastExit
Definition: kyra_lok.h:60
static const int16 _cauldronBowlTable[]
Definition: kyra_hof.h:303
int quitOptionsMenu(Button *caller)
Definition: gui_v2.cpp:526
iterator begin()
Definition: list.h:210
FILE * file
static const int8 _dosTrackMap[]
Definition: kyra_hof.h:80
unsigned char uint8
Definition: cdtypes.h:28
static const int16 _cauldronMagicTableScene77[]
Definition: kyra_hof.h:305
#define ARRAYSIZE(x)
Macro which determines the number of entries in a fixed size array.
Definition: util.h:66
bool loadStringTable(Common::SeekableReadStream &stream, void *&ptr, int &size)
Definition: staticres.cpp:430
int temp
Definition: main.cpp:69
static CodeValue value
Definition: decode.cpp:55
const HoFNestedSequence * nestedSeq
Definition: sequences_hof.h:62
uint16 southExit
Definition: kyra_lok.h:61
static const int _inventoryY[]
Definition: kyra_hof.h:242
int audioOptions(Button *caller)
Definition: gui_hof.cpp:836
int toggleWalkspeed(Button *caller)
Definition: gui_v2.cpp:532
static const int8 _albumWSAX[]
Definition: kyra_mr.h:556
static const byte _itemStringMap[]
Definition: kyra_hof.h:234
const Room * loadRoomTable(int id, int &entries)
Definition: staticres.cpp:308
static const char *const _mainMenuSpanishFan[]
Definition: kyra_mr.h:188
uint32 offset
Definition: voc.cpp:110
int cauldronClearButton(Button *button)
Definition: gui_hof.cpp:548
void initMainButtonList(bool disable)
Definition: staticres.cpp:1887
const char * output
int toggleSkipSupport(Button *caller)
Definition: gui_mr.cpp:1425
void loadSpecialEffectShapes()
Definition: staticres.cpp:873
#define SEEK_SET
Definition: gba_nds_fat.h:76
uint8 fadeInTransitionType
Definition: sequences_hof.h:34
const Shape * loadShapeTable(int id, int &entries)
Definition: staticres.cpp:300
virtual bool err() const
Returns true if an I/O failure occurred.
Definition: stream.h:49
Common::SharedPtr< CallbackFunctor > Callback
Definition: gui.h:41
static const uint8 _chapterLowestScene[]
Definition: kyra_mr.h:511
void freeAmigaSfxTable(void *&ptr, int &size)
Definition: staticres.cpp:660
static const uint8 _magicMouseItemStartFrame[]
Definition: kyra_lok.h:654
uint16 northExit
Definition: kyra_lok.h:59
#define GUI_V2_MENU(menu, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q)
Definition: gui_v2.h:57
int buttonInventory(Button *button)
Definition: gui_hof.cpp:114
#define RESFILE_VERSION
Definition: staticres.cpp:42
int loadSecondChance(Button *button)
Definition: gui_mr.cpp:1300
int8 yOffset
Definition: kyra_lok.h:53
#define BUTTON_FUNCTOR(type, x, y)
Definition: gui.h:37
uint8 h
Definition: kyra_lok.h:54
void freeHoFSequenceData(void *&ptr, int &size)
Definition: staticres.cpp:674
int resumeGame(Button *button)
Definition: gui_lok.cpp:544
int toggleHeliumMode(Button *caller)
Definition: gui_mr.cpp:1433
int controlsChangeSounds(Button *button)
Definition: gui_lok.cpp:1012
int quitPlaying(Button *button)
Definition: gui_lok.cpp:810
bool prefetchId(int id)
Definition: staticres.cpp:324
const FrameControl * wsaControl
Definition: sequences_hof.h:48
int saveMenu(Button *caller)
Definition: gui_v2.cpp:586
virtual uint32 read(void *dataPtr, uint32 dataSize)=0
Read data from the stream.
virtual bool seek(int32 offset, int whence=SEEK_SET)=0
Sets the stream position indicator for the stream.
const HoFSeqItemAnimData * loadHoFSeqItemAnimData(int id, int &entries)
Definition: staticres.cpp:316
#define GUI_V2_BUTTON(button, a, b, c, d, e, f, h, i, j, k, l, m, n, o, p, q, r, s, t)
Definition: gui_v2.h:30
int toggleStudioSFX(Button *caller)
Definition: gui_mr.cpp:1417
const HoFSeqData * loadHoFSequenceData(int id, int &entries)
Definition: staticres.cpp:312
static const int _gmSfxMapSize
Definition: kyra_hof.h:85
void freeItemAnimDefinition(void *&ptr, int &size)
Definition: staticres.cpp:703
bool computeStreamMD5(ReadStream &stream, uint8 digest[16], uint32 length)
Compute the MD5 checksum of the content of the given ReadStream.
Definition: md5.cpp:247
const FileType * getFiletype(int type)
Definition: staticres.cpp:392
void freeDummy(void *&ptr, int &size)
Definition: staticres.cpp:634
static const uint8 _characterFrameTable[]
Definition: kyra_hof.h:361
uint8 y
Definition: kyra_lok.h:54
uint8 fadeOutTransitionType
Definition: sequences_hof.h:35
const char * c_str() const
Definition: str.h:208
int buttonMenuCallback(Button *caller)
Definition: gui_lok.cpp:459
uint16 readUint16BE()
Read an unsigned 16-bit word stored in big endian (MSB first) order from the stream and return it...
Definition: stream.h:372
Endian conversion and byteswap conversion functions or macros.
#define GUI_V1_MENU(menu, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q)
Definition: gui_lok.h:51
uint32 type
Definition: mididrv.cpp:60
int optionsButton(Button *button)
Definition: gui_mr.cpp:1141
void unloadId(int id)
Definition: staticres.cpp:364
CruiseEngine * _vm
Definition: cruise.cpp:41
int gameControlsMenu(Button *button)
Definition: gui_lok.cpp:861
static const char *const _languageExtension[]
Definition: kyra_mr.h:662
static const uint16 _amuletY2[]
Definition: kyra_lok.h:662
int buttonShowScore(Button *button)
Definition: gui_mr.cpp:588
const HoFSequence * seq
Definition: sequences_hof.h:60
static const uint16 _itemPosX[]
Definition: kyra_lok.h:647
void listFiles(const Common::String &pattern, Common::ArchiveMemberList &list)
Definition: resource.cpp:289
static const uint16 _amuletX2[]
Definition: kyra_lok.h:661
int controlsApply(Button *button)
Definition: gui_lok.cpp:1045
int finishSavename(Button *caller)
Definition: gui_v2.cpp:802
static const int16 _cauldronMagicTable[]
Definition: kyra_hof.h:304
void GUIErrorMessage(const Common::String &msg)
Initializes graphics and shows error message.
Definition: engine.cpp:390
Constant for invalid item.
Definition: item.h:36
static const int8 _amigaTrackMap[]
Definition: kyra_lok.h:522
int buttonMoodChange(Button *button)
Definition: gui_mr.cpp:521
int loadMenu(Button *caller)
Definition: gui_hof.cpp:1115
int loadGameMenu(Button *button)
Definition: gui_lok.cpp:632
static const int _shapeDescsSize
Definition: kyra_mr.h:330
unsigned int uint
Definition: scummsys.h:440
int saveGameMenu(Button *button)
Definition: gui_lok.cpp:592
static const uint8 _magicMouseItemEndFrame[]
Definition: kyra_lok.h:655
int changeLanguage(Button *caller)
Definition: gui_mr.cpp:1406
Common::String filename
Definition: action.cpp:479
static const int _inventoryX[]
Definition: kyra_hof.h:241
int savegameConfirm(Button *button)
Definition: gui_lok.cpp:787
SceneIndex index
Definition: action.cpp:432
static const int8 _addYPosTable[]
Definition: kyra_v1.h:378
InventoryItem item
Definition: action.cpp:650
int changeLanguage(Button *caller)
Definition: gui_hof.cpp:983
static const uint8 _vocHighTable[]
Definition: kyra_mr.h:451
static const Item _flaskTable[]
Definition: kyra_hof.h:237
const uint8 * loadRawData(int id, int &size)
Definition: staticres.cpp:296
static const uint8 _magicMouseItemEndFrame2[]
Definition: kyra_lok.h:657
void initStaticData()
Definition: staticres.cpp:1513
static const int _amigaTrackMapSize
Definition: kyra_lok.h:523
uint32 readUint32BE()
Read an unsigned 32-bit word stored in big endian (MSB first) order from the stream and return it...
Definition: stream.h:385
void unloadPakFile(Common::String filename, bool remFromCache=false)
Definition: resource.cpp:257
uint8 nameIndex
Definition: kyra_lok.h:58
d
Definition: lingo-gr.cpp:1526
int8 xOffset
Definition: kyra_lok.h:53
int optionsButton(Button *button)
Definition: gui_hof.cpp:645
This is the namespace of the Kyra engine.
Definition: chargen.cpp:37
virtual int32 size() const =0
Obtains the total size of the stream, measured in bytes.
int gameOptions(Button *button)
Definition: gui_mr.cpp:1311
static const uint8 _cauldronStateTable[]
Definition: kyra_hof.h:306
FORCEINLINE int16 readSint16BE()
Read a signed 16-bit word stored in big endian (MSB first) order from the stream and return it...
Definition: stream.h:444
void freeRawData(void *&ptr, int &size)
Definition: staticres.cpp:637
static const int _screenDimTableCount
Definition: screen_hof.h:45
static const uint8 _magicMouseItemStartFrame2[]
Definition: kyra_lok.h:656
int cancelLoadMenu(Button *caller)
Definition: gui_v2.cpp:579
int16 Item
Definition: item.h:30
#define GUI_V1_MENU_ITEM(item, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v)
Definition: gui_lok.h:72
int cancelSaveMenu(Button *caller)
Definition: gui_v2.cpp:674
void initStaticResource()
Definition: staticres.cpp:1103
static const int _mt32SfxMapSize
Definition: kyra_hof.h:83
static const int _languageExtensionSize
Definition: kyra_mr.h:663
void freeStringTable(void *&ptr, int &size)
Definition: staticres.cpp:644
int controlsChangeMusic(Button *button)
Definition: gui_lok.cpp:1004
static const ScreenDim _screenDimTable[]
Definition: screen_hof.h:44
static const int8 _gmSfxMap[]
Definition: kyra_hof.h:84
static const int _dosTrackMapSize
Definition: kyra_hof.h:81
bool loadStaticResourceFile()
Definition: staticres.cpp:132
const char * wsaFile
Definition: sequences_hof.h:31
#define size
Definition: cdaudio.cpp:50
int resumeGame(Button *caller)
Definition: gui_v2.cpp:520
static const int8 _pcSpkSfxMap[]
Definition: kyra_hof.h:86
static const Item _trashItemList[]
Definition: kyra_mr.h:284
int buttonJesterStaff(Button *button)
Definition: gui_mr.cpp:611
signed short int16
Definition: cdtypes.h:30
int quitGame(Button *caller)
Definition: gui_hof.cpp:818
static const uint16 _menuStringsTalkie[]
Definition: gui_hof.h:78
int quitGame(Button *button)
Definition: gui_mr.cpp:1123
static const uint8 _characterFrameTable[]
Definition: kyra_mr.h:388
static const uint8 _inventoryY[]
Definition: kyra_mr.h:259
getData() -> entityPosition=kPosition_2740
void NORETURN_PRE error(const char *s,...)
Definition: textconsole.cpp:67
int buttonAmuletCallback(Button *caller)
Definition: gui_lok.cpp:84
static const ScreenDim _screenDimTable[]
Definition: screen_mr.h:47
static const uint8 _itemStringPickUp[]
Definition: kyra_mr.h:305
int choiceNo(Button *caller)
Definition: gui_v2.cpp:872
static const int _screenDimTableCount
Definition: screen_mr.h:48
static const uint8 _inventoryX[]
Definition: kyra_mr.h:258
int controlsChangeText(Button *button)
Definition: gui_lok.cpp:1029
static const ScreenDim _screenDimTable[]
Definition: screen_lok.h:68
static const uint8 _itemPosY[]
Definition: kyra_lok.h:648
static const char *const _mainMenuItalianFan[]
Definition: kyra_mr.h:189
void initStaticData()
Definition: staticres.cpp:1926
static const uint16 _amuletX[]
Definition: kyra_lok.h:659
int audioOptions(Button *button)
Definition: gui_mr.cpp:1444
static const int _dosTrackMapSize
Definition: kyra_lok.h:520
byte version
Definition: thumbnail.cpp:40
bool checkResList(int id, int &type, const void *&ptr, int &size)
Definition: staticres.cpp:379
int deleteMenu(Button *caller)
Definition: gui_v2.cpp:682
int clickLoadSlot(Button *caller)
Definition: gui_v2.cpp:564
const void * getData(int id, int requesttype, int &size)
Definition: staticres.cpp:404
static const char *const _scriptLangExt[]
Definition: kyra_hof.h:344
static const uint16 _itemMagicTable[]
Definition: kyra_hof.h:243
int controlsChangeWalk(Button *button)
Definition: gui_lok.cpp:1020
IteratorImpl< const Node > const_iterator
Definition: hashmap.h:220
int buttonInventory(Button *button)
Definition: gui_mr.cpp:474
const char *const * loadStrings(int id, int &strings)
Definition: staticres.cpp:292
static String format(const char *fmt,...) GCC_PRINTF(1
Print formatted data into a String object.
Definition: str.cpp:634
const ItemAnimDefinition * loadItemAnimDefinition(int id, int &entries)
Definition: staticres.cpp:320
void initInventoryButtonList()
Definition: staticres.cpp:1472
static const uint16 _menuStringsOther[]
Definition: gui_hof.h:79
static const int _bookPageYOffset[]
Definition: kyra_hof.h:276
static const char *const _languageExtension[]
Definition: kyra_hof.h:343
Interface for a seekable & readable data stream.
Definition: stream.h:561
static const uint8 _rainbowRoomData[]
Definition: kyra_hof.h:680
if(!yymsg) yymsg
byte readByte()
Read an unsigned byte from the stream and return it.
Definition: stream.h:310
bool loadPakFile(Common::String filename)
Definition: resource.cpp:165
bool loadDummy(Common::SeekableReadStream &stream, void *&ptr, int &size)
Definition: staticres.cpp:426
#define proc(x)
static const int _screenDimTableCount
Definition: screen_lok.h:69
int toggleText(Button *caller)
Definition: gui_v2.cpp:544
int cancelSubMenu(Button *button)
Definition: gui_lok.cpp:802
static const uint16 _amuletY[]
Definition: kyra_lok.h:660
#define GUI_V2_MENU_ITEM(item, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q)
Definition: gui_v2.h:78
static const int8 _mt32SfxMap[]
Definition: kyra_hof.h:82
int loadMenu(Button *button)
Definition: gui_mr.cpp:1254
unsigned char byte
Definition: portdefs.h:57
int buttonInventoryCallback(Button *caller)
Definition: gui_lok.cpp:43
In find(In first, In last, const T &v)
Finds the first data value in the range [first, last) matching v.
Definition: algorithm.h:115
bool isInCacheList(Common::String name)
Definition: resource.cpp:279
static const uint8 _badConscienceFrameTable[]
Definition: kyra_mr.h:479