From 8d73622311195e1600f48829610814eed7269e61 Mon Sep 17 00:00:00 2001 From: Sasha Szpakowski Date: Sun, 4 Feb 2024 23:18:40 -0400 Subject: [PATCH] Fix compilation --- src/modules/filesystem/physfs/PhysfsIo.cpp | 2 +- src/modules/filesystem/physfs/PhysfsIo.h | 17 ++++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/modules/filesystem/physfs/PhysfsIo.cpp b/src/modules/filesystem/physfs/PhysfsIo.cpp index adb392393..ec4ed6860 100644 --- a/src/modules/filesystem/physfs/PhysfsIo.cpp +++ b/src/modules/filesystem/physfs/PhysfsIo.cpp @@ -134,7 +134,7 @@ int64 StripSuffixIo::seek(uint64 offset) PHYSFS_setErrorCode(PHYSFS_ERR_OS_ERROR); 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); return success ? 1 : 0; } diff --git a/src/modules/filesystem/physfs/PhysfsIo.h b/src/modules/filesystem/physfs/PhysfsIo.h index 423d671e5..4952460e1 100644 --- a/src/modules/filesystem/physfs/PhysfsIo.h +++ b/src/modules/filesystem/physfs/PhysfsIo.h @@ -23,7 +23,7 @@ #include "libraries/physfs/physfs.h" #include "common/int.h" -#include "filesystem/DroppedFile.h" +#include "filesystem/NativeFile.h" #include @@ -119,7 +119,7 @@ struct StripSuffixIo : public PhysfsIo static const uint32 version = 0; std::string filename; - DroppedFile *file = nullptr; + NativeFile *file = nullptr; // 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. @@ -151,23 +151,14 @@ struct StripSuffixIo : public PhysfsIo StripSuffixIo(const std::string &f) : filename(f) - , file(new DroppedFile(f)) + , file(nullptr) { - bool success = false; - try { - success = file->open(File::MODE_READ); + file = new NativeFile(f, File::MODE_READ); } catch (love::Exception &) { - success = false; - } - - if (!success) - { - file->release(); - file = nullptr; } }