Merge pull request #18617 from hrydgard/feedback-fixes

Various fixes and cleanup, thanks Unknown
This commit is contained in:
Henrik Rydgård
2023-12-28 11:51:19 +01:00
committed by GitHub
5 changed files with 14 additions and 26 deletions
+5 -6
View File
@@ -167,14 +167,14 @@ ScreenRenderFlags ScreenManager::render() {
// the EmuScreen or the actual global background screen.
auto iter = stack_.end();
Screen *coveringScreen = nullptr;
Screen *backgroundScreen = nullptr;
Screen *foundBackgroundScreen = nullptr;
bool first = true;
do {
--iter;
if (!backgroundScreen && iter->screen->canBeBackground(first)) {
if (!foundBackgroundScreen && iter->screen->canBeBackground(first)) {
// There still might be a screen that wants to be background - generally the EmuScreen if present.
layers.push_back(iter->screen);
backgroundScreen = iter->screen;
foundBackgroundScreen = iter->screen;
} else if (!coveringScreen) {
layers.push_back(iter->screen);
}
@@ -184,10 +184,9 @@ ScreenRenderFlags ScreenManager::render() {
first = false;
} while (iter != stack_.begin());
// Confusing-looking expression, argh! Note the '_'
if (backgroundScreen_ && !backgroundScreen) {
if (backgroundScreen_ && !foundBackgroundScreen) {
layers.push_back(backgroundScreen_);
backgroundScreen = backgroundScreen_;
foundBackgroundScreen = backgroundScreen_;
}
// OK, now we iterate backwards over our little pile of collected screens.
-8
View File
@@ -495,10 +495,6 @@ void LinearLayout::Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec v
if (views_.empty())
return;
if (tag_ == "debug") {
tag_ = "debug";
}
float sum = 0.0f;
float maxOther = 0.0f;
float totalWeight = 0.0f;
@@ -670,10 +666,6 @@ void LinearLayout::Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec v
void LinearLayout::Layout() {
const Bounds &bounds = bounds_;
if (tag_ == "debug") {
tag_ = "debug";
}
Bounds itemBounds;
float pos;
+4 -9
View File
@@ -1893,19 +1893,14 @@ void PlayTimeTracker::Stop(const std::string &gameId) {
void PlayTimeTracker::Load(const Section *section) {
tracker_.clear();
std::vector<std::string> keys;
section->GetKeys(keys);
for (auto key : keys) {
std::string value;
if (!section->Get(key.c_str(), &value, nullptr)) {
continue;
}
auto map = section->ToMap();
for (const auto &iter : map) {
const std::string &value = iter.second;
// Parse the string.
PlayTime gameTime{};
if (2 == sscanf(value.c_str(), "%d,%llu", &gameTime.totalTimePlayed, (long long *)&gameTime.lastTimePlayed)) {
tracker_[key] = gameTime;
tracker_[iter.first.c_str()] = gameTime;
}
}
}
+2 -1
View File
@@ -1086,7 +1086,8 @@ void GPUCommonHW::Execute_Prim(u32 op, u32 diff) {
bool passCulling = onePassed || PASSES_CULLING;
if (!passCulling) {
// Do software culling.
if (drawEngineCommon_->TestBoundingBox(verts, inds, count, vertexType)) {
_dbg_assert_((vertexType & GE_VTYPE_IDX_MASK) == GE_VTYPE_IDX_NONE);
if (drawEngineCommon_->TestBoundingBoxFast(verts, count, vertexType)) {
passCulling = true;
} else {
gpuStats.numCulledDraws++;
+3 -2
View File
@@ -77,8 +77,7 @@ LRESULT CALLBACK CtrlDisplayListView::wndProc(HWND hwnd, UINT msg, WPARAM wParam
{
CtrlDisplayListView *win = CtrlDisplayListView::getFrom(hwnd);
switch(msg)
{
switch(msg) {
case WM_NCCREATE:
// Allocate a new CustCtrl structure for this window.
win = new CtrlDisplayListView(hwnd);
@@ -86,6 +85,8 @@ LRESULT CALLBACK CtrlDisplayListView::wndProc(HWND hwnd, UINT msg, WPARAM wParam
// Continue with window creation.
return win != NULL;
case WM_NCDESTROY:
SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
delete win;
break;
case WM_SIZE:
win->redraw();