mirror of https://github.com/OpenRCT2/OpenRCT2.git
Remove the use of INTERFACE macro and macro its self
This commit is contained in:
parent
83355e35cc
commit
0dc43d66e4
|
@ -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<IUiContext> CreateUiContext(const std::shared_ptr<IPlatformEnvironment>& env);
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
namespace OpenRCT2::Ui
|
||||
{
|
||||
INTERFACE IWindowManager;
|
||||
struct IWindowManager;
|
||||
|
||||
IWindowManager* CreateWindowManager();
|
||||
} // namespace OpenRCT2::Ui
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace OpenRCT2
|
|||
{
|
||||
using namespace OpenRCT2::Drawing;
|
||||
|
||||
INTERFACE IUiContext;
|
||||
struct IUiContext;
|
||||
|
||||
std::unique_ptr<IDrawingEngine> CreateSoftwareDrawingEngine(const std::shared_ptr<IUiContext>& uiContext);
|
||||
std::unique_ptr<IDrawingEngine> CreateHardwareDisplayDrawingEngine(const std::shared_ptr<IUiContext>& uiContext);
|
||||
|
|
|
@ -123,7 +123,7 @@ enum KeyboardShortcut
|
|||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
INTERFACE IPlatformEnvironment;
|
||||
struct IPlatformEnvironment;
|
||||
|
||||
namespace Input
|
||||
{
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
#include <memory>
|
||||
#include <openrct2/common.h>
|
||||
|
||||
INTERFACE ITitleSequencePlayer;
|
||||
INTERFACE IScenarioRepository;
|
||||
struct ITitleSequencePlayer;
|
||||
struct IScenarioRepository;
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
|
|
|
@ -15,15 +15,15 @@
|
|||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
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;
|
||||
|
|
|
@ -27,7 +27,7 @@ enum
|
|||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
INTERFACE IStream;
|
||||
struct IStream;
|
||||
}
|
||||
|
||||
enum class FILE_TYPE
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -17,12 +17,13 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
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
|
||||
|
|
|
@ -72,7 +72,7 @@ namespace OpenRCT2
|
|||
/**
|
||||
* Interface for retrieving paths and other environment related things.
|
||||
*/
|
||||
INTERFACE IPlatformEnvironment
|
||||
struct IPlatformEnvironment
|
||||
{
|
||||
virtual ~IPlatformEnvironment() = default;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<TrackDesign> Import() abstract;
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace OpenRCT2::Audio
|
|||
/**
|
||||
* Represents a readable source of audio PCM data.
|
||||
*/
|
||||
INTERFACE IAudioSource
|
||||
struct IAudioSource
|
||||
{
|
||||
virtual ~IAudioSource() = default;
|
||||
|
||||
|
|
|
@ -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__))
|
||||
|
|
|
@ -27,7 +27,7 @@ template<typename T> struct ConfigEnumEntry
|
|||
}
|
||||
};
|
||||
|
||||
template<typename T> INTERFACE IConfigEnum
|
||||
template<typename T> struct IConfigEnum
|
||||
{
|
||||
virtual ~IConfigEnum() = default;
|
||||
virtual std::string GetName(T value) const abstract;
|
||||
|
|
|
@ -15,12 +15,12 @@
|
|||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
INTERFACE IStream;
|
||||
struct IStream;
|
||||
}
|
||||
|
||||
template<typename T> struct IConfigEnum;
|
||||
|
||||
INTERFACE IIniReader
|
||||
struct IIniReader
|
||||
{
|
||||
virtual ~IIniReader() = default;
|
||||
|
||||
|
|
|
@ -15,12 +15,12 @@
|
|||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
INTERFACE IStream;
|
||||
struct IStream;
|
||||
}
|
||||
|
||||
template<typename T> struct IConfigEnum;
|
||||
|
||||
INTERFACE IIniWriter
|
||||
struct IIniWriter
|
||||
{
|
||||
virtual ~IIniWriter() = default;
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ struct FileInfo
|
|||
uint64_t LastModified;
|
||||
};
|
||||
|
||||
INTERFACE IFileScanner
|
||||
struct IFileScanner
|
||||
{
|
||||
virtual ~IFileScanner() = default;
|
||||
|
||||
|
|
|
@ -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<typename T> void Read(T * value)
|
||||
template<typename T> 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<typename T> void WriteArray(T * buffer, size_t count)
|
||||
template<typename T> void WriteArray(T* buffer, size_t count)
|
||||
{
|
||||
Write(buffer, sizeof(T) * count);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
/**
|
||||
* Represents a zip file.
|
||||
*/
|
||||
INTERFACE IZipArchive
|
||||
struct IZipArchive
|
||||
{
|
||||
virtual ~IZipArchive()
|
||||
{
|
||||
|
|
|
@ -22,12 +22,12 @@ struct ScreenLine;
|
|||
struct ScreenRect;
|
||||
namespace OpenRCT2
|
||||
{
|
||||
INTERFACE IPlatformEnvironment;
|
||||
struct IPlatformEnvironment;
|
||||
}
|
||||
|
||||
namespace OpenRCT2::Drawing
|
||||
{
|
||||
INTERFACE IDrawingEngine;
|
||||
struct IDrawingEngine;
|
||||
}
|
||||
|
||||
struct PaletteBGRA
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
|
||||
namespace OpenRCT2::Drawing
|
||||
{
|
||||
INTERFACE IDrawingEngine;
|
||||
struct IDrawingEngine;
|
||||
|
||||
INTERFACE IDrawingContext
|
||||
struct IDrawingContext
|
||||
{
|
||||
virtual ~IDrawingContext()
|
||||
{
|
||||
|
|
|
@ -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<OpenRCT2::Ui::IUiContext>& uiContext) abstract;
|
||||
};
|
||||
|
||||
INTERFACE IRainDrawer
|
||||
struct IRainDrawer
|
||||
{
|
||||
virtual ~IRainDrawer()
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@ struct rct_drawpixelinfo;
|
|||
|
||||
namespace OpenRCT2::Drawing
|
||||
{
|
||||
INTERFACE IRainDrawer;
|
||||
struct IRainDrawer;
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace OpenRCT2
|
|||
{
|
||||
namespace Ui
|
||||
{
|
||||
INTERFACE IUiContext;
|
||||
struct IUiContext;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Drawing
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
INTERFACE ILanguagePack
|
||||
struct ILanguagePack
|
||||
{
|
||||
virtual ~ILanguagePack() = default;
|
||||
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
#include <string_view>
|
||||
#include <tuple>
|
||||
|
||||
INTERFACE ILanguagePack;
|
||||
INTERFACE IObjectManager;
|
||||
struct ILanguagePack;
|
||||
struct IObjectManager;
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
INTERFACE IPlatformEnvironment;
|
||||
struct IPlatformEnvironment;
|
||||
}
|
||||
|
||||
namespace OpenRCT2::Localisation
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
INTERFACE IStream;
|
||||
struct IStream;
|
||||
}
|
||||
|
||||
namespace Crypt
|
||||
|
|
|
@ -20,7 +20,7 @@ enum class ADVERTISE_STATUS
|
|||
REGISTERED,
|
||||
};
|
||||
|
||||
INTERFACE INetworkServerAdvertiser
|
||||
struct INetworkServerAdvertiser
|
||||
{
|
||||
virtual ~INetworkServerAdvertiser()
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -32,7 +32,7 @@ enum class PermissionState : uint8_t;
|
|||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
INTERFACE IPlatformEnvironment;
|
||||
struct IPlatformEnvironment;
|
||||
}
|
||||
|
||||
void network_set_env(const std::shared_ptr<OpenRCT2::IPlatformEnvironment>& env);
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
INTERFACE IReadObjectContext;
|
||||
struct IReadObjectContext;
|
||||
namespace OpenRCT2
|
||||
{
|
||||
INTERFACE IStream;
|
||||
struct IStream;
|
||||
}
|
||||
|
||||
class ImageTable
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
#include <algorithm>
|
||||
#include <unordered_map>
|
||||
|
||||
INTERFACE IFileDataRetriever
|
||||
struct IFileDataRetriever
|
||||
{
|
||||
virtual ~IFileDataRetriever() = default;
|
||||
virtual std::vector<uint8_t> GetData(const std::string_view& path) const abstract;
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
#include <string_view>
|
||||
|
||||
INTERFACE IObjectRepository;
|
||||
struct IObjectRepository;
|
||||
class Object;
|
||||
struct rct_object_entry;
|
||||
|
||||
|
|
|
@ -14,11 +14,11 @@
|
|||
|
||||
#include <vector>
|
||||
|
||||
INTERFACE IObjectRepository;
|
||||
struct IObjectRepository;
|
||||
class Object;
|
||||
struct ObjectRepositoryItem;
|
||||
|
||||
INTERFACE IObjectManager
|
||||
struct IObjectManager
|
||||
{
|
||||
virtual ~IObjectManager()
|
||||
{
|
||||
|
|
|
@ -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<const ObjectRepositoryItem*> & objects) abstract;
|
||||
virtual void ExportPackedObject(OpenRCT2::IStream* stream) abstract;
|
||||
virtual void WritePackedObjects(OpenRCT2::IStream* stream, std::vector<const ObjectRepositoryItem*>& objects) abstract;
|
||||
};
|
||||
|
||||
std::unique_ptr<IObjectRepository> CreateObjectRepository(const std::shared_ptr<OpenRCT2::IPlatformEnvironment>& env);
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
INTERFACE IReadObjectContext;
|
||||
struct IReadObjectContext;
|
||||
namespace OpenRCT2
|
||||
{
|
||||
INTERFACE IStream;
|
||||
struct IStream;
|
||||
}
|
||||
|
||||
enum OBJ_STRING_ID : uint8_t
|
||||
|
|
|
@ -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<Ui::IUiContext> const _uiContext;
|
||||
|
@ -44,14 +44,14 @@ namespace OpenRCT2
|
|||
|
||||
public:
|
||||
explicit Painter(const std::shared_ptr<Ui::IUiContext>& 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
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
INTERFACE IStream;
|
||||
struct IStream;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
INTERFACE IStream;
|
||||
struct IStream;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
INTERFACE IStream;
|
||||
struct IStream;
|
||||
}
|
||||
|
||||
enum class RCT12TrackDesignVersion : uint8_t;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
INTERFACE IStream;
|
||||
struct IStream;
|
||||
}
|
||||
|
||||
struct ObjectRepositoryItem;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
INTERFACE IStream;
|
||||
struct IStream;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include <limits>
|
||||
#include <string_view>
|
||||
|
||||
INTERFACE IObjectManager;
|
||||
struct IObjectManager;
|
||||
class Formatter;
|
||||
class StationObject;
|
||||
struct Peep;
|
||||
|
|
|
@ -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<track_design_file_ref> GetItemsForObjectEntry(uint8_t rideType, const std::string& entry)
|
||||
const abstract;
|
||||
virtual std::vector<track_design_file_ref> 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;
|
||||
|
|
|
@ -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<IScenarioRepository> CreateScenarioRepository(const std::shared_ptr<OpenRCT2::IPlatformEnvironment>& env);
|
||||
|
|
|
@ -37,7 +37,7 @@ class InteractiveConsole;
|
|||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
INTERFACE IPlatformEnvironment;
|
||||
struct IPlatformEnvironment;
|
||||
}
|
||||
|
||||
namespace OpenRCT2::Scripting
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "../common.h"
|
||||
#include "../drawing/Drawing.h"
|
||||
|
||||
INTERFACE ITitleSequencePlayer;
|
||||
struct ITitleSequencePlayer;
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
#include "../common.h"
|
||||
|
||||
INTERFACE ITitleSequencePlayer
|
||||
struct ITitleSequencePlayer
|
||||
{
|
||||
virtual ~ITitleSequencePlayer() = default;
|
||||
|
||||
|
|
|
@ -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<Drawing::IDrawingEngineFactory> 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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
interface ITestTrackFilter
|
||||
struct ITestTrackFilter
|
||||
{
|
||||
public:
|
||||
virtual ~ITestTrackFilter()
|
||||
|
|
Loading…
Reference in New Issue