summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-16 08:47:09 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-16 08:47:09 +0200
commit1c4c0b5698984ebe4a035f6b8a291c581a9cb21e (patch)
treeae5b417cca7f33ae63263d6172b1aa49006a136c
parentCompiles on Android! Added Eclipse project, import it into your workspace and it should be runnable on Android! (diff)
downloadcuberite-1c4c0b5698984ebe4a035f6b8a291c581a9cb21e.tar
cuberite-1c4c0b5698984ebe4a035f6b8a291c581a9cb21e.tar.gz
cuberite-1c4c0b5698984ebe4a035f6b8a291c581a9cb21e.tar.bz2
cuberite-1c4c0b5698984ebe4a035f6b8a291c581a9cb21e.tar.lz
cuberite-1c4c0b5698984ebe4a035f6b8a291c581a9cb21e.tar.xz
cuberite-1c4c0b5698984ebe4a035f6b8a291c581a9cb21e.tar.zst
cuberite-1c4c0b5698984ebe4a035f6b8a291c581a9cb21e.zip
-rw-r--r--source/cPluginManager.cpp22
-rw-r--r--source/cRoot.cpp11
-rw-r--r--source/squirrelbindings/SquirrelBindings.cpp2
-rw-r--r--source/squirrelbindings/SquirrelBindings.h4
-rw-r--r--source/squirrelbindings/SquirrelFunctions.cpp2
5 files changed, 21 insertions, 20 deletions
diff --git a/source/cPluginManager.cpp b/source/cPluginManager.cpp
index a722520bf..b3392e356 100644
--- a/source/cPluginManager.cpp
+++ b/source/cPluginManager.cpp
@@ -8,15 +8,17 @@
#include "cItem.h"
#include "cRoot.h"
#include "cLuaCommandBinder.h"
-#if USE_SQUIRREL
-# include "cPlugin_Squirrel.h"
-# include "cSquirrelCommandBinder.h"
+
+#ifdef USE_SQUIRREL
+ #include "cPlugin_Squirrel.h"
+ #include "cSquirrelCommandBinder.h"
#endif
+
#include "../iniFile/iniFile.h"
#include "tolua++.h"
#include "cPlayer.h"
-#if USE_SQUIRREL
+#ifdef USE_SQUIRREL
#include "squirrelbindings/SquirrelBindings.h"
#include "squirrelbindings/SquirrelFunctions.h"
#pragma warning(disable:4100;disable:4127;disable:4510;disable:4610;disable:4244;disable:4512) // Getting A LOT of these warnings from SqPlus
@@ -40,7 +42,7 @@ cPluginManager* cPluginManager::GetPluginManager()
cPluginManager::cPluginManager()
: m_LuaCommandBinder( new cLuaCommandBinder() )
-#if USE_SQUIRREL
+#ifdef USE_SQUIRREL
, m_SquirrelCommandBinder( new cSquirrelCommandBinder() )
#endif
, m_bReloadPlugins(false)
@@ -56,7 +58,7 @@ cPluginManager::~cPluginManager()
UnloadPluginsNow();
delete m_LuaCommandBinder;
-#if USE_SQUIRREL
+#ifdef USE_SQUIRREL
delete m_SquirrelCommandBinder;
#endif
}
@@ -80,7 +82,7 @@ void cPluginManager::ReloadPluginsNow()
m_bReloadPlugins = false;
UnloadPluginsNow();
- #if USE_SQUIRREL
+ #ifdef USE_SQUIRREL
CloseSquirrelVM();
OpenSquirrelVM();
#endif // USE_SQUIRREL
@@ -130,7 +132,7 @@ void cPluginManager::ReloadPluginsNow()
}
}
- #if USE_SQUIRREL
+ #ifdef USE_SQUIRREL
else if( ValueName.compare("Squirrel") == 0 ) // Squirrel plugin
{
AString PluginFile = IniFile.GetValue(KeyNum, i );
@@ -202,7 +204,7 @@ bool cPluginManager::CallHook(PluginHook a_Hook, unsigned int a_NumArgs, ...)
cPlayer * Player = va_arg(argptr, cPlayer * );
va_end (argptr);
-#if USE_SQUIRREL
+#ifdef USE_SQUIRREL
if (m_SquirrelCommandBinder->HandleCommand( std::string( Message ), Player))
{
return true;
@@ -689,7 +691,7 @@ void cPluginManager::RemovePlugin( cPlugin* a_Plugin, bool a_bDelete /* = false
if( a_bDelete )
{
m_LuaCommandBinder->RemoveBindingsForPlugin( a_Plugin );
-#if USE_SQUIRREL
+#ifdef USE_SQUIRREL
m_SquirrelCommandBinder->RemoveBindingsForPlugin( a_Plugin );
#endif
m_Plugins.remove( a_Plugin );
diff --git a/source/cRoot.cpp b/source/cRoot.cpp
index 4d69635e2..317b03ca3 100644
--- a/source/cRoot.cpp
+++ b/source/cRoot.cpp
@@ -16,12 +16,13 @@
#include "cRedstone.h"
#include "blocks/Block.h"
#include "items/Item.h"
-#if USE_SQUIRREL
-#include "squirrelbindings/SquirrelFunctions.h"
-#include "squirrelbindings/SquirrelBindings.h"
-#endif
#include "cChunk.h"
+#ifdef USE_SQUIRREL
+ #include "squirrelbindings/SquirrelFunctions.h"
+ #include "squirrelbindings/SquirrelBindings.h"
+#endif
+
#include "../iniFile/iniFile.h"
#include <iostream>
@@ -177,7 +178,7 @@ void cRoot::Start()
delete m_PluginManager; m_PluginManager = 0; // This should be first
- #if USE_SQUIRREL
+ #ifdef USE_SQUIRREL
CloseSquirrelVM();
#endif
LOG("Freeing MonsterConfig...");
diff --git a/source/squirrelbindings/SquirrelBindings.cpp b/source/squirrelbindings/SquirrelBindings.cpp
index c24b82c70..3d1f3ff30 100644
--- a/source/squirrelbindings/SquirrelBindings.cpp
+++ b/source/squirrelbindings/SquirrelBindings.cpp
@@ -9,7 +9,7 @@
using namespace Sqrat;
-#if USE_SQUIRREL
+#ifdef USE_SQUIRREL
void BindSquirrel(HSQUIRRELVM vm)
{
RootTable()
diff --git a/source/squirrelbindings/SquirrelBindings.h b/source/squirrelbindings/SquirrelBindings.h
index d5aee170a..e16311d6a 100644
--- a/source/squirrelbindings/SquirrelBindings.h
+++ b/source/squirrelbindings/SquirrelBindings.h
@@ -1,9 +1,7 @@
#pragma once
-#define USE_SQUIRREL 0
-
-#if USE_SQUIRREL
+#ifdef USE_SQUIRREL
#include <squirrel.h>
#include <sqrat.h>
diff --git a/source/squirrelbindings/SquirrelFunctions.cpp b/source/squirrelbindings/SquirrelFunctions.cpp
index b965c63ab..b6410ad2e 100644
--- a/source/squirrelbindings/SquirrelFunctions.cpp
+++ b/source/squirrelbindings/SquirrelFunctions.cpp
@@ -4,7 +4,7 @@
#include "SquirrelBindings.h"
-#if USE_SQUIRREL
+#ifdef USE_SQUIRREL
static HSQUIRRELVM squirrelvm = NULL;