diff options
Diffstat (limited to 'src/config.zig')
-rw-r--r-- | src/config.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/config.zig b/src/config.zig index 4bde82c..f382d77 100644 --- a/src/config.zig +++ b/src/config.zig @@ -29,8 +29,8 @@ const std = @import("std"); /// Game configuration. pub const Config = extern struct { - screen_width: c_int = 640, - screen_height: c_int = 480, + width: c_int = 640, + height: c_int = 480, mouse_sensitivity: f32 = 0.7, debug: bool = false, vsync: bool = true, @@ -67,8 +67,8 @@ pub fn parse(allocator: *Allocator, base_dir: []const u8) !Config { const output = try createFile(path, .{}); defer output.close(); const writer = output.writer(); - try writer.print("screen width = {}\n", .{ config.screen_width }); - try writer.print("screen height = {}\n", .{ config.screen_height }); + try writer.print("screen width = {}\n", .{ config.width }); + try writer.print("screen height = {}\n", .{ config.height }); try writer.print("mouse sensitivity = {d:.1}\n", .{ config.mouse_sensitivity }); try writer.print("debug = {}\n", .{ config.debug }); @@ -89,9 +89,9 @@ pub fn parse(allocator: *Allocator, base_dir: []const u8) !Config { while (try parser.next()) |record| switch (record) { .property => |kv| if (eql(u8, kv.key, "screen width")) { - config.screen_width = try parseInt(c_int, kv.value, 10); + config.width = try parseInt(c_int, kv.value, 10); } else if (eql(u8, kv.key, "screen height")) { - config.screen_height = try parseInt(c_int, kv.value, 10); + config.height = try parseInt(c_int, kv.value, 10); } else if (eql(u8, kv.key, "mouse_sensitivity")) { config.mouse_sensitivity = try parseFloat(f32, kv.value); } else if (eql(u8, kv.key, "debug")) { |