aboutsummaryrefslogtreecommitdiff
path: root/posts
diff options
context:
space:
mode:
Diffstat (limited to 'posts')
-rw-r--r--posts/SDL2_devlog.md23
1 files changed, 22 insertions, 1 deletions
diff --git a/posts/SDL2_devlog.md b/posts/SDL2_devlog.md
index eb11de8..04ac928 100644
--- a/posts/SDL2_devlog.md
+++ b/posts/SDL2_devlog.md
@@ -5,6 +5,27 @@ on the editor. The days are listed in reverse chronological
5order, begin from the bottom, if this is your first time on 5order, begin from the bottom, if this is your first time on
6this page. 6this page.
7 7
8### Day 18
9
10I added basic support for guides, they can be added and
11activated from the `lisp` REPL. Another long standing
12improvement I wanted to make was reworking the pixmap
13drawing procedure. The old procedure draws a square for each
14pixel in the pixmap, coloured according to its value in the
15pixmap. Naturally, this means, for an **NxN** pixmap, there
16are **N²** calls to SDL! I reworked this procedure to
17compress each line of the pixmap using RLE (run length
18encoding), and call out to SDL for each run in the line.
19This drastically improved drawing speeds on larger grids.
20The following is a comparison between the two procedures,
21the leftmost picture is the rendered image, the middle
22picture is the optimized drawing procedure (draws each run
23instead of pixel), and the right most picture is the
24primitive drawing procedure (draws each pixel):
25
26![Day 18](https://u.peppe.rs/U4B.png)
27
28
8### Day 17 29### Day 17
9 30
10I decided to give the text-only statusline a touch up, by 31I decided to give the text-only statusline a touch up, by
@@ -23,7 +44,7 @@ let statusline =
23let mut primary = Container::uninit() 44let mut primary = Container::uninit()
24 .width(Size::Absolute(16)) 45 .width(Size::Absolute(16))
25 .height(Size::Absolute(16)); 46 .height(Size::Absolute(16));
26 47
27container.place( 48container.place(
28 &mut padding_box, 49 &mut padding_box,
29 HorAlign::Right, 50 HorAlign::Right,