2 //=======================================================================================================================
10 u32 FileDataSectionSize
;
11 u32 ArchiveMD5SectionSize
;
12 u32 OtherMD5SectionSize
;
13 u32 SignatureSectionSize
;
29 void vpk_free( VPKHeader
*self
)
34 VPKDirectoryEntry
*vpk_find( VPKHeader
*self
, const char *asset
)
40 strcpy( wbuf
, asset
);
42 char *ext
= csr_findext( wbuf
, '.' );
44 char *fn
= csr_findext( wbuf
, '/' );
48 char *pCur
= ((char *)self
) + sizeof( VPKHeader
);
54 int bExt
= !strcmp( ext
, pCur
);
56 while( *( pCur
++ ) ) {};
59 if( !*pCur
) { pCur
++; break; }
61 int bDir
= !strcmp( dir
, pCur
);
63 while( *( pCur
++ ) ) {};
66 if( !*pCur
) { pCur
++; break; }
68 const char *vpk_fn
= pCur
;
70 while( *( pCur
++ ) ) {};
71 VPKDirectoryEntry
*entry
= (VPKDirectoryEntry
*)pCur
;
73 if( !strcmp( vpk_fn
, fn
) && bExt
&& bDir
)
78 pCur
+= entry
->PreloadBytes
+ sizeof( VPKDirectoryEntry
);
81 if( bDir
&& bExt
) return NULL
;
84 if( bExt
) return NULL
;