mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-05 00:36:57 +00:00
FULLPIPE: Use more portable double loading
This commit is contained in:
parent
6cad53e546
commit
416ab05eaa
@ -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);
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user