Skip to content

Commit

Permalink
Render resource manager: delete redundant code.
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrocaster committed Nov 15, 2015
1 parent 7e2fb52 commit 63d9d93
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/Layers/xrRender/ResourceManager_Scripting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,15 @@ Shader* CResourceManager::_lua_Create (LPCSTR d_shader, LPCSTR s_textures)
{
// Analyze possibility to detail this shader
C.iElement = 0;
C.bDetail = RImplementation.Resources->m_textures_description.GetDetailTexture(C.L_textures[0],C.detail_texture,C.detail_scaler);
C.bDetail = m_textures_description.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 (ScriptEngine.object(s_shader,"normal",LUA_TFUNCTION))
{
C.iElement = 0;
C.bDetail = RImplementation.Resources->m_textures_description.GetDetailTexture(C.L_textures[0],C.detail_texture,C.detail_scaler);
C.bDetail = m_textures_description.GetDetailTexture(C.L_textures[0], C.detail_texture, C.detail_scaler);
S.E[0] = C._lua_Compile(s_shader,"normal");
}
}
Expand All @@ -214,7 +214,7 @@ Shader* CResourceManager::_lua_Create (LPCSTR d_shader, LPCSTR s_textures)
if (ScriptEngine.object(s_shader,"normal",LUA_TFUNCTION))
{
C.iElement = 1;
C.bDetail = RImplementation.Resources->m_textures_description.GetDetailTexture(C.L_textures[0],C.detail_texture,C.detail_scaler);
C.bDetail = m_textures_description.GetDetailTexture(C.L_textures[0], C.detail_texture, C.detail_scaler);
S.E[1] = C._lua_Compile(s_shader,"normal");
}

Expand Down
13 changes: 3 additions & 10 deletions src/Layers/xrRenderDX10/dx10ResourceManager_Scripting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,20 +282,15 @@ Shader* CResourceManager::_lua_Create (LPCSTR d_shader, LPCSTR s_textures)
{
// Analyze possibility to detail this shader
C.iElement = 0;
//. C.bDetail = RImplementation.Resources->_GetDetailTexture(*C.L_textures[0],C.detail_texture,C.detail_scaler);
//C.bDetail = RImplementation.Resources->m_textures_description.GetDetailTexture(C.L_textures[0],C.detail_texture,C.detail_scaler);
// XXX: (RImplementation.Resources->) part is redundant here
C.bDetail = RImplementation.Resources->m_textures_description.GetDetailTexture(C.L_textures[0],C.detail_texture,C.detail_scaler);
C.bDetail = m_textures_description.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 (ScriptEngine.object(s_shader,"normal",LUA_TFUNCTION))
{
C.iElement = 0;
//. C.bDetail = RImplementation.Resources->_GetDetailTexture(*C.L_textures[0],C.detail_texture,C.detail_scaler);
//C.bDetail = RImplementation.Resources->m_textures_description.GetDetailTexture(C.L_textures[0],C.detail_texture,C.detail_scaler);
C.bDetail = RImplementation.Resources->m_textures_description.GetDetailTexture(C.L_textures[0],C.detail_texture,C.detail_scaler);
C.bDetail = m_textures_description.GetDetailTexture(C.L_textures[0], C.detail_texture, C.detail_scaler);
S.E[0] = C._lua_Compile(s_shader,"normal");
}
}
Expand All @@ -304,9 +299,7 @@ Shader* CResourceManager::_lua_Create (LPCSTR d_shader, LPCSTR s_textures)
if (ScriptEngine.object(s_shader,"normal",LUA_TFUNCTION))
{
C.iElement = 1;
//. C.bDetail = RImplementation.Resources->_GetDetailTexture(*C.L_textures[0],C.detail_texture,C.detail_scaler);
//C.bDetail = RImplementation.Resources->m_textures_description.GetDetailTexture(C.L_textures[0],C.detail_texture,C.detail_scaler);
C.bDetail = RImplementation.Resources->m_textures_description.GetDetailTexture(C.L_textures[0],C.detail_texture,C.detail_scaler);
C.bDetail = m_textures_description.GetDetailTexture(C.L_textures[0], C.detail_texture, C.detail_scaler);
S.E[1] = C._lua_Compile(s_shader,"normal");
}

Expand Down

0 comments on commit 63d9d93

Please sign in to comment.