Merge pull request #4269 from marijnvdwerf/clean/data-11

Integrate various data
This commit is contained in:
Ted John 2016-08-12 23:38:09 +01:00 committed by GitHub
commit 572999e8e3
9 changed files with 103 additions and 18 deletions

View File

@ -25,7 +25,11 @@
#include "../world/sprite.h"
#include "finance.h"
// Monthly staff wages
/**
* Monthly staff wages
*
* rct2: 0x00992A00
*/
const money32 wage_table[4] = {
MONEY(50,00), // Handyman
MONEY(80,00), // Mechanic

View File

@ -53,6 +53,7 @@ enum {
#define gWeeklyProfitAverageDivisor RCT2_GLOBAL(RCT2_ADDRESS_WEEKLY_PROFIT_AVERAGE_DIVISOR, uint16)
extern const money32 research_cost_table[4];
extern const money32 wage_table[4];
extern money32 *gCashHistory;
extern money32 *gWeeklyProfitHistory;

View File

@ -704,6 +704,8 @@ static uint8 staff_handyman_direction_to_nearest_litter(rct_peep* peep){
return nextDirection;
}
extern const uint8 byte_98D800[4];
/**
*
* rct2: 0x006BF931
@ -717,7 +719,7 @@ static uint8 staff_handyman_direction_to_uncut_grass(rct_peep* peep, uint8 valid
return 0xFF;
if (peep->next_var_29 & 0x4) {
if ((mapElement->properties.surface.slope & MAP_ELEMENT_SLOPE_MASK) != RCT2_ADDRESS(0x0098D800, uint8)[peep->next_var_29 & 0x3])
if ((mapElement->properties.surface.slope & MAP_ELEMENT_SLOPE_MASK) != byte_98D800[peep->next_var_29 & 0x3])
return 0xFF;
}
else if ((mapElement->properties.surface.slope & MAP_ELEMENT_SLOPE_MASK) != 0)

View File

@ -249,6 +249,8 @@ static void research_rides_setup(){
}
}
extern rct_object_entry RequiredSelectedObjects[7];
/**
*
* rct2: 0x0068590C
@ -256,9 +258,8 @@ static void research_rides_setup(){
*/
static void research_scenery_sets_setup(){
for (rct_object_entry* object = RCT2_ADDRESS(0x0098DA74, rct_object_entry);
(object->flags & 0xFF) != 0xFF;
object++){
for (int i = 0; i < countof(RequiredSelectedObjects); i++) {
rct_object_entry * object = &RequiredSelectedObjects[i];
uint8 entry_type, entry_index;
if (!find_object_in_entry_group(object, &entry_type, &entry_index))

View File

@ -249,7 +249,8 @@ static void filter_update_counts();
void reset_selected_object_count_and_size();
static int sub_6AB211();
static rct_object_entry RequiredSelectedObjects[] = {
/** rct2: 0x0098DA74 */
rct_object_entry RequiredSelectedObjects[] = {
// Objects that are always required
{ 0x00000087, { "SCGTREES" }, 0 }, // Scenery: Trees
{ 0x00000087, { "SCGSHRUB" }, 0 }, // Scenery: Shrubs and Ornaments

View File

@ -146,6 +146,56 @@ static sint8 _window_footpath_provisional_path_arrow_timer;
static uint8 _lastUpdatedCameraRotation = UINT8_MAX;
static bool _footpathErrorOccured;
enum
{
FOOTHPATH_IS_SLOPED = (1 << 2),
IRREGULAR_SLOPE = (1 << 3),
};
/** rct2: 0x0098D8B4 */
const uint8 default_path_slope[] = {
0,
IRREGULAR_SLOPE,
IRREGULAR_SLOPE,
FOOTHPATH_IS_SLOPED | 2,
IRREGULAR_SLOPE,
IRREGULAR_SLOPE,
FOOTHPATH_IS_SLOPED | 3,
IRREGULAR_SLOPE,
IRREGULAR_SLOPE,
FOOTHPATH_IS_SLOPED | 1,
IRREGULAR_SLOPE,
IRREGULAR_SLOPE,
FOOTHPATH_IS_SLOPED | 0,
IRREGULAR_SLOPE,
IRREGULAR_SLOPE,
IRREGULAR_SLOPE,
IRREGULAR_SLOPE,
IRREGULAR_SLOPE,
IRREGULAR_SLOPE,
IRREGULAR_SLOPE,
IRREGULAR_SLOPE,
IRREGULAR_SLOPE,
IRREGULAR_SLOPE,
IRREGULAR_SLOPE,
IRREGULAR_SLOPE,
IRREGULAR_SLOPE,
IRREGULAR_SLOPE,
IRREGULAR_SLOPE,
IRREGULAR_SLOPE,
IRREGULAR_SLOPE,
IRREGULAR_SLOPE,
IRREGULAR_SLOPE,
};
/** rct2: 0x0098D7E0 */
unsigned char footpath_construction_preview_images[][4] = {
{5, 10, 5, 10}, // Flat
{16, 17, 18, 19}, // Upwards
{18, 19, 16, 17}, // Downwards
};
static void window_footpath_mousedown_direction(int direction);
static void window_footpath_mousedown_slope(int slope);
static void window_footpath_show_footpath_types_dialog(rct_window *w, rct_widget *widget, int showQueues);
@ -548,12 +598,13 @@ static void window_footpath_paint(rct_window *w, rct_drawpixelinfo *dpi)
if (!(w->disabled_widgets & (1 << WIDX_CONSTRUCT))) {
// Get construction image
image = (gFootpathConstructDirection + get_current_rotation()) % 4;
uint8 direction = (gFootpathConstructDirection + get_current_rotation()) % 4;
uint8 slope = 0;
if (gFootpathConstructSlope == 2)
image += 4;
slope = 1;
else if (gFootpathConstructSlope == 6)
image += 8;
image = RCT2_ADDRESS(0x0098D7E0, uint8)[image];
slope = 2;
image = footpath_construction_preview_images[slope][direction];
selectedPath = gFootpathSelectedId;
pathType = get_footpath_entry(selectedPath);
@ -688,7 +739,7 @@ static void window_footpath_set_provisional_path_at_point(int x, int y)
footpath_provisional_update();
// Set provisional path
slope = RCT2_ADDRESS(0x0098D8B4, uint8)[mapElement->properties.surface.slope & 0x1F];
slope = default_path_slope[mapElement->properties.surface.slope & 0x1F];
if (interactionType == VIEWPORT_INTERACTION_ITEM_FOOTPATH)
slope = mapElement->properties.surface.slope & 7;
pathType = (gFootpathSelectedType << 7) + (gFootpathSelectedId & 0xFF);
@ -765,7 +816,7 @@ static void window_footpath_place_path_at_point(int x, int y)
return;
// Set path
presentType = RCT2_ADDRESS(0x0098D8B4, uint8)[mapElement->properties.path.type & 0x1F];
presentType = default_path_slope[mapElement->properties.path.type & 0x1F];
if (interactionType == VIEWPORT_INTERACTION_ITEM_FOOTPATH)
presentType = mapElement->properties.path.type & 7;
z = mapElement->base_height;

View File

@ -1059,7 +1059,7 @@ void window_staff_stats_paint(rct_window *w, rct_drawpixelinfo *dpi)
int y = w->y + window_staff_stats_widgets[WIDX_RESIZE].top + 4;
if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) {
set_format_arg(0, uint32, RCT2_ADDRESS(0x00992A00, uint16)[peep->staff_type]);
set_format_arg(0, money32, wage_table[peep->staff_type]);
gfx_draw_string_left(dpi, STR_STAFF_STAT_WAGES, gCommonFormatArgs, 0, x, y);
y += 10;
}

View File

@ -596,7 +596,7 @@ void window_staff_list_paint(rct_window *w, rct_drawpixelinfo *dpi)
}
if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) {
set_format_arg(0, uint32, RCT2_ADDRESS(0x00992A00, uint16)[selectedTab]);
set_format_arg(0, money32, wage_table[selectedTab]);
gfx_draw_string_left(dpi, STR_COST_PER_MONTH, gCommonFormatArgs, 0, w->x + w->width - 155, w->y + 0x20);
}

View File

@ -62,6 +62,26 @@ static const uint16 EntranceDirections[] = {
(4 | 1), 0, 0, 0, 0, 0, 0, 0, // ENTRANCE_TYPE_PARK_ENTRANCE
};
/** rct2: 0x0098D7F0 */
static const uint8 connected_path_count[] = {
0, // 0b0000
1, // 0b0001
1, // 0b0010
2, // 0b0011
1, // 0b0100
2, // 0b0101
2, // 0b0110
3, // 0b0111
1, // 0b1000
2, // 0b1001
2, // 0b1010
3, // 0b1011
2, // 0b1100
3, // 0b1101
3, // 0b1110
4, // 0b1111
};
static int entrance_get_directions(rct_map_element *mapElement)
{
uint8 entranceType = mapElement->properties.entrance.type;
@ -150,6 +170,11 @@ static void loc_6A6620(int flags, int x, int y, rct_map_element *mapElement)
map_invalidate_tile_full(x, y);
}
/** rct2: 0x0098D7EC */
static const uint8 byte_98D7EC[] = {
207, 159, 63, 111
};
static money32 footpath_element_insert(int type, int x, int y, int z, int slope, int flags, uint8 pathItemType)
{
rct_map_element *mapElement;
@ -167,7 +192,7 @@ static money32 footpath_element_insert(int type, int x, int y, int z, int slope,
bl = 15;
zHigh = z + 4;
if (slope & 4) {
bl = RCT2_ADDRESS(0x0098D7EC, uint8)[slope & 3];
bl = byte_98D7EC[slope & 3];
zHigh += 2;
}
@ -496,7 +521,7 @@ static money32 footpath_place_from_track(int type, int x, int y, int z, int slop
uint8 bl = 15;
int zHigh = z + 4;
if (slope & 4) {
bl = RCT2_ADDRESS(0x0098D7EC, uint8)[slope & 3];
bl = byte_98D7EC[slope & 3];
zHigh += 2;
}
@ -1070,7 +1095,7 @@ static bool footpath_disconnect_queue_from_path(int x, int y, rct_map_element *m
if (footpath_element_is_sloped(mapElement)) return false;
uint8 c = RCT2_ADDRESS(0x0098D7F0, uint8)[mapElement->properties.path.edges & 0x0F];
uint8 c = connected_path_count[mapElement->properties.path.edges & 0x0F];
if ((action < 0) ? (c >= 2) : (c < 2)) return false;
if (action < 0) {
@ -1180,7 +1205,7 @@ static void loc_6A6D7E(
return;
}
if (footpath_element_is_queue(mapElement)) {
if (RCT2_ADDRESS(0x0098D7F0, uint8)[mapElement->properties.path.edges & 0x0F] < 2) {
if (connected_path_count[mapElement->properties.path.edges & 0x0F] < 2) {
neighbour_list_push(neighbourList, 4, direction, mapElement->properties.path.ride_index, mapElement->properties.entrance.index);
} else {
if (map_element_get_type(initialMapElement) == MAP_ELEMENT_TYPE_PATH &&