1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-01-24 17:26:41 +00:00

Update Aquaria/BBGE/External sources to comply with the new ttvfs API

This commit is contained in:
fgenesis 2014-04-07 02:10:05 +02:00
parent 8026cdd905
commit 6203bc7ce4
17 changed files with 172 additions and 383 deletions

View file

@ -2142,7 +2142,7 @@ void DSQ::applyPatches()
// This is to allow files in patches to override files in mods on non-win32 systems (theoretically) // This is to allow files in patches to override files in mods on non-win32 systems (theoretically)
if(!vfs.GetDir("_mods")) if(!vfs.GetDir("_mods"))
{ {
vfs.MountExternalPath(mod.getBaseModPath().c_str(), "_mods"); vfs.Mount(mod.getBaseModPath().c_str(), "_mods");
} }
loadMods(); loadMods();
@ -2159,23 +2159,23 @@ void DSQ::applyPatches()
#ifdef BBGE_BUILD_VFS #ifdef BBGE_BUILD_VFS
static void refr_pushback(ttvfs::VFSDir *vd, void *user) static void refr_pushback(ttvfs::DirBase *vd, void *user)
{ {
std::list<ttvfs::VFSDir*> *li = (std::list<ttvfs::VFSDir*>*)user; std::list<std::string> *li = (std::list<std::string>*)user;
li->push_back(vd); li->push_back(vd->fullname());
} }
static void refr_insert(VFILE *vf, void *user) static void refr_insert(VFILE *vf, void *user)
{ {
// texture names are like: "naija/naija2-frontleg3" - no .png extension, and no gfx/ path // texture names are like: "naija/naija2-frontleg3" - no .png extension, and no gfx/ path
std::set<std::string>*files = (std::set<std::string>*)user; std::set<std::string>*files = (std::set<std::string>*)user;
std::string t = vf->fullname(); std::string t = vf->fullname();
size_t dotpos = t.rfind('.'); size_t dotpos = t.rfind('.');
size_t pathstart = t.find("gfx/"); size_t pathstart = t.find("gfx/");
if(dotpos == std::string::npos || pathstart == std::string::npos || dotpos < pathstart) if(dotpos == std::string::npos || pathstart == std::string::npos || dotpos < pathstart)
return; // whoops return; // whoops
files->insert(t.substr(pathstart + 4, dotpos - (pathstart + 4))); files->insert(t.substr(pathstart + 4, dotpos - (pathstart + 4)));
} }
@ -2184,20 +2184,19 @@ static void refr_insert(VFILE *vf, void *user)
// thus directly using "gfx" subdir should be fine... // thus directly using "gfx" subdir should be fine...
void DSQ::refreshResourcesForPatch(const std::string& name) void DSQ::refreshResourcesForPatch(const std::string& name)
{ {
ttvfs::VFSDir *vd = vfs.GetDir((mod.getBaseModPath() + name + "/gfx").c_str()); // only textures are resources, anyways std::list<std::string> left;
if(!vd)
return;
std::list<ttvfs::VFSDir*> left;
std::set<std::string> files; std::set<std::string> files;
left.push_back(vd); left.push_back(mod.getBaseModPath() + name + "/gfx");
ttvfs::DirView view;
do do
{ {
vd = left.front(); std::string dirname = left.front();
left.pop_front(); left.pop_front();
vd->forEachDir(refr_pushback, &left); if(vfs.FillDirView(dirname.c_str(), view))
vd->forEachFile(refr_insert, &files); {
view.forEachDir(refr_pushback, &left);
view.forEachFile(refr_insert, &files);
}
} }
while(left.size()); while(left.size());
@ -2205,11 +2204,14 @@ void DSQ::refreshResourcesForPatch(const std::string& name)
os << "refreshResourcesForPatch - " << files.size() << " to refresh"; os << "refreshResourcesForPatch - " << files.size() << " to refresh";
debugLog(os.str()); debugLog(os.str());
for(int i = 0; i < dsq->resources.size(); ++i) if(files.size())
{ {
Resource *r = dsq->resources[i]; for(int i = 0; i < dsq->resources.size(); ++i)
if(files.find(r->name) != files.end()) {
r->reload(); Resource *r = dsq->resources[i];
if(files.find(r->name) != files.end())
r->reload();
}
} }
} }
#else #else
@ -2226,7 +2228,7 @@ void DSQ::applyPatch(const std::string& name)
std::string src = mod.getBaseModPath(); std::string src = mod.getBaseModPath();
src += name; src += name;
debugLog("Apply patch: " + src); debugLog("Apply patch: " + src);
vfs.Mount(src.c_str(), "", true); vfs.Mount(src.c_str(), "");
activePatches.insert(name); activePatches.insert(name);
refreshResourcesForPatch(name); refreshResourcesForPatch(name);
@ -2797,10 +2799,22 @@ bool DSQ::modIsKnown(const std::string& name)
bool DSQ::mountModPackage(const std::string& pkg) bool DSQ::mountModPackage(const std::string& pkg)
{ {
#ifdef BBGE_BUILD_VFS #ifdef BBGE_BUILD_VFS
ttvfs::VFSDir *vd = vfs.AddArchive(pkg.c_str(), false, mod.getBaseModPath().c_str()); ttvfs::DirBase *vd = vfs.GetDir(pkg.c_str());
if (!vd) if (!vd)
{ {
debugLog("Package: Unable to load " + pkg); // Load archive only if no such directory exists already (prevent loading multiple times)
vd = vfs.AddArchive(pkg.c_str());
if(vd)
debugLog("Package: Loaded file " + pkg);
else
{
debugLog("Package: Unable to load " + pkg);
return false;
}
}
if(!vfs.Mount(pkg.c_str(), mod.getBaseModPath().c_str()))
{
debugLog("Package: Failed to mount: " + pkg);
return false; return false;
} }
debugLog("Package: Mounted " + pkg + " as archive in _mods"); debugLog("Package: Mounted " + pkg + " as archive in _mods");
@ -2812,12 +2826,9 @@ bool DSQ::mountModPackage(const std::string& pkg)
} }
#ifdef BBGE_BUILD_VFS #ifdef BBGE_BUILD_VFS
static void _CloseSubdirCallback(ttvfs::VFSDir *vd, void*) static void _CloseSubdirCallback(ttvfs::DirBase *vd, void*)
{ {
vd->close(); vd->close();
ttvfs::VFSBase *origin = vd->getOrigin();
if(origin)
origin->close();
} }
#endif #endif
@ -2825,9 +2836,9 @@ static void _CloseSubdirCallback(ttvfs::VFSDir *vd, void*)
void DSQ::unloadMods() void DSQ::unloadMods()
{ {
#ifdef BBGE_BUILD_VFS #ifdef BBGE_BUILD_VFS
ttvfs::VFSDir *mods = vfs.GetDir(mod.getBaseModPath().c_str()); ttvfs::DirView view;
if(mods) if(vfs.FillDirView(mod.getBaseModPath().c_str(), view))
mods->forEachDir(_CloseSubdirCallback); view.forEachDir(_CloseSubdirCallback);
#endif #endif
} }

