From 5e2a973516e0729b225da9de0b03015dc5854ac4 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 18 Mar 2019 08:49:16 +0800 Subject: *luax --- Source/3rdParty/Luax/luax_class.cpp | 4 ++++ Source/3rdParty/Luax/luax_class.hpp | 2 ++ Source/3rdParty/Luax/luax_class.inl | 4 +--- Source/3rdParty/Luax/luax_config.h | 27 +++++++++++++++------------ Source/3rdParty/Luax/luax_enum.cpp | 4 ++-- Source/3rdParty/Luax/luax_enum.h | 3 ++- Source/3rdParty/Luax/luax_state.cpp | 4 ++++ Source/3rdParty/Luax/luax_state.h | 4 ++++ Source/Asura.Engine/graphics/color_palette.h | 0 Source/Asura.Engine/graphics/gif.cpp | 0 Source/Asura.Engine/graphics/gif.h | 4 ++++ 11 files changed, 38 insertions(+), 18 deletions(-) create mode 100644 Source/Asura.Engine/graphics/color_palette.h create mode 100644 Source/Asura.Engine/graphics/gif.cpp create mode 100644 Source/Asura.Engine/graphics/gif.h (limited to 'Source') diff --git a/Source/3rdParty/Luax/luax_class.cpp b/Source/3rdParty/Luax/luax_class.cpp index 155fd28..4c74926 100644 --- a/Source/3rdParty/Luax/luax_class.cpp +++ b/Source/3rdParty/Luax/luax_class.cpp @@ -5,6 +5,8 @@ namespace Luax { +#ifdef LUAX_ENABLE_PLAIN_CLASS + int LuaxPlainClass::registry(lua_State* L) { LUAX_STATE(L); @@ -188,4 +190,6 @@ namespace Luax return 1; } +#endif /*LUAX_ENABLE_PLAIN_CLASS*/ + } \ No newline at end of file diff --git a/Source/3rdParty/Luax/luax_class.hpp b/Source/3rdParty/Luax/luax_class.hpp index 3cbaf9c..da78d0b 100644 --- a/Source/3rdParty/Luax/luax_class.hpp +++ b/Source/3rdParty/Luax/luax_class.hpp @@ -140,6 +140,7 @@ namespace Luax //-------------------------------------------------------------------------------------------------------------- +#ifdef LUAX_ENABLE_PLAIN_CLASS /// /// 纯lua类 /// @@ -157,6 +158,7 @@ namespace Luax LUAX_DECL_METHOD( l_New ); }; +#endif } diff --git a/Source/3rdParty/Luax/luax_class.inl b/Source/3rdParty/Luax/luax_class.inl index 6f00a84..dc34c14 100644 --- a/Source/3rdParty/Luax/luax_class.inl +++ b/Source/3rdParty/Luax/luax_class.inl @@ -346,7 +346,6 @@ namespace Luax } #ifdef LUAX_ENABLE_NATIVE_EXTEND - /// /// 派生出子类,在lua里对派生类的成员和行为进行重新设计,但是保证了userdata的统一。Native class的派生提供Ctor支持,在 /// native实体创建后可以使用Ctor进行初始化,派生类拥有和基类一样的New参数列表,且native对象是一样的类型。 @@ -448,8 +447,7 @@ namespace Luax return 1; } - -#endif +#endif /*LUAX_ENABLE_NATIVE_EXTEND*/ template int LuaxNativeClass::l_GetClass(lua_State* L) diff --git a/Source/3rdParty/Luax/luax_config.h b/Source/3rdParty/Luax/luax_config.h index a161d95..0f69843 100644 --- a/Source/3rdParty/Luax/luax_config.h +++ b/Source/3rdParty/Luax/luax_config.h @@ -14,21 +14,21 @@ extern "C" { namespace Luax { - typedef unsigned int uint; - typedef unsigned long uintptr; - typedef long sintptr; + typedef unsigned int uint; + typedef unsigned long uintptr; + typedef long sintptr; - typedef const char cc8; + typedef const char cc8; - typedef unsigned char u8; - typedef unsigned short u16; - typedef unsigned int u32; - typedef unsigned long long u64; + typedef unsigned char u8; + typedef unsigned short u16; + typedef unsigned int u32; + typedef unsigned long long u64; - typedef signed char s8; - typedef signed short s16; - typedef signed int s32; - typedef signed long long s64; + typedef signed char s8; + typedef signed short s16; + typedef signed int s32; + typedef signed long long s64; #ifdef _WIN32 #define LUAX_FINAL final @@ -52,6 +52,9 @@ namespace Luax //#define LUAX_ENABLE_NATIVE_EXTEND 0 +#define LUAX_ENABLE_PLAIN_CLASS 1 +#define LUAX_ENABLE_PLAIN_ENABLE 1 + } #endif \ No newline at end of file diff --git a/Source/3rdParty/Luax/luax_enum.cpp b/Source/3rdParty/Luax/luax_enum.cpp index af832d1..c5b4a53 100644 --- a/Source/3rdParty/Luax/luax_enum.cpp +++ b/Source/3rdParty/Luax/luax_enum.cpp @@ -35,7 +35,7 @@ namespace Luax } //-------------------------------------------------------------------------------------------------------------- - +#ifdef LUAX_ENABLE_PLAIN_ENABLE int LuaxPlainEnum::registry(lua_State* L) { // params: @@ -63,5 +63,5 @@ namespace Luax return 1; } - +#endif } \ No newline at end of file diff --git a/Source/3rdParty/Luax/luax_enum.h b/Source/3rdParty/Luax/luax_enum.h index 19b2b83..f709885 100644 --- a/Source/3rdParty/Luax/luax_enum.h +++ b/Source/3rdParty/Luax/luax_enum.h @@ -20,7 +20,7 @@ namespace Luax extern int l_rmt__newindex(lua_State* L); //-------------------------------------------------------------------------------------------------------------- - +#ifdef LUAX_ENABLE_PLAIN_ENABLE /// /// 纯lua的枚举,创建不可修改的table /// @@ -31,6 +31,7 @@ namespace Luax static int registry(lua_State* L); }; +#endif } diff --git a/Source/3rdParty/Luax/luax_state.cpp b/Source/3rdParty/Luax/luax_state.cpp index b27825e..9812c8d 100644 --- a/Source/3rdParty/Luax/luax_state.cpp +++ b/Source/3rdParty/Luax/luax_state.cpp @@ -707,18 +707,22 @@ namespace Luax luaL_register(mState, libname, l); } +#ifdef LUAX_ENABLE_PLAIN_CLASS void LuaxState::RegisterPlainClassRegistry(cc8* name) { assert(lua_istable(mState, -1)); lua_pushcfunction(mState, LuaxPlainClass::registry); lua_setfield(mState, -2, name); } +#endif +#ifdef LUAX_ENABLE_PLAIN_ENABLE void LuaxState::RegisterPlainEnumRegistry(cc8* name) { assert(lua_istable(mState, -1)); lua_pushcfunction(mState, LuaxPlainEnum::registry); lua_setfield(mState, -2, name); } +#endif } \ No newline at end of file diff --git a/Source/3rdParty/Luax/luax_state.h b/Source/3rdParty/Luax/luax_state.h index 71e2c5c..8c5b8d6 100644 --- a/Source/3rdParty/Luax/luax_state.h +++ b/Source/3rdParty/Luax/luax_state.h @@ -168,15 +168,19 @@ namespace Luax /// void RegisterLib(cc8* libname, const luaL_Reg* l); +#ifdef LUAX_ENABLE_PLAIN_CLASS /// /// 注册纯lua类的注册函数,用来创建纯lua类。 /// void RegisterPlainClassRegistry(cc8* name); +#endif +#ifdef LUAX_ENABLE_PLAIN_ENABLE /// /// 注册纯lua的枚举,以防止修改枚举值。 /// void RegisterPlainEnumRegistry(cc8* name); +#endif //------------------------------------------------------------------------------------------------------------ diff --git a/Source/Asura.Engine/graphics/color_palette.h b/Source/Asura.Engine/graphics/color_palette.h new file mode 100644 index 0000000..e69de29 diff --git a/Source/Asura.Engine/graphics/gif.cpp b/Source/Asura.Engine/graphics/gif.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Source/Asura.Engine/graphics/gif.h b/Source/Asura.Engine/graphics/gif.h new file mode 100644 index 0000000..36a3259 --- /dev/null +++ b/Source/Asura.Engine/graphics/gif.h @@ -0,0 +1,4 @@ +#ifndef __ASURA_GIF_H__ +#define __ASURA_GIF_H__ + +#endif \ No newline at end of file -- cgit v1.1-26-g67d0