From d32386353d28093a5d03ad99f161f8133d73e056 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Mon, 13 Dec 2004 02:25:58 +0000 Subject: Some header order, namespace and lib fixes to improve MSVC support. --- ManaWorld.vcproj | 4 ++-- src/graphic/image.h | 18 +++++++++--------- src/gui/char_server.cpp | 1 - src/gui/gui.cpp | 2 +- src/gui/gui.h | 6 +++--- src/gui/setup.cpp | 10 ++++++---- src/gui/setup.h | 2 +- src/log.cpp | 2 +- src/log.h | 5 ++--- src/main.h | 2 +- src/sound/sound.h | 5 ++--- 11 files changed, 28 insertions(+), 29 deletions(-) diff --git a/ManaWorld.vcproj b/ManaWorld.vcproj index 0b2b1ea1..bf7b644c 100644 --- a/ManaWorld.vcproj +++ b/ManaWorld.vcproj @@ -33,7 +33,7 @@ #include #include #include -#include #include "../log.h" -using namespace std; + class IMAGE { protected: @@ -50,14 +50,14 @@ class VIDEO_IMAGE : public IMAGE { }; class SPRITESET { - private: - int get_property(DATAFILE *datafile, int type) { - return atoi(get_datafile_property(datafile, type)); - } - public: - vector spriteset; + private: + int get_property(DATAFILE *datafile, int type) { + return atoi(get_datafile_property(datafile, type)); + } + public: + std::vector spriteset; - SPRITESET(string filename) { + SPRITESET(std::string filename) { DATAFILE *datafile = load_datafile(filename.c_str()); if(!datafile)error("Unable to load graphic file: " + filename); int i = 0; diff --git a/src/gui/char_server.cpp b/src/gui/char_server.cpp index c84fc167..caf02eed 100644 --- a/src/gui/char_server.cpp +++ b/src/gui/char_server.cpp @@ -32,7 +32,6 @@ gcn::ListBox *serverList; void ServerSelectListener::action(const std::string& eventId) { - printf("%s\n", eventId.c_str()); if (eventId == "ok") { server_char_server(serverList->getSelected()); } diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index b20d2e1d..6b574b45 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -19,11 +19,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "gui.h" #include #include #include #include -#include "gui.h" #include "../log.h" #include "../sound/sound.h" diff --git a/src/gui/gui.h b/src/gui/gui.h index b3c989c2..af83ccac 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -22,15 +22,15 @@ #ifdef WIN32 #pragma warning (disable:4312) #endif -#include "login.h" + #ifndef _TMW_GUI #define _TMW_GUI +#include +#include #include #include #include -#include -#include typedef struct { BITMAP *grid[9]; diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index c8b677db..07ade6d3 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -64,10 +64,12 @@ Setup::~Setup() { } void Setup::toggleVisible(bool toggle) { - if(visible == false && toggle == true) - visible == true; - else - if(visible == true && toggle == false) visible == false; + if (!visible && toggle) { + visible = true; + } + else if (visible && !toggle) { + visible = false; + } setupDialog->setVisible(visible); } diff --git a/src/gui/setup.h b/src/gui/setup.h index 1d8b859f..5c92f136 100644 --- a/src/gui/setup.h +++ b/src/gui/setup.h @@ -8,7 +8,7 @@ #include #ifdef WIN32 -#include +#include #endif #include "gui.h" #include "../graphic/graphic.h" diff --git a/src/log.cpp b/src/log.cpp index ecc54aea..d9eb0bda 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -79,7 +79,7 @@ void log(const char *category, 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. */ -void error(const string error_text) { +void error(const std::string error_text) { log("Error", error_text.c_str()); #ifdef WIN32 diff --git a/src/log.h b/src/log.h index a173fa5a..cd9079cb 100644 --- a/src/log.h +++ b/src/log.h @@ -24,18 +24,17 @@ #include #include -#include -using namespace std; #include #include #ifdef WIN32 #include #include #endif +#include void init_log(); void log(const char *category, const char *log_text, ...); -void error(string error_text); +void error(std::string error_text); void warning(const char *warning_text); void status(const char *status_text); diff --git a/src/main.h b/src/main.h index 9c0607e2..0578b42a 100644 --- a/src/main.h +++ b/src/main.h @@ -30,12 +30,12 @@ #define CORE_VERSION "0.0.8" -#include #include #ifdef WIN32 #include #endif #include +#include #include "log.h" #include "game.h" diff --git a/src/sound/sound.h b/src/sound/sound.h index 7cd82680..4f7f573c 100644 --- a/src/sound/sound.h +++ b/src/sound/sound.h @@ -22,16 +22,15 @@ #ifndef __SOUND_H #define __SOUND_H -#include -#include -#include #ifdef WIN32 #pragma warning(disable:4312) #endif #include #include +#include #include +#include /** mod file */ #define TMWSOUND_MOD 1 -- cgit v1.2.3-60-g2f50