mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
Plumb through a ScreenRenderMode parameter
This commit is contained in:
parent
600fb7cc22
commit
22295a6412
@ -174,12 +174,12 @@ void ScreenManager::render() {
|
||||
// when screens are "compatible" (both are UIScreens, for example).
|
||||
first->screen->preRender();
|
||||
while (iter < last) {
|
||||
iter->screen->render();
|
||||
iter->screen->render(ScreenRenderMode::TOP);
|
||||
iter++;
|
||||
}
|
||||
stack_.back().screen->render();
|
||||
stack_.back().screen->render(ScreenRenderMode::TOP);
|
||||
if (overlayScreen_) {
|
||||
overlayScreen_->render();
|
||||
overlayScreen_->render(ScreenRenderMode::TOP);
|
||||
}
|
||||
if (postRenderCb_) {
|
||||
// Really can't render anything after this! Will crash the screenshot mechanism if we do.
|
||||
@ -191,9 +191,9 @@ void ScreenManager::render() {
|
||||
default:
|
||||
_assert_(stack_.back().screen);
|
||||
stack_.back().screen->preRender();
|
||||
stack_.back().screen->render();
|
||||
stack_.back().screen->render(ScreenRenderMode::TOP);
|
||||
if (overlayScreen_) {
|
||||
overlayScreen_->render();
|
||||
overlayScreen_->render(ScreenRenderMode::TOP);
|
||||
}
|
||||
if (postRenderCb_) {
|
||||
// Really can't render anything after this! Will crash the screenshot mechanism if we do.
|
||||
|
@ -47,6 +47,14 @@ enum class ScreenFocusChange {
|
||||
FOCUS_BECAME_TOP, // Became the top screen again
|
||||
};
|
||||
|
||||
enum class ScreenRenderMode {
|
||||
FIRST = 1,
|
||||
BACKGROUND = 2,
|
||||
BEHIND = 4,
|
||||
TOP = 8,
|
||||
};
|
||||
ENUM_CLASS_BITOPS(ScreenRenderMode);
|
||||
|
||||
class Screen {
|
||||
public:
|
||||
Screen() : screenManager_(nullptr) { }
|
||||
@ -57,7 +65,7 @@ public:
|
||||
virtual void onFinish(DialogResult reason) {}
|
||||
virtual void update() {}
|
||||
virtual void preRender() {}
|
||||
virtual void render() {}
|
||||
virtual void render(ScreenRenderMode mode) {}
|
||||
virtual void postRender() {}
|
||||
virtual void resized() {}
|
||||
virtual void dialogFinished(const Screen *dialog, DialogResult result) {}
|
||||
|
@ -216,7 +216,7 @@ void UIScreen::postRender() {
|
||||
screenManager()->getUIContext()->Flush();
|
||||
}
|
||||
|
||||
void UIScreen::render() {
|
||||
void UIScreen::render(ScreenRenderMode mode) {
|
||||
DoRecreateViews();
|
||||
|
||||
if (root_) {
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
|
||||
void update() override;
|
||||
void preRender() override;
|
||||
void render() override;
|
||||
void render(ScreenRenderMode mode) override;
|
||||
void postRender() override;
|
||||
void deviceLost() override;
|
||||
void deviceRestored() override;
|
||||
|
@ -713,8 +713,8 @@ void TouchTestScreen::axis(const AxisInput &axis) {
|
||||
UpdateLogView();
|
||||
}
|
||||
|
||||
void TouchTestScreen::render() {
|
||||
UIDialogScreenWithGameBackground::render();
|
||||
void TouchTestScreen::render(ScreenRenderMode mode) {
|
||||
UIDialogScreenWithGameBackground::render(mode);
|
||||
UIContext *ui_context = screenManager()->getUIContext();
|
||||
Bounds bounds = ui_context->GetLayoutBounds();
|
||||
|
||||
|
@ -147,7 +147,7 @@ public:
|
||||
}
|
||||
|
||||
void touch(const TouchInput &touch) override;
|
||||
void render() override;
|
||||
void render(ScreenRenderMode mode) override;
|
||||
|
||||
bool key(const KeyInput &key) override;
|
||||
void axis(const AxisInput &axis) override;
|
||||
|
@ -1447,7 +1447,7 @@ void EmuScreen::postRender() {
|
||||
draw->WipeQueue();
|
||||
}
|
||||
|
||||
void EmuScreen::render() {
|
||||
void EmuScreen::render(ScreenRenderMode mode) {
|
||||
using namespace Draw;
|
||||
|
||||
DrawContext *thin3d = screenManager()->getDrawContext();
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
const char *tag() const override { return "Emu"; }
|
||||
|
||||
void update() override;
|
||||
void render() override;
|
||||
void render(ScreenRenderMode mode) override;
|
||||
void preRender() override;
|
||||
void postRender() override;
|
||||
void dialogFinished(const Screen *dialog, DialogResult result) override;
|
||||
|
@ -630,9 +630,9 @@ void GPUDriverTestScreen::ShaderTest() {
|
||||
}
|
||||
|
||||
|
||||
void GPUDriverTestScreen::render() {
|
||||
void GPUDriverTestScreen::render(ScreenRenderMode mode) {
|
||||
using namespace Draw;
|
||||
UIScreen::render();
|
||||
UIScreen::render(mode);
|
||||
|
||||
switch (tabHolder_->GetCurrentTab()) {
|
||||
case 0:
|
||||
|
@ -15,7 +15,7 @@ public:
|
||||
~GPUDriverTestScreen();
|
||||
|
||||
void CreateViews() override;
|
||||
void render() override;
|
||||
void render(ScreenRenderMode mode) override;
|
||||
|
||||
const char *tag() const override { return "GPUDriverTest"; }
|
||||
|
||||
|
@ -274,8 +274,8 @@ UI::EventReturn GameScreen::OnDeleteConfig(UI::EventParams &e)
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
void GameScreen::render() {
|
||||
UIScreen::render();
|
||||
void GameScreen::render(ScreenRenderMode mode) {
|
||||
UIScreen::render(mode);
|
||||
|
||||
auto ga = GetI18NCategory(I18NCat::GAME);
|
||||
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
|
||||
void update() override;
|
||||
|
||||
void render() override;
|
||||
void render(ScreenRenderMode mode) override;
|
||||
|
||||
const char *tag() const override { return "Game"; }
|
||||
|
||||
|
@ -52,11 +52,11 @@ protected:
|
||||
|
||||
void dialogFinished(const Screen *dialog, DialogResult result) override;
|
||||
void update() override;
|
||||
void render() override {
|
||||
void render(ScreenRenderMode mode) override {
|
||||
// Simple anti-flicker due to delayed finish.
|
||||
if (!done_) {
|
||||
// render as usual.
|
||||
UIDialogScreenWithBackground::render();
|
||||
UIDialogScreenWithBackground::render(mode);
|
||||
} else {
|
||||
// no render. black frame insertion is better than flicker.
|
||||
}
|
||||
|
@ -756,10 +756,10 @@ void LogoScreen::touch(const TouchInput &touch) {
|
||||
}
|
||||
}
|
||||
|
||||
void LogoScreen::render() {
|
||||
void LogoScreen::render(ScreenRenderMode mode) {
|
||||
using namespace Draw;
|
||||
|
||||
UIScreen::render();
|
||||
UIScreen::render(mode);
|
||||
UIContext &dc = *screenManager()->getUIContext();
|
||||
|
||||
const Bounds &bounds = dc.GetBounds();
|
||||
@ -895,8 +895,8 @@ void CreditsScreen::update() {
|
||||
UpdateUIState(UISTATE_MENU);
|
||||
}
|
||||
|
||||
void CreditsScreen::render() {
|
||||
UIScreen::render();
|
||||
void CreditsScreen::render(ScreenRenderMode mode) {
|
||||
UIScreen::render(mode);
|
||||
|
||||
auto cr = GetI18NCategory(I18NCat::PSPCREDITS);
|
||||
|
||||
|
@ -140,7 +140,7 @@ public:
|
||||
bool key(const KeyInput &key) override;
|
||||
void touch(const TouchInput &touch) override;
|
||||
void update() override;
|
||||
void render() override;
|
||||
void render(ScreenRenderMode mode) override;
|
||||
void sendMessage(UIMessage message, const char *value) override;
|
||||
void CreateViews() override {}
|
||||
|
||||
@ -158,7 +158,7 @@ class CreditsScreen : public UIDialogScreenWithBackground {
|
||||
public:
|
||||
CreditsScreen();
|
||||
void update() override;
|
||||
void render() override;
|
||||
void render(ScreenRenderMode mode) override;
|
||||
|
||||
void CreateViews() override;
|
||||
|
||||
|
@ -517,8 +517,8 @@ void OSDOverlayScreen::CreateViews() {
|
||||
osmView_ = root_->Add(new OnScreenMessagesView(new UI::AnchorLayoutParams(0.0f, 0.0f, 0.0f, 0.0f)));
|
||||
}
|
||||
|
||||
void OSDOverlayScreen::render() {
|
||||
UIScreen::render();
|
||||
void OSDOverlayScreen::render(ScreenRenderMode mode) {
|
||||
UIScreen::render(mode);
|
||||
|
||||
DebugOverlay debugOverlay = (DebugOverlay)g_Config.iDebugOverlay;
|
||||
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
bool UnsyncTouch(const TouchInput &touch) override;
|
||||
|
||||
void CreateViews() override;
|
||||
void render() override;
|
||||
void render(ScreenRenderMode mode) override;
|
||||
void update() override;
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user