Today' s question is brought to you by the Diet Coke of Evil: 1 Calorie, not Evil enough.
Ahem... Sorry, I'm in a slightly silly mood.
Anyway. In AOE when a unit is partially obscured, a colored outline appears around the contours of the sprite, only the obscured part.
I was trying to figure out how this is done, but the only way I came up with (at 1am) seems silly, slow, and inefficient, but here goes.
1) a mask of the outline of the sprite
2) a mask of the object that is blocking the view
1) find the union of the bounding rectangles.
2) AND the masks (within the union of bounding rectangles), this should give you a new outline.
3) Putpixel of a bright color for every black pixel in the new mask
1) Extra bitmap (boolean array?) for every frame of animation for every sprite.
2) 1 sprite 32x64x32 FPS = 65K calls to GetPixelColor (or equivalent) per second!
1) Blit the new mask in the color needed (how?)
For the sake of discussions, lets say we are using DirectDraw for a 2D app.
Any ideas, comments, suggestions?