updating to newer version of onyx
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Fri, 20 May 2022 16:53:47 +0000 (11:53 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Fri, 20 May 2022 16:53:47 +0000 (11:53 -0500)
21 files changed:
.gitignore
.vscode/tasks.json
onyx-pkg.ini [new file with mode: 0644]
run_tree/lib/onyx_glfw3.so
run_tree/lib/onyx_openal.so
run_tree/lib/onyx_opengles.so
run_tree/lib/stb_image.so
run_tree/lib/stb_truetype.so
run_tree/run.sh
src/build.onyx
src/config.onyx.template [deleted file]
src/entity/entities.onyx
src/entity/items.onyx
src/entity/scene.onyx
src/entity/schematics/background.onyx
src/entity/schematics/entryway.onyx
src/entity/schematics/furniture.onyx
src/entity/schematics/patron.onyx
src/entity/schematics/player.onyx
src/entity/schematics/tap.onyx
src/utils/vecmath.onyx

index 54f6f035713e14305b70396e2b8908c2c155713a..f0c0553954464cdddae49141addc56f5c5023423 100644 (file)
@@ -2,4 +2,5 @@
 *.sublime-project
 *.sublime-workspace
 src/config.onyx
-*.wasm
\ No newline at end of file
+*.wasm
+lib/
\ No newline at end of file
index a000fc20647a0c3f3244cdf3aa0affa1a6d6c06b..cd529eb28afdea4c25c10f771d8ddf81c05ad448 100644 (file)
@@ -7,11 +7,14 @@
             "label": "Build game",
             "type": "shell",
             "options": {
-                "cwd": "${workspaceFolder}/run_tree"
+                "cwd": "${workspaceFolder}/run_tree",
+                "shell": {
+                    "executable": "/bin/sh"
+                }
             },
             "problemMatcher": "$onyx",
             "command": "./run.sh",
-            "args": ["build"],
+            // "args": ["build"],
             "presentation": {
                 "echo": true,
                 "reveal": "silent",
             "label": "run",
             "type": "shell",
             "options": {
-                "cwd": "${workspaceFolder}/run_tree"
+                "cwd": "${workspaceFolder}/run_tree",
+                "shell": {
+                    "executable": "/bin/sh"
+                }
             },
             "problemMatcher": "$onyx",
             "command": "./run.sh",
diff --git a/onyx-pkg.ini b/onyx-pkg.ini
new file mode 100644 (file)
index 0000000..b6da73c
--- /dev/null
@@ -0,0 +1,29 @@
+[metadata]
+name=bar-game
+description=Bar simulation for MadLads Brewing
+url=
+author=Brendan Hansen
+version=0.0.1
+
+[config]
+lib_source_directory=./lib
+lib_bin_directory=./run_tree/lib
+
+[native_library]
+build_cmd=
+library=
+
+[dependencies]
+git://onyxlang.io/repo/glfw3=0.0.2
+git://onyxlang.io/repo/opengles=0.0.2
+git://onyxlang.io/repo/openal=0.0.2
+git://onyxlang.io/repo/stb_truetype=0.0.2
+git://onyxlang.io/repo/stb_image=0.0.2
+
+[dependency_folders]
+git://onyxlang.io/repo/glfw3=glfw3
+git://onyxlang.io/repo/opengles=opengles
+git://onyxlang.io/repo/openal=openal
+git://onyxlang.io/repo/stb_truetype=stb_truetype
+git://onyxlang.io/repo/stb_image=stb_image
+
index dd2da0c0230868b6b6aae460358cbaf94a02df92..168d72232358ac5bac3318ec34ec4ec33d726648 100755 (executable)
Binary files a/run_tree/lib/onyx_glfw3.so and b/run_tree/lib/onyx_glfw3.so differ
index d853604de658d67dda22d0fce54c4c217c849cf3..d2a61d7b04c7cb288d50fe5cf89d83a019954a2d 100755 (executable)
Binary files a/run_tree/lib/onyx_openal.so and b/run_tree/lib/onyx_openal.so differ
index 6015b67ee5adae213bb217c128d55e77277c7aef..333ecb020151cd4f3ed26aea879d8d63b3b08d19 100755 (executable)
Binary files a/run_tree/lib/onyx_opengles.so and b/run_tree/lib/onyx_opengles.so differ
index e8d39d62fed49716912ffc8c8633ebfc1b584b50..56fda28f764f0be6e21069ea358962a1b64863a3 100755 (executable)
Binary files a/run_tree/lib/stb_image.so and b/run_tree/lib/stb_image.so differ
index 355297f44f7022578f8b145f0a27913efd70c8b7..6d81294c1c66f6fe8d74c674e2b98986544a1d91 100755 (executable)
Binary files a/run_tree/lib/stb_truetype.so and b/run_tree/lib/stb_truetype.so differ
index 4cdba56316695fc1e2ef5de8c13bed184a486276..90450efd138c699cd0a2b1a9ab8ed36fccd625ae 100755 (executable)
@@ -2,6 +2,6 @@ dest=game.wasm
 
 case "$1" in
     build) shift; onyx -V -I ../src build -o $dest $@ ;;
-    run)   onyxrun $dest ;;
+    run)   onyx-run $dest ;;
     *)     onyx run -V -I ../src build $@ ;;
 esac
