Pārlūkot izejas kodu

wxGUI/animation: fix 3D rendering (#1551)

Includes fix for Python3 for deleting items in dict
Anna Petrasova 4 gadi atpakaļ
vecāks
revīzija
bae972906b

+ 4 - 0
gui/wxpython/animation/controller.py

@@ -358,6 +358,8 @@ class AnimationController(wx.EvtHandler):
                         if anim.windowIndex == i][0]
                 w, h = self.mapwindows[i].GetClientSize()
                 regions = anim.GetRegions(w, h)
+                if anim.viewMode == "3d":
+                    regions = [None] * len(regions)
                 self.animations[i].SetFrames(
                     [HashCmds(cmdList, region) for cmdList,
                      region in zip(anim.cmdMatrix, regions)])
@@ -371,6 +373,8 @@ class AnimationController(wx.EvtHandler):
                         if anim.windowIndex == i][0]
                 w, h = self.mapwindows[i].GetClientSize()
                 regions = anim.GetRegions(w, h)
+                if anim.viewMode == "3d":
+                    regions = [None] * len(regions)
                 identifiers = sampleCmdMatrixAndCreateNames(
                     anim.cmdMatrix, mapNamesDict[
                         anim.firstStdsNameType[0]], regions)

+ 3 - 1
gui/wxpython/animation/provider.py

@@ -349,6 +349,8 @@ class BitmapRenderer:
 
         filteredCmdList = []
         for cmd, region in zip(cmdList, regions):
+            if cmd[0] == "m.nviz.image":
+                region = None
             filename = GetFileFromCmd(self._tempDir, cmd, region)
             if not force and os.path.exists(filename) and self._mapFilesPool.GetSize(
                     HashCmd(cmd, region)) == (self.imageWidth, self.imageHeight):
@@ -721,7 +723,7 @@ class MapFilesPool(DictRefCounter):
         """
         Debug.msg(4, 'MapFilesPool.Clear')
 
-        for key in self.dictionary.keys():
+        for key in list(self.dictionary.keys()):
             if self.referenceCount[key] <= 0:
                 name, ext = os.path.splitext(self.dictionary[key])
                 os.remove(self.dictionary[key])