diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/cat/LegacyLuaAPI.cpp | 3 | ||||
| -rw-r--r-- | src/cat/LuaBit.cpp | 3 | ||||
| -rw-r--r-- | src/cat/LuaButton.cpp | 4 | ||||
| -rw-r--r-- | src/cat/LuaCheckbox.cpp | 4 | ||||
| -rw-r--r-- | src/cat/LuaComponent.cpp | 4 | ||||
| -rw-r--r-- | src/cat/LuaLabel.cpp | 4 | ||||
| -rw-r--r-- | src/cat/LuaProgressBar.cpp | 4 | ||||
| -rw-r--r-- | src/cat/LuaScriptInterface.cpp | 2 | ||||
| -rw-r--r-- | src/cat/LuaSlider.cpp | 4 | ||||
| -rw-r--r-- | src/cat/LuaTextbox.cpp | 4 | ||||
| -rw-r--r-- | src/cat/LuaWindow.cpp | 4 | ||||
| -rw-r--r-- | src/graphics/Renderer.cpp | 4 | ||||
| -rw-r--r-- | src/gui/game/GameController.cpp | 8 | ||||
| -rw-r--r-- | src/gui/game/GameController.h | 5 | ||||
| -rw-r--r-- | src/simulation/Simulation.cpp | 8 | ||||
| -rw-r--r-- | src/socket/socket.lua.cpp | 2 |
16 files changed, 54 insertions, 13 deletions
diff --git a/src/cat/LegacyLuaAPI.cpp b/src/cat/LegacyLuaAPI.cpp index 9c73936..82ae6a0 100644 --- a/src/cat/LegacyLuaAPI.cpp +++ b/src/cat/LegacyLuaAPI.cpp @@ -1,3 +1,4 @@ +#ifdef LUACONSOLE #include <string> #include <iomanip> #include <vector> @@ -1983,4 +1984,4 @@ int luatpt_screenshot(lua_State* l) Client::Ref().WriteFile(data, filename.str()); return 0; } - +#endif
\ No newline at end of file diff --git a/src/cat/LuaBit.cpp b/src/cat/LuaBit.cpp index c55f45a..9807441 100644 --- a/src/cat/LuaBit.cpp +++ b/src/cat/LuaBit.cpp @@ -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
\ No newline at end of file diff --git a/src/cat/LuaButton.cpp b/src/cat/LuaButton.cpp index 013adac..3f7ba26 100644 --- a/src/cat/LuaButton.cpp +++ b/src/cat/LuaButton.cpp @@ -1,3 +1,4 @@ +#ifdef LUACONSOLE extern "C" { #include "lua.h" @@ -111,4 +112,5 @@ void LuaButton::triggerAction() LuaButton::~LuaButton() { -}
\ No newline at end of file +} +#endif
\ No newline at end of file diff --git a/src/cat/LuaCheckbox.cpp b/src/cat/LuaCheckbox.cpp index bac5c4e..d844cf5 100644 --- a/src/cat/LuaCheckbox.cpp +++ b/src/cat/LuaCheckbox.cpp @@ -1,3 +1,4 @@ +#ifdef LUACONSOLE extern "C" { #include "lua.h" @@ -109,4 +110,5 @@ void LuaCheckbox::triggerAction() LuaCheckbox::~LuaCheckbox() { -}
\ No newline at end of file +} +#endif
\ No newline at end of file diff --git a/src/cat/LuaComponent.cpp b/src/cat/LuaComponent.cpp index 75e7a21..c32db6d 100644 --- a/src/cat/LuaComponent.cpp +++ b/src/cat/LuaComponent.cpp @@ -1,3 +1,4 @@ +#ifdef LUACONSOLE extern "C" { #include "lua.h" @@ -79,4 +80,5 @@ LuaComponent::~LuaComponent() if(component->GetParentWindow()) component->GetParentWindow()->RemoveComponent(component); delete component; -}
\ No newline at end of file +} +#endif
\ No newline at end of file diff --git a/src/cat/LuaLabel.cpp b/src/cat/LuaLabel.cpp index b08e687..15a7720 100644 --- a/src/cat/LuaLabel.cpp +++ b/src/cat/LuaLabel.cpp @@ -1,3 +1,4 @@ +#ifdef LUACONSOLE extern "C" { #include "lua.h" @@ -52,4 +53,5 @@ int LuaLabel::text(lua_State * l) LuaLabel::~LuaLabel() { -}
\ No newline at end of file +} +#endif
\ No newline at end of file diff --git a/src/cat/LuaProgressBar.cpp b/src/cat/LuaProgressBar.cpp index 08c88ca..670d88a 100644 --- a/src/cat/LuaProgressBar.cpp +++ b/src/cat/LuaProgressBar.cpp @@ -1,3 +1,4 @@ +#ifdef LUACONSOLE extern "C" { #include "lua.h" @@ -68,4 +69,5 @@ int LuaProgressBar::status(lua_State * l) LuaProgressBar::~LuaProgressBar() { -}
\ No newline at end of file +} +#endif
\ No newline at end of file diff --git a/src/cat/LuaScriptInterface.cpp b/src/cat/LuaScriptInterface.cpp index 4b2e749..d299c2c 100644 --- a/src/cat/LuaScriptInterface.cpp +++ b/src/cat/LuaScriptInterface.cpp @@ -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
\ No newline at end of file diff --git a/src/cat/LuaSlider.cpp b/src/cat/LuaSlider.cpp index ce07ebb..e022ba0 100644 --- a/src/cat/LuaSlider.cpp +++ b/src/cat/LuaSlider.cpp @@ -1,3 +1,4 @@ +#ifdef LUACONSOLE extern "C" { #include "lua.h" @@ -109,4 +110,5 @@ void LuaSlider::triggerOnValueChanged() LuaSlider::~LuaSlider() { -}
\ No newline at end of file +} +#endif
\ No newline at end of file diff --git a/src/cat/LuaTextbox.cpp b/src/cat/LuaTextbox.cpp index 5721525..be4add9 100644 --- a/src/cat/LuaTextbox.cpp +++ b/src/cat/LuaTextbox.cpp @@ -1,3 +1,4 @@ +#ifdef LUACONSOLE extern "C" { #include "lua.h" @@ -112,4 +113,5 @@ int LuaTextbox::text(lua_State * l) LuaTextbox::~LuaTextbox() { -}
\ No newline at end of file +} +#endif
\ No newline at end of file diff --git a/src/cat/LuaWindow.cpp b/src/cat/LuaWindow.cpp index d765d68..80fc014 100644 --- a/src/cat/LuaWindow.cpp +++ b/src/cat/LuaWindow.cpp @@ -1,3 +1,4 @@ +#ifdef LUACONSOLE extern "C" { #include "lua.h" @@ -590,4 +591,5 @@ LuaWindow::~LuaWindow() if(ui::Engine::Ref().GetWindow() == window) ui::Engine::Ref().CloseWindow(); delete window; -}
\ No newline at end of file +} +#endif
\ No newline at end of file diff --git a/src/graphics/Renderer.cpp b/src/graphics/Renderer.cpp index a3ea66d..dfdd307 100644 --- a/src/graphics/Renderer.cpp +++ b/src/graphics/Renderer.cpp @@ -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); diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp index ed1a866..d7b808b 100644 --- a/src/gui/game/GameController.cpp +++ b/src/gui/game/GameController.cpp @@ -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); diff --git a/src/gui/game/GameController.h b/src/gui/game/GameController.h index c34d44a..f2cf26b 100644 --- a/src/gui/game/GameController.h +++ b/src/gui/game/GameController.h @@ -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" diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index c1f56f7..50239b1 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -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); diff --git a/src/socket/socket.lua.cpp b/src/socket/socket.lua.cpp index 80b32f7..0032e2c 100644 --- a/src/socket/socket.lua.cpp +++ b/src/socket/socket.lua.cpp @@ -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
\ No newline at end of file |
