ScummVM API documentation
Immortal::ImmortalEngine Class Reference
Inheritance diagram for Immortal::ImmortalEngine:
Engine

Public Member Functions

 ImmortalEngine (OSystem *syst, const ADGameDescription *gameDesc)
 
uint16 xba (uint16 ab)
 
uint16 rol (uint16 ab, int n)
 
uint16 ror (uint16 ab, int n)
 
uint16 mult16 (uint16 a, uint16 b)
 
void clearScreen ()
 
void whiteScreen ()
 
void rect (int x, int y, int w, int h)
 
void backspace ()
 
void printByte (int b)
 
void printChr (char c)
 
void loadWindow ()
 
void drawUniv ()
 
void copyToScreen ()
 
void mungeBM ()
 
void blit ()
 
void blit40 ()
 
void sBlit ()
 
void scroll ()
 
void makeMyCNM ()
 
void drawBGRND ()
 
void addRows ()
 
void addSprite (uint16 vpX, uint16 vpY, SpriteName s, int img, uint16 x, uint16 y, uint16 p)
 
void addSprites ()
 
void sortDrawItems ()
 
void drawItems ()
 
void drawIcon (int img)
 
void setPen (uint16 penX, uint16 penY)
 
void center ()
 
void carriageReturn ()
 
void toggleSound ()
 
void fixPause ()
 
Song getPlaying ()
 
void playMazeSong ()
 
void playCombatSong ()
 
void playTextSong ()
 
void doGroan ()
 
void stopMusic ()
 
void musicPause (int sID)
 
void musicUnPause (int sID)
 
void loadSingles (Common::String songName)
 
void standardBeep ()
 
void loadPalette ()
 
void setColors (uint16 pal[])
 
void fixColors ()
 
void useNormal ()
 
void useDim ()
 
void useBlack ()
 
void useWhite ()
 
void pump ()
 
void fadePal (uint16 pal[], int count, uint16 target[])
 
void fade (uint16 pal[], int dir, int delay)
 
void fadeOut (int j)
 
void fadeIn (int j)
 
void normalFadeOut ()
 
void slowFadeOut ()
 
void normalFadeIn ()
 
Common::SeekableReadStreamloadIFF (Common::String fileName)
 
void initStoryStatic ()
 
int loadUniv (char mazeNum)
 
void loadMazeGraphics (int m)
 
void makeBlisters (int povX, int povY)
 
void loadFont ()
 
void clearSprites ()
 
void loadSprites ()
 
void userIO ()
 
void pollKeys ()
 
void noNetwork ()
 
void waitKey ()
 
void waitClick ()
 
void blit8 ()
 
bool getInput ()
 
void addKeyBuffer ()
 
void clearKeyBuff ()
 
int mungeCBM (uint16 num2Chrs)
 
void storeAddr (uint16 *drawType, uint16 chr2, uint16 drawIndex)
 
void mungeSolid (int oldChr, uint16 &drawIndex)
 
void mungeLRHC (int oldChr, uint16 &drawIndex)
 
void mungeLLHC (int oldChr, uint16 &drawIndex)
 
void mungeULHC (int oldChr, uint16 &drawIndex)
 
void mungeURHC (int oldChr, uint16 &drawIndex)
 
void drawSolid (int chr, int x, int y)
 
void drawULHC (int chr, int x, int y)
 
void drawURHC (int chr, int x, int y)
 
void drawLLHC (int chr, int x, int y)
 
void drawLRHC (int chr, int x, int y)
 
void doSingleStep ()
 
void trapKeys ()
 
int keyOrButton ()
 
void logicInit ()
 
void logic ()
 
void restartLogic ()
 
int logicFreeze ()
 
void updateHitGauge ()
 
void drawGauge (int h)
 
void makeCertificate ()
 
void calcCheckSum (int l, uint8 checksum[])
 
bool getCertificate ()
 
void printCertificate ()
 
bool printAnd (Str s)
 
bool fromOldGame ()
 
void setGameFlags (uint16 f)
 
uint16 getGameFlags ()
 
void setSavedKing ()
 
bool isSavedKing ()
 
void setSavedAna ()
 
bool isSavedAna ()
 
int getLevel ()
 
void gameOverDisplay ()
 
void gameOver ()
 
void levelOver ()
 
void miscInit ()
 
void setRandomSeed ()
 
void getRandom ()
 
bool buttonPressed ()
 
