Вынес рендер в отдельный модуль. Сделал систему вызовов для модулй к ядру. Исправил баг в SaveMap. Убрал поддержку linux, так как трудно поддерживать обе платформы. Убрал тесты для linux.
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
#include <thread>
|
||||
|
||||
#include "Core/CoreInstance.h"
|
||||
#include "Core/RenderEngine.h"
|
||||
#include "Game/WorldFactory.h"
|
||||
#include "SaveMap/SaveMap.h"
|
||||
#include "Game/World/World.h"
|
||||
@@ -15,8 +14,6 @@ extern std::vector<WorldFactory> world_factories;
|
||||
|
||||
GameInstance::GameInstance(CoreInstance& core) : core(core)
|
||||
{
|
||||
render_engine_ = std::make_unique<RenderEngine>(core.getGameName(), 0, 0, 0, 0, 0, 0);
|
||||
render_engine_->onCloseWindow.bind(this, &GameInstance::quit);
|
||||
const std::string& base_world = core.getBaseWorldName();
|
||||
|
||||
// Init directories
|
||||
@@ -51,7 +48,6 @@ GameInstance::~GameInstance()
|
||||
|
||||
void GameInstance::start()
|
||||
{
|
||||
render_engine_->start();
|
||||
world->BeginPlay();
|
||||
|
||||
auto first = std::chrono::steady_clock::now();
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
class CoreInstance;
|
||||
class World;
|
||||
class RenderEngine;
|
||||
|
||||
#define GENERATE_FACTORY_GAME_INSTANCE(Class) \
|
||||
GameInstance* GameFactory(CoreInstance& core) { return new Class(core); }
|
||||
@@ -14,7 +13,6 @@ class GameInstance
|
||||
{
|
||||
CoreInstance& core;
|
||||
World* world = nullptr;
|
||||
std::unique_ptr<RenderEngine> render_engine_;
|
||||
|
||||
std::atomic<bool> is_running = true;
|
||||
|
||||
|
||||
@@ -49,17 +49,17 @@ SaveMap::SaveMap(const std::string& json_data)
|
||||
}
|
||||
|
||||
if (name[0] == 'i') {
|
||||
size_t begin = json_data.find(':', i) + 1;
|
||||
size_t begin = json_data.find(':', i) + 2;
|
||||
size_t end = i = json_data.find_first_of(",}", i);
|
||||
i++;
|
||||
std::string value = json_data.substr(begin, end - begin);
|
||||
std::string value = json_data.substr(begin, end - begin - 1);
|
||||
save_long[name.c_str() + 1] = std::stoll(value);
|
||||
} else if (name[0] == 'd')
|
||||
{
|
||||
size_t begin = json_data.find(':', i) + 1;
|
||||
size_t begin = json_data.find(':', i) + 2;
|
||||
size_t end = i = json_data.find_first_of(",}", i);
|
||||
i++;
|
||||
std::string value = json_data.substr(begin, end - begin);
|
||||
std::string value = json_data.substr(begin, end - begin - 1);
|
||||
save_double[name.c_str() + 1] = std::stod(value);
|
||||
} else if (name[0] == 's')
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user