Skip to content

Commit

Permalink
Fix window title and stop leaking memory
Browse files Browse the repository at this point in the history
  • Loading branch information
Beyley committed Mar 20, 2024
1 parent 8b31da2 commit e03d2ce
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions game/app.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
});
Expand Down
2 changes: 1 addition & 1 deletion game/convert.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion game/gfx.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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) };
Expand Down

0 comments on commit e03d2ce

Please sign in to comment.