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