summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-04-21 23:11:05 +0300
committerAndrei Karas <akaras@inbox.ru>2013-04-21 23:22:06 +0300
commit67d5177ef4f5d54ea8edc5403ed20f9ade56e8bf (patch)
tree0efb80c3cf13e5f859c522da923cf7fddac90bc5
parent73f36dd1934b3d0cdd52f13cab15480de4d0b9d2 (diff)
downloadmv-67d5177ef4f5d54ea8edc5403ed20f9ade56e8bf.tar.gz
mv-67d5177ef4f5d54ea8edc5403ed20f9ade56e8bf.tar.bz2
mv-67d5177ef4f5d54ea8edc5403ed20f9ade56e8bf.tar.xz
mv-67d5177ef4f5d54ea8edc5403ed20f9ade56e8bf.zip
fix code style and some other fixes after auto checks.
-rw-r--r--src/being.cpp2
-rw-r--r--src/chatlogger.cpp3
-rw-r--r--src/client.cpp4
-rw-r--r--src/configuration.cpp6
-rw-r--r--src/gui/minimap.cpp1
-rw-r--r--src/gui/popupmenu.cpp1
-rw-r--r--src/gui/viewport.cpp1
-rw-r--r--src/net/eathena/messagehandler.cpp5
-rw-r--r--src/net/tmwa/messagehandler.cpp5
-rw-r--r--src/resources/dyecolor.h55
-rw-r--r--src/resources/emotedb.h3
-rw-r--r--src/resources/iteminfo.h1
-rw-r--r--src/resources/palettedb.cpp7
13 files changed, 82 insertions, 12 deletions
diff --git a/src/being.cpp b/src/being.cpp
index d5012ac06..e8f6566f0 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -2794,6 +2794,8 @@ void Being::setEmote(const uint8_t emotion, const int emote_time)
mEmotionSprite = AnimatedSprite::clone(sprite->sprite);
if (mEmotionSprite)
mEmotionTime = info->time;
+ else
+ mEmotionTime = emote_time;
}
}
}
diff --git a/src/chatlogger.cpp b/src/chatlogger.cpp
index c09249f12..0343a7190 100644
--- a/src/chatlogger.cpp
+++ b/src/chatlogger.cpp
@@ -138,7 +138,8 @@ std::string ChatLogger::getDir() const
std::string ChatLogger::secureName(std::string &name) const
{
- for (unsigned int f = 0, sz = name.length(); f < sz; f ++)
+ const unsigned int sz = name.length();
+ for (unsigned int f = 0; f < sz; f ++)
{
const unsigned char ch = name[f];
if ((ch < '0' || ch > '9')
diff --git a/src/client.cpp b/src/client.cpp
index 6cd3967fc..e22f50fea 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -655,7 +655,7 @@ void Client::gameInit()
if (mCurrentServer.port == 0)
{
mCurrentServer.port = static_cast<uint16_t>(branding.getValue(
- "defaultPort", DEFAULT_PORT));
+ "defaultPort", static_cast<int>(DEFAULT_PORT)));
mCurrentServer.type = ServerInfo::parseType(
branding.getValue("defaultServerType", "tmwathena"));
}
@@ -722,7 +722,7 @@ void Client::setEnv(const char *const name, const char *const value)
if (!name || !value)
return;
#ifdef WIN32
- if (putenv(reinterpret_cast<char*>((std::string(name)
+ if (putenv(const_cast<char*>((std::string(name)
+ "=" + value).c_str())))
#else
if (setenv(name, value, 1))
diff --git a/src/configuration.cpp b/src/configuration.cpp
index 05b048408..ca2281a71 100644
--- a/src/configuration.cpp
+++ b/src/configuration.cpp
@@ -317,7 +317,13 @@ void ConfigurationObject::clear()
ConfigurationObject::ConfigurationObject() :
mOptions(),
+#ifdef DEBUG_CONFIG
+ mContainerOptions(),
+ mLogKeys(false),
+ mIsMain(false)
+#else
mContainerOptions()
+#endif
{
}
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp
index e2087117d..6c7a32a71 100644
--- a/src/gui/minimap.cpp
+++ b/src/gui/minimap.cpp
@@ -325,6 +325,7 @@ void Minimap::draw(gcn::Graphics *graphics)
case ActorSprite::PLAYER:
case ActorSprite::FLOOR_ITEM:
case ActorSprite::PORTAL:
+ case ActorSprite::PET:
default:
continue;
}
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index a66a534f7..ecb24849f 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -254,6 +254,7 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being)
case ActorSprite::UNKNOWN:
case ActorSprite::FLOOR_ITEM:
case ActorSprite::PORTAL:
+ case ActorSprite::PET:
default:
/* Other beings aren't interesting... */
return;
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index e4bbc8f5c..da771b397 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -925,6 +925,7 @@ void Viewport::mouseMoved(gcn::MouseEvent &event A_UNUSED)
case ActorSprite::FLOOR_ITEM:
case ActorSprite::UNKNOWN:
case ActorSprite::PLAYER:
+ case ActorSprite::PET:
default:
gui->setCursorType(Cursor::CURSOR_POINTER);
break;
diff --git a/src/net/eathena/messagehandler.cpp b/src/net/eathena/messagehandler.cpp
index 791660283..bf7753e4f 100644
--- a/src/net/eathena/messagehandler.cpp
+++ b/src/net/eathena/messagehandler.cpp
@@ -31,8 +31,9 @@
namespace EAthena
{
-MessageHandler::MessageHandler()
- : mNetwork(nullptr)
+MessageHandler::MessageHandler() :
+ Net::MessageHandler(),
+ mNetwork(nullptr)
{
}
diff --git a/src/net/tmwa/messagehandler.cpp b/src/net/tmwa/messagehandler.cpp
index 827efdcbd..6de8ea645 100644
--- a/src/net/tmwa/messagehandler.cpp
+++ b/src/net/tmwa/messagehandler.cpp
@@ -31,8 +31,9 @@
namespace TmwAthena
{
-MessageHandler::MessageHandler()
- : mNetwork(nullptr)
+MessageHandler::MessageHandler() :
+ Net::MessageHandler(),
+ mNetwork(nullptr)
{
}
diff --git a/src/resources/dyecolor.h b/src/resources/dyecolor.h
new file mode 100644
index 000000000..77351a042
--- /dev/null
+++ b/src/resources/dyecolor.h
@@ -0,0 +1,55 @@
+/*
+ * The ManaPlus Client
+ * Copyright (C) 2013 The ManaPlus Developers
+ *
+ * This file is part of The ManaPlus Client.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DYECOLOR_H
+#define DYECOLOR_H
+
+#include <SDL_stdinc.h>
+
+#include "localconsts.h"
+
+struct DyeColor
+{
+ DyeColor()
+ {
+ value[3] = 255;
+ }
+
+ DyeColor(const uint8_t r, const uint8_t g, const uint8_t b)
+ {
+ value[0] = r;
+ value[1] = g;
+ value[2] = b;
+ value[3] = 255;
+ }
+
+ DyeColor(const uint8_t r, const uint8_t g, const uint8_t b,
+ const uint8_t a)
+ {
+ value[0] = r;
+ value[1] = g;
+ value[2] = b;
+ value[3] = a;
+ }
+
+ uint8_t value[4];
+};
+
+#endif
diff --git a/src/resources/emotedb.h b/src/resources/emotedb.h
index d8edb99ec..939b3d667 100644
--- a/src/resources/emotedb.h
+++ b/src/resources/emotedb.h
@@ -48,7 +48,8 @@ struct EmoteInfo final
{
EmoteInfo() :
sprites(),
- particles()
+ particles(),
+ time(400)
{ }
A_DELETE_COPY(EmoteInfo)
diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h
index 01b5b2e6c..64855bc0a 100644
--- a/src/resources/iteminfo.h
+++ b/src/resources/iteminfo.h
@@ -26,7 +26,6 @@
#include "being.h"
#include "resources/colordb.h"
-#include "resources/soundinfo.h"
#include <map>
#include <set>
diff --git a/src/resources/palettedb.cpp b/src/resources/palettedb.cpp
index c770a9cdc..1219601ce 100644
--- a/src/resources/palettedb.cpp
+++ b/src/resources/palettedb.cpp
@@ -25,8 +25,6 @@
#include "resources/dyecolor.h"
#include "resources/resourcemanager.h"
-#include "utils/stringvector.h"
-
#include <map>
#include "debug.h"
@@ -87,8 +85,11 @@ void PaletteDB::loadPalette()
unsigned int g;
unsigned int b;
- if (sscanf(line.c_str(), "%u %u %u\t%s", &r, &g, &b, name) == 4)
+ if (sscanf(line.c_str(), "%10u %10u %10u\t%100s",
+ &r, &g, &b, name) == 4)
+ {
mColors[name] = DyeColor(r, g, b);
+ }
}
}