\ No newline at end of file
index 199acc653602281619882874bf9b571e74d30567..b5fc9a5aa68aab0b12f145943b79a1deb9fe057d 100644 (file)
@@ -7,8 +7,6 @@ MINOR_VERSION :: 1
 // DEBUG :: true
 
 
-#load_path ONYX_PATH
-
 #if (package runtime).arch == .X86_64  { #library_path "./lib" }
 #if (package runtime).arch == .AARCH64 { #library_path "./lib/aarch64" }
 
@@ -23,8 +21,8 @@ MINOR_VERSION :: 1
 #load_all "./sfx"
 #load_all "./utils"
 
-#load "modules/opengles/module"
-#load "modules/glfw3/module"
-#load "modules/openal/module"
-#load "modules/stb_truetype/module"
-#load "modules/stb_image/module"
+#load "./../lib/opengles/module"
+#load "./../lib/glfw3/module"
+#load "./../lib/openal/module"
+#load "./../lib/stb_truetype/module"
+#load "./../lib/stb_image/module"
diff --git a/src/config.onyx.template b/src/config.onyx.template
deleted file mode 100644 (file)
index a396fa5..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-package runtime.vars
-
-
-ONYX_PATH :: ""
\ No newline at end of file
index 8e91e0bed1f466d2131a7da6ea0b1022c6034167..e8cd66316c70603368cf2f1836cf9958792d3cd5 100644 (file)
@@ -2,16 +2,14 @@
 use package core
 use package glfw3
 
-
+#tag Entity_Schematic.{
+    (scene) => wall_create(scene, .{0,0}, .{0,0})
+}
 #local Wall :: struct {
     render :: (use this: ^Entity) {
         r := Entity.get_rect(this);
         immediate_rectangle(r.x, r.y, r.w, r.h);
     }
-
-    #struct_tag Entity_Schematic.{
-        (scene) => wall_create(scene, .{0,0}, .{0,0})
-    }
 }
 
 wall_create :: (scene: ^Scene, pos, size: Vector2) -> ^Entity {
@@ -27,6 +25,7 @@ wall_create :: (scene: ^Scene, pos, size: Vector2) -> ^Entity {
     return this;
 }
 
+#tag Entity_Schematic.{create}
 #local Door :: struct {
     create :: (scene) => door_create(scene, .Zero, .Zero);
 
@@ -50,8 +49,6 @@ wall_create :: (scene: ^Scene, pos, size: Vector2) -> ^Entity {
             door->toggle_open();
         }
     }
