301 lines
9.4 KiB
C#
301 lines
9.4 KiB
C#
#if USE_UNI_LUA
|
|
using LuaAPI = UniLua.Lua;
|
|
using RealStatePtr = UniLua.ILuaState;
|
|
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
|
|
#else
|
|
using LuaAPI = XLua.LuaDLL.Lua;
|
|
using RealStatePtr = System.IntPtr;
|
|
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
|
|
#endif
|
|
|
|
using XLua;
|
|
using System.Collections.Generic;
|
|
|
|
|
|
namespace XLua.CSObjectWrap
|
|
{
|
|
using Utils = XLua.Utils;
|
|
public class BFPostEffectBloomWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(BF.PostEffectBloom);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 4, 3, 0);
|
|
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetIteration", _m_SetIteration);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetDownSample", _m_SetDownSample);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetLuminance", _m_SetLuminance);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnRenderImage", _m_OnRenderImage);
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "Iterations", _g_get_Iterations);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "DownSample", _g_get_DownSample);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "LuminanceThreshold", _g_get_LuminanceThreshold);
|
|
|
|
|
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
|
null, null, null);
|
|
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 1, 2, 2);
|
|
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "BlurSizeID", _g_get_BlurSizeID);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "BloomID", _g_get_BloomID);
|
|
|
|
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "BlurSizeID", _s_set_BlurSizeID);
|
|
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "BloomID", _s_set_BloomID);
|
|
|
|
|
|
Utils.EndClassRegister(type, L, translator);
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int __CreateInstance(RealStatePtr L)
|
|
{
|
|
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
if(LuaAPI.lua_gettop(L) == 1)
|
|
{
|
|
|
|
var gen_ret = new BF.PostEffectBloom();
|
|
translator.Push(L, gen_ret);
|
|
|
|
return 1;
|
|
}
|
|
|
|
}
|
|
catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return LuaAPI.luaL_error(L, "invalid arguments to BF.PostEffectBloom constructor!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_SetIteration(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.PostEffectBloom gen_to_be_invoked = (BF.PostEffectBloom)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
int _iterations = LuaAPI.xlua_tointeger(L, 2);
|
|
|
|
gen_to_be_invoked.SetIteration( _iterations );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_SetDownSample(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.PostEffectBloom gen_to_be_invoked = (BF.PostEffectBloom)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
int _downSample = LuaAPI.xlua_tointeger(L, 2);
|
|
|
|
gen_to_be_invoked.SetDownSample( _downSample );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_SetLuminance(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.PostEffectBloom gen_to_be_invoked = (BF.PostEffectBloom)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
float _luminanceThreshold = (float)LuaAPI.lua_tonumber(L, 2);
|
|
|
|
gen_to_be_invoked.SetLuminance( _luminanceThreshold );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_OnRenderImage(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.PostEffectBloom gen_to_be_invoked = (BF.PostEffectBloom)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
BF.PostEffectContext _context = (BF.PostEffectContext)translator.GetObject(L, 2, typeof(BF.PostEffectContext));
|
|
|
|
var gen_ret = gen_to_be_invoked.OnRenderImage( _context );
|
|
translator.Push(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_Iterations(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.PostEffectBloom gen_to_be_invoked = (BF.PostEffectBloom)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.Iterations);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_DownSample(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.PostEffectBloom gen_to_be_invoked = (BF.PostEffectBloom)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.DownSample);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_LuminanceThreshold(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.PostEffectBloom gen_to_be_invoked = (BF.PostEffectBloom)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushnumber(L, gen_to_be_invoked.LuminanceThreshold);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_BlurSizeID(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
LuaAPI.xlua_pushinteger(L, BF.PostEffectBloom.BlurSizeID);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_BloomID(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
LuaAPI.xlua_pushinteger(L, BF.PostEffectBloom.BloomID);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_BlurSizeID(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
BF.PostEffectBloom.BlurSizeID = LuaAPI.xlua_tointeger(L, 1);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_BloomID(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
BF.PostEffectBloom.BloomID = LuaAPI.xlua_tointeger(L, 1);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|