mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-10-21 10:27:18 +02:00
Minor adjustments to Sqrat types. Improved shared pointers to use less heap allocations for counters.
This commit is contained in:
@@ -147,6 +147,24 @@ public:
|
||||
sq_pop(vm,1); // pop table
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// Binds a Table or Class to the Table (can be used to facilitate namespaces)
|
||||
///
|
||||
/// \param name The key in the table being assigned a Table or Class
|
||||
/// \param obj Table or Class that is being placed in the table
|
||||
///
|
||||
/// \remarks
|
||||
/// Bind cannot be called "inline" like other functions because it introduces order-of-initialization bugs.
|
||||
///
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void Bind(const SQChar* name, LightObj& obj) {
|
||||
sq_pushobject(vm, GetObject());
|
||||
sq_pushstring(vm, name, -1);
|
||||
sq_pushobject(vm, obj.GetObject());
|
||||
sq_newslot(vm, -3, false);
|
||||
sq_pop(vm,1); // pop table
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// Binds a raw Squirrel closure to the Table
|
||||
///
|
||||
|
Reference in New Issue
Block a user