ScummVM
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)
 
virtual ~MohawkEngine_LivingBooks ()
 
void addNotifyEvent (NotifyEvent event)
 
Common::SeekableSubReadStreamEndianwrapStreamEndian (uint32 tag, uint16 id)
 
Common::String readString (Common::ReadStream *stream)
 
Common::Rect readRect (Common::ReadStreamEndian *stream)
 
GUI::DebuggergetDebugger () override
 Return the engine's debugger instance, if any. More...
 
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
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...
 
 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 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 initKeymap ()
 
virtual void deinitKeymap ()
 
virtual void flipMute ()
 Flip mute all sound option. More...
 
virtual Common::Error loadGameState (int slot)
 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)
 Save a game state. More...
 
virtual bool canSaveGameStateCurrently ()
 Indicates whether a game state can be saved. More...
 

Public Attributes

Common::RandomSource_rnd
 
VideoManager_video
 
Sound_sound
 
LBGraphics_gfx
 
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
 
CursorManager_cursor
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

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)
 
bool shouldPerformAutoSave (int lastSaveTime)
 Indicate whether an autosave should be performed. More...
 

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

LivingBooksConsole_console
 
Common::INIFile _bookInfoFile
 
bool _readOnly
 
bool _introDone
 
LBMode _curMode
 
uint16 _curPage
 
uint16 _curSubPage
 
uint16 _phase
 
LBPage_page
 
Common::Array< LBItem * > _items
 
Common::List< LBItem * > _orderedItems
 
Common::Queue< DelayedEvent_eventQueue
 
LBItem_focus
 
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,
  kSupportsJoystick
}
 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 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
Common::TimerManager_timer
 
Common::EventManager_eventMan
 
Common::SaveFileManager_saveFileMan
 
GUI::Dialog_mainMenuDialog
 
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 ( )
virtual

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)
private

Definition at line 923 of file livingbooks.cpp.

◆ convertWinFileName()

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

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 ( )
private

Definition at line 366 of file livingbooks.cpp.

◆ getBookInfoFileName()

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

Definition at line 84 of file detection.cpp.

◆ getCurMode()

LBMode Mohawk::MohawkEngine_LivingBooks::getCurMode ( )
inline

Definition at line 749 of file livingbooks.h.

◆ getDebugger()

GUI::Debugger* Mohawk::MohawkEngine_LivingBooks::getDebugger ( )
inlineoverridevirtual

Return the engine's debugger instance, if any.

Used by error() to invoke the debugger when a severe error is reported.

Reimplemented from Engine.

Definition at line 728 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 
)
private

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 
)
private

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 
)
private

Definition at line 875 of file livingbooks.cpp.

◆ handleNotify()

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

Definition at line 1299 of file livingbooks.cpp.

◆ handleUIMenuClick()

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

Definition at line 1026 of file livingbooks.cpp.

◆ handleUIOptionsClick()

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

Definition at line 1227 of file livingbooks.cpp.

◆ handleUIPoetryMenuClick()

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

Definition at line 1119 of file livingbooks.cpp.

◆ handleUIQuitClick()

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

Definition at line 1187 of file livingbooks.cpp.

◆ isBigEndian()

bool Mohawk::MohawkEngine_LivingBooks::isBigEndian ( ) const
inline

Definition at line 746 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)
private

Definition at line 308 of file livingbooks.cpp.

◆ loadPage()

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

Definition at line 425 of file livingbooks.cpp.

◆ loadSHP()

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

◆ 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)
overrideprivatevirtual

Actual implementation of pauseEngine by subclasses.

See there for details.

Reimplemented from Engine.

Definition at line 297 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 
)
private

Definition at line 901 of file livingbooks.cpp.

◆ run()

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

Init the engine and start its main loop.

Returns
returns kNoError on success, else an error code.

Implements Engine.

Definition at line 170 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)
private

Definition at line 345 of file livingbooks.cpp.

◆ tryDefaultPage()

bool Mohawk::MohawkEngine_LivingBooks::tryDefaultPage ( )
private

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 ( )
private

Definition at line 510 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
private

Definition at line 811 of file livingbooks.h.

◆ _bookInfoFile

