summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-04-10 22:03:57 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-04-10 22:03:57 +0000
commitf97ddedaa9672c78147fc13282bd14a5be46eb19 (patch)
treeb433e4f9fe285ab6b48fb0e98a8c010e8a9b73e2 /src
parent720f716ba8d98a85266b8e81a534737c6fcdcf5f (diff)
downloadmana-client-f97ddedaa9672c78147fc13282bd14a5be46eb19.tar.gz
mana-client-f97ddedaa9672c78147fc13282bd14a5be46eb19.tar.bz2
mana-client-f97ddedaa9672c78147fc13282bd14a5be46eb19.tar.xz
mana-client-f97ddedaa9672c78147fc13282bd14a5be46eb19.zip
Fixed some compiler warnings and don't try to load particle effects when no
file is set.
Diffstat (limited to 'src')
-rw-r--r--src/gui/skill.cpp46
-rw-r--r--src/gui/trade.h2
-rw-r--r--src/gui/widgets/layout.h2
-rw-r--r--src/log.h4
-rw-r--r--src/resources/mapreader.cpp6
-rw-r--r--src/resources/spritedef.cpp2
6 files changed, 34 insertions, 28 deletions
diff --git a/src/gui/skill.cpp b/src/gui/skill.cpp
index 09e7a10d..48d64202 100644
--- a/src/gui/skill.cpp
+++ b/src/gui/skill.cpp
@@ -103,26 +103,27 @@ void SkillDialog::update()
Skill_Tab::Skill_Tab(std::string type): type(type)
{
- int skillnum;
+ int skillNum = 0;
+
if (type == "Weapon")
{
- skillnum = CHAR_SKILL_WEAPON_NB;
+ skillNum = CHAR_SKILL_WEAPON_NB;
}
else if (type == "Magic")
{
- skillnum = CHAR_SKILL_MAGIC_NB;
+ skillNum = CHAR_SKILL_MAGIC_NB;
}
else if (type == "Craft")
{
- skillnum = CHAR_SKILL_CRAFT_NB;
+ skillNum = CHAR_SKILL_CRAFT_NB;
}
- mSkillNameLabels.resize(skillnum);
- mSkillLevelLabels.resize(skillnum);
- mSkillExpLabels.resize(skillnum);
- mSkillProgress.resize(skillnum);
+ mSkillNameLabels.resize(skillNum);
+ mSkillLevelLabels.resize(skillNum);
+ mSkillExpLabels.resize(skillNum);
+ mSkillProgress.resize(skillNum);
- for (int a=0; a < skillnum; a++)
+ for (int a=0; a < skillNum; a++)
{
mSkillNameLabels.at(a) = new gcn::Label("");
mSkillNameLabels.at(a)->setPosition(1, a*32 );
@@ -148,28 +149,29 @@ Skill_Tab::Skill_Tab(std::string type): type(type)
void Skill_Tab::update()
{
setOpaque(false);
- int skillnum;
- int skillbegin;
+ int skillNum = 0;
+ int skillBegin;
+
if (type == "Weapon")
{
- skillnum = CHAR_SKILL_WEAPON_NB;
- skillbegin = CHAR_SKILL_WEAPON_BEGIN - CHAR_SKILL_BEGIN;
+ skillNum = CHAR_SKILL_WEAPON_NB;
+ skillBegin = CHAR_SKILL_WEAPON_BEGIN - CHAR_SKILL_BEGIN;
}
else if (type == "Magic")
{
- skillnum = CHAR_SKILL_MAGIC_NB;
- skillbegin = CHAR_SKILL_MAGIC_BEGIN - CHAR_SKILL_BEGIN;
+ skillNum = CHAR_SKILL_MAGIC_NB;
+ skillBegin = CHAR_SKILL_MAGIC_BEGIN - CHAR_SKILL_BEGIN;
}
else if (type == "Craft")
{
- skillnum = CHAR_SKILL_CRAFT_NB;
- skillbegin = CHAR_SKILL_CRAFT_BEGIN - CHAR_SKILL_BEGIN;
+ skillNum = CHAR_SKILL_CRAFT_NB;
+ skillBegin = CHAR_SKILL_CRAFT_BEGIN - CHAR_SKILL_BEGIN;
}
- for (int a = 0; a < skillnum; a++)
+ for (int a = 0; a < skillNum; a++)
{
- int baseLevel = player_node->getAttributeBase(a + skillbegin + CHAR_SKILL_BEGIN);
- int effLevel = player_node->getAttributeEffective(a + skillbegin + CHAR_SKILL_BEGIN);
+ int baseLevel = player_node->getAttributeBase(a + skillBegin + CHAR_SKILL_BEGIN);
+ int effLevel = player_node->getAttributeEffective(a + skillBegin + CHAR_SKILL_BEGIN);
std::string skillLevel("Lvl: " + toString(baseLevel));
if (effLevel < baseLevel)
@@ -182,11 +184,11 @@ void Skill_Tab::update()
}
mSkillLevelLabels.at(a)->setCaption(skillLevel);
- std::pair<int, int> exp = player_node->getExperience(a + skillbegin);
+ std::pair<int, int> exp = player_node->getExperience(a + skillBegin);
std::string sExp (toString(exp.first) + " / " + toString(exp.second));
- mSkillNameLabels.at(a)->setCaption(LocalPlayer::getSkillName(a + skillbegin));
+ mSkillNameLabels.at(a)->setCaption(LocalPlayer::getSkillName(a + skillBegin));
mSkillNameLabels.at(a)->adjustSize();
mSkillLevelLabels.at(a)->adjustSize();
mSkillExpLabels.at(a)->setCaption(sExp);
diff --git a/src/gui/trade.h b/src/gui/trade.h
index cd943a41..449de573 100644
--- a/src/gui/trade.h
+++ b/src/gui/trade.h
@@ -96,7 +96,7 @@ class TradeWindow : public Window, gcn::ActionListener, SelectionListener
{
PREPARING, /**< Players are adding items. */
PROPOSING, /**< Local player is proposing a trade. */
- ACCEPTING, /**< Distant player is proposing a trade. */
+ ACCEPTING /**< Distant player is proposing a trade. */
};
/**
diff --git a/src/gui/widgets/layout.h b/src/gui/widgets/layout.h
index 2d81ad81..5914b5c1 100644
--- a/src/gui/widgets/layout.h
+++ b/src/gui/widgets/layout.h
@@ -311,7 +311,7 @@ class Layout: public LayoutCell
{
AUTO_DEF = -42, /**< Default value, behaves like AUTO_ADD. */
AUTO_SET = -43, /**< Uses the share as the new size. */
- AUTO_ADD = -44, /**< Adds the share to the current size. */
+ AUTO_ADD = -44 /**< Adds the share to the current size. */
};
private:
diff --git a/src/log.h b/src/log.h
index dd1c0f91..5abf46a5 100644
--- a/src/log.h
+++ b/src/log.h
@@ -64,8 +64,8 @@ class Logger
void log(const char *log_text, ...);
/**
- * Log an error and quit. The error will pop-up in Windows and will be
- * printed to standard error everywhere else.
+ * Log an error and quit. The error will pop-up on Windows and Mac, and
+ * will be printed to standard error everywhere else.
*/
void error(const std::string &error_text);
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index 9c6c52aa..33616c0a 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -258,8 +258,14 @@ MapReader::readMap(xmlNodePtr node, const std::string &path)
logger->log("- Loading object name: %s type: %s at %d:%d",
objName.c_str(), objType.c_str(), objX, objY);
+
if (objType == "PARTICLE_EFFECT")
{
+ if (objName.empty()) {
+ logger->log(" Warning: No particle file given");
+ continue;
+ }
+
map->addParticleEffect(objName, objX, objY);
}
else
diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp
index 11821a60..9d98184a 100644
--- a/src/resources/spritedef.cpp
+++ b/src/resources/spritedef.cpp
@@ -51,8 +51,6 @@ SpriteDef::getAction(SpriteAction action) const
SpriteDef *SpriteDef::load(std::string const &animationFile, int variant)
{
- ResourceManager *resman = ResourceManager::getInstance();
-
std::string::size_type pos = animationFile.find('|');
std::string palettes;
if (pos != std::string::npos)