Commit Graph

542 Commits

Author SHA1 Message Date
Torbjörn Andersson
15738c13d3 I wanted to Valgrind the cutscene code, so I had to fix the warnings about
uninitialized values. Now the only warnings I got were from libmpeg2
itself, and I don't know how serious that is.

I've also added some code - disabled by default - to allow the cutscenes to
run with libmpeg 0.3.1, since that's what I've got on my Linux box. It
appears to work on that one, though I only have the "eye" cutscene on it
yet.

Ogg Vorbis playback is still broken for me under Windows, though. I wonder
if it is because I don't have the very latest Ogg Vorbis libraries on it
(since I didn't manage to compile them under MinGW). But surely the file
format hasn't changed in any important way...?

svn-id: r12374
2004-01-14 08:14:25 +00:00
Torbjörn Andersson
b17d77eae9 Changed the music fading so that volume is increased when ABS(_fading)
grows larger, both when fading up or down. This fixes the problem where the
volume would "jump" when changing the fading "direction" of a stream.

Also changed the logic for deciding which music stream to stop if both
streams are playing and a third stream is started. Before it always tried
to pick the one that was fading down. Now it will pick the one with the
lowest volume, assuming that the more faded a stream is the lower its
volume.

Together, this should fix some abrupt music changes at the watchman's hut,
where it would sometimes start two music streams in rapid succession.

svn-id: r12372
2004-01-14 08:06:56 +00:00
Max Horn
c39aa04c31 cut down pointless header interdependencies
svn-id: r12360
2004-01-13 14:22:29 +00:00
Max Horn
34960cf375 Moved some methods into class AnimationState (where they really belong - nicely shown by the fact that now all member vars of AnimationState are private)
svn-id: r12359
2004-01-13 14:16:40 +00:00
Torbjörn Andersson
dca14d9532 Some more formatting cleanups. Made the Ogg file handle part of the
animation state so that it can be deleted in doneAnimation().

svn-id: r12358
2004-01-13 13:12:40 +00:00
Torbjörn Andersson
13481b82c4 As an experiment, I've added a delay of 0 milliseconds when drawing
interpolation frames. It shouldn't delay anything, but I'm hoping it will
allow the other threads some breathing room, which might help bug #875683.

Or not. We'll see.

svn-id: r12357
2004-01-13 10:27:13 +00:00
Torbjörn Andersson
8a66ba33cf Moved the rest of the MoviePlayer class into animation.cpp/.h, plus some
minor cleanups. (Mostly spacing and indentation).

Unfortunately the Ogg Vorbis playback causes ScummVM to crash for me, so I
can't say for certain that I didn't break anything.

svn-id: r12356
2004-01-13 10:09:53 +00:00
Max Horn
b04dac03f2 added legal header; fixed incorrect fscanf use; C++ification (the code still is quite Cish, though :-)
svn-id: r12351
2004-01-13 01:26:18 +00:00
Travis Howell
9471d58720 Add mpeg2 option to mingw makefile
Fix compile on mingw

svn-id: r12350
2004-01-12 23:41:05 +00:00
Oliver Kiehl
d794488645 fixed bug that was causing lots of havoc on BE machines. Thanks eriktorbjorn
svn-id: r12348
2004-01-12 20:04:22 +00:00
Paweł Kołodziejski
b8e3dda84c - whitespaces
- fix for compilation at MAX, at include types
- changed to our types

svn-id: r12344
2004-01-12 19:08:04 +00:00
Torbjörn Andersson
cc67c13711 Don't hog the CPU when playing cutscenes.
svn-id: r12342
2004-01-12 16:36:01 +00:00
James Brown
a685422a13 Initial libmpeg2 cutscene support based on patch #874510.
Pre-converted cutscenes w/ palette files available - ask LeChuck about Cutscenes :)

svn-id: r12338
2004-01-12 11:11:19 +00:00
Torbjörn Andersson
c75f5efd2f Sync the credits so that the text scroll and music will last for about the
same amount of time. I don't think the original did this, but it turned out
to be pretty easy.

