ScummVM API documentation
WaynesWorld::WaynesWorldEngine Class Reference
Inheritance diagram for WaynesWorld::WaynesWorldEngine:
Engine

Classes

struct  SaveHeader
 

Public Types

enum  kReadSaveHeaderError { kRSHENoError = 0, kRSHEInvalidType = 1, kRSHEInvalidVersion = 2, kRSHEIoError = 3 }
 
- Public Types inherited from Engine
enum  EngineFeature {
  kSupportsSubtitleOptions, kSupportsReturnToLauncher, kSupportsLoadingDuringRuntime, kSupportsSavingDuringRuntime,
  kSupportsChangingOptionsDuringRuntime, kSupportsArbitraryResolutions, kSupportsHelp, kSupportsQuitDialogOverride
}
 

Public Member Functions

 WaynesWorldEngine (OSystem *syst, const ADGameDescription *gd)
 
const Common::String getTargetName ()
 
bool canLoadGameStateCurrently (Common::U32String *msg=nullptr) override
 
bool canSaveGameStateCurrently (Common::U32String *msg=nullptr) override
 
Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false) override
 
Common::Error loadGameState (int slot) override
 
void updateEvents ()
 
int getRandom (int max)
 
void waitMillis (uint millis)
 
void waitSeconds (uint seconds)
 
void initMouseCursor ()
 
bool isPointAtWayne (int x, int y)
 
bool isPointAtGarth (int x, int y)
 
void updateMouseMove ()
 
void handleMouseClick ()
 
void handleMouseLeftClick ()
 
void handleMouseRightClick ()
 
void loadPalette (GxlArchive *lib, const char *filename)
 
void paletteFadeIn (int index, int count, int stepsSize)
 
void paletteFadeOut (int index, int count, int stepsSize)
 
void paletteFadeColor (int index, byte r, byte g, byte b, int steps)
 
void handleMapPalette ()
 
void drawImageToSurfaceIntern (GxlArchive *lib, const char *filename, WWSurface *destSurface, int x, int y, bool transparent)
 
void drawImageToScreenIntern (GxlArchive *lib, const char *filename, int x, int y, bool transparent)
 
void drawImageToScreen (GxlArchive *lib, const char *filename, int x, int y)
 
void drawImageToSurface (GxlArchive *lib, const char *filename, WWSurface *destSurface, int x, int y)
 
void drawRoomImageToBackground (const char *filename, int x, int y)
 
void drawRoomImageToBackgroundTransparent (const char *filename, int x, int y)
 
void drawRoomImageToScreen (const char *filename, int x, int y)
 
void drawRoomImageToSurface (const char *filename, WWSurface *destSurface, int x, int y)
 
void drawSpiralEffect (Graphics::Surface *surface, int x, int y, int grainWidth, int grainHeight)
 
void drawRandomEffect (Graphics::Surface *surface, int x, int y, int grainWidth, int grainHeight)
 
Common::String loadString (const char *filename, int index, int flag)
 
void drawCurrentTextToSurface (WWSurface *destSurface, int x, int y)
 
void drawCurrentText (int x, int y, WWSurface *destSurface)
 
void displayText (const char *filename, int index, int flag, int x, int y, int drawToVirtual)
 
void displayTextLines (const char *filename, int baseIndex, int x, int y, int count)
 
void playSound (const char *filename, int flag)
 
void changeMusic ()
 
void stopMusic ()
 
void drawInterface (int verbNum)
 
void selectVerbNumber2 (int x)
 
void selectVerbNumber (int x)
 
void changeActor ()
 
void drawVerbLine (int verbNumber, int objectNumber, const char *objectName)
 
void rememberFirstObjectName (int objectId)
 
void redrawInventory ()
 
void refreshInventory (bool doRefresh)
 
void drawInventory ()
 
void setWayneInventoryItemQuantity (int objectId, int quantity)
 
void setGarthInventoryItemQuantity (int objectId, int quantity)
 
int getWayneInventoryItemQuantity (int objectId)
 
int getGarthInventoryItemQuantity (int objectId)
 
void loadMainActorSprites ()
 
void unloadMainActorSprites ()
 
int getActorScaleFromY (int actorY)
 
void drawActorReachObject (int objectId, int spriteIndex)
 
int drawActors (int direction, int wayneKind, int garthKind, int spriteIndex, int wayneX, int wayneY, int garthX, int garthY)
 
void refreshActors ()
 
void pickupObject (int objectId, byte &flags, byte flagsSet, int inventoryObjectId)
 
void playAnimation (const char *prefix, int startIndex, int count, int x, int y, int flag, uint ticks)
 
void playAnimationLoops (const char *prefix, int startIndex, int count, int x, int y, int flag, uint ticks, int loopCount)
 
