mirror of https://github.com/OpenRCT2/OpenRCT2.git
Mark classes as final
This may hint compiler to de-virtualise some calls.
This commit is contained in:
parent
4b92e5e820
commit
71d0861be1
|
@ -25,7 +25,7 @@ extern "C"
|
|||
/**
|
||||
* Class for enumerating and retrieving values for a set of command line arguments.
|
||||
*/
|
||||
class CommandLineArgEnumerator
|
||||
class CommandLineArgEnumerator final
|
||||
{
|
||||
private:
|
||||
const char * const * _arguments;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "../common.h"
|
||||
|
||||
struct file_info;
|
||||
class FileEnumerator
|
||||
class FileEnumerator final
|
||||
{
|
||||
private:
|
||||
struct DirectoryState
|
||||
|
|
|
@ -30,7 +30,7 @@ enum
|
|||
/**
|
||||
* A stream for reading and writing to files. Wraps an SDL_RWops, SDL2's cross platform file stream.
|
||||
*/
|
||||
class FileStream : public IStream
|
||||
class FileStream final : public IStream
|
||||
{
|
||||
private:
|
||||
SDL_RWops * _file;
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace Json
|
|||
void WriteToFile(const utf8 * path, const json_t * json, size_t flags = 0);
|
||||
}
|
||||
|
||||
class JsonException : public Exception
|
||||
class JsonException final : public Exception
|
||||
{
|
||||
private:
|
||||
json_error_t _jsonError = { 0 };
|
||||
|
|
|
@ -29,7 +29,7 @@ enum MEMORY_ACCESS
|
|||
/**
|
||||
* A stream for reading and writing to files. Wraps an SDL_RWops, SDL2's cross platform file stream.
|
||||
*/
|
||||
class MemoryStream : public IStream
|
||||
class MemoryStream final : public IStream
|
||||
{
|
||||
private:
|
||||
uint16 _access;
|
||||
|
|
|
@ -24,7 +24,7 @@ extern "C"
|
|||
/**
|
||||
* Class to accuately measure elapsed time with high precision.
|
||||
*/
|
||||
class Stopwatch
|
||||
class Stopwatch final
|
||||
{
|
||||
private:
|
||||
/** Number of ticks in a second. */
|
||||
|
|
|
@ -45,7 +45,7 @@ struct DirtyGrid
|
|||
uint8 * Blocks;
|
||||
};
|
||||
|
||||
class RainDrawer : public IRainDrawer
|
||||
class RainDrawer final : public IRainDrawer
|
||||
{
|
||||
private:
|
||||
struct RainPixel
|
||||
|
@ -156,7 +156,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class SoftwareDrawingContext : public IDrawingContext
|
||||
class SoftwareDrawingContext final : public IDrawingContext
|
||||
{
|
||||
private:
|
||||
SoftwareDrawingEngine * _engine;
|
||||
|
@ -179,7 +179,7 @@ public:
|
|||
void SetDPI(rct_drawpixelinfo * dpi);
|
||||
};
|
||||
|
||||
class SoftwareDrawingEngine : public IDrawingEngine
|
||||
class SoftwareDrawingEngine final : public IDrawingEngine
|
||||
{
|
||||
private:
|
||||
bool _hardwareDisplay;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "GLSLTypes.h"
|
||||
#include "OpenGLShaderProgram.h"
|
||||
|
||||
class CopyFramebufferShader : public OpenGLShaderProgram
|
||||
class CopyFramebufferShader final : public OpenGLShaderProgram
|
||||
{
|
||||
private:
|
||||
GLuint uScreenSize;
|
||||
|
|
|
@ -36,7 +36,7 @@ struct DrawImageInstance {
|
|||
int mask;
|
||||
};
|
||||
|
||||
class DrawImageShader : public OpenGLShaderProgram
|
||||
class DrawImageShader final : public OpenGLShaderProgram
|
||||
{
|
||||
private:
|
||||
GLuint uScreenSize;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "GLSLTypes.h"
|
||||
#include "OpenGLShaderProgram.h"
|
||||
|
||||
class DrawLineShader : public OpenGLShaderProgram
|
||||
class DrawLineShader final : public OpenGLShaderProgram
|
||||
{
|
||||
private:
|
||||
GLuint uScreenSize;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class OpenGLFramebuffer;
|
||||
|
||||
class FillRectShader : public OpenGLShaderProgram
|
||||
class FillRectShader final : public OpenGLShaderProgram
|
||||
{
|
||||
private:
|
||||
GLuint uScreenSize;
|
||||
|
|
|
@ -30,7 +30,7 @@ class OpenGLFramebuffer;
|
|||
* When you need to bind the current frame to a shader, call SwapCopy and
|
||||
* then bind the value of GetSourceTexture to your shader.
|
||||
*/
|
||||
class SwapFramebuffer
|
||||
class SwapFramebuffer final
|
||||
{
|
||||
private:
|
||||
sint32 _width;
|
||||
|
|
|
@ -73,7 +73,7 @@ struct CachedTextureInfo
|
|||
// Represents a texture atlas that images of a given maximum size can be allocated from
|
||||
// Atlases are all stored in the same 2D texture array, occupying the specified index
|
||||
// Slots in atlases are always squares.
|
||||
class Atlas
|
||||
class Atlas final
|
||||
{
|
||||
private:
|
||||
GLuint _index;
|
||||
|
@ -183,7 +183,7 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
class TextureCache
|
||||
class TextureCache final
|
||||
{
|
||||
private:
|
||||
bool _atlasesTextureInitialised = false;
|
||||
|
|
|
@ -61,7 +61,7 @@ struct ScenarioOverride
|
|||
};
|
||||
};
|
||||
|
||||
class LanguagePack : public ILanguagePack
|
||||
class LanguagePack final : public ILanguagePack
|
||||
{
|
||||
private:
|
||||
uint16 _id;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include <string>
|
||||
#include "../common.h"
|
||||
|
||||
class NetworkAction
|
||||
class NetworkAction final
|
||||
{
|
||||
public:
|
||||
rct_string_id Name;
|
||||
|
@ -28,7 +28,7 @@ public:
|
|||
std::vector<int> Commands;
|
||||
};
|
||||
|
||||
class NetworkActions
|
||||
class NetworkActions final
|
||||
{
|
||||
public:
|
||||
static const std::vector<NetworkAction> Actions;
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
class NetworkPlayer;
|
||||
|
||||
class NetworkConnection
|
||||
class NetworkConnection final
|
||||
{
|
||||
public:
|
||||
ITcpSocket * Socket = nullptr;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "NetworkPacket.h"
|
||||
#include "../common.h"
|
||||
|
||||
class NetworkGroup
|
||||
class NetworkGroup final
|
||||
{
|
||||
public:
|
||||
std::array<uint8, 8> ActionsAllowed;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
typedef struct evp_pkey_st EVP_PKEY;
|
||||
typedef struct evp_pkey_ctx_st EVP_PKEY_CTX;
|
||||
|
||||
class NetworkKey
|
||||
class NetworkKey final
|
||||
{
|
||||
public:
|
||||
NetworkKey();
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "NetworkTypes.h"
|
||||
#include "../common.h"
|
||||
|
||||
class NetworkPacket
|
||||
class NetworkPacket final
|
||||
{
|
||||
public:
|
||||
uint16 size;
|
||||
|
|
|
@ -26,7 +26,7 @@ extern "C"
|
|||
|
||||
class NetworkPacket;
|
||||
|
||||
class NetworkPlayer
|
||||
class NetworkPlayer final
|
||||
{
|
||||
public:
|
||||
uint8 id = 0;
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include <map>
|
||||
#include <string>
|
||||
|
||||
class NetworkUser
|
||||
class NetworkUser final
|
||||
{
|
||||
public:
|
||||
std::string Hash;
|
||||
|
@ -37,7 +37,7 @@ public:
|
|||
json_t * ToJson(json_t * json) const;
|
||||
};
|
||||
|
||||
class NetworkUserManager
|
||||
class NetworkUserManager final
|
||||
{
|
||||
public:
|
||||
~NetworkUserManager();
|
||||
|
|
|
@ -23,13 +23,13 @@ extern "C"
|
|||
#include "../world/scenery.h"
|
||||
}
|
||||
|
||||
class BannerObject : public SceneryObject
|
||||
class BannerObject final : public SceneryObject
|
||||
{
|
||||
private:
|
||||
rct_scenery_entry _legacyType = { 0 };
|
||||
|
||||
public:
|
||||
explicit BannerObject(const rct_object_entry &entry) : SceneryObject(entry) { };
|
||||
explicit BannerObject(const rct_object_entry &entry) : SceneryObject(entry) { }
|
||||
|
||||
void * GetLegacyData() override { return &_legacyType; }
|
||||
|
||||
|
|
|
@ -23,13 +23,13 @@ extern "C"
|
|||
#include "../world/entrance.h"
|
||||
}
|
||||
|
||||
class EntranceObject : public Object
|
||||
class EntranceObject final : public Object
|
||||
{
|
||||
private:
|
||||
rct_entrance_type _legacyType = { 0 };
|
||||
|
||||
public:
|
||||
explicit EntranceObject(const rct_object_entry &entry) : Object(entry) { };
|
||||
explicit EntranceObject(const rct_object_entry &entry) : Object(entry) { }
|
||||
|
||||
void * GetLegacyData() override { return &_legacyType; }
|
||||
|
||||
|
|
|
@ -23,13 +23,13 @@ extern "C"
|
|||
#include "../world/scenery.h"
|
||||
}
|
||||
|
||||
class FootpathItemObject : public SceneryObject
|
||||
class FootpathItemObject final : public SceneryObject
|
||||
{
|
||||
private:
|
||||
rct_scenery_entry _legacyType = { 0 };
|
||||
|
||||
public:
|
||||
explicit FootpathItemObject(const rct_object_entry &entry) : SceneryObject(entry) { };
|
||||
explicit FootpathItemObject(const rct_object_entry &entry) : SceneryObject(entry) { }
|
||||
|
||||
void * GetLegacyData() override { return &_legacyType; }
|
||||
|
||||
|
|
|
@ -23,13 +23,13 @@ extern "C"
|
|||
#include "../world/footpath.h"
|
||||
}
|
||||
|
||||
class FootpathObject : public Object
|
||||
class FootpathObject final : public Object
|
||||
{
|
||||
private:
|
||||
rct_footpath_entry _legacyType = { 0 };
|
||||
|
||||
public:
|
||||
explicit FootpathObject(const rct_object_entry &entry) : Object(entry) { };
|
||||
explicit FootpathObject(const rct_object_entry &entry) : Object(entry) { }
|
||||
|
||||
void * GetLegacyData() override { return &_legacyType; }
|
||||
|
||||
|
|
|
@ -39,5 +39,5 @@ public:
|
|||
|
||||
void Read(IReadObjectContext * context, IStream * stream);
|
||||
const rct_g1_element * GetImages() const { return _entries.data(); }
|
||||
uint32 GetCount() const { return (uint32)_entries.size(); };
|
||||
};
|
||||
uint32 GetCount() const { return (uint32)_entries.size(); }
|
||||
};
|
||||
|
|
|
@ -23,7 +23,7 @@ extern "C"
|
|||
#include "../world/scenery.h"
|
||||
}
|
||||
|
||||
class LargeSceneryObject : public SceneryObject
|
||||
class LargeSceneryObject final : public SceneryObject
|
||||
{
|
||||
private:
|
||||
rct_scenery_entry _legacyType = { 0 };
|
||||
|
@ -32,7 +32,7 @@ private:
|
|||
rct_large_scenery_tile * _tiles = nullptr;
|
||||
|
||||
public:
|
||||
explicit LargeSceneryObject(const rct_object_entry &entry) : SceneryObject(entry) { };
|
||||
explicit LargeSceneryObject(const rct_object_entry &entry) : SceneryObject(entry) { }
|
||||
~LargeSceneryObject();
|
||||
|
||||
void * GetLegacyData() override { return &_legacyType; }
|
||||
|
|
|
@ -23,7 +23,7 @@ extern "C"
|
|||
#include "../ride/ride.h"
|
||||
}
|
||||
|
||||
class RideObject : public Object
|
||||
class RideObject final : public Object
|
||||
{
|
||||
private:
|
||||
rct_ride_entry _legacyType = { 0 };
|
||||
|
@ -31,7 +31,7 @@ private:
|
|||
sint8 * _peepLoadingPositions[4] = { nullptr };
|
||||
|
||||
public:
|
||||
explicit RideObject(const rct_object_entry &entry) : Object(entry) { };
|
||||
explicit RideObject(const rct_object_entry &entry) : Object(entry) { }
|
||||
~RideObject();
|
||||
|
||||
void * GetLegacyData() override { return &_legacyType; }
|
||||
|
|
|
@ -25,7 +25,7 @@ extern "C"
|
|||
|
||||
struct ObjectRepositoryItem;
|
||||
|
||||
class SceneryGroupObject : public Object
|
||||
class SceneryGroupObject final : public Object
|
||||
{
|
||||
private:
|
||||
rct_scenery_set_entry _legacyType = { 0 };
|
||||
|
@ -33,7 +33,7 @@ private:
|
|||
rct_object_entry * _items = nullptr;
|
||||
|
||||
public:
|
||||
explicit SceneryGroupObject(const rct_object_entry &entry) : Object(entry) { };
|
||||
explicit SceneryGroupObject(const rct_object_entry &entry) : Object(entry) { }
|
||||
~SceneryGroupObject();
|
||||
|
||||
void * GetLegacyData() override { return &_legacyType; }
|
||||
|
|
|
@ -23,14 +23,14 @@ extern "C"
|
|||
#include "../world/scenery.h"
|
||||
}
|
||||
|
||||
class SmallSceneryObject : public SceneryObject
|
||||
class SmallSceneryObject final : public SceneryObject
|
||||
{
|
||||
private:
|
||||
rct_scenery_entry _legacyType = { 0 };
|
||||
uint8 * _var10data = nullptr;
|
||||
|
||||
public:
|
||||
explicit SmallSceneryObject(const rct_object_entry &entry) : SceneryObject(entry) { };
|
||||
explicit SmallSceneryObject(const rct_object_entry &entry) : SceneryObject(entry) { }
|
||||
~SmallSceneryObject();
|
||||
|
||||
void * GetLegacyData() override { return &_legacyType; }
|
||||
|
|
|
@ -23,13 +23,13 @@ extern "C"
|
|||
#include "../scenario.h"
|
||||
}
|
||||
|
||||
class StexObject : public Object
|
||||
class StexObject final : public Object
|
||||
{
|
||||
private:
|
||||
rct_stex_entry _legacyType = { 0 };
|
||||
|
||||
public:
|
||||
explicit StexObject(const rct_object_entry &entry) : Object(entry) { };
|
||||
explicit StexObject(const rct_object_entry &entry) : Object(entry) { }
|
||||
|
||||
void * GetLegacyData() override { return &_legacyType; }
|
||||
|
||||
|
|
|
@ -23,13 +23,13 @@ extern "C"
|
|||
#include "../world/scenery.h"
|
||||
}
|
||||
|
||||
class WallObject : public SceneryObject
|
||||
class WallObject final : public SceneryObject
|
||||
{
|
||||
private:
|
||||
rct_scenery_entry _legacyType = { 0 };
|
||||
|
||||
public:
|
||||
explicit WallObject(const rct_object_entry &entry) : SceneryObject(entry) { };
|
||||
explicit WallObject(const rct_object_entry &entry) : SceneryObject(entry) { }
|
||||
|
||||
void * GetLegacyData() override { return &_legacyType; }
|
||||
|
||||
|
|
|
@ -23,13 +23,13 @@ extern "C"
|
|||
#include "../world/water.h"
|
||||
}
|
||||
|
||||
class WaterObject : public Object
|
||||
class WaterObject final : public Object
|
||||
{
|
||||
private:
|
||||
rct_water_type _legacyType = { 0 };
|
||||
|
||||
public:
|
||||
explicit WaterObject(const rct_object_entry &entry) : Object(entry) { };
|
||||
explicit WaterObject(const rct_object_entry &entry) : Object(entry) { }
|
||||
|
||||
void * GetLegacyData() override { return &_legacyType; }
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ extern "C"
|
|||
/**
|
||||
* Class to export RollerCoaster Tycoon 2 scenarios (*.SC6) and saved games (*.SV6).
|
||||
*/
|
||||
class S6Exporter
|
||||
class S6Exporter final
|
||||
{
|
||||
public:
|
||||
bool ExportObjects;
|
||||
|
|
|
@ -26,7 +26,7 @@ extern "C"
|
|||
/**
|
||||
* Class to import RollerCoaster Tycoon 2 scenarios (*.SC6) and saved games (*.SV6).
|
||||
*/
|
||||
class S6Importer
|
||||
class S6Importer final
|
||||
{
|
||||
public:
|
||||
bool FixIssues;
|
||||
|
|
Loading…
Reference in New Issue