svn-id: r12334
2004-01-12 08:01:25 +00:00
Torbjörn Andersson
7309705db5 cleanup
svn-id: r12322
2004-01-11 16:53:33 +00:00
Torbjörn Andersson
a7fe335c82 I forgot this in the previous cleanup.
svn-id: r12311
2004-01-10 21:56:59 +00:00
Torbjörn Andersson
1db3b65825 cleanup
svn-id: r12309
2004-01-10 21:21:20 +00:00
Torbjörn Andersson
06caf87bdc Removed redundant comment.
svn-id: r12282
2004-01-09 15:58:21 +00:00
Torbjörn Andersson
b9c3b7b008 Removed redundant comments.
svn-id: r12279
2004-01-09 14:52:39 +00:00
Torbjörn Andersson
638231cc59 Make it possible to quit while showing in-game dialogs. (Regression fix.)
svn-id: r12273
2004-01-09 07:54:16 +00:00
Torbjörn Andersson
58c46a2b92 Fix a harmless clipping bug (block surfaces were drawn even when their
width or height was 0), and use consistent naming for clip rect parameters.

svn-id: r12272
2004-01-09 07:53:08 +00:00
Torbjörn Andersson
12cd552cab Allow quitting during cutscenes and credits again. This is getting a bit
hackish...

svn-id: r12247
2004-01-08 13:03:50 +00:00
Torbjörn Andersson
6d0dd6aee8 Valgrind fixes. Mostly about memory not being freed when the engine is
deleted.

svn-id: r12211
2004-01-07 07:42:00 +00:00
Torbjörn Andersson
60b59de181 Never call _system->quit() directly. Let ScummVM handle that so that the
engine can be properly deleted first. Apart from being the nice thing to
do, this should make it easier to Valgrind for memory leaks.

svn-id: r12184
2004-01-06 16:49:04 +00:00
Torbjörn Andersson
065f2bb9eb It's a new year in BS2 land, too!
svn-id: r12181
2004-01-06 13:44:17 +00:00
Torbjörn Andersson
eb5c4a1449 Made sure the screen is really cleared when drawing a dialog window, plus
some other cleanups. (This was a regression caused by the less stupid
screen updates implemented recently.)

svn-id: r12180
2004-01-06 13:33:28 +00:00
Torbjörn Andersson
6a7cf6d6cf Marked some more structs as packed. I don't know if it makes any
difference, as they contain only 32-bit integers, but I also believe it
does no harm.

svn-id: r12159
2004-01-05 14:46:12 +00:00
Torbjörn Andersson
8dabcaaef1 Changed some memmove()s to memcpy(), since the memory areas were not
overlapping.

Enabled some sanity-checking code.

Fixed clearWalkGridList() so that it clears the entire walk grid list. That
was a really stupid bug of mine, and I hope it had at least some bearing on
the rare (for me, at least) walk problems I've seen.

svn-id: r12154
2004-01-05 11:09:33 +00:00
Torbjörn Andersson
55167e392e Tiny cleanup.
svn-id: r12153
2004-01-05 11:02:00 +00:00
Torbjörn Andersson
9ea89568da Fixed some debugging messages so they refer to the correct function.
svn-id: r12152
2004-01-05 11:01:12 +00:00
Torbjörn Andersson
5f9cfba548 Slowed down the credits slightly. With the recent optimizations, the music
lasted longer than the text. Now the text lasts longer than the music.

svn-id: r12151
2004-01-05 11:00:12 +00:00
Torbjörn Andersson
8a91ae3257 Adapted LavosSpawn's idea for more efficient screen updating. It still
renders the entire screen every frame, but it tries to update (i.e. copy to
the backend) only the parts of the screen that actually changed. At least
approximately so.

svn-id: r12142
2004-01-04 15:11:30 +00:00
Torbjörn Andersson
5607f41e2d Some cleanup and Valgrind warning fixes.
svn-id: r12141
2004-01-04 15:05:54 +00:00
Torbjörn Andersson
14acddb167 Update a comment to reflect that some functions have different names now.
svn-id: r12140
2004-01-04 14:59:36 +00:00
Max Horn
d1e6c6059e renamed global var _debugLevel to g_debugLevel; let Engine constructor init it (this way all engines get it for free, allows further cleanup); removed some useless/duplicate member vars in SwordEngine
svn-id: r12134
2004-01-04 14:00:58 +00:00
Max Horn
cf6a5c0a04 cleanup
svn-id: r12116
2004-01-03 19:12:23 +00:00
Max Horn
ee3558b748 fix for BE systems
svn-id: r12115
2004-01-03 19:02:18 +00:00
Torbjörn Andersson
c1cddedca8 Fixed bug that made ScummVM crash when loading a savegame where the main
character was walking. (I had missed a case where pointers were cast to
integers.)

