From 6ac7c1cbd2c9cfa9eaa3bc036eaff1e87541a399 Mon Sep 17 00:00:00 2001 From: parax0 Date: Sat, 27 Feb 2016 02:51:11 -0700 Subject: [PATCH] Fixed undo/redo when selecting objects from the instance view, set DKCR to render basic lighting for objects with no ingame model --- src/Core/Scene/CScriptNode.cpp | 10 +++++++++- src/Editor/WorldEditor/WInstancesTab.cpp | 8 ++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Core/Scene/CScriptNode.cpp b/src/Core/Scene/CScriptNode.cpp index ddcb35a9..c08d10cd 100644 --- a/src/Core/Scene/CScriptNode.cpp +++ b/src/Core/Scene/CScriptNode.cpp @@ -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(); diff --git a/src/Editor/WorldEditor/WInstancesTab.cpp b/src/Editor/WorldEditor/WInstancesTab.cpp index 3ae7c929..200975f0 100644 --- a/src/Editor/WorldEditor/WInstancesTab.cpp +++ b/src/Editor/WorldEditor/WInstancesTab.cpp @@ -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(SourceIndex.internalPointer()) ); - - if (pSelectedNode) { - mpEditor->ClearSelection(); - mpEditor->SelectNode(pSelectedNode); + CSceneNode *pSelectedNode = mpScene->NodeForObject( static_cast(SourceIndex.internalPointer()) ); + mpEditor->ClearAndSelectNode(pSelectedNode); } } }