mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-29 09:44:52 +01:00
do not shift viewport pixels on OpenGL
This commit is contained in:
@@ -23,6 +23,16 @@
|
||||
struct rct_drawpixelinfo;
|
||||
interface IDrawingContext;
|
||||
|
||||
enum DRAWING_ENGINE_FLAGS
|
||||
{
|
||||
DEF_NONE = 0,
|
||||
|
||||
/**
|
||||
* Whether or not the engine will only draw changed blocks of the screen each frame.
|
||||
*/
|
||||
DEF_DIRTY_OPTIMISATIONS = 1 << 0,
|
||||
};
|
||||
|
||||
interface IDrawingEngine
|
||||
{
|
||||
virtual ~IDrawingEngine() { }
|
||||
@@ -36,6 +46,8 @@ interface IDrawingEngine
|
||||
virtual sint32 Screenshot() abstract;
|
||||
|
||||
virtual IDrawingContext * GetDrawingContext(rct_drawpixelinfo * dpi) abstract;
|
||||
|
||||
virtual DRAWING_ENGINE_FLAGS GetFlags() abstract;
|
||||
};
|
||||
|
||||
namespace DrawingEngineFactory
|
||||
|
||||
@@ -66,6 +66,16 @@ extern "C"
|
||||
_drawingEngine = nullptr;
|
||||
}
|
||||
|
||||
bool drawing_engine_has_dirty_optimisations()
|
||||
{
|
||||
bool result = false;
|
||||
if (_drawingEngine != nullptr)
|
||||
{
|
||||
result = (_drawingEngine->GetFlags() & DEF_DIRTY_OPTIMISATIONS);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void gfx_set_dirty_blocks(sint16 left, sint16 top, sint16 right, sint16 bottom)
|
||||
{
|
||||
if (_drawingEngine != nullptr)
|
||||
|
||||
@@ -27,6 +27,8 @@ void drawing_engine_set_palette(SDL_Color * colours);
|
||||
void drawing_engine_draw();
|
||||
void drawing_engine_dispose();
|
||||
|
||||
bool drawing_engine_has_dirty_optimisations();
|
||||
|
||||
#ifdef _cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -202,6 +202,11 @@ public:
|
||||
return _drawingContext;
|
||||
}
|
||||
|
||||
DRAWING_ENGINE_FLAGS GetFlags() override
|
||||
{
|
||||
return DEF_NONE;
|
||||
}
|
||||
|
||||
rct_drawpixelinfo * GetDPI()
|
||||
{
|
||||
return &_bitsDPI;
|
||||
|
||||
@@ -327,6 +327,11 @@ public:
|
||||
return _drawingContext;
|
||||
}
|
||||
|
||||
DRAWING_ENGINE_FLAGS GetFlags() override
|
||||
{
|
||||
return DEF_DIRTY_OPTIMISATIONS;
|
||||
}
|
||||
|
||||
rct_drawpixelinfo * GetDPI()
|
||||
{
|
||||
return &_bitsDPI;
|
||||
|
||||
Reference in New Issue
Block a user