svn-id: r12113
2004-01-03 15:52:05 +00:00
Torbjörn Andersson
fa523f7f7e It was pointed out to me that we can't use the DEMO variable here, because
the missing file may be the one with the resource for the global variables.

svn-id: r12112
2004-01-03 14:49:52 +00:00
Max Horn
bfea71b0c4 renamed AudioInputStream -> AudioStream
svn-id: r12110
2004-01-03 14:10:13 +00:00
Torbjörn Andersson
bb8ff0cd90 Made the music code more like the one in BS1, i.e. the fade time is longer
and it now fades both up and down.

Plenty of cleanups, simplifications and just moving code around to group it
in what I hope is a more logical fashion.

Fixed a long-standing bug where spot effects would eventually use up all
available sound effect handles. (I may have introduced this when I removed
the expiration of sound effects from FxServer().)

svn-id: r12108
2004-01-03 11:24:39 +00:00
Torbjörn Andersson
033a847e77 Oops, that was the wrong data type. (Not that it should matter, but...)
svn-id: r12069
2004-01-01 15:15:47 +00:00
Torbjörn Andersson
0d327b3b79 Some tweaking of the new credits code. It is no longer necessary to have
to have the credits.bmp file, though if you don't you won't see the
"Smacker" logo. (Whether or not this is a feature is open to debate.)

Happy New Year!

svn-id: r12062
2003-12-31 23:32:40 +00:00
Torbjörn Andersson
2687402c6b oops, forgot one case
svn-id: r12056
2003-12-31 14:10:42 +00:00
Torbjörn Andersson
c85301b2a9 When saving the music state, remember the name of the music file that was
open so that it can be re-opened afterwards. It's not so much that it may
have changed, but it may have been closed.

This should fix a crash when escaping the credits.

svn-id: r12055
2003-12-31 14:05:53 +00:00
Torbjörn Andersson
6899aa23cb I still don't know how to draw the credits like the original did, but at
least the credits text is showing now.

svn-id: r12053
2003-12-31 13:14:07 +00:00
Torbjörn Andersson
28eb8c4b76 Don't allow the credits to be displayed while in conversation mode.
svn-id: r12052
2003-12-31 12:58:18 +00:00
Torbjörn Andersson
bfd457d913 Enable the line that increases _gameCycle. There's a debugger command that
will display it, and it's so much more interesting this way. :-)

