4
4
using FEZUG ;
5
5
using FEZUG . Features ;
6
6
using Microsoft . Xna . Framework ;
7
+ using System ;
8
+ using System . Diagnostics ;
7
9
8
10
namespace FezGame
9
11
{
10
12
public class patch_Fez : Fez
11
13
{
14
+ private double timescaledGameTime ;
15
+ private double timescaledElapsedTime ;
16
+
12
17
public Fezug Fezug ;
13
18
14
19
protected extern void orig_Initialize ( ) ;
@@ -21,6 +26,33 @@ protected override void Initialize()
21
26
ServiceHelper . AddComponent ( Fezug = new Fezug ( this ) ) ;
22
27
ServiceHelper . AddComponent ( Fezug . Rendering ) ;
23
28
Logger . Log ( "FEZUG" , "FEZUG initialized!" ) ;
29
+
30
+ timescaledGameTime = 0.0f ;
31
+ }
32
+
33
+ protected extern void orig_Update ( GameTime gameTime ) ;
34
+ protected override void Update ( GameTime gameTime )
35
+ {
36
+ if ( gameTime . TotalGameTime . Ticks == 0 )
37
+ {
38
+ timescaledGameTime = 0.0f ;
39
+ }
40
+ timescaledElapsedTime = gameTime . ElapsedGameTime . TotalSeconds * Timescaler . Timescale ;
41
+ timescaledGameTime += timescaledElapsedTime ;
42
+
43
+ orig_Update ( new GameTime (
44
+ TimeSpan . FromSeconds ( timescaledGameTime ) ,
45
+ TimeSpan . FromSeconds ( timescaledElapsedTime )
46
+ ) ) ;
47
+ }
48
+
49
+ protected extern void orig_Draw ( GameTime gameTime ) ;
50
+ protected override void Draw ( GameTime gameTime )
51
+ {
52
+ orig_Draw ( new GameTime (
53
+ TimeSpan . FromSeconds ( timescaledGameTime ) ,
54
+ TimeSpan . FromSeconds ( timescaledElapsedTime )
55
+ ) ) ;
24
56
}
25
57
}
26
58
}
0 commit comments