Graphics: Expose "fixed_aspect_ratio" as attribute

This commit is contained in:
Jonas Kulla 2017-03-02 11:56:55 +01:00
parent 85452bf2cf
commit ea742be6b0
3 changed files with 20 additions and 0 deletions

View file

@ -1024,6 +1024,20 @@ void Graphics::setShowCursor(bool value)
p->threadData->ethread->requestShowCursor(value);
}
bool Graphics::getFixedAspectRatio() const
{
// It's a bit hacky to expose config values as a Graphics
// attribute, but there's really no point in state duplication
return shState->config().fixedAspectRatio;
}
void Graphics::setFixedAspectRatio(bool value)
{
shState->config().fixedAspectRatio = value;
p->recalculateScreenSize(p->threadData);
p->updateScreenResoRatio(p->threadData);
}
Scene *Graphics::getScreen() const
{
return &p->screen;

View file

@ -62,6 +62,8 @@ public:
DECL_ATTR( Fullscreen, bool )
DECL_ATTR( ShowCursor, bool )
DECL_ATTR( FixedAspectRatio, bool )
/* <internal> */
Scene *getScreen() const;
/* Repaint screen with static image until exitCond