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,6 +179,14 @@ void CScriptNode::Draw(FRenderOptions Options, int ComponentIndex, const SViewIn
else else
{ {
// 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); LoadLights(ViewInfo);
} }

View File

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