diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-19 18:29:03 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-19 18:29:03 +0300 |
commit | 7b6b389fe156b8ff1fc1f35ee776a2e65f160921 (patch) | |
tree | 81e893b9e57ff483492df3dd4b645157a02173b3 /src/resources/map/mapitem.cpp | |
parent | f3fdd048e6265ab2c6e88ddff21dffd9409c03db (diff) | |
download | mv-7b6b389fe156b8ff1fc1f35ee776a2e65f160921.tar.gz mv-7b6b389fe156b8ff1fc1f35ee776a2e65f160921.tar.bz2 mv-7b6b389fe156b8ff1fc1f35ee776a2e65f160921.tar.xz mv-7b6b389fe156b8ff1fc1f35ee776a2e65f160921.zip |
Move mapitemtype into separate file.
Diffstat (limited to 'src/resources/map/mapitem.cpp')
-rw-r--r-- | src/resources/map/mapitem.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/resources/map/mapitem.cpp b/src/resources/map/mapitem.cpp index 967b851a5..e035d88b3 100644 --- a/src/resources/map/mapitem.cpp +++ b/src/resources/map/mapitem.cpp @@ -26,6 +26,7 @@ #include "gui/fonts/font.h" #include "resources/image.h" +#include "resources/mapitemtype.h" #include "resources/resourcemanager.h" #include "render/graphics.h" @@ -36,11 +37,11 @@ MapItem::MapItem(): mImage(nullptr), mComment(), mName(), - mType(EMPTY), + mType(MapItemType::EMPTY), mX(-1), mY(-1) { - setType(EMPTY); + setType(MapItemType::EMPTY); } MapItem::MapItem(const int type): @@ -95,16 +96,16 @@ void MapItem::setType(const int type) switch (type) { - case ARROW_UP: + case MapItemType::ARROW_UP: name = "graphics/sprites/arrow_up.png"; break; - case ARROW_DOWN: + case MapItemType::ARROW_DOWN: name = "graphics/sprites/arrow_down.png"; break; - case ARROW_LEFT: + case MapItemType::ARROW_LEFT: name = "graphics/sprites/arrow_left.png"; break; - case ARROW_RIGHT: + case MapItemType::ARROW_RIGHT: name = "graphics/sprites/arrow_right.png"; break; default: @@ -137,14 +138,14 @@ void MapItem::draw(Graphics *const graphics, const int x, const int y, switch (mType) { - case ROAD: - case CROSS: + case MapItemType::ROAD: + case MapItemType::CROSS: graphics->setColor(userPalette->getColorWithAlpha( UserPalette::ROAD_POINT)); graphics->fillRectangle(Rect(x + dx / 3, y + dy / 3, dx / 3, dy / 3)); break; - case HOME: + case MapItemType::HOME: { graphics->setColor(userPalette->getColorWithAlpha( UserPalette::HOME_PLACE)); @@ -157,7 +158,9 @@ void MapItem::draw(Graphics *const graphics, const int x, const int y, default: break; } - if (!mName.empty() && mType != PORTAL && mType != EMPTY) + if (!mName.empty() + && mType != MapItemType::PORTAL + && mType != MapItemType::EMPTY) { Font *const font = gui->getFont(); if (font) |