UI: Fix tiny reverse dependency.

This commit is contained in:
Unknown W. Brackets 2022-12-27 15:18:35 -08:00
parent 682f5fae97
commit 68fb7a477d
3 changed files with 9 additions and 3 deletions

View File

@ -2,7 +2,6 @@
#include <algorithm>
#include "Core/Config.h"
#include "Common/System/Display.h"
#include "Common/System/System.h"
#include "Common/UI/UI.h"
@ -62,11 +61,14 @@ void UIContext::BeginFrame() {
}
uidrawbufferTop_->SetCurZ(0.0f);
uidrawbuffer_->SetCurZ(0.0f);
uidrawbuffer_->SetTintSaturation(g_Config.fUITint, g_Config.fUISaturation);
uidrawbufferTop_->SetTintSaturation(g_Config.fUITint, g_Config.fUISaturation);
ActivateTopScissor();
}
void UIContext::SetTintSaturation(float tint, float sat) {
uidrawbuffer_->SetTintSaturation(tint, sat);
uidrawbufferTop_->SetTintSaturation(tint, sat);
}
void UIContext::Begin() {
BeginPipeline(ui_pipeline_, sampler_);
}

View File

@ -75,6 +75,8 @@ public:
// Utility methods
TextDrawer *Text() const { return textDrawer_; }
void SetTintSaturation(float tint, float sat);
void SetFontStyle(const UI::FontStyle &style);
const UI::FontStyle &GetFontStyle() { return *fontStyle_; }
void SetFontScale(float scaleX, float scaleY);

View File

@ -1138,6 +1138,8 @@ void NativeRender(GraphicsContext *graphicsContext) {
ui_draw2d.PushDrawMatrix(ortho);
ui_draw2d_front.PushDrawMatrix(ortho);
screenManager->getUIContext()->SetTintSaturation(g_Config.fUITint, g_Config.fUISaturation);
// All actual rendering happen in here.
screenManager->render();
if (screenManager->getUIContext()->Text()) {