本文整理汇总了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);
}
示例2: init
void init(const char* argv0, bool symLinks)
{
if (!PHYSFS_init(argv0))
throw Exception(PHYSFS_getLastError());
PHYSFS_permitSymbolicLinks(symLinks);
}
示例3: initPhysFS
void initPhysFS(const char* argv0)
{
static const char* mainArgv0 = argv0;
deinitPhysFS();
PHYSFS_init(mainArgv0);
PHYSFS_permitSymbolicLinks(1);
}
示例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;
}
示例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 );
}
示例6: LOG
bool j1FileSystem::Awake()
{
bool ret = true;
LOG("Init File System event system");
PHYSFS_init(NULL);
return ret;
}
示例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);
}
示例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;
}
示例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);
}
示例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();
}
示例11: LOG
// Called before quitting
bool j1Physfs::CleanUp()
{
LOG("Destroying Physfs lib");
PHYSFS_init(0);
return true;
}
示例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);
}
示例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);
}
示例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;
}
示例15: InitDLL
DLL_API void InitDLL()
{
IToolBox *toolBox;
toolBox = EngineGetToolBox();
static CHashString ZLSFName(_T("CZLibStreamFactory"));
toolBox->CreateComponent( &ZLSFName, 0 );
PHYSFS_init( NULL );
}