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()
{
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";
}
}
}

View File

@ -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)