Ver código fonte

Reorganized includes for new layout. New class - IImageLoader

Ivan Savenko 2 anos atrás
pai
commit
108a42e4ba
100 arquivos alterados com 447 adições e 1065 exclusões
  1. 0 1
      CCallback.cpp
  2. 16 21
      client/CMT.cpp
  3. 2 0
      client/CMakeLists.txt
  4. 3 1
      client/CMusicHandler.cpp
  5. 6 6
      client/CPlayerInterface.cpp
  6. 1 1
      client/CVideoHandler.cpp
  7. 2 2
      client/Client.cpp
  8. 4 2
      client/ClientCommandManager.cpp
  9. 12 12
      client/NetPacksClient.cpp
  10. 20 34
      client/adventureMap/CAdvMapInt.cpp
  11. 19 15
      client/adventureMap/CAdvMapInt.h
  12. 6 36
      client/adventureMap/CAdvMapPanel.cpp
  13. 2 18
      client/adventureMap/CAdvMapPanel.h
  14. 4 70
      client/adventureMap/CAdventureOptions.cpp
  15. 2 26
      client/adventureMap/CAdventureOptions.h
  16. 8 29
      client/adventureMap/CInGameConsole.cpp
  17. 1 27
      client/adventureMap/CInGameConsole.h
  18. 8 28
      client/adventureMap/CInfoBar.cpp
  19. 3 12
      client/adventureMap/CInfoBar.h
  20. 7 28
      client/adventureMap/CList.cpp
  21. 3 17
      client/adventureMap/CList.h
  22. 6 26
      client/adventureMap/CMinimap.cpp
  23. 4 27
      client/adventureMap/CMinimap.h
  24. 4 71
      client/adventureMap/CResDataBar.cpp
  25. 1 26
      client/adventureMap/CResDataBar.h
  26. 15 72
      client/adventureMap/CTerrainRect.cpp
  27. 2 19
      client/adventureMap/CTerrainRect.h
  28. 18 24
      client/adventureMap/mapHandler.cpp
  29. 3 3
      client/adventureMap/mapHandler.h
  30. 2 2
      client/battle/BattleEffectsController.cpp
  31. 3 3
      client/battle/BattleFieldController.cpp
  32. 2 3
      client/battle/BattleInterface.cpp
  33. 5 5
      client/battle/BattleInterfaceClasses.cpp
  34. 1 2
      client/battle/BattleObstacleController.cpp
  35. 1 2
      client/battle/BattleProjectileController.cpp
  36. 2 2
      client/battle/BattleSiegeController.cpp
  37. 3 4
      client/battle/BattleStacksController.cpp
  38. 1 1
      client/battle/BattleStacksController.h
  39. 4 4
      client/battle/BattleWindow.cpp
  40. 3 3
      client/battle/CreatureAnimation.cpp
  41. 2 1
      client/battle/CreatureAnimation.h
  42. 4 3
      client/gui/CGuiHandler.cpp
  43. 2 2
      client/gui/CIntObject.cpp
  44. 1 1
      client/gui/CIntObject.h
  45. 7 2
      client/gui/CursorHandler.cpp
  46. 4 6
      client/gui/CursorHandler.h
  47. 0 1
      client/gui/InterfaceObjectConfigurable.cpp
  48. 3 3
      client/lobby/CBonusSelection.cpp
  49. 0 2
      client/lobby/CCampaignInfoScreen.cpp
  50. 1 2
      client/lobby/CSelectionBase.cpp
  51. 0 1
      client/lobby/OptionsTab.cpp
  52. 0 1
      client/lobby/RandomMapTab.cpp
  53. 1 2
      client/lobby/SelectionTab.cpp
  54. 0 2
      client/mainmenu/CCampaignScreen.cpp
  55. 0 4
      client/mainmenu/CMainMenu.cpp
  56. 3 10
      client/render/CAnimation.cpp
  57. 1 15
      client/render/CAnimation.h
  58. 5 3
      client/render/CBitmapHandler.cpp
  59. 17 24
      client/render/CDefFile.cpp
  60. 3 23
      client/render/CDefFile.h
  61. 2 12
      client/render/CFadeAnimation.cpp
  62. 0 9
      client/render/CFadeAnimation.h
  63. 3 4
      client/render/Canvas.cpp
  64. 1 1
      client/render/Canvas.h
  65. 7 3
      client/render/Graphics.cpp
  66. 2 1
      client/render/Graphics.h
  67. 4 6
      client/render/ICursor.h
  68. 4 7
      client/render/IFont.cpp
  69. 0 6
      client/render/IFont.h
  70. 1 12
      client/render/IImage.h
  71. 31 0
      client/render/IImageLoader.h
  72. 5 4
      client/renderSDL/CBitmapFont.cpp
  73. 1 14
      client/renderSDL/CBitmapFont.h
  74. 6 4
      client/renderSDL/CBitmapHanFont.cpp
  75. 2 29
      client/renderSDL/CBitmapHanFont.h
  76. 11 5
      client/renderSDL/CTrueTypeFont.cpp
  77. 2 9
      client/renderSDL/CTrueTypeFont.h
  78. 2 4
      client/renderSDL/CursorHardware.cpp
  79. 1 0
      client/renderSDL/CursorHardware.h
  80. 3 8
      client/renderSDL/CursorSoftware.cpp
  81. 1 0
      client/renderSDL/CursorSoftware.h
  82. 6 8
      client/renderSDL/SDLImage.cpp
  83. 5 16
      client/renderSDL/SDLImage.h
  84. 7 18
      client/renderSDL/SDLImageLoader.cpp
  85. 6 28
      client/renderSDL/SDLImageLoader.h
  86. 3 1
      client/renderSDL/SDLRWwrapper.cpp
  87. 16 15
      client/renderSDL/SDL_Extensions.cpp
  88. 2 1
      client/widgets/Buttons.cpp
  89. 1 1
      client/widgets/Buttons.h
  90. 6 4
      client/widgets/CComponent.cpp
  91. 2 2
      client/widgets/CreatureCostBox.h
  92. 3 7
      client/widgets/Images.cpp
  93. 3 2
      client/widgets/MiscWidgets.cpp
  94. 6 4
      client/widgets/TextControls.cpp
  95. 2 1
      client/widgets/TextControls.h
  96. 6 7
      client/windows/CCastleInterface.cpp
  97. 5 7
      client/windows/CHeroWindow.cpp
  98. 4 1
      client/windows/CKingdomInterface.cpp
  99. 9 10
      client/windows/CMessage.cpp
  100. 3 1
      client/windows/CMessage.h

+ 0 - 1
CCallback.cpp

@@ -21,7 +21,6 @@
 #include "lib/CGeneralTextHandler.h"
 #include "lib/CHeroHandler.h"
 #include "lib/NetPacks.h"
-#include "client/mapHandler.h"
 #include "lib/CArtHandler.h"
 #include "lib/GameConstants.h"
 #include "lib/CPlayerState.h"

+ 16 - 21
client/CMT.cpp

@@ -11,48 +11,43 @@
 //
 #include "StdInc.h"
 
-#include <boost/program_options.hpp>
-
-#include "gui/SDL_Extensions.h"
 #include "CGameInfo.h"
-#include "mapHandler.h"
-
-#include "../lib/filesystem/Filesystem.h"
-#include "../lib/filesystem/FileStream.h"
 #include "mainmenu/CMainMenu.h"
 #include "lobby/CSelectionBase.h"
 #include "windows/CCastleInterface.h"
-#include "../lib/CConsoleHandler.h"
 #include "gui/CursorHandler.h"
-#include "../lib/CGameState.h"
-#include "../CCallback.h"
 #include "CPlayerInterface.h"
-#include "windows/CAdvmapInterface.h"
-#include "../lib/CBuildingHandler.h"
 #include "CVideoHandler.h"
+#include "CMusicHandler.h"
+#include "Client.h"
+#include "gui/CGuiHandler.h"
+#include "CServerHandler.h"
+#include "gui/NotificationHandler.h"
+#include "ClientCommandManager.h"
+#include "windows/CMessage.h"
+#include "renderSDL/SDL_Extensions.h"
+
+#include "../lib/filesystem/Filesystem.h"
+#include "../lib/filesystem/FileStream.h"
+#include "../lib/CConsoleHandler.h"
+#include "../lib/CGameState.h"
+#include "../lib/CBuildingHandler.h"
+#include "../CCallback.h"
 #include "../lib/CHeroHandler.h"
 #include "../lib/spells/CSpellHandler.h"
-#include "CMusicHandler.h"
 #include "../lib/CGeneralTextHandler.h"
-#include "Graphics.h"
-#include "Client.h"
 #include "../lib/serializer/BinaryDeserializer.h"
 #include "../lib/serializer/BinarySerializer.h"
 #include "../lib/VCMIDirs.h"
 #include "../lib/NetPacks.h"
-#include "CMessage.h"
 #include "../lib/CModHandler.h"
 #include "../lib/CTownHandler.h"
-#include "gui/CGuiHandler.h"
 #include "../lib/logging/CBasicLogConfigurator.h"
 #include "../lib/CPlayerState.h"
-#include "gui/CAnimation.h"
 #include "../lib/serializer/Connection.h"
-#include "CServerHandler.h"
-#include "gui/NotificationHandler.h"
-#include "ClientCommandManager.h"
 
 #include <boost/asio.hpp>
+#include <boost/program_options.hpp>
 
 #include "mainmenu/CPrologEpilogVideo.h"
 #include <vstd/StringUtils.h>

+ 2 - 0
client/CMakeLists.txt

