diff options
Diffstat (limited to 'Runtime')
-rw-r--r-- | Runtime/LuaBind/LuaBind.h (renamed from Runtime/Scripting/LuaBind.h) | 6 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindCFunctions.cpp (renamed from Runtime/Scripting/LuaBindCFunctions.cpp) | 0 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindCFunctions.h (renamed from Runtime/Scripting/LuaBindCFunctions.h) | 12 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindClass.cpp (renamed from Runtime/Scripting/LuaBindClass.cpp) | 6 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindClass.hpp (renamed from Runtime/Scripting/LuaBindClass.hpp) | 132 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindClass.inc (renamed from Runtime/Scripting/LuaBindClass.inc) | 80 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindConfig.h (renamed from Runtime/Scripting/LuaBindConfig.h) | 0 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindEnum.cpp (renamed from Runtime/Scripting/LuaBindEnum.cpp) | 6 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindEnum.h (renamed from Runtime/Scripting/LuaBindEnum.h) | 12 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindGlobalState.h (renamed from Runtime/Scripting/LuaBindGlobalState.h) | 0 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindInternal.h (renamed from Runtime/Scripting/LuaBindInternal.h) | 6 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindMemberRef.cpp (renamed from Runtime/Scripting/LuaBindMemberRef.cpp) | 0 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindMemberRef.h (renamed from Runtime/Scripting/LuaBindMemberRef.h) | 8 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindRef.cpp (renamed from Runtime/Scripting/LuaBindRef.cpp) | 0 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindRef.h (renamed from Runtime/Scripting/LuaBindRef.h) | 18 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindRefTable.cpp (renamed from Runtime/Scripting/LuaBindRefTable.cpp) | 0 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindRefTable.h (renamed from Runtime/Scripting/LuaBindRefTable.h) | 30 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindState.cpp (renamed from Runtime/Scripting/LuaBindState.cpp) | 13 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindState.h (renamed from Runtime/Scripting/LuaBindState.h) | 80 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindState.inc (renamed from Runtime/Scripting/LuaBindState.inc) | 12 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindUtility.h (renamed from Runtime/Scripting/LuaBindUtility.h) | 14 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindVM.cpp (renamed from Runtime/Scripting/LuaBindVM.cpp) | 10 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindVM.h (renamed from Runtime/Scripting/LuaBindVM.h) | 17 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindWatchDog.cpp (renamed from Runtime/Scripting/LuaBindWatchDog.cpp) | 0 | ||||
-rw-r--r-- | Runtime/LuaBind/LuaBindWatchDog.h (renamed from Runtime/Scripting/LuaBindWatchDog.h) | 6 | ||||
-rw-r--r-- | Runtime/Math/FloatConversion.h | 38 | ||||
-rw-r--r-- | Runtime/Math/Rect.h | 38 | ||||
-rw-r--r-- | Runtime/Math/Vector2.h | 10 | ||||
-rw-r--r-- | Runtime/Runner.cpp | 0 | ||||
-rw-r--r-- | Runtime/Runner.h | 0 | ||||
-rw-r--r-- | Runtime/Scripting/GL.bind.cpp | 9 |
31 files changed, 273 insertions, 290 deletions
diff --git a/Runtime/Scripting/LuaBind.h b/Runtime/LuaBind/LuaBind.h index 5b0238e..1494b5c 100644 --- a/Runtime/Scripting/LuaBind.h +++ b/Runtime/LuaBind/LuaBind.h @@ -1,9 +1,9 @@ #ifndef __LUA_BIND_H__ #define __LUA_BIND_H__ -/// -/// (port) library 用于给lua注册类和函数 -/// +// +// (port) library 用于给lua注册类和函数 +// #include "LuaBindState.h" #include "LuaBindVM.h" diff --git a/Runtime/Scripting/LuaBindCFunctions.cpp b/Runtime/LuaBind/LuaBindCFunctions.cpp index ca662a3..ca662a3 100644 --- a/Runtime/Scripting/LuaBindCFunctions.cpp +++ b/Runtime/LuaBind/LuaBindCFunctions.cpp diff --git a/Runtime/Scripting/LuaBindCFunctions.h b/Runtime/LuaBind/LuaBindCFunctions.h index 696570e..25ccbc2 100644 --- a/Runtime/Scripting/LuaBindCFunctions.h +++ b/Runtime/LuaBind/LuaBindCFunctions.h @@ -10,14 +10,14 @@ namespace { - /// - /// 获得第一个upvalue - /// + // + // 获得第一个upvalue + // extern int luax_c_getupvalue(lua_State* L); - /// - /// 调用此函数时会报错,upvalue(1)是错误信息 - /// + // + // 调用此函数时会报错,upvalue(1)是错误信息 + // extern int luax_c_errfunc(lua_State* L); } diff --git a/Runtime/Scripting/LuaBindClass.cpp b/Runtime/LuaBind/LuaBindClass.cpp index b6a54b8..7fd603c 100644 --- a/Runtime/Scripting/LuaBindClass.cpp +++ b/Runtime/LuaBind/LuaBindClass.cpp @@ -72,9 +72,9 @@ namespace LuaBind return 1; } - /// - /// New函数接受n个参数,并尝试获取__init,将参数传给__init初始化实例。 - /// + // + // New函数接受n个参数,并尝试获取__init,将参数传给__init初始化实例。 + // int PlainClass::_New(lua_State* L) { LUA_BIND_STATE(L); diff --git a/Runtime/Scripting/LuaBindClass.hpp b/Runtime/LuaBind/LuaBindClass.hpp index 90c421d..c27af4e 100644 --- a/Runtime/Scripting/LuaBindClass.hpp +++ b/Runtime/LuaBind/LuaBindClass.hpp @@ -20,32 +20,32 @@ namespace LuaBind class VM; - /// - /// 虚基类,为了实现多态。需要访问下面这些接口的外部基类需要虚继承此类,之后再派生链中就会 - /// 调用对应实体的方法。注意继承此类时不能实现下面的方法,实现在NativeClass中,实现会 - /// 导致二义性。 - /// - /// 依据Effective C++条款40,如果在必须使用virtual base基类情况下,应该尽可能避免向其中放 - /// 置数据成员,规避数据成员初始化造成的一些隐性问题。依据这一点,vpb基类更加接近C#和Java中 - /// 的Interface。所以,在这里把类用I开头标识这是一个接口。 - /// + // + // 虚基类,为了实现多态。需要访问下面这些接口的外部基类需要虚继承此类,之后再派生链中就会 + // 调用对应实体的方法。注意继承此类时不能实现下面的方法,实现在NativeClass中,实现会 + // 导致二义性。 + // + // 依据Effective C++条款40,如果在必须使用virtual base基类情况下,应该尽可能避免向其中放 + // 置数据成员,规避数据成员初始化造成的一些隐性问题。依据这一点,vpb基类更加接近C#和Java中 + // 的Interface。所以,在这里把类用I开头标识这是一个接口。 + // class Object { public: Object() {}; virtual ~Object() {}; - /// - /// 成员引用管理,在实例的ref table里。设置、取、清除。 - /// + // + // 成员引用管理,在实例的ref table里。设置、取、清除。 + // virtual bool PushMemberRef(State& state, int refID) = 0; virtual bool PushUserdata(State& state) = 0; virtual bool PushMemberTable(State& state) = 0; virtual bool PushRefTable(State& state) = 0; - /// - /// 被NativeClass实现。保持和释放native资源。 - /// + // + // 被NativeClass实现。保持和释放native资源。 + // virtual void Retain() = 0; virtual void Release() = 0; @@ -56,43 +56,43 @@ namespace LuaBind //{ //} - /// - /// 需要暴露给lua的native class需要继承此类。通过lua管理的实例要确保引用计数的正确性,在多个线程中需要确 - /// 定不会误释放。 - /// + // + // 需要暴露给lua的native class需要继承此类。通过lua管理的实例要确保引用计数的正确性,在多个线程中需要确 + // 定不会误释放。 + // template<class TYPE, class BASE = Object> class NativeClass : public BASE { public: - /// - /// 将userdata作为key,在ref table里对userdata添加一个引用,以维持userdata的生命周期。 - /// 相比较member ref,这个用在实体会被多次被不同其他实体引用的情况,并频繁销毁这些实体, - /// 避免lua频繁的调用gc检测。 - /// + // + // 将userdata作为key,在ref table里对userdata添加一个引用,以维持userdata的生命周期。 + // 相比较member ref,这个用在实体会被多次被不同其他实体引用的情况,并频繁销毁这些实体, + // 避免lua频繁的调用gc检测。 + // template<class DATATYPE> void Retain(State& state, DATATYPE* userdata); - /// - /// 对userdata减少一个引用在ref table里,以尝试回收userdata。 - /// + // + // 对userdata减少一个引用在ref table里,以尝试回收userdata。 + // template<class DATATYPE> void Release(State& state, DATATYPE* userdata); - /// - /// 将userdata push到栈顶,如果没有初始化mUserdata,初始化设置好元表并把初始化好的 - /// userdata留在栈顶。并添加一个引用。这是一个将native对象所有权移交给lua控制的方法。 - /// + // + // 将userdata push到栈顶,如果没有初始化mUserdata,初始化设置好元表并把初始化好的 + // userdata留在栈顶。并添加一个引用。这是一个将native对象所有权移交给lua控制的方法。 + // bool PushMemberRef(State& state, int refID) override; bool PushUserdata(State& state) override; bool PushMemberTable(State& state) override; bool PushRefTable(State& state) override; - /// - /// WatchDog添加一个native引用。luaVM引用不会提供外部接口。继承此类的派生类不能直接使用 - /// delete方法,应该使用Release释放。一般情况下这个操作由虚拟机__gc进行,但是允许用户 - /// 程序在native中隔绝虚拟机情况下释放,这种情况下要使用Release。 - /// - /// 这两个函数是native接口。 - /// + // + // WatchDog添加一个native引用。luaVM引用不会提供外部接口。继承此类的派生类不能直接使用 + // delete方法,应该使用Release释放。一般情况下这个操作由虚拟机__gc进行,但是允许用户 + // 程序在native中隔绝虚拟机情况下释放,这种情况下要使用Release。 + // + // 这两个函数是native接口。 + // void Retain() override final; void Release() override final; @@ -106,9 +106,9 @@ namespace LuaBind NativeClass(); virtual ~NativeClass(); - /// - /// 成员引用管理,在实例的ref table里。设置、取、清除 - /// + // + // 成员引用管理,在实例的ref table里。设置、取、清除 + // void SetMemberRef(State& state, MemberRef& memRef, int idx); bool PushMemberRef(State& state, MemberRef& memRef); void ClearMemberRef(State& state, MemberRef& memRef); @@ -124,9 +124,9 @@ namespace LuaBind static void SetClassTableRef(State& state, int idx); static void PushClassTable(State& state); - /// - /// 创建userdata,绑定实例到state。 - /// + // + // 创建userdata,绑定实例到state。 + // void BindToLua(State& state); //------------------------------------------------------------------------------// @@ -148,28 +148,28 @@ namespace LuaBind //--------------------------------------------------------------------------------// - /// - /// class table,工厂和单例都有。 - /// + // + // class table,工厂和单例都有。 + // static StrongRef mClassTable; - /// - /// 如果类是单例,这个用来保存singleton的引用关系,以保证不会被回收类似普通类的ref table。 - /// 单例的成员是全生命周期的,所以直接在_LUA_BIND_STRONGREF_TABLE。单例对userdata进行 - /// Retain\Release和member ref操作时和工厂实例不同,是存在下面这个ref table里 - /// 的,这个table在_LUA_BIND_STRONGREF_TABLE里。 - /// + // + // 如果类是单例,这个用来保存singleton的引用关系,以保证不会被回收类似普通类的ref table。 + // 单例的成员是全生命周期的,所以直接在_LUA_BIND_STRONGREF_TABLE。单例对userdata进行 + // Retain\Release和member ref操作时和工厂实例不同,是存在下面这个ref table里 + // 的,这个table在_LUA_BIND_STRONGREF_TABLE里。 + // static StrongRef mSingletonRefTable; - /// - /// 通过userdata可以拿到: - /// 1: ref table - /// 2: member table - /// 3: class table - /// + // + // 通过userdata可以拿到: + // 1: ref table + // 2: member table + // 3: class table + // WeakRef mUserdata; - /// 通过后才能删除 + // 通过后才能删除 WatchDog mWatchDog; #if LUA_BIND_PROFILER @@ -182,16 +182,16 @@ namespace LuaBind }; #if LUA_BIND_ENABLE_PLAIN_CLASS - /// - /// 纯lua类 - /// + // + // 纯lua类 + // class PlainClass { public: - /// - /// 用来注册类的入口函数。可以通过registry(类名)注册类。 - /// + // + // 用来注册类的入口函数。可以通过registry(类名)注册类。 + // static int registry(lua_State* L); LUA_BIND_DECL_METHOD(__tostring); diff --git a/Runtime/Scripting/LuaBindClass.inc b/Runtime/LuaBind/LuaBindClass.inc index e9c7b8b..1d05f98 100644 --- a/Runtime/Scripting/LuaBindClass.inc +++ b/Runtime/LuaBind/LuaBindClass.inc @@ -3,9 +3,9 @@ namespace LuaBind //--------------------------------------------------------------------------------// - /// - /// 对不同类型,通过调用GetLuaClassName获得类型名,如果是派生类,GetClassName会被覆盖,指向luax_c_getupvalue。 - /// + // + // 对不同类型,通过调用GetLuaClassName获得类型名,如果是派生类,GetClassName会被覆盖,指向luax_c_getupvalue。 + // template<class TYPE, class BASE> int NativeClass<TYPE, BASE>::_GetClassName(lua_State* L) { @@ -18,9 +18,9 @@ namespace LuaBind //--------------------------------------------------------------------------------// - /// - /// 注册工厂和单例共有的类成员 - /// + // + // 注册工厂和单例共有的类成员 + // template<class TYPE, class BASE> void NativeClass<TYPE, BASE>::RegisterClassShared(State& state) { @@ -33,9 +33,9 @@ namespace LuaBind state.RegisterMethods(regTable); } - /// - /// 工厂类的成员,注册在class table - /// + // + // 工厂类的成员,注册在class table + // template<class TYPE, class BASE> void NativeClass<TYPE, BASE>::RegisterFactoryClass(State& state) { @@ -47,9 +47,9 @@ namespace LuaBind state.RegisterMethods(regTable); } - /// - /// 单例类的成员,注册在class table - /// + // + // 单例类的成员,注册在class table + // template<class TYPE, class BASE> void NativeClass<TYPE, BASE>::RegisterSingletonClass(State& state) { @@ -238,15 +238,15 @@ namespace LuaBind return false; } - /// - /// 创建userdata,并以此添加ref table,member table和class table。 - /// ref table 是kv强引用table,保存对其他userdata的引用计数(通过userdata作为key, - /// 计数为value),以及成员引用 - /// member table 保存lua创建的实例的成员 - /// class table 所有本类型的实例共有的函数表 - /// - /// BindToLua只会在第一次注册给Lua虚拟机时调用。 - /// + // + // 创建userdata,并以此添加ref table,member table和class table。 + // ref table 是kv强引用table,保存对其他userdata的引用计数(通过userdata作为key, + // 计数为value),以及成员引用 + // member table 保存lua创建的实例的成员 + // class table 所有本类型的实例共有的函数表 + // + // BindToLua只会在第一次注册给Lua虚拟机时调用。 + // template<class TYPE, class BASE> void NativeClass<TYPE, BASE>::BindToLua(State& state) { @@ -254,11 +254,11 @@ namespace LuaBind assert(!TYPE::IsClassSingleton()); assert(!mUserdata); - /// - /// 创建userdata并留在栈顶,注意地址要转换为TYPE*,直接用this可能会导致多重继承的类丧失多态。 - /// 如果直接传this进去,在多重继承情况下,是拿不到另一头的虚函数表的。所以这里需要将this - /// 转换为整个对象的低地址,这样可以拿到另一个基类的虚函数表,通过另一个基类实现多态。 - /// + // + // 创建userdata并留在栈顶,注意地址要转换为TYPE*,直接用this可能会导致多重继承的类丧失多态。 + // 如果直接传this进去,在多重继承情况下,是拿不到另一头的虚函数表的。所以这里需要将this + // 转换为整个对象的低地址,这样可以拿到另一个基类的虚函数表,通过另一个基类实现多态。 + // TYPE* p = static_cast<TYPE*>(this); state.PushPtrUserdata(p); @@ -306,9 +306,9 @@ namespace LuaBind #endif } - /// - /// 成员引用管理 - /// + // + // 成员引用管理 + // template<class TYPE, class BASE> void NativeClass<TYPE, BASE>::SetMemberRef(State& state, MemberRef& memRef, int idx) { @@ -377,9 +377,9 @@ namespace LuaBind //--------------------------------------------------------------------------------// - /// - /// 释放工厂创建的实例 - /// + // + // 释放工厂创建的实例 + // template<class TYPE, class BASE> int NativeClass<TYPE, BASE>::__gc(lua_State* L) { @@ -400,10 +400,10 @@ namespace LuaBind return 0; } - /// - /// 输出格式如下: - /// 地址 类名 - /// + // + // 输出格式如下: + // 地址 类名 + // template<class TYPE, class BASE> int NativeClass<TYPE, BASE>::__tostring(lua_State* L) { @@ -433,10 +433,10 @@ namespace LuaBind } #if LUA_BIND_ENABLE_NATIVE_EXTEND - /// - /// 派生出子类,在lua里对派生类的成员和行为进行重新设计,但是保证了userdata的统一。Native class的派生提供__init支持,在 - /// native实体创建后可以使用__init进行初始化,派生类拥有和基类一样的New参数列表,且native对象是一样的类型。 - /// + // + // 派生出子类,在lua里对派生类的成员和行为进行重新设计,但是保证了userdata的统一。Native class的派生提供__init支持,在 + // native实体创建后可以使用__init进行初始化,派生类拥有和基类一样的New参数列表,且native对象是一样的类型。 + // template<class TYPE, class BASE> int NativeClass<TYPE, BASE>::_ExtendFactory(lua_State* L) { diff --git a/Runtime/Scripting/LuaBindConfig.h b/Runtime/LuaBind/LuaBindConfig.h index 72709bd..72709bd 100644 --- a/Runtime/Scripting/LuaBindConfig.h +++ b/Runtime/LuaBind/LuaBindConfig.h diff --git a/Runtime/Scripting/LuaBindEnum.cpp b/Runtime/LuaBind/LuaBindEnum.cpp index ecf4a9f..63e2567 100644 --- a/Runtime/Scripting/LuaBindEnum.cpp +++ b/Runtime/LuaBind/LuaBindEnum.cpp @@ -5,9 +5,9 @@ namespace LuaBind { - /// - /// 只读metatable的__index - /// + // + // 只读metatable的__index + // int _rmt__index(lua_State* L) { // params: diff --git a/Runtime/Scripting/LuaBindEnum.h b/Runtime/LuaBind/LuaBindEnum.h index dbbd2f2..122e845 100644 --- a/Runtime/Scripting/LuaBindEnum.h +++ b/Runtime/LuaBind/LuaBindEnum.h @@ -6,9 +6,9 @@ namespace LuaBind { - /// - /// 导出枚举,枚举是一类不可修改整型集合,枚举的值在 - /// + // + // 导出枚举,枚举是一类不可修改整型集合,枚举的值在 + // struct Enum { cc8* name; @@ -22,9 +22,9 @@ namespace LuaBind //--------------------------------------------------------------------------------// #if LUA_BIND_ENABLE_PLAIN_ENUM - /// - /// 纯lua的枚举,创建不可修改的table - /// + // + // 纯lua的枚举,创建不可修改的table + // class PlainEnum { public: diff --git a/Runtime/Scripting/LuaBindGlobalState.h b/Runtime/LuaBind/LuaBindGlobalState.h index fa3cc4f..fa3cc4f 100644 --- a/Runtime/Scripting/LuaBindGlobalState.h +++ b/Runtime/LuaBind/LuaBindGlobalState.h diff --git a/Runtime/Scripting/LuaBindInternal.h b/Runtime/LuaBind/LuaBindInternal.h index 99f45d0..1d4a226 100644 --- a/Runtime/Scripting/LuaBindInternal.h +++ b/Runtime/LuaBind/LuaBindInternal.h @@ -1,9 +1,9 @@ #ifndef __LUA_BIND_INTERNAL_H__ #define __LUA_BIND_INTERNAL_H__ -/// -/// 对lua源代码的深度使用 -/// +// +// 对lua源代码的深度使用 +// extern "C" { #include "ThirdParty/lua51/lstate.h" diff --git a/Runtime/Scripting/LuaBindMemberRef.cpp b/Runtime/LuaBind/LuaBindMemberRef.cpp index e680cce..e680cce 100644 --- a/Runtime/Scripting/LuaBindMemberRef.cpp +++ b/Runtime/LuaBind/LuaBindMemberRef.cpp diff --git a/Runtime/Scripting/LuaBindMemberRef.h b/Runtime/LuaBind/LuaBindMemberRef.h index 9dbd36b..045d6ef 100644 --- a/Runtime/Scripting/LuaBindMemberRef.h +++ b/Runtime/LuaBind/LuaBindMemberRef.h @@ -6,10 +6,10 @@ namespace LuaBind { - /// - /// 实例的ref table保存的member ref。由luax class做具体的管理。实例的ref table是强引用,用来管理里面member的生命周期。 - /// 用来在lua和native之间进行数据沟通。 - /// + // + // 实例的ref table保存的member ref。由luax class做具体的管理。实例的ref table是强引用,用来管理里面member的生命周期。 + // 用来在lua和native之间进行数据沟通。 + // class MemberRef { public: diff --git a/Runtime/Scripting/LuaBindRef.cpp b/Runtime/LuaBind/LuaBindRef.cpp index 00a65d0..00a65d0 100644 --- a/Runtime/Scripting/LuaBindRef.cpp +++ b/Runtime/LuaBind/LuaBindRef.cpp diff --git a/Runtime/Scripting/LuaBindRef.h b/Runtime/LuaBind/LuaBindRef.h index 7628547..93b30be 100644 --- a/Runtime/Scripting/LuaBindRef.h +++ b/Runtime/LuaBind/LuaBindRef.h @@ -7,9 +7,9 @@ namespace LuaBind { - /// - /// 引用,存在LUA_REGISTRYINDEX下面的两个表里 - /// + // + // 引用,存在LUA_REGISTRYINDEX下面的两个表里 + // class Ref { public: @@ -37,9 +37,9 @@ namespace LuaBind }; - /// - /// 强引用,在LUA_REGISTRYINDEX["_LUA_BIND_STRONGREF_TABLE"]里,保证lua object不会被回收。 - /// + // + // 强引用,在LUA_REGISTRYINDEX["_LUA_BIND_STRONGREF_TABLE"]里,保证lua object不会被回收。 + // class StrongRef: public Ref { public: @@ -47,9 +47,9 @@ namespace LuaBind }; - /// - /// 弱引用,在LUA_REGISTRYINDEX["_LUA_BIND_WEAKREF_TABLE"]里,不影响lua object的回收,只是作为一个方便取lua object的映射。 - /// + // + // 弱引用,在LUA_REGISTRYINDEX["_LUA_BIND_WEAKREF_TABLE"]里,不影响lua object的回收,只是作为一个方便取lua object的映射。 + // class WeakRef : public Ref { public: diff --git a/Runtime/Scripting/LuaBindRefTable.cpp b/Runtime/LuaBind/LuaBindRefTable.cpp index 39ef9ab..39ef9ab 100644 --- a/Runtime/Scripting/LuaBindRefTable.cpp +++ b/Runtime/LuaBind/LuaBindRefTable.cpp diff --git a/Runtime/Scripting/LuaBindRefTable.h b/Runtime/LuaBind/LuaBindRefTable.h index 1cc2af3..0d4c2d4 100644 --- a/Runtime/Scripting/LuaBindRefTable.h +++ b/Runtime/LuaBind/LuaBindRefTable.h @@ -8,9 +8,9 @@ namespace LuaBind class State; - /// - /// ref table 管理,对strong ref table和weak ref table两个table的代理。 - /// + // + // ref table 管理,对strong ref table和weak ref table两个table的代理。 + // class RefTable { public: @@ -31,25 +31,25 @@ namespace LuaBind bool IsKeyWeak(); bool IsValueWeak(); - /// - /// 对stack[idx]的实体在此ref table中增加一个引用,并返回refID - /// + // + // 对stack[idx]的实体在此ref table中增加一个引用,并返回refID + // int Ref(State& state, int idx); void Unref(State& state, int refID); - /// - /// 将此 ref table 放在栈顶 - /// + // + // 将此 ref table 放在栈顶 + // void PushRefTable(State& state); - /// - /// 将 reftable[refID] 放在栈顶 - /// + // + // 将 reftable[refID] 放在栈顶 + // void PushRef(State& state, int refID); - /// - /// 清空 ref table,表还留在LUA_REGISTRYINDEX[mName] - /// + // + // 清空 ref table,表还留在LUA_REGISTRYINDEX[mName] + // void Clear(State& state); private: diff --git a/Runtime/Scripting/LuaBindState.cpp b/Runtime/LuaBind/LuaBindState.cpp index 2b699f5..a9520a8 100644 --- a/Runtime/Scripting/LuaBindState.cpp +++ b/Runtime/LuaBind/LuaBindState.cpp @@ -97,6 +97,11 @@ namespace LuaBind luaL_dostring(mState, code.c_str()); } + void State::DoFile(const std::string & path) + { + luaL_dofile(mState, path.c_str()); + } + int State::AbsIndex(int idx) { /* @@ -710,7 +715,7 @@ namespace LuaBind { assert(lua_istable(mState, -1)); lua_pushcfunction(mState, func); - lua_setfield(mState, -1, fname); + lua_setfield(mState, -2, fname); } void State::RegisterPreloader(cc8* libname, lua_CFunction preloader) @@ -837,9 +842,9 @@ namespace LuaBind return luaL_checkstring(mState, idx); } - /// - /// check light userdata - /// + // + // check light userdata + // template <> const void* State::CheckValue < const void* >(int idx) { diff --git a/Runtime/Scripting/LuaBindState.h b/Runtime/LuaBind/LuaBindState.h index ea8cf5b..776b23d 100644 --- a/Runtime/Scripting/LuaBindState.h +++ b/Runtime/LuaBind/LuaBindState.h @@ -15,15 +15,13 @@ namespace LuaBind class StrongRef; class WeakRef; - /// - /// 对lua_State的代理,除了保存一个lua_State的引用不保存其他内容。一个实例的metatable如下: - /// class table - /// member table - /// ref table - /// userdata - /// 从userdata通过getmetatable获取上级metatable。除此之外还有一个class table注册在对应 - /// 的名称空间里。 - /// + // 对lua_State的代理,除了保存一个lua_State的引用不保存其他内容。一个实例的metatable如下: + // class table + // member table + // ref table + // userdata + // 从userdata通过getmetatable获取上级metatable。除此之外还有一个class table注册在对应 + // 的名称空间里。 LUA_BIND_API class State { public: @@ -37,9 +35,7 @@ namespace LuaBind inline operator lua_State*() { return mState; } inline operator bool() { return mState != nullptr; }; - /// - /// 获取绑定的lua_State - /// + // 获取绑定的lua_State inline lua_State* GetHandle() { return mState; }; global_State* GetGlobalState(); @@ -111,14 +107,10 @@ namespace LuaBind void Push(const void* value); void Push(std::string value); - /// - /// 将idx开始的n个push到栈顶,idx会被取正,n向上生长。 - /// + // 将idx开始的n个push到栈顶,idx会被取正,n向上生长。 void PushValues(int idx, int n); - /// - /// 以void** 的形式创建userdata,并将值设置为ptr - /// + // 以void** 的形式创建userdata,并将值设置为ptr void PushPtrUserdata(void* ptr); void Pop(int n = 1); @@ -150,54 +142,36 @@ namespace LuaBind //------------------------------------------------------------------------------// // 注册方法 - /// - /// 注册工厂,适用于普通类,有New方法 - /// + // 注册工厂,适用于普通类,有New方法 template<class TYPE> void RegisterFactory(); - /// - /// 注册单例,没有New方法 - /// + // 注册单例,没有New方法 template<class TYPE> void RegisterSingleton(); - /// - /// 注册枚举 - /// + // 注册枚举 void RegisterEnum(cc8* name, Enum* enums); - /// - /// 注册C函数,注意后面加一行{0, 0} - /// + // 注册C函数,注意后面加一行{0, 0} void RegisterMethods(const luaL_Reg *l); - /// - /// 注册单个C函数 - /// + // 注册单个C函数 void RegisterMethod(cc8* fname, lua_CFunction func); - /// - /// 把preloader加到package.preload里,当require"libname"时lua的loader_preload根据 - /// libname找到preloader直接加载。用来实现需要require的时候才加载,并且加载过一次后 - /// package.loaded记录下来,下次不会再加载。通过require会调用这个preloader。 - /// + // 把preloader加到package.preload里,当require"libname"时lua的loader_preload根据 + // libname找到preloader直接加载。用来实现需要require的时候才加载,并且加载过一次后 + // package.loaded记录下来,下次不会再加载。通过require会调用这个preloader。 void RegisterPreloader(cc8* libname, lua_CFunction preloader); - /// - /// 根据luaL_Reg建立lib table,并在_G和package.loaded建立对libname的索引,指向lib table。 - /// + // 根据luaL_Reg建立lib table,并在_G和package.loaded建立对libname的索引,指向lib table。 void RegisterLib(cc8* libname, const luaL_Reg* l); #if LUA_BIND_ENABLE_PLAIN_CLASS - /// - /// 注册纯lua类的注册函数,用来创建纯lua类。 - /// + // 注册纯lua类的注册函数,用来创建纯lua类。 void RegisterPlainClassRegistry(cc8* name); #endif #if LUA_BIND_ENABLE_PLAIN_ENUM - /// - /// 注册纯lua的枚举,以防止修改枚举值。 - /// + // 注册纯lua的枚举,以防止修改枚举值。 void RegisterPlainEnumRegistry(cc8* name); #endif @@ -205,9 +179,7 @@ namespace LuaBind friend class VM; - /// - /// 屏蔽对State的地址相关操作 - /// + // 屏蔽对State的地址相关操作 void* operator &(); void* operator new(size_t size); @@ -250,9 +222,7 @@ namespace LuaBind template <> std::string State::CheckValue < std::string >(int idx); template <> const void* State::CheckValue < const void* >(int idx); - /// - /// 在成员方法里创建State并对参数进行检查。 - /// + // 在成员方法里创建State并对参数进行检查。 #define LUA_BIND_SETUP(L, params) \ LuaBind::State state(L); \ if(!state.CheckParams(1, params)) return 0 @@ -262,9 +232,7 @@ namespace LuaBind //--------------------------------------------------------------------------------// - /// - /// 确保不安全的lua调用能够在调用之后返回到最初stack状态。 - /// + // 确保不安全的lua调用能够在调用之后返回到最初stack状态。 class ScopedState : public State { diff --git a/Runtime/Scripting/LuaBindState.inc b/Runtime/LuaBind/LuaBindState.inc index 27151ff..4e7090d 100644 --- a/Runtime/Scripting/LuaBindState.inc +++ b/Runtime/LuaBind/LuaBindState.inc @@ -1,9 +1,9 @@ namespace LuaBind { - /// - /// 注册工厂,注册class table,以type name为键设置在名称空间上。在注册阶段不会设置元表,等到New方法调用的时候才会。 - /// + // + // 注册工厂,注册class table,以type name为键设置在名称空间上。在注册阶段不会设置元表,等到New方法调用的时候才会。 + // template<class TYPE> void State::RegisterFactory() { @@ -53,9 +53,9 @@ namespace LuaBind TYPE::RegisterPostprocess(state); } - /// - /// Singleton - /// + // + // Singleton + // template<typename TYPE> void State::RegisterSingleton() { diff --git a/Runtime/Scripting/LuaBindUtility.h b/Runtime/LuaBind/LuaBindUtility.h index 4d3d542..edc5b18 100644 --- a/Runtime/Scripting/LuaBindUtility.h +++ b/Runtime/LuaBind/LuaBindUtility.h @@ -3,8 +3,8 @@ // 导出native接口 -/// RegisterClass 注册类的方法和成员,比如枚举、常量等到class table GetFactoryName 获得工厂的类名, -/// 同时用来避免注册时错误注册为了singleton,通过编译时报错避免 +// RegisterClass 注册类的方法和成员,比如枚举、常量等到class table GetFactoryName 获得工厂的类名, +// 同时用来避免注册时错误注册为了singleton,通过编译时报错避免 #define LUA_BIND_DECL_FACTORY(type, ...) \ friend class ::State; \ friend class ::NativeClass<type,##__VA_ARGS__>; \ @@ -14,12 +14,12 @@ static const char* GetClassName() { return #type; };\ static bool IsClassSingleton() { return false; } -/// 作为基类的抽象工厂类可以使用此宏,注册一个入口,在派生类的注册函数中调用,注册基类的这些方法。 +// 作为基类的抽象工厂类可以使用此宏,注册一个入口,在派生类的注册函数中调用,注册基类的这些方法。 #define LUA_BIND_DECL_ABSTRACT_FACTORY() \ static void RegisterClass(::State&);\ static void RegisterPostprocess(::State&) -/// RegisterClass 注册类的方法和成员,比如枚举、常量等到class table GetSingletonName 获得单例的类名 +// RegisterClass 注册类的方法和成员,比如枚举、常量等到class table GetSingletonName 获得单例的类名 #define LUA_BIND_DECL_SINGLETON(type, ...) \ friend class ::State; \ friend class ::NativeClass<type,##__VA_ARGS__>; \ @@ -33,14 +33,14 @@ #define LUA_BIND_DECL_ENUM(e, under_line_index) -/// 标明方法实现的宏。上下文里有一个L。 +// 标明方法实现的宏。上下文里有一个L。 #define LUA_BIND_IMPL_METHOD(type, f) int type::f(lua_State* L) -/// 由应用程序实现的两个接口。上下文里有一个state。 +// 由应用程序实现的两个接口。上下文里有一个state。 #define LUA_BIND_REGISTRY(type) void type::RegisterClass(::State& state) #define LUA_BIND_POSTPROCESS(type) void type::RegisterPostprocess(::State& state) -/// 用来注册的宏。之前这里忘了用可变宏,导致没有luaclastable ref没有注册对。 +// 用来注册的宏。之前这里忘了用可变宏,导致没有luaclastable ref没有注册对。 #define LUA_BIND_REGISTER_FACTORY(state, param) state.RegisterFactory<param>() #define LUA_BIND_REGISTER_SINGLETON(state, param) state.RegisterSingleton<param>() #define LUA_BIND_REGISTER_ABSTRACT_FACTORY(state, type) type::RegisterPostprocess(state) diff --git a/Runtime/Scripting/LuaBindVM.cpp b/Runtime/LuaBind/LuaBindVM.cpp index 4677650..268a5ed 100644 --- a/Runtime/Scripting/LuaBindVM.cpp +++ b/Runtime/LuaBind/LuaBindVM.cpp @@ -42,8 +42,8 @@ namespace LuaBind { LUA_BIND_STATE(mMainThread); - mStrongRefTable.Init(state, "UNIVERSAL_STRONGREF_TABLE"); - mWeakRefTable.Init(state, "UNIVERSAL_WEAKREF_TABLE", "v"); + mStrongRefTable.Init(state, "GAMELAB_UNIVERSAL_STRONG_REFERENCE_TABLE"); + mWeakRefTable.Init(state, "GAMELAB_UNIVERSAL_WEAK_REFERENCE_TABLE", "v"); } lua_State* VM::CreateThread() @@ -73,4 +73,10 @@ namespace LuaBind return mWeakRefTable; } + void VM::OpenLibs() + { + assert(mMainThread); + luaL_openlibs(mMainThread); + } + }
\ No newline at end of file diff --git a/Runtime/Scripting/LuaBindVM.h b/Runtime/LuaBind/LuaBindVM.h index 287f906..3bfe899 100644 --- a/Runtime/Scripting/LuaBindVM.h +++ b/Runtime/LuaBind/LuaBindVM.h @@ -12,26 +12,21 @@ namespace LuaBind { - /// - /// 单个lua_state相关的context。是一系列代理的集合,拷贝也没关系,主要是为了节约内存。 - /// + // 单个lua_state相关的context。是一系列代理的集合,拷贝也没关系,主要是为了节约内存。 class VM { public: - /// - /// 根据global_State拿到虚拟机。 - /// + // 根据global_State拿到虚拟机。 static VM* TryGetVM(global_State* gState); static VM* TryGetVM(lua_State* state); VM(); ~VM(); - /// - /// 创建虚拟机后,需要手动调用Setup函数,初始化一些虚拟机状态。 - /// + // 创建虚拟机后,需要手动调用Setup函数,初始化一些虚拟机状态。 void Setup(); + void OpenLibs(); lua_State* GetMainThread(); lua_State* CreateThread(); @@ -46,8 +41,8 @@ namespace LuaBind static VMap VMs; // 通过global_State索引虚拟机,为了方便 - RefTable mStrongRefTable; // _LUA_BIND_STRONGREF_TABLE - RefTable mWeakRefTable; // _LUA_BIND_WEAKREF_TABLE + RefTable mStrongRefTable; // GAMELAB_UNIVERSAL_STRONG_REFERENCE_TABLE + RefTable mWeakRefTable; // GAMELAB_UNIVERSAL_WEAK_REFERENCE_TABLE global_State* mGlobalState; // 虚拟机的global_State,由当前虚拟机的所有线程共享 lua_State* mMainThread; // 主线程 diff --git a/Runtime/Scripting/LuaBindWatchDog.cpp b/Runtime/LuaBind/LuaBindWatchDog.cpp index e69de29..e69de29 100644 --- a/Runtime/Scripting/LuaBindWatchDog.cpp +++ b/Runtime/LuaBind/LuaBindWatchDog.cpp diff --git a/Runtime/Scripting/LuaBindWatchDog.h b/Runtime/LuaBind/LuaBindWatchDog.h index 44d1d35..794faa9 100644 --- a/Runtime/Scripting/LuaBindWatchDog.h +++ b/Runtime/LuaBind/LuaBindWatchDog.h @@ -6,9 +6,9 @@ namespace LuaBind { - /// - /// NativeClass实例的引用计数额watch dog,只有在watch dog通过时才可以delete。 - /// + // + // NativeClass实例的引用计数额watch dog,只有在watch dog通过时才可以delete。 + // class WatchDog { public: diff --git a/Runtime/Math/FloatConversion.h b/Runtime/Math/FloatConversion.h index e5c0f23..96a4d1d 100644 --- a/Runtime/Math/FloatConversion.h +++ b/Runtime/Math/FloatConversion.h @@ -189,7 +189,7 @@ inline double Roundf(double f) } -/// Fast conversion of float [0...1] to 0 ... 65535 +// Fast conversion of float [0...1] to 0 ... 65535 inline int NormalizedToWord(float f) { f = FloatMax(f, 0.0F); @@ -197,14 +197,14 @@ inline int NormalizedToWord(float f) return RoundfToIntPos(f * 65535.0f); } -/// Fast conversion of float [0...1] to 0 ... 65535 +// Fast conversion of float [0...1] to 0 ... 65535 inline float WordToNormalized(int p) { AssertIf(p < 0 || p > 65535); return (float)p / 65535.0F; } -/// Fast conversion of float [0...1] to 0 ... 255 +// Fast conversion of float [0...1] to 0 ... 255 inline int NormalizedToByte(float f) { f = FloatMax(f, 0.0F); @@ -212,7 +212,7 @@ inline int NormalizedToByte(float f) return RoundfToIntPos(f * 255.0f); } -/// Fast conversion of float [0...1] to 0 ... 255 +// Fast conversion of float [0...1] to 0 ... 255 inline float ByteToNormalized(int p) { AssertIf(p < 0 || p > 255); @@ -249,7 +249,7 @@ inline bool CompareApproximately(float f0, float f1, float epsilon = 0.000001F) return dist < epsilon; } -/// CopySignf () returns x with its sign changed to y's. +// CopySignf () returns x with its sign changed to y's. inline float CopySignf(float x, float y) { union @@ -389,17 +389,17 @@ inline bool IsFinite(const double& value) inline float InvSqrt(float p) { return 1.0F / sqrt(p); } inline float Sqrt(float p) { return sqrt(p); } -/// - Almost highest precision sqrt -/// - Returns 0 if value is 0 or -1 -/// inline float FastSqrt (float value) +// - Almost highest precision sqrt +// - Returns 0 if value is 0 or -1 +// inline float FastSqrt (float value) -/// - Almost highest precision inv sqrt -/// - if value == 0 or -0 it returns 0. -/// inline float FastInvSqrt (float value) +// - Almost highest precision inv sqrt +// - if value == 0 or -0 it returns 0. +// inline float FastInvSqrt (float value) -/// - Low precision inv sqrt approximately -/// - if value == 0 or -0 it returns nan or undefined -/// inline float FastestInvSqrt (float value) +// - Low precision inv sqrt approximately +// - if value == 0 or -0 it returns nan or undefined +// inline float FastestInvSqrt (float value) #if defined(__ppc__) || defined(SN_TARGET_PS3) @@ -426,8 +426,8 @@ inline float FastSqrt(float x) return x; } #else -/// - Accurate to 1 bit precision -/// - returns zero if x is zero +// - Accurate to 1 bit precision +// - returns zero if x is zero inline float FastSqrt(float x) { const float half = 0.5; @@ -459,8 +459,8 @@ inline float FastSqrt(float x) } #endif -/// - Accurate to 1 bit precision -/// - returns zero if f is zero +// - Accurate to 1 bit precision +// - returns zero if f is zero inline float FastInvSqrt(float f) { float result; @@ -486,7 +486,7 @@ inline float FastInvSqrt(float f) return result; } -/// Fast inverse sqrt function +// Fast inverse sqrt function inline float FastestInvSqrt(float value) { #if defined (__ppc__) && (defined (__MWERKS__) || defined(SN_TARGET_PS3)) diff --git a/Runtime/Math/Rect.h b/Runtime/Math/Rect.h index 3b4f16c..dbd147c 100644 --- a/Runtime/Math/Rect.h +++ b/Runtime/Math/Rect.h @@ -3,7 +3,7 @@ #include "Vector2.h" -/// A rectangle. +// A rectangle. template <typename T> class RectT { @@ -11,21 +11,21 @@ public: typedef RectT<T> RectType; typedef float BaseType; - T x; ///< Rectangle x coordinate. - T y; ///< Rectangle y coordinate. - T width; ///< Rectangle width. - T height; ///< Rectangle height. + T x; //< Rectangle x coordinate. + T y; //< Rectangle y coordinate. + T width; //< Rectangle width. + T height; //< Rectangle height. inline static const char* GetTypeString(); inline static bool IsAnimationChannel() { return false; } inline static bool MightContainPPtr() { return false; } - /// Create a empty rectangle. + // Create a empty rectangle. RectT() { Reset(); } - /// Create a new rectangle. + // Create a new rectangle. RectT(T inX, T inY, T iWidth, T iHeight) { x = inX; width = iWidth; @@ -43,7 +43,7 @@ public: T GetXMax() const { return x + width; } T GetYMax() const { return y + height; } - /// Return true if rectangle is empty. + // Return true if rectangle is empty. inline bool IsEmpty() const { return width <= 0 || height <= 0; } inline void SetPosition(const Vector2f& position) { x = position.x; y = position.y; } @@ -51,10 +51,10 @@ public: inline void SetSize(const Vector2f& size) { width = size.x; height = size.y; } inline Vector2f GetSize() const { return Vector2f(width, height); } - /// Resets the rectangle + // Resets the rectangle inline void Reset() { x = y = width = height = 0; } - /// Sets the rectangle + // Sets the rectangle inline void Set(T inX, T inY, T iWidth, T iHeight) { x = inX; width = iWidth; @@ -63,11 +63,11 @@ public: inline void Scale(T dx, T dy) { x *= dx; width *= dx; y *= dy; height *= dy; } - /// Set Center position of rectangle (size stays the same) + // Set Center position of rectangle (size stays the same) void SetCenterPos(T cx, T cy) { x = cx - width / 2; y = cy - height / 2; } Vector2f GetCenterPos() const { return Vector2f(x + (BaseType)width / 2, y + (BaseType)height / 2); } - /// Ensure this is inside the rect r. + // Ensure this is inside the rect r. void Clamp(const RectType &r) { T x2 = x + width; @@ -87,19 +87,19 @@ public: if (height < 0) height = 0; } - /// Move rectangle by deltaX, deltaY. + // Move rectangle by deltaX, deltaY. inline void Move(T dX, T dY) { x += dX; y += dY; } - /// Return the width of rectangle. + // Return the width of rectangle. inline T Width() const { return width; } - /// Return the height of rectangle. + // Return the height of rectangle. inline T Height() const { return height; } - /// Return true if a point lies within rectangle bounds. + // Return true if a point lies within rectangle bounds. inline bool Contains(T px, T py) const { return (px >= x) && (px < x + width) && (py >= y) && (py < y + height); } inline bool Contains(const Vector2f& p) const { return Contains(p.x, p.y); } - /// Return true if a relative point lies within rectangle bounds. + // Return true if a relative point lies within rectangle bounds. inline bool ContainsRel(T x, T y) const { return (x >= 0) && (x < Width()) && (y >= 0) && (y < Height()); @@ -115,7 +115,7 @@ public: return !disjoint; } - /// Normalize a rectangle such that xmin <= xmax and ymin <= ymax. + // Normalize a rectangle such that xmin <= xmax and ymin <= ymax. inline void Normalize() { width = std::max<T>(width, 0); @@ -138,7 +138,7 @@ inline bool CompareApproximately(const Rectf& lhs, const Rectf& rhs) CompareApproximately(lhs.width, rhs.width) && CompareApproximately(lhs.height, rhs.height); } -/// Make a rect with width & height +// Make a rect with width & height template<typename T> inline RectT<T> MinMaxRect(T minx, T miny, T maxx, T maxy) { return RectT<T>(minx, miny, maxx - minx, maxy - miny); } diff --git a/Runtime/Math/Vector2.h b/Runtime/Math/Vector2.h index 01fa015..62f4659 100644 --- a/Runtime/Math/Vector2.h +++ b/Runtime/Math/Vector2.h @@ -55,16 +55,16 @@ public: //inline Vector2f operator / (const Vector2f& inV, float s) { Vector2f temp(inV); temp /= s; return temp; } //inline Vector2f Inverse(const Vector2f& inVec) { return Vector2f(1.0F / inVec.x, 1.0F / inVec.y); } // -//// Normalizes a vector, asserts if the vector can be normalized +/// Normalizes a vector, asserts if the vector can be normalized //inline Vector2f Normalize(const Vector2f& inV) { return inV / Magnitude(inV); } -//// Normalizes a vector, returns default vector if it can't be normalized +/// Normalizes a vector, returns default vector if it can't be normalized //inline Vector2f NormalizeSafe(const Vector2f& inV, const Vector2f& defaultV = Vector2f::zero); // //inline Vector2f Lerp(const Vector2f& from, const Vector2f& to, float t) { return to * t + from * (1.0f - t); } // -//// Returns a vector with the smaller of every component from v0 and v1 +/// Returns a vector with the smaller of every component from v0 and v1 //inline Vector2f min(const Vector2f& lhs, const Vector2f& rhs) { return Vector2f(std::min(lhs.x, rhs.x), std::min(lhs.y, rhs.y)); } -//// Returns a vector with the larger of every component from v0 and v1 +/// Returns a vector with the larger of every component from v0 and v1 //inline Vector2f max(const Vector2f& lhs, const Vector2f& rhs) { return Vector2f(std::max(lhs.x, rhs.x), std::max(lhs.y, rhs.y)); } // //bool CompareApproximately(const Vector2f& inV0, const Vector2f& inV1, float inMaxDist = Vector2f::epsilon); @@ -79,7 +79,7 @@ public: // return CompareApproximately(SqrMagnitude(vec), 1.0F, epsilon); //} // -///// Returns the abs of every component of the vector +//// Returns the abs of every component of the vector //inline Vector2f Abs(const Vector2f& v) { return Vector2f(Abs(v.x), Abs(v.y)); } // //inline bool IsFinite(const Vector2f& f) diff --git a/Runtime/Runner.cpp b/Runtime/Runner.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Runtime/Runner.cpp diff --git a/Runtime/Runner.h b/Runtime/Runner.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Runtime/Runner.h diff --git a/Runtime/Scripting/GL.bind.cpp b/Runtime/Scripting/GL.bind.cpp new file mode 100644 index 0000000..57dba09 --- /dev/null +++ b/Runtime/Scripting/GL.bind.cpp @@ -0,0 +1,9 @@ +#include "Runtime/Graphics/OpenGL.h" +#include "Runtime/LuaBind/LuaBind.h" + +// GameLab.Engine.GL +void luaopen_GameLab_Engine_GL(lua_State* L) +{ + LUA_BIND_STATE(L); + +} |