22 #ifndef MOHAWK_LIVINGBOOKS_H 23 #define MOHAWK_LIVINGBOOKS_H 25 #include "mohawk/mohawk.h" 26 #include "mohawk/console.h" 27 #include "mohawk/livingbooks_graphics.h" 28 #include "mohawk/livingbooks_constants.h" 29 #include "mohawk/sound.h" 30 #include "mohawk/video.h" 32 #include "common/formats/ini-file.h" 33 #include "common/rect.h" 34 #include "common/queue.h" 35 #include "common/random.h" 37 #include "livingbooks_code.h" 39 #include "mohawk/livingbooks_itemscript.h" 40 #include "mohawk/livingbooks_item.h" 41 #include "mohawk/livingbooks_itemtypes.h" 42 #include "mohawk/livingbooks_animation.h" 43 #include "mohawk/livingbooks_page.h" 46 class SeekableReadStreamEndian;
47 class MemoryReadStreamEndian;
52 class MohawkEngine_LivingBooks;
57 bool tryOpenPage(Archive *archive,
const Common::String &fileName);
60 NotifyEvent(uint t, uint p) : type(t), param(p), newUnknown(0), newMode(0), newPage(0), newSubpage(0) { }
72 enum DelayedEventType {
73 kLBDelayedEventDestroy = 0,
74 kLBDelayedEventSetNotVisible = 1,
75 kLBDelayedEventDone = 2
81 DelayedEventType type;
97 bool _needsRedraw, _needsUpdate;
105 void addArchive(
Archive *archive);
106 void removeArchive(
Archive *archive);
107 void addItem(
LBItem *item);
110 LBItem *getItemById(uint16
id);
113 void setFocus(
LBItem *focus);
114 void setEnableForAll(
bool enable,
LBItem *except = 0);
115 void notifyAll(uint16 data, uint16 from);
118 bool playSound(
LBItem *source, uint16 resourceId);
119 void lockSound(
LBItem *owner,
bool lock);
121 bool isBigEndian()
const {
return getGameType() != GType_LIVINGBOOKSV1 || getPlatform() == Common::kPlatformMacintosh; }
122 bool isPreMohawk()
const;
124 LBMode getCurMode() {
return _curMode; }
126 bool tryLoadPageStart(LBMode mode, uint page);
127 bool loadPage(LBMode mode, uint page, uint subpage);
136 Archive *createArchive()
const;
146 bool _readOnly, _introDone;
148 uint16 _curPage, _curSubPage;
158 uint16 _lastSoundOwner, _lastSoundId;
159 uint16 _lastSoundPriority;
160 uint16 _soundLockOwner;
161 uint16 _maxSoundPriority;
163 void loadSHP(uint16 resourceId);
165 bool tryDefaultPage();
167 void handleUIMenuClick(uint controlId);
168 void handleUIPoetryMenuClick(uint controlId);
169 void handleUIQuitClick(uint controlId);
170 void handleUIOptionsClick(uint controlId);
176 uint16 _screenHeight;
177 uint16 _numLanguages;
184 uint16 _curSelectedPage;
185 bool _alreadyShowedIntro;
197 void pauseEngineIntern(
bool)
override;
Definition: livingbooks_graphics.h:31
Definition: livingbooks.h:78
Definition: resource.h:134
Definition: livingbooks_item.h:45
Definition: livingbooks.h:59
Definition: algorithm.h:29
Definition: ini-file.h:58
Definition: livingbooks_page.h:34
Definition: detection.h:65
Definition: livingbooks.h:84