From 9421ca53788e51a92b28056e06af3d9dd6b4d92c Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 17 Nov 2021 00:46:58 +0800 Subject: *rename --- Runtime/Graphics/ShaderCompiler.cpp | 10 +++++----- Runtime/Lua/LuaBind/LuaBindClass.hpp | 4 ++-- Runtime/Lua/LuaHelper.h | 1 + Runtime/Lua/LuaObjectProxy.h | 6 ++++++ 4 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 Runtime/Lua/LuaObjectProxy.h (limited to 'Runtime') diff --git a/Runtime/Graphics/ShaderCompiler.cpp b/Runtime/Graphics/ShaderCompiler.cpp index 20b19f5..bc601a8 100644 --- a/Runtime/Graphics/ShaderCompiler.cpp +++ b/Runtime/Graphics/ShaderCompiler.cpp @@ -21,11 +21,11 @@ std::string s_CompileError = ""; void GLSLCompiler::Compile(std::string& src, std::string& vsh, std::string& fsh, RenderCommandGroup& group)/*throw GLSLCompileException*/ { #define CheckLabel(label) {\ -int pos = src.find(label);\ -if(pos == string::npos || !IsLabelActive(src, label)) {\ - s_CompileError = std::string("Compile Shader Error: No ") + #label + " label";\ - throw GLSLCompileException(s_CompileError.c_str());\ -}} + int pos = src.find(label);\ + if(pos == string::npos || !IsLabelActive(src, label)) {\ + s_CompileError = std::string("Compile Shader Error: No ") + #label + " label";\ + throw GLSLCompileException(s_CompileError.c_str());\ + }} CheckLabel(VSH_BEGIN); CheckLabel(VSH_END); diff --git a/Runtime/Lua/LuaBind/LuaBindClass.hpp b/Runtime/Lua/LuaBind/LuaBindClass.hpp index a5ac978..27b3261 100644 --- a/Runtime/Lua/LuaBind/LuaBindClass.hpp +++ b/Runtime/Lua/LuaBind/LuaBindClass.hpp @@ -60,6 +60,8 @@ namespace LuaBind // 对userdata减少一个引用在ref table里,以尝试回收userdata。 template void Release(State& state, DATATYPE* userdata); + LuaBind::VM* GetVM() { return mOwner; } + // 将userdata push到栈顶,如果没有初始化mUserdata,初始化设置好元表并把初始化好的 // userdata留在栈顶。并添加一个引用。这是一个将native对象所有权移交给lua控制的方法。 bool PushUserdata(State& state) override; @@ -87,8 +89,6 @@ namespace LuaBind NativeClass(LuaBind::VM* vm); virtual ~NativeClass(); - LuaBind::VM* GetVM() { return mOwner; } - // 成员引用管理,在实例的ref table里。设置、取、清除 void SetMemberRef(State& state, MemberRef& memRef, int idx); bool PushMemberRef(State& state, MemberRef& memRef); diff --git a/Runtime/Lua/LuaHelper.h b/Runtime/Lua/LuaHelper.h index 1c18620..04fc3ef 100644 --- a/Runtime/Lua/LuaHelper.h +++ b/Runtime/Lua/LuaHelper.h @@ -1,5 +1,6 @@ #pragma once #include "./LuaBind/LuaBind.h" +#include "LuaObjectProxy.h" // lua 5.1 doc: https://www.lua.org/manual/5.1/ diff --git a/Runtime/Lua/LuaObjectProxy.h b/Runtime/Lua/LuaObjectProxy.h new file mode 100644 index 0000000..e5d1b41 --- /dev/null +++ b/Runtime/Lua/LuaObjectProxy.h @@ -0,0 +1,6 @@ +#pragma once + +// access lua side object's field and methods +class LuaObjectProxy +{ +}; \ No newline at end of file -- cgit v1.1-26-g67d0