Commit Graph

334 Commits

Author SHA1 Message Date
Eugene Sandulenko
c528765814 SWORD25: getSoundTime() is not used. Remove it.
svn-id: r55320
2011-01-19 07:40:30 +00:00
Eugene Sandulenko
4bc730f256 SWORD25: Strip off unportable functions
svn-id: r55319
2011-01-19 07:40:10 +00:00
Torbjörn Andersson
da42014402 SWORD25: Fix main menu button text colour
In the other cases I've found in the code, the colour components are
stored in the order B, G, R and A. Assume that's the case here too. I
hope that is correct. It doesn't seem to break anything obvious.

svn-id: r55255
2011-01-16 08:15:47 +00:00
Torbjörn Andersson
aa9786604c JANITORIAL: Remove unnecessary semicolon.
svn-id: r55077
2010-12-31 15:19:42 +00:00
Matthew Hoops
375f32fbe9 VIDEO: Make VideoDecoder::decodeNextFrame() return a const Surface pointer
svn-id: r54927
2010-12-16 01:35:13 +00:00
Max Horn
6edc86a19b DEBUG: Let GUI::Debugger::preEnter and postEnter (un)pause the engine
svn-id: r54815
2010-12-07 18:54:21 +00:00
Max Horn
b3ba5f6ec5 SWORD25: Fix warning about uninitialized DijkstraNode::parentIter
svn-id: r54551
2010-11-28 21:33:27 +00:00
Max Horn
5d2b77899f SWORD25: Fix warning: deref type-punned pointer breaks strict-aliasing rules
svn-id: r54550
2010-11-28 21:33:02 +00:00
Max Horn
2180b2d6b5 COMMON: Split common/stream.h into several headers
svn-id: r54385
2010-11-19 17:03:07 +00:00
Max Horn
ee4770ffb6 ENGINES: Change 'colour' to 'color'
Only changed this in engines where 'color' was/is already used
almost exclusively

svn-id: r54288
2010-11-17 12:22:08 +00:00
Max Horn
abe1959d36 COMMON: Simplify DECLARE_SINGLETON macro
This makes it possible to write
  DECLARE_SINGLETON(foo);
instead of
  DECLARE_SINGLETON(foo)
without causing a warning about an extra semicolon.
The extra semicolon helps some editors at parsing the C++ code.

svn-id: r54258
2010-11-16 08:23:13 +00:00
David Turner
7ad677afc8 SWORD25: Added basic debugging console to engine (Command Key Disabled)
Since SWORD25 uses Debug Channels, this allows for the interactive setting of debugflags as well as providing a base for adding further debugging commands.

However, this is not currently usable as the command key code is commented out.
This is due to the event loop which reads keyboard input being buried 2 object layers below the Engine VM object and I am unsure how the engine development team would want this exposed / interfaced.

svn-id: r54184
2010-11-10 04:30:24 +00:00
Max Horn
44c6a90643 LUA: Tweak lua_ident to not conflict with SVN keywords (since this is not used at all, only used to 'mark' binaries compiling Lua in, I think we could safely remove it, too)
svn-id: r54056
2010-11-04 00:31:50 +00:00
Max Horn
0f7645dda9 Trying to fix weird keyword expansion quirk
svn-id: r54055
2010-11-04 00:13:23 +00:00
Max Horn
0c018bf392 SWORD25: cleanup
svn-id: r54045
2010-11-03 00:19:28 +00:00
Max Horn
438da9b220 SWORD25: Convert printf to debugN
svn-id: r54040
2010-11-02 09:50:45 +00:00
Max Horn
6fa8772bae SWORD25: Replace art_warn/art_die by warning/error
svn-id: r54002
2010-11-01 16:00:35 +00:00
Max Horn
44393b2dc8 ALL: Add code to help stop people from accidentally using "bad" APIs
A new header file common/forbidden.h is included by scummsys.h and it
re-#defines numerous symbols like fopen(), fread(), system(), etc. with
garbage, in order to provoke compile errors in any code using them.

