aboutsummaryrefslogtreecommitdiff
path: root/sword2
AgeCommit message (Collapse)Author
2003-09-04Added locking to the music code. I'm not really the right person to do thisTorbjörn Andersson
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-03Added FIXME comment about how we probably need locking for FxServer() andTorbjörn Andersson
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-03Removed fxLooped[], fxCached[] and musCounter[]. They were written to, butTorbjörn Andersson
never read. svn-id: r9984
2003-09-03fixed music fading out. it's "goto" hack.Paweł Kołodziejski
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-03more cleanupPaweł Kołodziejski
svn-id: r9982
2003-09-03some cleanup codePaweł Kołodziejski
svn-id: r9981
2003-09-03fixed interval of fxServer func (why i saw before 1000 miliseconds?), moved ↵Paweł Kołodziejski
init sound data to class sound svn-id: r9980
2003-09-02Unless I'm gravely mistaken, StreamCompMusic() should always create a newTorbjörn Andersson
stream, in which case the warning about the sound handle being 0 is bogus. svn-id: r9973
2003-09-02Moved the sound initialisation to the Sword2Sound constructor to avoidTorbjörn Andersson
warning messages about uninitialised sound handles. svn-id: r9972
2003-09-02Another untested endian fix.Torbjörn Andersson
svn-id: r9971
2003-09-02Use the new per-channel pausing. This allows us to play the music for theTorbjörn Andersson
in-game dialogs. svn-id: r9969
2003-09-02Since soundHandleMusic[] is now an array of sound handles instead ofTorbjörn Andersson
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-02Re-formatted the code to be a bit more in line with the rest of ScummVM,Torbjörn Andersson
and made a few (untested) endian-fixes. svn-id: r9965
2003-09-02Re-formatted the code to be a bit more in line with the rest of ScummVM.Torbjörn Andersson
svn-id: r9964
2003-09-01added sound handle stuff to mixer streamsPaweł Kołodziejski
svn-id: r9956
2003-09-01Another attempt at fixing the music1.clu / music2.clu thing.Torbjörn Andersson
svn-id: r9952
2003-09-01possibly fixes for not exist id stream channelPaweł Kołodziejski
svn-id: r9951
2003-09-01added warkaround for not exist music stream id at appendStream callPaweł Kołodziejski
svn-id: r9950
2003-08-31added mixer features: volume and pan control per channelPaweł Kołodziejski
svn-id: r9944
2003-08-31Untested (because I don't have any savegames on this computer) support forTorbjörn Andersson
using music1.clu and music2.clu instead of music.clu svn-id: r9943
2003-08-31When a fading music channel is freed to make room for new music, or when aTorbjörn Andersson
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-31No longer assume that all sound effects are 22 kHz. Some are 11 kHz.Torbjörn Andersson
svn-id: r9939
2003-08-31Cleaned up StreamCompMusic(), including some untested endian-fixes.Torbjörn Andersson
This should also fix the bug where music sometimes didn't start playing. svn-id: r9938
2003-08-31support having speech clusters named speech1.clu and speech2.clu cd.bin is ↵Jonathan Gray
needed if you want to use this scheme svn-id: r9937
2003-08-31fix compilationJonathan Gray
svn-id: r9934
2003-08-30BS2 crashed because it passed a buffer of uneven length to the mixer. ThisTorbjörn Andersson
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-30Set a default music volume so that we can actually hear it. :-)Torbjörn Andersson
svn-id: r9932
2003-08-30fixed not cleared sound handle for musicPaweł Kołodziejski
svn-id: r9931
2003-08-30ahPaweł Kołodziejski
svn-id: r9928
2003-08-30revert id handle stuffPaweł Kołodziejski
svn-id: r9927
2003-08-30added sfx support, increased speech support, and music code(streaming works ↵Paweł Kołodziejski
fine but you don't hear anything) newStream, and appendStream doesn't work but playRaw works for music svn-id: r9923
2003-08-30properly close down when playing demoJonathan Gray
svn-id: r9921
2003-08-30Fixed sprite clipping issues, I hope.Torbjörn Andersson
svn-id: r9920
2003-08-29Disabled debug output. (I really need to get the debug message level toTorbjörn Andersson
work for BS2! :-) svn-id: r9906
2003-08-29Added some code to stop producing interpolation frames if the scene hasTorbjörn Andersson
already reached its scroll target. This keeps BS2 from using all available CPU time all of the time. It may still be that we need a mechanism for throttling the frame rate when the scene is moving towards a scroll target, but my computer isn't really fast enough to test that. Two other bugs fixed in the process: * I think the last frame of the render cycle was rendered, but not displayed. If so, that should be fixed now. * I discovered that there are cases where we do need to clear the screen (e.g. at the "Meanwhile..." message when George has found out about the Glease Gallery), so I've re-enabled the function and disabled it in the render cycle. svn-id: r9904
2003-08-29Cleanup.Torbjörn Andersson
svn-id: r9903
2003-08-28I forgot to commit this file earlier. (It's only a FIXME comment anyway.)Torbjörn Andersson
svn-id: r9892
2003-08-28Removed the Surface class in favor of small struct specially made for theTorbjörn Andersson
block surfaces. (A block surface is a 64x64 tile of a parallax layer.) I've also done a few things to try and optimize the drawing: * The back buffer is no longer cleared between frames. This may cause regressions, but I do believe that the entire picture area is always completely re-rendered for each frame. As a result of this, the menu code is now responsible for clearing the icon areas itself. * A few unnecessary copy_rect() calls were commented out in favor of one big copy_rect() in ServiceWindows(). * Completely opaque block surfaces are copied with memcpy(), one line at a time. Unless we manage to add intelligent screen redrawing, I don't think it will get that much faster than this, though there is some unnecessary data copying in DrawSprite() that could be removed. And the game is still a terrible CPU hog. I believe the animation runs at approximately 12 fps. If there's still time left, it will pump out further frames to get smooth scrolling. We ought to put a cap on that, and if it has already reached the scroll target it should sleep for the rest of the render cycle. svn-id: r9886
2003-08-28CleanupTorbjörn Andersson
svn-id: r9885
2003-08-28Fixed format string error.Torbjörn Andersson
svn-id: r9884
2003-08-27Add code to check for game-specific scaler and fullscreen settings, like weTorbjörn Andersson
do for the other game engines. svn-id: r9880
2003-08-27Added code for smoothing upscaled sprites (for the highest detail setting).Torbjörn Andersson
I don't know if I got it right - the result doesn't look that great to me - but at least the infrastructure is there. This, I think, marks the point where BS2 graphics is pretty much done. Some functions haven't been unstubbed yet, but I believe they're used for debugging and/or profiling. I'm not sure they're worth the trouble. Of course, there is still testing and clean-ups to make. For instance, I'd like DrawSprite() to use malloc() a bit less. svn-id: r9879
2003-08-27Unstubbed DimPalette() (used when pausing the game) and re-indented theTorbjörn Andersson
code to be more in line with the ScummVM coding style. svn-id: r9878
2003-08-27use file class for speech so people with clusters in different directories ↵Jonathan Gray
get to hear sound as well svn-id: r9875
2003-08-27errr. this shouldn't have been committedJoost Peters
svn-id: r9872
2003-08-27Basic speech code, the change in speech.cpp is needed for me, but I am ↵Joost Peters
afraid it might break "speech.clu opening" for someone else..I'm confused as to how this all works. heh. Anyway, if you hear no voices: this is probably where to look. svn-id: r9871
2003-08-26Handle the fadeNow parameter to BS2_SetPalette() so that the palette isTorbjörn Andersson
only uploaded to the backend if fadeNow == RDPAL_INSTANT. Otherwise, assume that FadeServer() will do it for us, eventually. I think this is the correct behaviour, and it prevents the bug where the unfaded room image might flash by briefly when moving the mouse while changing rooms. svn-id: r9868
2003-08-26The graphics detail settings partially work now. They only affect howTorbjörn Andersson
sprites are drawn, but I think that's how it should be. 1: No bells or whistles. 2: This setting adds sprite blending, e.g. the smoke at the docks or the display cases at the Glease Gallery. 3: This setting adds light map support, e.g. when walking under the shack at the docks. 4: This setting adds better scaling algorithms. The first three settings should work fine now. In fact, the third setting is what we used to implement. The fourth setting still needs work and testing. I've added code for downscaling case, but frankly I'm not convinced the result is any better than with the simpler scaler. I usually can't even tell the difference. Of course, my translation of the original code could very well be buggy. svn-id: r9867
2003-08-25Clarified the comments for our Surface class a bit. I plan on removing itTorbjörn Andersson
completely soon, so don't use it unless you really, really need to. svn-id: r9855
2003-08-25FadeServer() is now called from ServiceWindows(), thus eliminating the needTorbjörn Andersson
for the making it a timer handler. This should eliminate the occasional glitches I've been seeing with fades not being completed. I'm also hoping that it will fix the problem where the game would sometimes hang when moving between rooms. I know that at least once when I had that happen to me the game was busy-waiting for the palette to fade. At the very least, it's one place less to worry about thread-safety in. svn-id: r9854