From 485ba81a87c50c23d1f97318e42f4937af1fda1f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 4 Jun 2016 03:21:57 +0300 Subject: Remove some useless includes if using SDL2. --- src/being/compoundsprite.cpp | 14 +++++++++----- src/dyetool/dyemain.cpp | 7 +++++-- src/eventsmanager.cpp | 5 +++-- src/gui/palette.cpp | 2 ++ src/gui/widgets/textfield.cpp | 7 +++++-- src/gui/windows/itemamountwindow.cpp | 6 ++++-- src/input/keyinput.h | 4 ++++ src/render/rendererslistsdl2.h | 2 ++ src/render/surfacegraphics.cpp | 3 +++ src/resources/db/itemfielddb.h | 1 + src/resources/dye/dyepalette.cpp | 2 ++ 11 files changed, 40 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/being/compoundsprite.cpp b/src/being/compoundsprite.cpp index cd0ee8d62..39013767c 100644 --- a/src/being/compoundsprite.cpp +++ b/src/being/compoundsprite.cpp @@ -22,7 +22,6 @@ #include "being/compoundsprite.h" #include "configuration.h" -#include "game.h" #ifdef USE_OPENGL #include "main.h" @@ -32,10 +31,6 @@ #include "being/compounditem.h" -#include "const/resources/map/map.h" - -#include "resources/map/map.h" - #include "render/surfacegraphics.h" #include "resources/image.h" @@ -44,7 +39,16 @@ #include "utils/delete2.h" #include "utils/dtor.h" #include "utils/sdlcheckutils.h" + +#ifndef USE_SDL2 +#include "game.h" + +#include "const/resources/map/map.h" + +#include "resources/map/map.h" + #include "utils/timer.h" +#endif #include diff --git a/src/dyetool/dyemain.cpp b/src/dyetool/dyemain.cpp index 4625e95fc..9763f603b 100644 --- a/src/dyetool/dyemain.cpp +++ b/src/dyetool/dyemain.cpp @@ -26,11 +26,10 @@ #include "resources/image.h" #include "resources/imagewriter.h" -#include "resources/sdlimagehelper.h" #ifdef USE_SDL2 #include "resources/surfaceimagehelper.h" -#endif +#endif // USE_SDL2 #include "resources/loaders/imageloader.h" @@ -41,7 +40,11 @@ #include +#ifndef USE_SDL2 +#include "resources/sdlimagehelper.h" + #include +#endif // USE_SDL2 #include "debug.h" diff --git a/src/eventsmanager.cpp b/src/eventsmanager.cpp index 919c8bdbf..c8820487f 100644 --- a/src/eventsmanager.cpp +++ b/src/eventsmanager.cpp @@ -25,7 +25,6 @@ #ifndef DYECMD #include "game.h" #endif -#include "logger.h" #ifdef USE_MUMBLE #include "mumblemanager.h" #endif @@ -40,7 +39,9 @@ #ifdef USE_SDL2 #include "render/graphics.h" -#endif +#else // USE_SDL2 +#include "logger.h" +#endif // USE_SDL2 #include "utils/process.h" diff --git a/src/gui/palette.cpp b/src/gui/palette.cpp index cedfb0f86..ef0d33d89 100644 --- a/src/gui/palette.cpp +++ b/src/gui/palette.cpp @@ -25,7 +25,9 @@ #include "utils/timer.h" +#ifndef USE_SDL2 #include +#endif // USE_SDL2 #include "debug.h" diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp index 9f64b56cd..9d89dfe45 100644 --- a/src/gui/widgets/textfield.cpp +++ b/src/gui/widgets/textfield.cpp @@ -69,13 +69,13 @@ #ifdef USE_SDL2 #include "enums/input/keyvalue.h" -#endif +#endif // USE_SDL2 #include "gui/gui.h" #include "gui/skin.h" #ifdef ANDROID #include "gui/windowmanager.h" -#endif +#endif // ANDROID #include "gui/fonts/font.h" @@ -85,7 +85,10 @@ #include "utils/copynpaste.h" #include "utils/stringutils.h" + +#ifndef USE_SDL2 #include "utils/timer.h" +#endif // USE_SDL2 #include "render/graphics.h" diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp index 8f3dea0cd..b3fdf4a62 100644 --- a/src/gui/windows/itemamountwindow.cpp +++ b/src/gui/windows/itemamountwindow.cpp @@ -35,7 +35,7 @@ #include "gui/windows/maileditwindow.h" #ifdef EATHENA_SUPPORT #include "gui/windows/npcdialog.h" -#endif +#endif // EATHENA_SUPPORT #include "gui/windows/shopwindow.h" #include "gui/windows/tradewindow.h" @@ -51,13 +51,15 @@ #include "net/inventoryhandler.h" #ifdef EATHENA_SUPPORT #include "net/npchandler.h" -#endif +#endif // EATHENA_SUPPORT #include "resources/item/item.h" #include "utils/gettext.h" +#ifndef USE_SDL2 #include +#endif // USE_SDL2 #include "debug.h" diff --git a/src/input/keyinput.h b/src/input/keyinput.h index fb8246cf5..d582303a0 100644 --- a/src/input/keyinput.h +++ b/src/input/keyinput.h @@ -70,6 +70,10 @@ #include "input/key.h" +#ifdef USE_SDL2 +#include +#endif // USE_SDL2 + #include "localconsts.h" class KeyInput final diff --git a/src/render/rendererslistsdl2.h b/src/render/rendererslistsdl2.h index e98922f70..3944f4a56 100644 --- a/src/render/rendererslistsdl2.h +++ b/src/render/rendererslistsdl2.h @@ -25,6 +25,8 @@ #include "utils/gettext.h" +#include "render/renderers.h" + #ifdef USE_OPENGL #ifdef ANDROID // defined OPENGL ANDROID diff --git a/src/render/surfacegraphics.cpp b/src/render/surfacegraphics.cpp index d3083dd5c..e6fc33298 100644 --- a/src/render/surfacegraphics.cpp +++ b/src/render/surfacegraphics.cpp @@ -23,7 +23,10 @@ #include "render/surfacegraphics.h" #include "resources/image.h" + +#ifndef USE_SDL2 #include "resources/surfaceimagehelper.h" +#endif // USE_SDL2 #include "debug.h" diff --git a/src/resources/db/itemfielddb.h b/src/resources/db/itemfielddb.h index 18fa516b5..dc95e9558 100644 --- a/src/resources/db/itemfielddb.h +++ b/src/resources/db/itemfielddb.h @@ -24,6 +24,7 @@ #include "enums/simpletypes/skiperror.h" #include +#include #include "localconsts.h" diff --git a/src/resources/dye/dyepalette.cpp b/src/resources/dye/dyepalette.cpp index 930f23723..9b2a2a8a8 100644 --- a/src/resources/dye/dyepalette.cpp +++ b/src/resources/dye/dyepalette.cpp @@ -30,7 +30,9 @@ #include "utils/stringutils.h" +#ifndef USE_SDL2 #include +#endif // USE_SDL2 #include -- cgit v1.2.3-70-g09d2