Skip to content

Commit

Permalink
gfx2d: use latest mach.math API
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Gutekanst <[email protected]>
  • Loading branch information
slimsag committed Sep 9, 2023
1 parent 578bd4f commit b96e8ac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gfx2d/Sprite2D.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const Engine = @import("../engine.zig").Engine;
const mach = @import("../main.zig");

const math = mach.math;
const mat = math.mat;
const vec2 = math.vec2;
const Vec2 = math.Vec2;
const Vec3 = math.Vec3;
const Mat3x3 = math.Mat3x3;
Expand Down Expand Up @@ -161,10 +161,10 @@ pub fn engineSprite2dInit(
.sprite_transforms = sprite_transforms,
.sprite_uv_transforms = sprite_uv_transforms,
.sprite_sizes = sprite_sizes,
.texture_size = Vec2{
.texture_size = vec2(
@as(f32, @floatFromInt(sprite2d.state.texture.getWidth())),
@as(f32, @floatFromInt(sprite2d.state.texture.getHeight())),
},
),
.texture = sprite2d.state.texture,
};
shader_module.release();
Expand Down Expand Up @@ -202,7 +202,7 @@ pub fn tick(
});

// Update uniform buffer
const ortho = mat.ortho(
const ortho = Mat4x4.ortho(
-@as(f32, @floatFromInt(core.size().width)) / 2,
@as(f32, @floatFromInt(core.size().width)) / 2,
-@as(f32, @floatFromInt(core.size().height)) / 2,
Expand Down

0 comments on commit b96e8ac

Please sign in to comment.