From 3159273495128a4f97be55a5f97a7bc2cae3130b Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Sun, 21 May 2023 04:54:02 +0200 Subject: [PATCH] check at runtime --- kubi/src/cursor_lock.rs | 21 +++++++++++---------- kubi/src/rendering/world.rs | 3 +++ kubi/src/settings.rs | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/kubi/src/cursor_lock.rs b/kubi/src/cursor_lock.rs index d981262..428230a 100644 --- a/kubi/src/cursor_lock.rs +++ b/kubi/src/cursor_lock.rs @@ -9,16 +9,17 @@ pub fn update_cursor_lock_state( lock: UniqueView, display: NonSendSync> ) { - #[cfg(not(target_os = "android"))] { - if lock.is_inserted_or_modified() { - let gl_window = display.display.gl_window(); - let window = gl_window.window(); - window.set_cursor_grab(match lock.0 { - true => CursorGrabMode::Confined, - false => CursorGrabMode::None, - }).expect("Failed to change cursor grab state"); - window.set_cursor_visible(!lock.0); - } + if cfg!(target_os = "android") { + return + } + if lock.is_inserted_or_modified() { + let gl_window = display.display.gl_window(); + let window = gl_window.window(); + window.set_cursor_grab(match lock.0 { + true => CursorGrabMode::Confined, + false => CursorGrabMode::None, + }).expect("Failed to change cursor grab state"); + window.set_cursor_visible(!lock.0); } } diff --git a/kubi/src/rendering/world.rs b/kubi/src/rendering/world.rs index 4837170..d922dbe 100644 --- a/kubi/src/rendering/world.rs +++ b/kubi/src/rendering/world.rs @@ -120,6 +120,9 @@ pub fn draw_current_chunk_border( camera: View, settings: UniqueView, ) { + if cfg!(target_os = "android") { + return + } if !settings.debug_draw_current_chunk_border { return } diff --git a/kubi/src/settings.rs b/kubi/src/settings.rs index 288c177..2a71a83 100644 --- a/kubi/src/settings.rs +++ b/kubi/src/settings.rs @@ -29,7 +29,7 @@ impl Default for GameSettings { max_anisotropy: Some(16), render_distance: 6, mouse_sensitivity: 1., - debug_draw_current_chunk_border: cfg!(debug_assertions), + debug_draw_current_chunk_border: cfg!(not(target_os = "android")) && cfg!(debug_assertions), } } }