1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Fix build

This commit is contained in:
Ivan Savenko
2025-02-21 16:00:59 +00:00
parent 645b95ba02
commit cbcd48aabb
8 changed files with 15 additions and 15 deletions

View File

@@ -11,10 +11,13 @@
class CServerHandler;
class GlobalLobbyClient;
class INetworkHandler;
class CPlayerInterface;
class CMapHandler;
VCMI_LIB_NAMESPACE_BEGIN
class INetworkHandler;
VCMI_LIB_NAMESPACE_END
class GameInstance : boost::noncopyable
{
std::unique_ptr<CServerHandler> serverInstance;

View File

@@ -96,7 +96,7 @@ CMinimap::CMinimap(const Rect & position)
double maxSideLengthSrc = std::max(GAME->interface()->cb->getMapSize().x, GAME->interface()->cb->getMapSize().y);
double maxSideLengthDst = std::max(position.w, position.h);
double resize = maxSideLengthSrc / maxSideLengthDst;
Point newMinimapSize(GAME->interface()->cb->getMapSize().x/ resize, LOCPLINT->cb->getMapSize().y / resize);
Point newMinimapSize(GAME->interface()->cb->getMapSize().x/ resize, GAME->interface()->cb->getMapSize().y / resize);
Point offset = Point((std::max(newMinimapSize.x, newMinimapSize.y) - newMinimapSize.x) / 2, (std::max(newMinimapSize.x, newMinimapSize.y) - newMinimapSize.y) / 2);
pos.x += offset.x;

View File

@@ -24,8 +24,6 @@
#include "../../lib/mapObjects/ObjectTemplate.h"
#include "../../lib/mapping/CMap.h"
std::unique_ptr<CMapHandler> MAPHANDLER = nullptr;
bool CMapHandler::hasOngoingAnimations()
{
for(auto * observer : observers)
@@ -242,6 +240,5 @@ IMapObjectObserver::IMapObjectObserver()
IMapObjectObserver::~IMapObjectObserver()
{
if (LIBRARY && MAPHANDLER)
GAME->map().removeMapObserver(this);
GAME->map().removeMapObserver(this);
}

View File

@@ -57,12 +57,12 @@ CPuzzleWindow::CPuzzleWindow(const int3 & GrailPos, double discoveredRatio)
const SPuzzleInfo & info = elem;
auto piece = std::make_shared<CPicture>(info.filename, info.position.x, info.position.y);
piece->needRefresh = true;
//piece that will slowly disappear
if(info.whenUncovered <= GameConstants::PUZZLE_MAP_PIECES * discoveredRatio)
{
piecesToRemove.push_back(piece);
piece->needRefresh = true;
piece->recActions = piece->recActions & ~SHOWALL;
}
else

View File

@@ -467,7 +467,7 @@ static void mainLoop()
logConfig = nullptr;
}
ENGINE.reset();
//ENGINE.reset();
std::cout << "Ending...\n";
quitApplicationImmediately(0);

View File

@@ -89,7 +89,7 @@ const HeroTypeService * GameLibrary::heroTypes() const
}
#if SCRIPTING_ENABLED
const scripting::Service * LibClasses::scripts() const
const scripting::Service * GameLibrary::scripts() const
{
return scriptHandler.get();
}
@@ -200,7 +200,7 @@ void GameLibrary::init(bool onlyEssential)
}
#if SCRIPTING_ENABLED
void LibClasses::scriptsLoaded()
void GameLibrary::scriptsLoaded()
{
scriptHandler->performRegistration(this);
}

View File

@@ -18,7 +18,7 @@
#include "../mock/mock_spells_effects_Registry.h"
#include "../mock/mock_ServerCallback.h"
#include "../../../lib/VCMI_Lib.h"
#include "../../../lib/GameLibrary.h"
#include "../../lib/json/JsonUtils.h"
#include "../../../lib/ScriptHandler.h"
#include "../../../lib/CScriptingModule.h"
@@ -110,7 +110,7 @@ protected:
{
EXPECT_CALL(registryMock, add(Eq(SCRIPT_NAME), _)).WillOnce(SaveArg<1>(&factory));
EXPECT_CALL(scriptMock, getName()).WillRepeatedly(ReturnRef(SCRIPT_NAME));
VLC->scriptHandler->lua->registerSpellEffect(&registryMock, &scriptMock);
LIBRARY->scriptHandler->lua->registerSpellEffect(&registryMock, &scriptMock);
GTEST_ASSERT_NE(factory, nullptr);
subject.reset(factory->create());

View File

@@ -9,7 +9,7 @@
*/
#include "StdInc.h"
#include "lib/modding/ModScope.h"
#include "lib/VCMI_Lib.h"
#include "lib/GameLibrary.h"
#include "ScriptFixture.h"
@@ -31,7 +31,7 @@ void ScriptFixture::loadScriptFromFile(const std::string & path)
void ScriptFixture::loadScript(const JsonNode & scriptConfig)
{
subject = VLC->scriptHandler->loadFromJson(&loggerMock, ModScope::scopeBuiltin(), scriptConfig, "test");
subject = LIBRARY->scriptHandler->loadFromJson(&loggerMock, ModScope::scopeBuiltin(), scriptConfig, "test");
GTEST_ASSERT_NE(subject, nullptr);
@@ -42,7 +42,7 @@ void ScriptFixture::loadScript(const JsonNode & scriptConfig)
void ScriptFixture::loadScript(ModulePtr module, const std::string & scriptSource)
{
subject = std::make_shared<ScriptImpl>(VLC->scriptHandler.get());
subject = std::make_shared<ScriptImpl>(LIBRARY->scriptHandler.get());
subject->host = module;
subject->sourceText = scriptSource;