blog: Asset packing with zip.c - add images
This commit is contained in:
@ -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\`.
|
||||
|
||||

|
||||
|
||||
## 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
|
||||
|
||||

|
||||
|
||||
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
|
||||
|
Reference in New Issue
Block a user