Graphics style: pixel art (360 rows) or high-res (1080 rows, detailed sprites)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Opus 5.5 committed 2026-11-07 20:50:26 +01:00
1 parent 928c34e78b
commit 807a124a0b
23 files changed
+81 -48

No files matched your search

+4 -3
View File
@@ -1658,8 +1658,9 @@ impl R3d {
let mut mb = MB::new();
let sw = SPRITE_TEX_W;
let sh = SPRITE_TEX_H;
// screen pixels per tile: a sprite's cell (1.2 sizes high) shows a detailed sprite when
// every texel of it gets nearly a pixel; fewer pixels would only turn it into noise
// detailed sprites only in the high-res style, and only where a sprite's cell (1.2 sizes
// high) gives every texel nearly a pixel; fewer pixels would only turn it into noise
let hd = self.pixel_rows >= crate::settings::HIGH_RES_ROWS as u32;
let px_per_tile = world_rows / cam.view_h().max(0.1);
for e in &g.ents {
if !e.alive || e.held || unit_hidden(g, e) {
@@ -1760,7 +1761,7 @@ impl R3d {
}
let white = e.flash > 0.07;
let v = if e.captive != 0 { 0 } else { view };
let detailed = w * 1.2 * px_per_tile >= crate::gfx::ACELL as f32 * 0.85;
let detailed = hd && w * 1.2 * px_per_tile >= crate::gfx::ACELL as f32 * 0.85;
let src = detailed.then(|| Gfx::hd_cell_view(e.kind, white, e.level, v)).flatten().unwrap_or_else(|| Gfx::sprite_cell_view(e.kind, white, e.level, v));
let (mut u0, v0) = (src.x / sw, src.y / sh);
let (mut u1, v1) = ((src.x + src.w) / sw, (src.y + src.h) / sh);