diff --git a/blog/blog-asset-packing-with-zip.c.md b/blog/blog-asset-packing-with-zip.c.md index 54f2766..a6b701f 100644 --- a/blog/blog-asset-packing-with-zip.c.md +++ b/blog/blog-asset-packing-with-zip.c.md @@ -10,6 +10,8 @@ have to worry about this too much right now, since I've reimplemented asset pack zip library by \`kuba--\` (Polska GUROM!!!111!!). In this article I'd like to demonstrate how I've minimised the size of our assets using \`zip\` and \`incbin\`. +![zip file](/bakedres/apwz-zip-icon.png) + ## References - zip: https://raw.githubusercontent.com/kuba--/zip/refs/heads/master/src/zip.c @@ -256,6 +258,10 @@ void init_baked_resources(void) which is unpacking an in-memory .zip file. We iterate each entry in the bundle, get the name and size, preallocate a buffer and read said entry into the buffer. We can then add the resource to the hash table as we did previously. +## Conclusion + +![xkcd](/bakedres/apwz-xkcd1.png) + One question you may ask is, how much space are we saving? I don't remeber the exact sizes of the binary, but I remember that before compression it was \`~1.2M\` and now after compression is implemented, it's \`~1.6M\`. How is that an improvement if the binary gained weight? That \`~.4M\` is likely due to zip format overhead - metadata, file and diff --git a/build.c b/build.c index 22127dc..0c0cd47 100644 --- a/build.c +++ b/build.c @@ -34,6 +34,8 @@ int main(int argc, char ** argv) "./etc/me.jpg", \ "./etc/tmoa-engine.jpg", \ "./etc/tmoa-garbage.jpg", \ + "./etc/apwz-zip-icon.png", \ + "./etc/apwz-xkcd1.png", \ "./blog/blog-welcome.md", \ "./blog/blog-weird-page.md", \ "./blog/blog-curious-case-of-gebs.md", \ diff --git a/etc/apwz-xkcd1.png b/etc/apwz-xkcd1.png new file mode 100644 index 0000000..64be566 Binary files /dev/null and b/etc/apwz-xkcd1.png differ diff --git a/etc/apwz-zip-icon.png b/etc/apwz-zip-icon.png new file mode 100644 index 0000000..3818413 Binary files /dev/null and b/etc/apwz-zip-icon.png differ