diff --git a/.gitmodules b/.gitmodules index de43ab3..0bab840 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "depends/raylib-cpp"] - path = depends/raylib-cpp - url = https://github.com/robloach/raylib-cpp [submodule "depends/raylib"] path = depends/raylib url = https://github.com/raysan5/raylib diff --git a/Makefile b/Makefile index 5b2480c..7f2a516 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ WEB_HEAP_SIZE := 335544320 WEB_STACK_SIZE := 196608 WEB_SHELL := src/shell.html -DEBUG_MODE := no +DEBUG_MODE := yes COMPILER_FLAGS := -std=c++17 -Wno-enum-compare -O3 -flto -msse4.2 -mavx COMPILER_FLAGS += -DRPROF_IMPLEMENTATION @@ -40,7 +40,6 @@ EMSDK_PATH := $(SUBMODULES_PATH)/emsdk RAYLIB_PLATFORM := PLATFORM_DESKTOP COMPILER_FLAGS += -I$(SUBMODULES_PATH)/raylib/src -COMPILER_FLAGS += -I$(SUBMODULES_PATH)/raylib-cpp/include ifeq ($(OS), Windows_NT) CXX ?= g++ diff --git a/depends/raylib-cpp b/depends/raylib-cpp deleted file mode 160000 index 3f2b428..0000000 --- a/depends/raylib-cpp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3f2b428211ad04b2a3acefd65a9621a116678108 diff --git a/src/main.cpp b/src/main.cpp index 1115dc3..dee44d3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,16 +19,13 @@ static App g_app; +// TODO: Use compute shaders/multithreading to speed up performance // TODO: Repeat visuals in looping walls mode - // TODO: Make WASM canvas resizable - // TODO: Add prompt for restarting program in WASM on crash - // TODO: Add controls window - // TODO: Make boids form specific shapes defined by user, options: -// Circles, triangles, by image, text. +// Circles, triangles, by image, text. void UpdateDrawFrame(); static void profiling_test(); @@ -109,7 +106,7 @@ void UpdateDrawFrame() { // If user goes to another tab and comes back, the time that the user was gone needs to be ignored. // So boids wouldn't tunnel through walls and do other shenanigans. if (dt <= 5*TIME_PER_FRAME) { - world_update(&g_world, dt); + world_update(&g_app.world, dt); } #else world_update(&g_app.world, dt); diff --git a/src/raycast.cpp b/src/raycast.cpp index 227ac19..3b5c3a7 100644 --- a/src/raycast.cpp +++ b/src/raycast.cpp @@ -1,5 +1,5 @@ #include "raycast.hpp" -#include "raymath.hpp" +#include "raymath.h" static float get_intersect_point(Vector2 ray_origin, Vector2 ray_dir, Vector2 line1, Vector2 line2) { Vector2 line_dir = Vector2Subtract(line2, line1); diff --git a/src/ui.cpp b/src/ui.cpp index e976b68..b5d607f 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -40,7 +40,7 @@ static void ui_draw(World *world, Visuals *visuals, UI *ui) { return; } - float panel_height = 335; + float panel_height = 315; ui->show_panel = !GuiWindowBox({ 20, 20, 660, panel_height }, "Control panel"); float group_height = panel_height - 45; @@ -54,7 +54,8 @@ static void ui_draw(World *world, Visuals *visuals, UI *ui) { GuiCheckBox(next_in_layout(&layout, 15, 15), "Show view cone", &visuals->draw_view_cone); GuiCheckBox(next_in_layout(&layout, 15, 15), "Show separation radius", &visuals->draw_separation_radius); GuiCheckBox(next_in_layout(&layout, 15, 15), "Show collision rays", &visuals->draw_collision_avoidance_rays); - GuiCheckBox(next_in_layout(&layout, 15, 15), "Show pulling forces", &visuals->draw_pulling_forces); + // TODO: Visualize cohesion, alignment and separation forces + // GuiCheckBox(next_in_layout(&layout, 15, 15), "Show pulling forces", &visuals->draw_pulling_forces); GuiSlider(next_in_layout(&layout, 100, 15), NULL, "Boid size", &visuals->boid_edge_size, 2.5, 50); Rectangle boid_color_rect = next_in_layout(&layout, 50, 50);