diff options
author | Max Horn | 2010-10-23 15:45:22 +0000 |
---|---|---|
committer | Max Horn | 2010-10-23 15:45:22 +0000 |
commit | efcfb40da92eedc2a22e595b26369f960efd434e (patch) | |
tree | 3f2a1033929be1b4d487f9fe7eaf2a7738c0947f /engines | |
parent | da31121507db2d92cfbd707d2a08afa9bddf34c2 (diff) | |
download | scummvm-rg350-efcfb40da92eedc2a22e595b26369f960efd434e.tar.gz scummvm-rg350-efcfb40da92eedc2a22e595b26369f960efd434e.tar.bz2 scummvm-rg350-efcfb40da92eedc2a22e595b26369f960efd434e.zip |
SAGA: Add some const qualifiers to SagaEngine methods
svn-id: r53737
Diffstat (limited to 'engines')
-rw-r--r-- | engines/saga/detection.cpp | 4 | ||||
-rw-r--r-- | engines/saga/saga.cpp | 4 | ||||
-rw-r--r-- | engines/saga/saga.h | 19 | ||||
-rw-r--r-- | engines/saga/saveload.cpp | 2 |
4 files changed, 14 insertions, 15 deletions
diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp index edfafff70a..e43f1ee5c7 100644 --- a/engines/saga/detection.cpp +++ b/engines/saga/detection.cpp @@ -56,9 +56,9 @@ struct SAGAGameDescription { bool SagaEngine::isBigEndian() const { return isMacResources() && getGameId() == GID_ITE; } bool SagaEngine::isMacResources() const { return (getPlatform() == Common::kPlatformMacintosh); } -const GameResourceDescription *SagaEngine::getResourceDescription() { return _gameDescription->resourceDescription; } +const GameResourceDescription *SagaEngine::getResourceDescription() const { return _gameDescription->resourceDescription; } -const GameFontDescription *SagaEngine::getFontDescription(int index) { +const GameFontDescription *SagaEngine::getFontDescription(int index) const { assert(index < _gameDescription->fontsCount); return &_gameDescription->fontDescriptions[index]; } diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp index e7eac5e4fe..20c2ca2b1b 100644 --- a/engines/saga/saga.cpp +++ b/engines/saga/saga.cpp @@ -461,7 +461,7 @@ void SagaEngine::loadStrings(StringsTable &stringsTable, const byte *stringsPoin } } -const char *SagaEngine::getObjectName(uint16 objectId) { +const char *SagaEngine::getObjectName(uint16 objectId) const { ActorData *actor; ObjectData *obj; const HitZone *hitZone; @@ -616,7 +616,7 @@ void SagaEngine::setTalkspeed(int talkspeed) { ConfMan.setInt("talkspeed", (talkspeed * 255 + 3 / 2) / 3); } -int SagaEngine::getTalkspeed() { +int SagaEngine::getTalkspeed() const { return (ConfMan.getInt("talkspeed") * 3 + 255 / 2) / 255; } diff --git a/engines/saga/saga.h b/engines/saga/saga.h index aa66a06352..f40cbb89a8 100644 --- a/engines/saga/saga.h +++ b/engines/saga/saga.h @@ -486,15 +486,14 @@ public: void save(const char *fileName, const char *saveName); void load(const char *fileName); - uint32 getCurrentLoadVersion() { + uint32 getCurrentLoadVersion() const { return _saveHeader.version; } void fillSaveList(); char *calcSaveFileName(uint slotNumber); SaveFileData *getSaveFile(uint idx); - uint getSaveSlotNumber(uint idx); - uint getNewSaveSlotNumber(); + uint getNewSaveSlotNumber() const; bool locateSaveFile(char *saveName, uint &titleNumber); bool isSaveListFull() const { return _saveFilesCount == MAX_SAVES; @@ -503,7 +502,7 @@ public: return isSaveListFull() ? _saveFilesCount : _saveFilesCount + 1; } - bool isIHNMDemo() { return _isIHNMDemo; } + bool isIHNMDemo() const { return _isIHNMDemo; } int16 _framesEsc; @@ -559,12 +558,12 @@ public: const byte *getImagePal(const byte *image_data, size_t image_size); void loadStrings(StringsTable &stringsTable, const byte *stringsPointer, size_t stringsLength); - const char *getObjectName(uint16 objectId); + const char *getObjectName(uint16 objectId) const; public: int processInput(); Point mousePos() const; - int getMouseClickCount() { + int getMouseClickCount() const { return _mouseClickCount; } @@ -588,7 +587,7 @@ public: return _leftMouseButtonPressed || _rightMouseButtonPressed; } - inline int ticksToMSec(int tick) { + inline int ticksToMSec(int tick) const { if (getGameId() == GID_ITE) return tick * 1000 / kScriptTimeTicksPerSecond; else @@ -619,9 +618,9 @@ public: bool isBigEndian() const; bool isMacResources() const; bool isSaga2() const { return getGameId() == GID_DINO || getGameId() == GID_FTA2; } - const GameResourceDescription *getResourceDescription(); + const GameResourceDescription *getResourceDescription() const; - const GameFontDescription *getFontDescription(int index); + const GameFontDescription *getFontDescription(int index) const; int getFontsCount() const; int getGameId() const; @@ -650,7 +649,7 @@ private: public: ColorId KnownColor2ColorId(KnownColor knownColor); void setTalkspeed(int talkspeed); - int getTalkspeed(); + int getTalkspeed() const; }; } // End of namespace Saga diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp index 24acefa910..c5388d6878 100644 --- a/engines/saga/saveload.cpp +++ b/engines/saga/saveload.cpp @@ -82,7 +82,7 @@ bool SagaEngine::locateSaveFile(char *saveName, uint &titleNumber) { return false; } -uint SagaEngine::getNewSaveSlotNumber() { +uint SagaEngine::getNewSaveSlotNumber() const { uint i, j; bool found; for (i = 0; i < MAX_SAVES; i++) { |