Preliminary lua support for sdl
This commit is contained in:
parent
27b510df3f
commit
0285667a71
|
@ -182,7 +182,10 @@ InitConfig()
|
||||||
config->addOption('i', "inputcfg", "SDL.InputCfg", InputCfg);
|
config->addOption('i', "inputcfg", "SDL.InputCfg", InputCfg);
|
||||||
|
|
||||||
// video playback
|
// video playback
|
||||||
config->addOption('z', "playmov", "SDL.Movie", "");
|
config->addOption("playmov", "SDL.Movie", "");
|
||||||
|
|
||||||
|
// lua
|
||||||
|
config->addOption("loadlua", "SDL.LuaScript", "");
|
||||||
|
|
||||||
// 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++) {
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include "../common/cheat.h"
|
#include "../common/cheat.h"
|
||||||
#include "../../fceu.h"
|
#include "../../fceu.h"
|
||||||
#include "../../movie.h"
|
#include "../../movie.h"
|
||||||
|
#include "../../fceulua.h"
|
||||||
|
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "dface.h"
|
#include "dface.h"
|
||||||
|
@ -93,7 +94,8 @@ char *DriverUsage=
|
||||||
--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\
|
||||||
--playmov f Plays back a recorded movie from filename f.\n";
|
--playmov f Plays back a recorded movie from filename f.\n\
|
||||||
|
--loadlua f Loads lua script from filename f\n";
|
||||||
|
|
||||||
|
|
||||||
// global configuration object
|
// global configuration object
|
||||||
|
@ -523,6 +525,14 @@ main(int argc,
|
||||||
g_config->setOption("SDL.Movie", "");
|
g_config->setOption("SDL.Movie", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// load lua script if option passed
|
||||||
|
g_config->getOption("SDL.LuaScript", &fname);
|
||||||
|
if (fname != "")
|
||||||
|
{
|
||||||
|
FCEU_LoadLuaCode(fname.c_str());
|
||||||
|
g_config->setOption("SDL.LoadLua", "");
|
||||||
|
}
|
||||||
|
|
||||||
// loop playing the game
|
// loop playing the game
|
||||||
while(GameInfo) {
|
while(GameInfo) {
|
||||||
DoFun(frameskip);
|
DoFun(frameskip);
|
||||||
|
|
Loading…
Reference in New Issue