Holiday switch in the debug menu; darker wood for the treasury chests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8f670554c7
commit
4175ca7f97
24 files changed
+112
-8
No files matched your search
+7
-3
@@ -1255,6 +1255,7 @@ pub struct R3d {
|
||||
target: Option<(RenderTarget, u32, u32)>, // low resolution render target
|
||||
lava: Vec<f32>, // lava light per tile (see lava_field)
|
||||
chunks_hd: bool, // the chunks were built with the high-res atlas
|
||||
chunks_holiday: u8, // ... and with this holiday's decorations
|
||||
}
|
||||
|
||||
// The 3D resolution setting refers to a window 1080 device pixels high: smaller windows use a
|
||||
@@ -1305,7 +1306,7 @@ fn chunk_sig(map: &Map, cx: i32, cz: i32) -> u64 {
|
||||
|
||||
impl R3d {
|
||||
pub fn new() -> R3d {
|
||||
R3d { lit: lit_material(), glow: glow_material(), opaque: opaque_material(), chunks: Vec::new(), ncx: 0, ncz: 0, outlines: true, wall_sub: 3, max_lights: MAX_LIGHTS, pixel_rows: crate::settings::PIXEL_ART_ROWS as u32, target: None, lava: Vec::new(), chunks_hd: false }
|
||||
R3d { lit: lit_material(), glow: glow_material(), opaque: opaque_material(), chunks: Vec::new(), ncx: 0, ncz: 0, outlines: true, wall_sub: 3, max_lights: MAX_LIGHTS, pixel_rows: crate::settings::PIXEL_ART_ROWS as u32, target: None, lava: Vec::new(), chunks_hd: false, chunks_holiday: 0 }
|
||||
}
|
||||
|
||||
// Changing the wall detail rebuilds all chunks
|
||||
@@ -1345,10 +1346,13 @@ impl R3d {
|
||||
ch.sig = 0;
|
||||
}
|
||||
}
|
||||
// the graphics style changed: the chunks are built again with the other atlas
|
||||
// the graphics style or the holiday changed: the chunks are built again (other atlas,
|
||||
// other decorations)
|
||||
let hd = self.pixel_rows >= crate::settings::HIGH_RES_ROWS as u32;
|
||||
if hd != self.chunks_hd {
|
||||
let holiday = crate::holiday::current();
|
||||
if hd != self.chunks_hd || holiday != self.chunks_holiday {
|
||||
self.chunks_hd = hd;
|
||||
self.chunks_holiday = holiday;
|
||||
for ch in self.chunks.iter_mut() {
|
||||
ch.sig = 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user