Commit Graph

639 Commits

Author SHA1 Message Date
Max Horn
1a7ca2dc2a AudioStream::read() has been removed quite some time ago, now making sure that change is reflected everywhere
svn-id: r15911
2004-11-27 13:54:09 +00:00
Max Horn
876e738dce Moved Engine::getSavePath() to class SaveFileManager; removed the 'directory' parameter from SaveFileManager::openSavefile and listSavefiles (they always use getSavePath() now, which is what we did anyway)
svn-id: r15901
2004-11-27 00:26:11 +00:00
Max Horn
6df3e8dc6f Spelling
svn-id: r15890
2004-11-26 00:18:48 +00:00
Eugene Sandulenko
31e434dcf1 Fix a`ll engines. They work, though current fix is just temporary.
There are plans to add some brains to GameDetector class, which will let us
avoid passing detector to init() method.

svn-id: r15873
2004-11-24 00:14:21 +00:00
Max Horn
aad9f122c0 Added Engine::init() method; added return value to Engine::go()
svn-id: r15865
2004-11-23 00:03:25 +00:00
Max Horn
fa97d4ad89 Removing walkthrough stuff again (talked to aquadran about this, he had no objections)
svn-id: r15849
2004-11-20 23:49:11 +00:00
Paweł Kołodziejski
20e9cf6f20 added walkthrough
svn-id: r15835
2004-11-19 19:50:22 +00:00
Torbjörn Andersson
7adc1f419f Cleanup
svn-id: r15826
2004-11-16 09:15:25 +00:00
Torbjörn Andersson
38baf0a0d3 I think this is the kind of constructor/go changes _sev was talking about
in his mail to scummvm-devel. (Though "a discussed a while ago change"
sounds like sort of thing Robert Jordan writes whenever there is danger of
anything actually happening in any of his more recent books. Tantalizing,
yet non-informative. ;-)

It's still rather messy. I'll look into cleaning it up later.

svn-id: r15818
2004-11-15 08:22:16 +00:00
Torbjörn Andersson
0cfd573951 Cleanup
svn-id: r15810
2004-11-14 15:00:01 +00:00
Torbjörn Andersson
37833f9832 Fixed comment typo. It's the pyramid bug that's dreaded, not the pyramid
itself. :-)

svn-id: r15789
2004-11-11 15:30:02 +00:00
Max Horn
926cfc5bd2 Doxygen fixes
svn-id: r15701
2004-10-30 21:58:37 +00:00
Torbjörn Andersson
e31cd239bd Use the same REDUCE_MEMORY_USAGE trick here as in scumm/intern.h
svn-id: r15612
2004-10-19 14:19:52 +00:00
Torbjörn Andersson
4d3913d1b2 Cleanup of the credits code. Use the new gets() function.
svn-id: r15609
2004-10-19 07:12:23 +00:00
Max Horn
365b9a1e27 Doxygen fix
svn-id: r15594
2004-10-17 19:39:46 +00:00
Torbjörn Andersson
372eeb54cb Migration to the newer form of setupPremix().
svn-id: r15532
2004-10-12 17:03:07 +00:00
Torbjörn Andersson
eaccebd7fc Cleanup
svn-id: r15526
2004-10-12 06:24:46 +00:00
Chris Apers
757f2fdcef Prevent double slash in path
svn-id: r15473
2004-10-08 16:09:52 +00:00
Max Horn
ce8c99bf62 Rename remaining OSystem methods to match our coding guidelines
svn-id: r15332
2004-09-28 20:19:37 +00:00
Torbjörn Andersson
8f4a5ea3a5 Removed obsolete comment about floating/locked memory.
svn-id: r15297
2004-09-26 16:10:21 +00:00
Max Horn
61b7e2155a Fix doxygen warnings
svn-id: r15277
2004-09-25 23:26:46 +00:00
Torbjörn Andersson
095035e9c7 Removed obsolete comment.
svn-id: r15193
2004-09-19 18:19:30 +00:00
Torbjörn Andersson
d010b9e560 As an experiment, expire SCREEN_FILE resources faster than other resources.
They're generally the largest resources in the cache by far (though some
ANIMATION_FILE resources are about as big).

I still don't know how much benefit there is to resource caching, but some
of it is definitely needed, or the game won't work properly. Oh well, as
long as no one complains about the extra memory usage...

svn-id: r15079
2004-09-12 17:10:59 +00:00
Torbjörn Andersson
7011d697cb Made the output from the "mem" debugger command a bit more informative, and
sorted it to output the biggest memory blocks first.

svn-id: r15078
2004-09-12 17:05:17 +00:00
Torbjörn Andersson
412f7105f0 Fixed evil regression #2. Restarting the game, or using the "start" debug
command, would close the global script variables and player object
resources, without reopening them again. This made them fair game for the
resource expiration mechanism. The player object is probably referenced
often enough to stay alive, but the variables died on me pretty quickly,
causing ScummVM to crash.

I've also added a "reslist" debug command to make this sort of things
easier to spot. By default it only lists resources with refCount > 0. Use
"reslist 0" to see all the cached resources as well.

svn-id: r14958
2004-09-08 07:10:54 +00:00
Torbjörn Andersson
933cbeb91e Fixed debug output.
svn-id: r14951
2004-09-07 17:52:03 +00:00
Torbjörn Andersson
e6f19ff83a Much like an early civilization with no concept of the number zero, the
new memory manager didn't have the concept of the NULL pointer. Now it
does.

If ScummVM ever crashed for you when using the phone early in the game,
this patch hopefully fixes that bug. (If it didn't crash for you, memory
block zero was still allocated, so 0 still decoded to a valid pointer.)

svn-id: r14937
2004-09-07 06:29:57 +00:00
Travis Howell
95a52bf4b4 Fix compile
svn-id: r14898
2004-09-04 23:05:34 +00:00
Torbjörn Andersson
f04e412269 Rewrote the code that loads credits.clu into memory. The new code is
perhaps less clever than the old one I wrote, but should be much easier to
read. Besides, the old code had a small memory leak in it.

svn-id: r14897
2004-09-04 21:17:27 +00:00
Torbjörn Andersson
eff7b341d0 Fixed a glitch in the music fade-out code.
svn-id: r14888
2004-09-04 09:46:47 +00:00
Torbjörn Andersson
cb399b63d5 Added support for compressed music. I'm sure there are some glitches still
to fix, but it should work well enough for now.

In this rewrite of the music code, I removed the "save/restore music state"
function, since it just complicated things for a very small gain. It wasn't
in the original engine, and I added it just for the credits, so that the
previously playing music could be resumed afterwards. I might re-add it
later, but probably not.

svn-id: r14887
2004-09-04 09:27:17 +00:00
Torbjörn Andersson
4a6d5e4119 Cleanup. Removed the original DipMusic() code. If anyone wants to
implement it - personally I don't see the need - they can get it from CVS.

svn-id: r14819
2004-08-28 14:50:44 +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
15fa71e1bf Explicitly cast value to uint32, since there was a report about compilation
problems. Perhaps this will fix it?

svn-id: r14762
2004-08-26 06:59:15 +00:00
Torbjörn Andersson
68acd13ad4 The original speech clusters are now decoded through a custom AudioStream
class, so they are handled the same way as the compressed clusters.

The next step will be to migrate the music playback to use the same class,
which means the fade-in/out logic needs to be separated from the decoding.
Once this is done, adding support for compressed music should be a piece of
cake.

svn-id: r14740
2004-08-25 06:55:15 +00:00
Torbjörn Andersson
137d1ebe48 Added a destructor to the FontRenderer class to free any remaining text
sprites on exit. As far as I can tell, the only case when this makes any
difference is when there is text on screen when you quit ScummVM, so it's
not really a memory leak, but Valgrind will report it as one.

svn-id: r14738
2004-08-25 05:57:17 +00:00
Torbjörn Andersson
44eca16eb6 Fixed the bug that caused Vorbis and FLAC to misbehave with compressed
speech. (Apparently it was just an accident that MP3 worked.)

Unfortunately I had to change the file format of the compressed files to
include both the compressed and uncompressed size, but since the tool to
create these files has only lived as an item in the patch tracker, no one
should have exptected it to be the final, working version, right? Right.

svn-id: r14698
2004-08-23 06:17:40 +00:00
Torbjörn Andersson
e00f9f4a97 Experimental (i.e. slightly broken) code for handling compressed speech.
The equally experimental compression tool is in patch #854561.

Support for compressed music will require some restructuring first.

svn-id: r14684
2004-08-22 14:28:11 +00:00
Torbjörn Andersson
bb62b07f4f Don't try to free text sprites with the memory manager - it uses standard
malloc() nowadays! (This only affected the "dummy" player.

svn-id: r14638
2004-08-17 13:52:18 +00:00
Travis Howell
4b4ab244b1 Correct default settings used by COMI
Allow object_labels config option in COMI

svn-id: r14408
2004-08-01 06:52:56 +00:00
Torbjörn Andersson
2fedf7d285 I shouldn't be mixing cleanups and bug fixes, but I'm doing so anyway, just
this once. :-)

The parameters to drawLine() aren't clipped to the screen size, which meant
that it was accessing memory out of bounds when marking the screen as
dirty. The function now uses plotPoint(), which does the bounds checking
and screen dirtying for us. Apart from being a little easier to read, it
dirties only the parts of the screen the line actually passes through,
instead of a rectangle defined by the line's end points.

Since drawLine() is only used for debugging, I wouldn't consider this a
particularly serious bug.

Next change is that only the pixels inside the original parallax layer are
considered when creating the block surfaces. This may make the drawing
slightly more efficient, since fewer surfaces will be labelled as
transparent.

Plus some other minor cleanups.

svn-id: r14340
2004-07-26 16:41:57 +00:00
Torbjörn Andersson
f02a14427b Allowing both music streams to share the same rate converter only worked
by accident, and could cause bad noises during music cross-fades.

This wasn't a problem in 0.6.0 since all music is sampled at 22050 Hz,
which is the most likely output sample rate for ScummVM, so the converter
didn't actually have to do anything. Now, however, the output sample rate
could be anything.

I've given the music streams one converter each. In BS1, which uses similar
music code, it was already necessary to do this since some of its music is
sampled at 11025 Hz.

svn-id: r14237
2004-07-17 14:00:07 +00:00
Max Horn
53af3dc670 Enhanced default directory support in the File class; now one can specify arbitrary many default search directories
svn-id: r14095
2004-06-28 00:06:31 +00:00
Max Horn
b8ad54b3af Reversed param order of File::open() -- this allowed me to get rid of a few more getGameDataPath() calls
svn-id: r14090
2004-06-27 22:14:35 +00:00
Max Horn
6b722ff11b Added Engine::_saveFileMan; thus was able to get rid of auto_ptr usage again
svn-id: r14058
2004-06-25 22:39:21 +00:00
Max Horn
7a8d469c66 Use auto_ptr to avoid leaks
svn-id: r14057
2004-06-25 22:12:57 +00:00
Torbjörn Andersson
a7d7e6eb7a Itsy-bitsy cleanup.
svn-id: r13959
2004-06-17 06:46:18 +00:00
Torbjörn Andersson
e554f46f71 Cleanup
svn-id: r13956
2004-06-12 09:53:45 +00:00
Torbjörn Andersson
93d26c0bd1 Hopefully fixed the displayMsg() fade-up glitch I accidentally introduced
yesterday.

svn-id: r13955
2004-06-11 06:38:45 +00:00
Torbjörn Andersson
13024364b7 Fixed a regression caused by my recent cleanup. This one would cause the
game to crash shortly after Andr� shows you the coyote stone. More
precisely, when the camera view shifts from the close-up of the
conversation back to the normal view of the caf�.

For those who enjoy reading commit messages, this was the crash I was
hunting for yesterday.

svn-id: r13954
2004-06-11 06:37:50 +00:00
Torbjörn Andersson
3c70f5a85c If the 'time' parameter to displayMsg() is 0, wait until the user clicks
or presses a button. This is how displayMsg() was always used, so the only
difference is that the code to check for events is no longer outside the
function.

In the process, it turned out that removeMsg() was probably unnecessary so
I have removed it. May cause regressions, but we can deal with them later.

svn-id: r13953
2004-06-10 06:48:50 +00:00
Torbjörn Andersson
dabb32ce1a Some more work on the - still disabled - "right click to clear luggage"
code I added some time ago.

svn-id: r13952
2004-06-10 06:41:08 +00:00
Torbjörn Andersson
0d193e87ce Added another assert(). I'm hunting - unsuccessfully so far - for a
reproducable crash where an invalid pointer is decoded. Strangely, I never
saw it being encoded... Oh well, I'll find it eventually.

svn-id: r13951
2004-06-10 06:33:11 +00:00
Torbjörn Andersson
c63cc7c7d1 One of my not-so-recent cleanups caused BS2 to produce corrupt savegames.
And no one even noticed! Should be fixed now.

svn-id: r13950
2004-06-10 06:14:07 +00:00
Torbjörn Andersson
0426d38aa5 Cleaned up the palette handling a bit. Renamed _palCopy to _palette since I
found the old name misleading (there is only one array that stores the
palette in the engine, though it could be argued that it's a copy of the
one used by the backend), and removed some code that I'm almost certain was
never used. (I've added assert()s to trigger in the cases where it would
have been used.)

svn-id: r13949
2004-06-09 06:33:29 +00:00
Torbjörn Andersson
7e70c86870 Added a few comments, rewrote a few others, and added a couple of assert()s
svn-id: r13947
2004-06-08 06:53:35 +00:00
Torbjörn Andersson
78404c30d4 Added comment.
svn-id: r13946
2004-06-07 05:57:00 +00:00
Torbjörn Andersson
c9c56d2f72 Cleaned up sprite scaling.
svn-id: r13944
2004-06-06 15:40:31 +00:00
Torbjörn Andersson
dac16f4f43 Cleanup
svn-id: r13933
2004-06-05 10:28:42 +00:00
Torbjörn Andersson
1189083fe0 Close menus before restarting. (This is a purely cosmetical fix.)
svn-id: r13831
2004-05-10 07:11:40 +00:00
Torbjörn Andersson
9742985e50 Fixed typo.
svn-id: r13830
2004-05-10 07:10:28 +00:00
Torbjörn Andersson
9e4c641de1 Forgot to remove this file when I changed input handling.
svn-id: r13813
2004-05-09 13:40:39 +00:00
Torbjörn Andersson
fc970b3c75 Removed the buffering of mouse and keyboard events. I don't think any of
our other engines do this, so there is little reason for BS2 to. I did add
a filtering mechanism so that mouse button releases and scroll wheeling is
ignored during normal gameplay, but I don't know if that was necessary
either.

Since this left little more than an empty husk where the Input class used
to be, I've eliminated that class and buried its remains in Sword2Engine.

svn-id: r13812
2004-05-09 13:32:04 +00:00
Torbjörn Andersson
577600537c When drawing lines and points, mark the corresponding screen area as dirty
so that it gets properly redrawn. Only the debugging code uses these
drawing primitives, so it's no big deal, but it's still the right thing to
do.

svn-id: r13811
2004-05-09 13:24:07 +00:00
Torbjörn Andersson
ed9bac56b0 My recent sound changes broke "restart". This should un-break it again.
svn-id: r13810
2004-05-09 13:20:12 +00:00
Torbjörn Andersson
afb91fc184 Cleanup.
svn-id: r13806
2004-05-07 19:56:19 +00:00
Torbjörn Andersson
0600200980 Take advantage of the changes in the backend's mouse cursor handling. It
didn't do the change I was hoping for: the coyote stone is still partially
see-through, but perhaps it was in the original as well.

At least we no longer need to keep the buffer the mouse cursor is decoded
to, since that's now handled by the backend.

svn-id: r13782
2004-05-05 07:22:35 +00:00
Torbjörn Andersson
5882ea5819 Cleanup.
Part of this cleanup involved removing _unpauseZone. It was only used by
fnISpeak(), and as far as I could tell it was just because the original
code didn't trust amISpeaking() and getSpeechStatus() to return sensible
values directly after unpausing the game.

svn-id: r13781
2004-05-05 07:06:18 +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
e830d35a21 Made the "debugoff" console command actually turn *off* the debug info.
svn-id: r13704
2004-05-01 10:24:47 +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
49fc62b4d0 Cleanup
svn-id: r13649
2004-04-27 08:59:58 +00:00
Jamieson Christian
4ee0365a23 Tweaked a few things to accommodate
MSVC6's idiosyncracies.

svn-id: r13644
2004-04-26 20:28:34 +00:00
Torbjörn Andersson
0fcd887dcd Cleanup. Mostly removal of redundant comments.
I've also made the SaveGameHeader struct packed, which may break savegame
compatibility on some architectures (though not on the Linux and Windows
boxes I've tried it on). But I'm hoping it will guarantee, or at least make
it more likely, that savegames will be portable across architectures.

svn-id: r13634
2004-04-26 07:37:25 +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
8675bcfc6c Fixed a crash regression in setLuggage() that was caused by a change I
didn't make. :-)

(That is, I made the change and then thought better of it, but I forgot to
change one line back to its original form.)

svn-id: r13608
2004-04-23 11:43:20 +00:00
Torbjörn Andersson
0ac8c4bd3f I forgot to clear the reference counter when a resource is forcibly removed
and I may as well clear it when a resource is read from disk as well.

svn-id: r13606
2004-04-23 11:36:06 +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
0d2d884bb7 Cleanup
svn-id: r13582
2004-04-16 06:46:03 +00:00
Torbjörn Andersson
3a4536e2e2 Cleanup. (Mostly of the comments.)
svn-id: r13579
2004-04-14 07:12:10 +00:00
Torbjörn Andersson
12aeb85e62 Cleanup.
svn-id: r13495
2004-04-07 14:18:27 +00:00
Torbjörn Andersson
489e473fca Cleanup.
svn-id: r13494
2004-04-07 12:31:32 +00:00
Torbjörn Andersson
c2870adf60 Added notice about how I think CP_PUSH_LOCAL_ADDR is used.
svn-id: r13493
2004-04-07 08:53:24 +00:00
Torbjörn Andersson
a1ac764575 Cleanup. (Mostly to change the wording and priority of the debugging
messages to be more like in BS1.)

svn-id: r13491
2004-04-07 06:57:37 +00:00
Torbjörn Andersson
6d460d2e10 Cleanup.
svn-id: r13457
2004-04-04 15:16:05 +00:00
Torbjörn Andersson
b809a5670b Cleanup
svn-id: r13431
2004-03-30 06:54:27 +00:00
Torbjörn Andersson
bf10f5a616 Cleanup.
This removes a bunch of debugging code/commands that either didn't do
anything useful under ScummVM (e.g. "soft" and "hard"), or which did things
that was already easily avaiable elsewhere (e.g. "save" and "restore").

I didn't have the heart to remove the "tony" command, though. :-)

svn-id: r13422
2004-03-29 06:37:46 +00:00
Torbjörn Andersson
6cb86c641f Make clearScene() set the _needFullRedraw variable.
I think the reason I didn't do this from the start was that BS2 used to
call clearScene(), or whatever the function was called back then, between
every frame. Nowadays, it simply assumes that each frame will cover the
previous one.

Anyway, this change prevents the restart/restore dialog from appearing
briefly between the two intro cutscene animations.

svn-id: r13421
2004-03-29 06:32:54 +00:00
Max Horn
14378cb56e Renamed more OSystem methods
svn-id: r13410
2004-03-28 16:30:50 +00:00
Torbjörn Andersson
c831739c9c More format string fixes.
svn-id: r13407
2004-03-28 14:56:02 +00:00
Torbjörn Andersson
00243652e0 Fixed paramters to match format string.
svn-id: r13406
2004-03-28 14:53:09 +00:00
Torbjörn Andersson
129152c18b Fixed format string to match parameters.
svn-id: r13405
2004-03-28 14:52:19 +00:00
Torbjörn Andersson
41ef5a97ea Cleanup.
One of the changes, I'm not quite sure about: buildDisplay() used to open
and close the _thisScreen.background_layer_id resource for each layer it
processed. In particular, it used to "release the screen resource before
cacheing the sprites".

I have no idea why, because I can't see any trace of a sprite cache, and I
can't think of any harm in keeping the resource open during the whole
render cycle. The resource is probably loaded into memory already anyway,
though its reference counter may be 0.

svn-id: r13401
2004-03-28 13:16:01 +00:00
Torbjörn Andersson
3f18905732 Force the engine to pick a cursor after restoring a game. This appears to
be needed when using the -x command-line option to restore a game, though
I'm not quite sure why.

svn-id: r13400
2004-03-28 13:13:16 +00:00
Torbjörn Andersson
93336d8bc9 Don't show the restart/restore dialog if a boot parameter has been given.
And a teensy-weensy little cleanup.

svn-id: r13399
2004-03-28 13:12:10 +00:00
Torbjörn Andersson
d109cc1f98 Fixed bug I introduced in the recent cleanup: It's the screen, not the
overlay, that needs to be cleared at the beginning of the movie. Otherwise
what was on the screen may show at the end of the movie.

svn-id: r13398
2004-03-28 13:10:52 +00:00
Torbjörn Andersson
9b9ebb3a91 Make sure looping music is restarted after loading a savegame, regardless
of how the savegame is loaded. (ScummVM adds two alternative methods: the
-x command-line parameter, and the restart/restore dialog at the beginning
of the game, which is only shown when there are savegames available.)

svn-id: r13386
2004-03-27 12:07:07 +00:00
Torbjörn Andersson
56ae88d5c7 cleanup
svn-id: r13385
2004-03-27 12:02:38 +00:00
Torbjörn Andersson
afefe7dcfa Use the binary .pal file format that was introduced for 0.6.0.
Invalidate the lookup table when the screen changes. (TODO: We also have to
invalidate it if the change happens between cutscenes, don't we?)

Some cleanup, particularly in the BS2 cutscene player. More needed, I
guess...

svn-id: r13377
2004-03-24 07:29:59 +00:00
Max Horn
3fddbc18d6 Unify MPEG2 code even more
svn-id: r13365
2004-03-23 00:10:18 +00:00