/*---------------------------------------------------------------------------*/ BSLightingShaderPropertyRef NifConvertUtility::cloneBSLightingShaderProperty(BSLightingShaderPropertyRef pSource) { BSLightingShaderPropertyRef pDest(new BSLightingShaderProperty); BSShaderTextureSetRef pTSet(pSource->GetTextureSet()); // force empty texture set to source (HACK) pSource->SetTextureSet(NULL); // copy all members, even inaccessable ones (HACK) memcpy(pDest, pSource, sizeof(BSLightingShaderProperty)); // reset source texture set pSource->SetTextureSet(pTSet); return pDest; }
/*---------------------------------------------------------------------------*/ BSLightingShaderPropertyRef NifConvertUtility::cloneBSLightingShaderProperty(BSLightingShaderPropertyRef pSource) { //BSLightingShaderPropertyRef clone = DynamicCast<BSLightingShaderProperty>(pSource->Clone()); //return clone; //NiExtraDataRef ext_dat = DynamicCast<NiExtraData>(tx_clone); BSLightingShaderPropertyRef pDest(new BSLightingShaderProperty); BSShaderTextureSetRef pTSet(pSource->GetTextureSet()); // force empty texture set to source (HACK) pSource->SetTextureSet(NULL); //pTSet->Clone(); // copy all members, even inaccessable ones (HACK) memcpy(pDest, pSource, sizeof(BSLightingShaderProperty)); // reset source texture set pSource->SetTextureSet(pTSet); return pDest; }