diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-18 12:39:33 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-18 12:39:33 +0200 |
commit | 2a31d26fca33789ccf8ea28cdb214d20dd29f85d (patch) | |
tree | 426faa4d55905ecacdb9a1a4beca6d5a1ab97953 /pixel-client/src/render | |
parent | c4ae8c2df44cac2a8b3e4c8db43c2870b7d2bf69 (diff) | |
download | hurrycurry-2a31d26fca33789ccf8ea28cdb214d20dd29f85d.tar hurrycurry-2a31d26fca33789ccf8ea28cdb214d20dd29f85d.tar.bz2 hurrycurry-2a31d26fca33789ccf8ea28cdb214d20dd29f85d.tar.zst |
serve-authorative movement
Diffstat (limited to 'pixel-client/src/render')
-rw-r--r-- | pixel-client/src/render/mod.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/pixel-client/src/render/mod.rs b/pixel-client/src/render/mod.rs index a2aea365..f18d96ad 100644 --- a/pixel-client/src/render/mod.rs +++ b/pixel-client/src/render/mod.rs @@ -34,6 +34,8 @@ pub struct SpriteRenderer<'a> { pub size: Vec2, texture: Texture<'a>, + round: bool, + view_scale: Vec2, view_offset: Vec2, @@ -103,6 +105,7 @@ impl<'a> SpriteRenderer<'a> { .collect::<HashMap<_, _>>(); Self { + round: true, texture, size: Vec2::ONE, metadata, @@ -139,10 +142,10 @@ impl<'a> SpriteRenderer<'a> { z_order: sprite.z_order, src: sprite.src, dst: FRect::new( - ((sprite.dst.x + self.view_offset.x) * self.view_scale.x).round(), - ((sprite.dst.y + self.view_offset.y) * self.view_scale.y).round(), - (sprite.dst.w * self.view_scale.x).round(), - (sprite.dst.h * self.view_scale.y).round(), + (sprite.dst.x + self.view_offset.x) * self.view_scale.x, + (sprite.dst.y + self.view_offset.y) * self.view_scale.y, + sprite.dst.w * self.view_scale.x, + sprite.dst.h * self.view_scale.y, ), }) } |