@@ -25,6 +25,7 @@ set(client_SRCS
 	battle/BattleSiegeController.cpp
 	battle/BattleStacksController.cpp
 	battle/BattleWindow.cpp
+	battle/CreatureAnimation.cpp
 
 	gui/CGuiHandler.cpp
 	gui/CIntObject.cpp
@@ -163,6 +164,7 @@ set(client_HEADERS
 	render/ICursor.h
 	render/IFont.h
 	render/IImage.h
+	render/IImageLoader.h
 
 	renderSDL/CBitmapFont.h
 	renderSDL/CBitmapHanFont.h

+ 3 - 1
client/CMusicHandler.cpp

@@ -13,7 +13,8 @@
 
 #include "CMusicHandler.h"
 #include "CGameInfo.h"
-#include "SDLRWwrapper.h"
+#include "renderSDL/SDLRWwrapper.h"
+
 #include "../lib/JsonNode.h"
 #include "../lib/GameConstants.h"
 #include "../lib/filesystem/Filesystem.h"
@@ -22,6 +23,7 @@
 #include "../lib/VCMIDirs.h"
 #include "../lib/TerrainHandler.h"
 
+
 #define VCMI_SOUND_NAME(x)
 #define VCMI_SOUND_FILE(y) #y,
 

+ 6 - 6
client/CPlayerInterface.cpp

@@ -11,7 +11,8 @@
 
 #include <vcmi/Artifact.h>
 
-#include "windows/CAdvmapInterface.h"
+#include "adventureMap/CAdvMapInt.h"
+#include "adventureMap/mapHandler.h"
 #include "battle/BattleInterface.h"
 #include "battle/BattleEffectsController.h"
 #include "battle/BattleFieldController.h"
@@ -25,15 +26,15 @@
 #include "windows/CHeroWindow.h"
 #include "windows/CCreatureWindow.h"
 #include "windows/CQuestLog.h"
-#include "CMessage.h"
 #include "CPlayerInterface.h"
-#include "gui/SDL_Extensions.h"
 #include "widgets/CComponent.h"
+#include "widgets/Buttons.h"
 #include "windows/CTradeWindow.h"
 #include "windows/CSpellWindow.h"
 #include "../lib/CConfigHandler.h"
-#include "Graphics.h"
 #include "windows/GUIClasses.h"
+#include "render/CAnimation.h"
+#include "render/IImage.h"
 #include "../lib/CArtHandler.h"
 #include "../lib/CGeneralTextHandler.h"
 #include "../lib/CHeroHandler.h"
@@ -51,13 +52,11 @@
 #include "../lib/NetPacks.h"//todo: remove
 #include "../lib/mapping/CMap.h"
 #include "../lib/VCMIDirs.h"
-#include "mapHandler.h"
 #include "../lib/CStopWatch.h"
 #include "../lib/StartInfo.h"
 #include "../lib/CPlayerState.h"
 #include "../lib/GameConstants.h"
 #include "gui/CGuiHandler.h"
-#include "gui/CAnimation.h"
 #include "windows/InfoWindows.h"
 #include "../lib/UnlockGuard.h"
 #include "../lib/CPathfinder.h"
@@ -67,6 +66,7 @@
 // FIXME: only needed for CGameState::mutex
 #include "../lib/CGameState.h"
 #include "gui/NotificationHandler.h"
+#include "adventureMap/CInGameConsole.h"
 
 #include <SDL_events.h>
 

+ 1 - 1
client/CVideoHandler.cpp

@@ -11,7 +11,7 @@
 #include "CVideoHandler.h"
 
 #include "gui/CGuiHandler.h"
-#include "gui/SDL_Extensions.h"
+#include "renderSDL/SDL_Extensions.h"
 #include "CPlayerInterface.h"
 #include "../lib/filesystem/Filesystem.h"
 

+ 2 - 2
client/Client.cpp

@@ -13,6 +13,8 @@
 #include "CMusicHandler.h"
 #include "../lib/mapping/CCampaignHandler.h"
 #include "../CCallback.h"
+#include "adventureMap/CAdvMapInt.h"
+#include "adventureMap/mapHandler.h"
 #include "../lib/CConsoleHandler.h"
 #include "CGameInfo.h"
 #include "../lib/CGameState.h"
@@ -35,7 +37,6 @@
 #include "../lib/mapping/CMap.h"
 #include "../lib/mapping/CMapService.h"
 #include "../lib/JsonNode.h"
-#include "mapHandler.h"
 #include "../lib/CConfigHandler.h"
 #include "mainmenu/CMainMenu.h"
 #include "mainmenu/CCampaignScreen.h"
@@ -46,7 +47,6 @@
 #include "gui/CGuiHandler.h"
 #include "CServerHandler.h"
 #include "../lib/ScriptHandler.h"
-#include "windows/CAdvmapInterface.h"
 #include <vcmi/events/EventBus.h>
 
 #ifdef VCMI_ANDROID

+ 4 - 2
client/ClientCommandManager.cpp

@@ -12,6 +12,8 @@
 #include "ClientCommandManager.h"
 
 #include "Client.h"
+#include "adventureMap/CInGameConsole.h"
+#include "adventureMap/CAdvMapInt.h"
 #include "CPlayerInterface.h"
 #include "CServerHandler.h"
 #include "gui/CGuiHandler.h"
@@ -20,14 +22,14 @@
 #include "../lib/CGameState.h"
 #include "../lib/CPlayerState.h"
 #include "../lib/StringConstants.h"
-#include "gui/CAnimation.h"
-#include "windows/CAdvmapInterface.h"
 #include "windows/CCastleInterface.h"
+#include "render/CAnimation.h"
 #include "../CCallback.h"
 #include "../lib/CGeneralTextHandler.h"
 #include "../lib/CHeroHandler.h"
 #include "../lib/CModHandler.h"
 #include "../lib/VCMIDirs.h"
+#include "CMT.h"
 
 #ifdef SCRIPTING_ENABLED
 #include "../lib/ScriptHandler.h"

+ 12 - 12
client/NetPacksClient.cpp

@@ -10,12 +10,21 @@
 #include "StdInc.h"
 #include "../lib/NetPacks.h"
 
-#include "../lib/filesystem/Filesystem.h"
-#include "../lib/filesystem/FileInfo.h"
-#include "../CCallback.h"
 #include "Client.h"
 #include "CPlayerInterface.h"
 #include "CGameInfo.h"
+#include "windows/GUIClasses.h"
+#include "adventureMap/mapHandler.h"
+#include "adventureMap/CInGameConsole.h"
+#include "battle/BattleInterface.h"
+#include "gui/CGuiHandler.h"
+#include "widgets/MiscWidgets.h"
+#include "CMT.h"
+#include "CServerHandler.h"
+
+#include "../CCallback.h"
+#include "../lib/filesystem/Filesystem.h"
+#include "../lib/filesystem/FileInfo.h"
 #include "../lib/serializer/Connection.h"
 #include "../lib/serializer/BinarySerializer.h"
 #include "../lib/CGeneralTextHandler.h"
@@ -26,22 +35,13 @@
 #include "../lib/spells/CSpellHandler.h"
 #include "../lib/CSoundBase.h"
 #include "../lib/StartInfo.h"
-#include "mapHandler.h"
-#include "windows/GUIClasses.h"
 #include "../lib/CConfigHandler.h"
-#include "gui/SDL_Extensions.h"
-#include "battle/BattleInterface.h"
 #include "../lib/mapping/CCampaignHandler.h"
 #include "../lib/CGameState.h"
 #include "../lib/CStack.h"
 #include "../lib/battle/BattleInfo.h"
 #include "../lib/GameConstants.h"
 #include "../lib/CPlayerState.h"
-#include "gui/CGuiHandler.h"
-#include "widgets/MiscWidgets.h"
-#include "widgets/AdventureMapClasses.h"
-#include "CMT.h"
-#include "CServerHandler.h"
 
 // TODO: as Tow suggested these template should all be part of CClient
 // This will require rework spectator interface properly though

+ 20 - 34
client/adventureMap/CAdvMapInt.cpp

@@ -8,58 +8,44 @@
  *
  */
 #include "StdInc.h"
-#include "CAdvmapInterface.h"
-
-#include "CCastleInterface.h"
-#include "CHeroWindow.h"
-#include "CKingdomInterface.h"
-#include "CSpellWindow.h"
-#include "CTradeWindow.h"
-#include "GUIClasses.h"
-#include "InfoWindows.h"
-
-#include "../CBitmapHandler.h"
+#include "CAdvMapInt.h"
+
+#include "CAdvMapPanel.h"
+#include "CAdventureOptions.h"
+#include "CInGameConsole.h"
+#include "mapHandler.h"
+
+#include "../windows/CKingdomInterface.h"
+#include "../windows/CSpellWindow.h"
+#include "../windows/CTradeWindow.h"
+#include "../windows/GUIClasses.h"
+#include "../windows/InfoWindows.h"
 #include "../CGameInfo.h"
-#include "../CMessage.h"
 #include "../CMusicHandler.h"
 #include "../CPlayerInterface.h"
-#include "../mainmenu/CMainMenu.h"
-#include "../lobby/CSelectionBase.h"
-#include "../lobby/CCampaignInfoScreen.h"
 #include "../lobby/CSavingScreen.h"
-#include "../lobby/CScenarioInfoScreen.h"
-#include "../Graphics.h"
-#include "../mapHandler.h"
-
-#include "../gui/CAnimation.h"
+#include "../render/CAnimation.h"
 #include "../gui/CursorHandler.h"
+#include "../render/IImage.h"
 #include "../gui/CGuiHandler.h"
-#include "../gui/SDL_Extensions.h"
-#include "../widgets/MiscWidgets.h"
+#include "../widgets/TextControls.h"
+#include "../widgets/Buttons.h"
 
 #include "../../CCallback.h"
-
 #include "../../lib/CConfigHandler.h"
-#include "../../lib/CGameState.h"
 #include "../../lib/CGeneralTextHandler.h"
-#include "../../lib/CHeroHandler.h"
-#include "../../lib/CSoundBase.h"
 #include "../../lib/spells/CSpellHandler.h"
-#include "../../lib/CTownHandler.h"
-#include "../../lib/JsonNode.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"
+#include "../../lib/mapObjects/CGTownInstance.h"
+#include "../../lib/CPathfinder.h"
 #include "../../lib/mapping/CMap.h"
 #include "../../lib/UnlockGuard.h"
-#include "../../lib/VCMI_Lib.h"
-#include "../../lib/StartInfo.h"
-#include "../../lib/mapping/CMapInfo.h"
 #include "../../lib/TerrainHandler.h"
 
 #include <SDL_surface.h>
 #include <SDL_events.h>
 
 #define ADVOPT (conf.go()->ac)
-using namespace CSDL_Ext;
 
 std::shared_ptr<CAdvMapInt> adventureInt;
 
@@ -630,7 +616,7 @@ void CAdvMapInt::handleMapScrollingUpdate()
 	int scrollSpeed = static_cast<int>(settings["adventure"]["scrollSpeed"].Float());
 	//if advmap needs updating AND (no dialog is shown OR ctrl is pressed)
 	if((animValHitCount % (4 / scrollSpeed)) == 0
-	   && ((GH.topInt().get() == this) || isCtrlKeyDown()))
+	   && ((GH.topInt().get() == this) || CSDL_Ext::isCtrlKeyDown()))
 	{
 		if((scrollingDir & LEFT) && (position.x > -CGI->mh->frameW))
 			position.x--;
@@ -994,7 +980,7 @@ void CAdvMapInt::mouseMoved( const SDL_MouseMotionEvent & sEvent )
 	// adventure map scrolling with mouse
 	// currently disabled in world view mode (as it is in OH3), but should work correctly if mode check is removed
 	// don't scroll if there is no window in focus - these events don't seem to correspond to the actual mouse movement
-	if(!isCtrlKeyDown() && isActive() && sEvent.windowID != 0 && mode == EAdvMapMode::NORMAL)
+	if(!CSDL_Ext::isCtrlKeyDown() && isActive() && sEvent.windowID != 0 && mode == EAdvMapMode::NORMAL)
 	{
 		if(sEvent.x<15)
 		{

+ 19 - 15
client/adventureMap/CAdvMapInt.h

@@ -9,35 +9,39 @@
  */
 #pragma once
 
-#include "../widgets/AdventureMapClasses.h"
-#include "CWindowObject.h"
+#include "../gui/CIntObject.h"
 
-#include "../widgets/TextControls.h"
-#include "../widgets/Buttons.h"
+#include "../../lib/int3.h"
+#include "../../lib/GameConstants.h"
 
-#include "../../lib/spells/ViewSpellInt.h"
+#include "CTerrainRect.h"
+#include "CResDataBar.h"
+#include "CList.h"
+#include "CInfoBar.h"
+#include "CMinimap.h"
 
 VCMI_LIB_NAMESPACE_BEGIN
 
-struct CGPath;
-struct CGPathNode;
+class CGObjectInstance;
 class CGHeroInstance;
 class CGTownInstance;
-class CSpell;
+class CArmedInstance;
 class IShipyard;
+struct CGPathNode;
+struct ObjectPosInfo;
 
 VCMI_LIB_NAMESPACE_END
 
-class CCallback;
-class CAdvMapInt;
-class CHeroWindow;
-enum class EMapAnimRedrawStatus;
-class CFadeAnimation;
+class CButton;
+class IImage;
+class CAnimImage;
+class CGStatusBar;
+class CAdvMapPanel;
+class CAdvMapWorldViewPanel;
+class CAnimation;
 
 struct MapDrawingInfo;
 
-/*****************************/
-
 enum class EAdvMapMode
 {
 	NORMAL,

+ 6 - 36
client/adventureMap/CAdvMapPanel.cpp

@@ -7,45 +7,15 @@
  * Full text of license available in license.txt file, in main folder
  *
  */
-#include "StdInc.h"
-#include "AdventureMapClasses.h"
-
-#include <SDL_timer.h>
 
-#include "MiscWidgets.h"
-#include "CComponent.h"
-#include "Images.h"
-
-#include "../CGameInfo.h"
-#include "../CMusicHandler.h"
-#include "../CPlayerInterface.h"
-#include "../mainmenu/CMainMenu.h"
+#include "StdInc.h"
+#include "CAdvMapPanel.h"
 
+#include "../widgets/Buttons.h"
+#include "../widgets/Images.h"
+#include "../render/CAnimation.h"
+#include "../render/IImage.h"
 #include "../gui/CGuiHandler.h"
-#include "../gui/SDL_PixelAccess.h"
-#include "../gui/CAnimation.h"
-
-#include "../windows/InfoWindows.h"
-#include "../windows/CAdvmapInterface.h"
-
-#include "../battle/BattleInterfaceClasses.h"
-#include "../battle/BattleInterface.h"
-
-#include "../../CCallback.h"
-#include "../../lib/StartInfo.h"
-#include "../../lib/CGameState.h"
-#include "../../lib/CGeneralTextHandler.h"
-#include "../../lib/CHeroHandler.h"
-#include "../../lib/CModHandler.h"
-#include "../../lib/CTownHandler.h"
-#include "../../lib/TerrainHandler.h"
-#include "../../lib/mapObjects/CGHeroInstance.h"
-#include "../../lib/mapping/CMap.h"
-#include "ClientCommandManager.h"
-
-#include <SDL_surface.h>
-#include <SDL_keyboard.h>
-#include <SDL_events.h>
 
 CAdvMapPanel::CAdvMapPanel(std::shared_ptr<IImage> bg, Point position)
 	: CIntObject()

+ 2 - 18
client/adventureMap/CAdvMapPanel.h

@@ -9,32 +9,16 @@
  */
 #pragma once
 
-#include "ObjectLists.h"
-#include "../../lib/FunctionList.h"
+#include "../gui/CIntObject.h"
 
 VCMI_LIB_NAMESPACE_BEGIN
-
-class CArmedInstance;
-class CGGarrison;
-class CGObjectInstance;
-class CGHeroInstance;
-class CGTownInstance;
-struct Component;
-struct InfoAboutArmy;
-struct InfoAboutHero;
-struct InfoAboutTown;
-
+class PlayerColor;
 VCMI_LIB_NAMESPACE_END
 
 class CAnimation;
 class CAnimImage;
-class CShowableAnim;
 class CFilledTexture;
 class CButton;
-class CComponent;
-class CHeroTooltip;
-class CTownTooltip;
-class CTextBox;
 class IImage;
 
 /// simple panel that contains other displayable elements; used to separate groups of controls

+ 4 - 70
client/adventureMap/CAdventureOptions.cpp

@@ -7,87 +7,21 @@
  * Full text of license available in license.txt file, in main folder
  *
  */
+
 #include "StdInc.h"
-#include "CAdvmapInterface.h"
+#include "CAdventureOptions.h"
 
-#include "CCastleInterface.h"
-#include "CHeroWindow.h"
-#include "CKingdomInterface.h"
-#include "CSpellWindow.h"
-#include "CTradeWindow.h"
-#include "GUIClasses.h"
-#include "InfoWindows.h"
+#include "CAdvMapInt.h"
 
-#include "../CBitmapHandler.h"
 #include "../CGameInfo.h"
-#include "../CMessage.h"
-#include "../CMusicHandler.h"
 #include "../CPlayerInterface.h"
-#include "../mainmenu/CMainMenu.h"
-#include "../lobby/CSelectionBase.h"
 #include "../lobby/CCampaignInfoScreen.h"
-#include "../lobby/CSavingScreen.h"
 #include "../lobby/CScenarioInfoScreen.h"
-#include "../Graphics.h"
-#include "../mapHandler.h"
-
-#include "../gui/CAnimation.h"
-#include "../gui/CursorHandler.h"
 #include "../gui/CGuiHandler.h"
-#include "../gui/SDL_Extensions.h"
-#include "../widgets/MiscWidgets.h"
+#include "../widgets/Buttons.h"
 
 #include "../../CCallback.h"
-
-#include "../../lib/CConfigHandler.h"
-#include "../../lib/CGameState.h"
-#include "../../lib/CGeneralTextHandler.h"
-#include "../../lib/CHeroHandler.h"
-#include "../../lib/CSoundBase.h"
-#include "../../lib/spells/CSpellHandler.h"
-#include "../../lib/CTownHandler.h"
-#include "../../lib/JsonNode.h"
-#include "../../lib/mapObjects/CGHeroInstance.h"
-#include "../../lib/mapping/CMap.h"
-#include "../../lib/UnlockGuard.h"
-#include "../../lib/VCMI_Lib.h"
 #include "../../lib/StartInfo.h"
-#include "../../lib/mapping/CMapInfo.h"
-#include "../../lib/TerrainHandler.h"
-
-#include <SDL_surface.h>
-#include <SDL_events.h>
-
-#define ADVOPT (conf.go()->ac)
-using namespace CSDL_Ext;
-
-std::shared_ptr<CAdvMapInt> adventureInt;
-
-static void setScrollingCursor(ui8 direction)
-{
-	if(direction & CAdvMapInt::RIGHT)
-	{
-		if(direction & CAdvMapInt::UP)
-			CCS->curh->set(Cursor::Map::SCROLL_NORTHEAST);
-		else if(direction & CAdvMapInt::DOWN)
-			CCS->curh->set(Cursor::Map::SCROLL_SOUTHEAST);
-		else
-			CCS->curh->set(Cursor::Map::SCROLL_EAST);
-	}
-	else if(direction & CAdvMapInt::LEFT)
-	{
-		if(direction & CAdvMapInt::UP)
-			CCS->curh->set(Cursor::Map::SCROLL_NORTHWEST);
-		else if(direction & CAdvMapInt::DOWN)
-			CCS->curh->set(Cursor::Map::SCROLL_SOUTHWEST);
-		else
-			CCS->curh->set(Cursor::Map::SCROLL_WEST);
-	}
-	else if(direction & CAdvMapInt::UP)
-		CCS->curh->set(Cursor::Map::SCROLL_NORTH);
-	else if(direction & CAdvMapInt::DOWN)
-		CCS->curh->set(Cursor::Map::SCROLL_SOUTH);
-}
 
 CAdventureOptions::CAdventureOptions()
 	: CWindowObject(PLAYER_COLORED, "ADVOPTS")

+ 2 - 26
client/adventureMap/CAdventureOptions.h

@@ -9,33 +9,9 @@
  */
 #pragma once
 
-#include "../widgets/AdventureMapClasses.h"
-#include "CWindowObject.h"
-
-#include "../widgets/TextControls.h"
-#include "../widgets/Buttons.h"
-
-#include "../../lib/spells/ViewSpellInt.h"
-
-VCMI_LIB_NAMESPACE_BEGIN
-
-struct CGPath;
-struct CGPathNode;
-class CGHeroInstance;
-class CGTownInstance;
-class CSpell;
-class IShipyard;
-
-VCMI_LIB_NAMESPACE_END
-
-class CCallback;
-class CAdvMapInt;
-class CHeroWindow;
-enum class EMapAnimRedrawStatus;
-class CFadeAnimation;
-
-struct MapDrawingInfo;
+#include "../windows/CWindowObject.h"
 
+class CButton;
 
 /// Adventure options dialog where you can view the world, dig, play the replay of the last turn,...
 class CAdventureOptions : public CWindowObject

+ 8 - 29
client/adventureMap/CInGameConsole.cpp

@@ -7,44 +7,23 @@
  * Full text of license available in license.txt file, in main folder
  *
  */
-#include "StdInc.h"
-#include "AdventureMapClasses.h"
-
-#include <SDL_timer.h>
 
-#include "MiscWidgets.h"
-#include "CComponent.h"
-#include "Images.h"
+#include "StdInc.h"
+#include "CInGameConsole.h"
 
+#include "../renderSDL/SDL_Extensions.h"
 #include "../CGameInfo.h"
 #include "../CMusicHandler.h"
 #include "../CPlayerInterface.h"
-#include "../mainmenu/CMainMenu.h"
-
 #include "../gui/CGuiHandler.h"
-#include "../gui/SDL_PixelAccess.h"
-#include "../gui/CAnimation.h"
-
-#include "../windows/InfoWindows.h"
-#include "../windows/CAdvmapInterface.h"
-
-#include "../battle/BattleInterfaceClasses.h"
-#include "../battle/BattleInterface.h"
+#include "../ClientCommandManager.h"
 
 #include "../../CCallback.h"
-#include "../../lib/StartInfo.h"
-#include "../../lib/CGameState.h"
+#include "../../lib/CConfigHandler.h"
 #include "../../lib/CGeneralTextHandler.h"
-#include "../../lib/CHeroHandler.h"
-#include "../../lib/CModHandler.h"
-#include "../../lib/CTownHandler.h"
-#include "../../lib/TerrainHandler.h"
-#include "../../lib/mapObjects/CGHeroInstance.h"
-#include "../../lib/mapping/CMap.h"
-#include "ClientCommandManager.h"
-
-#include <SDL_surface.h>
-#include <SDL_keyboard.h>
+#include "../../lib/mapObjects/CArmedInstance.h"
+
+#include <SDL_timer.h>
 #include <SDL_events.h>
 
 CInGameConsole::CInGameConsole()

+ 1 - 27
client/adventureMap/CInGameConsole.h

@@ -9,33 +9,7 @@
  */
 #pragma once
 
-#include "ObjectLists.h"
-#include "../../lib/FunctionList.h"
-
-VCMI_LIB_NAMESPACE_BEGIN
-
-class CArmedInstance;
-class CGGarrison;
-class CGObjectInstance;
-class CGHeroInstance;
-class CGTownInstance;
-struct Component;
-struct InfoAboutArmy;
-struct InfoAboutHero;
-struct InfoAboutTown;
-
-VCMI_LIB_NAMESPACE_END
-
-class CAnimation;
-class CAnimImage;
-class CShowableAnim;
-class CFilledTexture;
-class CButton;
-class CComponent;
-class CHeroTooltip;
-class CTownTooltip;
-class CTextBox;
-class IImage;
+#include "../gui/CIntObject.h"
 
 class CInGameConsole : public CIntObject
 {

+ 8 - 28
client/adventureMap/CInfoBar.cpp

@@ -7,45 +7,25 @@
  * Full text of license available in license.txt file, in main folder
  *
  */
-#include "StdInc.h"
-#include "AdventureMapClasses.h"
 
-#include <SDL_timer.h>
+#include "StdInc.h"
+#include "CInfoBar.h"
 
-#include "MiscWidgets.h"
-#include "CComponent.h"
-#include "Images.h"
+#include "CAdvMapInt.h"
 
+#include "../widgets/CComponent.h"
+#include "../widgets/Images.h"
+#include "../widgets/TextControls.h"
+#include "../widgets/MiscWidgets.h"
 #include "../CGameInfo.h"
 #include "../CMusicHandler.h"
 #include "../CPlayerInterface.h"
-#include "../mainmenu/CMainMenu.h"
-
 #include "../gui/CGuiHandler.h"
-#include "../gui/SDL_PixelAccess.h"
-#include "../gui/CAnimation.h"
-
-#include "../windows/InfoWindows.h"
-#include "../windows/CAdvmapInterface.h"
-
-#include "../battle/BattleInterfaceClasses.h"
-#include "../battle/BattleInterface.h"
 
 #include "../../CCallback.h"
-#include "../../lib/StartInfo.h"
-#include "../../lib/CGameState.h"
 #include "../../lib/CGeneralTextHandler.h"
-#include "../../lib/CHeroHandler.h"
-#include "../../lib/CModHandler.h"
-#include "../../lib/CTownHandler.h"
-#include "../../lib/TerrainHandler.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"
-#include "../../lib/mapping/CMap.h"
-#include "ClientCommandManager.h"
-
-#include <SDL_surface.h>
-#include <SDL_keyboard.h>
-#include <SDL_events.h>
+#include "../../lib/mapObjects/CGTownInstance.h"
 
 CInfoBar::CVisibleInfo::CVisibleInfo()
 	: CIntObject(0, Point(8, 12))

+ 3 - 12
client/adventureMap/CInfoBar.h

@@ -9,33 +9,24 @@
  */
 #pragma once
 
-#include "ObjectLists.h"
-#include "../../lib/FunctionList.h"
+#include "../gui/CIntObject.h"
 
 VCMI_LIB_NAMESPACE_BEGIN
 
-class CArmedInstance;
-class CGGarrison;
-class CGObjectInstance;
 class CGHeroInstance;
 class CGTownInstance;
 struct Component;
-struct InfoAboutArmy;
-struct InfoAboutHero;
-struct InfoAboutTown;
+class PlayerColor;
 
 VCMI_LIB_NAMESPACE_END
 
-class CAnimation;
 class CAnimImage;
 class CShowableAnim;
-class CFilledTexture;
-class CButton;
 class CComponent;
 class CHeroTooltip;
 class CTownTooltip;
+class CLabel;
 class CTextBox;
-class IImage;
 
 /// Info box which shows next week/day information, hold the current date
 class CInfoBar : public CIntObject

+ 7 - 28
client/adventureMap/CList.cpp

@@ -7,45 +7,24 @@
  * Full text of license available in license.txt file, in main folder
  *
  */
-#include "StdInc.h"
-#include "AdventureMapClasses.h"
 
-#include <SDL_timer.h>
+#include "StdInc.h"
+#include "CList.h"
 
-#include "MiscWidgets.h"
-#include "CComponent.h"
-#include "Images.h"
+#include "CAdvMapInt.h"
 
+#include "../widgets/Images.h"
+#include "../widgets/Buttons.h"
+#include "../windows/InfoWindows.h"
 #include "../CGameInfo.h"
-#include "../CMusicHandler.h"
 #include "../CPlayerInterface.h"
-#include "../mainmenu/CMainMenu.h"
-
 #include "../gui/CGuiHandler.h"
-#include "../gui/SDL_PixelAccess.h"
-#include "../gui/CAnimation.h"
 
-#include "../windows/InfoWindows.h"
-#include "../windows/CAdvmapInterface.h"
-
-#include "../battle/BattleInterfaceClasses.h"
-#include "../battle/BattleInterface.h"
-
-#include "../../CCallback.h"
-#include "../../lib/StartInfo.h"
-#include "../../lib/CGameState.h"
 #include "../../lib/CGeneralTextHandler.h"
 #include "../../lib/CHeroHandler.h"
 #include "../../lib/CModHandler.h"
-#include "../../lib/CTownHandler.h"
-#include "../../lib/TerrainHandler.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"
-#include "../../lib/mapping/CMap.h"
-#include "ClientCommandManager.h"
-
-#include <SDL_surface.h>
-#include <SDL_keyboard.h>
-#include <SDL_events.h>
+#include "../../lib/mapObjects/CGTownInstance.h"
 
 CList::CListItem::CListItem(CList * Parent)
 	: CIntObject(LCLICK | RCLICK | HOVER),

+ 3 - 17
client/adventureMap/CList.h

@@ -9,33 +9,19 @@
  */
 #pragma once
 
-#include "ObjectLists.h"
+#include "../gui/CIntObject.h"
+
+#include "../widgets/ObjectLists.h"
 #include "../../lib/FunctionList.h"
 
 VCMI_LIB_NAMESPACE_BEGIN
 
-class CArmedInstance;
-class CGGarrison;
-class CGObjectInstance;
 class CGHeroInstance;
 class CGTownInstance;
-struct Component;
-struct InfoAboutArmy;
-struct InfoAboutHero;
-struct InfoAboutTown;
 
 VCMI_LIB_NAMESPACE_END
 
-class CAnimation;
-class CAnimImage;
-class CShowableAnim;
-class CFilledTexture;
 class CButton;
-class CComponent;
-class CHeroTooltip;
-class CTownTooltip;
-class CTextBox;
-class IImage;
 
 /// Base UI Element for hero\town lists
 class CList : public CIntObject

+ 6 - 26
client/adventureMap/CMinimap.cpp

@@ -7,45 +7,25 @@
  * Full text of license available in license.txt file, in main folder
  *
  */
-#include "StdInc.h"
-#include "AdventureMapClasses.h"
 
-#include <SDL_timer.h>
+#include "StdInc.h"
+#include "CMinimap.h"
 
-#include "MiscWidgets.h"
-#include "CComponent.h"
-#include "Images.h"
+#include "CAdvMapInt.h"
 
+#include "../widgets/Images.h"
 #include "../CGameInfo.h"
-#include "../CMusicHandler.h"
 #include "../CPlayerInterface.h"
-#include "../mainmenu/CMainMenu.h"
-
 #include "../gui/CGuiHandler.h"
-#include "../gui/SDL_PixelAccess.h"
-#include "../gui/CAnimation.h"
-
-#include "../windows/InfoWindows.h"
-#include "../windows/CAdvmapInterface.h"
-
-#include "../battle/BattleInterfaceClasses.h"
-#include "../battle/BattleInterface.h"
+#include "../renderSDL/SDL_PixelAccess.h"
 
 #include "../../CCallback.h"
-#include "../../lib/StartInfo.h"
-#include "../../lib/CGameState.h"
 #include "../../lib/CGeneralTextHandler.h"
-#include "../../lib/CHeroHandler.h"
-#include "../../lib/CModHandler.h"
-#include "../../lib/CTownHandler.h"
 #include "../../lib/TerrainHandler.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"
-#include "../../lib/mapping/CMap.h"
-#include "ClientCommandManager.h"
+#include "../../lib/mapping/CMapDefines.h"
 
 #include <SDL_surface.h>
-#include <SDL_keyboard.h>
-#include <SDL_events.h>
 
 const SDL_Color & CMinimapInstance::getTileColor(const int3 & pos)
 {

+ 4 - 27
client/adventureMap/CMinimap.h

@@ -9,34 +9,11 @@
  */
 #pragma once
 
-#include "ObjectLists.h"
-#include "../../lib/FunctionList.h"
-
-VCMI_LIB_NAMESPACE_BEGIN
-
-class CArmedInstance;
-class CGGarrison;
-class CGObjectInstance;
-class CGHeroInstance;
-class CGTownInstance;
-struct Component;
-struct InfoAboutArmy;
-struct InfoAboutHero;
-struct InfoAboutTown;
-
-VCMI_LIB_NAMESPACE_END
-
-class CAnimation;
-class CAnimImage;
-class CShowableAnim;
-class CFilledTexture;
-class CButton;
-class CComponent;
-class CHeroTooltip;
-class CTownTooltip;
-class CTextBox;
-class IImage;
+#include "../gui/CIntObject.h"
+#include "../../lib/GameConstants.h"
 
+
+struct SDL_Color;
 class CMinimap;
 
 class CMinimapInstance : public CIntObject

+ 4 - 71
client/adventureMap/CResDataBar.cpp

@@ -8,86 +8,19 @@
  *
  */
 #include "StdInc.h"
-#include "CAdvmapInterface.h"
+#include "CResDataBar.h"
 
-#include "CCastleInterface.h"
-#include "CHeroWindow.h"
-#include "CKingdomInterface.h"
-#include "CSpellWindow.h"
-#include "CTradeWindow.h"
-#include "GUIClasses.h"
-#include "InfoWindows.h"
-
-#include "../CBitmapHandler.h"
 #include "../CGameInfo.h"
-#include "../CMessage.h"
-#include "../CMusicHandler.h"
 #include "../CPlayerInterface.h"
-#include "../mainmenu/CMainMenu.h"
-#include "../lobby/CSelectionBase.h"
-#include "../lobby/CCampaignInfoScreen.h"
-#include "../lobby/CSavingScreen.h"
-#include "../lobby/CScenarioInfoScreen.h"
-#include "../Graphics.h"
-#include "../mapHandler.h"
-
-#include "../gui/CAnimation.h"
-#include "../gui/CursorHandler.h"
+#include "../renderSDL/SDL_Extensions.h"
 #include "../gui/CGuiHandler.h"
-#include "../gui/SDL_Extensions.h"
-#include "../widgets/MiscWidgets.h"
+#include "../widgets/Images.h"
 
 #include "../../CCallback.h"
-
 #include "../../lib/CConfigHandler.h"
-#include "../../lib/CGameState.h"
 #include "../../lib/CGeneralTextHandler.h"
-#include "../../lib/CHeroHandler.h"
-#include "../../lib/CSoundBase.h"
-#include "../../lib/spells/CSpellHandler.h"
-#include "../../lib/CTownHandler.h"
-#include "../../lib/JsonNode.h"
-#include "../../lib/mapObjects/CGHeroInstance.h"
-#include "../../lib/mapping/CMap.h"
-#include "../../lib/UnlockGuard.h"
-#include "../../lib/VCMI_Lib.h"
-#include "../../lib/StartInfo.h"
-#include "../../lib/mapping/CMapInfo.h"
-#include "../../lib/TerrainHandler.h"
-
-#include <SDL_surface.h>
-#include <SDL_events.h>
 
 #define ADVOPT (conf.go()->ac)
-using namespace CSDL_Ext;
-
-std::shared_ptr<CAdvMapInt> adventureInt;
-
-static void setScrollingCursor(ui8 direction)
-{
-	if(direction & CAdvMapInt::RIGHT)
-	{
-		if(direction & CAdvMapInt::UP)
-			CCS->curh->set(Cursor::Map::SCROLL_NORTHEAST);
-		else if(direction & CAdvMapInt::DOWN)
-			CCS->curh->set(Cursor::Map::SCROLL_SOUTHEAST);
-		else
-			CCS->curh->set(Cursor::Map::SCROLL_EAST);
-	}
-	else if(direction & CAdvMapInt::LEFT)
-	{
-		if(direction & CAdvMapInt::UP)
-			CCS->curh->set(Cursor::Map::SCROLL_NORTHWEST);
-		else if(direction & CAdvMapInt::DOWN)
-			CCS->curh->set(Cursor::Map::SCROLL_SOUTHWEST);
-		else
-			CCS->curh->set(Cursor::Map::SCROLL_WEST);
-	}
-	else if(direction & CAdvMapInt::UP)
-		CCS->curh->set(Cursor::Map::SCROLL_NORTH);
-	else if(direction & CAdvMapInt::DOWN)
-		CCS->curh->set(Cursor::Map::SCROLL_SOUTH);
-}
 
 void CResDataBar::clickRight(tribool down, bool previousState)
 {
@@ -156,7 +89,7 @@ void CResDataBar::draw(SDL_Surface * to)
 	temp.push_back(boost::lexical_cast<std::string>(LOCPLINT->cb->getDate(Date::WEEK)));
 	temp.push_back(boost::lexical_cast<std::string>(LOCPLINT->cb->getDate(Date::DAY_OF_WEEK)));
 
-	graphics->fonts[FONT_SMALL]->renderTextLeft(to, processStr(datetext,temp), Colors::WHITE, Point(txtpos[7].first,txtpos[7].second));
+	graphics->fonts[FONT_SMALL]->renderTextLeft(to, CSDL_Ext::processStr(datetext,temp), Colors::WHITE, Point(txtpos[7].first,txtpos[7].second));
 }
 
 void CResDataBar::show(SDL_Surface * to)

+ 1 - 26
client/adventureMap/CResDataBar.h

@@ -9,32 +9,7 @@
  */
 #pragma once
 
-#include "../widgets/AdventureMapClasses.h"
-#include "CWindowObject.h"
-
-#include "../widgets/TextControls.h"
-#include "../widgets/Buttons.h"
-
-#include "../../lib/spells/ViewSpellInt.h"
-
-VCMI_LIB_NAMESPACE_BEGIN
-
-struct CGPath;
-struct CGPathNode;
-class CGHeroInstance;
-class CGTownInstance;
-class CSpell;
-class IShipyard;
-
-VCMI_LIB_NAMESPACE_END
-
-class CCallback;
-class CAdvMapInt;
-class CHeroWindow;
-enum class EMapAnimRedrawStatus;
-class CFadeAnimation;
-
-struct MapDrawingInfo;
+#include "../gui/CIntObject.h"
 
 /// Resources bar which shows information about how many gold, crystals,... you have
 /// Current date is displayed too

+ 15 - 72
client/adventureMap/CTerrainRect.cpp

@@ -8,86 +8,29 @@
  *
  */
 #include "StdInc.h"
-#include "CAdvmapInterface.h"
+#include "CTerrainRect.h"
 
-#include "CCastleInterface.h"
-#include "CHeroWindow.h"
-#include "CKingdomInterface.h"
-#include "CSpellWindow.h"
-#include "CTradeWindow.h"
-#include "GUIClasses.h"
-#include "InfoWindows.h"
+#include "mapHandler.h"
+#include "CAdvMapInt.h"
 
-#include "../CBitmapHandler.h"
 #include "../CGameInfo.h"
-#include "../CMessage.h"
-#include "../CMusicHandler.h"
 #include "../CPlayerInterface.h"
-#include "../mainmenu/CMainMenu.h"
-#include "../lobby/CSelectionBase.h"
-#include "../lobby/CCampaignInfoScreen.h"
-#include "../lobby/CSavingScreen.h"
-#include "../lobby/CScenarioInfoScreen.h"
-#include "../Graphics.h"
-#include "../mapHandler.h"
-
-#include "../gui/CAnimation.h"
 #include "../gui/CursorHandler.h"
 #include "../gui/CGuiHandler.h"
-#include "../gui/SDL_Extensions.h"
-#include "../widgets/MiscWidgets.h"
+#include "../render/CAnimation.h"
+#include "../render/CFadeAnimation.h"
+#include "../render/IImage.h"
+#include "../renderSDL/SDL_Extensions.h"
+#include "../widgets/TextControls.h"
 
 #include "../../CCallback.h"
-
 #include "../../lib/CConfigHandler.h"
-#include "../../lib/CGameState.h"
-#include "../../lib/CGeneralTextHandler.h"
-#include "../../lib/CHeroHandler.h"
-#include "../../lib/CSoundBase.h"
-#include "../../lib/spells/CSpellHandler.h"
-#include "../../lib/CTownHandler.h"
-#include "../../lib/JsonNode.h"
-#include "../../lib/mapObjects/CGHeroInstance.h"
 #include "../../lib/mapping/CMap.h"
-#include "../../lib/UnlockGuard.h"
-#include "../../lib/VCMI_Lib.h"
-#include "../../lib/StartInfo.h"
-#include "../../lib/mapping/CMapInfo.h"
-#include "../../lib/TerrainHandler.h"
+#include "../../lib/CPathfinder.h"
 
-#include <SDL_surface.h>
 #include <SDL_events.h>
 
 #define ADVOPT (conf.go()->ac)
-using namespace CSDL_Ext;
-
-std::shared_ptr<CAdvMapInt> adventureInt;
-
-static void setScrollingCursor(ui8 direction)
-{
-	if(direction & CAdvMapInt::RIGHT)
-	{
-		if(direction & CAdvMapInt::UP)
-			CCS->curh->set(Cursor::Map::SCROLL_NORTHEAST);
-		else if(direction & CAdvMapInt::DOWN)
-			CCS->curh->set(Cursor::Map::SCROLL_SOUTHEAST);
-		else
-			CCS->curh->set(Cursor::Map::SCROLL_EAST);
-	}
-	else if(direction & CAdvMapInt::LEFT)
-	{
-		if(direction & CAdvMapInt::UP)
-			CCS->curh->set(Cursor::Map::SCROLL_NORTHWEST);
-		else if(direction & CAdvMapInt::DOWN)
-			CCS->curh->set(Cursor::Map::SCROLL_SOUTHWEST);
-		else
-			CCS->curh->set(Cursor::Map::SCROLL_WEST);
-	}
-	else if(direction & CAdvMapInt::UP)
-		CCS->curh->set(Cursor::Map::SCROLL_NORTH);
-	else if(direction & CAdvMapInt::DOWN)
-		CCS->curh->set(Cursor::Map::SCROLL_SOUTH);
-}
 
 CTerrainRect::CTerrainRect()
 	: fadeSurface(nullptr),
@@ -334,17 +277,17 @@ void CTerrainRect::showPath(const Rect & extRect, SDL_Surface * to)
 				}
 				else if(hvx<0)
 				{
-					Rect srcRect = genRect(arrow->height() - hvy, arrow->width(), 0, 0);
+					Rect srcRect = CSDL_Ext::genRect(arrow->height() - hvy, arrow->width(), 0, 0);
 					arrow->draw(to, x + moveX, y + moveY, &srcRect);
 				}
 				else if (hvy<0)
 				{
-					Rect srcRect = genRect(arrow->height(), arrow->width() - hvx, 0, 0);
+					Rect srcRect = CSDL_Ext::genRect(arrow->height(), arrow->width() - hvx, 0, 0);
 					arrow->draw(to, x + moveX, y + moveY, &srcRect);
 				}
 				else
 				{
-					Rect srcRect = genRect(arrow->height() - hvy, arrow->width() - hvx, 0, 0);
+					Rect srcRect = CSDL_Ext::genRect(arrow->height() - hvy, arrow->width() - hvx, 0, 0);
 					arrow->draw(to, x + moveX, y + moveY, &srcRect);
 				}
 			}
@@ -356,17 +299,17 @@ void CTerrainRect::showPath(const Rect & extRect, SDL_Surface * to)
 				}
 				else if(hvx<0)
 				{
-					Rect srcRect = genRect(arrow->height() - hvy, arrow->width(), 0, 0);
+					Rect srcRect = CSDL_Ext::genRect(arrow->height() - hvy, arrow->width(), 0, 0);
 					arrow->draw(to, x, y, &srcRect);
 				}
 				else if (hvy<0)
 				{
-					Rect srcRect = genRect(arrow->height(), arrow->width() - hvx, 0, 0);
+					Rect srcRect = CSDL_Ext::genRect(arrow->height(), arrow->width() - hvx, 0, 0);
 					arrow->draw(to, x, y, &srcRect);
 				}
 				else
 				{
-					Rect srcRect = genRect(arrow->height() - hvy, arrow->width() - hvx, 0, 0);
+					Rect srcRect = CSDL_Ext::genRect(arrow->height() - hvy, arrow->width() - hvx, 0, 0);
 					arrow->draw(to, x, y, &srcRect);
 				}
 			}

+ 2 - 19
client/adventureMap/CTerrainRect.h

@@ -9,33 +9,16 @@
  */
 #pragma once
 
-#include "../widgets/AdventureMapClasses.h"
-#include "CWindowObject.h"
-
-#include "../widgets/TextControls.h"
-#include "../widgets/Buttons.h"
-
-#include "../../lib/spells/ViewSpellInt.h"
+#include "../gui/CIntObject.h"
+#include "../../lib/int3.h"
 
 VCMI_LIB_NAMESPACE_BEGIN
-
 struct CGPath;
-struct CGPathNode;
-class CGHeroInstance;
-class CGTownInstance;
-class CSpell;
-class IShipyard;
-
 VCMI_LIB_NAMESPACE_END
 
-class CCallback;
-class CAdvMapInt;
-class CHeroWindow;
 enum class EMapAnimRedrawStatus;
 class CFadeAnimation;
 
-struct MapDrawingInfo;
-
 /// Holds information about which tiles of the terrain are shown/not shown at the screen
 class CTerrainRect : public CIntObject
 {

+ 18 - 24
client/adventureMap/mapHandler.cpp

@@ -11,30 +11,24 @@
 #include "StdInc.h"
 #include "mapHandler.h"
 
-#include "CBitmapHandler.h"
-#include "gui/CAnimation.h"
-#include "gui/SDL_Extensions.h"
-#include "CGameInfo.h"
-#include "../lib/mapObjects/CGHeroInstance.h"
-#include "../lib/mapObjects/CObjectClassesHandler.h"
-#include "../lib/CGameState.h"
-#include "../lib/CHeroHandler.h"
-#include "../lib/CTownHandler.h"
-#include "../lib/CModHandler.h"
-#include "Graphics.h"
-#include "../lib/mapping/CMap.h"
-#include "../lib/CConfigHandler.h"
-#include "../lib/CGeneralTextHandler.h"
-#include "../lib/GameConstants.h"
-#include "../lib/CStopWatch.h"
-#include "CMT.h"
-#include "CMusicHandler.h"
-#include "../lib/CRandomGenerator.h"
-#include "../lib/RoadHandler.h"
-#include "../lib/RiverHandler.h"
-#include "../lib/TerrainHandler.h"
-#include "../lib/filesystem/ResourceID.h"
-#include "../lib/JsonDetail.h"
+#include "../render/CAnimation.h"
+#include "../render/CFadeAnimation.h"
+#include "../renderSDL/SDL_Extensions.h"
+#include "../CGameInfo.h"
+#include "../render/Graphics.h"
+#include "../render/IImage.h"
+#include "../CMusicHandler.h"
+
+#include "../../lib/mapObjects/CGHeroInstance.h"
+#include "../../lib/mapObjects/CObjectClassesHandler.h"
+#include "../../lib/mapping/CMap.h"
+#include "../../lib/CConfigHandler.h"
+#include "../../lib/CGeneralTextHandler.h"
+#include "../../lib/CStopWatch.h"
+#include "../../lib/CRandomGenerator.h"
+#include "../../lib/RoadHandler.h"
+#include "../../lib/RiverHandler.h"
+#include "../../lib/TerrainHandler.h"
 
 #define ADVOPT (conf.go()->ac)
 

+ 3 - 3
client/adventureMap/mapHandler.h

@@ -10,9 +10,9 @@
 #pragma once
 
 
-#include "../lib/int3.h"
-#include "../lib/spells/ViewSpellInt.h"
-#include "../lib/Rect.h"
+#include "../../lib/int3.h"
+#include "../../lib/spells/ViewSpellInt.h"
+#include "../../lib/Rect.h"
 
 #ifdef IN
 #undef IN

+ 2 - 2
client/battle/BattleEffectsController.cpp

@@ -21,8 +21,8 @@
 #include "../CMusicHandler.h"
 #include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
-#include "../gui/CAnimation.h"
-#include "../gui/Canvas.h"
+#include "../render/Canvas.h"
+#include "../render/CAnimation.h"
 
 #include "../../CCallback.h"
 #include "../../lib/battle/BattleAction.h"

+ 3 - 3
client/battle/BattleFieldController.cpp

@@ -22,11 +22,11 @@
 
 #include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
-#include "../widgets/AdventureMapClasses.h"
-#include "../gui/CAnimation.h"
-#include "../gui/Canvas.h"
+#include "../render/Canvas.h"
+#include "../render/IImage.h"
 #include "../gui/CGuiHandler.h"
 #include "../gui/CursorHandler.h"
+#include "../adventureMap/CInGameConsole.h"
 
 #include "../../CCallback.h"
 #include "../../lib/BattleFieldHandler.h"

+ 2 - 3
client/battle/BattleInterface.cpp

@@ -24,13 +24,12 @@
 #include "BattleRenderer.h"
 
 #include "../CGameInfo.h"
-#include "../CMessage.h"
 #include "../CMusicHandler.h"
 #include "../CPlayerInterface.h"
-#include "../gui/Canvas.h"
 #include "../gui/CursorHandler.h"
 #include "../gui/CGuiHandler.h"
-#include "../windows/CAdvmapInterface.h"
+#include "../render/Canvas.h"
+#include "../adventureMap/CAdvMapInt.h"
 
 #include "../../CCallback.h"
 #include "../../lib/CStack.h"

+ 5 - 5
client/battle/BattleInterfaceClasses.cpp

@@ -19,21 +19,21 @@
 #include "BattleWindow.h"
 
 #include "../CGameInfo.h"
-#include "../CMessage.h"
 #include "../CMusicHandler.h"
 #include "../CPlayerInterface.h"
 #include "../CVideoHandler.h"
-#include "../Graphics.h"
-#include "../gui/CAnimation.h"
-#include "../gui/Canvas.h"
 #include "../gui/CursorHandler.h"
 #include "../gui/CGuiHandler.h"
-#include "../widgets/AdventureMapClasses.h"
+#include "../render/Canvas.h"
+#include "../render/IImage.h"
 #include "../widgets/Buttons.h"
 #include "../widgets/Images.h"
 #include "../widgets/TextControls.h"
+#include "../windows/CMessage.h"
 #include "../windows/CCreatureWindow.h"
 #include "../windows/CSpellWindow.h"
+#include "../render/CAnimation.h"
+#include "../adventureMap/CInGameConsole.h"
 
 #include "../../CCallback.h"
 #include "../../lib/CStack.h"

+ 1 - 2
client/battle/BattleObstacleController.cpp

@@ -20,9 +20,8 @@
 #include "../CMusicHandler.h"
 #include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
-#include "../gui/CAnimation.h"
-#include "../gui/Canvas.h"
 #include "../gui/CGuiHandler.h"
+#include "../render/Canvas.h"
 
 #include "../../CCallback.h"
 #include "../../lib/battle/CObstacleInstance.h"

+ 1 - 2
client/battle/BattleProjectileController.cpp

@@ -15,8 +15,7 @@
 #include "BattleStacksController.h"
 #include "CreatureAnimation.h"
 
-#include "../gui/CAnimation.h"
-#include "../gui/Canvas.h"
+#include "../render/Canvas.h"
 #include "../gui/CGuiHandler.h"
 #include "../CGameInfo.h"
 

+ 2 - 2
client/battle/BattleSiegeController.cpp

@@ -20,8 +20,8 @@
 #include "../CMusicHandler.h"
 #include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
-#include "../gui/CAnimation.h"
-#include "../gui/Canvas.h"
+#include "../render/Canvas.h"
+#include "../render/IImage.h"
 
 #include "../../CCallback.h"
 #include "../../lib/NetPacks.h"

+ 3 - 4
client/battle/BattleStacksController.cpp

@@ -25,13 +25,12 @@
 #include "../CPlayerInterface.h"
 #include "../CMusicHandler.h"
 #include "../CGameInfo.h"
-#include "../gui/CAnimation.h"
 #include "../gui/CGuiHandler.h"
-#include "../gui/Canvas.h"
-#include "../gui/SDL_Extensions.h"
-#include "../../lib/spells/ISpellMechanics.h"
+#include "../renderSDL/SDL_Extensions.h"
+#include "../render/Canvas.h"
 
 #include "../../CCallback.h"
+#include "../../lib/spells/ISpellMechanics.h"
 #include "../../lib/battle/BattleHex.h"
 #include "../../lib/CGameState.h"
 #include "../../lib/CStack.h"

+ 1 - 1
client/battle/BattleStacksController.h

@@ -9,7 +9,7 @@
  */
 #pragma once
 
-#include "../gui/ColorFilter.h"
+#include "../render/ColorFilter.h"
 
 VCMI_LIB_NAMESPACE_BEGIN
 

+ 4 - 4
client/battle/BattleWindow.cpp

@@ -17,17 +17,17 @@
 #include "BattleActionsController.h"
 
 #include "../CGameInfo.h"
-#include "../CMessage.h"
 #include "../CPlayerInterface.h"
 #include "../CMusicHandler.h"
-#include "../gui/Canvas.h"
 #include "../gui/CursorHandler.h"
 #include "../gui/CGuiHandler.h"
-#include "../gui/CAnimation.h"
 #include "../windows/CSpellWindow.h"
-#include "../widgets/AdventureMapClasses.h"
 #include "../widgets/Buttons.h"
 #include "../widgets/Images.h"
+#include "../windows/CMessage.h"
+#include "../render/CAnimation.h"
+#include "../render/Canvas.h"
+#include "../adventureMap/CInGameConsole.h"
 
 #include "../../CCallback.h"
 #include "../../lib/CGeneralTextHandler.h"

+ 3 - 3
client/battle/CreatureAnimation.cpp

@@ -13,9 +13,9 @@
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/CCreatureHandler.h"
 
-#include "../gui/Canvas.h"
-#include "../gui/ColorFilter.h"
-#include "../gui/SDL_Extensions.h"
+#include "../render/Canvas.h"
+#include "../render/ColorFilter.h"
+#include "../renderSDL/SDL_Extensions.h"
 
 static const SDL_Color creatureBlueBorder = { 0, 255, 255, 255 };
 static const SDL_Color creatureGoldBorder = { 255, 255, 0, 255 };

+ 2 - 1
client/battle/CreatureAnimation.h

@@ -11,7 +11,8 @@
 
 #include "../../lib/FunctionList.h"
 #include "../widgets/Images.h"
-#include "../gui/CAnimation.h"
+#include "../render/CAnimation.h"
+#include "../render/IImage.h"
 
 #include <SDL_pixels.h>
 

+ 4 - 3
client/gui/CGuiHandler.cpp

@@ -13,15 +13,16 @@
 
 #include "CIntObject.h"
 #include "CursorHandler.h"
-#include "SDL_Extensions.h"
 
 #include "../CGameInfo.h"
-#include "../../lib/CThreadHelper.h"
-#include "../../lib/CConfigHandler.h"
+#include "../renderSDL/SDL_Extensions.h"
 #include "../CMT.h"
 #include "../CPlayerInterface.h"
 #include "../battle/BattleInterface.h"
 
+#include "../../lib/CThreadHelper.h"
+#include "../../lib/CConfigHandler.h"
+
 #include <SDL_render.h>
 #include <SDL_timer.h>
 #include <SDL_events.h>

+ 2 - 2
client/gui/CIntObject.cpp

@@ -11,8 +11,8 @@
 #include "CIntObject.h"
 
 #include "CGuiHandler.h"
-#include "SDL_Extensions.h"
-#include "../CMessage.h"
+#include "../renderSDL/SDL_Extensions.h"
+#include "../windows/CMessage.h"
 
 #include <SDL_pixels.h>
 #include <SDL_surface.h>

+ 1 - 1
client/gui/CIntObject.h

@@ -10,7 +10,7 @@
 #pragma once
 
 #include "../../lib/Rect.h"
-#include "../Graphics.h"
+#include "../render/Graphics.h"
 
 struct SDL_Surface;
 class CGuiHandler;

+ 7 - 2
client/gui/CursorHandler.cpp

@@ -11,9 +11,14 @@
 #include "StdInc.h"
 #include "CursorHandler.h"
 
-#include "SDL_Extensions.h"
 #include "CGuiHandler.h"
-#include "CAnimation.h"
+#include "../renderSDL/CursorSoftware.h"
+#include "../renderSDL/CursorHardware.h"
+#include "../render/CAnimation.h"
+#include "../render/IImage.h"
+#include "../renderSDL/SDL_Extensions.h"
+#include "../CMT.h"
+
 #include "../../lib/CConfigHandler.h"
 
 #include <SDL_render.h>

+ 4 - 6
client/gui/CursorHandler.h

@@ -9,14 +9,12 @@
  */
 #pragma once
 
-class CAnimation;
-class IImage;
-struct SDL_Surface;
-struct SDL_Texture;
-struct SDL_Cursor;
-
 #include "../../lib/Point.h"
 
+class ICursor;
+class IImage;
+class CAnimation;
+
 namespace Cursor
 {
 	enum class Type {

+ 0 - 1
client/gui/InterfaceObjectConfigurable.cpp

@@ -14,7 +14,6 @@
 
 #include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
-#include "../gui/CAnimation.h"
 #include "../gui/CGuiHandler.h"
 #include "../widgets/CComponent.h"
 #include "../widgets/Buttons.h"

+ 3 - 3
client/lobby/CBonusSelection.cpp

@@ -17,13 +17,10 @@
 #include "CSelectionBase.h"
 
 #include "../CGameInfo.h"
-#include "../CMessage.h"
 #include "../CMusicHandler.h"
 #include "../CVideoHandler.h"
 #include "../CPlayerInterface.h"
 #include "../CServerHandler.h"
-#include "../gui/CAnimation.h"
-#include "../gui/CGuiHandler.h"
 #include "../mainmenu/CMainMenu.h"
 #include "../mainmenu/CPrologEpilogVideo.h"
 #include "../widgets/CComponent.h"
@@ -33,6 +30,9 @@
 #include "../widgets/TextControls.h"
 #include "../windows/GUIClasses.h"
 #include "../windows/InfoWindows.h"
+#include "../render/IImage.h"
+#include "../render/CAnimation.h"
+#include "../gui/CGuiHandler.h"
 
 #include "../../lib/filesystem/Filesystem.h"
 #include "../../lib/CGeneralTextHandler.h"

+ 0 - 2
client/lobby/CCampaignInfoScreen.cpp

@@ -15,10 +15,8 @@
 #include "../../lib/CGeneralTextHandler.h"
 #include "../../lib/StartInfo.h"
 #include "../../lib/mapping/CMapInfo.h"
-#include "../gui/CAnimation.h"
 #include "../gui/CGuiHandler.h"
 #include "../CGameInfo.h"
-#include "../CMessage.h"
 #include "../CPlayerInterface.h"
 
 CCampaignInfoScreen::CCampaignInfoScreen()

+ 1 - 2
client/lobby/CSelectionBase.cpp

@@ -20,12 +20,10 @@
 
 #include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
-#include "../CMessage.h"
 #include "../CMusicHandler.h"
 #include "../CVideoHandler.h"
 #include "../CPlayerInterface.h"
 #include "../CServerHandler.h"
-#include "../gui/CAnimation.h"
 #include "../gui/CGuiHandler.h"
 #include "../mainmenu/CMainMenu.h"
 #include "../widgets/CComponent.h"
@@ -35,6 +33,7 @@
 #include "../widgets/TextControls.h"
 #include "../windows/GUIClasses.h"
 #include "../windows/InfoWindows.h"
+#include "../render/CAnimation.h"
 
 #include "../../lib/NetPacksLobby.h"
 #include "../../lib/CGeneralTextHandler.h"

+ 0 - 1
client/lobby/OptionsTab.cpp

@@ -14,7 +14,6 @@
 
 #include "../CGameInfo.h"
 #include "../CServerHandler.h"
-#include "../gui/CAnimation.h"
 #include "../gui/CGuiHandler.h"
 #include "../widgets/CComponent.h"
 #include "../widgets/Buttons.h"

+ 0 - 1
client/lobby/RandomMapTab.cpp

@@ -14,7 +14,6 @@
 
 #include "../CGameInfo.h"
 #include "../CServerHandler.h"
-#include "../gui/CAnimation.h"
 #include "../gui/CGuiHandler.h"
 #include "../widgets/CComponent.h"
 #include "../widgets/Buttons.h"

+ 1 - 2
client/lobby/SelectionTab.cpp

@@ -14,10 +14,8 @@
 #include "CLobbyScreen.h"
 
 #include "../CGameInfo.h"
-#include "../CMessage.h"
 #include "../CPlayerInterface.h"
 #include "../CServerHandler.h"
-#include "../gui/CAnimation.h"
 #include "../gui/CGuiHandler.h"
 #include "../widgets/CComponent.h"
 #include "../widgets/Buttons.h"
@@ -26,6 +24,7 @@
 #include "../widgets/TextControls.h"
 #include "../windows/GUIClasses.h"
 #include "../windows/InfoWindows.h"
+#include "../render/CAnimation.h"
 
 #include "../../CCallback.h"
 

+ 0 - 2
client/mainmenu/CCampaignScreen.cpp

@@ -14,12 +14,10 @@
 #include "CMainMenu.h"
 
 #include "../CGameInfo.h"
-#include "../CMessage.h"
 #include "../CMusicHandler.h"
 #include "../CVideoHandler.h"
 #include "../CPlayerInterface.h"
 #include "../CServerHandler.h"
-#include "../gui/CAnimation.h"
 #include "../gui/CGuiHandler.h"
 #include "../widgets/CComponent.h"
 #include "../widgets/Buttons.h"

+ 0 - 4
client/mainmenu/CMainMenu.cpp

@@ -20,7 +20,6 @@
 #include "../../lib/filesystem/Filesystem.h"
 #include "../../lib/filesystem/CCompressedStream.h"
 
-#include "../gui/SDL_Extensions.h"
 #include "../gui/CursorHandler.h"
 
 #include "../CGameInfo.h"
@@ -28,7 +27,6 @@
 #include "../../lib/JsonNode.h"
 #include "../CMusicHandler.h"
 #include "../CVideoHandler.h"
-#include "../Graphics.h"
 #include "../../lib/serializer/Connection.h"
 #include "../../lib/serializer/CTypeList.h"
 #include "../../lib/VCMIDirs.h"
@@ -36,10 +34,8 @@
 #include "../windows/GUIClasses.h"
 #include "../CPlayerInterface.h"
 #include "../../CCallback.h"
-#include "../CMessage.h"
 #include "../Client.h"
 #include "../gui/CGuiHandler.h"
-#include "../gui/CAnimation.h"
 #include "../widgets/CComponent.h"
 #include "../widgets/Buttons.h"
 #include "../widgets/MiscWidgets.h"

+ 3 - 10
client/render/CAnimation.cpp

@@ -10,19 +10,12 @@
 #include "StdInc.h"
 #include "CAnimation.h"
 
-#include "SDL_Extensions.h"
-#include "ColorFilter.h"
-
-#include "../CBitmapHandler.h"
-#include "../Graphics.h"
+#include "CDefFile.h"
 
+#include "Graphics.h"
 #include "../../lib/filesystem/Filesystem.h"
-#include "../../lib/filesystem/ISimpleResourceLoader.h"
 #include "../../lib/JsonNode.h"
-#include "../../lib/CRandomGenerator.h"
-#include "../../lib/vcmi_endian.h"
-
-#include <SDL_surface.h>
+#include "../renderSDL/SDLImage.h"
 
 std::shared_ptr<IImage> CAnimation::getFromExtraDef(std::string filename)
 {

+ 1 - 15
client/render/CAnimation.h

@@ -11,26 +11,12 @@
 
 #include "../../lib/GameConstants.h"
 
-#ifdef IN
-#undef IN
-#endif
-
-#ifdef OUT
-#undef OUT
-#endif
-
 VCMI_LIB_NAMESPACE_BEGIN
-
 class JsonNode;
-class Rect;
-class Point;
-
 VCMI_LIB_NAMESPACE_END
 
-struct SDL_Surface;
-struct SDL_Color;
 class CDefFile;
-class ColorFilter;
+class IImage;
 
 /// Class for handling animation
 class CAnimation

+ 5 - 3
client/render/CBitmapHandler.cpp

@@ -8,13 +8,15 @@
  *
  */
 #include "StdInc.h"
+#include "CBitmapHandler.h"
+
+#include "../renderSDL/SDL_Extensions.h"
 
 #include "../lib/filesystem/Filesystem.h"
-#include <SDL_image.h>
-#include "CBitmapHandler.h"
-#include "gui/SDL_Extensions.h"
 #include "../lib/vcmi_endian.h"
 
+#include <SDL_image.h>
+
 namespace BitmapHandler
 {
 	SDL_Surface * loadH3PCX(ui8 * data, size_t size);

+ 17 - 24
client/render/CDefFile.cpp

@@ -7,22 +7,16 @@
  * Full text of license available in license.txt file, in main folder
  *
  */
-#include "StdInc.h"
-#include "CAnimation.h"
 
-#include "SDL_Extensions.h"
-#include "ColorFilter.h"
+#include "StdInc.h"
+#include "CDefFile.h"
 
-#include "../CBitmapHandler.h"
-#include "../Graphics.h"
+#include "IImageLoader.h"
 
 #include "../../lib/filesystem/Filesystem.h"
-#include "../../lib/filesystem/ISimpleResourceLoader.h"
-#include "../../lib/JsonNode.h"
-#include "../../lib/CRandomGenerator.h"
-#include "../../lib/vcmi_endian.h"
+#include "../../lib/Point.h"
 
-#include <SDL_surface.h>
+#include <SDL_pixels.h>
 
 // Extremely simple file cache. TODO: smarter, more general solution
 class CFileCache
@@ -203,8 +197,7 @@ CDefFile::CDefFile(std::string Name):
 	}
 }
 
-template<class ImageLoader>
-void CDefFile::loadFrame(size_t frame, size_t group, ImageLoader &loader) const
+void CDefFile::loadFrame(size_t frame, size_t group, IImageLoader &loader) const
 {
 	std::map<size_t, std::vector <size_t> >::const_iterator it;
 	it = offset.find(group);
@@ -250,9 +243,9 @@ void CDefFile::loadFrame(size_t frame, size_t group, ImageLoader &loader) const
 			//pixel data is not compressed, copy data to surface
 			for(ui32 i=0; i<sprite.height; i++)
 			{
-				loader.Load(sprite.width, FDef + currentOffset);
+				loader.load(sprite.width, FDef + currentOffset);
 				currentOffset += sprite.width;
-				loader.EndLine();
+				loader.endLine();
 			}
 			break;
 		}
@@ -275,17 +268,17 @@ void CDefFile::loadFrame(size_t frame, size_t group, ImageLoader &loader) const
 
 					if(segmentType==0xFF)//Raw data
 					{
-						loader.Load(length, FDef + currentOffset);
+						loader.load(length, FDef + currentOffset);
 						currentOffset+=length;
 					}
 					else// RLE
 					{
-						loader.Load(length, segmentType);
+						loader.load(length, segmentType);
 					}
 					TotalRowLength += length;
 				}
 
-				loader.EndLine();
+				loader.endLine();
 			}
 			break;
 		}
@@ -305,16 +298,16 @@ void CDefFile::loadFrame(size_t frame, size_t group, ImageLoader &loader) const
 
 					if(code==7)//Raw data
 					{
-						loader.Load(length, FDef + currentOffset);
+						loader.load(length, FDef + currentOffset);
 						currentOffset += length;
 					}
 					else//RLE
 					{
-						loader.Load(length, code);
+						loader.load(length, code);
 					}
 					TotalRowLength+=length;
 				}
-				loader.EndLine();
+				loader.endLine();
 			}
 			break;
 		}
