diff options
| author | Mica White <botahamec@outlook.com> | 2026-10-31 12:19:17 -0400 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2026-10-31 12:19:17 -0400 |
| commit | c2dfde109b8cd59946081ff2665bd1e75a6d116f (patch) | |
| tree | 9a889a42b9a67fba8851318a79d33a956f8afad1 /platforms/tortuise-script-wasm/src/buffer.rs | |
| parent | ec40f6e3acc7874b82709ab81b254c741529fdff (diff) | |
Fix import
Diffstat (limited to 'platforms/tortuise-script-wasm/src/buffer.rs')
| -rw-r--r-- | platforms/tortuise-script-wasm/src/buffer.rs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/platforms/tortuise-script-wasm/src/buffer.rs b/platforms/tortuise-script-wasm/src/buffer.rs index bbcb3ca..fbb63f8 100644 --- a/platforms/tortuise-script-wasm/src/buffer.rs +++ b/platforms/tortuise-script-wasm/src/buffer.rs @@ -15,6 +15,26 @@ mod tortuise { underline_color: u32, attributes: u32, ); + pub safe fn add_eternal_cell( + context: u64, + character: u32, + location: u32, + z: u32, + foreground_color: u32, + background_color: u32, + underline_color: u32, + attributes: u32, + ); + pub safe fn remove_eternal_cell( + context: u64, + character: u32, + location: u32, + z: u32, + foreground_color: u32, + background_color: u32, + underline_color: u32, + attributes: u32, + ); pub safe fn window_size(context: u64) -> u32; pub safe fn set_framerate_limit(context: u64, limit: u32); } @@ -226,6 +246,32 @@ impl ScriptContext<'_> { ); } + pub fn add_eternal_cell(&mut self, cell: Cell) { + tortuise::add_eternal_cell( + self.0, + cell.character as u32, + (cell.x as u32) << 16 | cell.y as u32, + cell.z as u32, + color_to_u32(cell.foreground_color), + color_to_u32(cell.background_color), + color_to_u32(cell.underline_color), + cell.attributes.0, + ); + } + + pub fn remove_eternal_cell(&mut self, cell: Cell) { + tortuise::remove_eternal_cell( + self.0, + cell.character as u32, + (cell.x as u32) << 16 | cell.y as u32, + cell.z as u32, + color_to_u32(cell.foreground_color), + color_to_u32(cell.background_color), + color_to_u32(cell.underline_color), + cell.attributes.0, + ); + } + pub fn window_size(&self) -> WindowSize { let size = tortuise::window_size(self.0); WindowSize { |
