I’ve made a bunch of little tweaks to the VectorStorm engine today. Most notably:
When doing a scene update, the camera now updates last, instead of first. Previously, the camera would pick where to be before the game had a chance to take any actions, which usually led to the game camera lagging one frame behind whatever it was supposed to be following. (Of course, now you’ll have the opposite problem; the game will no longer be able to tell where the camera is, since it won’t have moved into position until after the game finishes its update) In practice, the real solution is for the game itself to take responsibility for updating the camera whenever is appropriate for that game. But as a default, having the camera update last is usually less-bad than having it update first. So I’ve changed it.
I noticed that vsFont wasn’t applying text colors to strings which were justified as “centered” or “right”; they were always coming through as pure white. This is now fixed, in current trunk.
I also added another “primitive” function for creating renderable textured rectangles (as vsFragments that can be attached to a vsSprite or vsModel), this time supporting tiled textures. You can specify how big the tiles should be, and can optionally specify a rotation for the texture. Check for vsMakeTiledTexturedBox2D() in VS_Primitive.h, for that.
I’ve also been poking with the bloom effect again; I noticed that the trunk version looks pretty ugly at large screen sizes. I think I have it balanced nicely again, but haven’t committed these changes to the public repository yet; probably later tonight or tomorrow, once I’m certain that performance is still okay.
Finally, I’ve just finished scaling down the Asteroids testbed game. It’s been misbehaving ever since I converted it over to Box2D, because its objects were moving too fast for Box2D to cope with. So I’ve reduced everything by a factor of ten, and now things are moving at a reasonable speed again. I’ll be checking that in a bit later on as well. Oddly, I’m still occasionally having shots bounce off of asteroids, without receiving a collision callback. Mind you, I’m using an ancient version of Box2D; maybe I should update that someday.