ScummVM
Adl::AdlEngine_v2 Class Reference

#include <adl_v2.h>

Inheritance diagram for Adl::AdlEngine_v2:
Collaboration diagram for Adl::AdlEngine_v2:

Public Member Functions

virtual ~AdlEngine_v2 ()
 
- Public Member Functions inherited from Adl::AdlEngine
virtual ~AdlEngine ()
 
bool pollEvent (Common::Event &event) const
 
void bell (uint count=1) const
 
- 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...
 
void setGameToLoadSlot (int slot)
 Sets the game slot for a savegame to be loaded after global main menu execution. More...
 

Protected Member Functions

 AdlEngine_v2 (OSystem *syst, const AdlGameDescription *gd)
 
void setupOpcodeTables () override
 
void initState () override
 
byte roomArg (byte room) const override
 
void advanceClock () override
 
void printString (const Common::String &str) override
 
Common::String loadMessage (uint idx) const override
 
void drawItems () override
 
void drawItem (Item &item, const Common::Point &pos) override
 
void loadRoom (byte roomNr) override
 
void showRoom () override
 
void takeItem (byte noun) override
 
bool canSaveGameStateCurrently () override
 Indicates whether a game state can be saved. More...
 
void insertDisk (byte volume)
 
virtual DataBlockPtr readDataBlockPtr (Common::ReadStream &f) const
 
virtual void adjustDataBlockPtr (byte &track, byte &sector, byte &offset, byte &size) const
 
void loadItems (Common::ReadStream &stream)
 
void loadRooms (Common::ReadStream &stream, byte count)
 
void loadMessages (Common::ReadStream &stream, byte count)
 
void loadPictures (Common::ReadStream &stream)
 
void loadItemPictures (Common::ReadStream &stream, byte count)
 
virtual bool isInventoryFull ()
 
int askForSlot (const Common::String &question)
 
void checkTextOverflow (char c)
 
void handleTextOverflow ()
 
virtual int o_isFirstTime (ScriptEnv &e)
 
virtual int o_isRandomGT (ScriptEnv &e)
 
virtual int o_isNounNotInRoom (ScriptEnv &e)
 
virtual int o_isCarryingSomething (ScriptEnv &e)
 
int o_moveItem (ScriptEnv &e) override
 
int o_setCurPic (ScriptEnv &e) override
 
int o_setPic (ScriptEnv &e) override
 
virtual int o_moveAllItems (ScriptEnv &e)
 
int o_save (ScriptEnv &e) override
 
int o_restore (ScriptEnv &e) override
 
int o_placeItem (ScriptEnv &e) override
 
virtual int o_tellTime (ScriptEnv &e)
 
virtual int o_setRoomFromVar (ScriptEnv &e)
 
virtual int o_initDisk (ScriptEnv &e)
 
- Protected Member Functions inherited from Adl::AdlEngine
 AdlEngine (OSystem *syst, const AdlGameDescription *gd)
 
Common::Error loadGameState (int slot)
 Load a game state. More...
 
Common::Error saveGameState (int slot, const Common::String &desc)
 Save a game state. More...
 
Common::String getDiskImageName (byte volume) const
 
GameType getGameType () const
 
GameVersion getGameVersion () const
 
virtual void gameLoop ()
 
virtual void loadState (Common::ReadStream &stream)
 
virtual void saveState (Common::WriteStream &stream)
 
Common::String readString (Common::ReadStream &stream, byte until=0) const
 
Common::String readStringAt (Common::SeekableReadStream &stream, uint offset, byte until=0) const
 
void openFile (Common::File &file, const Common::String &name) const
 
virtual void printMessage (uint idx)
 
virtual Common::String getItemDescription (const Item &item) const
 
void delay (uint32 ms) const
 
virtual Common::String getLine ()
 
Common::String inputString (byte prompt=0) const
 
byte inputKey (bool showCursor=true) const
 
void getInput (uint &verb, uint &noun)
 
virtual Common::String formatVerbError (const Common::String &verb) const
 
virtual Common::String formatNounError (const Common::String &verb, const Common::String &noun) const
 
void loadWords (Common::ReadStream &stream, WordMap &map, Common::StringArray &pri) const
 
void readCommands (Common::ReadStream &stream, Commands &commands)
 
void removeCommand (Commands &commands, uint idx)
 
CommandgetCommand (Commands &commands, uint idx)
 
void checkInput (byte verb, byte noun)
 
