Preliminary lua support for sdl

This commit is contained in:
punkrockguy318 2008-08-02 23:06:33 +00:00
parent 27b510df3f
commit 0285667a71
2 changed files with 15 additions and 2 deletions

View File

@ -182,7 +182,10 @@ InitConfig()
config->addOption('i', "inputcfg", "SDL.InputCfg", InputCfg);
// video playback
config->addOption('z', "playmov", "SDL.Movie", "");
config->addOption("playmov", "SDL.Movie", "");
// lua
config->addOption("loadlua", "SDL.LuaScript", "");
// GamePad 0 - 3
for(unsigned int i = 0; i < GAMEPAD_NUM_DEVICES; i++) {

View File

@ -19,6 +19,7 @@
#include "../common/cheat.h"
#include "../../fceu.h"
#include "../../movie.h"
#include "../../fceulua.h"
#include "input.h"
#include "dface.h"
@ -93,7 +94,8 @@ char *DriverUsage=
--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\
--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
@ -522,6 +524,14 @@ main(int argc,
FCEUI_LoadMovie((char*)fname.c_str(), false, false, false);
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
while(GameInfo) {