1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 03:12:36 +01:00

Use "= default" for trivial ctor/dtor

This commit is contained in:
Filip Gawin 2018-02-18 01:06:39 +01:00
parent d03a33c284
commit cf5efb9560
15 changed files with 22 additions and 42 deletions

View File

@ -20,8 +20,7 @@ public:
* @brief The Activity struct interface * @brief The Activity struct interface
*/ */
struct Activity { struct Activity {
virtual ~Activity() { virtual ~Activity() = default;
}
virtual std::string name() const = 0; virtual std::string name() const = 0;
@ -77,8 +76,7 @@ protected:
public: public:
CharacterController(); CharacterController();
virtual ~CharacterController() { virtual ~CharacterController() = default;
}
/** /**
* Get the current Activity. * Get the current Activity.

View File

@ -49,8 +49,7 @@ public:
BaseModelInfo(ModelDataType type) : type_(type) { BaseModelInfo(ModelDataType type) : type_(type) {
} }
virtual ~BaseModelInfo() { virtual ~BaseModelInfo() = default;
}
ModelID id() const { ModelID id() const {
return modelid_; return modelid_;

View File

@ -38,9 +38,7 @@ GameData::GameData(Logger* log, const rwfs::path& path)
}); });
} }
GameData::~GameData() { GameData::~GameData() = default;
/// @todo don't leak models
}
void GameData::load() { void GameData::load() {
index.indexGameDirectory(datpath); index.indexGameDirectory(datpath);

View File

@ -27,8 +27,7 @@ struct AnimationKeyframe {
, id(_id) { , id(_id) {
} }
AnimationKeyframe() { AnimationKeyframe() = default;
}
}; };
struct AnimationBone { struct AnimationBone {

View File

@ -21,8 +21,7 @@ CutsceneObject::CutsceneObject(GameWorld *engine, const glm::vec3 &pos,
animator = new Animator(getClump()); animator = new Animator(getClump());
} }
CutsceneObject::~CutsceneObject() { CutsceneObject::~CutsceneObject() = default;
}
void CutsceneObject::tick(float dt) { void CutsceneObject::tick(float dt) {
animator->tick(dt); animator->tick(dt);

View File

@ -43,8 +43,7 @@ InstanceObject::InstanceObject(GameWorld* engine, const glm::vec3& pos,
} }
} }
InstanceObject::~InstanceObject() { InstanceObject::~InstanceObject() = default;
}
void InstanceObject::tick(float dt) { void InstanceObject::tick(float dt) {
if (animator) animator->tick(dt); if (animator) animator->tick(dt);

View File

@ -469,5 +469,4 @@ const Renderer::ProfileInfo& OpenGLRenderer::popDebugGroup() {
return profileInfo[0]; return profileInfo[0];
} }
Renderer::ShaderProgram::~ShaderProgram() { Renderer::ShaderProgram::~ShaderProgram() = default;
}

View File

@ -33,8 +33,7 @@ struct VertexP2 {
: position({_x, _y}) { : position({_x, _y}) {
} }
VertexP2() { VertexP2() = default;
}
}; };
@ -51,8 +50,7 @@ struct VertexP3 {
: position({_x, _y, _z}) { : position({_x, _y, _z}) {
} }
VertexP3() { VertexP3() = default;
}
}; };
class Renderer { class Renderer {

View File

@ -71,8 +71,7 @@ struct TextVertex {
, colour(_colour) { , colour(_colour) {
} }
TextVertex() { TextVertex() = default;
}
static const AttributeList vertex_attributes() { static const AttributeList vertex_attributes() {
return { return {
@ -132,8 +131,7 @@ TextRenderer::TextRenderer(GameRenderer* renderer) : renderer(renderer) {
} }
} }
TextRenderer::~TextRenderer() { TextRenderer::~TextRenderer() = default;
}
void TextRenderer::setFontTexture(int index, const std::string& texture) { void TextRenderer::setFontTexture(int index, const std::string& texture) {
if (index < GAME_FONTS) { if (index < GAME_FONTS) {

View File

@ -2,14 +2,11 @@
#include <new> #include <new>
VisualFX::LightData::~LightData() { VisualFX::LightData::~LightData() = default;
}
VisualFX::ParticleData::~ParticleData() { VisualFX::ParticleData::~ParticleData() = default;
}
VisualFX::TrailData::~TrailData() { VisualFX::TrailData::~TrailData() = default;
}
VisualFX::VisualFX(VisualFX::EffectType type) : type(type) { VisualFX::VisualFX(VisualFX::EffectType type) : type(type) {
switch (type) { switch (type) {

View File

@ -55,8 +55,7 @@ WaterRenderer::WaterRenderer(GameRenderer* renderer) : waterProg(nullptr) {
gridDraw.addGeometry(&gridGeom); gridDraw.addGeometry(&gridGeom);
} }
WaterRenderer::~WaterRenderer() { WaterRenderer::~WaterRenderer() = default;
}
void WaterRenderer::setWaterTable(float* waterHeights, unsigned int nHeights, void WaterRenderer::setWaterTable(float* waterHeights, unsigned int nHeights,
uint8_t* tiles, unsigned int nTiles) { uint8_t* tiles, unsigned int nTiles) {

View File

@ -26,8 +26,8 @@ class SCMFile;
struct SCMException { struct SCMException {
virtual ~SCMException() { virtual ~SCMException() = default;
}
virtual std::string what() const = 0; virtual std::string what() const = 0;
}; };
@ -119,7 +119,7 @@ struct SCMThread {
class ScriptMachine { class ScriptMachine {
public: public:
ScriptMachine(GameState* state, SCMFile* file, ScriptModule* ops); ScriptMachine(GameState* state, SCMFile* file, ScriptModule* ops);
~ScriptMachine() { } ~ScriptMachine() = default;
SCMFile* getFile() const { SCMFile* getFile() const {
return file; return file;

View File

@ -31,8 +31,7 @@ public:
} }
} }
virtual ~State() { virtual ~State() = default;
}
void enterMenu(const std::shared_ptr<Menu>& menu) { void enterMenu(const std::shared_ptr<Menu>& menu) {
nextMenu = menu; nextMenu = menu;

View File

@ -98,8 +98,7 @@ ModelFrame* Clump::findFrame(const std::string& name) const {
return rootframe_->findDescendant(name); return rootframe_->findDescendant(name);
} }
Clump::~Clump() { Clump::~Clump() = default;
}
void Clump::recalculateMetrics() { void Clump::recalculateMetrics() {
boundingRadius = std::numeric_limits<float>::min(); boundingRadius = std::numeric_limits<float>::min();

View File

@ -135,8 +135,7 @@ struct GeometryVertex {
, colour(_colour) { , colour(_colour) {
} }
GeometryVertex() { GeometryVertex() = default;
}
}; };
/** /**