void CEmiterInstance::Release() { m_pObjectReference = 0; vector<CEmiterInstance*>::iterator l_it = m_ChildEmiters.begin(); vector<CEmiterInstance*>::iterator l_end = m_ChildEmiters.end(); for(; l_it != l_end; ++l_it) { delete *l_it; } m_ChildEmiters.clear(); m_RecyclingParticles.DeleteAllElements(); CORE->GetPortalManager()->RemoveEmiter(this); CHECKED_DELETE_ARRAY(m_iaParticles); }
void CEffectShader::CreateShaderMacro() { m_PreprocessorMacros.clear(); if (m_Preprocessor.empty()) { m_ShaderMacros = NULL; return; } std::vector<std::string> l_PreprocessorItems; SplitString(m_Preprocessor, ';', l_PreprocessorItems); m_ShaderMacros = new D3D10_SHADER_MACRO[l_PreprocessorItems.size() + 1]; for (size_t i = 0; i<l_PreprocessorItems.size(); ++i) { std::vector<std::string> l_PreprocessorItem; SplitString(l_PreprocessorItems[i], '=', l_PreprocessorItem); if (l_PreprocessorItem.size() == 1) { m_PreprocessorMacros.push_back(l_PreprocessorItems[i]); m_PreprocessorMacros.push_back("1"); } else if (l_PreprocessorItem.size() == 2) { m_PreprocessorMacros.push_back(l_PreprocessorItem[0]); m_PreprocessorMacros.push_back(l_PreprocessorItem[1]); } else { //Info("Error creating shader macro '%s', with wrong size on parameters", l_PreprocessorItems[i]); printf("Error creating shader macro '%s', with wrong size on parameters", l_PreprocessorItems[i]); CHECKED_DELETE_ARRAY(m_ShaderMacros); return; } } for (size_t i = 0; i<l_PreprocessorItems.size(); ++i) { m_ShaderMacros[i].Name = m_PreprocessorMacros[i * 2].c_str(); m_ShaderMacros[i].Definition = m_PreprocessorMacros[(i * 2) + 1].c_str(); } m_ShaderMacros[l_PreprocessorItems.size()].Name = NULL; m_ShaderMacros[l_PreprocessorItems.size()].Definition = NULL; }