From 8d5e083998b871ca15daeca2bf8e0ec346054670 Mon Sep 17 00:00:00 2001 From: Ted John Date: Tue, 28 May 2019 22:06:56 +0100 Subject: [PATCH] Remove duplicate divisions --- src/openrct2/ride/thrill/LaunchedFreefall.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/openrct2/ride/thrill/LaunchedFreefall.cpp b/src/openrct2/ride/thrill/LaunchedFreefall.cpp index 27cdffbc9f..8a157f64b1 100644 --- a/src/openrct2/ride/thrill/LaunchedFreefall.cpp +++ b/src/openrct2/ride/thrill/LaunchedFreefall.cpp @@ -58,24 +58,25 @@ void vehicle_visual_launched_freefall( { baseImage_id += 2; // Draw peeps sitting without transparent area between them for restraints } - image_id = (baseImage_id + ((((imageDirection / 8) + 0) & 3) * 3)) + auto directionOffset = imageDirection / 8; + image_id = (baseImage_id + (((directionOffset + 0) & 3) * 3)) | SPRITE_ID_PALETTE_COLOUR_2(vehicle->peep_tshirt_colours[0], vehicle->peep_tshirt_colours[1]); sub_98199C(session, image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1); if (vehicle->num_peeps > 2) { - image_id = (baseImage_id + ((((imageDirection / 8) + 1) & 3) * 3)) + image_id = (baseImage_id + (((directionOffset + 1) & 3) * 3)) | SPRITE_ID_PALETTE_COLOUR_2(vehicle->peep_tshirt_colours[2], vehicle->peep_tshirt_colours[3]); sub_98199C(session, image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1); } if (vehicle->num_peeps > 4) { - image_id = (baseImage_id + ((((imageDirection / 8) + 2) & 3) * 3)) + image_id = (baseImage_id + (((directionOffset + 2) & 3) * 3)) | SPRITE_ID_PALETTE_COLOUR_2(vehicle->peep_tshirt_colours[4], vehicle->peep_tshirt_colours[5]); sub_98199C(session, image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1); } if (vehicle->num_peeps > 6) { - image_id = (baseImage_id + ((((imageDirection / 8) + 3) & 3) * 3)) + image_id = (baseImage_id + (((directionOffset + 3) & 3) * 3)) | SPRITE_ID_PALETTE_COLOUR_2(vehicle->peep_tshirt_colours[6], vehicle->peep_tshirt_colours[7]); sub_98199C(session, image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1); }