Move flecs out of engine, reorganize systems
This commit is contained in:
@@ -20,22 +20,14 @@ typedef struct BzAppDesc {
|
||||
BzAppRenderFunc imguiRender;
|
||||
BzAppDeinitFunc deinit;
|
||||
|
||||
bool useFlecs;
|
||||
|
||||
void *userData;
|
||||
} BzAppDesc;
|
||||
|
||||
typedef struct ecs_world_t ecs_world_t;
|
||||
extern ecs_world_t *ECS;
|
||||
|
||||
extern bool bzMain(BzAppDesc *appDesc, int argc, const char **argv);
|
||||
|
||||
#ifdef BZ_ENTRYPOINT
|
||||
#include <flecs.h>
|
||||
#include <rlImGui.h>
|
||||
|
||||
ecs_world_t *ECS = NULL;
|
||||
|
||||
// https://www.raylib.com/examples/core/loader.html?name=core_custom_logging
|
||||
static void bzRaylibLogger(int msgType, const char *text, va_list args) {
|
||||
BzLoggerLevel level = BZ_LOG_TRACE;
|
||||
@@ -94,8 +86,6 @@ int main(int argc, const char **argv) {
|
||||
SetTargetFPS(appDesc.fps);
|
||||
// Initialize modules
|
||||
|
||||
if (appDesc.useFlecs)
|
||||
ECS = ecs_init();
|
||||
if (appDesc.imguiRender)
|
||||
rlImGuiSetup(true);
|
||||
|
||||
@@ -131,10 +121,6 @@ int main(int argc, const char **argv) {
|
||||
// Deinitialize modules
|
||||
if (appDesc.imguiRender)
|
||||
rlImGuiShutdown();
|
||||
if (ECS) {
|
||||
ecs_fini(ECS);
|
||||
ECS = NULL;
|
||||
}
|
||||
|
||||
CloseWindow();
|
||||
bzLoggerDeinit();
|
||||
|
||||
Reference in New Issue
Block a user