engine: allow to change hardcoded path to custom.hpk

This commit is contained in:
Alibek Omarov
2024-06-15 17:22:26 +03:00
parent 1b36785177
commit 95b48da37d
12 changed files with 25 additions and 25 deletions
+7 -7
View File
@@ -938,16 +938,16 @@ static void CL_BeginUpload_f( void )
memset( &custResource, 0, sizeof( custResource ));
COM_HexConvert( name + 4, 32, md5 );
if( HPAK_ResourceForHash( CUSTOM_RES_PATH, md5, &custResource ))
if( HPAK_ResourceForHash( hpk_custom_file.string, md5, &custResource ))
{
if( memcmp( md5, custResource.rgucMD5_hash, 16 ))
{
Con_Reportf( "Bogus data retrieved from %s, attempting to delete entry\n", CUSTOM_RES_PATH );
HPAK_RemoveLump( CUSTOM_RES_PATH, &custResource );
Con_Reportf( "Bogus data retrieved from %s, attempting to delete entry\n", hpk_custom_file.string );
HPAK_RemoveLump( hpk_custom_file.string, &custResource );
return;
}
if( HPAK_GetDataPointer( CUSTOM_RES_PATH, &custResource, &buf, &size ))
if( HPAK_GetDataPointer( hpk_custom_file.string, &custResource, &buf, &size ))
{
byte md5[16];
MD5Context_t ctx;
@@ -963,7 +963,7 @@ static void CL_BeginUpload_f( void )
Con_Reportf( "Purported: %s\n", MD5_Print( custResource.rgucMD5_hash ) );
Con_Reportf( "Actual : %s\n", MD5_Print( md5 ) );
Con_Reportf( "Removing conflicting lump\n" );
HPAK_RemoveLump( CUSTOM_RES_PATH, &custResource );
HPAK_RemoveLump( hpk_custom_file.string, &custResource );
return;
}
}
@@ -1254,7 +1254,7 @@ static void CL_CreateResourceList( void )
{
SetBits( pNewResource->ucFlags, RES_CUSTOM );
memcpy( pNewResource->rgucMD5_hash, rgucMD5_hash, 16 );
HPAK_AddLump( false, CUSTOM_RES_PATH, pNewResource, NULL, fp );
HPAK_AddLump( false, hpk_custom_file.string, pNewResource, NULL, fp );
}
}
@@ -2634,7 +2634,7 @@ void CL_ProcessFile( qboolean successfully_received, const char *filename )
{
if( p->ucFlags & RES_CUSTOM )
{
HPAK_AddLump( true, CUSTOM_RES_PATH, p, cls.netchan.tempbuffer, NULL );
HPAK_AddLump( true, hpk_custom_file.string, p, cls.netchan.tempbuffer, NULL );
CL_RegisterCustomization( p );
}
}
+3 -3
View File
@@ -498,7 +498,7 @@ void CL_BatchResourceRequest( qboolean initialize )
CL_MoveToOnHandList( p );
break;
case t_decal:
if( !HPAK_GetDataPointer( CUSTOM_RES_PATH, p, NULL, NULL ))
if( !HPAK_GetDataPointer( hpk_custom_file.string, p, NULL, NULL ))
{
if( !FBitSet( p->ucFlags, RES_REQUESTED ))
{
@@ -722,7 +722,7 @@ void CL_ParseCustomization( sizebuf_t *msg )
}
}
if( HPAK_GetDataPointer( CUSTOM_RES_PATH, pRes, NULL, NULL ))
if( HPAK_GetDataPointer( hpk_custom_file.string, pRes, NULL, NULL ))
{
qboolean bError = false;
@@ -854,7 +854,7 @@ void CL_ParseServerData( sizebuf_t *msg, qboolean legacy )
int i;
uint32_t mapCRC;
HPAK_CheckSize( CUSTOM_RES_PATH );
HPAK_CheckSize( hpk_custom_file.string );
Con_Reportf( "%s packet received.\n", legacy ? "Legacy serverdata" : "Serverdata" );
+1 -1
View File
@@ -218,7 +218,7 @@ static void Joy_ProcessStick( const engineAxis_t engineAxis, short value )
// fwd/side axis simulate hat movement
if( ( engineAxis == JOY_AXIS_SIDE || engineAxis == JOY_AXIS_FWD ) &&
( CL_IsInMenu() || CL_IsInConsole() ) )
( cls.key_dest == key_menu || cls.key_dest == key_console ))
{
int val = 0;