From 421fc5bc5984241a8828806f021fa0453757367f Mon Sep 17 00:00:00 2001 From: hdpoliveira Date: Sun, 19 Apr 2020 02:01:07 -0300 Subject: [PATCH] Part of #9473: Create Vehicle::InvalidateWindow Converted from vehicle_invalidate_window --- src/openrct2/ride/Vehicle.cpp | 6 +++--- src/openrct2/ride/Vehicle.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index f9945c6034..1bea889d30 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -9806,10 +9806,10 @@ int32_t vehicle_get_total_num_peeps(const Vehicle* vehicle) * * rct2: 0x006DA1EC */ -void vehicle_invalidate_window(Vehicle* vehicle) +void Vehicle::InvalidateWindow() { auto intent = Intent(INTENT_ACTION_INVALIDATE_VEHICLE_WINDOW); - intent.putExtra(INTENT_EXTRA_VEHICLE, vehicle); + intent.putExtra(INTENT_EXTRA_VEHICLE, this); context_broadcast_intent(&intent); } @@ -9985,7 +9985,7 @@ void Vehicle::SetState(VEHICLE_STATUS vehicleStatus, uint8_t subState) { status = vehicleStatus; sub_state = subState; - vehicle_invalidate_window(this); + InvalidateWindow(); } bool Vehicle::IsGhost() const diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index 9243a771a0..780ab6fd05 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -360,6 +360,7 @@ private: bool CurrentTowerElementIsTop(); bool UpdateTrackMotionForwards(rct_ride_entry_vehicle* vehicleEntry, Ride* curRide, rct_ride_entry* rideEntry); bool UpdateTrackMotionBackwards(rct_ride_entry_vehicle* vehicleEntry, Ride* curRide, rct_ride_entry* rideEntry); + void InvalidateWindow(); void TestReset(); void UpdateTestFinish(); void PeepEasterEggHereWeAre() const; @@ -562,7 +563,6 @@ GForces vehicle_get_g_forces(const Vehicle* vehicle); void vehicle_set_map_toolbar(const Vehicle* vehicle); int32_t vehicle_is_used_in_pairs(const Vehicle* vehicle); int32_t vehicle_get_total_num_peeps(const Vehicle* vehicle); -void vehicle_invalidate_window(Vehicle* vehicle); const rct_vehicle_info* vehicle_get_move_info(int32_t trackSubposition, int32_t typeAndDirection, int32_t offset); uint16_t vehicle_get_move_info_size(int32_t trackSubposition, int32_t typeAndDirection);