Friday, May 01, 2009

More frames for 1.5 samples

I made a significant change in the way the console stores colors. Instead of having an array of cells, each cell containing the ascii code, foreground and background colors, colors are now stored in 2 TCODImages.
The obvious advantage for the user is that every TCODImage feature is now enabled on console background or foreground color.
Another advantage is that the opengl renderer can now directly access colors from the console without conversion. This results in a slightly improved framerate...


Remember that the framerate with 1.4.1 is around 140 on the same computer...

There are still remaining bugs with the opengl renderer, though. Doing pixel-perfect 2D blitting is a pain with opengl. Another issue is that most linux distribs come with poor drivers which results either in poor performances or even in a completely broken display. Apparently, there's no way I can detect if the driver is good from the library so I'll have to make it possible for the player to disable the opengl renderer, maybe in a libtcod.cfg config file...