From ac97d0069893dc6672c766ee4a7205acdef5a141 Mon Sep 17 00:00:00 2001 From: Kp Date: Sun, 27 Dec 2020 22:03:09 +0000 Subject: [PATCH] Remove support for PhysFS 1, PhysFS 2 The last PhysFS 1 release was in March 2009. The last PhysFS 2 release was in August 2017, shortly before the release of PhysFS 3 in September 2017. Most distributions have moved to PhysFS 3. Drop support for PhysFS 1 and PhysFS 2. PhysFS 2 support could be restored if there is interest. --- INSTALL.markdown | 2 +- SConstruct | 20 +++++++++++++++++++ .../dxx-rebirth/dxx-rebirth-9999.ebuild | 2 +- similar/main/menu.cpp | 14 ------------- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/INSTALL.markdown b/INSTALL.markdown index 2ce0e3763..8d08cad6e 100644 --- a/INSTALL.markdown +++ b/INSTALL.markdown @@ -19,7 +19,7 @@ The DXX-Rebirth maintainers have no control over the sites linked below. The ma * [SDL 1.2](https://www.libsdl.org/). SDL 2 is also supported, and will become the default soon. * [PhysicsFS](https://icculus.org/physfs/). -PhysFS 3.x is recommended. +PhysFS 3.x or later is required. Optional, but recommended: diff --git a/SConstruct b/SConstruct index 21e94ee39..809f1caf9 100644 --- a/SConstruct +++ b/SConstruct @@ -1369,6 +1369,23 @@ static void terminate_handler() char b[1] = {0}; if (!PHYSFS_init("")) return 1; + { + const char *r = PHYSFS_getRealDir(""); + (void)r; + } + PHYSFS_isDirectory(""); + { + const char *sep = PHYSFS_getDirSeparator(); + (void)sep; + } + { + const char *dir = PHYSFS_getBaseDir(); + (void)dir; + } + { + const char *dir = PHYSFS_getUserDir(); + (void)dir; + } f = PHYSFS_openWrite("a"); PHYSFS_sint64 w = PHYSFS_write(f, b, 1, 1); (void)w; @@ -1377,6 +1394,9 @@ static void terminate_handler() PHYSFS_sint64 r = PHYSFS_read(f, b, 1, 1); (void)r; PHYSFS_close(f); + PHYSFS_mount("", nullptr, 0); + PHYSFS_unmount(""); + PHYSFS_delete(""); ''' l = ['physfs'] successflags = {'LIBS' : l} diff --git a/contrib/gentoo/games-action/dxx-rebirth/dxx-rebirth-9999.ebuild b/contrib/gentoo/games-action/dxx-rebirth/dxx-rebirth-9999.ebuild index 502e48a35..37c7a5006 100644 --- a/contrib/gentoo/games-action/dxx-rebirth/dxx-rebirth-9999.ebuild +++ b/contrib/gentoo/games-action/dxx-rebirth/dxx-rebirth-9999.ebuild @@ -53,7 +53,7 @@ IUSE="+d1x +d2x +data debug editor +flac ipv6 +joystick l10n_de +midi +mp3 +musi # # PNG support enables writing screenshots as PNG instead of TGA (for # USE=opengl) or PCX (for USE=-opengl). -DEPEND="dev-games/physfs[hog,mvl,zip] +DEPEND=">=dev-games/physfs-3[hog,mvl,zip] opengl? ( virtual/opengl virtual/glu ) diff --git a/similar/main/menu.cpp b/similar/main/menu.cpp index 9d85cb769..515bb2ec9 100644 --- a/similar/main/menu.cpp +++ b/similar/main/menu.cpp @@ -1971,7 +1971,6 @@ void graphics_config() namespace dcx { namespace { -#if PHYSFS_VER_MAJOR >= 2 struct browser { browser(menu_title title, const partial_range_t &r) : @@ -2203,19 +2202,6 @@ static int select_file_recursive2(const menu_title title, const std::array &ext_range, int select_dir, int (*when_selected)(void *userdata, const char *filename), void *userdata) -{ - return 0; -} - - /* Include blank string to force a compile error if TXT cannot be - * string-pasted - */ -#define DXX_MENU_ITEM_BROWSE(VERB, TXT, OPT) \ - DXX_MENUITEM(VERB, TEXT, TXT "", OPT) -#endif #if DXX_USE_SDLMIXER static window_event_result get_absolute_path(char *full_path, const char *rel_path)