Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
51f27bfad7
29
SConscript
29
SConscript
@ -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('--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('--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('--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('--debugging', dest="debug", action="store_true", default=False, help="Enable debug options")
|
||||||
AddOption('--beta',dest="beta",action='store_true',default=False,help="Beta build.")
|
AddOption('--beta',dest="beta",action='store_true',default=False,help="Beta build.")
|
||||||
@ -90,15 +91,16 @@ if not GetOption("macosx"):
|
|||||||
env.Append(CPPPATH=[GetOption("sdl-dir")])
|
env.Append(CPPPATH=[GetOption("sdl-dir")])
|
||||||
|
|
||||||
#Find correct lua include dir
|
#Find correct lua include dir
|
||||||
try:
|
if not GetOption("nolua"):
|
||||||
env.ParseConfig('pkg-config --cflags lua5.1')
|
try:
|
||||||
except:
|
env.ParseConfig('pkg-config --cflags lua5.1')
|
||||||
if(GetOption("lua-dir")):
|
except:
|
||||||
if not conf.CheckCHeader(GetOption("lua-dir") + '/lua.h'):
|
if(GetOption("lua-dir")):
|
||||||
print "lua5.1 headers not found or not installed"
|
if not conf.CheckCHeader(GetOption("lua-dir") + '/lua.h'):
|
||||||
raise SystemExit(1)
|
print "lua5.1 headers not found or not installed"
|
||||||
else:
|
raise SystemExit(1)
|
||||||
env.Append(CPPPATH=[GetOption("lua-dir")])
|
else:
|
||||||
|
env.Append(CPPPATH=[GetOption("lua-dir")])
|
||||||
|
|
||||||
if not GetOption('nofft'):
|
if not GetOption('nofft'):
|
||||||
#Check for FFT lib
|
#Check for FFT lib
|
||||||
@ -121,7 +123,7 @@ if not GetOption("macosx"):
|
|||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
|
|
||||||
#Check for Lua lib
|
#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'):
|
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"
|
print "liblua not found or not installed"
|
||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
@ -135,9 +137,11 @@ else:
|
|||||||
env.Append(CPPPATH=['src/', 'data/', 'generated/'])
|
env.Append(CPPPATH=['src/', 'data/', 'generated/'])
|
||||||
env.Append(CCFLAGS=['-w', '-std=c++98', '-fkeep-inline-functions'])
|
env.Append(CCFLAGS=['-w', '-std=c++98', '-fkeep-inline-functions'])
|
||||||
env.Append(LIBS=['pthread', 'm'])
|
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'):
|
if not GetOption('nofft'):
|
||||||
env.Append(CPPDEFINES=["GRAVFFT"])
|
env.Append(CPPDEFINES=["GRAVFFT"])
|
||||||
|
if not GetOption('nolua'):
|
||||||
|
env.Append(CPPDEFINED=["LUACONSOLE"])
|
||||||
if GetOption("ptw32-static"):
|
if GetOption("ptw32-static"):
|
||||||
env.Append(CPPDEFINES=['PTW32_STATIC_LIB']);
|
env.Append(CPPDEFINES=['PTW32_STATIC_LIB']);
|
||||||
|
|
||||||
@ -267,7 +271,8 @@ sources+=Glob("src/gui/*/*.cpp")
|
|||||||
sources+=Glob("src/simulation/elements/*.cpp")
|
sources+=Glob("src/simulation/elements/*.cpp")
|
||||||
sources+=Glob("src/simulation/tools/*.cpp")
|
sources+=Glob("src/simulation/tools/*.cpp")
|
||||||
sources+=Glob("src/client/requestbroker/*.cpp")
|
sources+=Glob("src/client/requestbroker/*.cpp")
|
||||||
sources+=Glob("src/socket/*.c")
|
if not GetOption('nolua'):
|
||||||
|
sources+=Glob("src/socket/*.c")
|
||||||
|
|
||||||
#for source in sources:
|
#for source in sources:
|
||||||
# print str(source)
|
# print str(source)
|
||||||
|
@ -39,4 +39,4 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
virtual ~WindowActivity() {}
|
virtual ~WindowActivity() {}
|
||||||
};
|
};
|
||||||
|
@ -433,4 +433,4 @@ unsigned long update_crc(unsigned long crc, unsigned char *buf, int len)
|
|||||||
unsigned long format::CalculateCRC(unsigned char * data, int len)
|
unsigned long format::CalculateCRC(unsigned char * data, int len)
|
||||||
{
|
{
|
||||||
return update_crc(0xffffffffL, data, len) ^ 0xffffffffL;
|
return update_crc(0xffffffffL, data, len) ^ 0xffffffffL;
|
||||||
}
|
}
|
||||||
|
@ -35,4 +35,4 @@ namespace format
|
|||||||
std::vector<char> VideoBufferToPTI(const VideoBuffer & vidBuf);
|
std::vector<char> VideoBufferToPTI(const VideoBuffer & vidBuf);
|
||||||
VideoBuffer * PTIToVideoBuffer(std::vector<char> & data);
|
VideoBuffer * PTIToVideoBuffer(std::vector<char> & data);
|
||||||
unsigned long CalculateCRC(unsigned char * data, int length);
|
unsigned long CalculateCRC(unsigned char * data, int length);
|
||||||
}
|
}
|
||||||
|
@ -145,4 +145,4 @@ private:
|
|||||||
} // End namespace
|
} // End namespace
|
||||||
|
|
||||||
|
|
||||||
//#include "reader.inl"
|
//#include "reader.inl"
|
||||||
|
@ -75,4 +75,4 @@ private:
|
|||||||
} // End namespace
|
} // End namespace
|
||||||
|
|
||||||
|
|
||||||
//#include "writer.inl"
|
//#include "writer.inl"
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#ifdef LUACONSOLE
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <vector>
|
#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 title = std::string(luaL_optstring(l, 1, "Title"));
|
||||||
std::string message = std::string(luaL_optstring(l, 2, "Message"));
|
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);
|
new InformationMessage(title, message, large);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1983,4 +1984,4 @@ int luatpt_screenshot(lua_State* l)
|
|||||||
Client::Ref().WriteFile(data, filename.str());
|
Client::Ref().WriteFile(data, filename.str());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#ifdef LUACONSOLE
|
||||||
/*
|
/*
|
||||||
** Lua BitOp -- a bit operations library for Lua 5.1/5.2.
|
** Lua BitOp -- a bit operations library for Lua 5.1/5.2.
|
||||||
** http://bitop.luajit.org/
|
** http://bitop.luajit.org/
|
||||||
@ -189,4 +190,4 @@ int luaopen_bit(lua_State *L)
|
|||||||
#endif
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#ifdef LUACONSOLE
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#include "lua.h"
|
#include "lua.h"
|
||||||
@ -111,4 +112,5 @@ void LuaButton::triggerAction()
|
|||||||
|
|
||||||
LuaButton::~LuaButton()
|
LuaButton::~LuaButton()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -30,4 +30,4 @@ public:
|
|||||||
|
|
||||||
LuaButton(lua_State * l);
|
LuaButton(lua_State * l);
|
||||||
~LuaButton();
|
~LuaButton();
|
||||||
};
|
};
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#ifdef LUACONSOLE
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#include "lua.h"
|
#include "lua.h"
|
||||||
@ -109,4 +110,5 @@ void LuaCheckbox::triggerAction()
|
|||||||
|
|
||||||
LuaCheckbox::~LuaCheckbox()
|
LuaCheckbox::~LuaCheckbox()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -30,4 +30,4 @@ public:
|
|||||||
|
|
||||||
LuaCheckbox(lua_State * l);
|
LuaCheckbox(lua_State * l);
|
||||||
~LuaCheckbox();
|
~LuaCheckbox();
|
||||||
};
|
};
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#ifdef LUACONSOLE
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#include "lua.h"
|
#include "lua.h"
|
||||||
@ -79,4 +80,5 @@ LuaComponent::~LuaComponent()
|
|||||||
if(component->GetParentWindow())
|
if(component->GetParentWindow())
|
||||||
component->GetParentWindow()->RemoveComponent(component);
|
component->GetParentWindow()->RemoveComponent(component);
|
||||||
delete component;
|
delete component;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -30,4 +30,4 @@ public:
|
|||||||
ui::Component * GetComponent() { return component; }
|
ui::Component * GetComponent() { return component; }
|
||||||
LuaComponent(lua_State * l);
|
LuaComponent(lua_State * l);
|
||||||
~LuaComponent();
|
~LuaComponent();
|
||||||
};
|
};
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#ifdef LUACONSOLE
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#include "lua.h"
|
#include "lua.h"
|
||||||
@ -52,4 +53,5 @@ int LuaLabel::text(lua_State * l)
|
|||||||
|
|
||||||
LuaLabel::~LuaLabel()
|
LuaLabel::~LuaLabel()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -26,4 +26,4 @@ public:
|
|||||||
|
|
||||||
LuaLabel(lua_State * l);
|
LuaLabel(lua_State * l);
|
||||||
~LuaLabel();
|
~LuaLabel();
|
||||||
};
|
};
|
||||||
|
@ -157,4 +157,4 @@ private:
|
|||||||
lua_pushfstring(L, "%s (%s)", T::className, buff);
|
lua_pushfstring(L, "%s (%s)", T::className, buff);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#ifdef LUACONSOLE
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#include "lua.h"
|
#include "lua.h"
|
||||||
@ -68,4 +69,5 @@ int LuaProgressBar::status(lua_State * l)
|
|||||||
|
|
||||||
LuaProgressBar::~LuaProgressBar()
|
LuaProgressBar::~LuaProgressBar()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -27,4 +27,4 @@ public:
|
|||||||
|
|
||||||
LuaProgressBar(lua_State * l);
|
LuaProgressBar(lua_State * l);
|
||||||
~LuaProgressBar();
|
~LuaProgressBar();
|
||||||
};
|
};
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#ifdef LUACONSOLE
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -2201,3 +2202,4 @@ std::string LuaScriptInterface::FormatCommand(std::string command)
|
|||||||
LuaScriptInterface::~LuaScriptInterface() {
|
LuaScriptInterface::~LuaScriptInterface() {
|
||||||
delete legacy;
|
delete legacy;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#ifdef LUACONSOLE
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#include "lua.h"
|
#include "lua.h"
|
||||||
@ -109,4 +110,5 @@ void LuaSlider::triggerOnValueChanged()
|
|||||||
|
|
||||||
LuaSlider::~LuaSlider()
|
LuaSlider::~LuaSlider()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -30,4 +30,4 @@ public:
|
|||||||
|
|
||||||
LuaSlider(lua_State * l);
|
LuaSlider(lua_State * l);
|
||||||
~LuaSlider();
|
~LuaSlider();
|
||||||
};
|
};
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#ifdef LUACONSOLE
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#include "lua.h"
|
#include "lua.h"
|
||||||
@ -112,4 +113,5 @@ int LuaTextbox::text(lua_State * l)
|
|||||||
|
|
||||||
LuaTextbox::~LuaTextbox()
|
LuaTextbox::~LuaTextbox()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -30,4 +30,4 @@ public:
|
|||||||
|
|
||||||
LuaTextbox(lua_State * l);
|
LuaTextbox(lua_State * l);
|
||||||
~LuaTextbox();
|
~LuaTextbox();
|
||||||
};
|
};
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#ifdef LUACONSOLE
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#include "lua.h"
|
#include "lua.h"
|
||||||
@ -590,4 +591,5 @@ LuaWindow::~LuaWindow()
|
|||||||
if(ui::Engine::Ref().GetWindow() == window)
|
if(ui::Engine::Ref().GetWindow() == window)
|
||||||
ui::Engine::Ref().CloseWindow();
|
ui::Engine::Ref().CloseWindow();
|
||||||
delete window;
|
delete window;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -79,4 +79,4 @@ public:
|
|||||||
ui::Window * GetWindow() { return window; }
|
ui::Window * GetWindow() { return window; }
|
||||||
LuaWindow(lua_State * l);
|
LuaWindow(lua_State * l);
|
||||||
~LuaWindow();
|
~LuaWindow();
|
||||||
};
|
};
|
||||||
|
@ -134,4 +134,4 @@ void APIRequest::Cleanup()
|
|||||||
Parser->Cleanup(ResultObject);
|
Parser->Cleanup(ResultObject);
|
||||||
ResultObject = NULL;
|
ResultObject = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,4 +13,4 @@ public:
|
|||||||
virtual ~APIResultParser() { }
|
virtual ~APIResultParser() { }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -147,4 +147,4 @@ void ImageRequest::Cleanup()
|
|||||||
delete ((VideoBuffer*)ResultObject);
|
delete ((VideoBuffer*)ResultObject);
|
||||||
ResultObject = NULL;
|
ResultObject = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,4 +11,4 @@ public:
|
|||||||
virtual RequestBroker::ProcessResponse Process(RequestBroker & rb);
|
virtual RequestBroker::ProcessResponse Process(RequestBroker & rb);
|
||||||
virtual ~ImageRequest();
|
virtual ~ImageRequest();
|
||||||
virtual void Cleanup();
|
virtual void Cleanup();
|
||||||
};
|
};
|
||||||
|
@ -309,4 +309,4 @@ void RequestBroker::Request::Cleanup()
|
|||||||
(*iter)->Cleanup();
|
(*iter)->Cleanup();
|
||||||
iter++;
|
iter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,4 +75,4 @@ public:
|
|||||||
virtual ~Request();
|
virtual ~Request();
|
||||||
virtual void Cleanup();
|
virtual void Cleanup();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -50,4 +50,4 @@ void ThumbRenderRequest::Cleanup()
|
|||||||
delete ((VideoBuffer*)ResultObject);
|
delete ((VideoBuffer*)ResultObject);
|
||||||
ResultObject = NULL;
|
ResultObject = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,4 +6,4 @@ class DebugInfo
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void Draw(ui::Point position) {}
|
virtual void Draw(ui::Point position) {}
|
||||||
};
|
};
|
||||||
|
@ -81,4 +81,4 @@ void ElementPopulationDebug::Draw(ui::Point position)
|
|||||||
ElementPopulationDebug::~ElementPopulationDebug()
|
ElementPopulationDebug::~ElementPopulationDebug()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,4 +11,4 @@ public:
|
|||||||
ElementPopulationDebug(Simulation * sim);
|
ElementPopulationDebug(Simulation * sim);
|
||||||
virtual void Draw(ui::Point position);
|
virtual void Draw(ui::Point position);
|
||||||
virtual ~ElementPopulationDebug();
|
virtual ~ElementPopulationDebug();
|
||||||
};
|
};
|
||||||
|
@ -9,8 +9,10 @@
|
|||||||
#include "simulation/Elements.h"
|
#include "simulation/Elements.h"
|
||||||
#include "simulation/ElementGraphics.h"
|
#include "simulation/ElementGraphics.h"
|
||||||
#include "simulation/Air.h"
|
#include "simulation/Air.h"
|
||||||
|
#ifdef LUACONSOLE
|
||||||
#include "cat/LuaScriptInterface.h"
|
#include "cat/LuaScriptInterface.h"
|
||||||
#include "cat/LuaScriptHelper.h"
|
#include "cat/LuaScriptHelper.h"
|
||||||
|
#endif
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#include "hmap.h"
|
#include "hmap.h"
|
||||||
@ -1212,7 +1214,7 @@ void Renderer::render_parts()
|
|||||||
{
|
{
|
||||||
if (elements[t].Graphics)
|
if (elements[t].Graphics)
|
||||||
{
|
{
|
||||||
#ifndef RENDERER
|
#if !defined(RENDERER) && defined(LUACONSOLE)
|
||||||
if (lua_gr_func[t])
|
if (lua_gr_func[t])
|
||||||
{
|
{
|
||||||
luacon_graphicsReplacement(this, &(sim->parts[i]), nx, ny, &pixel_mode, &cola, &colr, &colg, &colb, &firea, &firer, &fireg, &fireb, i);
|
luacon_graphicsReplacement(this, &(sim->parts[i]), nx, ny, &pixel_mode, &cola, &colr, &colg, &colb, &firea, &firer, &fireg, &fireb, i);
|
||||||
|
@ -8,4 +8,4 @@ void ErrorUI(std::string title, std::string message) {}
|
|||||||
|
|
||||||
void InformationUI(std::string title, std::string message) {}
|
void InformationUI(std::string title, std::string message) {}
|
||||||
|
|
||||||
std::string MessagePromptUI(std::string title, std::string message, std::string text, std::string placeholder) {}
|
std::string MessagePromptUI(std::string title, std::string message, std::string text, std::string placeholder) {}
|
||||||
|
@ -333,4 +333,4 @@ FileBrowserActivity::~FileBrowserActivity()
|
|||||||
{
|
{
|
||||||
if(callback)
|
if(callback)
|
||||||
delete callback;
|
delete callback;
|
||||||
}
|
}
|
||||||
|
@ -62,4 +62,4 @@ public:
|
|||||||
virtual void NotifyError(Task * task);
|
virtual void NotifyError(Task * task);
|
||||||
virtual void NotifyProgress(Task * task);
|
virtual void NotifyProgress(Task * task);
|
||||||
virtual void NotifyStatus(Task * task);
|
virtual void NotifyStatus(Task * task);
|
||||||
};
|
};
|
||||||
|
@ -145,8 +145,12 @@ GameController::GameController():
|
|||||||
gameView->AttachController(this);
|
gameView->AttachController(this);
|
||||||
gameModel->AddObserver(gameView);
|
gameModel->AddObserver(gameView);
|
||||||
|
|
||||||
commandInterface = new LuaScriptInterface(this, gameModel);//new TPTScriptInterface();
|
#ifdef LUACONSOLE
|
||||||
|
commandInterface = new LuaScriptInterface(this, gameModel);
|
||||||
((LuaScriptInterface*)commandInterface)->SetWindow(gameView);
|
((LuaScriptInterface*)commandInterface)->SetWindow(gameView);
|
||||||
|
#else
|
||||||
|
commandInterface = new TPTScriptInterface(this, gameModel);
|
||||||
|
#endif
|
||||||
|
|
||||||
commandInterface->OnBrushChanged(gameModel->GetBrushID(), gameModel->GetBrush()->GetRadius().X, gameModel->GetBrush()->GetRadius().X);
|
commandInterface->OnBrushChanged(gameModel->GetBrushID(), gameModel->GetBrush()->GetRadius().X, gameModel->GetBrush()->GetRadius().X);
|
||||||
ActiveToolChanged(0, gameModel->GetActiveTool(0));
|
ActiveToolChanged(0, gameModel->GetActiveTool(0));
|
||||||
@ -706,7 +710,9 @@ void GameController::Tick()
|
|||||||
{
|
{
|
||||||
if(firstTick)
|
if(firstTick)
|
||||||
{
|
{
|
||||||
|
#ifdef LUACONSOLE
|
||||||
((LuaScriptInterface*)commandInterface)->Init();
|
((LuaScriptInterface*)commandInterface)->Init();
|
||||||
|
#endif
|
||||||
if(!Client::Ref().GetPrefBool("InstallCheck", false))
|
if(!Client::Ref().GetPrefBool("InstallCheck", false))
|
||||||
{
|
{
|
||||||
Client::Ref().SetPref("InstallCheck", true);
|
Client::Ref().SetPref("InstallCheck", true);
|
||||||
|
@ -14,8 +14,11 @@
|
|||||||
#include "gui/console/ConsoleController.h"
|
#include "gui/console/ConsoleController.h"
|
||||||
#include "gui/localbrowser/LocalBrowserController.h"
|
#include "gui/localbrowser/LocalBrowserController.h"
|
||||||
#include "gui/options/OptionsController.h"
|
#include "gui/options/OptionsController.h"
|
||||||
//#include "cat/TPTScriptInterface.h"
|
#ifdef LUACONSOLE
|
||||||
#include "cat/LuaScriptInterface.h"
|
#include "cat/LuaScriptInterface.h"
|
||||||
|
#else
|
||||||
|
#include "cat/TPTScriptInterface.h"
|
||||||
|
#endif
|
||||||
#include "client/ClientListener.h"
|
#include "client/ClientListener.h"
|
||||||
#include "RenderPreset.h"
|
#include "RenderPreset.h"
|
||||||
#include "Menu.h"
|
#include "Menu.h"
|
||||||
|
@ -232,4 +232,4 @@ void PropertyWindow::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl
|
|||||||
void PropertyTool::Click(Simulation * sim, Brush * brush, ui::Point position)
|
void PropertyTool::Click(Simulation * sim, Brush * brush, ui::Point position)
|
||||||
{
|
{
|
||||||
new PropertyWindow(this, sim, position);
|
new PropertyWindow(this, sim, position);
|
||||||
}
|
}
|
||||||
|
@ -16,4 +16,4 @@ public:
|
|||||||
ColourMode(colourMode)
|
ColourMode(colourMode)
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -212,4 +212,4 @@ void Element_TESC_Tool::DrawFill(Simulation * sim, Brush * brush, ui::Point posi
|
|||||||
void PlopTool::Click(Simulation * sim, Brush * brush, ui::Point position)
|
void PlopTool::Click(Simulation * sim, Brush * brush, ui::Point position)
|
||||||
{
|
{
|
||||||
sim->create_part(-1, position.X, position.Y, toolID);
|
sim->create_part(-1, position.X, position.Y, toolID);
|
||||||
}
|
}
|
||||||
|
@ -96,4 +96,4 @@ void ContextMenu::OnDraw()
|
|||||||
Graphics * g = ui::Engine::Ref().g;
|
Graphics * g = ui::Engine::Ref().g;
|
||||||
g->fillrect(Position.X, Position.Y, Size.X, Size.Y, 100, 100, 100, 255);
|
g->fillrect(Position.X, Position.Y, Size.X, Size.Y, 100, 100, 100, 255);
|
||||||
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, Appearance.BackgroundInactive.Red, Appearance.BackgroundInactive.Green, Appearance.BackgroundInactive.Blue, Appearance.BackgroundInactive.Alpha);
|
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, Appearance.BackgroundInactive.Red, Appearance.BackgroundInactive.Green, Appearance.BackgroundInactive.Blue, Appearance.BackgroundInactive.Alpha);
|
||||||
}
|
}
|
||||||
|
@ -37,4 +37,4 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -27,4 +27,4 @@ public:
|
|||||||
|
|
||||||
LuaProgressBar(lua_State * l);
|
LuaProgressBar(lua_State * l);
|
||||||
~LuaProgressBar();
|
~LuaProgressBar();
|
||||||
};
|
};
|
||||||
|
@ -78,4 +78,4 @@ void ProgressBar::Tick(float dt)
|
|||||||
intermediatePos += 1.0f*dt;
|
intermediatePos += 1.0f*dt;
|
||||||
if(intermediatePos>100.0f)
|
if(intermediatePos>100.0f)
|
||||||
intermediatePos = 0.0f;
|
intermediatePos = 0.0f;
|
||||||
}
|
}
|
||||||
|
@ -170,4 +170,4 @@ void ScrollPanel::XTick(float dt)
|
|||||||
scrollBarWidth++;
|
scrollBarWidth++;
|
||||||
else if(!mouseInside && scrollBarWidth > 0 && !scrollbarSelected)
|
else if(!mouseInside && scrollBarWidth > 0 && !scrollbarSelected)
|
||||||
scrollBarWidth--;
|
scrollBarWidth--;
|
||||||
}
|
}
|
||||||
|
@ -29,4 +29,4 @@ namespace ui
|
|||||||
virtual void XOnMouseUp(int x, int y, unsigned int button);
|
virtual void XOnMouseUp(int x, int y, unsigned int button);
|
||||||
virtual void XOnMouseMoved(int localx, int localy, int dx, int dy);
|
virtual void XOnMouseMoved(int localx, int localy, int dx, int dy);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -142,4 +142,4 @@ LocalSaveActivity::~LocalSaveActivity()
|
|||||||
delete thumbnail;
|
delete thumbnail;
|
||||||
if(callback)
|
if(callback)
|
||||||
delete callback;
|
delete callback;
|
||||||
}
|
}
|
||||||
|
@ -36,4 +36,4 @@ public:
|
|||||||
virtual void OnDraw();
|
virtual void OnDraw();
|
||||||
virtual void OnResponseReady(void * imagePtr);
|
virtual void OnResponseReady(void * imagePtr);
|
||||||
virtual ~LocalSaveActivity();
|
virtual ~LocalSaveActivity();
|
||||||
};
|
};
|
||||||
|
@ -49,4 +49,4 @@ protected:
|
|||||||
friend class CancelAction;
|
friend class CancelAction;
|
||||||
friend class SaveAction;
|
friend class SaveAction;
|
||||||
friend class RulesAction;
|
friend class RulesAction;
|
||||||
};
|
};
|
||||||
|
@ -515,4 +515,4 @@ namespace pim
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -175,4 +175,4 @@ namespace pim
|
|||||||
void Return();
|
void Return();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,4 +117,4 @@ namespace pim
|
|||||||
return word;
|
return word;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -9,4 +9,4 @@ namespace pim
|
|||||||
#undef OPDEF
|
#undef OPDEF
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -650,4 +650,4 @@ namespace pim
|
|||||||
throw ParserExpectException(token, symbol);
|
throw ParserExpectException(token, symbol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,4 +76,4 @@ namespace pim
|
|||||||
std::vector<unsigned char> Compile();
|
std::vector<unsigned char> Compile();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -196,4 +196,4 @@ namespace pim
|
|||||||
cChar = 0;
|
cChar = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,4 +19,4 @@ namespace pim
|
|||||||
Token NextToken();
|
Token NextToken();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ namespace pim
|
|||||||
"INVALID SYMBOL"
|
"INVALID SYMBOL"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,4 +80,4 @@ namespace pim
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,4 +32,4 @@ extern "C" {
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -1221,4 +1221,4 @@ char* Resampler::get_filter_name(int filter_num)
|
|||||||
return g_filters[filter_num].name;
|
return g_filters[filter_num].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -26,4 +26,4 @@ public:
|
|||||||
SimulationSample() : PositionX(0), PositionY(0), ParticleID(0), particle(), AirPressure(0), AirVelocityX(0), AirVelocityY(0), WallType(0), Gravity(0), GravityVelocityX(0), GravityVelocityY(0), AirTemperature(0), NumParts(0) {}
|
SimulationSample() : PositionX(0), PositionY(0), ParticleID(0), particle(), AirPressure(0), AirVelocityX(0), AirVelocityY(0), WallType(0), Gravity(0), GravityVelocityX(0), GravityVelocityY(0), AirTemperature(0), NumParts(0) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -24,8 +24,10 @@
|
|||||||
#include "Snapshot.h"
|
#include "Snapshot.h"
|
||||||
//#include "StorageClasses.h"
|
//#include "StorageClasses.h"
|
||||||
|
|
||||||
|
#ifdef LUACONSOLE
|
||||||
#include "cat/LuaScriptInterface.h"
|
#include "cat/LuaScriptInterface.h"
|
||||||
#include "cat/LuaScriptHelper.h"
|
#include "cat/LuaScriptHelper.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
int Simulation::Load(GameSave * save)
|
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
|
//call the particle update function, if there is one
|
||||||
|
#if !defined(RENDERER) && defined(LUACONSOLE)
|
||||||
if (elements[t].Update && lua_el_mode[t] != 2)
|
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))
|
if ((*(elements[t].Update))(this, i, x, y, surround_space, nt, parts, pmap))
|
||||||
continue;
|
continue;
|
||||||
@ -4207,6 +4213,7 @@ void Simulation::update_particles_i(int start, int inc)
|
|||||||
y = (int)(parts[i].y+0.5f);
|
y = (int)(parts[i].y+0.5f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if !defined(RENDERER) && defined(LUACONSOLE)
|
||||||
if(lua_el_mode[t])
|
if(lua_el_mode[t])
|
||||||
{
|
{
|
||||||
if(luacon_elementReplacement(this, i, x, y, surround_space, nt, parts, pmap))
|
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);
|
x = (int)(parts[i].x+0.5f);
|
||||||
y = (int)(parts[i].y+0.5f);
|
y = (int)(parts[i].y+0.5f);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if(legacy_enable)//if heat sim is off
|
if(legacy_enable)//if heat sim is off
|
||||||
Element::legacyUpdate(this, i,x,y,surround_space,nt, parts, pmap);
|
Element::legacyUpdate(this, i,x,y,surround_space,nt, parts, pmap);
|
||||||
|
@ -57,4 +57,4 @@ public:
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -51,4 +51,4 @@ typedef struct part_type part_type;*/
|
|||||||
};
|
};
|
||||||
typedef struct part_transition part_transition;*/
|
typedef struct part_transition part_transition;*/
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -46,4 +46,4 @@ Element_116::Element_116()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Element_116::~Element_116() {}
|
Element_116::~Element_116() {}
|
||||||
|
@ -46,4 +46,4 @@ Element_146::Element_146()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Element_146::~Element_146() {}
|
Element_146::~Element_146() {}
|
||||||
|
@ -46,4 +46,4 @@ Element_BGLA::Element_BGLA()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Element_BGLA::~Element_BGLA() {}
|
Element_BGLA::~Element_BGLA() {}
|
||||||
|
@ -46,4 +46,4 @@ Element_BHOL::Element_BHOL()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Element_BHOL::~Element_BHOL() {}
|
Element_BHOL::~Element_BHOL() {}
|
||||||
|
@ -106,4 +106,4 @@ int Element_BRAY::graphics(GRAPHICS_FUNC_ARGS)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Element_BRAY::~Element_BRAY() {}
|
Element_BRAY::~Element_BRAY() {}
|
||||||
|
@ -62,4 +62,4 @@ int Element_BRCK::graphics(GRAPHICS_FUNC_ARGS)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Element_BRCK::~Element_BRCK() {}
|
Element_BRCK::~Element_BRCK() {}
|
||||||
|
@ -47,4 +47,4 @@ Element_BVBR::Element_BVBR()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Element_BVBR::~Element_BVBR() {}
|
Element_BVBR::~Element_BVBR() {}
|
||||||
|
@ -83,4 +83,4 @@ int Element_CAUS::update(UPDATE_FUNC_ARGS)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Element_CAUS::~Element_CAUS() {}
|
Element_CAUS::~Element_CAUS() {}
|
||||||
|
@ -72,4 +72,4 @@ int Element_CFLM::graphics(GRAPHICS_FUNC_ARGS)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Element_CFLM::~Element_CFLM() {}
|
Element_CFLM::~Element_CFLM() {}
|
||||||
|
@ -46,4 +46,4 @@ Element_CNCT::Element_CNCT()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Element_CNCT::~Element_CNCT() {}
|
Element_CNCT::~Element_CNCT() {}
|
||||||
|
@ -46,4 +46,4 @@ Element_DESL::Element_DESL()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Element_DESL::~Element_DESL() {}
|
Element_DESL::~Element_DESL() {}
|
||||||
|
@ -46,4 +46,4 @@ Element_DMND::Element_DMND()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Element_DMND::~Element_DMND() {}
|
Element_DMND::~Element_DMND() {}
|
||||||
|
@ -46,4 +46,4 @@ Element_DRIC::Element_DRIC()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Element_DRIC::~Element_DRIC() {}
|
Element_DRIC::~Element_DRIC() {}
|
||||||
|
@ -46,4 +46,4 @@ Element_DUST::Element_DUST()
|
|||||||
Graphics = NULL;
|
Graphics = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Element_DUST::~Element_DUST() {}
|
Element_DUST::~Element_DUST() {}
|
||||||
|
@ -46,4 +46,4 @@ Element_DYST::Element_DYST()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Element_DYST::~Element_DYST() {}
|
Element_DYST::~Element_DYST() {}
|
||||||
|
@ -46,4 +46,4 @@ Element_ETRD::Element_ETRD()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Element_ETRD::~Element_ETRD() {}
|
Element_ETRD::~Element_ETRD() {}
|
||||||
|
@ -57,4 +57,4 @@ int Element_FRME::graphics(GRAPHICS_FUNC_ARGS)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Element_FRME::~Element_FRME() {}
|
Element_FRME::~Element_FRME() {}
|
||||||
|
@ -59,4 +59,4 @@ int Element_GLAS::update(UPDATE_FUNC_ARGS)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Element_GLAS::~Element_GLAS() {}
|
Element_GLAS::~Element_GLAS() {}
|
||||||
|
@ -61,4 +61,4 @@ int Element_GOO::update(UPDATE_FUNC_ARGS)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Element_GOO::~Element_GOO() {}
|
Element_GOO::~Element_GOO() {}
|
||||||
|
@ -46,4 +46,4 @@ Element_GUNP::Element_GUNP()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Element_GUNP::~Element_GUNP() {}
|
Element_GUNP::~Element_GUNP() {}
|
||||||
|
@ -46,4 +46,4 @@ Element_INSL::Element_INSL()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Element_INSL::~Element_INSL() {}
|
Element_INSL::~Element_INSL() {}
|
||||||
|
@ -46,4 +46,4 @@ Element_INST::Element_INST()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Element_INST::~Element_INST() {}
|
Element_INST::~Element_INST() {}
|
||||||
|
@ -46,4 +46,4 @@ Element_INWR::Element_INWR()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Element_INWR::~Element_INWR() {}
|
Element_INWR::~Element_INWR() {}
|
||||||
|
@ -128,4 +128,4 @@ int Element_LIFE::graphics(GRAPHICS_FUNC_ARGS)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Element_LIFE::~Element_LIFE() {}
|
Element_LIFE::~Element_LIFE() {}
|
||||||
|
@ -46,4 +46,4 @@ Element_LNTG::Element_LNTG()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Element_LNTG::~Element_LNTG() {}
|
Element_LNTG::~Element_LNTG() {}
|
||||||
|
@ -46,4 +46,4 @@ Element_LO2::Element_LO2()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Element_LO2::~Element_LO2() {}
|
Element_LO2::~Element_LO2() {}
|
||||||
|
@ -61,4 +61,4 @@ int Element_LOLZ::RuleTable[9][9] =
|
|||||||
//#TPT-Directive ElementHeader Element_LOLZ static int lolz[XRES/9][YRES/9];
|
//#TPT-Directive ElementHeader Element_LOLZ static int lolz[XRES/9][YRES/9];
|
||||||
int Element_LOLZ::lolz[XRES/9][YRES/9];
|
int Element_LOLZ::lolz[XRES/9][YRES/9];
|
||||||
|
|
||||||
Element_LOLZ::~Element_LOLZ() {}
|
Element_LOLZ::~Element_LOLZ() {}
|
||||||
|
@ -61,4 +61,4 @@ int Element_LOVE::RuleTable[9][9] =
|
|||||||
//#TPT-Directive ElementHeader Element_LOVE static int love[XRES/9][YRES/9];
|
//#TPT-Directive ElementHeader Element_LOVE static int love[XRES/9][YRES/9];
|
||||||
int Element_LOVE::love[XRES/9][YRES/9];
|
int Element_LOVE::love[XRES/9][YRES/9];
|
||||||
|
|
||||||
Element_LOVE::~Element_LOVE() {}
|
Element_LOVE::~Element_LOVE() {}
|
||||||
|
@ -46,4 +46,4 @@ Element_LRBD::Element_LRBD()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Element_LRBD::~Element_LRBD() {}
|
Element_LRBD::~Element_LRBD() {}
|
||||||
|
@ -46,4 +46,4 @@ Element_METL::Element_METL()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Element_METL::~Element_METL() {}
|
Element_METL::~Element_METL() {}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user