bool firePressed ()
 
void myFadeOut ()
 
void myFadeIn ()
 
bool textPrint (Str s, int n)
 
bool textBeginning (Str s, int n)
 
bool textSub (Str s, FadeType f, int n)
 
void textEnd (Str s, int n)
 
void textMiddle (Str s, int n)
 
void textCR ()
 
void textPageBreak (Common::String s, int &index)
 
void textAutoPageBreak ()
 
void textDoSpace (Common::String s, int index)
 
void textBounceDelay ()
 
bool yesNo ()
 
void noOn ()
 
void yesOn ()
 
void myDelay (int j)
 
void levelInitAtStartOfGameOnly ()
 
void levelInit ()
 
void levelStory (int l)
 
void levelLoadFile (int l)
 
void levelNew (int l)
 
void levelDrawAll ()
 
void levelShowRoom (int r, int bX, int bY)
 
bool levelIsShowRoom (int r)
 
bool levelIsLoaded (int l)
 
void univAtNew (int l)
 
void cycleFreeAll ()
 
void initStoryDynamic ()
 
void initDataSprite (Common::SeekableReadStream *f, DataSprite *d, int index, uint16 cenX, uint16 cenY)
 
void superSprite (DataSprite *dSprite, uint16 x, uint16 y, int img, uint16 bmw, byte *dst, uint16 superTop, uint16 superBottom)
 
bool clipSprite (uint16 &height, uint16 &pointIndex, uint16 &skipY, DataSprite *dSprite, uint16 &pointX, uint16 &pointY, int img, uint16 bmw, uint16 superTop, uint16 superBottom)
 
void spriteAligned (DataSprite *dSprite, Image &img, uint16 &skipY, uint16 &pointIndex, uint16 &height, uint16 bmw, byte *dst)
 
Common::SeekableReadStreamunCompress (Common::File *source, int lSource)
 
void setUpDictionary (uint16 *pCodes, uint16 *pTk, uint16 &findEmpty)
 
int inputCode (uint16 &outCode, int &lSource, Common::File *source, uint16 &evenOdd)
 
int member (uint16 &codeW, uint16 &k, uint16 *pCodes, uint16 *pTk, uint16 &findEmpty, uint16 &index)
 
void roomTransfer (int r, int x, int y)
 
void doorOpenSecret ()
 
void doorCloseSecret ()
 
void doorInit ()
 
void doorClrLock ()
 
void doorNew (SDoor door)
 
void doorDrawAll ()
 
void doorOnDoorMat ()
 
int findDoorTop (int x, int y)
 
int findDoor (int x, int y)
 
bool doLockStuff (int d, MonsterID m, int top)
 
bool inDoorTop (int x, int y, MonsterID m)
 
bool inDoor (int x, int y, MonsterID m)
 
int doorDoStep (MonsterID m, int d, int index)
 
int doorSetOn (int d)
 
int doorComeOut (MonsterID m)
 
void doorSetLadders (MonsterID m)
 
Common::ErrorCode initDisks ()
 
uint32 getFeatures () const
 
Common::String getGameId () const
 
uint32 getRandomNumber (uint maxNum)
 
bool hasFeature (EngineFeature f) const override
 
bool canLoadGameStateCurrently (Common::U32String *msg=nullptr) override
 
bool canSaveGameStateCurrently (Common::U32String *msg=nullptr) override
 
Common::Error syncGame (Common::Serializer &s)
 
- 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 loadGameState (int slot)
 
virtual Common::Error loadGameStream (Common::SeekableReadStream *stream)
 
void setGameToLoadSlot (int slot)
 
virtual Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false)
 
virtual Common::Error saveGameStream (Common::WriteStream *stream, bool isAutosave=false)
 
bool saveGameDialog ()
 
bool loadGameDialog ()
 

Public Attributes

const ADGameDescription_gameDescription
 
const int kNumLengths = 21
 
const int kNiceTime = 36
 
const int kMaxCertificate = 16
 
const int kScreenW__ = 128
 
const int kScreenH__ = 128
 
const int kViewPortW = 256
 
const int kViewPortH = 128
 
const int kScreenSize = (kResH * kResV) * 2
 
const uint16 kScreenLeft = 32
 
const uint16 kScreenTop = 20
 
const uint8 kTextLeft = 8
 
const uint8 kTextTop = 4
 
const uint8 kGaugeX = 0
 
