Mohawk::MohawkEngine_LivingBooks Class Reference

#include <livingbooks.h>

+ Inheritance diagram for Mohawk::MohawkEngine_LivingBooks:
+ Collaboration diagram for Mohawk::MohawkEngine_LivingBooks:

Public Member Functions

 MohawkEngine_LivingBooks (OSystem *syst, const MohawkGameDescription *gamedesc)
 ~MohawkEngine_LivingBooks () override
void addNotifyEvent (NotifyEvent event)
Common::SeekableSubReadStreamEndianwrapStreamEndian (uint32 tag, uint16 id)
Common::String readString (Common::ReadStream *stream)
Common::Rect readRect (Common::ReadStreamEndian *stream)
void addArchive (Archive *archive)
void removeArchive (Archive *archive)
void addItem (LBItem *item)
void removeItems (const Common::Array< LBItem * > &items)
LBItemgetItemById (uint16 id)
LBItemgetItemByName (Common::String name)
void setFocus (LBItem *focus)
void setEnableForAll (bool enable, LBItem *except=0)
void notifyAll (uint16 data, uint16 from)
void queueDelayedEvent (DelayedEvent event)
bool playSound (LBItem *source, uint16 resourceId)
void lockSound (LBItem *owner, bool lock)
bool isBigEndian () const
bool isPreMohawk () const
LBMode getCurMode ()
bool tryLoadPageStart (LBMode mode, uint page)
bool loadPage (LBMode mode, uint page, uint subpage)
void prevPage ()
void nextPage ()
Common::String getFileNameFromConfig (const Common::String &section, const Common::String &key, Common::String &leftover)
ArchivecreateArchive () const
- Public Member Functions inherited from Mohawk::MohawkEngine
 MohawkEngine (OSystem *syst, const MohawkGameDescription *gamedesc)
 ~MohawkEngine () override
const char * getGameId () const
uint32 getFeatures () const
const char * getAppName () const
Common::Platform getPlatform () const
uint8 getGameType () const
Common::Language getLanguage () const
Common::String getDatafileLanguageName (const char *prefix) const
bool hasFeature (EngineFeature f) const override
 Determine whether the engine supports the specified feature. More...
virtual Common::SeekableReadStreamgetResource (uint32 tag, uint16 id)
bool hasResource (uint32 tag, uint16 id)
bool hasResource (uint32 tag, const Common::String &resName)
uint32 getResourceOffset (uint32 tag, uint16 id)
uint16 findResourceID (uint32 type, const Common::String &resName)
Common::String getResourceName (uint32 tag, uint16 id)
void pauseGame ()
- Public Member Functions inherited from Engine
 Engine (OSystem *syst)
virtual ~Engine ()
virtual void initializePath (const Common::FSNode &gamePath)
 Init SearchMan according to the game path. More...
virtual void errorString (const char *buf_input, char *buf_output, int buf_output_size)
 Prepare an error string, which is printed by the error() function. More...
virtual GUI::DebuggergetDebugger ()
 Return the engine's debugger instance, if any. More...
void setDebugger (GUI::Debugger *debugger)
 Sets the engine's debugger. More...
GUI::DebuggergetOrCreateDebugger ()
 Return the engine's debugger instance, or create one if none is present. More...
virtual void syncSoundSettings ()
 Notify the engine that the sound settings in the config manager may have changed and that it hence should adjust any internal volume etc. More...
virtual void flipMute ()
 Flip mute all sound option. More...
virtual Common::String getSaveStateName (int slot) const
 Generates the savegame filename. More...
virtual Common::Error loadGameState (int slot)
 Load a game state. More...
virtual Common::Error loadGameStream (Common::SeekableReadStream *stream)
 Load a game state. More...
void setGameToLoadSlot (int slot)
 Sets the game slot for a savegame to be loaded after global main menu execution. More...
