Skip to content

Commit

Permalink
Fix various cases of incorrect types for color arguments. (#5)
Browse files Browse the repository at this point in the history
These are not pointers, but value types.
  • Loading branch information
Toqozz authored Jan 3, 2025
1 parent 194bf41 commit 1996547
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/zphysics.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,7 @@ pub const DebugRenderer = if (!debug_renderer_enabled) extern struct {} else ext

pub fn Methods(comptime T: type) type {
return extern struct {
pub inline fn drawLine(self: *T, from: *const [3]Real, to: *const [3]Real, color: *const Color) void {
pub inline fn drawLine(self: *T, from: *const [3]Real, to: *const [3]Real, color: Color) void {
return @as(*const DebugRenderer.VTable(T), @ptrCast(self.__v))
.drawLine(
@as(*const T, @ptrCast(self)),
Expand All @@ -1300,7 +1300,7 @@ pub const DebugRenderer = if (!debug_renderer_enabled) extern struct {} else ext
v1: *const [3]Real,
v2: *const [3]Real,
v3: *const [3]Real,
color: *const Color,
color: Color,
) void {
return @as(*const DebugRenderer.VTable(T), @ptrCast(self.__v))
.drawTriangle(
Expand Down Expand Up @@ -1388,14 +1388,14 @@ pub const DebugRenderer = if (!debug_renderer_enabled) extern struct {} else ext
self: *T,
from: *const [3]Real,
to: *const [3]Real,
color: *const Color,
color: Color,
) callconv(.C) void = null,
drawTriangle: ?*const fn (
self: *T,
v1: *const [3]Real,
v2: *const [3]Real,
v3: *const [3]Real,
color: *const Color,
color: Color,
) callconv(.C) void = null,
createTriangleBatch: ?*const fn (
self: *T,
Expand Down Expand Up @@ -4999,7 +4999,7 @@ const test_cb1 = struct {
self: *MyDebugRenderer,
from: *const [3]Real,
to: *const [3]Real,
color: *const DebugRenderer.Color,
color: DebugRenderer.Color,
) callconv(.C) void {
_ = self;
_ = from;
Expand All @@ -5011,7 +5011,7 @@ const test_cb1 = struct {
v1: *const [3]Real,
v2: *const [3]Real,
v3: *const [3]Real,
color: *const DebugRenderer.Color,
color: DebugRenderer.Color,
) callconv(.C) void {
_ = self;
_ = v1;
Expand Down

0 comments on commit 1996547

Please sign in to comment.