mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-16 11:33:03 +01:00
Started game_command_20 raise lower land
This commit is contained in:
@@ -877,7 +877,7 @@ static uint32 game_do_command_table[58] = {
|
||||
0x006A61DE,
|
||||
0x006A68AE,
|
||||
0x006A67C0,
|
||||
0x00663CCD, // 20
|
||||
0, // use new_game_command_table, original: 0x00663CCD, // 20
|
||||
0x006B53E9,
|
||||
0x00698D6C, // text input
|
||||
0x0068C542,
|
||||
@@ -940,7 +940,7 @@ static GAME_COMMAND_POINTER* new_game_command_table[58] = {
|
||||
game_command_emptysub,
|
||||
game_command_emptysub,
|
||||
game_command_emptysub,
|
||||
game_command_emptysub, // 20
|
||||
game_command_raise_lower_land, // 20
|
||||
game_command_emptysub,
|
||||
game_command_emptysub,
|
||||
game_command_emptysub,
|
||||
|
||||
@@ -42,7 +42,7 @@ enum GAME_COMMAND {
|
||||
GAME_COMMAND_PLACE_PATH, // 17
|
||||
GAME_COMMAND_18,
|
||||
GAME_COMMAND_REMOVE_PATH, // 19
|
||||
GAME_COMMAND_20, //Raise/lower land
|
||||
GAME_COMMAND_RAISE_LOWER_LAND, //Raise/lower land
|
||||
GAME_COMMAND_21,
|
||||
GAME_COMMAND_22, //To do with text input
|
||||
GAME_COMMAND_23,
|
||||
|
||||
@@ -646,7 +646,7 @@ static void window_game_top_toolbar_tool_down(){
|
||||
1,
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_A_Y, uint16),
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_TERRAIN_SURFACE, uint8) | (RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_TERRAIN_EDGE, uint8) << 8),
|
||||
GAME_COMMAND_20,
|
||||
GAME_COMMAND_RAISE_LOWER_LAND,
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_B_X, uint16),
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_B_Y, uint16)
|
||||
);
|
||||
|
||||
@@ -707,6 +707,88 @@ void game_command_clear_scenery(int* eax, int* ebx, int* ecx, int* edx, int* esi
|
||||
);
|
||||
}
|
||||
|
||||
/* rct2: 0x00663CCD */
|
||||
money32 map_raise_lower_land(int x0, int y0, int x1, int y1, uint8 terrain_surface, uint8 flags)
|
||||
{
|
||||
RCT2_GLOBAL(0x141F56C, uint8) = 12;
|
||||
|
||||
int x_mid, y_mid;
|
||||
|
||||
x_mid = (x0 + x1) / 2 + 16;
|
||||
y_mid = (y0 + y1) / 2 + 16;
|
||||
|
||||
int height_mid = map_element_height(x_mid, y_mid);
|
||||
|
||||
RCT2_GLOBAL(0x9DEA5E, uint16) = x_mid;
|
||||
RCT2_GLOBAL(0x9DEA60, uint16) = y_mid;
|
||||
RCT2_GLOBAL(0x9DEA62, uint16) = height_mid;
|
||||
RCT2_GLOBAL(0x9E32B4, uint32) = 0;
|
||||
|
||||
if (RCT2_GLOBAL(0x9DEA6E, uint8) != 0){
|
||||
//663e62 return part
|
||||
}
|
||||
|
||||
if (!(RCT2_GLOBAL(0x9DEA68, uint8) & 2) && RCT2_GLOBAL(0x13573E4, uint32) & 4){
|
||||
//663e62 return part
|
||||
}
|
||||
|
||||
for (int x = x0; x < x1; x += 32){
|
||||
for (int y = y0; y < y1; y += 32){
|
||||
if (x > 0x1FFF)continue;
|
||||
if (y > 0x1FFF)continue;
|
||||
|
||||
if (!(RCT2_GLOBAL(0x9DEA68, uint8) & 2)){
|
||||
if (!map_is_location_in_park(x, y))continue;
|
||||
}
|
||||
|
||||
rct_map_element* map_element = TILE_MAP_ELEMENT_POINTER((x | (y << 8)) >> 5);
|
||||
|
||||
while ((map_element->type&MAP_ELEMENT_TYPE_MASK) != MAP_ELEMENT_TYPE_SURFACE){
|
||||
map_element++;
|
||||
}
|
||||
|
||||
if (terrain_surface != 0xFF){
|
||||
uint8 cur_terrain = (
|
||||
(map_element->type&MAP_ELEMENT_DIRECTION_MASK) << 3)
|
||||
| (map_element->properties.surface.terrain >> 5);
|
||||
|
||||
if (terrain_surface != cur_terrain){
|
||||
RCT2_GLOBAL(0x9E32B4, uint32) += RCT2_ADDRESS(0x97B8B8, uint32)[terrain_surface & 0x1F];
|
||||
|
||||
if (flags & 1){
|
||||
map_element->properties.surface.terrain &= MAP_ELEMENT_WATER_HEIGHT_MASK;
|
||||
map_element->type &= MAP_ELEMENT_QUADRANT_MASK | MAP_ELEMENT_TYPE_MASK;
|
||||
|
||||
//Save the new terrain
|
||||
map_element->properties.surface.terrain |= terrain_surface << 5;
|
||||
//Save the new direction mask
|
||||
map_element->type |= terrain_surface >> 3;
|
||||
|
||||
map_invalidate_tile_full(x, y);
|
||||
RCT2_CALLPROC_X(0x673883, x, 0, y, map_element_height(x, y), 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//0x663de2
|
||||
|
||||
}
|
||||
}
|
||||
//0x663e62
|
||||
}
|
||||
|
||||
/* rct2: 0x00663CCD */
|
||||
void game_command_raise_lower_land(int* eax, int* ebx, int* ecx, int* edx, int* esi, int* edi, int* ebp){
|
||||
*ebx = map_raise_lower_land(
|
||||
(*eax & 0xFFFF) / 32,
|
||||
(*ecx & 0xFFFF) / 32,
|
||||
(*edi & 0xFFFF) / 32,
|
||||
(*ebp & 0xFFFF) / 32,
|
||||
*edx & 0xFF,
|
||||
*ebx & 0xFF
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006EC6D7
|
||||
|
||||
@@ -245,6 +245,7 @@ void map_invalidate_selection_rect();
|
||||
void fountain_update_all();
|
||||
|
||||
void game_command_clear_scenery(int* eax, int* ebx, int* ecx, int* edx, int* esi, int* edi, int* ebp);
|
||||
void game_command_raise_lower_land(int* eax, int* ebx, int* ecx, int* edx, int* esi, int* edi, int* ebp);
|
||||
|
||||
#define GET_MAP_ELEMENT(x) (&(RCT2_ADDRESS(RCT2_ADDRESS_MAP_ELEMENTS, rct_map_element)[x]))
|
||||
#define TILE_MAP_ELEMENT_POINTER(x) (RCT2_ADDRESS(RCT2_ADDRESS_TILE_MAP_ELEMENT_POINTERS, rct_map_element*)[x])
|
||||
|
||||
Reference in New Issue
Block a user