|
|
|
@ -109,7 +109,7 @@ void HPAK_CreatePak( const char *filename, resource_t *pResource, byte *pData, f
@@ -109,7 +109,7 @@ void HPAK_CreatePak( const char *filename, resource_t *pResource, byte *pData, f
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
Q_strncpy( pakname, filename, sizeof( pakname )); |
|
|
|
|
COM_ReplaceExtension( pakname, ".hpk" ); |
|
|
|
|
COM_ReplaceExtension( pakname, ".hpk", sizeof( pakname )); |
|
|
|
|
|
|
|
|
|
Con_Printf( "creating HPAK %s.\n", pakname ); |
|
|
|
|
|
|
|
|
@ -257,7 +257,7 @@ void HPAK_AddLump( qboolean bUseQueue, const char *name, resource_t *pResource,
@@ -257,7 +257,7 @@ void HPAK_AddLump( qboolean bUseQueue, const char *name, resource_t *pResource,
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Q_strncpy( srcname, name, sizeof( srcname )); |
|
|
|
|
COM_ReplaceExtension( srcname, ".hpk" ); |
|
|
|
|
COM_ReplaceExtension( srcname, ".hpk", sizeof( srcname )); |
|
|
|
|
|
|
|
|
|
file_src = FS_Open( srcname, "rb", true ); |
|
|
|
|
|
|
|
|
@ -269,7 +269,7 @@ void HPAK_AddLump( qboolean bUseQueue, const char *name, resource_t *pResource,
@@ -269,7 +269,7 @@ void HPAK_AddLump( qboolean bUseQueue, const char *name, resource_t *pResource,
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Q_strncpy( dstname, srcname, sizeof( dstname )); |
|
|
|
|
COM_ReplaceExtension( dstname, ".hp2" ); |
|
|
|
|
COM_ReplaceExtension( dstname, ".hp2", sizeof( dstname )); |
|
|
|
|
|
|
|
|
|
file_dst = FS_Open( dstname, "wb", true ); |
|
|
|
|
|
|
|
|
@ -395,7 +395,7 @@ static qboolean HPAK_Validate( const char *filename, qboolean quiet, qboolean de
@@ -395,7 +395,7 @@ static qboolean HPAK_Validate( const char *filename, qboolean quiet, qboolean de
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
Q_strncpy( pakname, filename, sizeof( pakname )); |
|
|
|
|
COM_ReplaceExtension( pakname, ".hpk" ); |
|
|
|
|
COM_ReplaceExtension( pakname, ".hpk", sizeof( pakname )); |
|
|
|
|
|
|
|
|
|
f = FS_Open( pakname, "rb", true ); |
|
|
|
|
if( !f ) |
|
|
|
@ -497,7 +497,7 @@ void HPAK_CheckIntegrity( const char *filename )
@@ -497,7 +497,7 @@ void HPAK_CheckIntegrity( const char *filename )
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
Q_strncpy( pakname, filename, sizeof( pakname )); |
|
|
|
|
COM_ReplaceExtension( pakname, ".hpk" ); |
|
|
|
|
COM_ReplaceExtension( pakname, ".hpk", sizeof( pakname )); |
|
|
|
|
|
|
|
|
|
HPAK_Validate( pakname, true, true ); |
|
|
|
|
} |
|
|
|
@ -514,7 +514,7 @@ void HPAK_CheckSize( const char *filename )
@@ -514,7 +514,7 @@ void HPAK_CheckSize( const char *filename )
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
Q_strncpy( pakname, filename, sizeof( pakname )); |
|
|
|
|
COM_ReplaceExtension( pakname, ".hpk" ); |
|
|
|
|
COM_ReplaceExtension( pakname, ".hpk", sizeof( pakname )); |
|
|
|
|
|
|
|
|
|
if( FS_FileSize( pakname, false ) > ( maxsize * 1048576 )) |
|
|
|
|
{ |
|
|
|
@ -547,7 +547,7 @@ qboolean HPAK_ResourceForHash( const char *filename, byte *hash, resource_t *pRe
@@ -547,7 +547,7 @@ qboolean HPAK_ResourceForHash( const char *filename, byte *hash, resource_t *pRe
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Q_strncpy( pakname, filename, sizeof( pakname )); |
|
|
|
|
COM_ReplaceExtension( pakname, ".hpk" ); |
|
|
|
|
COM_ReplaceExtension( pakname, ".hpk", sizeof( pakname )); |
|
|
|
|
|
|
|
|
|
f = FS_Open( pakname, "rb", true ); |
|
|
|
|
if( !f ) return false; |
|
|
|
@ -595,7 +595,7 @@ static qboolean HPAK_ResourceForIndex( const char *filename, int index, resource
@@ -595,7 +595,7 @@ static qboolean HPAK_ResourceForIndex( const char *filename, int index, resource
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
Q_strncpy( pakname, filename, sizeof( pakname )); |
|
|
|
|
COM_ReplaceExtension( pakname, ".hpk" ); |
|
|
|
|
COM_ReplaceExtension( pakname, ".hpk", sizeof( pakname )); |
|
|
|
|
|
|
|
|
|
f = FS_Open( pakname, "rb", true ); |
|
|
|
|
if( !f ) |
|
|
|
@ -681,7 +681,7 @@ qboolean HPAK_GetDataPointer( const char *filename, resource_t *pResource, byte
@@ -681,7 +681,7 @@ qboolean HPAK_GetDataPointer( const char *filename, resource_t *pResource, byte
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Q_strncpy( pakname, filename, sizeof( pakname )); |
|
|
|
|
COM_ReplaceExtension( pakname, ".hpk" ); |
|
|
|
|
COM_ReplaceExtension( pakname, ".hpk", sizeof( pakname )); |
|
|
|
|
|
|
|
|
|
f = FS_Open( pakname, "rb", true ); |
|
|
|
|
if( !f ) return false; |
|
|
|
@ -764,7 +764,7 @@ void HPAK_RemoveLump( const char *name, resource_t *pResource )
@@ -764,7 +764,7 @@ void HPAK_RemoveLump( const char *name, resource_t *pResource )
|
|
|
|
|
HPAK_FlushHostQueue(); |
|
|
|
|
|
|
|
|
|
Q_strncpy( read_path, name, sizeof( read_path )); |
|
|
|
|
COM_ReplaceExtension( read_path, ".hpk" ); |
|
|
|
|
COM_ReplaceExtension( read_path, ".hpk", sizeof( read_path )); |
|
|
|
|
|
|
|
|
|
file_src = FS_Open( read_path, "rb", true ); |
|
|
|
|
if( !file_src ) |
|
|
|
@ -774,7 +774,7 @@ void HPAK_RemoveLump( const char *name, resource_t *pResource )
@@ -774,7 +774,7 @@ void HPAK_RemoveLump( const char *name, resource_t *pResource )
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Q_strncpy( save_path, read_path, sizeof( save_path )); |
|
|
|
|
COM_ReplaceExtension( save_path, ".hp2" ); |
|
|
|
|
COM_ReplaceExtension( save_path, ".hp2", sizeof( save_path )); |
|
|
|
|
file_dst = FS_Open( save_path, "wb", true ); |
|
|
|
|
|
|
|
|
|
if( !file_dst ) |
|
|
|
@ -893,7 +893,7 @@ void HPAK_List_f( void )
@@ -893,7 +893,7 @@ void HPAK_List_f( void )
|
|
|
|
|
HPAK_FlushHostQueue(); |
|
|
|
|
|
|
|
|
|
Q_strncpy( pakname, Cmd_Argv( 1 ), sizeof( pakname )); |
|
|
|
|
COM_ReplaceExtension( pakname, ".hpk" ); |
|
|
|
|
COM_ReplaceExtension( pakname, ".hpk", sizeof( pakname )); |
|
|
|
|
Con_Printf( "Contents for %s.\n", pakname ); |
|
|
|
|
|
|
|
|
|
f = FS_Open( pakname, "rb", true ); |
|
|
|
@ -984,7 +984,7 @@ void HPAK_Extract_f( void )
@@ -984,7 +984,7 @@ void HPAK_Extract_f( void )
|
|
|
|
|
HPAK_FlushHostQueue(); |
|
|
|
|
|
|
|
|
|
Q_strncpy( pakname, Cmd_Argv( 1 ), sizeof( pakname )); |
|
|
|
|
COM_ReplaceExtension( pakname, ".hpk" ); |
|
|
|
|
COM_ReplaceExtension( pakname, ".hpk", sizeof( pakname )); |
|
|
|
|
Con_Printf( "Contents for %s.\n", pakname ); |
|
|
|
|
|
|
|
|
|
f = FS_Open( pakname, "rb", true ); |
|
|
|
|