Ok, i did stupid mistake. And i got better and faster average color calculation using scanlines: http://www.delphimaster.net/view/2-1...72/all#PageTop
I was calculating this for every pixel 64x64 and in a third loop. Thats why it was terribly slow. I really should not code at nights and after the work when im very tired.
Now i just get avg color for each of the 992 tiles and store it in a 1D array of TColors:
Code:
tileColorIndexes: array[0..991] of TColor;
Later i just loop through map and set minimap pixel color according to: tileColorIndexes[tile_id];
But i still have to optimize a bit. Just do reading tiles once, not twice. But anyways, here are the results using average colors. Amazing how good the minimaps look right now.
I still have to think about the logic for the transparent faces (tiles), so here is one with transparent disabled and second one enabled. The first one with lots of black pixels is the disabled transparency version.
Second
Bookmarks