If a .cpp file really *must* use any of these (e.g. because it is a
backend file), then these redefinitions can be disabled by #defining
FORBIDDEN_SYMBOL_ALLOW_ALL as the first thing in the .cpp file. Whenever
this is done, an explanatory comment should be added.

Note that this system cannot catch all "bad" usages (notably the Lua
code in the sword25 engine), as it can only work if scummsys.h is
included.

svn-id: r53961
2010-10-30 21:27:42 +00:00
Torbjörn Andersson
71e08336c0 SWORD25: Play the cutscene audio
Once the audio buffer has been queued in the audio stream, the Theora
decoder is no longer responsible for it. It has to allocate a new
audio buffer for the next set of audio data.

Of course, at the moment the audio is pretty useless because the
playback speed is all wrong.

svn-id: r53939
2010-10-30 09:17:21 +00:00
Torbjörn Andersson
09c678e363 SWORD25: Fix hanging cutscene video
Even though our video player does not (yet) support audio, we need to
adjust the values of _audiobufFill and _audiobufReady as if it did, or
it will never realize it has reached the end of the cutscene.

Also fixes what looks like a typo in audio data clipping.

svn-id: r53938
2010-10-30 08:21:10 +00:00
Paul Gilbert
919d79f091 SWORD25: Added a hack to allow the new English voice pack to be detected
svn-id: r53937
2010-10-30 04:30:42 +00:00
Johannes Schickel
2c042c263b SWORD25: Comment out unused static variable.
svn-id: r53909
2010-10-28 22:45:15 +00:00
Paul Gilbert
b53d12da23 SWORD25: Standardised savegame filenames, start on advanced engine features
svn-id: r53901
2010-10-28 09:51:56 +00:00
Max Horn
b2fa7e58a3 SWORD25: Start to rename read/write methods of *PersistenceBlock classes
All should be renamed to reduce risk of accidental incorrect use.

svn-id: r53899
2010-10-28 00:26:25 +00:00
Max Horn
cf3551525f SWORD25: Get rid of CallbackRegistry
svn-id: r53898
2010-10-28 00:25:33 +00:00
Max Horn
7e1d78cab1 SWORD25: Simplify InputEngine::(un)persist
svn-id: r53897
2010-10-28 00:24:53 +00:00
Max Horn
aaf7ffdd5c SWORD25: Fix keyboard state handling
Previously, you could get the game into a state where it would think a
key was constantly being pressed. E.g. by pressing 'p' several times
quickly in a row, the game would end in a state where it endlessly
toggled between pause mode and regular mode.

svn-id: r53878
2010-10-27 15:53:53 +00:00
Max Horn
95353b0e60 SWORD25: Use ScummVM keycodes
This should enable use of F-keys in BS25. Most of the KEY_*
constants are not used by the scripts anyway.

svn-id: r53877
2010-10-27 15:53:36 +00:00
Max Horn
b5e41b3a82 SWORD25: Fix out of bounds writes when pressing keys like ctrl or F-keys
This fixes a crash one got by quitting via the GMM.

svn-id: r53876
2010-10-27 15:15:59 +00:00
Max Horn
8217efc74a SWORD25: Disable script triggered screenshots
svn-id: r53840
2010-10-25 23:34:36 +00:00
Max Horn
ed0de8462d SWORD25: Add FIXME about savegame names; cleanup
svn-id: r53839
2010-10-25 23:34:12 +00:00
Max Horn
a783285625 SWORD25: Simplify FS 'wrapper' code a bit, add FIXME comments
The save system of this engine currently partially bypasses the
SaveFileManager API, by (abusing) the fact that the Lua engine allows
creating files in arbitrary places (it exposes fopen, fread, fwrite
etc.). This is used to create a 'config.lua' configuration file. This makes it non-portable.