virtual bool canLoadGameStateCurrently ()
 Indicates whether a game state can be loaded. More...
virtual Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false)
 Save a game state. More...
virtual Common::Error saveGameStream (Common::WriteStream *stream, bool isAutosave=false)
 Save a game state. More...
virtual bool canSaveGameStateCurrently ()
 Indicates whether a game state can be saved. More...
bool saveGameDialog ()
 Shows the ScummVM save dialog, allowing users to save their game. More...
bool loadGameDialog ()
 Shows the ScummVM Restore dialog, allowing users to load a game. More...
void pauseEngine (bool pause)
 Pause or resume the engine. More...
bool isPaused () const
 Return whether the engine is currently paused or not. More...
void openMainMenuDialog ()
 Run the Global Main Menu Dialog. More...
uint32 getTotalPlayTime () const
 Get the total play time. More...
void setTotalPlayTime (uint32 time=0)
 Set the game time counter to the specified time. More...
Common::TimerManagergetTimerManager ()
Common::EventManagergetEventManager ()
Common::SaveFileManagergetSaveFileManager ()
void checkCD ()
 On some systems, check if the game appears to be run from CD. More...
void handleAutoSave ()
 Checks for whether it's time to do an autosave, and if so, does it. More...
void saveAutosaveIfEnabled ()
 Does an autosave immediately if autosaves are turned on. More...
virtual bool canSaveAutosaveCurrently ()
 Indicates whether an autosave can currently be saved. More...
virtual int getAutosaveSlot () const
 Returns the slot that should be used for autosaves. More...
bool shouldPerformAutoSave (int lastSaveTime)

Public Attributes

bool _needsRedraw
bool _needsUpdate
Common::HashMap< Common::String, LBValue, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo_variables
- Public Attributes inherited from Mohawk::MohawkEngine
const MohawkGameDescription_gameDescription
- Public Attributes inherited from Engine

Protected Member Functions

Common::Error run () override
 Init the engine and start its main loop. More...
- Protected Member Functions inherited from Mohawk::MohawkEngine
Common::Error run () override
 Init the engine and start its main loop. More...
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)

Private Member Functions

Common::String getBookInfoFileName () const
void loadBookInfo (const Common::String &filename)
Common::String stringForMode (LBMode mode)
void destroyPage ()
void updatePage ()
void loadSHP (uint16 resourceId)
bool tryDefaultPage ()
void handleUIMenuClick (uint controlId)
void handleUIPoetryMenuClick (uint controlId)
void handleUIQuitClick (uint controlId)
void handleUIOptionsClick (uint controlId)
void handleNotify (NotifyEvent &event)
Common::String removeQuotesFromString (const Common::String &string, Common::String &leftover)
Common::String convertMacFileName (const Common::String &string)
Common::String convertWinFileName (const Common::String &string)
Common::String getStringFromConfig (const Common::String &section, const Common::String &key)
Common::String getStringFromConfig (const Common::String &section, const Common::String &key, Common::String &leftover)
int getIntFromConfig (const Common::String &section, const Common::String &key)
void pauseEngineIntern (bool) override
 Actual implementation of pauseEngine by subclasses. More...

Private Attributes

Common::INIFile _bookInfoFile
bool _readOnly
bool _introDone
LBMode _curMode
uint16 _curPage
uint16 _curSubPage
uint16 _phase
Common::Array< LBItem * > _items
Common::List< LBItem * > _orderedItems
Common::Queue< DelayedEvent_eventQueue
uint16 _lastSoundOwner
uint16 _lastSoundId
uint16 _lastSoundPriority
uint16 _soundLockOwner
uint16 _maxSoundPriority
Common::Queue< NotifyEvent_notifyEvents
uint16 _screenWidth
uint16 _screenHeight
uint16 _numLanguages
uint16 _numPages
Common::String _title
Common::String _copyright
bool _poetryMode
uint16 _curLanguage
uint16 _curSelectedPage
bool _alreadyShowedIntro

