Remove SpriteBase::flags (#14460)

* Remove SpriteBase::flags

* Increment network version

* update replays
This commit is contained in:
Duncan 2021-04-11 18:02:19 +01:00 committed by GitHub
parent 7d2823d1f0
commit a9e1f2e89c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 23 additions and 16 deletions

View File

@ -50,9 +50,9 @@ set(OBJECTS_VERSION "1.0.21")
set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip")
set(OBJECTS_SHA1 "c38af45d51a6e440386180feacf76c64720b6ac5")
set(REPLAYS_VERSION "0.0.37")
set(REPLAYS_VERSION "0.0.38")
set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v${REPLAYS_VERSION}/replays.zip")
set(REPLAYS_SHA1 "C31C299539EB86DA013AEE47C9B2B2F4609F52C4")
set(REPLAYS_SHA1 "8940FE7B3F86772214C8CF265E6CEA5A25B49FC1")
option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.")
option(WITH_TESTS "Build tests")

View File

@ -48,8 +48,8 @@
<TitleSequencesSha1>304d13a126c15bf2c86ff13b81a2f2cc1856ac8d</TitleSequencesSha1>
<ObjectsUrl>https://github.com/OpenRCT2/objects/releases/download/v1.0.21/objects.zip</ObjectsUrl>
<ObjectsSha1>c38af45d51a6e440386180feacf76c64720b6ac5</ObjectsSha1>
<ReplaysUrl>https://github.com/OpenRCT2/replays/releases/download/v0.0.37/replays.zip</ReplaysUrl>
<ReplaysSha1>C31C299539EB86DA013AEE47C9B2B2F4609F52C4</ReplaysSha1>
<ReplaysUrl>https://github.com/OpenRCT2/replays/releases/download/v0.0.38/replays.zip</ReplaysUrl>
<ReplaysSha1>8940FE7B3F86772214C8CF265E6CEA5A25B49FC1</ReplaysSha1>
</PropertyGroup>
<ItemGroup>

View File

@ -197,7 +197,6 @@ struct GameStateSnapshots final : public IGameStateSnapshots
{
COMPARE_FIELD(SpriteBase, Type);
COMPARE_FIELD(SpriteBase, sprite_index);
COMPARE_FIELD(SpriteBase, flags);
COMPARE_FIELD(SpriteBase, x);
COMPARE_FIELD(SpriteBase, y);
COMPARE_FIELD(SpriteBase, z);
@ -392,6 +391,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots
COMPARE_FIELD(Vehicle, target_seat_rotation);
COMPARE_FIELD(Vehicle, BoatLocation.x);
COMPARE_FIELD(Vehicle, BoatLocation.y);
COMPARE_FIELD(Vehicle, IsCrashedVehicle);
}
void CompareSpriteDataLitter(const Litter& spriteBase, const Litter& spriteCmp, GameStateSpriteChange_t& changeData) const

View File

@ -36,7 +36,7 @@
// This string specifies which version of network stream current build uses.
// It is used for making sure only compatible builds get connected, even within
// single OpenRCT2 version.
#define NETWORK_STREAM_VERSION "10"
#define NETWORK_STREAM_VERSION "11"
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
static Peep* _pickup_peep = nullptr;

View File

@ -1401,7 +1401,6 @@ private:
void ImportEntityCommonProperties(SpriteBase* dst, const RCT12SpriteBase* src)
{
dst->flags = src->flags;
dst->sprite_direction = src->sprite_direction;
dst->sprite_width = src->sprite_width;
dst->sprite_height_negative = src->sprite_height_negative;
@ -2877,6 +2876,7 @@ template<> void S4Importer::ImportEntity<Vehicle>(const RCT12SpriteBase& srcBase
dst->num_peeps = src->num_peeps;
dst->next_free_seat = src->next_free_seat;
dst->IsCrashedVehicle = src->flags & RCT12_SPRITE_FLAGS_IS_CRASHED_VEHICLE_SPRITE;
}
template<> void S4Importer::ImportEntity<Guest>(const RCT12SpriteBase& srcBase)

View File

@ -173,6 +173,11 @@ enum
RCT12_STATION_STYLE_INVISIBLE, // Added by OpenRCT2
};
enum
{
RCT12_SPRITE_FLAGS_IS_CRASHED_VEHICLE_SPRITE = 1 << 7,
};
#pragma pack(push, 1)
struct RCT12xy8

View File

@ -1068,7 +1068,7 @@ void S6Exporter::ExportEntityCommonProperties(RCT12SpriteBase* dst, const Sprite
dst->next_in_quadrant = SPRITE_INDEX_NULL;
dst->sprite_height_negative = src->sprite_height_negative;
dst->sprite_index = src->sprite_index;
dst->flags = src->flags;
dst->flags = 0;
dst->x = src->x;
dst->y = src->y;
dst->z = src->z;
@ -1167,6 +1167,7 @@ template<> void S6Exporter::ExportEntity(RCT2SpriteVehicle* dst, const Vehicle*
dst->colours_extended = src->colours_extended;
dst->seat_rotation = src->seat_rotation;
dst->target_seat_rotation = src->target_seat_rotation;
dst->flags = src->IsCrashedVehicle ? RCT12_SPRITE_FLAGS_IS_CRASHED_VEHICLE_SPRITE : 0;
}
template<> void S6Exporter::ExportEntity(RCT2SpritePeep* dst, const Guest* src)

View File

@ -1512,7 +1512,6 @@ public:
dst->Type = GetEntityTypeFromRCT2Sprite(src);
dst->sprite_height_negative = src->sprite_height_negative;
dst->sprite_index = src->sprite_index;
dst->flags = src->flags;
dst->x = src->x;
dst->y = src->y;
dst->z = src->z;
@ -1666,6 +1665,7 @@ template<> void S6Importer::ImportEntity<Vehicle>(const RCT12SpriteBase& baseSrc
dst->colours_extended = src->colours_extended;
dst->seat_rotation = src->seat_rotation;
dst->target_seat_rotation = src->target_seat_rotation;
dst->IsCrashedVehicle = src->flags & RCT12_SPRITE_FLAGS_IS_CRASHED_VEHICLE_SPRITE;
}
template<> void S6Importer::ImportEntity<Guest>(const RCT12SpriteBase& baseSrc)

View File

@ -79,6 +79,7 @@ Vehicle* cable_lift_segment_create(
current->num_peeps = 0;
current->next_free_seat = 0;
current->BoatLocation.setNull();
current->IsCrashedVehicle = false;
return current;
}

View File

@ -4270,6 +4270,7 @@ static Vehicle* vehicle_create_car(
vehicle->num_peeps = 0;
vehicle->next_free_seat = 0;
vehicle->BoatLocation.setNull();
vehicle->IsCrashedVehicle = false;
return vehicle;
}

View File

@ -3606,7 +3606,7 @@ void Vehicle::UpdateCollisionSetup()
crashed_vehicle_particle_create(train->colours, { train->x, train->y, train->z });
}
train->flags |= SPRITE_FLAGS_IS_CRASHED_VEHICLE_SPRITE;
train->IsCrashedVehicle = true;
train->var_C8 = scenario_rand();
train->var_CA = scenario_rand();
@ -5365,7 +5365,7 @@ void Vehicle::CrashOnLand()
while (numParticles-- != 0)
crashed_vehicle_particle_create(colours, { x, y, z });
flags |= SPRITE_FLAGS_IS_CRASHED_VEHICLE_SPRITE;
IsCrashedVehicle = true;
animation_frame = 0;
var_C8 = 0;
sprite_width = 13;
@ -5428,7 +5428,7 @@ void Vehicle::CrashOnWater()
for (int32_t i = 0; i < 10; ++i)
crashed_vehicle_particle_create(colours, { x - 4, y + 8, z });
flags |= SPRITE_FLAGS_IS_CRASHED_VEHICLE_SPRITE;
IsCrashedVehicle = true;
animation_frame = 0;
var_C8 = 0;
sprite_width = 13;

View File

@ -204,6 +204,7 @@ struct Vehicle : SpriteBase
uint8_t seat_rotation;
uint8_t target_seat_rotation;
CoordsXY BoatLocation;
bool IsCrashedVehicle;
constexpr bool IsHead() const
{

View File

@ -3140,7 +3140,7 @@ template<> void PaintEntity(paint_session* session, const Vehicle* vehicle, int3
int32_t y = vehicle->y;
int32_t z = vehicle->z;
if (vehicle->flags & SPRITE_FLAGS_IS_CRASHED_VEHICLE_SPRITE)
if (vehicle->IsCrashedVehicle)
{
uint32_t ebx = 22965 + vehicle->animation_frame;
PaintAddImageAsParent(session, ebx, 0, 0, 1, 1, 0, z, 0, 0, z + 2);

View File

@ -427,7 +427,6 @@ static void PrepareNewEntity(SpriteBase* base, const EntityType type)
base->sprite_width = 0x10;
base->sprite_height_negative = 0x14;
base->sprite_height_positive = 0x8;
base->flags = 0;
base->sprite_left = LOCATION_NULL;
SpriteSpatialInsert(base, { LOCATION_NULL, 0 });

View File

@ -29,7 +29,6 @@ struct SpriteBase
// Height from centre of sprite to bottom
uint8_t sprite_height_negative;
uint16_t sprite_index;
uint16_t flags;
int16_t x;
int16_t y;
int16_t z;

View File

@ -132,7 +132,6 @@ static void CompareSpriteDataCommon(const SpriteBase& left, const SpriteBase& ri
{
COMPARE_FIELD(Type);
COMPARE_FIELD(sprite_index);
COMPARE_FIELD(flags);
COMPARE_FIELD(x);
COMPARE_FIELD(y);
COMPARE_FIELD(z);
@ -336,6 +335,7 @@ static void CompareSpriteDataVehicle(const Vehicle& left, const Vehicle& right)
COMPARE_FIELD(colours_extended);
COMPARE_FIELD(seat_rotation);
COMPARE_FIELD(target_seat_rotation);
COMPARE_FIELD(IsCrashedVehicle);
}
static void CompareSpriteDataLitter(const Litter& left, const Litter& right)