mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Implement running the game in the background on the pause screen. Fix some bugs.
This commit is contained in:
parent
9f01661774
commit
e8f70594a4
25 changed files with 123 additions and 120 deletions
|
@ -154,7 +154,8 @@ void ScreenManager::resized() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenManager::render() {
|
ScreenRenderFlags ScreenManager::render() {
|
||||||
|
ScreenRenderFlags flags = ScreenRenderFlags::NONE;
|
||||||
if (!stack_.empty()) {
|
if (!stack_.empty()) {
|
||||||
// Collect the screens to render
|
// Collect the screens to render
|
||||||
TinySet<Screen *, 6> layers;
|
TinySet<Screen *, 6> layers;
|
||||||
|
@ -169,12 +170,12 @@ void ScreenManager::render() {
|
||||||
Screen *backgroundScreen = nullptr;
|
Screen *backgroundScreen = nullptr;
|
||||||
do {
|
do {
|
||||||
--iter;
|
--iter;
|
||||||
if (!coveringScreen) {
|
if (!backgroundScreen && iter->screen->canBeBackground()) {
|
||||||
layers.push_back(iter->screen);
|
|
||||||
} else if (!backgroundScreen && iter->screen->canBeBackground()) {
|
|
||||||
// There still might be a screen that wants to be background - generally the EmuScreen if present.
|
// There still might be a screen that wants to be background - generally the EmuScreen if present.
|
||||||
layers.push_back(iter->screen);
|
layers.push_back(iter->screen);
|
||||||
backgroundScreen = iter->screen;
|
backgroundScreen = iter->screen;
|
||||||
|
} else if (!coveringScreen) {
|
||||||
|
layers.push_back(iter->screen);
|
||||||
}
|
}
|
||||||
if (iter->flags != LAYER_TRANSPARENT) {
|
if (iter->flags != LAYER_TRANSPARENT) {
|
||||||
coveringScreen = iter->screen;
|
coveringScreen = iter->screen;
|
||||||
|
@ -194,9 +195,6 @@ void ScreenManager::render() {
|
||||||
if (i == (int)layers.size() - 1) {
|
if (i == (int)layers.size() - 1) {
|
||||||
// Bottom.
|
// Bottom.
|
||||||
mode = ScreenRenderMode::FIRST;
|
mode = ScreenRenderMode::FIRST;
|
||||||
if (layers[i] == backgroundScreen && coveringScreen != layers[i]) {
|
|
||||||
mode |= ScreenRenderMode::BACKGROUND;
|
|
||||||
}
|
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
mode |= ScreenRenderMode::TOP;
|
mode |= ScreenRenderMode::TOP;
|
||||||
}
|
}
|
||||||
|
@ -205,12 +203,12 @@ void ScreenManager::render() {
|
||||||
} else {
|
} else {
|
||||||
mode = ScreenRenderMode::BEHIND;
|
mode = ScreenRenderMode::BEHIND;
|
||||||
}
|
}
|
||||||
layers[i]->render(mode);
|
flags |= layers[i]->render(mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (overlayScreen_) {
|
if (overlayScreen_) {
|
||||||
// It doesn't care about mode.
|
// It doesn't care about mode.
|
||||||
overlayScreen_->render(ScreenRenderMode::TOP);
|
flags |= overlayScreen_->render(ScreenRenderMode::TOP);
|
||||||
}
|
}
|
||||||
|
|
||||||
getUIContext()->Flush();
|
getUIContext()->Flush();
|
||||||
|
@ -224,6 +222,7 @@ void ScreenManager::render() {
|
||||||
}
|
}
|
||||||
|
|
||||||
processFinishDialog();
|
processFinishDialog();
|
||||||
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenManager::getFocusPosition(float &x, float &y, float &z) {
|
void ScreenManager::getFocusPosition(float &x, float &y, float &z) {
|
||||||
|
|
|
@ -50,12 +50,17 @@ enum class ScreenFocusChange {
|
||||||
enum class ScreenRenderMode {
|
enum class ScreenRenderMode {
|
||||||
DEFAULT = 0,
|
DEFAULT = 0,
|
||||||
FIRST = 1,
|
FIRST = 1,
|
||||||
BACKGROUND = 2,
|
|
||||||
BEHIND = 4,
|
BEHIND = 4,
|
||||||
TOP = 8,
|
TOP = 8,
|
||||||
};
|
};
|
||||||
ENUM_CLASS_BITOPS(ScreenRenderMode);
|
ENUM_CLASS_BITOPS(ScreenRenderMode);
|
||||||
|
|
||||||
|
enum class ScreenRenderFlags {
|
||||||
|
NONE = 0,
|
||||||
|
HANDLED_THROTTLING = 1,
|
||||||
|
};
|
||||||
|
ENUM_CLASS_BITOPS(ScreenRenderFlags);
|
||||||
|
|
||||||
class Screen {
|
class Screen {
|
||||||
public:
|
public:
|
||||||
Screen() : screenManager_(nullptr) { }
|
Screen() : screenManager_(nullptr) { }
|
||||||
|
@ -65,7 +70,7 @@ public:
|
||||||
|
|
||||||
virtual void onFinish(DialogResult reason) {}
|
virtual void onFinish(DialogResult reason) {}
|
||||||
virtual void update() {}
|
virtual void update() {}
|
||||||
virtual void render(ScreenRenderMode mode) {}
|
virtual ScreenRenderFlags render(ScreenRenderMode mode) = 0;
|
||||||
virtual void resized() {}
|
virtual void resized() {}
|
||||||
virtual void dialogFinished(const Screen *dialog, DialogResult result) {}
|
virtual void dialogFinished(const Screen *dialog, DialogResult result) {}
|
||||||
virtual void sendMessage(UIMessage message, const char *value) {}
|
virtual void sendMessage(UIMessage message, const char *value) {}
|
||||||
|
@ -128,7 +133,7 @@ public:
|
||||||
postRenderUserdata_ = userdata;
|
postRenderUserdata_ = userdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
void render();
|
ScreenRenderFlags render();
|
||||||
void resized();
|
void resized();
|
||||||
void shutdown();
|
void shutdown();
|
||||||
|
|
||||||
|
|
|
@ -212,27 +212,32 @@ void UIScreen::SetupViewport() {
|
||||||
draw->SetTargetSize(g_display.pixel_xres, g_display.pixel_yres);
|
draw->SetTargetSize(g_display.pixel_xres, g_display.pixel_yres);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UIScreen::render(ScreenRenderMode mode) {
|
ScreenRenderFlags UIScreen::render(ScreenRenderMode mode) {
|
||||||
if (mode & ScreenRenderMode::FIRST) {
|
if (mode & ScreenRenderMode::FIRST) {
|
||||||
SetupViewport();
|
SetupViewport();
|
||||||
}
|
}
|
||||||
|
|
||||||
DoRecreateViews();
|
DoRecreateViews();
|
||||||
|
|
||||||
|
UIContext &uiContext = *screenManager()->getUIContext();
|
||||||
if (root_) {
|
if (root_) {
|
||||||
UIContext &uiContext = *screenManager()->getUIContext();
|
|
||||||
|
|
||||||
UI::LayoutViewHierarchy(uiContext, root_, ignoreInsets_);
|
UI::LayoutViewHierarchy(uiContext, root_, ignoreInsets_);
|
||||||
|
|
||||||
uiContext.PushTransform({translation_, scale_, alpha_});
|
|
||||||
|
|
||||||
uiContext.Begin();
|
|
||||||
DrawBackground(uiContext);
|
|
||||||
root_->Draw(uiContext);
|
|
||||||
uiContext.Flush();
|
|
||||||
|
|
||||||
uiContext.PopTransform();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uiContext.PushTransform({translation_, scale_, alpha_});
|
||||||
|
|
||||||
|
uiContext.Begin();
|
||||||
|
DrawBackground(uiContext);
|
||||||
|
if (root_) {
|
||||||
|
root_->Draw(uiContext);
|
||||||
|
}
|
||||||
|
uiContext.Flush();
|
||||||
|
DrawForeground(uiContext);
|
||||||
|
uiContext.Flush();
|
||||||
|
|
||||||
|
uiContext.PopTransform();
|
||||||
|
|
||||||
|
return ScreenRenderFlags::NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
TouchInput UIScreen::transformTouch(const TouchInput &touch) {
|
TouchInput UIScreen::transformTouch(const TouchInput &touch) {
|
||||||
|
|
|
@ -36,7 +36,7 @@ public:
|
||||||
~UIScreen();
|
~UIScreen();
|
||||||
|
|
||||||
void update() override;
|
void update() override;
|
||||||
void render(ScreenRenderMode mode) override;
|
ScreenRenderFlags render(ScreenRenderMode mode) override;
|
||||||
void deviceLost() override;
|
void deviceLost() override;
|
||||||
void deviceRestored() override;
|
void deviceRestored() override;
|
||||||
|
|
||||||
|
@ -72,6 +72,8 @@ protected:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void DrawBackground(UIContext &ui) {}
|
virtual void DrawBackground(UIContext &ui) {}
|
||||||
|
virtual void DrawForeground(UIContext &ui) {}
|
||||||
|
|
||||||
void SetupViewport();
|
void SetupViewport();
|
||||||
void DoRecreateViews();
|
void DoRecreateViews();
|
||||||
|
|
||||||
|
|
|
@ -297,6 +297,8 @@ static const ConfigSetting generalSettings[] = {
|
||||||
ConfigSetting("EnablePlugins", &g_Config.bLoadPlugins, true, CfgFlag::PER_GAME),
|
ConfigSetting("EnablePlugins", &g_Config.bLoadPlugins, true, CfgFlag::PER_GAME),
|
||||||
|
|
||||||
ConfigSetting("IgnoreCompatSettings", &g_Config.sIgnoreCompatSettings, "", CfgFlag::PER_GAME | CfgFlag::REPORT),
|
ConfigSetting("IgnoreCompatSettings", &g_Config.sIgnoreCompatSettings, "", CfgFlag::PER_GAME | CfgFlag::REPORT),
|
||||||
|
|
||||||
|
ConfigSetting("RunBehindPauseMenu", &g_Config.bRunBehindPauseMenu, false, CfgFlag::DEFAULT),
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool DefaultSasThread() {
|
static bool DefaultSasThread() {
|
||||||
|
|
|
@ -99,9 +99,10 @@ public:
|
||||||
|
|
||||||
// Not used on mobile devices.
|
// Not used on mobile devices.
|
||||||
bool bPauseExitsEmulator;
|
bool bPauseExitsEmulator;
|
||||||
|
|
||||||
bool bPauseMenuExitsEmulator;
|
bool bPauseMenuExitsEmulator;
|
||||||
|
|
||||||
|
bool bRunBehindPauseMenu;
|
||||||
|
|
||||||
// Core
|
// Core
|
||||||
bool bIgnoreBadMemAccess;
|
bool bIgnoreBadMemAccess;
|
||||||
|
|
||||||
|
|
|
@ -302,10 +302,6 @@ void BackgroundAudio::SetGame(const Path &path) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BackgroundAudio::Play() {
|
bool BackgroundAudio::Play() {
|
||||||
if (GetUIState() == UISTATE_INGAME) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::lock_guard<std::mutex> lock(mutex_);
|
std::lock_guard<std::mutex> lock(mutex_);
|
||||||
|
|
||||||
// Immediately stop the sound if it is turned off while playing.
|
// Immediately stop the sound if it is turned off while playing.
|
||||||
|
|
|
@ -713,27 +713,25 @@ void TouchTestScreen::axis(const AxisInput &axis) {
|
||||||
UpdateLogView();
|
UpdateLogView();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TouchTestScreen::render(ScreenRenderMode mode) {
|
void TouchTestScreen::DrawForeground(UIContext &dc) {
|
||||||
UIDialogScreenWithGameBackground::render(mode);
|
Bounds bounds = dc.GetLayoutBounds();
|
||||||
UIContext *ui_context = screenManager()->getUIContext();
|
|
||||||
Bounds bounds = ui_context->GetLayoutBounds();
|
|
||||||
|
|
||||||
ui_context->BeginNoTex();
|
dc.BeginNoTex();
|
||||||
for (int i = 0; i < MAX_TOUCH_POINTS; i++) {
|
for (int i = 0; i < MAX_TOUCH_POINTS; i++) {
|
||||||
if (touches_[i].id != -1) {
|
if (touches_[i].id != -1) {
|
||||||
ui_context->Draw()->Circle(touches_[i].x, touches_[i].y, 100.0, 3.0, 80, 0.0f, 0xFFFFFFFF, 1.0);
|
dc.Draw()->Circle(touches_[i].x, touches_[i].y, 100.0, 3.0, 80, 0.0f, 0xFFFFFFFF, 1.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ui_context->Flush();
|
dc.Flush();
|
||||||
|
|
||||||
ui_context->Begin();
|
dc.Begin();
|
||||||
|
|
||||||
char buffer[4096];
|
char buffer[4096];
|
||||||
for (int i = 0; i < MAX_TOUCH_POINTS; i++) {
|
for (int i = 0; i < MAX_TOUCH_POINTS; i++) {
|
||||||
if (touches_[i].id != -1) {
|
if (touches_[i].id != -1) {
|
||||||
ui_context->Draw()->Circle(touches_[i].x, touches_[i].y, 100.0, 3.0, 80, 0.0f, 0xFFFFFFFF, 1.0);
|
dc.Draw()->Circle(touches_[i].x, touches_[i].y, 100.0, 3.0, 80, 0.0f, 0xFFFFFFFF, 1.0);
|
||||||
snprintf(buffer, sizeof(buffer), "%0.1fx%0.1f", touches_[i].x, touches_[i].y);
|
snprintf(buffer, sizeof(buffer), "%0.1fx%0.1f", touches_[i].x, touches_[i].y);
|
||||||
ui_context->DrawText(buffer, touches_[i].x, touches_[i].y + (touches_[i].y > g_display.dp_yres - 100.0f ? -135.0f : 95.0f), 0xFFFFFFFF, ALIGN_HCENTER | FLAG_DYNAMIC_ASCII);
|
dc.DrawText(buffer, touches_[i].x, touches_[i].y + (touches_[i].y > g_display.dp_yres - 100.0f ? -135.0f : 95.0f), 0xFFFFFFFF, ALIGN_HCENTER | FLAG_DYNAMIC_ASCII);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -762,8 +760,8 @@ void TouchTestScreen::render(ScreenRenderMode mode) {
|
||||||
// On Android, also add joystick debug data.
|
// On Android, also add joystick debug data.
|
||||||
|
|
||||||
|
|
||||||
ui_context->DrawTextShadow(buffer, bounds.centerX(), bounds.y + 20.0f, 0xFFFFFFFF, FLAG_DYNAMIC_ASCII);
|
dc.DrawTextShadow(buffer, bounds.centerX(), bounds.y + 20.0f, 0xFFFFFFFF, FLAG_DYNAMIC_ASCII);
|
||||||
ui_context->Flush();
|
dc.Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RecreateActivity() {
|
void RecreateActivity() {
|
||||||
|
@ -799,8 +797,7 @@ UI::EventReturn TouchTestScreen::OnRecreateActivity(UI::EventParams &e) {
|
||||||
|
|
||||||
class Backplate : public UI::InertView {
|
class Backplate : public UI::InertView {
|
||||||
public:
|
public:
|
||||||
Backplate(float scale, UI::LayoutParams *layoutParams = nullptr) : InertView(layoutParams), scale_(scale) {
|
Backplate(float scale, UI::LayoutParams *layoutParams = nullptr) : InertView(layoutParams), scale_(scale) {}
|
||||||
}
|
|
||||||
|
|
||||||
void Draw(UIContext &dc) override {
|
void Draw(UIContext &dc) override {
|
||||||
for (float dy = 0.0f; dy <= 4.0f; dy += 1.0f) {
|
for (float dy = 0.0f; dy <= 4.0f; dy += 1.0f) {
|
||||||
|
|
|
@ -147,7 +147,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void touch(const TouchInput &touch) override;
|
void touch(const TouchInput &touch) override;
|
||||||
void render(ScreenRenderMode mode) override;
|
void DrawForeground(UIContext &dc) override;
|
||||||
|
|
||||||
bool key(const KeyInput &key) override;
|
bool key(const KeyInput &key) override;
|
||||||
void axis(const AxisInput &axis) override;
|
void axis(const AxisInput &axis) override;
|
||||||
|
|
|
@ -1438,12 +1438,17 @@ void EmuScreen::darken() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmuScreen::render(ScreenRenderMode mode) {
|
ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
|
||||||
|
ScreenRenderFlags flags = ScreenRenderFlags::NONE;
|
||||||
|
using namespace Draw;
|
||||||
|
|
||||||
|
DrawContext *draw = screenManager()->getDrawContext();
|
||||||
|
if (!draw)
|
||||||
|
return flags; // shouldn't really happen but I've seen a suspicious stack trace..
|
||||||
|
|
||||||
if (mode & ScreenRenderMode::FIRST) {
|
if (mode & ScreenRenderMode::FIRST) {
|
||||||
// Actually, always gonna be first when it exists (?)
|
// Actually, always gonna be first when it exists (?)
|
||||||
|
|
||||||
using namespace Draw;
|
|
||||||
DrawContext *draw = screenManager()->getDrawContext();
|
|
||||||
// Here we do NOT bind the backbuffer or clear the screen, unless non-buffered.
|
// Here we do NOT bind the backbuffer or clear the screen, unless non-buffered.
|
||||||
// The emuscreen is different than the others - we really want to allow the game to render to framebuffers
|
// The emuscreen is different than the others - we really want to allow the game to render to framebuffers
|
||||||
// before we ever bind the backbuffer for rendering. On mobile GPUs, switching back and forth between render
|
// before we ever bind the backbuffer for rendering. On mobile GPUs, switching back and forth between render
|
||||||
|
@ -1471,19 +1476,13 @@ void EmuScreen::render(ScreenRenderMode mode) {
|
||||||
draw->SetTargetSize(g_display.pixel_xres, g_display.pixel_yres);
|
draw->SetTargetSize(g_display.pixel_xres, g_display.pixel_yres);
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace Draw;
|
|
||||||
|
|
||||||
DrawContext *thin3d = screenManager()->getDrawContext();
|
|
||||||
if (!thin3d)
|
|
||||||
return; // shouldn't really happen but I've seen a suspicious stack trace..
|
|
||||||
|
|
||||||
g_OSD.NudgeSidebar();
|
g_OSD.NudgeSidebar();
|
||||||
|
|
||||||
if (mode & ScreenRenderMode::TOP) {
|
if (mode & ScreenRenderMode::TOP) {
|
||||||
System_Notify(SystemNotification::KEEP_SCREEN_AWAKE);
|
System_Notify(SystemNotification::KEEP_SCREEN_AWAKE);
|
||||||
} else {
|
} else if (!g_Config.bRunBehindPauseMenu) {
|
||||||
// Not on top. Let's not execute, only draw the image.
|
// Not on top. Let's not execute, only draw the image.
|
||||||
thin3d->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::DONT_CARE, RPAction::DONT_CARE }, "EmuScreen_Stepping");
|
draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::DONT_CARE, RPAction::DONT_CARE }, "EmuScreen_Stepping");
|
||||||
// Just to make sure.
|
// Just to make sure.
|
||||||
if (PSP_IsInited() && !g_Config.bSkipBufferEffects) {
|
if (PSP_IsInited() && !g_Config.bSkipBufferEffects) {
|
||||||
PSP_BeginHostFrame();
|
PSP_BeginHostFrame();
|
||||||
|
@ -1491,7 +1490,7 @@ void EmuScreen::render(ScreenRenderMode mode) {
|
||||||
PSP_EndHostFrame();
|
PSP_EndHostFrame();
|
||||||
darken();
|
darken();
|
||||||
}
|
}
|
||||||
return;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (invalid_) {
|
if (invalid_) {
|
||||||
|
@ -1502,9 +1501,9 @@ void EmuScreen::render(ScreenRenderMode mode) {
|
||||||
// It's possible this might be set outside PSP_RunLoopFor().
|
// It's possible this might be set outside PSP_RunLoopFor().
|
||||||
// In this case, we need to double check it here.
|
// In this case, we need to double check it here.
|
||||||
checkPowerDown();
|
checkPowerDown();
|
||||||
thin3d->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR }, "EmuScreen_Invalid");
|
draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR }, "EmuScreen_Invalid");
|
||||||
renderUI();
|
renderUI();
|
||||||
return;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Freeze-frame functionality (loads a savestate on every frame).
|
// Freeze-frame functionality (loads a savestate on every frame).
|
||||||
|
@ -1528,6 +1527,8 @@ void EmuScreen::render(ScreenRenderMode mode) {
|
||||||
PSP_BeginHostFrame();
|
PSP_BeginHostFrame();
|
||||||
PSP_RunLoopWhileState();
|
PSP_RunLoopWhileState();
|
||||||
|
|
||||||
|
flags |= ScreenRenderFlags::HANDLED_THROTTLING;
|
||||||
|
|
||||||
// Hopefully coreState is now CORE_NEXTFRAME
|
// Hopefully coreState is now CORE_NEXTFRAME
|
||||||
switch (coreState) {
|
switch (coreState) {
|
||||||
case CORE_NEXTFRAME:
|
case CORE_NEXTFRAME:
|
||||||
|
@ -1543,12 +1544,12 @@ void EmuScreen::render(ScreenRenderMode mode) {
|
||||||
// Clear to blue background screen
|
// Clear to blue background screen
|
||||||
bool dangerousSettings = !Reporting::IsSupported();
|
bool dangerousSettings = !Reporting::IsSupported();
|
||||||
uint32_t color = dangerousSettings ? 0xFF900050 : 0xFF900000;
|
uint32_t color = dangerousSettings ? 0xFF900050 : 0xFF900000;
|
||||||
thin3d->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::DONT_CARE, RPAction::DONT_CARE, color }, "EmuScreen_RuntimeError");
|
draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::DONT_CARE, RPAction::DONT_CARE, color }, "EmuScreen_RuntimeError");
|
||||||
// The info is drawn later in renderUI
|
// The info is drawn later in renderUI
|
||||||
} else {
|
} else {
|
||||||
// If we're stepping, it's convenient not to clear the screen entirely, so we copy display to output.
|
// If we're stepping, it's convenient not to clear the screen entirely, so we copy display to output.
|
||||||
// This won't work in non-buffered, but that's fine.
|
// This won't work in non-buffered, but that's fine.
|
||||||
thin3d->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::DONT_CARE, RPAction::DONT_CARE }, "EmuScreen_Stepping");
|
draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::DONT_CARE, RPAction::DONT_CARE }, "EmuScreen_Stepping");
|
||||||
// Just to make sure.
|
// Just to make sure.
|
||||||
if (PSP_IsInited()) {
|
if (PSP_IsInited()) {
|
||||||
gpu->CopyDisplayToOutput(true);
|
gpu->CopyDisplayToOutput(true);
|
||||||
|
@ -1570,12 +1571,19 @@ void EmuScreen::render(ScreenRenderMode mode) {
|
||||||
// This must happen after PSP_EndHostFrame so that things like push buffers are end-frame'd before we start destroying stuff.
|
// This must happen after PSP_EndHostFrame so that things like push buffers are end-frame'd before we start destroying stuff.
|
||||||
if (checkPowerDown() || rebind) {
|
if (checkPowerDown() || rebind) {
|
||||||
// Shutting down can end up ending the current render pass
|
// Shutting down can end up ending the current render pass
|
||||||
thin3d->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR }, "EmuScreen_NoFrame");
|
draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR }, "EmuScreen_NoFrame");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(mode & ScreenRenderMode::TOP)) {
|
||||||
|
// We're in run-behind mode, but we don't want to draw chat, debug UI and stuff.
|
||||||
|
// So, darken and bail here.
|
||||||
|
darken();
|
||||||
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasVisibleUI()) {
|
if (hasVisibleUI()) {
|
||||||
// In most cases, this should already be bound and a no-op.
|
// In most cases, this should already be bound and a no-op.
|
||||||
thin3d->BindFramebufferAsRenderTarget(nullptr, { RPAction::KEEP, RPAction::DONT_CARE, RPAction::DONT_CARE }, "EmuScreen_UI");
|
draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::KEEP, RPAction::DONT_CARE, RPAction::DONT_CARE }, "EmuScreen_UI");
|
||||||
cardboardDisableButton_->SetVisibility(g_Config.bEnableCardboardVR ? UI::V_VISIBLE : UI::V_GONE);
|
cardboardDisableButton_->SetVisibility(g_Config.bEnableCardboardVR ? UI::V_VISIBLE : UI::V_GONE);
|
||||||
screenManager()->getUIContext()->BeginFrame();
|
screenManager()->getUIContext()->BeginFrame();
|
||||||
renderUI();
|
renderUI();
|
||||||
|
@ -1590,10 +1598,11 @@ void EmuScreen::render(ScreenRenderMode mode) {
|
||||||
if (mode & ScreenRenderMode::TOP) {
|
if (mode & ScreenRenderMode::TOP) {
|
||||||
// TODO: Replace this with something else.
|
// TODO: Replace this with something else.
|
||||||
if (stopRender_)
|
if (stopRender_)
|
||||||
thin3d->WipeQueue();
|
draw->WipeQueue();
|
||||||
} else if (!screenManager()->topScreen()->wantBrightBackground()) {
|
} else {
|
||||||
darken();
|
darken();
|
||||||
}
|
}
|
||||||
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EmuScreen::hasVisibleUI() {
|
bool EmuScreen::hasVisibleUI() {
|
||||||
|
|
|
@ -42,7 +42,7 @@ public:
|
||||||
const char *tag() const override { return "Emu"; }
|
const char *tag() const override { return "Emu"; }
|
||||||
|
|
||||||
void update() override;
|
void update() override;
|
||||||
void render(ScreenRenderMode mode) override;
|
ScreenRenderFlags render(ScreenRenderMode mode) override;
|
||||||
void dialogFinished(const Screen *dialog, DialogResult result) override;
|
void dialogFinished(const Screen *dialog, DialogResult result) override;
|
||||||
void sendMessage(UIMessage message, const char *value) override;
|
void sendMessage(UIMessage message, const char *value) override;
|
||||||
void resized() override;
|
void resized() override;
|
||||||
|
|
|
@ -311,7 +311,7 @@ void GPUDriverTestScreen::CreateViews() {
|
||||||
anchor->Add(back);
|
anchor->Add(back);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPUDriverTestScreen::DiscardTest() {
|
void GPUDriverTestScreen::DiscardTest(UIContext &dc) {
|
||||||
using namespace UI;
|
using namespace UI;
|
||||||
using namespace Draw;
|
using namespace Draw;
|
||||||
if (!discardWriteDepthStencil_) {
|
if (!discardWriteDepthStencil_) {
|
||||||
|
@ -440,7 +440,6 @@ void GPUDriverTestScreen::DiscardTest() {
|
||||||
rasterNoCull->Release();
|
rasterNoCull->Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
UIContext &dc = *screenManager()->getUIContext();
|
|
||||||
Draw::DrawContext *draw = dc.GetDrawContext();
|
Draw::DrawContext *draw = dc.GetDrawContext();
|
||||||
|
|
||||||
static const char * const writeModeNames[] = { "Stencil+Depth", "Stencil", "Depth" };
|
static const char * const writeModeNames[] = { "Stencil+Depth", "Stencil", "Depth" };
|
||||||
|
@ -529,10 +528,9 @@ void GPUDriverTestScreen::DiscardTest() {
|
||||||
dc.Flush();
|
dc.Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPUDriverTestScreen::ShaderTest() {
|
void GPUDriverTestScreen::ShaderTest(UIContext &dc) {
|
||||||
using namespace Draw;
|
using namespace Draw;
|
||||||
|
|
||||||
UIContext &dc = *screenManager()->getUIContext();
|
|
||||||
Draw::DrawContext *draw = dc.GetDrawContext();
|
Draw::DrawContext *draw = dc.GetDrawContext();
|
||||||
|
|
||||||
if (!adrenoLogicDiscardPipeline_) {
|
if (!adrenoLogicDiscardPipeline_) {
|
||||||
|
@ -629,17 +627,13 @@ void GPUDriverTestScreen::ShaderTest() {
|
||||||
dc.Flush();
|
dc.Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GPUDriverTestScreen::DrawForeground(UIContext &dc) {
|
||||||
void GPUDriverTestScreen::render(ScreenRenderMode mode) {
|
|
||||||
using namespace Draw;
|
|
||||||
UIScreen::render(mode);
|
|
||||||
|
|
||||||
switch (tabHolder_->GetCurrentTab()) {
|
switch (tabHolder_->GetCurrentTab()) {
|
||||||
case 0:
|
case 0:
|
||||||
DiscardTest();
|
DiscardTest(dc);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
ShaderTest();
|
ShaderTest(dc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,13 +15,13 @@ public:
|
||||||
~GPUDriverTestScreen();
|
~GPUDriverTestScreen();
|
||||||
|
|
||||||
void CreateViews() override;
|
void CreateViews() override;
|
||||||
void render(ScreenRenderMode mode) override;
|
void DrawForeground(UIContext &dc) override;
|
||||||
|
|
||||||
const char *tag() const override { return "GPUDriverTest"; }
|
const char *tag() const override { return "GPUDriverTest"; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void DiscardTest();
|
void DiscardTest(UIContext &dc);
|
||||||
void ShaderTest();
|
void ShaderTest(UIContext &dc);
|
||||||
|
|
||||||
// Common objects
|
// Common objects
|
||||||
Draw::SamplerState *samplerNearest_ = nullptr;
|
Draw::SamplerState *samplerNearest_ = nullptr;
|
||||||
|
|
|
@ -276,14 +276,14 @@ UI::EventReturn GameScreen::OnDeleteConfig(UI::EventParams &e)
|
||||||
return UI::EVENT_DONE;
|
return UI::EVENT_DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameScreen::render(ScreenRenderMode mode) {
|
ScreenRenderFlags GameScreen::render(ScreenRenderMode mode) {
|
||||||
UIScreen::render(mode);
|
ScreenRenderFlags flags = UIScreen::render(mode);
|
||||||
|
|
||||||
auto ga = GetI18NCategory(I18NCat::GAME);
|
auto ga = GetI18NCategory(I18NCat::GAME);
|
||||||
|
|
||||||
Draw::DrawContext *thin3d = screenManager()->getDrawContext();
|
Draw::DrawContext *draw = screenManager()->getDrawContext();
|
||||||
|
|
||||||
std::shared_ptr<GameInfo> info = g_gameInfoCache->GetInfo(thin3d, gamePath_, GAMEINFO_WANTBG | GAMEINFO_WANTSIZE | GAMEINFO_WANTUNCOMPRESSEDSIZE);
|
std::shared_ptr<GameInfo> info = g_gameInfoCache->GetInfo(draw, gamePath_, GAMEINFO_WANTBG | GAMEINFO_WANTSIZE | GAMEINFO_WANTUNCOMPRESSEDSIZE);
|
||||||
|
|
||||||
if (tvTitle_) {
|
if (tvTitle_) {
|
||||||
tvTitle_->SetText(info->GetTitle());
|
tvTitle_->SetText(info->GetTitle());
|
||||||
|
@ -416,6 +416,7 @@ void GameScreen::render(ScreenRenderMode mode) {
|
||||||
choice->SetVisibility(UI::V_VISIBLE);
|
choice->SetVisibility(UI::V_VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
UI::EventReturn GameScreen::OnShowInFolder(UI::EventParams &e) {
|
UI::EventReturn GameScreen::OnShowInFolder(UI::EventParams &e) {
|
||||||
|
|
|
@ -38,7 +38,7 @@ public:
|
||||||
|
|
||||||
void update() override;
|
void update() override;
|
||||||
|
|
||||||
void render(ScreenRenderMode mode) override;
|
ScreenRenderFlags render(ScreenRenderMode mode) override;
|
||||||
|
|
||||||
const char *tag() const override { return "Game"; }
|
const char *tag() const override { return "Game"; }
|
||||||
|
|
||||||
|
|
|
@ -52,14 +52,15 @@ protected:
|
||||||
|
|
||||||
void dialogFinished(const Screen *dialog, DialogResult result) override;
|
void dialogFinished(const Screen *dialog, DialogResult result) override;
|
||||||
void update() override;
|
void update() override;
|
||||||
void render(ScreenRenderMode mode) override {
|
ScreenRenderFlags render(ScreenRenderMode mode) override {
|
||||||
// Simple anti-flicker due to delayed finish.
|
// Simple anti-flicker due to delayed finish.
|
||||||
if (!done_) {
|
if (!done_) {
|
||||||
// render as usual.
|
// render as usual.
|
||||||
UIDialogScreenWithBackground::render(mode);
|
return UIDialogScreenWithBackground::render(mode);
|
||||||
} else {
|
} else {
|
||||||
// no render. black frame insertion is better than flicker.
|
// no render. black frame insertion is better than flicker.
|
||||||
}
|
}
|
||||||
|
return ScreenRenderFlags::NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -429,7 +429,7 @@ void HandleCommonMessages(UIMessage message, const char *value, ScreenManager *m
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BackgroundScreen::render(ScreenRenderMode mode) {
|
ScreenRenderFlags BackgroundScreen::render(ScreenRenderMode mode) {
|
||||||
if (mode & ScreenRenderMode::FIRST) {
|
if (mode & ScreenRenderMode::FIRST) {
|
||||||
SetupViewport();
|
SetupViewport();
|
||||||
} else {
|
} else {
|
||||||
|
@ -453,6 +453,8 @@ void BackgroundScreen::render(ScreenRenderMode mode) {
|
||||||
uiContext->Flush();
|
uiContext->Flush();
|
||||||
|
|
||||||
uiContext->PopTransform();
|
uiContext->PopTransform();
|
||||||
|
|
||||||
|
return ScreenRenderFlags::NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BackgroundScreen::sendMessage(UIMessage message, const char *value) {
|
void BackgroundScreen::sendMessage(UIMessage message, const char *value) {
|
||||||
|
@ -732,12 +734,9 @@ void LogoScreen::touch(const TouchInput &touch) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogoScreen::render(ScreenRenderMode mode) {
|
void LogoScreen::DrawForeground(UIContext &dc) {
|
||||||
using namespace Draw;
|
using namespace Draw;
|
||||||
|
|
||||||
UIScreen::render(mode);
|
|
||||||
UIContext &dc = *screenManager()->getUIContext();
|
|
||||||
|
|
||||||
const Bounds &bounds = dc.GetBounds();
|
const Bounds &bounds = dc.GetBounds();
|
||||||
|
|
||||||
dc.Begin();
|
dc.Begin();
|
||||||
|
@ -752,10 +751,6 @@ void LogoScreen::render(ScreenRenderMode mode) {
|
||||||
alphaText = 3.0f - t;
|
alphaText = 3.0f - t;
|
||||||
uint32_t textColor = colorAlpha(dc.theme->infoStyle.fgColor, alphaText);
|
uint32_t textColor = colorAlpha(dc.theme->infoStyle.fgColor, alphaText);
|
||||||
|
|
||||||
float x, y, z;
|
|
||||||
screenManager()->getFocusPosition(x, y, z);
|
|
||||||
::DrawBackground(dc, alpha, x, y, z);
|
|
||||||
|
|
||||||
auto cr = GetI18NCategory(I18NCat::PSPCREDITS);
|
auto cr = GetI18NCategory(I18NCat::PSPCREDITS);
|
||||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||||
char temp[256];
|
char temp[256];
|
||||||
|
@ -871,9 +866,7 @@ void CreditsScreen::update() {
|
||||||
UpdateUIState(UISTATE_MENU);
|
UpdateUIState(UISTATE_MENU);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreditsScreen::render(ScreenRenderMode mode) {
|
void CreditsScreen::DrawForeground(UIContext &dc) {
|
||||||
UIScreen::render(mode);
|
|
||||||
|
|
||||||
auto cr = GetI18NCategory(I18NCat::PSPCREDITS);
|
auto cr = GetI18NCategory(I18NCat::PSPCREDITS);
|
||||||
|
|
||||||
std::string specialthanksMaxim = "Maxim ";
|
std::string specialthanksMaxim = "Maxim ";
|
||||||
|
@ -1020,7 +1013,6 @@ void CreditsScreen::render(ScreenRenderMode mode) {
|
||||||
}
|
}
|
||||||
credits[0] = (const char *)temp;
|
credits[0] = (const char *)temp;
|
||||||
|
|
||||||
UIContext &dc = *screenManager()->getUIContext();
|
|
||||||
dc.Begin();
|
dc.Begin();
|
||||||
const Bounds &bounds = dc.GetLayoutBounds();
|
const Bounds &bounds = dc.GetLayoutBounds();
|
||||||
|
|
||||||
|
|
|
@ -38,10 +38,9 @@ inline void NoOpVoidBool(bool) {}
|
||||||
|
|
||||||
class BackgroundScreen : public UIScreen {
|
class BackgroundScreen : public UIScreen {
|
||||||
public:
|
public:
|
||||||
void render(ScreenRenderMode mode) override;
|
ScreenRenderFlags render(ScreenRenderMode mode) override;
|
||||||
void sendMessage(UIMessage message, const char *value) override;
|
void sendMessage(UIMessage message, const char *value) override;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void CreateViews() override {}
|
void CreateViews() override {}
|
||||||
const char *tag() const override { return "bg"; }
|
const char *tag() const override { return "bg"; }
|
||||||
|
@ -146,7 +145,7 @@ public:
|
||||||
bool key(const KeyInput &key) override;
|
bool key(const KeyInput &key) override;
|
||||||
void touch(const TouchInput &touch) override;
|
void touch(const TouchInput &touch) override;
|
||||||
void update() override;
|
void update() override;
|
||||||
void render(ScreenRenderMode mode) override;
|
void DrawForeground(UIContext &ui) override;
|
||||||
void sendMessage(UIMessage message, const char *value) override;
|
void sendMessage(UIMessage message, const char *value) override;
|
||||||
void CreateViews() override {}
|
void CreateViews() override {}
|
||||||
|
|
||||||
|
@ -164,7 +163,7 @@ class CreditsScreen : public UIDialogScreenWithBackground {
|
||||||
public:
|
public:
|
||||||
CreditsScreen();
|
CreditsScreen();
|
||||||
void update() override;
|
void update() override;
|
||||||
void render(ScreenRenderMode mode) override;
|
void DrawForeground(UIContext &ui) override;
|
||||||
|
|
||||||
void CreateViews() override;
|
void CreateViews() override;
|
||||||
|
|
||||||
|
|
|
@ -1077,12 +1077,7 @@ static void SendMouseDeltaAxis();
|
||||||
void NativeFrame(GraphicsContext *graphicsContext) {
|
void NativeFrame(GraphicsContext *graphicsContext) {
|
||||||
PROFILE_END_FRAME();
|
PROFILE_END_FRAME();
|
||||||
|
|
||||||
bool menuThrottle = (GetUIState() != UISTATE_INGAME || !PSP_IsInited()) && GetUIState() != UISTATE_EXIT;
|
double startTime = time_now_d();
|
||||||
|
|
||||||
double startTime;
|
|
||||||
if (menuThrottle) {
|
|
||||||
startTime = time_now_d();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<PendingMessage> toProcess;
|
std::vector<PendingMessage> toProcess;
|
||||||
{
|
{
|
||||||
|
@ -1107,7 +1102,6 @@ void NativeFrame(GraphicsContext *graphicsContext) {
|
||||||
g_DownloadManager.Update();
|
g_DownloadManager.Update();
|
||||||
|
|
||||||
g_Discord.Update();
|
g_Discord.Update();
|
||||||
g_BackgroundAudio.Play();
|
|
||||||
|
|
||||||
g_OSD.Update();
|
g_OSD.Update();
|
||||||
|
|
||||||
|
@ -1147,7 +1141,7 @@ void NativeFrame(GraphicsContext *graphicsContext) {
|
||||||
g_screenManager->getUIContext()->SetTintSaturation(g_Config.fUITint, g_Config.fUISaturation);
|
g_screenManager->getUIContext()->SetTintSaturation(g_Config.fUITint, g_Config.fUISaturation);
|
||||||
|
|
||||||
// All actual rendering happen in here.
|
// All actual rendering happen in here.
|
||||||
g_screenManager->render();
|
ScreenRenderFlags renderFlags = g_screenManager->render();
|
||||||
if (g_screenManager->getUIContext()->Text()) {
|
if (g_screenManager->getUIContext()->Text()) {
|
||||||
g_screenManager->getUIContext()->Text()->OncePerFrame();
|
g_screenManager->getUIContext()->Text()->OncePerFrame();
|
||||||
}
|
}
|
||||||
|
@ -1200,7 +1194,7 @@ void NativeFrame(GraphicsContext *graphicsContext) {
|
||||||
graphicsContext->Poll();
|
graphicsContext->Poll();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (menuThrottle) {
|
if (!(renderFlags & ScreenRenderFlags::HANDLED_THROTTLING)) {
|
||||||
float refreshRate = System_GetPropertyFloat(SYSPROP_DISPLAY_REFRESH_RATE);
|
float refreshRate = System_GetPropertyFloat(SYSPROP_DISPLAY_REFRESH_RATE);
|
||||||
// Simple throttling to not burn the GPU in the menu.
|
// Simple throttling to not burn the GPU in the menu.
|
||||||
// TODO: This should move into NativeFrame. Also, it's only necessary in MAILBOX or IMMEDIATE presentation modes.
|
// TODO: This should move into NativeFrame. Also, it's only necessary in MAILBOX or IMMEDIATE presentation modes.
|
||||||
|
@ -1208,6 +1202,9 @@ void NativeFrame(GraphicsContext *graphicsContext) {
|
||||||
int sleepTime = (int)(1000.0 / refreshRate) - (int)(diffTime * 1000.0);
|
int sleepTime = (int)(1000.0 / refreshRate) - (int)(diffTime * 1000.0);
|
||||||
if (sleepTime > 0)
|
if (sleepTime > 0)
|
||||||
sleep_ms(sleepTime);
|
sleep_ms(sleepTime);
|
||||||
|
|
||||||
|
// TODO: We should ideally mix this with game audio.
|
||||||
|
g_BackgroundAudio.Play();
|
||||||
}
|
}
|
||||||
|
|
||||||
SendMouseDeltaAxis();
|
SendMouseDeltaAxis();
|
||||||
|
|
|
@ -517,9 +517,7 @@ void OSDOverlayScreen::CreateViews() {
|
||||||
osmView_ = root_->Add(new OnScreenMessagesView(new UI::AnchorLayoutParams(0.0f, 0.0f, 0.0f, 0.0f)));
|
osmView_ = root_->Add(new OnScreenMessagesView(new UI::AnchorLayoutParams(0.0f, 0.0f, 0.0f, 0.0f)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void OSDOverlayScreen::render(ScreenRenderMode mode) {
|
void OSDOverlayScreen::DrawForeground(UIContext &ui) {
|
||||||
UIScreen::render(mode);
|
|
||||||
|
|
||||||
DebugOverlay debugOverlay = (DebugOverlay)g_Config.iDebugOverlay;
|
DebugOverlay debugOverlay = (DebugOverlay)g_Config.iDebugOverlay;
|
||||||
|
|
||||||
// Special case control for now, since it uses the control mapper that's owned by EmuScreen.
|
// Special case control for now, since it uses the control mapper that's owned by EmuScreen.
|
||||||
|
|
|
@ -41,7 +41,7 @@ public:
|
||||||
bool UnsyncTouch(const TouchInput &touch) override;
|
bool UnsyncTouch(const TouchInput &touch) override;
|
||||||
|
|
||||||
void CreateViews() override;
|
void CreateViews() override;
|
||||||
void render(ScreenRenderMode mode) override;
|
void DrawForeground(UIContext &ui) override;
|
||||||
void update() override;
|
void update() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -414,6 +414,8 @@ void GamePauseScreen::CreateViews() {
|
||||||
} else {
|
} else {
|
||||||
rightColumnItems->Add(new Choice(pa->T("Exit to menu")))->OnClick.Handle(this, &GamePauseScreen::OnExitToMenu);
|
rightColumnItems->Add(new Choice(pa->T("Exit to menu")))->OnClick.Handle(this, &GamePauseScreen::OnExitToMenu);
|
||||||
}
|
}
|
||||||
|
rightColumnItems->Add(new Spacer(25.0f));
|
||||||
|
rightColumnItems->Add(new CheckBox(&g_Config.bRunBehindPauseMenu, "Run Behind"));
|
||||||
}
|
}
|
||||||
|
|
||||||
UI::EventReturn GamePauseScreen::OnGameSettings(UI::EventParams &e) {
|
UI::EventReturn GamePauseScreen::OnGameSettings(UI::EventParams &e) {
|
||||||
|
|
|
@ -65,4 +65,6 @@ private:
|
||||||
// hack
|
// hack
|
||||||
bool finishNextFrame_ = false;
|
bool finishNextFrame_ = false;
|
||||||
PauseScreenMode mode_ = PauseScreenMode::MAIN;
|
PauseScreenMode mode_ = PauseScreenMode::MAIN;
|
||||||
|
|
||||||
|
UI::Button *pauseButton_ = nullptr;
|
||||||
};
|
};
|
||||||
|
|
|
@ -166,8 +166,8 @@ ReportScreen::ReportScreen(const Path &gamePath)
|
||||||
ratingEnabled_ = enableReporting_;
|
ratingEnabled_ = enableReporting_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportScreen::render(ScreenRenderMode mode) {
|
ScreenRenderFlags ReportScreen::render(ScreenRenderMode mode) {
|
||||||
UIScreen::render(mode);
|
ScreenRenderFlags flags = UIScreen::render(mode);
|
||||||
|
|
||||||
if (mode & ScreenRenderMode::TOP) {
|
if (mode & ScreenRenderMode::TOP) {
|
||||||
|
|
||||||
|
@ -189,6 +189,7 @@ void ReportScreen::render(ScreenRenderMode mode) {
|
||||||
tookScreenshot_ = true;
|
tookScreenshot_ = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportScreen::update() {
|
void ReportScreen::update() {
|
||||||
|
|
|
@ -40,7 +40,7 @@ public:
|
||||||
const char *tag() const override { return "Report"; }
|
const char *tag() const override { return "Report"; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void render(ScreenRenderMode mode) override;
|
ScreenRenderFlags render(ScreenRenderMode mode) override;
|
||||||
void update() override;
|
void update() override;
|
||||||
void resized() override;
|
void resized() override;
|
||||||
void CreateViews() override;
|
void CreateViews() override;
|
||||||
|
|
Loading…
Add table
Reference in a new issue