Update to latest json library. Test build of refactored code.
This commit is contained in:
@@ -20,9 +20,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
include(cmake/CPM.cmake)
|
||||
|
||||
file(GLOB_RECURSE FORMAT_HEADERS "include/Format/*.hpp")
|
||||
file(GLOB_RECURSE FORMAT_SRC "src/Format/*.cpp")
|
||||
|
||||
file(GLOB_RECURSE EDITOR_HEADERS "include/Editor/*.hpp")
|
||||
file(GLOB_RECURSE FORMAT_SRC "src/Format/*.cpp" "src/Re2DLevelAPI.cpp")
|
||||
file(GLOB_RECURSE EDITOR_SRC "src/Editor/*.cpp")
|
||||
|
||||
file(GLOB_RECURSE DEMOGAME_HEADERS "include/DemoGame/*.hpp")
|
||||
@@ -39,7 +37,7 @@ CPMAddPackage(NAME jlog
|
||||
CPMAddPackage(NAME Event
|
||||
URL https://git.redacted.cc/josh/Event/archive/Release-12.zip)
|
||||
|
||||
CPMAddPackage(NAME jjx
|
||||
CPMAddPackage(NAME json
|
||||
URL https://git.redacted.cc/josh/json/archive/Release-1.3.zip)
|
||||
|
||||
CPMAddPackage(NAME J3ML
|
||||
@@ -94,7 +92,7 @@ target_include_directories(Editor PUBLIC
|
||||
|
||||
target_link_libraries(LevelFormat PUBLIC Event J3ML json)
|
||||
|
||||
target_link_libraries(Editor PUBLIC Event J3ML jlog ReWindow JGL JUI mcolor jjx)
|
||||
target_link_libraries(Editor PUBLIC LevelFormat jlog ReWindow JGL JUI mcolor)
|
||||
|
||||
|
||||
|
||||
|
@@ -146,6 +146,7 @@ public:
|
||||
int CellToIndex(Vector2i cell, int width);
|
||||
|
||||
EditorApp();
|
||||
EditorApp(int width, int height);
|
||||
~EditorApp() override
|
||||
{
|
||||
}
|
||||
|
@@ -1,11 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <JJX/JSON.hpp>
|
||||
#include <json.hpp>
|
||||
#include <Color4.hpp>
|
||||
#include <J3ML/LinearAlgebra/Vector2.hpp>
|
||||
|
||||
using namespace JJX;
|
||||
|
||||
struct RecentCameraState
|
||||
{
|
||||
Vector2 translation;
|
||||
|
@@ -9,7 +9,6 @@ enum class EntityRepresentativeShape {
|
||||
Point, AABB, Sphere, OBB
|
||||
};
|
||||
|
||||
|
||||
/// @class Entity
|
||||
/// @brief Represents an object or interactive element placed on the map, not necessarily tied to the tile grid.
|
||||
/// This can include plater spawn points, enemies, pickups, triggers, boxes (my favorite), or any other
|
||||
|
@@ -147,11 +147,14 @@ int EditorApp::CellToIndex(Vector2i cell, int width)
|
||||
return cell.y*width + cell.x;
|
||||
}
|
||||
|
||||
EditorApp::EditorApp(): OpenGLWindow("Editor App", 1776, 1000, GL_VER_MAJOR, GL_VER_MINOR)
|
||||
|
||||
EditorApp::EditorApp(int width, int height) : OpenGLWindow("Editor App", width, height, GL_VER_MAJOR, GL_VER_MINOR)
|
||||
{
|
||||
camera.DefaultState();
|
||||
}
|
||||
|
||||
EditorApp::EditorApp(): EditorApp(1024, 600) {}
|
||||
|
||||
void EditorApp::LoadPreferences()
|
||||
{
|
||||
if (std::filesystem::exists("preferences.json"))
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#include <Format/Level.hpp>
|
||||
#include <Colors.hpp>
|
||||
|
||||
|
||||
Level::Level(): rows(0), cols(0)
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include <Colors.hpp>
|
||||
#include <Re2DLevelAPI.hpp>
|
||||
#include <fstream>
|
||||
#include <json.hpp>
|
||||
|
||||
|
||||
Color4 JsonConversions::parse_color(const json::value& v)
|
||||
@@ -14,7 +15,7 @@ Color4 JsonConversions::parse_color(const json::value& v)
|
||||
int g = color_array[1].number.value();
|
||||
int b = color_array[2].number.value();
|
||||
int a = 255;
|
||||
if (color_array.value::array.value().size() == 4)
|
||||
if (color_array.size() == 4)
|
||||
a = color_array[3].number.value();
|
||||
return Color4(r, g, b, a);
|
||||
}
|
||||
|
Reference in New Issue
Block a user