updated to latest version of onyx master
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Fri, 10 Feb 2023 20:19:31 +0000 (14:19 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Fri, 10 Feb 2023 20:19:31 +0000 (14:19 -0600)
build.sh
onyx-lsp.ini [new file with mode: 0644]
onyx.prez
src/build.onyx
src/canvas.onyx
src/events.onyx
src/prez.onyx
src/show_parser.onyx
src/slides.onyx

index f967216d1c355ffa86b3c966fd69a04e381d7cdf..77aba6efb3b7770a9b7469de9ab1f67ace1fac80 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -1,3 +1,3 @@
 #!/bin/sh
 
 #!/bin/sh
 
-onyx -V -r js src/build.onyx -o dist/prez.wasm --use-post-mvp-features
+onyx -V -r js src/build.onyx -o dist/prez.wasm
diff --git a/onyx-lsp.ini b/onyx-lsp.ini
new file mode 100644 (file)
index 0000000..9666a1e
--- /dev/null
@@ -0,0 +1,3 @@
+[lsp]
+mode=project
+onyxFiles=src/build.onyx
index 3e93444f8e63cb8ad691e4839e2efe504a6265a2..f3d9864688bd756028e7caf12d4d7e889dd50cba 100644 (file)
--- a/onyx.prez
+++ b/onyx.prez
@@ -24,7 +24,8 @@
 [define_text_style hyperlink color 100 100 255 font_attr italic font_size 40 font_name "Arial" left padding 10]
 [define_text_style code color 255 255 255 font_size 40 font_name "monospace" left padding 20]
 
 [define_text_style hyperlink color 100 100 255 font_attr italic font_size 40 font_name "Arial" left padding 10]
 [define_text_style code color 255 255 255 font_size 40 font_name "monospace" left padding 20]
 
-[load_image onyx_example "https://brendanfh.com/files/onyx_prez/onyx_example.png"]
+# [load_image onyx_example "https://brendanfh.com/files/onyx_prez/onyx_example.png"]
+[load_image onyx_example "https://webassembly.org/css/webassembly.svg"]
 [load_image wasm_logo "https://webassembly.org/css/webassembly.svg"]
 
 # ---------------------------------------------
 [load_image wasm_logo "https://webassembly.org/css/webassembly.svg"]
 
 # ---------------------------------------------
index 4892f68725f2c25dad771fa76b16e86c198662e7..e5450f87c0e748cf1088099a0c43e9d3f6d7b03e 100644 (file)
@@ -1,6 +1,6 @@
 
 
-use package build_opts as build_opts
-#if build_opts.Runtime != build_opts.Runtime_Js {
+#local runtime :: package runtime
+#if runtime.runtime != .Js {
     #error "This software is only compatible with a JavaScript runtime. Use '-r js' to specify this on the command line."
 }
 
     #error "This software is only compatible with a JavaScript runtime. Use '-r js' to specify this on the command line."
 }
 
