Well, I thought that figuring out what I wanted to do with the animation system would be the hard part and the actual programming would be trivial. I was mostly right, but it turns out there’s one problem that’s surprisingly sticky: Drawing the cached data in the right location. To do this I need to find where the upper left corner of the bitmap data lines up after its rotation, based on whichever point it rotates around.
I found a solution I was sure would work — rotating the four corners of the bitmap’s starting position with offset around the origin and finding the lowest x and y among them — but for some reason that creates a sort of flower pattern, where it lines up when the square is flat along one of the sides but bows out too far when it’s angled into a diamond shape. I can’t figure out why that is, so I’m gonna sleep on it.