const uint8 kGaugeY = static_cast<uint8>((-13) & 0xff)
 
const uint16 kScreenBMW = 160
 
const uint16 kChrW = 64
 
const uint16 kChrH = 32
 
const uint16 kChrH2 = kChrH * 2
 
const uint16 kChrH3 = kChrH * 3
 
const uint16 kChrLen = (kChrW / 2) * kChrH
 
const uint16 kChrBMW = kChrW / 2
 
const uint16 kLCutaway = 4
 
const uint16 kLDrawSolid = 32 * ((3 * 16) + 5)
 
const uint16 kChrDy [19]
 
const uint16 kChrMask [19]
 
const uint16 kIsBackground [36]
 
const int kPaletteOffset = 21205
 
const uint16 kMaxSpriteW = 64
 
const uint16 kMaxSpriteH = 64
 
const uint16 kSpriteDY = 32
 
const uint16 kVSX = kMaxSpriteW
 
const uint16 kVSY = kSpriteDY
 
const uint16 kVSBMW = (kViewPortW + kMaxSpriteW) / 2
 
const uint16 kVSLen = kVSBMW * (kViewPortH + kMaxSpriteH)
 
const uint16 kVSDY = 32
 
const uint16 kMySuperBottom = kVSDY + kViewPortH
 
const uint16 kSuperBottom = 200
 
const uint16 kMySuperTop = kVSDY
 
const uint16 kSuperTop = 0
 
const uint16 kViewPortSpX = 32
 
const uint16 kViewPortSpY = 0
 
const uint16 kWizardX = 28
 
const uint16 kWizardY = 37
 
const uint16 kObjectY = 24
 
const uint16 kObjectX = 32
 
const uint16 kObjectHeight = 48
 
const uint16 kObjectWidth = 64
 
const uint8 kMaxRows = 5
 
const uint8 kMaxCollumns = 26
 
const uint16 kYesNoY = 88
 
const uint16 kYesNoX1 = 8
 
const uint16 kYesNoX2 = 182
 
const char kGaugeOn = 1
 
const char kGaugeOff = 0
 
const char kGaugeStop = 1
 
const char kGaugeStart = 1
 
const int kStoryNull = 5
 
const int kMaxFilesPerLevel = 16
 
const int kMaxPartInstances = 4
 
const int kLevelToMaze [8] = {0, 0, 1, 1, 2, 2, 2, 3}
 
Common::ErrorCode _err
 
uint8 _certificate [16]
 
uint8 _lastCertLen = 0
 
bool _draw = 0
 
int _zero = 0
 
bool _gameOverFlag = false
 
uint8 _gameFlags = 0
 
bool _themePaused = false
 
int _titlesShown = 0
 
int _time = 0
 
int _promoting = 0
 
bool _restart = false
 
Story _stories [8]
 
int _maxLevels = 0
 
int _level = 0
 
bool _levelOver = false
 
int _count = 0
 
int _lastLevelLoaded = 0
 
int _lastSongLoaded = 0
 
int _storyLevel = 0
 
int _storyX = 0
 
int _loadA = 0
 
int _loadY = 0
 
uint16 _initialX = 0
 
uint16 _initialY = 0
 
int _initialBX = 0
 
int _initialBY = 0
 
int _dRoomNum = 0
 
int _initialRoom = 0
 
int _currentRoom = 0
 
int _lastType = 0
 
int _roomCellX = 0
 
int _roomCellY = 0
 
Room_rooms [kMaxRooms]
 
Common::Array< SFlame_allFlames [kMaxRooms]
 
Common::Array< Door_doors
 
uint8 _numDoors = 0
 
uint8 _doorRoom = 0
 
uint8 _doorToNextLevel = 0
 
uint8 _doorCameInFrom = 0
 
uint8 _ladders = 0
 
uint8 _numLadders = 0
 
uint8 _ladderInUse = 0
 
uint8 _secretLadder = 0
 
uint8 _secretCount = 0
 
uint8 _secretDelta = 0
 
bool _singleStep = false
 
int _pressedAction = 0
 
int _heldAction = 0
 
int _pressedDirection = 0
 
int _heldDirection = 0
 
uint8 _slowText = 0
 
uint8 _formatted = 0
 
uint8 _collumn = 0
 
uint8 _row = 0
 
uint8 _myButton = 0
 
uint8 _lastYes = 0
 
Song _playing
 
int _themeID = 0
 
int _combatID = 0
 
