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:
parent
8026cdd905
commit
6203bc7ce4
17 changed files with 172 additions and 383 deletions
|
@ -2142,7 +2142,7 @@ void DSQ::applyPatches()
|
|||
// This is to allow files in patches to override files in mods on non-win32 systems (theoretically)
|
||||
if(!vfs.GetDir("_mods"))
|
||||
{
|
||||
vfs.MountExternalPath(mod.getBaseModPath().c_str(), "_mods");
|
||||
vfs.Mount(mod.getBaseModPath().c_str(), "_mods");
|
||||
}
|
||||
|
||||
loadMods();
|
||||
|
@ -2159,23 +2159,23 @@ void DSQ::applyPatches()
|
|||
|
||||
#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;
|
||||
li->push_back(vd);
|
||||
std::list<std::string> *li = (std::list<std::string>*)user;
|
||||
li->push_back(vd->fullname());
|
||||
}
|
||||
|
||||
static void refr_insert(VFILE *vf, void *user)
|
||||
{
|
||||
// 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::string t = vf->fullname();
|
||||
size_t dotpos = t.rfind('.');
|
||||
size_t pathstart = t.find("gfx/");
|
||||
if(dotpos == std::string::npos || pathstart == std::string::npos || dotpos < pathstart)
|
||||
return; // whoops
|
||||
// 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::string t = vf->fullname();
|
||||
size_t dotpos = t.rfind('.');
|
||||
size_t pathstart = t.find("gfx/");
|
||||
if(dotpos == std::string::npos || pathstart == std::string::npos || dotpos < pathstart)
|
||||
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...
|
||||
void DSQ::refreshResourcesForPatch(const std::string& name)
|
||||
{
|
||||
ttvfs::VFSDir *vd = vfs.GetDir((mod.getBaseModPath() + name + "/gfx").c_str()); // only textures are resources, anyways
|
||||
if(!vd)
|
||||
return;
|
||||
|
||||
std::list<ttvfs::VFSDir*> left;
|
||||
std::list<std::string> left;
|
||||
std::set<std::string> files;
|
||||
left.push_back(vd);
|
||||
|
||||
left.push_back(mod.getBaseModPath() + name + "/gfx");
|
||||
ttvfs::DirView view;
|
||||
do
|
||||
{
|
||||
vd = left.front();
|
||||
std::string dirname = left.front();
|
||||
left.pop_front();
|
||||
vd->forEachDir(refr_pushback, &left);
|
||||
vd->forEachFile(refr_insert, &files);
|
||||
if(vfs.FillDirView(dirname.c_str(), view))
|
||||
{
|
||||
view.forEachDir(refr_pushback, &left);
|
||||
view.forEachFile(refr_insert, &files);
|
||||
}
|
||||
}
|
||||
while(left.size());
|
||||
|
||||
|
@ -2205,11 +2204,14 @@ void DSQ::refreshResourcesForPatch(const std::string& name)
|
|||
os << "refreshResourcesForPatch - " << files.size() << " to refresh";
|
||||
debugLog(os.str());
|
||||
|
||||
for(int i = 0; i < dsq->resources.size(); ++i)
|
||||
if(files.size())
|
||||
{
|
||||
Resource *r = dsq->resources[i];
|
||||
if(files.find(r->name) != files.end())
|
||||
r->reload();
|
||||
for(int i = 0; i < dsq->resources.size(); ++i)
|
||||
{
|
||||
Resource *r = dsq->resources[i];
|
||||
if(files.find(r->name) != files.end())
|
||||
r->reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
@ -2226,7 +2228,7 @@ void DSQ::applyPatch(const std::string& name)
|
|||
std::string src = mod.getBaseModPath();
|
||||
src += name;
|
||||
debugLog("Apply patch: " + src);
|
||||
vfs.Mount(src.c_str(), "", true);
|
||||
vfs.Mount(src.c_str(), "");
|
||||
|
||||
activePatches.insert(name);
|
||||
refreshResourcesForPatch(name);
|
||||
|
@ -2797,10 +2799,22 @@ bool DSQ::modIsKnown(const std::string& name)
|
|||
bool DSQ::mountModPackage(const std::string& pkg)
|
||||
{
|
||||
#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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
debugLog("Package: Mounted " + pkg + " as archive in _mods");
|
||||
|
@ -2812,12 +2826,9 @@ bool DSQ::mountModPackage(const std::string& pkg)
|
|||
}
|
||||
|
||||
#ifdef BBGE_BUILD_VFS
|
||||
static void _CloseSubdirCallback(ttvfs::VFSDir *vd, void*)
|
||||
static void _CloseSubdirCallback(ttvfs::DirBase *vd, void*)
|
||||
{
|
||||
vd->close();
|
||||
ttvfs::VFSBase *origin = vd->getOrigin();
|
||||
if(origin)
|
||||
origin->close();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -2825,9 +2836,9 @@ static void _CloseSubdirCallback(ttvfs::VFSDir *vd, void*)
|
|||
void DSQ::unloadMods()
|
||||
{
|
||||
#ifdef BBGE_BUILD_VFS
|
||||
ttvfs::VFSDir *mods = vfs.GetDir(mod.getBaseModPath().c_str());
|
||||
if(mods)
|
||||
mods->forEachDir(_CloseSubdirCallback);
|
||||
ttvfs::DirView view;
|
||||
if(vfs.FillDirView(mod.getBaseModPath().c_str(), view))
|
||||
view.forEachDir(_CloseSubdirCallback);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -108,10 +108,6 @@ void ModDL::init()
|
|||
{
|
||||
tempDir = dsq->getUserDataFolder() + "/webcache";
|
||||
createDir(tempDir.c_str());
|
||||
|
||||
ttvfs::VFSDir *vd = vfs.GetDir(tempDir.c_str());
|
||||
if(vd)
|
||||
vd->load(false);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
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();
|
||||
}
|
||||
|
@ -396,7 +392,7 @@ bool ModDL::ParseModXML(const std::string& fn, bool allowChaining)
|
|||
{
|
||||
std::string modpkg = dsq->mod.getBaseModPath() + localname;
|
||||
modpkg += ".aqmod";
|
||||
ttvfs::VFSFile *vf = vfs.GetFile(modpkg.c_str());
|
||||
ttvfs::File *vf = vfs.GetFile(modpkg.c_str());
|
||||
if(vf)
|
||||
{
|
||||
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.
|
||||
// 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.
|
||||
ttvfs::VFSDir *vd = vfs.GetDir(moddir.c_str());
|
||||
ttvfs::DirBase *vd = vfs.GetDir(moddir.c_str());
|
||||
if(vd)
|
||||
{
|
||||
ttvfs::VFSBase *origin = vd->getOrigin();
|
||||
if(origin)
|
||||
origin->close();
|
||||
}
|
||||
vd->close();
|
||||
|
||||
std::string archiveFile = moddir + ".aqmod";
|
||||
|
||||
|
@ -520,8 +512,7 @@ void ModDL::NotifyMod(ModRequest *rq, NetEvent ev, size_t recvd, size_t total)
|
|||
|
||||
if(vd)
|
||||
{
|
||||
// Dir already exists, just remount everything
|
||||
vfs.Reload();
|
||||
// Nothing to do
|
||||
}
|
||||
else if(!dsq->mountModPackage(archiveFile))
|
||||
{
|
||||
|
|
|
@ -815,16 +815,17 @@ static bool findFile_helper(const char *rawname, std::string &fname)
|
|||
static int loadFile_helper(lua_State *L, const char *fn)
|
||||
{
|
||||
#ifdef BBGE_BUILD_VFS
|
||||
VFILE *vf = vfs.GetFile(fn);
|
||||
if (!vf)
|
||||
unsigned long size = 0;
|
||||
const char *data = readFile(fn, &size);
|
||||
if (!data)
|
||||
{
|
||||
lua_pushfstring(L, "cannot open %s", fn);
|
||||
return LUA_ERRFILE;
|
||||
}
|
||||
else
|
||||
{
|
||||
int result = luaL_loadbuffer(L, (const char*)vf->getBuf(), vf->size(), fn);
|
||||
vf->dropBuf(true);
|
||||
int result = luaL_loadbuffer(L, data, size, fn);
|
||||
delete [] data;
|
||||
return result;
|
||||
}
|
||||
#else
|
||||
|
|
|
@ -43,6 +43,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef BBGE_BUILD_VFS
|
||||
ttvfs::Root vfs; // extern
|
||||
#endif
|
||||
|
||||
Vector getDirVector(Direction dir)
|
||||
{
|
||||
switch(dir)
|
||||
|
@ -489,26 +493,15 @@ void debugLog(const std::string &s)
|
|||
// delete[] when no longer needed.
|
||||
char *readFile(const std::string& path, unsigned long *size_ret)
|
||||
{
|
||||
long fileSize;
|
||||
#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");
|
||||
VFILE *f = vfopen(path.c_str(), "rb");
|
||||
if (!f)
|
||||
return NULL;
|
||||
|
||||
|
||||
if (fseek(f, 0, SEEK_END) != 0
|
||||
|| (fileSize = ftell(f)) < 0
|
||||
|| fseek(f, 0, SEEK_SET) != 0)
|
||||
size_t fileSize = 0;
|
||||
if(vfsize(f, &fileSize) < 0)
|
||||
{
|
||||
debugLog(path + ": Failed to get file size");
|
||||
fclose(f);
|
||||
vfclose(f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -519,23 +512,22 @@ char *readFile(const std::string& path, unsigned long *size_ret)
|
|||
os << path << ": Not enough memory for file ("
|
||||
<< (fileSize+1) << " bytes)";
|
||||
debugLog(os.str());
|
||||
fclose(f);
|
||||
vfclose(f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
long bytesRead = fread(buffer, 1, fileSize, f);
|
||||
long bytesRead = vfread(buffer, 1, fileSize, f);
|
||||
if (bytesRead != fileSize)
|
||||
{
|
||||
std::ostringstream os;
|
||||
os << path << ": Failed to read file (only got "
|
||||
<< bytesRead << " of " << fileSize << " bytes)";
|
||||
debugLog(os.str());
|
||||
fclose(f);
|
||||
vfclose(f);
|
||||
return NULL;
|
||||
}
|
||||
fclose(f);
|
||||
vfclose(f);
|
||||
buffer[fileSize] = 0;
|
||||
#endif
|
||||
|
||||
if (size_ret)
|
||||
*size_ret = fileSize;
|
||||
|
@ -630,21 +622,19 @@ void forEachFile(std::string path, std::string type, void callback(const std::st
|
|||
{
|
||||
if (path.empty()) return;
|
||||
|
||||
|
||||
#ifdef BBGE_BUILD_VFS
|
||||
ttvfs::VFSDir *vd = vfs.GetDir(path.c_str(), true); // add to tree if it wasn't loaded before
|
||||
if(!vd)
|
||||
ttvfs::DirView view;
|
||||
if(!vfs.FillDirView(path.c_str(), view))
|
||||
{
|
||||
debugLog("Path '" + path + "' does not exist");
|
||||
return;
|
||||
}
|
||||
vd->load(false);
|
||||
vfscallback_s dat;
|
||||
dat.path = &path;
|
||||
dat.ext = type.length() ? type.c_str() : NULL;
|
||||
dat.param = param;
|
||||
dat.callback = callback;
|
||||
vd->forEachFile(forEachFile_vfscallback, &dat, true);
|
||||
view.forEachFile(forEachFile_vfscallback, &dat, true);
|
||||
|
||||
return;
|
||||
// -------------------------------------
|
||||
|
|
15
BBGE/Base.h
15
BBGE/Base.h
|
@ -141,7 +141,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "Rect.h"
|
||||
|
||||
#include "math.h"
|
||||
#include "FileAPI.h"
|
||||
#include "ttvfs_stdio.h"
|
||||
|
||||
#ifdef BBGE_BUILD_LINUX
|
||||
# include <sys/types.h>
|
||||
|
@ -173,16 +173,6 @@ enum Direction
|
|||
#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 PI = 3.14159265;
|
||||
|
@ -304,5 +294,8 @@ void triggerBreakpoint();
|
|||
|
||||
bool createDir(const std::string& d);
|
||||
|
||||
#ifdef BBGE_BUILD_VFS
|
||||
extern ttvfs::Root vfs; // in Base.cpp
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -5136,34 +5136,22 @@ void Core::setupFileAccess()
|
|||
if(!ttvfs::checkCompat())
|
||||
exit_error("ttvfs not compatible");
|
||||
|
||||
vfs.AddArchiveLoader(new ttvfs::VFSZipArchiveLoader);
|
||||
|
||||
if(!vfs.LoadFileSysRoot(false))
|
||||
{
|
||||
exit_error("Failed to setup file access");
|
||||
}
|
||||
|
||||
vfs.Prepare();
|
||||
ttvfs_setroot(&vfs);
|
||||
|
||||
vfs.AddLoader(new ttvfs::DiskLoader);
|
||||
vfs.AddArchiveLoader(new ttvfs::VFSZipArchiveLoader);
|
||||
|
||||
ttvfs::VFSDir *override = vfs.GetDir("override");
|
||||
if(override)
|
||||
{
|
||||
debugLog("Mounting override dir...");
|
||||
override->load(true);
|
||||
vfs.Mount("override", "", true);
|
||||
}
|
||||
vfs.Mount("override", "");
|
||||
|
||||
// If we ever want to read from a container...
|
||||
//vfs.AddArchive("aqfiles.zip", false, "");
|
||||
//vfs.AddArchive("aqfiles.zip");
|
||||
|
||||
if(_extraDataDir.length())
|
||||
{
|
||||
debugLog("Mounting extra data dir: " + _extraDataDir);
|
||||
vfs.MountExternalPath(_extraDataDir.c_str(), "", true, true);
|
||||
vfs.Mount(_extraDataDir.c_str(), "");
|
||||
}
|
||||
|
||||
|
||||
debugLog("Done");
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -42,7 +42,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "ogg/ogg.h"
|
||||
#include "vorbis/vorbisfile.h"
|
||||
|
||||
#include "FileAPI.h"
|
||||
#include "MT.h"
|
||||
|
||||
#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);
|
||||
vfclose(io);
|
||||
vfclear(io);
|
||||
if (nread != size)
|
||||
{
|
||||
debugLog("Failed to read data from " + std::string(fname));
|
||||
|
|
|
@ -437,19 +437,11 @@ void Texture::loadPNG(const std::string &file)
|
|||
pngType = PNG_LUMINANCEALPHA;
|
||||
}
|
||||
|
||||
#ifdef BBGE_BUILD_VFS
|
||||
ttvfs::VFSFile *vf = vfs.GetFile(file.c_str());
|
||||
const char *memptr = vf ? (const char*)vf->getBuf() : NULL;
|
||||
if(!memptr)
|
||||
{
|
||||
debugLog("Can't load PNG file: " + file);
|
||||
width = 64;
|
||||
height = 64;
|
||||
Texture::textureError = TEXERR_FILENOTFOUND;
|
||||
return;
|
||||
}
|
||||
unsigned long memsize = 0;
|
||||
const char *memptr = readFile(file, &memsize);
|
||||
if(!memptr || !memsize)
|
||||
goto fail;
|
||||
|
||||
int memsize = vf->size();
|
||||
if (filter == GL_NEAREST)
|
||||
{
|
||||
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);
|
||||
}
|
||||
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)
|
||||
{
|
||||
|
@ -478,12 +458,16 @@ void Texture::loadPNG(const std::string &file)
|
|||
}
|
||||
else
|
||||
{
|
||||
fail:
|
||||
|
||||
debugLog("Can't load PNG file: " + file);
|
||||
width = 64;
|
||||
height = 64;
|
||||
Texture::textureError = TEXERR_FILENOTFOUND;
|
||||
}
|
||||
|
||||
if(memptr)
|
||||
delete [] memptr;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -236,7 +236,7 @@ INCLUDE_DIRECTORIES(${OGGVORBIS_INCLUDE_DIRS})
|
|||
INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
|
||||
INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIR})
|
||||
INCLUDE_DIRECTORIES(${EXTLIBDIR})
|
||||
INCLUDE_DIRECTORIES(${EXTLIBDIR}/ttvfs)
|
||||
|
||||
|
||||
|
||||
# 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)
|
||||
IF(AQUARIA_USE_VFS)
|
||||
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)
|
||||
|
||||
IF(AQUARIA_USE_SDL2)
|
||||
|
@ -680,8 +684,10 @@ SET(LUA_SRCS
|
|||
IF(AQUARIA_USE_VFS)
|
||||
ADD_SUBDIRECTORY("${EXTLIBDIR}/ttvfs")
|
||||
ADD_SUBDIRECTORY("${EXTLIBDIR}/ttvfs_zip")
|
||||
ADD_SUBDIRECTORY("${EXTLIBDIR}/ttvfs_cfileapi")
|
||||
SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} "ttvfs")
|
||||
SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} "ttvfs_zip")
|
||||
SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} "ttvfs_cfileapi")
|
||||
ENDIF(AQUARIA_USE_VFS)
|
||||
|
||||
IF(WIN32)
|
||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
//STL headers
|
||||
#include <string>
|
||||
#include "FileAPI.h"
|
||||
#include "ttvfs_stdio.h"
|
||||
#include "ByteBuffer.h"
|
||||
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();
|
||||
|
||||
|
||||
#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");
|
||||
if (!fh)
|
||||
return false;
|
||||
vfseek(fh, 0, SEEK_END);
|
||||
long int sz = vftell(fh);
|
||||
vfseek(fh, 0, SEEK_SET);
|
||||
|
||||
size_t sz = 0;
|
||||
if(vfsize(fh, &sz) < 0)
|
||||
{
|
||||
vfclose(fh);
|
||||
return false;
|
||||
}
|
||||
|
||||
ByteBuffer bb(sz);
|
||||
bb.resize(sz);
|
||||
vfread(bb.contents(), 1, sz, fh);
|
||||
vfclose(fh);
|
||||
#endif
|
||||
|
||||
// Read the header from file
|
||||
header.tex = tex;
|
||||
|
|
|
@ -953,17 +953,10 @@ bool TiXmlDocument::LoadFile( VFILE* file, TiXmlEncoding encoding )
|
|||
location.Clear();
|
||||
|
||||
// Get the file size, so we can pre-allocate the string. HUGE speed impact.
|
||||
long length = 0;
|
||||
#ifdef BBGE_BUILD_VFS
|
||||
length = file->size();
|
||||
#else
|
||||
fseek( file, 0, SEEK_END );
|
||||
length = ftell( file );
|
||||
fseek( file, 0, SEEK_SET );
|
||||
#endif
|
||||
size_t length = 0;
|
||||
|
||||
// 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 );
|
||||
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 ];
|
||||
buf[0] = 0;
|
||||
|
||||
|
@ -1007,7 +991,6 @@ bool TiXmlDocument::LoadFile( VFILE* file, TiXmlEncoding encoding )
|
|||
SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN );
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
return LoadMem(buf, length, encoding);
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ distribution.
|
|||
#pragma warning( disable : 4786 )
|
||||
#endif
|
||||
|
||||
#include "FileAPI.h"
|
||||
#include "ttvfs_stdio.h"
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -41,8 +41,8 @@
|
|||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config";"$(SolutionDir)\..\ExternalLibs\gl";"$(SolutionDir)\..\ExternalLibs\glpng\zlib";"$(SolutionDir)\..\ExternalLibs\glpng\png";"$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include";"$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include";"$(SolutionDir)\..\ExternalLibs\freetype2\include";"$(SolutionDir)\..\ExternalLibs\FTGL\include";"$(SolutionDir)\..\ExternalLibs\SDL2\include";"$(SolutionDir)\..\ExternalLibs\AL\include";"$(SolutionDir)\..\BBGE";"$(SolutionDir)\..\ExternalLibs\lua-5.1.4\src";"$(SolutionDir)\..\ExternalLibs\lvpa\include";"$(SolutionDir)\..\ExternalLibs\lvpa";"$(SolutionDir)\..\ExternalLibs\ttvfs";"$(SolutionDir)\..\ExternalLibs""
|
||||
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"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config";"$(SolutionDir)\..\ExternalLibs\gl";"$(SolutionDir)\..\ExternalLibs\glpng\zlib";"$(SolutionDir)\..\ExternalLibs\glpng\png";"$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include";"$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include";"$(SolutionDir)\..\ExternalLibs\freetype2\include";"$(SolutionDir)\..\ExternalLibs\FTGL\include";"$(SolutionDir)\..\ExternalLibs\SDL2\include";"$(SolutionDir)\..\ExternalLibs\AL\include";"$(SolutionDir)\..\BBGE";"$(SolutionDir)\..\ExternalLibs\lua-5.1.4\src";"$(SolutionDir)\..\ExternalLibs\lvpa\include";"$(SolutionDir)\..\ExternalLibs\lvpa";"$(SolutionDir)\..\ExternalLibs\ttvfs";"$(SolutionDir)\..\ExternalLibs\ttvfs_cfileapi";"$(SolutionDir)\..\ExternalLibs""
|
||||
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"
|
||||
BasicRuntimeChecks="0"
|
||||
RuntimeLibrary="3"
|
||||
|
@ -123,8 +123,8 @@
|
|||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="true"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config";"$(SolutionDir)\..\ExternalLibs\gl";"$(SolutionDir)\..\ExternalLibs\glpng\zlib";"$(SolutionDir)\..\ExternalLibs\glpng\png";"$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include";"$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include";"$(SolutionDir)\..\ExternalLibs\freetype2\include";"$(SolutionDir)\..\ExternalLibs\FTGL\include";"$(SolutionDir)\..\ExternalLibs\SDL2\include";"$(SolutionDir)\..\ExternalLibs\AL\include";"$(SolutionDir)\..\BBGE";"$(SolutionDir)\..\ExternalLibs\lua-5.1.4\src";"$(SolutionDir)\..\ExternalLibs\lvpa\include";"$(SolutionDir)\..\ExternalLibs\lvpa";"$(SolutionDir)\..\ExternalLibs\ttvfs";"$(SolutionDir)\..\ExternalLibs""
|
||||
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"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config";"$(SolutionDir)\..\ExternalLibs\gl";"$(SolutionDir)\..\ExternalLibs\glpng\zlib";"$(SolutionDir)\..\ExternalLibs\glpng\png";"$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include";"$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include";"$(SolutionDir)\..\ExternalLibs\freetype2\include";"$(SolutionDir)\..\ExternalLibs\FTGL\include";"$(SolutionDir)\..\ExternalLibs\SDL2\include";"$(SolutionDir)\..\ExternalLibs\AL\include";"$(SolutionDir)\..\BBGE";"$(SolutionDir)\..\ExternalLibs\lua-5.1.4\src";"$(SolutionDir)\..\ExternalLibs\lvpa\include";"$(SolutionDir)\..\ExternalLibs\lvpa";"$(SolutionDir)\..\ExternalLibs\ttvfs";"$(SolutionDir)\..\ExternalLibs\ttvfs_cfileapi";"$(SolutionDir)\..\ExternalLibs""
|
||||
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"
|
||||
ExceptionHandling="0"
|
||||
RuntimeLibrary="0"
|
||||
|
|
|
@ -42,8 +42,8 @@
|
|||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config";"$(SolutionDir)\..\ExternalLibs\gl";"$(SolutionDir)\..\ExternalLibs\glpng\zlib";"$(SolutionDir)\..\ExternalLibs\glpng\png";"$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include";"$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include";"$(SolutionDir)\..\ExternalLibs\freetype2\include";"$(SolutionDir)\..\ExternalLibs\FTGL\include";"$(SolutionDir)\..\ExternalLibs\SDL2\include";"$(SolutionDir)\..\ExternalLibs\AL\include";"$(SolutionDir)\..\ExternalLibs\ttvfs";"$(SolutionDir)\..\ExternalLibs\lvpa";"$(SolutionDir)\..\ExternalLibs\lvpa\include";"$(SolutionDir)\..\ExternalLibs""
|
||||
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"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config";"$(SolutionDir)\..\ExternalLibs\gl";"$(SolutionDir)\..\ExternalLibs\glpng\zlib";"$(SolutionDir)\..\ExternalLibs\glpng\png";"$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include";"$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include";"$(SolutionDir)\..\ExternalLibs\freetype2\include";"$(SolutionDir)\..\ExternalLibs\FTGL\include";"$(SolutionDir)\..\ExternalLibs\SDL2\include";"$(SolutionDir)\..\ExternalLibs\AL\include";"$(SolutionDir)\..\ExternalLibs\ttvfs";"$(SolutionDir)\..\ExternalLibs\ttvfs_cfileapi";"$(SolutionDir)\..\ExternalLibs\lvpa";"$(SolutionDir)\..\ExternalLibs\lvpa\include";"$(SolutionDir)\..\ExternalLibs""
|
||||
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"
|
||||
BasicRuntimeChecks="0"
|
||||
RuntimeLibrary="3"
|
||||
|
@ -115,8 +115,8 @@
|
|||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="true"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config";"$(SolutionDir)\..\ExternalLibs\gl";"$(SolutionDir)\..\ExternalLibs\glpng\zlib";"$(SolutionDir)\..\ExternalLibs\glpng\png";"$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include";"$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include";"$(SolutionDir)\..\ExternalLibs\freetype2\include";"$(SolutionDir)\..\ExternalLibs\FTGL\include";"$(SolutionDir)\..\ExternalLibs\SDL2\include";"$(SolutionDir)\..\ExternalLibs\AL\include";"$(SolutionDir)\..\ExternalLibs\ttvfs";"$(SolutionDir)\..\ExternalLibs\lvpa";"$(SolutionDir)\..\ExternalLibs\lvpa\include";"$(SolutionDir)\..\ExternalLibs""
|
||||
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"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config";"$(SolutionDir)\..\ExternalLibs\gl";"$(SolutionDir)\..\ExternalLibs\glpng\zlib";"$(SolutionDir)\..\ExternalLibs\glpng\png";"$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include";"$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include";"$(SolutionDir)\..\ExternalLibs\freetype2\include";"$(SolutionDir)\..\ExternalLibs\FTGL\include";"$(SolutionDir)\..\ExternalLibs\SDL2\include";"$(SolutionDir)\..\ExternalLibs\AL\include";"$(SolutionDir)\..\ExternalLibs\ttvfs";"$(SolutionDir)\..\ExternalLibs\ttvfs_cfileapi";"$(SolutionDir)\..\ExternalLibs\lvpa";"$(SolutionDir)\..\ExternalLibs\lvpa\include";"$(SolutionDir)\..\ExternalLibs""
|
||||
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"
|
||||
ExceptionHandling="0"
|
||||
RuntimeLibrary="0"
|
||||
|
|
|
@ -41,8 +41,8 @@
|
|||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config";"$(SolutionDir)\..\ExternalLibs\gl";"$(SolutionDir)\..\ExternalLibs\glpng\zlib";"$(SolutionDir)\..\ExternalLibs\glpng\png";"$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include";"$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include";"$(SolutionDir)\..\ExternalLibs\freetype2\include";"$(SolutionDir)\..\ExternalLibs\FTGL\include";"$(SolutionDir)\..\ExternalLibs\SDL2\include";"$(SolutionDir)\..\ExternalLibs\ttvfs";"$(SolutionDir)\..\ExternalLibs\""
|
||||
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"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config";"$(SolutionDir)\..\ExternalLibs\gl";"$(SolutionDir)\..\ExternalLibs\glpng\zlib";"$(SolutionDir)\..\ExternalLibs\glpng\png";"$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include";"$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include";"$(SolutionDir)\..\ExternalLibs\freetype2\include";"$(SolutionDir)\..\ExternalLibs\FTGL\include";"$(SolutionDir)\..\ExternalLibs\SDL2\include";"$(SolutionDir)\..\ExternalLibs\ttvfs";"$(SolutionDir)\..\ExternalLibs\ttvfs_cfileapi";"$(SolutionDir)\..\ExternalLibs\""
|
||||
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"
|
||||
BasicRuntimeChecks="0"
|
||||
RuntimeLibrary="3"
|
||||
|
@ -115,8 +115,8 @@
|
|||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="true"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config";"$(SolutionDir)\..\ExternalLibs\gl";"$(SolutionDir)\..\ExternalLibs\glpng\zlib";"$(SolutionDir)\..\ExternalLibs\glpng\png";"$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include";"$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include";"$(SolutionDir)\..\ExternalLibs\freetype2\include";"$(SolutionDir)\..\ExternalLibs\FTGL\include";"$(SolutionDir)\..\ExternalLibs\SDL12\include";"$(SolutionDir)\..\ExternalLibs\ttvfs";"$(SolutionDir)\..\ExternalLibs""
|
||||
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"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\..\ExternalLibs\freetype2\include\freetype\config";"$(SolutionDir)\..\ExternalLibs\gl";"$(SolutionDir)\..\ExternalLibs\glpng\zlib";"$(SolutionDir)\..\ExternalLibs\glpng\png";"$(SolutionDir)\..\ExternalLibs\libogg-1.3.0\include";"$(SolutionDir)\..\ExternalLibs\libvorbis-1.3.3\include";"$(SolutionDir)\..\ExternalLibs\freetype2\include";"$(SolutionDir)\..\ExternalLibs\FTGL\include";"$(SolutionDir)\..\ExternalLibs\SDL2\include";"$(SolutionDir)\..\ExternalLibs\ttvfs";"$(SolutionDir)\..\ExternalLibs\ttvfs_cfileapi";"$(SolutionDir)\..\ExternalLibs\""
|
||||
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"
|
||||
ExceptionHandling="0"
|
||||
RuntimeLibrary="0"
|
||||
|
@ -181,14 +181,6 @@
|
|||
RelativePath="..\..\ExternalLibs\DeflateCompressor.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ExternalLibs\FileAPI.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ExternalLibs\FileAPI.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ExternalLibs\minihttp.cpp"
|
||||
>
|
||||
|
@ -1065,7 +1057,7 @@
|
|||
Name="ttvfs"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFS.h"
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\ttvfs.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
|
@ -1073,31 +1065,39 @@
|
|||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSAtomic.cpp"
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSBase.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSAtomic.h"
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSBase.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSBase.cpp"
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSDefines.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSBase.h"
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSDir.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSDefines.h"
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSDir.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSDir.cpp"
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSDirInternal.cpp"
|
||||
>
|
||||
</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
|
||||
|
@ -1117,33 +1117,41 @@
|
|||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSHashmap.h"
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSInternal.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSHelper.cpp"
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSLoader.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSHelper.h"
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSLoader.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSInternal.h"
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSRefcounted.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSLoader.cpp"
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSRoot.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSLoader.h"
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSRoot.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSSelfRefCounter.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSSystemPaths.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSSystemPaths.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ExternalLibs\ttvfs\VFSTools.cpp"
|
||||
>
|
||||
|
@ -1188,6 +1196,14 @@
|
|||
RelativePath="..\..\ExternalLibs\ttvfs_zip\VFSZipArchiveLoader.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ExternalLibs\ttvfs_zip\VFSZipArchiveRef.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ExternalLibs\ttvfs_zip\VFSZipArchiveRef.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="LVPA"
|
||||
|
@ -1213,6 +1229,18 @@
|
|||
>
|
||||
</File>
|
||||
</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
|
||||
Name="Header Files"
|
||||
|
|
Loading…
Reference in a new issue