diff options
author | Eugene Sandulenko | 2019-11-10 19:49:19 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2019-11-10 19:50:53 +0100 |
commit | 416ab05eaa0bec3939629d5716803ab207eed8b1 (patch) | |
tree | 42604115e5565f27ea5b476cebbf14b45e88f356 /engines/fullpipe | |
parent | 6cad53e5460066cff49fda1c7abd8a431607d478 (diff) | |
download | scummvm-rg350-416ab05eaa0bec3939629d5716803ab207eed8b1.tar.gz scummvm-rg350-416ab05eaa0bec3939629d5716803ab207eed8b1.tar.bz2 scummvm-rg350-416ab05eaa0bec3939629d5716803ab207eed8b1.zip |
FULLPIPE: Use more portable double loading
Diffstat (limited to 'engines/fullpipe')
-rw-r--r-- | engines/fullpipe/motion.cpp | 4 | ||||
-rw-r--r-- | engines/fullpipe/utils.cpp | 16 | ||||
-rw-r--r-- | engines/fullpipe/utils.h | 1 |
3 files changed, 2 insertions, 19 deletions
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index c667ac2aa5..67acaedffe 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -2871,8 +2871,8 @@ bool MovGraphLink::load(MfcArchive &file) { debugC(8, kDebugLoading, "GraphNode2"); _graphDst = file.readClass<MovGraphNode>(); - _length = file.readDouble(); - _angle = file.readDouble(); + _length = file.readDoubleLE(); + _angle = file.readDoubleLE(); debugC(8, kDebugLoading, "length: %g, angle: %g", _length, _angle); diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp index 3b60e962c6..aba629de83 100644 --- a/engines/fullpipe/utils.cpp +++ b/engines/fullpipe/utils.cpp @@ -246,22 +246,6 @@ int MfcArchive::readCount() { return count; } -double MfcArchive::readDouble() { - // FIXME: This is utterly cruel and unportable - // Some articles on the matter: - // http://randomascii.wordpress.com/2013/02/07/float-precision-revisited-nine-digit-float-portability/ - // http://randomascii.wordpress.com/2012/01/11/tricks-with-the-floating-point-format/ - - union { - byte b[8]; - double d; - } tmp; - - read(&tmp.b, 8); - - return tmp.d; -} - enum { kNullObject, kInteraction, diff --git a/engines/fullpipe/utils.h b/engines/fullpipe/utils.h index 6ffafc54bc..a4fae83231 100644 --- a/engines/fullpipe/utils.h +++ b/engines/fullpipe/utils.h @@ -56,7 +56,6 @@ public: Common::String readPascalString(bool twoByte = false); void writePascalString(const Common::String &str, bool twoByte = false); int readCount(); - double readDouble(); CObject *parseClass(bool *isCopyReturned); /** ownership of returned object is passed to caller */ |