which in turn causes Broken Sword 2 to crash. And that change made it into
0.8.1, too. Augh! Kudos to wjp for tracking down the bug while I was still
waiting for ScummVM to finish compiling.
svn-id: r20358
files marked as being on both CDs (I haven't seen any such file -- ever),
treat it as if it's on the hard disk.
Also, the "cd" field of the ResourceFile struct now holds 0, 1 or 2, not
the bit flags from the data file. (This last change is not in the 0.8
branch.)
svn-id: r19884
(in one case) by not allocating file handles dynamically. While this isn't
really necessary at the moment, it makes it easier to find the real memory
leaks, if there are any.
svn-id: r19775
reported by Crilith.
To elaborate a bit, the engine no longer accesses resource data through
packed structs. Instead it uses memory streams and the READ/WRITE
functions.
If data is mainly read, not written, I have replaced the old struct with a
new one with a read() function to read the whole thing from memory into the
struct's variables, and a write() function to dump the struct's variables
to memory. In fact, most of these write() functions remain unused.
If data is both read and written, I have replaced the struct with a class
with individual get/set functions to replace the old variables. This
manipulates memory directly.
Since I'm fairly sure that these structs are frequently stored as local
variables for a script, all script variables (both local and global) are
stored as little-endian and accessed through the READ/WRITE functions,
rather than being treated as arrays of 32-bit integers.
On a positive note, the functions for doing endian conversion of resources
and save games have been removed, and some general cleanups have been made
to assist in the rewrite.
Initial reports indicate that this patch indeed fixes alignment issues, and
that I have not - surprisingly - broken the game on big-endian platforms.
At least not in any immediately obvious way. And there's still plenty of
time to fix regressions before 0.9.0, too.
svn-id: r19366
more or less serious bugs here:
* The fnResetGlobals() function returned IR_CONT. Since it potentially
kills its own script resource, this can lead to illegal read accesses.
Not it returns IR_STOP instead. This was probably a bug in the original
interpreter as well, but it handled memory allocation quite differently
so it was probably never an issue.
* Since fnResetGlobals() forcibly closes resources, I've changed the
closeResource() function to silently ignore requests to close resources
where the data pointer is NULL. While it could signify an error, it isn't
necessarily so.
* Don't force the screen to fade up after the credits -- let the script do
it instead. This prevents it from fading up the wrong image.
svn-id: r19127
that:
* Re-worked the elevator script bug workaround so that it's more consistent
with the other two script bug workarounds.
* Some renamings to make it more clear that game events and input events
are two completely different things.
* Added function for clearing pending input events, and used that to fix an
annoying keyboard repeat bug when closing the debug console. (The console
would keep re-opening because the key press to open it kept repeating
even though the key had been released.)
svn-id: r18522