engine: fix hdr to ldr conversion

This commit is contained in:
nillerusr
2022-04-16 12:54:00 +03:00
parent 58873c35c7
commit 0feeab91dd
11 changed files with 31 additions and 28 deletions
+6 -6
View File
@@ -1038,7 +1038,7 @@ bool Map_CheckForHDR( model_t *pModel, const char *pLoadName )
}
bool bEnableHDR = ( IsX360() && bHasHDR ) ||
( bHasHDR && ( mat_hdr_level.GetInt() >= 2 ) &&
( bHasHDR &&
( g_pMaterialSystemHardwareConfig->GetDXSupportLevel() >= 90 ) );
EnableHDR( bEnableHDR );
@@ -1856,7 +1856,7 @@ void Mod_LoadFaces( void )
int ti, di;
int face_lump_to_load = LUMP_FACES;
if ( CMapLoadHelper::LumpSize( LUMP_FACES_HDR ) > 0 )
if ( g_pMaterialSystemHardwareConfig->GetHDREnabled() && CMapLoadHelper::LumpSize( LUMP_FACES_HDR ) > 0 )
{
face_lump_to_load = LUMP_FACES_HDR;
}
@@ -2288,7 +2288,7 @@ void Mod_LoadLeafs( void )
Mod_LoadLeafs_Version_0( lh );
break;
case 1:
if( CMapLoadHelper::LumpSize( LUMP_LEAF_AMBIENT_LIGHTING_HDR ) > 0 )
if( g_pMaterialSystemHardwareConfig->GetHDREnabled() && CMapLoadHelper::LumpSize( LUMP_LEAF_AMBIENT_LIGHTING_HDR ) > 0 )
{
CMapLoadHelper mlh( LUMP_LEAF_AMBIENT_LIGHTING_HDR );
CMapLoadHelper mlhTable( LUMP_LEAF_AMBIENT_INDEX_HDR );
@@ -2383,7 +2383,7 @@ void Mod_LoadCubemapSamples( void )
lh.GetMap()->m_pCubemapSamples = out;
lh.GetMap()->m_nCubemapSamples = count;
bool bHDR = true; //g_pMaterialSystemHardwareConfig->GetHDRType() != HDR_TYPE_NONE;
bool bHDR = g_pMaterialSystemHardwareConfig->GetHDREnabled(); //g_pMaterialSystemHardwareConfig->GetHDRType() != HDR_TYPE_NONE;
int nCreateFlags = bHDR ? 0 : TEXTUREFLAGS_SRGB;
// We have separate HDR versions of the textures. In order to deal with this,
@@ -4451,7 +4451,7 @@ void CModelLoader::Map_LoadModel( model_t *mod )
// Until BSP version 19, this must occur after loading texinfo
COM_TimestampedLog( " Mod_LoadLighting" );
if ( CMapLoadHelper::LumpSize( LUMP_LIGHTING_HDR ) > 0 )
if ( g_pMaterialSystemHardwareConfig->GetHDREnabled() && CMapLoadHelper::LumpSize( LUMP_LIGHTING_HDR ) > 0 )
{
CMapLoadHelper mlh( LUMP_LIGHTING_HDR );
Mod_LoadLighting( mlh );
@@ -4543,7 +4543,7 @@ void CModelLoader::Map_LoadModel( model_t *mod )
&m_worldBrushData.m_nAreas );
COM_TimestampedLog( " Mod_LoadWorldlights" );
if ( CMapLoadHelper::LumpSize( LUMP_WORLDLIGHTS_HDR ) > 0 )
if ( g_pMaterialSystemHardwareConfig->GetHDREnabled() && CMapLoadHelper::LumpSize( LUMP_WORLDLIGHTS_HDR ) > 0 )
{
CMapLoadHelper mlh( LUMP_WORLDLIGHTS_HDR );
Mod_LoadWorldlights( mlh, true );