1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-20 20:23:03 +02:00

Reorganized includes for new layout. New class - IImageLoader

This commit is contained in:
Ivan Savenko 2023-02-01 20:42:06 +02:00
parent 84dfcacafd
commit 108a42e4ba
109 changed files with 487 additions and 1109 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,58 +8,44 @@
* *
*/ */
#include "StdInc.h" #include "StdInc.h"
#include "CAdvmapInterface.h" #include "CAdvMapInt.h"
#include "CCastleInterface.h" #include "CAdvMapPanel.h"
#include "CHeroWindow.h" #include "CAdventureOptions.h"
#include "CKingdomInterface.h" #include "CInGameConsole.h"
#include "CSpellWindow.h" #include "mapHandler.h"
#include "CTradeWindow.h"
#include "GUIClasses.h"
#include "InfoWindows.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 "../CGameInfo.h"
#include "../CMessage.h"
#include "../CMusicHandler.h" #include "../CMusicHandler.h"
#include "../CPlayerInterface.h" #include "../CPlayerInterface.h"
#include "../mainmenu/CMainMenu.h"
#include "../lobby/CSelectionBase.h"
#include "../lobby/CCampaignInfoScreen.h"
#include "../lobby/CSavingScreen.h" #include "../lobby/CSavingScreen.h"
#include "../lobby/CScenarioInfoScreen.h" #include "../render/CAnimation.h"
#include "../Graphics.h"
#include "../mapHandler.h"
#include "../gui/CAnimation.h"
#include "../gui/CursorHandler.h" #include "../gui/CursorHandler.h"
#include "../render/IImage.h"
#include "../gui/CGuiHandler.h" #include "../gui/CGuiHandler.h"
#include "../gui/SDL_Extensions.h" #include "../widgets/TextControls.h"
#include "../widgets/MiscWidgets.h" #include "../widgets/Buttons.h"
#include "../../CCallback.h" #include "../../CCallback.h"
#include "../../lib/CConfigHandler.h" #include "../../lib/CConfigHandler.h"
#include "../../lib/CGameState.h"
#include "../../lib/CGeneralTextHandler.h" #include "../../lib/CGeneralTextHandler.h"
#include "../../lib/CHeroHandler.h"
#include "../../lib/CSoundBase.h"
#include "../../lib/spells/CSpellHandler.h" #include "../../lib/spells/CSpellHandler.h"
#include "../../lib/CTownHandler.h"
#include "../../lib/JsonNode.h"
#include "../../lib/mapObjects/CGHeroInstance.h" #include "../../lib/mapObjects/CGHeroInstance.h"
#include "../../lib/mapObjects/CGTownInstance.h"
#include "../../lib/CPathfinder.h"
#include "../../lib/mapping/CMap.h" #include "../../lib/mapping/CMap.h"
#include "../../lib/UnlockGuard.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/TerrainHandler.h"
#include <SDL_surface.h> #include <SDL_surface.h>
#include <SDL_events.h> #include <SDL_events.h>
#define ADVOPT (conf.go()->ac) #define ADVOPT (conf.go()->ac)
using namespace CSDL_Ext;
std::shared_ptr<CAdvMapInt> adventureInt; std::shared_ptr<CAdvMapInt> adventureInt;
@ -630,7 +616,7 @@ void CAdvMapInt::handleMapScrollingUpdate()
int scrollSpeed = static_cast<int>(settings["adventure"]["scrollSpeed"].Float()); int scrollSpeed = static_cast<int>(settings["adventure"]["scrollSpeed"].Float());
//if advmap needs updating AND (no dialog is shown OR ctrl is pressed) //if advmap needs updating AND (no dialog is shown OR ctrl is pressed)
if((animValHitCount % (4 / scrollSpeed)) == 0 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)) if((scrollingDir & LEFT) && (position.x > -CGI->mh->frameW))
position.x--; position.x--;
@ -994,7 +980,7 @@ void CAdvMapInt::mouseMoved( const SDL_MouseMotionEvent & sEvent )
// adventure map scrolling with mouse // 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 // 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 // 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) if(sEvent.x<15)
{ {

View File

@ -9,35 +9,39 @@
*/ */
#pragma once #pragma once
#include "../widgets/AdventureMapClasses.h" #include "../gui/CIntObject.h"
#include "CWindowObject.h"
#include "../widgets/TextControls.h" #include "../../lib/int3.h"
#include "../widgets/Buttons.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 VCMI_LIB_NAMESPACE_BEGIN
struct CGPath; class CGObjectInstance;
struct CGPathNode;
class CGHeroInstance; class CGHeroInstance;
class CGTownInstance; class CGTownInstance;
class CSpell; class CArmedInstance;
class IShipyard; class IShipyard;
struct CGPathNode;
struct ObjectPosInfo;
VCMI_LIB_NAMESPACE_END VCMI_LIB_NAMESPACE_END
class CCallback; class CButton;
class CAdvMapInt; class IImage;
class CHeroWindow; class CAnimImage;
enum class EMapAnimRedrawStatus; class CGStatusBar;
class CFadeAnimation; class CAdvMapPanel;
class CAdvMapWorldViewPanel;
class CAnimation;
struct MapDrawingInfo; struct MapDrawingInfo;
/*****************************/
enum class EAdvMapMode enum class EAdvMapMode
{ {
NORMAL, NORMAL,

View File

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

View File

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

View File

@ -7,87 +7,21 @@
* Full text of license available in license.txt file, in main folder * Full text of license available in license.txt file, in main folder
* *
*/ */
#include "StdInc.h" #include "StdInc.h"
#include "CAdvmapInterface.h" #include "CAdventureOptions.h"
#include "CCastleInterface.h" #include "CAdvMapInt.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 "../CGameInfo.h"
#include "../CMessage.h"
#include "../CMusicHandler.h"
#include "../CPlayerInterface.h" #include "../CPlayerInterface.h"
#include "../mainmenu/CMainMenu.h"
#include "../lobby/CSelectionBase.h"
#include "../lobby/CCampaignInfoScreen.h" #include "../lobby/CCampaignInfoScreen.h"
#include "../lobby/CSavingScreen.h"
#include "../lobby/CScenarioInfoScreen.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/CGuiHandler.h"
#include "../gui/SDL_Extensions.h" #include "../widgets/Buttons.h"
#include "../widgets/MiscWidgets.h"
#include "../../CCallback.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/StartInfo.h"
#include "../../lib/mapping/CMapInfo.h"
#include "../../lib/TerrainHandler.h"
#include <SDL_surface.h>
#include <SDL_events.h>
#define ADVOPT (conf.go()->ac)
using namespace CSDL_Ext;
std::shared_ptr<CAdvMapInt> adventureInt;
static void setScrollingCursor(ui8 direction)
{
if(direction & CAdvMapInt::RIGHT)
{
if(direction & CAdvMapInt::UP)
CCS->curh->set(Cursor::Map::SCROLL_NORTHEAST);
else if(direction & CAdvMapInt::DOWN)
CCS->curh->set(Cursor::Map::SCROLL_SOUTHEAST);
else
CCS->curh->set(Cursor::Map::SCROLL_EAST);
}
else if(direction & CAdvMapInt::LEFT)
{
if(direction & CAdvMapInt::UP)
CCS->curh->set(Cursor::Map::SCROLL_NORTHWEST);
else if(direction & CAdvMapInt::DOWN)
CCS->curh->set(Cursor::Map::SCROLL_SOUTHWEST);
else
CCS->curh->set(Cursor::Map::SCROLL_WEST);
}
else if(direction & CAdvMapInt::UP)
CCS->curh->set(Cursor::Map::SCROLL_NORTH);
else if(direction & CAdvMapInt::DOWN)
CCS->curh->set(Cursor::Map::SCROLL_SOUTH);
}
CAdventureOptions::CAdventureOptions() CAdventureOptions::CAdventureOptions()
: CWindowObject(PLAYER_COLORED, "ADVOPTS") : CWindowObject(PLAYER_COLORED, "ADVOPTS")

View File

@ -9,33 +9,9 @@
*/ */
#pragma once #pragma once
#include "../widgets/AdventureMapClasses.h" #include "../windows/CWindowObject.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;
class CButton;
/// Adventure options dialog where you can view the world, dig, play the replay of the last turn,... /// Adventure options dialog where you can view the world, dig, play the replay of the last turn,...
class CAdventureOptions : public CWindowObject class CAdventureOptions : public CWindowObject

View File

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

View File

@ -9,33 +9,7 @@
*/ */
#pragma once #pragma once
#include "ObjectLists.h" #include "../gui/CIntObject.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;
class CInGameConsole : public CIntObject class CInGameConsole : public CIntObject
{ {

View File

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

View File

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

View File

@ -7,45 +7,24 @@
* Full text of license available in license.txt file, in main folder * Full text of license available in license.txt file, in main folder
* *
*/ */
#include "StdInc.h" #include "StdInc.h"
#include "AdventureMapClasses.h" #include "CList.h"
#include <SDL_timer.h> #include "CAdvMapInt.h"
#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 "../widgets/Images.h"
#include "../widgets/Buttons.h"
#include "../windows/InfoWindows.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/CGeneralTextHandler.h"
#include "../../lib/CHeroHandler.h" #include "../../lib/CHeroHandler.h"
#include "../../lib/CModHandler.h" #include "../../lib/CModHandler.h"
#include "../../lib/CTownHandler.h"
#include "../../lib/TerrainHandler.h"
#include "../../lib/mapObjects/CGHeroInstance.h" #include "../../lib/mapObjects/CGHeroInstance.h"
#include "../../lib/mapping/CMap.h" #include "../../lib/mapObjects/CGTownInstance.h"
#include "ClientCommandManager.h"
#include <SDL_surface.h>
#include <SDL_keyboard.h>
#include <SDL_events.h>
CList::CListItem::CListItem(CList * Parent) CList::CListItem::CListItem(CList * Parent)
: CIntObject(LCLICK | RCLICK | HOVER), : CIntObject(LCLICK | RCLICK | HOVER),

View File

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

View File

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

View File

@ -9,34 +9,11 @@
*/ */
#pragma once #pragma once
#include "ObjectLists.h" #include "../gui/CIntObject.h"
#include "../../lib/FunctionList.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 CMinimap;
class CMinimapInstance : public CIntObject class CMinimapInstance : public CIntObject

View File

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

View File

@ -9,32 +9,7 @@
*/ */
#pragma once #pragma once
#include "../widgets/AdventureMapClasses.h" #include "../gui/CIntObject.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;
/// Resources bar which shows information about how many gold, crystals,... you have /// Resources bar which shows information about how many gold, crystals,... you have
/// Current date is displayed too /// Current date is displayed too

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -17,17 +17,17 @@
#include "BattleActionsController.h" #include "BattleActionsController.h"
#include "../CGameInfo.h" #include "../CGameInfo.h"
#include "../CMessage.h"
#include "../CPlayerInterface.h" #include "../CPlayerInterface.h"
#include "../CMusicHandler.h" #include "../CMusicHandler.h"
#include "../gui/Canvas.h"
#include "../gui/CursorHandler.h" #include "../gui/CursorHandler.h"
#include "../gui/CGuiHandler.h" #include "../gui/CGuiHandler.h"
#include "../gui/CAnimation.h"
#include "../windows/CSpellWindow.h" #include "../windows/CSpellWindow.h"
#include "../widgets/AdventureMapClasses.h"
#include "../widgets/Buttons.h" #include "../widgets/Buttons.h"
#include "../widgets/Images.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 "../../CCallback.h"
#include "../../lib/CGeneralTextHandler.h" #include "../../lib/CGeneralTextHandler.h"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -11,9 +11,14 @@
#include "StdInc.h" #include "StdInc.h"
#include "CursorHandler.h" #include "CursorHandler.h"
#include "SDL_Extensions.h"
#include "CGuiHandler.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 "../../lib/CConfigHandler.h"
#include <SDL_render.h> #include <SDL_render.h>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,19 +8,9 @@
* *
*/ */
#include "StdInc.h" #include "StdInc.h"
#include "CAnimation.h" #include "CFadeAnimation.h"
#include "SDL_Extensions.h" #include "../renderSDL/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 <SDL_surface.h> #include <SDL_surface.h>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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;
};

View File

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

View File

@ -9,20 +9,7 @@
*/ */
#pragma once #pragma once
VCMI_LIB_NAMESPACE_BEGIN #include "../render/IFont.h"
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 CBitmapFont : public IFont class CBitmapFont : public IFont
{ {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,19 +8,17 @@
* *
*/ */
#include "StdInc.h" #include "StdInc.h"
#include "CAnimation.h" #include "SDLImage.h"
#include "SDLImageLoader.h"
#include "SDL_Extensions.h" #include "SDL_Extensions.h"
#include "ColorFilter.h"
#include "../CBitmapHandler.h" #include "../render/ColorFilter.h"
#include "../Graphics.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/JsonNode.h"
#include "../../lib/CRandomGenerator.h"
#include "../../lib/vcmi_endian.h"
#include <SDL_surface.h> #include <SDL_surface.h>

View File

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

View File

@ -7,27 +7,16 @@
* Full text of license available in license.txt file, in main folder * Full text of license available in license.txt file, in main folder
* *
*/ */
#include "StdInc.h" #include "StdInc.h"
#include "CAnimation.h" #include "SDLImageLoader.h"
#include "SDL_Extensions.h" #include "SDLImage.h"
#include "ColorFilter.h"
#include "../CBitmapHandler.h" #include "../../lib/Point.h"
#include "../Graphics.h"
#include "../../lib/filesystem/Filesystem.h"
#include "../../lib/filesystem/ISimpleResourceLoader.h"
#include "../../lib/JsonNode.h"
#include "../../lib/CRandomGenerator.h"
#include "../../lib/vcmi_endian.h"
#include <SDL_surface.h> #include <SDL_surface.h>
/*************************************************************************
* Classes for image loaders - helpers for loading from def files *
*************************************************************************/
SDLImageLoader::SDLImageLoader(SDLImage * Img): SDLImageLoader::SDLImageLoader(SDLImage * Img):
image(Img), image(Img),
lineStart(nullptr), lineStart(nullptr),
@ -52,7 +41,7 @@ void SDLImageLoader::init(Point SpriteSize, Point Margins, Point FullSize, SDL_C
lineStart = position = (ui8*)image->surf->pixels; 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) 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) 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; lineStart += image->surf->pitch;
position = lineStart; position = lineStart;

View File

@ -9,43 +9,21 @@
*/ */
#pragma once #pragma once
#include "../../lib/GameConstants.h" #include "../render/IImageLoader.h"
#ifdef IN class SDLImageLoader : public IImageLoader
#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
{ {
SDLImage * image; SDLImage * image;
ui8 * lineStart; ui8 * lineStart;
ui8 * position; ui8 * position;
public: public:
//load size raw pixels from data //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 //set size pixels to color
inline void Load(size_t size, ui8 color=0); void load(size_t size, ui8 color=0);
inline void EndLine(); void endLine();
//init image with these sizes and palette //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(SDLImage * Img);
~SDLImageLoader(); ~SDLImageLoader();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -10,25 +10,24 @@
#include "StdInc.h" #include "StdInc.h"
#include "CCastleInterface.h" #include "CCastleInterface.h"
#include "CAdvmapInterface.h"
#include "CHeroWindow.h" #include "CHeroWindow.h"
#include "CTradeWindow.h" #include "CTradeWindow.h"
#include "InfoWindows.h" #include "InfoWindows.h"
#include "GUIClasses.h" #include "GUIClasses.h"
#include "QuickRecruitmentWindow.h" #include "QuickRecruitmentWindow.h"
#include "../CBitmapHandler.h"
#include "../CGameInfo.h" #include "../CGameInfo.h"
#include "../CMessage.h"
#include "../CMusicHandler.h" #include "../CMusicHandler.h"
#include "../CPlayerInterface.h" #include "../CPlayerInterface.h"
#include "../Graphics.h"
#include "../gui/CGuiHandler.h" #include "../gui/CGuiHandler.h"
#include "../gui/CAnimation.h"
#include "../gui/ColorFilter.h"
#include "../gui/SDL_Extensions.h"
#include "../widgets/MiscWidgets.h" #include "../widgets/MiscWidgets.h"
#include "../widgets/CComponent.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 "../../CCallback.h"
#include "../../lib/CArtHandler.h" #include "../../lib/CArtHandler.h"

View File

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

View File

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

View File

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

View File

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

Some files were not shown because too many files have changed in this diff Show More