From 345e0665bfc9cb796d054c106f56966e9d5a7e22 Mon Sep 17 00:00:00 2001 From: Silas Bartha Date: Wed, 24 Jul 2024 12:02:10 -0400 Subject: Update to bevy 0.14 + Add 0BSD Option --- src/display/components.rs | 14 +++++++------- src/display/systems.rs | 8 +++----- 2 files changed, 10 insertions(+), 12 deletions(-) (limited to 'src/display') diff --git a/src/display/components.rs b/src/display/components.rs index 4459325..1deb6f5 100644 --- a/src/display/components.rs +++ b/src/display/components.rs @@ -1,6 +1,6 @@ use bevy::{prelude::*, render::render_resource::{Extent3d, TextureDescriptor, TextureDimension, TextureFormat, TextureUsages}}; use bevy_dither_post_process::components::DitherPostProcessSettings; -use bevy_framebuffer_extract::{components::{ExtractFramebufferBundle, FramebufferExtractDestination}, render_assets::FramebufferExtractSource}; +use bevy_headless_render::{components::{HeadlessRenderBundle, HeadlessRenderDestination}, render_assets::HeadlessRenderSource}; /// Marker component for terminal display #[derive(Component)] @@ -11,8 +11,8 @@ pub struct TerminalDisplay; #[derive(Bundle)] pub struct TerminalDisplayBundle { _terminal_display: TerminalDisplay, - extract_framebuffer_bundle: ExtractFramebufferBundle, - dither_post_process_settings: DitherPostProcessSettings, + _headless_render_bundle: HeadlessRenderBundle, + _dither_post_process_settings: DitherPostProcessSettings, image_handle: Handle, } @@ -48,16 +48,16 @@ impl TerminalDisplayBundle { let image_handle = asset_server.add(image); let framebuffer_extract_source = - asset_server.add(FramebufferExtractSource(image_handle.clone())); + asset_server.add(HeadlessRenderSource(image_handle.clone())); Self { _terminal_display: TerminalDisplay, - extract_framebuffer_bundle: ExtractFramebufferBundle { + _headless_render_bundle: HeadlessRenderBundle { source: framebuffer_extract_source, - dest: FramebufferExtractDestination::default(), + dest: HeadlessRenderDestination::default(), }, image_handle, - dither_post_process_settings: DitherPostProcessSettings::new( + _dither_post_process_settings: DitherPostProcessSettings::new( dither_level, asset_server, ), diff --git a/src/display/systems.rs b/src/display/systems.rs index 037f72d..9f8acb9 100644 --- a/src/display/systems.rs +++ b/src/display/systems.rs @@ -2,9 +2,7 @@ use bevy::{ prelude::*, render::render_resource::{Extent3d, TextureFormat}, }; -use bevy_framebuffer_extract::{ - components::FramebufferExtractDestination, render_assets::FramebufferExtractSource, -}; +use bevy_headless_render::{components::HeadlessRenderDestination, render_assets::HeadlessRenderSource}; use crossterm::event::Event; use ratatui::{ style::Stylize, @@ -27,7 +25,7 @@ const BRAILLE_DOT_BIT_POSITIONS: [u8; 8] = [0, 1, 2, 6, 3, 4, 5, 7]; /// Prints out the contents of a render image to the terminal as braille characters pub fn print_to_terminal( mut terminal: ResMut, - image_exports: Query<&FramebufferExtractDestination>, + image_exports: Query<&HeadlessRenderDestination>, mut widgets: Query<&mut Widget>, ) { for image_export in image_exports.iter() { @@ -108,7 +106,7 @@ fn braille_char(mask: u8) -> char { /// Watches for terminal resize events and resizes the render image accordingly pub fn resize_handling( mut images: ResMut>, - mut sources: ResMut>, + mut sources: ResMut>, mut event_reader: EventReader, ) { for event in event_reader.read() { -- cgit v1.2.3