int _numSprites = 0
 
DataSprite _dataSprites [kFont+1]
 
Sprite _sprites [kMaxSprites]
 
Cycle _cycles [kMaxCycles]
 
Common::Array< Common::String_strPtrs
 
Common::Array< Motive > _motivePtrs
 
Common::Array< Damage_damagePtrs
 
Common::Array< Use_usePtrs
 
Common::Array< Pickup_pickupPtrs
 
Common::Array< SCycle_cycPtrs
 
CArray2D< Motive > _programPtrs
 
Common::Array< ObjType_objTypePtrs
 
Univ_univ
 
uint16 * _logicalCNM
 
uint16 * _CNM
 
byte * _oldCBM
 
Common::Array< Chr_Draw
 
uint16 * _Solid
 
uint16 * _Right
 
uint16 * _Left
 
Common::SeekableReadStream_dataBuffer
 
uint16 * _modCNM
 
uint16 * _modLogicalCNM
 
uint16 _myCNM [(kViewPortCW+1)][(kViewPortCH+1)]
 
uint16 _myModCNM [(kViewPortCW+1)][(kViewPortCH+1)]
 
uint16 _myModLCNM [(kViewPortCW+1)][(kViewPortCH+1)]
 
byte * _screenBuff
 
Graphics::Surface_mainSurface
 
uint16 _columnX [kViewPortCW+1]
 
uint16 _columnTop [kViewPortCW+1]
 
uint16 _columnIndex [kViewPortCW+1]
 
uint16 _tIndex [kMaxDrawItems]
 
uint16 _tPriority [kMaxDrawItems]
 
uint16 _viewPortX = 0
 
uint16 _viewPortY = 0
 
uint16 _myViewPortX = 0
 
uint16 _myViewPortY = 0
 
int _lastGauge = 0
 
uint16 _lastBMW = 0
 
uint16 _lastY = 0
 
uint16 _lastPoint = 0
 
uint16 _penX = 0
 
uint16 _penY = 0
 
uint16 _myUnivPointX = 0
 
uint16 _myUnivPointY = 0
 
int _num2DrawItems = 0
 
GenericSprite _genSprites [6]
 
int _dontResetColors = 0
 
bool _usingNormal = 0
 
bool _dim = 0
 
uint16 _palUniv [16]
 
uint16 _palDefault [16]
 
uint16 _palWhite [16]
 
uint16 _palBlack [16]
 
uint16 _palDim [16]
 
byte _palRGB [48]
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Protected Member Functions

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

Additional Inherited Members

- Public Types inherited from Engine
enum  EngineFeature {
  kSupportsSubtitleOptions, kSupportsReturnToLauncher, kSupportsLoadingDuringRuntime, kSupportsSavingDuringRuntime,
  kSupportsChangingOptionsDuringRuntime, kSupportsArbitraryResolutions, kSupportsHelp, kSupportsQuitDialogOverride
}
 
- 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)
 
- 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 Immortal::ImmortalEngine::run ( )
overrideprotectedvirtual

Initialize the engine and start its main loop.

Returns
kNoError on success, otherwise an error code.

Implements Engine.

◆ hasFeature()

bool Immortal::ImmortalEngine::hasFeature ( EngineFeature  f) const
inlineoverridevirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

◆ canLoadGameStateCurrently()

bool Immortal::ImmortalEngine::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 Immortal::ImmortalEngine::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.

Member Data Documentation

◆ kChrDy

const uint16 Immortal::ImmortalEngine::kChrDy[19]
Initial value:
= {kChr0, kChrH, kChrH2, kChrH, kChrH2,
kChrH2, kChrH, kChrH2, kChrH2, kChr0,
kChr0, kChrH2, kChrH, kChrH2, kChrH2,
kChrH2, kChrH, kChrH2, kChrH2
}

◆ kChrMask

const uint16 Immortal::ImmortalEngine::kChrMask[19]
Initial value:
= {kChr0, kChr0, kChr0, kChr0,
kChrR, kChrL, kChr0, kChrL,
kChrR, kChr0, kChr0, kChrLD,
kChr0, kChrR, kChrLD, kChrRD,
kChr0, kChrRD, kChrL
}

◆ kIsBackground

const uint16 Immortal::ImmortalEngine::kIsBackground[36]
Initial value:
= {1, 0, 0, 0, 0, 0,
0, 0, 0, 1, 1, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0
}

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