Eyecandy is eating me.
Posted by Overkill on July 21, 2008 at 3:43 am under gruedorfThis week for Gruedorf, I spent more time on the graphics sections of brockoly.
I hand-optimized the crap out of the rotation blitter function, and so now it only iterates over the rectangle enclosing the rotation instead of iterating the entire image (bad), and I factored out a bunch of crazy calculation bottlenecks. I’m sure it could be further optimized, but not gonna bother since I plan on having hardware blits anyway.
I also made a nifty line drawing algorithm, which uses Cohen-Sutherland to clip the lines, and then Bresenham to draw them.
Oh and I added a fairly optimized scanline circle drawing algorithm based on some fancy-looking paper about fast circle drawing I found with google. I guess you could call that reinventing the spokeless (or infinite spoke) wheel.
I also made a bunch of slight improvements on the blending macros to make them slightly faster, and also added a global alpha that’s applied onto all blends (except Opaque — which is direct pixel copy).
With that, I’m left with gradient effects, palette maps, and drawing subregions of images for software.
I started coming up with some design planning stuff for how interaction with hardware textures will work. Here’s what I’m thinking: each of these textures each have a backend image — an image that can be retreived, drawn onto, and then applied to the texture once updates are done.
Sadly, though, I realized since a texture’s image can be changed, not all textures can be cached in memory. But the subsystems like sprites probably can be cached.
But okay there’s another interesting problem I read about — any time an SDL window resizes apparently the whole OpenGL context is discarded, so any texture bindings that were in memory are wiped out. I might have to disallow resizing of the game window at runtime just to prevent this, because this is preeeeetty bad.
I’ll be happy when all the graphical side of things is working nice, because it’s not until the graphical stuff’s done that I can really work on the cooler things, like the fancy world/area/tileset/sprite formats.
Oh right, and, The Dark Knight was epic and made of awesome. And so was playing Marvel Heroes vs Street Fighter in the arcade beforehand.
Uhm, anyway, that’s it for this week!


No comments yet. Make one!