1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-18 12:33:17 +01:00

Merge pull request #4620 from marijnvdwerf/clean/testpaint-1

Start cleanup of testpaint
This commit is contained in:
Ted John
2016-10-21 08:50:07 +01:00
committed by GitHub
35 changed files with 2841 additions and 2007 deletions

View File

@@ -38,9 +38,9 @@ uint16 gUnk141E9DC;
rct_xy16 gPaintMapPosition;
bool gDidPassSurface;
rct_map_element * gSurfaceElement;
tunnel_entry gLeftTunnels[65];
tunnel_entry gLeftTunnels[TUNNEL_MAX_COUNT];
uint8 gLeftTunnelCount;
tunnel_entry gRightTunnels[65];
tunnel_entry gRightTunnels[TUNNEL_MAX_COUNT];
uint8 gRightTunnelCount;
uint8 gVerticalTunnelHeight;
#endif

View File

@@ -80,15 +80,17 @@ enum
G141E9DB_FLAG_2 = 2,
};
#define TUNNEL_MAX_COUNT 65
#ifdef NO_RCT2
extern uint8 g141E9DB;
extern uint16 gUnk141E9DC;
extern rct_xy16 gPaintMapPosition;
extern bool gDidPassSurface;
extern rct_map_element * gSurfaceElement;
extern tunnel_entry gLeftTunnels[65];
extern tunnel_entry gLeftTunnels[TUNNEL_MAX_COUNT];
extern uint8 gLeftTunnelCount;
extern tunnel_entry gRightTunnels[65];
extern tunnel_entry gRightTunnels[TUNNEL_MAX_COUNT];
extern uint8 gRightTunnelCount;
extern uint8 gVerticalTunnelHeight;
#else

View File

