mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Fix #4698: Scenery blocks wrong segments
This commit is contained in:
@@ -98,7 +98,7 @@ void scenery_paint(uint8 direction, int height, rct_map_element* mapElement) {
|
||||
}
|
||||
} else {
|
||||
// 6DFFC2:
|
||||
uint32 ecx = ((mapElement->type >> 6) + rotation) & 3;
|
||||
uint8 ecx = (map_element_get_scenery_quadrant(mapElement) + rotation) & 3;
|
||||
x_offset = ScenerySubTileOffsets[ecx].x;
|
||||
y_offset = ScenerySubTileOffsets[ecx].y;
|
||||
boxoffset.x = x_offset;
|
||||
@@ -293,11 +293,12 @@ void scenery_paint(uint8 direction, int height, rct_map_element* mapElement) {
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!(entry->small_scenery.flags & SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) {
|
||||
if (entry->small_scenery.flags & SMALL_SCENERY_FLAG_VOFFSET_CENTRE) {
|
||||
// 6E075C:
|
||||
uint8 direction = (map_element_get_scenery_quadrant(mapElement) + rotation) % 4;
|
||||
paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), height, 0x20);
|
||||
return;
|
||||
}
|
||||
// 6E075C:
|
||||
paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, rotation), height, 0x20);
|
||||
return;
|
||||
}
|
||||
if (entry->small_scenery.flags & (SMALL_SCENERY_FLAG27 | SMALL_SCENERY_FLAG_FULL_TILE)) {
|
||||
@@ -307,9 +308,9 @@ void scenery_paint(uint8 direction, int height, rct_map_element* mapElement) {
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!(entry->small_scenery.flags & SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) {
|
||||
if (entry->small_scenery.flags & SMALL_SCENERY_FLAG_VOFFSET_CENTRE) {
|
||||
uint8 direction = (map_element_get_scenery_quadrant(mapElement) + rotation) % 4;
|
||||
paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
|
||||
return;
|
||||
}
|
||||
paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, rotation), 0xFFFF, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1200,7 +1200,7 @@ void window_scenery_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int scrol
|
||||
|
||||
gfx_draw_sprite(&clipdpi, imageId, 0x20, spriteTop, w->colours[1]);
|
||||
|
||||
if (sceneryEntry->small_scenery.flags & 0x200) {
|
||||
if (sceneryEntry->small_scenery.flags & SMALL_SCENERY_FLAG_HAS_GLASS) {
|
||||
imageId = ((sceneryEntry->image + gWindowSceneryRotation) + 0x40000004) +
|
||||
((gWindowSceneryPrimaryColour + 0x70) << 19);
|
||||
|
||||
|
||||
@@ -242,6 +242,11 @@ int map_element_is_last_for_tile(const rct_map_element *element)
|
||||
return element->flags & MAP_ELEMENT_FLAG_LAST_TILE;
|
||||
}
|
||||
|
||||
uint8 map_element_get_scenery_quadrant(const rct_map_element *element)
|
||||
{
|
||||
return (element->type & MAP_ELEMENT_QUADRANT_MASK) >> 6;
|
||||
}
|
||||
|
||||
int map_element_get_type(const rct_map_element *element)
|
||||
{
|
||||
return element->type & MAP_ELEMENT_TYPE_MASK;
|
||||
|
||||
@@ -393,6 +393,7 @@ void map_update_tile_pointers();
|
||||
rct_map_element *map_get_first_element_at(int x, int y);
|
||||
void map_set_tile_elements(int x, int y, rct_map_element *elements);
|
||||
int map_element_is_last_for_tile(const rct_map_element *element);
|
||||
uint8 map_element_get_scenery_quadrant(const rct_map_element *element);
|
||||
int map_element_get_type(const rct_map_element *element);
|
||||
int map_element_get_direction(const rct_map_element *element);
|
||||
int map_element_get_terrain(const rct_map_element *element);
|
||||
|
||||
Reference in New Issue
Block a user