mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-17 03:53:07 +01:00
Remove PlainContext
This commit is contained in:
@@ -38,6 +38,11 @@ KeyboardShortcuts::KeyboardShortcuts(const std::shared_ptr<IPlatformEnvironment>
|
||||
_instance = this;
|
||||
}
|
||||
|
||||
KeyboardShortcuts::~KeyboardShortcuts()
|
||||
{
|
||||
_instance = nullptr;
|
||||
}
|
||||
|
||||
void KeyboardShortcuts::Reset()
|
||||
{
|
||||
for (size_t i = 0; i < SHORTCUT_COUNT; i++)
|
||||
|
||||
@@ -125,6 +125,7 @@ namespace OpenRCT2
|
||||
|
||||
public:
|
||||
KeyboardShortcuts(const std::shared_ptr<IPlatformEnvironment>& env);
|
||||
~KeyboardShortcuts();
|
||||
|
||||
void Reset();
|
||||
bool Load();
|
||||
|
||||
@@ -918,35 +918,11 @@ namespace OpenRCT2
|
||||
}
|
||||
};
|
||||
|
||||
class PlainContext final : public Context
|
||||
{
|
||||
std::shared_ptr<IPlatformEnvironment> _env;
|
||||
std::shared_ptr<IAudioContext> _audioContext;
|
||||
std::shared_ptr<IUiContext> _uiContext;
|
||||
|
||||
public:
|
||||
PlainContext()
|
||||
: PlainContext(CreatePlatformEnvironment(), CreateDummyAudioContext(), CreateDummyUiContext())
|
||||
{
|
||||
}
|
||||
|
||||
PlainContext(
|
||||
const std::shared_ptr<IPlatformEnvironment>& env,
|
||||
const std::shared_ptr<IAudioContext>& audioContext,
|
||||
const std::shared_ptr<IUiContext>& uiContext)
|
||||
: Context(env, audioContext, uiContext),
|
||||
_env(env),
|
||||
_audioContext(audioContext),
|
||||
_uiContext(uiContext)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
Context * Context::Instance = nullptr;
|
||||
|
||||
std::unique_ptr<IContext> CreateContext()
|
||||
{
|
||||
return std::make_unique<PlainContext>();
|
||||
return std::make_unique<Context>(CreatePlatformEnvironment(), CreateDummyAudioContext(), CreateDummyUiContext());
|
||||
}
|
||||
|
||||
std::unique_ptr<IContext> CreateContext(
|
||||
|
||||
Reference in New Issue
Block a user