From 9c456c6bf53ce6da8604ffe4a33c403772dbc6e1 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Tue, 16 Feb 2016 14:22:43 +0100 Subject: [PATCH] Add development suggestions --- src/peep/peep.c | 8 ++++++++ src/world/scenery.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/peep/peep.c b/src/peep/peep.c index a3406f9f6b..61fb4985a0 100644 --- a/src/peep/peep.c +++ b/src/peep/peep.c @@ -9349,6 +9349,7 @@ static bool new_sub_690B99(rct_peep *peep, uint8 edge, uint8 *rideToView, uint8 if (map_element_get_type(mapElement) != MAP_ELEMENT_TYPE_FENCE) continue; if ((map_element_get_direction(mapElement) ^ 0x2) != edge) continue; if (g_wallSceneryEntries[mapElement->properties.fence.type]->wall.flags2 & WALL_SCENERY_FLAG4) continue; + // TODO: Check whether this shouldn't be <=, as the other loops use. If so, also extract as loop A. if (peep->next_z + 4 >= mapElement->base_height) continue; if (peep->next_z + 1 >= mapElement->clearance_height) continue; @@ -9356,6 +9357,7 @@ static bool new_sub_690B99(rct_peep *peep, uint8 edge, uint8 *rideToView, uint8 } while (!map_element_is_last_for_tile(mapElement++)); + // TODO: Extract loop B mapElement = surfaceElement; do { if (mapElement->clearance_height + 1 < peep->next_z) continue; @@ -9384,6 +9386,7 @@ static bool new_sub_690B99(rct_peep *peep, uint8 edge, uint8 *rideToView, uint8 } while (!map_element_is_last_for_tile(mapElement++)); + // TODO: Extract loop C mapElement = surfaceElement; do { if (mapElement->clearance_height + 1 < peep->next_z) continue; @@ -9410,6 +9413,7 @@ static bool new_sub_690B99(rct_peep *peep, uint8 edge, uint8 *rideToView, uint8 surfaceElement = map_get_surface_element_at(x / 32, y / 32); + // TODO: extract loop A mapElement = surfaceElement; do { if (map_element_get_type(mapElement) != MAP_ELEMENT_TYPE_FENCE) continue; @@ -9422,6 +9426,7 @@ static bool new_sub_690B99(rct_peep *peep, uint8 edge, uint8 *rideToView, uint8 } while (!map_element_is_last_for_tile(mapElement++)); + // TODO: Extract loop B mapElement = surfaceElement; do { if (mapElement->clearance_height + 1 < peep->next_z) continue; @@ -9450,6 +9455,7 @@ static bool new_sub_690B99(rct_peep *peep, uint8 edge, uint8 *rideToView, uint8 } while (!map_element_is_last_for_tile(mapElement++)); + // TODO: Extract loop C mapElement = surfaceElement; do { if (mapElement->clearance_height + 1 < peep->next_z) continue; @@ -9475,6 +9481,7 @@ static bool new_sub_690B99(rct_peep *peep, uint8 edge, uint8 *rideToView, uint8 surfaceElement = map_get_surface_element_at(x / 32, y / 32); + // TODO: extract loop A mapElement = surfaceElement; do { if (map_element_get_type(mapElement) != MAP_ELEMENT_TYPE_FENCE) continue; @@ -9487,6 +9494,7 @@ static bool new_sub_690B99(rct_peep *peep, uint8 edge, uint8 *rideToView, uint8 } while (!map_element_is_last_for_tile(mapElement++)); + // TODO: Extract loop B mapElement = surfaceElement; do { if (mapElement->clearance_height + 1 < peep->next_z) continue; diff --git a/src/world/scenery.h b/src/world/scenery.h index 1869069998..332d11c8da 100644 --- a/src/world/scenery.h +++ b/src/world/scenery.h @@ -99,7 +99,7 @@ typedef enum { WALL_SCENERY_FLAG1 = (1 << 0), // 0x1 WALL_SCENERY_FLAG2 = (1 << 1), // 0x2 WALL_SCENERY_FLAG3 = (1 << 2), // 0x4 - WALL_SCENERY_FLAG4 = (1 << 3), // 0x8 + WALL_SCENERY_FLAG4 = (1 << 3), // 0x8 // Probably indicates translucency WALL_SCENERY_FLAG5 = (1 << 4), // 0x10 WALL_SCENERY_FLAG6 = (1 << 5), // 0x20 WALL_SCENERY_HAS_SECONDARY_COLOUR = (1 << 6), // 0x40