Fixed undo/redo when selecting objects from the instance view, set DKCR to render basic lighting for objects with no ingame model

This commit is contained in:
parax0 2016-02-27 02:51:11 -07:00
parent ecab7be63f
commit 6ac7c1cbd2
2 changed files with 11 additions and 7 deletions

View File

@ -179,7 +179,15 @@ void CScriptNode::Draw(FRenderOptions Options, int ComponentIndex, const SViewIn
else
{
LoadLights(ViewInfo);
// DKCR doesn't support world lighting yet, so light nodes that don't have ingame models with default lighting
if (Template()->Game() == eReturns && !mpInstance->HasInGameModel() && CGraphics::sLightMode == CGraphics::eWorldLighting)
{
CGraphics::SetDefaultLighting();
CGraphics::sVertexBlock.COLOR0_Amb = CGraphics::skDefaultAmbientColor;
}
else
LoadLights(ViewInfo);
}
LoadModelMatrix();

View File

@ -144,15 +144,11 @@ void WInstancesTab::OnTreeDoubleClick(QModelIndex Index)
if ((mpEditor) && (IndexType == CInstancesModel::eInstanceIndex))
{
CInstancesModel::ENodeType NodeType = mpTypesModel->IndexNodeType(SourceIndex);
CSceneNode *pSelectedNode = nullptr;
if (NodeType == CInstancesModel::eScriptType)
pSelectedNode = mpScene->NodeForObject( static_cast<CScriptObject*>(SourceIndex.internalPointer()) );
if (pSelectedNode)
{
mpEditor->ClearSelection();
mpEditor->SelectNode(pSelectedNode);
CSceneNode *pSelectedNode = mpScene->NodeForObject( static_cast<CScriptObject*>(SourceIndex.internalPointer()) );
mpEditor->ClearAndSelectNode(pSelectedNode);
}
}
}