Commit Graph

146 Commits

Author SHA1 Message Date
Torbjörn Andersson
bb5f479a8c Added a WaitForFade() function, to replace numerous while-loops scattered
througout the code.

svn-id: r10127
2003-09-09 12:14:08 +00:00
Torbjörn Andersson
29607a17ef Cleanup
svn-id: r10126
2003-09-09 11:52:43 +00:00
Torbjörn Andersson
fb6e8dd628 Clarified some comments in PlaySmacker(). At this point it should be fairly
trivial to actually play the Smacker voice-overs, but I think the sound
code needs a bit more cleaning up first. (I'm pretty sure it isn't
alignment-safe, and it might not be endian-safe either.)

svn-id: r10123
2003-09-09 07:01:04 +00:00
Torbjörn Andersson
e68176f8c3 Read Smacker voice-overs from the correct file, same way as speech.cpp does
svn-id: r10122
2003-09-09 06:54:11 +00:00
Torbjörn Andersson
5396901ec6 Simplified the code to decide whether to use speech1.clu or speech2.clu
since res_man.WhichCd() appears to be working now.

svn-id: r10121
2003-09-09 06:49:15 +00:00
Torbjörn Andersson
a6661b2070 Cleanup.
svn-id: r10104
2003-09-08 17:44:26 +00:00
Torbjörn Andersson
d0949b7035 Updated comment.
svn-id: r10100
2003-09-08 17:24:00 +00:00
Torbjörn Andersson
c2070e28fa Added some code to display the subtitles for the Smacker movies, when
available, since they are separate from the Smacker files themselves.

Next step will be to play the voice-over sounds as well, and to make sure
subtitles settings etc. are taken into account (if they aren't already).

svn-id: r10099
2003-09-08 17:18:38 +00:00
Max Horn
f23a34c9e5 renamed VersionSettings -> TargetSettings and also renamed some of its members; added GameDetector::findTarget; made launcher use that new method; some initial preparations for Plugin code
svn-id: r10092
2003-09-08 15:38:34 +00:00
Torbjörn Andersson
0b86100456 Complete rewrite of the in-game dialogs (quit, restart, settings, save and
load). The new code is smaller, hopefully a bit easier to read and doesn't
use up all the CPU time.

Of course, it may some new and exciting bugs too. ;-)

svn-id: r10079
2003-09-08 06:38:16 +00:00
Torbjörn Andersson
aff37c083b Hide the menus when displaying full-screen messages, e.g. error messages
from the save/load dialog. (This probably happened automagically in the
original, but we handle screen updates a bit differently now.)

svn-id: r10078
2003-09-08 06:32:37 +00:00
Max Horn
78476c6bd6 more endian fixes
svn-id: r10058
2003-09-07 03:18:27 +00:00
Max Horn
2fb59884f1 some endian fixes
svn-id: r10056
2003-09-07 01:51:15 +00:00
Max Horn
3aa8454efa moved the sound ID param in playRaw before volume/pan
svn-id: r10023
2003-09-05 22:09:56 +00:00
Torbjörn Andersson
cd9496ab3a Added FIXME comment about DipMusic().
svn-id: r10010
2003-09-05 16:07:03 +00:00
Torbjörn Andersson
7400995094 Cleanup.
svn-id: r10009
2003-09-05 15:56:43 +00:00
Torbjörn Andersson
94ec5238c9 This fixes another music-related crash for me. I guess it's our
implementation of music fade-out that makes it a bad thing to close the
music cluster file prematurely.

svn-id: r10007
2003-09-05 15:37:51 +00:00
Torbjörn Andersson
bee5a3820a Removed unused function, StartMusicFadeDown().
svn-id: r10004
2003-09-05 12:19:40 +00:00
Torbjörn Andersson
2ecbd4ae88 Cleaned up UpdateCompSampleStreaming() and re-enabled music fading. We
currently don't fade music that ends because we reached the end of the
musical cue, though. Only music that ends because it's being replaced by
another cue.

svn-id: r10003
2003-09-05 11:12:40 +00:00
Jonathan Gray
bb9a4bbfcc comment unused label
svn-id: r9995
2003-09-05 03:46:30 +00:00
Torbjörn Andersson
9729256b2b Added locking to the music code. I'm not really the right person to do this
but at least it doesn't seem to do any harm.

Disabled the sound FX "garbage collection" in FxServer(). I'm not really
convinced it's necessary at all, and even if it is, doing it from a
separate thread it just begging for trouble. I've modified OpenFx()
slightly to deal with this, but I may still have introduced regressions.

Temporarily disabled the "goto label1" hack, since it seems to be the main
reason for ScummVM crashing if I allow a piece of music to finish on its
own (i.e. when not terminating it prematurely by triggering another piece
of music).

svn-id: r9990
2003-09-04 10:58:55 +00:00
Torbjörn Andersson
a1e336c1cb Added FIXME comment about how we probably need locking for FxServer() and
the functions which access data manipulated by FxServer().

For instance, FxServer() may free bufferFx[i], which sounds potentially
unhealthy to me.

svn-id: r9989
2003-09-03 18:59:02 +00:00
Torbjörn Andersson
ee68d3d198 Removed fxLooped[], fxCached[] and musCounter[]. They were written to, but
never read.

svn-id: r9984
2003-09-03 06:27:25 +00:00
Paweł Kołodziejski
3fba3b3d4c fixed music fading out. it's "goto" hack.
originaly dsound has 3 seconds buffer fillled with data enought for fading
this hack continue play music for time while fading is going

