SAGA: Add some const qualifiers to SagaEngine methods

svn-id: r53737
This commit is contained in:
Max Horn
2010-10-23 15:45:22 +00:00
parent da31121507
commit efcfb40da9
4 changed files with 14 additions and 15 deletions
+2 -2
View File
@@ -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];
}
+2 -2
View File
@@ -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;
}
+9 -10
View File
@@ -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
+1 -1
View File
@@ -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++) {