keeping things up to date
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 28 Mar 2023 02:28:12 +0000 (21:28 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 28 Mar 2023 02:28:12 +0000 (21:28 -0500)
29 files changed:
onyx-pkg.ini
run_tree/lib/glfw3.dll [deleted file]
run_tree/lib/onyx_glfw3.dll [deleted file]
run_tree/lib/onyx_opengles.dll [deleted file]
run_tree/lib/onyx_runtime.dll [deleted file]
run_tree/lib/stb_truetype.dll [deleted file]
run_tree/run.sh
src/build.onyx
src/entity/components/background.onyx
src/entity/components/collision_mask.onyx
src/entity/components/dispenser.onyx
src/entity/components/entryway.onyx
src/entity/components/money.onyx
src/entity/components/movement.onyx
src/entity/components/patron.onyx
src/entity/components/player.onyx
src/entity/editor.onyx
src/entity/entities.onyx
src/entity/items.onyx
src/entity/scene.onyx
src/entity/schematics/patron.onyx
src/entity/schematics/player.onyx
src/entity/store.onyx
src/game.onyx
src/main.onyx
src/sfx/audio_manager.onyx
src/sfx/wav_file.onyx
src/utils/asset_loader.onyx
src/utils/logger.onyx

index 7dce445b1d2ffdafd9a85630a06bef6b456f16e3..fc9cc131102b781971aabad64b09841e581944d9 100644 (file)
@@ -17,8 +17,8 @@ build_cmd=
 library=
 
 [dependencies]
-git://onyxlang.io/repo/openal=0.0.2
-git://onyxlang.io/repo/ogre=0.0.15
+git://onyxlang.io/repo/openal=0.0.3
+git://onyxlang.io/repo/ogre=0.0.19
 
 [dependency_folders]
 git://onyxlang.io/repo/openal=openal
diff --git a/run_tree/lib/glfw3.dll b/run_tree/lib/glfw3.dll
deleted file mode 100644 (file)
index 1d9f9a2..0000000
Binary files a/run_tree/lib/glfw3.dll and /dev/null differ
diff --git a/run_tree/lib/onyx_glfw3.dll b/run_tree/lib/onyx_glfw3.dll
deleted file mode 100644 (file)
index abd19ac..0000000
Binary files a/run_tree/lib/onyx_glfw3.dll and /dev/null differ
diff --git a/run_tree/lib/onyx_opengles.dll b/run_tree/lib/onyx_opengles.dll
deleted file mode 100644 (file)
index d015f35..0000000
Binary files a/run_tree/lib/onyx_opengles.dll and /dev/null differ
diff --git a/run_tree/lib/onyx_runtime.dll b/run_tree/lib/onyx_runtime.dll
deleted file mode 100644 (file)
index 53571c2..0000000
Binary files a/run_tree/lib/onyx_runtime.dll and /dev/null differ
diff --git a/run_tree/lib/stb_truetype.dll b/run_tree/lib/stb_truetype.dll
deleted file mode 100644 (file)
index 37e6b45..0000000
Binary files a/run_tree/lib/stb_truetype.dll and /dev/null differ
index 2932a5be59e5d4371be9a894b6f164a4de15de90..465d8174e42501445f748bf49055825d8cdaa1b6 100755 (executable)
@@ -1,9 +1,9 @@
 dest=game.wasm
 
 case "$1" in
-    build) shift; onyx -V -I ../src build -o $dest $@ ;;
+    build) shift; onyx build -V -I ../src build -o $dest $@ ;;
     check) shift; onyx check -V -I ../src build  $@ ;;
-    run)   onyx-run $dest ;;
+    run)   onyx run $dest ;;
     debug) shift; onyx run -V -I ../src build --debug $@ ;;
     *)     onyx run -V -I ../src build $@ ;;
 esac
index da15fdb0b58073b5d132fc6247b778a0efc28424..f2b99ce372e731125b18d6c94e330b4963d5c4f8 100644 (file)
@@ -1,5 +1,7 @@
 package runtime.vars
 
+use runtime
+
 
 MAJOR_VERSION :: 0
 MINOR_VERSION :: 1
index 241071c799772ca2056dc5ef6694926565b69308..3dfbae2257cbb783b036b20cd0b7a4cdd9ae65f6 100644 (file)
@@ -1,6 +1,6 @@
 
