diff options
Diffstat (limited to 'src/main.zig')
-rw-r--r-- | src/main.zig | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main.zig b/src/main.zig index 49f2b49..b44b592 100644 --- a/src/main.zig +++ b/src/main.zig @@ -49,7 +49,7 @@ fn handleKey(window: gf.Window, key: gf.Key, scancode: c_int, action: gf.KeyAction, mods: gf.Mods) void { _ = window; _ = scancode; - c.handleKey(game, @enumToInt(key), @enumToInt(action), mods.toInt()); + c.handleKey(game, @intFromEnum(key), @intFromEnum(action), mods.toInt()); } fn look(window: gf.Window, xpos: f64, ypos: f64) void { @@ -60,7 +60,7 @@ fn look(window: gf.Window, xpos: f64, ypos: f64) void { fn click(window: gf.Window, button: gf.MouseButton, action: gf.MouseButton.Action, mods: gf.Mods) void { _ = window; - c.click(game, @enumToInt(button), @enumToInt(action), mods.toInt()); + c.click(game, @intFromEnum(button), @intFromEnum(action), mods.toInt()); } /// Return a floating point value evenly distributed in the range [0, 1). @@ -92,14 +92,14 @@ pub fn main() !void { "Black Shades", .{}, .{}); try window.makeCurrent(); - prng = DefaultPrng.init(@bitCast(u64, try gf.getTime())); - game = c.makeGame(@bitCast(c.Config, config), - @bitCast(c.Scores, try loadScores(loca.user_data))).?; - defer saveScores(loca.user_data, @bitCast(Scores, c.getScores(game))) + prng = DefaultPrng.init(@bitCast(try gf.getTime())); + game = c.makeGame(@bitCast(config), + @bitCast(try loadScores(loca.user_data))).?; + defer saveScores(loca.user_data, @bitCast(c.getScores(game))) catch unreachable; try window.setSizeCallback(resizeWindow); - try gf.swapInterval(@boolToInt(config.vsync)); + try gf.swapInterval(@intFromBool(config.vsync)); c.initGl(game); if (try gf.rawMouseMotionSupported()) |