コード例 #1
0
void BuildMac::Initialize()
{
    ToolSystem* tsystem = GetSubsystem<ToolSystem>();
    Project* project = tsystem->GetProject();

    String dataPath = tsystem->GetDataPath();
    String projectResources = project->GetResourcePath();
    String coreDataFolder = dataPath + "CoreData/";

    AddResourceDir(coreDataFolder);
    AddResourceDir(projectResources);

    BuildResourceEntries();

}
コード例 #2
0
ファイル: Resources.cpp プロジェクト: ArchyInf/HPL1Engine
	bool cResources::LoadResourceDirsFile(const tString &asFile)
	{
		TiXmlDocument* pXmlDoc = hplNew( TiXmlDocument, (asFile.c_str()) );
		if(pXmlDoc->LoadFile()==false)
		{
			Error("Couldn't load XML file '%s'!\n",asFile.c_str());
			hplDelete( pXmlDoc);
			return false;
		}

		//Get the root.
		TiXmlElement* pRootElem = pXmlDoc->RootElement();
        
		TiXmlElement* pChildElem = pRootElem->FirstChildElement();
		for(; pChildElem != NULL; pChildElem = pChildElem->NextSiblingElement())
		{
			tString sPath = cString::ToString(pChildElem->Attribute("Path"),"");
			if(sPath==""){
				continue;
			}

			if(sPath[0]=='/' || sPath[0]=='\\') sPath = sPath.substr(1);

			AddResourceDir(sPath);
		}

		hplDelete(pXmlDoc);
		return true;
	}
コード例 #3
0
void BuildMac::Initialize()
{
    ToolSystem* tsystem = GetSubsystem<ToolSystem>();

    Project* project = tsystem->GetProject();

    Vector<String> defaultResourcePaths;
    GetDefaultResourcePaths(defaultResourcePaths);
    String projectResources = project->GetResourcePath();

    for (unsigned i = 0; i < defaultResourcePaths.Size(); i++)
    {
        AddResourceDir(defaultResourcePaths[i]);
    }

    AddResourceDir(projectResources);

    BuildResourceEntries();

}
コード例 #4
0
void BuildIOS::Initialize()
{
    Editor* editor = GetSubsystem<Editor>();
    Project* project = editor->GetProject();

    FileSystem* fileSystem = GetSubsystem<FileSystem>();

#ifdef ATOMIC_PLATFORM_WINDOWS
    String bundleResources = fileSystem->GetProgramDir();
#else
    String bundleResources = fileSystem->GetAppBundleResourceFolder();
#endif

    String projectResources = project->GetResourcePath();
    String coreDataFolder = bundleResources + "CoreData/";

    AddResourceDir(coreDataFolder);
    AddResourceDir(projectResources);

    BuildResourceEntries();

}
コード例 #5
0
void BuildWindows::Initialize()
{
    ToolSystem* tsystem = GetSubsystem<ToolSystem>();

    Project* project = tsystem->GetProject();

    Vector<String> defaultResourcePaths;
    GetDefaultResourcePaths(defaultResourcePaths);
    String projectResources = project->GetResourcePath();

    for (unsigned i = 0; i < defaultResourcePaths.Size(); i++)
    {
        AddResourceDir(defaultResourcePaths[i]);
    }

    // TODO: smart filtering of cache
    AddResourceDir(project->GetProjectPath() + "Cache/");
    AddResourceDir(projectResources);

    BuildResourceEntries();

}
コード例 #6
0
ファイル: CResourceBase.cpp プロジェクト: roberpot/Source
CResourceScript * CResourceBase::AddResourceFile( LPCTSTR pszName )
{
	ADDTOCALLSTACK("CResourceBase::AddResourceFile");
	ASSERT(pszName != NULL);
	// Is this really just a dir name ?

	TCHAR szName[_MAX_PATH];
	ASSERT(strlen(pszName) < COUNTOF(szName));
	strcpy(szName, pszName);

	TCHAR szTitle[_MAX_PATH];
	strcpy(szTitle, CScript::GetFilesTitle( szName ));

	if ( szTitle[0] == '\0' )
	{
		AddResourceDir( pszName );
		return NULL;
	}

	LPCTSTR pszExt = CScript::GetFilesExt( szTitle );
	if ( pszExt == NULL )
	{
		// No file extension provided, so append .scp to the filename
		strcat( szName, GRAY_SCRIPT );
		strcat( szTitle, GRAY_SCRIPT );
	}

	if ( ! strnicmp( szTitle, GRAY_FILE "tables", strlen(GRAY_FILE "tables")))
	{
		// Don't dupe this.
		return NULL;
	}

	// Try to prevent dupes
	CResourceScript * pNewRes = FindResourceFile(szTitle);
	if ( pNewRes )
		return( pNewRes );

	// Find correct path
	CScript s;
	if ( ! OpenResourceFind( s, szName ))
	{
		return( NULL );
	}

	pNewRes = new CResourceScript( s.GetFilePath() );
	m_ResourceFiles.Add(pNewRes);
	return( pNewRes );
}
コード例 #7
0
void BuildWindows::Initialize()
{
    ToolSystem* tsystem = GetSubsystem<ToolSystem>();
    Project* project = tsystem->GetProject();

    Vector<String> defaultResourcePaths;
    GetDefaultResourcePaths(defaultResourcePaths);

    for (unsigned i = 0; i < defaultResourcePaths.Size(); i++)
    {
        AddResourceDir(defaultResourcePaths[i]);
    }
    BuildDefaultResourceEntries();

    // Include the project resources and cache separately
    AddProjectResourceDir(project->GetResourcePath());
    AssetDatabase* db = GetSubsystem<AssetDatabase>();
    String cachePath = db->GetCachePath();
    AddProjectResourceDir(cachePath);

    BuildProjectResourceEntries();
}
コード例 #8
0
void BuildAndroid::Initialize()
{
    ToolSystem* tsystem = GetSubsystem<ToolSystem>();
    Project* project = tsystem->GetProject();

    Vector<String> defaultResourcePaths;
    GetDefaultResourcePaths(defaultResourcePaths);
    

    for (unsigned i = 0; i < defaultResourcePaths.Size(); i++)
    {
        AddResourceDir(defaultResourcePaths[i]);
    }
    BuildDefaultResourceEntries();

    // TODO: smart filtering of cache
    String projectResources = project->GetResourcePath();
    AddProjectResourceDir(projectResources);
    AssetDatabase* db = GetSubsystem<AssetDatabase>();
    String cachePath = db->GetCachePath();
    AddProjectResourceDir(cachePath);

    BuildProjectResourceEntries();
}