From 7a8c602c7565c60ab2a12f03d837e42a6daae183 Mon Sep 17 00:00:00 2001 From: Aldoxtor Date: Wed, 3 May 2017 09:54:21 +0200 Subject: [PATCH] add missing override --- rwengine/src/ai/CharacterController.hpp | 14 +++++++------- rwengine/src/objects/CharacterObject.hpp | 6 +++--- rwengine/src/objects/CutsceneObject.hpp | 4 ++-- rwengine/src/objects/GameObject.hpp | 4 ++-- rwengine/src/objects/InstanceObject.hpp | 10 +++++----- rwengine/src/objects/PickupObject.hpp | 4 ++-- rwengine/src/objects/ProjectileObject.hpp | 4 ++-- rwengine/src/objects/VehicleObject.hpp | 10 +++++----- rwgame/states/BenchmarkState.hpp | 10 +++++----- rwgame/states/DebugState.hpp | 10 +++++----- rwgame/states/IngameState.hpp | 10 +++++----- rwgame/states/LoadingState.hpp | 12 ++++++------ rwgame/states/MenuState.hpp | 8 ++++---- rwgame/states/PauseState.hpp | 10 +++++----- 14 files changed, 58 insertions(+), 58 deletions(-) diff --git a/rwengine/src/ai/CharacterController.hpp b/rwengine/src/ai/CharacterController.hpp index e9fb145c..078be0bc 100644 --- a/rwengine/src/ai/CharacterController.hpp +++ b/rwengine/src/ai/CharacterController.hpp @@ -143,7 +143,7 @@ public: #define DECL_ACTIVITY(activity_name) \ static constexpr auto ActivityName = #activity_name; \ - std::string name() const { \ + std::string name() const override { \ return ActivityName; \ } @@ -165,9 +165,9 @@ struct GoTo : public CharacterController::Activity { : target(target), sprint(_sprint) { } - bool update(CharacterObject* character, CharacterController* controller); + bool update(CharacterObject* character, CharacterController* controller) override; - bool canSkip(CharacterObject*, CharacterController*) const { + bool canSkip(CharacterObject*, CharacterController*) const override { return true; } }; @@ -180,7 +180,7 @@ struct Jump : public CharacterController::Activity { Jump() : jumped(false) { } - bool update(CharacterObject* character, CharacterController* controller); + bool update(CharacterObject* character, CharacterController* controller) override; }; struct EnterVehicle : public CharacterController::Activity { @@ -202,7 +202,7 @@ struct EnterVehicle : public CharacterController::Activity { bool canSkip(CharacterObject* character, CharacterController*) const override; - bool update(CharacterObject* character, CharacterController* controller); + bool update(CharacterObject* character, CharacterController* controller) override; }; struct ExitVehicle : public CharacterController::Activity { @@ -213,7 +213,7 @@ struct ExitVehicle : public CharacterController::Activity { ExitVehicle(bool jacked_ = false) : jacked(jacked_) { } - bool update(CharacterObject* character, CharacterController* controller); + bool update(CharacterObject* character, CharacterController* controller) override; }; struct UseItem : public CharacterController::Activity { @@ -226,7 +226,7 @@ struct UseItem : public CharacterController::Activity { UseItem(int slot) : itemslot(slot) { } - bool update(CharacterObject* character, CharacterController* controller); + bool update(CharacterObject* character, CharacterController* controller) override; }; } diff --git a/rwengine/src/objects/CharacterObject.hpp b/rwengine/src/objects/CharacterObject.hpp index 40b35b84..e89833d1 100644 --- a/rwengine/src/objects/CharacterObject.hpp +++ b/rwengine/src/objects/CharacterObject.hpp @@ -86,11 +86,11 @@ public: ~CharacterObject(); - Type type() { + Type type() const override { return Character; } - void tick(float dt); + void tick(float dt) override; const CharacterState& getCurrentState() const { return currentState; @@ -111,7 +111,7 @@ public: */ void updateCharacter(float dt); - virtual void setPosition(const glm::vec3& pos); + virtual void setPosition(const glm::vec3& pos) override; bool isPlayer() const; diff --git a/rwengine/src/objects/CutsceneObject.hpp b/rwengine/src/objects/CutsceneObject.hpp index 6a05f4f8..969043aa 100644 --- a/rwengine/src/objects/CutsceneObject.hpp +++ b/rwengine/src/objects/CutsceneObject.hpp @@ -16,11 +16,11 @@ public: BaseModelInfo* modelinfo); ~CutsceneObject(); - Type type() { + Type type() const override { return Cutscene; } - void tick(float dt); + void tick(float dt) override; void setParentActor(GameObject* parent, ModelFrame* bone); diff --git a/rwengine/src/objects/GameObject.hpp b/rwengine/src/objects/GameObject.hpp index 7a6de40a..2417e0bf 100644 --- a/rwengine/src/objects/GameObject.hpp +++ b/rwengine/src/objects/GameObject.hpp @@ -130,7 +130,7 @@ public: * @brief determines what type of object this is. * @return one of Type */ - virtual Type type() { + virtual Type type() const { return Unknown; } @@ -183,7 +183,7 @@ public: float impulse; }; - virtual bool takeDamage(const DamageInfo& /*damage*/) { + virtual bool takeDamage(const DamageInfo& damage) { return false; } diff --git a/rwengine/src/objects/InstanceObject.hpp b/rwengine/src/objects/InstanceObject.hpp index 9e1b0e06..f94091e1 100644 --- a/rwengine/src/objects/InstanceObject.hpp +++ b/rwengine/src/objects/InstanceObject.hpp @@ -31,7 +31,7 @@ public: std::shared_ptr dyn); ~InstanceObject(); - Type type() { + Type type() const override { return Instance; } @@ -39,14 +39,14 @@ public: return atomic_; } - void tick(float dt); + void tick(float dt) override; void changeModel(BaseModelInfo* incoming); - virtual void setPosition(const glm::vec3& pos); - virtual void setRotation(const glm::quat& r); + virtual void setPosition(const glm::vec3& pos) override; + virtual void setRotation(const glm::quat& r) override; - virtual bool takeDamage(const DamageInfo& damage); + virtual bool takeDamage(const DamageInfo& damage) override; void setSolid(bool solid); diff --git a/rwengine/src/objects/PickupObject.hpp b/rwengine/src/objects/PickupObject.hpp index 657d58d8..9b8157f9 100644 --- a/rwengine/src/objects/PickupObject.hpp +++ b/rwengine/src/objects/PickupObject.hpp @@ -42,11 +42,11 @@ public: ~PickupObject(); - Type type() { + Type type() const override { return Pickup; } - void tick(float dt); + void tick(float dt) override; virtual bool onCharacterTouch(CharacterObject* character) { RW_UNUSED(character); diff --git a/rwengine/src/objects/ProjectileObject.hpp b/rwengine/src/objects/ProjectileObject.hpp index 65c93025..6059e262 100644 --- a/rwengine/src/objects/ProjectileObject.hpp +++ b/rwengine/src/objects/ProjectileObject.hpp @@ -53,9 +53,9 @@ public: ~ProjectileObject(); - void tick(float dt); + void tick(float dt) override; - Type type() { + Type type() const override { return Projectile; } diff --git a/rwengine/src/objects/VehicleObject.hpp b/rwengine/src/objects/VehicleObject.hpp index 0becf5a3..2b57074c 100644 --- a/rwengine/src/objects/VehicleObject.hpp +++ b/rwengine/src/objects/VehicleObject.hpp @@ -58,9 +58,9 @@ public: virtual ~VehicleObject(); - void setPosition(const glm::vec3& pos); + void setPosition(const glm::vec3& pos) override; - void setRotation(const glm::quat& orientation); + void setRotation(const glm::quat& orientation) override; void updateTransform(const glm::vec3& pos, const glm::quat& rot) override; @@ -71,7 +71,7 @@ public: Atomic* getHighLOD() const { return chassishigh_; } Atomic* getLowLOD() const { return chassislow_; } - Type type() { + Type type() const override { return Vehicle; } @@ -91,7 +91,7 @@ public: bool getHandbraking() const; - void tick(float dt); + void tick(float dt) override; void tickPhysics(float dt); @@ -130,7 +130,7 @@ public: Part* getSeatEntryDoor(size_t seat); - virtual bool takeDamage(const DamageInfo& damage); + virtual bool takeDamage(const DamageInfo& damage) override; enum FrameState { OK, DAM, BROKEN }; diff --git a/rwgame/states/BenchmarkState.hpp b/rwgame/states/BenchmarkState.hpp index 96915179..27436600 100644 --- a/rwgame/states/BenchmarkState.hpp +++ b/rwgame/states/BenchmarkState.hpp @@ -22,13 +22,13 @@ class BenchmarkState : public State { public: BenchmarkState(RWGame* game, const std::string& benchfile); - virtual void enter(); - virtual void exit(); + virtual void enter() override; + virtual void exit() override; - virtual void tick(float dt); - virtual void draw(GameRenderer* r); + virtual void tick(float dt) override; + virtual void draw(GameRenderer* r) override; - virtual void handleEvent(const SDL_Event& event); + virtual void handleEvent(const SDL_Event& event) override; const ViewCamera& getCamera(); }; diff --git a/rwgame/states/DebugState.hpp b/rwgame/states/DebugState.hpp index 54c7adef..6faef43e 100644 --- a/rwgame/states/DebugState.hpp +++ b/rwgame/states/DebugState.hpp @@ -21,13 +21,13 @@ public: DebugState(RWGame* game, const glm::vec3& vp = {}, const glm::quat& vd = {}); - virtual void enter(); - virtual void exit(); + virtual void enter() override; + virtual void exit() override; - virtual void tick(float dt); - virtual void draw(GameRenderer* r); + virtual void tick(float dt) override; + virtual void draw(GameRenderer* r) override; - virtual void handleEvent(const SDL_Event& event); + virtual void handleEvent(const SDL_Event& event) override; void printCameraDetails(); diff --git a/rwgame/states/IngameState.hpp b/rwgame/states/IngameState.hpp index 8c838505..a3f46c45 100644 --- a/rwgame/states/IngameState.hpp +++ b/rwgame/states/IngameState.hpp @@ -46,16 +46,16 @@ public: void startTest(); void startGame(); - virtual void enter(); - virtual void exit(); + virtual void enter() override; + virtual void exit() override; - virtual void tick(float dt); + virtual void tick(float dt) override; virtual void draw(GameRenderer* r); - virtual void handleEvent(const SDL_Event& event); + virtual void handleEvent(const SDL_Event& event) override; virtual void handlePlayerInput(const SDL_Event& event); - virtual bool shouldWorldUpdate(); + virtual bool shouldWorldUpdate() override; const ViewCamera& getCamera(float alpha); private: diff --git a/rwgame/states/LoadingState.hpp b/rwgame/states/LoadingState.hpp index 9bcddcb9..9a54bf16 100644 --- a/rwgame/states/LoadingState.hpp +++ b/rwgame/states/LoadingState.hpp @@ -10,16 +10,16 @@ class LoadingState : public State { public: LoadingState(RWGame* game, std::function callback); - virtual void enter(); - virtual void exit(); + virtual void enter() override; + virtual void exit() override; - virtual void tick(float dt); + virtual void tick(float dt) override; - virtual void draw(GameRenderer* r); + virtual void draw(GameRenderer* r) override; - virtual bool shouldWorldUpdate(); + virtual bool shouldWorldUpdate() override; - virtual void handleEvent(const SDL_Event& event); + virtual void handleEvent(const SDL_Event& event) override; }; #endif // LOADINGSTATE_HPP diff --git a/rwgame/states/MenuState.hpp b/rwgame/states/MenuState.hpp index 691c25db..2c051918 100644 --- a/rwgame/states/MenuState.hpp +++ b/rwgame/states/MenuState.hpp @@ -7,15 +7,15 @@ class MenuState : public State { public: MenuState(RWGame* game); - virtual void enter(); - virtual void exit(); + virtual void enter() override; + virtual void exit() override; - virtual void tick(float dt); + virtual void tick(float dt) override; virtual void enterMainMenu(); virtual void enterLoadMenu(); - virtual void handleEvent(const SDL_Event& event); + virtual void handleEvent(const SDL_Event& event) override; }; #endif // MENUSTATE_HPP diff --git a/rwgame/states/PauseState.hpp b/rwgame/states/PauseState.hpp index 32eddcc8..ca74ad4e 100644 --- a/rwgame/states/PauseState.hpp +++ b/rwgame/states/PauseState.hpp @@ -7,14 +7,14 @@ class PauseState : public State { public: PauseState(RWGame* game); - virtual void enter(); - virtual void exit(); + virtual void enter() override; + virtual void exit() override; - virtual void tick(float dt); + virtual void tick(float dt) override; - virtual void draw(GameRenderer* r); + virtual void draw(GameRenderer* r) override; - virtual void handleEvent(const SDL_Event& event); + virtual void handleEvent(const SDL_Event& event) override; }; #endif // PAUSESTATE_HPP