From 4d7ca10cb0f57718994f52022b9a0ecf9a108253 Mon Sep 17 00:00:00 2001
From: "Egli Adrian (IT-SCI-API-PFI)" <adrian.egli@sbb.ch>
Date: Mon, 30 Sep 2019 23:13:37 +0200
Subject: [PATCH] rendering

---
 flatland/utils/graphics_pil.py | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/flatland/utils/graphics_pil.py b/flatland/utils/graphics_pil.py
index b76b130e..2e891b74 100644
--- a/flatland/utils/graphics_pil.py
+++ b/flatland/utils/graphics_pil.py
@@ -357,9 +357,9 @@ class PILSVG(PILGL):
         ]
 
         scenery_files_d3 = [
-            "Scenery-Bergwelt_A_Teil_3_rechts.svg",
+            "Scenery-Bergwelt_A_Teil_1_links.svg",
             "Scenery-Bergwelt_A_Teil_2_mitte.svg",
-            "Scenery-Bergwelt_A_Teil_1_links.svg"
+            "Scenery-Bergwelt_A_Teil_3_rechts.svg"
         ]
 
         img_back_ground = self.pil_from_svg_file('svg', "Background_Light_green.svg")
@@ -526,7 +526,27 @@ class PILSVG(PILGL):
                     a2 = (a + (col + row + col * row + col ** 3 + row ** 4))
                     if a2 % 64 > 11:
                         a = a2
-                    pil_track = self.scenery[a % len(self.scenery)]
+                    a_l = a % len(self.scenery)
+                    pil_track = self.scenery[a_l]
+                    if rail_grid is not None:
+                        if a2 % 11 > 3:
+                            if a_l == len(self.scenery) - 1:
+                                # mountain
+                                if col > 1 and row % 7 == 1:
+                                    if rail_grid[row, col - 1] == 0:
+                                        self.draw_image_row_col(self.scenery_d2[0], (row, col - 1),
+                                                                layer=PILGL.RAIL_LAYER)
+                                        pil_track = self.scenery_d2[1]
+                        if a2 % 11 > 3:
+                            if a_l == len(self.scenery) - 1:
+                                # mountain
+                                if col > 2 and row % 5 == 0 and not (row % 7 == 1):
+                                    if rail_grid[row, col - 2] == 0 and rail_grid[row, col - 1] == 0:
+                                        self.draw_image_row_col(self.scenery_d3[0], (row, col - 2),
+                                                                layer=PILGL.RAIL_LAYER)
+                                        self.draw_image_row_col(self.scenery_d3[1], (row, col - 1),
+                                                                layer=PILGL.RAIL_LAYER)
+                                        pil_track = self.scenery_d3[2]
 
             self.draw_image_row_col(pil_track, (row, col), layer=PILGL.RAIL_LAYER)
         else:
-- 
GitLab