1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 03:53:07 +01:00

Remove PlainContext

This commit is contained in:
Ted John
2018-05-05 11:12:45 +01:00
parent 302fe00805
commit 8eacc3582c
3 changed files with 7 additions and 25 deletions

View File

@@ -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++)

View File

@@ -125,6 +125,7 @@ namespace OpenRCT2
public:
KeyboardShortcuts(const std::shared_ptr<IPlatformEnvironment>& env);
~KeyboardShortcuts();
void Reset();
bool Load();

View File

@@ -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(