High-res: bestiary shows the detailed sprites, toolbar buttons on stone

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Opus 5.5 committed 2026-11-07 23:33:41 +01:00
1 parent ffad92b641
commit 0ada04f4fb
3 files changed
+23 -2

No files matched your search

+11 -1
View File
@@ -305,8 +305,18 @@ impl Menu {
}
}
// a unit sprite with the gear of a level, scaled up
// a unit sprite with the gear of a level, scaled up; the high-res style shows the detailed
// sprite (front view, 64x64 level; without the gear)
fn draw_sprite(gfx: &Gfx, kind: EK, level: u32, x: f32, y: f32, size: f32) {
if crate::gfx::high_res_ui() {
if let Some(pic) = Gfx::hd_picture(kind, 0, None, false) {
let uv = Gfx::hd_uv(pic, true);
let (w, h) = crate::gfx::hd_tex_size(true);
let src = Rect::new(uv.x * w as f32, uv.y * h as f32, uv.w * w as f32, uv.h * h as f32);
draw_texture_ex(&gfx.hd_sprites, x, y, WHITE, DrawTextureParams { source: Some(src), dest_size: Some(vec2(size, size)), ..Default::default() });
return;
}
}
let src = Gfx::sprite_cell(kind, false, level);
draw_texture_ex(&gfx.sprites, x, y, WHITE, DrawTextureParams { source: Some(src), dest_size: Some(vec2(size, size)), ..Default::default() });
}