diff --git a/src/debug.odin b/src/debug.odin index a468071..db025bf 100644 --- a/src/debug.odin +++ b/src/debug.odin @@ -1,6 +1,5 @@ package game -import "core:fmt" import rl "vendor:raylib" Debug :: struct { @@ -26,12 +25,10 @@ debug_fps :: proc() { for i in i32(0)..<4 { if rl.IsGamepadAvailable(i) { rl.DrawText(rl.TextFormat("GP%d: %s", i, rl.GetGamepadName(i)), 20, 45 + i*20, 20, rl.BLACK) - } else { - rl.DrawText(rl.TextFormat("GP%d: NOT DETECTED", i), 20, 45 + i*20, 20, rl.GRAY) } } - } + } } // DEBUG CAMERA @@ -52,6 +49,17 @@ debug_camera_init :: proc(player: Player) -> rl.Camera2D { debug_camera_update :: proc(debug: ^Debug) { when DEBUG_MODE { + scroll := rl.GetMouseWheelMove() + if scroll != 0.0 { + debug.camera.zoom += scroll * 0.1 + } + + if rl.IsMouseButtonDown(.RIGHT) { + sensitivity: f32 = 0.32 + mouse_move := rl.GetMouseDelta() + debug.camera.target -= ((mouse_move * sensitivity) / debug.camera.zoom) + } + if rl.IsKeyPressed(.ONE) { debug.camera_active = !debug.camera_active } @@ -59,19 +67,6 @@ debug_camera_update :: proc(debug: ^Debug) { if rl.IsKeyPressed(.TWO) { debug.bounds_active = !debug.bounds_active } - - if rl.IsKeyDown(.LEFT_CONTROL) { - scroll := rl.GetMouseWheelMove() - if scroll != 0.0 { - debug.camera.zoom += scroll * 0.1 - } - } - - if rl.IsMouseButtonDown(.RIGHT) { - sensitivity: f32 = 0.32 - mouse_move := rl.GetMouseDelta() - debug.camera.target -= ((mouse_move * sensitivity) / debug.camera.zoom) - } } }