@@ -333,16 +326,16 @@ void CDefFile::loadFrame(size_t frame, size_t group, ImageLoader &loader) const
 
 					if(code==7)//Raw data
 					{
-						loader.Load(length, FDef + currentOffset);
+						loader.load(length, FDef + currentOffset);
 						currentOffset += length;
 					}
 					else//RLE
 					{
-						loader.Load(length, code);
+						loader.load(length, code);
 					}
 					TotalRowLength += length;
 				}
-				loader.EndLine();
+				loader.endLine();
 			}
 			break;
 		}

+ 3 - 23
client/render/CDefFile.h

@@ -9,29 +9,10 @@
  */
 #pragma once
 
-#include "../../lib/GameConstants.h"
+#include "../../lib/vcmi_endian.h"
 
-#ifdef IN
-#undef IN
-#endif
-
-#ifdef OUT
-#undef OUT
-#endif
-
-VCMI_LIB_NAMESPACE_BEGIN
-
-class JsonNode;
-class Rect;
-class Point;
-
-VCMI_LIB_NAMESPACE_END
-
-struct SDL_Surface;
+class IImageLoader;
 struct SDL_Color;
-class CDefFile;
-class ColorFilter;
-
 
 /// Class for def loading
 /// After loading will store general info (palette and frame offsets) and pointer to file itself
