Remove optionality of Lua support

This commit is contained in:
Ilari Liusvaara 2012-10-16 00:00:53 +03:00
parent 72a34e9863
commit a58fbd974a
7 changed files with 9 additions and 58 deletions

View file

@ -1,6 +1,9 @@
OPTIONS=options.build
include $(OPTIONS)
ifndef LUA
LUA=lua
endif
#Compilers.
REALCC = $(CROSS_PREFIX)$(CC)

View file

@ -96,7 +96,6 @@ void lua_callback_do_unsafe_rewind(const std::vector<char>& save, uint64_t secs,
uint64_t lua_timed_hook(int timer) throw();
extern bool lua_supported;
extern bool lua_requests_repaint;
extern bool lua_requests_subframe_paint;

View file

@ -63,7 +63,7 @@ FONT_SRC=unifontfull-5.1.20080820.hex
# Lua package to use.
# - Usually either 'lua' or 'lua5.1'.
# - Empty value disables Lua support.
# - Default value is 'lua'.
LUA=lua
# Threading package to use.

View file

@ -1,12 +1,7 @@
ifndef LUA
CFLAGS += -DNO_LUA
OBJECTS = dummy.$(OBJECT_SUFFIX)
else
OBJECTS = $(patsubst %.cpp,%.$(OBJECT_SUFFIX),$(wildcard src/lua/*.cpp))
LUA_CFLAGS += $(shell $(CROSS_PREFIX)pkg-config $(LUA) --cflags)
LUA_LDFLAGS += $(shell $(CROSS_PREFIX)pkg-config $(LUA) --libs)
OBJECTS=$(patsubst %.cpp,%.$(OBJECT_SUFFIX),$(wildcard *.cpp))
endif
.PRECIOUS: %.$(OBJECT_SUFFIX)

View file

@ -1,43 +0,0 @@
#include "lua/lua.hpp"
#ifdef NO_LUA
struct lua_State { int x; };
lua_function::lua_function(const std::string& name) throw(std::bad_alloc) {}
lua_function::~lua_function() throw() {}
void lua_callback_do_paint(struct lua_render_context* ctx, bool nonsynth) throw() {}
void lua_callback_do_video(struct lua_render_context* ctx) throw() {}
void lua_callback_do_input(controller_frame& data, bool subframe) throw() {}
void lua_callback_do_reset() throw() {}
void lua_callback_do_frame() throw() {}
void lua_callback_do_frame_emulated() throw() {}
void lua_callback_do_rewind() throw() {}
void lua_callback_do_idle() throw() {}
void lua_callback_do_timer() throw() {}
void lua_callback_do_readwrite() throw() {}
void lua_callback_startup() throw() {}
void lua_callback_pre_load(const std::string& name) throw() {}
void lua_callback_err_load(const std::string& name) throw() {}
void lua_callback_post_load(const std::string& name, bool was_state) throw() {}
void lua_callback_pre_save(const std::string& name, bool is_state) throw() {}
void lua_callback_err_save(const std::string& name) throw() {}
void lua_callback_post_save(const std::string& name, bool is_state) throw() {}
void lua_callback_snoop_input(uint32_t port, uint32_t controller, uint32_t index, short value) throw() {}
void lua_callback_quit() throw() {}
void lua_callback_keyhook(const std::string& key, const struct keygroup::parameters& p) throw() {}
void init_lua(bool soft) throw() {}
void quit_lua() throw() {}
uint64_t lua_timed_hook(int timer) throw() { return 0x7EFFFFFFFFFFFFFFULL; }
void lua_callback_do_unsafe_rewind(const std::vector<char>& save, uint64_t secs, uint64_t ssecs, movie& mov, void* u)
{
}
bool lua_requests_repaint = false;
bool lua_requests_subframe_paint = false;
bool lua_supported = false;
uint64_t lua_idle_hook_time = 0x7EFFFFFFFFFFFFFFULL;
uint64_t lua_timer_hook_time = 0x7EFFFFFFFFFFFFFFULL;
#endif
char SYMBOL_3263572374236473826587375832743243264346;

View file

@ -617,6 +617,5 @@ void lua_callback_do_unsafe_rewind(const std::vector<char>& save, uint64_t secs,
bool lua_requests_repaint = false;
bool lua_requests_subframe_paint = false;
bool lua_supported = true;
DECLARE_LUACLASS(lua_unsaferewind, "UNSAFEREWIND");

View file

@ -835,13 +835,11 @@ wxwin_mainwindow::wxwin_mainwindow()
menu_start(wxT("Tools"));
menu_entry(wxID_RUN_SCRIPT, wxT("Run batch file..."));
if(lua_supported) {
menu_separator();
menu_entry(wxID_EVAL_LUA, wxT("Evaluate Lua statement..."));
menu_entry(wxID_RUN_LUA, wxT("Run Lua script..."));
menu_separator();
menu_entry(wxID_RESET_LUA, wxT("Reset Lua VM"));
}
menu_separator();
menu_entry(wxID_EVAL_LUA, wxT("Evaluate Lua statement..."));
menu_entry(wxID_RUN_LUA, wxT("Run Lua script..."));
menu_separator();
menu_entry(wxID_RESET_LUA, wxT("Reset Lua VM"));
menu_separator();
menu_entry(wxID_EDIT_MEMORYWATCH, wxT("Edit memory watch..."));
menu_separator();