summaryrefslogtreecommitdiff
path: root/platforms/tortuise-script-compiled/src/buffer.rs
diff options
context:
space:
mode:
authorMica White <botahamec@outlook.com>2026-10-31 12:19:17 -0400
committerMica White <botahamec@outlook.com>2026-10-31 12:19:17 -0400
commitc2dfde109b8cd59946081ff2665bd1e75a6d116f (patch)
tree9a889a42b9a67fba8851318a79d33a956f8afad1 /platforms/tortuise-script-compiled/src/buffer.rs
parentec40f6e3acc7874b82709ab81b254c741529fdff (diff)
Fix import
Diffstat (limited to 'platforms/tortuise-script-compiled/src/buffer.rs')
-rw-r--r--platforms/tortuise-script-compiled/src/buffer.rs42
1 files changed, 42 insertions, 0 deletions
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<Attributes> 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<u32>) {
+ #[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));