Browse Source

Reduced SDL includes

Ivan Savenko 2 years ago
parent
commit
fc0f5a9fb3

+ 1 - 2
client/CBitmapHandler.cpp

@@ -10,8 +10,7 @@
 #include "StdInc.h"
 
 #include "../lib/filesystem/Filesystem.h"
-#include "SDL.h"
-#include "SDL_image.h"
+#include <SDL_image.h>
 #include "CBitmapHandler.h"
 #include "gui/SDL_Extensions.h"
 #include "../lib/vcmi_endian.h"

+ 1 - 0
client/CMT.cpp

@@ -56,6 +56,7 @@
 
 #include "mainmenu/CPrologEpilogVideo.h"
 #include <vstd/StringUtils.h>
+#include <SDL.h>
 
 #ifdef VCMI_WINDOWS
 #include "SDL_syswm.h"

+ 1 - 1
client/CMusicHandler.cpp

@@ -9,7 +9,7 @@
  */
 #include "StdInc.h"
 #include <SDL_mixer.h>
-#include <SDL.h>
+#include <SDL_timer.h>
 
 #include "CMusicHandler.h"
 #include "CGameInfo.h"

+ 1 - 1
client/CPlayerInterface.cpp

@@ -63,7 +63,7 @@
 #include "../lib/CPathfinder.h"
 #include "../lib/RoadHandler.h"
 #include "../lib/TerrainHandler.h"
-#include <SDL.h>
+#include <SDL_timer.h>
 #include "CServerHandler.h"
 // FIXME: only needed for CGameState::mutex
 #include "../lib/CGameState.h"

+ 0 - 1
client/CVideoHandler.cpp

@@ -8,7 +8,6 @@
  *
  */
 #include "StdInc.h"
-#include <SDL.h>
 #include "CVideoHandler.h"
 
 #include "gui/CGuiHandler.h"

+ 0 - 2
client/Client.cpp

@@ -10,8 +10,6 @@
 #include "StdInc.h"
 #include "Client.h"
 
-#include <SDL.h>
-
 #include "CMusicHandler.h"
 #include "../lib/mapping/CCampaignHandler.h"
 #include "../CCallback.h"

+ 1 - 1
client/gui/CGuiHandler.cpp

@@ -11,7 +11,7 @@
 #include "CGuiHandler.h"
 #include "../lib/CondSh.h"
 
-#include <SDL.h>
+#include <SDL_timer.h>
 
 #include "CIntObject.h"
 #include "CursorHandler.h"

+ 2 - 4
client/gui/CursorHandler.cpp

@@ -11,8 +11,6 @@
 #include "StdInc.h"
 #include "CursorHandler.h"
 
-#include <SDL.h>
-
 #include "SDL_Extensions.h"
 #include "CGuiHandler.h"
 #include "CAnimation.h"
@@ -345,7 +343,7 @@ void CursorSoftware::updateTexture()
 	if (!cursorSurface ||  Point(cursorSurface->w, cursorSurface->h) != cursorImage->dimensions())
 		createTexture(cursorImage->dimensions());
 
-	CSDL_Ext::fillSurface(cursorSurface, Colors::TRANSPARENT);
+	CSDL_Ext::fillSurface(cursorSurface, Colors::TRANSPARENCY);
 
 	cursorImage->draw(cursorSurface);
 	SDL_UpdateTexture(cursorTexture, NULL, cursorSurface->pixels, cursorSurface->pitch);
@@ -413,7 +411,7 @@ void CursorHardware::setImage(std::shared_ptr<IImage> image, const Point & pivot
 {
 	auto cursorSurface = CSDL_Ext::newSurface(image->dimensions().x, image->dimensions().y);
 
-	CSDL_Ext::fillSurface(cursorSurface, Colors::TRANSPARENT);
+	CSDL_Ext::fillSurface(cursorSurface, Colors::TRANSPARENCY);
 
 	image->draw(cursorSurface);
 

+ 1 - 1
client/gui/SDL_Extensions.cpp

@@ -39,7 +39,7 @@ const SDL_Color Colors::DEFAULT_KEY_COLOR = {0, 255, 255, SDL_ALPHA_OPAQUE};
 const SDL_Color Colors::RED = {255, 0, 0, SDL_ALPHA_OPAQUE};
 const SDL_Color Colors::PURPLE = {255, 75, 125, SDL_ALPHA_OPAQUE};
 const SDL_Color Colors::BLACK = {0, 0, 0, SDL_ALPHA_OPAQUE};
-const SDL_Color Colors::TRANSPARENT = {0, 0, 0, SDL_ALPHA_TRANSPARENT};
+const SDL_Color Colors::TRANSPARENCY = {0, 0, 0, SDL_ALPHA_TRANSPARENT};
 
 Rect CSDL_Ext::genRect(const int & hh, const int & ww, const int & xx, const int & yy)
 {

+ 1 - 1
client/gui/SDL_Extensions.h

@@ -63,7 +63,7 @@ public:
 
 	static const SDL_Color BLACK;
 
-	static const SDL_Color TRANSPARENT;
+	static const SDL_Color TRANSPARENCY;
 };
 
 namespace CSDL_Ext

+ 0 - 1
client/mapHandler.h

@@ -13,7 +13,6 @@
 #include "../lib/int3.h"
 #include "../lib/spells/ViewSpellInt.h"
 #include "../lib/Rect.h"
-#include "SDL.h"
 
 #ifdef IN
 #undef IN

+ 1 - 1
client/widgets/AdventureMapClasses.cpp

@@ -10,7 +10,7 @@
 #include "StdInc.h"
 #include "AdventureMapClasses.h"
 
-#include <SDL.h>
+#include <SDL_timer.h>
 
 #include "MiscWidgets.h"
 #include "CComponent.h"