From: Brendan Hansen Date: Tue, 6 Dec 2022 01:56:58 +0000 (-0600) Subject: bugfixes X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=b984d9d12e0be037f5de7e85fce097fff7619705;p=bar-game.git bugfixes --- diff --git a/.gitignore b/.gitignore index f0c0553..2f35394 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ *.sublime-workspace src/config.onyx *.wasm -lib/ \ No newline at end of file +run_tree/lib/ diff --git a/onyx-pkg.ini b/onyx-pkg.ini index b6da73c..9e3d0fc 100644 --- a/onyx-pkg.ini +++ b/onyx-pkg.ini @@ -8,6 +8,9 @@ version=0.0.1 [config] lib_source_directory=./lib lib_bin_directory=./run_tree/lib +run_cmd= +debug_cmd= +test_cmd= [native_library] build_cmd= diff --git a/run_tree/lib/onyx_glfw3.so b/run_tree/lib/onyx_glfw3.so deleted file mode 100755 index 168d722..0000000 Binary files a/run_tree/lib/onyx_glfw3.so and /dev/null differ diff --git a/run_tree/lib/onyx_opengles.so b/run_tree/lib/onyx_opengles.so deleted file mode 100755 index 333ecb0..0000000 Binary files a/run_tree/lib/onyx_opengles.so and /dev/null differ diff --git a/src/entity/components/dispenser.onyx b/src/entity/components/dispenser.onyx index 649c825..683713e 100644 --- a/src/entity/components/dispenser.onyx +++ b/src/entity/components/dispenser.onyx @@ -89,4 +89,3 @@ DispenserComponent :: struct { } } } - diff --git a/src/entity/scene.onyx b/src/entity/scene.onyx index 6ee0c23..9e0a80a 100644 --- a/src/entity/scene.onyx +++ b/src/entity/scene.onyx @@ -267,7 +267,7 @@ scene_create_from_schematic :: (use this: ^Scene, schematic_name: str) -> ^Entit if schematic == null do return null; entity := schematic.create(this); - entity.schematic = schematic_name; + entity.schematic = schematic.name; return entity; } diff --git a/src/main.onyx b/src/main.onyx index 05c80aa..70d8098 100644 --- a/src/main.onyx +++ b/src/main.onyx @@ -1,3 +1,4 @@ +// #inject runtime.vars.Onyx_Enable_Operator_Methods :: true use core use opengles @@ -14,9 +15,7 @@ init :: () { window = window_create(1200, 900, #cstr "Bar Simulator"); window_use(^window); - shaders_init(); - fonts_init(); - immediate_init(); + ogre_init(); editor_init(); game_init(); diff --git a/src/ogre/ogre.onyx b/src/ogre/ogre.onyx new file mode 100644 index 0000000..936d000 --- /dev/null +++ b/src/ogre/ogre.onyx @@ -0,0 +1,7 @@ +package ogre + +ogre_init :: () { + shaders_init(); + fonts_init(); + immediate_init(); +} diff --git a/src/ogre/shader.onyx b/src/ogre/shader.onyx index 671e583..449f6c8 100644 --- a/src/ogre/shader.onyx +++ b/src/ogre/shader.onyx @@ -29,6 +29,10 @@ shaders_init :: () { shader_make :: (shader_path: str) -> Shader { shader_source := os.get_contents(shader_path); + return shader_make_from_source(shader_source); +} + +shader_make_from_source :: (shader_source: str) -> Shader { vs := compile_shader(shader_source, GL_VERTEX_SHADER); fs := compile_shader(shader_source, GL_FRAGMENT_SHADER); @@ -61,7 +65,7 @@ shader_set_uniform :: (shader: Shader, uniform: cstr, value: $T) { location := glGetUniformLocation(shader.prog, uniform); set_uniform_internal(location, value); - + set_uniform_internal :: #match { macro (location: GLint, value: u32) do glUniform1i(location, value); , macro (location: GLint, value: f32) do glUniform1f(location, value); , @@ -84,7 +88,7 @@ update_view_matrix :: (width, height: u32) { bottom := cast(f32) height; far := 10.0f; near := 0f; - + matrix[0] = 2 / (right - left); matrix[5] = 2 / (top - bottom); matrix[10] = -2 / (far - near); @@ -179,4 +183,3 @@ update_model_matrix :: (v: Vector2) { return prog; } } -