integrate ScenerySubTileOffsets

This commit is contained in:
zsilencer 2016-05-24 20:57:53 -06:00
parent f04fa3ca4f
commit 1c5a73db54
4 changed files with 14 additions and 4 deletions

View File

@ -83,8 +83,8 @@ void scenery_paint(uint8 direction, int height, rct_map_element* mapElement) {
} else {
// 6DFFC2:
uint32 ecx = ((mapElement->type >> 6) + get_current_rotation()) & 3;
x_offset = RCT2_ADDRESS(0x009A3E74, sint8)[ecx * 2];
y_offset = RCT2_ADDRESS(0x009A3E75, sint8)[ecx * 2];
x_offset = ScenerySubTileOffsets[ecx].x;
y_offset = ScenerySubTileOffsets[ecx].y;
}
// 6E0074:
boxoffset.x = x_offset;

View File

@ -2959,8 +2959,8 @@ void game_command_place_scenery(int* eax, int* ebx, int* ecx, int* edx, int* esi
x2 += 16;
y2 += 16;
}else{
x2 += RCT2_ADDRESS(0x009A3E74, uint8)[(quadrant & 3) * 2] - 1;
y2 += RCT2_ADDRESS(0x009A3E75, uint8)[(quadrant & 3) * 2] - 1;
x2 += ScenerySubTileOffsets[quadrant & 3].x - 1;
y2 += ScenerySubTileOffsets[quadrant & 3].y - 1;
}
int base_height2 = map_element_height(x2, y2);
if(base_height2 & 0xFFFF0000){

View File

@ -60,6 +60,14 @@ sint16 gSceneryCtrlPressZ;
uint8 gSceneryGroundFlags;
// rct2: 0x009A3E74
const rct_xy8 ScenerySubTileOffsets[] = {
{ 7, 7 },
{ 7, 23 },
{ 23, 23 },
{ 23, 7 }
};
void scenery_increase_age(int x, int y, rct_map_element *mapElement);
void scenery_update_tile(int x, int y)

View File

@ -223,6 +223,8 @@ extern sint16 gSceneryCtrlPressZ;
extern uint8 gSceneryGroundFlags;
extern const rct_xy8 ScenerySubTileOffsets[];
extern sint16 window_scenery_tab_entries[20][SCENERY_ENTRIES_BY_TAB + 1];
void init_scenery();