diff options
author | RichieSams | 2014-12-30 18:28:14 -0600 |
---|---|---|
committer | RichieSams | 2014-12-30 18:28:14 -0600 |
commit | e4f74b6c346023608841d9f871b16069e5b54194 (patch) | |
tree | b8bccbd7d31619f71b62364f29e1be1df1d8078b /engines | |
parent | 9a4d62e76a29647ed7f2c0b16f009ff143fdf739 (diff) | |
download | scummvm-rg350-e4f74b6c346023608841d9f871b16069e5b54194.tar.gz scummvm-rg350-e4f74b6c346023608841d9f871b16069e5b54194.tar.bz2 scummvm-rg350-e4f74b6c346023608841d9f871b16069e5b54194.zip |
SWORD25: Remove the option to persist a double as a string
Since the current method *should* be more accurate
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sword25/util/lua_persist.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/engines/sword25/util/lua_persist.cpp b/engines/sword25/util/lua_persist.cpp index 6038111bbc..6fe88fe9a3 100644 --- a/engines/sword25/util/lua_persist.cpp +++ b/engines/sword25/util/lua_persist.cpp @@ -281,21 +281,11 @@ static void persistBoolean(SerializationInfo *info) { static void persistNumber(SerializationInfo *info) { lua_Number value = lua_tonumber(info->luaState, -1); - #if 1 - Util::SerializedDouble serializedValue(Util::encodeDouble(value)); - - info->writeStream->writeUint32LE(serializedValue.significandOne); - info->writeStream->writeUint32LE(serializedValue.signAndSignificandTwo); - info->writeStream->writeSint16LE(serializedValue.exponent); - #else - // NOTE: We need to store a double. Unfortunately, we have to accommodate endianness. - // Also, I don't know if we can assume all compilers use IEEE double - // Therefore, I have chosen to store the double as a string. - Common::String buffer = Common::String::format("%f", value); - - info->writeStream->write(buffer.c_str(), buffer.size()); - #endif + Util::SerializedDouble serializedValue(Util::encodeDouble(value)); + info->writeStream->writeUint32LE(serializedValue.significandOne); + info->writeStream->writeUint32LE(serializedValue.signAndSignificandTwo); + info->writeStream->writeSint16LE(serializedValue.exponent); } static void persistString(SerializationInfo *info) { |