-
-    #struct_tag Entity_Schematic.{create}
 }
 
 DoorComponent :: struct {
index de76aafa157115135b5288f762a164ef3b0147fc..3e3574349d39d0234792bb5d3c1a43b8f6a883c1 100644 (file)
@@ -87,8 +87,8 @@ item_store_get_item :: (use this: ^Item_Store, id: str) -> ^Item {
     return items[id];
 }
 
+#tag Entity_Schematic.{create}
 #local Item_Entity :: struct {
-    #struct_tag Entity_Schematic.{create}
 
     create :: (scene) => {
         this := scene->make();
index cfcfad077e3d039a5ce3dbd871ca5e9766750fa3..c9c7acc02390ae889a8556d8466bec0caa28aae2 100644 (file)
@@ -82,18 +82,16 @@ SpriteRenderComponent :: struct {
     }
 }
 
+#tag Entity_Store.Skip
 SizeComponent :: struct {
     use base: Component;
     func : (e: ^Entity) -> Rect;
-
-    #struct_tag Entity_Store.Skip
 }
 
+#tag Entity_Store.Skip
 InteractableComponent :: struct {
     use base: Component;
     interact: (e: ^Entity, interactor: ^Entity) -> void;
-
-    #struct_tag Entity_Store.Skip
 }
 
 Entity :: struct {
index 095abf490c239c96b19ee35b765bc3b3483ad5a8..5c6014efe6192f7bf1fade2e9f8fbd91e47a6a87 100644 (file)
@@ -3,18 +3,17 @@ use package core
 
 // #local background_texture: Texture;
 
+#tag Entity_Schematic.{ Background.create }
 Background :: struct {
-    #struct_tag Entity_Schematic.{
-        (scene) => {
-            this := scene->make();
-            this.pos = .{0, 0};
-            this.size = .{0, 0};
+    create :: (scene) => {
+        this := scene->make();
+        this.pos = .{0, 0};
+        this.size = .{0, 0};
 
-            scene->modify_component(this, BackgroundComponent) {
-                comp.texture_path = "./assets/images/background.png";
-            }
-
-            return this;
+        scene->modify_component(this, BackgroundComponent) {
+            comp.texture_path = "./assets/images/background.png";
         }
+
+        return this;
     }
 }
index 825762c681220e23f0d2ac948a48a147f78bc86f..8ceac16dc13add788bd4d8fbdeb8f81b78750b71 100644 (file)
@@ -1,25 +1,24 @@
 
 use package core
 
+#tag Entity_Schematic.{ Entryway.create }
 Entryway :: struct {
-    #struct_tag Entity_Schematic.{
-        (scene) => {
-            this := scene->make();
-            this.size = .{16, 16};
+    create :: (scene) => {
+        this := scene->make();
+        this.size = .{16, 16};
 
-            scene->modify_component(this, SpriteRenderComponent) {
-                comp.sprite.sheet = "./assets/images/spritesheet.png";
-                comp.sprite.pos = .{0, 0};
-                comp.sprite.size = .{16, 16};
-                comp.sprite.color = .{1, 1, 1};
-            }
-
-            scene->modify_component(this, EntrywayComponent) {
-                comp.schematic = "Patron";
-                comp.spawned_size = .{16, 32};
-            }
+        scene->modify_component(this, SpriteRenderComponent) {
+            comp.sprite.sheet = "./assets/images/spritesheet.png";
+            comp.sprite.pos = .{0, 0};
+            comp.sprite.size = .{16, 16};
+            comp.sprite.color = .{1, 1, 1};
+        }
 
-            return this;
+        scene->modify_component(this, EntrywayComponent) {
+            comp.schematic = "Patron";
+            comp.spawned_size = .{16, 32};
         }
+
+        return this;
     }
 }
index 06375a185c344e3607e348eeff8ba33fa1647136..5ff56abfe64b95bc467ea3baf85f6a4877026b94 100644 (file)
@@ -1,11 +1,10 @@
 
 use package core
 
+#tag Entity_Schematic.{
+    (scene) => Furniture.create(scene, .{0, 0})
+}
 Furniture :: struct {
-    #struct_tag Entity_Schematic.{
-        (scene) => Furniture.create(scene, .{0, 0})
-    }
-
     create :: (scene: ^Scene, pos: Vector2) -> ^Entity {
         this := scene->make();
         this.pos = pos;
index 3a91d6a36c5da311bbcc1729239531e8d466f478..197d1e78b549f54da6ccf022a8972caafd0facb8 100644 (file)
@@ -1,11 +1,10 @@
 
 use package core
 
+#tag Entity_Schematic.{
+    (scene) => Patron.create(scene, .{0,0})
+}
 Patron :: struct {
-    #struct_tag Entity_Schematic.{
-        (scene) => Patron.create(scene, .{0,0})
-    }
-
     create :: (scene: ^Scene, pos: Vector2) -> ^Entity {
         this := scene->make();
         this.pos = pos;
index 2e1752673cebd694ca1270697e6469aafa159c1f..200a760452ec519bf9bf31ece3aca0766f6b9f6e 100644 (file)
@@ -30,11 +30,10 @@ player_2_controls :: Player_Controls.{
 }
 
 
+#tag Entity_Schematic.{
+    (scene: ^Scene) => Player.create(scene, .{0,0})
+}
 Player :: struct {
-    #struct_tag Entity_Schematic.{
-        (scene: ^Scene) => Player.create(scene, .{0,0})
-    }
-
     create :: (scene: ^Scene, pos: Vector2, controls := player_1_controls) -> ^Entity {
         this := scene->make();
         this.pos = pos;
index ca956e6426bcafd3c24b95189b89be46b3950d90..60baef6486220e4f740e9aca8bf9496c82a70617 100644 (file)
@@ -1,9 +1,8 @@
 
+#tag Entity_Schematic.{
+    (scene) => Tap.create(scene, .{0,0}, .{0,0})
+}
 Tap :: struct {
-    #struct_tag Entity_Schematic.{
-        (scene) => Tap.create(scene, .{0,0}, .{0,0})
-    }
-
     create :: (scene: ^Scene, pos: Vector2, size: Vector2) -> ^Entity {
         this := scene->make();
         this.pos = pos;
index c3e02e31d80e3d8094b2d6bdbbaab63620cd0463..a2f38c6bc2f4c8a9e9b7d0357668eb929549e3b1 100644 (file)
@@ -1,12 +1,14 @@
 #local hash :: package core.hash
 
+#tag conv.Custom_Format.{format_vector2i}
+#tag conv.Custom_Parse.{parse_vector2i}
 Vector2i :: struct {
     x, y: i32;
     
-    #struct_tag conv.Custom_Format.{format_vector2i}
-    #struct_tag conv.Custom_Parse.{parse_vector2i}
 }
 
+#tag conv.Custom_Format.{format_vector2}
+#tag conv.Custom_Parse.{parse_vector2}
 Vector2 :: struct {
     x, y: f32;
 
@@ -21,16 +23,14 @@ Vector2 :: struct {
 
 
     Zero :: Vector2.{0, 0}
-
-    #struct_tag conv.Custom_Format.{format_vector2}
-    #struct_tag conv.Custom_Parse.{parse_vector2}
 }
 
+#tag conv.Custom_Format.{format_vector3i}
 Vector3i :: struct {
     x, y, z: i32;
-    #struct_tag conv.Custom_Format.{format_vector3i}
 }
 
+#tag conv.Custom_Format.{format_vector3}
 Vector3 :: struct {
     x, y, z: f32;
 
@@ -62,8 +62,6 @@ Vector3 :: struct {
             math.clamp(v.z, min.z, max.z),
         };
     }
-
-    #struct_tag conv.Custom_Format.{format_vector3}
 }
 
 #operator + macro (v1, v2: Vector2i)   => (typeof v1).{ v1.x + v2.x, v1.y + v2.y };