本文整理汇总了C++中CBlender_Compile::_lua_Compile方法的典型用法代码示例。如果您正苦于以下问题:C++ CBlender_Compile::_lua_Compile方法的具体用法?C++ CBlender_Compile::_lua_Compile怎么用?C++ CBlender_Compile::_lua_Compile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBlender_Compile
的用法示例。
在下文中一共展示了CBlender_Compile::_lua_Compile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
Shader* CResourceManager::_lua_Create (LPCSTR d_shader, LPCSTR s_textures)
{
CBlender_Compile C;
Shader S;
// undecorate
string256 undercorated;
for (int i=0, l=xr_strlen(d_shader)+1; i<l; i++)
undercorated[i]=('\\'==d_shader[i])?'_':d_shader[i];
LPCSTR s_shader = undercorated;
// Access to template
C.BT = NULL;
C.bEditor = FALSE;
C.bDetail = FALSE;
// Prepare
_ParseList (C.L_textures, s_textures );
C.detail_texture = NULL;
C.detail_scaler = NULL;
// Compile element (LOD0 - HQ)
if (Script::bfIsObjectPresent(LSVM,s_shader,"normal_hq",LUA_TFUNCTION))
{
// Analyze possibility to detail this shader
C.iElement = 0;
C.bDetail = Device.Resources->_GetDetailTexture(*C.L_textures[0],C.detail_texture,C.detail_scaler);
if (C.bDetail) S.E[0] = C._lua_Compile(s_shader,"normal_hq");
else S.E[0] = C._lua_Compile(s_shader,"normal");
} else {
if (Script::bfIsObjectPresent(LSVM,s_shader,"normal",LUA_TFUNCTION))
{
C.iElement = 0;
C.bDetail = Device.Resources->_GetDetailTexture(*C.L_textures[0],C.detail_texture,C.detail_scaler);
S.E[0] = C._lua_Compile(s_shader,"normal");
}
}
// Compile element (LOD1)
if (Script::bfIsObjectPresent(LSVM,s_shader,"normal",LUA_TFUNCTION))
{
C.iElement = 1;
C.bDetail = Device.Resources->_GetDetailTexture(*C.L_textures[0],C.detail_texture,C.detail_scaler);
S.E[1] = C._lua_Compile(s_shader,"normal");
}
// Compile element
if (Script::bfIsObjectPresent(LSVM,s_shader,"l_point",LUA_TFUNCTION))
{
C.iElement = 2;
C.bDetail = FALSE;
S.E[2] = C._lua_Compile(s_shader,"l_point");;
}
// Compile element
if (Script::bfIsObjectPresent(LSVM,s_shader,"l_spot",LUA_TFUNCTION))
{
C.iElement = 3;
C.bDetail = FALSE;
S.E[3] = C._lua_Compile(s_shader,"l_spot");;
}
// Compile element
if (Script::bfIsObjectPresent(LSVM,s_shader,"l_special",LUA_TFUNCTION))
{
C.iElement = 4;
C.bDetail = FALSE;
S.E[4] = C._lua_Compile(s_shader,"l_special");
}
// Search equal in shaders array
for (u32 it=0; it<v_shaders.size(); it++)
if (S.equal(v_shaders[it])) return v_shaders[it];
// Create _new_ entry
Shader* N = xr_new<Shader>(S);
N->dwFlags |= xr_resource_flagged::RF_REGISTERED;
v_shaders.push_back (N);
return N;
}