aboutsummaryrefslogtreecommitdiff
path: root/sword2/layers.cpp
AgeCommit message (Collapse)Author
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-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-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-01Updated copyright year.Torbjörn Andersson
svn-id: r16397
2004-09-12As an experiment, expire SCREEN_FILE resources faster than other resources.Torbjörn Andersson
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-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-04-24fetchObjectName() no longer assumes that the resource will still be in theTorbjörn Andersson
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-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-04-07Cleanup.Torbjörn Andersson
svn-id: r13494
2004-03-28Cleanup.Torbjörn Andersson
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-02-05Removed some of the #includes from sword2.hTorbjörn Andersson
svn-id: r12739
2004-01-06It's a new year in BS2 land, too!Torbjörn Andersson
svn-id: r12181
2003-12-28Hopefully the last big renaming. Now the datatypes have names likeTorbjörn Andersson
"StandardHeader" instead of "_standardHeader". svn-id: r11997
2003-11-16More cleanup. I've eliminated all the temporary global variables I've addedTorbjörn Andersson
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-11Moved low-level keyboard and mouse handling to a new Input class, andTorbjörn Andersson
renamed the Display class Graphics for no better reason than me liking the phrase "sound and graphics" better than "sound and display". svn-id: r11258
2003-11-08Moved more stuff into classes, changed some static allocation to dynamic,Torbjörn Andersson
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-03The resource and memory managers are now created dynamically.Torbjörn Andersson
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-02Moved some more "homeless" functions into Sword2Engine. (Don't worry -- ITorbjörn Andersson
promise I will get rid of g_sword2 later.) svn-id: r11057
2003-11-01More moving of stuff into classesTorbjörn Andersson
svn-id: r11025
2003-10-28bs2 -> sword2Max Horn
svn-id: r10997
2003-10-26Enable the debug console. Actually, what I've done is to adapt the debugTorbjörn Andersson
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-18Moved the opcode functions into the Logic class.Torbjörn Andersson
svn-id: r10885
2003-10-15Dumped most of the remaining "driver" code into a new "Display" class. ThisTorbjörn Andersson
touches a lot of the code, of course, and adds yet another global variable (temporarily, I hope), but everything still seems to work. Knock on wood. svn-id: r10806
2003-10-07Some cleanup, some code removal and some unstubbing. Nothing important.Torbjörn Andersson
svn-id: r10659
2003-10-04Changed to use #include "bs2/..." and removed the inclusion of standard CTorbjörn Andersson
headers. Most (all?) of the ones we need should probably come from stdafx.h instead. svn-id: r10588
2003-10-04added namespace Sword2Max Horn
svn-id: r10581
2003-09-30Changed the resource manager object to use more ScummVM-like naming.Torbjörn Andersson
svn-id: r10499
2003-09-27More cleanup, and I've replaced most - not quite all - of BS2's debugTorbjörn Andersson
message functions with our own. We still need to go through them and assign sensible debug levels to them. svn-id: r10422
2003-09-26Some more reformatting / cleanup, and removal of comments that did nothingTorbjörn Andersson
but say who added what when. (No disrespect intended, but this information means very little to us.) svn-id: r10413
2003-09-17cleanupTorbjörn Andersson
svn-id: r10267
2003-09-09Added a WaitForFade() function, to replace numerous while-loops scatteredTorbjörn Andersson
througout the code. svn-id: r10127
2003-07-30rename bs2 to sword2 to have the same name as the original engine.Oliver Kiehl
besides this way all our engines start with an "s" ;) svn-id: r9301
2003-07-28rename _DEBUG define to _BS2_DEBUG to stop it conflicting with VCJonathan Gray
svn-id: r9237
2003-07-28Compiles on mingw nowTravis Howell
svn-id: r9222
2003-07-28bs2Jonathan Gray
svn-id: r9211