View file

@ -108,10 +108,6 @@ void ModDL::init()
{ {
tempDir = dsq->getUserDataFolder() + "/webcache"; tempDir = dsq->getUserDataFolder() + "/webcache";
createDir(tempDir.c_str()); createDir(tempDir.c_str());
ttvfs::VFSDir *vd = vfs.GetDir(tempDir.c_str());
if(vd)
vd->load(false);
} }
bool ModDL::hasUrlFileCached(const std::string& url) bool ModDL::hasUrlFileCached(const std::string& url)
@ -372,7 +368,7 @@ bool ModDL::ParseModXML(const std::string& fn, bool allowChaining)
std::string localIcon = remoteToLocalName(iconurl); std::string localIcon = remoteToLocalName(iconurl);
size_t localIconSize = 0; size_t localIconSize = 0;
if(ttvfs::VFSFile *vf = vfs.GetFile(localIcon.c_str())) if(ttvfs::File *vf = vfs.GetFile(localIcon.c_str()))
{ {
localIconSize = vf->size(); localIconSize = vf->size();
} }
@ -396,7 +392,7 @@ bool ModDL::ParseModXML(const std::string& fn, bool allowChaining)
{ {
std::string modpkg = dsq->mod.getBaseModPath() + localname; std::string modpkg = dsq->mod.getBaseModPath() + localname;
modpkg += ".aqmod"; modpkg += ".aqmod";
ttvfs::VFSFile *vf = vfs.GetFile(modpkg.c_str()); ttvfs::File *vf = vfs.GetFile(modpkg.c_str());
if(vf) if(vf)
{ {
size_t sz = vf->size(); size_t sz = vf->size();
@ -498,13 +494,9 @@ void ModDL::NotifyMod(ModRequest *rq, NetEvent ev, size_t recvd, size_t total)
// the mod file can already exist, and if it does, it will most likely be mounted. // the mod file can already exist, and if it does, it will most likely be mounted.
// zip archives are locked and cannot be deleted/replaced, so we need to unload it first. // zip archives are locked and cannot be deleted/replaced, so we need to unload it first.
// this effectively closes the file handle only, nothing else. // this effectively closes the file handle only, nothing else.
ttvfs::VFSDir *vd = vfs.GetDir(moddir.c_str()); ttvfs::DirBase *vd = vfs.GetDir(moddir.c_str());
if(vd) if(vd)
{ vd->close();
ttvfs::VFSBase *origin = vd->getOrigin();
if(origin)
origin->close();
}
std::string archiveFile = moddir + ".aqmod"; std::string archiveFile = moddir + ".aqmod";
@ -520,8 +512,7 @@ void ModDL::NotifyMod(ModRequest *rq, NetEvent ev, size_t recvd, size_t total)
if(vd) if(vd)
{ {
// Dir already exists, just remount everything // Nothing to do
vfs.Reload();
} }
else if(!dsq->mountModPackage(archiveFile)) else if(!dsq->mountModPackage(archiveFile))
{ {

View file

@ -815,16 +815,17 @@ static bool findFile_helper(const char *rawname, std::string &fname)
static int loadFile_helper(lua_State *L, const char *fn) static int loadFile_helper(lua_State *L, const char *fn)
{ {
#ifdef BBGE_BUILD_VFS #ifdef BBGE_BUILD_VFS
VFILE *vf = vfs.GetFile(fn); unsigned long size = 0;
if (!vf) const char *data = readFile(fn, &size);
if (!data)
{ {
lua_pushfstring(L, "cannot open %s", fn); lua_pushfstring(L, "cannot open %s", fn);
return LUA_ERRFILE; return LUA_ERRFILE;
} }
else else
{ {
int result = luaL_loadbuffer(L, (const char*)vf->getBuf(), vf->size(), fn); int result = luaL_loadbuffer(L, data, size, fn);
vf->dropBuf(true); delete [] data;
return result; return result;
} }
#else #else

View file

@ -43,6 +43,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <assert.h> #include <assert.h>
#ifdef BBGE_BUILD_VFS
ttvfs::Root vfs; // extern
#endif
Vector getDirVector(Direction dir) Vector getDirVector(Direction dir)
{ {
switch(dir) switch(dir)
@ -489,26 +493,15 @@ void debugLog(const std::string &s)
// delete[] when no longer needed. // delete[] when no longer needed.
char *readFile(const std::string& path, unsigned long *size_ret) char *readFile(const std::string& path, unsigned long *size_ret)
{ {
long fileSize; VFILE *f = vfopen(path.c_str(), "rb");
#ifdef BBGE_BUILD_VFS
VFILE *vf = vfs.GetFile(path.c_str());
if (!vf)
return NULL;
char *buffer = (char*)vf->getBuf(NULL, NULL);
fileSize = vf->size();
vf->dropBuf(false); // unlink buffer from file
#else
FILE *f = fopen(path.c_str(), "rb");
if (!f) if (!f)
return NULL; return NULL;
size_t fileSize = 0;
if (fseek(f, 0, SEEK_END) != 0 if(vfsize(f, &fileSize) < 0)
|| (fileSize = ftell(f)) < 0
|| fseek(f, 0, SEEK_SET) != 0)
{ {
debugLog(path + ": Failed to get file size"); debugLog(path + ": Failed to get file size");
fclose(f); vfclose(f);
return NULL; return NULL;
} }
@ -519,23 +512,22 @@ char *readFile(const std::string& path, unsigned long *size_ret)
os << path << ": Not enough memory for file (" os << path << ": Not enough memory for file ("
<< (fileSize+1) << " bytes)"; << (fileSize+1) << " bytes)";
debugLog(os.str()); debugLog(os.str());
fclose(f); vfclose(f);
return NULL; return NULL;
} }
long bytesRead = fread(buffer, 1, fileSize, f); long bytesRead = vfread(buffer, 1, fileSize, f);
if (bytesRead != fileSize) if (bytesRead != fileSize)
{ {
std::ostringstream os; std::ostringstream os;
os << path << ": Failed to read file (only got " os << path << ": Failed to read file (only got "
<< bytesRead << " of " << fileSize << " bytes)"; << bytesRead << " of " << fileSize << " bytes)";
debugLog(os.str()); debugLog(os.str());
fclose(f); vfclose(f);
return NULL; return NULL;
} }
fclose(f); vfclose(f);
buffer[fileSize] = 0; buffer[fileSize] = 0;
#endif
if (size_ret) if (size_ret)
*size_ret = fileSize; *size_ret = fileSize;
@ -630,21 +622,19 @@ void forEachFile(std::string path, std::string type, void callback(const std::st
{ {
if (path.empty()) return; if (path.empty()) return;
#ifdef BBGE_BUILD_VFS #ifdef BBGE_BUILD_VFS
ttvfs::VFSDir *vd = vfs.GetDir(path.c_str(), true); // add to tree if it wasn't loaded before ttvfs::DirView view;
if(!vd) if(!vfs.FillDirView(path.c_str(), view))
{ {
debugLog("Path '" + path + "' does not exist"); debugLog("Path '" + path + "' does not exist");
return; return;
} }
vd->load(false);
vfscallback_s dat; vfscallback_s dat;
dat.path = &path; dat.path = &path;
dat.ext = type.length() ? type.c_str() : NULL; dat.ext = type.length() ? type.c_str() : NULL;
dat.param = param; dat.param = param;
dat.callback = callback; dat.callback = callback;
vd->forEachFile(forEachFile_vfscallback, &dat, true); view.forEachFile(forEachFile_vfscallback, &dat, true);
return; return;
// ------------------------------------- // -------------------------------------

View file

@ -141,7 +141,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "Rect.h" #include "Rect.h"
#include "math.h" #include "math.h"
#include "FileAPI.h" #include "ttvfs_stdio.h"
#ifdef BBGE_BUILD_LINUX #ifdef BBGE_BUILD_LINUX
# include <sys/types.h> # include <sys/types.h>
@ -173,16 +173,6 @@ enum Direction
#include "Vector.h" #include "Vector.h"
#define FOR_ALL(object, type, object_iterator)\
{\
for (type::iterator object_iterator = object.begin(); object_iterator != object.end(); ++object_iterator)\
{\
#define END_FOR_ALL\
}\
}\
const float SQRT2 = 1.41421356; const float SQRT2 = 1.41421356;
const float PI = 3.14159265; const float PI = 3.14159265;
@ -304,5 +294,8 @@ void triggerBreakpoint();
bool createDir(const std::string& d); bool createDir(const std::string& d);
#ifdef BBGE_BUILD_VFS
extern ttvfs::Root vfs; // in Base.cpp
#endif
#endif #endif

View file

@ -5136,34 +5136,22 @@ void Core::setupFileAccess()
if(!ttvfs::checkCompat()) if(!ttvfs::checkCompat())
exit_error("ttvfs not compatible"); exit_error("ttvfs not compatible");
vfs.AddArchiveLoader(new ttvfs::VFSZipArchiveLoader); ttvfs_setroot(&vfs);
if(!vfs.LoadFileSysRoot(false))
{
exit_error("Failed to setup file access");
}
vfs.Prepare();
vfs.AddLoader(new ttvfs::DiskLoader);
vfs.AddArchiveLoader(new ttvfs::VFSZipArchiveLoader);
ttvfs::VFSDir *override = vfs.GetDir("override"); vfs.Mount("override", "");
if(override)
{
debugLog("Mounting override dir...");
override->load(true);
vfs.Mount("override", "", true);
}
// If we ever want to read from a container... // If we ever want to read from a container...
//vfs.AddArchive("aqfiles.zip", false, ""); //vfs.AddArchive("aqfiles.zip");
if(_extraDataDir.length()) if(_extraDataDir.length())
{ {
debugLog("Mounting extra data dir: " + _extraDataDir); debugLog("Mounting extra data dir: " + _extraDataDir);
vfs.MountExternalPath(_extraDataDir.c_str(), "", true, true); vfs.Mount(_extraDataDir.c_str(), "");
} }
debugLog("Done"); debugLog("Done");
#endif #endif
} }

View file

@ -42,7 +42,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "ogg/ogg.h" #include "ogg/ogg.h"
#include "vorbis/vorbisfile.h" #include "vorbis/vorbisfile.h"
#include "FileAPI.h"
#include "MT.h" #include "MT.h"
#ifndef _DEBUG #ifndef _DEBUG
@ -1488,7 +1487,6 @@ FMOD_RESULT OpenALSystem::createSound(const char *name_or_data, const FMOD_MODE
long nread = vfread(data, 1, size, io); long nread = vfread(data, 1, size, io);
vfclose(io); vfclose(io);
vfclear(io);
if (nread != size) if (nread != size)
{ {
debugLog("Failed to read data from " + std::string(fname)); debugLog("Failed to read data from " + std::string(fname));

View file

@ -437,19 +437,11 @@ void Texture::loadPNG(const std::string &file)
pngType = PNG_LUMINANCEALPHA; pngType = PNG_LUMINANCEALPHA;
} }
#ifdef BBGE_BUILD_VFS unsigned long memsize = 0;
ttvfs::VFSFile *vf = vfs.GetFile(file.c_str()); const char *memptr = readFile(file, &memsize);
const char *memptr = vf ? (const char*)vf->getBuf() : NULL; if(!memptr || !memsize)
if(!memptr) goto fail;
{
debugLog("Can't load PNG file: " + file);
width = 64;
height = 64;
Texture::textureError = TEXERR_FILENOTFOUND;
return;
}
int memsize = vf->size();
if (filter == GL_NEAREST) if (filter == GL_NEAREST)
{ {
textures[0] = pngBindMem(memptr, memsize, PNG_NOMIPMAPS, pngType, &info, GL_CLAMP_TO_EDGE, filter, filter); textures[0] = pngBindMem(memptr, memsize, PNG_NOMIPMAPS, pngType, &info, GL_CLAMP_TO_EDGE, filter, filter);
@ -458,18 +450,6 @@ void Texture::loadPNG(const std::string &file)
{ {
textures[0] = pngBindMem(memptr, memsize, PNG_BUILDMIPMAPS, pngType, &info, GL_CLAMP_TO_EDGE, GL_LINEAR_MIPMAP_LINEAR, filter); textures[0] = pngBindMem(memptr, memsize, PNG_BUILDMIPMAPS, pngType, &info, GL_CLAMP_TO_EDGE, GL_LINEAR_MIPMAP_LINEAR, filter);
} }
vf->dropBuf(true);
#else
if (filter == GL_NEAREST)
{
textures[0] = pngBind(file.c_str(), PNG_NOMIPMAPS, pngType, &info, GL_CLAMP_TO_EDGE, filter, filter);
}
else
{
textures[0] = pngBind(file.c_str(), PNG_BUILDMIPMAPS, pngType, &info, GL_CLAMP_TO_EDGE, GL_LINEAR_MIPMAP_LINEAR, filter);
}
#endif
if (textures[0] != 0) if (textures[0] != 0)
{ {
@ -478,12 +458,16 @@ void Texture::loadPNG(const std::string &file)
} }
else else
{ {
fail:
debugLog("Can't load PNG file: " + file); debugLog("Can't load PNG file: " + file);
width = 64; width = 64;
height = 64; height = 64;
Texture::textureError = TEXERR_FILENOTFOUND; Texture::textureError = TEXERR_FILENOTFOUND;
} }
if(memptr)
delete [] memptr;
#endif #endif
} }

View file

@ -236,7 +236,7 @@ INCLUDE_DIRECTORIES(${OGGVORBIS_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${EXTLIBDIR}) INCLUDE_DIRECTORIES(${EXTLIBDIR})
INCLUDE_DIRECTORIES(${EXTLIBDIR}/ttvfs)
# Custom build ID: e.g. "-custom", " (my very own build)" # Custom build ID: e.g. "-custom", " (my very own build)"
@ -280,6 +280,10 @@ ADD_DEFINITIONS(-DBBGE_BUILD_OPENGL_DYNAMIC=1)
ADD_DEFINITIONS(-DBBGE_BUILD_FMOD_OPENAL_BRIDGE=1) ADD_DEFINITIONS(-DBBGE_BUILD_FMOD_OPENAL_BRIDGE=1)
IF(AQUARIA_USE_VFS) IF(AQUARIA_USE_VFS)
ADD_DEFINITIONS(-DBBGE_BUILD_VFS=1) ADD_DEFINITIONS(-DBBGE_BUILD_VFS=1)
ADD_DEFINITIONS(-VFS_ENABLE_C_API=1)
INCLUDE_DIRECTORIES(${EXTLIBDIR}/ttvfs)
INCLUDE_DIRECTORIES(${EXTLIBDIR}/ttvfs_zip)
INCLUDE_DIRECTORIES(${EXTLIBDIR}/ttvfs_cfileapi)
ENDIF(AQUARIA_USE_VFS) ENDIF(AQUARIA_USE_VFS)
IF(AQUARIA_USE_SDL2) IF(AQUARIA_USE_SDL2)
@ -680,8 +684,10 @@ SET(LUA_SRCS
IF(AQUARIA_USE_VFS) IF(AQUARIA_USE_VFS)
ADD_SUBDIRECTORY("${EXTLIBDIR}/ttvfs") ADD_SUBDIRECTORY("${EXTLIBDIR}/ttvfs")
ADD_SUBDIRECTORY("${EXTLIBDIR}/ttvfs_zip") ADD_SUBDIRECTORY("${EXTLIBDIR}/ttvfs_zip")
ADD_SUBDIRECTORY("${EXTLIBDIR}/ttvfs_cfileapi")
SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} "ttvfs") SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} "ttvfs")
SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} "ttvfs_zip") SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} "ttvfs_zip")
SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} "ttvfs_cfileapi")
ENDIF(AQUARIA_USE_VFS) ENDIF(AQUARIA_USE_VFS)
IF(WIN32) IF(WIN32)

View file

@ -1,125 +0,0 @@
#ifdef BBGE_BUILD_VFS
#include "FileAPI.h"
#include "ttvfs_zip/VFSZipArchiveLoader.h"
#include <stdio.h>
ttvfs::VFSHelper vfs;
VFILE *vfopen(const char *fn, const char *mode)
{
if (strchr(mode, 'w'))
{
fprintf(stderr, "FileAPI.h: File writing via VFS not yet supported!");
return NULL;
}
VFILE *vf = vfs.GetFile(fn);
if (!vf || !vf->open(mode))
return NULL;
++(vf->ref); // keep the file alive until closed.
return vf;
}
size_t vfread(void *ptr, size_t size, size_t count, VFILE *vf)
{
return vf->read(ptr, size * count) / size;
}
int vfclose(VFILE *vf)
{
bool closed = vf->close();
vf->ref--;
return closed ? 0 : EOF;
}
size_t vfwrite(const void *ptr, size_t size, size_t count, VFILE *vf)
{
return vf->write(ptr, size * count) / size;
}
// return 0 on success, -1 on error
int vfseek(VFILE *vf, long int offset, int origin)
{
bool ok = false;
switch(origin)
{
case SEEK_SET: ok = vf->seek(offset); break;
case SEEK_CUR: ok = vf->seekRel(offset); break;
case SEEK_END: ok = vf->seek((long int)(vf->size() - offset)); break;
}
return ok ? 0 : -1;
}
char *vfgets(char *str, int num, VFILE *vf)
{
char *s = str;
if (vf->iseof())
return NULL;
char *ptr = (char*)vf->getBuf() + vf->getpos();
unsigned int remain = int(vf->size() - vf->getpos());
if (remain < (unsigned int)num)
num = remain;
else
--num; // be sure to keep space for the final null char
int i = 0;
char c;
for( ; i < num && *ptr; ++i)
{
c = (*s++ = *ptr++);
if(c == '\n' || c == '\r')
{
++i;
c = *ptr++; // because windows linebreaks suck.
if(c == '\n' || c == '\r')
++i;
break;
}
}
vf->seekRel(i);
*s++ = 0;
return str;
}
void vfclear(VFILE *vf)
{
vf->dropBuf(true);
}
long int vftell(VFILE *vf)
{
return (long int)vf->getpos();
}
InStream::InStream(const std::string& fn)
: std::istringstream()
{
open(fn.c_str());
}
InStream::InStream(const char *fn)
: std::istringstream()
{
open(fn);
}
bool InStream::open(const char *fn)
{
ttvfs::VFSFile *vf = vfs.GetFile(fn);
if(vf)
{
vf->open("r");
str((char*)vf->getBuf()); // stringstream will always make a copy
vf->close();
vf->dropBuf(true);
return true;
}
setstate(std::ios::failbit);
return false;
}
#endif

View file

@ -1,55 +0,0 @@
#ifndef FILE_API_H
#define FILE_API_H
// TODO: need VFS output functions?
#ifdef BBGE_BUILD_VFS
#include "ttvfs/VFS.h"
#include <sstream>
extern ttvfs::VFSHelper vfs;
typedef ttvfs::VFSFile VFILE;
VFILE *vfopen(const char *fn, const char *mode);
size_t vfread(void *ptr, size_t size, size_t count, VFILE *vf);
int vfclose(VFILE *vf);
size_t vfwrite(const void *ptr, size_t size, size_t count, VFILE *vf);
int vfseek(VFILE *vf, long int offset, int origin);
char *vfgets(char *str, int num, VFILE *vf);
void vfclear(VFILE *vf);
long int vftell(VFILE *vf);
// This class is a minimal adapter to support STL-like read-only file streams for VFS files, using std::istringstream.
class InStream : public std::istringstream
{
public:
InStream(const char *fn);
InStream(const std::string& fn);
bool open(const char *fn);
inline bool is_open() { return good(); }
inline void close() {}
private:
void _init(const char *fn);
};
#else // BBGE_BUILD_VFS
#include <stdio.h>
#include <fstream>
typedef std::ifstream InStream;
typedef FILE VFILE;
#define vfopen fopen
#define vfread fread
#define vfclose fclose
#define vfwrite fwrite
#define vfseek fseek
#define vfgets fgets
#define vftell ftell
#define vfclear
#endif // BBGE_BUILD_VFS
#endif // FILE_API_H

View file

@ -7,7 +7,7 @@
//STL headers //STL headers
#include <string> #include <string>
#include "FileAPI.h" #include "ttvfs_stdio.h"
#include "ByteBuffer.h" #include "ByteBuffer.h"
using namespace std; using namespace std;
@ -53,26 +53,22 @@ bool GLFont::Create (const char *file_name, int tex, bool loadTexture)
//Destroy the old font if there was one, just to be safe //Destroy the old font if there was one, just to be safe
Destroy(); Destroy();
#ifdef BBGE_BUILD_VFS
//Open input file
ttvfs::VFSFile *vf = vfs.GetFile(file_name);
if (!vf)
return false;
ByteBuffer bb((void*)vf->getBuf(), vf->size(), ByteBuffer::TAKE_OVER);
vf->dropBuf(false);
#else
VFILE *fh = vfopen(file_name, "rb"); VFILE *fh = vfopen(file_name, "rb");
if (!fh) if (!fh)
return false; return false;
vfseek(fh, 0, SEEK_END);
long int sz = vftell(fh); size_t sz = 0;
vfseek(fh, 0, SEEK_SET); if(vfsize(fh, &sz) < 0)
{
vfclose(fh);
return false;
}
ByteBuffer bb(sz); ByteBuffer bb(sz);
bb.resize(sz); bb.resize(sz);
vfread(bb.contents(), 1, sz, fh); vfread(bb.contents(), 1, sz, fh);
vfclose(fh); vfclose(fh);
#endif
// Read the header from file // Read the header from file
header.tex = tex; header.tex = tex;

View file

@ -953,17 +953,10 @@ bool TiXmlDocument::LoadFile( VFILE* file, TiXmlEncoding encoding )
location.Clear(); location.Clear();
// Get the file size, so we can pre-allocate the string. HUGE speed impact. // Get the file size, so we can pre-allocate the string. HUGE speed impact.
long length = 0; size_t length = 0;
#ifdef BBGE_BUILD_VFS
length = file->size();
#else
fseek( file, 0, SEEK_END );
length = ftell( file );
fseek( file, 0, SEEK_SET );
#endif
// Strange case, but good to handle up front. // Strange case, but good to handle up front.
if ( length <= 0 ) if ( vfsize(file, &length) < 0 || length <= 0 )
{ {
SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN );
return false; return false;
@ -990,15 +983,6 @@ bool TiXmlDocument::LoadFile( VFILE* file, TiXmlEncoding encoding )
} }
*/ */
#ifdef BBGE_BUILD_VFS
char *buf = (char*)file->getBuf();
file->dropBuf(false);
if (!buf)
{
SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN );
return false;
}
#else
char* buf = new char[ length+1 ]; char* buf = new char[ length+1 ];
buf[0] = 0; buf[0] = 0;
@ -1007,7 +991,6 @@ bool TiXmlDocument::LoadFile( VFILE* file, TiXmlEncoding encoding )
SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN );
return false; return false;
} }
#endif
return LoadMem(buf, length, encoding); return LoadMem(buf, length, encoding);
} }

