diff --git a/VC2008/MCServer.vcproj b/VC2008/MCServer.vcproj
index 420bf2f5a..76d500615 100644
--- a/VC2008/MCServer.vcproj
+++ b/VC2008/MCServer.vcproj
@@ -1737,6 +1737,14 @@
RelativePath="..\source\cPluginManager.h"
>
+
+
+
+
@@ -1784,6 +1792,10 @@
RelativePath="..\source\squirrelbindings\cSquirrelBaseClass.h"
>
+
+
diff --git a/VC2010/MCServer.vcxproj b/VC2010/MCServer.vcxproj
index 06fc9aa6e..f388d704d 100644
--- a/VC2010/MCServer.vcxproj
+++ b/VC2010/MCServer.vcxproj
@@ -378,6 +378,7 @@
+
@@ -527,6 +528,7 @@
+
@@ -666,6 +668,7 @@
+
diff --git a/VC2010/MCServer.vcxproj.filters b/VC2010/MCServer.vcxproj.filters
index 1e1dc15d9..d7287ab3b 100644
--- a/VC2010/MCServer.vcxproj.filters
+++ b/VC2010/MCServer.vcxproj.filters
@@ -436,6 +436,9 @@
{833e49bd-848d-42de-ac60-6cd7656474e3}
+
+ {0a0b9b8e-ac72-4755-98e5-87cbc835016a}
+
@@ -914,6 +917,9 @@
LuaBindings\SquirrelBindings
+
+ cPluginManager\cSquirrelCommandBinder
+
@@ -1437,6 +1443,12 @@
LuaBindings\SquirrelBindings
+
+ cPluginManager\cSquirrelCommandBinder
+
+
+ LuaBindings\SquirrelBindings
+
diff --git a/makefile_base b/makefile_base
index 71828e411..1c1681998 100644
--- a/makefile_base
+++ b/makefile_base
@@ -280,6 +280,7 @@ MCServer : \
build/sqvm.o\
build/squirrelbindings/SquirrelBindings.o\
build/squirrelbindings/SquirrelFunctions.o\
+ build/cSquirrelCommandBinder.o\
build/cPlugin_Squirrel.o\
build/CraftingRecipes.o
@@ -528,6 +529,7 @@ MCServer : \
build/sqvm.o\
build/squirrelbindings/SquirrelBindings.o\
build/squirrelbindings/SquirrelFunctions.o\
+ build/cSquirrelCommandBinder.o\
build/cPlugin_Squirrel.o\
-o MCServer
@@ -771,6 +773,7 @@ clean :
build/sqvm.o\
build/squirrelbindings/SquirrelBindings.o\
build/squirrelbindings/SquirrelFunctions.o\
+ build/cSquirrelCommandBinder.o\
build/cPlugin_Squirrel.o\
MCServer
@@ -1686,6 +1689,9 @@ build/CraftingRecipes.o : source/CraftingRecipes.cpp
build/squirrelbindings/SquirrelBindings.o : source/squirrelbindings/SquirrelBindings.cpp
$(CC) $(CC_OPTIONS) source/squirrelbindings/SquirrelBindings.cpp -c $(INCLUDE) -o build/squirrelbindings/SquirrelBindings.o
+build/cSquirrelCommandBinder.o : source/cSquirrelCommandBinder.cpp
+ $(CC) $(CC_OPTIONS) source/cSquirrelCommandBinder.cpp -c $(INCLUDE) -o build/cSquirrelCommandBinder.o
+
build/squirrelbindings/SquirrelFunctions.o : source/squirrelbindings/SquirrelFunctions.cpp
$(CC) $(CC_OPTIONS) source/squirrelbindings/SquirrelFunctions.cpp -c $(INCLUDE) -o build/squirrelbindings/SquirrelFunctions.o
diff --git a/source/Bindings.cpp b/source/Bindings.cpp
index cabd19661..2636f1336 100644
--- a/source/Bindings.cpp
+++ b/source/Bindings.cpp
@@ -1,6 +1,6 @@
/*
** Lua binding: AllToLua
-** Generated automatically by tolua++-1.0.92 on 07/08/12 16:56:12.
+** Generated automatically by tolua++-1.0.92 on 07/09/12 09:01:54.
*/
#ifndef __cplusplus
diff --git a/source/Bindings.h b/source/Bindings.h
index 097fe7e64..4dd00606e 100644
--- a/source/Bindings.h
+++ b/source/Bindings.h
@@ -1,6 +1,6 @@
/*
** Lua binding: AllToLua
-** Generated automatically by tolua++-1.0.92 on 07/08/12 16:56:13.
+** Generated automatically by tolua++-1.0.92 on 07/09/12 09:01:55.
*/
/* Exported function */
diff --git a/source/cPluginManager.cpp b/source/cPluginManager.cpp
index 4cf21c850..99523183e 100644
--- a/source/cPluginManager.cpp
+++ b/source/cPluginManager.cpp
@@ -1,4 +1,3 @@
-
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "cPluginManager.h"
@@ -10,6 +9,7 @@
#include "cItem.h"
#include "cRoot.h"
#include "cLuaCommandBinder.h"
+#include "cSquirrelCommandBinder.h"
#include "../iniFile/iniFile.h"
#include "tolua++.h"
@@ -38,6 +38,7 @@ cPluginManager* cPluginManager::GetPluginManager()
cPluginManager::cPluginManager()
: m_LuaCommandBinder( new cLuaCommandBinder() )
+ , m_SquirrelCommandBinder( new cSquirrelCommandBinder() )
, m_bReloadPlugins(false)
{
}
@@ -51,6 +52,7 @@ cPluginManager::~cPluginManager()
UnloadPluginsNow();
delete m_LuaCommandBinder;
+ delete m_SquirrelCommandBinder;
}
@@ -130,7 +132,12 @@ void cPluginManager::ReloadPluginsNow()
{
LOGINFO("Loading Squirrel plugin: %s", PluginFile.c_str() );
- this->AddPlugin(new cPlugin_Squirrel(PluginFile.c_str()));
+ cPlugin_Squirrel *Plugin = new cPlugin_Squirrel(PluginFile.c_str());
+
+ if( !AddPlugin( Plugin ) )
+ {
+ delete Plugin;
+ }
}
}
#endif // USE_SQUIRREL
@@ -189,6 +196,11 @@ bool cPluginManager::CallHook(PluginHook a_Hook, unsigned int a_NumArgs, ...)
cPlayer * Player = va_arg(argptr, cPlayer * );
va_end (argptr);
+ if (m_SquirrelCommandBinder->HandleCommand( std::string( Message ), Player))
+ {
+ return true;
+ }
+
if (m_LuaCommandBinder->HandleCommand( std::string( Message ), Player))
{
return true;
@@ -644,13 +656,12 @@ void cPluginManager::RemovePlugin( cPlugin* a_Plugin, bool a_bDelete /* = false
if( a_bDelete )
{
m_LuaCommandBinder->RemoveBindingsForPlugin( a_Plugin );
+ m_SquirrelCommandBinder->RemoveBindingsForPlugin( a_Plugin );
m_Plugins.remove( a_Plugin );
RemoveHooks( a_Plugin );
a_Plugin->OnDisable();
- if( a_Plugin->GetLanguage() != cPlugin::E_SQUIRREL ) // Squirrel needs to clean it up himself!
- {
- delete a_Plugin;
- }
+
+ delete a_Plugin;
}
else
{
diff --git a/source/cPluginManager.h b/source/cPluginManager.h
index e40b00dcf..2e50b2005 100644
--- a/source/cPluginManager.h
+++ b/source/cPluginManager.h
@@ -5,6 +5,7 @@
struct lua_State;
class cLuaCommandBinder;
+class cSquirrelCommandBinder;
class cPlugin;
class cPlugin_Lua;
@@ -109,8 +110,10 @@ public: //tolua_export
void RemovePlugin( cPlugin* a_Plugin, bool a_bDelete = false ); //tolua_export
void RemoveLuaPlugin( std::string a_FileName ); //tolua_export
cPlugin_Lua* GetLuaPlugin( lua_State* a_State ); //tolua_export
-
+
cLuaCommandBinder* GetLuaCommandBinder() const { return m_LuaCommandBinder; }
+
+ cSquirrelCommandBinder* GetSquirrelCommandBinder() { return m_SquirrelCommandBinder; }
bool HasPlugin( cPlugin* a_Plugin ) const;
private:
@@ -127,8 +130,9 @@ private:
void ReloadPluginsNow();
void UnloadPluginsNow();
-
+
cLuaCommandBinder* m_LuaCommandBinder;
+ cSquirrelCommandBinder* m_SquirrelCommandBinder;
bool m_bReloadPlugins;
}; //tolua_export
diff --git a/source/cPlugin_Squirrel.cpp b/source/cPlugin_Squirrel.cpp
index aa7f7f023..892e8e433 100644
--- a/source/cPlugin_Squirrel.cpp
+++ b/source/cPlugin_Squirrel.cpp
@@ -13,7 +13,6 @@ cPlugin_Squirrel::cPlugin_Squirrel( const char* a_PluginName )
cPlugin_Squirrel::~cPlugin_Squirrel()
{
- delete m_PluginName;
delete m_Plugin;
}
diff --git a/source/cSquirrelCommandBinder.cpp b/source/cSquirrelCommandBinder.cpp
new file mode 100644
index 000000000..e2a34dfb6
--- /dev/null
+++ b/source/cSquirrelCommandBinder.cpp
@@ -0,0 +1,98 @@
+
+#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
+
+#include "cSquirrelCommandBinder.h"
+#include "cPlayer.h"
+#include "cPlugin.h"
+#include "cPlugin_Squirrel.h"
+#include "squirrelbindings/SquirrelArray.h"
+
+
+cSquirrelCommandBinder::cSquirrelCommandBinder()
+{
+}
+
+cSquirrelCommandBinder::~cSquirrelCommandBinder()
+{
+}
+
+void cSquirrelCommandBinder::ClearBindings()
+{
+ m_BoundCommands.clear();
+}
+
+void cSquirrelCommandBinder::RemoveBindingsForPlugin( cPlugin* a_Plugin )
+{
+ for( CommandMap::iterator itr = m_BoundCommands.begin(); itr != m_BoundCommands.end(); )
+ {
+ if( itr->second.Plugin == a_Plugin )
+ {
+ LOGINFO("Unbinding %s ", itr->first.c_str( ) );
+ CommandMap::iterator eraseme = itr;
+ ++itr;
+ m_BoundCommands.erase( eraseme );
+ continue;
+ }
+ ++itr;
+ }
+}
+
+bool cSquirrelCommandBinder::BindCommand( const std::string & a_Command, const std::string & a_Permission, cPlugin* a_Plugin, Sqrat::Function a_Callback )
+{
+ if( !a_Plugin->CanBindCommands() )
+ {
+ LOGERROR("ERROR: Trying to bind command \"%s\" to a plugin that is not initialized.", a_Command.c_str() );
+ return false;
+ }
+ if( m_BoundCommands.find( a_Command ) != m_BoundCommands.end() )
+ {
+ LOGERROR("ERROR: Trying to bind command \"%s\" that has already been bound.", a_Command.c_str() );
+ return false;
+ }
+ LOGINFO("Binding %s (%s)", a_Command.c_str(), a_Permission.c_str() );
+
+ BoundFunction Callback;
+ Callback.Callback = a_Callback;
+ Callback.Plugin = a_Plugin;
+ Callback.Permission = a_Permission;
+
+ m_BoundCommands[ a_Command ] = Callback;
+ return true;
+}
+
+bool cSquirrelCommandBinder::HandleCommand( const std::string & a_Command, cPlayer* a_Player )
+{
+ AStringVector Split = StringSplit(a_Command, " ");
+ if (Split.size() == 0)
+ {
+ return false;
+ }
+
+ CommandMap::iterator FoundCommand = m_BoundCommands.find( Split[0] );
+ if( FoundCommand != m_BoundCommands.end() )
+ {
+ const BoundFunction & func = FoundCommand->second;
+ if( func.Permission.size() > 0 )
+ {
+ if( !a_Player->HasPermission( func.Permission.c_str() ) )
+ {
+ return false;
+ }
+ }
+
+
+ // Push the split
+ SquirrelStringArray SplitData;
+
+ std::vector::const_iterator iter = Split.begin();
+ while(iter != Split.end()) {
+ SplitData.Add(*iter);
+ ++iter;
+ }
+
+ // Push player
+ Sqrat::Function callback = func.Callback;
+ return callback.Evaluate(&SplitData, a_Player);
+ }
+ return false;
+}
diff --git a/source/cSquirrelCommandBinder.h b/source/cSquirrelCommandBinder.h
new file mode 100644
index 000000000..50e026d06
--- /dev/null
+++ b/source/cSquirrelCommandBinder.h
@@ -0,0 +1,35 @@
+#pragma once
+#include
+#include
+
+class cPlugin;
+class cPlayer;
+
+class cSquirrelCommandBinder
+{
+public:
+ cSquirrelCommandBinder();
+ ~cSquirrelCommandBinder();
+
+ bool HandleCommand( const std::string & a_Command, cPlayer* a_Player );
+
+ bool BindCommand( const std::string & a_Command, const std::string & a_Permission, cPlugin* a_Plugin, Sqrat::Function a_Callback);
+
+ void ClearBindings();
+ void RemoveBindingsForPlugin( cPlugin* a_Plugin );
+private:
+ struct BoundFunction
+ {
+ Sqrat::Function Callback;
+ cPlugin *Plugin;
+ std::string Permission;
+ };
+
+ typedef std::map< std::string, BoundFunction > CommandMap;
+ CommandMap m_BoundCommands;
+};
+
+
+
+
+
diff --git a/source/squirrelbindings/SquirrelArray.h b/source/squirrelbindings/SquirrelArray.h
new file mode 100644
index 000000000..0c2e34f7f
--- /dev/null
+++ b/source/squirrelbindings/SquirrelArray.h
@@ -0,0 +1,36 @@
+#pragma once
+#include
+
+template
+class SquirrelArray
+{
+public:
+ SquirrelArray()
+ {
+ }
+
+ unsigned int Size()
+ {
+ return m_Values.size();
+ }
+
+ T Get(unsigned int a_Index)
+ {
+ if(m_Values.size() < a_Index)
+ {
+ return T();
+ }
+ return m_Values.at(a_Index);
+ }
+
+ void Add(T a_Value)
+ {
+ m_Values.push_back(a_Value);
+ }
+
+protected:
+ std::vector m_Values;
+
+};
+
+class SquirrelStringArray : public SquirrelArray { };
\ No newline at end of file
diff --git a/source/squirrelbindings/SquirrelBindings.cpp b/source/squirrelbindings/SquirrelBindings.cpp
index 27a82c306..f0291b39b 100644
--- a/source/squirrelbindings/SquirrelBindings.cpp
+++ b/source/squirrelbindings/SquirrelBindings.cpp
@@ -3,6 +3,7 @@
#include "SquirrelFunctions.h"
#include "cSquirrelBaseClass.h"
+#include "SquirrelArray.h"
#include "../cPlayer.h"
@@ -15,9 +16,135 @@ void BindSquirrel(HSQUIRRELVM vm)
RootTable()
.Bind("Plugin", Class()
.Func("AddHook", &cSquirrelBaseClass::AddHook)
+ .Func("AddCommand", &cSquirrelBaseClass::AddCommand)
+ .Func("BindCommand", &cSquirrelBaseClass::BindCommand)
);
- RootTable().Bind("cPlayer", Class()
+
+ RootTable().Bind("Vector3f", Class()
+ .Func("Set", &Vector3f::Set)
+ .Func("Normalize", &Vector3f::Normalize)
+ .Func("Length", &Vector3f::Length)
+ .Func("SqrLength", &Vector3f::SqrLength)
+ .Var("x", &Vector3f::x)
+ .Var("y", &Vector3f::y)
+ .Var("z", &Vector3f::z)
+ );
+
+ RootTable().Bind("Vector3d", Class()
+ .Func("Set", &Vector3d::Set)
+ .Func("Normalize", &Vector3d::Normalize)
+ .Func("Length", &Vector3d::Length)
+ .Func("SqrLength", &Vector3d::SqrLength)
+ .Var("x", &Vector3d::x)
+ .Var("y", &Vector3d::y)
+ .Var("z", &Vector3d::z)
+ );
+
+ RootTable().Bind("cEntity", Class()
+ .Func("GetEntityType", &cEntity::GetEntityType)
+ .Func("IsA", &cEntity::IsA)
+ .Func("GetWorld", &cEntity::GetWorld)
+ .Func("GetPosition", &cEntity::GetPosition)
+ .Func("GetPosX", &cEntity::GetPosX)
+ .Func("GetPosY", &cEntity::GetPosY)
+ .Func("GetPosZ", &cEntity::GetPosZ)
+ .Func("GetRot", &cEntity::GetRot)
+ .Func("GetRotation", &cEntity::GetRotation)
+ .Func("GetPitch", &cEntity::GetPitch)
+ .Func("GetRoll", &cEntity::GetRoll)
+ .Func("SetRotation", &cEntity::SetRotation)
+ .Func("SetPitch", &cEntity::SetPitch)
+ .Func("SetRoll", &cEntity::SetRoll)
+ .Func("GetLookVector", &cEntity::GetLookVector)
+ .Func("GetChunkX", &cEntity::GetChunkX)
+ .Func("GetChunkY", &cEntity::GetChunkY)
+ .Func("GetChunkZ", &cEntity::GetChunkZ)
+ .Func("SetPosX", &cEntity::SetPosX)
+ .Func("SetPosY", &cEntity::SetPosY)
+ .Func("SetPosZ", &cEntity::SetPosZ)
+ .Func("SetPosition", &cEntity::SetPosition)
+ .Func("GetUniqueID", &cEntity::GetUniqueID)
+ .Func("IsDestroyed", &cEntity::IsDestroyed)
+ .Func("Destroy", &cEntity::Destroy)
+ .Func("SpawnOn", &cEntity::SpawnOn)
+
+ );
+
+ ConstTable().Enum("MetaData", Enumeration()
+ .Const("Normal", cPawn::NORMAL)
+ .Const("Burning", cPawn::BURNING)
+ .Const("Crouched", cPawn::CROUCHED)
+ .Const("Riding", cPawn::RIDING)
+ .Const("Sprinting", cPawn::SPRINTING)
+ .Const("Eating", cPawn::EATING)
+ .Const("Blocking", cPawn::BLOCKING)
+ );
+
+ RootTable().Bind("cPawn", DerivedClass()
+ .Func("TeleportToEntity", &cPawn::TeleportToEntity)
+ .Func("TeleportTo", &cPawn::TeleportTo)
+ .Func("Heal", &cPawn::Heal)
+ .Func("TakeDamage", &cPawn::TakeDamage)
+ .Func("KilledBy", &cPawn::KilledBy)
+ .Func("GetHealth", &cPawn::GetHealth)
+ .Func("SetMetaData", &cPawn::SetMetaData)
+ .Func("GetMetaData", &cPawn::GetMetaData)
+ .Func("SetMaxHealth", &cPawn::SetMaxHealth)
+ .Func("GetMaxHealth", &cPawn::GetMaxHealth)
+ .Func("GetMaxFood", &cPawn::GetMaxFood)
+ .Func("GetFood", &cPawn::GetFood)
+ .Func("GetMaxFoodSaturation", &cPawn::GetMaxFoodSaturation)
+ .Func("GetFoodSaturation", &cPawn::GetFoodSaturation)
+ .Func("SetMaxFoodLevel", &cPawn::SetMaxFoodLevel)
+ .Func("GetMaxFoodLevel", &cPawn::SetMaxFoodLevel)
+ );
+
+ RootTable().Bind("cPlayer", DerivedClass()
.Func("GetName", &cPlayer::GetName)
+ .Func("SetTouchGround", &cPlayer::SetTouchGround)
+ .Func("SetStance", &cPlayer::SetStance)
+ .Func("GetEyeHeight", &cPlayer::GetEyeHeight)
+ .Func("GetEyePosition", &cPlayer::GetEyePosition)
+ .Func("GetFlying", &cPlayer::GetFlying)
+ .Func("GetStance", &cPlayer::GetStance)
+ //TODO .Func("GetInventory", &cPlayer::GetInventory)
+ .Func("TeleportTo", &cPlayer::TeleportTo)
+ .Func("GetGameMode", &cPlayer::GetGameMode)
+ .Func("GetIP", &cPlayer::GetIP)
+ .Func("GetLastBlockActionTime", &cPlayer::GetLastBlockActionTime)
+ .Func("GetLastBlockActionCnt", &cPlayer::GetLastBlockActionCnt)
+ .Func("SetLastBlockActionCnt", &cPlayer::SetLastBlockActionCnt)
+ .Func("SetLastBlockActionTime", &cPlayer::SetLastBlockActionTime)
+ .Func("SetGameMode", &cPlayer::SetGameMode)
+ .Func("LoginSetGameMode", &cPlayer::LoginSetGameMode)
+ .Func("SetIP", &cPlayer::SetIP)
+ .Func("MoveTo", &cPlayer::MoveTo)
+ .Func("GetClientHandle", &cPlayer::GetClientHandle)
+ .Func("SendMessage", &cPlayer::SendMessage)
+ .Func("AddToGroup", &cPlayer::AddToGroup)
+ .Func("CanUseCommand", &cPlayer::CanUseCommand)
+ .Func("HasPermission", &cPlayer::HasPermission)
+ .Func("IsInGroup", &cPlayer::IsInGroup)
+ .Func("GetColor", &cPlayer::GetColor)
+ .Func("TossItem", &cPlayer::TossItem)
+ .Func("Heal", &cPlayer::Heal)
+ .Func("Feed", &cPlayer::Feed)
+ .Func("TakeDamage", &cPlayer::TakeDamage)
+ .Func("KilledBy", &cPlayer::KilledBy)
+ .Func("Respawn", &cPlayer::Respawn)
+ .Func("SetVisible", &cPlayer::SetVisible)
+ .Func("IsVisible", &cPlayer::IsVisible)
+ .Func("MoveToWorld", &cPlayer::MoveToWorld)
+ .Func("GetLoadedWorldName", &cPlayer::GetLoadedWorldName)
+ .Func("UseEquippedItem", &cPlayer::UseEquippedItem)
+ .Func("EatItem", &cPlayer::EatItem)
+
+ );
+
+ RootTable().Bind("StringArray", Class()
+ .Func("Get", &SquirrelStringArray::Get)
+ .Func("Add", &SquirrelStringArray::Add)
+ .Func("Size", &SquirrelStringArray::Size)
);
diff --git a/source/squirrelbindings/cSquirrelBaseClass.h b/source/squirrelbindings/cSquirrelBaseClass.h
index a66ca7ddd..279c47027 100644
--- a/source/squirrelbindings/cSquirrelBaseClass.h
+++ b/source/squirrelbindings/cSquirrelBaseClass.h
@@ -3,6 +3,7 @@
#include "../cPlugin_Squirrel.h"
#include "../cPluginManager.h"
#include "../cRoot.h"
+#include "../cSquirrelCommandBinder.h"
//The baseclass for squirrel plugins
class cSquirrelBaseClass
@@ -24,6 +25,17 @@ public:
cRoot::Get()->GetPluginManager()->AddHook(m_Instance, (cPluginManager::PluginHook) a_Hook);
}
+ void AddCommand( std::string a_Command, std::string a_Description, std::string a_Permission )
+ {
+ if(m_Instance) m_Instance->AddCommand(a_Command, a_Description, a_Permission);
+ }
+
+ bool BindCommand( const std::string a_Command, const std::string a_Permission, Sqrat::Function a_Callback)
+ {
+ if(!m_Instance) return false;
+ return cRoot::Get()->GetPluginManager()->GetSquirrelCommandBinder()->BindCommand(a_Command, a_Permission, m_Instance, a_Callback);
+ }
+
protected:
cPlugin_Squirrel *m_Instance;
};
\ No newline at end of file
diff --git a/squirrel_3_0_1_stable/_OLD_sqplus/Makefile b/squirrel_3_0_1_stable/_OLD_sqplus/Makefile
deleted file mode 100644
index 1bef39832..000000000
--- a/squirrel_3_0_1_stable/_OLD_sqplus/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-SQUIRREL= ..
-
-OUT= $(SQUIRREL)/lib/libsqplus.a
-INCDIRS= -I$(SQUIRREL)/include -I. -Iinclude
-
-ALLSRCS = $(wildcard *.cpp)
-WIN32SRCS = $(wildcard *Win32*)
-SRCS = $(filter-out $(WIN32SRCS),$(ALLSRCS))
-
-sqplus:
-# g++ -fno-rtti -c $(SRCS) $(INCDIRS)
- g++ -O3 -fno-rtti -Os -c $(SRCS) $(INCDIRS)
- ar rc $(OUT) *.o
- rm *.o
-
-
-#g++ -O3 -fno-rtti -Os -c $(SRCS) $(INCDIRS)
-#g++ -ggdb -fno-rtti -c $(SRCS) $(INCDIRS)
diff --git a/squirrel_3_0_1_stable/_OLD_sqplus/SqPlus.cpp b/squirrel_3_0_1_stable/_OLD_sqplus/SqPlus.cpp
deleted file mode 100644
index 3fdf99735..000000000
--- a/squirrel_3_0_1_stable/_OLD_sqplus/SqPlus.cpp
+++ /dev/null
@@ -1,382 +0,0 @@
-#include "sqplus.h"
-#include
-
-#ifdef SQPLUS_SMARTPOINTER_OPT
-#define SQPLUS_SMARTPOINTER_CPP_DECLARATION
-#include "SqPlusSmartPointer.h"
-#endif
-
-namespace SqPlus {
-
-static int getVarInfo(StackHandler & sa,VarRefPtr & vr) {
- HSQOBJECT htable = sa.GetObjectHandle(1);
- SquirrelObject table(htable);
- const SQChar * el = sa.GetString(2);
- ScriptStringVar256 varNameTag;
- getVarNameTag(varNameTag,sizeof(varNameTag),el);
- SQUserPointer data=0;
- if (!table.RawGetUserData(varNameTag,&data)) {
- return sa.ThrowError(_SC("getVarInfo: Could not retrieve UserData")); // Results in variable not being found error.
- }
- vr = (VarRefPtr)data;
- return SQ_OK;
-} // getVarInfo
-
-static int getInstanceVarInfo(StackHandler & sa,VarRefPtr & vr,SQUserPointer & data) {
- HSQOBJECT ho = sa.GetObjectHandle(1);
- SquirrelObject instance(ho);
- const SQChar * el = sa.GetString(2);
- ScriptStringVar256 varNameTag;
- getVarNameTag(varNameTag,sizeof(varNameTag),el);
- SQUserPointer ivrData=0;
- if (!instance.RawGetUserData(varNameTag,&ivrData)) {
- return sa.ThrowError(_SC("getInstanceVarInfo: Could not retrieve UserData")); // Results in variable not being found error.
- }
- vr = (VarRefPtr)ivrData;
-
- char * up;
- if (!(vr->m_access & (VAR_ACCESS_STATIC|VAR_ACCESS_CONSTANT))) {
- SQUserPointer typetag;
- instance.GetTypeTag(&typetag);
-
-#if defined(SQ_USE_CLASS_INHERITANCE)
- if (typetag != vr->instanceType) {
- SquirrelObject typeTable = instance.GetValue(SQ_CLASS_OBJECT_TABLE_NAME);
- up = (char *)typeTable.GetUserPointer(INT((size_t)vr->instanceType)); // 64-bit compatible version.
- if (!up) {
- throw SquirrelError(_SC("Invalid Instance Type"));
- }
- } else {
- up = (char *)instance.GetInstanceUP(0);
- } // if
-
-#elif defined(SQ_USE_CLASS_INHERITANCE_SIMPLE)
- ClassTypeBase *ctb = (ClassTypeBase*)vr->instanceType;
- up = (char *)instance.GetInstanceUP(0);
- // Walk base classes until type tag match, adjust for inheritence offset
- while(ctb && typetag!=ctb) {
- up = (char*)up - ctb->m_offset;
- ctb = ctb->m_pbase;
- }
- if (!ctb) {
- throw SquirrelError(_SC("Invalid Instance Type"));
- }
-#else
- up = (char *)instance.GetInstanceUP(0);
-#endif
-
-#ifdef SQPLUS_SMARTPOINTER_OPT
-#define SQPLUS_SMARTPOINTER_INSTANCE_VARINFO
-#include "SqPlusSmartPointer.h"
-#endif
-
- up += (size_t)vr->offsetOrAddrOrConst; // Offset
- } else {
- up = (char *)vr->offsetOrAddrOrConst; // Address
- } // if
- data = up;
- return SQ_OK;
-} // getInstanceVarInfo
-
-
-// If not static/global, message can (and will) disappear before arriving at catch (G++)
-static ScriptStringVar256 g_msg_throw;
-
-static int setVar(StackHandler & sa,VarRef * vr,void * data) {
- if (vr->m_access & (VAR_ACCESS_READ_ONLY|VAR_ACCESS_CONSTANT)) {
- const SQChar * el = sa.GetString(2);
- SCSNPRINTF(g_msg_throw.s,sizeof(g_msg_throw),_SC("setVar(): Cannot write to constant: %s"),el);
- throw SquirrelError(g_msg_throw.s);
- } // if
- switch (vr->m_type) {
- case TypeInfo::TypeID: {
- INT * val = (INT *)data; // Address
- if (val) {
- INT v = sa.GetInt(3);
- // Support for different int sizes
- switch( vr->m_size ) {
- case 1: v = (*(char*)val = (char)v); break;
- case 2: v = (*(short*)val = (short)v); break;
-#ifdef _SQ64
- case 4: v = (*(int*)val = (int)v); break;
-#endif
- default: *val = v;
- }
- return sa.Return(v);
- } // if
- break;
- } // case
- case TypeInfo::TypeID: {
- unsigned * val = (unsigned *)data; // Address
- if (val) {
- *val = sa.GetInt(3);
- return sa.Return(static_cast(*val));
- } // if
- break;
- } // case
- case TypeInfo::TypeID: {
- FLOAT * val = (FLOAT *)data; // Address
- if (val) {
- *val = sa.GetFloat(3);
- return sa.Return(*val);
- } // if
- break;
- } // case
- case TypeInfo::TypeID: {
- bool * val = (bool *)data; // Address
- if (val) {
- *val = sa.GetBool(3) ? true : false;
- return sa.Return(*val);
- } // if
- break;
- } // case
- case VAR_TYPE_INSTANCE: {
- HSQUIRRELVM v = sa.GetVMPtr();
- SQUserPointer src = sa.GetInstanceUp(3,(SQUserPointer)vr->varType); // Effectively performs: ClassType<>::type() == ClassType<>().
- if (!src) {
- throw SquirrelError(_SC("INSTANCE type assignment mismatch"));
- }
- vr->varType->vgetCopyFunc()(data,src);
- return 0;
- }
- case TypeInfo::TypeID: {
- const SQChar * el = sa.GetString(2);
- SCSNPRINTF(g_msg_throw.s,sizeof(g_msg_throw),_SC("setVar(): Cannot write to an SQUserPointer: %s"),el);
- throw SquirrelError(g_msg_throw.s);
- } // case
- case TypeInfo::TypeID: {
- ScriptStringVarBase * val = (ScriptStringVarBase *)data; // Address
- if (val) {
- const SQChar * strVal = sa.GetString(3);
- if (strVal) {
- *val = strVal;
- return sa.Return(val->s);
- } // if
- } // if
- break;
- } // case
-#if defined(SQPLUS_SUPPORT_STD_STRING) && !defined(SQUNICODE)
- case TypeInfo::TypeID: {
- std::string *val = (std::string*)data; // Address
- if (val) {
- const SQChar *strVal = sa.GetString(3);
- if (strVal) {
- *val = strVal;
- return sa.Return(val->c_str());
- } // if
- } // if
- break;
- } // case
-#endif
- } // switch
- return SQ_ERROR;
-} // setVar
-
-static int getVar(StackHandler & sa,VarRef * vr,void * data) {
- switch (vr->m_type) {
- case TypeInfo::TypeID: {
- if (!(vr->m_access & VAR_ACCESS_CONSTANT)) {
- if (data) {
- INT v;
- // Support for different int sizes
- switch( vr->m_size ){
- case 1: v = *(char*)data; break;
- case 2: v = *(short*)data; break;
-#ifdef _SQ64
- case 4: v = *(int*)data; break;
-#endif
- default: v = *(INT*)data;
- }
- return sa.Return(v);
- } // if
- } else {
- INT * val = (INT *)&data; // Constant value
- return sa.Return(*val);
- } // if
- break;
- } // case
- case TypeInfo::TypeID: {
- if (!(vr->m_access & VAR_ACCESS_CONSTANT)) {
- unsigned * val = (unsigned *)data; // Address
- if (val){
- return sa.Return(static_cast(*val));
- }
- } else {
- unsigned * val = (unsigned *)&data; // Constant value
- return sa.Return(static_cast(*val));
- } // if
- break;
- } // case
- case TypeInfo::TypeID: {
- if (!(vr->m_access & VAR_ACCESS_CONSTANT)) {
- FLOAT * val = (FLOAT *)data; // Address
- if (val) {
- return sa.Return(*val);
- } // if
- } else {
- FLOAT * val = (FLOAT *)&data; // Constant value
- return sa.Return(*val);
- } // if
- break;
- } // case
- case TypeInfo::TypeID: {
- if (!(vr->m_access & VAR_ACCESS_CONSTANT)) {
- bool * val = (bool *)data; // Address
- if (val) {
- return sa.Return(*val);
- } // if
- } else {
- bool * val = (bool *)&data; // Constant value
- return sa.Return(*val);
- } // if
- break;
- } // case
- case VAR_TYPE_INSTANCE:
- if (!CreateNativeClassInstance(sa.GetVMPtr(),vr->varType->GetTypeName(),data,0)) { // data = address. Allocates memory.
- SCSNPRINTF(g_msg_throw.s,sizeof(g_msg_throw),_SC("getVar(): Could not create instance: %s"),vr->varType->GetTypeName());
- throw SquirrelError(g_msg_throw.s);
- } // if
- return 1;
- case TypeInfo::TypeID:
- return sa.Return(data); // The address of member variable, not the variable itself.
- case TypeInfo::TypeID: {
- if (!(vr->m_access & VAR_ACCESS_CONSTANT)) {
- ScriptStringVarBase * val = (ScriptStringVarBase *)data; // Address
- if (val) {
- return sa.Return(val->s);
- } // if
- } else {
- throw SquirrelError(_SC("getVar(): Invalid type+access: 'ScriptStringVarBase' with VAR_ACCESS_CONSTANT (use VAR_ACCESS_READ_ONLY instead)"));
- }
- break;
- } // case
- case TypeInfo::TypeID: {
- if (!(vr->m_access & VAR_ACCESS_CONSTANT)) {
- if( vr->m_access==VAR_ACCESS_READ_WRITE )
- throw SquirrelError(_SC("getVar(): Invalid type+access: 'const SQChar *' without VAR_ACCESS_CONSTANT"));
- // It is OK to read from a SQChar* if requested
- return sa.Return(*(const SQChar **)data); // Address
- } else {
- return sa.Return((const SQChar *)data); // Address
- }
- break;
- } // case
-#ifdef SQPLUS_SUPPORT_STD_STRING
- case TypeInfo::TypeID: {
- if (!(vr->m_access & VAR_ACCESS_CONSTANT)) {
- std::string *val = (std::string *)data; // Address
- if (val) {
- return sa.Return(val->c_str());
- }
- } else {
- throw SquirrelError(_SC("getVar(): Invalid type+access: 'std::string' with VAR_ACCESS_CONSTANT (use VAR_ACCESS_READ_ONLY instead)"));
- }
- break;
- } // case
-#endif
- } // switch
- return SQ_ERROR;
-} // getVar
-
-// === Global Vars ===
-
-int setVarFunc(HSQUIRRELVM v) {
- SquirrelVM::Init(v); // For handling multi-VM setting right
- StackHandler sa(v);
- if (sa.GetType(1) == OT_TABLE) {
- VarRefPtr vr;
- int res = getVarInfo(sa,vr);
- if (res != SQ_OK) return res;
- return setVar(sa,vr,vr->offsetOrAddrOrConst);
- } // if
- return SQ_ERROR;
-} // setVarFunc
-
-int getVarFunc(HSQUIRRELVM v) {
- SquirrelVM::Init(v); // For handling multi-VM setting right
- StackHandler sa(v);
- if (sa.GetType(1) == OT_TABLE) {
- VarRefPtr vr;
- int res = getVarInfo(sa,vr);
- if (res != SQ_OK) return res;
- return getVar(sa,vr,vr->offsetOrAddrOrConst);
- } // if
- return SQ_ERROR;
-} // getVarFunc
-
-// === Instance Vars ===
-
-int setInstanceVarFunc(HSQUIRRELVM v) {
- SquirrelVM::Init(v); // For handling multi-VM setting right
- StackHandler sa(v);
- if (sa.GetType(1) == OT_INSTANCE) {
- VarRefPtr vr;
- void * data;
- int res = getInstanceVarInfo(sa,vr,data);
- if (res != SQ_OK) return res;
- return setVar(sa,vr,data);
- } // if
- return SQ_ERROR;
-} // setInstanceVarFunc
-
-int getInstanceVarFunc(HSQUIRRELVM v) {
- SquirrelVM::Init(v); // For handling multi-VM setting right
- StackHandler sa(v);
- if (sa.GetType(1) == OT_INSTANCE) {
- VarRefPtr vr;
- void * data;
- int res = getInstanceVarInfo(sa,vr,data);
- if (res != SQ_OK) return res;
- return getVar(sa,vr,data);
- } // if
- return SQ_ERROR;
-} // getInstanceVarFunc
-
-// === Classes ===
-
-BOOL CreateClass(HSQUIRRELVM v,SquirrelObject & newClass,SQUserPointer classType,const SQChar * name,const SQChar * baseName) {
- int n = 0;
- int oldtop = sq_gettop(v);
- sq_pushroottable(v);
- sq_pushstring(v,name,-1);
- if (baseName) {
- sq_pushstring(v,baseName,-1);
- if (SQ_FAILED(sq_get(v,-3))) { // Make sure the base exists if specified by baseName.
- sq_settop(v,oldtop);
- return FALSE;
- } // if
- } // if
- if (SQ_FAILED(sq_newclass(v,baseName ? 1 : 0))) { // Will inherit from base class on stack from sq_get() above.
- sq_settop(v,oldtop);
- return FALSE;
- } // if
- newClass.AttachToStackObject(-1);
- sq_settypetag(v,-1,classType);
- sq_createslot(v,-3);
- sq_pop(v,1);
- return TRUE;
-} // CreateClass
-
-SquirrelObject RegisterClassType(HSQUIRRELVM v,const SQChar * scriptClassName,SQUserPointer classType,SQFUNCTION constructor) {
- SquirrelVM::Init(v); // For handling multi-VM setting right
- int top = sq_gettop(v);
- SquirrelObject newClass;
- if (CreateClass(v,newClass,classType,scriptClassName)) {
- SquirrelVM::CreateFunction(newClass,constructor,_SC("constructor"));
- } // if
- sq_settop(v,top);
- return newClass;
-} // RegisterClassType
-
-
-///////////////////////////////////////////////////////////////////////////
-// GCC sometimes has problems with finding inline functions at link time
-// (that also have a template definition). To solve the problem,
-// non-inlines goes here.
-#ifdef GCC_INLINE_WORKAROUND
-# include "SqPlusFunctionCallImpl.h"
-#endif // GCC_INLINE_WORKAROUND
-///////////////////////////////////////////////////////////////////////////
-
-} // namespace SqPlus
-
diff --git a/squirrel_3_0_1_stable/_OLD_sqplus/SqPlusCallTemplates.h b/squirrel_3_0_1_stable/_OLD_sqplus/SqPlusCallTemplates.h
deleted file mode 100644
index 4ebded1d3..000000000
--- a/squirrel_3_0_1_stable/_OLD_sqplus/SqPlusCallTemplates.h
+++ /dev/null
@@ -1,337 +0,0 @@
-
-// This file is included multiple times, with varying options - No header guard.
-
-// Include this file to generate Call templates with or without these options:
-// - SQPLUS_APPLY_CONST - const qualifier after functions signature (const func / member func)
-// - SQPLUS_APPLY_CDECL - qualifier before class name (MSVC specific calling convention)
-
-#undef CONST_QUAL
-#undef CALL_QUAL
-
-#ifdef SQPLUS_APPLY_CONST
- #define CONST_QUAL const
-#else
- #define CONST_QUAL
-#endif
-
-#ifdef SQPLUS_APPLY_CDECL
- #define CALL_QUAL __cdecl
-#else
- #define CALL_QUAL
-#endif
-
-
-#ifdef SQPLUS_CALL_MFUNC_RET0
-
- // Include this file again, with __cdecl also (Visual C++ specific)
- #if defined(SQPLUS_ENABLE_CDECL_MEMBER_FUNCTIONS) && !defined(SQPLUS_APPLY_CDECL)
- #define SQPLUS_APPLY_CDECL
- #include "SqPlusCallTemplates.h"
- #undef CALL_QUAL
- #define CALL_QUAL
- #endif
-
- template
- static int Call(Callee & callee,RT (CALL_QUAL Callee::*func)() CONST_QUAL,HSQUIRRELVM v,int /*index*/) {
- RT ret = (callee.*func)();
- Push(v,ret);
- return 1;
- }
-
- template
- static int Call(Callee & callee,RT (CALL_QUAL Callee::*func)(P1) CONST_QUAL,HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- RT ret = (callee.*func)(
- Get(TypeWrapper(),v,index + 0)
- );
- Push(v,ret);
- return 1;
- }
-
- template
- static int Call(Callee & callee,RT (CALL_QUAL Callee::*func)(P1,P2) CONST_QUAL,HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- RT ret = (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1)
- );
- Push(v,ret);
- return 1;
- }
-
- template
- static int Call(Callee & callee,RT (CALL_QUAL Callee::*func)(P1,P2,P3) CONST_QUAL,HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- sq_argassert(3,index + 2);
- RT ret = (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1),
- Get(TypeWrapper(),v,index + 2)
- );
- Push(v,ret);
- return 1;
- }
-
- template
- static int Call(Callee & callee,RT (CALL_QUAL Callee::*func)(P1,P2,P3,P4) CONST_QUAL,HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- sq_argassert(3,index + 2);
- sq_argassert(4,index + 3);
- RT ret = (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1),
- Get(TypeWrapper(),v,index + 2),
- Get(TypeWrapper(),v,index + 3)
- );
- Push(v,ret);
- return 1;
- }
-
- template
- static int Call(Callee & callee,RT (CALL_QUAL Callee::*func)(P1,P2,P3,P4,P5) CONST_QUAL,HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- sq_argassert(3,index + 2);
- sq_argassert(4,index + 3);
- sq_argassert(5,index + 4);
- RT ret = (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1),
- Get(TypeWrapper(),v,index + 2),
- Get(TypeWrapper(),v,index + 3),
- Get(TypeWrapper(),v,index + 4)
- );
- Push(v,ret);
- return 1;
- }
-
- template
- static int Call(Callee & callee,RT (CALL_QUAL Callee::*func)(P1,P2,P3,P4,P5,P6) CONST_QUAL,HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- sq_argassert(3,index + 2);
- sq_argassert(4,index + 3);
- sq_argassert(5,index + 4);
- sq_argassert(6,index + 5);
- RT ret = (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1),
- Get(TypeWrapper(),v,index + 2),
- Get(TypeWrapper(),v,index + 3),
- Get(TypeWrapper(),v,index + 4),
- Get(TypeWrapper(),v,index + 5)
- );
- Push(v,ret);
- return 1;
- }
-
- template
- static int Call(Callee & callee,RT (CALL_QUAL Callee::*func)(P1,P2,P3,P4,P5,P6,P7) CONST_QUAL,HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- sq_argassert(3,index + 2);
- sq_argassert(4,index + 3);
- sq_argassert(5,index + 4);
- sq_argassert(6,index + 5);
- sq_argassert(7,index + 6);
- RT ret = (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1),
- Get(TypeWrapper(),v,index + 2),
- Get(TypeWrapper(),v,index + 3),
- Get(TypeWrapper(),v,index + 4),
- Get(TypeWrapper(),v,index + 5),
- Get(TypeWrapper(),v,index + 6)
- );
- Push(v,ret);
- return 1;
- }
-#undef SQPLUS_CALL_MFUNC_RET0
-#endif // SQPLUS_CALL_MFUNC_RET0
-
-
-#ifdef SQPLUS_CALL_MFUNC_NORET
-
- // Include this very same thing with __cdecl also
- #if defined(SQPLUS_ENABLE_CDECL_MEMBER_FUNCTIONS) && !defined(SQPLUS_APPLY_CDECL)
- #define SQPLUS_APPLY_CDECL
- #include "SqPlusCallTemplates.h"
- #undef CALL_QUAL
- #define CALL_QUAL
- #endif
-
- // === Member function calls ===
-
- template
- static int Call(Callee & callee,void (CALL_QUAL Callee::*func)() CONST_QUAL, HSQUIRRELVM,int /*index*/) {
- (callee.*func)();
- return 0;
- }
-
- template
- static int Call(Callee & callee,void (CALL_QUAL Callee::*func)(P1) CONST_QUAL, HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- (callee.*func)(
- Get(TypeWrapper(),v,index + 0)
- );
- return 0;
- }
-
- template
- static int Call(Callee & callee,void (CALL_QUAL Callee::*func)(P1,P2) CONST_QUAL, HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1)
- );
- return 0;
- }
-
- template
- static int Call(Callee & callee,void (CALL_QUAL Callee::*func)(P1,P2,P3) CONST_QUAL, HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- sq_argassert(3,index + 2);
- (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1),
- Get(TypeWrapper(),v,index + 2)
- );
- return 0;
- }
-
- template
- static int Call(Callee & callee,void (CALL_QUAL Callee::*func)(P1,P2,P3,P4) CONST_QUAL, HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- sq_argassert(3,index + 2);
- sq_argassert(4,index + 3);
- (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1),
- Get(TypeWrapper(),v,index + 2),
- Get(TypeWrapper(),v,index + 3)
- );
- return 0;
- }
-
- template
- static int Call(Callee & callee,void (CALL_QUAL Callee::*func)(P1,P2,P3,P4,P5) CONST_QUAL, HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- sq_argassert(3,index + 2);
- sq_argassert(4,index + 3);
- sq_argassert(5,index + 4);
- (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1),
- Get(TypeWrapper(),v,index + 2),
- Get(TypeWrapper(),v,index + 3),
- Get(TypeWrapper(),v,index + 4)
- );
- return 0;
- }
-
- template
- static int Call(Callee & callee,void (CALL_QUAL Callee::*func)(P1,P2,P3,P4,P5,P6) CONST_QUAL, HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- sq_argassert(3,index + 2);
- sq_argassert(4,index + 3);
- sq_argassert(5,index + 4);
- sq_argassert(6,index + 5);
- (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1),
- Get(TypeWrapper(),v,index + 2),
- Get(TypeWrapper(),v,index + 3),
- Get(TypeWrapper(),v,index + 4),
- Get(TypeWrapper(),v,index + 5)
- );
- return 0;
- }
-
- template
- static int Call(Callee & callee,void (CALL_QUAL Callee::*func)(P1,P2,P3,P4,P5,P6,P7) CONST_QUAL, HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- sq_argassert(3,index + 2);
- sq_argassert(4,index + 3);
- sq_argassert(5,index + 4);
- sq_argassert(6,index + 5);
- sq_argassert(7,index + 6);
- (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1),
- Get(TypeWrapper(),v,index + 2),
- Get(TypeWrapper(),v,index + 3),
- Get(TypeWrapper(),v,index + 4),
- Get(TypeWrapper(),v,index + 5),
- Get(TypeWrapper(),v,index + 6)
- );
- return 0;
- }
-#undef SQPLUS_CALL_MFUNC_NORET
-#endif // SQPLUS_CALL_MFUNC_NORET
-
-
-#ifdef SQPLUS_CALL_MFUNC_RET1
-
- // Include this very same thing with __cdecl also
- #if defined(SQPLUS_ENABLE_CDECL_MEMBER_FUNCTIONS) && !defined(SQPLUS_APPLY_CDECL)
- #define SQPLUS_APPLY_CDECL
- #include "SqPlusCallTemplates.h"
- #undef CALL_QUAL
- #define CALL_QUAL
- #endif
-
- template
- int Call(Callee & callee, RT (CALL_QUAL Callee::*func)() CONST_QUAL, HSQUIRRELVM v,int index) {
- return ReturnSpecialization