diff options
author | Einar Johan Trøan Sømåen | 2013-04-17 20:54:41 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2013-04-17 21:21:17 +0200 |
commit | 5f5b415289d80e6e0dacfc15000bb6ae3e45d824 (patch) | |
tree | 40b63f4e2887889c3fd4ca6b91f2de3e608acffe | |
parent | 7f4b95b3f8bbe7aa2be842462e57868ec17fd19e (diff) | |
download | scummvm-rg350-5f5b415289d80e6e0dacfc15000bb6ae3e45d824.tar.gz scummvm-rg350-5f5b415289d80e6e0dacfc15000bb6ae3e45d824.tar.bz2 scummvm-rg350-5f5b415289d80e6e0dacfc15000bb6ae3e45d824.zip |
WINTERMUTE: Increase const-usage.
-rw-r--r-- | engines/wintermute/ad/ad_game.cpp | 8 | ||||
-rw-r--r-- | engines/wintermute/ad/ad_game.h | 8 | ||||
-rw-r--r-- | engines/wintermute/base/base_game.cpp | 8 | ||||
-rw-r--r-- | engines/wintermute/base/base_game.h | 10 | ||||
-rw-r--r-- | engines/wintermute/base/base_named_object.h | 2 |
5 files changed, 18 insertions, 18 deletions
diff --git a/engines/wintermute/ad/ad_game.cpp b/engines/wintermute/ad/ad_game.cpp index 3730b23fc2..f0d2fcf5c8 100644 --- a/engines/wintermute/ad/ad_game.cpp +++ b/engines/wintermute/ad/ad_game.cpp @@ -1497,7 +1497,7 @@ bool AdGame::scheduleChangeScene(const char *filename, bool fadeIn) { ////////////////////////////////////////////////////////////////////////// -bool AdGame::getVersion(byte *verMajor, byte *verMinor, byte *extMajor, byte *extMinor) { +bool AdGame::getVersion(byte *verMajor, byte *verMinor, byte *extMajor, byte *extMinor) const { BaseGame::getVersion(verMajor, verMinor, nullptr, nullptr); if (extMajor) { @@ -1766,7 +1766,7 @@ bool AdGame::addBranchResponse(int id) { ////////////////////////////////////////////////////////////////////////// -bool AdGame::branchResponseUsed(int id) { +bool AdGame::branchResponseUsed(int id) const { char *context = _dlgPendingBranches.size() > 0 ? _dlgPendingBranches[_dlgPendingBranches.size() - 1] : nullptr; for (uint32 i = 0; i < _responsesBranch.size(); i++) { if (_responsesBranch[i]->_id == id) { @@ -1793,7 +1793,7 @@ bool AdGame::addGameResponse(int id) { ////////////////////////////////////////////////////////////////////////// -bool AdGame::gameResponseUsed(int id) { +bool AdGame::gameResponseUsed(int id) const { char *context = _dlgPendingBranches.size() > 0 ? _dlgPendingBranches[_dlgPendingBranches.size() - 1] : nullptr; for (uint32 i = 0; i < _responsesGame.size(); i++) { AdResponseContext *respContext = _responsesGame[i]; @@ -1958,7 +1958,7 @@ bool AdGame::isItemTaken(char *itemName) { } ////////////////////////////////////////////////////////////////////////// -AdItem *AdGame::getItemByName(const char *name) { +AdItem *AdGame::getItemByName(const char *name) const { for (uint32 i = 0; i < _items.size(); i++) { if (scumm_stricmp(_items[i]->getName(), name) == 0) { return _items[i]; diff --git a/engines/wintermute/ad/ad_game.h b/engines/wintermute/ad/ad_game.h index 81c79a3da8..9bcd0bb531 100644 --- a/engines/wintermute/ad/ad_game.h +++ b/engines/wintermute/ad/ad_game.h @@ -63,7 +63,7 @@ public: bool _tempDisableSaveState; virtual bool resetContent(); bool addItem(AdItem *item); - AdItem *getItemByName(const char *name); + AdItem *getItemByName(const char *name) const; AdObject *_inventoryOwner; bool isItemTaken(char *itemName); @@ -71,11 +71,11 @@ public: bool unregisterInventory(AdInventory *inv); virtual bool displayContent(bool update = true, bool displayAll = false); - bool gameResponseUsed(int ID); + bool gameResponseUsed(int ID) const; bool addGameResponse(int ID); bool resetResponse(int ID); - bool branchResponseUsed(int ID); + bool branchResponseUsed(int ID) const; bool addBranchResponse(int ID); bool clearBranchResponses(char *name); bool startDlgBranch(const char *branchName, const char *scriptName, const char *eventName); @@ -93,7 +93,7 @@ public: TTalkSkipButton _talkSkipButton; - virtual bool getVersion(byte *verMajor, byte *verMinor, byte *extMajor, byte *extMinor); + virtual bool getVersion(byte *verMajor, byte *verMinor, byte *extMajor, byte *extMinor) const; bool scheduleChangeScene(const char *filename, bool fadeIn); void setPrevSceneName(const char *name); void setPrevSceneFilename(const char *name); diff --git a/engines/wintermute/base/base_game.cpp b/engines/wintermute/base/base_game.cpp index f90c6bf775..2ba54798ae 100644 --- a/engines/wintermute/base/base_game.cpp +++ b/engines/wintermute/base/base_game.cpp @@ -620,7 +620,7 @@ void BaseGame::setOffset(int offsetX, int offsetY) { } ////////////////////////////////////////////////////////////////////////// -void BaseGame::getOffset(int *offsetX, int *offsetY) { +void BaseGame::getOffset(int *offsetX, int *offsetY) const { if (offsetX != nullptr) { *offsetX = _offsetX; } @@ -3270,7 +3270,7 @@ bool BaseGame::handleMouseWheel(int delta) { ////////////////////////////////////////////////////////////////////////// -bool BaseGame::getVersion(byte *verMajor, byte *verMinor, byte *extMajor, byte *extMinor) { +bool BaseGame::getVersion(byte *verMajor, byte *verMinor, byte *extMajor, byte *extMinor) const { if (verMajor) { *verMajor = DCGF_VER_MAJOR; } @@ -3372,7 +3372,7 @@ bool BaseGame::popViewport() { ////////////////////////////////////////////////////////////////////////// -bool BaseGame::getCurrentViewportRect(Rect32 *rect, bool *custom) { +bool BaseGame::getCurrentViewportRect(Rect32 *rect, bool *custom) const { if (rect == nullptr) { return STATUS_FAILED; } else { @@ -3397,7 +3397,7 @@ bool BaseGame::getCurrentViewportRect(Rect32 *rect, bool *custom) { ////////////////////////////////////////////////////////////////////////// -bool BaseGame::getCurrentViewportOffset(int *offsetX, int *offsetY) { +bool BaseGame::getCurrentViewportOffset(int *offsetX, int *offsetY) const { if (_viewportSP >= 0) { if (offsetX) { *offsetX = _viewportStack[_viewportSP]->_offsetX; diff --git a/engines/wintermute/base/base_game.h b/engines/wintermute/base/base_game.h index cd7f752f4a..f3496f7dd0 100644 --- a/engines/wintermute/base/base_game.h +++ b/engines/wintermute/base/base_game.h @@ -111,7 +111,7 @@ public: int getSaveThumbHeight() const { return _thumbnailHeight; } bool _editorMode; - void getOffset(int *offsetX, int *offsetY); + void getOffset(int *offsetX, int *offsetY) const; void setOffset(int offsetX, int offsetY); int getSequence(); @@ -172,7 +172,7 @@ public: // compatibility bits bool _compatKillMethodThreads; - const char* getGameId() { return _gameId.c_str(); } + const char* getGameId() const { return _gameId.c_str(); } void setGameId(const Common::String& gameId) { _gameId = gameId; } uint32 _surfaceGCCycleTime; bool _smartCache; // RO @@ -184,7 +184,7 @@ public: virtual bool handleMouseWheel(int delta); bool _quitting; - virtual bool getVersion(byte *verMajor, byte *verMinor, byte *extMajor, byte *extMinor); + virtual bool getVersion(byte *verMajor, byte *verMinor, byte *extMajor, byte *extMinor) const; virtual bool handleKeypress(Common::Event *event, bool printable = false); virtual void handleKeyRelease(Common::Event *event); @@ -239,8 +239,8 @@ public: void setInteractive(bool state); virtual bool windowLoadHook(UIWindow *win, char **buf, char **params); virtual bool windowScriptMethodHook(UIWindow *win, ScScript *script, ScStack *stack, const char *name); - bool getCurrentViewportOffset(int *offsetX = nullptr, int *offsetY = nullptr); - bool getCurrentViewportRect(Rect32 *rect, bool *custom = nullptr); + bool getCurrentViewportOffset(int *offsetX = nullptr, int *offsetY = nullptr) const; + bool getCurrentViewportRect(Rect32 *rect, bool *custom = nullptr) const; bool popViewport(); bool pushViewport(BaseViewport *Viewport); bool setActiveObject(BaseObject *Obj); diff --git a/engines/wintermute/base/base_named_object.h b/engines/wintermute/base/base_named_object.h index 77a00cee45..d25fec4a82 100644 --- a/engines/wintermute/base/base_named_object.h +++ b/engines/wintermute/base/base_named_object.h @@ -42,7 +42,7 @@ public: virtual ~BaseNamedObject(void); BaseNamedObject(TDynamicConstructor, TDynamicConstructor); - const char *getName() { return _name; } + const char *getName() const { return _name; } void setName(const char *name); }; |