From 58a6cd09e9dad44565b939599fa24c5d82011820 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 21 Jun 2016 15:59:43 +0300 Subject: Remove function BeingRecv::setSprite --- src/net/ea/beingrecv.cpp | 10 ------- src/net/ea/beingrecv.h | 4 --- src/net/eathena/beingrecv.cpp | 67 ++++++++++++++++--------------------------- src/net/tmwa/beingrecv.cpp | 50 ++++++++++++-------------------- 4 files changed, 42 insertions(+), 89 deletions(-) (limited to 'src') diff --git a/src/net/ea/beingrecv.cpp b/src/net/ea/beingrecv.cpp index a32ad0ecb..c93d26a2c 100644 --- a/src/net/ea/beingrecv.cpp +++ b/src/net/ea/beingrecv.cpp @@ -542,14 +542,4 @@ Being *BeingRecv::createBeing(const BeingId id, return being; } -void BeingRecv::setSprite(Being *const being, - const unsigned int slot, - const int id, - const std::string &color) -{ - if (!being) - return; - being->updateSprite(slot, id, color); -} - } // namespace Ea diff --git a/src/net/ea/beingrecv.h b/src/net/ea/beingrecv.h index 0fe2ea234..7b1bf17e0 100644 --- a/src/net/ea/beingrecv.h +++ b/src/net/ea/beingrecv.h @@ -53,10 +53,6 @@ namespace Ea void processBeingMove3(Net::MessageIn &msg); Being *createBeing(const BeingId id, const int job); - void setSprite(Being *const being, - const unsigned int slot, - const int id, - const std::string &color = ""); } // namespace BeingRecv } // namespace Ea diff --git a/src/net/eathena/beingrecv.cpp b/src/net/eathena/beingrecv.cpp index fdc8ff5d6..ba0ad46d0 100644 --- a/src/net/eathena/beingrecv.cpp +++ b/src/net/eathena/beingrecv.cpp @@ -447,27 +447,22 @@ void BeingRecv::processBeingVisible(Net::MessageIn &msg) // Set these after the gender, as the sprites may be gender-specific if (hairStyle == 0) { - Ea::BeingRecv::setSprite(dstBeing, - SPRITE_HAIR_COLOR, + dstBeing->updateSprite(SPRITE_HAIR_COLOR, 0, std::string()); } else { - Ea::BeingRecv::setSprite(dstBeing, - SPRITE_HAIR_COLOR, + dstBeing->updateSprite(SPRITE_HAIR_COLOR, hairStyle * -1, ItemDB::get(-hairStyle).getDyeColorsString(hairColor)); } - Ea::BeingRecv::setSprite(dstBeing, SPRITE_WEAPON, headBottom); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_HEAD_BOTTOM, headMid); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_CLOTHES_COLOR, headTop); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_HAIR, shoes); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_SHOES, gloves); - Ea::BeingRecv::setSprite(dstBeing, - SPRITE_BODY, - weapon, - std::string()); + dstBeing->updateSprite(SPRITE_WEAPON, headBottom); + dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid); + dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop); + dstBeing->updateSprite(SPRITE_HAIR, shoes); + dstBeing->updateSprite(SPRITE_SHOES, gloves); + dstBeing->updateSprite(SPRITE_BODY, weapon); dstBeing->setWeaponId(weapon); // Ea::BeingRecv::setSprite(dstBeing, SPRITE_FLOOR, shield); } @@ -650,29 +645,22 @@ void BeingRecv::processBeingMove(Net::MessageIn &msg) // Set these after the gender, as the sprites may be gender-specific if (hairStyle == 0) { - Ea::BeingRecv::setSprite(dstBeing, - SPRITE_HAIR_COLOR, - 0, - std::string()); + dstBeing->updateSprite(SPRITE_HAIR_COLOR, 0); } else { - Ea::BeingRecv::setSprite(dstBeing, - SPRITE_HAIR_COLOR, + dstBeing->updateSprite(SPRITE_HAIR_COLOR, hairStyle * -1, ItemDB::get(-hairStyle).getDyeColorsString(hairColor)); } if (!serverFeatures->haveMove3()) { - Ea::BeingRecv::setSprite(dstBeing, SPRITE_WEAPON, headBottom); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_HEAD_BOTTOM, headMid); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_CLOTHES_COLOR, headTop); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_HAIR, shoes); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_SHOES, gloves); - Ea::BeingRecv::setSprite(dstBeing, - SPRITE_BODY, - weapon, - std::string()); + dstBeing->updateSprite(SPRITE_WEAPON, headBottom); + dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid); + dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop); + dstBeing->updateSprite(SPRITE_HAIR, shoes); + dstBeing->updateSprite(SPRITE_SHOES, gloves); + dstBeing->updateSprite(SPRITE_BODY, weapon); dstBeing->setWeaponId(weapon); } // Ea::BeingRecv::setSprite(dstBeing, SPRITE_FLOOR, shield); @@ -855,27 +843,20 @@ void BeingRecv::processBeingSpawn(Net::MessageIn &msg) // Set these after the gender, as the sprites may be gender-specific if (hairStyle == 0) { - Ea::BeingRecv::setSprite(dstBeing, - SPRITE_HAIR_COLOR, - 0, - std::string()); + dstBeing->updateSprite(SPRITE_HAIR_COLOR, 0); } else { - Ea::BeingRecv::setSprite(dstBeing, - SPRITE_HAIR_COLOR, + dstBeing->updateSprite(SPRITE_HAIR_COLOR, hairStyle * -1, ItemDB::get(-hairStyle).getDyeColorsString(hairColor)); } - Ea::BeingRecv::setSprite(dstBeing, SPRITE_WEAPON, headBottom); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_HEAD_BOTTOM, headMid); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_CLOTHES_COLOR, headTop); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_HAIR, shoes); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_SHOES, gloves); - Ea::BeingRecv::setSprite(dstBeing, - SPRITE_BODY, - weapon, - std::string()); + dstBeing->updateSprite(SPRITE_WEAPON, headBottom); + dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid); + dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop); + dstBeing->updateSprite(SPRITE_HAIR, shoes); + dstBeing->updateSprite(SPRITE_SHOES, gloves); + dstBeing->updateSprite(SPRITE_BODY, weapon); dstBeing->setWeaponId(weapon); // Ea::BeingRecv::setSprite(dstBeing, SPRITE_FLOOR, shield); } diff --git a/src/net/tmwa/beingrecv.cpp b/src/net/tmwa/beingrecv.cpp index 78d40dc1d..a489d4179 100644 --- a/src/net/tmwa/beingrecv.cpp +++ b/src/net/tmwa/beingrecv.cpp @@ -837,30 +837,23 @@ void BeingRecv::processBeingVisible(Net::MessageIn &msg) // Set these after the gender, as the sprites may be gender-specific if (hairStyle == 0) { - Ea::BeingRecv::setSprite(dstBeing, - SPRITE_HAIR_COLOR, - 0, - std::string()); + dstBeing->updateSprite(SPRITE_HAIR_COLOR, 0); } else { - Ea::BeingRecv::setSprite(dstBeing, - SPRITE_HAIR_COLOR, + dstBeing->updateSprite(SPRITE_HAIR_COLOR, hairStyle * -1, ItemDB::get(-hairStyle).getDyeColorsString(hairColor)); } dstBeing->setHairColor(hairColor); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_WEAPON, headBottom); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_HEAD_BOTTOM, headMid); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_CLOTHES_COLOR, headTop); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_HAIR, shoes); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_SHOES, gloves); - Ea::BeingRecv::setSprite(dstBeing, - SPRITE_BODY, - weapon, - std::string()); + dstBeing->updateSprite(SPRITE_WEAPON, headBottom); + dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid); + dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop); + dstBeing->updateSprite(SPRITE_HAIR, shoes); + dstBeing->updateSprite(SPRITE_SHOES, gloves); + dstBeing->updateSprite(SPRITE_BODY, weapon); dstBeing->setWeaponId(weapon); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_FLOOR, shield); + dstBeing->updateSprite(SPRITE_FLOOR, shield); } else if (dstBeing->getType() == ActorType::Npc && serverFeatures->haveNpcGender()) @@ -1053,30 +1046,23 @@ void BeingRecv::processBeingMove(Net::MessageIn &msg) // Set these after the gender, as the sprites may be gender-specific if (hairStyle == 0) { - Ea::BeingRecv::setSprite(dstBeing, - SPRITE_HAIR_COLOR, - 0, - std::string()); + dstBeing->updateSprite(SPRITE_HAIR_COLOR, 0); } else { - Ea::BeingRecv::setSprite(dstBeing, - SPRITE_HAIR_COLOR, + dstBeing->updateSprite(SPRITE_HAIR_COLOR, hairStyle * -1, ItemDB::get(-hairStyle).getDyeColorsString(hairColor)); } dstBeing->setHairColor(hairColor); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_WEAPON, headBottom); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_HEAD_BOTTOM, headMid); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_CLOTHES_COLOR, headTop); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_HAIR, shoes); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_SHOES, gloves); - Ea::BeingRecv::setSprite(dstBeing, - SPRITE_BODY, - weapon, - std::string()); + dstBeing->updateSprite(SPRITE_WEAPON, headBottom); + dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid); + dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop); + dstBeing->updateSprite(SPRITE_HAIR, shoes); + dstBeing->updateSprite(SPRITE_SHOES, gloves); + dstBeing->updateSprite(SPRITE_BODY, weapon); dstBeing->setWeaponId(weapon); - Ea::BeingRecv::setSprite(dstBeing, SPRITE_FLOOR, shield); + dstBeing->updateSprite(SPRITE_FLOOR, shield); } else if (dstBeing->getType() == ActorType::Npc && serverFeatures->haveNpcGender()) -- cgit v1.2.3-70-g09d2