@@ -62,8 +43,7 @@ public:
 	~CDefFile();
 
 	//load frame as SDL_Surface
-	template<class ImageLoader>
-	void loadFrame(size_t frame, size_t group, ImageLoader &loader) const;
+	void loadFrame(size_t frame, size_t group, IImageLoader &loader) const;
 
 	const std::map<size_t, size_t> getEntries() const;
 };

+ 2 - 12
client/render/CFadeAnimation.cpp

@@ -8,19 +8,9 @@
  *
  */
 #include "StdInc.h"
-#include "CAnimation.h"
+#include "CFadeAnimation.h"
 
-#include "SDL_Extensions.h"
-#include "ColorFilter.h"
-
-#include "../CBitmapHandler.h"
-#include "../Graphics.h"
-
-#include "../../lib/filesystem/Filesystem.h"
-#include "../../lib/filesystem/ISimpleResourceLoader.h"
-#include "../../lib/JsonNode.h"
-#include "../../lib/CRandomGenerator.h"
-#include "../../lib/vcmi_endian.h"
+#include "../renderSDL/SDL_Extensions.h"
 
 #include <SDL_surface.h>
 

+ 0 - 9
client/render/CFadeAnimation.h

@@ -9,8 +9,6 @@
  */
 #pragma once
 
