Commit Graph

58 Commits

Author SHA1 Message Date
Max Horn
7cd2cb2b17 PlayingSoundHandle -> SoundHandle; also, turned the handle activity check into a mixer method
svn-id: r17106
2005-03-12 18:56:09 +00:00
Max Horn
0ec193b4be changing AudioDataType -> SoundType, so now the constant names match the name of the data type / the SoundMixer method names
svn-id: r17052
2005-03-09 18:12:54 +00:00
Torbjörn Andersson
2f8d85e025 Initialise variable.
svn-id: r16983
2005-03-03 08:34:01 +00:00
Robert Göffringmann
c7dad332fa basically the same change as for bs1; don't keep the mutex locked while loading mp3, ogg or wave data. it blocks the playing thread for too long.
Also added index caching for the speech and music clusters to reduce seeks.

svn-id: r16849
2005-02-21 08:35:18 +00:00
Torbjörn Andersson
43cfe01f3d This is the second part of the BS2 restructuring. There are two new
classes: Screen and Mouse. Screen handles most of the drawing, except the
mouse cursor and in-game menus.

The old Graphics class is no more.

I've also fixed some "reverse stereo" regressions from the first part of
the restructuring.

I'm not sure what the next step will be, but hopefully it will be smaller
than this one was.

svn-id: r16812
2005-02-19 14:02:16 +00:00
Torbjörn Andersson
fe3e01a110 Now there are two file handles for the music: one for each CD. This is not
the same thing as one for each music stream. If both music streams are
playing music from the same CD, they will both take turns at using the same
file handle.

The only case where both file handles are used is when music from one CD is
fading in while music from the other CD is fading out. Which of course can
only happen if you play the game from hard disk. If the game has to ask for
the other CD, it kills the music immediately.

The reason for doing this is that there was some concern about whether
having two file handles open to the same file was portable or not. I don't
think that question was ever fully answered, so I avoid the situation.

svn-id: r16753
2005-02-08 08:32:50 +00:00
Max Horn
abd12dd1b6 Use class Mutex instead of MutexRef
svn-id: r16679
2005-01-28 22:05:51 +00:00
Torbjörn Andersson
c0a3816e17 Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.

To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.

The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.

I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)

At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.

Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.

svn-id: r16668
2005-01-28 16:33:14 +00:00
Torbjörn Andersson
0b461c8506 Updated copyright header, as discussed on the mailing list.
svn-id: r16580
2005-01-17 10:57:15 +00:00
Torbjörn Andersson
c5e83de099 Use Fingolfin's new WAV code.
svn-id: r16540
2005-01-11 08:32:10 +00:00
Torbjörn Andersson
5178822833 Updated copyright year.
svn-id: r16397
2005-01-01 15:10:22 +00:00
Torbjörn Andersson
0cfd573951 Cleanup
svn-id: r15810
2004-11-14 15:00:01 +00:00
Torbjörn Andersson
f004af9d4f Use the same code for opening the music clusters as for opening the speech
clusters. (No, that doesn't mean compressed music is support yet. This is
just a tiny little step closer.)

svn-id: r14794
2004-08-27 08:31:33 +00:00
Torbjörn Andersson
bc77ba431a Simplified the handling of sound effects. It's not necessary for the driver
to keep its own copy of the sound data. It could be even further simplified
(I don't really see any reason for having two different sound queues), but
I seem to have reached a point of stability here and I don't want to jinx
it by making further changes yet.

svn-id: r13705
2004-05-01 10:42:23 +00:00
Torbjörn Andersson
6a432d10b5 Cleanup. I plan to take a closer look at the sound effects handling later.
svn-id: r13661
2004-04-28 11:47:19 +00:00
Torbjörn Andersson
a575576890 fetchObjectName() no longer assumes that the resource will still be in the
cache after it's been closed. (Currently it always is, but ideally I'd like
for BS to work even if resource caching is disabled.)

svn-id: r13610
2004-04-24 12:29:35 +00:00
Torbjörn Andersson
8f8185f035 Major revamping of the BS2 memory manager and, some small changes to the
resource manager. All new code! All new bugs!

