raze-gles/source/build/src/vfs.cpp
hendricks266 7414f29348 Add buildvfs, abstraction layer for file I/O.
Currently it passes calls through to the system libraries as before.

Also adds an incomplete implementation on PhysFS.

git-svn-id: https://svn.eduke32.com/eduke32@7359 1a8010ca-5511-0410-912e-c29ae57300e0
2019-03-01 08:51:50 +00:00

29 lines
514 B
C++

#include "vfs.h"
#include "cache1d.h"
#ifdef USE_PHYSFS
int32_t numgroupfiles;
void uninitgroupfile(void)
{
PHYSFS_deinit();
}
#include <sys/stat.h>
int32_t klseek(buildvfs_kfd handle, int32_t offset, int32_t whence)
{
// TODO: replace klseek calls with _{abs,cur,end} versions
if (whence == SEEK_CUR)
offset += PHYSFS_tell(handle);
else if (whence == SEEK_END)
offset += PHYSFS_fileLength(handle);
PHYSFS_seek(handle, offset);
return PHYSFS_tell(handle);
}
#endif