The old algorithm went like this:
if (inside charted space)
draw a bunch of pseudo-random stars on the tile
else if (inside the galactic bounds)
construct a tile-sized bitmap
draw a bunch of pseudo-random stars on the bitmap
load a path describing the galactic arms
on the tile, fill the path using the bitmap as a brush
The new code looks like this:
if (inside charted space)
draw a bunch of pseudo-random stars on the tile
else if (inside the galactic bounds)
load a path describing the galactic arms
use the path as a "clipping" region
draw a bunch of pseudo-random stars on the tile
Simpler, huh? Well, yes, but it turns out that (1) it's a whopping huge path with lots of curves and segments (and I reduced it as much as I could), (2) bitmap-based clipping is heavily optimized, and (3) it's a single clip against a region, rather than once per star.
After pondering the importance of this (i.e. not very) I decided to simply ditch the pseudo-random stars away from charted space, and turn on the pretty galaxy image instead if you zoom out.
So... I'm pretty close to flipping the switch on this to make it live, but want to double check all of the changes first. But to whet your appetites, here are few more previews:
Spinward Marches - Eye-Candy - this one is a bit big (1MB) due to all the images
Charted Space
Enjoy! Ω
1 comment:
Positively beautiful.
Now, does it work with the white background//black lines selection?
I need to show this to Marc.
Post a Comment