Skip to content

May 25th, 2014

May 25th, 2014 published on

I had hoped to get the display part of this thing up and running this week, but illness happened. The code part of it is complete, but doing the necessary additions to related code and making it capable of actually compiling still need to be done.

You might recall last week that I decided to make sprite caching operate by having parent scale/tint/rotation/etc applied to the cache texture instead of the individual cached sprites that make up the texture. At this point I had the idea of storing a second set of world coordinates for each of these cached sprites to keep track of where they really were in the world rather than where they were relative to their cache texture.

This idea was rather naive in that I considered world coordinates to be calculated the same way as if the cache wasn’t there. Of course in reality scaling up a texture that has a sprite in it isn’t the same as scaling that sprite up directly- its position ends up shifting as part of the scale operation! Once my head had cleared I ended up shifting to a system where collision coordinates are converted between the render targets as needed for nested cache sprites, as well as other systems such as the map camera.