ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
livingbooks.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef MOHAWK_LIVINGBOOKS_H
23 #define MOHAWK_LIVINGBOOKS_H
24 
25 #include "mohawk/mohawk.h"
26 #include "mohawk/console.h"
27 #include "mohawk/livingbooks_graphics.h"
28 #include "mohawk/sound.h"
29 #include "mohawk/video.h"
30 
31 #include "common/formats/ini-file.h"
32 #include "common/rect.h"
33 #include "common/queue.h"
34 #include "common/random.h"
35 
36 #include "livingbooks_code.h"
37 
38 namespace Common {
39  class SeekableReadStreamEndian;
40  class MemoryReadStreamEndian;
41 }
42 
43 namespace Mohawk {
44 
45 // Engine Debug Flags
46 enum {
47  kDebugCode = 1,
48 };
49 
50 #define LBKEY_MOD_CTRL 1
51 #define LBKEY_MOD_ALT 2
52 #define LBKEY_MOD_SHIFT 4
53 
54 struct LBKey {
55  byte code;
56  byte modifiers;
57  byte char_;
58  byte repeats;
59 };
60 
61 enum NodeState {
62  kLBNodeDone = 0,
63  kLBNodeRunning = 1,
64  kLBNodeWaiting = 2
65 };
66 
67 enum LBMode {
68  kLBIntroMode = 1,
69  kLBControlMode = 2,
70  kLBCreditsMode = 3,
71  kLBPreviewMode = 4,
72  kLBReadMode = 5,
73  kLBPlayMode = 6
74 };
75 
76 enum {
77  kLBPhaseInit = 0x0,
78  kLBPhaseIntro = 0x1,
79  kLBPhaseMain = 0x2,
80  kLBPhaseNone = 0x7fff,
81  kLBPhaseLoad = 0xfffe,
82  kLBPhaseCreate = 0xffff
83 };
84 
85 // automatic modes used in _timingMode
86 enum {
87  kLBAutoNone = 0,
88  kLBAutoIntro = 1,
89  kLBAutoUserIdle = 2,
90  kLBAutoMain = 3,
91  kLBAutoSync = 4,
92  kLBAutoInit = 5,
93  kLBAutoCreate = 6,
94  kLBAutoLoad = 7
95 };
96 
97 // control modes used in _controlMode
98 enum {
99  kLBControlNone = 0,
100  kLBControlHideMouse = 1,
101  kLBControlPauseItems = 2
102 };
103 
104 enum {
105  kLBStaticTextItem = 0x1,
106  kLBPictureItem = 0x2,
107  kLBEditTextItem = 0x14,
108  kLBLiveTextItem = 0x15,
109  kLBAnimationItem = 0x40,
110  kLBSoundItem = 0x41,
111  kLBGroupItem = 0x42,
112  kLBMovieItem = 0x43,
113  kLBPaletteAItem = 0x44, // unused?
114  kLBPaletteItem = 0x45,
115  kLBProxyItem = 0x46,
116  kLBMiniGameItem = 666, // EVIL!!!!
117  kLBXDataFileItem = 0x3e9,
118  kLBDiscDectectorItem = 0xfa1
119 };
120 
121 enum {
122  // no 0x1?
123  kLBAnimOpNotify = 0x2,
124  kLBAnimOpSetTempo = 0x3,
125  // no 0x4?
126  kLBAnimOpMoveTo = 0x5,
127  kLBAnimOpWait = 0x6,
128  kLBAnimOpSetCel = 0x7,
129  kLBAnimOpSleepUntil = 0x8,
130  kLBAnimOpDrawMode = 0x9,
131  kLBAnimOpPlaySound = 0xa,
132  kLBAnimOpWaitForSound = 0xb,
133  kLBAnimOpReleaseSound = 0xc,
134  kLBAnimOpResetSound = 0xd,
135  kLBAnimOpSetTempoDiv = 0xe,
136  kLBAnimOpDelay = 0xf
137 };
138 
139 enum {
140  kLBEventPhaseInit = 0,
141  kLBEventPhaseIntro = 1,
142  kLBEventMouseDown = 2,
143  kLBEventStarted = 3,
144  kLBEventDone = 4,
145  kLBEventMouseUp = 5,
146  kLBEventPhaseMain = 6,
147  kLBEventNotified = 7,
148  kLBEventDragStart = 8,
149  kLBEventDragMove = 9,
150  kLBEventDragEnd = 0xa,
151  kLBEventRolloverBegin = 0xb,
152  kLBEventRolloverMove = 0xc,
153  kLBEventRolloverEnd = 0xd,
154  kLBEventMouseUpIn = 0xe,
155  kLBEventMouseUpOut = 0xf,
156  kLBEventMouseTrackIn = 0x10,
157  kLBEventMouseTrackMove = 0x11,
158  kLBEventMouseTrackMoveIn = 0x12,
159  kLBEventMouseTrackMoveOut = 0x13,
160  kLBEventMouseTrackOut = 0x14,
161  kLBEventFocusBegin = 0x15,
162  kLBEventFocusEnd = 0x16,
163  kLBEventInit = 0x17,
164  kLBEventLoad = 0x1a,
165  kLBEventListLoad = 0x1b,
166  kLBEventPhaseCreate = 0xff
167 };
168 
169 enum {
170  kLBGroupData = 0x64,
171  kLBLiveTextData = 0x65,
172  kLBMsgListScript = 0x66,
173  kLBNotifyScript = 0x67,
174  kLBSetPlayInfo = 0x68,
175  kLBSetRandomLoc = 0x69, // unused?
176  kLBSetDrag = 0x6a, // unused?
177  kLBSetDrawMode = 0x6b,
178  kLBSetFont = 0x6c, // unused?
179  kLBSetOneShot = 0x6d, // unused?
180  kLBSetPlayPhase = 0x6e,
181  // from here, 2.x+
182  kLBSetKeyNotify = 0x6f,
183  kLBCommand = 0x70,
184  kLBPaletteAData = 0x71, // unused?
185  kLBPaletteXData = 0x72,
186  kLBDisable = 0x73, // unused?
187  kLBEnable = 0x74, // unused?
188  kLBSetNotVisible = 0x75,
189  kLBSetVisible = 0x76, // unused?
190  kLBGlobalDisable = 0x77,
191  kLBGlobalEnable = 0x78, // unused?
192  kLBGlobalSetNotVisible = 0x79,
193  kLBGlobalSetVisible = 0x7a, // unused?
194  kLBSetAmbient = 0x7b,
195  kLBSetDragParams = 0x7c,
196  kLBSetKeyEvent = 0x7d,
197  kLBSetRolloverData = 0x7e,
198  kLBSetParent = 0x7f,
199  kLBSetHitTest = 0x80,
200  // from here, rugrats
201  kLBUnknown194 = 0x194
202 };
203 
204 enum {
205  kLBOpNone = 0x0,
206  kLBOpXShow = 0x1,
207  kLBOpTogglePlay = 0x2,
208  kLBOpSetNotVisible = 0x3,
209  kLBOpSetVisible = 0x4,
210  kLBOpDestroy = 0x5,
211  kLBOpRewind = 0x6,
212  kLBOpStop = 0x7,
213  kLBOpDisable = 0x8,
214  kLBOpEnable = 0x9,
215  // (no 0xa)
216  kLBOpGlobalSetNotVisible = 0xb,
217  kLBOpGlobalSetVisible = 0xc,
218  kLBOpGlobalDisable = 0xd,
219  kLBOpGlobalEnable = 0xe,
220  kLBOpSeekToEnd = 0xf,
221  // (no 0x10)
222  kLBOpMute = 0x11,
223  kLBOpUnmute = 0x12,
224  kLBOpLoad = 0x13,
225  kLBOpPreload = 0x14,
226  kLBOpUnload = 0x15,
227  kLBOpSeekToNext = 0x16,
228  kLBOpSeekToPrev = 0x17,
229  kLBOpDragBegin = 0x18,
230  kLBOpDragEnd = 0x19,
231  kLBOpScriptDisable = 0x1a,
232  kLBOpScriptEnable = 0x1b,
233  kLBOpUnknown1C = 0x1c,
234  kLBOpSendExpression = 0x1d,
235  kLBOpJumpUnlessExpression = 0xfffb,
236  kLBOpBreakExpression = 0xfffc,
237  kLBOpJumpToExpression = 0xfffd,
238  kLBOpRunSubentries = 0xfffe,
239  kLBOpRunData = 0xffff
240 };
241 
242 enum {
243  kLBNotifyGUIAction = 1,
244  kLBNotifyGoToControls = 2,
245  kLBNotifyChangePage = 3,
246  kLBNotifyGotoQuit = 4,
247  kLBNotifyIntroDone = 5,
248  kLBNotifyChangeMode = 6,
249  kLBNotifyCursorChange = 7,
250  kLBNotifyPrintPage = 0xc,
251  kLBNotifyQuit = 0xd
252 };
253 
254 enum {
255  kTargetTypeExpression = 0x3f3f,
256  kTargetTypeCode = 0xfffe,
257  kTargetTypeName = 0xffff
258 };
259 
261 class LBPage;
262 class LBGraphics;
263 class LBAnimation;
264 
266  LBScriptEntry();
267  ~LBScriptEntry();
268 
269  uint16 state;
270 
271  uint16 type;
272  uint16 event;
273  uint16 opcode;
274  uint16 param;
275 
276  uint16 argc;
277  uint16 *argvParam;
278  uint16 *argvTarget;
279 
280  uint16 targetingType;
282 
283  // kLBNotifyChangeMode
284  uint16 newUnknown;
285  uint16 newMode;
286  uint16 newPage;
287  uint16 newSubpage;
288  Common::String newCursor;
289 
290  // kLBEventNotified
291  uint16 matchFrom;
292  uint16 matchNotify;
293 
294  // kLBOpSendExpression
295  uint32 offset;
296  // kLBOpJumpUnlessExpression
297  uint16 target;
298 
299  uint16 dataType;
300  uint16 dataLen;
301  byte *data;
302 
305 };
306 
308  byte opcode;
309  byte size;
310  byte *data;
311 };
312 
314 public:
315  LBAnimationNode(MohawkEngine_LivingBooks *vm, LBAnimation *parent, uint16 scriptResourceId);
316  ~LBAnimationNode();
317 
318  void draw(const Common::Rect &_bounds);
319  void reset();
320  NodeState update(bool seeking = false);
321  bool transparentAt(int x, int y);
322 
323 protected:
325  LBAnimation *_parent;
326 
327  void loadScript(uint16 resourceId);
328  uint _currentEntry;
329  Common::Array<LBAnimScriptEntry> _scriptEntries;
330 
331  uint _currentCel;
332  int16 _xPos, _yPos;
333  uint32 _delay;
334 };
335 
336 class LBAnimationItem;
337 
338 class LBAnimation {
339 public:
340  LBAnimation(MohawkEngine_LivingBooks *vm, LBAnimationItem *parent, uint16 resourceId);
341  ~LBAnimation();
342 
343  void draw();
344  bool update();
345 
346  void start();
347  void seek(uint16 pos);
348  void seekToTime(uint32 time);
349  void stop();
350 
351  void playSound(uint16 resourceId);
352  bool soundPlaying(uint16 resourceId, const Common::String &cue);
353 
354  bool transparentAt(int x, int y);
355 
356  void setTempo(uint16 tempo);
357 
358  uint getNumResources() { return _shapeResources.size(); }
359  uint16 getResource(uint num) { return _shapeResources[num]; }
360  Common::Point getOffset(uint num) { return _shapeOffsets[num]; }
361 
362  uint32 getCurrentFrame() { return _currentFrame; }
363 
364  uint16 getParentId();
365 
366 protected:
368  LBAnimationItem *_parent;
369 
370  Common::Rect _bounds, _clip;
372 
373  uint16 _tempo;
374 
375  uint16 _currentSound;
376  CueList _cueList;
377 
378  uint32 _lastTime, _currentFrame;
379  bool _running;
380 
381  void loadShape(uint16 resourceId);
382  Common::Array<uint16> _shapeResources;
383  Common::Array<Common::Point> _shapeOffsets;
384 };
385 
386 class LBItem {
387  friend class LBCode;
388 
389 public:
391  virtual ~LBItem();
392 
393  void readFrom(Common::SeekableReadStreamEndian *stream);
394  void readData(uint16 type, uint16 size, byte *data);
395  virtual void readData(uint16 type, uint16 size, Common::MemoryReadStreamEndian *stream);
396 
397  virtual void destroySelf(); // 0x2
398  virtual void setEnabled(bool enabled); // 0x3
399  virtual void setGlobalEnabled(bool enabled);
400  virtual bool contains(Common::Point point); // 0x7
401  virtual void update(); // 0x8
402  virtual void draw() { } // 0x9
403  virtual void handleKeyChar(Common::Point pos) { } // 0xA
404  virtual void handleMouseDown(Common::Point pos); // 0xB
405  virtual void handleMouseMove(Common::Point pos); // 0xC
406  virtual void handleMouseUp(Common::Point pos); // 0xD
407  virtual bool togglePlaying(bool playing, bool restart = false); // 0xF
408  virtual void done(bool onlyNotify); // 0x10
409  virtual void init(); // 0x11
410  virtual void seek(uint16 pos) { } // 0x13
411  virtual void seekToTime(uint32 time) { }
412  virtual void setFocused(bool focused) { } // 0x14
413  virtual void setVisible(bool visible); // 0x17
414  virtual void setGlobalVisible(bool enabled);
415  virtual void startPhase(uint phase); // 0x18
416  virtual void stop(); // 0x19
417  virtual void notify(uint16 data, uint16 from); // 0x1A
418  virtual void load();
419  virtual void unload();
420  virtual void moveBy(const Common::Point &pos);
421  virtual void moveTo(const Common::Point &pos);
422 
423  LBItem *clone(uint16 newId, const Common::String &newName);
424 
425  uint16 getId() { return _itemId; }
426  const Common::String &getName() { return _desc; }
427  const Common::Rect &getRect() { return _rect; }
428  uint16 getSoundPriority() { return _soundMode; }
429  bool isLoaded() { return _loaded; }
430  bool isAmbient() { return _isAmbient; }
431 
433 
434  // TODO: make private
436 
437 protected:
439  LBPage *_page;
440 
441  void setNextTime(uint16 min, uint16 max);
442  void setNextTime(uint16 min, uint16 max, uint32 start);
443 
444  Common::Rect _rect;
445  Common::String _desc;
446  uint16 _resourceId;
447  uint16 _itemId;
448 
449  bool _loaded, _visible, _globalVisible, _playing, _enabled, _globalEnabled;
450 
451  uint32 _nextTime, _startTime;
452  uint16 _loops;
453 
454  uint16 _phase, _timingMode, _delayMin, _delayMax;
455  uint16 _loopMode, _periodMin, _periodMax;
456  uint16 _controlMode, _soundMode;
457  Common::Point _relocPoint;
458 
459  bool _isAmbient;
460  bool _doHitTest;
461 
462  virtual LBItem *createClone();
463 
464  Common::Array<LBScriptEntry *> _scriptEntries;
465  void runScript(uint event, uint16 data = 0, uint16 from = 0);
466  int runScriptEntry(LBScriptEntry *entry);
467 
468  void runCommand(const Common::String &command);
469  bool checkCondition(const Common::String &condition);
470 
471  LBScriptEntry *parseScriptEntry(uint16 type, uint16 &size, Common::MemoryReadStreamEndian *stream, bool isSubentry = false);
472 };
473 
474 class LBSoundItem : public LBItem {
475 public:
477  ~LBSoundItem() override;
478 
479  void update() override;
480  bool togglePlaying(bool playing, bool restart) override;
481  void stop() override;
482 
483 protected:
484  LBItem *createClone() override;
485 
486  bool _running;
487 };
488 
489 struct GroupEntry {
490  uint entryId;
491  uint entryType;
492 };
493 
494 class LBGroupItem : public LBItem {
495 public:
497 
498  void readData(uint16 type, uint16 size, Common::MemoryReadStreamEndian *stream) override;
499 
500  void destroySelf() override;
501  void setEnabled(bool enabled) override;
502  void setGlobalEnabled(bool enabled) override;
503  bool contains(Common::Point point) override;
504  bool togglePlaying(bool playing, bool restart) override;
505  // 0x12
506  void seek(uint16 pos) override;
507  void setVisible(bool visible) override;
508  void setGlobalVisible(bool visible) override;
509  void startPhase(uint phase) override;
510  void stop() override;
511  void load() override;
512  void unload() override;
513  void moveBy(const Common::Point &pos) override;
514  void moveTo(const Common::Point &pos) override;
515 
516 protected:
517  LBItem *createClone() override;
518 
519  bool _starting;
520 
521  Common::Array<GroupEntry> _groupEntries;
522 };
523 
524 class LBPaletteItem : public LBItem {
525 public:
527  ~LBPaletteItem() override;
528 
529  void readData(uint16 type, uint16 size, Common::MemoryReadStreamEndian *stream) override;
530 
531  bool togglePlaying(bool playing, bool restart) override;
532  void update() override;
533 
534 protected:
535  LBItem *createClone() override;
536 
537  uint16 _fadeInPeriod, _fadeInStep, _drawStart, _drawCount;
538  uint32 _fadeInStart, _fadeInCurrent;
539  byte *_palette;
540 };
541 
542 struct LiveTextWord {
543  Common::Rect bounds;
544  uint16 soundId;
545 
546  uint16 itemType;
547  uint16 itemId;
548 };
549 
551  uint16 wordStart, wordCount;
552  uint16 highlightStart, highlightEnd;
553  uint16 startId, endId;
554 };
555 
556 class LBLiveTextItem : public LBItem {
557 public:
559 
560  void readData(uint16 type, uint16 size, Common::MemoryReadStreamEndian *stream) override;
561 
562  bool contains(Common::Point point) override;
563  void update() override;
564  void draw() override;
565  void handleMouseDown(Common::Point pos) override;
566  bool togglePlaying(bool playing, bool restart) override;
567  void stop() override;
568  void notify(uint16 data, uint16 from) override;
569 
570 protected:
571  LBItem *createClone() override;
572 
573  void paletteUpdate(uint16 word, bool on);
574  void drawWord(uint word, uint yPos);
575 
576  uint16 _currentPhrase, _currentWord;
577 
578  byte _backgroundColor[4];
579  byte _foregroundColor[4];
580  byte _highlightColor[4];
581  uint16 _paletteIndex;
582 
585 };
586 
587 class LBPictureItem : public LBItem {
588 public:
590 
591  void readData(uint16 type, uint16 size, Common::MemoryReadStreamEndian *stream) override;
592 
593  bool contains(Common::Point point) override;
594  void draw() override;
595  void init() override;
596 
597 protected:
598  LBItem *createClone() override;
599 };
600 
601 class LBAnimationItem : public LBItem {
602 public:
604  ~LBAnimationItem() override;
605 
606  void setEnabled(bool enabled) override;
607  bool contains(Common::Point point) override;
608  void update() override;
609  void draw() override;
610  bool togglePlaying(bool playing, bool restart) override;
611  void done(bool onlyNotify) override;
612  void init() override;
613  void seek(uint16 pos) override;
614  void seekToTime(uint32 time) override;
615  void startPhase(uint phase) override;
616  void stop() override;
617 
618 protected:
619  LBItem *createClone() override;
620 
621  LBAnimation *_anim;
622  bool _running;
623 };
624 
625 class LBMovieItem : public LBItem {
626 public:
628  ~LBMovieItem() override;
629 
630  void update() override;
631  bool togglePlaying(bool playing, bool restart) override;
632 
633 protected:
634  LBItem *createClone() override;
635 };
636 
637 class LBMiniGameItem : public LBItem {
638 public:
640  ~LBMiniGameItem() override;
641 
642  bool togglePlaying(bool playing, bool restart) override;
643 
644 protected:
645  LBItem *createClone() override;
646 };
647 
648 class LBProxyItem : public LBItem {
649 public:
651  ~LBProxyItem() override;
652 
653  void load() override;
654  void unload() override;
655 
656 protected:
657  LBItem *createClone() override;
658 
659  class LBPage *_page;
660 };
661 
662 struct NotifyEvent {
663  NotifyEvent(uint t, uint p) : type(t), param(p), newUnknown(0), newMode(0), newPage(0), newSubpage(0) { }
664  uint type;
665  uint param;
666 
667  // kLBNotifyChangeMode
668  uint16 newUnknown;
669  uint16 newMode;
670  uint16 newPage;
671  uint16 newSubpage;
672  Common::String newCursor;
673 };
674 
675 enum DelayedEventType {
676  kLBDelayedEventDestroy = 0,
677  kLBDelayedEventSetNotVisible = 1,
678  kLBDelayedEventDone = 2
679 };
680 
681 struct DelayedEvent {
682  DelayedEvent(LBItem *i, DelayedEventType t) : item(i), type(t) { }
683  LBItem *item;
684  DelayedEventType type;
685 };
686 
687 class LBPage {
688 public:
690  ~LBPage();
691 
692  void open(Archive *mhk, uint16 baseId);
693  uint16 getResourceVersion();
694 
695  void addClonedItem(LBItem *item);
696  void itemDestroyed(LBItem *item);
697 
698  LBCode *_code;
699 
700 protected:
702 
703  Archive *_mhk;
705 
706  uint16 _baseId;
707  bool _cascade;
708 
709  void loadBITL(uint16 resourceId);
710 };
711 
713 protected:
714  Common::Error run() override;
715 
716 public:
718  ~MohawkEngine_LivingBooks() override;
719 
720  Common::RandomSource *_rnd;
721 
722  VideoManager *_video;
723  Sound *_sound;
724  LBGraphics *_gfx;
725  bool _needsRedraw, _needsUpdate;
726 
727  void addNotifyEvent(NotifyEvent event);
728 
729  Common::SeekableReadStreamEndian *wrapStreamEndian(uint32 tag, uint16 id);
730  Common::String readString(Common::ReadStream *stream);
731  Common::Rect readRect(Common::ReadStreamEndian *stream);
732 
733  void addArchive(Archive *archive);
734  void removeArchive(Archive *archive);
735  void addItem(LBItem *item);
736  void removeItems(const Common::Array<LBItem *> &items);
737 
738  LBItem *getItemById(uint16 id);
739  LBItem *getItemByName(Common::String name);
740 
741  void setFocus(LBItem *focus);
742  void setEnableForAll(bool enable, LBItem *except = 0);
743  void notifyAll(uint16 data, uint16 from);
744  void queueDelayedEvent(DelayedEvent event);
745 
746  bool playSound(LBItem *source, uint16 resourceId);
747  void lockSound(LBItem *owner, bool lock);
748 
749  bool isBigEndian() const { return getGameType() != GType_LIVINGBOOKSV1 || getPlatform() == Common::kPlatformMacintosh; }
750  bool isPreMohawk() const;
751 
752  LBMode getCurMode() { return _curMode; }
753 
754  bool tryLoadPageStart(LBMode mode, uint page);
755  bool loadPage(LBMode mode, uint page, uint subpage);
756  void prevPage();
757  void nextPage();
758 
759  // TODO: make private
761 
762  // helper functions, also used by LBProxyItem
763  Common::String getFileNameFromConfig(const Common::String &section, const Common::String &key, Common::String &leftover);
764  Archive *createArchive() const;
765 
766 private:
767  Common::INIFile _bookInfoFile;
768 
769  Common::Path getBookInfoFileName() const;
770  void loadBookInfo(const Common::Path &filename);
771 
772  Common::String stringForMode(LBMode mode);
773 
774  bool _readOnly, _introDone;
775  LBMode _curMode;
776  uint16 _curPage, _curSubPage;
777  uint16 _phase;
778  LBPage *_page;
780  Common::List<LBItem *> _orderedItems;
781  Common::Queue<DelayedEvent> _eventQueue;
782  LBItem *_focus;
783  void destroyPage();
784  void updatePage();
785 
786  uint16 _lastSoundOwner, _lastSoundId;
787  uint16 _lastSoundPriority;
788  uint16 _soundLockOwner;
789  uint16 _maxSoundPriority;
790 
791  void loadSHP(uint16 resourceId);
792 
793  bool tryDefaultPage();
794 
795  void handleUIMenuClick(uint controlId);
796  void handleUIPoetryMenuClick(uint controlId);
797  void handleUIQuitClick(uint controlId);
798  void handleUIOptionsClick(uint controlId);
799 
800  Common::Queue<NotifyEvent> _notifyEvents;
801  void handleNotify(NotifyEvent &event);
802 
803  uint16 _screenWidth;
804  uint16 _screenHeight;
805  uint16 _numLanguages;
806  uint16 _numPages;
807  Common::String _title;
808  Common::String _copyright;
809  bool _poetryMode;
810 
811  uint16 _curLanguage;
812  uint16 _curSelectedPage;
813  bool _alreadyShowedIntro;
814 
815  // String Manipulation Functions
816  Common::String removeQuotesFromString(const Common::String &string, Common::String &leftover);
817  Common::String convertMacFileName(const Common::String &string);
818  Common::String convertWinFileName(const Common::String &string);
819 
820  // Configuration File Functions
821  Common::String getStringFromConfig(const Common::String &section, const Common::String &key);
822  Common::String getStringFromConfig(const Common::String &section, const Common::String &key, Common::String &leftover);
823  int getIntFromConfig(const Common::String &section, const Common::String &key);
824 
825  void pauseEngineIntern(bool) override;
826 };
827 
828 } // End of namespace Mohawk
829 
830 #endif
Definition: livingbooks.h:550
Definition: stream.h:854
Definition: livingbooks.h:625
Definition: str.h:59
Definition: livingbooks.h:556
Definition: livingbooks_code.h:212
Definition: livingbooks.h:338
Definition: livingbooks.h:313
Definition: error.h:84
Definition: livingbooks.h:489
Definition: random.h:44
Definition: livingbooks_graphics.h:31
Definition: list.h:44
Definition: livingbooks.h:681
Definition: rect.h:144
Definition: path.h:52
Definition: resource.h:134
Definition: queue.h:42
Definition: memstream.h:103
Definition: video.h:244
Definition: livingbooks.h:386
Definition: livingbooks.h:648
Definition: sound.h:102
Definition: livingbooks.h:542
Definition: hashmap.h:85
Definition: livingbooks.h:662
Definition: livingbooks.h:307
Definition: sound.h:74
Definition: algorithm.h:29
Definition: rect.h:45
Definition: mohawk.h:54
Definition: livingbooks.h:474
Definition: livingbooks.h:54
Definition: livingbooks.h:265
Definition: livingbooks.h:494
Definition: ini-file.h:58
Definition: livingbooks.h:637
Definition: stream.h:944
Definition: stream.h:385
Definition: livingbooks.h:587
Definition: list_intern.h:54
Definition: system.h:161
Definition: livingbooks.h:687
Definition: livingbooks.h:601
Definition: bitmap.h:32
Definition: detection.h:65
Definition: livingbooks.h:524
Definition: livingbooks.h:712