svn-id: r13603
2004-04-23 07:02:11 +00:00
Torbjörn Andersson
4c3a68027f Use the same syntax for accessing script variables as BS1 does, i.e. now
it's Logic::_scriptVars[ID] instead of just ID. Apart from looking cool, it
makes it much easier to tell the difference between variables and constants
when looking at the code.

Of course, this sort of sweeping changes is jolly good for introducing
truly weird regressions, which is why I waited until after 0.6.0.

svn-id: r13331
2004-03-17 09:03:15 +00:00
Torbjörn Andersson
802a301a16 Removed some of the #includes from sword2.h
svn-id: r12739
2004-02-05 14:19:07 +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
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
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
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
Paweł Kołodziejski
409108df82 cleanup whitespaces
svn-id: r11212
2003-11-08 19:47:20 +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
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
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
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
3a43829b88 Moved the opcode functions into the Logic class.
svn-id: r10885
2003-10-18 08:11:50 +00:00
Torbjörn Andersson
ade93aabff cleanup
svn-id: r10728
2003-10-10 16:14:52 +00:00
Torbjörn Andersson
a29d128bd3 Use RandomSource instead of rand().
svn-id: r10682
2003-10-08 18:02:53 +00:00
Torbjörn Andersson
7174a32c8e Made a separate class for the cutscene functions, removed some unused code
and made some other minor cleanups.

svn-id: r10614
2003-10-05 15:28:15 +00:00
Torbjörn Andersson
4fad04846a Changed to use #include "bs2/..." and removed the inclusion of standard C
headers. Most (all?) of the ones we need should probably come from stdafx.h
instead.

svn-id: r10588
2003-10-04 08:07:03 +00:00
Max Horn
5a074e6137 added namespace Sword2
svn-id: r10581
2003-10-04 00:52:27 +00:00
Torbjörn Andersson
c8de7d5089 Cleanups, mostly related to sound effects.
svn-id: r10532
2003-10-02 07:01:12 +00:00
Torbjörn Andersson
2a41216f08 ScummVM naming conventions and cleanup in the Sword2Sound class.
svn-id: r10514
2003-10-01 06:36:25 +00:00
Torbjörn Andersson
568a4bd839 Changed the resource manager object to use more ScummVM-like naming.
svn-id: r10499
2003-09-30 09:27:27 +00:00
Torbjörn Andersson
8ad28e3a7e More cleanup, and I've replaced most - not quite all - of BS2's debug
message functions with our own.

We still need to go through them and assign sensible debug levels to them.

svn-id: r10422
2003-09-27 11:02:58 +00:00
Torbjörn Andersson
b21208e6a9 Some more reformatting / cleanup, and removal of comments that did nothing
but say who added what when. (No disrespect intended, but this information
means very little to us.)

svn-id: r10413
2003-09-26 10:07:18 +00:00
Torbjörn Andersson
3c7c60196f ScummVM code formatting conventions
svn-id: r10350
2003-09-21 16:11:26 +00:00
Torbjörn Andersson
bfa5c61734 Some cleanup - lots more needed!
svn-id: r10348
2003-09-21 14:26:25 +00:00
Torbjörn Andersson
6539b8a0e6 cleanup
svn-id: r10333
2003-09-20 12:43:52 +00:00
Max Horn
468275bb94 added a static method setDefaultDirectory to class File; used this to simplify some code; added a global g_sound pointer in bs2, this cuts down on uses of g_sword2 (of course both should be removed on the long run); some other minor tweaks/fixes
svn-id: r10278
2003-09-17 21:06:16 +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
Paweł Kołodziejski
a2dad74da1 added sfx support, increased speech support, and music code(streaming works fine but you don't hear anything) newStream, and appendStream doesn't work but playRaw works for music
svn-id: r9923
2003-08-30 18:06:08 +00:00
Jonathan Gray
a8ddcec684 be more tolerant of files being in different spots, and living on case sensitive filesystems
svn-id: r9846
2003-08-24 12:13:03 +00:00
Jonathan Gray
e52f4c89c7 correct slashes in paths
svn-id: r9844
2003-08-24 08:15:01 +00:00