Remove dead code from #6819 (#13971)

This was missed back in 2017 there is now no longer a reason to make a backup tunnel array as we never modify it. I've also added a const to make it clear we never write to the array
This commit is contained in:
Duncan 2021-01-30 08:33:36 +00:00 committed by GitHub
parent 418b6f9a54
commit dc113ff6e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 10 deletions

View File

@ -563,7 +563,7 @@ static void viewport_surface_draw_tile_side_bottom(
LocationXY16 tunnelBounds = { 1, 1 };
LocationXY16 tunnelTopBoundBoxOffset = { 0, 0 };
tunnel_entry* tunnelArray;
const tunnel_entry* tunnelArray;
switch (edge)
{
case EDGE_BOTTOMLEFT:
@ -1285,21 +1285,12 @@ void surface_paint(paint_session* session, uint8_t direction, uint16_t height, c
log_verbose("edgeStyle: %d", edgeStyle);
}
tunnel_entry backupLeftTunnels[TUNNEL_MAX_COUNT];
tunnel_entry backupRightTunnels[TUNNEL_MAX_COUNT];
std::memcpy(backupLeftTunnels, session->LeftTunnels, sizeof(tunnel_entry) * TUNNEL_MAX_COUNT);
std::memcpy(backupRightTunnels, session->RightTunnels, sizeof(tunnel_entry) * TUNNEL_MAX_COUNT);
viewport_surface_draw_land_side_top(session, EDGE_TOPLEFT, height, edgeStyle, tileDescriptors[0], tileDescriptors[3]);
viewport_surface_draw_land_side_top(session, EDGE_TOPRIGHT, height, edgeStyle, tileDescriptors[0], tileDescriptors[4]);
viewport_surface_draw_land_side_bottom(
session, EDGE_BOTTOMLEFT, height, edgeStyle, tileDescriptors[0], tileDescriptors[1]);
viewport_surface_draw_land_side_bottom(
session, EDGE_BOTTOMRIGHT, height, edgeStyle, tileDescriptors[0], tileDescriptors[2]);
std::memcpy(session->LeftTunnels, backupLeftTunnels, sizeof(tunnel_entry) * TUNNEL_MAX_COUNT);
std::memcpy(session->RightTunnels, backupRightTunnels, sizeof(tunnel_entry) * TUNNEL_MAX_COUNT);
}
const uint16_t waterHeight = tileElement->AsSurface()->GetWaterHeight();