1
0
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:
Ted John
2016-06-05 16:41:35 +01:00
parent a8fed0c4b8
commit 932dec75d0
6 changed files with 43 additions and 5 deletions

View File

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

View File

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

View File

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

View File

@@ -202,6 +202,11 @@ public:
return _drawingContext;
}
DRAWING_ENGINE_FLAGS GetFlags() override
{
return DEF_NONE;
}
rct_drawpixelinfo * GetDPI()
{
return &_bitsDPI;

View File

@@ -327,6 +327,11 @@ public:
return _drawingContext;
}
DRAWING_ENGINE_FLAGS GetFlags() override
{
return DEF_DIRTY_OPTIMISATIONS;
}
rct_drawpixelinfo * GetDPI()
{
return &_bitsDPI;