Fix syncless recorder

This commit is contained in:
alyosha-tas 2021-01-09 22:20:16 -05:00
parent a67d01f04d
commit bcee6d4d39
2 changed files with 12 additions and 2 deletions

View File

@ -185,6 +185,12 @@ namespace BizHawk.Client.EmuHawk
public new virtual void SetFrame(int frame) public new virtual void SetFrame(int frame)
{ {
// this writer will never support this capability // this writer will never support this capability
// but it needs to for syncless recorder, otherwise it won't work at all
if (W is SynclessRecorder)
{
W.SetFrame(frame);
}
} }
/// <exception cref="InvalidOperationException">always</exception> /// <exception cref="InvalidOperationException">always</exception>

View File

@ -54,7 +54,7 @@ namespace BizHawk.Client.EmuHawk
public void AddFrame(IVideoProvider source) public void AddFrame(IVideoProvider source)
{ {
using var bb = new BitmapBuffer(source.BufferWidth, source.BufferHeight, source.GetVideoBuffer()); using var bb = new BitmapBuffer(source.BufferWidth, source.BufferHeight, source.GetVideoBuffer());
string subPath = GetAndCreatePathForFrameNum(_mCurrFrame); string subPath = GetAndCreatePathForFrameNum(_mCurrFrame);
string path = $"{subPath}.png"; string path = $"{subPath}.png";
bb.ToSysdrawingBitmap().Save(path, ImageFormat.Png); bb.ToSysdrawingBitmap().Save(path, ImageFormat.Png);
@ -153,9 +153,13 @@ namespace BizHawk.Client.EmuHawk
public static string GetPathFragmentForFrameNum(int index) public static string GetPathFragmentForFrameNum(int index)
{ {
var chunks = StringChunkSplit(index.ToString(), 2); // not sure of the original purpose here, but the subfolders it makes don't seem to work right, just return frame number for now
/*
var chunks = StringChunkSplit(index.ToString(), 2);
string subPath = string.Join("/", chunks); string subPath = string.Join("/", chunks);
return subPath; return subPath;
*/
return index.ToString();
} }
} }
} }