diff options
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 { |