View file

@ -36,7 +36,7 @@ distribution.
#pragma warning( disable : 4786 ) #pragma warning( disable : 4786 )
#endif #endif
#include "FileAPI.h" #include "ttvfs_stdio.h"
#include <ctype.h> #include <ctype.h>
#include <stdlib.h> #include <stdlib.h>

View file

@ -41,8 +41,8 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config&quot;;&quot;$(SolutionDir)\..\ExternalLibs\gl&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\zlib&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\png&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\FTGL\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\SDL2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\AL\include&quot;;&quot;$(SolutionDir)\..\BBGE&quot;;&quot;$(SolutionDir)\..\ExternalLibs\lua-5.1.4\src&quot;;&quot;$(SolutionDir)\..\ExternalLibs\lvpa\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\lvpa&quot;;&quot;$(SolutionDir)\..\ExternalLibs\ttvfs&quot;;&quot;$(SolutionDir)\..\ExternalLibs&quot;" AdditionalIncludeDirectories="&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config&quot;;&quot;$(SolutionDir)\..\ExternalLibs\gl&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\zlib&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\png&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\FTGL\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\SDL2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\AL\include&quot;;&quot;$(SolutionDir)\..\BBGE&quot;;&quot;$(SolutionDir)\..\ExternalLibs\lua-5.1.4\src&quot;;&quot;$(SolutionDir)\..\ExternalLibs\lvpa\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\lvpa&quot;;&quot;$(SolutionDir)\..\ExternalLibs\ttvfs&quot;;&quot;$(SolutionDir)\..\ExternalLibs\ttvfs_cfileapi&quot;;&quot;$(SolutionDir)\..\ExternalLibs&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;GL_GLEXT_LEGACY=1;TIXML_USE_STL=1;HAVE_PUTENV=1;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;BBGE_BUILD_WINDOWS=1" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;GL_GLEXT_LEGACY=1;TIXML_USE_STL=1;HAVE_PUTENV=1;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;BBGE_BUILD_WINDOWS=1;BBGE_BUILD_VFS=1;VFS_ENABLE_C_API=1"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="0" BasicRuntimeChecks="0"
RuntimeLibrary="3" RuntimeLibrary="3"
@ -123,8 +123,8 @@
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
OmitFramePointers="true" OmitFramePointers="true"
EnableFiberSafeOptimizations="true" EnableFiberSafeOptimizations="true"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config&quot;;&quot;$(SolutionDir)\..\ExternalLibs\gl&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\zlib&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\png&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\FTGL\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\SDL2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\AL\include&quot;;&quot;$(SolutionDir)\..\BBGE&quot;;&quot;$(SolutionDir)\..\ExternalLibs\lua-5.1.4\src&quot;;&quot;$(SolutionDir)\..\ExternalLibs\lvpa\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\lvpa&quot;;&quot;$(SolutionDir)\..\ExternalLibs\ttvfs&quot;;&quot;$(SolutionDir)\..\ExternalLibs&quot;" AdditionalIncludeDirectories="&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config&quot;;&quot;$(SolutionDir)\..\ExternalLibs\gl&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\zlib&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\png&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\FTGL\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\SDL2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\AL\include&quot;;&quot;$(SolutionDir)\..\BBGE&quot;;&quot;$(SolutionDir)\..\ExternalLibs\lua-5.1.4\src&quot;;&quot;$(SolutionDir)\..\ExternalLibs\lvpa\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\lvpa&quot;;&quot;$(SolutionDir)\..\ExternalLibs\ttvfs&quot;;&quot;$(SolutionDir)\..\ExternalLibs\ttvfs_cfileapi&quot;;&quot;$(SolutionDir)\..\ExternalLibs&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;GL_GLEXT_LEGACY=1;TIXML_USE_STL=1;HAVE_PUTENV=1;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;BBGE_BUILD_WINDOWS=1;_HAS_EXCEPTIONS=0" PreprocessorDefinitions="WIN32;NDEBUG;GL_GLEXT_LEGACY=1;TIXML_USE_STL=1;HAVE_PUTENV=1;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;BBGE_BUILD_WINDOWS=1;_HAS_EXCEPTIONS=0;BBGE_BUILD_VFS=1;VFS_ENABLE_C_API=1"
StringPooling="true" StringPooling="true"
ExceptionHandling="0" ExceptionHandling="0"
RuntimeLibrary="0" RuntimeLibrary="0"

