1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-28 09:14:58 +01:00

Move paint_session_alloc and paint_session_free into Painter.

This commit is contained in:
Matt
2019-02-19 16:26:11 +01:00
parent db96df010f
commit 65ef018e4e
6 changed files with 78 additions and 48 deletions

View File

@@ -133,6 +133,7 @@ namespace OpenRCT2
, _audioContext(audioContext)
, _uiContext(uiContext)
, _localisationService(std::make_unique<LocalisationService>(env))
, _painter(std::make_unique<Painter>(uiContext))
{
// Can't have more than one context currently.
Guard::Assert(Instance == nullptr);
@@ -415,6 +416,7 @@ namespace OpenRCT2
lightfx_init();
#endif
}
gScenarioTicks = 0;
util_srand((uint32_t)time(nullptr));
input_reset_place_obj_modifier();
@@ -430,7 +432,6 @@ namespace OpenRCT2
void InitialiseDrawingEngine() final override
{
assert(_drawingEngine == nullptr);
assert(_painter == nullptr);
_drawingEngineType = gConfigGeneral.drawing_engine;
@@ -457,7 +458,6 @@ namespace OpenRCT2
}
else
{
_painter = std::make_unique<Painter>(_uiContext);
try
{
drawingEngine->Initialise();
@@ -466,7 +466,6 @@ namespace OpenRCT2
}
catch (const std::exception& ex)
{
_painter = nullptr;
if (_drawingEngineType == DRAWING_ENGINE_SOFTWARE)
{
_drawingEngineType = DRAWING_ENGINE_NONE;
@@ -491,7 +490,6 @@ namespace OpenRCT2
void DisposeDrawingEngine() final override
{
_drawingEngine = nullptr;
_painter = nullptr;
}
bool LoadParkFromFile(const std::string& path, bool loadTitleScreenOnFail) final override