Final refactor touches

core_refactor
Joey Pollack 4 years ago
parent eeb33c06ff
commit 564f3e8efe

@ -87,6 +87,7 @@ set(LUNARIUM_SRC
"src/input/input_manager.cpp"
"src/scripting/script_manager.cpp"
"src/scripting/coreAPI.cpp"
"src/world/world.cpp"
)
# add the executable

@ -7,17 +7,14 @@ Build System:
✔ Modify .sh scripts to recognize the noeditor flag @done (1/25/2022, 3:59:23 PM)
Core:
☐ Research EnTT for the ECS (https://github.com/skypjack/entt/)
✔ Add Terminal subsystem to allow for printing colored text in a cross-platform way @done(22-05-16 18:05)
✔ Create a LogListener that uses the colored text (replace the current stdout listener) @done(22-05-16 18:23)
☐ Replace XML with JSON (https://github.com/nlohmann/json) @high
Move internal libs back into the core and refactor @high
Move internal libs back into the core and refactor @high @done(22-05-17 14:27)
✔ Utils @done(22-05-13 17:29)
☐ assets
☐ gui
✔ assets @done(22-05-17 14:27)
✔ gui @done(22-05-17 14:27)
☐ Replace the File Browser (imgui) class with the NFD library (https://github.com/btzy/nativefiledialog-extended) @high
☐ For scripting switch to Wren instead of LUA (https://github.com/wren-lang/wren) @high
☐ Remove SOL
☐ Add log settings to the state file
✔ Refactor log system to use separate log level methods instead of passing log level @done(22-05-12 16:46)
✔ Add log level options to config script @done(22-05-12 16:46)
@ -46,7 +43,8 @@ Core:
✔ Allow an image size to be passed in for rendering to an image @high @done (2/3/2022, 4:07:33 PM)
Scripting:
☐ Replace LUA with Wren for scripting
☐ Switch to Wren instead of LUA (https://github.com/wren-lang/wren) @high
☐ Remove SOL
Script Managment class:
✘ Manage LUA states @cancelled(22-05-13 17:31)
@ -58,18 +56,34 @@ Core:
☐ Provide Methods that give access to the C++ code
ECS:
☐ Research using ECS with a quadtree (regions will essentially be out quadtree)
☐ Research EnTT for the ECS (https://github.com/skypjack/entt/)
☐ Research using ECS with a quadtree (regions may essentially be a quadtree)
☐ Use 1 Entt registry with a component that stores the region ID (Index?)
☐ Entity class - Store a reference to the registry?
Enitity:
☐ Single UUID
☐ Functionality for adding/working with components (through EnTT)
Components:
☐ Transform (store decomposed matrix)
☐ Transform
☐ SpriteRenderer
☐ Scripts
☐ Animation Controller
☐ Script
☐ Audio Listener
Physics:
☐ Rigid Body (Box2D)
☐ Box Collider (Box2D)
World (Lunariums version of a "Scene"):
☐ Track/manage loaded regions
☐ Render loaded Regions
Region:
☐ List of renderable images for each layer
☐ List of game objects (by reference) in this Region
☐ Implement image grid within regions
[Regions could potentially be split into multiple images (an internal grid).
To support larger region sizes without needing single images that are like 1048576x1048576 or some nonsense.]
GUI:
✔ Dear ImGui class with basic initialization @done (9/10/2021, 1:42:19 PM)

@ -6,42 +6,13 @@ Game:
☐ Manage global scripts
☐ Handle Events from the core
Scene:
☐ Manage scene scripts
☐ Manage the master list of game objects in scene
☐ Contains a World (World System)
World System:
☐ Track/manage loaded regions
☐ Render loaded Regions
Camera:
☐ Current Region
☐ Current Position within Region
Region:
☐ List of renderable images for each layer
☐ List of game objects (by reference) in this Region
☐ Implement image grid within regions
[Regions could potentially be split into multiple images (an internal grid).
To support larger region sizes without needing single images that are like 1048576x1048576 or some nonsense.]
Game Object:
✘ List of components @cancelled(22-05-16 20:01)
Enitity:
☐ Single UUID
☐ Functionality for adding/working with components (through EnTT)
Components:
☐ Transform
☐ Image
☐ Animation Controller
☐ Collider (maybe via Box2D?)
☐ Script
☐ RigidBody (via Box2D)
☐ Audio Listener
Animations:
☐ Animated Sprite class

File diff suppressed because it is too large Load Diff

@ -43,10 +43,13 @@ static_assert(sizeof(f64) == 8, "Expected f64 to be 8 bytes");
// Platform detection
#if defined(_WIN32) || defined(_WIN64)
#define LPLATFORM_WINDOWS
#elif defined(__linux__) || defined(__gnu_linux__)
#define LPLATFORM_LINUX
#else
#error "Unsupported platform. Must build on windows or linux"
#endif
#endif // LUNARIUM_COMMON_DEFS_H_

@ -1,13 +1,13 @@
add_library(game world/world.cpp)
# add_library(game )
target_include_directories(game
PUBLIC "${PROJECT_BINARY_DIR}"
PUBLIC ./
PUBLIC ../../
PUBLIC ../../internal_libs
PUBLIC ../../../external/glm
PUBLIC ../../../external/glad/include
PUBLIC ../../../external/glfw/include
PUBLIC ../../../external/box2d/include
PUBLIC ../../../external/pugixml/src
)
# target_include_directories(game
# PUBLIC "${PROJECT_BINARY_DIR}"
# PUBLIC ./
# PUBLIC ../../
# PUBLIC ../../internal_libs
# PUBLIC ../../../external/glm
# PUBLIC ../../../external/glad/include
# PUBLIC ../../../external/glfw/include
# PUBLIC ../../../external/box2d/include
# PUBLIC ../../../external/pugixml/src
# )

@ -1,20 +0,0 @@
/******************************************************************************
* File - object.h
* Author - Joey Pollack
* Date - 2022/01/25 (y/m/d)
* Mod Date - 2022/01/25 (y/m/d)
* Description - The base object for all in-game objects
******************************************************************************/
#ifndef OBJECT_H_
#define OBJECT_H_
namespace lunarium
{
class GameObject
{
};
}
#endif // OBJECT_H_

@ -10,13 +10,12 @@
******************************************************************************/
#include "world.h"
#include <object/object.h>
#include <assets/types/script.h>
#include <assets/types/image.h>
#include <graphics/graphics.h>
#include <graphics/camera.h>
namespace lunarium { namespace game
namespace lunarium
{
World::World(Camera* pCam, Sizei region_size, Sizei world_size)
: mpCamera(pCam), mRegionSize(region_size), mpWorldScript(nullptr), mWorldSize(world_size)
@ -70,4 +69,4 @@ namespace lunarium { namespace game
return mpWorldScript;
}
}}
}

@ -12,11 +12,12 @@
#ifndef WORLD_H_
#define WORLD_H_
#include <vector>
#include <map>
#include <core/types.h>
#include <utils/op_res.h>
#include <vector>
#include <map>
namespace lunarium
{
class Graphics;
@ -24,7 +25,7 @@ namespace lunarium
class Script;
}
namespace lunarium { namespace game
namespace lunarium
{
class Camera;
class GameObject;
@ -75,6 +76,6 @@ namespace lunarium { namespace game
};
}}
}
#endif // WORLD_H_
Loading…
Cancel
Save