diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-05-12 10:22:03 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-05-12 10:22:03 +0000 |
commit | 3ac438c461e66b50151579db3362cd939a41f83c (patch) | |
tree | b47f37d30734626c4944f925adf096559661cc64 | |
parent | 6c0e78de6eb137e75473e056eec238cd31b9e901 (diff) | |
download | mana-3ac438c461e66b50151579db3362cd939a41f83c.tar.gz mana-3ac438c461e66b50151579db3362cd939a41f83c.tar.bz2 mana-3ac438c461e66b50151579db3362cd939a41f83c.tar.xz mana-3ac438c461e66b50151579db3362cd939a41f83c.zip |
You can now see the shirt when equipping a top equipment.
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | The Mana World.dev | 20 | ||||
-rw-r--r-- | src/being.cpp | 4 | ||||
-rw-r--r-- | src/being.h | 4 | ||||
-rw-r--r-- | src/localplayer.cpp | 3 | ||||
-rw-r--r-- | src/localplayer.h | 2 | ||||
-rw-r--r-- | src/main.cpp | 5 | ||||
-rw-r--r-- | src/player.cpp | 9 |
8 files changed, 41 insertions, 16 deletions
@@ -1,4 +1,12 @@ -2006-05-05 Eugenio Favalli <elvenprogrammer@gmail.com> +2006-05-12 Eugenio Favalli <elvenprogrammer@gmail.com> + + * data/graphics/sprites/item1202.png, + data/graphics/sprites/Makefile.am, src/being.cpp, src/being.h, + src/localplayer.cpp, src/localplayer.h, src/main.cpp, src/player.cpp, + The Mana World: You can now see the shirt when equipping a top + equipment. + +2006-05-05 Eugenio Favalli <elvenprogrammer@gmail.com> * src/gui/setup_video.cpp: Fixed some numeric conversions. diff --git a/The Mana World.dev b/The Mana World.dev index 9bfe9ac4..5b0ba74b 100644 --- a/The Mana World.dev +++ b/The Mana World.dev @@ -1860,7 +1860,7 @@ BuildCmd= [Unit181] FileName=src\lockedarray.h CompileCpp=1 -Folder=tmw +Folder=header Compile=1 Link=1 Priority=1000 @@ -1870,7 +1870,7 @@ BuildCmd= [Unit182] FileName=src\logindata.h CompileCpp=1 -Folder=tmw +Folder=header Compile=1 Link=1 Priority=1000 @@ -1880,7 +1880,7 @@ BuildCmd= [Unit183] FileName=src\monster.cpp CompileCpp=1 -Folder=tmw +Folder= Compile=1 Link=1 Priority=1000 @@ -1890,7 +1890,7 @@ BuildCmd= [Unit184] FileName=src\monster.h CompileCpp=1 -Folder=tmw +Folder=header Compile=1 Link=1 Priority=1000 @@ -1900,7 +1900,7 @@ BuildCmd= [Unit185] FileName=src\player.cpp CompileCpp=1 -Folder=tmw +Folder= Compile=1 Link=1 Priority=1000 @@ -1910,7 +1910,7 @@ BuildCmd= [Unit186] FileName=src\player.h CompileCpp=1 -Folder=tmw +Folder=header Compile=1 Link=1 Priority=1000 @@ -2200,7 +2200,7 @@ BuildCmd= [Unit215] FileName=src\joystick.h CompileCpp=1 -Folder=tmw +Folder=header Compile=1 Link=1 Priority=1000 @@ -2210,7 +2210,7 @@ BuildCmd= [Unit216] FileName=src\flooritemmanager.cpp CompileCpp=1 -Folder=tmw +Folder= Compile=1 Link=1 Priority=1000 @@ -2220,7 +2220,7 @@ BuildCmd= [Unit217] FileName=src\flooritemmanager.h CompileCpp=1 -Folder=tmw +Folder=header Compile=1 Link=1 Priority=1000 @@ -2230,7 +2230,7 @@ BuildCmd= [Unit218] FileName=src\joystick.cpp CompileCpp=1 -Folder=tmw +Folder= Compile=1 Link=1 Priority=1000 diff --git a/src/being.cpp b/src/being.cpp index a74efe5f..9e2e3d7d 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -22,6 +22,7 @@ */ #include "being.h" +#include "equipment.h" #include "game.h" #include "graphics.h" #include "log.h" @@ -56,7 +57,8 @@ Being::Being(Uint32 id, Uint16 job, Map *map): mSpeechTime(0), mDamageTime(0), mShowSpeech(false), mShowDamage(false), - mSpriteset(NULL), mSpriteFrame(0) + mSpriteset(NULL), mSpriteFrame(0), + mEquipment(new Equipment()) { setMap(map); } diff --git a/src/being.h b/src/being.h index 7aeb40a3..0dd8cd65 100644 --- a/src/being.h +++ b/src/being.h @@ -34,6 +34,8 @@ #define NR_HAIR_STYLES 6 #define NR_HAIR_COLORS 10 +class Equipment; +class Item; class Map; class Graphics; class Spriteset; @@ -287,6 +289,8 @@ class Being : public Sprite */ int getYOffset() const { return getOffset(UP, DOWN); } + + std::auto_ptr<Equipment> mEquipment; protected: /** diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 3d12c7c1..0313fe81 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -23,9 +23,9 @@ #include "localplayer.h" -#include "game.h" #include "equipment.h" #include "floor_item.h" +#include "game.h" #include "inventory.h" #include "item.h" #include "main.h" @@ -39,7 +39,6 @@ LocalPlayer *player_node = NULL; LocalPlayer::LocalPlayer(Uint32 id, Uint16 job, Map *map): Player(id, job, map), mInventory(new Inventory()), - mEquipment(new Equipment()), mTarget(NULL), mPickUpTarget(NULL), mTrading(false), mLastAction(-1) { diff --git a/src/localplayer.h b/src/localplayer.h index 38e05f4f..1f8c836f 100644 --- a/src/localplayer.h +++ b/src/localplayer.h @@ -31,7 +31,6 @@ // TODO move into some sane place... #define MAX_SLOT 2 -class Equipment; class FloorItem; class Inventory; class Item; @@ -144,7 +143,6 @@ class LocalPlayer : public Player float mLastAttackTime; /**< Used to synchronize the charge dialog */ std::auto_ptr<Inventory> mInventory; - std::auto_ptr<Equipment> mEquipment; protected: Network *mNetwork; diff --git a/src/main.cpp b/src/main.cpp index 9202654a..f7c36b18 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -84,6 +84,7 @@ char n_server, n_character; std::vector<Spriteset *> hairset; Spriteset *playerset = NULL; +Spriteset *equipmentset = NULL; Graphics *graphics; // TODO Anyone knows a good location for this? Or a way to make it non-global? @@ -250,6 +251,9 @@ void init_engine() playerset = resman->createSpriteset( "graphics/sprites/player_male_base.png", 64, 64); if (!playerset) logger->error("Couldn't load player spriteset!"); + equipmentset = resman->createSpriteset( + "graphics/sprites/item1202.png", 64, 64); + if (!equipmentset) logger->error("Couldn't load player equipmentset!"); for (int i=0; i < NR_HAIR_STYLES; i++) { @@ -290,6 +294,7 @@ void exit_engine() for_each(hairset.begin(), hairset.end(), make_dtor(hairset)); hairset.clear(); delete playerset; + delete equipmentset; // Shutdown libxml xmlCleanupParser(); diff --git a/src/player.cpp b/src/player.cpp index d13cd2f4..54075206 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -23,6 +23,7 @@ #include "player.h" +#include "equipment.h" #include "game.h" #include "graphics.h" @@ -33,6 +34,7 @@ extern std::vector<Spriteset *> hairset; extern Spriteset *playerset; extern std::vector<Spriteset *> weaponset; +extern Spriteset *equipmentset; signed char hairtable[19][4][2] = { // S(x,y) W(x,y) N(x,y) E(x,y) @@ -129,6 +131,13 @@ void Player::draw(Graphics *graphics, int offsetX, int offsetY) graphics->drawImage(playerset->get(frame + 18 * dir), px - 16, py - 32); + Item *item = mEquipment->getEquipment(3); + if (item) + { + graphics->drawImage(equipmentset->get(frame + 18 * dir), + px - 16, py - 32); + } + if (getWeapon() != 0 && mAction == ATTACK) { int frames = 4; |