Lua: add movie.replay()

This commit is contained in:
gocha 2012-08-25 00:04:44 +09:00
parent b64a8d37c7
commit b8592e83f5
1 changed files with 8 additions and 8 deletions

View File

@ -4157,14 +4157,14 @@ DEFINE_LUA_FUNCTION(movie_play, "[filename]")
} }
return 0; return 0;
} }
/*DEFINE_LUA_FUNCTION(movie_replay, "") DEFINE_LUA_FUNCTION(movie_replay, "")
{ {
if(MainMovie.File) if(!S9xMovieActive())
GensReplayMovie(); return 0;
else lua_settop(L, 0);
luaL_error(L, "it is invalid to call movie.replay when no movie open."); movie_getname(L);
return 0; return movie_play(L);
}*/ }
DEFINE_LUA_FUNCTION(movie_close, "") DEFINE_LUA_FUNCTION(movie_close, "")
{ {
S9xMovieShutdown(); S9xMovieShutdown();
@ -4720,7 +4720,7 @@ static const struct luaL_reg movielib [] =
{"framecount", emu_getframecount}, // for those familiar with other emulators that have movie.framecount() instead of emulatorname.framecount() {"framecount", emu_getframecount}, // for those familiar with other emulators that have movie.framecount() instead of emulatorname.framecount()
{"play", movie_play}, {"play", movie_play},
// {"replay", movie_replay}, {"replay", movie_replay},
{"stop", movie_close}, {"stop", movie_close},
// alternative names // alternative names