diff --git a/src/openrct2-ui/UiContext.h b/src/openrct2-ui/UiContext.h index 7728ae9b15..9dc51b9524 100644 --- a/src/openrct2-ui/UiContext.h +++ b/src/openrct2-ui/UiContext.h @@ -17,26 +17,27 @@ struct SDL_Window; namespace OpenRCT2 { - INTERFACE IContext; - INTERFACE IPlatformEnvironment; + struct IContext; + struct IPlatformEnvironment; namespace Ui { struct FileDialogDesc; class InGameConsole; - INTERFACE IUiContext; + struct IUiContext; - INTERFACE IPlatformUiContext + struct IPlatformUiContext { virtual ~IPlatformUiContext() = default; - virtual void SetWindowIcon(SDL_Window * window) abstract; + virtual void SetWindowIcon(SDL_Window* window) abstract; virtual bool IsSteamOverlayAttached() abstract; - virtual void ShowMessageBox(SDL_Window * window, const std::string& message) abstract; + virtual void ShowMessageBox(SDL_Window* window, const std::string& message) abstract; virtual void OpenFolder(const std::string& path) abstract; + virtual void OpenURL(const std::string& url) abstract; - virtual std::string ShowFileDialog(SDL_Window * window, const FileDialogDesc& desc) abstract; - virtual std::string ShowDirectoryDialog(SDL_Window * window, const std::string& title) abstract; + virtual std::string ShowFileDialog(SDL_Window* window, const FileDialogDesc& desc) abstract; + virtual std::string ShowDirectoryDialog(SDL_Window* window, const std::string& title) abstract; }; std::unique_ptr CreateUiContext(const std::shared_ptr& env); diff --git a/src/openrct2-ui/WindowManager.h b/src/openrct2-ui/WindowManager.h index 5bb0f36fe8..e75d2411de 100644 --- a/src/openrct2-ui/WindowManager.h +++ b/src/openrct2-ui/WindowManager.h @@ -13,7 +13,7 @@ namespace OpenRCT2::Ui { - INTERFACE IWindowManager; + struct IWindowManager; IWindowManager* CreateWindowManager(); } // namespace OpenRCT2::Ui diff --git a/src/openrct2-ui/audio/AudioContext.h b/src/openrct2-ui/audio/AudioContext.h index 03ad0ece07..0fe4a17def 100644 --- a/src/openrct2-ui/audio/AudioContext.h +++ b/src/openrct2-ui/audio/AudioContext.h @@ -21,7 +21,7 @@ using SpeexResamplerState = struct SpeexResamplerState_; namespace OpenRCT2::Audio { struct AudioFormat; - INTERFACE IAudioContext; + struct IAudioContext; #pragma pack(push, 1) struct WaveFormat @@ -48,16 +48,16 @@ namespace OpenRCT2::Audio assert_struct_size(WaveFormatEx, 18); #pragma pack(pop) - INTERFACE ISDLAudioSource : public IAudioSource + struct ISDLAudioSource : public IAudioSource { [[nodiscard]] virtual AudioFormat GetFormat() const abstract; }; - INTERFACE ISDLAudioChannel : public IAudioChannel + struct ISDLAudioChannel : public IAudioChannel { [[nodiscard]] virtual AudioFormat GetFormat() const abstract; [[nodiscard]] virtual SpeexResamplerState* GetResampler() const abstract; - virtual void SetResampler(SpeexResamplerState * value) abstract; + virtual void SetResampler(SpeexResamplerState* value) abstract; }; namespace AudioSource diff --git a/src/openrct2-ui/drawing/engines/DrawingEngineFactory.hpp b/src/openrct2-ui/drawing/engines/DrawingEngineFactory.hpp index c40c745bd9..d57fd421fc 100644 --- a/src/openrct2-ui/drawing/engines/DrawingEngineFactory.hpp +++ b/src/openrct2-ui/drawing/engines/DrawingEngineFactory.hpp @@ -19,7 +19,7 @@ namespace OpenRCT2 { using namespace OpenRCT2::Drawing; - INTERFACE IUiContext; + struct IUiContext; std::unique_ptr CreateSoftwareDrawingEngine(const std::shared_ptr& uiContext); std::unique_ptr CreateHardwareDisplayDrawingEngine(const std::shared_ptr& uiContext); diff --git a/src/openrct2-ui/input/KeyboardShortcuts.h b/src/openrct2-ui/input/KeyboardShortcuts.h index ca7cacbf66..d3d8cee1a5 100644 --- a/src/openrct2-ui/input/KeyboardShortcuts.h +++ b/src/openrct2-ui/input/KeyboardShortcuts.h @@ -123,7 +123,7 @@ enum KeyboardShortcut namespace OpenRCT2 { - INTERFACE IPlatformEnvironment; + struct IPlatformEnvironment; namespace Input { diff --git a/src/openrct2-ui/title/TitleSequencePlayer.h b/src/openrct2-ui/title/TitleSequencePlayer.h index 5585b1018e..77699d47fa 100644 --- a/src/openrct2-ui/title/TitleSequencePlayer.h +++ b/src/openrct2-ui/title/TitleSequencePlayer.h @@ -12,8 +12,8 @@ #include #include -INTERFACE ITitleSequencePlayer; -INTERFACE IScenarioRepository; +struct ITitleSequencePlayer; +struct IScenarioRepository; namespace OpenRCT2 { diff --git a/src/openrct2/Context.h b/src/openrct2/Context.h index 8c2659cb36..9111642757 100644 --- a/src/openrct2/Context.h +++ b/src/openrct2/Context.h @@ -15,15 +15,15 @@ #include #include -INTERFACE IObjectManager; -INTERFACE IObjectRepository; -INTERFACE IScenarioRepository; +struct IObjectManager; +struct IObjectRepository; +struct IScenarioRepository; namespace OpenRCT2 { - INTERFACE IStream; + struct IStream; } -INTERFACE ITrackDesignRepository; -INTERFACE IGameStateSnapshots; +struct ITrackDesignRepository; +struct IGameStateSnapshots; class Intent; struct rct_window; @@ -70,17 +70,17 @@ namespace OpenRCT2 { class GameState; - INTERFACE IPlatformEnvironment; - INTERFACE IReplayManager; + struct IPlatformEnvironment; + struct IReplayManager; namespace Audio { - INTERFACE IAudioContext; + struct IAudioContext; } namespace Drawing { - INTERFACE IDrawingEngine; + struct IDrawingEngine; } namespace Localisation @@ -95,18 +95,18 @@ namespace OpenRCT2 namespace Ui { - INTERFACE IUiContext; + struct IUiContext; } namespace Paint { - INTERFACE Painter; + struct Painter; } /** * Represents an instance of OpenRCT2 and can be used to get various services. */ - INTERFACE IContext + struct IContext { virtual ~IContext() = default; @@ -134,8 +134,8 @@ namespace OpenRCT2 virtual void InitialiseDrawingEngine() abstract; virtual void DisposeDrawingEngine() abstract; virtual bool LoadParkFromFile(const std::string& path, bool loadTitleScreenOnFail = false) abstract; - virtual bool LoadParkFromStream(IStream * stream, const std::string& path, bool loadTitleScreenFirstOnFail = false) - abstract; + virtual bool LoadParkFromStream( + IStream* stream, const std::string& path, bool loadTitleScreenFirstOnFail = false) abstract; virtual void WriteLine(const std::string& s) abstract; virtual void Finish() abstract; virtual void Quit() abstract; diff --git a/src/openrct2/FileClassifier.h b/src/openrct2/FileClassifier.h index c8736bb10b..ecf9ced3b2 100644 --- a/src/openrct2/FileClassifier.h +++ b/src/openrct2/FileClassifier.h @@ -27,7 +27,7 @@ enum namespace OpenRCT2 { - INTERFACE IStream; + struct IStream; } enum class FILE_TYPE diff --git a/src/openrct2/GameStateSnapshots.h b/src/openrct2/GameStateSnapshots.h index 1b27801c3c..e978851a62 100644 --- a/src/openrct2/GameStateSnapshots.h +++ b/src/openrct2/GameStateSnapshots.h @@ -60,7 +60,7 @@ struct GameStateCompareData_t * as it may become invalid at any time when a snapshot is created, rather Link the snapshot * to a specific tick which can be obtained by that later again assuming its still valid. */ -INTERFACE IGameStateSnapshots +struct IGameStateSnapshots { virtual ~IGameStateSnapshots() = default; @@ -77,12 +77,12 @@ INTERFACE IGameStateSnapshots /* * Links the snapshot to a specific game tick. */ - virtual void LinkSnapshot(GameStateSnapshot_t & snapshot, uint32_t tick, uint32_t srand0) = 0; + virtual void LinkSnapshot(GameStateSnapshot_t& snapshot, uint32_t tick, uint32_t srand0) = 0; /* * This will fill the snapshot with the current game state in a compact form. */ - virtual void Capture(GameStateSnapshot_t & snapshot) = 0; + virtual void Capture(GameStateSnapshot_t& snapshot) = 0; /* * Returns the snapshot for a given tick in the history, nullptr if not found. @@ -92,7 +92,7 @@ INTERFACE IGameStateSnapshots /* * Serialisation of GameStateSnapshot_t */ - virtual void SerialiseSnapshot(GameStateSnapshot_t & snapshot, DataSerialiser & serialiser) const = 0; + virtual void SerialiseSnapshot(GameStateSnapshot_t& snapshot, DataSerialiser& serialiser) const = 0; /* * Compares two states resulting GameStateCompareData_t with all mismatches stored. diff --git a/src/openrct2/ParkImporter.h b/src/openrct2/ParkImporter.h index 6e5707d9b9..f887979b63 100644 --- a/src/openrct2/ParkImporter.h +++ b/src/openrct2/ParkImporter.h @@ -17,12 +17,13 @@ #include #include -INTERFACE IObjectManager; -INTERFACE IObjectRepository; +struct IObjectManager; +struct IObjectRepository; namespace OpenRCT2 { - INTERFACE IStream; + struct IStream; } + struct scenario_index_entry; struct ParkLoadResult final @@ -39,7 +40,7 @@ public: /** * Interface to import scenarios and saved games. */ -INTERFACE IParkImporter +struct IParkImporter { public: virtual ~IParkImporter() = default; @@ -48,10 +49,10 @@ public: virtual ParkLoadResult LoadSavedGame(const utf8* path, bool skipObjectCheck = false) abstract; virtual ParkLoadResult LoadScenario(const utf8* path, bool skipObjectCheck = false) abstract; virtual ParkLoadResult LoadFromStream( - OpenRCT2::IStream * stream, bool isScenario, bool skipObjectCheck = false, const utf8* path = String::Empty) abstract; + OpenRCT2::IStream* stream, bool isScenario, bool skipObjectCheck = false, const utf8* path = String::Empty) abstract; virtual void Import() abstract; - virtual bool GetDetails(scenario_index_entry * dst) abstract; + virtual bool GetDetails(scenario_index_entry* dst) abstract; }; namespace ParkImporter diff --git a/src/openrct2/PlatformEnvironment.h b/src/openrct2/PlatformEnvironment.h index 6a84f00c65..fdd1dcdeb9 100644 --- a/src/openrct2/PlatformEnvironment.h +++ b/src/openrct2/PlatformEnvironment.h @@ -72,7 +72,7 @@ namespace OpenRCT2 /** * Interface for retrieving paths and other environment related things. */ - INTERFACE IPlatformEnvironment + struct IPlatformEnvironment { virtual ~IPlatformEnvironment() = default; diff --git a/src/openrct2/ReplayManager.h b/src/openrct2/ReplayManager.h index f7fa785dd9..d635147008 100644 --- a/src/openrct2/ReplayManager.h +++ b/src/openrct2/ReplayManager.h @@ -32,7 +32,7 @@ namespace OpenRCT2 std::string FilePath; }; - INTERFACE IReplayManager + struct IReplayManager { public: enum class RecordType @@ -56,7 +56,7 @@ namespace OpenRCT2 const std::string& name, uint32_t maxTicks = k_MaxReplayTicks, RecordType rt = RecordType::NORMAL) = 0; virtual bool StopRecording(bool discard = false) = 0; - virtual bool GetCurrentReplayInfo(ReplayRecordInfo & info) const = 0; + virtual bool GetCurrentReplayInfo(ReplayRecordInfo& info) const = 0; virtual bool StartPlayback(const std::string& file) = 0; virtual bool IsPlaybackStateMismatching() const = 0; diff --git a/src/openrct2/TrackImporter.h b/src/openrct2/TrackImporter.h index 2ce9ef54a7..677228dc1a 100644 --- a/src/openrct2/TrackImporter.h +++ b/src/openrct2/TrackImporter.h @@ -20,13 +20,13 @@ /** * Interface to import scenarios and saved games. */ -INTERFACE ITrackImporter +struct ITrackImporter { public: virtual ~ITrackImporter() = default; virtual bool Load(const utf8* path) abstract; - virtual bool LoadFromStream(OpenRCT2::IStream * stream) abstract; + virtual bool LoadFromStream(OpenRCT2::IStream* stream) abstract; virtual std::unique_ptr Import() abstract; }; diff --git a/src/openrct2/audio/AudioChannel.h b/src/openrct2/audio/AudioChannel.h index 02e7517634..ec8619f622 100644 --- a/src/openrct2/audio/AudioChannel.h +++ b/src/openrct2/audio/AudioChannel.h @@ -14,13 +14,13 @@ namespace OpenRCT2::Audio { - INTERFACE IAudioSource; + struct IAudioSource; /** * Represents an audio channel that represents an audio source * and a number of properties such as volume, pan and loop information. */ - INTERFACE IAudioChannel + struct IAudioChannel { virtual ~IAudioChannel() = default; @@ -62,7 +62,7 @@ namespace OpenRCT2::Audio virtual bool IsPlaying() const abstract; - virtual void Play(IAudioSource * source, int32_t loop = 0) abstract; + virtual void Play(IAudioSource* source, int32_t loop = 0) abstract; virtual void UpdateOldVolume() abstract; virtual size_t Read(void* dst, size_t len) abstract; diff --git a/src/openrct2/audio/AudioContext.h b/src/openrct2/audio/AudioContext.h index 114a166045..5725503af8 100644 --- a/src/openrct2/audio/AudioContext.h +++ b/src/openrct2/audio/AudioContext.h @@ -17,14 +17,14 @@ namespace OpenRCT2::Audio { - INTERFACE IAudioChannel; - INTERFACE IAudioMixer; - INTERFACE IAudioSource; + struct IAudioChannel; + struct IAudioMixer; + struct IAudioSource; /** * Audio services for playing music and sound effects. */ - INTERFACE IAudioContext + struct IAudioContext { virtual ~IAudioContext() = default; diff --git a/src/openrct2/audio/AudioMixer.h b/src/openrct2/audio/AudioMixer.h index 0e36533c26..1d94d635ef 100644 --- a/src/openrct2/audio/AudioMixer.h +++ b/src/openrct2/audio/AudioMixer.h @@ -26,13 +26,13 @@ namespace OpenRCT2::Audio TitleMusic, }; - INTERFACE IAudioSource; - INTERFACE IAudioChannel; + struct IAudioSource; + struct IAudioChannel; /** * Provides an audio stream by mixing multiple audio channels together. */ - INTERFACE IAudioMixer + struct IAudioMixer { virtual ~IAudioMixer() = default; @@ -40,8 +40,8 @@ namespace OpenRCT2::Audio virtual void Close() abstract; virtual void Lock() abstract; virtual void Unlock() abstract; - virtual IAudioChannel* Play(IAudioSource * source, int32_t loop, bool deleteondone, bool deletesourceondone) abstract; - virtual void Stop(IAudioChannel * channel) abstract; + virtual IAudioChannel* Play(IAudioSource* source, int32_t loop, bool deleteondone, bool deletesourceondone) abstract; + virtual void Stop(IAudioChannel* channel) abstract; virtual bool LoadMusic(size_t pathid) abstract; virtual void SetVolume(float volume) abstract; diff --git a/src/openrct2/audio/AudioSource.h b/src/openrct2/audio/AudioSource.h index 5c6b860edc..98a5350e44 100644 --- a/src/openrct2/audio/AudioSource.h +++ b/src/openrct2/audio/AudioSource.h @@ -17,7 +17,7 @@ namespace OpenRCT2::Audio /** * Represents a readable source of audio PCM data. */ - INTERFACE IAudioSource + struct IAudioSource { virtual ~IAudioSource() = default; diff --git a/src/openrct2/common.h b/src/openrct2/common.h index ed6ec9a048..dc284a5f3c 100644 --- a/src/openrct2/common.h +++ b/src/openrct2/common.h @@ -165,9 +165,6 @@ using rct_string_id = uint16_t; (x) = nullptr; \ } while (false) -#ifndef INTERFACE -# define INTERFACE struct -#endif #define abstract = 0 #if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__)) diff --git a/src/openrct2/config/ConfigEnum.hpp b/src/openrct2/config/ConfigEnum.hpp index 96fc4289e0..d598047c8d 100644 --- a/src/openrct2/config/ConfigEnum.hpp +++ b/src/openrct2/config/ConfigEnum.hpp @@ -27,7 +27,7 @@ template struct ConfigEnumEntry } }; -template INTERFACE IConfigEnum +template struct IConfigEnum { virtual ~IConfigEnum() = default; virtual std::string GetName(T value) const abstract; diff --git a/src/openrct2/config/IniReader.hpp b/src/openrct2/config/IniReader.hpp index e65ec0a13c..741c090525 100644 --- a/src/openrct2/config/IniReader.hpp +++ b/src/openrct2/config/IniReader.hpp @@ -15,12 +15,12 @@ namespace OpenRCT2 { - INTERFACE IStream; + struct IStream; } template struct IConfigEnum; -INTERFACE IIniReader +struct IIniReader { virtual ~IIniReader() = default; diff --git a/src/openrct2/config/IniWriter.hpp b/src/openrct2/config/IniWriter.hpp index 54400fc954..644974f06b 100644 --- a/src/openrct2/config/IniWriter.hpp +++ b/src/openrct2/config/IniWriter.hpp @@ -15,12 +15,12 @@ namespace OpenRCT2 { - INTERFACE IStream; + struct IStream; } template struct IConfigEnum; -INTERFACE IIniWriter +struct IIniWriter { virtual ~IIniWriter() = default; diff --git a/src/openrct2/core/FileScanner.h b/src/openrct2/core/FileScanner.h index 62268e0eec..f3136e48f4 100644 --- a/src/openrct2/core/FileScanner.h +++ b/src/openrct2/core/FileScanner.h @@ -21,7 +21,7 @@ struct FileInfo uint64_t LastModified; }; -INTERFACE IFileScanner +struct IFileScanner { virtual ~IFileScanner() = default; diff --git a/src/openrct2/core/IStream.hpp b/src/openrct2/core/IStream.hpp index 87a7859fb7..b3d729c4d6 100644 --- a/src/openrct2/core/IStream.hpp +++ b/src/openrct2/core/IStream.hpp @@ -36,7 +36,7 @@ namespace OpenRCT2 * Represents a stream that can be read or written to. Implemented by types such as FileStream, NetworkStream or * MemoryStream. */ - INTERFACE IStream + struct IStream { /////////////////////////////////////////////////////////////////////////// // Interface methods @@ -111,7 +111,7 @@ namespace OpenRCT2 /** * Reads the size of the given type from the stream directly into the given address. */ - template void Read(T * value) + template void Read(T* value) { // Selects the best path at compile time if constexpr (sizeof(T) == 1) @@ -197,7 +197,7 @@ namespace OpenRCT2 return buffer; } - template void WriteArray(T * buffer, size_t count) + template void WriteArray(T* buffer, size_t count) { Write(buffer, sizeof(T) * count); } diff --git a/src/openrct2/core/Registration.hpp b/src/openrct2/core/Registration.hpp index 97da307ef5..d43967db41 100644 --- a/src/openrct2/core/Registration.hpp +++ b/src/openrct2/core/Registration.hpp @@ -17,7 +17,7 @@ namespace OpenRCT2 * Represents a registration of some service which when deleted will be * unregistered. */ - INTERFACE IRegistration + struct IRegistration { virtual ~IRegistration() = default; }; diff --git a/src/openrct2/core/StringReader.hpp b/src/openrct2/core/StringReader.hpp index d2d71e648c..76586e9ff4 100644 --- a/src/openrct2/core/StringReader.hpp +++ b/src/openrct2/core/StringReader.hpp @@ -14,12 +14,12 @@ #include "../util/Util.h" #include "String.hpp" -INTERFACE IStringReader +struct IStringReader { virtual ~IStringReader() = default; - virtual bool TryPeek(codepoint_t * outCodepoint) abstract; - virtual bool TryRead(codepoint_t * outCodepoint) abstract; + virtual bool TryPeek(codepoint_t* outCodepoint) abstract; + virtual bool TryRead(codepoint_t* outCodepoint) abstract; virtual void Skip() abstract; virtual bool CanRead() const abstract; }; diff --git a/src/openrct2/core/Zip.h b/src/openrct2/core/Zip.h index 327ba3e008..1fef4ad894 100644 --- a/src/openrct2/core/Zip.h +++ b/src/openrct2/core/Zip.h @@ -18,7 +18,7 @@ /** * Represents a zip file. */ -INTERFACE IZipArchive +struct IZipArchive { virtual ~IZipArchive() { diff --git a/src/openrct2/drawing/Drawing.h b/src/openrct2/drawing/Drawing.h index 02f7910516..115ee6a4ac 100644 --- a/src/openrct2/drawing/Drawing.h +++ b/src/openrct2/drawing/Drawing.h @@ -22,12 +22,12 @@ struct ScreenLine; struct ScreenRect; namespace OpenRCT2 { - INTERFACE IPlatformEnvironment; + struct IPlatformEnvironment; } namespace OpenRCT2::Drawing { - INTERFACE IDrawingEngine; + struct IDrawingEngine; } struct PaletteBGRA diff --git a/src/openrct2/drawing/IDrawingContext.h b/src/openrct2/drawing/IDrawingContext.h index 50feaa997b..838fd7c3e2 100644 --- a/src/openrct2/drawing/IDrawingContext.h +++ b/src/openrct2/drawing/IDrawingContext.h @@ -14,9 +14,9 @@ namespace OpenRCT2::Drawing { - INTERFACE IDrawingEngine; + struct IDrawingEngine; - INTERFACE IDrawingContext + struct IDrawingContext { virtual ~IDrawingContext() { diff --git a/src/openrct2/drawing/IDrawingEngine.h b/src/openrct2/drawing/IDrawingEngine.h index e811faec91..968421a5ff 100644 --- a/src/openrct2/drawing/IDrawingEngine.h +++ b/src/openrct2/drawing/IDrawingEngine.h @@ -38,15 +38,15 @@ struct GamePalette; namespace OpenRCT2::Ui { - INTERFACE IUiContext; + struct IUiContext; } // namespace OpenRCT2::Ui namespace OpenRCT2::Drawing { enum class DRAWING_ENGINE_TYPE; - INTERFACE IDrawingContext; + struct IDrawingContext; - INTERFACE IDrawingEngine + struct IDrawingEngine { virtual ~IDrawingEngine() { @@ -67,7 +67,7 @@ namespace OpenRCT2::Drawing virtual void CopyRect(int32_t x, int32_t y, int32_t width, int32_t height, int32_t dx, int32_t dy) abstract; virtual std::string Screenshot() abstract; - virtual IDrawingContext* GetDrawingContext(rct_drawpixelinfo * dpi) abstract; + virtual IDrawingContext* GetDrawingContext(rct_drawpixelinfo* dpi) abstract; virtual rct_drawpixelinfo* GetDrawingPixelInfo() abstract; virtual DRAWING_ENGINE_FLAGS GetFlags() abstract; @@ -75,7 +75,7 @@ namespace OpenRCT2::Drawing virtual void InvalidateImage(uint32_t image) abstract; }; - INTERFACE IDrawingEngineFactory + struct IDrawingEngineFactory { virtual ~IDrawingEngineFactory() { @@ -84,7 +84,7 @@ namespace OpenRCT2::Drawing DRAWING_ENGINE_TYPE type, const std::shared_ptr& uiContext) abstract; }; - INTERFACE IRainDrawer + struct IRainDrawer { virtual ~IRainDrawer() { diff --git a/src/openrct2/drawing/Rain.h b/src/openrct2/drawing/Rain.h index 9758d7c7d3..047cec80ae 100644 --- a/src/openrct2/drawing/Rain.h +++ b/src/openrct2/drawing/Rain.h @@ -15,7 +15,7 @@ struct rct_drawpixelinfo; namespace OpenRCT2::Drawing { - INTERFACE IRainDrawer; + struct IRainDrawer; } // clang-format off diff --git a/src/openrct2/drawing/X8DrawingEngine.h b/src/openrct2/drawing/X8DrawingEngine.h index 16353fbd0f..9448b04d40 100644 --- a/src/openrct2/drawing/X8DrawingEngine.h +++ b/src/openrct2/drawing/X8DrawingEngine.h @@ -17,7 +17,7 @@ namespace OpenRCT2 { namespace Ui { - INTERFACE IUiContext; + struct IUiContext; } // namespace Ui namespace Drawing diff --git a/src/openrct2/localisation/LanguagePack.h b/src/openrct2/localisation/LanguagePack.h index 26619d577a..4153d6235e 100644 --- a/src/openrct2/localisation/LanguagePack.h +++ b/src/openrct2/localisation/LanguagePack.h @@ -14,7 +14,7 @@ #include #include -INTERFACE ILanguagePack +struct ILanguagePack { virtual ~ILanguagePack() = default; diff --git a/src/openrct2/localisation/LocalisationService.h b/src/openrct2/localisation/LocalisationService.h index ffceaf6b82..5dab276299 100644 --- a/src/openrct2/localisation/LocalisationService.h +++ b/src/openrct2/localisation/LocalisationService.h @@ -17,12 +17,12 @@ #include #include -INTERFACE ILanguagePack; -INTERFACE IObjectManager; +struct ILanguagePack; +struct IObjectManager; namespace OpenRCT2 { - INTERFACE IPlatformEnvironment; + struct IPlatformEnvironment; } namespace OpenRCT2::Localisation diff --git a/src/openrct2/network/NetworkKey.h b/src/openrct2/network/NetworkKey.h index 337f1ee58f..73f58de2b6 100644 --- a/src/openrct2/network/NetworkKey.h +++ b/src/openrct2/network/NetworkKey.h @@ -20,7 +20,7 @@ namespace OpenRCT2 { - INTERFACE IStream; + struct IStream; } namespace Crypt diff --git a/src/openrct2/network/NetworkServerAdvertiser.h b/src/openrct2/network/NetworkServerAdvertiser.h index 9153b8bad5..b4581ca9f6 100644 --- a/src/openrct2/network/NetworkServerAdvertiser.h +++ b/src/openrct2/network/NetworkServerAdvertiser.h @@ -20,7 +20,7 @@ enum class ADVERTISE_STATUS REGISTERED, }; -INTERFACE INetworkServerAdvertiser +struct INetworkServerAdvertiser { virtual ~INetworkServerAdvertiser() { diff --git a/src/openrct2/network/Socket.h b/src/openrct2/network/Socket.h index 102aab0038..2020d3dba7 100644 --- a/src/openrct2/network/Socket.h +++ b/src/openrct2/network/Socket.h @@ -35,7 +35,7 @@ enum NETWORK_READPACKET /** * Represents an address and port. */ -INTERFACE INetworkEndpoint +struct INetworkEndpoint { virtual ~INetworkEndpoint() { @@ -47,7 +47,7 @@ INTERFACE INetworkEndpoint /** * Represents a TCP socket / connection or listener. */ -INTERFACE ITcpSocket +struct ITcpSocket { public: virtual ~ITcpSocket() = default; @@ -74,7 +74,7 @@ public: /** * Represents a UDP socket / listener. */ -INTERFACE IUdpSocket +struct IUdpSocket { public: virtual ~IUdpSocket() = default; diff --git a/src/openrct2/network/network.h b/src/openrct2/network/network.h index 16e9eb8238..221bccf22d 100644 --- a/src/openrct2/network/network.h +++ b/src/openrct2/network/network.h @@ -32,7 +32,7 @@ enum class PermissionState : uint8_t; namespace OpenRCT2 { - INTERFACE IPlatformEnvironment; + struct IPlatformEnvironment; } void network_set_env(const std::shared_ptr& env); diff --git a/src/openrct2/object/ImageTable.h b/src/openrct2/object/ImageTable.h index 2279698719..a4f92efee7 100644 --- a/src/openrct2/object/ImageTable.h +++ b/src/openrct2/object/ImageTable.h @@ -15,10 +15,10 @@ #include #include -INTERFACE IReadObjectContext; +struct IReadObjectContext; namespace OpenRCT2 { - INTERFACE IStream; + struct IStream; } class ImageTable diff --git a/src/openrct2/object/Object.h b/src/openrct2/object/Object.h index d074411183..7e7454f5db 100644 --- a/src/openrct2/object/Object.h +++ b/src/openrct2/object/Object.h @@ -134,16 +134,16 @@ struct rct_object_filters assert_struct_size(rct_object_filters, 3); #pragma pack(pop) -INTERFACE IObjectRepository; +struct IObjectRepository; namespace OpenRCT2 { - INTERFACE IStream; + struct IStream; } struct ObjectRepositoryItem; struct rct_drawpixelinfo; struct json_t; -INTERFACE IReadObjectContext +struct IReadObjectContext { virtual ~IReadObjectContext() = default; diff --git a/src/openrct2/object/ObjectFactory.cpp b/src/openrct2/object/ObjectFactory.cpp index 5003f1d625..9e46319ad5 100644 --- a/src/openrct2/object/ObjectFactory.cpp +++ b/src/openrct2/object/ObjectFactory.cpp @@ -40,7 +40,7 @@ #include #include -INTERFACE IFileDataRetriever +struct IFileDataRetriever { virtual ~IFileDataRetriever() = default; virtual std::vector GetData(const std::string_view& path) const abstract; diff --git a/src/openrct2/object/ObjectFactory.h b/src/openrct2/object/ObjectFactory.h index 2e060f0158..a7a01f6e9c 100644 --- a/src/openrct2/object/ObjectFactory.h +++ b/src/openrct2/object/ObjectFactory.h @@ -13,7 +13,7 @@ #include -INTERFACE IObjectRepository; +struct IObjectRepository; class Object; struct rct_object_entry; diff --git a/src/openrct2/object/ObjectManager.h b/src/openrct2/object/ObjectManager.h index 7a2461c539..3e2a0b4a01 100644 --- a/src/openrct2/object/ObjectManager.h +++ b/src/openrct2/object/ObjectManager.h @@ -14,11 +14,11 @@ #include -INTERFACE IObjectRepository; +struct IObjectRepository; class Object; struct ObjectRepositoryItem; -INTERFACE IObjectManager +struct IObjectManager { virtual ~IObjectManager() { diff --git a/src/openrct2/object/ObjectRepository.h b/src/openrct2/object/ObjectRepository.h index 658f90b8cd..3995e37f1a 100644 --- a/src/openrct2/object/ObjectRepository.h +++ b/src/openrct2/object/ObjectRepository.h @@ -18,13 +18,13 @@ namespace OpenRCT2 { - INTERFACE IStream; + struct IStream; } class Object; namespace OpenRCT2 { - INTERFACE IPlatformEnvironment; + struct IPlatformEnvironment; } namespace OpenRCT2::Localisation @@ -62,7 +62,7 @@ struct ObjectRepositoryItem } }; -INTERFACE IObjectRepository +struct IObjectRepository { virtual ~IObjectRepository() = default; @@ -80,8 +80,8 @@ INTERFACE IObjectRepository virtual void AddObject(const rct_object_entry* objectEntry, const void* data, size_t dataSize) abstract; virtual void AddObjectFromFile(const std::string_view& objectName, const void* data, size_t dataSize) abstract; - virtual void ExportPackedObject(OpenRCT2::IStream * stream) abstract; - virtual void WritePackedObjects(OpenRCT2::IStream * stream, std::vector & objects) abstract; + virtual void ExportPackedObject(OpenRCT2::IStream* stream) abstract; + virtual void WritePackedObjects(OpenRCT2::IStream* stream, std::vector& objects) abstract; }; std::unique_ptr CreateObjectRepository(const std::shared_ptr& env); diff --git a/src/openrct2/object/StringTable.h b/src/openrct2/object/StringTable.h index 324cb93d0d..a4f5fdac9e 100644 --- a/src/openrct2/object/StringTable.h +++ b/src/openrct2/object/StringTable.h @@ -15,10 +15,10 @@ #include #include -INTERFACE IReadObjectContext; +struct IReadObjectContext; namespace OpenRCT2 { - INTERFACE IStream; + struct IStream; } enum OBJ_STRING_ID : uint8_t diff --git a/src/openrct2/paint/Painter.h b/src/openrct2/paint/Painter.h index 9ec14caefd..e479a0e93c 100644 --- a/src/openrct2/paint/Painter.h +++ b/src/openrct2/paint/Painter.h @@ -22,17 +22,17 @@ namespace OpenRCT2 { namespace Drawing { - INTERFACE IDrawingEngine; + struct IDrawingEngine; } // namespace Drawing namespace Ui { - INTERFACE IUiContext; + struct IUiContext; } // namespace Ui namespace Paint { - INTERFACE Painter final + struct Painter final { private: std::shared_ptr const _uiContext; @@ -44,14 +44,14 @@ namespace OpenRCT2 public: explicit Painter(const std::shared_ptr& uiContext); - void Paint(Drawing::IDrawingEngine & de); + void Paint(Drawing::IDrawingEngine& de); - paint_session* CreateSession(rct_drawpixelinfo * dpi, uint32_t viewFlags); - void ReleaseSession(paint_session * session); + paint_session* CreateSession(rct_drawpixelinfo* dpi, uint32_t viewFlags); + void ReleaseSession(paint_session* session); private: - void PaintReplayNotice(rct_drawpixelinfo * dpi, const char* text); - void PaintFPS(rct_drawpixelinfo * dpi); + void PaintReplayNotice(rct_drawpixelinfo* dpi, const char* text); + void PaintFPS(rct_drawpixelinfo* dpi); void MeasureFPS(); }; } // namespace Paint diff --git a/src/openrct2/rct12/SawyerChunkReader.h b/src/openrct2/rct12/SawyerChunkReader.h index 8c608be9fa..7c86e150d2 100644 --- a/src/openrct2/rct12/SawyerChunkReader.h +++ b/src/openrct2/rct12/SawyerChunkReader.h @@ -17,7 +17,7 @@ namespace OpenRCT2 { - INTERFACE IStream; + struct IStream; } /** diff --git a/src/openrct2/rct12/SawyerChunkWriter.h b/src/openrct2/rct12/SawyerChunkWriter.h index 1690087141..5164c30387 100644 --- a/src/openrct2/rct12/SawyerChunkWriter.h +++ b/src/openrct2/rct12/SawyerChunkWriter.h @@ -16,7 +16,7 @@ namespace OpenRCT2 { - INTERFACE IStream; + struct IStream; } /** diff --git a/src/openrct2/rct12/SawyerEncoding.h b/src/openrct2/rct12/SawyerEncoding.h index 1b98aefb71..0dd386c81c 100644 --- a/src/openrct2/rct12/SawyerEncoding.h +++ b/src/openrct2/rct12/SawyerEncoding.h @@ -13,7 +13,7 @@ namespace OpenRCT2 { - INTERFACE IStream; + struct IStream; } enum class RCT12TrackDesignVersion : uint8_t; diff --git a/src/openrct2/rct2/S6Exporter.h b/src/openrct2/rct2/S6Exporter.h index eb97641319..4566b0f510 100644 --- a/src/openrct2/rct2/S6Exporter.h +++ b/src/openrct2/rct2/S6Exporter.h @@ -20,7 +20,7 @@ namespace OpenRCT2 { - INTERFACE IStream; + struct IStream; } struct ObjectRepositoryItem; diff --git a/src/openrct2/rct2/T6Exporter.h b/src/openrct2/rct2/T6Exporter.h index 54b137a588..14cdeb23d9 100644 --- a/src/openrct2/rct2/T6Exporter.h +++ b/src/openrct2/rct2/T6Exporter.h @@ -16,7 +16,7 @@ namespace OpenRCT2 { - INTERFACE IStream; + struct IStream; } /** diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 00f46c61d3..69bd99ff06 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -21,7 +21,7 @@ #include #include -INTERFACE IObjectManager; +struct IObjectManager; class Formatter; class StationObject; struct Peep; diff --git a/src/openrct2/ride/TrackDesignRepository.h b/src/openrct2/ride/TrackDesignRepository.h index 582523ce72..2ef516cbf0 100644 --- a/src/openrct2/ride/TrackDesignRepository.h +++ b/src/openrct2/ride/TrackDesignRepository.h @@ -24,17 +24,17 @@ struct track_design_file_ref namespace OpenRCT2 { - INTERFACE IPlatformEnvironment; + struct IPlatformEnvironment; } -INTERFACE ITrackDesignRepository +struct ITrackDesignRepository { virtual ~ITrackDesignRepository() = default; virtual size_t GetCount() const abstract; virtual size_t GetCountForObjectEntry(uint8_t rideType, const std::string& entry) const abstract; - virtual std::vector GetItemsForObjectEntry(uint8_t rideType, const std::string& entry) - const abstract; + virtual std::vector GetItemsForObjectEntry( + uint8_t rideType, const std::string& entry) const abstract; virtual void Scan(int32_t language) abstract; virtual bool Delete(const std::string& path) abstract; diff --git a/src/openrct2/scenario/ScenarioRepository.h b/src/openrct2/scenario/ScenarioRepository.h index b9a20309de..d98c8dd76e 100644 --- a/src/openrct2/scenario/ScenarioRepository.h +++ b/src/openrct2/scenario/ScenarioRepository.h @@ -48,10 +48,10 @@ struct scenario_index_entry namespace OpenRCT2 { - INTERFACE IPlatformEnvironment; + struct IPlatformEnvironment; } -INTERFACE IScenarioRepository +struct IScenarioRepository { virtual ~IScenarioRepository() = default; @@ -69,8 +69,8 @@ INTERFACE IScenarioRepository virtual const scenario_index_entry* GetByInternalName(const utf8* name) const abstract; virtual const scenario_index_entry* GetByPath(const utf8* path) const abstract; - virtual bool TryRecordHighscore(int32_t language, const utf8* scenarioFileName, money32 companyValue, const utf8* name) - abstract; + virtual bool TryRecordHighscore( + int32_t language, const utf8* scenarioFileName, money32 companyValue, const utf8* name) abstract; }; std::unique_ptr CreateScenarioRepository(const std::shared_ptr& env); diff --git a/src/openrct2/scripting/ScriptEngine.h b/src/openrct2/scripting/ScriptEngine.h index e688904d25..ba2fc9666f 100644 --- a/src/openrct2/scripting/ScriptEngine.h +++ b/src/openrct2/scripting/ScriptEngine.h @@ -37,7 +37,7 @@ class InteractiveConsole; namespace OpenRCT2 { - INTERFACE IPlatformEnvironment; + struct IPlatformEnvironment; } namespace OpenRCT2::Scripting diff --git a/src/openrct2/title/TitleScreen.h b/src/openrct2/title/TitleScreen.h index a2e2c730aa..9e590e816a 100644 --- a/src/openrct2/title/TitleScreen.h +++ b/src/openrct2/title/TitleScreen.h @@ -12,7 +12,7 @@ #include "../common.h" #include "../drawing/Drawing.h" -INTERFACE ITitleSequencePlayer; +struct ITitleSequencePlayer; namespace OpenRCT2 { diff --git a/src/openrct2/title/TitleSequencePlayer.h b/src/openrct2/title/TitleSequencePlayer.h index 209b9c3da1..c8ef385da8 100644 --- a/src/openrct2/title/TitleSequencePlayer.h +++ b/src/openrct2/title/TitleSequencePlayer.h @@ -11,7 +11,7 @@ #include "../common.h" -INTERFACE ITitleSequencePlayer +struct ITitleSequencePlayer { virtual ~ITitleSequencePlayer() = default; diff --git a/src/openrct2/ui/UiContext.h b/src/openrct2/ui/UiContext.h index 2aa46e4bc4..4f5ded9393 100644 --- a/src/openrct2/ui/UiContext.h +++ b/src/openrct2/ui/UiContext.h @@ -19,21 +19,21 @@ struct ScreenCoordsXY; struct rct_drawpixelinfo; -INTERFACE ITitleSequencePlayer; +struct ITitleSequencePlayer; namespace OpenRCT2 { namespace Drawing { - INTERFACE IDrawingEngineFactory; - INTERFACE IRainDrawer; + struct IDrawingEngineFactory; + struct IRainDrawer; using DrawRainFunc = void (*)( OpenRCT2::Drawing::IRainDrawer* rainDrawer, int32_t left, int32_t top, int32_t width, int32_t height); } // namespace Drawing namespace Ui { - INTERFACE IWindowManager; + struct IWindowManager; enum class FULLSCREEN_MODE { @@ -87,13 +87,13 @@ namespace OpenRCT2 /** * Represents the window or screen that OpenRCT2 is presented on. */ - INTERFACE IUiContext + struct IUiContext { virtual ~IUiContext() = default; virtual void Initialise() abstract; virtual void Update() abstract; - virtual void Draw(rct_drawpixelinfo * dpi) abstract; + virtual void Draw(rct_drawpixelinfo* dpi) abstract; // Window virtual void CreateWindow() abstract; @@ -133,12 +133,12 @@ namespace OpenRCT2 // Drawing virtual std::shared_ptr GetDrawingEngineFactory() abstract; virtual void DrawRainAnimation( - OpenRCT2::Drawing::IRainDrawer * rainDrawer, rct_drawpixelinfo * dpi, OpenRCT2::Drawing::DrawRainFunc drawFunc) - abstract; + OpenRCT2::Drawing::IRainDrawer* rainDrawer, rct_drawpixelinfo* dpi, + OpenRCT2::Drawing::DrawRainFunc drawFunc) abstract; // Text input virtual bool IsTextInputActive() abstract; - virtual TextInputSession* StartTextInput(utf8 * buffer, size_t bufferSize) abstract; + virtual TextInputSession* StartTextInput(utf8* buffer, size_t bufferSize) abstract; virtual void StopTextInput() abstract; // In-game UI diff --git a/src/openrct2/ui/WindowManager.h b/src/openrct2/ui/WindowManager.h index f187e0568e..213e2d4ef0 100644 --- a/src/openrct2/ui/WindowManager.h +++ b/src/openrct2/ui/WindowManager.h @@ -20,14 +20,14 @@ namespace OpenRCT2::Ui /** * Manager of in-game windows and widgets. */ - INTERFACE IWindowManager + struct IWindowManager { virtual ~IWindowManager() = default; virtual void Init() abstract; virtual rct_window* OpenWindow(rct_windowclass wc) abstract; virtual rct_window* OpenView(uint8_t view) abstract; virtual rct_window* OpenDetails(uint8_t type, int32_t id) abstract; - virtual rct_window* OpenIntent(Intent * intent) abstract; + virtual rct_window* OpenIntent(Intent* intent) abstract; virtual void BroadcastIntent(const Intent& intent) abstract; virtual rct_window* ShowError(rct_string_id title, rct_string_id message) abstract; virtual rct_window* ShowError(const std::string_view& title, const std::string_view& message) abstract; diff --git a/test/testpaint/TestTrack.cpp b/test/testpaint/TestTrack.cpp index 3dd6902c8c..679a4a67d4 100644 --- a/test/testpaint/TestTrack.cpp +++ b/test/testpaint/TestTrack.cpp @@ -30,7 +30,7 @@ #include #include -interface ITestTrackFilter +struct ITestTrackFilter { public: virtual ~ITestTrackFilter()