1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-09-18 16:32:32 +02:00

Mark classes as final

It lets complier to make extra optimization.

See:
https://gcc.godbolt.org/#compilers:!((compiler:g6,options:'-O2+-Wall++-
xc%2B%2B+-
std%3Dc%2B%2B11',sourcez:MYGwhgzhAECC0G8BQAHArgIxAS2ALiWiOgDdsAnAFzTBFIHtsATaAMwAoBKaAXmgAYA3EgC%2BwpKEgwAQtDzR0WXHESpMOfIWIlGLDt1bYAdrWj0SAU3LlmF4WKQTwUaAGE5C9cvjJFGgsQMzGxcZpbWtvbiOsGs9PTs0gBk0BjcyIEYAHT69o4xLBhg5OyuKcDpWkTAOVz2QAA%3D%3D)),filterAsm:
(commentOnly:!t,directives:!t,intel:!t,labels:!t),version:3
This commit is contained in:
Filip Gawin 2018-07-07 22:55:10 +02:00
parent 83ee9ef568
commit 495c831972
19 changed files with 21 additions and 21 deletions

View File

@ -3,7 +3,7 @@
#include <glm/glm.hpp>
#include <ai/CharacterController.hpp>
class DefaultAIController : public CharacterController {
class DefaultAIController final : public CharacterController {
glm::vec3 gotoPos{};
public:

View File

@ -5,7 +5,7 @@
#include <glm/glm.hpp>
#include <glm/gtc/quaternion.hpp>
class PlayerController : public CharacterController {
class PlayerController final : public CharacterController {
private:
glm::quat cameraRotation{1.0f, 0.0f, 0.0f, 0.0f};

View File

@ -60,7 +60,7 @@ private:
std::vector<MessageReceiver*> receivers;
};
class StdOutReceiver : public Logger::MessageReceiver {
class StdOutReceiver final : public Logger::MessageReceiver {
void messageReceived(const Logger::LogMessage&) override;
};

View File

@ -6,7 +6,7 @@
/**
* Implements raycast callback that ignores a specified btCollisionObject
*/
class ClosestNotMeRayResultCallback
class ClosestNotMeRayResultCallback final
: public btCollisionWorld::ClosestRayResultCallback {
btCollisionObject* _self;

View File

@ -53,7 +53,7 @@ class GameWorld;
* @brief The CharacterObject struct
* Implements Character object behaviours.
*/
class CharacterObject : public GameObject, public ClumpObject {
class CharacterObject final : public GameObject, public ClumpObject {
private:
CharacterState currentState{};

View File

@ -13,7 +13,7 @@ class ModelFrame;
/**
* @brief Object type used for cutscene animations.
*/
class CutsceneObject : public GameObject, public ClumpObject {
class CutsceneObject final : public GameObject, public ClumpObject {
GameObject* _parent = nullptr;
ModelFrame* _bone = nullptr;

View File

@ -16,7 +16,7 @@ class GameWorld;
* @struct InstanceObject
* A simple object instance
*/
class InstanceObject : public GameObject {
class InstanceObject final : public GameObject {
float health = 100.f;
bool visible =true;
bool floating = false;

View File

@ -14,7 +14,7 @@ struct WeaponData;
/**
* @brief Implements weapon projectile (e.g. molotovs, RPGs etc.)
*/
class ProjectileObject : public GameObject {
class ProjectileObject final : public GameObject {
public:
enum ProjectileType {
Grenade,

View File

@ -25,7 +25,7 @@ constexpr float kVehicleMaxExitVelocity = 0.15f;
/**
* A raycaster that will ignore the body of the vehicle when casting rays
*/
class VehicleRaycaster : public btVehicleRaycaster {
class VehicleRaycaster final : public btVehicleRaycaster {
btDynamicsWorld* _world;
VehicleObject* _vehicle;
@ -59,7 +59,7 @@ public:
}
};
class VehiclePartMotionState : public btMotionState {
class VehiclePartMotionState final : public btMotionState {
public:
VehiclePartMotionState(VehicleObject* object, VehicleObject::Part* part)
: m_object(object), m_part(part) {

View File

@ -30,7 +30,7 @@ class btHingeConstraint;
* @class VehicleObject
* Implements Vehicle behaviours.
*/
class VehicleObject : public GameObject, public ClumpObject {
class VehicleObject final : public GameObject, public ClumpObject {
private:
float steerAngle{0.f};
float throttle{0.f};

View File

@ -17,7 +17,7 @@ class DrawBuffer;
class GameRenderer;
class GeometryBuffer;
class DebugDraw : public btIDebugDraw {
class DebugDraw final : public btIDebugDraw {
public:
DebugDraw();
~DebugDraw() override;

View File

@ -245,9 +245,9 @@ protected:
SceneUniformData lastSceneData{};
};
class OpenGLRenderer : public Renderer {
class OpenGLRenderer final : public Renderer {
public:
class OpenGLShaderProgram : public ShaderProgram {
class OpenGLShaderProgram final : public ShaderProgram {
GLuint program;
std::map<std::string, GLint> uniforms;

View File

@ -19,7 +19,7 @@
class PlayerController;
class RWGame : public GameBase {
class RWGame final : public GameBase {
GameData data;
GameRenderer renderer;
DebugDraw debug;

View File

@ -3,7 +3,7 @@
#include "State.hpp"
class BenchmarkState : public State {
class BenchmarkState final : public State {
struct TrackPoint {
float time;
glm::vec3 position{};

View File

@ -3,7 +3,7 @@
#include "State.hpp"
class DebugState : public State {
class DebugState final : public State {
ViewCamera _debugCam;
glm::vec3 _movement{};
glm::vec2 _debugLook{};

View File

@ -6,7 +6,7 @@
class GameObject;
class PlayerController;
class IngameState : public State {
class IngameState final : public State {
enum CameraMode {
CAMERA_CLOSE = 0,
CAMERA_NORMAL = 1,

View File

@ -4,7 +4,7 @@
#include <functional>
class LoadingState : public State {
class LoadingState final : public State {
std::function<void(void)> complete;
public:

View File

@ -3,7 +3,7 @@
#include "StateManager.hpp"
class MenuState : public State {
class MenuState final : public State {
public:
MenuState(RWGame* game);

View File

@ -3,7 +3,7 @@
#include "StateManager.hpp"
class PauseState : public State {
class PauseState final : public State {
public:
PauseState(RWGame* game);