From 4d1bf305866d4cafcc1b9d85b1751c19ddadd555 Mon Sep 17 00:00:00 2001 From: Richard Zink Date: Tue, 3 Nov 2026 09:48:25 +0100 Subject: [PATCH] 3D resolution setting extended down to 1/16 Co-Authored-By: Claude Opus 5.5 --- DESIGN.md | 2 +- src/main.rs | 2 +- src/menu.rs | 2 +- src/settings.rs | 4 +++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/DESIGN.md b/DESIGN.md index e2fd194..d7afac9 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -9,7 +9,7 @@ An original dungeon management game (genre: dungeon building & defence) that run - All UI windows use **CP437 frames** (single lines for panels, double lines for dialogs); **all bars are CP437 block characters** (█ ▌ ░) - Text only in **fixed integer sizes**: 1×, 2× and 4× the 6×8 glyph size, times an integer **interface factor** (automatic from the device resolution, or 1×–4× in the settings) - The interface is drawn in **device pixels** (high DPI) and laid out on the **character grid**, so every font pixel has exactly the same size -- **3D resolution** setting: the world can be rendered at 1/1, 1/2, 1/3 or 1/4 resolution and scaled up by exactly that factor (pixel look); the interface stays sharp +- **3D resolution** setting: the world can be rendered at 1/1 down to 1/16 resolution and scaled up by exactly that factor (pixel look); the interface stays sharp - Sound: event system + macroquad audio prepared (volume, mute key M); sounds will be generated later - Languages: all in-game texts live in **language files** (`lang/*.lang`, key = text); English is the reference/fallback, German included, more can be added. The language is chosen on first start and stored in the browser. - Repository language: **English** (code, comments, docs, commit messages) diff --git a/src/main.rs b/src/main.rs index 5d3daba..3ba0ebb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -73,7 +73,7 @@ fn apply_settings(s: &Settings, r3d: &mut R3d) { r3d.outlines = s.outlines; r3d.set_wall_detail(s.wall_subdivisions()); r3d.max_lights = s.max_lights as usize; - r3d.render_div = s.render_scale.clamp(1, 4) as u32; + r3d.render_div = s.render_scale.clamp(1, 16) as u32; audio::set_volumes(s.music_volume, s.volume, s.muted); } diff --git a/src/menu.rs b/src/menu.rs index 2f4c218..66c588a 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -139,7 +139,7 @@ fn item_change(it: Item, s: &mut Settings, d: i32) { Item::WallDetail => s.wall_detail = cycle(&[1u8, 2, 3], s.wall_detail, d), Item::Lights => s.max_lights = cycle(&[8u8, 16, 24], s.max_lights, d), Item::UiScale => s.ui_factor = cycle(&[0u8, 1, 2, 3, 4], s.ui_factor, d), - Item::RenderScale => s.render_scale = cycle(&[1u8, 2, 3, 4], s.render_scale.max(1), d), + Item::RenderScale => s.render_scale = cycle(&(1u8..=16).collect::>(), s.render_scale.clamp(1, 16), d), Item::GameSpeed => s.game_speed = cycle(&[1.0f32, 2.0], s.game_speed, d), Item::Hints => s.hints = !s.hints, } diff --git a/src/settings.rs b/src/settings.rs index e116b52..5abab7b 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -142,7 +142,8 @@ pub struct Settings { pub wall_detail: u8, // 1 low, 2 medium, 3 high pub max_lights: u8, // 8, 16 or 24 pub ui_factor: u8, // interface size: 0 = automatic, 1..4 = fixed integer factor - pub render_scale: u8, // 3D world resolution divisor: 1 = full, 2..4 = pixel look + pub render_scale: u8, // 3D world resolution divisor: 1 = full, 2..16 = pixel look + pub touch_ui: u8, // touch interface: 0 = automatic (after the first touch), 1 = on, 2 = off // game pub game_speed: f32, // 1 or 2 pub hints: bool, @@ -168,6 +169,7 @@ impl Default for Settings { max_lights: 24, ui_factor: 0, render_scale: 1, + touch_ui: 0, game_speed: 1.0, hints: true, map_w: 64,