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;
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;
+
+ loadsize = len;
// extract the filename base name for hunk tag
COM_FileBase (path, base);
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);