Is the map like 3D with different layers, or flat plane of tiles? If there are layers, it might at least look best by finding the "roof-block" and plotting its color. You can get roof-block by starting searching from sky/height-max level downwards, until you meet a block that is non-empty. (And you could cache this information for later use in a byte-array)
As for color averages, OpenGL can do that for you. If you for example wanted to draw a roughly blurred map of 32x32 world, using only every second tile of it:
- Initialize a 16x16 texture with GL_LINEAR.
- Plot every second tile to it.
- Render the texture with any size quad.
(Obviously this is just a bad example. It'd be better to use 32x32 texture for full details.)
But also some simple algorithm if you have to do it manually:
Code:
For-loop through tiles from 0 to MapWidth-2, 0 to MapHeight-2:
color.R:=(col[x,y].R + col[x+1,y].R + col[x,y+1].R + col[x+1,y+1].R)*0.25; // Average Red
// Same for Green and Blue channels
Bookmarks