summaryrefslogtreecommitdiff
path: root/src/map.h
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-07-31 17:34:35 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-07-31 17:56:17 +0200
commitc6380acb33a7414c2abe968a8bd056fae93dd10a (patch)
treee3237080c15d7a3b4607ab9a770dce4a0c283fb8 /src/map.h
parent7a178f6d257a2241d3400271d20eb2b902fdab37 (diff)
downloadmana-c6380acb33a7414c2abe968a8bd056fae93dd10a.tar.gz
mana-c6380acb33a7414c2abe968a8bd056fae93dd10a.tar.bz2
mana-c6380acb33a7414c2abe968a8bd056fae93dd10a.tar.xz
mana-c6380acb33a7414c2abe968a8bd056fae93dd10a.zip
Removed 'virtual' from methods of Image
Maybe it used to be necessary for these methods to be virtual, but this is no longer the case. Hence we can avoid wasting CPU ticks searching through virtual function tables, especially for frequently used methods like getWidth, getHeight and setAlpha. MapLayer::getTile was inlined.
Diffstat (limited to 'src/map.h')
-rw-r--r--src/map.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/map.h b/src/map.h
index 6fe2b556..086ff4cc 100644
--- a/src/map.h
+++ b/src/map.h
@@ -108,7 +108,8 @@ class MapLayer
/**
* Get tile image, with x and y in layer coordinates.
*/
- Image *getTile(int x, int y) const;
+ Image *getTile(int x, int y) const
+ { return mTiles[x + y * mWidth]; }
/**
* Draws this layer to the given graphics context. The coordinates are