don't double load movie files when pre-loading, remove unused HawkFile parameter

This commit is contained in:
adelikat 2020-07-05 15:31:43 -05:00
parent 624493e6e2
commit 72993a3bd0
3 changed files with 3 additions and 15 deletions

View File

@ -48,17 +48,7 @@ namespace BizHawk.Client.Common
return true;
}
public bool PreLoadHeaderAndLength(HawkFile hawkFile)
{
var file = new FileInfo(Filename);
if (!file.Exists)
{
return false;
}
Filename = file.FullName;
return Load(true);
}
public bool PreLoadHeaderAndLength() => Load(true);
protected virtual void Write(string fn, bool isBackup = false)
{

View File

@ -1,7 +1,5 @@
using System.Collections.Generic;
using System.IO;
using BizHawk.Common;
using BizHawk.Emulation.Common;
namespace BizHawk.Client.Common
@ -98,7 +96,7 @@ namespace BizHawk.Client.Common
/// Loads from the HawkFile the minimal amount of information needed to determine Header info and Movie length
/// This method is intended to be more performant than a full load
/// </summary>
bool PreLoadHeaderAndLength(HawkFile hawkFile);
bool PreLoadHeaderAndLength();
/// <summary>
/// Gets the header key value pairs stored in the movie file

View File

@ -136,7 +136,7 @@ namespace BizHawk.Client.EmuHawk
try
{
movie.PreLoadHeaderAndLength(hf);
movie.PreLoadHeaderAndLength();
// Don't do this from browse
if (movie.Hash == _game.Hash