diff options
Diffstat (limited to 'Source/3rdParty/Luax')
-rw-r--r-- | Source/3rdParty/Luax/lua.hpp | 11 | ||||
-rw-r--r-- | Source/3rdParty/Luax/luax.cpp | 0 | ||||
-rw-r--r-- | Source/3rdParty/Luax/luax.h | 21 | ||||
-rw-r--r-- | Source/3rdParty/Luax/luax_class.cpp | 0 | ||||
-rw-r--r-- | Source/3rdParty/Luax/luax_class.h | 52 | ||||
-rw-r--r-- | Source/3rdParty/Luax/luax_function.cpp | 0 | ||||
-rw-r--r-- | Source/3rdParty/Luax/luax_function.h | 0 | ||||
-rw-r--r-- | Source/3rdParty/Luax/luax_module.cpp | 8 | ||||
-rw-r--r-- | Source/3rdParty/Luax/luax_module.h | 12 | ||||
-rw-r--r-- | Source/3rdParty/Luax/luax_ref.cpp | 0 | ||||
-rw-r--r-- | Source/3rdParty/Luax/luax_ref.h | 0 | ||||
-rw-r--r-- | Source/3rdParty/Luax/luax_runtime.cpp | 0 | ||||
-rw-r--r-- | Source/3rdParty/Luax/luax_runtime.h | 11 | ||||
-rw-r--r-- | Source/3rdParty/Luax/luax_state.cpp | 8 | ||||
-rw-r--r-- | Source/3rdParty/Luax/luax_state.h | 27 | ||||
-rw-r--r-- | Source/3rdParty/Luax/luax_variable.cpp | 0 | ||||
-rw-r--r-- | Source/3rdParty/Luax/luax_variable.h | 0 |
17 files changed, 150 insertions, 0 deletions
diff --git a/Source/3rdParty/Luax/lua.hpp b/Source/3rdParty/Luax/lua.hpp new file mode 100644 index 0000000..2ad2293 --- /dev/null +++ b/Source/3rdParty/Luax/lua.hpp @@ -0,0 +1,11 @@ +#ifndef __LUAX_LUA_HPP__ +#define __LUAX_LUA_HPP__ + +// Include lua first + +extern "C" { +#include "lua.h" +#include "lualib.h" +#include "lauxlib.h" +} +#endif
\ No newline at end of file diff --git a/Source/3rdParty/Luax/luax.cpp b/Source/3rdParty/Luax/luax.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/3rdParty/Luax/luax.cpp diff --git a/Source/3rdParty/Luax/luax.h b/Source/3rdParty/Luax/luax.h new file mode 100644 index 0000000..68ff9f2 --- /dev/null +++ b/Source/3rdParty/Luax/luax.h @@ -0,0 +1,21 @@ +#ifndef __LUAX_H__ +#define __LUAX_H__ + +extern "C" { +#include "lua.h" +#include "lualib.h" +#include "lauxlib.h" +} +// include lua.hpp before this +#include "luax_runtime.h" +#include "luax_state.h" +#include "luax_ref.h" +#include "luax_class.h" +#include "luax_module.h" + +// luax չluaҪ +// * modules +// * class +// * + +#endif
\ No newline at end of file diff --git a/Source/3rdParty/Luax/luax_class.cpp b/Source/3rdParty/Luax/luax_class.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/3rdParty/Luax/luax_class.cpp diff --git a/Source/3rdParty/Luax/luax_class.h b/Source/3rdParty/Luax/luax_class.h new file mode 100644 index 0000000..46918af --- /dev/null +++ b/Source/3rdParty/Luax/luax_class.h @@ -0,0 +1,52 @@ +#ifndef __LUAX_CLASS_H__ +#define __LUAX_CLASS_H__ + +#include <vector> + +namespace Luax +{ + + /// + /// Ҫ¶luaclassҪ̳дࡣ + /// + class LuaxClass + { + public: + +#define LUAX_DECL_METHOD(MTD) static int MTD(lua_State*) +#define LUAX_DECL_FACTORY(CLS) +#define LUAX_DECL_SINGLETON(CLS) + +#define LUAX_REGISTER_CLASS(CLS) CLS::RegisterLuaType() + + static void RegisterLuaType(); + + static void RegisterLuaFuncs(); + + private: + + }; + + /// + /// ҪΪuserdata̳дࡣΪ࣬ͨLUAX_DECL_FACTORY(CLS)ָ + /// + class LuaxFactory : public LuaxClass + { + + + }; + + /// + /// עluaĵ̳дࡣ + /// + class LuaxSingleton : public LuaxClass + { + public: + + private: + + }; + +} + +#endif
\ No newline at end of file diff --git a/Source/3rdParty/Luax/luax_function.cpp b/Source/3rdParty/Luax/luax_function.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/3rdParty/Luax/luax_function.cpp diff --git a/Source/3rdParty/Luax/luax_function.h b/Source/3rdParty/Luax/luax_function.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/3rdParty/Luax/luax_function.h diff --git a/Source/3rdParty/Luax/luax_module.cpp b/Source/3rdParty/Luax/luax_module.cpp new file mode 100644 index 0000000..94de1a6 --- /dev/null +++ b/Source/3rdParty/Luax/luax_module.cpp @@ -0,0 +1,8 @@ +#include "luax_module.h" + +namespace Luax +{ + + + +}
\ No newline at end of file diff --git a/Source/3rdParty/Luax/luax_module.h b/Source/3rdParty/Luax/luax_module.h new file mode 100644 index 0000000..96d954c --- /dev/null +++ b/Source/3rdParty/Luax/luax_module.h @@ -0,0 +1,12 @@ +#ifndef __LUAX_MODULE_H__ +#define __LUAX_MODULE_H__ + +namespace Luax +{ + +#define LUAX_BEGIN_MODULE(MDL) +#define LUAX_END_MODULE(MDL) + +} + +#endif
\ No newline at end of file diff --git a/Source/3rdParty/Luax/luax_ref.cpp b/Source/3rdParty/Luax/luax_ref.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/3rdParty/Luax/luax_ref.cpp diff --git a/Source/3rdParty/Luax/luax_ref.h b/Source/3rdParty/Luax/luax_ref.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/3rdParty/Luax/luax_ref.h diff --git a/Source/3rdParty/Luax/luax_runtime.cpp b/Source/3rdParty/Luax/luax_runtime.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/3rdParty/Luax/luax_runtime.cpp diff --git a/Source/3rdParty/Luax/luax_runtime.h b/Source/3rdParty/Luax/luax_runtime.h new file mode 100644 index 0000000..a0dbea3 --- /dev/null +++ b/Source/3rdParty/Luax/luax_runtime.h @@ -0,0 +1,11 @@ +#ifndef __LUAX_RUNTIME_H__ +#define __LUAX_RUNTIME_H__ + +namespace Luax +{ + + + +} + +#endif
\ No newline at end of file diff --git a/Source/3rdParty/Luax/luax_state.cpp b/Source/3rdParty/Luax/luax_state.cpp new file mode 100644 index 0000000..3fc1645 --- /dev/null +++ b/Source/3rdParty/Luax/luax_state.cpp @@ -0,0 +1,8 @@ +//#include "luax_state.h" + +namespace Luax +{ + + + +}
\ No newline at end of file diff --git a/Source/3rdParty/Luax/luax_state.h b/Source/3rdParty/Luax/luax_state.h new file mode 100644 index 0000000..7b6338f --- /dev/null +++ b/Source/3rdParty/Luax/luax_state.h @@ -0,0 +1,27 @@ +#ifndef __LUAX_STATE_H__ +#define __LUAX_STATE_H__ + +namespace Luax +{ + + class LuaxState + { + public: + LuaxState(lua_State* state) : mState(state){}; + ~LuaxState() {}; + + inline operator lua_State*() { return mState; }; + operator bool(); + inline lua_State* operator ->() { return mState; }; + inline lua_State& operator *() { return *mState; }; + + private: + void* operator new(size_t size); + + lua_State* mState; + + }; + +} + +#endif
\ No newline at end of file diff --git a/Source/3rdParty/Luax/luax_variable.cpp b/Source/3rdParty/Luax/luax_variable.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/3rdParty/Luax/luax_variable.cpp diff --git a/Source/3rdParty/Luax/luax_variable.h b/Source/3rdParty/Luax/luax_variable.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/3rdParty/Luax/luax_variable.h |