mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Append allocation and generics fixes
This commit is contained in:
@@ -8,7 +8,7 @@ namespace GlitchyEngine
|
||||
*/
|
||||
public class GameTime
|
||||
{
|
||||
private Stopwatch _stopwatch;
|
||||
private append Stopwatch _stopwatch = .() ~ delete:append _;
|
||||
|
||||
private uint64 _frameCount;
|
||||
|
||||
@@ -31,22 +31,15 @@ namespace GlitchyEngine
|
||||
/// The interval in seconds from the last frame to the current one.
|
||||
public float DeltaTime => (float)_frameTime.TotalSeconds;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of a GameTime.
|
||||
*/
|
||||
[AllowAppend]
|
||||
public this() : this(false) {}
|
||||
|
||||
/**
|
||||
* Initializes a new instance of a GameTime.
|
||||
* @param startNow If set to true, the timer will start immediately.
|
||||
* If set to false, the timer has to be started manually.
|
||||
*/
|
||||
[AllowAppend]
|
||||
public this(bool startNow)
|
||||
public this(bool startNow = false)
|
||||
{
|
||||
let sw = append Stopwatch(startNow);
|
||||
_stopwatch = sw;
|
||||
_stopwatch.Restart();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user