virtual bool isInputValid (byte verb, byte noun, bool &is_any)
 
virtual bool isInputValid (const Commands &commands, byte verb, byte noun, bool &is_any)
 
virtual void applyRoomWorkarounds (byte roomNr)
 
virtual void applyRegionWorkarounds ()
 
virtual void switchRoom (byte roomNr)
 
void loadDroppedItemOffsets (Common::ReadStream &stream, byte count)
 
template<class T >
Opcode opcode (int(T::*f)(ScriptEnv &))
 
virtual int o_isItemInRoom (ScriptEnv &e)
 
virtual int o_isMovesGT (ScriptEnv &e)
 
virtual int o_isVarEQ (ScriptEnv &e)
 
virtual int o_isCurPicEQ (ScriptEnv &e)
 
virtual int o_isItemPicEQ (ScriptEnv &e)
 
virtual int o_varAdd (ScriptEnv &e)
 
virtual int o_varSub (ScriptEnv &e)
 
virtual int o_varSet (ScriptEnv &e)
 
virtual int o_listInv (ScriptEnv &e)
 
virtual int o_setRoom (ScriptEnv &e)
 
virtual int o_printMsg (ScriptEnv &e)
 
virtual int o_setLight (ScriptEnv &e)
 
virtual int o_setDark (ScriptEnv &e)
 
virtual int o_restart (ScriptEnv &e)
 
virtual int o_quit (ScriptEnv &e)
 
virtual int o_setItemPic (ScriptEnv &e)
 
virtual int o_resetPic (ScriptEnv &e)
 
virtual int o_takeItem (ScriptEnv &e)
 
virtual int o_dropItem (ScriptEnv &e)
 
virtual int o_setRoomPic (ScriptEnv &e)
 
virtual int goDirection (ScriptEnv &e, Direction D)
 
int o_goNorth (ScriptEnv &e)
 
int o_goSouth (ScriptEnv &e)
 
int o_goEast (ScriptEnv &e)
 
int o_goWest (ScriptEnv &e)
 
int o_goUp (ScriptEnv &e)
 
int o_goDown (ScriptEnv &e)
 
void drawPic (byte pic, Common::Point pos=Common::Point()) const
 
bool playTones (const Tones &tones, bool isMusic, bool allowSkip=false) const
 
const RegiongetRegion (uint i) const
 
RegiongetRegion (uint i)
 
const RoomgetRoom (uint i) const
 
RoomgetRoom (uint i)
 
const RegiongetCurRegion () const
 
RegiongetCurRegion ()
 
const RoomgetCurRoom () const
 
RoomgetCurRoom ()
 
const ItemgetItem (uint i) const
 
ItemgetItem (uint i)
 
byte getVar (uint i) const
 
void setVar (uint i, byte value)
 
virtual void dropItem (byte noun)
 
bool matchCommand (ScriptEnv &env) const
 
void doActions (ScriptEnv &env)
 
bool doOneCommand (const Commands &commands, byte verb, byte noun)
 
void doAllCommands (const Commands &commands, byte verb, byte noun)
 
virtual ScriptEnvcreateScriptEnv (const Command &cmd, byte room, byte verb, byte noun)
 
Common::String itemStr (uint i) const
 
Common::String roomStr (uint i) const
 
Common::String itemRoomStr (uint i) const
 
Common::String verbStr (uint i) const
 
Common::String nounStr (uint i) const
 
Common::String msgStr (uint i) const
 
Common::String dirStr (Direction dir) const
 
bool op_debug (const char *fmt,...) const
 
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
bool shouldPerformAutoSave (int lastSaveTime)
 Indicate whether an autosave should be performed. More...
 
virtual void pauseEngineIntern (bool pause)
 Actual implementation of pauseEngine by subclasses. More...
 

Protected Attributes

struct {
   Common::String   time
 
   Common::String   saveInsert
 
   Common::String   saveReplace
 
   Common::String   restoreInsert
 
