summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-05-08 19:23:14 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-05-08 19:23:14 +0000
commit9e89ccb915fbc6cb73a5f48fcaf2fa10f64e6f24 (patch)
tree53a68a255161bb45ff17a181251a67650c4327fd /src
parent2c2222a442165fd091cc80ab2d198e3539e1cdd4 (diff)
downloadmana-client-9e89ccb915fbc6cb73a5f48fcaf2fa10f64e6f24.tar.gz
mana-client-9e89ccb915fbc6cb73a5f48fcaf2fa10f64e6f24.tar.bz2
mana-client-9e89ccb915fbc6cb73a5f48fcaf2fa10f64e6f24.tar.xz
mana-client-9e89ccb915fbc6cb73a5f48fcaf2fa10f64e6f24.zip
Added new hair style by Frode Lindeijer.
Diffstat (limited to 'src')
-rw-r--r--src/being.cpp2
-rw-r--r--src/being.h3
-rw-r--r--src/engine.cpp2
-rw-r--r--src/gui/char_select.cpp4
-rw-r--r--src/gui/playerbox.cpp3
5 files changed, 8 insertions, 6 deletions
diff --git a/src/being.cpp b/src/being.cpp
index c9b65e60..204065a5 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -212,7 +212,7 @@ void Being::setHairColor(int color)
void Being::setHairStyle(int style)
{
hairStyle = style;
- if (hairStyle < 1 || hairStyle > 4)
+ if (hairStyle < 1 || hairStyle > NR_HAIR_STYLES)
{
hairStyle = 1;
}
diff --git a/src/being.h b/src/being.h
index c246aeaa..8224a729 100644
--- a/src/being.h
+++ b/src/being.h
@@ -28,6 +28,9 @@
#include <string>
#include "graphics.h"
+#define NR_HAIR_STYLES 5
+#define NR_HAIR_COLORS 10
+
struct PATH_NODE {
/**
* Constructor.
diff --git a/src/engine.cpp b/src/engine.cpp
index 65fbc431..9ef0a5a2 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -422,7 +422,7 @@ void Engine::draw()
being->text_x - 64, being->text_y - 80);
}
- if (being->getHairColor() <= 10) {
+ if (being->getHairColor() <= NR_HAIR_COLORS) {
int hf = being->getHairColor() - 1 + 10 * (dir + 4 *
(being->getHairStyle() - 1));
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp
index 008c7e8d..ab0e19a1 100644
--- a/src/gui/char_select.cpp
+++ b/src/gui/char_select.cpp
@@ -26,14 +26,12 @@
#include "textfield.h"
#include "button.h"
#include "ok_dialog.h"
+#include "being.h"
#include "../graphics.h"
#include "../net/protocol.h"
#include "../resources/resourcemanager.h"
#include <sstream>
-#define NR_HAIR_STYLES 4
-#define NR_HAIR_COLORS 10
-
CharSelectDialog::CharDeleteConfirm::CharDeleteConfirm(CharSelectDialog *m):
ConfirmDialog(m,
"Confirm", "Are you sure you want to delete this character?"),
diff --git a/src/gui/playerbox.cpp b/src/gui/playerbox.cpp
index c8493c79..0e9f5e0f 100644
--- a/src/gui/playerbox.cpp
+++ b/src/gui/playerbox.cpp
@@ -23,6 +23,7 @@
#include "playerbox.h"
#include "gui.h"
+#include "../being.h"
#include "../main.h"
#include "../resources/resourcemanager.h"
@@ -63,7 +64,7 @@ void PlayerBox::draw(gcn::Graphics *graphics)
// Draw his hair
if (hairColor >= 0 && hairStyle >= 0 &&
- hairColor < 10 && hairStyle < 4)
+ hairColor < NR_HAIR_COLORS && hairStyle < NR_HAIR_STYLES)
{
int hf = hairColor + 40 * (hairStyle);
if (hf >= 0 && hf < (int)hairset->spriteset.size()) {