-#include "../../lib/GameConstants.h"
-
 #ifdef IN
 #undef IN
 #endif
@@ -20,17 +18,10 @@
 #endif
 
 VCMI_LIB_NAMESPACE_BEGIN
-
-class JsonNode;
-class Rect;
 class Point;
-
 VCMI_LIB_NAMESPACE_END
 
 struct SDL_Surface;
-struct SDL_Color;
-class CDefFile;
-class ColorFilter;
 
 const float DEFAULT_DELTA = 0.05f;
 

+ 3 - 4
client/render/Canvas.cpp

@@ -10,10 +10,9 @@
 #include "StdInc.h"
 #include "Canvas.h"
 
-#include "SDL_Extensions.h"
-#include "CAnimation.h"
-
-#include "../Graphics.h"
+#include "../renderSDL/SDL_Extensions.h"
+#include "IImage.h"
+#include "Graphics.h"
 
 #include <SDL_surface.h>
 

+ 1 - 1
client/render/Canvas.h

@@ -9,7 +9,7 @@
  */
 #pragma once
 
-#include "TextAlignment.h"
+#include "../gui/TextAlignment.h"
 #include "../../lib/Rect.h"
 #include "../../lib/Color.h"
 

+ 7 - 3
client/render/Graphics.cpp

@@ -18,11 +18,15 @@
 #include <vcmi/SkillService.h>
 #include <vcmi/spells/Service.h>
 