View file

@ -42,8 +42,8 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config&quot;;&quot;$(SolutionDir)\..\ExternalLibs\gl&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\zlib&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\png&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\FTGL\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\SDL2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\AL\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\ttvfs&quot;;&quot;$(SolutionDir)\..\ExternalLibs\lvpa&quot;;&quot;$(SolutionDir)\..\ExternalLibs\lvpa\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs&quot;" AdditionalIncludeDirectories="&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config&quot;;&quot;$(SolutionDir)\..\ExternalLibs\gl&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\zlib&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\png&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\FTGL\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\SDL2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\AL\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\ttvfs&quot;;&quot;$(SolutionDir)\..\ExternalLibs\ttvfs_cfileapi&quot;;&quot;$(SolutionDir)\..\ExternalLibs\lvpa&quot;;&quot;$(SolutionDir)\..\ExternalLibs\lvpa\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;GL_GLEXT_LEGACY=1;TIXML_USE_STL=1;HAVE_PUTENV=1;FTGL_LIBRARY_STATIC;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;BBGE_BUILD_WINDOWS=1" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;GL_GLEXT_LEGACY=1;TIXML_USE_STL=1;HAVE_PUTENV=1;FTGL_LIBRARY_STATIC;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;BBGE_BUILD_WINDOWS=1;VFS_ENABLE_C_API=1"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="0" BasicRuntimeChecks="0"
RuntimeLibrary="3" RuntimeLibrary="3"
@ -115,8 +115,8 @@
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
OmitFramePointers="true" OmitFramePointers="true"
EnableFiberSafeOptimizations="true" EnableFiberSafeOptimizations="true"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config&quot;;&quot;$(SolutionDir)\..\ExternalLibs\gl&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\zlib&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\png&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\FTGL\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\SDL2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\AL\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\ttvfs&quot;;&quot;$(SolutionDir)\..\ExternalLibs\lvpa&quot;;&quot;$(SolutionDir)\..\ExternalLibs\lvpa\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs&quot;" AdditionalIncludeDirectories="&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config&quot;;&quot;$(SolutionDir)\..\ExternalLibs\gl&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\zlib&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\png&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\FTGL\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\SDL2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\AL\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\ttvfs&quot;;&quot;$(SolutionDir)\..\ExternalLibs\ttvfs_cfileapi&quot;;&quot;$(SolutionDir)\..\ExternalLibs\lvpa&quot;;&quot;$(SolutionDir)\..\ExternalLibs\lvpa\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GL_GLEXT_LEGACY=1;TIXML_USE_STL=1;HAVE_PUTENV=1;FTGL_LIBRARY_STATIC;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;BBGE_BUILD_WINDOWS=1;_HAS_EXCEPTIONS=0" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GL_GLEXT_LEGACY=1;TIXML_USE_STL=1;HAVE_PUTENV=1;FTGL_LIBRARY_STATIC;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;BBGE_BUILD_WINDOWS=1;_HAS_EXCEPTIONS=0;VFS_ENABLE_C_API=1"
StringPooling="true" StringPooling="true"
ExceptionHandling="0" ExceptionHandling="0"
RuntimeLibrary="0" RuntimeLibrary="0"