-use core
-use ogre
+use core {*}
+use ogre {*}
 
 BackgroundComponent :: struct {
     use component: Component;
index acbefb812ae63353d582001f521b467602edeeab..190c4e4b59ad3a930b8a80801dd65db30214ebcc 100644 (file)
@@ -1,6 +1,6 @@
 
-use core
-use ogre
+use core {*}
+use ogre {*}
 
 CollisionMaskComponent :: struct {
     use component: Component;
index 98a8329bc5e57e3fd72aa6a4c814b0779e55c254..b6e60b6be97d00970fe5545e5264e01d0f4aa24f 100644 (file)
@@ -1,6 +1,6 @@
 
-use core
-use ogre
+use core {*}
+use ogre {*}
 
 //
 // Currently, DispenserComponents only dispense Item_Entity's, and no
index d313e7877ef001148004e0c787396b1a4e33da9d..f0f031174f738c2c1e97f6fbbe7ce0cbd9cb3fcb 100644 (file)
@@ -1,6 +1,6 @@
 
-use core
-use ogre
+use core {*}
+use ogre {*}
 
 EntrywayComponent :: struct {
     use component: Component;
index 78a29218ac7a7923a22b6c06ae4a3ea6f4d23749..956ad551445fb1ef290fa4604eb2a7cbc93c385d 100644 (file)
@@ -1,6 +1,6 @@
 
-use core
-use ogre
+use core {*}
+use ogre {*}
 
 #local Transaction :: struct {
     amount: i32;
index 6a0b0ea8829835700223a49d5934871ef2756640..af1749c81efca3ff29ef3827ff88fa3d5e4cd745 100644 (file)
@@ -1,6 +1,6 @@
 
-use core
-use ogre
+use core {*}
+use ogre {*}
 
 
 Facing :: enum {
index a68e1d46db7b94b8475a0104b2f70ee82a1fb7f8..3c445709df7656ac9a655b00099bd9cc41e228fc 100644 (file)
@@ -1,6 +1,6 @@
 
-use core
-use ogre
+use core {*}
+use ogre {*}
 
 #local Patron_State :: enum {
     Walking_To_Seat;
index 88449ef5eea1a60168874c8c1cd050d8266420ae..54a61ad42d0fb29a68e6c0d8aa43a879abc0f466 100644 (file)
@@ -1,6 +1,6 @@
 
-use core
-use ogre
+use core {*}
+use ogre {*}
 
 PlayerComponent :: struct {
     use base: Component;
index c045d9398fce039315606f084fc231c1059548fd..e3865b40b295c05bdb0b9de7909a064adc5d31e4 100644 (file)
@@ -7,9 +7,9 @@
 // - [x] Serialize / Deserialize a scene
 //
 
-use core
-use ogre
-use ogre.ui
+use core {*}
+use ogre {*}
+use ogre.ui {*}
 use runtime {type_info :: info}
 use core.misc {as_any}
 
@@ -449,7 +449,7 @@ editor_draw :: () {
         i += 1;
         y += Field_Height;
 
-        member_any := any.{cast(^u8) v.data + it.offset, it.type};
+        member_any := any.{cast([&] u8) v.data + it.offset, it.type};
 
         if is_button_just_down(GLFW_MOUSE_BUTTON_LEFT) {
             is_disabled := false;
index f191b82f13f9b60691fd1194362628052b621e30..ff65d6c5eea169b476b60f3cdf4e3e34506d2da0 100644 (file)
@@ -1,6 +1,6 @@
 
-use core
-use ogre
+use core {*}
+use ogre {*}
 
 @Entity_Schematic.{ "Wall" }
 (scene: ^Scene) => wall_create(scene, .{0,0}, .{0,0})
index c69715bc0c7167fb59fbf1dc978905279484e7cf..69db529b85b3036087fdee6493a71b50d8f1ca4e 100644 (file)
@@ -1,7 +1,7 @@
 
-use core
-use ogre
-use ogre.ui
+use core {*}
+use ogre {*}
+use ogre.ui {*}
 use core.misc {as_any, any_nested_selector}
 
 
@@ -34,15 +34,17 @@ item_store_make :: () -> Item_Store {
 item_store_load_items_from_file :: (use this: ^Item_Store, path: str) {
     // @CopyNPaste // from entity/store.onyx
 
-    err, input_file := os.open(path, .Read);
-    if err != .None {
+    input_file_res := os.open(path, .Read);
+    if !input_file_res {
         logf(.Error, "Failed to open file: {}", path);
         return;
     }
+    input_file := input_file_res->unwrap();
+
     defer os.close(^input_file);
     reader := io.reader_make(^input_file);
 
-    use type_info;
+    use runtime.info {*};
 
     current_item: ^Item;
 
index f7a8cb35ab3df280b031de90d099f90aae954933..5361788bbbf145468aeefea981fc6964a16437d3 100644 (file)
@@ -1,6 +1,7 @@
 
-use core
-use ogre
+use core {*}
+use ogre {*}
+use runtime
 
 Entity_Nothing :: cast(Entity_ID) 0
 Entity_ID :: #distinct u32
@@ -211,7 +212,7 @@ scene_create :: (width, height: f32) -> Scene {
 }
 
 #local scene_load_schematics :: (use this: ^Scene) {
-    use runtime.info;
+    use runtime.info { * };
 
     index := 0;
     for type_table {
index 7a4225eaee3517fde3514bd0759473ce4c5189fd..0fdc230c7348d03b1ad9c34a924ab250c143a2f0 100644 (file)
@@ -1,6 +1,6 @@
 
-use core
-use ogre
+use core {*}
+use ogre {*}
 
 @Entity_Schematic.{ "Patron" }
 (scene: ^Scene) -> ^Entity {
index 4703239804cbe8828bde7bae7b7b589d03b786e4..c56cf554ead8a05f171d47915a64dce9321e5272 100644 (file)
@@ -1,6 +1,6 @@
 
-use core
-use ogre
+use core {*}
+use ogre {*}
 
 Player_Controls :: struct {
     up       : Keys;
index f86377298512eeffd24c20d024ec71d905b0b0de..2c3a27f0d1a0fbefbc9cf04e02037c7d6234dc5c 100644 (file)
@@ -1,5 +1,5 @@
 
-use core
+use core {*}
 use core.misc {any_nested_selector}
 
 // Flags to control how a field of a structure is being stored
@@ -9,7 +9,12 @@ Entity_Store :: enum {
 }
 
 scene_save_to_file :: (use this: ^Scene, filename: str) {
-    err, output_file := os.open(filename, .Write);
+    output_file_res := os.open(filename, .Write);
+    if !output_file_res {
+        logf(.Error, "Failed to open file: {}", filename);
+        return;
+    }
+    output_file := output_file_res->unwrap();
     defer os.close(^output_file);
 
     writer_ := io.writer_make(^output_file);
@@ -19,7 +24,7 @@ scene_save_to_file :: (use this: ^Scene, filename: str) {
 
     // writer := ^stdio.print_writer;
 
-    use runtime.info;
+    use runtime.info {*};
 
     for entities {
         name := it.schematic;
@@ -42,7 +47,7 @@ scene_save_to_file :: (use this: ^Scene, filename: str) {
     }
 
     emit_struct_fields :: (v: any, dest: ^io.Writer, parent_name: str) {
-        use runtime.info;
+        use runtime.info {*};
 
         info := cast(^Type_Info_Struct) get_type_info(v.type);
         assert(info.kind == .Struct, "Expected type to be a structure.");
@@ -56,7 +61,7 @@ scene_save_to_file :: (use this: ^Scene, filename: str) {
             }
 
             member_info := get_type_info(it.type);
-            member_any  := any.{cast(^u8) v.data + it.offset, it.type};
+            member_any  := any.{cast([&] u8) v.data + it.offset, it.type};
 
             name := conv.format(name_buffer, "{}{}{}",
                 parent_name,
@@ -90,11 +95,13 @@ scene_save_to_file :: (use this: ^Scene, filename: str) {
 }
 
 scene_load_from_file :: (use this: ^Scene, filename: str, reset_scene := true) {
-    err, input_file := os.open(filename, .Read);
-    if err != .None {
+    input_file_res := os.open(filename, .Read);
+    if !input_file_res {
         logf(.Error, "Failed to open file: {}", filename);
         return;
     }
+    input_file := input_file_res->unwrap();
+
     defer os.close(^input_file);
     reader := io.reader_make(^input_file);
 
@@ -105,7 +112,7 @@ scene_load_from_file :: (use this: ^Scene, filename: str, reset_scene := true) {
         next_entity_id = 0;
     }
 
-    use runtime.info;
+    use runtime.info {*};
 
     current_entity: ^Entity;
     current_component: ^Component;
index d692f97b9fc884e1273ce8da9c15c80a82c181c4..de0ef70104b3287f5f5e44e1f5db114feb2a4c2b 100644 (file)
@@ -1,6 +1,6 @@
 
-use core
-use ogre
+use core {*}
+use ogre {*}
 
 //
 // Game Global Variables
@@ -30,7 +30,7 @@ game_init :: () {
 
     // This process of queueing the asset bucket should
     // be made automatic somehow...
-    Spritesheet', _ := texture_lookup(#cstr "./assets/images/spritesheet.png");
+    Spritesheet~, _ := texture_lookup(#cstr "./assets/images/spritesheet.png");
 
     load_assets();
 
@@ -70,7 +70,7 @@ game_update :: (dt: f32) {
 }
 
 game_draw :: () {
-    canvas_use(^scene_canvas);
+    canvas_use(&scene_canvas);
     immediate_clear(.{0.15, 0.15, 0.2});
     scene->draw();
     immediate_flush();
@@ -79,8 +79,8 @@ game_draw :: () {
     immediate_clear(.{0.04, 0.04, 0.06});
     immediate_set_color(.{1, 1, 1});
 
-    texture := canvas_to_texture(^scene_canvas);
-    texture_wrap(^texture, .Clamp);
+    texture := canvas_to_texture(&scene_canvas);
+    texture_wrap(&texture, .Clamp);
     view_rect: Rect;
     if !editor_shown() {
         view_rect = Rect.{0, 0, ~~window.width, ~~window.height};
@@ -96,7 +96,7 @@ game_draw :: () {
     use opengles { glDisable, glEnable, GL_CULL_FACE }
 
     glDisable(GL_CULL_FACE);
-    immediate_image(^texture, view_rect.x, ~~window.height - view_rect.y, view_rect.w, -view_rect.h);
+    immediate_image(&texture, view_rect.x, ~~window.height - view_rect.y, view_rect.w, -view_rect.h);
     if distortion_enabled {
         shader_use(distortion_shader);
         shader_set_uniform(distortion_shader, #cstr "u_texture", 0);
index 28b9757bd90df7b2ddf82e2d0a37c00f4c7620b0..e235f1934bc16bc5ff963c0ca291f50ccee389c4 100644 (file)
@@ -1,7 +1,7 @@
 // #inject runtime.vars.Onyx_Enable_Operator_Methods :: true
 
-use core
-use ogre
+use core {*}
+use ogre {*}
 
 DEBUG :: #defined(runtime.vars.DEBUG)
 
index 56f2ee0171daf6826531e466b370884ebcd049a0..8307870756ab420537973f22853da13ae1f05f42 100644 (file)
@@ -1,6 +1,6 @@
 
-use core
-use openal
+use core {*}
+use openal {*}
 
 Sound :: struct {
     buffer: u32;
index c5c9ee7a0e1e99be732183c2ba47ea80699c6354..0f215bebf69a70a15affe6d058883ae49fe73526 100644 (file)
@@ -1,5 +1,5 @@
 
-use core
+use core {*}
 
 WAV_File :: struct {
     Format :: enum {
@@ -64,4 +64,4 @@ load_wav_file :: (path: str) -> WAV_File {
         defer pos += n;
         return data[pos .. pos+n];
     }
-}
\ No newline at end of file
+}
index ad92c905f3bbbf973aac8b4d8dc9b003bef613ab..6e1b40ef23cf67eadd091a30a760b8f23e7378f1 100644 (file)
@@ -1,6 +1,6 @@
 
-use core
-use ogre
+use core {*}
+use ogre {*}
 
 queue_assets :: (store: ^$T, callsite := #callsite) {
     assets_to_load << .{ T, store, callsite };
@@ -26,13 +26,13 @@ load_assets :: () {
     }
 
     load_asset_bucket :: (bucket: ^Asset_Bucket_To_Load) {
-        use package runtime.info
+        use package runtime.info {*}
 
         struct_info := cast(^Type_Info_Struct) get_type_info(bucket.type);
         if struct_info.kind != .Struct do return;
 
         for struct_info.members {
-            load_asset(cast(^u8) bucket.dest + it.offset, it.type, bucket.location, it.tags);
+            load_asset(cast([&] u8) bucket.dest + it.offset, it.type, bucket.location, it.tags);
         }
     }
 
index 6c9b44c7b610e84e62842f30d4823b8dda791933..be1849325ff296a68f8b5af81b08a5629d7dd71c 100644 (file)
@@ -3,6 +3,8 @@
 // but for now this is just for logging to the command line.
 //
 
+use core
+
 logf :: (level: Log_Level, format: str, args: ..any) {
     buf: [2048] u8;
     log(level, core.conv.format_va(buf, format, args));