Ejemplo n.º 1
0
VManagedResource* VFmodSoundResourceManager::CreateResource(const char *szFilename, VResourceSnapshotEntry *pExtraInfo)
{
  int iUsageFlags = VFMOD_RESOURCEFLAG_DEFAULT;
  if (pExtraInfo)
    iUsageFlags = pExtraInfo->GetCustomIntValue(0, iUsageFlags); 
  VManagedResource *pRes = VFmodManager::GlobalManager().LoadSoundResource(szFilename, iUsageFlags);
  if (!pRes)
    return NULL;
  pRes->EnsureLoaded();
  return pRes;
}
VManagedResource* vHavokBehaviorResourceManager::CreateResource(const char *szFilename, VResourceSnapshotEntry *pExtraInfo)
{
	char szTempBuffer[FS_MAX_PATH];
	szFilename = VResourceManager::GetFilePathResolver().ResolvePath(szFilename,szTempBuffer);

	VManagedResource* pBehaviorResource = NULL;
	if (Vision::File.Exists(szFilename))
	{
		// create a new resource (unique for streaming resources)
		pBehaviorResource = new vHavokBehaviorResource(szFilename);
		pBehaviorResource->EnsureLoaded();
	}
	return pBehaviorResource;
}
Ejemplo n.º 3
0
VManagedResource* VFmodEventGroupManager::CreateResource(const char *szFilename, VResourceSnapshotEntry *pExtraInfo)
{
  // split resource name into project-path and group-name
  char szFilenameCopy[2*FS_MAX_PATH];
  strcpy(szFilenameCopy, szFilename);
  VStringTokenizerInPlace tokenizer(szFilenameCopy, '|');
  const char *szEventProjectPath = tokenizer.Next();
  const char *szEventGroupName = tokenizer.Next();
  VASSERT(szEventProjectPath!=NULL && szEventGroupName!=NULL);

  VManagedResource *pRes = VFmodManager::GlobalManager().LoadEventGroup(szEventProjectPath, szEventGroupName);
  if (!pRes)
    return NULL;

  pRes->EnsureLoaded();

  return pRes;
}