From e6d78d344732bb7109012a0169d4e416d1b1c9d6 Mon Sep 17 00:00:00 2001 From: hrydgard Date: Tue, 20 Jan 2009 19:41:45 +0000 Subject: [PATCH] fix red coloring of fp regs in registerview git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1964 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DebuggerWX/Src/RegisterView.cpp | 22 ++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Source/Core/DebuggerWX/Src/RegisterView.cpp b/Source/Core/DebuggerWX/Src/RegisterView.cpp index 113bf0133e..fac3287702 100644 --- a/Source/Core/DebuggerWX/Src/RegisterView.cpp +++ b/Source/Core/DebuggerWX/Src/RegisterView.cpp @@ -93,13 +93,25 @@ wxGridCellAttr *CRegTable::GetAttr(int row, int col, wxGridCellAttr::wxAttrKind) attr->SetBackgroundColour(wxColour(wxT("#FFFFFF"))); attr->SetFont(DefaultFont); - attr->SetAlignment(col & 1 ? wxALIGN_CENTER : wxALIGN_LEFT, wxALIGN_CENTER); - if (col == 0) - attr->SetTextColour(wxColour(wxT("#000000"))); - else - attr->SetTextColour(m_CachedRegHasChanged[row] ? wxColor(wxT("#FF0000")) : wxColor(wxT("#000000"))); + switch (col) { + case 1: + case 3: + case 4: + attr->SetAlignment(wxALIGN_CENTER, wxALIGN_CENTER); + break; + default: + attr->SetAlignment(wxALIGN_LEFT, wxALIGN_CENTER); + break; + } + bool red = false; + switch (col) { + case 1: red = row < 32 ? m_CachedRegHasChanged[row] : m_CachedSpecialRegHasChanged[row-32]; break; + case 3: + case 4: red = row < 32 ? m_CachedFRegHasChanged[row][col-3] : false; break; + } + attr->SetTextColour(red ? wxColor(wxT("#FF0000")) : wxColor(wxT("#000000"))); attr->IncRef(); return attr; }