summaryrefslogtreecommitdiffhomepage
path: root/Stars45/StarSystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Stars45/StarSystem.cpp')
-rw-r--r--Stars45/StarSystem.cpp35
1 files changed, 7 insertions, 28 deletions
diff --git a/Stars45/StarSystem.cpp b/Stars45/StarSystem.cpp
index 8daed31..3c91f99 100644
--- a/Stars45/StarSystem.cpp
+++ b/Stars45/StarSystem.cpp
@@ -54,34 +54,17 @@
#include "Scene.h"
#include "ParseUtil.h"
-const double epoch = 0.5e9;
-double StarSystem::stardate = 0;
+const long double epoch = 0.5e9;
+long double StarSystem::stardate = 0;
// +====================================================================+
-static double base_time = 0;
+static long double base_time = 0;
static WORD oldcw = 0;
static WORD fpcw = 0;
-void FPU2Extended()
+void StarSystem::SetBaseTime(long double t, bool absolute)
{
- _asm { fstcw oldcw }
- fpcw = oldcw | 0x0300; // set 80-bit precision mode
- _asm { fldcw fpcw }
-}
-
-void FPURestore()
-{
- // well, I don't actually WANT single-precision mode
- // so I think I'll just ignore this...
-
- //_asm { fldcw oldcw }
-}
-
-void StarSystem::SetBaseTime(double t, bool absolute)
-{
- FPU2Extended();
-
if (absolute) {
base_time = t;
CalcStardate();
@@ -94,7 +77,7 @@ void StarSystem::SetBaseTime(double t, bool absolute)
}
}
-double StarSystem::GetBaseTime()
+long double StarSystem::GetBaseTime()
{
return base_time;
}
@@ -111,14 +94,10 @@ void StarSystem::CalcStardate()
base_time += epoch;
}
- FPU2Extended();
-
- double gtime = (double) Game::GameTime() / 1000.0;
- double sdate = gtime + base_time + epoch;
+ long double gtime = (long double) Game::GameTime() / 1000.0;
+ long double sdate = gtime + base_time + epoch;
stardate = sdate;
-
- FPURestore();
}
static const double GRAV = 6.673e-11;