diff options
| author | manuel <manuel@mausz.at> | 2011-04-17 19:54:02 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2011-04-17 19:54:02 +0200 |
| commit | 19c9c38d28cdaafcc1b496027f53dcd1914037cf (patch) | |
| tree | 416d1efa5ed1dd9fdcea55cb5794fdb25d3bbb87 /pacman-c++/sceneholder.cpp | |
| parent | 65195fdab6262d31056c74f922376de3b009943c (diff) | |
| download | foop-19c9c38d28cdaafcc1b496027f53dcd1914037cf.tar.gz foop-19c9c38d28cdaafcc1b496027f53dcd1914037cf.tar.bz2 foop-19c9c38d28cdaafcc1b496027f53dcd1914037cf.zip | |
get rid of two dynamic_casts and use qgraphicitem_cast which is A LOT faster (it makes use of static casts)
Diffstat (limited to 'pacman-c++/sceneholder.cpp')
| -rw-r--r-- | pacman-c++/sceneholder.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pacman-c++/sceneholder.cpp b/pacman-c++/sceneholder.cpp index 38b49e5..6879ea1 100644 --- a/pacman-c++/sceneholder.cpp +++ b/pacman-c++/sceneholder.cpp | |||
| @@ -59,7 +59,7 @@ void SceneHolder::updateMap(const Transmission::map_t& map, const unsigned int x | |||
| 59 | /* special handling for purging field | 59 | /* special handling for purging field |
| 60 | * remove elements (in case it's not an actor) | 60 | * remove elements (in case it's not an actor) |
| 61 | */ | 61 | */ |
| 62 | if (oldItem != NULL && dynamic_cast<Actor *>(oldItem) == NULL) | 62 | if (oldItem != NULL && qgraphicsitem_cast<Actor *>(oldItem) == NULL) |
| 63 | { | 63 | { |
| 64 | visualMap[x][y] = NULL; | 64 | visualMap[x][y] = NULL; |
| 65 | Actor *actor = NULL; | 65 | Actor *actor = NULL; |
| @@ -94,7 +94,7 @@ void SceneHolder::updateMap(const Transmission::map_t& map, const unsigned int x | |||
| 94 | // check for old block first | 94 | // check for old block first |
| 95 | if (visualMap[x][y] != NULL) | 95 | if (visualMap[x][y] != NULL) |
| 96 | { | 96 | { |
| 97 | Block *oldItem = dynamic_cast<Block *>(visualMap[x][y]); | 97 | Block *oldItem = qgraphicsitem_cast<Block *>(visualMap[x][y]); |
| 98 | if (oldItem != NULL) | 98 | if (oldItem != NULL) |
| 99 | neighbours = oldItem->neighbours(); | 99 | neighbours = oldItem->neighbours(); |
| 100 | } | 100 | } |
