1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

Fix fence drawing

This commit is contained in:
Marijn van der Werf
2016-04-24 11:51:56 +02:00
parent 159646e717
commit 22b95ef515

View File

@@ -2344,6 +2344,7 @@ void viewport_surface_paint_setup(uint8 direction, uint16 height, rct_map_elemen
uint32 image_1, image_2, image_3;
switch (i) {
case 0:
// Bottom right
bit_1 = 1;
bit_8 = 8;
bit_4 = 4;
@@ -2357,6 +2358,7 @@ void viewport_surface_paint_setup(uint8 direction, uint16 height, rct_map_elemen
break;
case 1:
// Bottom left
bit_1 = 1;
bit_8 = 2;
bit_4 = 4;
@@ -2370,6 +2372,7 @@ void viewport_surface_paint_setup(uint8 direction, uint16 height, rct_map_elemen
break;
case 2:
// Top left
bit_1 = 4;
bit_8 = 2;
bit_4 = 8;
@@ -2383,6 +2386,7 @@ void viewport_surface_paint_setup(uint8 direction, uint16 height, rct_map_elemen
break;
case 3:
// Top right
bit_1 = 4;
bit_8 = 8;
bit_4 = 2;
@@ -2396,6 +2400,15 @@ void viewport_surface_paint_setup(uint8 direction, uint16 height, rct_map_elemen
break;
}
uint32 image_4, image_5;
if (i == 0 || i == 1) {
image_4 = image_3;
image_5 = image_2;
} else {
image_4 = image_2;
image_5 = image_3;
}
int local_ebx = ebx;
int local_height = height;
int image_id = 0;
@@ -2413,9 +2426,9 @@ void viewport_surface_paint_setup(uint8 direction, uint16 height, rct_map_elemen
if (!(local_ebx & 0x10)) { // loc_6619B5 (first)
image_id = image_1;
} else if (local_ebx & bit_4) { // loc_6619B5 (second)
image_id = image_3;
image_id = image_4;
} else if (local_ebx & bit_2) { // loc_6619B5 (third)
image_id = image_2;
image_id = image_5;
} else {
image_id = image_1;
}