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.

This commit is contained in:
andres.delikat 2011-08-27 13:56:06 +00:00
parent c7e8e7ece1
commit 5e9f90eea9
2 changed files with 23 additions and 14 deletions

View File

@ -64,6 +64,9 @@ namespace BizHawk.MultiClient
public RamSearch() public RamSearch()
{ {
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
InitializeComponent(); InitializeComponent();
Closing += (o, e) => SaveConfigSettings(); Closing += (o, e) => SaveConfigSettings();
} }
@ -544,18 +547,21 @@ namespace BizHawk.MultiClient
private void SearchListView_QueryItemBkColor(int index, int column, ref Color color) 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 (!weededList.Contains(searchList[index]))
if (Global.CheatList.IsActiveCheat(Domain, searchList[index].address)) {
color = Color.Purple; 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()) if (GenerateWeedOutList())
{ {
OutputLabel.Text = MakeAddressString(searchList.Count - weededList.Count) + " would be removed"; //OutputLabel.Text = MakeAddressString(searchList.Count - weededList.Count) + " would be removed";
} }
} }
} }

View File

@ -155,10 +155,13 @@ namespace BizHawk.MultiClient
private void WatchListView_QueryItemBkColor(int index, int column, ref Color color) private void WatchListView_QueryItemBkColor(int index, int column, ref Color color)
{ {
if (watchList[index].type == atype.SEPARATOR) if (column == 0)
color = this.BackColor; {
if (Global.CheatList.IsActiveCheat(Domain, watchList[index].address)) if (watchList[index].type == atype.SEPARATOR)
color = Color.LightCyan; color = this.BackColor;
if (Global.CheatList.IsActiveCheat(Domain, watchList[index].address))
color = Color.LightCyan;
}
} }
void WatchListView_QueryItemText(int index, int column, out string text) void WatchListView_QueryItemText(int index, int column, out string text)