Commit Graph

376 Commits

Author SHA1 Message Date
Torbjörn Andersson
4420b15d9f Mostly cleanups, but I believe this also fixes an endian problem in the
"restart script" opcode. To actually verify this, though, I'd need to find
a case where any other script than script 0 at offset 0 is restarted...

svn-id: r11638
2003-12-14 16:33:27 +00:00
Torbjörn Andersson
ce04dd9f7e Fixed a potential crash bug where an audio buffer would be freed at the end
of an animated cutscene while the mixer was still using it. Oddly enough, I
didn't encounter this bug when I played through the game recently, but
today it happened every time at the end of the cutscene where Nico finds
the jaguar stone.

svn-id: r11637
2003-12-14 16:32:21 +00:00
Max Horn
35b62c294d removed GameSettings::detectname and GameSettings::midi; renamed GameSettings::gameName to name; added temporary experimental MD5 hack
svn-id: r11603
2003-12-13 00:20:01 +00:00
Torbjörn Andersson
9f465dab04 cleanup
svn-id: r11581
2003-12-11 13:08:36 +00:00
Torbjörn Andersson
7153d77024 Restored some relevant information to a comment that was removed by my
previous commit.

svn-id: r11551
2003-12-10 13:14:50 +00:00
Torbjörn Andersson
a2221c88e9 Sprite surfaces (as opposed to standard sprites) are always display
aligned, never flipped and never RLE16-compressed. Simplified the code
accordingly. (Displaying the restore dialog when specifying an unused save
slot from the command-line works again now.)

Plus some minor cleanups.

svn-id: r11550
2003-12-10 08:01:58 +00:00
Torbjörn Andersson
f89739b8f3 Cleaned up keyboard handling. The old code would misinterpret some keys,
e.g. it's 'C' or 'c' to display the credits, not some random function key.

svn-id: r11549
2003-12-10 07:59:45 +00:00
Torbjörn Andersson
7d8839ab52 I've played through the whole game, and I've scanned through the cluster
files with a primitive and incomplete tool to present resource information.
(It may evolve into something useful and/or presentable later. Much later.)

I've found no evidence whatsoever that the mysterious blend & 0x02 case is
ever used. Since the code makes no sense to me, I've removed it.

svn-id: r11538
2003-12-09 08:09:18 +00:00
Torbjörn Andersson
5c539040e4 Shut up Valgrind warnings.
svn-id: r11528
2003-12-08 07:30:22 +00:00
Travis Howell
d78ccc55a4 Change Broken Sword 2 default to no subtitles
To match original version and other games.

svn-id: r11479
2003-12-03 01:04:54 +00:00
Torbjörn Andersson
6d3c760ffd Since all other engines have been changed to use "subtitles" instead of
"nosubtitles", let's change this one as well. Of course, it does break
compatibility with old config files, but I guess the worst that can happen
is that we have an unused "nosubtitles" line in addition to the used
"subtitles" line...

svn-id: r11464
2003-12-02 10:25:12 +00:00
Torbjörn Andersson
af02beefd9 cleanup
svn-id: r11457
2003-12-02 07:41:04 +00:00
Torbjörn Andersson
b0037e29e2 Removed semi-colon after REGISTER_PLUGIN() to be consistent with the other
game engines.

svn-id: r11447
2003-12-01 10:24:02 +00:00
Torbjörn Andersson
7c9d46765b Removed some unnecessary / commented out code, and initialized the debug
console a bit earlier so that error messages about missing files will be
more obvious to the user. (If an error happens that early, some of the
debugger commands will cause ScummVM to crash. I might look into that
later.)

svn-id: r11443
2003-12-01 07:47:54 +00:00
Torbjörn Andersson
67c75a35c6 Clarified comment about the elevator script bug and added a workaround for
the dreaded Pyramid Bug.

svn-id: r11427
2003-11-29 17:05:30 +00:00
Torbjörn Andersson
9fdaf04a21 Some formatting changes, and a few debug message corrections.
svn-id: r11384
2003-11-28 07:55:25 +00:00
Torbjörn Andersson
6f23e2c211 Mostly whitespace changes, but also a few modifications to the still
experimental resource dumping code.