+#include "../renderSDL/SDL_Extensions.h"
+#include "../renderSDL/CBitmapFont.h"
+#include "../renderSDL/CBitmapHanFont.h"
+#include "../renderSDL/CTrueTypeFont.h"
+#include "../render/CAnimation.h"
+#include "../render/IImage.h"
+
 #include "../lib/filesystem/Filesystem.h"
 #include "../lib/filesystem/CBinaryReader.h"
-#include "gui/SDL_Extensions.h"
-#include "gui/CAnimation.h"
-#include "../lib/CThreadHelper.h"
 #include "../lib/CModHandler.h"
 #include "CGameInfo.h"
 #include "../lib/VCMI_Lib.h"

+ 2 - 1
client/render/Graphics.h

@@ -9,7 +9,7 @@
  */
 #pragma once
 
-#include "gui/Fonts.h"
+#include "IFont.h"
 #include "../lib/GameConstants.h"
 
 VCMI_LIB_NAMESPACE_BEGIN
@@ -22,6 +22,7 @@ struct InfoAboutTown;
 class CGObjectInstance;
 class ObjectTemplate;
 class EntityService;
+class JsonNode;
 
 VCMI_LIB_NAMESPACE_END
 

+ 4 - 6
client/render/ICursor.h

@@ -9,13 +9,11 @@
  */
 #pragma once
 
