From e03d2ce0b1fd534dbd515f87566df2898ada616d Mon Sep 17 00:00:00 2001 From: Beyley Thomas Date: Wed, 20 Mar 2024 14:38:51 -0700 Subject: [PATCH] Fix window title and stop leaking memory --- game/app.zig | 4 +--- game/convert.zig | 2 +- game/gfx.zig | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/game/app.zig b/game/app.zig index 6e047c0..36de5ee 100644 --- a/game/app.zig +++ b/game/app.zig @@ -53,13 +53,11 @@ conv: Conv, pub fn init(app: *App) !void { const config = try Config.readConfig(); - _ = try Conv.init(core.allocator); - const width: u32 = @intFromFloat(640 * config.window_scale); const height: u32 = @intFromFloat(480 * config.window_scale); try core.init(.{ - .title = "ilo nanpa pi ilo nanpa", + .title = "ztyping", .power_preference = .low_power, .size = .{ .width = width, .height = height }, }); diff --git a/game/convert.zig b/game/convert.zig index 358b3e6..c953cd9 100644 --- a/game/convert.zig +++ b/game/convert.zig @@ -50,7 +50,7 @@ pub fn readUTypingConversions(conv: Conv, allocator: std.mem.Allocator) !Self { var raw_replaced_data = try allocator.alloc(u8, converted_data.items.len); defer allocator.free(raw_replaced_data); - //NOTE: this is safe as the tilde and backslash are both 1 bytes long, while the overline and yen sign are both longer, so the data is always guarenteed to be shoretr + //NOTE: this is safe as the tilde and backslash are both 1 byte long, while the overline and yen sign are both longer, so the data is always guarenteed to be shoretr //Replace the tilde with the overline const underlines_replaced = std.mem.replace(u8, converted_data.items, "‾", "~", raw_replaced_data); //Replace the yen sign with the backslash diff --git a/game/gfx.zig b/game/gfx.zig index 6c077aa..a74a2ee 100644 --- a/game/gfx.zig +++ b/game/gfx.zig @@ -131,7 +131,6 @@ pub fn init(config: Config) !Self { .min = .{ .width = width, .height = height }, .max = .{ .width = width, .height = height }, }); - // core.setSize(.{ .width = width, .height = height }); //Update the viewport self.viewport = RectU{ 0, 0, @intCast(width), @intCast(height) };