From: Cloudwalk Date: Thu, 22 Jul 2021 01:47:14 +0000 (-0400) Subject: Merge branch 'Mario/dpk_support' of gitlab.com:xonotic/darkplaces X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=4d34e0a632cbc401712f46e10bb9864438b0881f;hp=0706fdfa8e33548670e59234409eac2c51849631 Merge branch 'Mario/dpk_support' of gitlab.com:xonotic/darkplaces --- diff --git a/.gitattributes b/.gitattributes index ec3bfe3d..c8716cc0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -61,6 +61,7 @@ DoxyConfig crlf=input doxyfile crlf=input Doxyfile crlf=input *.doxygen crlf=input +*.dpk -diff -crlf *.dpm -diff -crlf *.dsp -crlf *.dsw -crlf diff --git a/cl_parse.c b/cl_parse.c index 5cbcb8b2..326c1fc0 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -1448,7 +1448,7 @@ static void CL_StopDownload(int size, int crc) Con_Printf("Downloaded \"%s\" (%i bytes, %i CRC)\n", cls.qw_downloadname, size, crc); FS_WriteFile(cls.qw_downloadname, cls.qw_downloadmemory, cls.qw_downloadmemorycursize); extension = FS_FileExtension(cls.qw_downloadname); - if (!strcasecmp(extension, "pak") || !strcasecmp(extension, "pk3")) + if (!strcasecmp(extension, "pak") || !strcasecmp(extension, "pk3") || !strcasecmp(extension, "dpk")) FS_Rescan(); } } diff --git a/fs.c b/fs.c index 97259f72..f5f4d6b9 100644 --- a/fs.c +++ b/fs.c @@ -1138,11 +1138,11 @@ static qbool FS_AddPack_Fullpath(const char *pakfile, const char *shortname, qbo if(already_loaded) *already_loaded = false; - if(!strcasecmp(ext, "pk3dir")) + if(!strcasecmp(ext, "pk3dir") || !strcasecmp(ext, "dpkdir")) pak = FS_LoadPackVirtual (pakfile); else if(!strcasecmp(ext, "pak")) pak = FS_LoadPackPAK (pakfile); - else if(!strcasecmp(ext, "pk3")) + else if(!strcasecmp(ext, "pk3") || !strcasecmp(ext, "dpk")) pak = FS_LoadPackPK3 (pakfile); else if(!strcasecmp(ext, "obb")) // android apk expansion pak = FS_LoadPackPK3 (pakfile); @@ -1197,15 +1197,15 @@ static qbool FS_AddPack_Fullpath(const char *pakfile, const char *shortname, qbo if(pak->vpack) { dpsnprintf(search->filename, sizeof(search->filename), "%s/", pakfile); - // if shortname ends with "pk3dir", strip that suffix to make it just "pk3" + // if shortname ends with "pk3dir" or "dpkdir", strip that suffix to make it just "pk3" or "dpk" // same goes for the name inside the pack structure l = strlen(pak->shortname); if(l >= 7) - if(!strcasecmp(pak->shortname + l - 7, ".pk3dir")) + if(!strcasecmp(pak->shortname + l - 7, ".pk3dir") || !strcasecmp(pak->shortname + l - 7, ".dpkdir")) pak->shortname[l - 3] = 0; l = strlen(pak->filename); if(l >= 7) - if(!strcasecmp(pak->filename + l - 7, ".pk3dir")) + if(!strcasecmp(pak->filename + l - 7, ".pk3dir") || !strcasecmp(pak->filename + l - 7, ".dpkdir")) pak->filename[l - 3] = 0; } return true; @@ -1287,7 +1287,8 @@ static void FS_AddGameDirectory (const char *dir) // add any PK3 package in the directory for (i = 0;i < list.numstrings;i++) { - if (!strcasecmp(FS_FileExtension(list.strings[i]), "pk3") || !strcasecmp(FS_FileExtension(list.strings[i]), "obb") || !strcasecmp(FS_FileExtension(list.strings[i]), "pk3dir")) + if (!strcasecmp(FS_FileExtension(list.strings[i]), "pk3") || !strcasecmp(FS_FileExtension(list.strings[i]), "obb") || !strcasecmp(FS_FileExtension(list.strings[i]), "pk3dir") + || !strcasecmp(FS_FileExtension(list.strings[i]), "dpk") || !strcasecmp(FS_FileExtension(list.strings[i]), "dpkdir")) { FS_AddPack_Fullpath(list.strings[i], list.strings[i] + strlen(dir), NULL, false); } diff --git a/sv_main.c b/sv_main.c index 777d3e57..4479a30e 100644 --- a/sv_main.c +++ b/sv_main.c @@ -1302,7 +1302,7 @@ static void SV_Download_f(cmd_state_t *cmd) if (!sv_allowdownloads_archive.integer) { - if (!strcasecmp(extension, "pak") || !strcasecmp(extension, "pk3")) + if (!strcasecmp(extension, "pak") || !strcasecmp(extension, "pk3") || !strcasecmp(extension, "dpk")) { SV_ClientPrintf("Download rejected: file \"%s\" is an archive\nYou must separately download or purchase the data archives for this game/mod to get this file\n", host_client->download_name); SV_ClientCommands("\nstopdownload\n");