remove NeedsToPaint; client now repaints ~100fps while paused all the time. as it already did when input display was enabled. fixes #615.. probably

This commit is contained in:
zeromus 2016-04-20 12:17:30 -05:00
parent 1108f13df4
commit 1a1a688b96
11 changed files with 2 additions and 68 deletions

View File

@ -109,9 +109,6 @@ namespace BizHawk.Client.EmuHawk
f.Dispose();
}
//dont know what to do about this yet
public bool NeedsToPaint { get; set; }
//rendering resources:
public IGL GL;
StringRenderer TheOneFont;
@ -830,8 +827,6 @@ namespace BizHawk.Client.EmuHawk
//nope. dont do this. workaround for slow context switching on intel GPUs. just switch to another context when necessary before doing anything
//presentationPanel.GraphicsControl.End();
NeedsToPaint = false; //??
}
}

View File

@ -19,7 +19,6 @@ namespace BizHawk.Client.EmuHawk
/// </summary>
public interface IBlitter
{
IBlitterFont GetFontType(string fontType);
void DrawString(string s, IBlitterFont font, Color color, float x, float y);
SizeF MeasureString(string s, IBlitterFont font);
@ -133,13 +132,11 @@ namespace BizHawk.Client.EmuHawk
public void AddMessage(string message)
{
GlobalWin.DisplayManager.NeedsToPaint = true;
messages.Add(new UIMessage { Message = message, ExpireAt = DateTime.Now + TimeSpan.FromSeconds(2) });
}
public void AddGUIText(string message, int x, int y, Color backGround, Color foreColor, int anchor)
{
GlobalWin.DisplayManager.NeedsToPaint = true;
GUITextList.Add(new UIDisplay
{
Message = message,
@ -153,7 +150,6 @@ namespace BizHawk.Client.EmuHawk
public void ClearGUIText()
{
GlobalWin.DisplayManager.NeedsToPaint = true;
GUITextList.Clear();
}

View File

@ -810,37 +810,31 @@ namespace BizHawk.Client.EmuHawk
private void DisplayFPSMenuItem_Click(object sender, EventArgs e)
{
GlobalWin.DisplayManager.NeedsToPaint = true;
ToggleFPS();
}
private void DisplayFrameCounterMenuItem_Click(object sender, EventArgs e)
{
GlobalWin.DisplayManager.NeedsToPaint = true;
ToggleFrameCounter();
}
private void DisplayLagCounterMenuItem_Click(object sender, EventArgs e)
{
GlobalWin.DisplayManager.NeedsToPaint = true;
ToggleLagCounter();
}
private void DisplayInputMenuItem_Click(object sender, EventArgs e)
{
GlobalWin.DisplayManager.NeedsToPaint = true;
ToggleInputDisplay();
}
private void DisplayRerecordsMenuItem_Click(object sender, EventArgs e)
{
GlobalWin.DisplayManager.NeedsToPaint = true;
Global.Config.DisplayRerecordCount ^= true;
}
private void DisplaySubtitlesMenuItem_Click(object sender, EventArgs e)
{
GlobalWin.DisplayManager.NeedsToPaint = true;
Global.Config.DisplaySubtitles ^= true;
}
@ -2672,7 +2666,6 @@ namespace BizHawk.Client.EmuHawk
private void MainForm_Enter(object sender, EventArgs e)
{
GlobalWin.DisplayManager.NeedsToPaint = true;
AutohideCursor(false);
}
@ -2710,7 +2703,6 @@ namespace BizHawk.Client.EmuHawk
private void MainformMenu_Leave(object sender, EventArgs e)
{
GlobalWin.DisplayManager.NeedsToPaint = true;
}
private void MainformMenu_MenuActivate(object sender, EventArgs e)
@ -2726,7 +2718,6 @@ namespace BizHawk.Client.EmuHawk
private void MainformMenu_MenuDeactivate(object sender, EventArgs e)
{
GlobalWin.DisplayManager.NeedsToPaint = true;
if (!_wasPaused)
{
UnpauseEmulator();

View File

@ -276,23 +276,18 @@ namespace BizHawk.Client.EmuHawk
break;
case "Toggle MultiTrack":
Global.MovieSession.ToggleMultitrack();
GlobalWin.DisplayManager.NeedsToPaint = true;
break;
case "MT Select All":
Global.MovieSession.MultiTrack.SelectAll();
GlobalWin.DisplayManager.NeedsToPaint = true;
break;
case "MT Select None":
Global.MovieSession.MultiTrack.SelectNone();
GlobalWin.DisplayManager.NeedsToPaint = true;
break;
case "MT Increment Player":
Global.MovieSession.MultiTrack.Increment();
GlobalWin.DisplayManager.NeedsToPaint = true;
break;
case "MT Decrement Player":
Global.MovieSession.MultiTrack.Decrement();
GlobalWin.DisplayManager.NeedsToPaint = true;
break;
case "Movie Poke":
ToggleModePokeMode();

View File

@ -95,7 +95,6 @@ namespace BizHawk.Client.EmuHawk
SetMainformMovieInfo();
GlobalWin.Tools.Restart<VirtualpadTool>();
GlobalWin.DisplayManager.NeedsToPaint = true;
if (Global.MovieSession.Movie.Hash != Global.Game.Hash)

View File

@ -455,10 +455,9 @@ namespace BizHawk.Client.EmuHawk
SynchChrome();
//TODO POOP
PresentationPanel.Control.Paint += (o, e) =>
{
GlobalWin.DisplayManager.NeedsToPaint = true;
//I would like to trigger a repaint here, but this isnt done yet
};
}
@ -517,18 +516,10 @@ namespace BizHawk.Client.EmuHawk
GlobalWin.Tools.LuaConsole.ResumeScripts(false);
}
if (Global.Config.DisplayInput) // Input display wants to update even while paused
{
GlobalWin.DisplayManager.NeedsToPaint = true;
}
StepRunLoop_Core();
StepRunLoop_Throttle();
if (GlobalWin.DisplayManager.NeedsToPaint)
{
Render();
}
Render();
CheckMessages();
@ -2841,7 +2832,6 @@ namespace BizHawk.Client.EmuHawk
Global.MovieSession.HandleMovieAfterFrameLoop();
GlobalWin.DisplayManager.NeedsToPaint = true;
Global.CheatList.Pulse();
if (!PauseAVI)
@ -3122,7 +3112,6 @@ namespace BizHawk.Client.EmuHawk
private void AvFrameAdvance()
{
GlobalWin.DisplayManager.NeedsToPaint = true;
if (_currAviWriter != null)
{
//TODO ZERO - this code is pretty jacked. we'll want to frugalize buffers better for speedier dumping, and we might want to rely on the GL layer for padding
@ -3231,8 +3220,6 @@ namespace BizHawk.Client.EmuHawk
}
}
}
GlobalWin.DisplayManager.NeedsToPaint = true;
}
}
@ -3707,8 +3694,6 @@ namespace BizHawk.Client.EmuHawk
if (fromLua)
Global.MovieSession.Movie.IsCountingRerecords = false;
GlobalWin.DisplayManager.NeedsToPaint = true;
if (SavestateManager.LoadStateFile(path, userFriendlyStateName))
{
if (GlobalWin.Tools.Has<LuaConsole>())

View File

@ -279,15 +279,6 @@ namespace BizHawk.Client.EmuHawk
GlobalWin.Tools.Load<TraceLogger>();
}
[LuaMethodAttributes(
"paint",
"Causes the client UI to repaint the screen"
)]
public static void Paint()
{
GlobalWin.DisplayManager.NeedsToPaint = true;
}
[LuaMethodAttributes(
"pause",
"Pauses the emulator"

View File

@ -149,7 +149,6 @@ namespace BizHawk.Client.EmuHawk
)]
public void ClearGraphics()
{
GlobalWin.DisplayManager.NeedsToPaint = true;
_luaSurface.Clear();
}
@ -219,7 +218,6 @@ namespace BizHawk.Client.EmuHawk
)]
public void DrawBezier(LuaTable points, Color color)
{
GlobalWin.DisplayManager.NeedsToPaint = true;
using (var g = GetGraphics())
{
try
@ -298,7 +296,6 @@ namespace BizHawk.Client.EmuHawk
)]
public void DrawEllipse(int x, int y, int width, int height, Color? line = null, Color? background = null)
{
GlobalWin.DisplayManager.NeedsToPaint = true;
using (var g = GetGraphics())
{
try
@ -326,7 +323,6 @@ namespace BizHawk.Client.EmuHawk
)]
public void DrawIcon(string path, int x, int y, int? width = null, int? height = null)
{
GlobalWin.DisplayManager.NeedsToPaint = true;
using (var g = GetGraphics())
{
try
@ -358,7 +354,6 @@ namespace BizHawk.Client.EmuHawk
)]
public void DrawImage(string path, int x, int y, int? width = null, int? height = null)
{
GlobalWin.DisplayManager.NeedsToPaint = true;
using (var g = GetGraphics())
{
Image img;
@ -382,7 +377,6 @@ namespace BizHawk.Client.EmuHawk
)]
public void DrawImageRegion(string path, int source_x, int source_y, int source_width, int source_height, int dest_x, int dest_y, int? dest_width = null, int? dest_height = null)
{
GlobalWin.DisplayManager.NeedsToPaint = true;
using (var g = GetGraphics())
{
Image img;
@ -408,7 +402,6 @@ namespace BizHawk.Client.EmuHawk
)]
public void DrawLine(int x1, int y1, int x2, int y2, Color? color = null)
{
GlobalWin.DisplayManager.NeedsToPaint = true;
using (var g = GetGraphics())
{
g.DrawLine(GetPen(color ?? DefaultForeground), x1, y1, x2, y2);
@ -441,7 +434,6 @@ namespace BizHawk.Client.EmuHawk
Color? line = null,
Color? background = null)
{
GlobalWin.DisplayManager.NeedsToPaint = true;
using (var g = GetGraphics())
{
var bg = background ?? DefaultBackground;
@ -462,7 +454,6 @@ namespace BizHawk.Client.EmuHawk
)]
public void DrawPixel(int x, int y, Color? color = null)
{
GlobalWin.DisplayManager.NeedsToPaint = true;
using (var g = GetGraphics())
{
try
@ -482,8 +473,6 @@ namespace BizHawk.Client.EmuHawk
)]
public void DrawPolygon(LuaTable points, Color? line = null, Color? background = null)
{
GlobalWin.DisplayManager.NeedsToPaint = true;
using (var g = GetGraphics())
{
try
@ -558,7 +547,6 @@ namespace BizHawk.Client.EmuHawk
string fontfamily = null,
string fontstyle = null)
{
GlobalWin.DisplayManager.NeedsToPaint = true;
using (var g = GetGraphics())
{
try
@ -618,7 +606,6 @@ namespace BizHawk.Client.EmuHawk
Color? backcolor = null,
string fontfamily = null)
{
GlobalWin.DisplayManager.NeedsToPaint = true;
using (var g = GetGraphics())
{
try

View File

@ -206,7 +206,6 @@ namespace BizHawk.Client.EmuHawk
private void EmuYield()
{
GlobalWin.DisplayManager.NeedsToPaint = true;
_currThread.Yield(0);
}

View File

@ -162,7 +162,6 @@ namespace BizHawk.Client.EmuHawk
private void LoadBranch(TasBranch branch)
{
Tastudio.CurrentTasMovie.LoadBranch(branch);
GlobalWin.DisplayManager.NeedsToPaint = true;
var stateInfo = new KeyValuePair<int, byte[]>(branch.Frame, branch.CoreData);
Tastudio.LoadState(stateInfo);
QuickBmpFile.Copy(new BitmapBufferVideoProvider(branch.OSDFrameBuffer), Global.Emulator.VideoProvider());

View File

@ -78,9 +78,6 @@ namespace BizHawk.Client.MultiHawk
f.Dispose();
}
//dont know what to do about this yet
public bool NeedsToPaint { get { return true; } } // TODO
//rendering resources:
public IGL GL;
IGuiRenderer Renderer;