diff --git a/CCallback.cpp b/CCallback.cpp index a1fea415c..4e4e3eeee 100644 --- a/CCallback.cpp +++ b/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" diff --git a/client/CMT.cpp b/client/CMT.cpp index 5eb2f6b9a..a7566075e 100644 --- a/client/CMT.cpp +++ b/client/CMT.cpp @@ -11,48 +11,43 @@ // #include "StdInc.h" -#include - -#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 +#include #include "mainmenu/CPrologEpilogVideo.h" #include diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 898b6de48..fd1e5713d 100644 --- a/client/CMakeLists.txt +++ b/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 diff --git a/client/CMusicHandler.cpp b/client/CMusicHandler.cpp index 4e2f3bdb0..db0478c17 100644 --- a/client/CMusicHandler.cpp +++ b/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, diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index 17689f6e0..5fcb149e4 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -11,7 +11,8 @@ #include -#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 diff --git a/client/CVideoHandler.cpp b/client/CVideoHandler.cpp index 22d102021..4fb0fcb1d 100644 --- a/client/CVideoHandler.cpp +++ b/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" diff --git a/client/Client.cpp b/client/Client.cpp index 397c241bb..5add9104a 100644 --- a/client/Client.cpp +++ b/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 #ifdef VCMI_ANDROID diff --git a/client/ClientCommandManager.cpp b/client/ClientCommandManager.cpp index 0fb190826..213c9b2de 100644 --- a/client/ClientCommandManager.cpp +++ b/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" diff --git a/client/NetPacksClient.cpp b/client/NetPacksClient.cpp index 30a09d750..1565d95bc 100644 --- a/client/NetPacksClient.cpp +++ b/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 diff --git a/client/adventureMap/CAdvMapInt.cpp b/client/adventureMap/CAdvMapInt.cpp index e9005bfd0..e7a6139d0 100644 --- a/client/adventureMap/CAdvMapInt.cpp +++ b/client/adventureMap/CAdvMapInt.cpp @@ -8,58 +8,44 @@ * */ #include "StdInc.h" -#include "CAdvmapInterface.h" +#include "CAdvMapInt.h" -#include "CCastleInterface.h" -#include "CHeroWindow.h" -#include "CKingdomInterface.h" -#include "CSpellWindow.h" -#include "CTradeWindow.h" -#include "GUIClasses.h" -#include "InfoWindows.h" +#include "CAdvMapPanel.h" +#include "CAdventureOptions.h" +#include "CInGameConsole.h" +#include "mapHandler.h" -#include "../CBitmapHandler.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 #include #define ADVOPT (conf.go()->ac) -using namespace CSDL_Ext; std::shared_ptr adventureInt; @@ -630,7 +616,7 @@ void CAdvMapInt::handleMapScrollingUpdate() int scrollSpeed = static_cast(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) { diff --git a/client/adventureMap/CAdvMapInt.h b/client/adventureMap/CAdvMapInt.h index d3fa66ffc..ea7c07e80 100644 --- a/client/adventureMap/CAdvMapInt.h +++ b/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, diff --git a/client/adventureMap/CAdvMapPanel.cpp b/client/adventureMap/CAdvMapPanel.cpp index 986619c90..027afc273 100644 --- a/client/adventureMap/CAdvMapPanel.cpp +++ b/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 - -#include "MiscWidgets.h" -#include "CComponent.h" -#include "Images.h" - -#include "../CGameInfo.h" -#include "../CMusicHandler.h" -#include "../CPlayerInterface.h" -#include "../mainmenu/CMainMenu.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 -#include -#include CAdvMapPanel::CAdvMapPanel(std::shared_ptr bg, Point position) : CIntObject() diff --git a/client/adventureMap/CAdvMapPanel.h b/client/adventureMap/CAdvMapPanel.h index dae9e7c5a..0f4ef172f 100644 --- a/client/adventureMap/CAdvMapPanel.h +++ b/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 diff --git a/client/adventureMap/CAdventureOptions.cpp b/client/adventureMap/CAdventureOptions.cpp index ffc074d4b..7e96ac4b0 100644 --- a/client/adventureMap/CAdventureOptions.cpp +++ b/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 -#include - -#define ADVOPT (conf.go()->ac) -using namespace CSDL_Ext; - -std::shared_ptr 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") diff --git a/client/adventureMap/CAdventureOptions.h b/client/adventureMap/CAdventureOptions.h index 498af6a1f..aa651ce77 100644 --- a/client/adventureMap/CAdventureOptions.h +++ b/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 diff --git a/client/adventureMap/CInGameConsole.cpp b/client/adventureMap/CInGameConsole.cpp index c5c3ce32a..bda566a30 100644 --- a/client/adventureMap/CInGameConsole.cpp +++ b/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 - -#include "MiscWidgets.h" -#include "CComponent.h" -#include "Images.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 "../../lib/mapObjects/CArmedInstance.h" -#include -#include +#include #include CInGameConsole::CInGameConsole() diff --git a/client/adventureMap/CInGameConsole.h b/client/adventureMap/CInGameConsole.h index 7e08d5abb..6f0f9851e 100644 --- a/client/adventureMap/CInGameConsole.h +++ b/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 { diff --git a/client/adventureMap/CInfoBar.cpp b/client/adventureMap/CInfoBar.cpp index f202b77c7..ec6611bac 100644 --- a/client/adventureMap/CInfoBar.cpp +++ b/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 "CInfoBar.h" -#include - -#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 -#include -#include +#include "../../lib/mapObjects/CGTownInstance.h" CInfoBar::CVisibleInfo::CVisibleInfo() : CIntObject(0, Point(8, 12)) diff --git a/client/adventureMap/CInfoBar.h b/client/adventureMap/CInfoBar.h index ba56c3178..0c6106011 100644 --- a/client/adventureMap/CInfoBar.h +++ b/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 diff --git a/client/adventureMap/CList.cpp b/client/adventureMap/CList.cpp index e9d2391e7..b35918c99 100644 --- a/client/adventureMap/CList.cpp +++ b/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 "CList.h" -#include - -#include "MiscWidgets.h" -#include "CComponent.h" -#include "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 "CAdvMapInt.h" +#include "../widgets/Images.h" +#include "../widgets/Buttons.h" #include "../windows/InfoWindows.h" -#include "../windows/CAdvmapInterface.h" +#include "../CGameInfo.h" +#include "../CPlayerInterface.h" +#include "../gui/CGuiHandler.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 -#include -#include +#include "../../lib/mapObjects/CGTownInstance.h" CList::CListItem::CListItem(CList * Parent) : CIntObject(LCLICK | RCLICK | HOVER), diff --git a/client/adventureMap/CList.h b/client/adventureMap/CList.h index 11568779f..494c4d19b 100644 --- a/client/adventureMap/CList.h +++ b/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 diff --git a/client/adventureMap/CMinimap.cpp b/client/adventureMap/CMinimap.cpp index a52989a57..9e0f41c5e 100644 --- a/client/adventureMap/CMinimap.cpp +++ b/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 "CMinimap.h" -#include - -#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 -#include -#include const SDL_Color & CMinimapInstance::getTileColor(const int3 & pos) { diff --git a/client/adventureMap/CMinimap.h b/client/adventureMap/CMinimap.h index 5ea772963..f7df33b2f 100644 --- a/client/adventureMap/CMinimap.h +++ b/client/adventureMap/CMinimap.h @@ -9,34 +9,11 @@ */ #pragma once -#include "ObjectLists.h" -#include "../../lib/FunctionList.h" +#include "../gui/CIntObject.h" +#include "../../lib/GameConstants.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; +struct SDL_Color; class CMinimap; class CMinimapInstance : public CIntObject diff --git a/client/adventureMap/CResDataBar.cpp b/client/adventureMap/CResDataBar.cpp index 9e7e75544..aaa627297 100644 --- a/client/adventureMap/CResDataBar.cpp +++ b/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 -#include #define ADVOPT (conf.go()->ac) -using namespace CSDL_Ext; - -std::shared_ptr 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(LOCPLINT->cb->getDate(Date::WEEK))); temp.push_back(boost::lexical_cast(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) diff --git a/client/adventureMap/CResDataBar.h b/client/adventureMap/CResDataBar.h index d8a38967c..98598451e 100644 --- a/client/adventureMap/CResDataBar.h +++ b/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 diff --git a/client/adventureMap/CTerrainRect.cpp b/client/adventureMap/CTerrainRect.cpp index c0ec1bc6b..1bf788967 100644 --- a/client/adventureMap/CTerrainRect.cpp +++ b/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 #include #define ADVOPT (conf.go()->ac) -using namespace CSDL_Ext; - -std::shared_ptr 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); } } diff --git a/client/adventureMap/CTerrainRect.h b/client/adventureMap/CTerrainRect.h index b439f44d1..4945f905f 100644 --- a/client/adventureMap/CTerrainRect.h +++ b/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 { diff --git a/client/adventureMap/mapHandler.cpp b/client/adventureMap/mapHandler.cpp index 3c0c053f9..e4413ea99 100644 --- a/client/adventureMap/mapHandler.cpp +++ b/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) diff --git a/client/adventureMap/mapHandler.h b/client/adventureMap/mapHandler.h index b1c2ff839..4b23e711b 100644 --- a/client/adventureMap/mapHandler.h +++ b/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 diff --git a/client/battle/BattleEffectsController.cpp b/client/battle/BattleEffectsController.cpp index fddb27be0..9453673e2 100644 --- a/client/battle/BattleEffectsController.cpp +++ b/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" diff --git a/client/battle/BattleFieldController.cpp b/client/battle/BattleFieldController.cpp index 2f4d3bb12..46bd6aa5e 100644 --- a/client/battle/BattleFieldController.cpp +++ b/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" diff --git a/client/battle/BattleInterface.cpp b/client/battle/BattleInterface.cpp index 6a6e435a4..e78df4e56 100644 --- a/client/battle/BattleInterface.cpp +++ b/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" diff --git a/client/battle/BattleInterfaceClasses.cpp b/client/battle/BattleInterfaceClasses.cpp index 69b5f54cd..7ee7707ff 100644 --- a/client/battle/BattleInterfaceClasses.cpp +++ b/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" diff --git a/client/battle/BattleObstacleController.cpp b/client/battle/BattleObstacleController.cpp index ba2485d13..5e3eb2cd8 100644 --- a/client/battle/BattleObstacleController.cpp +++ b/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" diff --git a/client/battle/BattleProjectileController.cpp b/client/battle/BattleProjectileController.cpp index c89e25e57..eb9d8b6fe 100644 --- a/client/battle/BattleProjectileController.cpp +++ b/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" diff --git a/client/battle/BattleSiegeController.cpp b/client/battle/BattleSiegeController.cpp index 6d23c5ffd..602912807 100644 --- a/client/battle/BattleSiegeController.cpp +++ b/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" diff --git a/client/battle/BattleStacksController.cpp b/client/battle/BattleStacksController.cpp index 369554ed1..8e3add970 100644 --- a/client/battle/BattleStacksController.cpp +++ b/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" diff --git a/client/battle/BattleStacksController.h b/client/battle/BattleStacksController.h index 92ffdaae0..7963c8c23 100644 --- a/client/battle/BattleStacksController.h +++ b/client/battle/BattleStacksController.h @@ -9,7 +9,7 @@ */ #pragma once -#include "../gui/ColorFilter.h" +#include "../render/ColorFilter.h" VCMI_LIB_NAMESPACE_BEGIN diff --git a/client/battle/BattleWindow.cpp b/client/battle/BattleWindow.cpp index 7c711ef8c..4279352bc 100644 --- a/client/battle/BattleWindow.cpp +++ b/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" diff --git a/client/battle/CreatureAnimation.cpp b/client/battle/CreatureAnimation.cpp index 4db83af3e..f6a827468 100644 --- a/client/battle/CreatureAnimation.cpp +++ b/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 }; diff --git a/client/battle/CreatureAnimation.h b/client/battle/CreatureAnimation.h index e4c1a9d67..12eebef0d 100644 --- a/client/battle/CreatureAnimation.h +++ b/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 diff --git a/client/gui/CGuiHandler.cpp b/client/gui/CGuiHandler.cpp index 12bfe6ed0..ae9b0624f 100644 --- a/client/gui/CGuiHandler.cpp +++ b/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 #include #include diff --git a/client/gui/CIntObject.cpp b/client/gui/CIntObject.cpp index 9a1c00794..334771b56 100644 --- a/client/gui/CIntObject.cpp +++ b/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 #include diff --git a/client/gui/CIntObject.h b/client/gui/CIntObject.h index e4836c544..a61fe5d6f 100644 --- a/client/gui/CIntObject.h +++ b/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; diff --git a/client/gui/CursorHandler.cpp b/client/gui/CursorHandler.cpp index 4d1760f7a..2d9ba31db 100644 --- a/client/gui/CursorHandler.cpp +++ b/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 diff --git a/client/gui/CursorHandler.h b/client/gui/CursorHandler.h index 807f90164..1b5cede0b 100644 --- a/client/gui/CursorHandler.h +++ b/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 { diff --git a/client/gui/InterfaceObjectConfigurable.cpp b/client/gui/InterfaceObjectConfigurable.cpp index cb9b6854e..fd138dc8d 100644 --- a/client/gui/InterfaceObjectConfigurable.cpp +++ b/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" diff --git a/client/lobby/CBonusSelection.cpp b/client/lobby/CBonusSelection.cpp index d3a6d7505..9bcf406ae 100644 --- a/client/lobby/CBonusSelection.cpp +++ b/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" diff --git a/client/lobby/CCampaignInfoScreen.cpp b/client/lobby/CCampaignInfoScreen.cpp index ce45bf45c..f84cb6101 100644 --- a/client/lobby/CCampaignInfoScreen.cpp +++ b/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() diff --git a/client/lobby/CSelectionBase.cpp b/client/lobby/CSelectionBase.cpp index b35598316..0cfb4a661 100644 --- a/client/lobby/CSelectionBase.cpp +++ b/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" diff --git a/client/lobby/OptionsTab.cpp b/client/lobby/OptionsTab.cpp index 199788093..31c8b4d28 100644 --- a/client/lobby/OptionsTab.cpp +++ b/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" diff --git a/client/lobby/RandomMapTab.cpp b/client/lobby/RandomMapTab.cpp index bcefe0c23..285e9e355 100644 --- a/client/lobby/RandomMapTab.cpp +++ b/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" diff --git a/client/lobby/SelectionTab.cpp b/client/lobby/SelectionTab.cpp index f33d7413e..a280e7ed4 100644 --- a/client/lobby/SelectionTab.cpp +++ b/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" diff --git a/client/mainmenu/CCampaignScreen.cpp b/client/mainmenu/CCampaignScreen.cpp index 6cb1d500c..e89128b1e 100644 --- a/client/mainmenu/CCampaignScreen.cpp +++ b/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" diff --git a/client/mainmenu/CMainMenu.cpp b/client/mainmenu/CMainMenu.cpp index 88ec3e949..0ff17fe3c 100644 --- a/client/mainmenu/CMainMenu.cpp +++ b/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" diff --git a/client/render/CAnimation.cpp b/client/render/CAnimation.cpp index 6fa584767..2f884fdff 100644 --- a/client/render/CAnimation.cpp +++ b/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 +#include "../renderSDL/SDLImage.h" std::shared_ptr CAnimation::getFromExtraDef(std::string filename) { diff --git a/client/render/CAnimation.h b/client/render/CAnimation.h index 88ff80415..7e26d13cd 100644 --- a/client/render/CAnimation.h +++ b/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 diff --git a/client/render/CBitmapHandler.cpp b/client/render/CBitmapHandler.cpp index c13f2381f..1d096fe08 100644 --- a/client/render/CBitmapHandler.cpp +++ b/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 -#include "CBitmapHandler.h" -#include "gui/SDL_Extensions.h" #include "../lib/vcmi_endian.h" +#include + namespace BitmapHandler { SDL_Surface * loadH3PCX(ui8 * data, size_t size); diff --git a/client/render/CDefFile.cpp b/client/render/CDefFile.cpp index a88ab0aa5..190da28f6 100644 --- a/client/render/CDefFile.cpp +++ b/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 "CDefFile.h" -#include "SDL_Extensions.h" -#include "ColorFilter.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 +#include // Extremely simple file cache. TODO: smarter, more general solution class CFileCache @@ -203,8 +197,7 @@ CDefFile::CDefFile(std::string Name): } } -template -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 >::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 - 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 getEntries() const; }; diff --git a/client/render/CFadeAnimation.cpp b/client/render/CFadeAnimation.cpp index 04427b197..d2e5c9e10 100644 --- a/client/render/CFadeAnimation.cpp +++ b/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 diff --git a/client/render/CFadeAnimation.h b/client/render/CFadeAnimation.h index 76e95b313..b253ce828 100644 --- a/client/render/CFadeAnimation.h +++ b/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; diff --git a/client/render/Canvas.cpp b/client/render/Canvas.cpp index 95d2f555c..82ccd447f 100644 --- a/client/render/Canvas.cpp +++ b/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 diff --git a/client/render/Canvas.h b/client/render/Canvas.h index 39a4df9fa..73f795f2c 100644 --- a/client/render/Canvas.h +++ b/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" diff --git a/client/render/Graphics.cpp b/client/render/Graphics.cpp index 54c9baf2a..527a5f70a 100644 --- a/client/render/Graphics.cpp +++ b/client/render/Graphics.cpp @@ -18,11 +18,15 @@ #include #include +#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" diff --git a/client/render/Graphics.h b/client/render/Graphics.h index 0b539d396..83b3bc198 100644 --- a/client/render/Graphics.h +++ b/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 diff --git a/client/render/ICursor.h b/client/render/ICursor.h index 8abbbbef5..6d37b3e37 100644 --- a/client/render/ICursor.h +++ b/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 { diff --git a/client/render/IFont.cpp b/client/render/IFont.cpp index bea94c076..0086cd9ee 100644 --- a/client/render/IFont.cpp +++ b/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 "IFont.h" -#include - -#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 { diff --git a/client/render/IFont.h b/client/render/IFont.h index bc87fea28..933b85db5 100644 --- a/client/render/IFont.h +++ b/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: diff --git a/client/render/IImage.h b/client/render/IImage.h index 06691db52..64cdfffec 100644 --- a/client/render/IImage.h +++ b/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; /* diff --git a/client/render/IImageLoader.h b/client/render/IImageLoader.h new file mode 100644 index 000000000..fd3a72045 --- /dev/null +++ b/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; +}; diff --git a/client/renderSDL/CBitmapFont.cpp b/client/renderSDL/CBitmapFont.cpp index ce600e2bd..f2eb49d00 100644 --- a/client/renderSDL/CBitmapFont.cpp +++ b/client/renderSDL/CBitmapFont.cpp @@ -8,15 +8,16 @@ * */ #include "StdInc.h" -#include "Fonts.h" - -#include +#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 std::array CBitmapFont::loadChars() const { diff --git a/client/renderSDL/CBitmapFont.h b/client/renderSDL/CBitmapFont.h index 3f1012113..8da10b4d4 100644 --- a/client/renderSDL/CBitmapFont.h +++ b/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 { diff --git a/client/renderSDL/CBitmapHanFont.cpp b/client/renderSDL/CBitmapHanFont.cpp index 303299cab..bcaa94d59 100644 --- a/client/renderSDL/CBitmapHanFont.cpp +++ b/client/renderSDL/CBitmapHanFont.cpp @@ -8,15 +8,17 @@ * */ #include "StdInc.h" -#include "Fonts.h" - -#include +#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 size_t CBitmapHanFont::getCharacterDataOffset(size_t index) const { diff --git a/client/renderSDL/CBitmapHanFont.h b/client/renderSDL/CBitmapHanFont.h index ea61a42b5..32b7e081f 100644 --- a/client/renderSDL/CBitmapHanFont.h +++ b/client/renderSDL/CBitmapHanFont.h @@ -9,20 +9,13 @@ */ #pragma once +#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, ui64> data; - - const std::unique_ptr font; - const bool blended; - - std::pair, 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; -}; diff --git a/client/renderSDL/CTrueTypeFont.cpp b/client/renderSDL/CTrueTypeFont.cpp index 98df180c7..4788e4636 100644 --- a/client/renderSDL/CTrueTypeFont.cpp +++ b/client/renderSDL/CTrueTypeFont.cpp @@ -8,15 +8,21 @@ * */ #include "StdInc.h" -#include "Fonts.h" +#include "CTrueTypeFont.h" + +#include "SDL_Extensions.h" + +#include "../../lib/JsonNode.h" +#include "../../lib/CGeneralTextHandler.h" +#include "../../lib/filesystem/Filesystem.h" #include -#include "SDL_Extensions.h" -#include "../../lib/JsonNode.h" -#include "../../lib/vcmi_endian.h" -#include "../../lib/filesystem/Filesystem.h" -#include "../../lib/CGeneralTextHandler.h" +std::pair, 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) { diff --git a/client/renderSDL/CTrueTypeFont.h b/client/renderSDL/CTrueTypeFont.h index 6e65645b8..eb834b40c 100644 --- a/client/renderSDL/CTrueTypeFont.h +++ b/client/renderSDL/CTrueTypeFont.h @@ -9,21 +9,14 @@ */ #pragma once +#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, ui64> data; diff --git a/client/renderSDL/CursorHardware.cpp b/client/renderSDL/CursorHardware.cpp index d72a75d28..a2c7e728e 100644 --- a/client/renderSDL/CursorHardware.cpp +++ b/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 #include diff --git a/client/renderSDL/CursorHardware.h b/client/renderSDL/CursorHardware.h index 41048dcbb..8f0aa2f19 100644 --- a/client/renderSDL/CursorHardware.h +++ b/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 { diff --git a/client/renderSDL/CursorSoftware.cpp b/client/renderSDL/CursorSoftware.cpp index b2b8019d2..a143b7d98 100644 --- a/client/renderSDL/CursorSoftware.cpp +++ b/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 #include -#ifdef VCMI_APPLE -#include -#endif - void CursorSoftware::render() { //texture must be updated in the main (renderer) thread, but changes to cursor type may come from other threads diff --git a/client/renderSDL/CursorSoftware.h b/client/renderSDL/CursorSoftware.h index cc450844e..f33add2f6 100644 --- a/client/renderSDL/CursorSoftware.h +++ b/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 { diff --git a/client/renderSDL/SDLImage.cpp b/client/renderSDL/SDLImage.cpp index 55c014c61..386058026 100644 --- a/client/renderSDL/SDLImage.cpp +++ b/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 diff --git a/client/renderSDL/SDLImage.h b/client/renderSDL/SDLImage.h index 850004b51..86f14e48d 100644 --- a/client/renderSDL/SDLImage.h +++ b/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 diff --git a/client/renderSDL/SDLImageLoader.cpp b/client/renderSDL/SDLImageLoader.cpp index 1dfbb8e16..c951dcc2d 100644 --- a/client/renderSDL/SDLImageLoader.cpp +++ b/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 "SDLImageLoader.h" -#include "SDL_Extensions.h" -#include "ColorFilter.h" +#include "SDLImage.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 "../../lib/Point.h" #include -/************************************************************************* - * 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; diff --git a/client/renderSDL/SDLImageLoader.h b/client/renderSDL/SDLImageLoader.h index 15247b581..5a5b6e97f 100644 --- a/client/renderSDL/SDLImageLoader.h +++ b/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(); diff --git a/client/renderSDL/SDLRWwrapper.cpp b/client/renderSDL/SDLRWwrapper.cpp index 6e1a98b7a..379d94de5 100644 --- a/client/renderSDL/SDLRWwrapper.cpp +++ b/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 static inline CInputStream* get_stream(SDL_RWops* context) diff --git a/client/renderSDL/SDL_Extensions.cpp b/client/renderSDL/SDL_Extensions.cpp index b4403a477..2e66eb4bd 100644 --- a/client/renderSDL/SDL_Extensions.cpp +++ b/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 +// +//#include "../CGameInfo.h" +//#include "../CMessage.h" +#include "../render/Graphics.h" +//#include "../CMT.h" +// +//#include #include #include #include - -#ifdef VCMI_APPLE -#include -#endif - -#ifdef VCMI_IOS -#include "ios/utils.h" -#endif +// +//#ifdef VCMI_APPLE +//#include +//#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 }; diff --git a/client/widgets/Buttons.cpp b/client/widgets/Buttons.cpp index 30965e53d..514d62cea 100644 --- a/client/widgets/Buttons.cpp +++ b/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" diff --git a/client/widgets/Buttons.h b/client/widgets/Buttons.h index 74e6ad690..33f0533ce 100644 --- a/client/widgets/Buttons.h +++ b/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 diff --git a/client/widgets/CComponent.cpp b/client/widgets/CComponent.cpp index 5017781ed..05f316b25 100644 --- a/client/widgets/CComponent.cpp +++ b/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) diff --git a/client/widgets/CreatureCostBox.h b/client/widgets/CreatureCostBox.h index 908b74508..338101ebc 100644 --- a/client/widgets/CreatureCostBox.h +++ b/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; diff --git a/client/widgets/Images.cpp b/client/widgets/Images.cpp index 56ed3b65d..61017edf9 100644 --- a/client/widgets/Images.cpp +++ b/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" diff --git a/client/widgets/MiscWidgets.cpp b/client/widgets/MiscWidgets.cpp index 7dcbe272f..e82109ce3 100644 --- a/client/widgets/MiscWidgets.cpp +++ b/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" diff --git a/client/widgets/TextControls.cpp b/client/widgets/TextControls.cpp index bb3ad318e..ecff24ca7 100644 --- a/client/widgets/TextControls.cpp +++ b/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 +std::list CFocusable::focusables; +CFocusable * CFocusable::inputWithFocus; + std::string CLabel::visibleText() { return text; diff --git a/client/widgets/TextControls.h b/client/widgets/TextControls.h index d1a5b3e67..a5f7cab4b 100644 --- a/client/widgets/TextControls.h +++ b/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 diff --git a/client/windows/CCastleInterface.cpp b/client/windows/CCastleInterface.cpp index fc6e41ec7..9de836afb 100644 --- a/client/windows/CCastleInterface.cpp +++ b/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" diff --git a/client/windows/CHeroWindow.cpp b/client/windows/CHeroWindow.cpp index afc4ed853..1b37d9ede 100644 --- a/client/windows/CHeroWindow.cpp +++ b/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 { diff --git a/client/windows/CKingdomInterface.cpp b/client/windows/CKingdomInterface.cpp index 9511a3cc6..6da92c6d0 100644 --- a/client/windows/CKingdomInterface.cpp +++ b/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" diff --git a/client/windows/CMessage.cpp b/client/windows/CMessage.cpp index 9559045be..abb9fe26b 100644 --- a/client/windows/CMessage.cpp +++ b/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 "../CGameInfo.h" +#include "../../lib/CGeneralTextHandler.h" -#include "widgets/CComponent.h" -#include "windows/InfoWindows.h" -#include "widgets/Buttons.h" -#include "widgets/TextControls.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 diff --git a/client/windows/CMessage.h b/client/windows/CMessage.h index 8eac68881..f41c5d01a 100644 --- a/client/windows/CMessage.h +++ b/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 { diff --git a/client/windows/CQuestLog.cpp b/client/windows/CQuestLog.cpp index e3ef8a562..7ee5c35fc 100644 --- a/client/windows/CQuestLog.cpp +++ b/client/windows/CQuestLog.cpp @@ -10,15 +10,14 @@ #include "StdInc.h" #include "CQuestLog.h" -#include "CAdvmapInterface.h" - #include "../CGameInfo.h" #include "../CPlayerInterface.h" -#include "../Graphics.h" #include "../gui/CGuiHandler.h" -#include "../gui/SDL_Extensions.h" #include "../widgets/CComponent.h" +#include "../adventureMap/CAdvMapInt.h" +#include "../widgets/Buttons.h" +#include "../adventureMap/CMinimap.h" #include "../../CCallback.h" #include "../../lib/CArtHandler.h" diff --git a/client/windows/CQuestLog.h b/client/windows/CQuestLog.h index c1446a2c8..9654d0481 100644 --- a/client/windows/CQuestLog.h +++ b/client/windows/CQuestLog.h @@ -9,10 +9,10 @@ */ #pragma once -#include "../widgets/AdventureMapClasses.h" #include "../widgets/TextControls.h" #include "../widgets/MiscWidgets.h" #include "../widgets/Images.h" +#include "../adventureMap/CMinimap.h" #include "CWindowObject.h" VCMI_LIB_NAMESPACE_BEGIN diff --git a/client/windows/CSpellWindow.cpp b/client/windows/CSpellWindow.cpp index 2cc5b6c78..0c055823a 100644 --- a/client/windows/CSpellWindow.cpp +++ b/client/windows/CSpellWindow.cpp @@ -12,25 +12,22 @@ #include "../../lib/ScopeGuard.h" -#include "CAdvmapInterface.h" #include "GUIClasses.h" #include "InfoWindows.h" #include "CCastleInterface.h" #include "../CGameInfo.h" -#include "../CMessage.h" #include "../CMT.h" #include "../CPlayerInterface.h" #include "../CVideoHandler.h" -#include "../Graphics.h" #include "../battle/BattleInterface.h" -#include "../gui/CAnimation.h" #include "../gui/CGuiHandler.h" -#include "../gui/SDL_Extensions.h" #include "../widgets/MiscWidgets.h" #include "../widgets/CComponent.h" #include "../widgets/TextControls.h" +#include "../adventureMap/CAdvMapInt.h" +#include "../render/CAnimation.h" #include "../../CCallback.h" diff --git a/client/windows/CTradeWindow.cpp b/client/windows/CTradeWindow.cpp index d12bbf7c6..c1e7ca1e3 100644 --- a/client/windows/CTradeWindow.cpp +++ b/client/windows/CTradeWindow.cpp @@ -10,11 +10,14 @@ #include "StdInc.h" #include "CTradeWindow.h" -#include "CAdvmapInterface.h" - #include "../gui/CGuiHandler.h" #include "../gui/CursorHandler.h" #include "../widgets/Images.h" +#include "../adventureMap/CAdvMapInt.h" +#include "../renderSDL/SDL_Extensions.h" +#include "../gui/TextAlignment.h" +#include "../widgets/Buttons.h" +#include "../widgets/TextControls.h" #include "../CGameInfo.h" #include "../CPlayerInterface.h" diff --git a/client/windows/CWindowObject.cpp b/client/windows/CWindowObject.cpp index dca6b6e5b..86ad26bb6 100644 --- a/client/windows/CWindowObject.cpp +++ b/client/windows/CWindowObject.cpp @@ -10,24 +10,20 @@ #include "StdInc.h" #include "CWindowObject.h" -#include "CAdvmapInterface.h" - #include "../widgets/MiscWidgets.h" #include "../widgets/Images.h" - -#include "../gui/SDL_PixelAccess.h" -#include "../gui/SDL_Extensions.h" +#include "../widgets/TextControls.h" #include "../gui/CGuiHandler.h" #include "../gui/CursorHandler.h" -#include "../gui/CAnimation.h" - #include "../battle/BattleInterface.h" #include "../battle/BattleInterfaceClasses.h" +#include "../windows/CMessage.h" +#include "../renderSDL/SDL_Extensions.h" +#include "../renderSDL/SDL_PixelAccess.h" +#include "../render/IImage.h" -#include "../Graphics.h" #include "../CGameInfo.h" #include "../CPlayerInterface.h" -#include "../CMessage.h" #include "../CMusicHandler.h" #include "../../CCallback.h" diff --git a/client/windows/CreaturePurchaseCard.cpp b/client/windows/CreaturePurchaseCard.cpp index 9a0b72ca3..b880146d3 100644 --- a/client/windows/CreaturePurchaseCard.cpp +++ b/client/windows/CreaturePurchaseCard.cpp @@ -9,16 +9,20 @@ */ #include "StdInc.h" #include "CreaturePurchaseCard.h" -#include "CAdvmapInterface.h" + #include "CHeroWindow.h" -#include "../widgets/Buttons.h" -#include "../../CCallback.h" -#include "../CreatureCostBox.h" #include "QuickRecruitmentWindow.h" -#include "../gui/CGuiHandler.h" -#include "../../lib/CCreatureHandler.h" #include "CCreatureWindow.h" +#include "../gui/CGuiHandler.h" +#include "../gui/TextAlignment.h" +#include "../widgets/Buttons.h" +#include "../widgets/TextControls.h" +#include "../widgets/CreatureCostBox.h" + +#include "../../CCallback.h" +#include "../../lib/CCreatureHandler.h" + void CreaturePurchaseCard::initButtons() { initMaxButton(); diff --git a/client/windows/GUIClasses.cpp b/client/windows/GUIClasses.cpp index 50fefaa2a..bdd3a9eec 100644 --- a/client/windows/GUIClasses.cpp +++ b/client/windows/GUIClasses.cpp @@ -10,34 +10,36 @@ #include "StdInc.h" #include "GUIClasses.h" -#include "CAdvmapInterface.h" #include "CCastleInterface.h" #include "CCreatureWindow.h" #include "CHeroWindow.h" -#include "CreatureCostBox.h" #include "InfoWindows.h" #include "../CGameInfo.h" -#include "../CMessage.h" #include "../CMusicHandler.h" #include "../CPlayerInterface.h" #include "../CVideoHandler.h" -#include "../Graphics.h" -#include "../mapHandler.h" #include "../CServerHandler.h" +#include "../adventureMap/mapHandler.h" +#include "../adventureMap/CResDataBar.h" #include "../battle/BattleInterfaceClasses.h" #include "../battle/BattleInterface.h" -#include "../gui/CAnimation.h" #include "../gui/CGuiHandler.h" -#include "../gui/SDL_Extensions.h" #include "../gui/CursorHandler.h" +#include "../gui/TextAlignment.h" #include "../widgets/CComponent.h" #include "../widgets/MiscWidgets.h" +#include "../widgets/CreatureCostBox.h" +#include "../widgets/Buttons.h" +#include "../widgets/TextControls.h" +#include "../widgets/ObjectLists.h" #include "../lobby/CSavingScreen.h" +#include "../renderSDL/SDL_Extensions.h" +#include "../render/CAnimation.h" #include "../../CCallback.h" @@ -65,9 +67,6 @@ using namespace CSDL_Ext; -std::list CFocusable::focusables; -CFocusable * CFocusable::inputWithFocus; - CRecruitmentWindow::CCreatureCard::CCreatureCard(CRecruitmentWindow * window, const CCreature * crea, int totalAmount) : CIntObject(LCLICK | RCLICK), parent(window), diff --git a/client/windows/InfoWindows.cpp b/client/windows/InfoWindows.cpp index 6f1bc6d46..4fe1b9b04 100644 --- a/client/windows/InfoWindows.cpp +++ b/client/windows/InfoWindows.cpp @@ -10,23 +10,21 @@ #include "StdInc.h" #include "InfoWindows.h" -#include "CAdvmapInterface.h" - -#include "../Graphics.h" #include "../CGameInfo.h" #include "../CPlayerInterface.h" -#include "../CMessage.h" #include "../CMusicHandler.h" #include "../widgets/CComponent.h" #include "../widgets/MiscWidgets.h" - -#include "../gui/SDL_Extensions.h" +#include "../widgets/Buttons.h" +#include "../widgets/TextControls.h" #include "../gui/CGuiHandler.h" -#include "../gui/CursorHandler.h" - #include "../battle/BattleInterface.h" #include "../battle/BattleInterfaceClasses.h" +#include "../adventureMap/CAdvMapInt.h" +#include "../windows/CMessage.h" +#include "../renderSDL/SDL_Extensions.h" +#include "../gui/CursorHandler.h" #include "../../CCallback.h" diff --git a/client/windows/QuickRecruitmentWindow.cpp b/client/windows/QuickRecruitmentWindow.cpp index 07751d314..17c61a2c0 100644 --- a/client/windows/QuickRecruitmentWindow.cpp +++ b/client/windows/QuickRecruitmentWindow.cpp @@ -12,9 +12,9 @@ #include "../../lib/mapObjects/CGTownInstance.h" #include "../CPlayerInterface.h" #include "../widgets/Buttons.h" +#include "../widgets/CreatureCostBox.h" #include "../gui/CGuiHandler.h" #include "../../CCallback.h" -#include "../CreatureCostBox.h" #include "../../lib/ResourceSet.h" #include "../../lib/CCreatureHandler.h" #include "CreaturePurchaseCard.h"