diff options
-rw-r--r-- | src/net/ea/generalhandler.cpp | 7 | ||||
-rw-r--r-- | src/net/ea/network.cpp | 6 | ||||
-rw-r--r-- | src/net/ea/partyhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/messagehandler.h | 3 | ||||
-rw-r--r-- | src/sound.cpp | 30 | ||||
-rw-r--r-- | src/sound.h | 11 |
6 files changed, 28 insertions, 33 deletions
diff --git a/src/net/ea/generalhandler.cpp b/src/net/ea/generalhandler.cpp index 2dee8d1e..91406278 100644 --- a/src/net/ea/generalhandler.cpp +++ b/src/net/ea/generalhandler.cpp @@ -140,10 +140,7 @@ void GeneralHandler::load() void GeneralHandler::unload() { mNetwork->clearHandlers(); - - // The party tab might not have been made (if we never loaded the main GUI) - if (partyTab) - delete partyTab; + delete partyTab; } void GeneralHandler::flushNetwork() @@ -159,7 +156,7 @@ bool GeneralHandler::isNetworkConnected() void GeneralHandler::guiWindowsLoaded() { - partyTab = new PartyTab(); + partyTab = new PartyTab; } } // namespace EAthena diff --git a/src/net/ea/network.cpp b/src/net/ea/network.cpp index 8f55236f..690ca946 100644 --- a/src/net/ea/network.cpp +++ b/src/net/ea/network.cpp @@ -175,7 +175,7 @@ void Network::disconnect() void Network::registerHandler(MessageHandler *handler) { - for (const Uint16 *i = handler->handledMessages; *i; i++) + for (const Uint16 *i = handler->handledMessages; *i; ++i) { mMessageHandlers[*i] = handler; } @@ -185,7 +185,7 @@ void Network::registerHandler(MessageHandler *handler) void Network::unregisterHandler(MessageHandler *handler) { - for (const Uint16 *i = handler->handledMessages; *i; i++) + for (const Uint16 *i = handler->handledMessages; *i; ++i) { mMessageHandlers.erase(*i); } @@ -196,7 +196,7 @@ void Network::unregisterHandler(MessageHandler *handler) void Network::clearHandlers() { MessageHandlerIterator i; - for (i = mMessageHandlers.begin(); i != mMessageHandlers.end(); i++) + for (i = mMessageHandlers.begin(); i != mMessageHandlers.end(); ++i) { i->second->setNetwork(0); } diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp index f76bd7d8..c1d625f5 100644 --- a/src/net/ea/partyhandler.cpp +++ b/src/net/ea/partyhandler.cpp @@ -36,8 +36,8 @@ #include "utils/gettext.h" #include "utils/strprintf.h" -PartyTab *partyTab; -PartyHandler *partyHandler; +PartyTab *partyTab = 0; +PartyHandler *partyHandler = 0; PartyHandler::PartyHandler() { diff --git a/src/net/messagehandler.h b/src/net/messagehandler.h index 1aa0b401..28d4fea5 100644 --- a/src/net/messagehandler.h +++ b/src/net/messagehandler.h @@ -44,8 +44,7 @@ class MessageHandler virtual void handleMessage(MessageIn &msg) = 0; -#ifdef TMWSERV_SUPPORT -#else +#ifdef EATHENA_SUPPORT void setNetwork(Network *network); protected: diff --git a/src/sound.cpp b/src/sound.cpp index 6e0b0da0..6d18b86c 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -41,7 +41,8 @@ Sound::~Sound() void Sound::init() { // Don't initialize sound engine twice - if (mInstalled) return; + if (mInstalled) + return; logger->log("Sound::init() Initializing sound..."); @@ -110,7 +111,8 @@ void Sound::info() void Sound::setMusicVolume(int volume) { - if (!mInstalled) return; + if (!mInstalled) + return; mMusicVolume = volume; Mix_VolumeMusic(volume); @@ -118,7 +120,8 @@ void Sound::setMusicVolume(int volume) void Sound::setSfxVolume(int volume) { - if (!mInstalled) return; + if (!mInstalled) + return; mSfxVolume = volume; Mix_Volume(-1, volume); @@ -126,11 +129,11 @@ void Sound::setSfxVolume(int volume) void Sound::playMusic(const std::string &filename, int loop) { - if (!mInstalled) return; + if (!mInstalled) + return; - if (mMusic) { + if (mMusic) stopMusic(); - } ResourceManager *resman = ResourceManager::getInstance(); std::string path = resman->getPath("music/" + filename); @@ -150,7 +153,8 @@ void Sound::playMusic(const std::string &filename, int loop) void Sound::stopMusic() { - if (!mInstalled) return; + if (!mInstalled) + return; logger->log("Sound::stopMusic()"); @@ -163,11 +167,11 @@ void Sound::stopMusic() void Sound::fadeInMusic(const std::string &path, int loop, int ms) { - if (!mInstalled) return; + if (!mInstalled) + return; - if (mMusic) { + if (mMusic) stopMusic(); - } logger->log("Sound::fadeInMusic() Fading \"%s\" %i times (%i ms)", path.c_str(), @@ -184,7 +188,8 @@ void Sound::fadeInMusic(const std::string &path, int loop, int ms) void Sound::fadeOutMusic(int ms) { - if (!mInstalled) return; + if (!mInstalled) + return; logger->log("Sound::fadeOutMusic() Fading-out (%i ms)", ms); @@ -197,7 +202,8 @@ void Sound::fadeOutMusic(int ms) void Sound::playSfx(const std::string &path) { - if (!mInstalled || path.length() == 0) return; + if (!mInstalled || path.length() == 0) + return; ResourceManager *resman = ResourceManager::getInstance(); SoundEffect *sample = resman->getSoundEffect(path); diff --git a/src/sound.h b/src/sound.h index c30ef7cd..2e43ef37 100644 --- a/src/sound.h +++ b/src/sound.h @@ -27,7 +27,6 @@ #else #include <SDL_mixer.h> #endif -#include <string> #include <string> @@ -35,16 +34,10 @@ * * \ingroup CORE */ -class Sound { +class Sound +{ public: - /** - * Constructor. - */ Sound(); - - /** - * Destructor. - */ ~Sound(); /** |