mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #2440 from LinusU/world-map-fixes
small fixes to world/map.c
This commit is contained in:
commit
0604068aac
|
@ -4364,7 +4364,7 @@ bool map_large_scenery_get_origin(
|
||||||
*
|
*
|
||||||
* rct2: 0x006B9B05
|
* rct2: 0x006B9B05
|
||||||
*/
|
*/
|
||||||
void sign_set_colour(int x, int y, int z, int direction, int sequence, uint8 mainColour, uint8 textColour)
|
bool sign_set_colour(int x, int y, int z, int direction, int sequence, uint8 mainColour, uint8 textColour)
|
||||||
{
|
{
|
||||||
rct_map_element *mapElement;
|
rct_map_element *mapElement;
|
||||||
rct_scenery_entry *sceneryEntry;
|
rct_scenery_entry *sceneryEntry;
|
||||||
|
@ -4372,7 +4372,9 @@ void sign_set_colour(int x, int y, int z, int direction, int sequence, uint8 mai
|
||||||
sint16 offsetX, offsetY;
|
sint16 offsetX, offsetY;
|
||||||
int x0, y0, z0;
|
int x0, y0, z0;
|
||||||
|
|
||||||
if (!map_large_scenery_get_origin(x, y, z, direction, sequence, &x0, &y0, &z0, &mapElement));
|
if (!map_large_scenery_get_origin(x, y, z, direction, sequence, &x0, &y0, &z0, &mapElement)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
sceneryEntry = g_largeSceneryEntries[(mapElement->properties.scenerymultiple.type) & 0x3FF];
|
sceneryEntry = g_largeSceneryEntries[(mapElement->properties.scenerymultiple.type) & 0x3FF];
|
||||||
sceneryTiles = sceneryEntry->large_scenery.tiles;
|
sceneryTiles = sceneryEntry->large_scenery.tiles;
|
||||||
|
@ -4397,6 +4399,8 @@ void sign_set_colour(int x, int y, int z, int direction, int sequence, uint8 mai
|
||||||
map_invalidate_tile(x, y, mapElement->base_height * 8 , mapElement->clearance_height * 8);
|
map_invalidate_tile(x, y, mapElement->base_height * 8 , mapElement->clearance_height * 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4782,7 +4786,7 @@ void game_command_set_banner_name(int* eax, int* ebx, int* ecx, int* edx, int* e
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
utf8 *buffer = RCT2_ADDRESS(RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER, uint8);
|
utf8 *buffer = RCT2_ADDRESS(RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER, utf8);
|
||||||
utf8 *dst = buffer;
|
utf8 *dst = buffer;
|
||||||
dst = utf8_write_codepoint(dst, FORMAT_COLOUR_CODE_START + banner->text_colour);
|
dst = utf8_write_codepoint(dst, FORMAT_COLOUR_CODE_START + banner->text_colour);
|
||||||
strncpy(dst, newName, 32);
|
strncpy(dst, newName, 32);
|
||||||
|
@ -4899,7 +4903,7 @@ void game_command_set_banner_style(int* eax, int* ebx, int* ecx, int* edx, int*
|
||||||
|
|
||||||
int colourCodepoint = FORMAT_COLOUR_CODE_START + banner->text_colour;
|
int colourCodepoint = FORMAT_COLOUR_CODE_START + banner->text_colour;
|
||||||
|
|
||||||
uint8 buffer[256];
|
utf8 buffer[256];
|
||||||
format_string(buffer, banner->string_idx, 0);
|
format_string(buffer, banner->string_idx, 0);
|
||||||
int firstCodepoint = utf8_get_next(buffer, NULL);
|
int firstCodepoint = utf8_get_next(buffer, NULL);
|
||||||
if (firstCodepoint >= FORMAT_COLOUR_CODE_START && firstCodepoint <= FORMAT_COLOUR_CODE_END) {
|
if (firstCodepoint >= FORMAT_COLOUR_CODE_START && firstCodepoint <= FORMAT_COLOUR_CODE_END) {
|
||||||
|
@ -4971,7 +4975,7 @@ void game_command_set_sign_style(int* eax, int* ebx, int* ecx, int* edx, int* es
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sign_set_colour(
|
if (!sign_set_colour(
|
||||||
banner->x * 32,
|
banner->x * 32,
|
||||||
banner->y * 32,
|
banner->y * 32,
|
||||||
mapElement->base_height,
|
mapElement->base_height,
|
||||||
|
@ -4979,7 +4983,10 @@ void game_command_set_sign_style(int* eax, int* ebx, int* ecx, int* edx, int* es
|
||||||
mapElement->properties.scenerymultiple.type >> 10,
|
mapElement->properties.scenerymultiple.type >> 10,
|
||||||
mainColour,
|
mainColour,
|
||||||
textColour
|
textColour
|
||||||
);
|
)) {
|
||||||
|
*ebx = MONEY32_UNDEFINED;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rct_window* w = window_bring_to_front_by_number(WC_BANNER, *ecx);
|
rct_window* w = window_bring_to_front_by_number(WC_BANNER, *ecx);
|
||||||
|
@ -5028,4 +5035,3 @@ rct_map_element *map_get_track_element_at_of_type(int x, int y, int z, int track
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -369,7 +369,7 @@ bool map_element_is_underground(rct_map_element *mapElement);
|
||||||
void map_remove_out_of_range_elements();
|
void map_remove_out_of_range_elements();
|
||||||
void map_extend_boundary_surface();
|
void map_extend_boundary_surface();
|
||||||
|
|
||||||
void sign_set_colour(int x, int y, int z, int direction, int sequence, uint8 mainColour, uint8 textColour);
|
bool sign_set_colour(int x, int y, int z, int direction, int sequence, uint8 mainColour, uint8 textColour);
|
||||||
void map_remove_walls_at(int x, int y, int z0, int z1);
|
void map_remove_walls_at(int x, int y, int z0, int z1);
|
||||||
void map_remove_walls_at_z(int x, int y, int z);
|
void map_remove_walls_at_z(int x, int y, int z);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue