Linux: Fixed interop crash when trying to record a movie

This commit is contained in:
Sour 2017-12-28 13:15:01 -05:00
parent 4b40857779
commit 9e09c51e7c
3 changed files with 11 additions and 4 deletions

View file

@ -32,12 +32,13 @@ namespace Mesen.GUI.Forms
{
base.OnFormClosed(e);
if(this.DialogResult == DialogResult.OK) {
InteropEmu.MovieRecord(new RecordMovieOptions(
RecordMovieOptions options = new RecordMovieOptions(
this.txtFilename.Text,
this.txtAuthor.Text,
this.txtDescription.Text,
this.cboRecordFrom.GetEnumValue<RecordMovieFrom>()
));
);
InteropEmu.MovieRecord(ref options);
}
}

View file

@ -98,7 +98,7 @@ namespace Mesen.GUI
[DllImport(DLLPath, EntryPoint = "GetLog")] private static extern IntPtr GetLogWrapper();
[DllImport(DLLPath)] public static extern void MoviePlay([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))]string filename);
[DllImport(DLLPath)] public static extern void MovieRecord(RecordMovieOptions options);
[DllImport(DLLPath)] public static extern void MovieRecord(ref RecordMovieOptions options);
[DllImport(DLLPath)] public static extern void MovieStop();
[DllImport(DLLPath)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool MoviePlaying();
[DllImport(DLLPath)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool MovieRecording();

View file

@ -356,7 +356,13 @@ namespace InteropEmu {
DllExport int64_t __stdcall GetStateInfo(uint32_t stateIndex) { return SaveStateManager::GetStateInfo(stateIndex); }
DllExport void __stdcall MoviePlay(char* filename) { MovieManager::Play(string(filename)); }
DllExport void __stdcall MovieRecord(RecordMovieOptions options) { MovieManager::Record(options); }
DllExport void __stdcall MovieRecord(RecordMovieOptions *options)
{
RecordMovieOptions opt = *options;
MovieManager::Record(opt);
}
DllExport void __stdcall MovieStop() { MovieManager::Stop(); }
DllExport bool __stdcall MoviePlaying() { return MovieManager::Playing(); }
DllExport bool __stdcall MovieRecording() { return MovieManager::Recording(); }