From 19c9c38d28cdaafcc1b496027f53dcd1914037cf Mon Sep 17 00:00:00 2001 From: manuel Date: Sun, 17 Apr 2011 19:54:02 +0200 Subject: get rid of two dynamic_casts and use qgraphicitem_cast which is A LOT faster (it makes use of static casts) --- pacman-c++/sceneholder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pacman-c++/sceneholder.cpp') 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 /* special handling for purging field * remove elements (in case it's not an actor) */ - if (oldItem != NULL && dynamic_cast(oldItem) == NULL) + if (oldItem != NULL && qgraphicsitem_cast(oldItem) == NULL) { visualMap[x][y] = NULL; Actor *actor = NULL; @@ -94,7 +94,7 @@ void SceneHolder::updateMap(const Transmission::map_t& map, const unsigned int x // check for old block first if (visualMap[x][y] != NULL) { - Block *oldItem = dynamic_cast(visualMap[x][y]); + Block *oldItem = qgraphicsitem_cast(visualMap[x][y]); if (oldItem != NULL) neighbours = oldItem->neighbours(); } -- cgit v1.2.3