コード例 #1
0
int rendererInitializePlatform(AAssetManager *aAssetManager,
		const char * activityExternalFilesDir)
{
	LOGI(">rendererInitializePlatform (%lx, %lx)", (long )aAssetManager,
			(long )activityExternalFilesDir);

	if (myGame == NULL)
	{
		myGame = Game::getInstance();
		LOGI(">rendererInitializePlatform myGame=%lx", (long )myGame);

		Platform* platform = Platform::create(myGame);
		LOGI(">rendererInitializePlatform platform=%lx", (long )platform);GP_ASSERT(platform);
	}

	// Set the default path to store the resources.
	std::string assetsPath(activityExternalFilesDir);
	if (activityExternalFilesDir[strlen(activityExternalFilesDir) - 1] != '/')
		assetsPath += "/";

	LOGI(">rendererInitializePlatform FileSystem::setResourcePath=%s",
			assetsPath.c_str());
	FileSystem::setResourcePath(assetsPath.c_str());

	// Get the asset manager to get the resources from the .apk file.
	__assetManager = aAssetManager;
	LOGI(">rendererInitializePlatform __assetManager=%lx", (long )__assetManager);

	LOGI("<rendererInitializePlatform 0");
	return 0;
}
コード例 #2
0
ファイル: kfiletools.cpp プロジェクト: zkelong/QQuickProject
QUrl KFileTools::assetsUrl(QString srcPath)
{
    return QUrl::fromLocalFile(assetsPath(srcPath));
}