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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user