Add graphical offset global settings.

This commit is contained in:
2023-02-10 17:36:19 +08:00
parent ff410529b0
commit bb4ecfcd8c
2 changed files with 15 additions and 1 deletions

View File

@@ -63,6 +63,7 @@ namespace Cryville.Crtr {
static double renderStep = 0.05;
public static double actualRenderStep = 0;
static bool autoRenderStep = false;
public static float graphicalOffset = 0;
public static float soundOffset = 0;
static float startOffset = 0;
public static float sv = 16f;
@@ -133,7 +134,7 @@ namespace Cryville.Crtr {
if (forceSyncFrames != 0) {
forceSyncFrames--;
double target = Game.AudioClient.Position - atime0;
dt = target - cbus.Time;
dt = target - cbus.Time - graphicalOffset;
step = autoRenderStep ? 1f / Application.targetFrameRate : renderStep;
inputProxy.SyncTime(target);
}
@@ -346,6 +347,7 @@ namespace Cryville.Crtr {
renderStep = Settings.Default.RenderStep;
actualRenderStep = renderStep;
autoRenderStep = renderStep == 0;
graphicalOffset = Settings.Default.GraphicalOffset;
soundOffset = Settings.Default.SoundOffset;
startOffset = Settings.Default.StartOffset;
forceSyncFrames= Settings.Default.ForceSyncFrames;

View File

@@ -61,6 +61,18 @@ namespace Cryville.Crtr {
}
}
[Category("gameplay")]
[Step(0.01f)]
[Precision(1e-3)]
public float GraphicalOffset {
get {
return PlayerPrefs.GetFloat("GraphicalOffset", 0);
}
set {
PlayerPrefs.SetFloat("GraphicalOffset", value);
}
}
[Browsable(false)]
public string LastRunVersion {
get {