Added --play option to SDL version for movie playback

This commit is contained in:
punkrockguy318 2008-07-23 05:14:45 +00:00
parent 04f13170e2
commit 3bb5e96ed3
2 changed files with 16 additions and 1 deletions

View File

@ -181,6 +181,9 @@ InitConfig()
// Allow for input configuration // Allow for input configuration
config->addOption('i', "inputcfg", "SDL.InputCfg", InputCfg); config->addOption('i', "inputcfg", "SDL.InputCfg", InputCfg);
// video playback
config->addOption('z', "play", "SDL.Movie", "");
// GamePad 0 - 3 // GamePad 0 - 3
for(unsigned int i = 0; i < GAMEPAD_NUM_DEVICES; i++) { for(unsigned int i = 0; i < GAMEPAD_NUM_DEVICES; i++) {
char buf[64]; char buf[64];

View File

@ -18,6 +18,7 @@
#include "../common/cheat.h" #include "../common/cheat.h"
#include "../../fceu.h" #include "../../fceu.h"
#include "../../movie.h"
#include "input.h" #include "input.h"
#include "dface.h" #include "dface.h"
@ -28,6 +29,7 @@
#include "../common/configSys.h" #include "../common/configSys.h"
#ifdef WIN32 #ifdef WIN32
#include <windows.h> #include <windows.h>
#endif #endif
@ -90,7 +92,8 @@ char *DriverUsage=
--user s, -u s Sets the nickname to use in network play.\n\ --user s, -u s Sets the nickname to use in network play.\n\
--pass s, -w s Sets password to use for connecting to the server.\n\ --pass s, -w s Sets password to use for connecting to the server.\n\
--netkey s, -k s Uses key 's' to create a unique session for the game loaded.\n\ --netkey s, -k s Uses key 's' to create a unique session for the game loaded.\n\
--players x, -l x Sets the number of local players.\n"; --players x, -l x Sets the number of local players.\n\
--play f Plays back a recorded movie from filename f.\n";
// global configuration object // global configuration object
@ -511,6 +514,15 @@ main(int argc,
return -1; return -1;
} }
// movie playback
std::string fname;
g_config->getOption("SDL.Movie", &fname);
if (fname != "")
{
FCEUI_LoadMovie((char*)fname.c_str(), false, false, false);
g_config->setOption("SDL.Movie", "");
}
// loop playing the game // loop playing the game
while(GameInfo) { while(GameInfo) {
DoFun(frameskip); DoFun(frameskip);