   Common::String   restoreReplace
 
_strings_v2
 
uint _maxLines
 
DiskImage_disk
 
byte _currentVolume
 
Common::Array< DataBlockPtr_itemPics
 
bool _itemRemoved
 
byte _roomOnScreen
 
byte _picOnScreen
 
byte _itemsOnScreen
 
Common::Array< byte_brokenRooms
 
- Protected Attributes inherited from Adl::AdlEngine
Common::DumpFile_dumpFile
 
Display_display
 
GraphicsMan_graphics
 
bool _textMode
 
Common::Array< Opcode_condOpcodes
 
Common::Array< Opcode_actOpcodes
 
Common::Array< DataBlockPtr_messages
 
PictureMap _pictures
 
Common::Array< Common::Point_itemOffsets
 
Commands _roomCommands
 
Commands _globalCommands
 
RoomData _roomData
 
WordMap _verbs
 
WordMap _nouns
 
Common::StringArray _priVerbs
 
Common::StringArray _priNouns
 
struct {
   Common::String   enterCommand
 
   Common::String   verbError
 
   Common::String   nounError
 
   Common::String   playAgain
 
   Common::String   pressReturn
 
   Common::String   lineFeeds
 
_strings
 
struct {
   uint   cantGoThere
 
   uint   dontUnderstand
 
   uint   itemDoesntMove
 
   uint   itemNotHere
 