svn-id: r11382
2003-11-27 07:34:19 +00:00
Torbjörn Andersson
3f115ba95d Removed some spurious semi-colons pointed out in patch #847464
svn-id: r11366
2003-11-25 17:08:46 +00:00
Torbjörn Andersson
5c14fb3597 Removed extra bars/node stuff since it was never used. From what I
understand the idea was to allow moving objects to take up space in the
scene, thus forcing actors to move around them, or something like that.

However, the number of extra bars/nodes was always zero.

svn-id: r11365
2003-11-25 15:18:47 +00:00
Torbjörn Andersson
5eb38cb380 cleanup
svn-id: r11364
2003-11-25 09:05:10 +00:00
Torbjörn Andersson
a1e80765f5 More cleanup. Another unused file bites the dust.
svn-id: r11363
2003-11-25 07:35:52 +00:00
Torbjörn Andersson
1fc58a5ca0 Removed redundant information from the opcode list. I thought having the
number of parameters to a function would be useful for debugging, but that
information is already available in the script data itself.

svn-id: r11360
2003-11-24 07:34:07 +00:00
Torbjörn Andersson
509235e176 Added experimental (i.e. not tested) resource dumping code.
Added tentative workaround for the bug (a script bug, I think) that causes
the game to hang when examining the lift at the top of the pyramid.

And, of course, some misc. cleanup.

svn-id: r11359
2003-11-23 13:40:24 +00:00
Torbjörn Andersson
083c328077 Eliminated some more references to g_sword2. I think the only thing that
still uses it are the engine's global variables which, on the other hand,
are used *everywhere*.

I'll have to think some more about those. I guess I should take a closer
look at how the other engines handle them. (That goes for a lot of things
by the way.)

svn-id: r11349
2003-11-19 18:40:53 +00:00
Torbjörn Andersson
022facfbce Removed unused file.
svn-id: r11343
2003-11-18 08:29:01 +00:00
Torbjörn Andersson
50be85ac42 The readFile() function was only used once, for creating the debugger start
menu, and wasn't even necessary there so I've removed it. That means the
tony_gsdk.cpp file is no longer necessary. Sorry Tony, but at least you
still have your own debugger command! ;-)

svn-id: r11342
2003-11-18 08:17:36 +00:00
Max Horn
b5d3add003 fix compilation on big endian systems
svn-id: r11318
2003-11-16 23:35:00 +00:00
Torbjörn Andersson
fa2b8ba8de More cleanup. I've eliminated all the temporary global variables I've added
over the past few weeks, except for g_sword2. (Of course, this doesn't
necessarily make the code any prettier, but we can work on that later.)

svn-id: r11309
2003-11-16 14:18:29 +00:00
Torbjörn Andersson
aaa5631a99 Mostly cleanup. Also prevented what would probably have been an infinite
loop if ScummVM failed to find a file in the demo. (Now it should error out
instead, which is marginally preferable.)

svn-id: r11298
2003-11-15 09:38:00 +00:00
Torbjörn Andersson
30670deb2c cleanup
svn-id: r11290
2003-11-14 07:41:22 +00:00
Torbjörn Andersson
66d9b4315a Re-enabled the CD swapping code, after rewriting it a bit.
If a cluster file isn't found the resource manager will first check if it's
one of the files that it expects to find on the hard disk. If so, it's
considered a fatal error.

Otherwise it will present the user with an "Insert CD1" or "Insert CD2"
message, just like the original did. Unlike the original, the user will
have to press a button or click the mouse to indicate when he's done. I
don't know if we even can detect the CD automatically in any portable way.

As far as I can see, we'll need at least two separate path settings for
this to actually work: one for the HD install directory, and one or two for
the CDs. The file that are supposed to be found on the HD are only on one
of the CDs, so the amount of CD swapping would probably be unbearable
otherwise.

As a consequence, I haven't actually tried running the game from CD yet.

By the way, the old caching code has been removed completely now. All it
did was to copy the cluster file to HD for faster access. ScummVM never did
that, but so far no one has complained.

