MATERIAL *Copy_Material(MATERIAL *Old)
{
  MATERIAL *New;

  if (Old != NULL)
  {
    New = Create_Material();

    *New = *Old;

    New->Texture  = Copy_Textures(Old->Texture);
    New->Interior_Texture  = Copy_Textures(Old->Interior_Texture);
    New->Interior = Copy_Interior(Old->Interior);

    return(New);
  }
  else
  {
    return(NULL);
  }
}
示例#2
0
文件: interior.cpp 项目: Degot/povray
MATERIAL *Copy_Material(const MATERIAL *Old)
{
	MATERIAL *New;

	if (Old != NULL)
	{
		New = Create_Material();

		*New = *Old;

		New->Texture  = Copy_Textures(Old->Texture);
		New->Interior_Texture  = Copy_Textures(Old->Interior_Texture);
		if (Old->interior != NULL)
			New->interior = new Interior(*(Old->interior));

		return(New);
	}
	else
	{
		return(NULL);
	}
}