summaryrefslogtreecommitdiff
path: root/src/flooritem.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-02-11 14:58:14 +0300
committerAndrei Karas <akaras@inbox.ru>2012-02-11 14:58:14 +0300
commitc14086d6a08fb2ea644eec9fafa0374604c98991 (patch)
tree29a00277b215a32e019fd06cab4b9ac709ac775c /src/flooritem.cpp
parent7e19d626711ecf70035b32ee99098fc7fc3419fe (diff)
downloadManaVerse-c14086d6a08fb2ea644eec9fafa0374604c98991.tar.gz
ManaVerse-c14086d6a08fb2ea644eec9fafa0374604c98991.tar.bz2
ManaVerse-c14086d6a08fb2ea644eec9fafa0374604c98991.tar.xz
ManaVerse-c14086d6a08fb2ea644eec9fafa0374604c98991.zip
Add relative pixel based position to item drops (floor items).
Diffstat (limited to 'src/flooritem.cpp')
-rw-r--r--src/flooritem.cpp21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/flooritem.cpp b/src/flooritem.cpp
index 6e4926f2e..111019546 100644
--- a/src/flooritem.cpp
+++ b/src/flooritem.cpp
@@ -38,13 +38,8 @@
#include "debug.h"
-FloorItem::FloorItem(int id,
- int itemId,
- int x,
- int y,
- Map *map,
- int amount,
- unsigned char color):
+FloorItem::FloorItem(int id, int itemId, int x, int y, Map *map, int amount,
+ unsigned char color, int subX, int subY):
ActorSprite(id),
mItemId(itemId),
mX(x),
@@ -60,16 +55,8 @@ FloorItem::FloorItem(int id,
setMap(map);
if (map)
{
- // TODO: Eventually, we probably should fix all sprite offsets so that
- // these translations aren't necessary anymore. The sprites know
- // best where their base point should be.
- mPos.x = static_cast<float>(x * map->getTileWidth() + 16);
-#ifdef MANASERV_SUPPORT
- mPos.y = static_cast<float>(y * map->getTileHeight() +
- ((Net::getNetworkType() == ServerInfo::MANASERV) ? 15 : 32));
-#else
- mPos.y = static_cast<float>(y * map->getTileHeight() + 32);
-#endif
+ mPos.x = static_cast<float>(x * map->getTileWidth() + subX);
+ mPos.y = static_cast<float>(y * map->getTileHeight() + subY);
}
else
{