diff options
author | Johannes Schickel | 2012-01-03 01:47:31 +0100 |
---|---|---|
committer | Johannes Schickel | 2012-01-03 02:13:22 +0100 |
commit | d0ddd299a4f19463749922859d2b5e9e5123b15f (patch) | |
tree | 2175db79567d9061e6a7c475053a9fa2eedf6651 /backends | |
parent | c98a123f4c69b7e04a116dd7501bdc80afa3afcc (diff) | |
download | scummvm-rg350-d0ddd299a4f19463749922859d2b5e9e5123b15f.tar.gz scummvm-rg350-d0ddd299a4f19463749922859d2b5e9e5123b15f.tar.bz2 scummvm-rg350-d0ddd299a4f19463749922859d2b5e9e5123b15f.zip |
VKEYBD: Slight cleanup in ImageMap code.
Diffstat (limited to 'backends')
-rw-r--r-- | backends/vkeybd/image-map.cpp | 7 | ||||
-rw-r--r-- | backends/vkeybd/image-map.h | 5 |
2 files changed, 5 insertions, 7 deletions
diff --git a/backends/vkeybd/image-map.cpp b/backends/vkeybd/image-map.cpp index e3f986ee1b..359fc58d20 100644 --- a/backends/vkeybd/image-map.cpp +++ b/backends/vkeybd/image-map.cpp @@ -53,19 +53,18 @@ void ImageMap::removeArea(const String &id) { } void ImageMap::removeAllAreas() { - HashMap<String, Polygon *>::iterator it; - for (it = _areas.begin(); it != _areas.end(); ++it) { + for (AreaMap::iterator it = _areas.begin(); it != _areas.end(); ++it) { delete it->_value; } _areas.clear(); } String ImageMap::findMapArea(int16 x, int16 y) { - HashMap<String, Polygon *>::iterator it; - for (it = _areas.begin(); it != _areas.end(); ++it) { + for (AreaMap::iterator it = _areas.begin(); it != _areas.end(); ++it) { if (it->_value->contains(x, y)) return it->_key; } + return String(); } diff --git a/backends/vkeybd/image-map.h b/backends/vkeybd/image-map.h index 5132c31083..952ba624b0 100644 --- a/backends/vkeybd/image-map.h +++ b/backends/vkeybd/image-map.h @@ -35,9 +35,7 @@ namespace Common { struct Polygon; class ImageMap { - public: - ~ImageMap(); Polygon *createArea(const String &id); @@ -46,7 +44,8 @@ public: String findMapArea(int16 x, int16 y); protected: - HashMap<String, Polygon *> _areas; + typedef HashMap<String, Polygon *> AreaMap; + AreaMap _areas; }; |