Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
51f27bfad7
@ -44,6 +44,7 @@ AddOption('--sse2',dest="sse2",action='store_true',default=False,help="Enable SS
|
||||
AddOption('--sse3',dest="sse3",action='store_true',default=False,help="Enable SSE3 optimisations")
|
||||
AddOption('--x86',dest="x86",action='store_true',default=True,help="Target Intel x86 platform")
|
||||
AddOption('--nofft',dest="nofft", action='store_true',default=False,help="Do not use fftw3f for gravity.")
|
||||
AddOption('--nolua',dest="nolua", action='store_true',default=False,help="Disable all lua scripting features.")
|
||||
|
||||
AddOption('--debugging', dest="debug", action="store_true", default=False, help="Enable debug options")
|
||||
AddOption('--beta',dest="beta",action='store_true',default=False,help="Beta build.")
|
||||
@ -90,6 +91,7 @@ if not GetOption("macosx"):
|
||||
env.Append(CPPPATH=[GetOption("sdl-dir")])
|
||||
|
||||
#Find correct lua include dir
|
||||
if not GetOption("nolua"):
|
||||
try:
|
||||
env.ParseConfig('pkg-config --cflags lua5.1')
|
||||
except:
|
||||
@ -121,7 +123,7 @@ if not GetOption("macosx"):
|
||||
raise SystemExit(1)
|
||||
|
||||
#Check for Lua lib
|
||||
if not GetOption("macosx"):
|
||||
if not GetOption("macosx") and not GetOption("nolua"):
|
||||
if not conf.CheckLib('lua5.1') and not conf.CheckLib('lua-5.1') and not conf.CheckLib('lua51') and not conf.CheckLib('lua'):
|
||||
print "liblua not found or not installed"
|
||||
raise SystemExit(1)
|
||||
@ -135,9 +137,11 @@ else:
|
||||
env.Append(CPPPATH=['src/', 'data/', 'generated/'])
|
||||
env.Append(CCFLAGS=['-w', '-std=c++98', '-fkeep-inline-functions'])
|
||||
env.Append(LIBS=['pthread', 'm'])
|
||||
env.Append(CPPDEFINES=["LUACONSOLE", "_GNU_SOURCE", "USE_STDINT", "_POSIX_C_SOURCE=200112L"])
|
||||
env.Append(CPPDEFINES=["_GNU_SOURCE", "USE_STDINT", "_POSIX_C_SOURCE=200112L"])
|
||||
if not GetOption('nofft'):
|
||||
env.Append(CPPDEFINES=["GRAVFFT"])
|
||||
if not GetOption('nolua'):
|
||||
env.Append(CPPDEFINED=["LUACONSOLE"])
|
||||
if GetOption("ptw32-static"):
|
||||
env.Append(CPPDEFINES=['PTW32_STATIC_LIB']);
|
||||
|
||||
@ -267,6 +271,7 @@ sources+=Glob("src/gui/*/*.cpp")
|
||||
sources+=Glob("src/simulation/elements/*.cpp")
|
||||
sources+=Glob("src/simulation/tools/*.cpp")
|
||||
sources+=Glob("src/client/requestbroker/*.cpp")
|
||||
if not GetOption('nolua'):
|
||||
sources+=Glob("src/socket/*.c")
|
||||
|
||||
#for source in sources:
|
||||
|
@ -1,3 +1,4 @@
|
||||
#ifdef LUACONSOLE
|
||||
#include <string>
|
||||
#include <iomanip>
|
||||
#include <vector>
|
||||
@ -1739,7 +1740,7 @@ int luatpt_message_box(lua_State* l)
|
||||
{
|
||||
std::string title = std::string(luaL_optstring(l, 1, "Title"));
|
||||
std::string message = std::string(luaL_optstring(l, 2, "Message"));
|
||||
int large = luaL_optint(l, 3, 0);
|
||||
int large = lua_toboolean(l, 3);
|
||||
new InformationMessage(title, message, large);
|
||||
return 0;
|
||||
}
|
||||
@ -1983,4 +1984,4 @@ int luatpt_screenshot(lua_State* l)
|
||||
Client::Ref().WriteFile(data, filename.str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,3 +1,4 @@
|
||||
#ifdef LUACONSOLE
|
||||
/*
|
||||
** Lua BitOp -- a bit operations library for Lua 5.1/5.2.
|
||||
** http://bitop.luajit.org/
|
||||
@ -189,4 +190,4 @@ int luaopen_bit(lua_State *L)
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,3 +1,4 @@
|
||||
#ifdef LUACONSOLE
|
||||
extern "C"
|
||||
{
|
||||
#include "lua.h"
|
||||
@ -112,3 +113,4 @@ void LuaButton::triggerAction()
|
||||
LuaButton::~LuaButton()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
@ -1,3 +1,4 @@
|
||||
#ifdef LUACONSOLE
|
||||
extern "C"
|
||||
{
|
||||
#include "lua.h"
|
||||
@ -110,3 +111,4 @@ void LuaCheckbox::triggerAction()
|
||||
LuaCheckbox::~LuaCheckbox()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
@ -1,3 +1,4 @@
|
||||
#ifdef LUACONSOLE
|
||||
extern "C"
|
||||
{
|
||||
#include "lua.h"
|
||||
@ -80,3 +81,4 @@ LuaComponent::~LuaComponent()
|
||||
component->GetParentWindow()->RemoveComponent(component);
|
||||
delete component;
|
||||
}
|
||||
#endif
|
||||
|
@ -1,3 +1,4 @@
|
||||
#ifdef LUACONSOLE
|
||||
extern "C"
|
||||
{
|
||||
#include "lua.h"
|
||||
@ -53,3 +54,4 @@ int LuaLabel::text(lua_State * l)
|
||||
LuaLabel::~LuaLabel()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
@ -1,3 +1,4 @@
|
||||
#ifdef LUACONSOLE
|
||||
extern "C"
|
||||
{
|
||||
#include "lua.h"
|
||||
@ -69,3 +70,4 @@ int LuaProgressBar::status(lua_State * l)
|
||||
LuaProgressBar::~LuaProgressBar()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
@ -1,3 +1,4 @@
|
||||
#ifdef LUACONSOLE
|
||||
#include <string>
|
||||
#include <iomanip>
|
||||
#include <vector>
|
||||
@ -2201,3 +2202,4 @@ std::string LuaScriptInterface::FormatCommand(std::string command)
|
||||
LuaScriptInterface::~LuaScriptInterface() {
|
||||
delete legacy;
|
||||
}
|
||||
#endif
|
||||
|
@ -1,3 +1,4 @@
|
||||
#ifdef LUACONSOLE
|
||||
extern "C"
|
||||
{
|
||||
#include "lua.h"
|
||||
@ -110,3 +111,4 @@ void LuaSlider::triggerOnValueChanged()
|
||||
LuaSlider::~LuaSlider()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
@ -1,3 +1,4 @@
|
||||
#ifdef LUACONSOLE
|
||||
extern "C"
|
||||
{
|
||||
#include "lua.h"
|
||||
@ -113,3 +114,4 @@ int LuaTextbox::text(lua_State * l)
|
||||
LuaTextbox::~LuaTextbox()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
@ -1,3 +1,4 @@
|
||||
#ifdef LUACONSOLE
|
||||
extern "C"
|
||||
{
|
||||
#include "lua.h"
|
||||
@ -591,3 +592,4 @@ LuaWindow::~LuaWindow()
|
||||
ui::Engine::Ref().CloseWindow();
|
||||
delete window;
|
||||
}
|
||||
#endif
|
||||
|
@ -9,8 +9,10 @@
|
||||
#include "simulation/Elements.h"
|
||||
#include "simulation/ElementGraphics.h"
|
||||
#include "simulation/Air.h"
|
||||
#ifdef LUACONSOLE
|
||||
#include "cat/LuaScriptInterface.h"
|
||||
#include "cat/LuaScriptHelper.h"
|
||||
#endif
|
||||
extern "C"
|
||||
{
|
||||
#include "hmap.h"
|
||||
@ -1212,7 +1214,7 @@ void Renderer::render_parts()
|
||||
{
|
||||
if (elements[t].Graphics)
|
||||
{
|
||||
#ifndef RENDERER
|
||||
#if !defined(RENDERER) && defined(LUACONSOLE)
|
||||
if (lua_gr_func[t])
|
||||
{
|
||||
luacon_graphicsReplacement(this, &(sim->parts[i]), nx, ny, &pixel_mode, &cola, &colr, &colg, &colb, &firea, &firer, &fireg, &fireb, i);
|
||||
|
@ -145,8 +145,12 @@ GameController::GameController():
|
||||
gameView->AttachController(this);
|
||||
gameModel->AddObserver(gameView);
|
||||
|
||||
commandInterface = new LuaScriptInterface(this, gameModel);//new TPTScriptInterface();
|
||||
#ifdef LUACONSOLE
|
||||
commandInterface = new LuaScriptInterface(this, gameModel);
|
||||
((LuaScriptInterface*)commandInterface)->SetWindow(gameView);
|
||||
#else
|
||||
commandInterface = new TPTScriptInterface(this, gameModel);
|
||||
#endif
|
||||
|
||||
commandInterface->OnBrushChanged(gameModel->GetBrushID(), gameModel->GetBrush()->GetRadius().X, gameModel->GetBrush()->GetRadius().X);
|
||||
ActiveToolChanged(0, gameModel->GetActiveTool(0));
|
||||
@ -706,7 +710,9 @@ void GameController::Tick()
|
||||
{
|
||||
if(firstTick)
|
||||
{
|
||||
#ifdef LUACONSOLE
|
||||
((LuaScriptInterface*)commandInterface)->Init();
|
||||
#endif
|
||||
if(!Client::Ref().GetPrefBool("InstallCheck", false))
|
||||
{
|
||||
Client::Ref().SetPref("InstallCheck", true);
|
||||
|
@ -14,8 +14,11 @@
|
||||
#include "gui/console/ConsoleController.h"
|
||||
#include "gui/localbrowser/LocalBrowserController.h"
|
||||
#include "gui/options/OptionsController.h"
|
||||
//#include "cat/TPTScriptInterface.h"
|
||||
#ifdef LUACONSOLE
|
||||
#include "cat/LuaScriptInterface.h"
|
||||
#else
|
||||
#include "cat/TPTScriptInterface.h"
|
||||
#endif
|
||||
#include "client/ClientListener.h"
|
||||
#include "RenderPreset.h"
|
||||
#include "Menu.h"
|
||||
|
@ -24,8 +24,10 @@
|
||||
#include "Snapshot.h"
|
||||
//#include "StorageClasses.h"
|
||||
|
||||
#ifdef LUACONSOLE
|
||||
#include "cat/LuaScriptInterface.h"
|
||||
#include "cat/LuaScriptHelper.h"
|
||||
#endif
|
||||
|
||||
int Simulation::Load(GameSave * save)
|
||||
{
|
||||
@ -4196,7 +4198,11 @@ void Simulation::update_particles_i(int start, int inc)
|
||||
}
|
||||
|
||||
//call the particle update function, if there is one
|
||||
#if !defined(RENDERER) && defined(LUACONSOLE)
|
||||
if (elements[t].Update && lua_el_mode[t] != 2)
|
||||
#else
|
||||
if (elements[t].Update)
|
||||
#endif
|
||||
{
|
||||
if ((*(elements[t].Update))(this, i, x, y, surround_space, nt, parts, pmap))
|
||||
continue;
|
||||
@ -4207,6 +4213,7 @@ void Simulation::update_particles_i(int start, int inc)
|
||||
y = (int)(parts[i].y+0.5f);
|
||||
}
|
||||
}
|
||||
#if !defined(RENDERER) && defined(LUACONSOLE)
|
||||
if(lua_el_mode[t])
|
||||
{
|
||||
if(luacon_elementReplacement(this, i, x, y, surround_space, nt, parts, pmap))
|
||||
@ -4215,6 +4222,7 @@ void Simulation::update_particles_i(int start, int inc)
|
||||
x = (int)(parts[i].x+0.5f);
|
||||
y = (int)(parts[i].y+0.5f);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(legacy_enable)//if heat sim is off
|
||||
Element::legacyUpdate(this, i,x,y,surround_space,nt, parts, pmap);
|
||||
|
@ -1,3 +1,4 @@
|
||||
#ifdef LUACONSOLE
|
||||
// socket.lua from luasocket compiled into a cpp file
|
||||
extern "C" {
|
||||
#include "lua.h"
|
||||
@ -10,3 +11,4 @@ void luaopen_socket(lua_State *l){
|
||||
luaL_loadbuffer(l, socket_luac, socket_luac_sz, "@builtin socket.lua");
|
||||
lua_call(l, 0, 0);
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user