diff --git a/GUI.NET/Forms/frmRecordMovie.cs b/GUI.NET/Forms/frmRecordMovie.cs index 0c34c51e..38bd933b 100644 --- a/GUI.NET/Forms/frmRecordMovie.cs +++ b/GUI.NET/Forms/frmRecordMovie.cs @@ -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() - )); + ); + InteropEmu.MovieRecord(ref options); } } diff --git a/GUI.NET/InteropEmu.cs b/GUI.NET/InteropEmu.cs index 2233ec8d..ae4593b2 100644 --- a/GUI.NET/InteropEmu.cs +++ b/GUI.NET/InteropEmu.cs @@ -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(); diff --git a/InteropDLL/ConsoleWrapper.cpp b/InteropDLL/ConsoleWrapper.cpp index a64be553..200e63f0 100644 --- a/InteropDLL/ConsoleWrapper.cpp +++ b/InteropDLL/ConsoleWrapper.cpp @@ -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(); }