src/sprite.c

changeset 105
2b7f92ff2c15
parent 102
0d94fd280c6e
--- a/src/sprite.c	Sat May 03 13:30:04 2025 +0200
+++ b/src/sprite.c	Sat May 03 13:49:24 2025 +0200
@@ -52,12 +52,12 @@
                              : ASC_RENDER_GROUP_SPRITE_BLEND;
     node->free_func = asc_sprite_free;
 
-    node->position.x = (float) args.x;
-    node->position.y = (float) args.y;
-    node->position.z = ASC_SCENE_2D_DEPTH_OFFSET;
-    node->scale.width = (float) (args.width == 0 ? args.texture->width : args.width);
-    node->scale.height = (float) (args.height == 0 ? args.texture->height : args.height);
-    node->scale.depth = 1.f;
+    node->position = asc_vec3f_new(args.x, args.y, ASC_SCENE_2D_DEPTH_OFFSET);
+    node->scale = asc_vec3f_new(
+        args.width == 0 ? args.texture->width : args.width,
+        args.height == 0 ? args.texture->height : args.height,
+        1
+    );
     asc_node_update_transform(node);
 
     return node;

mercurial