diff --git a/Common/UI/Screen.cpp b/Common/UI/Screen.cpp index c5f1a7be72..657aaddcca 100644 --- a/Common/UI/Screen.cpp +++ b/Common/UI/Screen.cpp @@ -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. diff --git a/Common/UI/ViewGroup.cpp b/Common/UI/ViewGroup.cpp index 7fbb4aa7fd..6e6afda28c 100644 --- a/Common/UI/ViewGroup.cpp +++ b/Common/UI/ViewGroup.cpp @@ -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; diff --git a/Core/Config.cpp b/Core/Config.cpp index a60d1dbedf..1d97f59050 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1893,19 +1893,14 @@ void PlayTimeTracker::Stop(const std::string &gameId) { void PlayTimeTracker::Load(const Section *section) { tracker_.clear(); - std::vector 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; } } } diff --git a/GPU/GPUCommonHW.cpp b/GPU/GPUCommonHW.cpp index 2c1eba7f4d..2e20702f6b 100644 --- a/GPU/GPUCommonHW.cpp +++ b/GPU/GPUCommonHW.cpp @@ -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++; diff --git a/Windows/GEDebugger/CtrlDisplayListView.cpp b/Windows/GEDebugger/CtrlDisplayListView.cpp index 7318beb808..2d9e64239d 100644 --- a/Windows/GEDebugger/CtrlDisplayListView.cpp +++ b/Windows/GEDebugger/CtrlDisplayListView.cpp @@ -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();