Skip to content

Commit

Permalink
Merge pull request #18617 from hrydgard/feedback-fixes
Browse files Browse the repository at this point in the history
Various fixes and cleanup, thanks Unknown
  • Loading branch information
hrydgard committed Dec 28, 2023
2 parents 851be72 + 99962b9 commit 15b5c7f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 26 deletions.
11 changes: 5 additions & 6 deletions Common/UI/Screen.cpp
Expand Up @@ -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);
}
Expand All @@ -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.
Expand Down
8 changes: 0 additions & 8 deletions Common/UI/ViewGroup.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
13 changes: 4 additions & 9 deletions Core/Config.cpp
Expand Up @@ -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;
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion GPU/GPUCommonHW.cpp
Expand Up @@ -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++;
Expand Down
5 changes: 3 additions & 2 deletions Windows/GEDebugger/CtrlDisplayListView.cpp
Expand Up @@ -77,15 +77,16 @@ 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);

// Continue with window creation.
return win != NULL;
case WM_NCDESTROY:
SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
delete win;
break;
case WM_SIZE:
win->redraw();
Expand Down

0 comments on commit 15b5c7f

Please sign in to comment.