mirror of https://github.com/OpenRCT2/OpenRCT2.git
Include missing headers
This commit is contained in:
parent
59349b0a31
commit
30376085cf
|
@ -16,7 +16,11 @@
|
|||
# endif // __MINGW32__
|
||||
|
||||
// Windows.h needs to be included first
|
||||
// clang-format off
|
||||
# include <windows.h>
|
||||
# include <shellapi.h>
|
||||
# include <commdlg.h>
|
||||
// clang-format on
|
||||
# undef CreateWindow
|
||||
|
||||
// Then the rest
|
||||
|
|
|
@ -17,16 +17,16 @@ struct SDL_Window;
|
|||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
interface IContext;
|
||||
interface IPlatformEnvironment;
|
||||
INTERFACE IContext;
|
||||
INTERFACE IPlatformEnvironment;
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
struct FileDialogDesc;
|
||||
class InGameConsole;
|
||||
interface IUiContext;
|
||||
INTERFACE IUiContext;
|
||||
|
||||
interface IPlatformUiContext
|
||||
INTERFACE IPlatformUiContext
|
||||
{
|
||||
virtual ~IPlatformUiContext() = default;
|
||||
virtual void SetWindowIcon(SDL_Window * window) abstract;
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
namespace OpenRCT2::Ui
|
||||
{
|
||||
interface IWindowManager;
|
||||
INTERFACE IWindowManager;
|
||||
|
||||
IWindowManager* CreateWindowManager();
|
||||
} // namespace OpenRCT2::Ui
|
||||
|
|
|
@ -21,7 +21,7 @@ using SpeexResamplerState = struct SpeexResamplerState_;
|
|||
namespace OpenRCT2::Audio
|
||||
{
|
||||
struct AudioFormat;
|
||||
interface IAudioContext;
|
||||
INTERFACE IAudioContext;
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct WaveFormat
|
||||
|
@ -48,12 +48,12 @@ namespace OpenRCT2::Audio
|
|||
assert_struct_size(WaveFormatEx, 18);
|
||||
#pragma pack(pop)
|
||||
|
||||
interface ISDLAudioSource : public IAudioSource
|
||||
INTERFACE ISDLAudioSource : public IAudioSource
|
||||
{
|
||||
[[nodiscard]] virtual AudioFormat GetFormat() const abstract;
|
||||
};
|
||||
|
||||
interface ISDLAudioChannel : public IAudioChannel
|
||||
INTERFACE ISDLAudioChannel : public IAudioChannel
|
||||
{
|
||||
[[nodiscard]] virtual AudioFormat GetFormat() const abstract;
|
||||
[[nodiscard]] virtual SpeexResamplerState* GetResampler() const abstract;
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace OpenRCT2
|
|||
{
|
||||
using namespace OpenRCT2::Drawing;
|
||||
|
||||
interface IUiContext;
|
||||
INTERFACE 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;
|
||||
INTERFACE IPlatformEnvironment;
|
||||
|
||||
namespace Input
|
||||
{
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
#include <memory>
|
||||
#include <openrct2/common.h>
|
||||
|
||||
interface ITitleSequencePlayer;
|
||||
interface IScenarioRepository;
|
||||
INTERFACE ITitleSequencePlayer;
|
||||
INTERFACE IScenarioRepository;
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
*****************************************************************************/
|
||||
|
||||
// Windows.h needs to be included first
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
// Enable visual styles
|
||||
|
|
|
@ -15,12 +15,12 @@
|
|||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
interface IObjectManager;
|
||||
interface IObjectRepository;
|
||||
interface IScenarioRepository;
|
||||
interface IStream;
|
||||
interface ITrackDesignRepository;
|
||||
interface IGameStateSnapshots;
|
||||
INTERFACE IObjectManager;
|
||||
INTERFACE IObjectRepository;
|
||||
INTERFACE IScenarioRepository;
|
||||
INTERFACE IStream;
|
||||
INTERFACE ITrackDesignRepository;
|
||||
INTERFACE IGameStateSnapshots;
|
||||
|
||||
class Intent;
|
||||
struct rct_window;
|
||||
|
@ -67,17 +67,17 @@ namespace OpenRCT2
|
|||
{
|
||||
class GameState;
|
||||
|
||||
interface IPlatformEnvironment;
|
||||
interface IReplayManager;
|
||||
INTERFACE IPlatformEnvironment;
|
||||
INTERFACE IReplayManager;
|
||||
|
||||
namespace Audio
|
||||
{
|
||||
interface IAudioContext;
|
||||
INTERFACE IAudioContext;
|
||||
}
|
||||
|
||||
namespace Drawing
|
||||
{
|
||||
interface IDrawingEngine;
|
||||
INTERFACE IDrawingEngine;
|
||||
}
|
||||
|
||||
namespace Localisation
|
||||
|
@ -92,18 +92,18 @@ namespace OpenRCT2
|
|||
|
||||
namespace Ui
|
||||
{
|
||||
interface IUiContext;
|
||||
INTERFACE IUiContext;
|
||||
}
|
||||
|
||||
namespace Paint
|
||||
{
|
||||
interface Painter;
|
||||
INTERFACE Painter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents an instance of OpenRCT2 and can be used to get various services.
|
||||
*/
|
||||
interface IContext
|
||||
INTERFACE IContext
|
||||
{
|
||||
virtual ~IContext() = default;
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ enum
|
|||
|
||||
#include <string>
|
||||
|
||||
interface IStream;
|
||||
INTERFACE 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
|
||||
INTERFACE IGameStateSnapshots
|
||||
{
|
||||
virtual ~IGameStateSnapshots() = default;
|
||||
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
interface IObjectManager;
|
||||
interface IObjectRepository;
|
||||
interface IStream;
|
||||
INTERFACE IObjectManager;
|
||||
INTERFACE IObjectRepository;
|
||||
INTERFACE IStream;
|
||||
struct scenario_index_entry;
|
||||
|
||||
struct ParkLoadResult final
|
||||
|
@ -36,7 +36,7 @@ public:
|
|||
/**
|
||||
* Interface to import scenarios and saved games.
|
||||
*/
|
||||
interface IParkImporter
|
||||
INTERFACE IParkImporter
|
||||
{
|
||||
public:
|
||||
virtual ~IParkImporter() = default;
|
||||
|
|
|
@ -72,7 +72,7 @@ namespace OpenRCT2
|
|||
/**
|
||||
* Interface for retrieving paths and other environment related things.
|
||||
*/
|
||||
interface IPlatformEnvironment
|
||||
INTERFACE IPlatformEnvironment
|
||||
{
|
||||
virtual ~IPlatformEnvironment() = default;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace OpenRCT2
|
|||
std::string FilePath;
|
||||
};
|
||||
|
||||
interface IReplayManager
|
||||
INTERFACE IReplayManager
|
||||
{
|
||||
public:
|
||||
enum class RecordType
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
/**
|
||||
* Interface to import scenarios and saved games.
|
||||
*/
|
||||
interface ITrackImporter
|
||||
INTERFACE ITrackImporter
|
||||
{
|
||||
public:
|
||||
virtual ~ITrackImporter() = default;
|
||||
|
|
|
@ -14,13 +14,13 @@
|
|||
|
||||
namespace OpenRCT2::Audio
|
||||
{
|
||||
interface IAudioSource;
|
||||
INTERFACE IAudioSource;
|
||||
|
||||
/**
|
||||
* Represents an audio channel that represents an audio source
|
||||
* and a number of properties such as volume, pan and loop information.
|
||||
*/
|
||||
interface IAudioChannel
|
||||
INTERFACE IAudioChannel
|
||||
{
|
||||
virtual ~IAudioChannel() = default;
|
||||
|
||||
|
|
|
@ -17,14 +17,14 @@
|
|||
|
||||
namespace OpenRCT2::Audio
|
||||
{
|
||||
interface IAudioChannel;
|
||||
interface IAudioMixer;
|
||||
interface IAudioSource;
|
||||
INTERFACE IAudioChannel;
|
||||
INTERFACE IAudioMixer;
|
||||
INTERFACE IAudioSource;
|
||||
|
||||
/**
|
||||
* Audio services for playing music and sound effects.
|
||||
*/
|
||||
interface IAudioContext
|
||||
INTERFACE IAudioContext
|
||||
{
|
||||
virtual ~IAudioContext() = default;
|
||||
|
||||
|
|
|
@ -26,13 +26,13 @@ namespace OpenRCT2::Audio
|
|||
TitleMusic,
|
||||
};
|
||||
|
||||
interface IAudioSource;
|
||||
interface IAudioChannel;
|
||||
INTERFACE IAudioSource;
|
||||
INTERFACE IAudioChannel;
|
||||
|
||||
/**
|
||||
* Provides an audio stream by mixing multiple audio channels together.
|
||||
*/
|
||||
interface IAudioMixer
|
||||
INTERFACE IAudioMixer
|
||||
{
|
||||
virtual ~IAudioMixer() = default;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace OpenRCT2::Audio
|
|||
/**
|
||||
* Represents a readable source of audio PCM data.
|
||||
*/
|
||||
interface IAudioSource
|
||||
INTERFACE IAudioSource
|
||||
{
|
||||
virtual ~IAudioSource() = default;
|
||||
|
||||
|
|
|
@ -165,8 +165,8 @@ using rct_string_id = uint16_t;
|
|||
(x) = nullptr; \
|
||||
} while (false)
|
||||
|
||||
#ifndef interface
|
||||
# define interface struct
|
||||
#ifndef INTERFACE
|
||||
# define INTERFACE struct
|
||||
#endif
|
||||
#define abstract = 0
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ template<typename T> struct ConfigEnumEntry
|
|||
}
|
||||
};
|
||||
|
||||
template<typename T> interface IConfigEnum
|
||||
template<typename T> INTERFACE IConfigEnum
|
||||
{
|
||||
virtual ~IConfigEnum() = default;
|
||||
virtual std::string GetName(T value) const abstract;
|
||||
|
|
|
@ -13,10 +13,10 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
interface IStream;
|
||||
INTERFACE IStream;
|
||||
template<typename T> struct IConfigEnum;
|
||||
|
||||
interface IIniReader
|
||||
INTERFACE IIniReader
|
||||
{
|
||||
virtual ~IIniReader() = default;
|
||||
|
||||
|
|
|
@ -13,10 +13,10 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
interface IStream;
|
||||
INTERFACE IStream;
|
||||
template<typename T> struct IConfigEnum;
|
||||
|
||||
interface IIniWriter
|
||||
INTERFACE IIniWriter
|
||||
{
|
||||
virtual ~IIniWriter() = default;
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
// clang-format off
|
||||
// CNG: Cryptography API: Next Generation (CNG)
|
||||
// available in Windows Vista onwards.
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <wincrypt.h>
|
||||
#include <bcrypt.h>
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
*****************************************************************************/
|
||||
|
||||
#ifdef _WIN32
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
#else
|
||||
# include <sys/stat.h>
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "../common.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ struct FileInfo
|
|||
uint64_t LastModified;
|
||||
};
|
||||
|
||||
interface IFileScanner
|
||||
INTERFACE IFileScanner
|
||||
{
|
||||
virtual ~IFileScanner() = default;
|
||||
|
||||
|
|
|
@ -29,170 +29,174 @@
|
|||
# define fseeko _fseeki64
|
||||
#endif
|
||||
|
||||
enum
|
||||
namespace OpenRCT2
|
||||
{
|
||||
FILE_MODE_OPEN,
|
||||
FILE_MODE_WRITE,
|
||||
FILE_MODE_APPEND,
|
||||
};
|
||||
|
||||
/**
|
||||
* A stream for reading and writing to files.
|
||||
*/
|
||||
class FileStream final : public IStream
|
||||
{
|
||||
private:
|
||||
FILE* _file = nullptr;
|
||||
bool _ownsFilePtr = false;
|
||||
bool _canRead = false;
|
||||
bool _canWrite = false;
|
||||
bool _disposed = false;
|
||||
uint64_t _fileSize = 0;
|
||||
|
||||
public:
|
||||
FileStream(const std::string& path, int32_t fileMode)
|
||||
: FileStream(path.c_str(), fileMode)
|
||||
enum
|
||||
{
|
||||
}
|
||||
FILE_MODE_OPEN,
|
||||
FILE_MODE_WRITE,
|
||||
FILE_MODE_APPEND,
|
||||
};
|
||||
|
||||
FileStream(const utf8* path, int32_t fileMode)
|
||||
/**
|
||||
* A stream for reading and writing to files.
|
||||
*/
|
||||
class FileStream final : public IStream
|
||||
{
|
||||
const char* mode;
|
||||
switch (fileMode)
|
||||
private:
|
||||
FILE* _file = nullptr;
|
||||
bool _ownsFilePtr = false;
|
||||
bool _canRead = false;
|
||||
bool _canWrite = false;
|
||||
bool _disposed = false;
|
||||
uint64_t _fileSize = 0;
|
||||
|
||||
public:
|
||||
FileStream(const std::string& path, int32_t fileMode)
|
||||
: FileStream(path.c_str(), fileMode)
|
||||
{
|
||||
case FILE_MODE_OPEN:
|
||||
mode = "rb";
|
||||
_canRead = true;
|
||||
_canWrite = false;
|
||||
break;
|
||||
case FILE_MODE_WRITE:
|
||||
mode = "w+b";
|
||||
_canRead = true;
|
||||
_canWrite = true;
|
||||
break;
|
||||
case FILE_MODE_APPEND:
|
||||
mode = "a";
|
||||
_canRead = false;
|
||||
_canWrite = true;
|
||||
break;
|
||||
default:
|
||||
throw;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
auto pathW = String::ToWideChar(path);
|
||||
auto modeW = String::ToWideChar(mode);
|
||||
_file = _wfopen(pathW.c_str(), modeW.c_str());
|
||||
#else
|
||||
if (fileMode == FILE_MODE_OPEN)
|
||||
FileStream(const utf8* path, int32_t fileMode)
|
||||
{
|
||||
struct stat fileStat;
|
||||
// Only allow regular files to be opened as its possible to open directories.
|
||||
if (stat(path, &fileStat) == 0 && S_ISREG(fileStat.st_mode))
|
||||
const char* mode;
|
||||
switch (fileMode)
|
||||
{
|
||||
case FILE_MODE_OPEN:
|
||||
mode = "rb";
|
||||
_canRead = true;
|
||||
_canWrite = false;
|
||||
break;
|
||||
case FILE_MODE_WRITE:
|
||||
mode = "w+b";
|
||||
_canRead = true;
|
||||
_canWrite = true;
|
||||
break;
|
||||
case FILE_MODE_APPEND:
|
||||
mode = "a";
|
||||
_canRead = false;
|
||||
_canWrite = true;
|
||||
break;
|
||||
default:
|
||||
throw;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
auto pathW = String::ToWideChar(path);
|
||||
auto modeW = String::ToWideChar(mode);
|
||||
_file = _wfopen(pathW.c_str(), modeW.c_str());
|
||||
#else
|
||||
if (fileMode == FILE_MODE_OPEN)
|
||||
{
|
||||
struct stat fileStat;
|
||||
// Only allow regular files to be opened as its possible to open directories.
|
||||
if (stat(path, &fileStat) == 0 && S_ISREG(fileStat.st_mode))
|
||||
{
|
||||
_file = fopen(path, mode);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_file = fopen(path, mode);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_file = fopen(path, mode);
|
||||
}
|
||||
#endif
|
||||
if (_file == nullptr)
|
||||
{
|
||||
throw IOException(String::StdFormat("Unable to open '%s'", path));
|
||||
if (_file == nullptr)
|
||||
{
|
||||
throw IOException(String::StdFormat("Unable to open '%s'", path));
|
||||
}
|
||||
|
||||
Seek(0, STREAM_SEEK_END);
|
||||
_fileSize = GetPosition();
|
||||
Seek(0, STREAM_SEEK_BEGIN);
|
||||
|
||||
_ownsFilePtr = true;
|
||||
}
|
||||
|
||||
Seek(0, STREAM_SEEK_END);
|
||||
_fileSize = GetPosition();
|
||||
Seek(0, STREAM_SEEK_BEGIN);
|
||||
|
||||
_ownsFilePtr = true;
|
||||
}
|
||||
|
||||
~FileStream() override
|
||||
{
|
||||
if (!_disposed)
|
||||
~FileStream() override
|
||||
{
|
||||
_disposed = true;
|
||||
if (_ownsFilePtr)
|
||||
if (!_disposed)
|
||||
{
|
||||
fclose(_file);
|
||||
_disposed = true;
|
||||
if (_ownsFilePtr)
|
||||
{
|
||||
fclose(_file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool CanRead() const override
|
||||
{
|
||||
return _canRead;
|
||||
}
|
||||
bool CanWrite() const override
|
||||
{
|
||||
return _canWrite;
|
||||
}
|
||||
|
||||
uint64_t GetLength() const override
|
||||
{
|
||||
return _fileSize;
|
||||
}
|
||||
uint64_t GetPosition() const override
|
||||
{
|
||||
return ftello(_file);
|
||||
}
|
||||
|
||||
void SetPosition(uint64_t position) override
|
||||
{
|
||||
Seek(position, STREAM_SEEK_BEGIN);
|
||||
}
|
||||
|
||||
void Seek(int64_t offset, int32_t origin) override
|
||||
{
|
||||
switch (origin)
|
||||
bool CanRead() const override
|
||||
{
|
||||
case STREAM_SEEK_BEGIN:
|
||||
fseeko(_file, offset, SEEK_SET);
|
||||
break;
|
||||
case STREAM_SEEK_CURRENT:
|
||||
fseeko(_file, offset, SEEK_CUR);
|
||||
break;
|
||||
case STREAM_SEEK_END:
|
||||
fseeko(_file, offset, SEEK_END);
|
||||
break;
|
||||
return _canRead;
|
||||
}
|
||||
}
|
||||
|
||||
void Read(void* buffer, uint64_t length) override
|
||||
{
|
||||
uint64_t remainingBytes = GetLength() - GetPosition();
|
||||
if (length <= remainingBytes)
|
||||
bool CanWrite() const override
|
||||
{
|
||||
if (fread(buffer, static_cast<size_t>(length), 1, _file) == 1)
|
||||
return _canWrite;
|
||||
}
|
||||
|
||||
uint64_t GetLength() const override
|
||||
{
|
||||
return _fileSize;
|
||||
}
|
||||
uint64_t GetPosition() const override
|
||||
{
|
||||
return ftello(_file);
|
||||
}
|
||||
|
||||
void SetPosition(uint64_t position) override
|
||||
{
|
||||
Seek(position, STREAM_SEEK_BEGIN);
|
||||
}
|
||||
|
||||
void Seek(int64_t offset, IStream::SeekType origin) override
|
||||
{
|
||||
switch (origin)
|
||||
{
|
||||
return;
|
||||
case IStream::SeekType.STREAM_SEEK_BEGIN:
|
||||
fseeko(_file, offset, SEEK_SET);
|
||||
break;
|
||||
case IStream::SeekType.STREAM_SEEK_CURRENT:
|
||||
fseeko(_file, offset, SEEK_CUR);
|
||||
break;
|
||||
case IStream::SeekType.STREAM_SEEK_END:
|
||||
fseeko(_file, offset, SEEK_END);
|
||||
break;
|
||||
}
|
||||
}
|
||||
throw IOException("Attempted to read past end of file.");
|
||||
}
|
||||
|
||||
void Write(const void* buffer, uint64_t length) override
|
||||
{
|
||||
if (fwrite(buffer, static_cast<size_t>(length), 1, _file) != 1)
|
||||
void Read(void* buffer, uint64_t length) override
|
||||
{
|
||||
throw IOException("Unable to write to file.");
|
||||
uint64_t remainingBytes = GetLength() - GetPosition();
|
||||
if (length <= remainingBytes)
|
||||
{
|
||||
if (fread(buffer, static_cast<size_t>(length), 1, _file) == 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw IOException("Attempted to read past end of file.");
|
||||
}
|
||||
|
||||
uint64_t position = GetPosition();
|
||||
_fileSize = std::max(_fileSize, position);
|
||||
}
|
||||
void Write(const void* buffer, uint64_t length) override
|
||||
{
|
||||
if (fwrite(buffer, static_cast<size_t>(length), 1, _file) != 1)
|
||||
{
|
||||
throw IOException("Unable to write to file.");
|
||||
}
|
||||
|
||||
uint64_t TryRead(void* buffer, uint64_t length) override
|
||||
{
|
||||
size_t readBytes = fread(buffer, 1, static_cast<size_t>(length), _file);
|
||||
return readBytes;
|
||||
}
|
||||
uint64_t position = GetPosition();
|
||||
_fileSize = std::max(_fileSize, position);
|
||||
}
|
||||
|
||||
const void* GetData() const override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
uint64_t TryRead(void* buffer, uint64_t length) override
|
||||
{
|
||||
size_t readBytes = fread(buffer, 1, static_cast<size_t>(length), _file);
|
||||
return readBytes;
|
||||
}
|
||||
|
||||
const void* GetData() const override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace OpenRCT2
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include <stdexcept>
|
||||
|
||||
#ifdef _WIN32
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
#elif defined(__linux__)
|
||||
# include <fcntl.h>
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
*****************************************************************************/
|
||||
|
||||
#ifdef _WIN32
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
# include <cstdio>
|
||||
# include <stdexcept>
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
# include <winhttp.h>
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace OpenRCT2
|
|||
* Represents a registration of some service which when deleted will be
|
||||
* unregistered.
|
||||
*/
|
||||
interface IRegistration
|
||||
INTERFACE IRegistration
|
||||
{
|
||||
virtual ~IRegistration() = default;
|
||||
};
|
||||
|
|
|
@ -24,10 +24,6 @@
|
|||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
# ifndef NOMINMAX
|
||||
# define NOMINMAX
|
||||
# endif
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include "../util/Util.h"
|
||||
#include "String.hpp"
|
||||
|
||||
interface IStringReader
|
||||
INTERFACE IStringReader
|
||||
{
|
||||
virtual ~IStringReader() = default;
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
/**
|
||||
* Represents a zip file.
|
||||
*/
|
||||
interface IZipArchive
|
||||
INTERFACE IZipArchive
|
||||
{
|
||||
virtual ~IZipArchive()
|
||||
{
|
||||
|
|
|
@ -22,12 +22,12 @@ struct ScreenLine;
|
|||
struct ScreenRect;
|
||||
namespace OpenRCT2
|
||||
{
|
||||
interface IPlatformEnvironment;
|
||||
INTERFACE IPlatformEnvironment;
|
||||
}
|
||||
|
||||
namespace OpenRCT2::Drawing
|
||||
{
|
||||
interface IDrawingEngine;
|
||||
INTERFACE IDrawingEngine;
|
||||
}
|
||||
|
||||
struct PaletteBGRA
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
|
||||
namespace OpenRCT2::Drawing
|
||||
{
|
||||
interface IDrawingEngine;
|
||||
INTERFACE IDrawingEngine;
|
||||
|
||||
interface IDrawingContext
|
||||
INTERFACE IDrawingContext
|
||||
{
|
||||
virtual ~IDrawingContext()
|
||||
{
|
||||
|
|
|
@ -38,15 +38,15 @@ struct GamePalette;
|
|||
|
||||
namespace OpenRCT2::Ui
|
||||
{
|
||||
interface IUiContext;
|
||||
INTERFACE IUiContext;
|
||||
} // namespace OpenRCT2::Ui
|
||||
|
||||
namespace OpenRCT2::Drawing
|
||||
{
|
||||
enum class DRAWING_ENGINE_TYPE;
|
||||
interface IDrawingContext;
|
||||
INTERFACE IDrawingContext;
|
||||
|
||||
interface IDrawingEngine
|
||||
INTERFACE IDrawingEngine
|
||||
{
|
||||
virtual ~IDrawingEngine()
|
||||
{
|
||||
|
@ -75,7 +75,7 @@ namespace OpenRCT2::Drawing
|
|||
virtual void InvalidateImage(uint32_t image) abstract;
|
||||
};
|
||||
|
||||
interface IDrawingEngineFactory
|
||||
INTERFACE 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
|
||||
INTERFACE IRainDrawer
|
||||
{
|
||||
virtual ~IRainDrawer()
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@ struct rct_drawpixelinfo;
|
|||
|
||||
namespace OpenRCT2::Drawing
|
||||
{
|
||||
interface IRainDrawer;
|
||||
INTERFACE IRainDrawer;
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace OpenRCT2
|
|||
{
|
||||
namespace Ui
|
||||
{
|
||||
interface IUiContext;
|
||||
INTERFACE IUiContext;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Drawing
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
interface ILanguagePack
|
||||
INTERFACE ILanguagePack
|
||||
{
|
||||
virtual ~ILanguagePack() = default;
|
||||
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
#include <string_view>
|
||||
#include <tuple>
|
||||
|
||||
interface ILanguagePack;
|
||||
interface IObjectManager;
|
||||
INTERFACE ILanguagePack;
|
||||
INTERFACE IObjectManager;
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
interface IPlatformEnvironment;
|
||||
INTERFACE IPlatformEnvironment;
|
||||
}
|
||||
|
||||
namespace OpenRCT2::Localisation
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
# include <string>
|
||||
# include <vector>
|
||||
|
||||
interface IStream;
|
||||
INTERFACE IStream;
|
||||
|
||||
namespace Crypt
|
||||
{
|
||||
|
|
|
@ -20,7 +20,7 @@ enum class ADVERTISE_STATUS
|
|||
REGISTERED,
|
||||
};
|
||||
|
||||
interface INetworkServerAdvertiser
|
||||
INTERFACE INetworkServerAdvertiser
|
||||
{
|
||||
virtual ~INetworkServerAdvertiser()
|
||||
{
|
||||
|
|
|
@ -35,7 +35,7 @@ enum NETWORK_READPACKET
|
|||
/**
|
||||
* Represents an address and port.
|
||||
*/
|
||||
interface INetworkEndpoint
|
||||
INTERFACE INetworkEndpoint
|
||||
{
|
||||
virtual ~INetworkEndpoint()
|
||||
{
|
||||
|
@ -47,7 +47,7 @@ interface INetworkEndpoint
|
|||
/**
|
||||
* Represents a TCP socket / connection or listener.
|
||||
*/
|
||||
interface ITcpSocket
|
||||
INTERFACE ITcpSocket
|
||||
{
|
||||
public:
|
||||
virtual ~ITcpSocket() = default;
|
||||
|
@ -74,7 +74,7 @@ public:
|
|||
/**
|
||||
* Represents a UDP socket / listener.
|
||||
*/
|
||||
interface IUdpSocket
|
||||
INTERFACE IUdpSocket
|
||||
{
|
||||
public:
|
||||
virtual ~IUdpSocket() = default;
|
||||
|
|
|
@ -32,7 +32,7 @@ enum class PermissionState : uint8_t;
|
|||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
interface IPlatformEnvironment;
|
||||
INTERFACE IPlatformEnvironment;
|
||||
}
|
||||
|
||||
void network_set_env(const std::shared_ptr<OpenRCT2::IPlatformEnvironment>& env);
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
interface IReadObjectContext;
|
||||
interface IStream;
|
||||
INTERFACE IReadObjectContext;
|
||||
INTERFACE IStream;
|
||||
|
||||
class ImageTable
|
||||
{
|
||||
|
|
|
@ -134,13 +134,13 @@ struct rct_object_filters
|
|||
assert_struct_size(rct_object_filters, 3);
|
||||
#pragma pack(pop)
|
||||
|
||||
interface IObjectRepository;
|
||||
interface IStream;
|
||||
INTERFACE IObjectRepository;
|
||||
INTERFACE IStream;
|
||||
struct ObjectRepositoryItem;
|
||||
struct rct_drawpixelinfo;
|
||||
struct json_t;
|
||||
|
||||
interface IReadObjectContext
|
||||
INTERFACE IReadObjectContext
|
||||
{
|
||||
virtual ~IReadObjectContext() = default;
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
#include <algorithm>
|
||||
#include <unordered_map>
|
||||
|
||||
interface IFileDataRetriever
|
||||
INTERFACE 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;
|
||||
INTERFACE IObjectRepository;
|
||||
class Object;
|
||||
struct rct_object_entry;
|
||||
|
||||
|
|
|
@ -14,11 +14,11 @@
|
|||
|
||||
#include <vector>
|
||||
|
||||
interface IObjectRepository;
|
||||
INTERFACE IObjectRepository;
|
||||
class Object;
|
||||
struct ObjectRepositoryItem;
|
||||
|
||||
interface IObjectManager
|
||||
INTERFACE IObjectManager
|
||||
{
|
||||
virtual ~IObjectManager()
|
||||
{
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
interface IStream;
|
||||
INTERFACE IStream;
|
||||
class Object;
|
||||
namespace OpenRCT2
|
||||
{
|
||||
interface IPlatformEnvironment;
|
||||
INTERFACE IPlatformEnvironment;
|
||||
}
|
||||
|
||||
namespace OpenRCT2::Localisation
|
||||
|
@ -58,7 +58,7 @@ struct ObjectRepositoryItem
|
|||
}
|
||||
};
|
||||
|
||||
interface IObjectRepository
|
||||
INTERFACE IObjectRepository
|
||||
{
|
||||
virtual ~IObjectRepository() = default;
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
interface IReadObjectContext;
|
||||
interface IStream;
|
||||
INTERFACE IReadObjectContext;
|
||||
INTERFACE IStream;
|
||||
|
||||
enum OBJ_STRING_ID : uint8_t
|
||||
{
|
||||
|
|
|
@ -22,17 +22,17 @@ namespace OpenRCT2
|
|||
{
|
||||
namespace Drawing
|
||||
{
|
||||
interface IDrawingEngine;
|
||||
INTERFACE IDrawingEngine;
|
||||
} // namespace Drawing
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
interface IUiContext;
|
||||
INTERFACE IUiContext;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Paint
|
||||
{
|
||||
interface Painter final
|
||||
INTERFACE Painter final
|
||||
{
|
||||
private:
|
||||
std::shared_ptr<Ui::IUiContext> const _uiContext;
|
||||
|
|
|
@ -225,7 +225,7 @@ namespace Platform
|
|||
auto hModule = GetModuleHandleA("ntdll.dll");
|
||||
if (hModule != nullptr)
|
||||
{
|
||||
using RtlGetVersionPtr = NTSTATUS(WINAPI*)(PRTL_OSVERSIONINFOW);
|
||||
using RtlGetVersionPtr = long(WINAPI*)(PRTL_OSVERSIONINFOW);
|
||||
# if defined(__GNUC__) && __GNUC__ >= 8
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wcast-function-type"
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "../common.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
|
|
|
@ -16,7 +16,10 @@
|
|||
#ifdef _WIN32
|
||||
|
||||
// Windows.h needs to be included first
|
||||
// clang-format off
|
||||
# include <windows.h>
|
||||
# include <shellapi.h>
|
||||
// clang-format on
|
||||
|
||||
// Then the rest
|
||||
# include "../OpenRCT2.h"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#include <memory>
|
||||
|
||||
interface IStream;
|
||||
INTERFACE IStream;
|
||||
|
||||
/**
|
||||
* Reads sawyer encoding chunks from a data stream. This can be used to read
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include <memory>
|
||||
|
||||
interface IStream;
|
||||
INTERFACE IStream;
|
||||
|
||||
/**
|
||||
* Writes sawyer encoding chunks to a data stream. This can be used to write
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
#include "../common.h"
|
||||
|
||||
interface IStream;
|
||||
INTERFACE IStream;
|
||||
|
||||
enum class RCT12TrackDesignVersion : uint8_t;
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
interface IStream;
|
||||
INTERFACE IStream;
|
||||
struct ObjectRepositoryItem;
|
||||
struct RCT12SpriteBase;
|
||||
struct SpriteBase;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include <vector>
|
||||
|
||||
interface IStream;
|
||||
INTERFACE IStream;
|
||||
|
||||
/**
|
||||
* Class to export RollerCoaster Tycoon 2 track designs (*.TD6).
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include <limits>
|
||||
#include <string_view>
|
||||
|
||||
interface IObjectManager;
|
||||
INTERFACE IObjectManager;
|
||||
class Formatter;
|
||||
class StationObject;
|
||||
struct Peep;
|
||||
|
|
|
@ -24,10 +24,10 @@ struct track_design_file_ref
|
|||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
interface IPlatformEnvironment;
|
||||
INTERFACE IPlatformEnvironment;
|
||||
}
|
||||
|
||||
interface ITrackDesignRepository
|
||||
INTERFACE ITrackDesignRepository
|
||||
{
|
||||
virtual ~ITrackDesignRepository() = default;
|
||||
|
||||
|
|
|
@ -48,10 +48,10 @@ struct scenario_index_entry
|
|||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
interface IPlatformEnvironment;
|
||||
INTERFACE IPlatformEnvironment;
|
||||
}
|
||||
|
||||
interface IScenarioRepository
|
||||
INTERFACE IScenarioRepository
|
||||
{
|
||||
virtual ~IScenarioRepository() = default;
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ class InteractiveConsole;
|
|||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
interface IPlatformEnvironment;
|
||||
INTERFACE IPlatformEnvironment;
|
||||
}
|
||||
|
||||
namespace OpenRCT2::Scripting
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "../common.h"
|
||||
#include "../drawing/Drawing.h"
|
||||
|
||||
interface ITitleSequencePlayer;
|
||||
INTERFACE ITitleSequencePlayer;
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
#include "../common.h"
|
||||
|
||||
interface ITitleSequencePlayer
|
||||
INTERFACE ITitleSequencePlayer
|
||||
{
|
||||
virtual ~ITitleSequencePlayer() = default;
|
||||
|
||||
|
|
|
@ -19,21 +19,21 @@
|
|||
|
||||
struct ScreenCoordsXY;
|
||||
struct rct_drawpixelinfo;
|
||||
interface ITitleSequencePlayer;
|
||||
INTERFACE ITitleSequencePlayer;
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
namespace Drawing
|
||||
{
|
||||
interface IDrawingEngineFactory;
|
||||
interface IRainDrawer;
|
||||
INTERFACE IDrawingEngineFactory;
|
||||
INTERFACE 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;
|
||||
INTERFACE IWindowManager;
|
||||
|
||||
enum class FULLSCREEN_MODE
|
||||
{
|
||||
|
@ -87,7 +87,7 @@ namespace OpenRCT2
|
|||
/**
|
||||
* Represents the window or screen that OpenRCT2 is presented on.
|
||||
*/
|
||||
interface IUiContext
|
||||
INTERFACE IUiContext
|
||||
{
|
||||
virtual ~IUiContext() = default;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace OpenRCT2::Ui
|
|||
/**
|
||||
* Manager of in-game windows and widgets.
|
||||
*/
|
||||
interface IWindowManager
|
||||
INTERFACE IWindowManager
|
||||
{
|
||||
virtual ~IWindowManager() = default;
|
||||
virtual void Init() abstract;
|
||||
|
|
Loading…
Reference in New Issue