-class CAnimation;
-class IImage;
-struct SDL_Surface;
-struct SDL_Texture;
-struct SDL_Cursor;
+VCMI_LIB_NAMESPACE_BEGIN
+class Point;
+VCMI_LIB_NAMESPACE_END
 
-#include "../../lib/Point.h"
+class IImage;
 
 class ICursor
 {

+ 4 - 7
client/render/IFont.cpp

@@ -7,16 +7,13 @@
  * Full text of license available in license.txt file, in main folder
  *
  */
-#include "StdInc.h"
-#include "Fonts.h"
 
-#include <SDL_ttf.h>
+#include "StdInc.h"
+#include "IFont.h"
 
-#include "SDL_Extensions.h"
-#include "../../lib/JsonNode.h"
-#include "../../lib/vcmi_endian.h"
-#include "../../lib/filesystem/Filesystem.h"
+#include "../../lib/Point.h"
 #include "../../lib/CGeneralTextHandler.h"
+//
 
 size_t IFont::getStringWidth(const std::string & data) const
 {

+ 0 - 6
client/render/IFont.h

@@ -11,7 +11,6 @@
 
 VCMI_LIB_NAMESPACE_BEGIN
 
-class JsonNode;
 class Point;
 
 VCMI_LIB_NAMESPACE_END
@@ -19,11 +18,6 @@ VCMI_LIB_NAMESPACE_END
 struct SDL_Surface;
 struct SDL_Color;
 
-typedef struct _TTF_Font TTF_Font;
-
-class CBitmapFont;
-class CBitmapHanFont;
-
 class IFont
 {
 protected:

+ 1 - 12
client/render/IImage.h

@@ -9,19 +9,9 @@
  */
 #pragma once
 
-#include "../../lib/GameConstants.h"
-
-#ifdef IN
-#undef IN
-#endif
-
-#ifdef OUT
-#undef OUT
-#endif
-
 VCMI_LIB_NAMESPACE_BEGIN
 
-class JsonNode;
+class PlayerColor;
 class Rect;
 class Point;
 
@@ -29,7 +19,6 @@ VCMI_LIB_NAMESPACE_END
 
 struct SDL_Surface;
 struct SDL_Color;
-class CDefFile;
 class ColorFilter;
 
 /*

+ 31 - 0
client/render/IImageLoader.h

@@ -0,0 +1,31 @@
+/*
+ * IImageLoader.h, part of VCMI engine
+ *
+ * Authors: listed in file AUTHORS in main folder
+ *
+ * License: GNU General Public License v2.0 or later
+ * Full text of license available in license.txt file, in main folder
+ *
+ */
+
+#pragma once
+
+class SDLImage;
+class Point;
+
+struct SDL_Color;
+
+class IImageLoader
+{
+public:
+	//load size raw pixels from data
+	virtual void load(size_t size, const ui8 * data) = 0;
+	//set size pixels to color
+	virtual void load(size_t size, ui8 color=0) = 0;
+
+	virtual void endLine() = 0;
+	//init image with these sizes and palette
+	virtual void init(Point SpriteSize, Point Margins, Point FullSize, SDL_Color *pal) = 0;
+
+	virtual ~IImageLoader() = default;
+};

+ 5 - 4
client/renderSDL/CBitmapFont.cpp

@@ -8,15 +8,16 @@
  *
  */
 #include "StdInc.h"
-#include "Fonts.h"
-
-#include <SDL_ttf.h>
+#include "CBitmapFont.h"
 
 #include "SDL_Extensions.h"
-#include "../../lib/JsonNode.h"
+
 #include "../../lib/vcmi_endian.h"
 #include "../../lib/filesystem/Filesystem.h"
 #include "../../lib/CGeneralTextHandler.h"
+#include "../../lib/Rect.h"
+
+#include <SDL_surface.h>
 
 std::array<CBitmapFont::BitmapChar, CBitmapFont::totalChars> CBitmapFont::loadChars() const
 {

+ 1 - 14
client/renderSDL/CBitmapFont.h

@@ -9,20 +9,7 @@
  */
 #pragma once
 
-VCMI_LIB_NAMESPACE_BEGIN
-
-class JsonNode;
-class Point;
-
-VCMI_LIB_NAMESPACE_END
-
-struct SDL_Surface;
-struct SDL_Color;
-
-typedef struct _TTF_Font TTF_Font;
-
-class CBitmapFont;
-class CBitmapHanFont;
+#include "../render/IFont.h"
 
 class CBitmapFont : public IFont
 {

+ 6 - 4
client/renderSDL/CBitmapHanFont.cpp

@@ -8,15 +8,17 @@
  *
  */
 #include "StdInc.h"
-#include "Fonts.h"
-
-#include <SDL_ttf.h>
+#include "CBitmapHanFont.h"
 
+#include "CBitmapFont.h"
 #include "SDL_Extensions.h"
+
 #include "../../lib/JsonNode.h"
-#include "../../lib/vcmi_endian.h"
 #include "../../lib/filesystem/Filesystem.h"
 #include "../../lib/CGeneralTextHandler.h"
+#include "../../lib/Rect.h"
+
+#include <SDL_surface.h>
 
 size_t CBitmapHanFont::getCharacterDataOffset(size_t index) const
 {

+ 2 - 29
client/renderSDL/CBitmapHanFont.h

@@ -9,20 +9,13 @@
  */
 #pragma once
 
-VCMI_LIB_NAMESPACE_BEGIN
+#include "../render/IFont.h"
 
+VCMI_LIB_NAMESPACE_BEGIN
 class JsonNode;
-class Point;
-
 VCMI_LIB_NAMESPACE_END
 
-struct SDL_Surface;
-struct SDL_Color;
-
-typedef struct _TTF_Font TTF_Font;
-
 class CBitmapFont;
-class CBitmapHanFont;
 
 /// supports multi-byte characters for such languages like Chinese
 class CBitmapHanFont : public IFont
@@ -45,23 +38,3 @@ public:
 	size_t getLineHeight() const override;
 	size_t getGlyphWidth(const char * data) const override;
 };
-
-class CTrueTypeFont : public IFont
-{
-	const std::pair<std::unique_ptr<ui8[]>, ui64> data;
-
-	const std::unique_ptr<TTF_Font, void (*)(TTF_Font*)> font;
-	const bool blended;
-
-	std::pair<std::unique_ptr<ui8[]>, ui64> loadData(const JsonNode & config);
-	TTF_Font * loadFont(const JsonNode & config);
-	int getFontStyle(const JsonNode & config);
-
-	void renderText(SDL_Surface * surface, const std::string & data, const SDL_Color & color, const Point & pos) const override;
-public:
-	CTrueTypeFont(const JsonNode & fontConfig);
-
-	size_t getLineHeight() const override;
-	size_t getGlyphWidth(const char * data) const override;
-	size_t getStringWidth(const std::string & data) const override;
-};

+ 11 - 5
client/renderSDL/CTrueTypeFont.cpp

@@ -8,15 +8,21 @@
  *
  */
 #include "StdInc.h"
-#include "Fonts.h"
-
-#include <SDL_ttf.h>
+#include "CTrueTypeFont.h"
 
 #include "SDL_Extensions.h"
+
 #include "../../lib/JsonNode.h"
-#include "../../lib/vcmi_endian.h"
-#include "../../lib/filesystem/Filesystem.h"
 #include "../../lib/CGeneralTextHandler.h"
+#include "../../lib/filesystem/Filesystem.h"
+
+#include <SDL_ttf.h>
+
+std::pair<std::unique_ptr<ui8[]>, ui64> CTrueTypeFont::loadData(const JsonNode & config)
+{
+	std::string filename = "Data/" + config["file"].String();
+	return CResourceHandler::get()->load(ResourceID(filename, EResType::TTF_FONT))->readAll();
+}
 
 TTF_Font * CTrueTypeFont::loadFont(const JsonNode &config)
 {

+ 2 - 9
client/renderSDL/CTrueTypeFont.h

@@ -9,21 +9,14 @@
  */
 #pragma once
 
-VCMI_LIB_NAMESPACE_BEGIN
+#include "../render/IFont.h"
 
+VCMI_LIB_NAMESPACE_BEGIN
 class JsonNode;
-class Point;
-
 VCMI_LIB_NAMESPACE_END
 
-struct SDL_Surface;
-struct SDL_Color;
-
 typedef struct _TTF_Font TTF_Font;
 
-class CBitmapFont;
-class CBitmapHanFont;
-
 class CTrueTypeFont : public IFont
 {
 	const std::pair<std::unique_ptr<ui8[]>, ui64> data;

+ 2 - 4
client/renderSDL/CursorHardware.cpp

@@ -9,12 +9,10 @@
  */
 
 #include "StdInc.h"
-#include "CursorHandler.h"
+#include "CursorHardware.h"
 
 #include "SDL_Extensions.h"
-#include "CGuiHandler.h"
-#include "CAnimation.h"
-#include "../../lib/CConfigHandler.h"
+#include "../render/IImage.h"
 
 #include <SDL_render.h>
 #include <SDL_events.h>

+ 1 - 0
client/renderSDL/CursorHardware.h

@@ -16,6 +16,7 @@ struct SDL_Texture;
 struct SDL_Cursor;
 
 #include "../../lib/Point.h"
+#include "../render/ICursor.h"
 
 class CursorHardware : public ICursor
 {

+ 3 - 8
client/renderSDL/CursorSoftware.cpp

@@ -9,20 +9,15 @@
  */
 
 #include "StdInc.h"
-#include "CursorHandler.h"
+#include "CursorSoftware.h"
 
 #include "SDL_Extensions.h"
-#include "CGuiHandler.h"
-#include "CAnimation.h"
-#include "../../lib/CConfigHandler.h"
+
+#include "../render/IImage.h"
 
 #include <SDL_render.h>
 #include <SDL_events.h>
 
-#ifdef VCMI_APPLE
-#include <dispatch/dispatch.h>
-#endif
-
 void CursorSoftware::render()
 {
 	//texture must be updated in the main (renderer) thread, but changes to cursor type may come from other threads

+ 1 - 0
client/renderSDL/CursorSoftware.h

@@ -16,6 +16,7 @@ struct SDL_Texture;
 struct SDL_Cursor;
 
 #include "../../lib/Point.h"
+#include "../render/ICursor.h"
 
 class CursorSoftware : public ICursor
 {

+ 6 - 8
client/renderSDL/SDLImage.cpp

@@ -8,19 +8,17 @@
  *
  */
 #include "StdInc.h"
-#include "CAnimation.h"
+#include "SDLImage.h"
 
+#include "SDLImageLoader.h"
 #include "SDL_Extensions.h"
-#include "ColorFilter.h"
 
-#include "../CBitmapHandler.h"
-#include "../Graphics.h"
+#include "../render/ColorFilter.h"
+#include "../render/CBitmapHandler.h"
+#include "../render/CDefFile.h"
+#include "../render/Graphics.h"
 
-#include "../../lib/filesystem/Filesystem.h"
-#include "../../lib/filesystem/ISimpleResourceLoader.h"
 #include "../../lib/JsonNode.h"
-#include "../../lib/CRandomGenerator.h"
-#include "../../lib/vcmi_endian.h"
 
 #include <SDL_surface.h>
 

+ 5 - 16
client/renderSDL/SDLImage.h

@@ -9,28 +9,17 @@
  */
 #pragma once
 
-#include "../../lib/GameConstants.h"
-
-#ifdef IN
-#undef IN
-#endif
-
-#ifdef OUT
-#undef OUT
-#endif
+#include "../render/IImage.h"
+#include "../../lib/Point.h"
 
 VCMI_LIB_NAMESPACE_BEGIN
-
 class JsonNode;
-class Rect;
-class Point;
-
 VCMI_LIB_NAMESPACE_END
 
-struct SDL_Surface;
-struct SDL_Color;
 class CDefFile;
-class ColorFilter;
+
+struct SDL_Surface;
+struct SDL_Palette;
 
 /*
  * Wrapper around SDL_Surface

+ 7 - 18
client/renderSDL/SDLImageLoader.cpp

@@ -7,27 +7,16 @@
  * Full text of license available in license.txt file, in main folder
  *
  */
-#include "StdInc.h"
-#include "CAnimation.h"
 
-#include "SDL_Extensions.h"
-#include "ColorFilter.h"
+#include "StdInc.h"
+#include "SDLImageLoader.h"
 
-#include "../CBitmapHandler.h"
-#include "../Graphics.h"
+#include "SDLImage.h"
 
-#include "../../lib/filesystem/Filesystem.h"
-#include "../../lib/filesystem/ISimpleResourceLoader.h"
-#include "../../lib/JsonNode.h"
-#include "../../lib/CRandomGenerator.h"
-#include "../../lib/vcmi_endian.h"
+#include "../../lib/Point.h"
 
 #include <SDL_surface.h>
 
-/*************************************************************************
- *  Classes for image loaders - helpers for loading from def files       *
- *************************************************************************/
-
 SDLImageLoader::SDLImageLoader(SDLImage * Img):
 	image(Img),
 	lineStart(nullptr),
@@ -52,7 +41,7 @@ void SDLImageLoader::init(Point SpriteSize, Point Margins, Point FullSize, SDL_C
 	lineStart = position = (ui8*)image->surf->pixels;
 }
 
-inline void SDLImageLoader::Load(size_t size, const ui8 * data)
+inline void SDLImageLoader::load(size_t size, const ui8 * data)
 {
 	if (size)
 	{
@@ -61,7 +50,7 @@ inline void SDLImageLoader::Load(size_t size, const ui8 * data)
 	}
 }
 
-inline void SDLImageLoader::Load(size_t size, ui8 color)
+inline void SDLImageLoader::load(size_t size, ui8 color)
 {
 	if (size)
 	{
@@ -70,7 +59,7 @@ inline void SDLImageLoader::Load(size_t size, ui8 color)
 	}
 }
 
-inline void SDLImageLoader::EndLine()
+inline void SDLImageLoader::endLine()
 {
 	lineStart += image->surf->pitch;
 	position = lineStart;

+ 6 - 28
client/renderSDL/SDLImageLoader.h

@@ -9,43 +9,21 @@
  */
 #pragma once
 
-#include "../../lib/GameConstants.h"
+#include "../render/IImageLoader.h"
 
-#ifdef IN
-#undef IN
-#endif
-
-#ifdef OUT
-#undef OUT
-#endif
-
-VCMI_LIB_NAMESPACE_BEGIN
-
-class JsonNode;
-class Rect;
-class Point;
-
-VCMI_LIB_NAMESPACE_END
-
-struct SDL_Surface;
-struct SDL_Color;
-class CDefFile;
-class ColorFilter;
-
-
-class SDLImageLoader
+class SDLImageLoader : public IImageLoader
 {
 	SDLImage * image;
 	ui8 * lineStart;
 	ui8 * position;
 public:
 	//load size raw pixels from data
-	inline void Load(size_t size, const ui8 * data);
+	void load(size_t size, const ui8 * data);
 	//set size pixels to color
-	inline void Load(size_t size, ui8 color=0);
-	inline void EndLine();
+	void load(size_t size, ui8 color=0);
+	void endLine();
 	//init image with these sizes and palette
-	inline void init(Point SpriteSize, Point Margins, Point FullSize, SDL_Color *pal);
+	void init(Point SpriteSize, Point Margins, Point FullSize, SDL_Color *pal);
 
 	SDLImageLoader(SDLImage * Img);
 	~SDLImageLoader();

+ 3 - 1
client/renderSDL/SDLRWwrapper.cpp

@@ -10,7 +10,9 @@
 
 #include "StdInc.h"
 #include "SDLRWwrapper.h"
-#include "../lib/filesystem/CInputStream.h"
+
+#include "../../lib/filesystem/CInputStream.h"
+
 #include <SDL_rwops.h>
 
 static inline CInputStream* get_stream(SDL_RWops* context)

+ 16 - 15
client/renderSDL/SDL_Extensions.cpp

@@ -9,25 +9,26 @@
  */
 #include "StdInc.h"
 #include "SDL_Extensions.h"
-#include "SDL_PixelAccess.h"
-
-#include "../CGameInfo.h"
-#include "../CMessage.h"
-#include "../Graphics.h"
-#include "../CMT.h"
 
-#include <SDL_version.h>
+#include "SDL_PixelAccess.h"
+//
+//#include "../CGameInfo.h"
+//#include "../CMessage.h"
+#include "../render/Graphics.h"
+//#include "../CMT.h"
+//
+//#include <SDL_version.h>
 #include <SDL_render.h>
 #include <SDL_video.h>
 #include <SDL_events.h>
-
-#ifdef VCMI_APPLE
-#include <dispatch/dispatch.h>
-#endif
-
-#ifdef VCMI_IOS
-#include "ios/utils.h"
-#endif
+//
+//#ifdef VCMI_APPLE
+//#include <dispatch/dispatch.h>
+//#endif
+//
+//#ifdef VCMI_IOS
+//#include "ios/utils.h"
+//#endif
 
 const SDL_Color Colors::YELLOW = { 229, 215, 123, SDL_ALPHA_OPAQUE };
 const SDL_Color Colors::WHITE = { 255, 243, 222, SDL_ALPHA_OPAQUE };

+ 2 - 1
client/widgets/Buttons.cpp

@@ -18,9 +18,10 @@
 #include "../CPlayerInterface.h"
 #include "../battle/BattleInterface.h"
 #include "../battle/BattleInterfaceClasses.h"
-#include "../gui/CAnimation.h"
 #include "../gui/CGuiHandler.h"
 #include "../windows/InfoWindows.h"
+#include "../render/CAnimation.h"
+
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/CGeneralTextHandler.h"
 

+ 1 - 1
client/widgets/Buttons.h

@@ -10,7 +10,7 @@
 #pragma once
 
 #include "../gui/CIntObject.h"
-#include "../gui/SDL_Extensions.h"
+#include "../renderSDL/SDL_Extensions.h"
 #include "../../lib/FunctionList.h"
 
 #include <SDL_pixels.h>

+ 6 - 4
client/widgets/CComponent.cpp

@@ -18,18 +18,20 @@
 
 #include "../gui/CGuiHandler.h"
 #include "../gui/CursorHandler.h"
-
-#include "../CMessage.h"
+#include "../gui/TextAlignment.h"
+#include "../renderSDL/SDL_Extensions.h"
+#include "../adventureMap/CAdvMapInt.h"
+#include "../windows/CMessage.h"
+#include "../widgets/TextControls.h"
 #include "../CGameInfo.h"
-#include "../windows/CAdvmapInterface.h"
 
-#include "../../lib/CArtHandler.h"
 #include "../../lib/CTownHandler.h"
 #include "../../lib/spells/CSpellHandler.h"
 #include "../../lib/CCreatureHandler.h"
 #include "../../lib/CSkillHandler.h"
 #include "../../lib/CGeneralTextHandler.h"
 #include "../../lib/NetPacksBase.h"
+#include "../../lib/CArtHandler.h"
 
 CComponent::CComponent(Etype Type, int Subtype, int Val, ESize imageSize)
 	: perDay(false)

+ 2 - 2
client/widgets/CreatureCostBox.h

@@ -9,8 +9,8 @@
  */
 #pragma once
 
-#include "../lib/ResourceSet.h"
-#include "gui/CIntObject.h"
+#include "../../lib/ResourceSet.h"
+#include "../gui/CIntObject.h"
 
 class CLabel;
 class CAnimImage;

+ 3 - 7
client/widgets/Images.cpp

@@ -12,21 +12,17 @@
 
 #include "MiscWidgets.h"
 
-#include "../gui/CAnimation.h"
 #include "../gui/CGuiHandler.h"
-#include "../gui/CursorHandler.h"
-#include "../gui/ColorFilter.h"
+#include "../renderSDL/SDL_Extensions.h"
+#include "../render/IImage.h"
+#include "../render/CAnimation.h"
 
 #include "../battle/BattleInterface.h"
 #include "../battle/BattleInterfaceClasses.h"
 
-#include "../CBitmapHandler.h"
-#include "../Graphics.h"
 #include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
-#include "../CMessage.h"
 #include "../CMusicHandler.h"
-#include "../windows/CAdvmapInterface.h"
 
 #include "../../CCallback.h"
 

+ 3 - 2
client/widgets/MiscWidgets.cpp

@@ -16,11 +16,12 @@
 #include "../gui/CursorHandler.h"
 
 #include "../CPlayerInterface.h"
-#include "../CMessage.h"
 #include "../CGameInfo.h"
-#include "../windows/CAdvmapInterface.h"
+#include "../widgets/TextControls.h"
 #include "../windows/CCastleInterface.h"
 #include "../windows/InfoWindows.h"
+#include "../renderSDL/SDL_Extensions.h"
+#include "../adventureMap/CAdvMapInt.h"
 
 #include "../../CCallback.h"
 

+ 6 - 4
client/widgets/TextControls.cpp

@@ -13,12 +13,11 @@
 #include "Buttons.h"
 #include "Images.h"
 
-#include "../CMessage.h"
 #include "../CPlayerInterface.h"
 #include "../gui/CGuiHandler.h"
-#include "../widgets/AdventureMapClasses.h"
-
-#include "../../lib/CGeneralTextHandler.h" //for Unicode related stuff
+#include "../windows/CMessage.h"
+#include "../adventureMap/CInGameConsole.h"
+#include "../../lib/CGeneralTextHandler.h"
 
 #ifdef VCMI_ANDROID
 #include "lib/CAndroidVMHelper.h"
@@ -26,6 +25,9 @@
 
 #include <SDL_events.h>
 
+std::list<CFocusable*> CFocusable::focusables;
+CFocusable * CFocusable::inputWithFocus;
+
 std::string CLabel::visibleText()
 {
 	return text;

+ 2 - 1
client/widgets/TextControls.h

@@ -11,7 +11,8 @@
 
 #include "../gui/CIntObject.h"
 #include "../gui/TextAlignment.h"
-#include "../gui/SDL_Extensions.h"
+#include "../renderSDL/SDL_Extensions.h"
+#include "../render/Graphics.h"
 #include "../../lib/FunctionList.h"
 
 #include <SDL_pixels.h>

+ 6 - 7
client/windows/CCastleInterface.cpp

@@ -10,25 +10,24 @@
 #include "StdInc.h"
 #include "CCastleInterface.h"
 
-#include "CAdvmapInterface.h"
 #include "CHeroWindow.h"
 #include "CTradeWindow.h"
 #include "InfoWindows.h"
 #include "GUIClasses.h"
 #include "QuickRecruitmentWindow.h"
 
-#include "../CBitmapHandler.h"
 #include "../CGameInfo.h"
-#include "../CMessage.h"
 #include "../CMusicHandler.h"
 #include "../CPlayerInterface.h"
-#include "../Graphics.h"
 #include "../gui/CGuiHandler.h"
-#include "../gui/CAnimation.h"
-#include "../gui/ColorFilter.h"
-#include "../gui/SDL_Extensions.h"
 #include "../widgets/MiscWidgets.h"
 #include "../widgets/CComponent.h"
+#include "../widgets/Buttons.h"
+#include "../widgets/TextControls.h"
+#include "../renderSDL/SDL_Extensions.h"
+#include "../render/IImage.h"
+#include "../render/ColorFilter.h"
+#include "../adventureMap/CAdvMapInt.h"
 
 #include "../../CCallback.h"
 #include "../../lib/CArtHandler.h"

+ 5 - 7
client/windows/CHeroWindow.cpp

@@ -10,22 +10,22 @@
 #include "StdInc.h"
 #include "CHeroWindow.h"
 
-#include "CAdvmapInterface.h"
 #include "CCreatureWindow.h"
 #include "CKingdomInterface.h"
 #include "GUIClasses.h"
 
 #include "../CGameInfo.h"
-#include "../CMessage.h"
 #include "../CMT.h"
 #include "../CPlayerInterface.h"
-#include "../Graphics.h"
 
-#include "../gui/SDL_Extensions.h"
 #include "../gui/CGuiHandler.h"
-#include "../gui/CAnimation.h"
+#include "../gui/TextAlignment.h"
 #include "../widgets/MiscWidgets.h"
 #include "../widgets/CComponent.h"
+#include "../widgets/TextControls.h"
+#include "../widgets/Buttons.h"
+#include "../renderSDL/SDL_Extensions.h"
+#include "../render/CAnimation.h"
 
 #include "../../CCallback.h"
 
@@ -36,8 +36,6 @@
 #include "../lib/CSkillHandler.h"
 #include "../lib/mapObjects/CGHeroInstance.h"
 #include "../lib/NetPacksBase.h"
-#include "../mapHandler.h"
-
 
 TConstBonusListPtr CHeroWithMaybePickedArtifact::getAllBonuses(const CSelector & selector, const CSelector & limit, const CBonusSystemNode * root, const std::string & cachingStr) const
 {

+ 4 - 1
client/windows/CKingdomInterface.cpp

@@ -10,7 +10,6 @@
 #include "StdInc.h"
 #include "CKingdomInterface.h"
 
-#include "CAdvmapInterface.h"
 #include "CCastleInterface.h"
 #include "InfoWindows.h"
 
@@ -19,7 +18,11 @@
 #include "../CPlayerInterface.h"
 #include "../gui/CGuiHandler.h"
 #include "../widgets/CComponent.h"
+#include "../widgets/TextControls.h"
 #include "../widgets/MiscWidgets.h"
+#include "../widgets/Buttons.h"
+#include "../adventureMap/CAdvMapInt.h"
+#include "../renderSDL/SDL_Extensions.h"
 
 #include "../../CCallback.h"
 

+ 9 - 10
client/windows/CMessage.cpp

@@ -11,16 +11,15 @@
 #include "StdInc.h"
 #include "CMessage.h"
 
-#include "CGameInfo.h"
-#include "gui/SDL_Extensions.h"
-#include "../lib/CGeneralTextHandler.h"
-#include "CBitmapHandler.h"
-#include "gui/CAnimation.h"
-
-#include "widgets/CComponent.h"
-#include "windows/InfoWindows.h"
-#include "widgets/Buttons.h"
-#include "widgets/TextControls.h"
+#include "../CGameInfo.h"
+#include "../../lib/CGeneralTextHandler.h"
+
+#include "../windows/InfoWindows.h"
+#include "../widgets/Buttons.h"
+#include "../widgets/CComponent.h"
+#include "../widgets/TextControls.h"
+#include "../render/CAnimation.h"
+#include "../render/IImage.h"
 
 #include <SDL_surface.h>
 

+ 3 - 1
client/windows/CMessage.h

@@ -9,12 +9,14 @@
  */
 #pragma once
 
-#include "Graphics.h"
+#include "../render/Graphics.h"
+#include "../../lib/GameConstants.h"
 
 struct SDL_Surface;
 class CInfoWindow;
 class CComponent;
 
+
 /// Class which draws formatted text messages and generates chat windows
 class CMessage
 {

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff