From c14086d6a08fb2ea644eec9fafa0374604c98991 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 11 Feb 2012 14:58:14 +0300 Subject: Add relative pixel based position to item drops (floor items). --- src/flooritem.cpp | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'src/flooritem.cpp') 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(x * map->getTileWidth() + 16); -#ifdef MANASERV_SUPPORT - mPos.y = static_cast(y * map->getTileHeight() + - ((Net::getNetworkType() == ServerInfo::MANASERV) ? 15 : 32)); -#else - mPos.y = static_cast(y * map->getTileHeight() + 32); -#endif + mPos.x = static_cast(x * map->getTileWidth() + subX); + mPos.y = static_cast(y * map->getTileHeight() + subY); } else { -- cgit v1.2.3-70-g09d2