From 679db5e05506a5de4ad4acc82d13e5e694f4b895 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Tue, 17 May 2016 10:33:36 +0200 Subject: [PATCH] Use decompiled construction markers --- src/paint/map_element/banner.c | 2 +- src/paint/map_element/entrance.c | 4 ++-- src/paint/map_element/fence.c | 7 +------ src/paint/paint.h | 8 ++++++++ src/ride/track_paint.c | 2 +- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/paint/map_element/banner.c b/src/paint/map_element/banner.c index 7cded1eaed..d2d66c7eeb 100644 --- a/src/paint/map_element/banner.c +++ b/src/paint/map_element/banner.c @@ -53,7 +53,7 @@ void banner_paint(uint8 direction, int height, rct_map_element* map_element) if (map_element->flags & MAP_ELEMENT_FLAG_GHOST)//if being placed { RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8_t) = VIEWPORT_INTERACTION_ITEM_NONE; - image_id |= RCT2_ADDRESS(0x993CC4, uint32_t)[gConfigGeneral.construction_marker_colour]; + image_id |= construction_markers[gConfigGeneral.construction_marker_colour]; } else{ image_id |= diff --git a/src/paint/map_element/entrance.c b/src/paint/map_element/entrance.c index d3d39bc9c7..9316e7784b 100644 --- a/src/paint/map_element/entrance.c +++ b/src/paint/map_element/entrance.c @@ -60,7 +60,7 @@ void ride_entrance_exit_paint(uint8 direction, int height, rct_map_element* map_ if (map_element->flags & MAP_ELEMENT_FLAG_GHOST){ RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_NONE; - image_id = RCT2_ADDRESS(0x993CC4, uint32_t)[gConfigGeneral.construction_marker_colour]; + image_id = construction_markers[gConfigGeneral.construction_marker_colour]; RCT2_GLOBAL(0x009E32BC, uint32) = image_id; if (transparant_image_id) transparant_image_id = image_id; @@ -168,7 +168,7 @@ void park_entrance_paint(uint8 direction, int height, rct_map_element* map_eleme uint32 image_id, ghost_id = 0; if (map_element->flags & MAP_ELEMENT_FLAG_GHOST){ RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_NONE; - ghost_id = RCT2_ADDRESS(0x993CC4, uint32)[gConfigGeneral.construction_marker_colour]; + ghost_id = construction_markers[gConfigGeneral.construction_marker_colour]; RCT2_GLOBAL(0x009E32BC, uint32) = ghost_id; } diff --git a/src/paint/map_element/fence.c b/src/paint/map_element/fence.c index 4b2767a6da..1c0c16b5b2 100644 --- a/src/paint/map_element/fence.c +++ b/src/paint/map_element/fence.c @@ -27,11 +27,6 @@ #include "../../interface/viewport.h" #include "../paint.h" -uint32 dword_993CC4[] = { - COLOUR_DARK_GREEN << 19 | COLOUR_GREY << 24 | 0x20000000, - COLOUR_YELLOW << 19 | COLOUR_GREY << 24 | 0x40000000 -}; - const uint8 byte_9A406C[] = { 2, 2, 22, 26, 30, 34, 34, 34, 34, 34, 30, 26, 22, 2, 6, 2, 2, 2, 6, 10, 14, 18, 18, 18, 18, 18, 14, 10, 6, 2, 22, 2 @@ -178,7 +173,7 @@ void fence_paint(uint8 direction, int height, rct_map_element * map_element) if (map_element->flags & MAP_ELEMENT_FLAG_GHOST) { RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_NONE; - dword_141F710 = dword_993CC4[gConfigGeneral.construction_marker_colour]; + dword_141F710 = construction_markers[gConfigGeneral.construction_marker_colour]; } // save map_element diff --git a/src/paint/paint.h b/src/paint/paint.h index b527dee06c..067e467a04 100644 --- a/src/paint/paint.h +++ b/src/paint/paint.h @@ -19,6 +19,8 @@ #include "../common.h" #include "../world/map.h" +#include "../interface/colour.h" +#include "../drawing/drawing.h" typedef struct attached_paint_struct attached_paint_struct; @@ -85,6 +87,12 @@ enum PAINT_STRUCT_FLAGS { PAINT_STRUCT_FLAG_IS_MASKED = (1 << 0) }; +/** rct2: 0x00993CC4 */ +const uint32 construction_markers[] = { + COLOUR_DARK_GREEN << 19 | COLOUR_GREY << 24 | IMAGE_TYPE_USE_PALETTE << 28, // White + 2 << 19 | 0b110000 << 19 | IMAGE_TYPE_MIX_BACKGROUND << 28, // Translucent +}; + void painter_setup(); paint_struct * sub_98196C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, sint16 z_offset, uint32 rotation); diff --git a/src/ride/track_paint.c b/src/ride/track_paint.c index 09ef4ab715..80fe203076 100644 --- a/src/ride/track_paint.c +++ b/src/ride/track_paint.c @@ -238,7 +238,7 @@ void track_paint(uint8 direction, int height, rct_map_element *mapElement) RCT2_GLOBAL(0x00F441A4, uint32) = 0x21600000; } if (mapElement->flags & MAP_ELEMENT_FLAG_GHOST) { - uint32 ghost_id = RCT2_ADDRESS(0x00993CC4, uint32)[gConfigGeneral.construction_marker_colour]; + uint32 ghost_id = construction_markers[gConfigGeneral.construction_marker_colour]; RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = 0; RCT2_GLOBAL(0x00F44198, uint32) = ghost_id; RCT2_GLOBAL(0x00F4419C, uint32) = ghost_id;