From d2f6860430f93291a52d1cdaccf6831cd57be9a5 Mon Sep 17 00:00:00 2001 From: tslil clingman <> Date: Thu, 9 Sep 2021 23:18:56 -0400 Subject: Added ceilings and pos_z to sprites (they can now be on the ceiling) --- src/sfml/graphics/texture.zig | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/sfml/graphics/texture.zig') diff --git a/src/sfml/graphics/texture.zig b/src/sfml/graphics/texture.zig index ac4cfbb..317738a 100644 --- a/src/sfml/graphics/texture.zig +++ b/src/sfml/graphics/texture.zig @@ -75,15 +75,8 @@ pub const Texture = union(TextureType) { /// Gets the size of this image pub fn getSize(self: Self) sf.Vector2u { - // This is a hack - _ = sf.c.sfTexture_getSize(self.get()); - // Register Rax holds the return val of function calls that can fit in a register - const rax: usize = asm volatile ("" - : [ret] "={rax}" (-> usize) - ); - var x: u32 = @truncate(u32, (rax & 0x00000000FFFFFFFF) >> 00); - var y: u32 = @truncate(u32, (rax & 0xFFFFFFFF00000000) >> 32); - return sf.Vector2u{ .x = x, .y = y }; + const size = sf.c.sfTexture_getSize(self.get()); + return sf.Vector2u{ .x = size.x, .y = size.y }; } /// Gets the pixel count of this image pub fn getPixelCount(self: Self) usize { -- cgit v1.3.1