index f06b128d0ba24de684aa6f6bc803ea8dcb3e6ad5..442dcb2c6391551d17e816992c7094feccd5ece9 100644 (file)
@@ -50,7 +50,7 @@ setup_canvas :: () {
     use Canvas
 
     canvas = init("prez_canvas");
     use Canvas
 
     canvas = init("prez_canvas");
-    assert(canvas != -1, "Failed to set up canvas.");
+    assert(canvas != 0xffffffff, "Failed to set up canvas.");
 
     clear(canvas, 0.1, 0.1, 0.1);
 
 
     clear(canvas, 0.1, 0.1, 0.1);
 
index 820076da34a3ec65c986549079e9aaf73e60b408..763d97486315f678f7233e290ab74b87bf86b7e7 100644 (file)
@@ -1,6 +1,6 @@
 package event
 
 package event
 
-#private_file Num_Buffered_Events :: 16
+#local Num_Buffered_Events :: 16
 
 // NOTE: These need to match exactly what is in the corresponding javascript
 DomEventKind :: enum {
 
 // NOTE: These need to match exactly what is in the corresponding javascript
 DomEventKind :: enum {
@@ -98,11 +98,13 @@ poll :: (ev: ^Event) -> bool {
 
 /* Private members */
 
 
 /* Private members */
 
-#private_file EventStorage :: struct {
-    event_count  : u32;
-    max_events   : u32;
-    event_buffer : [Num_Buffered_Events] Event;
-}
+#local {
+    EventStorage :: struct {
+        event_count  : u32;
+        max_events   : u32;
+        event_buffer : [Num_Buffered_Events] Event;
+    }
 
 
-#private_file event_storage : EventStorage;
-#private_file event_setup :: (event_storage: ^EventStorage, event_size: u32) -> void #foreign "event" "setup" ---
+    event_storage : EventStorage;
+    event_setup :: (event_storage: ^EventStorage, event_size: u32) -> void #foreign "event" "setup" ---
+}
index 18d755abb6267e4d8f4dbf2332344640510e6eac..e273b1ca050a9f91842b38d1dc95a0af8491e6f3 100644 (file)
@@ -1,5 +1,5 @@
 use package core
 use package core
-use package event as event
+event :: package event
 
 // This is an integer, not a boolean, because I was noticing an issue
 // where the slide would redraw, but the screen would still be blank
 
 // This is an integer, not a boolean, because I was noticing an issue
 // where the slide would redraw, but the screen would still be blank
@@ -37,7 +37,7 @@ poll_events :: () {
             }
 
             case FileDropped {
             }
 
             case FileDropped {
-                printf("New slideshow was dropped! %i bytes in size\n", ev.file.file_size);
+                printf("New slideshow was dropped! {} bytes in size\n", ev.file.file_size);
 
                 source := memory.make_slice(u8, ev.file.file_size);
                 defer cfree(source.data);
 
                 source := memory.make_slice(u8, ev.file.file_size);
                 defer cfree(source.data);
@@ -52,7 +52,8 @@ poll_events :: () {
     }
 }
 
     }
 }
 
-loop :: () -> void #export "loop" {
+#export "loop" loop
+loop :: () {
     poll_events();
 
     slideshow_update_animation(^the_slideshow);
     poll_events();
 
     slideshow_update_animation(^the_slideshow);
@@ -68,7 +69,7 @@ loop :: () -> void #export "loop" {
         Canvas.clear(canvas, 0, 0, 0, 1);
 
         current_slide := slideshow_get_current_slide(^the_slideshow);
         Canvas.clear(canvas, 0, 0, 0, 1);
 
         current_slide := slideshow_get_current_slide(^the_slideshow);
-        slide_render(current_slide);
+        if current_slide do slide_render(current_slide);
 
         redraw -= 1;
     }
 
         redraw -= 1;
     }
