当前位置: 首页>>代码示例>>C++>>正文


C++ PHYSFS_init函数代码示例

本文整理汇总了C++中PHYSFS_init函数的典型用法代码示例。如果您正苦于以下问题:C++ PHYSFS_init函数的具体用法?C++ PHYSFS_init怎么用?C++ PHYSFS_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PHYSFS_init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: defined

void FileManager::OnInit()
{
#if defined(WINDOWS_TARGET)
	int ret = PHYSFS_init(s_exePath);
#elif defined(EMSCRIPTEN_TARGET)
	int ret = PHYSFS_init("/");
#endif

	assert(ret);

#if defined(WINDOWS_TARGET)
	if(PHYSFS_mount("\\data\\", "/data", 0) == 0)
	{
		assert(false);
	}
#elif defined(EMSCRIPTEN_TARGET)
	if(PHYSFS_mount("/data", "/data", 0) == 0)
	{
		//printf("%s\n", PHYSFS_getLastError());
		assert(false);
	}
#else

#endif

	//FILE* file = fopen("data/idle-0.png", "r");
	//assert(file);

}
开发者ID:ricklesauceur,项目名称:dukecorporation,代码行数:29,代码来源:filemanager.cpp

示例2: init

  void init(const char* argv0, bool symLinks)
  {
    if (!PHYSFS_init(argv0))
      throw Exception(PHYSFS_getLastError());

    PHYSFS_permitSymbolicLinks(symLinks);
  }
开发者ID:yildiz-online,项目名称:module-graphic-ogre,代码行数:7,代码来源:PhysFS++.cpp

示例3: initPhysFS

	void initPhysFS(const char* argv0)
	{
		static const char* mainArgv0 = argv0;
		deinitPhysFS();
		PHYSFS_init(mainArgv0);
		PHYSFS_permitSymbolicLinks(1);
	}
开发者ID:dgengin,项目名称:DGEngine,代码行数:7,代码来源:FileUtils.cpp

示例4: assert

FileSystem::FileSystem(const std::string& path)
{
	assert(mFileSystemSingleton == 0);
	PHYSFS_init(path.c_str());
	/// \todo do we need to check if this operation suceeded?
	mFileSystemSingleton = this;
}
开发者ID:EliasOenal,项目名称:blobby,代码行数:7,代码来源:FileSystem.cpp

示例5: PHYSFS_init

//==================================================
//! Constructor
//==================================================
System::VFS::VFS() {
	// Initialize PhysicsFS
	PHYSFS_init( NULL );
	
	// Hardcoded paths for now
	PHYSFS_addToSearchPath( "/Users/aaron/Documents/Phaedrus-FPS/Resources/", 1 );
}
开发者ID:schnarf,项目名称:Phaedrus-FPS,代码行数:10,代码来源:VFS.cpp

示例6: LOG

bool j1FileSystem::Awake()
{
	bool ret = true;
	LOG("Init File System event system");
	PHYSFS_init(NULL);
	return ret;
}
开发者ID:N4bi,项目名称:VGD,代码行数:7,代码来源:j1FileSystem.cpp

示例7: mRoot

ZipFileSystem::ZipFileSystem(const String& filePath, const String& root) : mRoot(root){
	PHYSFS_init(NULL);

	// TODO handle root directory

	PHYSFS_addToSearchPath(filePath.c_str(), 0);
}
开发者ID:spiricn,项目名称:Wt,代码行数:7,代码来源:ZipFileSystem.cpp

示例8: gInit

bool gInit (int sdlflags, int repeat_delay, int repeat_interval, const char *argv0)
{
   if(SDL_Init(sdlflags|SDL_INIT_VIDEO|SDL_INIT_TIMER) == -1)
   {
      gLogf("SDL_Init failed: %s\n", SDL_GetError());
      return false;
   }

   SDL_EnableUNICODE(1);
   SDL_EnableKeyRepeat(repeat_delay, repeat_interval);

   if(TTF_Init()==-1) 
   {
       gLogf("TTF_Init failed: %s\n", TTF_GetError());
       return false;
   }

   if(!PHYSFS_init(argv0))
   {
      gLogf("PHYSFS_init failed: %s\n", PHYSFS_getLastError());
      return false;
   }

   return true;
}
开发者ID:gitustc,项目名称:d2imdev,代码行数:25,代码来源:gmain.c

示例9: PHYSFS_init

util::VersionInfo Application::initPhysFS(const std::string& arg0)
{
    PHYSFS_Version ver;
    PHYSFS_init(arg0.c_str());
    PHYSFS_addToSearchPath(PHYSFS_getBaseDir(),0);
    PHYSFS_getLinkedVersion(&ver);
    return util::VersionInfo(ver.major, ver.minor, ver.patch);
}
开发者ID:jamesturk,项目名称:cpp_photon,代码行数:8,代码来源:Application.cpp

示例10: PHYSFS_init

ResourceCache::ResourceCache() {
	PHYSFS_init(NULL);
	PHYSFS_addToSearchPath("data/images.zip", 1);
	PHYSFS_addToSearchPath("data/sounds.zip", 1);
	al_init_image_addon();
	al_init_acodec_addon();
	al_set_physfs_file_interface();
}
开发者ID:chn22,项目名称:OSGCC6,代码行数:8,代码来源:ResourceCache.cpp

