640×480 (VGA) intern, UI auf EGA 8×14

Text-getrieben → 80-Spalten-Textmodus-Look; RGB555+Dither bleiben.
Menü-/Dialog-Metriken an die Fonthöhe angepasst, CGA bleibt fürs HUD.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-16 19:22:09 +02:00
parent 9db3929750
commit 186ee9a817
4 changed files with 16 additions and 10 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
// Upscale-Pass: internes 320×240-Target nearest-gesampelt auf die
// Upscale-Pass: internes 640×480-Target nearest-gesampelt auf die
// Surface. Das 4:3-Letterbox-Rechteck setzt der Rust-Code als Viewport;
// hier ist es ein simples Fullscreen-Dreieck mit UVs.
+2 -2
View File
@@ -40,9 +40,9 @@ pub(crate) struct Font {
/// Die im Projekt geladenen Fonts, gebaut in render::run und an `ui::layout`
/// gereicht.
pub(crate) struct Fonts {
/// Größerer Font, für spätere Überschriften/HUD bereitgehalten.
#[allow(dead_code)]
pub(crate) ega: Font,
/// Kleinerer Font, für späteres HUD-Kleinzeug bereitgehalten.
#[allow(dead_code)]
pub(crate) cga: Font,
}
+7 -3
View File
@@ -1,10 +1,14 @@
//! wgpu-Zustand: Surface, Device und der zweistufige Render-Pfad
//! aus dem Renderer-Plan:
//!
//! Pass 1 (intern): 320×240 RGBA8 + Depth — hier entsteht das Bild
//! Pass 1 (intern): 640×480 RGBA8 + Depth — hier entsteht das Bild
//! ([`ScenePass`], PS1-Shader).
//! Pass 2 (Fenster): Nearest-Upscale des internen Targets mit
//! 4:3-Letterbox (via Viewport) auf die Surface.
//!
//! 640×480 (VGA) statt 320×240: das Spiel ist text-getrieben — die höhere
//! Auflösung trägt den 80-Spalten-Textmodus-Look (EGA 8×14), der Lo-Fi-Rest
//! (RGB555 + Bayer-Dither, affines Mapping) bleibt.
use std::sync::Arc;
@@ -16,8 +20,8 @@ use crate::render::scene::{Mesh, ScenePass};
use crate::render::sprite::SpritePass;
use crate::render::ui::Ui;
pub const INTERNAL_W: u32 = 320;
pub const INTERNAL_H: u32 = 240;
pub const INTERNAL_W: u32 = 640;
pub const INTERNAL_H: u32 = 480;
/// D16 reicht für PS1-Geometrieskalen und ist das älteste, überall
/// (auch GL-Fallback) unterstützte Depth-Format.
+6 -4
View File
@@ -221,7 +221,9 @@ const TEXT: [f32; 4] = [0.92, 0.92, 1.0, 1.0];
pub(crate) fn layout(internal: [f32; 2], fonts: &Fonts, session: &Session, cur: &Cursor) -> Screen {
let mut ui = Ui::default();
let mut hover: Option<String> = None;
let f = &fonts.cga; // CGA 8×8 ist der UI-Standard-Font.
// EGA 8×14 ist der UI-Standard-Font: bei 640×480 der klassische
// 80-Spalten-VGA-Textmodus. CGA 8×8 bleibt für kleines HUD-Zeug.
let f = &fonts.ega;
// Im Flycam-Modus (Maus gefangen) zählt die freie Sicht → kein Panel.
// Sonst je nach Modus Menü oder Dialog. Hit-Tests laufen nur bei freier
@@ -257,7 +259,7 @@ fn menu(ui: &mut Ui, f: &Font, internal: [f32; 2], cur: [f32; 2], hover: &mut Op
("KV anzeigen", "kv"),
("Beenden", "quit"),
];
let (bw, bh, gap) = (112.0, 14.0, 4.0);
let (bw, bh, gap) = (176.0, 20.0, 6.0);
let title_h = f.glyph_h;
let body_h = title_h + gap + items.len() as f32 * bh + (items.len() as f32 - 1.0) * gap;
let pw = bw + 2.0 * INSET;
@@ -280,8 +282,8 @@ fn menu(ui: &mut Ui, f: &Font, internal: [f32; 2], cur: [f32; 2], hover: &mut Op
/// ein „Weiter"-Button, dessen Aktion die Leereingabe ist (blättert weiter) —
/// derselbe Pfad wie Enter im Terminal (`dialog_input`).
fn dialog(ui: &mut Ui, f: &Font, internal: [f32; 2], d: &Dialog, cur: [f32; 2], hover: &mut Option<String>) {
let margin = 16.0;
let (bh, gap) = (14.0, 4.0);
let margin = 24.0;
let (bh, gap) = (20.0, 6.0);
let pw = internal[0] - 2.0 * margin;
let line_h = f.glyph_h + 2.0;