svn-id: r12051
2003-12-31 12:54:41 +00:00
Torbjörn Andersson
40419b1aee tiny cleanup
svn-id: r12017
2003-12-29 17:26:56 +00:00
Torbjörn Andersson
ea39ef6d7d The game sets its own DEMO variable, so we might as well check that one as
checking the GF_DEMO flag. (There's still one "unnecessary" reference to
GF_DEMO in functions.cpp, but I plan on rewriting that function soon so I
don't want to touch it right now.)

svn-id: r12009
2003-12-29 15:30:10 +00:00
Torbjörn Andersson
6ae8218d53 Hopefully the last big renaming. Now the datatypes have names like
"StandardHeader" instead of "_standardHeader".

svn-id: r11997
2003-12-28 15:08:12 +00:00
Max Horn
859a9c0129 o Added SoundMixer::isReady()
o Removed SoundMixer::bindToSystem()
o In scumm, replaced _silentMixer, _silentDigitalImuse and _noDigitalSamples by SoundMixer::isReady()

svn-id: r11893
2003-12-24 17:42:22 +00:00
Max Horn
e9269257f3 turned PlayingSoundHandle into an 'opaque' (well not really :-) data type, mainly because people kept (accidentally and sometimes on purpose :-) misusing them
svn-id: r11881
2003-12-24 00:25:18 +00:00
Max Horn
f19f73eb50 Make it possible for game detection functions to detect language/platform (not yet done by any detector, but will come with the MD5 detection code)
svn-id: r11811
2003-12-21 15:29:52 +00:00
Nicolas Bacca
9e1dda1f68 Make VC6/EVC happier
svn-id: r11764
2003-12-20 01:17:02 +00:00
Torbjörn Andersson
c2c250edc1 Fixed bug with looping music. It must have been there all along, but maybe
the recent mixer changes made it more audible. Or maybe I just didn't
listen until now.

svn-id: r11763
2003-12-19 17:07:37 +00:00
Torbjörn Andersson
dc0c7bf845 Implemented scroll wheel handling for save/load dialogs. (This turned up a
few other hitherto harmless bugs, which I've hopefully managed to fix.)

svn-id: r11762
2003-12-19 16:50:03 +00:00
Max Horn
d8903123b0 distinguish between end of stream and end of data
svn-id: r11756
2003-12-19 01:30:19 +00:00
Max Horn
0cddca5f43 unregister the premix proc when you go away
svn-id: r11755
2003-12-19 01:08:30 +00:00
Max Horn
97ee61963c I am going to remove the default implementation of readBuffer() (AudioInputStream subclasses really really should implement readBuffer() for good performance)
svn-id: r11753
2003-12-19 00:27:09 +00:00
Torbjörn Andersson
9a1bbb361b My last commit didn't work on big-endian. Maybe this one does...
svn-id: r11711
2003-12-17 11:52:05 +00:00
Torbjörn Andersson
a739f3ae3b The mixer handles little-endian samples now. Take advantage of that.
svn-id: r11707
2003-12-17 11:07:40 +00:00
Paweł Kołodziejski
7f03b140d4 fixed warning
svn-id: r11705
2003-12-17 08:36:09 +00:00
Torbjörn Andersson
8b12be81e5 cleanup
svn-id: r11704
2003-12-17 08:01:59 +00:00
Max Horn
e7bf167428 Made sure that *all* AudioInputStream 'know' their sample rate; removed pointless MusicStream class; removed various specific Channel subclasses and instead generalized the base class some more
svn-id: r11699
2003-12-17 02:19:24 +00:00
Torbjörn Andersson
4e736a6602 Tiny whitespace change. (No, as a matter of fact I don't have anything
better to do. :-)

svn-id: r11649
2003-12-15 07:31:22 +00:00
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
Paweł Kołodziejski
99447628ac fixed warning
svn-id: r11069
2003-11-02 22:38:04 +00:00
Torbjörn Andersson
7ec257ae3f Even more stuff moving into Sword2Engine. I'm tempted to make a new class
for the mouse stuff, but I need to think about that a bit more. I have a
feeling the code could be cleaned up a bit anyway...

svn-id: r11060
2003-11-02 18:50:09 +00:00
Torbjörn Andersson
2adc147600 Moved some more "homeless" functions into Sword2Engine. (Don't worry -- I
promise I will get rid of g_sword2 later.)

svn-id: r11057
2003-11-02 17:17:10 +00:00
Torbjörn Andersson
db9b8070f6 More moving of stuff into classes. I had to make a few changes/cleanups to
events.cpp, so there could be regressions.

svn-id: r11053
2003-11-02 15:58:45 +00:00
Paweł Kołodziejski
9588a6fd31 fixed warnings
svn-id: r11046
2003-11-02 10:12:08 +00:00
Max Horn
b27a871f87 turned NewGui into a singleton, and made OSystem a pseudo-singleton; added Widget::findWidget (preparing to add support for nested widgets, for the tab widget)
svn-id: r11045
2003-11-02 02:18:16 +00:00
Torbjörn Andersson
ae9fe77479 Instead of having a function that reverses the panning table, we now have a
function that creates the panning table. The difference is that you now
have to tell whether you want one for normal or reverse stereo, so you are
not dependent on the previous state of the table.

(I still think it may be possible to get rid of the panning table
completely, but that's for later cleanups.)

svn-id: r11027
2003-11-01 18:12:04 +00:00
Torbjörn Andersson
0435658b96 Create the gui object dynamically
svn-id: r11026
2003-11-01 17:08:23 +00:00
Torbjörn Andersson
94edf540ef More moving of stuff into classes
svn-id: r11025
2003-11-01 16:55:20 +00:00
Max Horn
078091e7f4 cleanup of game detector functions
svn-id: r11024
2003-11-01 16:39:26 +00:00
Torbjörn Andersson
6011bd6cdc Save the config file when options are changed.
svn-id: r11014
2003-10-31 07:43:26 +00:00
Torbjörn Andersson
d7bd7d44b8 Use the ScummVM config manager instead of a separate BS2-specific config
file, plus some other cleanup. I don't know how the config manager decides
if/when to save the settings to file, but we can worry about that later.

svn-id: r11001
2003-10-29 07:53:05 +00:00
Max Horn
2fef2dcb84 bs2 -> sword2
svn-id: r10997
2003-10-28 19:51:30 +00:00
Max Horn
53db0a8a07 cleanup: removed version/id from GameSettings
svn-id: r10995
2003-10-28 17:07:25 +00:00
Torbjörn Andersson
7418c47b48 If we fail to read the game settings, use sensible defaults.
svn-id: r10990
2003-10-28 13:46:28 +00:00
Max Horn
a4d2a47820 factor out common debugger code
svn-id: r10984
2003-10-26 21:30:52 +00:00
Max Horn
d581c99ab5 cleanup
svn-id: r10982
2003-10-26 19:16:59 +00:00
Torbjörn Andersson
7c4cc25cec Enable the debug console. Actually, what I've done is to adapt the debug
console from the SCUMM engine. I decided that would be easier than to clean
up the original console code.

Unfortunately there's a bunch of code that I just copied - a pretty lousy
form of code-reusal. It'd be nice if the console could be made part of the
Engine class, or something like that.

Most of the debug commands seem to be working. Some aren't relevant for
ScummVM, and some are a bit obscure so I'm not quite sure what they're
supposed to be doing.

svn-id: r10978
2003-10-26 15:42:49 +00:00
Torbjörn Andersson
320b0a405a Corrected/clarified some debug messages/comments
svn-id: r10945
2003-10-23 07:08:09 +00:00
Torbjörn Andersson
59b72f2b38 Moved a few remaining pieces of the script interpreter into the Logic class
svn-id: r10939
2003-10-22 06:51:57 +00:00
Torbjörn Andersson
3be2f0f1e0 Moved some more stuff into the Logic class.
svn-id: r10923
2003-10-21 08:54:50 +00:00
Torbjörn Andersson
64aaaa0b25 Small cleanup, and added FIXME comment.
svn-id: r10907
2003-10-19 18:01:05 +00:00
Torbjörn Andersson
3a43829b88 Moved the opcode functions into the Logic class.
svn-id: r10885
2003-10-18 08:11:50 +00:00
Max Horn
0694eed273 moved game detection code out to the plugins
svn-id: r10882
2003-10-17 23:16:53 +00:00
Torbjörn Andersson
8b42d65a7e Dumped most of the remaining "driver" code into a new "Display" class. This
touches a lot of the code, of course, and adds yet another global variable
(temporarily, I hope), but everything still seems to work.

Knock on wood.

svn-id: r10806
2003-10-15 06:40:31 +00:00
Max Horn
31ba12c800 some more target<->game cleanup
svn-id: r10769
2003-10-12 19:10:17 +00:00
Max Horn
36fd7ec445 some renaming for more consistent terminology (although we might want to reevaluate this): 'target' is what is in your config file; 'game' is what a frontend provide. E.g. the scumm frontend provides the game 'monkeyvga', and my config file has target 'monkeyvga-ger' configured to use that game
svn-id: r10766
2003-10-12 18:40:12 +00:00
Torbjörn Andersson
1b52e11d55 Moved the "router" code into a new Router class. I'm hoping this is
analogous to the SkyAutoRoute class.

svn-id: r10754
2003-10-12 14:40:04 +00:00
Nicolas Bacca
70667d14da Alignment fix in debug message
svn-id: r10742
2003-10-12 13:04:46 +00:00
Torbjörn Andersson
02a157e745 Moved the text drawing stuff into a class of its own. (Adding another
global variable which will hopefully be dealt with later.)

svn-id: r10734
2003-10-11 12:26:53 +00:00
Torbjörn Andersson
ade93aabff cleanup
svn-id: r10728
2003-10-10 16:14:52 +00:00
Max Horn
5301edc383 some cleanup
svn-id: r10720
2003-10-10 13:55:08 +00:00
Torbjörn Andersson
d5bd6812ee Some cleanups and clarifications. Mainly, we no longer refer to the
inventory/conversation menu (which is drawn at the bottom of the screen) as
the "top menu".

svn-id: r10693
2003-10-09 06:57:35 +00:00
Max Horn
d177364715 new config manager. not everything is completed, and some things will still be changed, but it seems to work well enough to put it into CVS
svn-id: r10687
2003-10-08 21:59:23 +00:00