mirror of https://github.com/OpenRCT2/OpenRCT2.git
Split off a number of entity files into separate headers (#14629)
* Split off a number of entity files into seperate headers * Get compiling * Update copyright date
This commit is contained in:
parent
36b2742c19
commit
816bf827ab
|
@ -9,7 +9,8 @@
|
|||
|
||||
#include "BalloonPressAction.h"
|
||||
|
||||
#include "../world/Sprite.h"
|
||||
#include "../world/Balloon.h"
|
||||
#include "../world/Entity.h"
|
||||
#include "GameAction.h"
|
||||
|
||||
BalloonPressAction::BalloonPressAction(uint16_t spriteIndex)
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
#include "../scripting/ScriptEngine.h"
|
||||
#include "../ui/UiContext.h"
|
||||
#include "../ui/WindowManager.h"
|
||||
#include "../world/MoneyEffect.h"
|
||||
#include "../world/Park.h"
|
||||
#include "../world/Scenery.h"
|
||||
#include "../world/Sprite.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
|
|
|
@ -436,20 +436,25 @@
|
|||
<ClInclude Include="Version.h" />
|
||||
<ClInclude Include="windows\Intent.h" />
|
||||
<ClInclude Include="windows\tile_inspector.h" />
|
||||
<ClInclude Include="world\Balloon.h" />
|
||||
<ClInclude Include="world\Banner.h" />
|
||||
<ClInclude Include="world\Climate.h" />
|
||||
<ClInclude Include="world\Duck.h" />
|
||||
<ClInclude Include="world\Entity.h" />
|
||||
<ClInclude Include="world\EntityList.h" />
|
||||
<ClInclude Include="world\Entrance.h" />
|
||||
<ClInclude Include="world\Footpath.h" />
|
||||
<ClInclude Include="world\Fountain.h" />
|
||||
<ClInclude Include="world\LargeScenery.h" />
|
||||
<ClInclude Include="world\Litter.h" />
|
||||
<ClInclude Include="world\Location.hpp" />
|
||||
<ClInclude Include="world\Map.h" />
|
||||
<ClInclude Include="world\MapAnimation.h" />
|
||||
<ClInclude Include="world\MapGen.h" />
|
||||
<ClInclude Include="world\MapHelpers.h" />
|
||||
<ClInclude Include="world\MoneyEffect.h" />
|
||||
<ClInclude Include="world\Park.h" />
|
||||
<ClInclude Include="world\Particle.h" />
|
||||
<ClInclude Include="world\Scenery.h" />
|
||||
<ClInclude Include="world\ScenerySelection.h" />
|
||||
<ClInclude Include="world\SmallScenery.h" />
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
#include "../../interface/Viewport.h"
|
||||
#include "../../world/Sprite.h"
|
||||
#include "../../world/Litter.h"
|
||||
#include "../Paint.h"
|
||||
#include "Paint.Sprite.h"
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "Balloon.h"
|
||||
|
||||
#include "../Game.h"
|
||||
#include "../audio/audio.h"
|
||||
#include "../network/network.h"
|
||||
|
@ -94,8 +96,3 @@ void create_balloon(const CoordsXYZ& balloonPos, int32_t colour, bool isPopped)
|
|||
balloon->colour = colour;
|
||||
balloon->popped = (isPopped ? 1 : 0);
|
||||
}
|
||||
|
||||
void balloon_update(Balloon* balloon)
|
||||
{
|
||||
balloon->Update();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
/*****************************************************************************
|
||||
* Copyright (c) 2014-2021 OpenRCT2 developers
|
||||
*
|
||||
* For a complete list of all authors, please refer to contributors.md
|
||||
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
||||
*
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "SpriteBase.h"
|
||||
|
||||
class DataSerialiser;
|
||||
struct CoordsXYZ;
|
||||
|
||||
struct Balloon : MiscEntity
|
||||
{
|
||||
static constexpr auto cEntityType = EntityType::Balloon;
|
||||
uint16_t popped;
|
||||
uint8_t time_to_move;
|
||||
uint8_t colour;
|
||||
|
||||
void Update();
|
||||
void Pop();
|
||||
void Press();
|
||||
void Serialise(DataSerialiser& stream);
|
||||
};
|
||||
|
||||
void create_balloon(const CoordsXYZ& balloonPos, int32_t colour, bool isPopped);
|
|
@ -6,6 +6,7 @@
|
|||
*
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
#include "Duck.h"
|
||||
|
||||
#include "../Game.h"
|
||||
#include "../audio/audio.h"
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
/*****************************************************************************
|
||||
* Copyright (c) 2014-2021 OpenRCT2 developers
|
||||
*
|
||||
* For a complete list of all authors, please refer to contributors.md
|
||||
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
||||
*
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "SpriteBase.h"
|
||||
|
||||
class DataSerialiser;
|
||||
struct CoordsXY;
|
||||
|
||||
struct Duck : MiscEntity
|
||||
{
|
||||
static constexpr auto cEntityType = EntityType::Duck;
|
||||
enum class DuckState : uint8_t
|
||||
{
|
||||
FlyToWater,
|
||||
Swim,
|
||||
Drink,
|
||||
DoubleDrink,
|
||||
FlyAway,
|
||||
};
|
||||
int16_t target_x;
|
||||
int16_t target_y;
|
||||
DuckState state;
|
||||
|
||||
void Update();
|
||||
uint32_t GetFrameImage(int32_t direction) const;
|
||||
bool IsFlying();
|
||||
void Remove();
|
||||
void Serialise(DataSerialiser& stream);
|
||||
|
||||
private:
|
||||
void UpdateFlyToWater();
|
||||
void UpdateSwim();
|
||||
void UpdateDrink();
|
||||
void UpdateDoubleDrink();
|
||||
void UpdateFlyAway();
|
||||
};
|
||||
|
||||
void create_duck(const CoordsXY& pos);
|
||||
void duck_press(Duck* duck);
|
||||
void duck_remove_all();
|
|
@ -0,0 +1,45 @@
|
|||
/*****************************************************************************
|
||||
* Copyright (c) 2014-2021 OpenRCT2 developers
|
||||
*
|
||||
* For a complete list of all authors, please refer to contributors.md
|
||||
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
||||
*
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "SpriteBase.h"
|
||||
|
||||
class DataSerialiser;
|
||||
struct CoordsXYZ;
|
||||
struct CoordsXYZD;
|
||||
|
||||
enum LitterType : uint8_t
|
||||
{
|
||||
LITTER_TYPE_SICK,
|
||||
LITTER_TYPE_SICK_ALT,
|
||||
LITTER_TYPE_EMPTY_CAN,
|
||||
LITTER_TYPE_RUBBISH,
|
||||
LITTER_TYPE_EMPTY_BURGER_BOX,
|
||||
LITTER_TYPE_EMPTY_CUP,
|
||||
LITTER_TYPE_EMPTY_BOX,
|
||||
LITTER_TYPE_EMPTY_BOTTLE,
|
||||
LITTER_TYPE_EMPTY_BOWL_RED,
|
||||
LITTER_TYPE_EMPTY_DRINK_CARTON,
|
||||
LITTER_TYPE_EMPTY_JUICE_CUP,
|
||||
LITTER_TYPE_EMPTY_BOWL_BLUE,
|
||||
};
|
||||
|
||||
struct Litter : SpriteBase
|
||||
{
|
||||
static constexpr auto cEntityType = EntityType::Litter;
|
||||
LitterType SubType;
|
||||
uint32_t creationTick;
|
||||
void Serialise(DataSerialiser& stream);
|
||||
};
|
||||
|
||||
extern const rct_string_id litterNames[12];
|
||||
|
||||
void litter_create(const CoordsXYZD& litterPos, LitterType type);
|
||||
void litter_remove_at(const CoordsXYZ& litterPos);
|
|
@ -6,6 +6,7 @@
|
|||
*
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
#include "MoneyEffect.h"
|
||||
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../drawing/Drawing.h"
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
/*****************************************************************************
|
||||
* Copyright (c) 2014-2021 OpenRCT2 developers
|
||||
*
|
||||
* For a complete list of all authors, please refer to contributors.md
|
||||
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
||||
*
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "SpriteBase.h"
|
||||
|
||||
class DataSerialiser;
|
||||
struct CoordsXYZ;
|
||||
|
||||
struct MoneyEffect : MiscEntity
|
||||
{
|
||||
static constexpr auto cEntityType = EntityType::MoneyEffect;
|
||||
uint16_t MoveDelay;
|
||||
uint8_t NumMovements;
|
||||
uint8_t Vertical;
|
||||
money32 Value;
|
||||
int16_t OffsetX;
|
||||
uint16_t Wiggle;
|
||||
|
||||
static void CreateAt(money32 value, const CoordsXYZ& effectPos, bool vertical);
|
||||
static void Create(money32 value, const CoordsXYZ& loc);
|
||||
void Update();
|
||||
std::pair<rct_string_id, money32> GetStringId() const;
|
||||
void Serialise(DataSerialiser& stream);
|
||||
};
|
|
@ -36,8 +36,8 @@
|
|||
#include "../util/Util.h"
|
||||
#include "../windows/Intent.h"
|
||||
#include "Entrance.h"
|
||||
#include "Litter.h"
|
||||
#include "Map.h"
|
||||
#include "Sprite.h"
|
||||
#include "Surface.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
#include "Particle.h"
|
||||
|
||||
#include "../audio/audio.h"
|
||||
#include "../paint/sprite/Paint.Sprite.h"
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
/*****************************************************************************
|
||||
* Copyright (c) 2014-2021 OpenRCT2 developers
|
||||
*
|
||||
* For a complete list of all authors, please refer to contributors.md
|
||||
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
||||
*
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../ride/VehicleColour.h"
|
||||
#include "SpriteBase.h"
|
||||
|
||||
class DataSerialiser;
|
||||
struct CoordsXYZ;
|
||||
|
||||
struct VehicleCrashParticle : MiscEntity
|
||||
{
|
||||
static constexpr auto cEntityType = EntityType::CrashedVehicleParticle;
|
||||
uint16_t time_to_live;
|
||||
uint8_t colour[2];
|
||||
uint16_t crashed_sprite_base;
|
||||
int16_t velocity_x;
|
||||
int16_t velocity_y;
|
||||
int16_t velocity_z;
|
||||
int32_t acceleration_x;
|
||||
int32_t acceleration_y;
|
||||
int32_t acceleration_z;
|
||||
|
||||
void Update();
|
||||
void Serialise(DataSerialiser& stream);
|
||||
};
|
||||
|
||||
struct CrashSplashParticle : MiscEntity
|
||||
{
|
||||
static constexpr auto cEntityType = EntityType::CrashSplash;
|
||||
void Update();
|
||||
void Serialise(DataSerialiser& stream);
|
||||
};
|
||||
|
||||
void crashed_vehicle_particle_create(rct_vehicle_colour colours, const CoordsXYZ& vehiclePos);
|
||||
void crash_splash_create(const CoordsXYZ& splashPos);
|
|
@ -13,97 +13,17 @@
|
|||
#include "../common.h"
|
||||
#include "../peep/Peep.h"
|
||||
#include "../ride/Vehicle.h"
|
||||
#include "Balloon.h"
|
||||
#include "Duck.h"
|
||||
#include "Entity.h"
|
||||
#include "Fountain.h"
|
||||
#include "Litter.h"
|
||||
#include "MoneyEffect.h"
|
||||
#include "Particle.h"
|
||||
#include "SpriteBase.h"
|
||||
|
||||
enum LitterType : uint8_t;
|
||||
class DataSerialiser;
|
||||
|
||||
struct Litter : SpriteBase
|
||||
{
|
||||
static constexpr auto cEntityType = EntityType::Litter;
|
||||
LitterType SubType;
|
||||
uint32_t creationTick;
|
||||
void Serialise(DataSerialiser& stream);
|
||||
};
|
||||
|
||||
struct Balloon : MiscEntity
|
||||
{
|
||||
static constexpr auto cEntityType = EntityType::Balloon;
|
||||
uint16_t popped;
|
||||
uint8_t time_to_move;
|
||||
uint8_t colour;
|
||||
|
||||
void Update();
|
||||
void Pop();
|
||||
void Press();
|
||||
void Serialise(DataSerialiser& stream);
|
||||
};
|
||||
|
||||
struct Duck : MiscEntity
|
||||
{
|
||||
static constexpr auto cEntityType = EntityType::Duck;
|
||||
enum class DuckState : uint8_t
|
||||
{
|
||||
FlyToWater,
|
||||
Swim,
|
||||
Drink,
|
||||
DoubleDrink,
|
||||
FlyAway,
|
||||
};
|
||||
int16_t target_x;
|
||||
int16_t target_y;
|
||||
DuckState state;
|
||||
|
||||
void Update();
|
||||
uint32_t GetFrameImage(int32_t direction) const;
|
||||
bool IsFlying();
|
||||
void Remove();
|
||||
void Serialise(DataSerialiser& stream);
|
||||
|
||||
private:
|
||||
void UpdateFlyToWater();
|
||||
void UpdateSwim();
|
||||
void UpdateDrink();
|
||||
void UpdateDoubleDrink();
|
||||
void UpdateFlyAway();
|
||||
};
|
||||
|
||||
struct MoneyEffect : MiscEntity
|
||||
{
|
||||
static constexpr auto cEntityType = EntityType::MoneyEffect;
|
||||
uint16_t MoveDelay;
|
||||
uint8_t NumMovements;
|
||||
uint8_t Vertical;
|
||||
money32 Value;
|
||||
int16_t OffsetX;
|
||||
uint16_t Wiggle;
|
||||
|
||||
static void CreateAt(money32 value, const CoordsXYZ& effectPos, bool vertical);
|
||||
static void Create(money32 value, const CoordsXYZ& loc);
|
||||
void Update();
|
||||
std::pair<rct_string_id, money32> GetStringId() const;
|
||||
void Serialise(DataSerialiser& stream);
|
||||
};
|
||||
|
||||
struct VehicleCrashParticle : MiscEntity
|
||||
{
|
||||
static constexpr auto cEntityType = EntityType::CrashedVehicleParticle;
|
||||
uint16_t time_to_live;
|
||||
uint8_t colour[2];
|
||||
uint16_t crashed_sprite_base;
|
||||
int16_t velocity_x;
|
||||
int16_t velocity_y;
|
||||
int16_t velocity_z;
|
||||
int32_t acceleration_x;
|
||||
int32_t acceleration_y;
|
||||
int32_t acceleration_z;
|
||||
|
||||
void Update();
|
||||
void Serialise(DataSerialiser& stream);
|
||||
};
|
||||
|
||||
struct ExplosionFlare : MiscEntity
|
||||
{
|
||||
static constexpr auto cEntityType = EntityType::ExplosionFlare;
|
||||
|
@ -118,13 +38,6 @@ struct ExplosionCloud : MiscEntity
|
|||
void Serialise(DataSerialiser& stream);
|
||||
};
|
||||
|
||||
struct CrashSplashParticle : MiscEntity
|
||||
{
|
||||
static constexpr auto cEntityType = EntityType::CrashSplash;
|
||||
void Update();
|
||||
void Serialise(DataSerialiser& stream);
|
||||
};
|
||||
|
||||
struct SteamParticle : MiscEntity
|
||||
{
|
||||
static constexpr auto cEntityType = EntityType::SteamParticle;
|
||||
|
@ -178,22 +91,6 @@ enum
|
|||
SPRITE_FLAGS_PEEP_FLASHING = 1 << 9, // Deprecated: Use sprite_set_flashing/sprite_get_flashing instead.
|
||||
};
|
||||
|
||||
enum LitterType : uint8_t
|
||||
{
|
||||
LITTER_TYPE_SICK,
|
||||
LITTER_TYPE_SICK_ALT,
|
||||
LITTER_TYPE_EMPTY_CAN,
|
||||
LITTER_TYPE_RUBBISH,
|
||||
LITTER_TYPE_EMPTY_BURGER_BOX,
|
||||
LITTER_TYPE_EMPTY_CUP,
|
||||
LITTER_TYPE_EMPTY_BOX,
|
||||
LITTER_TYPE_EMPTY_BOTTLE,
|
||||
LITTER_TYPE_EMPTY_BOWL_RED,
|
||||
LITTER_TYPE_EMPTY_DRINK_CARTON,
|
||||
LITTER_TYPE_EMPTY_JUICE_CUP,
|
||||
LITTER_TYPE_EMPTY_BOWL_BLUE,
|
||||
};
|
||||
|
||||
constexpr const uint32_t SPATIAL_INDEX_SIZE = (MAXIMUM_MAP_SIZE_TECHNICAL * MAXIMUM_MAP_SIZE_TECHNICAL) + 1;
|
||||
constexpr const uint32_t SPATIAL_INDEX_LOCATION_NULL = SPATIAL_INDEX_SIZE - 1;
|
||||
|
||||
|
@ -218,31 +115,10 @@ void sprite_clear_all_unused();
|
|||
void sprite_misc_update_all();
|
||||
void sprite_set_coordinates(const CoordsXYZ& spritePos, SpriteBase* sprite);
|
||||
void sprite_remove(SpriteBase* sprite);
|
||||
void litter_create(const CoordsXYZD& litterPos, LitterType type);
|
||||
void litter_remove_at(const CoordsXYZ& litterPos);
|
||||
uint16_t remove_floating_sprites();
|
||||
void sprite_misc_explosion_cloud_create(const CoordsXYZ& cloudPos);
|
||||
void sprite_misc_explosion_flare_create(const CoordsXYZ& flarePos);
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Balloon
|
||||
///////////////////////////////////////////////////////////////
|
||||
void create_balloon(const CoordsXYZ& balloonPos, int32_t colour, bool isPopped);
|
||||
void balloon_update(Balloon* balloon);
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Duck
|
||||
///////////////////////////////////////////////////////////////
|
||||
void create_duck(const CoordsXY& pos);
|
||||
void duck_press(Duck* duck);
|
||||
void duck_remove_all();
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Crash particles
|
||||
///////////////////////////////////////////////////////////////
|
||||
void crashed_vehicle_particle_create(rct_vehicle_colour colours, const CoordsXYZ& vehiclePos);
|
||||
void crash_splash_create(const CoordsXYZ& splashPos);
|
||||
|
||||
rct_sprite_checksum sprite_checksum();
|
||||
|
||||
void sprite_set_flashing(SpriteBase* sprite, bool flashing);
|
||||
|
|
Loading…
Reference in New Issue