removed silly code
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Wed, 2 Mar 2022 03:30:40 +0000 (21:30 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Wed, 2 Mar 2022 03:30:40 +0000 (21:30 -0600)
src/entity/schematics/background.onyx

index 7aefc89f6bcc93783698d05d7f5349a50849003c..e9f66d890dda374fefdcf560bd7ecaa464ccdb94 100644 (file)
@@ -1,6 +1,8 @@
 
 use package core
 
+#local background_texture: Texture;
+
 Background :: struct {
     #struct_tag Entity_Schematic.{
         (scene) => {
@@ -12,8 +14,8 @@ Background :: struct {
                 comp.func = Background.render;
             }
 
-            queue_assets(^Background.assets);
-            load_assets();
+            background_texture', _ := texture_lookup("./assets/images/background.png");
+            texture_wrap(^background_texture, .Repeat);
 
             return this;
         }
@@ -22,12 +24,6 @@ Background :: struct {
     render :: (this: ^Entity) {
         size :: 10000.0f
         immediate_set_color(.{1, 1, 1});
-        immediate_subimage(^assets.texture, this.pos.x, this.pos.y, size, size, 0, 0, size / 2, size / 2);
-    }
-
-    #persist assets: struct {
-        #tag "./assets/images/background.png"
-        #tag Texture_Wrap.Repeat
-        texture: Texture;
+        immediate_subimage(^background_texture, this.pos.x, this.pos.y, size, size, 0, 0, size / 2, size / 2);
     }
 }
\ No newline at end of file