From fcdbd268ed91641b211b41507ae614f5e369c577 Mon Sep 17 00:00:00 2001 From: Chris Brooke Date: Mon, 18 Jun 2012 16:31:12 +0100 Subject: [PATCH] Quake Live PK3 support - FIXED --- plugins/vfsqlpk3/qlvfs.cpp | 8 ++++++++ plugins/vfsqlpk3/unzip.cpp | 12 ++++++------ plugins/vfsqlpk3/vfsqlpk3.cpp | 12 +++++++----- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/plugins/vfsqlpk3/qlvfs.cpp b/plugins/vfsqlpk3/qlvfs.cpp index e5275736..6ce6eaf8 100644 --- a/plugins/vfsqlpk3/qlvfs.cpp +++ b/plugins/vfsqlpk3/qlvfs.cpp @@ -1,3 +1,11 @@ +/***************************************************************************** + * name: qlvfs.cpp + * + * desc: QL VFS functions for unzip.cpp + * + * QBall147 - 18/06/2012 + *****************************************************************************/ + #include "stdio.h" #include "qlvfs.h" diff --git a/plugins/vfsqlpk3/unzip.cpp b/plugins/vfsqlpk3/unzip.cpp index ac10d59d..c7ff36b7 100644 --- a/plugins/vfsqlpk3/unzip.cpp +++ b/plugins/vfsqlpk3/unzip.cpp @@ -6,11 +6,11 @@ See https://github.com/TTimo/GtkRadiant/issues/33 /***************************************************************************** - * name: unzip.c - * - * desc: IO on .zip files using portions of zlib + * name: unzip.cpp * + * desc: IO on (ql encoded) .zip files using portions of zlib * + * QBall147 - 18/06/2012 *****************************************************************************/ #include @@ -1223,7 +1223,7 @@ void zcfree OF((voidp opaque, voidp ptr)); static int unzlocal_getByte(FILE *fin,int *pi) { unsigned char c; - int err = fread(&c, 1, 1, fin); + int err = fread_ql(&c, 1, 1, fin); if (err==1) { *pi = (int)c; @@ -1246,7 +1246,7 @@ static int unzlocal_getShort (FILE* fin, uLong *pX) { short v; - fread( &v, sizeof(v), 1, fin ); + fread_ql( &v, sizeof(v), 1, fin ); *pX = __LittleShort( v); return UNZ_OK; @@ -1275,7 +1275,7 @@ static int unzlocal_getLong (FILE *fin, uLong *pX) { int v; - fread( &v, sizeof(v), 1, fin ); + fread_ql( &v, sizeof(v), 1, fin ); *pX = __LittleLong( v); return UNZ_OK; diff --git a/plugins/vfsqlpk3/vfsqlpk3.cpp b/plugins/vfsqlpk3/vfsqlpk3.cpp index fb4b34a5..7495684b 100644 --- a/plugins/vfsqlpk3/vfsqlpk3.cpp +++ b/plugins/vfsqlpk3/vfsqlpk3.cpp @@ -28,11 +28,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -// -// Quake Live Virtual FileSystem - reads files from different dirs and inside pak files -// -// QBall147 -// +/***************************************************************************** + * name: vfsqlpk3.cpp + * + * desc: Quake Live Virtual FileSystem - reads files from different dirs and inside pak files + * + * QBall147 - 18/06/2012 + *****************************************************************************/ #ifdef _WIN32 #include