diff options
author | Eugene Sandulenko | 2017-01-14 11:23:19 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2017-01-14 11:24:39 +0100 |
commit | 599184ab19e2ff6500c0c7fcbb314a5e7cd0e2b0 (patch) | |
tree | d517ddb849e231f3f777bde541f01592132d6698 /engines | |
parent | ce343f7168f52a7288611ee48126e1b31b548095 (diff) | |
download | scummvm-rg350-599184ab19e2ff6500c0c7fcbb314a5e7cd0e2b0.tar.gz scummvm-rg350-599184ab19e2ff6500c0c7fcbb314a5e7cd0e2b0.tar.bz2 scummvm-rg350-599184ab19e2ff6500c0c7fcbb314a5e7cd0e2b0.zip |
DIRECTOR: Lingo: More portable float reading
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/lingo/lingo-code.cpp | 2 | ||||
-rw-r--r-- | engines/director/lingo/lingo-codegen.cpp | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp index f55c6946b1..9d8509a145 100644 --- a/engines/director/lingo/lingo-code.cpp +++ b/engines/director/lingo/lingo-code.cpp @@ -209,7 +209,7 @@ void Lingo::c_voidpush() { void Lingo::c_fconstpush() { Datum d; inst i = (*g_lingo->_currentScript)[g_lingo->_pc]; - d.u.f = *((double *)&i); + d.u.i = READ_UINT32(&i); // d.u.f value will be read d.type = FLOAT; g_lingo->_pc += g_lingo->calcCodeAlignment(sizeof(double)); diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp index da5c8de35e..166bf7094f 100644 --- a/engines/director/lingo/lingo-codegen.cpp +++ b/engines/director/lingo/lingo-codegen.cpp @@ -101,10 +101,11 @@ Common::String Lingo::decodeInstruction(uint pc, uint *newPc) { } case 'f': { + Datum d; i = (*_currentScript)[pc++]; - double v = *((double *)&i); + d.u.i = READ_UINT32(&i); - res += Common::String::format(" %f", v); + res += Common::String::format(" %f", d.u.f); break; } case 'o': |