In addition, the filenames used for the savestates ("0.b25s") do not
comply with our naming conventions for engine savestates.

It should be possible to overcome all this, but it might require hacking
the Lua engine; or we could try to replace some of the BS2.5 script
functions with our own, dynamically.

svn-id: r53838
2010-10-25 23:19:39 +00:00
Max Horn
e0d5db0bb8 SWORD25: 'Implement' RTL support & add TODOs about missing feature support
svn-id: r53837
2010-10-25 22:41:48 +00:00
Max Horn
e761f76653 SWORD25: Get rid of most of the 'kernel service/superclass' code
svn-id: r53835
2010-10-25 22:41:25 +00:00
Max Horn
90dcc8c91a SWORD25: Get rid of classes ScummVMWindow and Window
svn-id: r53832
2010-10-25 21:51:11 +00:00
Max Horn
518526ba2f SWORD25: Remove some dead code; cleanup
svn-id: r53760
2010-10-24 01:53:32 +00:00
Max Horn
fa0151683c SWORD25: Replace ResourceManager's hash table by a Common::HashMap
svn-id: r53759
2010-10-24 01:53:01 +00:00
Max Horn
48d15398e5 SWORD25: Get rid of kernel/string.h
svn-id: r53758
2010-10-24 01:52:27 +00:00
Max Horn
2a987c4a31 SWORD25: Simplify & optimize PNG reading code
The interlaced part is untested since I do not know any place
in the game where interlaced data is used.

svn-id: r53757
2010-10-24 01:33:24 +00:00
Max Horn
4d6fb4e768 SWORD25: Get rid of colorFormat parameter in PNGLoader API
Only CF_ARGB32 was supported anyway.

svn-id: r53756
2010-10-24 01:32:52 +00:00
Max Horn
7cc8811a5c SWORD25: Merge classes PNGLoader, ImageLoader and ImageLoaderManager
This looses some flexibility when it comes to supporting other image
formats. But since the game does not use other image formats, this seems
rather irrelevant, compared to how much simpler the code now is.

svn-id: r53755
2010-10-24 01:32:15 +00:00
Max Horn
1e16d576ca SWORD25: Merge B25SLoader into PNGLoader
svn-id: r53754
2010-10-24 01:31:30 +00:00
Max Horn
85e3ddc309 SWORD25: Add ImageLoaderManager, get rid of last globally constructed object
This also gets rid of an evil use of atexit.

svn-id: r53753
2010-10-24 01:30:53 +00:00
Max Horn
2da4469686 SWORD25: Remove outdated comments
svn-id: r53752
2010-10-24 01:29:59 +00:00
Max Horn
360f67636b SWORD25: Register LUA callbacks insider registerScriptBindings() methods
Previously, the constructor of an anonymous global object was used to do
this, for no apparent reason.
However, maybe there was a hidden reason which I missed, so this change
might cause regressions. I.e., please test.

svn-id: r53735
2010-10-23 15:44:33 +00:00
Max Horn
c483a22f2a SWORD25: Get rid of global SharedPtr instances
svn-id: r53734
2010-10-23 15:44:04 +00:00
Paul Gilbert
14e82dbe7f SWORD25: Added description field to savegames
This stores the date and time of when the game was saved, since ScummVM doesn't support getting a file's age like the original engine did.

svn-id: r53638
2010-10-20 11:11:09 +00:00
Paul Gilbert
66ecd08868 SWORD25: Fix to correctly write game state to savegame files
svn-id: r53637
2010-10-20 10:53:50 +00:00
Eugene Sandulenko
6629efc676 SWORD25: Enforced code formatting rules in rest of the engine
svn-id: r53626
2010-10-19 21:03:33 +00:00
Eugene Sandulenko
ae78107e2a SWORD25: Enforce code naming conventions in gfx/*
svn-id: r53625
2010-10-19 20:54:30 +00:00