Custom engine which caps framerate to 60fps and fixes timestep to 1/60
Custom engine which caps framerate to 60fps and fixes timestep to 1/60
This commit is contained in:
parent
289c60102b
commit
ac61585f5c
@ -28,6 +28,9 @@ AppliedDefaultGraphicsPerformance=Maximum
|
||||
+ActiveGameNameRedirects=(OldGameName="/Script/TP_SideScroller",NewGameName="/Script/KOFForever")
|
||||
+ActiveClassRedirects=(OldClassName="TP_SideScrollerGameMode",NewClassName="KOFForeverGameMode")
|
||||
+ActiveClassRedirects=(OldClassName="TP_SideScrollerCharacter",NewClassName="KOFForeverCharacter")
|
||||
GameEngine=/Script/KOFForever.KOFGameEngine
|
||||
EditorEngine=/Script/UnrealEd.EditorEngine
|
||||
UnrealEdEngine=/Script/KOFForever.KOFEdEngine
|
||||
|
||||
[SystemSettingsEditor]
|
||||
r.Editor.SkipSourceControlCheckForEditablePackages = 1
|
||||
|
@ -11,7 +11,8 @@
|
||||
"AdditionalDependencies": [
|
||||
"Paper2D",
|
||||
"Engine",
|
||||
"CoreUObject"
|
||||
"CoreUObject",
|
||||
"UnrealEd"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
@ -8,6 +8,6 @@ public class KOFForever : ModuleRules
|
||||
{
|
||||
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||
|
||||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "Paper2D" });
|
||||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "Paper2D", "UnrealEd" });
|
||||
}
|
||||
}
|
||||
|
14
KOFForever/Source/KOFForever/Private/Engine/KOFEdEngine.cpp
Normal file
14
KOFForever/Source/KOFForever/Private/Engine/KOFEdEngine.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
|
||||
#include "Engine/KOFEdEngine.h"
|
||||
|
||||
void UKOFEdEngine::Tick(float DeltaSeconds, bool bIdleMode)
|
||||
{
|
||||
Super::Tick(1.0f / 60.0f, bIdleMode);
|
||||
}
|
||||
|
||||
float UKOFEdEngine::GetMaxTickRate(float DeltaTime, bool bAllowFrameRateSmoothing) const
|
||||
{
|
||||
return 60.0f;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
|
||||
#include "Engine/KOFGameEngine.h"
|
||||
|
||||
void UKOFGameEngine::Tick(float DeltaSeconds, bool bIdleMode)
|
||||
{
|
||||
Super::Tick(1.0f / 60.0f, bIdleMode);
|
||||
}
|
||||
|
||||
float UKOFGameEngine::GetMaxTickRate(float DeltaTime, bool bAllowFrameRateSmoothing) const
|
||||
{
|
||||
return 60.0f;
|
||||
}
|
20
KOFForever/Source/KOFForever/Public/Engine/KOFEdEngine.h
Normal file
20
KOFForever/Source/KOFForever/Public/Engine/KOFEdEngine.h
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Editor/UnrealEdEngine.h"
|
||||
#include "KOFEdEngine.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class KOFFOREVER_API UKOFEdEngine : public UUnrealEdEngine
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
virtual void Tick(float DeltaSeconds, bool bIdleMode) override;
|
||||
|
||||
virtual float GetMaxTickRate(float DeltaTime, bool bAllowFrameRateSmoothing) const override;
|
||||
};
|
20
KOFForever/Source/KOFForever/Public/Engine/KOFGameEngine.h
Normal file
20
KOFForever/Source/KOFForever/Public/Engine/KOFGameEngine.h
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Engine/GameEngine.h"
|
||||
#include "KOFGameEngine.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class KOFFOREVER_API UKOFGameEngine : public UGameEngine
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
virtual void Tick(float DeltaSeconds, bool bIdleMode) override;
|
||||
|
||||
virtual float GetMaxTickRate(float DeltaTime, bool bAllowFrameRateSmoothing) const override;
|
||||
};
|
Loading…
Reference in New Issue
Block a user