aboutsummaryrefslogtreecommitdiff
path: root/docs/index.xml
diff options
context:
space:
mode:
Diffstat (limited to 'docs/index.xml')
-rw-r--r--docs/index.xml9
1 files changed, 7 insertions, 2 deletions
diff --git a/docs/index.xml b/docs/index.xml
index 8d876b6..8a4e57f 100644
--- a/docs/index.xml
+++ b/docs/index.xml
@@ -14,6 +14,11 @@
14 <item> 14 <item>
15<title>SDL2 Devlog</title> 15<title>SDL2 Devlog</title>
16<description>&lt;p&gt;I have been working on an editor for the &lt;a href="https://git.peppe.rs/graphics/obi/about"&gt;One Bit Image&lt;/a&gt; file format in Rust and SDL2. This entry in my blog follows my progress on the editor. The days are listed in reverse chronological order, begin from the bottom, if this is your first time on this page.&lt;/p&gt; 16<description>&lt;p&gt;I have been working on an editor for the &lt;a href="https://git.peppe.rs/graphics/obi/about"&gt;One Bit Image&lt;/a&gt; file format in Rust and SDL2. This entry in my blog follows my progress on the editor. The days are listed in reverse chronological order, begin from the bottom, if this is your first time on this page.&lt;/p&gt;
17&lt;h3 id="day-18"&gt;Day 18&lt;/h3&gt;
18&lt;p&gt;I added basic support for guides, they can be added and activated from the &lt;code&gt;lisp&lt;/code&gt; REPL. Another long standing improvement I wanted to make was reworking the pixmap drawing procedure. The old procedure draws a square for each pixel in the pixmap, coloured according to its value in the pixmap. Naturally, this means, for an &lt;strong&gt;NxN&lt;/strong&gt; pixmap, there are &lt;strong&gt;N²&lt;/strong&gt; calls to SDL! I reworked this procedure to compress each line of the pixmap using RLE (run length encoding), and call out to SDL for each run in the line. This drastically improved drawing speeds on larger grids. The following is a comparison between the two procedures, the leftmost picture is the rendered image, the middle picture is the optimized drawing procedure (draws each run instead of pixel), and the right most picture is the primitive drawing procedure (draws each pixel):&lt;/p&gt;
19&lt;figure&gt;
20&lt;img src="https://u.peppe.rs/U4B.png" alt="Day 18" /&gt;&lt;figcaption aria-hidden="true"&gt;Day 18&lt;/figcaption&gt;
21&lt;/figure&gt;
17&lt;h3 id="day-17"&gt;Day 17&lt;/h3&gt; 22&lt;h3 id="day-17"&gt;Day 17&lt;/h3&gt;
18&lt;p&gt;I decided to give the text-only statusline a touch up, by adding a active color and dither level preview. Aligning the “widget” to the right of statusline involved a lot more than I thought, so I created a ghetto CSS-like rectangle placement system to position containers inside containers:&lt;/p&gt; 23&lt;p&gt;I decided to give the text-only statusline a touch up, by adding a active color and dither level preview. Aligning the “widget” to the right of statusline involved a lot more than I thought, so I created a ghetto CSS-like rectangle placement system to position containers inside containers:&lt;/p&gt;
19&lt;div class="sourceCode" id="cb1"&gt;&lt;pre class="sourceCode rust"&gt;&lt;code class="sourceCode rust"&gt;&lt;span id="cb1-1"&gt;&lt;a href="#cb1-1" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="co"&gt;// roughly something like this&lt;/span&gt;&lt;/span&gt; 24&lt;div class="sourceCode" id="cb1"&gt;&lt;pre class="sourceCode rust"&gt;&lt;code class="sourceCode rust"&gt;&lt;span id="cb1-1"&gt;&lt;a href="#cb1-1" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="co"&gt;// roughly something like this&lt;/span&gt;&lt;/span&gt;
@@ -25,7 +30,7 @@
25&lt;span id="cb1-7"&gt;&lt;a href="#cb1-7" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="kw"&gt;let&lt;/span&gt; &lt;span class="kw"&gt;mut&lt;/span&gt; primary &lt;span class="op"&gt;=&lt;/span&gt; &lt;span class="pp"&gt;Container::&lt;/span&gt;uninit()&lt;/span&gt; 30&lt;span id="cb1-7"&gt;&lt;a href="#cb1-7" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="kw"&gt;let&lt;/span&gt; &lt;span class="kw"&gt;mut&lt;/span&gt; primary &lt;span class="op"&gt;=&lt;/span&gt; &lt;span class="pp"&gt;Container::&lt;/span&gt;uninit()&lt;/span&gt;
26&lt;span id="cb1-8"&gt;&lt;a href="#cb1-8" aria-hidden="true"&gt;&lt;/a&gt; &lt;span class="op"&gt;.&lt;/span&gt;width(&lt;span class="pp"&gt;Size::&lt;/span&gt;Absolute(&lt;span class="dv"&gt;16&lt;/span&gt;))&lt;/span&gt; 31&lt;span id="cb1-8"&gt;&lt;a href="#cb1-8" aria-hidden="true"&gt;&lt;/a&gt; &lt;span class="op"&gt;.&lt;/span&gt;width(&lt;span class="pp"&gt;Size::&lt;/span&gt;Absolute(&lt;span class="dv"&gt;16&lt;/span&gt;))&lt;/span&gt;
27&lt;span id="cb1-9"&gt;&lt;a href="#cb1-9" aria-hidden="true"&gt;&lt;/a&gt; &lt;span class="op"&gt;.&lt;/span&gt;height(&lt;span class="pp"&gt;Size::&lt;/span&gt;Absolute(&lt;span class="dv"&gt;16&lt;/span&gt;))&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt; 32&lt;span id="cb1-9"&gt;&lt;a href="#cb1-9" aria-hidden="true"&gt;&lt;/a&gt; &lt;span class="op"&gt;.&lt;/span&gt;height(&lt;span class="pp"&gt;Size::&lt;/span&gt;Absolute(&lt;span class="dv"&gt;16&lt;/span&gt;))&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
28&lt;span id="cb1-10"&gt;&lt;a href="#cb1-10" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt; 33&lt;span id="cb1-10"&gt;&lt;a href="#cb1-10" aria-hidden="true"&gt;&lt;/a&gt; &lt;/span&gt;
29&lt;span id="cb1-11"&gt;&lt;a href="#cb1-11" aria-hidden="true"&gt;&lt;/a&gt;container&lt;span class="op"&gt;.&lt;/span&gt;place(&lt;/span&gt; 34&lt;span id="cb1-11"&gt;&lt;a href="#cb1-11" aria-hidden="true"&gt;&lt;/a&gt;container&lt;span class="op"&gt;.&lt;/span&gt;place(&lt;/span&gt;
30&lt;span id="cb1-12"&gt;&lt;a href="#cb1-12" aria-hidden="true"&gt;&lt;/a&gt; &lt;span class="op"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kw"&gt;mut&lt;/span&gt; padding_box&lt;span class="op"&gt;,&lt;/span&gt;&lt;/span&gt; 35&lt;span id="cb1-12"&gt;&lt;a href="#cb1-12" aria-hidden="true"&gt;&lt;/a&gt; &lt;span class="op"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kw"&gt;mut&lt;/span&gt; padding_box&lt;span class="op"&gt;,&lt;/span&gt;&lt;/span&gt;
31&lt;span id="cb1-13"&gt;&lt;a href="#cb1-13" aria-hidden="true"&gt;&lt;/a&gt; &lt;span class="pp"&gt;HorAlign::&lt;/span&gt;Right&lt;span class="op"&gt;,&lt;/span&gt;&lt;/span&gt; 36&lt;span id="cb1-13"&gt;&lt;a href="#cb1-13" aria-hidden="true"&gt;&lt;/a&gt; &lt;span class="pp"&gt;HorAlign::&lt;/span&gt;Right&lt;span class="op"&gt;,&lt;/span&gt;&lt;/span&gt;
@@ -134,7 +139,7 @@
134&lt;img src="https://u.peppe.rs/Ma.png" alt="Day 1" /&gt;&lt;figcaption aria-hidden="true"&gt;Day 1&lt;/figcaption&gt; 139&lt;img src="https://u.peppe.rs/Ma.png" alt="Day 1" /&gt;&lt;figcaption aria-hidden="true"&gt;Day 1&lt;/figcaption&gt;
135&lt;/figure&gt;</description> 140&lt;/figure&gt;</description>
136<link>https://peppe.rs/posts/SDL2_devlog/</link> 141<link>https://peppe.rs/posts/SDL2_devlog/</link>
137<pubDate>Fri, 02 Apr 2021 05:01:00 +0000</pubDate> 142<pubDate>Sun, 04 Apr 2021 16:01:00 +0000</pubDate>
138<guid>https://peppe.rs/posts/SDL2_devlog/</guid> 143<guid>https://peppe.rs/posts/SDL2_devlog/</guid>
139</item> 144</item>
140<item> 145<item>