diff options
author | Eugene Sandulenko | 2011-07-10 16:59:13 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2011-07-10 18:11:00 +0300 |
commit | 18cbb63cba75c41602bd54d7796d6e0f21e7fa61 (patch) | |
tree | 62abea84fe2e3ab0264ca0aa1af46946987e617b /engines/sword25/kernel/outputpersistenceblock.cpp | |
parent | 1c711da8fc2f8099e641cfbe0a726e2f5ff8e308 (diff) | |
download | scummvm-rg350-18cbb63cba75c41602bd54d7796d6e0f21e7fa61.tar.gz scummvm-rg350-18cbb63cba75c41602bd54d7796d6e0f21e7fa61.tar.bz2 scummvm-rg350-18cbb63cba75c41602bd54d7796d6e0f21e7fa61.zip |
SWORD25: Removed custom endianness code in persistence code
This is first step towards making saves portable. Binary footprint
left intact, so the saves are compatible.
Diffstat (limited to 'engines/sword25/kernel/outputpersistenceblock.cpp')
-rw-r--r-- | engines/sword25/kernel/outputpersistenceblock.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/engines/sword25/kernel/outputpersistenceblock.cpp b/engines/sword25/kernel/outputpersistenceblock.cpp index cf28ea401f..e29d956e5f 100644 --- a/engines/sword25/kernel/outputpersistenceblock.cpp +++ b/engines/sword25/kernel/outputpersistenceblock.cpp @@ -43,19 +43,23 @@ OutputPersistenceBlock::OutputPersistenceBlock() { void OutputPersistenceBlock::write(signed int value) { writeMarker(SINT_MARKER); - value = convertEndianessFromSystemToStorage(value); + value = TO_LE_32(value); rawWrite(&value, sizeof(value)); } void OutputPersistenceBlock::write(uint value) { writeMarker(UINT_MARKER); - value = convertEndianessFromSystemToStorage(value); + value = TO_LE_32(value); rawWrite(&value, sizeof(value)); } void OutputPersistenceBlock::write(float value) { writeMarker(FLOAT_MARKER); - value = convertEndianessFromSystemToStorage(value); + uint32 tmp[1]; + + ((float *)tmp)[0] = value; + tmp[0] = TO_LE_32(tmp[0]); + rawWrite(&value, sizeof(value)); } @@ -63,7 +67,7 @@ void OutputPersistenceBlock::write(bool value) { writeMarker(BOOL_MARKER); uint uintBool = value ? 1 : 0; - uintBool = convertEndianessFromSystemToStorage(uintBool); + uintBool = TO_LE_32(uintBool); rawWrite(&uintBool, sizeof(uintBool)); } |