diff options
author | chai <chaifix@163.com> | 2021-10-26 11:27:58 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-10-26 11:27:58 +0800 |
commit | 32345800737b668011a87328cd3dcce59ec2934c (patch) | |
tree | e1bbd47ae775f1268447f1c1011ab10492ee9197 /Runtime/Scripting | |
parent | ef7aedf5f272c52247d8ee9522d7b2896d21af63 (diff) |
*misc
Diffstat (limited to 'Runtime/Scripting')
-rw-r--r-- | Runtime/Scripting/Common/Common.bind.cpp | 14 | ||||
-rw-r--r-- | Runtime/Scripting/Common/DataBuffer.bind.cpp | 19 | ||||
-rw-r--r-- | Runtime/Scripting/Path/Path.bind.cpp (renamed from Runtime/Scripting/Path.bind.cpp) | 0 |
3 files changed, 33 insertions, 0 deletions
diff --git a/Runtime/Scripting/Common/Common.bind.cpp b/Runtime/Scripting/Common/Common.bind.cpp new file mode 100644 index 0000000..081426d --- /dev/null +++ b/Runtime/Scripting/Common/Common.bind.cpp @@ -0,0 +1,14 @@ +#include "Runtime/Lua/LuaHelper.h"
+#include "Runtime/Common/DataBuffer.h"
+
+int luaopen_GameLab(lua_State* L)
+{
+ LUA_BIND_STATE(L);
+
+ state.PushGlobalNamespace();
+ state.PushNamespace("GameLab");
+
+ state.RegisterNativeClass<DataBuffer>();
+
+ return 1;
+}
\ No newline at end of file diff --git a/Runtime/Scripting/Common/DataBuffer.bind.cpp b/Runtime/Scripting/Common/DataBuffer.bind.cpp new file mode 100644 index 0000000..5a5c30a --- /dev/null +++ b/Runtime/Scripting/Common/DataBuffer.bind.cpp @@ -0,0 +1,19 @@ +#include "Runtime/Common/DataBuffer.h"
+
+LUA_BIND_REGISTRY(DataBuffer) +{ + LUA_BIND_REGISTER_METHODS(state, + { "GetLength", _GetLength } + ); +} + +LUA_BIND_POSTPROCESS(DataBuffer) +{
+}
+
+LUA_BIND_IMPL_METHOD(DataBuffer, _GetLength)
+{
+ LUA_BIND_PREPARE(L, DataBuffer);
+ state.Push(self->length);
+ return 1;
+}
\ No newline at end of file diff --git a/Runtime/Scripting/Path.bind.cpp b/Runtime/Scripting/Path/Path.bind.cpp index 920f586..920f586 100644 --- a/Runtime/Scripting/Path.bind.cpp +++ b/Runtime/Scripting/Path/Path.bind.cpp |