diff options
author | Fabio Battaglia | 2009-12-30 22:56:19 +0000 |
---|---|---|
committer | Fabio Battaglia | 2009-12-30 22:56:19 +0000 |
commit | 3a418c13a7ab9790bb9b43bfc435056827a79e64 (patch) | |
tree | 14fbf03424597cd89b98b10f189e0b54c97f3326 /backends/platform/n64 | |
parent | dc5524bda56007c4ea2006bf5f970f35392beb82 (diff) | |
download | scummvm-rg350-3a418c13a7ab9790bb9b43bfc435056827a79e64.tar.gz scummvm-rg350-3a418c13a7ab9790bb9b43bfc435056827a79e64.tar.bz2 scummvm-rg350-3a418c13a7ab9790bb9b43bfc435056827a79e64.zip |
remove bad hackery caused by n64 port and avoid polluting StdioStream using a custom Stream subclass
svn-id: r46777
Diffstat (limited to 'backends/platform/n64')
-rw-r--r-- | backends/platform/n64/Makefile | 4 | ||||
-rw-r--r-- | backends/platform/n64/osys_n64_base.cpp | 2 | ||||
-rw-r--r-- | backends/platform/n64/pakfs_save_manager.cpp | 29 | ||||
-rw-r--r-- | backends/platform/n64/portdefs.h | 8 |
4 files changed, 11 insertions, 32 deletions
diff --git a/backends/platform/n64/Makefile b/backends/platform/n64/Makefile index 833f660a49..8aa0a1e145 100644 --- a/backends/platform/n64/Makefile +++ b/backends/platform/n64/Makefile @@ -52,7 +52,7 @@ USE_RGB_COLOR=0 ENABLED=STATIC_PLUGIN -#ENABLE_SCUMM=$(ENABLED) +ENABLE_SCUMM=$(ENABLED) #ENABLE_SKY=$(ENABLED) #ENABLE_SCI=$(ENABLED) #ENABLE_GOB=$(ENABLED) @@ -62,7 +62,7 @@ ENABLED=STATIC_PLUGIN #ENABLE_AGI = $(ENABLED) #ENABLE_QUEEN = $(ENABLED) #ENABLE_MADE = $(ENABLED) -ENABLE_SAGA = $(ENABLED) +#ENABLE_SAGA = $(ENABLED) OBJS := nintendo64.o osys_n64_base.o osys_n64_events.o osys_n64_utilities.o pakfs_save_manager.o diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp index 65290c5c6e..558a8642e6 100644 --- a/backends/platform/n64/osys_n64_base.cpp +++ b/backends/platform/n64/osys_n64_base.cpp @@ -22,6 +22,8 @@ #include <romfs.h> +#include <malloc.h> // Required for memalign + #include "osys_n64.h" #include "pakfs_save_manager.h" #include "backends/fs/n64/n64-fs-factory.h" diff --git a/backends/platform/n64/pakfs_save_manager.cpp b/backends/platform/n64/pakfs_save_manager.cpp index 3fbf55a199..5499462d68 100644 --- a/backends/platform/n64/pakfs_save_manager.cpp +++ b/backends/platform/n64/pakfs_save_manager.cpp @@ -21,9 +21,8 @@ */ #include <n64utils.h> -#include "pakfs_save_manager.h" -static bool matches(const char *glob, const char *name); +#include "pakfs_save_manager.h" bool deleteSaveGame(const char *filename) { int res = removeFileOnPak(filename); @@ -56,11 +55,14 @@ Common::StringList PAKSaveManager::listSavefiles(const Common::String &pattern) PAKDIR *dirp = pakfs_opendir(); pakfs_dirent *dp; Common::StringList list; + Common::String *fname; while ((dp = pakfs_readdir(dirp)) != NULL) { - if (matches(pattern.c_str(), dp->entryname)) + fname = new Common::String(dp->entryname); + if (fname->matchString(pattern, false, false)) list.push_back(dp->entryname); + delete fname; free(dp); } @@ -69,24 +71,3 @@ Common::StringList PAKSaveManager::listSavefiles(const Common::String &pattern) return list; } -static bool matches(const char *glob, const char *name) { - while (*glob) - if (*glob == '*') { - while (*glob == '*') - glob++; - do { - if ((*name == *glob || *glob == '?') && - matches(glob, name)) - return true; - } while (*name++); - return false; - } else if (!*name) - return false; - else if (*glob == '?' || *glob == *name) { - glob++; - name++; - } else - return false; - return !*name; -} - diff --git a/backends/platform/n64/portdefs.h b/backends/platform/n64/portdefs.h index fd6d295b0c..942d807a91 100644 --- a/backends/platform/n64/portdefs.h +++ b/backends/platform/n64/portdefs.h @@ -29,15 +29,11 @@ #include <n64utils.h> #include <sys/types.h> -#include <stdio.h> -#include <fcntl.h> -#include <stdlib.h> -#include <string.h> #include <stdarg.h> -#include <assert.h> +#include <string.h> +#include <stdio.h> #include <ctype.h> #include <math.h> -#include <malloc.h> #undef assert #define assert(x) ((x) ? 0 : (print_error("["#x"] (%s:%d)", __FILE__, __LINE__))) |