Smart Tilemap?

Monkey Forums/Monkey Programming/Smart Tilemap?

zoqfotpik(Posted 2013) [#1]
I want a tilemap engine in which the tiles can be shaded using setcolor to diminish the brightness of the tile, but some pixels or small rectangular areas on the tilemap can be fullbright and in various colors.

What is the best way to do this?

I had thought of stegonographically encoding information for the fullbright areas into the tiles.

Probably it would be easier to use some sort of metadata method for defining rectangles to be fullbright, which would be loaded alongside the tilemap bmp.

To minimize state changes using setcolor, during the tilemap draw routine, a stack of rectangles and their respective colors would be built up, and then when the tilemap draw was finished the color would be set to 255,255,255 and then the fullbright areas would be blitted on top of the tiles.

This would be for lighting in a shmup and I don't foresee a lot of the tiles using fullbright, and the areas would be quite small-- a few 3x5 rectangles on a 32x32 bitmap.

This method could also be generalized for ground with foliage on top of it-- a hash would be fed into a pseudorandom number generator of the x and y array coordinates of a tile, and then based on that, the locations of several trees or bushes would be generated, then blitted on top of the full tilemap.

Has anyone played with methods like this?

Is the Monkey engine fillrate limited? Are many smaller rectangles blitted as fast as one screenfilling bitmap or is it CPU bound?