Commit Graph

242 Commits

Author SHA1 Message Date
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
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
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
065f2bb9eb It's a new year in BS2 land, too!
svn-id: r12181
2004-01-06 13:44:17 +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
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
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
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
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
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
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
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
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
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
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
Torbjörn Andersson
af02beefd9 cleanup
svn-id: r11457
2003-12-02 07:41:04 +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
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
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
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
Paweł Kołodziejski
409108df82 cleanup whitespaces
svn-id: r11212
2003-11-08 19:47:20 +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
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
9588a6fd31 fixed warnings
svn-id: r11046
2003-11-02 10:12:08 +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