From aac4b3487ad00443692bf048e64a596aef6fbee4 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sun, 22 Feb 2015 17:48:32 -0400 Subject: [PATCH] Replace deprecated PHYSFS_addToSearchPath calls with PHYSFS_mount. --HG-- branch : minor --- platform/xcode/liblove.xcodeproj/project.pbxproj | 3 +++ src/modules/filesystem/physfs/Filesystem.cpp | 6 +++--- src/modules/graphics/Quad.cpp | 2 +- src/modules/graphics/Quad.h | 4 +--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/platform/xcode/liblove.xcodeproj/project.pbxproj b/platform/xcode/liblove.xcodeproj/project.pbxproj index 5fa532eef..45fe952ef 100644 --- a/platform/xcode/liblove.xcodeproj/project.pbxproj +++ b/platform/xcode/liblove.xcodeproj/project.pbxproj @@ -3802,6 +3802,7 @@ LOVE_NOMPG123, ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; HEADER_SEARCH_PATHS = ( "$(inherited)", ios/include, @@ -3843,6 +3844,7 @@ LOVE_NO_MODPLUG, LOVE_NOMPG123, ); + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; HEADER_SEARCH_PATHS = ( "$(inherited)", ios/include, @@ -3885,6 +3887,7 @@ LOVE_NO_MODPLUG, LOVE_NOMPG123, ); + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; HEADER_SEARCH_PATHS = ( "$(inherited)", ios/include, diff --git a/src/modules/filesystem/physfs/Filesystem.cpp b/src/modules/filesystem/physfs/Filesystem.cpp index 9592f204f..4fc42fbeb 100644 --- a/src/modules/filesystem/physfs/Filesystem.cpp +++ b/src/modules/filesystem/physfs/Filesystem.cpp @@ -174,7 +174,7 @@ bool Filesystem::setIdentity(const char *ident, bool appendToPath) // Try to add the save directory to the search path. // (No error on fail, it means that the path doesn't exist). - PHYSFS_addToSearchPath(save_path_full.c_str(), appendToPath); + PHYSFS_mount(save_path_full.c_str(), nullptr, appendToPath); // HACK: This forces setupWriteDirectory to be called the next time a file // is opened for writing - otherwise it won't be called at all if it was @@ -199,7 +199,7 @@ bool Filesystem::setSource(const char *source) return false; // Add the directory. - if (!PHYSFS_addToSearchPath(source, 1)) + if (!PHYSFS_mount(source, nullptr, 1)) return false; // Save the game source. @@ -260,7 +260,7 @@ bool Filesystem::setupWriteDirectory() return false; // Add the directory. (Will not be readded if already present). - if (!PHYSFS_addToSearchPath(save_path_full.c_str(), 0)) + if (!PHYSFS_mount(save_path_full.c_str(), nullptr, 0)) { PHYSFS_setWriteDir(nullptr); // Clear the write directory in case of error. return false; diff --git a/src/modules/graphics/Quad.cpp b/src/modules/graphics/Quad.cpp index 0eb60d1cc..55619f40f 100644 --- a/src/modules/graphics/Quad.cpp +++ b/src/modules/graphics/Quad.cpp @@ -33,7 +33,7 @@ Quad::Quad(const Quad::Viewport &v, float sw, float sh) : sw(sw) , sh(sh) { - memset(vertices, 255, sizeof(Vertex) * NUM_VERTICES); + memset(vertices, 255, sizeof(Vertex) * 4); refresh(v, sw, sh); } diff --git a/src/modules/graphics/Quad.h b/src/modules/graphics/Quad.h index 99047513b..c146c97ec 100644 --- a/src/modules/graphics/Quad.h +++ b/src/modules/graphics/Quad.h @@ -40,8 +40,6 @@ public: float w, h; }; - static const size_t NUM_VERTICES = 4; - Quad(const Viewport &v, float sw, float sh); virtual ~Quad(); @@ -53,7 +51,7 @@ public: private: - Vertex vertices[NUM_VERTICES]; + Vertex vertices[4]; Viewport viewport; float sw;