movie.getfilename returns the filename of movie loaded with no path
| 3381 | // |
| 3382 | //returns the filename of movie loaded with no path |
| 3383 | static int movie_getfilename (lua_State *L) { |
| 3384 | |
| 3385 | if (!FCEUMOV_IsRecording() && !FCEUMOV_IsPlaying() && !FCEUMOV_Mode(MOVIEMODE_TASEDITOR)) |
| 3386 | luaL_error(L, "No movie loaded."); |
| 3387 | |
| 3388 | std::string name = FCEUI_GetMovieName(); |
| 3389 | int x = name.find_last_of("/\\") + 1; |
| 3390 | if (x) |
| 3391 | name = name.substr(x, name.length()-x); |
| 3392 | lua_pushstring(L, name.c_str()); |
| 3393 | return 1; |
| 3394 | } |
| 3395 | |
| 3396 | //movie.replay |
| 3397 | // |
nothing calls this directly
no test coverage detected