Ticket #1771: no_preview_shadows_05222013.patch
File no_preview_shadows_05222013.patch, 3.0 KB (added by , 11 years ago) |
---|
-
source/graphics/Model.cpp
602 602 m_Props[i].m_Model->ToCModel()->AddFlagsRec(flags); 603 603 } 604 604 605 void CModel::RemoveShadowsRec() 606 { 607 m_Flags &= ~MODELFLAG_CASTSHADOWS; 608 609 m_Material.AddShaderDefine("DISABLE_RECEIVE_SHADOWS", "1"); 610 611 for (size_t i = 0; i < m_Props.size(); ++i) 612 if (m_Props[i].m_Model->ToCModel()) 613 m_Props[i].m_Model->ToCModel()->RemoveShadowsRec(); 614 } 615 605 616 void CModel::SetMaterial(const CMaterial &material) 606 617 { 607 618 m_Material = material; -
source/graphics/Model.h
118 118 int GetFlags() const { return m_Flags; } 119 119 // add object flags, recursively through props 120 120 void AddFlagsRec(int flags); 121 // remove shadow casting and receiving, recursively through props 122 void RemoveShadowsRec(); 121 123 122 124 // recurse down tree setting dirty bits 123 125 virtual void SetDirtyRec(int dirtyflags) { -
source/simulation2/components/CCmpTemplateManager.cpp
525 525 if (out.GetChild("Entity").GetChild("Obstruction").IsOk()) 526 526 CParamNode::LoadXMLString(out, "<Entity><Obstruction><Active>false</Active></Obstruction></Entity>"); 527 527 528 if (out.GetChild("Entity").GetChild("VisualActor").IsOk()) 529 CParamNode::LoadXMLString(out, "<Entity><VisualActor><DisableShadows/></VisualActor></Entity>"); 530 528 531 if (!corpse) 529 532 { 530 533 // Previews should always be visible in fog-of-war/etc -
source/simulation2/components/CCmpVisualActor.cpp
117 117 "<empty/>" 118 118 "</element>" 119 119 "</optional>" 120 "<optional>" 121 "<element name='DisableShadows' a:help='Used internally; if present, shadows will be disabled'>" 122 "<empty/>" 123 "</element>" 124 "</optional>" 120 125 "<element name='SilhouetteDisplay'>" 121 126 "<data type='boolean'/>" 122 127 "</element>" … … 535 540 536 541 if (paramNode.GetChild("SilhouetteDisplay").ToBool()) 537 542 modelFlags |= MODELFLAG_SILHOUETTE_DISPLAY; 538 539 543 if (paramNode.GetChild("SilhouetteOccluder").ToBool()) 540 544 modelFlags |= MODELFLAG_SILHOUETTE_OCCLUDER; 541 545 … … 544 548 modelFlags |= MODELFLAG_IGNORE_LOS; 545 549 546 550 model.ToCModel()->AddFlagsRec(modelFlags); 551 552 if (paramNode.GetChild("DisableShadows").IsOk()) 553 model.ToCModel()->RemoveShadowsRec(); 547 554 } 548 555 549 556 // Initialize the model's selection shape descriptor. This currently relies on the component initialization order; the