示例11: LOG

// Called before quitting
bool j1Physfs::CleanUp()
{
	LOG("Destroying Physfs lib");
	PHYSFS_init(0);

	return true;
	
}
开发者ID:kellazo,项目名称:GameDevelopment,代码行数:9,代码来源:j1Physfs.cpp

示例12: strcpy

physfsDrive::physfsDrive(const char * startdir,Bit16u _bytes_sector,Bit8u _sectors_cluster,Bit16u _total_clusters,Bit16u _free_clusters,Bit8u _mediaid)
		   :localDrive(startdir,_bytes_sector,_sectors_cluster,_total_clusters,_free_clusters,_mediaid) {

	char newname[CROSS_LEN+1];

	/* No writedir given, use capture directory */
	if(startdir[0] == ':') {
		strcpy(newname,capturedir.c_str());
		strcat(newname,startdir);
	} else {
		strcpy(newname,startdir);
	}

	CROSS_FILENAME(newname);	
	if (!physfs_used) {
		PHYSFS_init("");
		PHYSFS_permitSymbolicLinks(1);
	}

	physfs_used++;
	char *lastdir = newname;
	char *dir = strchr(lastdir+(((lastdir[0]|0x20) >= 'a' && (lastdir[0]|0x20) <= 'z')?2:0),':');
	while (dir) {
		*dir++ = 0;
		if((lastdir == newname) && !strchr(dir+(((dir[0]|0x20) >= 'a' && (dir[0]|0x20) <= 'z')?2:0),':')) {
			// If the first parameter is a directory, the next one has to be the archive file,
			// do not confuse it with basedir if trailing : is not there!
			int tmp = strlen(dir)-1;
			dir[tmp++] = ':';
			dir[tmp++] = CROSS_FILESPLIT;
			dir[tmp] = '\0';
		}
		if (*lastdir && PHYSFS_addToSearchPath(lastdir,true) == 0) {
			LOG_MSG("PHYSFS couldn't add '%s': %s",lastdir,PHYSFS_getLastError());
		}
		lastdir = dir;
		dir = strchr(lastdir+(((lastdir[0]|0x20) >= 'a' && (lastdir[0]|0x20) <= 'z')?2:0),':');
	}
	const char *oldwrite = PHYSFS_getWriteDir();
	if (oldwrite) oldwrite = strdup(oldwrite);
	if (!PHYSFS_setWriteDir(newname)) {
		if (!oldwrite)
			LOG_MSG("PHYSFS can't use '%s' for writing, you might encounter problems",newname);
		else
			PHYSFS_setWriteDir(oldwrite);
	}
	if (oldwrite) free((char *)oldwrite);
	
	strcpy(basedir,lastdir);

	allocation.bytes_sector=_bytes_sector;
	allocation.sectors_cluster=_sectors_cluster;
	allocation.total_clusters=_total_clusters;
	allocation.free_clusters=_free_clusters;
	allocation.mediaid=_mediaid;

	dirCache.SetBaseDir(basedir, this);
}
开发者ID:Cliff-F,项目名称:Boxer,代码行数:58,代码来源:drive_physfs.cpp

示例13: GetLogger

CResourceManager::CResourceManager(const char *argv0)
{
    if (!PHYSFS_init(argv0))
    {
        GetLogger()->Error("Error while initializing physfs: %s\n", PHYSFS_getLastError());
        assert(false);
    }
    PHYSFS_permitSymbolicLinks(1);
}
开发者ID:2asoft,项目名称:colobot,代码行数:9,代码来源:resourcemanager.cpp

示例14: Init

/**Initialize the PhysFS system with some default configuration.
 * The write directory is set to $HOME/.Games/Epiar
 * The search path is set to
 *  - The write directory
 *  - The directory of the current executeable
 *  - Any archives found in the path (must pass in the extension)
 * \return Nonzero on success. */
int Filesystem::Init( const char* argv0, const string &extension ) {
	int retval;
	if ( (retval = PHYSFS_init(argv0)) == 0 )
		LogMsg(ERR,"Error initializing PhysicsFS.\n%s",PHYSFS_getLastError());
	if ( (retval = PHYSFS_setSaneConfig("Games","Epiar",
				extension.c_str(),0,1) == 0) )
		LogMsg(ERR,"Error initializing PhysicsFS configuration.\n%s",PHYSFS_getLastError());
	return retval;
}
开发者ID:Maka7879,项目名称:Epiar,代码行数:16,代码来源:filesystem.cpp

示例15: InitDLL

DLL_API void InitDLL()
{
	IToolBox *toolBox;
	toolBox = EngineGetToolBox();
	static CHashString ZLSFName(_T("CZLibStreamFactory"));
	toolBox->CreateComponent( &ZLSFName, 0 );

	PHYSFS_init( NULL );
}
开发者ID:klhurley,项目名称:ElementalEngine2,代码行数:9,代码来源:ZLibStreamFactoryDLL.cpp


注:本文中的PHYSFS_init函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。