summaryrefslogtreecommitdiff
path: root/src/graphic
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2005-02-25 18:09:30 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2005-02-25 18:09:30 +0000
commitd855488fdc9830c00ed3ce71532cfd52316988f1 (patch)
treea241ce6d0da88148e9b9024ec8adbe16148aff0f /src/graphic
parent7369c775464aa9eae7a98bb935442b2fa2992f8e (diff)
downloadmana-d855488fdc9830c00ed3ce71532cfd52316988f1.tar.gz
mana-d855488fdc9830c00ed3ce71532cfd52316988f1.tar.bz2
mana-d855488fdc9830c00ed3ce71532cfd52316988f1.tar.xz
mana-d855488fdc9830c00ed3ce71532cfd52316988f1.zip
Fixing equipment and shops according to the new server script
Diffstat (limited to 'src/graphic')
-rw-r--r--src/graphic/graphic.cpp11
-rw-r--r--src/graphic/graphic.h2
2 files changed, 11 insertions, 2 deletions
diff --git a/src/graphic/graphic.cpp b/src/graphic/graphic.cpp
index 8b13e0e9..39938dcb 100644
--- a/src/graphic/graphic.cpp
+++ b/src/graphic/graphic.cpp
@@ -310,14 +310,18 @@ Engine::Engine()
"core/graphics/sprites/emotions.png");
Image *monsterbitmap = resman->getImage(
"core/graphics/sprites/monsters.png");
+ Image *weaponbitmap = resman->getImage(
+ "core/graphics/sprites/weapons.png");
if (!npcbmp) error("Unable to load npcs.png");
if (!emotionbmp) error("Unable to load emotions.png");
if (!monsterbitmap) error("Unable to load monsters.png");
+ if (!weaponbitmap) error("Unable to load weapons.png");
npcset = new Spriteset(npcbmp, 50, 80);
emotionset = new Spriteset(emotionbmp, 19, 19);
monsterset = new Spriteset(monsterbitmap, 60, 60);
+ weaponset = new Spriteset(weaponbitmap, 160, 120);
}
Engine::~Engine()
@@ -339,6 +343,7 @@ Engine::~Engine()
delete monsterset;
delete npcset;
delete emotionset;
+ delete weaponset;
}
void Engine::draw()
@@ -413,6 +418,10 @@ void Engine::draw()
playerset->spriteset[4 * pf + dir]->draw(screen,
being->text_x - 64, being->text_y - 80);
+ if (being->weapon != 0 && being->action == ATTACK) {
+ weaponset->spriteset[4 * being->frame + dir]->draw(screen,
+ being->text_x - 64, being->text_y - 80);
+ }
if (being->hair_color <= 10) {
int hf = being->hair_color - 1 + 10 * (dir + 4 *
@@ -574,7 +583,7 @@ void Engine::draw()
std::stringstream debugStream;
debugStream << "[" << fps << " fps] " <<
- (mouseX / 32 + camera_x) << ", " << (mouseY / 32 + camera_y);
+ (mouseX / 32 + camera_x) << ", " << (mouseY / 32 + camera_y) << " " << player_node->weapon;
debugInfo->setCaption(debugStream.str());
debugInfo->adjustSize();
}
diff --git a/src/graphic/graphic.h b/src/graphic/graphic.h
index c660f49c..b85c29ae 100644
--- a/src/graphic/graphic.h
+++ b/src/graphic/graphic.h
@@ -162,7 +162,7 @@ class Graphics : public gcn::SDLGraphics {
*/
class Engine {
private:
- Spriteset *emotionset, *npcset, *monsterset;
+ Spriteset *emotionset, *npcset, *monsterset, *weaponset;
public:
Engine();