svn-id: r9983
2003-09-03 06:03:29 +00:00
Paweł Kołodziejski
1fc3c0be23 more cleanup
svn-id: r9982
2003-09-03 05:04:55 +00:00
Paweł Kołodziejski
b62c527fa0 some cleanup code
svn-id: r9981
2003-09-03 04:45:57 +00:00
Paweł Kołodziejski
455d3faf2f fixed interval of fxServer func (why i saw before 1000 miliseconds?), moved init sound data to class sound
svn-id: r9980
2003-09-03 03:57:23 +00:00
Torbjörn Andersson
124a84033f Unless I'm gravely mistaken, StreamCompMusic() should always create a new
stream, in which case the warning about the sound handle being 0 is bogus.

svn-id: r9973
2003-09-02 16:20:10 +00:00
Torbjörn Andersson
145f17c4a9 Moved the sound initialisation to the Sword2Sound constructor to avoid
warning messages about uninitialised sound handles.

svn-id: r9972
2003-09-02 15:55:55 +00:00
Torbjörn Andersson
907485c1a2 Another untested endian fix.
svn-id: r9971
2003-09-02 15:11:19 +00:00
Torbjörn Andersson
730e6b8c38 Use the new per-channel pausing. This allows us to play the music for the
in-game dialogs.

svn-id: r9969
2003-09-02 13:50:45 +00:00
Torbjörn Andersson
8c61a29c29 Since soundHandleMusic[] is now an array of sound handles instead of
channel indexes, we should use stopHandle() instead of stop() to kill the
music channel.

Am I the only one who finds the distinction between channel indexes and
sound handles confusing at times? :-)

svn-id: r9967
2003-09-02 12:55:20 +00:00
Torbjörn Andersson
5270fa2d5a Re-formatted the code to be a bit more in line with the rest of ScummVM,
and made a few (untested) endian-fixes.

svn-id: r9965
2003-09-02 09:55:11 +00:00
Torbjörn Andersson
66cdc7900e Re-formatted the code to be a bit more in line with the rest of ScummVM.
svn-id: r9964
2003-09-02 09:54:42 +00:00
Paweł Kołodziejski
743a3fbdaf added sound handle stuff to mixer streams
svn-id: r9956
2003-09-01 13:43:22 +00:00
Torbjörn Andersson
178b0d82df Another attempt at fixing the music1.clu / music2.clu thing.
svn-id: r9952
2003-09-01 06:40:07 +00:00
Paweł Kołodziejski
56ca9f03df possibly fixes for not exist id stream channel
svn-id: r9951
2003-09-01 06:23:04 +00:00
Paweł Kołodziejski
beb138d4d8 added warkaround for not exist music stream id at appendStream call
svn-id: r9950
2003-09-01 06:13:47 +00:00
Paweł Kołodziejski
2533b23a60 added mixer features: volume and pan control per channel
svn-id: r9944
2003-08-31 20:26:21 +00:00
Torbjörn Andersson
54f5caedc5 Untested (because I don't have any savegames on this computer) support for
using music1.clu and music2.clu instead of music.clu

svn-id: r9943
2003-08-31 18:09:21 +00:00
Torbjörn Andersson
e60ee06e2d When a fading music channel is freed to make room for new music, or when a
music channel has faded out, destroy the channel immediately. Don't wait
for the mixer to finish it off.

This seems to fix a problem where the mixer would eventually run out of
slots if you left the Quit dialog showing for too long.

Unfortunately I don't know if it fixes the "out of slots" errors I
encountered once during normal play. Oh well, time will tell...

svn-id: r9942
2003-08-31 17:28:36 +00:00
Torbjörn Andersson
3b62d9b4da No longer assume that all sound effects are 22 kHz. Some are 11 kHz.
svn-id: r9939
2003-08-31 10:45:14 +00:00
Torbjörn Andersson
155f4591c9 Cleaned up StreamCompMusic(), including some untested endian-fixes.
This should also fix the bug where music sometimes didn't start playing.

svn-id: r9938
2003-08-31 10:38:32 +00:00
Jonathan Gray
25a7c5de67 support having speech clusters named speech1.clu and speech2.clu cd.bin is needed if you want to use this scheme
svn-id: r9937
2003-08-31 03:19:43 +00:00
Jonathan Gray
4ea7eeb563 fix compilation
svn-id: r9934
2003-08-31 00:00:09 +00:00
Torbjörn Andersson
c54baa429b BS2 crashed because it passed a buffer of uneven length to the mixer. This
is the only place I can think of where this could have happened, so I've
added a paranoid check to ensure the buffer length is even.

Let's see how that works out...

svn-id: r9933
2003-08-30 22:17:59 +00:00
Torbjörn Andersson
f00b48b4cf Set a default music volume so that we can actually hear it. :-)
svn-id: r9932
2003-08-30 21:58:10 +00:00
Paweł Kołodziejski
7b3aae7c03 fixed not cleared sound handle for music
svn-id: r9931
2003-08-30 21:09:13 +00:00
Paweł Kołodziejski
b321a7a468 ah
svn-id: r9928
2003-08-30 20:27:48 +00:00
Paweł Kołodziejski
c684a076ee revert id handle stuff
svn-id: r9927
2003-08-30 20:25:07 +00:00