   uint   thanksForPlaying
 
_messageIds
 
State _state
 
uint _linesPrinted
 
bool _isRestarting
 
bool _isRestoring
 
bool _isQuitting
 
bool _canSaveNow
 
bool _canRestoreNow
 
bool _abortScript
 
Common::RandomSource_random
 
const AdlGameDescription_gameDescription
 
Common::File_inputScript
 
uint _scriptDelay
 
bool _scriptPaused
 
- Protected Attributes inherited from Engine
Common::TimerManager_timer
 
Common::EventManager_eventMan
 
Common::SaveFileManager_saveFileMan
 
GUI::Dialog_mainMenuDialog
 
const Common::String _targetName
 

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...
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 
- Protected Types inherited from Adl::AdlEngine
typedef Common::SharedPtr< Common::Functor1< ScriptEnv &, int > > Opcode
 
- Static Protected Member Functions inherited from Adl::AdlEngine
static Common::String toAscii (const Common::String &str)
 

Detailed Description

Definition at line 30 of file adl_v2.h.

Constructor & Destructor Documentation

◆ ~AdlEngine_v2()

Adl::AdlEngine_v2::~AdlEngine_v2 ( )
virtual

Definition at line 33 of file adl_v2.cpp.

◆ AdlEngine_v2()

Adl::AdlEngine_v2::AdlEngine_v2 ( OSystem syst,
const AdlGameDescription gd 
)
protected

Definition at line 37 of file adl_v2.cpp.

Member Function Documentation

◆ adjustDataBlockPtr()

virtual void Adl::AdlEngine_v2::adjustDataBlockPtr ( byte track,
byte sector,
byte offset,
byte size 
) const
inlineprotectedvirtual

Reimplemented in Adl::HiRes4Engine_Atari, and Adl::AdlEngine_v4.

Definition at line 55 of file adl_v2.h.

◆ advanceClock()

void Adl::AdlEngine_v2::advanceClock ( )
overrideprotectedvirtual

Reimplemented from Adl::AdlEngine.

Definition at line 88 of file adl_v2.cpp.

◆ askForSlot()

int Adl::AdlEngine_v2::askForSlot ( const Common::String question)
protected

Definition at line 610 of file adl_v2.cpp.

◆ canSaveGameStateCurrently()

bool Adl::AdlEngine_v2::canSaveGameStateCurrently ( )
overrideprotectedvirtual

Indicates whether a game state can be saved.

Reimplemented from Adl::AdlEngine.

Reimplemented in Adl::HiRes6Engine.

Definition at line 597 of file adl_v2.cpp.

◆ checkTextOverflow()

void Adl::AdlEngine_v2::checkTextOverflow ( char  c)
protected

Definition at line 103 of file adl_v2.cpp.

◆ drawItem()

void Adl::AdlEngine_v2::drawItem ( Item item,
const Common::Point pos 
)
overrideprotectedvirtual

Implements Adl::AdlEngine.

Definition at line 191 of file adl_v2.cpp.

◆ drawItems()

void Adl::AdlEngine_v2::drawItems ( )
overrideprotectedvirtual

Implements Adl::AdlEngine.

Definition at line 304 of file adl_v2.cpp.

◆ handleTextOverflow()

void Adl::AdlEngine_v2::handleTextOverflow ( )
protected

Definition at line 113 of file adl_v2.cpp.

◆ initState()

void Adl::AdlEngine_v2::initState ( )
overrideprotectedvirtual

Reimplemented from Adl::AdlEngine.

Definition at line 72 of file adl_v2.cpp.

◆ insertDisk()

void Adl::AdlEngine_v2::insertDisk ( byte  volume)
protected

Definition at line 47 of file adl_v2.cpp.

◆ isInventoryFull()

virtual bool Adl::AdlEngine_v2::isInventoryFull ( )
inlineprotectedvirtual

Reimplemented in Adl::HiRes5Engine.

Definition at line 61 of file adl_v2.h.

◆ loadItemPictures()

void Adl::AdlEngine_v2::loadItemPictures ( Common::ReadStream stream,
byte  count 
)
protected

Definition at line 412 of file adl_v2.cpp.

◆ loadItems()

void Adl::AdlEngine_v2::loadItems ( Common::ReadStream stream)
protected

Definition at line 346 of file adl_v2.cpp.

◆ loadMessage()

Common::String Adl::AdlEngine_v2::loadMessage ( uint  idx) const
overrideprotectedvirtual

Implements Adl::AdlEngine.

Reimplemented in Adl::AdlEngine_v4.

Definition at line 145 of file adl_v2.cpp.

◆ loadMessages()

void Adl::AdlEngine_v2::loadMessages ( Common::ReadStream stream,
byte  count 
)
protected

Definition at line 397 of file adl_v2.cpp.

◆ loadPictures()

void Adl::AdlEngine_v2::loadPictures ( Common::ReadStream stream)
protected

Definition at line 402 of file adl_v2.cpp.

◆ loadRoom()

void Adl::AdlEngine_v2::loadRoom ( byte  roomNr)
overrideprotectedvirtual

Implements Adl::AdlEngine.

Reimplemented in Adl::HiRes4Engine_Atari.

Definition at line 198 of file adl_v2.cpp.

◆ loadRooms()

void Adl::AdlEngine_v2::loadRooms ( Common::ReadStream stream,
byte  count 
)
protected

Definition at line 378 of file adl_v2.cpp.

◆ o_initDisk()

int Adl::AdlEngine_v2::o_initDisk ( ScriptEnv e)
protectedvirtual

Definition at line 590 of file adl_v2.cpp.

◆ o_isCarryingSomething()

int Adl::AdlEngine_v2::o_isCarryingSomething ( ScriptEnv e)
protectedvirtual

Definition at line 455 of file adl_v2.cpp.

◆ o_isFirstTime()

int Adl::AdlEngine_v2::o_isFirstTime ( ScriptEnv e)
protectedvirtual

Definition at line 419 of file adl_v2.cpp.

◆ o_isNounNotInRoom()

int Adl::AdlEngine_v2::o_isNounNotInRoom ( ScriptEnv e)
protectedvirtual

Reimplemented in Adl::AdlEngine_v5, and Adl::AdlEngine_v3.

Definition at line 443 of file adl_v2.cpp.

◆ o_isRandomGT()

int Adl::AdlEngine_v2::o_isRandomGT ( ScriptEnv e)
protectedvirtual

Definition at line 432 of file adl_v2.cpp.

◆ o_moveAllItems()

int Adl::AdlEngine_v2::o_moveAllItems ( ScriptEnv e)
protectedvirtual

Reimplemented in Adl::AdlEngine_v4.

Definition at line 498 of file adl_v2.cpp.

◆ o_moveItem()

int Adl::AdlEngine_v2::o_moveItem ( ScriptEnv e)
overrideprotectedvirtual

Reimplemented from Adl::AdlEngine.

Reimplemented in Adl::AdlEngine_v4.

Definition at line 466 of file adl_v2.cpp.

◆ o_placeItem()

int Adl::AdlEngine_v2::o_placeItem ( ScriptEnv e)
overrideprotectedvirtual

Reimplemented from Adl::AdlEngine.

Definition at line 553 of file adl_v2.cpp.

◆ o_restore()

int Adl::AdlEngine_v2::o_restore ( ScriptEnv e)
overrideprotectedvirtual

Reimplemented from Adl::AdlEngine.

Reimplemented in Adl::AdlEngine_v4.

Definition at line 535 of file adl_v2.cpp.

◆ o_save()

int Adl::AdlEngine_v2::o_save ( ScriptEnv e)
overrideprotectedvirtual

Reimplemented from Adl::AdlEngine.

Reimplemented in Adl::AdlEngine_v4.

Definition at line 520 of file adl_v2.cpp.

◆ o_setCurPic()

int Adl::AdlEngine_v2::o_setCurPic ( ScriptEnv e)
overrideprotectedvirtual

Reimplemented from Adl::AdlEngine.

Definition at line 484 of file adl_v2.cpp.

◆ o_setPic()

int Adl::AdlEngine_v2::o_setPic ( ScriptEnv e)
overrideprotectedvirtual

Reimplemented from Adl::AdlEngine.

Definition at line 491 of file adl_v2.cpp.

◆ o_setRoomFromVar()

int Adl::AdlEngine_v2::o_setRoomFromVar ( ScriptEnv e)
protectedvirtual

Definition at line 583 of file adl_v2.cpp.

◆ o_tellTime()

int Adl::AdlEngine_v2::o_tellTime ( ScriptEnv e)
protectedvirtual

Definition at line 566 of file adl_v2.cpp.

◆ printString()

void Adl::AdlEngine_v2::printString ( const Common::String str)
overrideprotectedvirtual

Implements Adl::AdlEngine.

Reimplemented in Adl::HiRes6Engine.

Definition at line 154 of file adl_v2.cpp.

◆ readDataBlockPtr()

DataBlockPtr Adl::AdlEngine_v2::readDataBlockPtr ( Common::ReadStream f) const
protectedvirtual

Definition at line 329 of file adl_v2.cpp.

◆ roomArg()

byte Adl::AdlEngine_v2::roomArg ( byte  room) const
overrideprotectedvirtual

Reimplemented from Adl::AdlEngine.

Definition at line 82 of file adl_v2.cpp.

◆ setupOpcodeTables()

void Adl::AdlEngine_v2::setupOpcodeTables ( )
overrideprotectedvirtual

Reimplemented from Adl::AdlEngine.

Reimplemented in Adl::AdlEngine_v4, Adl::HiRes6Engine, Adl::HiRes5Engine, and Adl::AdlEngine_v5.

Definition at line 57 of file adl_v2.cpp.

◆ showRoom()

void Adl::AdlEngine_v2::showRoom ( )
overrideprotectedvirtual

Implements Adl::AdlEngine.

Reimplemented in Adl::HiRes6Engine.

Definition at line 234 of file adl_v2.cpp.

◆ takeItem()

void Adl::AdlEngine_v2::takeItem ( byte  noun)
overrideprotectedvirtual

Reimplemented from Adl::AdlEngine.

Definition at line 271 of file adl_v2.cpp.

Member Data Documentation

◆ _brokenRooms

Common::Array<byte> Adl::AdlEngine_v2::_brokenRooms
protected

Definition at line 95 of file adl_v2.h.

◆ _currentVolume

byte Adl::AdlEngine_v2::_currentVolume
protected

Definition at line 91 of file adl_v2.h.

◆ _disk

DiskImage* Adl::AdlEngine_v2::_disk
protected

Definition at line 90 of file adl_v2.h.

◆ _itemPics

Common::Array<DataBlockPtr> Adl::AdlEngine_v2::_itemPics
protected

Definition at line 92 of file adl_v2.h.

◆ _itemRemoved

bool Adl::AdlEngine_v2::_itemRemoved
protected

Definition at line 93 of file adl_v2.h.

◆ _itemsOnScreen

byte Adl::AdlEngine_v2::_itemsOnScreen
protected

Definition at line 94 of file adl_v2.h.

◆ _maxLines

uint Adl::AdlEngine_v2::_maxLines
protected

Definition at line 89 of file adl_v2.h.

◆ _picOnScreen

byte Adl::AdlEngine_v2::_picOnScreen
protected

Definition at line 94 of file adl_v2.h.

◆ _roomOnScreen

byte Adl::AdlEngine_v2::_roomOnScreen
protected

Definition at line 94 of file adl_v2.h.

◆ _strings_v2

struct { ... } Adl::AdlEngine_v2::_strings_v2

◆ restoreInsert

Common::String Adl::AdlEngine_v2::restoreInsert

Definition at line 86 of file adl_v2.h.

◆ restoreReplace

Common::String Adl::AdlEngine_v2::restoreReplace

Definition at line 86 of file adl_v2.h.

◆ saveInsert

Common::String Adl::AdlEngine_v2::saveInsert

Definition at line 85 of file adl_v2.h.

◆ saveReplace

Common::String Adl::AdlEngine_v2::saveReplace

Definition at line 85 of file adl_v2.h.

◆ time

Common::String Adl::AdlEngine_v2::time

Definition at line 84 of file adl_v2.h.


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