]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
added loadsize variable set by COM_LoadFile
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 30 May 2001 08:28:52 +0000 (08:28 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 30 May 2001 08:28:52 +0000 (08:28 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@225 d7cf8633-e32d-0410-b094-e92efae38249

common.c
common.h

index 7b1fd49f4cce06d81a6d6a04d1a7c3a2eab3eec3..56d7f5ee031376fc8aa8ac195d2aeaa703f88d82 100644 (file)
--- a/common.c
+++ b/common.c
@@ -1660,9 +1660,9 @@ Filename are reletive to the quake directory.
 Always appends a 0 byte.
 ============
 */
 Always appends a 0 byte.
 ============
 */
-cache_user_t *loadcache;
-byte    *loadbuf;
-int             loadsize;
+cache_user_t   *loadcache;
+byte                   *loadbuf;
+int                            loadsize;
 byte *COM_LoadFile (char *path, int usehunk, qboolean quiet)
 {
        QFile             *h;
 byte *COM_LoadFile (char *path, int usehunk, qboolean quiet)
 {
        QFile             *h;
@@ -1671,11 +1671,14 @@ byte *COM_LoadFile (char *path, int usehunk, qboolean quiet)
        int             len;
 
        buf = NULL;     // quiet compiler warning
        int             len;
 
        buf = NULL;     // quiet compiler warning
+       loadsize = 0;
 
 // look for it in the filesystem or pack files
        len = COM_FOpenFile (path, &h, quiet, true);
        if (!h)
                return NULL;
 
 // look for it in the filesystem or pack files
        len = COM_FOpenFile (path, &h, quiet, true);
        if (!h)
                return NULL;
+
+       loadsize = len;
        
 // extract the filename base name for hunk tag
        COM_FileBase (path, base);
        
 // extract the filename base name for hunk tag
        COM_FileBase (path, base);
index 96b61b5ea9f2d8d0074c9b2265079cd2a6dc7b1f..81de850aed5e30616ec24529ce407d6bff204326 100644 (file)
--- a/common.h
+++ b/common.h
@@ -207,6 +207,8 @@ extern      char    com_gamedir[MAX_OSPATH];
 void COM_WriteFile (char *filename, void *data, int len);
 int COM_FOpenFile (char *filename, QFile **file, qboolean quiet, qboolean zip);
 
 void COM_WriteFile (char *filename, void *data, int len);
 int COM_FOpenFile (char *filename, QFile **file, qboolean quiet, qboolean zip);
 
+// set by COM_LoadFile functions
+extern int loadsize;
 byte *COM_LoadHunkFile (char *path, qboolean quiet);
 byte *COM_LoadMallocFile (char *path, qboolean quiet);
 //void COM_LoadCacheFile (char *path, struct cache_user_s *cu, qboolean quiet);
 byte *COM_LoadHunkFile (char *path, qboolean quiet);
 byte *COM_LoadMallocFile (char *path, qboolean quiet);
 //void COM_LoadCacheFile (char *path, struct cache_user_s *cu, qboolean quiet);