Skip to content

Commit

Permalink
restored last working shader cache
Browse files Browse the repository at this point in the history
-fixed crash on clear vfs path contents
  • Loading branch information
megai2 committed Sep 25, 2019
1 parent 747e979 commit 784e7b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Binary file modified bin/d912pxy/pck/vfs_archive.zpck
Binary file not shown.
6 changes: 5 additions & 1 deletion d912pxy/d912pxy_vfs_packer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ void d912pxy_vfs_packer::UnpackArchive(const char * name)

FILE* f = fopen(fn, "rb");

if (!f)
return;

UINT32 header[3] = { 0 };

fread(header, 1, 4 * 3, f);
Expand Down Expand Up @@ -125,6 +128,7 @@ void d912pxy_vfs_packer::UnpackArchive(const char * name)
--listingInfo[1];
}

fflush(vfs_f);
fseek(vfs_f, 0, SEEK_SET);
fwrite(signature, 1, 16, vfs_f);
fwrite(headerTable, PXY_VFS_FILE_HEADER_SIZE, PXY_VFS_MAX_FILES_PER_BID, vfs_f);
Expand Down Expand Up @@ -266,7 +270,7 @@ void d912pxy_vfs_packer::ReadVFS(d912pxy_vfs_id_name * id)

UINT64 signature[2] = { PXY_VFS_SIGNATURE, PXY_VFS_VER };

if (sz < PXY_VFS_BID_TABLE_SIZE + PXY_VFS_BID_TABLE_START)
if (sz <= PXY_VFS_BID_TABLE_SIZE + PXY_VFS_BID_TABLE_START)
{
fclose(f);
return;
Expand Down

0 comments on commit 784e7b7

Please sign in to comment.