Common::INIFile Mohawk::MohawkEngine_LivingBooks::_bookInfoFile
private

Definition at line 765 of file livingbooks.h.

◆ _console

LivingBooksConsole* Mohawk::MohawkEngine_LivingBooks::_console
private

Definition at line 764 of file livingbooks.h.

◆ _copyright

Common::String Mohawk::MohawkEngine_LivingBooks::_copyright
private

Definition at line 806 of file livingbooks.h.

◆ _curLanguage

uint16 Mohawk::MohawkEngine_LivingBooks::_curLanguage
private

Definition at line 809 of file livingbooks.h.

◆ _curMode

LBMode Mohawk::MohawkEngine_LivingBooks::_curMode
private

Definition at line 773 of file livingbooks.h.

◆ _curPage

uint16 Mohawk::MohawkEngine_LivingBooks::_curPage
private

Definition at line 774 of file livingbooks.h.

◆ _curSelectedPage

uint16 Mohawk::MohawkEngine_LivingBooks::_curSelectedPage
private

Definition at line 810 of file livingbooks.h.

◆ _curSubPage

uint16 Mohawk::MohawkEngine_LivingBooks::_curSubPage
private

Definition at line 774 of file livingbooks.h.

◆ _eventQueue

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

Definition at line 779 of file livingbooks.h.

◆ _focus

LBItem* Mohawk::MohawkEngine_LivingBooks::_focus
private

Definition at line 780 of file livingbooks.h.

◆ _gfx

LBGraphics* Mohawk::MohawkEngine_LivingBooks::_gfx

Definition at line 720 of file livingbooks.h.

◆ _introDone

bool Mohawk::MohawkEngine_LivingBooks::_introDone
private

Definition at line 772 of file livingbooks.h.

◆ _items

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

Definition at line 777 of file livingbooks.h.

◆ _lastSoundId

uint16 Mohawk::MohawkEngine_LivingBooks::_lastSoundId
private

Definition at line 784 of file livingbooks.h.

◆ _lastSoundOwner

uint16 Mohawk::MohawkEngine_LivingBooks::_lastSoundOwner
private

Definition at line 784 of file livingbooks.h.

◆ _lastSoundPriority

uint16 Mohawk::MohawkEngine_LivingBooks::_lastSoundPriority
private

Definition at line 785 of file livingbooks.h.

◆ _maxSoundPriority

uint16 Mohawk::MohawkEngine_LivingBooks::_maxSoundPriority
private

Definition at line 787 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
private

Definition at line 798 of file livingbooks.h.

◆ _numLanguages

uint16 Mohawk::MohawkEngine_LivingBooks::_numLanguages
private

Definition at line 803 of file livingbooks.h.

◆ _numPages

uint16 Mohawk::MohawkEngine_LivingBooks::_numPages
private

Definition at line 804 of file livingbooks.h.

◆ _orderedItems

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

Definition at line 778 of file livingbooks.h.

◆ _page

LBPage* Mohawk::MohawkEngine_LivingBooks::_page
private

Definition at line 776 of file livingbooks.h.

◆ _phase

uint16 Mohawk::MohawkEngine_LivingBooks::_phase
private

Definition at line 775 of file livingbooks.h.

◆ _poetryMode

bool Mohawk::MohawkEngine_LivingBooks::_poetryMode
private

Definition at line 807 of file livingbooks.h.

◆ _readOnly

bool Mohawk::MohawkEngine_LivingBooks::_readOnly
private

Definition at line 772 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
private

Definition at line 802 of file livingbooks.h.

◆ _screenWidth

uint16 Mohawk::MohawkEngine_LivingBooks::_screenWidth
private

Definition at line 801 of file livingbooks.h.

◆ _sound

Sound* Mohawk::MohawkEngine_LivingBooks::_sound

Definition at line 719 of file livingbooks.h.

◆ _soundLockOwner

uint16 Mohawk::MohawkEngine_LivingBooks::_soundLockOwner
private

Definition at line 786 of file livingbooks.h.

◆ _title

Common::String Mohawk::MohawkEngine_LivingBooks::_title
private

Definition at line 805 of file livingbooks.h.

◆ _variables

Definition at line 757 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: