Files
UnrealEngineUWP/Engine/Source/Runtime/TimeManagement/Public/CommonFrameRates.h
Bryan sefcik b4a6e947d8 Ran IWYU on Public headers under Engine/Source/Runtime/...
Headers are updated to contain any missing #includes needed to compile and #includes are sorted.  Nothing is removed.

#ushell-cherrypick of 21065896 by bryan.sefcik
#preflight 62d4b1a5a6141b6adfb0c892
#jira

#ROBOMERGE-OWNER: Bryan.sefcik
#ROBOMERGE-AUTHOR: bryan.sefcik
#ROBOMERGE-SOURCE: CL 21150156 via CL 21151754 via CL 21154719
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)
#ROBOMERGE-CONFLICT from-shelf

[CL 21181076 by Bryan sefcik in ue5-main branch]
2022-07-20 11:31:36 -04:00

77 lines
3.0 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Containers/ArrayView.h"
#include "HAL/Platform.h"
#include "Internationalization/Text.h"
#include "Math/UnrealMathUtility.h"
#include "Misc/FrameRate.h"
enum class ECommonFrameRate : uint8
{
FPS_12,
FPS_15,
FPS_24,
FPS_25,
FPS_30,
FPS_48,
FPS_50,
FPS_60,
FPS_100,
FPS_120,
FPS_240,
NTSC_24,
NTSC_30,
NTSC_60,
Private_Num
};
struct FCommonFrameRateInfo
{
FFrameRate FrameRate;
FText DisplayName;
FText Description;
};
struct TIMEMANAGEMENT_API FCommonFrameRates
{
typedef __underlying_type(ECommonFrameRate) NumericType;
FORCEINLINE static FFrameRate FPS_12() { return AllFrameRates[(NumericType)ECommonFrameRate::FPS_12].FrameRate; }
FORCEINLINE static FFrameRate FPS_15() { return AllFrameRates[(NumericType)ECommonFrameRate::FPS_15].FrameRate; }
FORCEINLINE static FFrameRate FPS_24() { return AllFrameRates[(NumericType)ECommonFrameRate::FPS_24].FrameRate; }
FORCEINLINE static FFrameRate FPS_25() { return AllFrameRates[(NumericType)ECommonFrameRate::FPS_25].FrameRate; }
FORCEINLINE static FFrameRate FPS_30() { return AllFrameRates[(NumericType)ECommonFrameRate::FPS_30].FrameRate; }
FORCEINLINE static FFrameRate FPS_48() { return AllFrameRates[(NumericType)ECommonFrameRate::FPS_48].FrameRate; }
FORCEINLINE static FFrameRate FPS_50() { return AllFrameRates[(NumericType)ECommonFrameRate::FPS_50].FrameRate; }
FORCEINLINE static FFrameRate FPS_60() { return AllFrameRates[(NumericType)ECommonFrameRate::FPS_60].FrameRate; }
FORCEINLINE static FFrameRate FPS_100() { return AllFrameRates[(NumericType)ECommonFrameRate::FPS_100].FrameRate; }
FORCEINLINE static FFrameRate FPS_120() { return AllFrameRates[(NumericType)ECommonFrameRate::FPS_120].FrameRate; }
FORCEINLINE static FFrameRate FPS_240() { return AllFrameRates[(NumericType)ECommonFrameRate::FPS_240].FrameRate; }
FORCEINLINE static FFrameRate NTSC_24() { return AllFrameRates[(NumericType)ECommonFrameRate::NTSC_24].FrameRate; }
FORCEINLINE static FFrameRate NTSC_30() { return AllFrameRates[(NumericType)ECommonFrameRate::NTSC_30].FrameRate; }
FORCEINLINE static FFrameRate NTSC_60() { return AllFrameRates[(NumericType)ECommonFrameRate::NTSC_60].FrameRate; }
static TArrayView<const FCommonFrameRateInfo> GetAll();
static bool Contains(FFrameRate FrameRateToCheck)
{
return Find(FrameRateToCheck) != nullptr;
}
static const FCommonFrameRateInfo* Find(FFrameRate InFrameRate);
/** Find a common frame rate that matches the given frame rate as a decimal number of frames per second.
*
* @param InFrameRateAsDecimal: Frame rate (in frames per second) to search for.
* @param Tolerance: Numerical tolerance to use when searching for a frame rate match.
* @return: a pointer to the matching common frame rate if a match was found, or nullptr otherwise.
*/
static const FCommonFrameRateInfo* Find(const double InFrameRateAsDecimal, const double Tolerance = UE_DOUBLE_KINDA_SMALL_NUMBER);
private:
static const FCommonFrameRateInfo AllFrameRates[(int32)ECommonFrameRate::Private_Num];
};