From aa3bfbf823c301a433aa2c048ee6b0bf31843950 Mon Sep 17 00:00:00 2001 From: Klemen Plestenjak Date: Fri, 29 Dec 2023 13:43:01 +0100 Subject: [PATCH] Add static keyword to ease inout sine function --- engine/breeze/math/easings.h | 2 +- game/{systems_ai.c => systems/s_ai.c} | 5 +---- game/{systems_entity.c => systems/s_entity.c} | 0 game/{systems_input.c => systems/s_input.c} | 0 game/{systems_ui.c => systems/s_ui.c} | 0 game/{ => systems}/systems.h | 5 +++++ 6 files changed, 7 insertions(+), 5 deletions(-) rename game/{systems_ai.c => systems/s_ai.c} (90%) rename game/{systems_entity.c => systems/s_entity.c} (100%) rename game/{systems_input.c => systems/s_input.c} (100%) rename game/{systems_ui.c => systems/s_ui.c} (100%) rename game/{ => systems}/systems.h (94%) diff --git a/engine/breeze/math/easings.h b/engine/breeze/math/easings.h index 59f4b43..bb4c327 100644 --- a/engine/breeze/math/easings.h +++ b/engine/breeze/math/easings.h @@ -48,7 +48,7 @@ static f32 bzEaseInSine(f32 x) { static f32 bzEaseOutSine(f32 x) { return sinf((x * M_PI) / 2.0f); } -f32 bzEaseInOutSine(f32 x) { +static f32 bzEaseInOutSine(f32 x) { return -(-cosf(M_PI * x) - 1) / 2.0f; } diff --git a/game/systems_ai.c b/game/systems/s_ai.c similarity index 90% rename from game/systems_ai.c rename to game/systems/s_ai.c index ea62122..a557d7d 100644 --- a/game/systems_ai.c +++ b/game/systems/s_ai.c @@ -24,10 +24,7 @@ void updateUnitAISystem(ecs_iter_t *it) { ecs_entity_t entity = it->entities[i]; Action *firstAction = action[i].first; - if (firstAction) - unitAI[i].action = firstAction; - else - unitAI[i].action = NULL; + unitAI[i].action = firstAction; updateUnitAI(entity, &unitAI[i], game); } diff --git a/game/systems_entity.c b/game/systems/s_entity.c similarity index 100% rename from game/systems_entity.c rename to game/systems/s_entity.c diff --git a/game/systems_input.c b/game/systems/s_input.c similarity index 100% rename from game/systems_input.c rename to game/systems/s_input.c diff --git a/game/systems_ui.c b/game/systems/s_ui.c similarity index 100% rename from game/systems_ui.c rename to game/systems/s_ui.c diff --git a/game/systems.h b/game/systems/systems.h similarity index 94% rename from game/systems.h rename to game/systems/systems.h index 3bf207a..3b5ef6d 100644 --- a/game/systems.h +++ b/game/systems/systems.h @@ -111,6 +111,11 @@ void renderRotationDirection(ecs_iter_t *it); */ void renderDebugPath(ecs_iter_t *it); +/********************************** + * Event Systems + **********************************/ + +i32 harvestEvent(ecs_entity_t entity, HarvestEvent event); /**********************************