From 771e9b59b314c9d11df1087975a17514c0a6a518 Mon Sep 17 00:00:00 2001 From: Krzosa Karol Date: Sat, 22 Apr 2023 21:00:02 +0200 Subject: [PATCH] Core: Array is now module --- build/{rtsgame => modules}/array.core | 0 build/rtsgame/main.core | 12 ++++++++---- core_main.cpp | 3 --- 3 files changed, 8 insertions(+), 7 deletions(-) rename build/{rtsgame => modules}/array.core (100%) diff --git a/build/rtsgame/array.core b/build/modules/array.core similarity index 100% rename from build/rtsgame/array.core rename to build/modules/array.core diff --git a/build/rtsgame/main.core b/build/rtsgame/main.core index f5a30fc..bc18b0f 100644 --- a/build/rtsgame/main.core +++ b/build/rtsgame/main.core @@ -1,5 +1,6 @@ #import "raylib.core" -A :: #load "array.core" +#import "LibC.core" +A :: #import "array.core" MAP :: #load "map.core" sqrtf :: #foreign (value: F32): F32 @@ -54,6 +55,11 @@ main :: (): int target_color := RED target_color.a = 255/2 + COLOR_SelectionBox := GREEN + COLOR_SelectionBox.a = 255/2 + + COLOR_Selected := COLOR_SelectionBox + testing := 0 for !WindowShouldClose() defer ;; testing += 1 @@ -200,7 +206,7 @@ main :: (): int for actor_i := 0, actor_i < MouseSelectedActors.len, actor_i += 1 actor_it := MouseSelectedActors.data[actor_i] actor_box := MAP.Rect(actor_it.p) - DrawRectangleRec(actor_box, GREEN) + DrawRectangleRec(actor_box, COLOR_Selected) if IsMouseButtonPressed(MOUSE_BUTTON_RIGHT) p := MAP.ScreenToMap(MouseP) @@ -208,8 +214,6 @@ main :: (): int if MouseSelecting A.Reset(&MouseSelectedActors) - COLOR_SelectionBox := GREEN - COLOR_SelectionBox.a = 255/2 for actor_i := 0, actor_i < map.actors.len, actor_i += 1 actor_it := map.actors.data + actor_i diff --git a/core_main.cpp b/core_main.cpp index f02df18..7814846 100644 --- a/core_main.cpp +++ b/core_main.cpp @@ -7,7 +7,6 @@ Features - for i: int = 0, i < 10, i+=1 - for diff: array - iterator how to do this without function poly ? for it := iter_begin(), iter_valid(), iter_advance() -- Defer - Expand macros - Using directive to bring symbols into local scope @@ -168,11 +167,9 @@ int main(int argument_count, char **arguments) { } } printf("End of program\n"); -#if 1 if (IsDebuggerPresent()) { Breakpoint; } -#endif return 0; }