index c065bf260b7ba74f1c1786dd3d5736765e618eeb..f319f1f9629280357b53839e843598f18a19e737 100644 (file)
@@ -13,7 +13,7 @@ parse_slideshow :: (source: str, slideshow: ^Slideshow) {
 
     parse_alloc := alloc.arena.make_allocator(^parse_arena);
 
 
     parse_alloc := alloc.arena.make_allocator(^parse_arena);
 
-    show_stream := string_stream_make(source);
+    show_stream := buffer_stream_make(source, fixed=true, write_enabled=false);
     show_reader := reader_make(^show_stream);
 
     default_text_style := Slide_Item_Text.{
     show_reader := reader_make(^show_stream);
 
     default_text_style := Slide_Item_Text.{
@@ -30,7 +30,7 @@ parse_slideshow :: (source: str, slideshow: ^Slideshow) {
     variables := map.make(str, u32);
     defer map.free(^variables);
 
     variables := map.make(str, u32);
     defer map.free(^variables);
 
-    animations := map.make(str, #type (Allocator) -> ^Slide_Animation, default=null_proc, hash_count=4);
+    animations := map.make(str, #type (Allocator) -> ^Slide_Animation, default=null_proc);
     defer map.free(^animations);
     map.put(^animations, "swipe", Slide_Animation_Swipe.make);
     map.put(^animations, "fade",  Slide_Animation_Fade.make);
     defer map.free(^animations);
     map.put(^animations, "swipe", Slide_Animation_Swipe.make);
     map.put(^animations, "fade",  Slide_Animation_Fade.make);
@@ -47,11 +47,11 @@ parse_slideshow :: (source: str, slideshow: ^Slideshow) {
     aspect_ratio := 1.0f;
     y_increment := 0.05f;
 
     aspect_ratio := 1.0f;
     y_increment := 0.05f;
 
-    while !stream_end_of_file(^show_stream) {
+    while !reader_empty(^show_reader) {
         skip_whitespace(^show_reader); 
         defer skip_whitespace(^show_reader); 
 
         skip_whitespace(^show_reader); 
         defer skip_whitespace(^show_reader); 
 
-        _, next_byte := stream_peek_byte(^show_stream);
+        next_byte, _ := peek_byte(^show_reader);
         switch next_byte {
             case #char "[" {
                 // Command
         switch next_byte {
             case #char "[" {
                 // Command
@@ -96,7 +96,7 @@ parse_slideshow :: (source: str, slideshow: ^Slideshow) {
                 elseif command_name == "text_style" {
                     text_style_name := read_word(^show_reader, numeric_allowed=true);
                     if !map.has(^text_styles, text_style_name) {
                 elseif command_name == "text_style" {
                     text_style_name := read_word(^show_reader, numeric_allowed=true);
                     if !map.has(^text_styles, text_style_name) {
-                        printf("Text style '%s' was never defined.\n", text_style_name);
+                        printf("Text style '{}' was never defined.\n", text_style_name);
                     }
 
                     text_style := map.get(^text_styles, text_style_name);
                     }
 
                     text_style := map.get(^text_styles, text_style_name);
@@ -150,15 +150,15 @@ parse_slideshow :: (source: str, slideshow: ^Slideshow) {
                         allocator := alloc.arena.make_allocator(^slideshow.arena);
                         current_slide.animation = (map.get(^animations, anim_name))(allocator);
                     } else {
                         allocator := alloc.arena.make_allocator(^slideshow.arena);
                         current_slide.animation = (map.get(^animations, anim_name))(allocator);
                     } else {
-                        printf("Unknown animation: '%s'\n", anim_name);
+                        printf("Unknown animation: '{}'\n", anim_name);
 
                         current_slide.animation = null;
                     }
                 }
                 else {
 
                         current_slide.animation = null;
                     }
                 }
                 else {
-                    printf("******** Unknown command: '%s'.\n", command_name);
+                    printf("******** Unknown command: '{}'.\n", command_name);
                 }
                 }
-                
+
                 read_until(^show_reader, #char "]", allocator=parse_alloc, consume_end=true);
             }
 
                 read_until(^show_reader, #char "]", allocator=parse_alloc, consume_end=true);
             }
 
@@ -169,7 +169,7 @@ parse_slideshow :: (source: str, slideshow: ^Slideshow) {
             case #default {
                 // @Memory
                 text_allocator := alloc.arena.make_allocator(^slideshow.arena);
             case #default {
                 // @Memory
                 text_allocator := alloc.arena.make_allocator(^slideshow.arena);
-                text := read_line(^show_reader, text_allocator);
+                text := read_line(^show_reader, allocator=text_allocator);
 
                 new_slide_text := slideshow_make_item(slideshow);
                 new_slide_text.text = current_text_style;
 
                 new_slide_text := slideshow_make_item(slideshow);
                 new_slide_text.text = current_text_style;
@@ -184,7 +184,7 @@ parse_slideshow :: (source: str, slideshow: ^Slideshow) {
 
     flush_items(current_slide, ^current_slide_items, slideshow);
 
 
     flush_items(current_slide, ^current_slide_items, slideshow);
 
-    printf("Total slide count: %i\n", slideshow.slides.count);
+    printf("Total slide count: {}\n", slideshow.slides.count);
 
     flush_items :: (slide: ^Slide, items: ^[..] ^Slide_Item, slideshow: ^Slideshow) {
         allocator := alloc.arena.make_allocator(^slideshow.arena);
 
     flush_items :: (slide: ^Slide, items: ^[..] ^Slide_Item, slideshow: ^Slideshow) {
         allocator := alloc.arena.make_allocator(^slideshow.arena);
@@ -198,11 +198,13 @@ parse_slideshow :: (source: str, slideshow: ^Slideshow) {
     }
 }
 
     }
 }
 
-#private_file
+#local
 parse_text_style :: (use pc: ^ParseContext, text_style: ^Slide_Item_Text, parse_alloc := context.allocator) {
     use io
 
 parse_text_style :: (use pc: ^ParseContext, text_style: ^Slide_Item_Text, parse_alloc := context.allocator) {
     use io
 
-    while !stream_end_of_file(reader.stream) && peek_byte(reader) != #char "]" {
+    while !reader_empty(reader) {
+        if b, err := peek_byte(reader); b == #char "]" do break;
+
         skip_whitespace(reader);
         defer skip_whitespace(reader);
         style_name := read_word(reader, allocator=parse_alloc);
         skip_whitespace(reader);
         defer skip_whitespace(reader);
         style_name := read_word(reader, allocator=parse_alloc);
@@ -231,21 +233,23 @@ parse_text_style :: (use pc: ^ParseContext, text_style: ^Slide_Item_Text, parse_
         elseif style_name == "centered" do text_style.justify = Slide_Item_Text.Justify.Center;
         elseif style_name == "right"    do text_style.justify = Slide_Item_Text.Justify.Right;
         else {
         elseif style_name == "centered" do text_style.justify = Slide_Item_Text.Justify.Center;
         elseif style_name == "right"    do text_style.justify = Slide_Item_Text.Justify.Right;
         else {
-            printf("Unknown style option: '%s'\n", style_name);
+            printf("Unknown style option: '{}'\n", style_name);
             advance_line(reader);
             break;
         }
     }
 }
 
             advance_line(reader);
             break;
         }
     }
 }
 
-#private_file
+#local
 parse_image_style :: (use pc: ^ParseContext, image_style: ^Slide_Item_Image, parse_alloc := context.allocator) {
     use io
 
     image_name := read_word(reader, numeric_allowed=true);
     image_style.name = image_name;
 
 parse_image_style :: (use pc: ^ParseContext, image_style: ^Slide_Item_Image, parse_alloc := context.allocator) {
     use io
 
     image_name := read_word(reader, numeric_allowed=true);
     image_style.name = image_name;
 
-    while !stream_end_of_file(reader.stream) && peek_byte(reader) != #char "]" {
+    while !reader_empty(reader) {
+        if b, err := peek_byte(reader); b == #char "]" do break;
+
         skip_whitespace(reader);
         defer skip_whitespace(reader);
         style_name := read_word(reader, allocator=parse_alloc);
         skip_whitespace(reader);
         defer skip_whitespace(reader);
         style_name := read_word(reader, allocator=parse_alloc);
@@ -271,18 +275,20 @@ parse_image_style :: (use pc: ^ParseContext, image_style: ^Slide_Item_Image, par
             image_style.border_color = .{ r, g, b };
         }
         else {
             image_style.border_color = .{ r, g, b };
         }
         else {
-            printf("Unknown style option: '%s'\n", style_name);
+            printf("Unknown style option: '{}'\n", style_name);
             advance_line(reader);
             break;
         }
     }
 }
 
             advance_line(reader);
             break;
         }
     }
 }
 
-#private_file
+#local
 parse_rect_style :: (use pc: ^ParseContext, rect_style: ^Slide_Item_Rect, parse_alloc := context.allocator) {
     use io
 
 parse_rect_style :: (use pc: ^ParseContext, rect_style: ^Slide_Item_Rect, parse_alloc := context.allocator) {
     use io
 
-    while !stream_end_of_file(reader.stream) && peek_byte(reader) != #char "]" {
+    while !reader_empty(reader) {
+        if b, err := peek_byte(reader); b == #char "]" do break;
+
         skip_whitespace(reader);
         defer skip_whitespace(reader);
         style_name := read_word(reader, allocator=parse_alloc);
         skip_whitespace(reader);
         defer skip_whitespace(reader);
         style_name := read_word(reader, allocator=parse_alloc);
@@ -308,19 +314,19 @@ parse_rect_style :: (use pc: ^ParseContext, rect_style: ^Slide_Item_Rect, parse_
             rect_style.color = .{ r, g, b };
         }
         else {
             rect_style.color = .{ r, g, b };
         }
         else {
-            printf("Unknown style option: '%s'\n", style_name);
+            printf("Unknown style option: '{}'\n", style_name);
             advance_line(reader);
             break;
         }
     }
 }
 
             advance_line(reader);
             break;
         }
     }
 }
 
-#private_file
+#local
 parse_numeric_value :: (use pc: ^ParseContext) -> u32 {
     use io
 
     skip_whitespace(reader);
 parse_numeric_value :: (use pc: ^ParseContext) -> u32 {
     use io
 
     skip_whitespace(reader);
-    _, next_byte := stream_peek_byte(reader.stream);
+    next_byte := peek_byte(reader);
     if next_byte == #char "$" {
         io.read_byte(reader);
         var_name := read_word(reader, numeric_allowed=true);
     if next_byte == #char "$" {
         io.read_byte(reader);
         var_name := read_word(reader, numeric_allowed=true);
@@ -330,7 +336,7 @@ parse_numeric_value :: (use pc: ^ParseContext) -> u32 {
         if map.has(variables, var_name) {
             value = map.get(variables, var_name);
         } else {
         if map.has(variables, var_name) {
             value = map.get(variables, var_name);
         } else {
-            printf("Variable '%s' was never defined!\n", var_name);
+            printf("Variable '{}' was never defined!\n", var_name);
         }
 
         return value;
         }
 
         return value;
@@ -339,7 +345,7 @@ parse_numeric_value :: (use pc: ^ParseContext) -> u32 {
     return read_u32(reader);
 }
 
     return read_u32(reader);
 }
 
-#private_file
+#local
 parse_color :: (use pc: ^ParseContext) -> (f32, f32, f32) {
     r := parse_numeric_value(pc);
     g := parse_numeric_value(pc);
 parse_color :: (use pc: ^ParseContext) -> (f32, f32, f32) {
     r := parse_numeric_value(pc);
     g := parse_numeric_value(pc);
@@ -352,12 +358,12 @@ parse_color :: (use pc: ^ParseContext) -> (f32, f32, f32) {
     return fr, fg, fb;
 }
 
     return fr, fg, fb;
 }
 
-#private_file
+#local
 parse_string :: (use pc: ^ParseContext, allocator := context.allocator) -> str {
     use io
 
     // @Cleanup
 parse_string :: (use pc: ^ParseContext, allocator := context.allocator) -> str {
     use io
 
     // @Cleanup
-    dummy := read_until(reader, #char "\"", context.temp_allocator);
+    dummy := read_until(reader, #char "\"", allocator=context.temp_allocator);
     read_byte(reader);
 
     str_contents := read_until(reader, #char "\"", allocator=allocator);
     read_byte(reader);
 
     str_contents := read_until(reader, #char "\"", allocator=allocator);
index 72136c2dfe04e69df7add248f212d546956807c3..4109c891e3731ae7af3d9e145b841b927c491839 100644 (file)
@@ -32,7 +32,7 @@ Slide :: struct {
 
     animation: ^Slide_Animation;
 
 
     animation: ^Slide_Animation;
 
-    items : [] ^Slide_Item;
+    items : [] ^Slide_Item = .{};
 }
 
 Slide_Item :: struct #union {
 }
 
 Slide_Item :: struct #union {
@@ -113,8 +113,8 @@ slideshow_make :: (allocator := context.allocator) -> Slideshow {
 slideshow_init :: (use s: ^Slideshow, allocator := context.allocator) {
     title = "Untitled Slideshow";
 
 slideshow_init :: (use s: ^Slideshow, allocator := context.allocator) {
     title = "Untitled Slideshow";
 
-    arena = alloc.arena.make(allocator, arena_size = 16 * 1024);
-    array.init(^slides, 4);
+    arena = alloc.arena.make(allocator, arena_size = 32 * 1024);
+    array.init(^slides, 4, allocator=allocator);
 
     map.init(^image_map, default=.{});
 }
 
     map.init(^image_map, default=.{});
 }
@@ -129,8 +129,9 @@ slideshow_reset :: (use s: ^Slideshow) {
 }
 
 slideshow_get_current_slide :: (use s: ^Slideshow) -> ^Slide {
 }
 
 slideshow_get_current_slide :: (use s: ^Slideshow) -> ^Slide {
-    current_slide = math.clamp(current_slide, 0, slides.count - 1); 
+    if slides.count == 0 do return null;
 
 
+    current_slide = math.clamp(current_slide, 0, slides.count - 1); 
     return ^slides[current_slide];
 }
 
     return ^slides[current_slide];
 }
 
@@ -159,24 +160,23 @@ slideshow_insert_slide :: (use s: ^Slideshow, at := -1) -> ^Slide {
         return ^slides[at];
     }
 
         return ^slides[at];
     }
 
-    array.ensure_capacity(^slides, slides.count + 1);
-    defer slides.count += 1;
-    return ^slides[slides.count];
+    slide := array.alloc_one(^slides);
+    return slide;
 }
 
 slideshow_make_item :: (use s: ^Slideshow) -> ^Slide_Item {
     allocator := alloc.arena.make_allocator(^arena);
 }
 
 slideshow_make_item :: (use s: ^Slideshow) -> ^Slide_Item {
     allocator := alloc.arena.make_allocator(^arena);
-    ret := new(Slide_Item, allocator=allocator, initialize=false);
+    ret := make(Slide_Item, allocator=allocator);
     memory.set(ret, 0, sizeof Slide_Item);
     return ret;
 }
 
 // @Cleanup
     memory.set(ret, 0, sizeof Slide_Item);
     return ret;
 }
 
 // @Cleanup
-use package core.intrinsics.wasm { __initialize }
+use package core.intrinsics.onyx { __initialize }
 
 slideshow_load_image :: (use s: ^Slideshow, image_name: str, image_path: str) -> HTML_Image {
     if map.has(^image_map, image_name) {
 
 slideshow_load_image :: (use s: ^Slideshow, image_name: str, image_path: str) -> HTML_Image {
     if map.has(^image_map, image_name) {
-        printf("Warning: the image '%s' was already defined.", image_name);
+        printf("Warning: the image '{}' was already defined.", image_name);
         return image_map.default_value;
     }
 
         return image_map.default_value;
     }
 
@@ -212,11 +212,12 @@ slide_init :: (use slide: ^Slide,
     if item_count > 0 {
         // @GlobalVariable
         allocator := alloc.arena.make_allocator(^the_slideshow.arena);
     if item_count > 0 {
         // @GlobalVariable
         allocator := alloc.arena.make_allocator(^the_slideshow.arena);
-        items = memory.make_slice(#type ^Slide_Item, item_count, allocator=allocator);
+        items = make([] ^Slide_Item, item_count, allocator=allocator);
         memory.set(items.data, 0, items.count * sizeof ^Slide_Item);
 
     } else {
         items.count = 0;
         memory.set(items.data, 0, items.count * sizeof ^Slide_Item);
 
     } else {
         items.count = 0;
+        items.data = null;
     }
 }
 
     }
 }
 
@@ -248,7 +249,11 @@ slide_render :: (use slide: ^Slide) {
     defer Canvas.set_transform(canvas, old_transform);
 
     Canvas.fill_rect(canvas, 0, 0, width, height, background.r, background.g, background.b, background.a);
     defer Canvas.set_transform(canvas, old_transform);
 
     Canvas.fill_rect(canvas, 0, 0, width, height, background.r, background.g, background.b, background.a);
-    for item: items do if item != null do slide_item_render(item, slide, width, height);
+    for item: items {
+        if item != null {
+            slide_item_render(item, slide, width, height);
+        }
+    }
 }
 
 slide_item_render :: (use slide_item: ^Slide_Item, slide: ^Slide, width: f32, height: f32) {
 }
 
 slide_item_render :: (use slide_item: ^Slide_Item, slide: ^Slide, width: f32, height: f32) {
@@ -335,8 +340,7 @@ slide_item_render :: (use slide_item: ^Slide_Item, slide: ^Slide, width: f32, he
         if text.font_attr & Underline != ~~ 0 do underline_str = "underline";
         
         formatted_name := aprintf(
         if text.font_attr & Underline != ~~ 0 do underline_str = "underline";
         
         formatted_name := aprintf(
-            context.allocator,
-            "%s %s %s %ipx %s",
+            "{} {} {} {}px {}",
             bold_str, italic_str, underline_str,
             text.font_size, text.font_name);
         defer cfree(formatted_name.data);
             bold_str, italic_str, underline_str,
             text.font_size, text.font_name);
         defer cfree(formatted_name.data);
@@ -346,14 +350,14 @@ slide_item_render :: (use slide_item: ^Slide_Item, slide: ^Slide, width: f32, he
 }
 
 // @Cleanup: this should be part of the standard library.
 }
 
 // @Cleanup: this should be part of the standard library.
-aprintf :: (allocator: Allocator, format: str, va: ...) -> str {
-    // @Robustness: Same potential overflow bug.
-    buffer: [2048] u8;  
-    formatted := conv.str_format_va(format, ~~buffer, va);
-
-    output := string.alloc_copy(formatted, allocator = allocator);
-    return output;
-}
+// aprintf :: (allocator: Allocator, format: str, va: ..any) -> str {
+//     // @Robustness: Same potential overflow bug.
+//     buffer: [2048] u8;  
+//     formatted := conv.format_va(buffer, format, va);
+// 
+//     output := string.alloc_copy(formatted, allocator = allocator);
+//     return output;
+// }
 
 
 
 
 
 
@@ -373,7 +377,7 @@ Slide_Animation :: struct {
 }
 
 Slide_Animation_Swipe :: struct {
 }
 
 Slide_Animation_Swipe :: struct {
-    use base := Slide_Animation.{
+    use base: Slide_Animation = .{
         init   = init,
         update = update,
         render = render
         init   = init,
         update = update,
         render = render
@@ -420,7 +424,7 @@ Slide_Animation_Swipe :: struct {
 
 
 Slide_Animation_Fade :: struct {
 
 
 Slide_Animation_Fade :: struct {
-    use base := Slide_Animation.{
+    use base: Slide_Animation = .{
         init   = init,
         update = update,
         render = render
         init   = init,
         update = update,
         render = render
@@ -467,7 +471,7 @@ Slide_Animation_Fade :: struct {
 }
 
 Slide_Animation_Wiper :: struct {
 }
 
 Slide_Animation_Wiper :: struct {
-    use base := Slide_Animation.{
+    use base: Slide_Animation = .{
         init   = init,
         update = update,
         render = render
         init   = init,
         update = update,
         render = render