void setWaynePosition (int x, int y)
 
void setGarthPosition (int x, int y)
 
bool isActorWayne ()
 
bool isActorGarth ()
 
void selectActorWayne ()
 
void selectActorGarth ()
 
void toggleActor ()
 
bool walkIsPixelWalkable (int x, int y)
 
bool walkAdjustDestPoint (int &x, int &y)
 
void walkGetNextPoint (int sourceX, int sourceY, int destX, int destY, int &nextX, int &nextY)
 
void walkCalcOtherActorDest (int flag, int &x, int &y)
 
int walkCalcPath (int flag, int sourceX, int sourceY, int destX, int destY, int pointsCount)
 
bool walkFindPoint (int flag, int &sourceX, int &sourceY, int &nextSourceX, int &nextSourceY, int destX, int destY, int pointsCount)
 
int walkAddWalkLine (int flag, int x1, int y1, int x2, int y2, int pointsCount)
 
bool walkTestPoint (int sourceX, int sourceY, int nextSourceX, int nextSourceY, int destX, int destY)
 
bool walkIsLineWalkable (int sourceX, int sourceY, int destX, int destY)
 
int walkCalcDirection (int deltaX, int deltaY)
 
bool walkTo (int actor1_destX, int actor1_destY, int direction, int actor2_destX, int actor2_destY)
 
void gxCloseLib (GxlArchive *lib)
 
void setMouseBounds (int x1, int x2, int y1, int y2)
 
void openRoomLibrary (int roomNum)
 
void openAlternateRoomLibrary (const char *name)
 
void loadRoomBackground ()
 
void changeRoom (int roomNum)
 
void refreshRoomBackground (int roomNum)
 
void handleRoomEvent ()
 
void changeRoomScrolling ()
 
void loadScrollSprite ()
 
void scrollRoom ()
 
void loadRoomMask (int roomNum)
 
void fillRoomMaskArea (int x1, int y1, int x2, int y2, bool blocked)
 
void loadAnimationSpriteRange (int baseIndex, const char *filename, int count)
 
void loadAnimationSprite (int index, const char *filename)
 
void drawAnimationSprite (int index, int x, int y)
 
void drawAnimationSpriteTransparent (int index, int x, int y)
 
void updateRoomAnimations ()
 
void startRoomAnimations ()
 
void stopRoomAnimations ()
 
void updateAnimationTimers ()
 
void setAnimationTimer (uint index, uint32 delay, int initialCounter=0)
 
bool isAnimationTimerExpired (uint index)
 
int getAnimationTimerCounter (uint index)
 
void initStaticRoomObjects ()
 
void loadStaticRoomObjects (int roomNum)
 
void unloadStaticRoomObjects ()
 
void setStaticRoomObjectPosition (int roomNum, int fromIndex, int toIndex, int x, int y)
 
void drawStaticRoomObjects (int roomNum, int x, int y, int actorHeight, int actorWidth, WWSurface *surface)
 
void initRoomObjects ()
 
void moveObjectToRoom (int objectId, int roomNum)
 
void moveObjectToNowhere (int objectId)
 
const RoomObjectgetRoomObject (int objectId)
 
const char * getRoomObjectName (int objectId)
 
int getObjectRoom (int objectId)
 
int getObjectDirection (int objectId)
 
int findRoomObjectIdAtPoint (int x, int y)
 
void walkToObject ()
 
void startDialog ()
 
void setDialogChoices (int choice1, int choice2, int choice3, int choice4, int choice5)
 
void drawDialogChoices (int choiceIndex)
 
void handleDialogMouseClick ()
 
void handleVerb (int verbFlag)
 
void handleVerbPickUp ()
 
void handleVerbLookAt ()
 
void handleVerbUse ()
 
void handleVerbTalkTo ()
 
void handleVerbPush ()
 
void handleVerbPull ()
 
void handleVerbExtremeCloseupOf ()
 
void handleVerbGive ()
 
void handleVerbOpen ()
 
void handleVerbClose ()
 
void lookAtUnusedTicket ()
 
void unusedTicketHandleMouseMove ()
 
void unusedTicketHandleMouseClick ()
 
void extremeCloseUpHandleMouseClick ()
 
void gameMapOpen ()
 
void gameMapFinish ()
 
void gameMapHandleMouseMove (int objectNumber)
 
void gameMapHandleMouseClick ()
 
void gameMapSelectItem (const char *prefix, int animX, int animY)
 
void gameMapPaletteHandlerStart ()
 
void gameMapPaletteHandlerStop ()
 
void writeSavegameHeader (Common::OutSaveFile *out, SavegameHeader &header)
 
- Public Member Functions inherited from Engine
MetaEnginegetMetaEngine () const
 
void setMetaEngine (MetaEngine *metaEngine)
 
