I worked on OpenGTA2 fonts today. As the result of my work everything is working now – it means that graphics subsystem (responsible for loading sprites and sprite data + caching), converter tools (which convert GTA2 graphics stuff into OpenGTA2 shared format), and font rendering work entirely now.
I split this post in two due to amount of work done (and it’s clearly divided into two steps).
I had few troubles on my way – the very first one I encountered looked like this:

This was a simple one, I just messed up VBO output (I wrote 4 vertexes, instead of 6 vertexes, aka two triangles), and also there was a problem with texture atlas – there was a read in the loop, something along the lines of fread((char*)entry->TextureAtlas->textureData,1,min(2048,chunkSize),TEX);, and it was reading only into first 2048 bytes of texture atlas graphics data.
So I fixed that, and this was what I saw on screen:

Okay. That is sort of font, but not quite. In fact what the hell is that thing…
I decided to perform a simple test – I made font renderer just output sprites named GTA2_0, GTA2_1 and so on. It’s known that those sprites define car graphics, and ONLY car graphics. What did I see on screen?
Oh wow, those aren’t cars at all – instead those are largest sprites in texture atlas, which means they were wrongfully exported with names GTA2_0, …. while they should have been exported with proper names.







