aboutsummaryrefslogtreecommitdiff
path: root/sword2/console.cpp
AgeCommit message (Collapse)Author
2006-02-11Moved engines to the new engines/ directoryMax Horn
svn-id: r20582
2006-02-09Fix $Header$ and some minor file header inconsistencies.Torbjörn Andersson
svn-id: r20444
2006-01-18Update copyright noticeEugene Sandulenko
svn-id: r20088
2006-01-01Some cleanup/paranoia fixes to the previous missing voices/music fix. TreatTorbjörn Andersson
files marked as being on both CDs (I haven't seen any such file -- ever), treat it as if it's on the hard disk. Also, the "cd" field of the ResourceFile struct now holds 0, 1 or 2, not the bit flags from the data file. (This last change is not in the 0.8 branch.) svn-id: r19884
2005-10-29Applied my own patch #1341495, in an attempt to fix alignment issuesTorbjörn Andersson
reported by Crilith. To elaborate a bit, the engine no longer accesses resource data through packed structs. Instead it uses memory streams and the READ/WRITE functions. If data is mainly read, not written, I have replaced the old struct with a new one with a read() function to read the whole thing from memory into the struct's variables, and a write() function to dump the struct's variables to memory. In fact, most of these write() functions remain unused. If data is both read and written, I have replaced the struct with a class with individual get/set functions to replace the old variables. This manipulates memory directly. Since I'm fairly sure that these structs are frequently stored as local variables for a script, all script variables (both local and global) are stored as little-endian and accessed through the READ/WRITE functions, rather than being treated as arrays of 32-bit integers. On a positive note, the functions for doing endian conversion of resources and save games have been removed, and some general cleanups have been made to assist in the rewrite. Initial reports indicate that this patch indeed fixes alignment issues, and that I have not - surprisingly - broken the game on big-endian platforms. At least not in any immediately obvious way. And there's still plenty of time to fix regressions before 0.9.0, too. svn-id: r19366
2005-10-18Update FSF address. Eek. Actually that took place on May 1, 2005Eugene Sandulenko
svn-id: r19142
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-12Whitespace: "(type *)something" instead of "(type *) something", becauseTorbjörn Andersson
that's how we write it in most other places. svn-id: r18069
2005-02-22Moved some debugging stuff into the debugger class.Torbjörn Andersson
svn-id: r16859
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-11-14CleanupTorbjörn Andersson
svn-id: r15810
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-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-05-01Made the "debugoff" console command actually turn *off* the debug info.Torbjörn Andersson
svn-id: r13704
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-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-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-01Removed some unnecessary / commented out code, and initialized the debugTorbjörn Andersson
console a bit earlier so that error messages about missing files will be more obvious to the user. (If an error happens that early, some of the debugger commands will cause ScummVM to crash. I might look into that later.) svn-id: r11443
2003-11-27Mostly whitespace changes, but also a few modifications to the stillTorbjörn Andersson
experimental resource dumping code. svn-id: r11382
2003-11-19Eliminated some more references to g_sword2. I think the only thing thatTorbjörn Andersson
still uses it are the engine's global variables which, on the other hand, are used *everywhere*. I'll have to think some more about those. I guess I should take a closer look at how the other engines handle them. (That goes for a lot of things by the way.) svn-id: r11349
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-15Mostly cleanup. Also prevented what would probably have been an infiniteTorbjörn Andersson
loop if ScummVM failed to find a file in the demo. (Now it should error out instead, which is marginally preferable.) svn-id: r11298
2003-11-11Removed SVM_timeGetTime(). We may as well call get_msecs() directly.Torbjörn Andersson
svn-id: r11260
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-08Removed some now redundant header files.Torbjörn Andersson
svn-id: r11209
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-04Create g_logic dynamically. More moving of stuff into classes.Torbjörn Andersson
svn-id: r11129
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-02Even more stuff moving into Sword2Engine. I'm tempted to make a new classTorbjörn Andersson
for the mouse stuff, but I need to think about that a bit more. I have a feeling the code could be cleaned up a bit anyway... svn-id: r11060
2003-11-02More moving of stuff into classes. I had to make a few changes/cleanups toTorbjörn Andersson
events.cpp, so there could be regressions. svn-id: r11053
2003-11-02turned NewGui into a singleton, and made OSystem a pseudo-singleton; added ↵Max Horn
Widget::findWidget (preparing to add support for nested widgets, for the tab widget) svn-id: r11045
2003-10-28bs2 -> sword2Max Horn
svn-id: r10997
2003-10-26factor out common debugger codeMax Horn
svn-id: r10984
2003-10-26cleanupMax Horn
svn-id: r10982
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-11Moved the text drawing stuff into a class of its own. (Adding anotherTorbjörn Andersson
global variable which will hopefully be dealt with later.) svn-id: r10734
2003-10-08Some more cosmetic changes while I'm considering the next move. (Or maybeTorbjörn Andersson
I'm just hoping that if I stall long enough, someone else will make the move for me. :-) svn-id: r10676
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-30Moved the memory manager functions into an object of its own (and enabledTorbjörn Andersson
debugging levels). This needs further cleanups, but I believe I have reached a stable point where I can commit it without too much anxiety. svn-id: r10502