From 5e9f90eea9dca4ff90fd42688754cd07359b0dd0 Mon Sep 17 00:00:00 2001 From: "andres.delikat" Date: Sat, 27 Aug 2011 13:56:06 +0000 Subject: [PATCH] Ram Search - big speed up in QueryItemBkColor by only checking for column == 0, apparently it was causing a redraw for each column instead of just once, setting column == 0 still colors the entire row. Also removed the "x addresses would be removed" message when in preview mode as it isn't worth a 1 fps cost imo. Also applied the column == 0 fix to Ram Watch though that will have a significantly smaller speed boost. --- BizHawk.MultiClient/tools/RamSearch.cs | 26 ++++++++++++++++---------- BizHawk.MultiClient/tools/RamWatch.cs | 11 +++++++---- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/BizHawk.MultiClient/tools/RamSearch.cs b/BizHawk.MultiClient/tools/RamSearch.cs index 79f0d4e8de..5895fd0ff7 100644 --- a/BizHawk.MultiClient/tools/RamSearch.cs +++ b/BizHawk.MultiClient/tools/RamSearch.cs @@ -64,6 +64,9 @@ namespace BizHawk.MultiClient public RamSearch() { + SetStyle(ControlStyles.AllPaintingInWmPaint, true); + SetStyle(ControlStyles.UserPaint, true); + SetStyle(ControlStyles.OptimizedDoubleBuffer, true); InitializeComponent(); Closing += (o, e) => SaveConfigSettings(); } @@ -544,18 +547,21 @@ namespace BizHawk.MultiClient private void SearchListView_QueryItemBkColor(int index, int column, ref Color color) { - if (IsAWeededList) + if (column == 0) { - if (!weededList.Contains(searchList[index])) + if (IsAWeededList) { - color = Color.Pink; - if (Global.CheatList.IsActiveCheat(Domain, searchList[index].address)) - color = Color.Purple; + if (!weededList.Contains(searchList[index])) + { + color = Color.Pink; + if (Global.CheatList.IsActiveCheat(Domain, searchList[index].address)) + color = Color.Purple; + } + else if (Global.CheatList.IsActiveCheat(Domain, searchList[index].address)) + color = Color.LightCyan; + else + color = Color.White; } - else if (Global.CheatList.IsActiveCheat(Domain, searchList[index].address)) - color = Color.LightCyan; - else - color = Color.White; } } @@ -686,7 +692,7 @@ namespace BizHawk.MultiClient { if (GenerateWeedOutList()) { - OutputLabel.Text = MakeAddressString(searchList.Count - weededList.Count) + " would be removed"; + //OutputLabel.Text = MakeAddressString(searchList.Count - weededList.Count) + " would be removed"; } } } diff --git a/BizHawk.MultiClient/tools/RamWatch.cs b/BizHawk.MultiClient/tools/RamWatch.cs index 06cf649318..387d2a5c75 100644 --- a/BizHawk.MultiClient/tools/RamWatch.cs +++ b/BizHawk.MultiClient/tools/RamWatch.cs @@ -155,10 +155,13 @@ namespace BizHawk.MultiClient private void WatchListView_QueryItemBkColor(int index, int column, ref Color color) { - if (watchList[index].type == atype.SEPARATOR) - color = this.BackColor; - if (Global.CheatList.IsActiveCheat(Domain, watchList[index].address)) - color = Color.LightCyan; + if (column == 0) + { + if (watchList[index].type == atype.SEPARATOR) + color = this.BackColor; + if (Global.CheatList.IsActiveCheat(Domain, watchList[index].address)) + color = Color.LightCyan; + } } void WatchListView_QueryItemText(int index, int column, out string text)