• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ PHYSFS_init函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: main

int main(int argc, char **argv)
{
	char filename[PATH_MAX];
	char path[PATH_MAX], *delim;
	GAMEMAP *map;

	if (argc != 2)
	{
		printf("Usage: %s <map>\n", argv[0]);
		return -1;
	}
	strcpy(path, argv[1]);
	delim = strrchr(path, '/');
	if (delim)
	{
		*delim = '\0';
		delim++;
		strcpy(filename, delim);
	}
	else
	{
		path[1] = '.';
		path[1] = '\0';
		strcpy(filename, argv[1]);
	}
	PHYSFS_init(argv[0]);
	PHYSFS_addToSearchPath(path, 1);

	map = mapLoad(filename);
	if (map)
	{
		char tilesetName[PATH_MAX];

		if (map->tileset == TILESET_ARIZONA) { strcpy(tilesetName, "Arizona"); }
		else if (map->tileset == TILESET_URBAN) { strcpy(tilesetName, "Urban"); }
		else if (map->tileset == TILESET_ROCKIES) { strcpy(tilesetName, "Rockies"); }
		else { strcpy(tilesetName, "(unknown)"); }

		printf("Loaded map: %s\n", filename);
		printf("\tMap version: %d\n", (int)map->mapVersion);
		printf("\tGame version: %d\n", (int)map->gameVersion);
		printf("\tWidth: %d\n", (int)map->width);
		printf("\tHeight: %d\n", (int)map->height);
		printf("\tGateways: %d\n", (int)map->numGateways);
		printf("\tPlayers: %d\n", (int)map->numPlayers);
		printf("\tFeatures: %d\n", (int)map->numFeatures);
		printf("\tDroids: %d\n", (int)map->numDroids);
		printf("\tStructures: %d\n", (int)map->numStructures);
		printf("\tScroll limits: (%d, %d, %d, %d)\n",
			   (int)map->scrollMinX, (int)map->scrollMinY, (int)map->scrollMaxX, (int)map->scrollMaxY);
		printf("\tLevel name: %s\n", map->levelName);
		printf("\tTileset: %s\n", tilesetName);
	}
	mapFree(map);

	return 0;
}
开发者ID:BG1,项目名称:warzone2100,代码行数:57,代码来源:mapinfo.cpp


示例17: fs_init

int fs_init(const char *argv0)
{
    if (PHYSFS_init(argv0))
    {
        PHYSFS_permitSymbolicLinks(1);
        return 1;
    }

    return 0;
}
开发者ID:L0rdK,项目名称:neverball-sdl2,代码行数:10,代码来源:fs_physfs.c


示例18: SetUp

 virtual void SetUp(void) {
     glfwInit();
     glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE);
     window = glfwCreateWindow(TEST_WIDTH, TEST_HEIGHT, "gtest", nullptr, nullptr);
     glfwSetWindowPos(window, 300, 300);
     glfwMakeContextCurrent(window);
     ASSERT_EQ(GLEW_OK, glewInit());
     PHYSFS_init("gtest");
     PHYSFS_addToSearchPath("data", true);
 }
开发者ID:SamNi,项目名称:citydemo,代码行数:10,代码来源:gtest_shadermanager.cpp


示例19: main

int main(int argc, char* argv[])
{
    PHYSFS_init(argv[0]);
	Editor* editor = Editor::getEditor();

    if (editor!=0)
	    editor->run();

	return 0;
}
开发者ID:pixelr0,项目名称:stk-editor,代码行数:10,代码来源:main.cpp


示例20: initialize_PhysicsFS

/*!
 * Initialize the PhysicsFS library.
 */
static void initialize_PhysicsFS(const char* argv_0)
{
	int result = PHYSFS_init(argv_0);

	if (!result)
	{
		debug(LOG_FATAL, "There was a problem trying to init Physfs.  Error was %s", PHYSFS_getLastError());
		exit(-1);
	}
}
开发者ID:GhostKing,项目名称:warzone2100,代码行数:13,代码来源:main.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PHYSFS_openRead函数代码示例发布时间:2022-05-30
下一篇:
C++ PHYSFS_getWriteDir函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap