You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
* Ran IWYU on all cpp files. Re-running IWYU will cause a few breaking changes so will handle that in a separate change #preflight 63a1fa7c2540a78d27beadb5 #rb none [CL 23551816 by henrik karlsson in ue5-main branch]
55 lines
1.5 KiB
C++
55 lines
1.5 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
/*=============================================================================
|
|
HardwareInfo.cpp: Implements the FHardwareInfo class
|
|
=============================================================================*/
|
|
|
|
|
|
#include "HardwareInfo.h"
|
|
#include "CoreGlobals.h"
|
|
|
|
|
|
static TMap< FName, FString > HardwareDetailsMap;
|
|
|
|
ENGINE_API const FName NAME_RHI( "RHI" );
|
|
ENGINE_API const FName NAME_TextureFormat( "TextureFormat" );
|
|
ENGINE_API const FName NAME_DeviceType( "DeviceType" );
|
|
|
|
void FHardwareInfo::RegisterHardwareInfo( const FName SpecIdentifier, const FString& HardwareInfo )
|
|
{
|
|
// Ensure we are adding a valid identifier to the map
|
|
check( SpecIdentifier == NAME_RHI ||
|
|
SpecIdentifier == NAME_TextureFormat ||
|
|
SpecIdentifier == NAME_DeviceType );
|
|
|
|
HardwareDetailsMap.Add( SpecIdentifier, HardwareInfo );
|
|
}
|
|
|
|
FString FHardwareInfo::GetHardwareInfo(const FName SpecIdentifier)
|
|
{
|
|
return HardwareDetailsMap.FindRef(SpecIdentifier);
|
|
}
|
|
|
|
const FString FHardwareInfo::GetHardwareDetailsString()
|
|
{
|
|
FString DetailsString;
|
|
|
|
int32 DetailsAdded = 0;
|
|
|
|
for( TMap< FName, FString >::TConstIterator SpecIt( HardwareDetailsMap ); SpecIt; ++SpecIt )
|
|
{
|
|
// Separate all entries with a comma
|
|
if( DetailsAdded++ > 0 )
|
|
{
|
|
DetailsString += TEXT( ", " );
|
|
}
|
|
|
|
FString SpecID = SpecIt.Key().ToString();
|
|
FString SpecValue = SpecIt.Value();
|
|
|
|
DetailsString += ( ( SpecID + TEXT( "=" ) ) + SpecValue );
|
|
}
|
|
return DetailsString;
|
|
}
|