Fixes ego never walking down the museum staircase due to differences
in our pathfinding algorithm.
I don't know if there is a general change to our algorithm that could
take care of this, but given that both points are within multiple
barred access polygons this might be something that just happened to
work in the original.
Either way, we're close to a release so I only want to address this
specific issue.
The pathfinding debugging code is using Sierra's buggy 8-bit matching
algorithm to find colors for drawing obstacles and path points in most
of the SCI 1.1 games. This usually results all colors being black.
Now we select the good 16-bit algorithm for internal use.
Fixes crash when kDebugLevelAvoidPath is enabled and kMergePoly merges
room obstacles, such in QFG1VGA after defeating a monster.
The debugging code that draws obstacles uses the polygon type as an
index to a color array and asserts that this value is between 0 and 3,
but that didn't take into account the 0x10 flag that kMergePoly sets.
Memory references and integers in SSCI are both 16-bit numbers,
so game scripts frequently (incorrectly) use an IntArray instead
of an IDArray for holding references. Since references in ScummVM
are 32-bit reg_ts, IntArray entries must be large enough to hold
reg_ts in order to be compatible with game scripts that store
references in integer arrays.
The alternative solution is to find and patch all incorrect use of
IntArray across all games. This is possible, but a bit risky from
a save game stability perspective, since incorrect IntArray usage
is sometimes not apparent until well after the array is
instantiated (like GK1's global interview array).
This change invalidates existing SCI32 save games.
This change invalidates earlier SCI32 save games, which separated
arrays and strings in an incompatible manner. Old save games
contain invalid references to a string segment which no longer
exists, and contain incompatible array structures that lack
critical type information.
This workaround has been added for now to stop the game from freezing.
A more correct solution would be to match our pathfinding algorithm
to what SSCI is doing, but with this workaround we can stop the more
immediate problem (game freezing) now.
No functionality change has been made with this commit. This avoids
setting and getting the reg_t members directly, and is the basis of any
future work on large SCI3 scripts (larger than 64KB)
This tries to make our code a bit more compliant with our code formatting
conventions. For future use, this is the command I used:
git ls-files "*.cpp" "*.h" | xargs sed -i -e 's/[ \t]*$//'
Added wrapper functions to read/write from dynmem segments, as these are
treated as BE in Amiga versions (as we treat them like raw data instead
of reg_t's), whereas the rest are LE. Thanks to waltervn and wjp for their
help on this
We now also fixup the start point when it's on the edge of an obstacle. If the
start point is also on the edge of the screen, the actor is now allowed to
walk through that obstacle to find his way to clear territory. This is based
on observation of SSCI behavior.
svn-id: r54230