svn-id: r11273
2003-11-13 07:59:52 +00:00
Torbjörn Andersson
beed02807f cleanup
svn-id: r11266
2003-11-12 08:21:18 +00:00
Torbjörn Andersson
c16d20c72f Slight refinement to the last patch. There are four different possibilities
for which CD to look for: 0 (both CDs - not used?), 1, 2 and 3 (not used?)

svn-id: r11263
2003-11-11 15:16:41 +00:00
Torbjörn Andersson
ce619b254e Extended the "res" debugger command to print information about where the
game expects to find the various cluster files. I plan to look into making
the game playable from CD, and this should help during the testing.

svn-id: r11262
2003-11-11 15:07:35 +00:00
Torbjörn Andersson
1f53624d88 Removed SVM_timeGetTime(). We may as well call get_msecs() directly.
svn-id: r11260
2003-11-11 10:30:25 +00:00
Torbjörn Andersson
70bc5d15ec Removed redundant header files.
svn-id: r11259
2003-11-11 07:47:22 +00:00
Torbjörn Andersson
446a01ba09 Moved low-level keyboard and mouse handling to a new Input class, and
renamed the Display class Graphics for no better reason than me liking the
phrase "sound and graphics" better than "sound and display".

svn-id: r11258
2003-11-11 07:43:02 +00:00
Torbjörn Andersson
3d012651fd The script engine frequently needs to pass pointers to various structures
etc. to the different opcodes. Until now it has done so by casting the
pointer to an int32 (opcode parameters are represented as arrays of int32)
and then the opcode function casts it back to whatever pointer it needs.

At least in C there is no guarantee that a pointer can be represented as an
integer type (though apparently C99 may define such a type), so this has
struck me as unsafe ever since I first noticed it.

However, since all such pointers appear to point to the memory block owned
by the memory manager, we can easily convert them to integers by treating
them as offsets into the memory block. So that's what I have done. I hope I
caught all the occurences in the opcode functions, or we're going to have
some pretty interesting regressions on our hands...

svn-id: r11241
2003-11-10 07:52:15 +00:00
Max Horn
e34f2b8b33 cut down on unnecessary GameDetector references
svn-id: r11239
2003-11-10 01:04:12 +00:00
Paweł Kołodziejski
409108df82 cleanup whitespaces
svn-id: r11212
2003-11-08 19:47:20 +00:00
Torbjörn Andersson
980ad7daba This one can go as well
svn-id: r11210
2003-11-08 18:41:44 +00:00
Torbjörn Andersson
9106229bef Removed some now redundant header files.
svn-id: r11209
2003-11-08 18:15:35 +00:00
Torbjörn Andersson
688c80b062 Moved more stuff into classes, changed some static allocation to dynamic,
and removed some of the references to global variables.

At this point I believe everything in the main game engine has been moved
into classes - not necessarily the correct ones, but still... However,
there is some stuff in the driver directory that need to be taken care of
as well.

svn-id: r11207
2003-11-08 15:47:51 +00:00
Jonathan Gray
f6e1915b77 missed one
svn-id: r11177
2003-11-07 02:14:56 +00:00
Jonathan Gray
9a1cfe838f spelling fixes
svn-id: r11175
2003-11-07 01:36:53 +00:00
Max Horn
8ad1ec4453 setup opcode table *before* using it to avoid crashes :-)
svn-id: r11156
2003-11-05 20:42:33 +00:00
Torbjörn Andersson
ba098a3a5b Create g_logic dynamically. More moving of stuff into classes.
svn-id: r11129
2003-11-04 18:02:49 +00:00
Torbjörn Andersson
64ec1907c2 More moving of stuff into classes.
svn-id: r11128
2003-11-04 17:26:59 +00:00
Max Horn
6e60d7b827 fix compile error
svn-id: r11107
2003-11-03 17:46:55 +00:00
Torbjörn Andersson
b3b0118292 The resource and memory managers are now created dynamically.
Renamed the resource manager's open/close methods openResource() and
closeResource() to avoid confusion. (It was I who originally shortened
their names to open() and close(), but I've changed my mind now.)

Moved more stuff into Sword2Engine.

svn-id: r11088
2003-11-03 07:47:42 +00:00