mirror of https://github.com/OpenRCT2/OpenRCT2.git
Minor cleanups
Mostly just setting variables to better define game state, with one minor update of decompilation where an `or` instruction was used in place of `mov` (in `sub_6CBCE2`).
This commit is contained in:
parent
ed8e7c2d38
commit
075b98e209
|
@ -1493,7 +1493,7 @@ static void title_sequence_open(const char *path, const char *customName)
|
|||
token = &parts[0 * 128];
|
||||
part1 = &parts[1 * 128];
|
||||
part2 = &parts[2 * 128];
|
||||
title_command command;
|
||||
title_command command = { 0 };
|
||||
command.command = 0xFF;
|
||||
|
||||
if (token[0] != 0) {
|
||||
|
|
|
@ -389,6 +389,7 @@ uint16 hire_new_staff_member(uint8 staffType)
|
|||
RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TITLE, uint16) = STR_CANT_HIRE_NEW_STAFF;
|
||||
|
||||
int eax, ebx, ecx, edx, esi, edi, ebp;
|
||||
ecx = edx = esi = edi = ebp = 0;
|
||||
eax = 0x8000;
|
||||
ebx = staffType << 8 | GAME_COMMAND_FLAG_APPLY;
|
||||
|
||||
|
|
|
@ -850,6 +850,7 @@ int ride_create_ride(ride_list_item listItem)
|
|||
ebx = GAME_COMMAND_FLAG_APPLY;
|
||||
edi = 0;
|
||||
esi = 0;
|
||||
ebp = 0;
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TITLE, uint16) = 0x3DC;
|
||||
|
||||
|
@ -1194,7 +1195,7 @@ int sub_6C683D(int* x, int* y, int* z, int direction, int type, uint16 extra_par
|
|||
mapElement->properties.track.colour &= 0x0F;
|
||||
mapElement->properties.track.colour |= (extra_params & 0xFF) << 4;
|
||||
}
|
||||
|
||||
|
||||
if (flags & (1 << 3)) {
|
||||
track_element_set_cable_lift(mapElement);
|
||||
}
|
||||
|
@ -5562,7 +5563,7 @@ void game_command_callback_ride_remove_track_piece(int eax, int ebx, int ecx, in
|
|||
z = gRideRemoveTrackPieceCallbackZ;
|
||||
direction = gRideRemoveTrackPieceCallbackDirection;
|
||||
type = gRideRemoveTrackPieceCallbackType;
|
||||
|
||||
|
||||
window_ride_construction_mouseup_demolish_next_piece(x, y, z, direction, type);
|
||||
}
|
||||
|
||||
|
@ -6412,9 +6413,9 @@ static void ride_update_vehicle_colours(int rideIndex)
|
|||
{
|
||||
rct_ride *ride;
|
||||
rct_vehicle *vehicle;
|
||||
rct_vehicle_colour colours;
|
||||
rct_vehicle_colour colours = { 0 };
|
||||
uint16 spriteIndex;
|
||||
uint8 coloursExtended;
|
||||
uint8 coloursExtended = 0;
|
||||
|
||||
ride = GET_RIDE(rideIndex);
|
||||
if (ride->type == RIDE_TYPE_SPACE_RINGS || ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_16)) {
|
||||
|
|
|
@ -497,7 +497,7 @@ void scenario_success_submit_name(const char *name)
|
|||
**/
|
||||
void scenario_entrance_fee_too_high_check()
|
||||
{
|
||||
uint16 x, y;
|
||||
uint16 x = 0, y = 0;
|
||||
uint16 totalRideValue = RCT2_GLOBAL(RCT2_TOTAL_RIDE_VALUE, uint16);
|
||||
uint16 park_entrance_fee = RCT2_GLOBAL(RCT2_ADDRESS_PARK_ENTRANCE_FEE, uint16);
|
||||
int max_fee = totalRideValue + (totalRideValue / 2);
|
||||
|
|
|
@ -1597,7 +1597,7 @@ static uint16 map_window_get_pixel_colour_ride(int x, int y)
|
|||
|
||||
static void map_window_set_pixels(rct_window *w)
|
||||
{
|
||||
uint16 colour, *destination;
|
||||
uint16 colour = 0, *destination;
|
||||
int x, y, dx, dy;
|
||||
|
||||
destination = (uint16*)((RCT2_GLOBAL(0x00F1AD6C, uint32) * 511) + RCT2_GLOBAL(RCT2_ADDRESS_MAP_IMAGE_DATA, uint32) + 255);
|
||||
|
|
|
@ -1053,6 +1053,7 @@ static void window_park_entrance_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
static void window_park_init_viewport(rct_window *w)
|
||||
{
|
||||
int i, x, y, z, r, xy, zr, viewportFlags;
|
||||
x = y = z = r = xy = zr = 0;
|
||||
rct_viewport *viewport;
|
||||
rct_widget *viewportWidget;
|
||||
|
||||
|
|
|
@ -5341,6 +5341,9 @@ static void window_ride_graphs_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi
|
|||
top = measurement->lateral[x] + 52;
|
||||
bottom = measurement->lateral[x + 1] + 52;
|
||||
break;
|
||||
default:
|
||||
log_error("Wrong graph type %d", listType);
|
||||
top = bottom = 0;
|
||||
}
|
||||
|
||||
top = widget->bottom - widget->top - top - 13;
|
||||
|
|
|
@ -2273,7 +2273,7 @@ static void sub_6CBCE2(
|
|||
offsetX = -trackBlock->y;
|
||||
offsetY = trackBlock->x;
|
||||
bl = rol8(bl, 3);
|
||||
bh |= bl;
|
||||
bh = bl;
|
||||
bh = ror8(bh, 4);
|
||||
bl &= 0x88;
|
||||
bh &= 0x77;
|
||||
|
|
|
@ -943,7 +943,7 @@ void window_title_editor_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int
|
|||
gfx_fill_rect(dpi, x, y, x + SCROLL_WIDTH + 100, y + ROW_HEIGHT - 1, ColourMapA[w->colours[1]].lighter | 0x1000000);
|
||||
}
|
||||
|
||||
rct_string_id commandName;
|
||||
rct_string_id commandName = STR_NONE;
|
||||
switch (command->command) {
|
||||
case TITLE_SCRIPT_LOAD:
|
||||
commandName = 5415;
|
||||
|
@ -984,6 +984,8 @@ void window_title_editor_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int
|
|||
case TITLE_SCRIPT_END:
|
||||
commandName = 5426;
|
||||
break;
|
||||
default:
|
||||
log_warning("Unknown command %d", command->command);
|
||||
}
|
||||
|
||||
if ((selected || hover) && !error) {
|
||||
|
|
|
@ -352,6 +352,7 @@ static void window_track_place_attempt_placement(int x, int y, int z, int bl, mo
|
|||
int eax, ebx, ecx, edx, esi, edi, ebp;
|
||||
money32 result;
|
||||
|
||||
edx = esi = ebp = 0;
|
||||
eax = x;
|
||||
ebx = bl;
|
||||
ecx = y;
|
||||
|
|
Loading…
Reference in New Issue