aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/util/lua_persist.cpp
diff options
context:
space:
mode:
authorRichieSams2014-12-30 18:28:14 -0600
committerRichieSams2014-12-30 18:28:14 -0600
commite4f74b6c346023608841d9f871b16069e5b54194 (patch)
treeb8bccbd7d31619f71b62364f29e1be1df1d8078b /engines/sword25/util/lua_persist.cpp
parent9a4d62e76a29647ed7f2c0b16f009ff143fdf739 (diff)
downloadscummvm-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/sword25/util/lua_persist.cpp')
-rw-r--r--engines/sword25/util/lua_persist.cpp18
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) {