mirror of
https://github.com/love2d/love.git
synced 2026-08-20 04:30:09 +02:00
Fix compilation
This commit is contained in:
@@ -134,7 +134,7 @@ int64 StripSuffixIo::seek(uint64 offset)
|
|||||||
PHYSFS_setErrorCode(PHYSFS_ERR_OS_ERROR);
|
PHYSFS_setErrorCode(PHYSFS_ERR_OS_ERROR);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
bool success = file->seek(offset);
|
bool success = file->seek(offset, Stream::SEEKORIGIN_BEGIN);
|
||||||
PHYSFS_setErrorCode(success ? PHYSFS_ERR_OK : PHYSFS_ERR_OS_ERROR);
|
PHYSFS_setErrorCode(success ? PHYSFS_ERR_OK : PHYSFS_ERR_OS_ERROR);
|
||||||
return success ? 1 : 0;
|
return success ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include "libraries/physfs/physfs.h"
|
#include "libraries/physfs/physfs.h"
|
||||||
#include "common/int.h"
|
#include "common/int.h"
|
||||||
#include "filesystem/DroppedFile.h"
|
#include "filesystem/NativeFile.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ struct StripSuffixIo : public PhysfsIo<StripSuffixIo>
|
|||||||
static const uint32 version = 0;
|
static const uint32 version = 0;
|
||||||
|
|
||||||
std::string filename;
|
std::string filename;
|
||||||
DroppedFile *file = nullptr;
|
NativeFile *file = nullptr;
|
||||||
|
|
||||||
// The constructor is private in favor of this function to prevent stack allocation
|
// The constructor is private in favor of this function to prevent stack allocation
|
||||||
// because Physfs will take ownership of this object and call destroy on it later.
|
// because Physfs will take ownership of this object and call destroy on it later.
|
||||||
@@ -151,23 +151,14 @@ private:
|
|||||||
|
|
||||||
StripSuffixIo(const std::string &f)
|
StripSuffixIo(const std::string &f)
|
||||||
: filename(f)
|
: filename(f)
|
||||||
, file(new DroppedFile(f))
|
, file(nullptr)
|
||||||
{
|
{
|
||||||
bool success = false;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
success = file->open(File::MODE_READ);
|
file = new NativeFile(f, File::MODE_READ);
|
||||||
}
|
}
|
||||||
catch (love::Exception &)
|
catch (love::Exception &)
|
||||||
{
|
{
|
||||||
success = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!success)
|
|
||||||
{
|
|
||||||
file->release();
|
|
||||||
file = nullptr;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user