Implement ROOM fades and character voices
This commit is contained in:
13
engine/Age.Engine/Model/LegacyScreenTransitionTiming.cs
Normal file
13
engine/Age.Engine/Model/LegacyScreenTransitionTiming.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace Age.Engine.Model;
|
||||
|
||||
/// <summary>Native timing conversion shared by the legacy op-0x25 screen-transition family.</summary>
|
||||
public static class LegacyScreenTransitionTiming
|
||||
{
|
||||
public static long DurationMilliseconds(long argument)
|
||||
{
|
||||
long interval = argument <= 64 ? argument : argument / 16;
|
||||
long step = argument <= 64 ? 16 : 1;
|
||||
interval = System.Math.Max(1, interval);
|
||||
return System.Math.Clamp(((256 + step - 1) / step) * interval, 1, 60_000);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user