aboutsummaryrefslogtreecommitdiff
path: root/src/lisp
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-04-07 14:37:46 +0100
committerAkshay <[email protected]>2021-04-07 14:37:46 +0100
commitb90c2c4bc61248d5ea2e894fc70b84bc00582406 (patch)
tree5e361a095a5745ba4944e55d12d5e73090cdd54c /src/lisp
parentf57f03cd87d205d8304008d08c05f53c34b44435 (diff)
implement iso grids; lisp primitives to manipulate grids
Diffstat (limited to 'src/lisp')
-rw-r--r--src/lisp/prelude.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lisp/prelude.rs b/src/lisp/prelude.rs
index fee787e..d0667d8 100644
--- a/src/lisp/prelude.rs
+++ b/src/lisp/prelude.rs
@@ -1,6 +1,7 @@
1use crate::{ 1use crate::{
2 bitmap::MapPoint, 2 bitmap::MapPoint,
3 brush::Brush, 3 brush::Brush,
4 grid::{Grid, GridKind},
4 guide::Guide, 5 guide::Guide,
5 lisp::{ 6 lisp::{
6 error::{EvalError, LispError}, 7 error::{EvalError, LispError},
@@ -257,6 +258,16 @@ pub fn new_env() -> Result<Environment, LispError> {
257 Ok(LispExpr::Unit) 258 Ok(LispExpr::Unit)
258 }); 259 });
259 260
261 primitive!(env, Arity::Exact(0), "grid-rectangle", |_, app| {
262 app.grid.kind = GridKind::Rectangle;
263 Ok(LispExpr::Unit)
264 });
265
266 primitive!(env, Arity::Exact(0), "grid-isometric", |_, app| {
267 app.grid.kind = GridKind::Isometric;
268 Ok(LispExpr::Unit)
269 });
270
260 primitive!(env, Arity::Exact(0), "brush-fill", |_, app| { 271 primitive!(env, Arity::Exact(0), "brush-fill", |_, app| {
261 app.brush = Brush::Fill; 272 app.brush = Brush::Fill;
262 Ok(LispExpr::Unit) 273 Ok(LispExpr::Unit)