From 0bb4cffbd685e1b8c6b4830dc7edffbdb362ce3f Mon Sep 17 00:00:00 2001 From: Katajisto Date: Tue, 16 Dec 2025 17:59:55 +0200 Subject: [PATCH] port to latest jai version --- first.jai | 2 +- modules/Jaison/examples/example.jai | 4 +- modules/Jaison/generic.jai | 12 +++--- modules/Jaison/typed.jai | 40 +++++++++---------- .../examples/example.jai | 2 +- modules/Simple_Package_Reader/module.jai | 6 +-- src/load.jai | 8 ++-- src/rendering/meshgen.jai | 2 +- src/trile.jai | 2 +- src/ui/ui.jai | 2 +- 10 files changed, 40 insertions(+), 40 deletions(-) diff --git a/first.jai b/first.jai index e0a6ed1..909dc9a 100644 --- a/first.jai +++ b/first.jai @@ -152,7 +152,7 @@ Iprof :: #import "Iprof"(IMPORT_MODE = .METAPROGRAM); root_opts := get_build_options(); w := compiler_create_workspace("Target"); opts := get_build_options(w); - copy_commonly_propagated_fields(*opts, *root_opts); + copy_commonly_propagated_fields(opts, *root_opts); opts.cpu_target = root_opts.cpu_target; opts.os_target = root_opts.os_target; diff --git a/modules/Jaison/examples/example.jai b/modules/Jaison/examples/example.jai index 5e0d7b7..8e05ec7 100644 --- a/modules/Jaison/examples/example.jai +++ b/modules/Jaison/examples/example.jai @@ -203,7 +203,7 @@ DONE get :: (json_val: JSON_Value, key: string, expected_type: JSON_Type) -> JSON_Value { assert(json_val.type == .OBJECT); table := json_val.object; - success, val := Hash_Table.table_find_new(table, key); + success, val := Hash_Table.table_find(table, key); assert(success); assert(val.type == expected_type); return val; @@ -212,7 +212,7 @@ DONE // Check for version number that may or may not exist version: float64 = -1; assert(root.type == .OBJECT); - success2, val := Hash_Table.table_find_new(root.object, "version"); + success2, val := Hash_Table.table_find(root.object, "version"); if success2 { if val.type == .NUMBER { version = val.number; diff --git a/modules/Jaison/generic.jai b/modules/Jaison/generic.jai index 225e8c9..f437718 100644 --- a/modules/Jaison/generic.jai +++ b/modules/Jaison/generic.jai @@ -83,7 +83,7 @@ print_val :: (using val: JSON_Value) { for array print_val(it); print("]"); case .OBJECT; - print("%", < bool { if !next.count return false; if !remainder.count return false; - success, next_value := table_find_new(obj, next); + success, next_value := table_find(obj, next); next_obj: *JSON_Object; if success { if next_value.type != JSON_Type.OBJECT return false; @@ -242,7 +242,7 @@ get_as :: (val: JSON_Value, $T: Type) -> T { } else if T == JSON_Object { return #string END assert(val.type == .OBJECT, "Expected a % but got %", T, val.type); - return < JSON_Value, remainder: string, success: boo result.array, remainder, success = parse_array(remainder); case #char "{"; obj := cast(*JSON_Object) alloc(size_of(JSON_Object)); - < (sg_image, s32, s32) { - ok, entry := table_find_new(*g_asset_pack.lookup, path); + ok, entry := table_find(*g_asset_pack.lookup, path); if !ok { print("Failed to find texture % from pack...\n", path); img : sg_image; @@ -69,7 +69,7 @@ create_texture_from_pack :: (path: string) -> (sg_image, s32, s32) { size = xx (x * y * 4) }; - sg_init_image(*img, *(sg_image_desc.{ + sg_init_image(img, *(sg_image_desc.{ width = x, height = y, pixel_format = sg_pixel_format.RGBA8, @@ -84,7 +84,7 @@ create_texture_from_pack :: (path: string) -> (sg_image, s32, s32) { } load_string_from_pack :: (path: string) -> string { - ok, entry := table_find_new(*g_asset_pack.lookup, path); + ok, entry := table_find(*g_asset_pack.lookup, path); if !ok { print("Failed to load string from pack: %\n", path); return ""; diff --git a/src/rendering/meshgen.jai b/src/rendering/meshgen.jai index 0cb20f5..53c320f 100644 --- a/src/rendering/meshgen.jai +++ b/src/rendering/meshgen.jai @@ -86,7 +86,7 @@ draw_trile_side_triangles :: (vecs: *[]float, normals: *[]float, index: *int, si index.* = index.* + 3; } - for #v2 < 0..2 { + for < 0..2 { vecs.*[index.*] = (x + points[it][0]) * TRIXEL_SIZE; vecs.*[index.*+1] = (y + points[it][1]) * TRIXEL_SIZE; vecs.*[index.*+2] = (z + points[it][2]) * TRIXEL_SIZE; diff --git a/src/trile.jai b/src/trile.jai index 6226555..196917c 100644 --- a/src/trile.jai +++ b/src/trile.jai @@ -25,7 +25,7 @@ get_trile_table_ptr :: () -> *Table(string, Trile) { // once it's more clear how this whole trile storage thing // will pan out. -ktjst get_trile_gfx :: (name: string) -> (Trile_GFX, success: bool) { - success, value := table_find_new(*trile_gfx_table, name); + success, value := table_find(*trile_gfx_table, name); if !success { // Check if such a trile exists. trile, success_with_trile := get_trile(name); diff --git a/src/ui/ui.jai b/src/ui/ui.jai index 412f9a1..46d4e84 100644 --- a/src/ui/ui.jai +++ b/src/ui/ui.jai @@ -127,7 +127,7 @@ texture_load_from_memory :: (texture: *Ui_Texture, memory: []u8, srgb: bool, bui size = xx (x * y * 4) }; - sg_init_image(*img, *(sg_image_desc.{ + sg_init_image(img, *(sg_image_desc.{ width = x, height = y, pixel_format = sg_pixel_format.RGBA8,