From c2dfde109b8cd59946081ff2665bd1e75a6d116f Mon Sep 17 00:00:00 2001 From: Mica White Date: Sat, 31 Oct 2026 12:19:17 -0400 Subject: Fix import --- platforms/tortuise-script-compiled/src/buffer.rs | 42 ++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'platforms/tortuise-script-compiled/src/buffer.rs') diff --git a/platforms/tortuise-script-compiled/src/buffer.rs b/platforms/tortuise-script-compiled/src/buffer.rs index c60ee40..ce3a693 100644 --- a/platforms/tortuise-script-compiled/src/buffer.rs +++ b/platforms/tortuise-script-compiled/src/buffer.rs @@ -262,6 +262,7 @@ impl From for crossterm::style::Attributes { impl ScriptContext<'_> { pub fn add_cell(&mut self, cell: Cell) { + #[cfg(feature = "profiling")] puffin::profile_function!(); self.0 .operation_queue @@ -279,7 +280,47 @@ impl ScriptContext<'_> { })); } + pub fn add_eternal_cell(&mut self, cell: Cell) { + #[cfg(feature = "profiling")] + puffin::profile_function!(); + log::info!("Add eternal cell"); + self.0 + .operation_queue + .push(Operation::AddEternalCell(tortuise::buffer::Cell { + character: cell.character, + style: ContentStyle { + foreground_color: Some(cell.foreground_color.into()), + background_color: Some(cell.background_color.into()), + underline_color: Some(cell.underline_color.into()), + attributes: cell.attributes.into(), + }, + x: cell.x, + y: cell.y, + z: cell.z, + })); + } + + pub fn remove_eternal_cell(&mut self, cell: Cell) { + #[cfg(feature = "profiling")] + puffin::profile_function!(); + self.0 + .operation_queue + .push(Operation::RemoveEternalCell(tortuise::buffer::Cell { + character: cell.character, + style: ContentStyle { + foreground_color: Some(cell.foreground_color.into()), + background_color: Some(cell.background_color.into()), + underline_color: Some(cell.underline_color.into()), + attributes: cell.attributes.into(), + }, + x: cell.x, + y: cell.y, + z: cell.z, + })); + } + pub fn window_size(&self) -> WindowSize { + #[cfg(feature = "profiling")] puffin::profile_function!(); let size = &self.0.buffer.window_size; WindowSize { @@ -289,6 +330,7 @@ impl ScriptContext<'_> { } pub fn set_framerate_limit(&mut self, limit: Option) { + #[cfg(feature = "profiling")] puffin::profile_function!(); let limit = limit.map(|limit| Duration::from_nanos(1_000_000_000 / limit as u64)); self.0.operation_queue.push(Operation::SetFrameLimit(limit)); -- cgit v1.3.1