View file

@ -41,8 +41,8 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config&quot;;&quot;$(SolutionDir)\..\ExternalLibs\gl&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\zlib&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\png&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\FTGL\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\SDL2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\ttvfs&quot;;&quot;$(SolutionDir)\..\ExternalLibs\&quot;" AdditionalIncludeDirectories="&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config&quot;;&quot;$(SolutionDir)\..\ExternalLibs\gl&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\zlib&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\png&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\FTGL\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\SDL2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\ttvfs&quot;;&quot;$(SolutionDir)\..\ExternalLibs\ttvfs_cfileapi&quot;;&quot;$(SolutionDir)\..\ExternalLibs\&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;HAVE_FCNTL_H;FT_CONFIG_OPTION_SYSTEM_ZLIB;FTGL_LIBRARY_STATIC;FT2_BUILD_LIBRARY;GL_GLEXT_LEGACY=1;TIXML_USE_STL=1;HAVE_PUTENV=1;BBGE_BUILD_VFS=1" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;HAVE_FCNTL_H;FT_CONFIG_OPTION_SYSTEM_ZLIB;FTGL_LIBRARY_STATIC;FT2_BUILD_LIBRARY;GL_GLEXT_LEGACY=1;TIXML_USE_STL=1;HAVE_PUTENV=1;VFS_ENABLE_C_API=1"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="0" BasicRuntimeChecks="0"
RuntimeLibrary="3" RuntimeLibrary="3"
@ -115,8 +115,8 @@
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
OmitFramePointers="true" OmitFramePointers="true"
EnableFiberSafeOptimizations="true" EnableFiberSafeOptimizations="true"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config&quot;;&quot;$(SolutionDir)\..\ExternalLibs\gl&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\zlib&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\png&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\FTGL\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\SDL12\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\ttvfs&quot;;&quot;$(SolutionDir)\..\ExternalLibs&quot;" AdditionalIncludeDirectories="&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config&quot;;&quot;$(SolutionDir)\..\ExternalLibs\gl&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\zlib&quot;;&quot;$(SolutionDir)\..\ExternalLibs\glpng\png&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\freetype2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\FTGL\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\SDL2\include&quot;;&quot;$(SolutionDir)\..\ExternalLibs\ttvfs&quot;;&quot;$(SolutionDir)\..\ExternalLibs\ttvfs_cfileapi&quot;;&quot;$(SolutionDir)\..\ExternalLibs\&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;HAVE_FCNTL_H;FT_CONFIG_OPTION_SYSTEM_ZLIB;FTGL_LIBRARY_STATIC;FT2_BUILD_LIBRARY;GL_GLEXT_LEGACY=1;TIXML_USE_STL=1;HAVE_PUTENV=1;_HAS_EXCEPTIONS=0;BBGE_BUILD_VFS=1" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;HAVE_FCNTL_H;FT_CONFIG_OPTION_SYSTEM_ZLIB;FTGL_LIBRARY_STATIC;FT2_BUILD_LIBRARY;GL_GLEXT_LEGACY=1;TIXML_USE_STL=1;HAVE_PUTENV=1;_HAS_EXCEPTIONS=0;VFS_ENABLE_C_API=1"
StringPooling="true" StringPooling="true"
ExceptionHandling="0" ExceptionHandling="0"
RuntimeLibrary="0" RuntimeLibrary="0"
@ -181,14 +181,6 @@
RelativePath="..\..\ExternalLibs\DeflateCompressor.h" RelativePath="..\..\ExternalLibs\DeflateCompressor.h"
> >
</File> </File>
<File
RelativePath="..\..\ExternalLibs\FileAPI.cpp"
>
</File>
<File
RelativePath="..\..\ExternalLibs\FileAPI.h"
>
</File>
<File <File
RelativePath="..\..\ExternalLibs\minihttp.cpp" RelativePath="..\..\ExternalLibs\minihttp.cpp"
> >
@ -1065,7 +1057,7 @@
Name="ttvfs" Name="ttvfs"
> >
<File <File
RelativePath="..\..\ExternalLibs\ttvfs\VFS.h" RelativePath="..\..\ExternalLibs\ttvfs\ttvfs.h"
> >
</File> </File>
<File <File
@ -1073,31 +1065,39 @@
> >
</File> </File>
<File <File
RelativePath="..\..\ExternalLibs\ttvfs\VFSAtomic.cpp" RelativePath="..\..\ExternalLibs\ttvfs\VFSBase.cpp"
> >
</File> </File>
<File <File
RelativePath="..\..\ExternalLibs\ttvfs\VFSAtomic.h" RelativePath="..\..\ExternalLibs\ttvfs\VFSBase.h"
> >
</File> </File>
<File <File
RelativePath="..\..\ExternalLibs\ttvfs\VFSBase.cpp" RelativePath="..\..\ExternalLibs\ttvfs\VFSDefines.h"
> >
</File> </File>
<File <File
RelativePath="..\..\ExternalLibs\ttvfs\VFSBase.h" RelativePath="..\..\ExternalLibs\ttvfs\VFSDir.cpp"
> >
</File> </File>
<File <File
RelativePath="..\..\ExternalLibs\ttvfs\VFSDefines.h" RelativePath="..\..\ExternalLibs\ttvfs\VFSDir.h"
> >
</File> </File>
<File <File
RelativePath="..\..\ExternalLibs\ttvfs\VFSDir.cpp" RelativePath="..\..\ExternalLibs\ttvfs\VFSDirInternal.cpp"
> >
</File> </File>
<File <File
RelativePath="..\..\ExternalLibs\ttvfs\VFSDir.h" RelativePath="..\..\ExternalLibs\ttvfs\VFSDirInternal.h"
>
</File>
<File
RelativePath="..\..\ExternalLibs\ttvfs\VFSDirView.cpp"
>
</File>
<File
RelativePath="..\..\ExternalLibs\ttvfs\VFSDirView.h"
> >
</File> </File>
<File <File
@ -1117,33 +1117,41 @@
> >
</File> </File>
<File <File
RelativePath="..\..\ExternalLibs\ttvfs\VFSHashmap.h" RelativePath="..\..\ExternalLibs\ttvfs\VFSInternal.h"
> >
</File> </File>
<File <File
RelativePath="..\..\ExternalLibs\ttvfs\VFSHelper.cpp" RelativePath="..\..\ExternalLibs\ttvfs\VFSLoader.cpp"
> >
</File> </File>
<File <File
RelativePath="..\..\ExternalLibs\ttvfs\VFSHelper.h" RelativePath="..\..\ExternalLibs\ttvfs\VFSLoader.h"
> >
</File> </File>
<File <File
RelativePath="..\..\ExternalLibs\ttvfs\VFSInternal.h" RelativePath="..\..\ExternalLibs\ttvfs\VFSRefcounted.h"
> >
</File> </File>
<File <File
RelativePath="..\..\ExternalLibs\ttvfs\VFSLoader.cpp" RelativePath="..\..\ExternalLibs\ttvfs\VFSRoot.cpp"
> >
</File> </File>
<File <File
RelativePath="..\..\ExternalLibs\ttvfs\VFSLoader.h" RelativePath="..\..\ExternalLibs\ttvfs\VFSRoot.h"
> >
</File> </File>
<File <File
RelativePath="..\..\ExternalLibs\ttvfs\VFSSelfRefCounter.h" RelativePath="..\..\ExternalLibs\ttvfs\VFSSelfRefCounter.h"
> >
</File> </File>
<File
RelativePath="..\..\ExternalLibs\ttvfs\VFSSystemPaths.cpp"
>
</File>
<File
RelativePath="..\..\ExternalLibs\ttvfs\VFSSystemPaths.h"
>
</File>
<File <File
RelativePath="..\..\ExternalLibs\ttvfs\VFSTools.cpp" RelativePath="..\..\ExternalLibs\ttvfs\VFSTools.cpp"
> >
@ -1188,6 +1196,14 @@
RelativePath="..\..\ExternalLibs\ttvfs_zip\VFSZipArchiveLoader.h" RelativePath="..\..\ExternalLibs\ttvfs_zip\VFSZipArchiveLoader.h"
> >
</File> </File>
<File
RelativePath="..\..\ExternalLibs\ttvfs_zip\VFSZipArchiveRef.cpp"
>
</File>
<File
RelativePath="..\..\ExternalLibs\ttvfs_zip\VFSZipArchiveRef.h"
>
</File>
</Filter> </Filter>
<Filter <Filter
Name="LVPA" Name="LVPA"
@ -1213,6 +1229,18 @@
> >
</File> </File>
</Filter> </Filter>
<Filter
Name="ttvfs_cfileapi"
>
<File
RelativePath="..\..\ExternalLibs\ttvfs_cfileapi\ttvfs_stdio.cpp"
>
</File>
<File
RelativePath="..\..\ExternalLibs\ttvfs_cfileapi\ttvfs_stdio.h"
>
</File>
</Filter>
</Filter> </Filter>
<Filter <Filter
Name="Header Files" Name="Header Files"