aboutsummaryrefslogtreecommitdiff
path: root/sword2/sword2.cpp
AgeCommit message (Collapse)Author
2005-10-23Unified Broken Sword 1 & 2 name (instead of I & II) -- usage is more ↵Max Horn
consistent with other numerically numbered games (and also internally consistent). Work in progress. svn-id: r19249
2005-10-18Update FSF address. Eek. Actually that took place on May 1, 2005Eugene Sandulenko
svn-id: r19142
2005-10-17Fixed end credits crash. (See bug #1327650). Actually, there were severalTorbjörn Andersson
more or less serious bugs here: * The fnResetGlobals() function returned IR_CONT. Since it potentially kills its own script resource, this can lead to illegal read accesses. Not it returns IR_STOP instead. This was probably a bug in the original interpreter as well, but it handled memory allocation quite differently so it was probably never an issue. * Since fnResetGlobals() forcibly closes resources, I've changed the closeResource() function to silently ignore requests to close resources where the data pointer is NULL. While it could signify an error, it isn't necessarily so. * Don't force the screen to fade up after the credits -- let the script do it instead. This prevents it from fading up the wrong image. svn-id: r19127
2005-07-30Remove trailing whitespaces.Eugene Sandulenko
svn-id: r18604
2005-07-09This should really be two or three different commits, but I'm too lazy forTorbjörn Andersson
that: * Re-worked the elevator script bug workaround so that it's more consistent with the other two script bug workarounds. * Some renamings to make it more clear that game events and input events are two completely different things. * Added function for clearing pending input events, and used that to fix an annoying keyboard repeat bug when closing the debug console. (The console would keep re-opening because the key press to open it kept repeating even though the key had been released.) svn-id: r18522
2005-05-31Added keyboard auto-repeat. (I've been meaning to do that for a long time.)Torbjörn Andersson
svn-id: r18302
2005-05-12Whitespace: "(type *)something" instead of "(type *) something", becauseTorbjörn Andersson
that's how we write it in most other places. svn-id: r18069
2005-05-10Moved class SoundMixer to Audio::Mixer (didn't call the namespace 'Sound' ↵Max Horn
because we already have many classes with that name) svn-id: r18039
2005-05-10Moved class File and the MD5 stuff to namespace CommonMax Horn
svn-id: r18037
2005-05-02Cleanup. Most of is simply moves the credits code out of Logic and intoTorbjörn Andersson
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-04-24Moved conversation stuff from Logic to Mouse.Torbjörn Andersson
svn-id: r17787
2005-03-25Patch #1117443 (Experimental plugin code revision)Max Horn
svn-id: r17231
2005-03-09changing AudioDataType -> SoundType, so now the constant names match the ↵Max Horn
name of the data type / the SoundMixer method names svn-id: r17052
2005-02-27Got rid of all the .h files but one in the 'driver' directory. They wereTorbjörn Andersson
either very small or, in the case of driver96.h, a disorganized jumbles. svn-id: r16952
2005-02-21Some cleanup and renaming. (It was confusing to see "load" sometimes andTorbjörn Andersson
"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-21removed lots of unnecessary seek()s and read()s by keeping the datafiles' ↵Robert Göffringmann
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-20More BS2 restructuring.Torbjörn Andersson
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-19This is the second part of the BS2 restructuring. There are two newTorbjörn Andersson
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-01-28Began what I hope is the final major restructuring of the BS2 engine.Torbjörn Andersson
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-17Updated copyright header, as discussed on the mailing list.Torbjörn Andersson
svn-id: r16580
2005-01-10system.h was being included in tons of places, without any good reason; ↵Max Horn
reduced this (total dependencies on system.h went down from 193 to 85 files) svn-id: r16527
2005-01-01Updated copyright year.Torbjörn Andersson
svn-id: r16397
2004-12-27Use the mixer to handle sound volumesMax Horn
svn-id: r16349
2004-12-27Added 'sound types' to the mixer - for now, only plain (for the premixer), ↵Max Horn
SFX and music; volume is now controlled based on the sound type svn-id: r16330
2004-12-09Pass subdirectories to gamedetector functionsRobert Göffringmann
svn-id: r16002
2004-12-05Clean up OSystem::EventMax Horn
svn-id: r15990
2004-11-29Fix music volumeEugene Sandulenko
svn-id: r15960
2004-11-24Fix a`ll engines. They work, though current fix is just temporary.Eugene Sandulenko
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-23Added Engine::init() method; added return value to Engine::go()Max Horn
svn-id: r15865
2004-11-20Removing walkthrough stuff again (talked to aquadran about this, he had no ↵Max Horn
objections) svn-id: r15849
2004-11-19added walkthroughPaweł Kołodziejski
svn-id: r15835
2004-11-16CleanupTorbjörn Andersson
svn-id: r15826
2004-11-15I think this is the kind of constructor/go changes _sev was talking aboutTorbjörn Andersson
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-14CleanupTorbjörn Andersson
svn-id: r15810
2004-10-12Migration to the newer form of setupPremix().Torbjörn Andersson
svn-id: r15532
2004-10-08Prevent double slash in pathChris Apers
svn-id: r15473
2004-09-28Rename remaining OSystem methods to match our coding guidelinesMax Horn
svn-id: r15332
2004-09-08Fixed evil regression #2. Restarting the game, or using the "start" debugTorbjörn Andersson
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-06-28Enhanced default directory support in the File class; now one can specify ↵Max Horn
arbitrary many default search directories svn-id: r14095
2004-05-09Removed the buffering of mouse and keyboard events. I don't think any ofTorbjörn Andersson
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-05Cleanup.Torbjörn Andersson
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-04-23Major revamping of the BS2 memory manager and, some small changes to theTorbjörn Andersson
resource manager. All new code! All new bugs! svn-id: r13603
2004-03-29Cleanup.Torbjörn Andersson
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-28Don't show the restart/restore dialog if a boot parameter has been given.Torbjörn Andersson
And a teensy-weensy little cleanup. svn-id: r13399
2004-03-27Make sure looping music is restarted after loading a savegame, regardlessTorbjörn Andersson
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-17Use the same syntax for accessing script variables as BS1 does, i.e. nowTorbjörn Andersson
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-04If the user has previous savegames, display a restart/restore dialog whenTorbjörn Andersson
the game starts. (I know it could look prettier, but I don't have much to work with here...) svn-id: r13178
2004-02-05Removed some of the #includes from sword2.hTorbjörn Andersson
svn-id: r12739
2004-02-05renamed (Const)Iterator to (const_)iterator; changed size() to return an uintMax Horn
svn-id: r12722
2004-01-08Allow quitting during cutscenes and credits again. This is getting a bitTorbjörn Andersson
hackish... svn-id: r12247