ScummVM API documentation
Prince::PrinceEngine Class Reference
Inheritance diagram for Prince::PrinceEngine:
Engine

Public Types

enum  HeroId { kMainHero, kSecondHero }
 
- Public Types inherited from Engine
enum  EngineFeature {
  kSupportsSubtitleOptions, kSupportsReturnToLauncher, kSupportsLoadingDuringRuntime, kSupportsSavingDuringRuntime,
  kSupportsChangingOptionsDuringRuntime, kSupportsArbitraryResolutions, kSupportsHelp, kSupportsQuitDialogOverride
}
 

Public Member Functions

 PrinceEngine (OSystem *syst, const PrinceGameDescription *gameDesc)
 
bool scummVMSaveLoadDialog (bool isSave)
 
bool hasFeature (EngineFeature f) const override
 
void pauseEngineIntern (bool pause) override
 
bool canSaveGameStateCurrently (Common::U32String *msg=nullptr) override
 
bool canLoadGameStateCurrently (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 playVideo (const Common::Path &videoFilename)
 
void writeSavegameHeader (Common::OutSaveFile *out, SavegameHeader &header)
 
void syncGame (Common::SeekableReadStream *readStream, Common::WriteStream *writeStream)
 
bool loadGame (int slotNumber)
 
void resetGame ()
 
void scrollCredits ()
 
int getGameType () const
 
const char * getGameId () const
 
uint32 getFeatures () const
 
Common::Language getLanguage () const
 
bool loadLocation (uint16 locationNr)
 
bool loadAnim (uint16 animNr, bool loop)
 
bool loadVoice (uint32 textSlot, uint32 sampleSlot, const Common::String &name)
 
bool loadSample (uint32 sampleSlot, const Common::String &name)
 
bool loadZoom (byte *zoomBitmap, uint32 dataSize, const char *resourceName)
 
bool loadShadow (byte *shadowBitmap, uint32 dataSize, const char *resourceName1, const char *resourceName2)
 
bool loadTrans (byte *transTable, const char *resourceName)
 
bool loadMobPriority (const char *resourceName)
 
void loadMobTranslationTexts ()
 
void setMobTranslationTexts ()
 
bool loadMusic (int musNumber)
 
void stopMusic ()
 
void playSample (uint16 sampleId, uint16 loopType)
 
void stopSample (uint16 sampleId)
 
void stopAllSamples ()
 
void freeSample (uint16 sampleId)
 
void freeAllSamples ()
 
void setVoice (uint16 slot, uint32 sampleSlot, uint16 flag)
 
void changeCursor (uint16 curId)
 
void printAt (uint32 slot, uint8 color, char *s, uint16 x, uint16 y)
 
int calcTextLines (const char *s)
 
int calcTextTime (int numberOfLines)
 
void correctStringDEU (char *s)
 
void setShadowScale (int32 shadowScale)
 
void freeNormAnim (int slot)
 
void freeAllNormAnims ()
 
void removeSingleBackAnim (int slot)
 
void checkMasks (int x1, int y1, int sprWidth, int sprHeight, int z)
 
void insertMasks (Graphics::Surface *originalRoomSurface)
 
void showMask (int maskNr, Graphics::Surface *originalRoomSurface)
 
void clsMasks ()
 
void grabMap ()
 
void inventoryFlagChange (bool inventoryState)
 
bool loadAllInv ()
 
void rememberScreenInv ()
 
void prepareInventoryToView ()
 
void drawInvItems ()
 
void displayInventory ()
 
void addInv (int heroId, int item, bool addItemQuiet)
 
void remInv (int heroId, int item)
 
void clearInv (int heroId)
 
void swapInv (int heroId)
 
void addInvObj ()
 
void makeInvCursor (int itemNr)
 
void enableOptions (bool checkType)
 
void checkOptions ()
 
void checkInvOptions ()
 
void openInventoryCheck ()
 
void leftMouseButton ()
 
void rightMouseButton ()
 
void inventoryLeftMouseButton ()
 
void inventoryRightMouseButton ()
 
void dialogLeftMouseButton (byte *string, int dialogSelected)
 
void createDialogBox (int dialogBoxNr)
 
void dialogRun ()
 
void talkHero (int slot)
 
void doTalkAnim (int animNumber, int slot, AnimType animType)
 
void initZoomIn (int slot)
 
void initZoomOut (int slot)
 
void doZoomIn (int slot)
 
void doZoomOut (int slot)
 
void freeZoomObject (int slot)
 
void blackPalette ()
 
void setPalette (const byte *palette)
 
int getMob (Common::Array< Mob > &mobList, bool usePriorityList, int posX, int posY)
 
void makeCurve ()
 
void getCurve ()
 
void mouseWeirdo ()
 
void showPower ()
 
int drawLine (int x0, int y0, int x1, int y1, int(*plotProc)(int, int, void *), void *data)
 
bool loadPath (const char *resourceName)
 
byte * makePath (int heroId, int currX, int currY, int destX, int destY)
 
void findPoint (int x, int y)
 
int getPixelAddr (byte *pathBitmap, int x, int y)
 
void specialPlotInside (int x, int y)
 
bool tracePath (int x1, int y1, int x2, int y2)
 
Direction makeDirection (int x1, int y1, int x2, int y2)
 
void specialPlot (int x, int y)
 
void specialPlot2 (int x, int y)
 
void allocCoords2 ()
 
void freeCoords2 ()
 
void freeCoords3 ()
 
void specialPlotInside2 (int x, int y)
 
void approxPath ()
 
void freeDirectionTable ()
 
void scanDirections ()
 
int scanDirectionsFindNext (byte *coords, int xDiff, int yDiff)
 
void moveShandria ()
 
void walkTo ()
 
void moveRunHero (int heroId, int x, int y, int dir, bool runHeroFlag)
 
int leftDownDir ()
 
int leftDir ()
 
int leftUpDir ()
 
int rightDownDir ()
 
int rightDir ()
 
int rightUpDir ()
 
int upLeftDir ()
 
int upDir ()
 
int upRightDir ()
 
int downLeftDir ()
 
int downDir ()
 
int downRightDir ()
 
int cpe ()
 
int checkLeftDownDir ()
 
int checkLeftDir ()
 
int checkDownDir ()
 
int checkUpDir ()
 
int checkRightDir ()
 
int checkLeftUpDir ()
 
int checkRightDownDir ()
 
int checkRightUpDir ()
 
- 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
 
 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 WARN_UNUSED_RESULT bool readSavegameHeader (Common::InSaveFile *in, SavegameHeader &header, bool skipThumbnail=true)
 
static void plotShadowLinePoint (int x, int y, int color, void *data)
 
static int plotTraceLine (int x, int y, void *data)
 
static int plotTracePoint (int x, int y, void *data)
 
- Static Public Member Functions inherited from Engine
static void quitGame ()
 
static bool shouldQuit ()
 
static bool warnUserAboutUnsupportedGame (Common::String msg=Common::String())
 
static void errorUnsupportedGame (Common::String extraMsg)
 

Public Attributes

int32 _creditsDataSize
 
byte * _creditsData
 
const PrinceGameDescription_gameDescription
 
Video::FlicDecoder _flicPlayer
 
const Graphics::Surface_flcFrameSurface
 
VariaTxt_variaTxt
 
uint32 _talkTxtSize
 
byte * _talkTxt
 
uint32 _mobTranslationSize
 
byte * _mobTranslationData
 
bool _missingVoice
 
Text _textSlots [kMaxTexts]
 
Hero_mainHero
 
Hero_secondHero
 
int _mouseFlag
 
uint32 _currentTime
 
uint16 _locationNr
 
uint16 _sceneWidth
 
int32 _picWindowX
 
int32 _picWindowY
 
Image::BitmapDecoder_roomBmp
 
MhwanhDecoder_suitcaseBmp
 
Room_room
 
Script_script
 
InterpreterFlags_flags
 
Interpreter_interpreter
 
GraphicsMan_graph
 
uint8 _currentMidi
 
byte * _zoomBitmap
 
byte * _shadowBitmap
 
byte * _transTable
 
int16 _scaleValue
 
int16 _lightX
 
int16 _lightY
 
int32 _shadScaleValue
 
int32 _shadLineLen
 
byte * _shadowLine
 
Common::Array< DrawNode_drawNodeList
 
Common::Array< AnimListItem_animList
 
Common::Array< BackgroundAnim_backAnimList
 
Common::Array< Anim_normAnimList
 
Common::Array< Mob_mobList
 
Common::Array< uint32 > _mobPriorityList
 
Common::Array< Mask_maskList
 
Common::Array< Object * > _objList
 
uint16 * _objSlot
 
Common::RandomSource _randomSource
 
int _selectedMob
 
int _selectedItem
 
int _selectedMode
 
int _currentPointerNumber
 
uint32 _invTxtSize
 
byte * _invTxt
 
Graphics::Surface_optionsPic
 
Graphics::Surface_optionsPicInInventory
 
bool _optionsFlag
 
int _optionEnabled
 
int _optionsMob
 
int _optionsX
 
int _optionsY
 
int _optionsWidth
 
int _optionsHeight
 
int _invOptionsWidth
 
int _invOptionsHeight
 
int _optionsStep
 
int _invOptionsStep
 
int _optionsNumber
 
int _invOptionsNumber
 
int _optionsColor1
 
int _optionsColor2
 
bool _showInventoryFlag
 
int _invExamY
 
bool _inventoryBackgroundRemember
 
int _invLineX
 
int _invLineY
 
int _invLine
 
int _invLines
 
int _invLineW
 
int _invLineH
 
int _maxInvW
 
int _maxInvH
 
int _invLineSkipX
 
int _invLineSkipY
 
int _invX1
 
int _invY1
 
int _invWidth
 
int _invHeight
 
bool _invCurInside
 
int _mst_shadow
 
int _mst_shadow2
 
int _candleCounter
 
int _invMaxCount
 
int _invCounter
 
uint32 _dialogDatSize
 
byte * _dialogDat
 
byte * _dialogData
 
byte * _dialogBoxAddr [32]
 
byte * _dialogOptAddr [32]
 
int _dialogOptLines [4 *32]
 
byte * _dialogText
 
int _dialogLines
 
bool _dialogFlag
 
int _dialogWidth
 
int _dialogHeight
 
int _dialogLineSpace
 
int _dialogColor1
 
int _dialogColor2
 
Graphics::Surface_dialogImage
 
int16 * _curveData
 
int _curvPos
 
byte * _roomPathBitmap
 
byte * _roomPathBitmapTemp
 
byte * _coordsBufEnd
 
byte * _coordsBuf
 
byte * _coords
 
byte * _coordsBuf2
 
byte * _coords2
 
byte * _coordsBuf3
 
byte * _coords3
 
int _traceLineLen
 
bool _traceLineFirstPointFlag
 
bool _tracePointFirstPointFlag
 
byte * _directionTable
 
int _shanLen
 
byte * _checkBitmapTemp
 
byte * _checkBitmap
 
int _checkMask
 
int _checkX
 
int _checkY
 
byte * _rembBitmapTemp
 
byte * _rembBitmap
 
int _rembMask
 
int _rembX
 
int _rembY
 
int _fpX
 
int _fpY
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Static Public Attributes

static const uint8 kMaxTexts = 32
 
static const int16 kFPS = 15
 
static const int32 kIntMax = 2147483647
 
static const int16 kMaxPicWidth = 1280
 
static const int16 kMaxPicHeight = 480
 
static const int16 kZoomStep = 4
 
static const int32 kZoomBitmapLen = kMaxPicHeight / kZoomStep * kMaxPicWidth / kZoomStep
 
static const int32 kShadowBitmapSize = kMaxPicWidth * kMaxPicHeight / 8
 
static const int16 kShadowLineArraySize = 2 * 1280 * 4
 
static const int16 kZoomBitmapWidth = kMaxPicWidth / kZoomStep
 
static const int16 kZoomBitmapHeight = kMaxPicHeight / kZoomStep
 
static const int16 kNormalWidth = 640
 
static const int16 kNormalHeight = 480
 
static const uint32 kTransTableSize = 256 * 256
 
static const int kMaxNormAnims = 64
 
static const int kMaxBackAnims = 64
 
static const int kMaxObjects = 64
 
static const int kMaxMobs = 64
 
static const int16 kMaxInv = 90
 
static const uint16 kMaxItems = 30
 
static const uint8 zoomInStep = 8
 
static const uint8 kFadeStep = 4
 
static const int16 kCurveLen = 17
 
static const int kCelStep = 4
 
static const uint16 kPowerBarPosX = 288
 
static const uint16 kPowerBarPosY = 430
 
static const uint8 kPowerBarWidth = 64
 
static const uint8 kPowerBarHeight = 16
 
static const uint8 kPowerBarBackgroundColor = 0
 
static const uint16 kPowerBarGreenPosY = 434
 
static const uint8 kPowerBarGreenColor1 = 202
 
static const uint8 kPowerBarGreenColor2 = 235
 
static const uint8 kPowerBarGreenHeight = 8
 
static const int16 kPathGridStep = 2
 
static const uint32 kPathBitmapLen = (kMaxPicHeight / kPathGridStep * kMaxPicWidth / kPathGridStep) / 8
 
static const int32 kTracePts = 8000
 
static const int32 kPBW = kMaxPicWidth / 16
 
static const int kMinDistance = 2500
 

Protected Member Functions

Common::Error run () override
 
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
void defaultSyncSoundSettings ()
 

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 Prince::PrinceEngine::run ( )
overrideprotectedvirtual

Initialize the engine and start its main loop.

Returns
kNoError on success, otherwise an error code.

Implements Engine.

◆ hasFeature()

bool Prince::PrinceEngine::hasFeature ( EngineFeature  f) const
overridevirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

◆ pauseEngineIntern()

void Prince::PrinceEngine::pauseEngineIntern ( bool  pause)
overridevirtual

Actual implementation of pauseEngine by subclasses.

See also
Engine::pauseEngine

Reimplemented from Engine.

◆ canSaveGameStateCurrently()

bool Prince::PrinceEngine::canSaveGameStateCurrently ( Common::U32String msg = nullptr)
overridevirtual

Indicate whether a game state can be saved.

Parameters
msgOptional pointer to message explaining why it is disabled

Reimplemented from Engine.

◆ canLoadGameStateCurrently()

bool Prince::PrinceEngine::canLoadGameStateCurrently ( Common::U32String msg = nullptr)
overridevirtual

Indicate whether a game state can be loaded.

Parameters
msgOptional pointer to message explaining why it is disabled

Reimplemented from Engine.

◆ saveGameState()

Common::Error Prince::PrinceEngine::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 Prince::PrinceEngine::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: