mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-25 08:30:24 +00:00
Headless Mode fixes for the Backend (#65)
This PR brings some fixes that are needed for the backend to render scenes.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use bevy::{
|
||||
app::AppExit,
|
||||
core_pipeline::{core_3d, prepass::ViewPrepassTextures},
|
||||
prelude::*,
|
||||
render::{
|
||||
@@ -123,9 +124,16 @@ impl ScreenCapture {
|
||||
}
|
||||
}
|
||||
|
||||
fn update_screen_capture_on_extract_step(mut screen_captures: Query<&mut ScreenCapture>) {
|
||||
fn update_screen_capture_on_extract_step(
|
||||
mut screen_captures: Query<&mut ScreenCapture>,
|
||||
mut exit_event: EventWriter<AppExit>,
|
||||
) {
|
||||
for mut screen_capture in screen_captures.iter_mut() {
|
||||
screen_capture.frames += 1;
|
||||
|
||||
if !screen_capture.should_capture() {
|
||||
exit_event.send(AppExit);
|
||||
}
|
||||
// if screen_capture.number_of_frames == 0 {
|
||||
// commands.entity(entity).remove::<ScreenCapture>();
|
||||
// }
|
||||
@@ -139,6 +147,10 @@ fn extract_screen_capture_components(
|
||||
) {
|
||||
for (entity, screen_capture) in screen_capure_comps.iter() {
|
||||
if screen_capture.should_capture() {
|
||||
println!(
|
||||
"Capturing Frame: {} / {}",
|
||||
screen_capture.frames, screen_capture.max_frames
|
||||
);
|
||||
commands.get_or_spawn(entity).insert(screen_capture.clone());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user