Commit Graph

664 Commits

Author SHA1 Message Date
Torbjörn Andersson
d34e5fc605 Whitespace: "(type *)something" instead of "(type *) something", because
that's how we write it in most other places.

svn-id: r18069
2005-05-12 13:12:15 +00:00
Torbjörn Andersson
f45b23b63f Moved some more animation stuff out of the Logic class and into the
increasingly misnamed Router class. (I'll fix the naming later. Probably.)

svn-id: r18066
2005-05-12 06:30:16 +00:00
Max Horn
2de46dc8eb Moved some more stuff to namespace Audio (enough for tonight)
svn-id: r18040
2005-05-11 00:01:44 +00:00
Max Horn
1a615346ab Moved class SoundMixer to Audio::Mixer (didn't call the namespace 'Sound' because we already have many classes with that name)
svn-id: r18039
2005-05-10 23:48:48 +00:00
Max Horn
72f4c03b0b Moved (In/Out)SaveFile(Manager) and Timer to namespace Common
svn-id: r18038
2005-05-10 23:17:38 +00:00
Max Horn
b75c969e66 Moved class File and the MD5 stuff to namespace Common
svn-id: r18037
2005-05-10 22:56:25 +00:00
Max Horn
74f15bea74 Fix doxygen warning
svn-id: r17970
2005-05-08 17:13:08 +00:00
Torbjörn Andersson
781472641e Made it possible to quit while the game is asking for a CD.
svn-id: r17963
2005-05-08 13:05:31 +00:00
Torbjörn Andersson
e39dea37e7 Quitting the game now implies that the game is done fading the screen.
svn-id: r17962
2005-05-08 13:04:54 +00:00
Torbjörn Andersson
196127aa04 Forgot to remove this.
svn-id: r17961
2005-05-08 13:04:18 +00:00
Max Horn
d00117ec4b Fixed some doxygen warnings
svn-id: r17923
2005-05-05 15:59:24 +00:00
Torbjörn Andersson
f5f9da940b More cleanup/restructuring: Moved walk-related code from Logic to Router.
(I may have to think up some better name for that class later.)

svn-id: r17901
2005-05-03 09:00:06 +00:00
Torbjörn Andersson
7947fa5d8a Don't let drawSprite() modify the SpriteInfo struct.
svn-id: r17897
2005-05-02 09:20:27 +00:00
Torbjörn Andersson
cd6e22a3b1 Cleanup. Most of is simply moves the credits code out of Logic and into
Screen. I've also added an unused "splash screen" function that displays
the image that used to be shown by CacheNewCluster() while copying a data
file from CD to hard disk. ScummVM doesn't do that, but it's a nice image
that I wish we could do something useful with, and it's easier to have the
code here for reference than having to dig through old revisions of the
resource manager.

svn-id: r17894
2005-05-02 05:41:01 +00:00
Max Horn
4ec7161032 Patch #1186744 (Common line-drawing function)
svn-id: r17842
2005-04-27 20:29:19 +00:00
Torbjörn Andersson
8776150321 Better support for "seamless" cutscenes, i.e. ones where - in theory - you
shouldn't see where the cutscene begins/ends as it's the same image as is
currently displayed by the game engine itself.

Of course, in reality you can still see the seams easily. But at least it
looks a bit beter now. I made most of this change yesterday, but it's less
hard-wired now.

svn-id: r17797
2005-04-25 05:23:21 +00:00
Torbjörn Andersson
4cdcb0b049 Don't wait for the lead-out sound to finish when playing the "shaman"
cutscene, as it's obviously meant to blend in with the rest of the game.

svn-id: r17791
2005-04-24 15:38:53 +00:00
Torbjörn Andersson
5553ef53f1 Moved conversation stuff from Logic to Mouse.
svn-id: r17787
2005-04-24 12:13:03 +00:00
Torbjörn Andersson
e70c98fa22 Oops. This should have been removed long ago.
svn-id: r17768
2005-04-23 12:55:54 +00:00
Max Horn
969ef3dac9 * Added new virtual base class 'Stream', ReadStream and
WriteStream are now subclasses of it.
* Added new methods eos(), ioFailed(), clearIOFailed() to
  all streams. This allows better error checking.
* SaveFile classes take advantage of these new standard
  stream APIS
* Removed File::gets()
* Added SeekableReadStream::readLine() (replaces File::gets)
* Added WriteStream::writeString, for convenience

svn-id: r17752
2005-04-22 17:40:09 +00:00
Torbjörn Andersson
a18d4d5c2f Replaced drawLine() with a shorter version described in Wikipedia. It uses
a callback to plot each point so that it doesn't need to worry about how
the caller deals with screen dirtying, etc.

My plan is to move this function into a standard class. (That's why I used
the American spelling "color" instead of "colour".) I just haven't made up
my mind on which is the most appropriate one yet.

svn-id: r17715
2005-04-20 14:45:23 +00:00
Torbjörn Andersson
140a1d7c46 Initialization fix.
svn-id: r17535
2005-04-11 06:25:05 +00:00
Torbjörn Andersson
9ab6b86c3a Initialise _currentRunList to avoid failed assertion when quitting the
game before it has been initialised the normal way.

svn-id: r17519
2005-04-10 16:22:06 +00:00
Max Horn
e79c168d35 split SaveFileManager::openSavefile and class SaveFile into two, each, one for loading and one for saving
svn-id: r17517
2005-04-10 15:13:40 +00:00
Torbjörn Andersson
342334f235 Removed unnecessary includes.
svn-id: r17477
2005-04-09 13:08:00 +00:00
Max Horn
9a4bc8ce16 Patch #1117443 (Experimental plugin code revision)
svn-id: r17231
2005-03-25 17:55:57 +00:00
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
Torbjörn Andersson
a52de03324 Renamed variables in the MPEG animation classes to better conform with
ScummVM standard. It seems the 8-bit version of the code had decayed
slightly, but I believe it's working again now.

svn-id: r17081
2005-03-11 15:30:28 +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
e3105f926b Applied patch #1155731, reducing the memory usage of the MPEG player by
about 8 MB.

svn-id: r17007
2005-03-06 14:12:40 +00:00
Torbjörn Andersson
2f8d85e025 Initialise variable.
svn-id: r16983
2005-03-03 08:34:01 +00:00
Torbjörn Andersson
58dc309969 And, finally, the change I meant to before I got side-tracked: Use
ScummVM's "Rect" data type in the mouse list. The benefit of this is that
we can then use the contains() function in checkMouseList(), which makes
the code a bit less eye-watering.

svn-id: r16961
2005-02-28 14:03:53 +00:00
Torbjörn Andersson
bed897719c Index the "mouse list" from 0 instead of 1. I have no idea why it wasn't
this way to begin with.

svn-id: r16959
2005-02-28 13:28:02 +00:00
Torbjörn Andersson
9424c5aef2 Changed a few more hard-coded text-ids to constants.
svn-id: r16957
2005-02-28 13:22:31 +00:00
Torbjörn Andersson
f628ee836b Restored the original values to the return codes. Since I've been removing
a bunch of them, it's better that the remaining ones keep the same value
between future releases. (Not that the user will ever get error messages,
of course. *cough* :-)

svn-id: r16953
2005-02-27 16:20:01 +00:00
Torbjörn Andersson
a5356edb36 Got rid of all the .h files but one in the 'driver' directory. They were
either very small or, in the case of driver96.h, a disorganized jumbles.

svn-id: r16952
2005-02-27 16:11:19 +00:00
Torbjörn Andersson
7298987bba Whitespace changes.
svn-id: r16913
2005-02-25 14:19:30 +00:00
Max Horn
457ee7f582 Fix compilation on BE systems
svn-id: r16861
2005-02-22 18:09:38 +00:00
Torbjörn Andersson
9bb1414818 Moved some debugging stuff into the debugger class.
svn-id: r16859
2005-02-22 07:37:50 +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
8edce85e04 Some cleanup and renaming. (It was confusing to see "load" sometimes and
"restore" other times.) The save/restore dialog now has two separate
classes, though they both inherit from the old combined class of course.

svn-id: r16848
2005-02-21 08:16:50 +00:00
Robert Göffringmann
fd5a9be26e removed lots of unnecessary seek()s and read()s by keeping the datafiles' index tables in memory instead of accessing them over and over again, which caused major slowdowns with cd accesses.
Also, the caching of datafiles depends on the memory usage now, not on the number of screens that the player entered in the meantime.
The old behaviour made the engine run out of memory on the PS2.

svn-id: r16843
2005-02-21 02:29:18 +00:00
Torbjörn Andersson
807b33ec29 More BS2 restructuring.
The various game settings are no longer stored in the Gui class. They are
stored in the class that use them.

Code that doesn't belong in the Gui class, e.g. the "restart" code, has
been moved out of it.

Afterwards, the Gui class had been reduced to nothing more than a handful
of trivial methods for invoking the in-game dialogs. So the entire Gui
class has been removed.

svn-id: r16827
2005-02-20 15:38:48 +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
5aa2ea2d44 Forgot to check if preFetchCompSpeech() could find the speech file. Now it
will work even if the file is missing. (This only affects the cutscene
player.)

svn-id: r16806
2005-02-18 16:50:51 +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
Torbjörn Andersson
00670e2c23 Fixed crash that would happen if the game tried to play music from CD1 and
CD2 at the same time. There will eventually be a better fix for this, I
hope.

svn-id: r16750
2005-02-07 10:51:48 +00:00
Max Horn
577b04aaad Fix compilation with mpeg2 disabled
svn-id: r16680
2005-01-28 22:10:56 +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