mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-11-07 11:06:11 -10:00
screenshot-sequence: no pack reload or loading screen during a sequence
A Horizon pack's hot reload could rebuild the pack under the same name mid-sequence, unseen by the scene check: it now waits for the reply. A sequence doesn't start, or ends, while the level-loading screen shows, which a new world keeps a moment after it is ready. The 30 s limit is on the frames before the last: the last frame's PNG waits as screenshot does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
0be2751890
commit
8650e51ddb
3 files changed
+10
-1
No files matched your search
@@ -6511,7 +6511,8 @@ impl Renderer {
|
||||
}
|
||||
/// `screenshot-sequence`: waits (30 seconds at most) for the frame just drawn to finish on
|
||||
/// the GPU, and takes the centre depth a `shaders/` pack copied in it, which its next frame
|
||||
/// reads: that frame's, or an error, never an older one.
|
||||
/// reads: that frame's, or an error, never an older one. The last frame's PNG has already
|
||||
/// waited for it, without a limit, as `screenshot` does.
|
||||
pub fn finish_sequence_frame(&mut self) -> Result<()> {
|
||||
self.device
|
||||
.poll(wgpu::PollType::Wait {
|
||||
|
||||
@@ -40,6 +40,10 @@ impl NativeShaders {
|
||||
impl Game<'_> {
|
||||
/// Builds the pack at `path` when its files changed since it was last read.
|
||||
pub(super) fn tick_native_shader_pack(&mut self, path: &Path) {
|
||||
// A reload would replace the pack a `screenshot-sequence` draws: it waits for the reply.
|
||||
if self.screenshot_sequence.is_some() {
|
||||
return;
|
||||
}
|
||||
let now = Instant::now();
|
||||
let state = &mut self.native_shaders;
|
||||
if state.looked.is_some_and(|t| now - t < LOOK_EVERY) {
|
||||
|
||||
@@ -67,6 +67,10 @@ impl Game<'_> {
|
||||
|| self.pending_entry.is_some()
|
||||
|| self.pack_reload.is_some()
|
||||
|| self.pending_save.is_some()
|
||||
|| self
|
||||
.remote
|
||||
.as_ref()
|
||||
.is_some_and(|r| r.level_load.is_active())
|
||||
|| self.flight.is_some()
|
||||
|| self.world.chunks.is_empty()
|
||||
|| self.streaming.pending() != 0
|
||||
|
||||
Reference in new issue
Block a user