is presently its sole maintainer,
You can support him:
Plan for today
Asset metadata is already loaded, so LoadBitmap and LoadSound reduce to just fetching the data
Getting rid of LoadSound
(intermission) Forcing order of reads between checking if an asset is loaded and accessing it
(intermission) Implementing CompletePreviousReadsBeforeFutureReads
Back to removing LoadSound
Copying the contents of assets into the right place in memory
General-purpose memory copy function
Setting the channel sample pointers
Testing the changes. There's some strange clicking bug going on, probably not related to today's changes. We'll do the debugging later
Asset background loader with tag matching in 430 lines of code!
Avoiding loading the entire asset file into memory
Assets need to be rebased and pointed to the appropriate file through a file index
Finding a good place in the code for the asset struct
Filling in the asset struct
The asset struct is just an hha_asset augmented with a file index
Don't design architecture up-front
File I/O code is simple. Assuming we don't get it wrong, we'll save time by writing it now and testing it together with the code we just wrote. The alternative would involve writing some extra test code
Implementing the platform functions
We don't close files, so there's no need for a Win32CloseFile function
Windows can't do reads bigger than 4GB. We don't plan on reading assets of that size, but let's assert against that situation, just in case
Ignoring file operations on bad handles
Testing today's code
We hadn't read the header yet!
Visual Studio fails to show size information on symbols outside the current running executable
The null asset triggers an assertion. We ignore it for the moment
It (mostly) works!
bigmonachus Q: What do you use when you need something more dynamic than arenas? Default to VirtualAlloc/malloc? Something completely different?
insofaras Q: How "handmade" are you going to go on the Linux version?
quatzequatel Q: Kind of off-topic do you usually have that much luck not getting bugs?
plain_flavored Q: Do you usually design an API by just implementing it, or do you try to define the interface first?
kknewkles Q: What is "usage code"? Basically everything down the line that awaits to be fed data?
general_tach Q: Do you feel that a lot of the common programs today have "bloated" code (much unnecessary code or something along those lines), and/or that coders need to learn to simplify/barebone their code?
gasto5 Q: Doesn't anticipating the usage of the API require decades of work?
kknewkles Q: So basically when you're about to make shoes for a monster, you don't assume how many legs or toes it has, let it stomp around and then use the footprints to make the shoes
jameswidman Q: Suggestion: call this "Snuffy-oriented programming"