Ticket #143: receiveshadows.diff
File receiveshadows.diff, 5.9 KB (added by , 14 years ago) |
---|
-
tools/atlas/AtlasUI/ActorEditor/ActorEditor.cpp
73 73 m_CastShadows = new wxCheckBox(propertiesPanel, wxID_ANY, _("Cast shadow")); 74 74 propertiesSizer->Add(m_CastShadows, wxSizerFlags().Border(wxALL, 5)); 75 75 76 m_ReceiveShadows = new wxCheckBox(propertiesPanel, wxID_ANY, _("Receive shadow")); 77 propertiesSizer->Add(m_ReceiveShadows, wxSizerFlags().Border(wxALL, 5)); 78 76 79 m_Float = new wxCheckBox(propertiesPanel, wxID_ANY, _("Float on water")); 77 80 propertiesSizer->Add(m_Float, wxSizerFlags().Border(wxALL, 5)); 78 81 … … 107 110 m_ActorEditorListCtrl->ThawData(actor); 108 111 109 112 m_CastShadows->SetValue(actor["castshadow"].defined()); 113 m_ReceiveShadows->SetValue(actor["receiveshadow"].defined()); 110 114 m_Float->SetValue(actor["float"].defined()); 111 115 m_Material->SetValue((wxString)actor["material"]); 112 116 } … … 118 122 if (m_CastShadows->IsChecked()) 119 123 actor.set("castshadow", L""); 120 124 125 if (m_ReceiveShadows->IsChecked()) 126 actor.set("receiveshadow", L""); 127 121 128 if (m_Float->IsChecked()) 122 129 actor.set("float", L""); 123 130 … … 173 180 174 181 if (wxString(in["Object"]["Properties"]["@castshadows"]) == _T("1")) 175 182 actor.add("castshadow", L""); 183 184 if (wxString(in["Object"]["Properties"]["@receiveshadows"]) == _T("1")) 185 actor.add("receiveshadow", L""); 176 186 177 187 // Things to strip leading strings (for converting filenames, since the 178 188 // new format doesn't store the entire path) … … 247 257 AtObj actor; 248 258 249 259 if (in["actor"]["castshadow"].defined()) actor.add("castshadow", in["actor"]["castshadow"]); 260 if (in["actor"]["receiveshadow"].defined()) actor.add("receiveshadow", in["actor"]["receiveshadow"]); 250 261 if (in["actor"]["material"].defined()) actor.add("material", in["actor"]["material"]); 251 262 252 263 for (AtIter grpit = in["actor"]["group"]; grpit.defined(); ++grpit) … … 317 328 m_ActorEditorListCtrl->ImportData(actor); 318 329 319 330 m_CastShadows->SetValue(actor["castshadow"].defined()); 331 m_ReceiveShadows->SetValue(actor["receiveshadow"].defined()); 320 332 m_Float->SetValue(actor["float"].defined()); 321 333 m_Material->SetValue((wxString)actor["material"]); 322 334 } … … 330 342 331 343 if (m_CastShadows->IsChecked()) 332 344 actor.set("castshadow", L""); 345 346 if (m_ReceiveShadows->IsChecked()) 347 actor.set("receiveshadow", L""); 333 348 334 349 if (m_Float->IsChecked()) 335 350 actor.set("float", L""); -
tools/atlas/AtlasUI/ActorEditor/ActorEditor.h
48 48 ActorEditorListCtrl* m_ActorEditorListCtrl; 49 49 50 50 wxCheckBox* m_CastShadows; 51 wxCheckBox* m_ReceiveShadows; 51 52 wxCheckBox* m_Float; 52 53 wxComboBox* m_Material; 53 54 -
graphics/Model.cpp
379 379 m_Flags &= ~MODELFLAG_CASTSHADOWS; 380 380 if (source->m_Flags & MODELFLAG_CASTSHADOWS) 381 381 m_Flags |= MODELFLAG_CASTSHADOWS; 382 383 m_Flags &= ~MODELFLAG_RECEIVESHADOWS; 384 if (source->m_Flags & MODELFLAG_RECEIVESHADOWS) 385 m_Flags |= MODELFLAG_RECEIVESHADOWS; 382 386 383 387 m_ObjectBounds.SetEmpty(); 384 388 InvalidateBounds(); -
graphics/Model.h
37 37 class CSkeletonAnimManager; 38 38 39 39 #define MODELFLAG_CASTSHADOWS (1<<0) 40 #define MODELFLAG_NOLOOPANIMATION (1<<1) 40 #define MODELFLAG_RECEIVESHADOWS (1<<1) 41 #define MODELFLAG_NOLOOPANIMATION (1<<2) 41 42 42 43 /////////////////////////////////////////////////////////////////////////////// 43 44 // CModel: basically, a mesh object - holds the texturing and skinning -
graphics/ObjectBase.h
120 120 bool m_AutoFlatten; 121 121 // cast shadows from this object 122 122 bool m_CastShadows; 123 // this object receives shadows 124 bool m_ReceiveShadows; 123 125 // float on top of water 124 126 bool m_FloatOnWater; 125 127 } m_Properties; -
graphics/ObjectBase.cpp
35 35 CObjectBase::CObjectBase(CObjectManager& objectManager) 36 36 : m_ObjectManager(objectManager) 37 37 { 38 m_Properties.m_CastShadows = true; 38 m_Properties.m_CastShadows = false; 39 m_Properties.m_ReceiveShadows = false; 39 40 m_Properties.m_AutoFlatten = false; 40 41 m_Properties.m_FloatOnWater = false; 41 42 } … … 51 52 #define AT(x) int at_##x = XeroFile.GetAttributeID(#x) 52 53 EL(actor); 53 54 EL(castshadow); 55 EL(receiveshadow); 54 56 EL(float); 55 57 EL(material); 56 58 EL(group); … … 213 215 } 214 216 else if (child_name == el_castshadow) 215 217 { 216 m_Properties.m_CastShadows = true; // TODO: this is the default, so it's a bit useless218 m_Properties.m_CastShadows = true; 217 219 } 220 else if (child_name == el_receiveshadow) 221 { 222 m_Properties.m_ReceiveShadows = true; 223 } 218 224 else if (child_name == el_float) 219 225 { 220 226 m_Properties.m_FloatOnWater = true; -
graphics/ObjectEntry.cpp
199 199 { 200 200 m_Model->SetFlags(m_Model->GetFlags()|MODELFLAG_CASTSHADOWS); 201 201 } 202 if (m_Base->m_Properties.m_ReceiveShadows) 203 { 204 m_Model->SetFlags(m_Model->GetFlags()|MODELFLAG_RECEIVESHADOWS); 205 } 202 206 203 207 // replace any units using old model to now use new model; also reprop models, if necessary 204 208 // FIXME, RC - ugh, doesn't recurse correctly through props