From a482fdce5d688fb504b12c7101e3e28360887492 Mon Sep 17 00:00:00 2001 From: punkrockguy318 Date: Sat, 2 Aug 2008 17:22:28 +0000 Subject: [PATCH] Fixed some issues with movie recording in sdl; however it's still sketchy --- src/drivers/sdl/input.cpp | 17 ++++++++++------- src/movie.cpp | 4 ++-- src/movie.h | 4 ++-- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/drivers/sdl/input.cpp b/src/drivers/sdl/input.cpp index 3fe529df..fbb9df5f 100644 --- a/src/drivers/sdl/input.cpp +++ b/src/drivers/sdl/input.cpp @@ -217,9 +217,10 @@ KeyboardCommands() g_config->getOption("SDL.Hotkeys.SaveState", &key); if(_keyonly(key)) { - if(is_shift) { - FCEUI_printf("Recording movie to %s\n", curMovieFilename); - FCEUI_SaveMovie(curMovieFilename, MOVIE_FLAG_NONE); + if(is_shift) { + const char* fname = FCEU_MakeFName(FCEUMKF_MOVIE, 0, 0).c_str(); + FCEUI_printf("Recording movie to %s\n", fname); + FCEUI_SaveMovie(fname, MOVIE_FLAG_NONE); } else { FCEUI_SaveState(NULL); } @@ -228,9 +229,11 @@ KeyboardCommands() g_config->getOption("SDL.Hotkeys.LoadState", &key); // f7 to load state, Shift-f7 to load movie if(_keyonly(key)) { - if(is_shift) { - FCEUI_printf("Playing back movie located at %s\n", curMovieFilename); - FCEUI_LoadMovie(curMovieFilename , false, false, false); + if(is_shift) { + const char* fname = FCEU_MakeFName(FCEUMKF_MOVIE, 0, 0).c_str(); + std::cout << fname; + FCEUI_printf("Playing back movie located at %s\n", fname); + FCEUI_LoadMovie(fname , false, false, false); } else { FCEUI_LoadState(NULL); } @@ -335,7 +338,7 @@ do { \ FCEUI_DispMessage("Barcode: %s", bbuf); \ } else { \ FCEUI_SelectState(x,1); \ - } \ + } \ } while(0) DIPSless: diff --git a/src/movie.cpp b/src/movie.cpp index 81f2ed1a..fd92c2a8 100644 --- a/src/movie.cpp +++ b/src/movie.cpp @@ -675,7 +675,7 @@ void MovieData::dumpSavestateTo(std::vector* buf, int compressionLevel) } //begin playing an existing movie -void FCEUI_LoadMovie(char *fname, bool _read_only, bool tasedit, int _pauseframe) +void FCEUI_LoadMovie(const char *fname, bool _read_only, bool tasedit, int _pauseframe) { if(!tasedit && !FCEU_IsValidUI(FCEUI_PLAYMOVIE)) return; @@ -752,7 +752,7 @@ static void openRecordingMovie(const char* fname) //begin recording a new movie //TODO - BUG - the record-from-another-savestate doesnt work. -void FCEUI_SaveMovie(char *fname, EMOVIE_FLAG flags) +void FCEUI_SaveMovie(const char *fname, EMOVIE_FLAG flags) { if(!FCEU_IsValidUI(FCEUI_RECORDMOVIE)) return; diff --git a/src/movie.h b/src/movie.h index 5a35d4b8..f395797d 100644 --- a/src/movie.h +++ b/src/movie.h @@ -228,8 +228,8 @@ extern int currFrameCounter; extern char curMovieFilename[512]; //--------- -void FCEUI_SaveMovie(char *fname, EMOVIE_FLAG flags); -void FCEUI_LoadMovie(char *fname, bool read_only, bool tasedit, int _stopframe); +void FCEUI_SaveMovie(const char *fname, EMOVIE_FLAG flags); +void FCEUI_LoadMovie(const char *fname, bool read_only, bool tasedit, int _stopframe); void FCEUI_MoviePlayFromBeginning(void); void FCEUI_StopMovie(void); bool FCEUI_MovieGetInfo(const std::string& fname, MOVIE_INFO* /* [in, out] */ info, bool skipFrameCount = false);