Jack-Ji / jok

A minimal 2d/3d game framework for @ziglang.
MIT License
181 stars 5 forks source link

Usage of @splat #1

Closed mjoork closed 1 year ago

mjoork commented 1 year ago

Right now, if I use any of the functions that use @splat, it causes a compile error:

/home/mpokhil/Source/jok/src/j2d/Vector.zig:97:39: error: expected type 'u32', found 'type'
    const result = self.data / @splat(f32, l);
                                      ^~~
referenced by:
    move: /home/.../src/main.zig:63:30
    update: /home/.../src/main.zig:146:13
    remaining reference traces hidden; use '-freference-trace' to see all reference traces

/home/.../jok/src/j2d/Vector.zig:23:27: error: expected type 'u32', found 'type'
    const result = @splat(f32, val);

Just changing all instance of @splat(f32, ...) in jok.j2d.Vector to @splat(2, ...) works as expected.

Should I create a PR for this?

Jack-Ji commented 1 year ago

Thanks for bug report, I’ll give it a check as soon as possible.

Jack-Ji commented 1 year ago

Fixed 5aedc0e