In short:
- No more grid-for-alpha; everything uses generated textures now
(With proper bilinear filtering so it looks like the old method)
- All tiles are now shown partially uncovered at the same time;
selecting one is no longer needed
- Gems can now be local (associated to a tile) or global.
Local games move with their tile, global ones stay where they were placed
Background:
Originally there were two possible implementations of how to render the world map:
- One used write-alpha-to-texture to implement graual uncovering.
- The other (permanently enabled) used the DrawGrid to render the map tiles
as a fine grid, each little square having its own alpha value
The downside of the first method was that it didn't look as good as the
second, so i guess that's why it was never fully finished.
The main downside of the second method was that it burned a lot of vertices
just to do alpha, so only one tile at a time could show the detailed grid.
I also never liked how an entire tile was effectively fully uncovered once
the map was first entered, taking away a lot of the exploration feeling
that could have been there if everything that hasn't been explored would be
completely invisible.
I've added this worldmap uncovering method as an optional config param,
<WorldMap revealMethod="1"/> but i've decided to fully switch over now.
Things left to be done:
- create a WorldMapRender instance only once and keep the tiles across map loads
- add debug option to reload/recreate worldmap at runtime
- cleanup gem storage and carry over the player gem properly (ged rid of std::list)
- remove "worldmap" grid render type
- Add more user "pyramid" gems as world map markers. More colors!
- check that gems and beacons still work as they should
Eliminates stutter on slow machines or in debug mode when operating doors.
Also the game shouldn't freeze anymore when marking very large tiles
as obstructing.
reconstructGrid() or editor use fixed this, but that usually didn't happen
when playing vanilla maps normally
Again, the dreaded black edges, should now be fixed for good...
One such case is the editor; if Ctrl was mapped to RMB then rotating
tiles in 45° increment mode is impossible
(since the editor checks for Ctrl to enable increment mode,
and it did the wrong thing when releasing "both" at the same time)
First i thought this would fix the bug fixed in the prev. commit,
but it was unrelated.
Now that i've changed it and made it more readable, may as well keep it.