summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-26 02:48:32 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-26 02:48:32 +0300
commitab596ef3f4215f792feaa9ca1dfe5acb74c67328 (patch)
treeac5a4f31e2fa9c784d7de8d817654d47e21ccac2 /src/game.cpp
parent399f264360f6e8dfa31d0c3ff7d72aad8033888d (diff)
downloadmv-ab596ef3f4215f792feaa9ca1dfe5acb74c67328.tar.gz
mv-ab596ef3f4215f792feaa9ca1dfe5acb74c67328.tar.bz2
mv-ab596ef3f4215f792feaa9ca1dfe5acb74c67328.tar.xz
mv-ab596ef3f4215f792feaa9ca1dfe5acb74c67328.zip
Add const to some classes.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/game.cpp b/src/game.cpp
index f00123af3..3672a3ea8 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -384,7 +384,7 @@ Game::Game():
viewport = new Viewport;
viewport->setSize(mainGraphics->mWidth, mainGraphics->mHeight);
- gcn::Container *top = static_cast<gcn::Container*>(gui->getTop());
+ gcn::Container *const top = static_cast<gcn::Container*>(gui->getTop());
top->add(viewport);
viewport->requestMoveToBottom();
@@ -488,7 +488,7 @@ bool Game::createScreenshot()
return saveScreenshot(screenshot);
}
-bool Game::saveScreenshot(SDL_Surface *screenshot)
+bool Game::saveScreenshot(SDL_Surface *const screenshot)
{
static unsigned int screenshotCount = 0;
// Search for an unused screenshot name
@@ -606,7 +606,7 @@ void Game::slowLogic()
if (viewport && !errorMessage.empty())
{
- Map *map = viewport->getCurrentMap();
+ Map *const map = viewport->getCurrentMap();
if (map)
{
logger->log("state: %d", Client::getState());
@@ -838,7 +838,7 @@ void Game::handleMove()
}
}
-void Game::handleActive(SDL_Event &event)
+void Game::handleActive(const SDL_Event &event)
{
// logger->log("SDL_ACTIVEEVENT");
// logger->log("state: %d", (int)event.active.state);
@@ -979,12 +979,12 @@ void Game::changeMap(const std::string &mapPath)
std::string realFullMap = paths.getValue("maps", "maps/")
+ MapDB::getMapName(mMapName) + ".tmx";
- ResourceManager *resman = ResourceManager::getInstance();
+ ResourceManager *const resman = ResourceManager::getInstance();
if (!resman->exists(realFullMap))
realFullMap += ".gz";
// Attempt to load the new map
- Map *newMap = MapReader::readMap(fullMap, realFullMap);
+ Map *const newMap = MapReader::readMap(fullMap, realFullMap);
if (!newMap)
{
@@ -1044,7 +1044,7 @@ void Game::changeMap(const std::string &mapPath)
DepricatedEvent::trigger(CHANNEL_GAME, event);
}
-void Game::updateHistory(SDL_Event &event)
+void Game::updateHistory(const SDL_Event &event)
{
if (!player_node || !player_node->getAttackType())
return;
@@ -1053,8 +1053,8 @@ void Game::updateHistory(SDL_Event &event)
{
bool old = false;
- int key = keyboard.getKeyIndex(event);
- int time = cur_time;
+ const int key = keyboard.getKeyIndex(event);
+ const int time = cur_time;
int idx = -1;
for (int f = 0; f < MAX_LASTKEYS; f ++)
{
@@ -1144,7 +1144,7 @@ void Game::closeDialogs()
}
}
-void Game::videoResized(int width, int height)
+void Game::videoResized(const int width, const int height) const
{
if (viewport)
viewport->setSize(width, height);