Little bugs

Spent much of my spare time today debugging the system which handles optimised OpenGL state changes, and porting that back into the VectorStorm trunk.  (It was tricky to get to work properly, since half of the Testbed games don’t use the material system;  took me ages to work out why things weren’t drawing properly!)

I also spent a kind of frighteningly large amount of time trying to figure out why I couldn’t get my “sub regions” to draw, as seen in this screenshot.  Silly me, I’d forgotten that my accelerated drawing stuff that’s used almost exclusively in MMORPG Tycoon 2 isn’t as easy to use as simply placing a model into the scene;  the drawing was accidentally occurring in an entirely different part of the world.  (For any with an interest in such things, this accelerated approach just sets a combined modelview matrix directly into the OpenGL state, instead of multiplying several matrices together one at a time within the OpenGL driver.  For those looking in the source code, this is done via the “SetMatrix4x4()” call on the display list, instead of using the Push/Pop functions.)

Virtually everything in MMORPG Tycoon 2 is rendering using custom rendering code.  Which means that almost none of it is testing the standard sprite or model systems (exception:  GUI elements).  Which means that it’s all a little bit prone to surprising errors when I’ve made a mistake.  But when it’s working, it’s very fast.