@@ -634,7 +634,7 @@ static void viewport_surface_draw_land_side_bottom(enum edge edge, uint8 height,
// Normal walls
while (curHeight > tunnelArray[0].height) {
// TODO: Should probably be done by just keeping track of the current index
memmove(&tunnelArray[0], &tunnelArray[1], sizeof(tunnel_entry) * 64);
memmove(&tunnelArray[0], &tunnelArray[1], sizeof(tunnel_entry) * (TUNNEL_MAX_COUNT - 1));
}
if (curHeight != tunnelArray[0].height) {
@@ -682,7 +682,7 @@ static void viewport_surface_draw_land_side_bottom(enum edge edge, uint8 height,
curHeight += stru_97B570[tunnelType][0];
// TODO: Should probably be done by just keeping track of the current index
memmove(&tunnelArray[0], &tunnelArray[1], sizeof(tunnel_entry) * 64);
memmove(&tunnelArray[0], &tunnelArray[1], sizeof(tunnel_entry) * (TUNNEL_MAX_COUNT - 1));
}
}
@@ -906,7 +906,7 @@ static void viewport_surface_draw_water_side_bottom(enum edge edge, uint8 height
// Normal walls
while (curHeight > tunnelArray[0].height) {
// TODO: Should probably be done by just keeping track of the current index
memmove(&tunnelArray[0], &tunnelArray[1], sizeof(tunnel_entry) * 64);
memmove(&tunnelArray[0], &tunnelArray[1], sizeof(tunnel_entry) * (TUNNEL_MAX_COUNT - 1));
}
sub_98196C(base_image_id, offset.x, offset.y, bounds.x, bounds.y, 15, curHeight * 16, rotation);
@@ -952,7 +952,7 @@ static void viewport_surface_draw_water_side_bottom(enum edge edge, uint8 height
curHeight += stru_97B570[tunnelType][0];
// TODO: Should probably be done by just keeping track of the current index
memmove(&tunnelArray[0], &tunnelArray[1], sizeof(tunnel_entry) * 64);
memmove(&tunnelArray[0], &tunnelArray[1], sizeof(tunnel_entry) * (TUNNEL_MAX_COUNT - 1));
}
}
@@ -1316,18 +1316,18 @@ void surface_paint(uint8 direction, uint16 height, rct_map_element * mapElement)
log_verbose("eax: %d", eax);
}
tunnel_entry backupLeftTunnels[65];
tunnel_entry backupRightTunnels[65];
tunnel_entry backupLeftTunnels[TUNNEL_MAX_COUNT];
tunnel_entry backupRightTunnels[TUNNEL_MAX_COUNT];
#ifdef __MINGW32__
// The other code crashes mingw 4.8.2, as available on Travis
for (int i = 0; i < 65; i++) {
for (int i = 0; i < TUNNEL_MAX_COUNT; i++) {
backupLeftTunnels[i] = gLeftTunnels[i];
backupRightTunnels[i] = gRightTunnels[i];
}
#else
memcpy(backupLeftTunnels, gLeftTunnels, sizeof(tunnel_entry) * 65);
memcpy(backupRightTunnels, gRightTunnels, sizeof(tunnel_entry) * 65);
memcpy(backupLeftTunnels, gLeftTunnels, sizeof(tunnel_entry) * TUNNEL_MAX_COUNT);
memcpy(backupRightTunnels, gRightTunnels, sizeof(tunnel_entry) * TUNNEL_MAX_COUNT);
#endif
viewport_surface_draw_land_side_top(EDGE_TOPLEFT, height / 16, eax / 32, tileDescriptors[0], tileDescriptors[3]);
@@ -1338,13 +1338,13 @@ void surface_paint(uint8 direction, uint16 height, rct_map_element * mapElement)
#ifdef __MINGW32__
// The other code crashes mingw 4.8.2, as available on Travis
for (int i = 0; i < 65; i++) {
for (int i = 0; i < TUNNEL_MAX_COUNT; i++) {
gLeftTunnels[i] = backupLeftTunnels[i];
gRightTunnels[i] = backupRightTunnels[i];
}
#else
memcpy(gLeftTunnels, backupLeftTunnels, sizeof(tunnel_entry) * 65);
memcpy(gRightTunnels, backupRightTunnels, sizeof(tunnel_entry) * 65);
memcpy(gLeftTunnels, backupLeftTunnels, sizeof(tunnel_entry) * TUNNEL_MAX_COUNT);
memcpy(gRightTunnels, backupRightTunnels, sizeof(tunnel_entry) * TUNNEL_MAX_COUNT);
#endif
}

View File

@@ -687,7 +687,7 @@ bool wooden_b_supports_paint_setup(int supportType, int special, int height, uin
* @param imageColourFlags (ebp)
* rct2: 0x00663105
*/
bool metal_a_supports_paint_setup(int supportType, int segment, int special, int height, uint32 imageColourFlags)
bool metal_a_supports_paint_setup(uint8 supportType, uint8 segment, int special, int height, uint32 imageColourFlags)
{
if (gCurrentViewportFlags & VIEWPORT_FLAG_INVISIBLE_SUPPORTS) {
return false;
@@ -876,7 +876,7 @@ bool metal_a_supports_paint_setup(int supportType, int segment, int special, int
*
* @return (Carry Flag)
*/
bool metal_b_supports_paint_setup(int supportType, uint8 segment, int special, int height, uint32 imageColourFlags)
bool metal_b_supports_paint_setup(uint8 supportType, uint8 segment, int special, int height, uint32 imageColourFlags)
{
#ifndef NO_RCT2
if (gUseOriginalRidePaint) {

View File

@@ -28,8 +28,8 @@ extern paint_struct * gWoodenSupportsPrependTo;
bool wooden_a_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags, bool* underground);
bool wooden_b_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags, bool* underground);
bool metal_a_supports_paint_setup(int supportType, int segment, int special, int height, uint32 imageColourFlags);
bool metal_b_supports_paint_setup(int supportType, uint8 segment, int special, int height, uint32 imageColourFlags);
bool metal_a_supports_paint_setup(uint8 supportType, uint8 segment, int special, int height, uint32 imageColourFlags);
bool metal_b_supports_paint_setup(uint8 supportType, uint8 segment, int special, int height, uint32 imageColourFlags);
bool path_a_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags, rct_footpath_entry * pathEntry, bool * underground);
bool path_b_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags, rct_footpath_entry * pathEntry);