Currently the mini-map does not update when the water height changes (outside of Atlas) - this is noticeable when testing D229, which adds a random map with a script that slowly raises the water height. It is very disorienting and misleading as the mini-map never changes the water height from its original state at the beginning of the game. Also, in the future, there could be more map scripts added that change the water height dynamically like this (maybe a river that floods periodically and then subsides or something).
Details
Whenever a map's water height changes, the mini-map will update accordingly. The map at D229 can be used to test this.
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
source/gui/MiniMap.cpp | ||
---|---|---|
412 ↗ | (On Diff #1288) | Shouldn't be there some small EPS, to prevent the recalculating of all data each frame if water is always rising? |
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (305 tests).................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (305 tests).................................................................................................................................................................................................................................................................................................................OK!
http://jw:8080/job/phabricator/790/ for more details.
The recalculation seems to take a negligible amount of time - at least on my system (with PROFILE2 the function seems to take around ~300us).
There is no clean way to listen to the MT_WaterChanged messages sent in the simulation, mainly because the Minimap component is not a system component.
source/gui/MiniMap.cpp | ||
---|---|---|
412 ↗ | (On Diff #1288) | The recalculation is not done on every frame even if the water is always rising - in this function RebuildTerrainTexture() is only called at most 2 times a second. |
Awesome patch!!
I was too busy looking into the Minimap code, but this really fixes it nicely and the result looks really great with extinct volcano. Thumbs up!
source/gui/MiniMap.cpp | ||
---|---|---|
68 ↗ | (On Diff #1288) | Can be initialized with 0 since it is rebuilt anyway (appears a bit less arbitrary than 1) |