~mil/mepo

c9af5f468e9039fbd4db9fce35cf7633b04effcd — Miles Alan a month ago f585932
Move crosshair_size to prefs system
1 files changed, 4 insertions(+), 5 deletions(-)

M src/Mepo.zig
M src/Mepo.zig => src/Mepo.zig +4 -5
@@ 17,7 17,6 @@ var pending_signal: ?u6 = null;
allocator: std.mem.Allocator,
async_shellpipe_threads: std.ArrayList(*sdl.SDL_Thread),
config: []const u8,
crosshair_size: u8 = 10,
debug_message: ?[]const u8 = null,
drag: ?struct {
    begin_ticks: u32,


@@ 54,17 53,17 @@ fn blit_crosshair(mepo: *@This()) errors.SDLError!void {
    try utilsdl.sdl_renderer_set_draw_color(mepo.renderer, .{ .value = 0x000000 });
    try utilsdl.errorcheck(sdl.SDL_RenderDrawLine(
        mepo.renderer,
        @intCast(c_int, mepo.win_w / 2 - (mepo.crosshair_size / 2)),
        @intCast(c_int, mepo.win_w / 2 - (mepo.prefs.get("crosshair_size").u / 2)),
        @intCast(c_int, mepo.win_h / 2),
        @intCast(c_int, mepo.win_w / 2 + (mepo.crosshair_size / 2)),
        @intCast(c_int, mepo.win_w / 2 + (mepo.prefs.get("crosshair_size").u / 2)),
        @intCast(c_int, mepo.win_h / 2),
    ));
    try utilsdl.errorcheck(sdl.SDL_RenderDrawLine(
        mepo.renderer,
        @intCast(c_int, mepo.win_w / 2),
        @intCast(c_int, mepo.win_h / 2 - (mepo.crosshair_size / 2)),
        @intCast(c_int, mepo.win_h / 2 - (mepo.prefs.get("crosshair_size").u / 2)),
        @intCast(c_int, mepo.win_w / 2),
        @intCast(c_int, mepo.win_h / 2 + (mepo.crosshair_size / 2)),
        @intCast(c_int, mepo.win_h / 2 + (mepo.prefs.get("crosshair_size").u / 2)),
    ));
}