Bug fixes for alternative zip layout and define to toggle it on

This commit is contained in:
Tim Newell 2012-12-15 15:30:10 -05:00 committed by DavidWyand-GG
parent 3df2aa64f4
commit 31036c4031
9 changed files with 46 additions and 5 deletions

View file

@ -29,6 +29,7 @@
#include "app/mainLoop.h"
#include "platform/input/event.h"
#include "platform/typetraits.h"
#include "core/volume.h"
const F32 TypeTraits< F32 >::MIN = - F32_MAX;
@ -132,8 +133,10 @@ const bool Platform::KeyboardInputExclusion::checkAgainstInput( const InputEvent
S32 Platform::compareModifiedTimes( const char *firstPath, const char *secondPath )
{
FileTime firstModTime;
if ( !getFileTimes( firstPath, NULL, &firstModTime ) )
return -1;
if ( !getFileTimes( firstPath, NULL, &firstModTime ) ) {
//The reason we failed to get file times could be cause it is in a zip. Lets check.
return Torque::FS::CompareModifiedTimes(firstPath, secondPath);
}
FileTime secondModTime;
if ( !getFileTimes( secondPath, NULL, &secondModTime ) )

View file

@ -70,7 +70,11 @@ bool MountZips(const String &root)
for(S32 i = 0;i < outList.size();++i)
{
String &zipfile = outList[i];
#ifdef TORQUE_ZIP_DISK_LAYOUT
mounted += (S32)Mount(root, new ZipFileSystem(zipfile, false));
#else
mounted += (S32)Mount(root, new ZipFileSystem(zipfile, true));
#endif
}
return mounted == outList.size();

View file

@ -49,6 +49,8 @@
#include "platform/profiler.h"
#include "cinterface/cinterface.h";
#include "core/volume.h"
//TODO: file io still needs some work...
#define MAX_MAC_PATH_LONG 2048
@ -634,7 +636,10 @@ bool Platform::isFile(const char *path)
// make sure we can stat the file
struct stat statData;
if( stat(path, &statData) < 0 )
return false;
{
// Since file does not exist on disk see if it exists in a zip file loaded
return Torque::FS::IsFile(path);
}
// now see if it's a regular file
if( (statData.st_mode & S_IFMT) == S_IFREG)

View file

@ -29,6 +29,7 @@
#include "core/strings/unicode.h"
#include "util/tempAlloc.h"
#include "core/util/safeDelete.h"
#include "core/volume.h"
// Microsoft VC++ has this POSIX header in the wrong directory
#if defined(TORQUE_COMPILER_VISUALC)
@ -946,7 +947,11 @@ bool Platform::isFile(const char *pFilePath)
FindClose(handle);
if(handle == INVALID_HANDLE_VALUE)
return false;
{
// Since file does not exist on disk see if it exists in a zip file loaded
return Torque::FS::IsFile(pFilePath);
}
// if the file is a Directory, Offline, System or Temporary then FALSE
if (findData.dwFileAttributes &

View file

@ -56,6 +56,7 @@
#include "core/strings/stringFunctions.h"
#include "util/tempAlloc.h"
#include "cinterface/cinterface.h"
#include "core/volume.h"
#if defined(__FreeBSD__)
#include <sys/types.h>
@ -980,7 +981,10 @@ bool dPathCopy(const char *fromName, const char *toName, bool nooverwrite)
// Get file info
struct stat fStat;
if (stat(pFilePath, &fStat) < 0)
return false;
{
// Since file does not exist on disk see if it exists in a zip file loaded
return Torque::FS::IsFile(pFilePath);
}
// if the file is a "regular file" then true
if ( (fStat.st_mode & S_IFMT) == S_IFREG)

View file

@ -73,6 +73,11 @@
/// the root of the path. Requires the virtual mount system to be active.
//#define TORQUE_DISABLE_FIND_ROOT_WITHIN_ZIP
//Uncomment this define if you want to use the alternative zip support where you can
//define your directories and files inside the zip just like you would on disk
//instead of the default zip support that treats the zip as an extra directory.
//#define TORQUE_ZIP_DISK_LAYOUT
/// Define me if you don't want Torque to compile dso's
#define TORQUE_NO_DSO_GENERATION

View file

@ -73,6 +73,11 @@
/// the root of the path. Requires the virtual mount system to be active.
//#define TORQUE_DISABLE_FIND_ROOT_WITHIN_ZIP
//Uncomment this define if you want to use the alternative zip support where you can
//define your directories and files inside the zip just like you would on disk
//instead of the default zip support that treats the zip as an extra directory.
//#define TORQUE_ZIP_DISK_LAYOUT
/// Define me if you don't want Torque to compile dso's
#define TORQUE_NO_DSO_GENERATION

View file

@ -73,6 +73,11 @@
/// the root of the path. Requires the virtual mount system to be active.
//#define TORQUE_DISABLE_FIND_ROOT_WITHIN_ZIP
//Uncomment this define if you want to use the alternative zip support where you can
//define your directories and files inside the zip just like you would on disk
//instead of the default zip support that treats the zip as an extra directory.
//#define TORQUE_ZIP_DISK_LAYOUT
/// Define me if you don't want Torque to compile dso's
#define TORQUE_NO_DSO_GENERATION

View file

@ -73,6 +73,11 @@
/// the root of the path. Requires the virtual mount system to be active.
//#define TORQUE_DISABLE_FIND_ROOT_WITHIN_ZIP
//Uncomment this define if you want to use the alternative zip support where you can
//define your directories and files inside the zip just like you would on disk
//instead of the default zip support that treats the zip as an extra directory.
//#define TORQUE_ZIP_DISK_LAYOUT
/// Define me if you don't want Torque to compile dso's
#define TORQUE_NO_DSO_GENERATION