Today I continued with the fonts rendering. Adding functions to draw some debug text. These functions will first be used to print out some timers. That way I can see how long certain functions take and how long one frame takes. Pretty basic, but important stuff.

However the renderer was working a bit against me. Which just points that stuff needs to change there. For example scaling was broken and that made it difficult to scale the font properly to see it on screen. But also it was a bit hard to understand what the correct flow should be. Right now I have to set the scale on the transform. I actually want to be able to say to the PushBitmap function that it needs to scale the image. Besides that I also want a function where I can say just scale this image as a 32×32 image. That the renderer than figures out how big the bitmap should be scaled to result into a 32×32 image on screen.

Asset Management
And to make it all complete. Before all the font stuff, some bugs needed to be fixed in the asset management. That resulted in a game breaking bug. So that means I can’t test the collision systems right now. As the game can only run for 3 seconds or so. I’ll work on fixing all these bugs and nastiness this week. In the hope that next week I have a more robust engine again. I really don’t want bugs to keep me back like this. And some things should have been fixed earlier to be honest.

I managed to not let the game crash anymore for now. Or there really is a bug in the asset builder or audio processing code. Or it’s just that some values are incorrectly set for the audio that is playing. Since shortening the total audio clip from 10 to 6 seconds fixes the issue. Now it can normally finish the sound. That code in the asset builder is definitely not staying. It has that audio file hardcoded in now.

So after having that fixed for now I could try setting the alignment for the font correctly. It was a bit of fiddling and moving some code around. But the result is definitely worth it. Having never done anything with fonts really it’s fun to work with it. It’s really just images, aligning them correctly. Then you really quickly get a decent result already.

I’m just glad I choose to follow this series. Getting back to the "old" way of coding. That was fun and it has shown it is still fun and actually the preferred way of doing things. Though for this week I have still one video left to follow. I can at least go to sleep peacefully tonight knowing the game doesn’t crash. As well as having done the vertical alignment of the glyphs.

Last modified: December 12, 2022