Additional Inherited Members

- Public Types inherited from Engine
enum  EngineFeature { kSupportsSubtitleOptions, kSupportsRTL, kSupportsLoadingDuringRuntime, kSupportsSavingDuringRuntime }
 A feature in this context means an ability of the engine which can be either available or not. More...
- Static Public Member Functions inherited from Engine
static void quitGame ()
 Request the engine to quit. More...
static bool shouldQuit ()
 Return whether the ENGINE should quit respectively should return to the launcher. More...
static MetaEnginegetMetaEngine ()
static bool warnUserAboutUnsupportedGame ()
 Display a warning to the user that the game is not fully supported. More...
- Protected Attributes inherited from Mohawk::MohawkEngine
Common::Array< Archive * > _mhk
- Protected Attributes inherited from Engine
const Common::String _targetName

Detailed Description

Definition at line 708 of file livingbooks.h.

Constructor & Destructor Documentation

◆ MohawkEngine_LivingBooks()

Mohawk::MohawkEngine_LivingBooks::MohawkEngine_LivingBooks ( OSystem syst,
const MohawkGameDescription gamedesc 

Definition at line 135 of file livingbooks.cpp.

◆ ~MohawkEngine_LivingBooks()

Mohawk::MohawkEngine_LivingBooks::~MohawkEngine_LivingBooks ( )

Definition at line 159 of file livingbooks.cpp.

Member Function Documentation

◆ addArchive()

void Mohawk::MohawkEngine_LivingBooks::addArchive ( Archive archive)

Definition at line 674 of file livingbooks.cpp.

◆ addItem()

void Mohawk::MohawkEngine_LivingBooks::addItem ( LBItem item)

Definition at line 689 of file livingbooks.cpp.

◆ addNotifyEvent()

void Mohawk::MohawkEngine_LivingBooks::addNotifyEvent ( NotifyEvent  event)

Definition at line 967 of file livingbooks.cpp.

◆ convertMacFileName()

Common::String Mohawk::MohawkEngine_LivingBooks::convertMacFileName ( const Common::String string)

Definition at line 923 of file livingbooks.cpp.

◆ convertWinFileName()

Common::String Mohawk::MohawkEngine_LivingBooks::convertWinFileName ( const Common::String string)

Definition at line 940 of file livingbooks.cpp.

◆ createArchive()

Archive * Mohawk::MohawkEngine_LivingBooks::createArchive ( ) const

Definition at line 955 of file livingbooks.cpp.

◆ destroyPage()

void Mohawk::MohawkEngine_LivingBooks::destroyPage ( )

Definition at line 358 of file livingbooks.cpp.

◆ getBookInfoFileName()

Common::String Mohawk::MohawkEngine_LivingBooks::getBookInfoFileName ( ) const

Definition at line 87 of file detection.cpp.

◆ getCurMode()

LBMode Mohawk::MohawkEngine_LivingBooks::getCurMode ( )

Definition at line 748 of file livingbooks.h.

◆ getFileNameFromConfig()

Common::String Mohawk::MohawkEngine_LivingBooks::getFileNameFromConfig ( const Common::String section,
const Common::String key,
Common::String leftover 

Definition at line 885 of file livingbooks.cpp.

◆ getIntFromConfig()

int Mohawk::MohawkEngine_LivingBooks::getIntFromConfig ( const Common::String section,
const Common::String key 

Definition at line 881 of file livingbooks.cpp.

◆ getItemById()

LBItem * Mohawk::MohawkEngine_LivingBooks::getItemById ( uint16  id)

Definition at line 710 of file livingbooks.cpp.

◆ getItemByName()

LBItem * Mohawk::MohawkEngine_LivingBooks::getItemByName ( Common::String  name)

Definition at line 718 of file livingbooks.cpp.

◆ getStringFromConfig() [1/2]

Common::String Mohawk::MohawkEngine_LivingBooks::getStringFromConfig ( const Common::String section,
const Common::String key 

Definition at line 865 of file livingbooks.cpp.

◆ getStringFromConfig() [2/2]

Common::String Mohawk::MohawkEngine_LivingBooks::getStringFromConfig ( const Common::String section,
const Common::String key,
Common::String leftover 

Definition at line 875 of file livingbooks.cpp.

◆ handleNotify()

void Mohawk::MohawkEngine_LivingBooks::handleNotify ( NotifyEvent event)

Definition at line 1305 of file livingbooks.cpp.

◆ handleUIMenuClick()

void Mohawk::MohawkEngine_LivingBooks::handleUIMenuClick ( uint  controlId)

Definition at line 1026 of file livingbooks.cpp.

◆ handleUIOptionsClick()

void Mohawk::MohawkEngine_LivingBooks::handleUIOptionsClick ( uint  controlId)

Definition at line 1230 of file livingbooks.cpp.

◆ handleUIPoetryMenuClick()

void Mohawk::MohawkEngine_LivingBooks::handleUIPoetryMenuClick ( uint  controlId)

Definition at line 1119 of file livingbooks.cpp.

◆ handleUIQuitClick()

void Mohawk::MohawkEngine_LivingBooks::handleUIQuitClick ( uint  controlId)

Definition at line 1187 of file livingbooks.cpp.

◆ isBigEndian()

bool Mohawk::MohawkEngine_LivingBooks::isBigEndian ( ) const

Definition at line 745 of file livingbooks.h.

◆ isPreMohawk()

bool Mohawk::MohawkEngine_LivingBooks::isPreMohawk ( ) const

Definition at line 962 of file livingbooks.cpp.

◆ loadBookInfo()

void Mohawk::MohawkEngine_LivingBooks::loadBookInfo ( const Common::String filename)

Definition at line 300 of file livingbooks.cpp.

◆ loadPage()

bool Mohawk::MohawkEngine_LivingBooks::loadPage ( LBMode  mode,
uint  page,
uint  subpage 

Definition at line 417 of file livingbooks.cpp.

◆ loadSHP()

void Mohawk::MohawkEngine_LivingBooks::loadSHP ( uint16  resourceId)

◆ lockSound()

void Mohawk::MohawkEngine_LivingBooks::lockSound ( LBItem owner,
bool  lock 

Definition at line 772 of file livingbooks.cpp.

◆ nextPage()

void Mohawk::MohawkEngine_LivingBooks::nextPage ( )

Definition at line 1012 of file livingbooks.cpp.

◆ notifyAll()

void Mohawk::MohawkEngine_LivingBooks::notifyAll ( uint16  data,
uint16  from 

Definition at line 736 of file livingbooks.cpp.

◆ pauseEngineIntern()

void Mohawk::MohawkEngine_LivingBooks::pauseEngineIntern ( bool  pause)

Actual implementation of pauseEngine by subclasses.

See there for details.

Reimplemented from Engine.

Definition at line 289 of file livingbooks.cpp.

◆ playSound()

bool Mohawk::MohawkEngine_LivingBooks::playSound ( LBItem source,
uint16  resourceId 

Definition at line 745 of file livingbooks.cpp.

◆ prevPage()

void Mohawk::MohawkEngine_LivingBooks::prevPage ( )

Definition at line 1002 of file livingbooks.cpp.

◆ queueDelayedEvent()

void Mohawk::MohawkEngine_LivingBooks::queueDelayedEvent ( DelayedEvent  event)

Definition at line 741 of file livingbooks.cpp.

◆ readRect()

Common::Rect Mohawk::MohawkEngine_LivingBooks::readRect ( Common::ReadStreamEndian stream)

Definition at line 60 of file livingbooks.cpp.

◆ readString()

Common::String Mohawk::MohawkEngine_LivingBooks::readString ( Common::ReadStream stream)

Definition at line 48 of file livingbooks.cpp.

◆ removeArchive()

void Mohawk::MohawkEngine_LivingBooks::removeArchive ( Archive archive)

Definition at line 678 of file livingbooks.cpp.

◆ removeItems()

void Mohawk::MohawkEngine_LivingBooks::removeItems ( const Common::Array< LBItem * > &  items)

Definition at line 695 of file livingbooks.cpp.

◆ removeQuotesFromString()

Common::String Mohawk::MohawkEngine_LivingBooks::removeQuotesFromString ( const Common::String string,
Common::String leftover 

Definition at line 901 of file livingbooks.cpp.

◆ run()

Common::Error Mohawk::MohawkEngine_LivingBooks::run ( )

Init the engine and start its main loop.

returns kNoError on success, else an error code.

Implements Engine.

Definition at line 169 of file livingbooks.cpp.

◆ setEnableForAll()

void Mohawk::MohawkEngine_LivingBooks::setEnableForAll ( bool  enable,
LBItem except = 0 

Definition at line 730 of file livingbooks.cpp.

◆ setFocus()

void Mohawk::MohawkEngine_LivingBooks::setFocus ( LBItem focus)

Definition at line 726 of file livingbooks.cpp.

◆ stringForMode()

Common::String Mohawk::MohawkEngine_LivingBooks::stringForMode ( LBMode  mode)

Definition at line 337 of file livingbooks.cpp.

◆ tryDefaultPage()

bool Mohawk::MohawkEngine_LivingBooks::tryDefaultPage ( )

Definition at line 983 of file livingbooks.cpp.

◆ tryLoadPageStart()

bool Mohawk::MohawkEngine_LivingBooks::tryLoadPageStart ( LBMode  mode,
uint  page 

Definition at line 971 of file livingbooks.cpp.

◆ updatePage()

void Mohawk::MohawkEngine_LivingBooks::updatePage ( )

Definition at line 502 of file livingbooks.cpp.

◆ wrapStreamEndian()

Common::SeekableSubReadStreamEndian * Mohawk::MohawkEngine_LivingBooks::wrapStreamEndian ( uint32  tag,
uint16  id 

Definition at line 860 of file livingbooks.cpp.

Member Data Documentation

◆ _alreadyShowedIntro

bool Mohawk::MohawkEngine_LivingBooks::_alreadyShowedIntro

Definition at line 809 of file livingbooks.h.

◆ _bookInfoFile

Common::INIFile Mohawk::MohawkEngine_LivingBooks::_bookInfoFile

Definition at line 763 of file livingbooks.h.

◆ _copyright

Common::String Mohawk::MohawkEngine_LivingBooks::_copyright

Definition at line 804 of file livingbooks.h.

◆ _curLanguage

uint16 Mohawk::MohawkEngine_LivingBooks::_curLanguage

Definition at line 807 of file livingbooks.h.

◆ _curMode

LBMode Mohawk::MohawkEngine_LivingBooks::_curMode

Definition at line 771 of file livingbooks.h.

◆ _curPage

uint16 Mohawk::MohawkEngine_LivingBooks::_curPage

Definition at line 772 of file livingbooks.h.

◆ _curSelectedPage

uint16 Mohawk::MohawkEngine_LivingBooks::_curSelectedPage

Definition at line 808 of file livingbooks.h.

◆ _curSubPage

uint16 Mohawk::MohawkEngine_LivingBooks::_curSubPage

Definition at line 772 of file livingbooks.h.

◆ _eventQueue

Common::Queue<DelayedEvent> Mohawk::MohawkEngine_LivingBooks::_eventQueue

Definition at line 777 of file livingbooks.h.

◆ _focus

LBItem* Mohawk::MohawkEngine_LivingBooks::_focus

Definition at line 778 of file livingbooks.h.

◆ _gfx

LBGraphics* Mohawk::MohawkEngine_LivingBooks::_gfx

Definition at line 720 of file livingbooks.h.

◆ _introDone

bool Mohawk::MohawkEngine_LivingBooks::_introDone

Definition at line 770 of file livingbooks.h.

◆ _items

Common::Array<LBItem *> Mohawk::MohawkEngine_LivingBooks::_items

Definition at line 775 of file livingbooks.h.

◆ _lastSoundId

uint16 Mohawk::MohawkEngine_LivingBooks::_lastSoundId

Definition at line 782 of file livingbooks.h.

◆ _lastSoundOwner

uint16 Mohawk::MohawkEngine_LivingBooks::_lastSoundOwner

Definition at line 782 of file livingbooks.h.

◆ _lastSoundPriority

uint16 Mohawk::MohawkEngine_LivingBooks::_lastSoundPriority

Definition at line 783 of file livingbooks.h.

◆ _maxSoundPriority

uint16 Mohawk::MohawkEngine_LivingBooks::_maxSoundPriority

Definition at line 785 of file livingbooks.h.

◆ _needsRedraw

bool Mohawk::MohawkEngine_LivingBooks::_needsRedraw

Definition at line 721 of file livingbooks.h.

◆ _needsUpdate

bool Mohawk::MohawkEngine_LivingBooks::_needsUpdate

Definition at line 721 of file livingbooks.h.

◆ _notifyEvents

Common::Queue<NotifyEvent> Mohawk::MohawkEngine_LivingBooks::_notifyEvents

Definition at line 796 of file livingbooks.h.

◆ _numLanguages

uint16 Mohawk::MohawkEngine_LivingBooks::_numLanguages

Definition at line 801 of file livingbooks.h.

◆ _numPages

uint16 Mohawk::MohawkEngine_LivingBooks::_numPages

Definition at line 802 of file livingbooks.h.

◆ _orderedItems

Common::List<LBItem *> Mohawk::MohawkEngine_LivingBooks::_orderedItems

Definition at line 776 of file livingbooks.h.

◆ _page

LBPage* Mohawk::MohawkEngine_LivingBooks::_page

Definition at line 774 of file livingbooks.h.

◆ _phase

uint16 Mohawk::MohawkEngine_LivingBooks::_phase

Definition at line 773 of file livingbooks.h.

◆ _poetryMode

bool Mohawk::MohawkEngine_LivingBooks::_poetryMode

Definition at line 805 of file livingbooks.h.

◆ _readOnly

bool Mohawk::MohawkEngine_LivingBooks::_readOnly

Definition at line 770 of file livingbooks.h.

◆ _rnd

Common::RandomSource* Mohawk::MohawkEngine_LivingBooks::_rnd

Definition at line 716 of file livingbooks.h.

◆ _screenHeight

uint16 Mohawk::MohawkEngine_LivingBooks::_screenHeight

Definition at line 800 of file livingbooks.h.

◆ _screenWidth

uint16 Mohawk::MohawkEngine_LivingBooks::_screenWidth

Definition at line 799 of file livingbooks.h.

◆ _sound

Sound* Mohawk::MohawkEngine_LivingBooks::_sound

Definition at line 719 of file livingbooks.h.

◆ _soundLockOwner

uint16 Mohawk::MohawkEngine_LivingBooks::_soundLockOwner

Definition at line 784 of file livingbooks.h.

◆ _title

Common::String Mohawk::MohawkEngine_LivingBooks::_title

Definition at line 803 of file livingbooks.h.

◆ _variables

Common::HashMap<Common::String, LBValue, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> Mohawk::MohawkEngine_LivingBooks::_variables

Definition at line 756 of file livingbooks.h.

◆ _video

VideoManager* Mohawk::MohawkEngine_LivingBooks::_video

Definition at line 718 of file livingbooks.h.

The documentation for this class was generated from the following files: