Viewport: Cache landscape pixels in map mode

Avoid invalidating landscape pixels for non-landscape updates
(vehicles, overlays, etc.)
This commit is contained in:
Jonathan G Rennison
2020-10-01 23:11:15 +01:00
parent 8071976b0e
commit a474e71243
23 changed files with 268 additions and 143 deletions

View File

@@ -16,6 +16,7 @@
#include "command_func.h"
#include "sound_func.h"
#include "tree_map.h"
#include "viewport_func.h"
#include "widgets/tree_widget.h"
@@ -117,13 +118,13 @@ public:
case WID_BT_MANY_RANDOM: // place trees randomly over the landscape
if (_settings_client.sound.confirm) SndPlayFx(SND_15_BEEP);
PlaceTreesRandomly();
MarkWholeScreenDirty();
MarkWholeNonMapViewportsDirty();
break;
case WID_BT_REMOVE_ALL: // remove all trees over the landscape
if (_settings_client.sound.confirm) SndPlayFx(SND_15_BEEP);
RemoveAllTrees();
MarkWholeScreenDirty();
MarkWholeNonMapViewportsDirty();
break;
}