PauseToken pauseEngine ()
 
bool isPaused () const
 
void openMainMenuDialog ()
 
uint32 getTotalPlayTime () const
 
void setTotalPlayTime (uint32 time=0)
 
Common::TimerManagergetTimerManager ()
 
Common::EventManagergetEventManager ()
 
Common::SaveFileManagergetSaveFileManager ()
 
bool existExtractedCDAudioFiles (uint track=1)
 
bool isDataAndCDAudioReadFromSameCD ()
 
void warnMissingExtractedCDAudio ()
 
void handleAutoSave ()
 
void saveAutosaveIfEnabled ()
 
virtual bool canSaveAutosaveCurrently ()
 
virtual int getAutosaveSlot () const
 
virtual bool gameTypeHasAddOns () const
 
virtual bool dirCanBeGameAddOn (const Common::FSDirectory &dir) const
 
virtual bool dirMustBeGameAddOn (const Common::FSDirectory &dir) const
 
Common::ErrorCode updateAddOns (const MetaEngine *metaEngine) const
 
 Engine (OSystem *syst)
 
virtual ~Engine ()
 
virtual void initializePath (const Common::FSNode &gamePath)
 
virtual void errorString (const char *buf_input, char *buf_output, int buf_output_size)
 
virtual GUI::DebuggergetDebugger () final
 
void setDebugger (GUI::Debugger *debugger)
 
GUI::DebuggergetOrCreateDebugger ()
 
bool enhancementEnabled (int32 cls)
 
virtual void syncSoundSettings ()
 
virtual void applyGameSettings ()
 
virtual void flipMute ()
 
virtual Common::String getSaveStateName (int slot) const
 
virtual Common::Error loadGameStream (Common::SeekableReadStream *stream)
 
void setGameToLoadSlot (int slot)
 
virtual Common::Error saveGameStream (Common::WriteStream *stream, bool isAutosave=false)
 
bool saveGameDialog ()
 
bool loadGameDialog ()
 

Static Public Member Functions

static bool readSavegameHeader (Common::InSaveFile *in, SavegameHeader &header, bool skipThumbnail=true)
 
- Static Public Member Functions inherited from Engine
static void quitGame ()
 
static bool shouldQuit ()
 
static bool warnUserAboutUnsupportedGame (Common::String msg=Common::String())
 
static bool warnUserAboutUnsupportedAddOn (Common::String addOnName)
 
static void errorAddingAddOnWithoutBaseGame (Common::String addOnName, Common::String gameId)
 
static void errorUnsupportedGame (Common::String extraMsg)
 

Public Attributes

const ADGameDescription_gameDescription
 
bool _isSoundEnabled = true
 
bool _isMusicEnabled = true
 
bool _introOngoing = true
 
bool _escPressed = false
 
bool _useOriginalSaveLoad = true
 
Common::RandomSource_random = nullptr
 
GameLogic_logic = nullptr
 
byte _palette2 [768] = {0}
 
Screen_screen = nullptr
 
WWSurface_backgroundSurface = nullptr
 
WWSurface_backgroundScrollSurface = nullptr
 
GFTFont_fontWW = nullptr
 
GFTFont_fontWWInv = nullptr
 
GFTFont_fontBit5x7 = nullptr
 
WWSurface_roomAnimations [kRoomAnimationsCount] = {nullptr}
 
GxlArchive_m00Gxl = nullptr
 
GxlArchive_m01Gxl = nullptr
 
GxlArchive_m02Gxl = nullptr
 
GxlArchive_m03Gxl = nullptr
 
GxlArchive_m05Gxl = nullptr
 
GxlArchive_r10Gxl = nullptr
 
SoundManager_sound = nullptr
 
MusicManager_midi = nullptr
 
Common::String _roomName
 
GxlArchive_roomGxl = nullptr
 
byte * _walkMap = nullptr
 
int _scrollWidth = 0
 
int _scrollRemaining = 0
 
int _roomChangeCtr = 0
 
int _scrollPosition = 0
 
bool _doScrollRight = false
 
bool _hasRoomAnimationCallback = false
 
AnimationTimer _animationTimers [kAnimationTimersCount]
 
int _mouseX = 0
 
int _mouseY = 0
 
int _mouseClickY = 0
 
int _mouseClickX = 0
 
Common::Rect _mouseZone = {0, 0, 319, 199}
 
uint _mouseClickButtons = 0
 
Common::KeyCode _keyCode = Common::KEYCODE_INVALID
 
Common::String _currentText
 
int _currentTextX = 0
 
int _currentTextY = 0
 
bool _isTextVisible = false
 
int _musicIndex = 0
 
int _gameState
 
int _currentActorNum
 
int _currentRoomNumber
 
int _verbNumber
 
