From 378441b559615cc96150e64137ae2ce02d23d2f2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 19 Sep 2013 20:59:49 +0300 Subject: fix some compilation issues in different platforms. --- src/graphicsmanager.cpp | 2 ++ src/gui/setup_video.cpp | 2 +- src/gui/widgets/setuptouchitem.cpp | 2 +- src/guild.cpp | 2 +- src/maplayer.h | 2 +- src/net/tmwa/messagehandler.h | 2 -- src/party.cpp | 2 +- src/resources/sdlmusic.cpp | 3 ++- src/resources/sdlmusic.h | 2 -- src/resources/spritedef.cpp | 2 +- src/utils/process.cpp | 2 ++ src/utils/stringutils.cpp | 4 ++-- 12 files changed, 14 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index 423b08202..d226e35e0 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -150,7 +150,9 @@ int GraphicsManager::detectGraphics() logger->log1("enable opengl mode"); int textureSampler = 0; int compressTextures = 0; +#ifndef ANDROID mainGraphics = new NormalOpenGLGraphics; +#endif SDL_Window *const window = createWindow(100, 100, 0, SDL_ANYFORMAT | SDL_OPENGL); mainGraphics->setWindow(window, 100, 100); diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index b82b25f25..4c285a879 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -565,7 +565,7 @@ void Setup_Video::action(const gcn::ActionEvent &event) { const int val = test->getConfig().getValueInt("opengl", -1); if (val >= 0 && static_cast(val) - < sizeof(renderToIndex) / sizeof (int)) + < sizeof(renderToIndex) / sizeof(int)) { mOpenGLDropDown->setSelected(renderToIndex[val]); } diff --git a/src/gui/widgets/setuptouchitem.cpp b/src/gui/widgets/setuptouchitem.cpp index b62e1e550..d8d6eda9a 100644 --- a/src/gui/widgets/setuptouchitem.cpp +++ b/src/gui/widgets/setuptouchitem.cpp @@ -31,7 +31,7 @@ #include "debug.h" -static const class SortTouchActionFunctor final +static class SortTouchActionFunctor final { public: bool operator() (const SetupActionData *const data1, diff --git a/src/guild.cpp b/src/guild.cpp index 3b80022ae..12fbe78a4 100644 --- a/src/guild.cpp +++ b/src/guild.cpp @@ -28,7 +28,7 @@ #include "debug.h" -static const class SortGuildFunctor final +static class SortGuildFunctor final { public: bool operator() (const GuildMember *const m1, diff --git a/src/maplayer.h b/src/maplayer.h index 410be05fa..62c6e86b7 100644 --- a/src/maplayer.h +++ b/src/maplayer.h @@ -89,7 +89,7 @@ class MapLayer final: public ConfigListener public: enum Type { - TILES, + TILES = 0, COLLISION, HEIGHTS }; diff --git a/src/net/tmwa/messagehandler.h b/src/net/tmwa/messagehandler.h index e012f7a8a..4cdc46119 100644 --- a/src/net/tmwa/messagehandler.h +++ b/src/net/tmwa/messagehandler.h @@ -25,8 +25,6 @@ #include "net/messagehandler.h" -//#include - #include namespace TmwAthena diff --git a/src/party.cpp b/src/party.cpp index 2f747e752..b6594672a 100644 --- a/src/party.cpp +++ b/src/party.cpp @@ -27,7 +27,7 @@ #include "debug.h" -static const class SortPartyFunctor final +static class SortPartyFunctor final { public: bool operator() (const PartyMember *const p1, diff --git a/src/resources/sdlmusic.cpp b/src/resources/sdlmusic.cpp index 03c6922d6..b9f6492d1 100644 --- a/src/resources/sdlmusic.cpp +++ b/src/resources/sdlmusic.cpp @@ -51,13 +51,14 @@ Resource *SDLMusic::load(SDL_RWops *const rw) if (Mix_Music *const music = Mix_LoadMUSType_RW(rw, MUS_OGG, 1)) { return new SDLMusic(music, nullptr); + } #else // Mix_LoadMUSType_RW was added without version changed in SDL1.2 :( if (Mix_Music *const music = Mix_LoadMUS_RW(rw)) { return new SDLMusic(music, rw); -#endif } +#endif else { logger->log("Error, failed to load music: %s", Mix_GetError()); diff --git a/src/resources/sdlmusic.h b/src/resources/sdlmusic.h index 23397ec61..04b78bde9 100644 --- a/src/resources/sdlmusic.h +++ b/src/resources/sdlmusic.h @@ -29,8 +29,6 @@ #include "localconsts.h" -//struct SDL_RWops; - /** * Defines a class for loading and storing music. */ diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp index 2d5d25fb4..a855e90ba 100644 --- a/src/resources/spritedef.cpp +++ b/src/resources/spritedef.cpp @@ -237,7 +237,7 @@ void SpriteDef::loadAction(const XmlNodePtr node, const int variant_offset) imageSetName.c_str(), getIdPath().c_str()); return; } - ImageSet *const imageSet = si->second; + const ImageSet *const imageSet = si->second; if (actionName == SpriteAction::INVALID) { diff --git a/src/utils/process.cpp b/src/utils/process.cpp index 37670b18b..1859b1c2f 100644 --- a/src/utils/process.cpp +++ b/src/utils/process.cpp @@ -34,6 +34,7 @@ const int timeOut = 10; #ifdef WIN32 +#include "utils/stringutils.h" #include int execFileWait(const std::string &pathName, const std::string &name A_UNUSED, @@ -236,6 +237,7 @@ bool openBrowser(std::string url) nullptr, nullptr, SW_SHOWNORMAL)) > 32; } #elif defined ANDROID +#include "utils/stringutils.h" #include bool openBrowser(std::string url) { diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index c5ac71d28..680d8e44d 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -26,9 +26,9 @@ #include #include #include -#include - #include +#include +#include #include "debug.h" -- cgit v1.2.3-60-g2f50