예제 #1
0
파일: coremodel.cpp 프로젝트: newobj/taz
int CalCoreModel::loadCoreMesh(const std::string& strFilename, const char* pbyBuffer, unsigned long nBufferSize)
{
  // the core skeleton has to be loaded already
  if(m_pCoreSkeleton == 0)
  {
    CalError::setLastError(CalError::INVALID_HANDLE, __FILE__, __LINE__);
    return -1;
  }

  // load a new core mesh
  CalLoader loader;
  CalCoreMesh *pCoreMesh;
  pCoreMesh = loader.loadCoreMesh(strFilename, pbyBuffer, nBufferSize);
  if(pCoreMesh == 0) return -1;

  // add core mesh to this core model
  int meshId;
  meshId = addCoreMesh(pCoreMesh);
  if(meshId == -1)
  {
    pCoreMesh->release();
    return -1;
  }

  return meshId;
}
예제 #2
0
파일: coremodel.cpp 프로젝트: newobj/taz
int CalCoreModel::loadCoreMaterial(const std::string& strFilename, const char* pbyBuffer, unsigned long nBufferSize)
{
  // the core skeleton has to be loaded already
  if(m_pCoreSkeleton == 0)
  {
    CalError::setLastError(CalError::INVALID_HANDLE, __FILE__, __LINE__);
    return -1;
  }

  // load a new core material
  CalLoader loader;
  CalCoreMaterial *pCoreMaterial;
  pCoreMaterial = loader.loadCoreMaterial(strFilename, pbyBuffer, nBufferSize);
  if(pCoreMaterial == 0) return -1;

  // add core material to this core model
  int materialId;
  materialId = addCoreMaterial(pCoreMaterial);
  if(materialId == -1)
  {
    delete pCoreMaterial;
    return -1;
  }

  return materialId;
}
예제 #3
0
파일: coremodel.cpp 프로젝트: newobj/taz
int CalCoreModel::loadCoreAnimation(const std::string& strFilename, const char* pbyBuffer, unsigned long nBufferSize)
{
  // the core skeleton has to be loaded already
  if(m_pCoreSkeleton == 0)
  {
    CalError::setLastError(CalError::INVALID_HANDLE, __FILE__, __LINE__);
    return -1;
  }

  // load a new core animation
  CalLoader loader;
  CalCoreAnimation *pCoreAnimation;
  pCoreAnimation = loader.loadCoreAnimation(strFilename, pbyBuffer, nBufferSize);
  if(pCoreAnimation == 0) return -1;

  // add core animation to this core model
  int animationId;
  animationId = addCoreAnimation(pCoreAnimation);
  if(animationId == -1)
  {
    pCoreAnimation->release();
    return -1;
  }

  return animationId;
}
예제 #4
0
int CalCoreModel::loadCoreMesh(const char* strFilename)
{
  // the core skeleton has to be loaded already
  if(m_pCoreSkeleton == 0)
  {
    CalError::setLastError(CalError::INVALID_HANDLE, __FILE__, __LINE__);
    return -1;
  }

  // load a new core mesh
  CalLoader loader;
  CalCoreMesh *pCoreMesh;
  pCoreMesh = loader.loadCoreMesh(strFilename);
  if(pCoreMesh == 0) return -1;

  // add core mesh to this core model
  int meshId;
  meshId = addCoreMesh(pCoreMesh);
  if(meshId == -1)
  {
    delete pCoreMesh;
    return -1;
  }

  return meshId;
}
예제 #5
0
int CalCoreModel::loadCoreAnimation(const char* strFilename)
{
  // the core skeleton has to be loaded already
  if(m_pCoreSkeleton == 0)
  {
    CalError::setLastError(CalError::INVALID_HANDLE, __FILE__, __LINE__);
    return -1;
  }

  // load a new core animation
  CalLoader loader;
  CalCoreAnimation *pCoreAnimation;
  pCoreAnimation = loader.loadCoreAnimation(strFilename);
  if(pCoreAnimation == 0) return -1;

  // add core animation to this core model
  int animationId;
  animationId = addCoreAnimation(pCoreAnimation);
  if(animationId == -1)
  {
    delete pCoreAnimation;
    return -1;
  }

  return animationId;
}
예제 #6
0
파일: coremodel.cpp 프로젝트: newobj/taz
bool CalCoreModel::loadCoreSkeleton(const std::string& strFilename, const char* pbyBuffer, unsigned long nBufferSize)
{
  // destroy the current core skeleton
  if(m_pCoreSkeleton != 0)
  {
    m_pCoreSkeleton->release();
  }

  // load a new core skeleton
  CalLoader loader;
  m_pCoreSkeleton = loader.loadCoreSkeleton(strFilename, pbyBuffer, nBufferSize);
  if(m_pCoreSkeleton == 0) return false;

  return true;
}
예제 #7
0
bool CalCoreModel::loadCoreSkeleton(const char* strFilename)
{
  // destroy the current core skeleton
  if(m_pCoreSkeleton != 0)
  {
    m_pCoreSkeleton->destroy();
    delete m_pCoreSkeleton;
  }

  // load a new core skeleton
  CalLoader loader;
  m_pCoreSkeleton = loader.loadCoreSkeleton(strFilename);
  if(m_pCoreSkeleton == 0) return false;

  return true;
}