fix endian issue for old savegames created on big endian system when trying to load them on little endian systems

svn-id: r4862
This commit is contained in:
Max Horn 2002-08-26 16:13:38 +00:00
parent bacdd936f2
commit 39422bd24a

View file

@ -96,8 +96,10 @@ bool Scumm::loadState(int slot, bool compat)
return false;
}
// In older versions of ScummVM, the header version was not endian safe.
// We account for that by retrying once with swapped byte order.
if (hdr.ver < VER_V7 || hdr.ver > _current_version)
hdr.ver = TO_LE_32(hdr.ver);
hdr.ver = SWAP_BYTES(hdr.ver);
if (hdr.ver < VER_V7 || hdr.ver > _current_version)
{
warning("Invalid version of '%s'", filename);