Guard and attack markers (shields and swords, up to eight each, right click removes); the world and the interface are copied opaque so glows keep their brightness

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Opus 5.5 committed 2026-11-06 07:47:21 +01:00
1 parent a1a53273cd
commit c9dafb1606
24 files changed
+470 -46

No files matched your search

+10
View File
@@ -24,6 +24,7 @@ thread_local! {
static UI_TARGET: std::cell::RefCell<Option<(RenderTarget, u32, u32)>> = std::cell::RefCell::new(None);
static UP_TARGET: std::cell::RefCell<Option<(RenderTarget, u32, u32)>> = std::cell::RefCell::new(None);
static FRAME_STARTED: std::cell::Cell<bool> = std::cell::Cell::new(false);
static OPAQUE: std::cell::RefCell<Option<Material>> = std::cell::RefCell::new(None);
}
// the rows of the virtual screen for this frame (0: device pixels). Set once per frame before
@@ -188,7 +189,16 @@ pub fn end_frame() {
c.render_target = Some(up.clone());
set_camera(&c);
clear_background(Color::new(0.0, 0.0, 0.0, 1.0));
// opaque: translucent parts must not let the black below shine through
OPAQUE.with(|m| {
let mut m = m.borrow_mut();
if m.is_none() {
*m = Some(crate::render3d::opaque_material());
}
gl_use_material(m.as_ref().unwrap());
});
draw_texture_ex(&rt.texture, 0.0, 0.0, WHITE, DrawTextureParams { dest_size: Some(vec2(uw as f32, uh as f32)), flip_y: true, ..Default::default() });
gl_use_default_material();
set_default_camera();
draw_texture_ex(&up.texture, 0.0, 0.0, WHITE, DrawTextureParams { dest_size: Some(vec2(screen_width(), screen_height())), flip_y: true, ..Default::default() });
}