RGSSAD: Add RGSS2 archive reader

Exactly the same as RGSS1 but different file extension.
Also remove some redundant strings.
This commit is contained in:
Jonas Kulla 2014-07-23 23:05:24 +02:00
parent 1ecdd9f980
commit 6726493ee7
3 changed files with 29 additions and 5 deletions

View File

@ -337,7 +337,9 @@ FileSystem::FileSystem(const char *argv0,
p->extensions[Font].push_back("otf"); p->extensions[Font].push_back("otf");
PHYSFS_init(argv0); PHYSFS_init(argv0);
PHYSFS_registerArchiver(&RGSS_Archiver);
PHYSFS_registerArchiver(&RGSS1_Archiver);
PHYSFS_registerArchiver(&RGSS2_Archiver);
if (allowSymlinks) if (allowSymlinks)
PHYSFS_permitSymbolicLinks(1); PHYSFS_permitSymbolicLinks(1);

View File

@ -466,14 +466,35 @@ RGSS_noop2(void*, const char*)
return 0; return 0;
} }
const PHYSFS_Archiver RGSS_Archiver = const PHYSFS_Archiver RGSS1_Archiver =
{ {
0, 0,
{ {
"RGSSAD", "RGSSAD",
"RGSS encrypted archive format", "RGSS encrypted archive format",
"Jonas Kulla <Nyocurio@gmail.com>", "", /* Author */
"http://k-du.de/rgss/rgss.html", "", /* Website */
0 /* symlinks not supported */
},
RGSS_openArchive,
RGSS_enumerateFiles,
RGSS_openRead,
RGSS_noop1, /* openWrite */
RGSS_noop1, /* openAppend */
RGSS_noop2, /* remove */
RGSS_noop2, /* mkdir */
RGSS_stat,
RGSS_closeArchive
};
const PHYSFS_Archiver RGSS2_Archiver =
{
0,
{
"RGSS2A",
"RGSS2 encrypted archive format",
"", /* Author */
"", /* Website */
0 /* symlinks not supported */ 0 /* symlinks not supported */
}, },
RGSS_openArchive, RGSS_openArchive,

View File

@ -24,6 +24,7 @@
#include <physfs.h> #include <physfs.h>
extern const PHYSFS_Archiver RGSS_Archiver; extern const PHYSFS_Archiver RGSS1_Archiver;
extern const PHYSFS_Archiver RGSS2_Archiver;
#endif // RGSSAD_H #endif // RGSSAD_H