Merge pull request #3465 from marijnvdwerf/paint-setup/path

Path paint
This commit is contained in:
Duncan authored and GitHub committed 2016-06-15 07:10:55 +01:00
commit f339bd6e7a
10 files changed
+1021 -27

No files matched your search

+1 -1
View File
@@ -127,7 +127,7 @@ static void cheat_remove_litter()
continue;
sceneryEntry = get_footpath_item_entry(footpath_element_get_path_scenery_index(it.element));
if(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_BIN)
if (sceneryEntry->path_bit.flags & PATH_BIT_FLAG_IS_BIN)
it.element->properties.path.addition_status = 0xFF;
} while (map_element_iterator_next(&it));
+1
View File
@@ -57,6 +57,7 @@ enum
TUNNEL_7 = 7,
TUNNEL_8 = 8,
TUNNEL_10 = 0x0A,
TUNNEL_11 = 0x0B,
TUNNEL_12 = 0x0C,
TUNNEL_14 = 0x0E
};
File diff suppressed because it is too large. Load diff
+4 -4
View File
@@ -517,11 +517,11 @@ bool metal_b_supports_paint_setup(int supportType, uint8 segment, int special, i
}
/**
* Some kind of supports
* rct2: 0x006A2ECC
*/
bool sub_6A2ECC(int supportType, int special, int height, uint32 imageColourFlags)
bool path_a_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags, rct_footpath_entry * pathEntry, bool * underground)
{
RCT2_GLOBAL(0xF3EF6C, rct_footpath_entry *) = pathEntry;
int eax = special, ebx = 0, ecx = 0, edx = height, esi = 0, _edi = supportType, ebp = imageColourFlags;
RCT2_CALLFUNC_X(0x006A2ECC, &eax, &ebx, &ecx, &edx, &esi, &_edi, &ebp);
return eax & 0xFF;
@@ -531,9 +531,9 @@ bool sub_6A2ECC(int supportType, int special, int height, uint32 imageColourFlag
*
* rct2: 0x006A326B
*/
bool path_wooden_a_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags)
bool path_b_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags)
{
int eax = special, ebx = 0, ecx = 0, edx = height, esi = 0, _edi = supportType, ebp = imageColourFlags;
int eax = special, ebx = supportType, ecx = 0, edx = height, esi = 0, _edi = 0, ebp = imageColourFlags;
RCT2_CALLFUNC_X(0x006A326B, &eax, &ebx, &ecx, &edx, &esi, &_edi, &ebp);
return eax & 0xFF;
}
+3
View File
@@ -18,10 +18,13 @@
#define _DRAWING_SUPPORTS_H_
#include "../common.h"
#include "../world/footpath.h"
bool wooden_a_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags, bool* underground);
bool wooden_b_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags);
bool metal_a_supports_paint_setup(int supportType, int segment, int special, int height, uint32 imageColourFlags);
bool metal_b_supports_paint_setup(int supportType, uint8 segment, int special, int height, uint32 imageColourFlags);
bool path_a_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags, rct_footpath_entry * pathEntry, bool * underground);
bool path_b_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags);
#endif
+7 -7
View File
@@ -626,7 +626,7 @@ static void sub_68F41A(rct_peep *peep, int index)
if (footpath_element_has_path_scenery(mapElement) && footpath_element_path_scenery_is_ghost(mapElement)){
uint8 pathSceneryIndex = footpath_element_get_path_scenery_index(mapElement);
rct_scenery_entry *sceneryEntry = get_footpath_item_entry(pathSceneryIndex);
if (sceneryEntry->path_bit.flags & PATH_BIT_FLAG_QUEUE_MONITOR) {
if (sceneryEntry->path_bit.flags & PATH_BIT_FLAG_IS_QUEUE_SCREEN){
found = 1;
}
}
@@ -4272,7 +4272,7 @@ static void peep_update_emptying_bin(rct_peep* peep){
rct_scenery_entry* scenery_entry = get_footpath_item_entry(footpath_element_get_path_scenery_index(map_element));
if (
!(scenery_entry->path_bit.flags & PATH_BIT_FLAG_BIN)
!(scenery_entry->path_bit.flags & PATH_BIT_FLAG_IS_BIN)
|| map_element->flags & (1 << 5)
|| footpath_element_path_scenery_is_ghost(map_element)
) {
@@ -4532,7 +4532,7 @@ static int peep_update_walking_find_bench(rct_peep* peep){
if (!footpath_element_has_path_scenery(map_element)) return 0;
rct_scenery_entry* sceneryEntry = get_footpath_item_entry(footpath_element_get_path_scenery_index(map_element));
if (!(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_BENCH))return 0;
if (!(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_IS_BENCH))return 0;
if (map_element->flags & MAP_ELEMENT_FLAG_BROKEN)return 0;
@@ -4607,7 +4607,7 @@ static int peep_update_walking_find_bin(rct_peep* peep){
if (!footpath_element_has_path_scenery(map_element)) return 0;
rct_scenery_entry* sceneryEntry = get_footpath_item_entry(footpath_element_get_path_scenery_index(map_element));
if (!(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_BIN))return 0;
if (!(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_IS_BIN))return 0;
if (map_element->flags & MAP_ELEMENT_FLAG_BROKEN)return 0;
@@ -4859,7 +4859,7 @@ static void peep_update_using_bin(rct_peep* peep){
}
rct_scenery_entry* sceneryEntry = get_footpath_item_entry(footpath_element_get_path_scenery_index(map_element));
if (!(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_BIN)){
if (!(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_IS_BIN)){
peep_state_reset(peep);
return;
}
@@ -5256,7 +5256,7 @@ static int peep_update_patrolling_find_bin(rct_peep* peep){
if (!footpath_element_has_path_scenery(map_element)) return 0;
rct_scenery_entry* sceneryEntry = get_footpath_item_entry(footpath_element_get_path_scenery_index(map_element));
if (!(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_BIN))
if (!(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_IS_BIN))
return 0;
if (map_element->flags & MAP_ELEMENT_FLAG_BROKEN)
@@ -5560,7 +5560,7 @@ static void peep_update_walking(rct_peep* peep){
if (!footpath_element_path_scenery_is_ghost(map_element)) {
rct_scenery_entry* sceneryEntry = get_footpath_item_entry(footpath_element_get_path_scenery_index(map_element));
if (!(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_BENCH)) ebp = 9;
if (!(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_IS_BENCH)) ebp = 9;
}
}
+3 -4
View File
@@ -238,13 +238,12 @@ static money32 footpath_element_update(int x, int y, rct_map_element *mapElement
return MONEY32_UNDEFINED;
}
uint16 jfMask = PATH_BIT_FLAG_JUMPING_FOUNTAIN_WATER | PATH_BIT_FLAG_JUMPING_FOUNTAIN_SNOW;
if (!(unk6 & jfMask) && (mapElement->properties.path.edges & 0x0F) == 0x0F) {
if (!(unk6 & (PATH_BIT_FLAG_JUMPING_FOUNTAIN_WATER | PATH_BIT_FLAG_JUMPING_FOUNTAIN_SNOW)) && (mapElement->properties.path.edges & 0x0F) == 0x0F) {
gGameCommandErrorText = STR_NONE;
return MONEY32_UNDEFINED;
}
if ((unk6 & PATH_BIT_FLAG_QUEUE_MONITOR) && !footpath_element_is_queue(mapElement)) {
if ((unk6 & PATH_BIT_FLAG_IS_QUEUE_SCREEN) && !footpath_element_is_queue(mapElement)) {
gGameCommandErrorText = STR_CAN_ONLY_PLACE_THESE_ON_QUEUE_AREA;
return MONEY32_UNDEFINED;
}
@@ -282,7 +281,7 @@ static money32 footpath_element_update(int x, int y, rct_map_element *mapElement
mapElement->flags &= ~MAP_ELEMENT_FLAG_BROKEN;
if (pathItemType != 0) {
rct_scenery_entry* scenery_entry = get_footpath_item_entry(pathItemType - 1);
if (scenery_entry->path_bit.flags & PATH_BIT_FLAG_BIN) {
if (scenery_entry->path_bit.flags & PATH_BIT_FLAG_IS_BIN) {
mapElement->properties.path.addition_status = 255;
}
}
+2 -1
View File
@@ -34,8 +34,9 @@ typedef struct rct_footpath_entry {
uint32 bridge_image; // 0x06
uint8 var_0A;
uint8 flags; // 0x0B
uint8 scrolling_mode; // 0x0C
} rct_footpath_entry;
assert_struct_size(rct_footpath_entry, 12);
assert_struct_size(rct_footpath_entry, 13);
#pragma pack(pop)
enum {
+1 -1
View File
@@ -29,7 +29,7 @@ typedef struct rct_map_element_surface_properties {
assert_struct_size(rct_map_element_surface_properties, 4);
typedef struct rct_map_element_path_properties {
uint8 type; //4 0xF0 Path type, 0x08 Unknown/Unused, 0x04 Set when path is diagonal, 0x03 Rotation
uint8 type; //4 0xF0 Path type, 0x08 Ride sign, 0x04 Set when path is diagonal, 0x03 Rotation
uint8 additions; //5
uint8 edges; //6
union {
+11 -4
View File
@@ -136,7 +136,7 @@ typedef enum {
typedef struct rct_path_bit_scenery_entry {
uint16 flags; // 0x06
uint8 pad_08;
uint8 draw_type; // 0x08
uint8 tool_id; // 0x09
sint16 price; // 0x0A
uint8 scenery_tab_id; // 0x0C
@@ -180,15 +180,22 @@ assert_struct_size(rct_scenery_set_entry, 14 + 2 * 0x80);
#pragma pack(pop)
enum {
PATH_BIT_FLAG_BIN = 1 << 0,
PATH_BIT_FLAG_BENCH = 1 << 1,
PATH_BIT_FLAG_IS_BIN = 1 << 0,
PATH_BIT_FLAG_IS_BENCH = 1 << 1,
PATH_BIT_FLAG_BREAKABLE = 1 << 2,
PATH_BIT_FLAG_LAMP = 1 << 3,
PATH_BIT_FLAG_JUMPING_FOUNTAIN_WATER = 1 << 4,
PATH_BIT_FLAG_JUMPING_FOUNTAIN_SNOW = 1 << 5,
PATH_BIT_FLAG_DONT_ALLOW_ON_QUEUE = 1 << 6,
PATH_BIT_FLAG_DONT_ALLOW_ON_SLOPE = 1 << 7,
PATH_BIT_FLAG_QUEUE_MONITOR = 1 << 8,
PATH_BIT_FLAG_IS_QUEUE_SCREEN = 1 << 8
};
enum {
PATH_BIT_DRAW_TYPE_LIGHTS,
PATH_BIT_DRAW_TYPE_BINS,
PATH_BIT_DRAW_TYPE_BENCHES,
PATH_BIT_DRAW_TYPE_JUMPING_FOUNTAINS
};
enum {