mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-27 02:10:34 +00:00
PPGe: Allow overriding text drawer DPI scale.
This commit is contained in:
parent
70b07f20c9
commit
5141dc7e91
@ -35,6 +35,8 @@ void TextDrawer::SetFontScale(float xscale, float yscale) {
|
||||
}
|
||||
|
||||
float TextDrawer::CalculateDPIScale() {
|
||||
if (ignoreGlobalDpi_)
|
||||
return dpiScale_;
|
||||
float scale = g_dpi_scale_y;
|
||||
if (scale >= 1.0f) {
|
||||
scale = 1.0f;
|
||||
|
@ -64,6 +64,10 @@ public:
|
||||
virtual void OncePerFrame() = 0;
|
||||
|
||||
float CalculateDPIScale();
|
||||
void SetForcedDPIScale(float dpi) {
|
||||
dpiScale_ = dpi;
|
||||
ignoreGlobalDpi_ = true;
|
||||
}
|
||||
|
||||
// Factory function that selects implementation.
|
||||
static TextDrawer *Create(Draw::DrawContext *draw);
|
||||
@ -87,10 +91,11 @@ protected:
|
||||
uint32_t fontHash;
|
||||
};
|
||||
|
||||
int frameCount_;
|
||||
float fontScaleX_;
|
||||
float fontScaleY_;
|
||||
float dpiScale_;
|
||||
int frameCount_ = 0;
|
||||
float fontScaleX_ = 1.0f;
|
||||
float fontScaleY_ = 1.0f;
|
||||
float dpiScale_ = 1.0f;
|
||||
bool ignoreGlobalDpi_ = false;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user