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/input/input_manager.cpp"
"src/scripting/script_manager.cpp" "src/scripting/script_manager.cpp"
"src/scripting/coreAPI.cpp" "src/scripting/coreAPI.cpp"
"src/world/world.cpp"
) )
# add the executable # 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) ✔ Modify .sh scripts to recognize the noeditor flag @done (1/25/2022, 3:59:23 PM)
Core: 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) ✔ 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) ✔ 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 ☐ 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) ✔ Utils @done(22-05-13 17:29)
☐ assets ✔ assets @done(22-05-17 14:27)
☐ gui ✔ gui @done(22-05-17 14:27)
☐ Replace the File Browser (imgui) class with the NFD library (https://github.com/btzy/nativefiledialog-extended) @high ☐ 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 ☐ 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) ✔ 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) ✔ 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) ✔ Allow an image size to be passed in for rendering to an image @high @done (2/3/2022, 4:07:33 PM)
Scripting: 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: Script Managment class:
✘ Manage LUA states @cancelled(22-05-13 17:31) ✘ Manage LUA states @cancelled(22-05-13 17:31)
@ -58,18 +56,34 @@ Core:
☐ Provide Methods that give access to the C++ code ☐ Provide Methods that give access to the C++ code
ECS: 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?) ☐ 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: Components:
☐ Transform (store decomposed matrix) ☐ Transform
☐ Sprite Renderer ☐ SpriteRenderer
☐ Scripts ☐ Animation Controller
☐ Script
☐ Audio Listener
Physics: Physics:
☐ Rigid Body (Box2D) ☐ Rigid Body (Box2D)
☐ Box Collider (Box2D) ☐ Box Collider (Box2D)
World (Lunariums version of a "Scene"): 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: GUI:
✔ Dear ImGui class with basic initialization @done (9/10/2021, 1:42:19 PM) ✔ Dear ImGui class with basic initialization @done (9/10/2021, 1:42:19 PM)

@ -6,42 +6,13 @@ Game:
☐ Manage global scripts ☐ Manage global scripts
☐ Handle Events from the core ☐ 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: Camera:
☐ Current Region ☐ Current Region
☐ Current Position within 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: Game Object:
✘ List of components @cancelled(22-05-16 20:01) ✘ 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: Animations:
☐ Animated Sprite class ☐ 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 // Platform detection
#if defined(_WIN32) || defined(_WIN64) #if defined(_WIN32) || defined(_WIN64)
#define LPLATFORM_WINDOWS #define LPLATFORM_WINDOWS
#elif defined(__linux__) || defined(__gnu_linux__) #elif defined(__linux__) || defined(__gnu_linux__)
#define LPLATFORM_LINUX #define LPLATFORM_LINUX
#else #else
#error "Unsupported platform. Must build on windows or linux" #error "Unsupported platform. Must build on windows or linux"
#endif #endif
#endif // LUNARIUM_COMMON_DEFS_H_ #endif // LUNARIUM_COMMON_DEFS_H_

@ -1,13 +1,13 @@
add_library(game world/world.cpp) # add_library(game )
target_include_directories(game # target_include_directories(game
PUBLIC "${PROJECT_BINARY_DIR}" # PUBLIC "${PROJECT_BINARY_DIR}"
PUBLIC ./ # PUBLIC ./
PUBLIC ../../ # PUBLIC ../../
PUBLIC ../../internal_libs # PUBLIC ../../internal_libs
PUBLIC ../../../external/glm # PUBLIC ../../../external/glm
PUBLIC ../../../external/glad/include # PUBLIC ../../../external/glad/include
PUBLIC ../../../external/glfw/include # PUBLIC ../../../external/glfw/include
PUBLIC ../../../external/box2d/include # PUBLIC ../../../external/box2d/include
PUBLIC ../../../external/pugixml/src # 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 "world.h"
#include <object/object.h>
#include <assets/types/script.h> #include <assets/types/script.h>
#include <assets/types/image.h> #include <assets/types/image.h>
#include <graphics/graphics.h> #include <graphics/graphics.h>
#include <graphics/camera.h> #include <graphics/camera.h>
namespace lunarium { namespace game namespace lunarium
{ {
World::World(Camera* pCam, Sizei region_size, Sizei world_size) World::World(Camera* pCam, Sizei region_size, Sizei world_size)
: mpCamera(pCam), mRegionSize(region_size), mpWorldScript(nullptr), mWorldSize(world_size) : mpCamera(pCam), mRegionSize(region_size), mpWorldScript(nullptr), mWorldSize(world_size)
@ -70,4 +69,4 @@ namespace lunarium { namespace game
return mpWorldScript; return mpWorldScript;
} }
}} }

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