int _verbNumber2
 
int _objectNumber
 
int _hoverObjectNumber
 
int _firstObjectNumber
 
Common::String _firstObjectName
 
int _roomEventNum
 
int _animationsCtr
 
bool _animationsRedrawBackground
 
int _wayneSpriteX
 
int _wayneSpriteY
 
int _wayneKind
 
int _wayneActorScale
 
int _garthSpriteX
 
int _garthSpriteY
 
int _garthKind
 
int _garthActorScale
 
int _actorSpriteValue
 
int _actorSpriteIndex
 
WWSurface_wayneSprites [8]
 
WWSurface_wayneWalkSprites [8][4]
 
WWSurface_wayneReachRightSprite
 
WWSurface_wayneReachLeftSprite
 
WWSurface_garthSprites [8]
 
WWSurface_garthWalkSprites [8][4]
 
WWSurface_garthReachRightSprite
 
WWSurface_garthReachLeftSprite
 
WalkPoint _wayneWalkPoints [kWalkPointsCount]
 
WalkPoint _garthWalkPoints [kWalkPointsCount]
 
WWSurface_inventorySprite
 
int _inventoryItemsCount
 
int _inventoryItemsObjectMap [kInventorySize]
 
int _wayneInventory [kInventorySize]
 
int _garthInventory [kInventorySize]
 
int _selectedDialogChoice
 
int _dialogChoices [5]
 
RoomObject _roomObjects [kRoomObjectsCount]
 
StaticRoomObject _staticRoomObjects [kStaticRoomObjectsCount]
 
WWSurface_staticRoomObjectSprites [kStaticRoomObjectSpritesCount]
 
int _gameMapRoomNumber
 
int _gameMapWayneSpriteX
 
int _gameMapGarthSpriteX
 
int _currentMapItemIndex
 
int _gameMapDestinationRoomNum
 
bool _gameMapFlag
 
bool _gameMapHasPaletteHandler = false
 
int _gameMapCtr = 0
 
uint32 _gameMapLastTicks = 0
 
WWIntrointro = nullptr
 
bool _isSaveAllowed
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Static Public Attributes

static const RoomObject kRoomObjects [kRoomObjectsCount]
 
static const StaticRoomObjectMapEntry kStaticRoomObjectsMap [kStaticRoomObjectsMapCount]
 
static const StaticRoomObject kStaticRoomObjects [kStaticRoomObjectsCount]
 

Protected Member Functions

Common::Error run () override
 
bool hasFeature (EngineFeature f) const override
 
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
void defaultSyncSoundSettings ()
 
virtual void pauseEngineIntern (bool pause)
 

Additional Inherited Members

- Protected Attributes inherited from Engine
Common::TimerManager_timer
 
Common::EventManager_eventMan
 
Common::SaveFileManager_saveFileMan
 
GUI::Dialog_mainMenuDialog
 
const Common::String _targetName
 
int32 _activeEnhancements = kEnhGameBreakingBugFixes
 

Member Function Documentation

◆ run()

Common::Error WaynesWorld::WaynesWorldEngine::run ( )
overrideprotectedvirtual

Initialize the engine and start its main loop.

Returns
kNoError on success, otherwise an error code.

Implements Engine.

◆ hasFeature()

bool WaynesWorld::WaynesWorldEngine::hasFeature ( EngineFeature  f) const
overrideprotectedvirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

◆ canLoadGameStateCurrently()

bool WaynesWorld::WaynesWorldEngine::canLoadGameStateCurrently ( Common::U32String msg = nullptr)
inlineoverridevirtual

Indicate whether a game state can be loaded.

Parameters
msgOptional pointer to message explaining why it is disabled

Reimplemented from Engine.

◆ canSaveGameStateCurrently()

bool WaynesWorld::WaynesWorldEngine::canSaveGameStateCurrently ( Common::U32String msg = nullptr)
inlineoverridevirtual

Indicate whether a game state can be saved.

Parameters
msgOptional pointer to message explaining why it is disabled

Reimplemented from Engine.

◆ saveGameState()

Common::Error WaynesWorld::WaynesWorldEngine::saveGameState ( int  slot,
const Common::String desc,
bool  isAutosave = false 
)
overridevirtual

Save a game state.

Parameters
slotThe slot into which the save state should be stored.
descDescription for the save state, entered by the user.
isAutosaveExpected to be true if an autosave is being created.
Returns
kNoError on success, otherwise an error code.

Reimplemented from Engine.

◆ loadGameState()

Common::Error WaynesWorld::WaynesWorldEngine::loadGameState ( int  slot)
overridevirtual

Load a game state.

Parameters
slotThe slot from which a save state should be loaded.
Returns
kNoError on success, otherwise an error code.

Reimplemented from Engine.


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