diff --git a/AUTHORS b/AUTHORS index ca6342d8360..89ad7dc1b22 100644 --- a/AUTHORS +++ b/AUTHORS @@ -19,7 +19,7 @@ ScummVM Team Jonathan Gray - (retired) Vincent Hamm - (retired) Max Horn - Travis Howell + Travis Howell - (retired) Pawel Kolodziejski - Codecs, iMUSE, Smush, etc. Gregory Montoir Eugene Sandulenko - FT INSANE, MM NES, MM C64, game detection, @@ -28,7 +28,7 @@ ScummVM Team HE: Jonathan Gray - (retired) - Travis Howell + Travis Howell - (retired) Gregory Montoir Eugene Sandulenko @@ -45,40 +45,18 @@ ScummVM Team AGOS: Torbjorn Andersson Paul Gilbert - Travis Howell + Travis Howell - (retired) Oliver Kiehl - (retired) Ludvig Strigeus - (retired) - BASS: - Robert Goeffringmann - (retired) - Oliver Kiehl - (retired) - Joost Peters - - Broken Sword: - Fabio Battaglia - PSX version support - Thierry Crozat - Mac version support - Robert Goeffringmann - (retired) - - Broken Sword II: - Torbjorn Andersson - Fabio Battaglia - PSX version support - Jonathan Gray - (retired) - - Broken Sword 2.5: - Eugene Sandulenko - Filippos Karapetis - Max Horn - Paul Gilbert - Torbjorn Andersson - - Cinematique evo 1: + Cine: Vincent Hamm - (retired) Pawel Kolodziejski Gregory Montoir Kari Salminen Eugene Sandulenko - Cinematique evo 2: + CruisE: Paul Gilbert Vincent Hamm - (retired) @@ -90,11 +68,6 @@ ScummVM Team Filippos Karapetis Pawel Kolodziejski - FOTAQ: - David Eriksson - (retired) - Gregory Montoir - Joost Peters - Gob: Torbjorn Andersson Arnaud Boutonne @@ -118,7 +91,7 @@ ScummVM Team Gregory Montoir Johannes Schickel - Last Express: + Lastexpress: Matthew Hoops Jordi Vilalta Prat Julien Templier @@ -147,6 +120,11 @@ ScummVM Team Parallaction: peres + Queen: + David Eriksson - (retired) + Gregory Montoir + Joost Peters + SAGA: Torbjorn Andersson Filippos Karapetis @@ -164,6 +142,28 @@ ScummVM Team Jordi Vilalta Prat Lars Skovlund + Sky: + Robert Goeffringmann - (retired) + Oliver Kiehl - (retired) + Joost Peters + + Sword1: + Fabio Battaglia - PSX version support + Thierry Crozat - Mac version support + Robert Goeffringmann - (retired) + + Sword2: + Torbjorn Andersson + Fabio Battaglia - PSX version support + Jonathan Gray - (retired) + + Sword25: + Eugene Sandulenko + Filippos Karapetis + Max Horn + Paul Gilbert + Torbjorn Andersson + TeenAgent: Robert Megone - Help with callback rewriting Vladimir Menshakov @@ -222,7 +222,8 @@ ScummVM Team PocketPC / WinCE: Nicolas Bacca - (retired) - Kostas Nakos + Ismail Khatib + Kostas Nakos - (retired) PlayStation 2: Robert Goeffringmann - (retired) @@ -357,7 +358,7 @@ Other contributions Markus Strangl Win32: - Travis Howell + Travis Howell - (retired) Win64: Chris Gray - (retired) diff --git a/COPYING b/COPYING index b6f92f3dbfa..75a1ad8761e 100644 --- a/COPYING +++ b/COPYING @@ -1,8 +1,8 @@ GNU GENERAL PUBLIC LICENSE Version 2, June 1991 - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to +the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not @@ -303,10 +303,9 @@ the "copyright" line and a pointer to where the full notice is found. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. @@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names: This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. \ No newline at end of file diff --git a/COPYRIGHT b/COPYRIGHT index fca190596fc..f240725e1c9 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -40,10 +40,10 @@ Travis Howell Janne Huttunen Felix Jakschitsch Jeroen Janssen -Willem Jan Palenstijn Florian Kagerer Filippos Karapetis Andreas Karlsson +Ismail Khatib Oliver Kiehl Martin Kiewitz Pawel Kolodziejski @@ -58,6 +58,7 @@ Gregory Montoir Kostas Nakos Mikesch Nepomuk Nicolas Noble +Willem Jan Palenstijn Lars Persson Joost Peters Tim Phillips diff --git a/Makefile b/Makefile index 4a6a1572597..dd921b82aad 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,3 @@ -# $URL$ -# $Id$ ####################################################################### # Default compilation parameters. Normally don't edit these # diff --git a/Makefile.common b/Makefile.common index 8aee2b6d6e1..7c81a0d80c9 100644 --- a/Makefile.common +++ b/Makefile.common @@ -1,8 +1,6 @@ # This file is used by Makefile and declares common build rules, # a list of common object files etc. # -# $URL$ -# $Id$ ###################################################################### # The default build target: just build the scummvm executable diff --git a/NEWS b/NEWS index 26085c089e3..6fda0a8f39d 100644 --- a/NEWS +++ b/NEWS @@ -5,7 +5,7 @@ For a more comprehensive changelog of the latest experimental code, see: SDL ports: - Added support for OpenGL (GSoC Task). -1.3.0 (????-??-??) +1.3.0 (2011-05-28) New Games: - Added support for Backyard Baseball. - Added support for Backyard Baseball 2001. @@ -1123,7 +1123,7 @@ For a more comprehensive changelog of the latest experimental code, see: - Added MMX i386 assembler versions of the HQ2x and HQ3x scalers. - Added 'Extra Path' option allows for a searching an additional datafile location (for reencoded cutscenes and the like). - - Disabled Alt-x and Ctrl-z quit keys in favour of Ctrl-q on unix like + - Disabled Alt-x and Ctrl-z quit keys in favor of Ctrl-q on unix like operating systems, like Linux (exception: Mac OS X still uses Cmd-q). - Separate smaller font for the console, allowing for more visible information, for example in the SCUMM debugger. diff --git a/audio/audiostream.cpp b/audio/audiostream.cpp index 0cfbabf53bd..547aa77526c 100644 --- a/audio/audiostream.cpp +++ b/audio/audiostream.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/audio/audiostream.h b/audio/audiostream.h index 22de21cb34e..0ffaa241cea 100644 --- a/audio/audiostream.h +++ b/audio/audiostream.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SOUND_AUDIOSTREAM_H diff --git a/audio/decoders/adpcm.cpp b/audio/decoders/adpcm.cpp index a9284973d50..d28ed222a56 100644 --- a/audio/decoders/adpcm.cpp +++ b/audio/decoders/adpcm.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/stream.h" diff --git a/audio/decoders/adpcm.h b/audio/decoders/adpcm.h index 10344101e2b..1dd4d510df7 100644 --- a/audio/decoders/adpcm.h +++ b/audio/decoders/adpcm.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** diff --git a/audio/decoders/adpcm_intern.h b/audio/decoders/adpcm_intern.h index f875bd88c79..c9f894fb841 100644 --- a/audio/decoders/adpcm_intern.h +++ b/audio/decoders/adpcm_intern.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** diff --git a/audio/decoders/aiff.cpp b/audio/decoders/aiff.cpp index 957fb136384..f3b0dfb5599 100644 --- a/audio/decoders/aiff.cpp +++ b/audio/decoders/aiff.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/audio/decoders/aiff.h b/audio/decoders/aiff.h index dddbffb5209..558a018f576 100644 --- a/audio/decoders/aiff.h +++ b/audio/decoders/aiff.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** diff --git a/audio/decoders/flac.cpp b/audio/decoders/flac.cpp index fe15877ac6c..d06a7b9c0e6 100644 --- a/audio/decoders/flac.cpp +++ b/audio/decoders/flac.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides for FILE as that is used in FLAC headers @@ -306,7 +303,7 @@ int FLACStream::readBuffer(int16 *buffer, const int numSamples) { const uint numChannels = getChannels(); if (numChannels == 0) { - warning("FLACStream: Stream not successfully initialised, cant playback"); + warning("FLACStream: Stream not successfully initialized, cant playback"); return -1; // streaminfo wasnt read! } diff --git a/audio/decoders/flac.h b/audio/decoders/flac.h index 69222f22a16..3182b26425a 100644 --- a/audio/decoders/flac.h +++ b/audio/decoders/flac.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** diff --git a/audio/decoders/iff_sound.cpp b/audio/decoders/iff_sound.cpp index 8efe017e755..4efdce03384 100644 --- a/audio/decoders/iff_sound.cpp +++ b/audio/decoders/iff_sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/decoders/iff_sound.h" diff --git a/audio/decoders/iff_sound.h b/audio/decoders/iff_sound.h index 4d26b32e712..b266e629a1b 100644 --- a/audio/decoders/iff_sound.h +++ b/audio/decoders/iff_sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** diff --git a/audio/decoders/mac_snd.cpp b/audio/decoders/mac_snd.cpp index fc699888601..43253a9ddfa 100644 --- a/audio/decoders/mac_snd.cpp +++ b/audio/decoders/mac_snd.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/audio/decoders/mac_snd.h b/audio/decoders/mac_snd.h index bf6331a265d..cbbd82bbe03 100644 --- a/audio/decoders/mac_snd.h +++ b/audio/decoders/mac_snd.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** diff --git a/audio/decoders/mp3.cpp b/audio/decoders/mp3.cpp index 91bd49873a0..8d7f006ec7e 100644 --- a/audio/decoders/mp3.cpp +++ b/audio/decoders/mp3.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/decoders/mp3.h" diff --git a/audio/decoders/mp3.h b/audio/decoders/mp3.h index d3a5b70d454..86ddc599ea6 100644 --- a/audio/decoders/mp3.h +++ b/audio/decoders/mp3.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** diff --git a/audio/decoders/qdm2.cpp b/audio/decoders/qdm2.cpp index dbce8d2447f..a178c363b5b 100644 --- a/audio/decoders/qdm2.cpp +++ b/audio/decoders/qdm2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Based off ffmpeg's QDM2 decoder diff --git a/audio/decoders/qdm2.h b/audio/decoders/qdm2.h index 6988623dcb2..c0ec647bfdd 100644 --- a/audio/decoders/qdm2.h +++ b/audio/decoders/qdm2.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Only compile if Mohawk is enabled or if we're building dynamic modules diff --git a/audio/decoders/qdm2data.h b/audio/decoders/qdm2data.h index cfe1a3d10eb..d92bc0ff801 100644 --- a/audio/decoders/qdm2data.h +++ b/audio/decoders/qdm2data.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AUDIO_QDM2DATA_H diff --git a/audio/decoders/raw.cpp b/audio/decoders/raw.cpp index cf787f9b12b..4789fd0f36b 100644 --- a/audio/decoders/raw.cpp +++ b/audio/decoders/raw.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/audio/decoders/raw.h b/audio/decoders/raw.h index 23ed02182dd..5a7897b688f 100644 --- a/audio/decoders/raw.h +++ b/audio/decoders/raw.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SOUND_RAW_H diff --git a/audio/decoders/vag.cpp b/audio/decoders/vag.cpp index 2c3a36202ab..10ef69708c7 100644 --- a/audio/decoders/vag.cpp +++ b/audio/decoders/vag.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/decoders/vag.h" diff --git a/audio/decoders/vag.h b/audio/decoders/vag.h index 4adc1d3dde0..b80fbdb98f7 100644 --- a/audio/decoders/vag.h +++ b/audio/decoders/vag.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** diff --git a/audio/decoders/voc.cpp b/audio/decoders/voc.cpp index 9c2dc4f3379..74ea4440a1c 100644 --- a/audio/decoders/voc.cpp +++ b/audio/decoders/voc.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/audio/decoders/voc.h b/audio/decoders/voc.h index 38250dcf7a8..8bc6dcf46f3 100644 --- a/audio/decoders/voc.h +++ b/audio/decoders/voc.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** diff --git a/audio/decoders/vorbis.cpp b/audio/decoders/vorbis.cpp index 63f7ba82079..2724dd1f023 100644 --- a/audio/decoders/vorbis.cpp +++ b/audio/decoders/vorbis.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides for FILE and fseek as those are used in the diff --git a/audio/decoders/vorbis.h b/audio/decoders/vorbis.h index 51d0b82d5fa..e3d989e9b8c 100644 --- a/audio/decoders/vorbis.h +++ b/audio/decoders/vorbis.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** @@ -36,6 +33,7 @@ * - scumm * - sword1 * - sword2 + * - sword25 * - touche * - tucker */ diff --git a/audio/decoders/wave.cpp b/audio/decoders/wave.cpp index a64874887a2..3cf4566d0c7 100644 --- a/audio/decoders/wave.cpp +++ b/audio/decoders/wave.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/audio/decoders/wave.h b/audio/decoders/wave.h index 33c3e798a08..6a34bc175a9 100644 --- a/audio/decoders/wave.h +++ b/audio/decoders/wave.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** diff --git a/audio/fmopl.cpp b/audio/fmopl.cpp index 5952a987a7a..a24c2a533c7 100644 --- a/audio/fmopl.cpp +++ b/audio/fmopl.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "audio/fmopl.h" diff --git a/audio/fmopl.h b/audio/fmopl.h index 33235f35458..b88325a52ea 100644 --- a/audio/fmopl.h +++ b/audio/fmopl.h @@ -17,16 +17,16 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SOUND_FMOPL_H #define SOUND_FMOPL_H #include "common/scummsys.h" -#include "common/str.h" + +namespace Common { +class String; +} namespace OPL { diff --git a/audio/mididrv.cpp b/audio/mididrv.cpp index 6cc3366847a..7beb76352ca 100644 --- a/audio/mididrv.cpp +++ b/audio/mididrv.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/audio/mididrv.h b/audio/mididrv.h index c6c51790514..7369cab26b4 100644 --- a/audio/mididrv.h +++ b/audio/mididrv.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SOUND_MIDIDRV_H diff --git a/audio/midiparser.cpp b/audio/midiparser.cpp index a1399d0c309..943a6067a4d 100644 --- a/audio/midiparser.cpp +++ b/audio/midiparser.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/midiparser.h" diff --git a/audio/midiparser.h b/audio/midiparser.h index 24f2ba79636..9dff4b54ba7 100644 --- a/audio/midiparser.h +++ b/audio/midiparser.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /// \brief Declarations related to the MidiParser class diff --git a/audio/midiparser_smf.cpp b/audio/midiparser_smf.cpp index 8ead95de4c9..e883471b54c 100644 --- a/audio/midiparser_smf.cpp +++ b/audio/midiparser_smf.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/midiparser.h" diff --git a/audio/midiparser_xmidi.cpp b/audio/midiparser_xmidi.cpp index 1146084cde9..7c3cf102d1f 100644 --- a/audio/midiparser_xmidi.cpp +++ b/audio/midiparser_xmidi.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/midiparser.h" @@ -240,7 +237,7 @@ bool MidiParser_XMIDI::loadMusic(byte *data, uint32 size) { pos += 4; _num_tracks = 1; } else if (memcmp(pos, "XDIR", 4)) { - // Not an XMIDI that we recognise + // Not an XMIDI that we recognize warning("Expected 'XDIR' but found '%c%c%c%c'", pos[0], pos[1], pos[2], pos[3]); return false; } else { diff --git a/audio/midiplayer.cpp b/audio/midiplayer.cpp index f4a13a04380..7fab02a5bea 100644 --- a/audio/midiplayer.cpp +++ b/audio/midiplayer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/midiplayer.h" diff --git a/audio/midiplayer.h b/audio/midiplayer.h index 0cf373d6460..e1da0bfb799 100644 --- a/audio/midiplayer.h +++ b/audio/midiplayer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SOUND_MIDIPLAYER_H diff --git a/audio/mixer.cpp b/audio/mixer.cpp index 4d23487e713..fb4fffb8d8a 100644 --- a/audio/mixer.cpp +++ b/audio/mixer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" @@ -260,6 +257,8 @@ int MixerImpl::mixCallback(byte *samples, uint len) { Common::StackLock lock(_mutex); int16 *buf = (int16 *)samples; + // we store stereo, 16-bit samples + assert(len % 4 == 0); len >>= 2; // Since the mixer callback has been called, the mixer must be ready... diff --git a/audio/mixer.h b/audio/mixer.h index 5802abdd6b8..1fbe2654889 100644 --- a/audio/mixer.h +++ b/audio/mixer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SOUND_MIXER_H diff --git a/audio/mixer_intern.h b/audio/mixer_intern.h index d7764e50d96..a04eb55c5b1 100644 --- a/audio/mixer_intern.h +++ b/audio/mixer_intern.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SOUND_MIXER_INTERN_H @@ -129,6 +126,8 @@ public: * the backend (e.g. from an audio mixing thread). All the actual mixing * work is done from here. * + * @param samples Sample buffer, in which stereo 16-bit samples will be stored. + * @param len Length of the provided buffer to fill (in bytes, should be divisible by 4). * @return number of sample pairs processed (which can still be silence!) */ int mixCallback(byte *samples, uint len); diff --git a/audio/mods/infogrames.cpp b/audio/mods/infogrames.cpp index 8bfffeacb60..5b4d39fe493 100644 --- a/audio/mods/infogrames.cpp +++ b/audio/mods/infogrames.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/mods/infogrames.h" diff --git a/audio/mods/infogrames.h b/audio/mods/infogrames.h index 9787210e825..307a26d4e1a 100644 --- a/audio/mods/infogrames.h +++ b/audio/mods/infogrames.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** diff --git a/audio/mods/maxtrax.cpp b/audio/mods/maxtrax.cpp index 0738966dabd..953bb8f8d2b 100644 --- a/audio/mods/maxtrax.cpp +++ b/audio/mods/maxtrax.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/audio/mods/maxtrax.h b/audio/mods/maxtrax.h index 2f890afe2d9..bef6669d2ae 100644 --- a/audio/mods/maxtrax.h +++ b/audio/mods/maxtrax.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // see if all engines using this class are DISABLED diff --git a/audio/mods/module.cpp b/audio/mods/module.cpp index 987b17bc8d8..8d09671d26d 100644 --- a/audio/mods/module.cpp +++ b/audio/mods/module.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/mods/module.h" diff --git a/audio/mods/module.h b/audio/mods/module.h index c9b72bd2d6c..a57a89225e2 100644 --- a/audio/mods/module.h +++ b/audio/mods/module.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SOUND_MODS_MODULE_H diff --git a/audio/mods/paula.cpp b/audio/mods/paula.cpp index ef841ac9bfa..4b49d6e7507 100644 --- a/audio/mods/paula.cpp +++ b/audio/mods/paula.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/mods/paula.h" diff --git a/audio/mods/paula.h b/audio/mods/paula.h index f6f159d5a6a..cd797f51cb3 100644 --- a/audio/mods/paula.h +++ b/audio/mods/paula.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SOUND_MODS_PAULA_H diff --git a/audio/mods/protracker.cpp b/audio/mods/protracker.cpp index f7819205053..084b0edf9ae 100644 --- a/audio/mods/protracker.cpp +++ b/audio/mods/protracker.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/mods/protracker.h" diff --git a/audio/mods/protracker.h b/audio/mods/protracker.h index fa9895b81f3..15f708d801e 100644 --- a/audio/mods/protracker.h +++ b/audio/mods/protracker.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** diff --git a/audio/mods/rjp1.cpp b/audio/mods/rjp1.cpp index eaa99e6928c..45c6caa106c 100644 --- a/audio/mods/rjp1.cpp +++ b/audio/mods/rjp1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/audio/mods/rjp1.h b/audio/mods/rjp1.h index e3cb0b853dd..232b1926e9e 100644 --- a/audio/mods/rjp1.h +++ b/audio/mods/rjp1.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** diff --git a/audio/mods/soundfx.cpp b/audio/mods/soundfx.cpp index 44fdd659867..767d1ce9c8b 100644 --- a/audio/mods/soundfx.cpp +++ b/audio/mods/soundfx.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/audio/mods/soundfx.h b/audio/mods/soundfx.h index 9dd5240160b..48ccff2da6e 100644 --- a/audio/mods/soundfx.h +++ b/audio/mods/soundfx.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** diff --git a/audio/mods/tfmx.cpp b/audio/mods/tfmx.cpp index f7cfc50c107..a89da78af19 100644 --- a/audio/mods/tfmx.cpp +++ b/audio/mods/tfmx.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" @@ -335,7 +332,7 @@ void Tfmx::macroRun(ChannelContext &channel) { channel.vibLength = macroPtr[1]; channel.vibCount = macroPtr[1] / 2; channel.vibDelta = macroPtr[3]; - // TODO: Perhaps a bug, vibValue could be left uninitialised + // TODO: Perhaps a bug, vibValue could be left uninitialized if (!channel.portaDelta) { channel.period = channel.refPeriod; channel.vibValue = 0; @@ -703,7 +700,7 @@ void Tfmx::noteCommand(const uint8 note, const uint8 param1, const uint8 param2, channel.relVol = param2 >> 4; channel.fineTune = (int8)param3; - // TODO: the point where the channel gets initialised varies with the games, needs more research. + // TODO: the point where the channel gets initialized varies with the games, needs more research. initMacroProgramm(channel); channel.keyUp = false; // key down = playing a Note diff --git a/audio/mods/tfmx.h b/audio/mods/tfmx.h index 1930487eb84..2b07e2e6606 100644 --- a/audio/mods/tfmx.h +++ b/audio/mods/tfmx.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // see if all engines using this class are DISABLED diff --git a/audio/module.mk b/audio/module.mk index 545a55c23bc..46cb9944e14 100644 --- a/audio/module.mk +++ b/audio/module.mk @@ -42,10 +42,11 @@ MODULE_OBJS := \ softsynth/opl/mame.o \ softsynth/fmtowns_pc98/towns_audio.o \ softsynth/fmtowns_pc98/towns_euphony.o \ + softsynth/fmtowns_pc98/towns_midi.o \ softsynth/fmtowns_pc98/towns_pc98_driver.o \ softsynth/fmtowns_pc98/towns_pc98_fmsynth.o \ + softsynth/fmtowns_pc98/towns_pc98_plugins.o \ softsynth/appleiigs.o \ - softsynth/ym2612.o \ softsynth/fluidsynth.o \ softsynth/mt32.o \ softsynth/eas.o \ diff --git a/audio/mpu401.cpp b/audio/mpu401.cpp index 4834772c072..caad945258f 100644 --- a/audio/mpu401.cpp +++ b/audio/mpu401.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "audio/mpu401.h" diff --git a/audio/mpu401.h b/audio/mpu401.h index 5f1a5108ac6..15728a6d970 100644 --- a/audio/mpu401.h +++ b/audio/mpu401.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SOUND_MPU401_H diff --git a/audio/musicplugin.cpp b/audio/musicplugin.cpp index eb28d2f4c9e..7c77c3455c3 100644 --- a/audio/musicplugin.cpp +++ b/audio/musicplugin.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/musicplugin.h" diff --git a/audio/musicplugin.h b/audio/musicplugin.h index 53a2ae426d2..2a25962b87a 100644 --- a/audio/musicplugin.h +++ b/audio/musicplugin.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SOUND_MUSICPLUGIN_H diff --git a/audio/null.cpp b/audio/null.cpp index 2066a6d048c..36c894aa7c2 100644 --- a/audio/null.cpp +++ b/audio/null.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/error.h" diff --git a/audio/null.h b/audio/null.h index 8570d4d2934..97c7c8cc93b 100644 --- a/audio/null.h +++ b/audio/null.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SOUND_NULL_H diff --git a/audio/rate.cpp b/audio/rate.cpp index fd52503b8c6..83abd6150b6 100644 --- a/audio/rate.cpp +++ b/audio/rate.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/audio/rate.h b/audio/rate.h index af37994d022..72bcbf48c51 100644 --- a/audio/rate.h +++ b/audio/rate.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SOUND_RATE_H diff --git a/audio/rate_arm.cpp b/audio/rate_arm.cpp index 1eb55d0dc37..433a7d34233 100644 --- a/audio/rate_arm.cpp +++ b/audio/rate_arm.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/audio/rate_arm_asm.s b/audio/rate_arm_asm.s index 9431ae06492..d86d96267eb 100644 --- a/audio/rate_arm_asm.s +++ b/audio/rate_arm_asm.s @@ -18,9 +18,6 @@ @ along with this program@ if not, write to the Free Software @ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @ -@ $URL$ -@ $Id$ -@ @ @author Robin Watts (robin@wss.co.uk) @ @ This file, together with rate_arm.cpp, provides an ARM optimised version diff --git a/audio/softsynth/adlib.cpp b/audio/softsynth/adlib.cpp index 9fec74c9d61..60de8fad609 100644 --- a/audio/softsynth/adlib.cpp +++ b/audio/softsynth/adlib.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "audio/softsynth/emumidi.h" diff --git a/audio/softsynth/appleiigs.cpp b/audio/softsynth/appleiigs.cpp index 80159c79ce0..6ee70d12023 100644 --- a/audio/softsynth/appleiigs.cpp +++ b/audio/softsynth/appleiigs.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "audio/null.h" diff --git a/audio/softsynth/cms.cpp b/audio/softsynth/cms.cpp index fcc15f127e9..67eacd1a414 100644 --- a/audio/softsynth/cms.cpp +++ b/audio/softsynth/cms.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "audio/softsynth/cms.h" diff --git a/audio/softsynth/cms.h b/audio/softsynth/cms.h index d5bb7f0a42e..48064746a81 100644 --- a/audio/softsynth/cms.h +++ b/audio/softsynth/cms.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SOUND_SOFTSYNTH_CMS_H diff --git a/audio/softsynth/eas.cpp b/audio/softsynth/eas.cpp index 7d17655d20e..d829e3b39af 100644 --- a/audio/softsynth/eas.cpp +++ b/audio/softsynth/eas.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/scummsys.h" diff --git a/audio/softsynth/emumidi.h b/audio/softsynth/emumidi.h index 190b70c3928..f3d7645f87a 100644 --- a/audio/softsynth/emumidi.h +++ b/audio/softsynth/emumidi.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SOUND_SOFTSYNTH_EMUMIDI_H diff --git a/audio/softsynth/fluidsynth.cpp b/audio/softsynth/fluidsynth.cpp index a4877a4ec1b..2451336784d 100644 --- a/audio/softsynth/fluidsynth.cpp +++ b/audio/softsynth/fluidsynth.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/scummsys.h" diff --git a/audio/softsynth/fmtowns_pc98/towns_audio.cpp b/audio/softsynth/fmtowns_pc98/towns_audio.cpp index 7b6658ab3ab..786e3ee1d2e 100644 --- a/audio/softsynth/fmtowns_pc98/towns_audio.cpp +++ b/audio/softsynth/fmtowns_pc98/towns_audio.cpp @@ -18,19 +18,19 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/softsynth/fmtowns_pc98/towns_audio.h" +#include "audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h" + #include "common/endian.h" #include "common/util.h" +#include "common/textconsole.h" #include "backends/audiocd/audiocd.h" class TownsAudio_PcmChannel { -friend class TownsAudioInterface; +friend class TownsAudioInterfaceInternal; public: TownsAudio_PcmChannel(); ~TownsAudio_PcmChannel(); @@ -80,7 +80,7 @@ private: }; class TownsAudio_WaveTable { -friend class TownsAudioInterface; +friend class TownsAudioInterfaceInternal; public: TownsAudio_WaveTable(); ~TownsAudio_WaveTable(); @@ -101,14 +101,170 @@ private: int8 *data; }; -TownsAudioInterface::TownsAudioInterface(Audio::Mixer *mixer, TownsAudioInterfacePluginDriver *driver) : TownsPC98_FmSynth(mixer, kTypeTowns), - _fmInstruments(0), _pcmInstruments(0), _pcmChan(0), _waveTables(0), _waveTablesTotalDataSize(0), - _baserate(55125.0f / (float)mixer->getOutputRate()), _tickLength(0), _timer(0), _drv(driver), - _pcmSfxChanMask(0), _musicVolume(Audio::Mixer::kMaxMixerVolume), _sfxVolume(Audio::Mixer::kMaxMixerVolume), - _outputVolumeFlags(0), _outputMuteFlags(0), _pcmChanOut(0), _pcmChanReserved(0), _pcmChanKeyPressed(0), - _pcmChanEffectPlaying(0), _pcmChanKeyPlaying(0), _ready(false) { +class TownsAudioInterfaceInternal : public TownsPC98_FmSynth { +public: + TownsAudioInterfaceInternal(Audio::Mixer *mixer, TownsAudioInterface *owner, TownsAudioInterfacePluginDriver *driver, bool externalMutexHandling = false); + ~TownsAudioInterfaceInternal(); -#define INTCB(x) &TownsAudioInterface::intf_##x + static TownsAudioInterfaceInternal *addNewRef(Audio::Mixer *mixer, TownsAudioInterface *owner, TownsAudioInterfacePluginDriver *driver, bool externalMutexHandling = false); + static void releaseRef(TownsAudioInterface *owner); + + bool init(); + + int callback(int command, ...); + int processCommand(int command, va_list &args); + + void setMusicVolume(int volume); + void setSoundEffectVolume(int volume); + // Defines the channels used as sound effect channels for the purpose of ScummVM GUI volume control. + // The first 6 bits are the 6 fm channels. The next 8 bits are pcm channels. + void setSoundEffectChanMask(int mask); + +private: + bool assignPluginDriver(TownsAudioInterface *owner, TownsAudioInterfacePluginDriver *driver, bool externalMutexHandling = false); + void removePluginDriver(TownsAudioInterface *owner); + + void nextTickEx(int32 *buffer, uint32 bufferSize); + + void timerCallbackA(); + void timerCallbackB(); + + typedef int (TownsAudioInterfaceInternal::*TownsAudioIntfCallback)(va_list &); + const TownsAudioIntfCallback *_intfOpcodes; + + int intf_reset(va_list &args); + int intf_keyOn(va_list &args); + int intf_keyOff(va_list &args); + int intf_setPanPos(va_list &args); + int intf_setInstrument(va_list &args); + int intf_loadInstrument(va_list &args); + int intf_setPitch(va_list &args); + int intf_setLevel(va_list &args); + int intf_chanOff(va_list &args); + int intf_writeReg(va_list &args); + int intf_writeRegBuffer(va_list &args); + int intf_readRegBuffer(va_list &args); + int intf_setTimerA(va_list &args); + int intf_setTimerB(va_list &args); + int intf_enableTimerA(va_list &args); + int intf_enableTimerB(va_list &args); + int intf_loadSamples(va_list &args); + int intf_reserveEffectChannels(va_list &args); + int intf_loadWaveTable(va_list &args); + int intf_unloadWaveTable(va_list &args); + int intf_pcmPlayEffect(va_list &args); + int intf_pcmChanOff(va_list &args); + int intf_pcmEffectPlaying(va_list &args); + int intf_fmKeyOn(va_list &args); + int intf_fmKeyOff(va_list &args); + int intf_fmSetPanPos(va_list &args); + int intf_fmSetInstrument(va_list &args); + int intf_fmLoadInstrument(va_list &args); + int intf_fmSetPitch(va_list &args); + int intf_fmSetLevel(va_list &args); + int intf_fmReset(va_list &args); + int intf_setOutputVolume(va_list &args); + int intf_resetOutputVolume(va_list &args); + int intf_getOutputVolume(va_list &args); + int intf_setOutputMute(va_list &args); + int intf_cdaToggle(va_list &args); + int intf_getOutputVolume2(va_list &args); + int intf_getOutputMute(va_list &args); + int intf_pcmUpdateEnvelopeGenerator(va_list &args); + + int intf_notImpl(va_list &args); + + void fmReset(); + int fmKeyOn(int chan, int note, int velo); + int fmKeyOff(int chan); + int fmChanOff(int chan); + int fmSetPanPos(int chan, int mode); + int fmSetInstrument(int chan, int instrId); + int fmLoadInstrument(int instrId, const uint8 *data); + int fmSetPitch(int chan, int pitch); + int fmSetLevel(int chan, int lvl); + + void bufferedWriteReg(uint8 part, uint8 regAddress, uint8 value); + + uint8 _fmChanPlaying; + uint8 _fmChanNote[6]; + int16 _fmChanPitch[6]; + + uint8 *_fmSaveReg[2]; + uint8 *_fmInstruments; + + void pcmReset(); + int pcmKeyOn(int chan, int note, int velo); + int pcmKeyOff(int chan); + int pcmChanOff(int chan); + int pcmSetPanPos(int chan, int mode); + int pcmSetInstrument(int chan, int instrId); + int pcmLoadInstrument(int instrId, const uint8 *data); + int pcmSetPitch(int chan, int pitch); + int pcmSetLevel(int chan, int lvl); + void pcmUpdateEnvelopeGenerator(int chan); + + TownsAudio_PcmChannel *_pcmChan; + uint8 _pcmChanOut; + uint8 _pcmChanReserved; + uint8 _pcmChanKeyPressed; + uint8 _pcmChanEffectPlaying; + uint8 _pcmChanKeyPlaying; + + uint8 _pcmChanNote[8]; + uint8 _pcmChanVelo[8]; + uint8 _pcmChanLevel[8]; + + uint8 _numReservedChannels; + uint8 *_pcmInstruments; + + TownsAudio_WaveTable *_waveTables; + uint8 _numWaveTables; + uint32 _waveTablesTotalDataSize; + + void pcmCalcPhaseStep(TownsAudio_PcmChannel *p, TownsAudio_WaveTable *w); + + void updateOutputVolume(); + void updateOutputVolumeInternal(); + uint8 _outputVolumeFlags; + uint8 _outputLevel[16]; + uint8 _outputMute[16]; + bool _updateOutputVol; + + const float _baserate; + uint32 _timerBase; + uint32 _tickLength; + uint32 _timer; + + uint16 _musicVolume; + uint16 _sfxVolume; + int _pcmSfxChanMask; + + TownsAudioInterfacePluginDriver *_drv; + void *_drvOwner; + bool _ready; + + static TownsAudioInterfaceInternal *_refInstance; + static int _refCount; + + static const uint8 _chanFlags[]; + static const uint16 _frequency[]; + static const uint8 _carrier[]; + static const uint8 _fmDefaultInstrument[]; + static const uint16 _pcmPhase1[]; + static const uint16 _pcmPhase2[]; +}; + +TownsAudioInterfaceInternal::TownsAudioInterfaceInternal(Audio::Mixer *mixer, TownsAudioInterface *owner, TownsAudioInterfacePluginDriver *driver, bool externalMutexHandling) : + TownsPC98_FmSynth(mixer, kTypeTowns, externalMutexHandling), + _fmInstruments(0), _pcmInstruments(0), _pcmChan(0), _waveTables(0), _waveTablesTotalDataSize(0), + _baserate(55125.0f / (float)mixer->getOutputRate()), _tickLength(0), _timer(0), _drv(driver), _drvOwner(owner), + _pcmSfxChanMask(0), _musicVolume(Audio::Mixer::kMaxMixerVolume), _sfxVolume(Audio::Mixer::kMaxMixerVolume), + _outputVolumeFlags(0), _pcmChanOut(0), _pcmChanReserved(0), _pcmChanKeyPressed(0), + _pcmChanEffectPlaying(0), _pcmChanKeyPlaying(0), _fmChanPlaying(0), + _numReservedChannels(0), _numWaveTables(0), _updateOutputVol(false), _ready(false) { + +#define INTCB(x) &TownsAudioInterfaceInternal::intf_##x static const TownsAudioIntfCallback intfCb[] = { // 0 INTCB(reset), @@ -197,14 +353,14 @@ TownsAudioInterface::TownsAudioInterface(Audio::Mixer *mixer, TownsAudioInterfac INTCB(setOutputVolume), // 68 INTCB(resetOutputVolume), - INTCB(notImpl), - INTCB(updateOutputVolume), + INTCB(getOutputVolume), + INTCB(setOutputMute), INTCB(notImpl), // 72 INTCB(notImpl), INTCB(cdaToggle), - INTCB(notImpl), - INTCB(notImpl), + INTCB(getOutputVolume2), + INTCB(getOutputMute), // 76 INTCB(notImpl), INTCB(notImpl), @@ -219,16 +375,24 @@ TownsAudioInterface::TownsAudioInterface(Audio::Mixer *mixer, TownsAudioInterfac _intfOpcodes = intfCb; memset(_fmSaveReg, 0, sizeof(_fmSaveReg)); + memset(_fmChanNote, 0, sizeof(_fmChanNote)); + memset(_fmChanPitch, 0, sizeof(_fmChanPitch)); + memset(_pcmChanNote, 0, sizeof(_pcmChanNote)); + memset(_pcmChanVelo, 0, sizeof(_pcmChanVelo)); + memset(_pcmChanLevel, 0, sizeof(_pcmChanLevel)); memset(_outputLevel, 0, sizeof(_outputLevel)); + memset(_outputMute, 0, sizeof(_outputMute)); _timerBase = (uint32)(_baserate * 1000000.0f); _tickLength = 2 * _timerBase; } -TownsAudioInterface::~TownsAudioInterface() { +TownsAudioInterfaceInternal::~TownsAudioInterfaceInternal() { _ready = false; deinit(); + Common::StackLock lock(_mutex); + delete[] _fmSaveReg[0]; delete[] _fmSaveReg[1]; delete[] _fmInstruments; @@ -237,7 +401,34 @@ TownsAudioInterface::~TownsAudioInterface() { delete[] _pcmChan; } -bool TownsAudioInterface::init() { +TownsAudioInterfaceInternal *TownsAudioInterfaceInternal::addNewRef(Audio::Mixer *mixer, TownsAudioInterface *owner, TownsAudioInterfacePluginDriver *driver, bool externalMutexHandling) { + _refCount++; + if (_refCount == 1 && _refInstance == 0) + _refInstance = new TownsAudioInterfaceInternal(mixer, owner, driver, externalMutexHandling); + else if (_refCount < 2 || _refInstance == 0) + error("TownsAudioInterfaceInternal::addNewRef(): Internal reference management failure"); + else if (!_refInstance->assignPluginDriver(owner, driver, externalMutexHandling)) + error("TownsAudioInterfaceInternal::addNewRef(): Plugin driver conflict"); + + return _refInstance; +} + +void TownsAudioInterfaceInternal::releaseRef(TownsAudioInterface *owner) { + if (!_refCount) + return; + + _refCount--; + + if (_refCount) { + if (_refInstance) + _refInstance->removePluginDriver(owner); + } else { + delete _refInstance; + _refInstance = 0; + } +} + +bool TownsAudioInterfaceInternal::init() { if (_ready) return true; @@ -261,44 +452,79 @@ bool TownsAudioInterface::init() { return true; } -int TownsAudioInterface::callback(int command, ...) { +int TownsAudioInterfaceInternal::callback(int command, ...) { if (!_ready) return 1; va_list args; va_start(args, command); - if (command > 81) { - va_end(args); - return 4; - } - - int res = (this->*_intfOpcodes[command])(args); + int res = processCommand(command, args); va_end(args); return res; } -void TownsAudioInterface::setMusicVolume(int volume) { +int TownsAudioInterfaceInternal::processCommand(int command, va_list &args) { + if (!_ready) + return 1; + + if (command < 0 || command > 81) + return 4; + + Common::StackLock lock(_mutex); + int res = (this->*_intfOpcodes[command])(args); + + return res; +} + +void TownsAudioInterfaceInternal::setMusicVolume(int volume) { _musicVolume = CLIP(volume, 0, Audio::Mixer::kMaxMixerVolume); setVolumeIntern(_musicVolume, _sfxVolume); } -void TownsAudioInterface::setSoundEffectVolume(int volume) { +void TownsAudioInterfaceInternal::setSoundEffectVolume(int volume) { _sfxVolume = CLIP(volume, 0, Audio::Mixer::kMaxMixerVolume); setVolumeIntern(_musicVolume, _sfxVolume); } -void TownsAudioInterface::setSoundEffectChanMask(int mask) { +void TownsAudioInterfaceInternal::setSoundEffectChanMask(int mask) { _pcmSfxChanMask = mask >> 6; mask &= 0x3f; setVolumeChannelMasks(~mask, mask); } -void TownsAudioInterface::nextTickEx(int32 *buffer, uint32 bufferSize) { +bool TownsAudioInterfaceInternal::assignPluginDriver(TownsAudioInterface *owner, TownsAudioInterfacePluginDriver *driver, bool externalMutexHandling) { + if (_refCount <= 1) + return true; + + if (_drv) { + if (driver && driver != _drv) + return false; + } else { + Common::StackLock lock(_mutex); + _drv = driver; + _drvOwner = owner; + _externalMutex = externalMutexHandling; + } + + return true; +} + +void TownsAudioInterfaceInternal::removePluginDriver(TownsAudioInterface *owner) { + if (_drvOwner == owner) { + Common::StackLock lock(_mutex); + _drv = 0; + } +} + +void TownsAudioInterfaceInternal::nextTickEx(int32 *buffer, uint32 bufferSize) { if (!_ready) return; + if (_updateOutputVol) + updateOutputVolumeInternal(); + for (uint32 i = 0; i < bufferSize; i++) { _timer += _tickLength; while (_timer > 0x514767) { @@ -346,14 +572,12 @@ void TownsAudioInterface::nextTickEx(int32 *buffer, uint32 bufferSize) { } } -void TownsAudioInterface::timerCallbackA() { - Common::StackLock lock(_mutex); +void TownsAudioInterfaceInternal::timerCallbackA() { if (_drv && _ready) _drv->timerCallback(0); } -void TownsAudioInterface::timerCallbackB() { - Common::StackLock lock(_mutex); +void TownsAudioInterfaceInternal::timerCallbackB() { if (_ready) { if (_drv) _drv->timerCallback(1); @@ -361,62 +585,62 @@ void TownsAudioInterface::timerCallbackB() { } } -int TownsAudioInterface::intf_reset(va_list &args) { +int TownsAudioInterfaceInternal::intf_reset(va_list &args) { fmReset(); pcmReset(); callback(68); return 0; } -int TownsAudioInterface::intf_keyOn(va_list &args) { +int TownsAudioInterfaceInternal::intf_keyOn(va_list &args) { int chan = va_arg(args, int); int note = va_arg(args, int); int velo = va_arg(args, int); return (chan & 0x40) ? pcmKeyOn(chan, note, velo) : fmKeyOn(chan, note, velo); } -int TownsAudioInterface::intf_keyOff(va_list &args) { +int TownsAudioInterfaceInternal::intf_keyOff(va_list &args) { int chan = va_arg(args, int); return (chan & 0x40) ? pcmKeyOff(chan) : fmKeyOff(chan); } -int TownsAudioInterface::intf_setPanPos(va_list &args) { +int TownsAudioInterfaceInternal::intf_setPanPos(va_list &args) { int chan = va_arg(args, int); int mode = va_arg(args, int); return (chan & 0x40) ? pcmSetPanPos(chan, mode) : fmSetPanPos(chan, mode); } -int TownsAudioInterface::intf_setInstrument(va_list &args) { +int TownsAudioInterfaceInternal::intf_setInstrument(va_list &args) { int chan = va_arg(args, int); int instrId = va_arg(args, int); return (chan & 0x40) ? pcmSetInstrument(chan, instrId) : fmSetInstrument(chan, instrId); } -int TownsAudioInterface::intf_loadInstrument(va_list &args) { +int TownsAudioInterfaceInternal::intf_loadInstrument(va_list &args) { int chanType = va_arg(args, int); int instrId = va_arg(args, int); uint8 *instrData = va_arg(args, uint8 *); return (chanType & 0x40) ? pcmLoadInstrument(instrId, instrData) : fmLoadInstrument(instrId, instrData); } -int TownsAudioInterface::intf_setPitch(va_list &args) { +int TownsAudioInterfaceInternal::intf_setPitch(va_list &args) { int chan = va_arg(args, int); int16 pitch = (int16)(va_arg(args, int) & 0xffff); return (chan & 0x40) ? pcmSetPitch(chan, pitch) : fmSetPitch(chan, pitch); } -int TownsAudioInterface::intf_setLevel(va_list &args) { +int TownsAudioInterfaceInternal::intf_setLevel(va_list &args) { int chan = va_arg(args, int); int lvl = va_arg(args, int); return (chan & 0x40) ? pcmSetLevel(chan, lvl) : fmSetLevel(chan, lvl); } -int TownsAudioInterface::intf_chanOff(va_list &args) { +int TownsAudioInterfaceInternal::intf_chanOff(va_list &args) { int chan = va_arg(args, int); return (chan & 0x40) ? pcmChanOff(chan) : fmChanOff(chan); } -int TownsAudioInterface::intf_writeReg(va_list &args) { +int TownsAudioInterfaceInternal::intf_writeReg(va_list &args) { int part = va_arg(args, int) ? 1 : 0; int reg = va_arg(args, int); int val = va_arg(args, int); @@ -427,7 +651,7 @@ int TownsAudioInterface::intf_writeReg(va_list &args) { return 0; } -int TownsAudioInterface::intf_writeRegBuffer(va_list &args) { +int TownsAudioInterfaceInternal::intf_writeRegBuffer(va_list &args) { int part = va_arg(args, int) ? 1 : 0; int reg = va_arg(args, int); int val = va_arg(args, int); @@ -439,7 +663,7 @@ int TownsAudioInterface::intf_writeRegBuffer(va_list &args) { return 0; } -int TownsAudioInterface::intf_readRegBuffer(va_list &args) { +int TownsAudioInterfaceInternal::intf_readRegBuffer(va_list &args) { int part = va_arg(args, int) ? 1 : 0; int reg = va_arg(args, int); uint8 *dst = va_arg(args, uint8 *); @@ -452,7 +676,7 @@ int TownsAudioInterface::intf_readRegBuffer(va_list &args) { return 0; } -int TownsAudioInterface::intf_setTimerA(va_list &args) { +int TownsAudioInterfaceInternal::intf_setTimerA(va_list &args) { int enable = va_arg(args, int); int tempo = va_arg(args, int); @@ -467,7 +691,7 @@ int TownsAudioInterface::intf_setTimerA(va_list &args) { return 0; } -int TownsAudioInterface::intf_setTimerB(va_list &args) { +int TownsAudioInterfaceInternal::intf_setTimerB(va_list &args) { int enable = va_arg(args, int); int tempo = va_arg(args, int); @@ -481,17 +705,17 @@ int TownsAudioInterface::intf_setTimerB(va_list &args) { return 0; } -int TownsAudioInterface::intf_enableTimerA(va_list &args) { +int TownsAudioInterfaceInternal::intf_enableTimerA(va_list &args) { bufferedWriteReg(0, 0x27, _fmSaveReg[0][0x27] | 0x15); return 0; } -int TownsAudioInterface::intf_enableTimerB(va_list &args) { +int TownsAudioInterfaceInternal::intf_enableTimerB(va_list &args) { bufferedWriteReg(0, 0x27, _fmSaveReg[0][0x27] | 0x2a); return 0; } -int TownsAudioInterface::intf_loadSamples(va_list &args) { +int TownsAudioInterfaceInternal::intf_loadSamples(va_list &args) { uint32 dest = va_arg(args, uint32); int size = va_arg(args, int); uint8 *src = va_arg(args, uint8*); @@ -514,7 +738,7 @@ int TownsAudioInterface::intf_loadSamples(va_list &args) { return 0; } -int TownsAudioInterface::intf_reserveEffectChannels(va_list &args) { +int TownsAudioInterfaceInternal::intf_reserveEffectChannels(va_list &args) { int numChan = va_arg(args, int); if (numChan > 8) return 3; @@ -546,7 +770,7 @@ int TownsAudioInterface::intf_reserveEffectChannels(va_list &args) { return 0; } -int TownsAudioInterface::intf_loadWaveTable(va_list &args) { +int TownsAudioInterfaceInternal::intf_loadWaveTable(va_list &args) { uint8 *data = va_arg(args, uint8 *); if (_numWaveTables > 127) return 3; @@ -573,7 +797,7 @@ int TownsAudioInterface::intf_loadWaveTable(va_list &args) { return 0; } -int TownsAudioInterface::intf_unloadWaveTable(va_list &args) { +int TownsAudioInterfaceInternal::intf_unloadWaveTable(va_list &args) { int id = va_arg(args, int); if (id == -1) { @@ -600,7 +824,7 @@ int TownsAudioInterface::intf_unloadWaveTable(va_list &args) { return 0; } -int TownsAudioInterface::intf_pcmPlayEffect(va_list &args) { +int TownsAudioInterfaceInternal::intf_pcmPlayEffect(va_list &args) { int chan = va_arg(args, int); int note = va_arg(args, int); int velo = va_arg(args, int); @@ -650,13 +874,13 @@ int TownsAudioInterface::intf_pcmPlayEffect(va_list &args) { return 0; } -int TownsAudioInterface::intf_pcmChanOff(va_list &args) { +int TownsAudioInterfaceInternal::intf_pcmChanOff(va_list &args) { int chan = va_arg(args, int); pcmChanOff(chan); return 0; } -int TownsAudioInterface::intf_pcmEffectPlaying(va_list &args) { +int TownsAudioInterfaceInternal::intf_pcmEffectPlaying(va_list &args) { int chan = va_arg(args, int); if (chan < 0x40 || chan > 0x47) return 1; @@ -664,54 +888,54 @@ int TownsAudioInterface::intf_pcmEffectPlaying(va_list &args) { return (_pcmChanEffectPlaying & _chanFlags[chan]) ? 1 : 0; } -int TownsAudioInterface::intf_fmKeyOn(va_list &args) { +int TownsAudioInterfaceInternal::intf_fmKeyOn(va_list &args) { int chan = va_arg(args, int); int note = va_arg(args, int); int velo = va_arg(args, int); return fmKeyOn(chan, note, velo); } -int TownsAudioInterface::intf_fmKeyOff(va_list &args) { +int TownsAudioInterfaceInternal::intf_fmKeyOff(va_list &args) { int chan = va_arg(args, int); return fmKeyOff(chan); } -int TownsAudioInterface::intf_fmSetPanPos(va_list &args) { +int TownsAudioInterfaceInternal::intf_fmSetPanPos(va_list &args) { int chan = va_arg(args, int); int mode = va_arg(args, int); return fmSetPanPos(chan, mode); } -int TownsAudioInterface::intf_fmSetInstrument(va_list &args) { +int TownsAudioInterfaceInternal::intf_fmSetInstrument(va_list &args) { int chan = va_arg(args, int); int instrId = va_arg(args, int); return fmSetInstrument(chan, instrId); } -int TownsAudioInterface::intf_fmLoadInstrument(va_list &args) { +int TownsAudioInterfaceInternal::intf_fmLoadInstrument(va_list &args) { int instrId = va_arg(args, int); uint8 *instrData = va_arg(args, uint8 *); return fmLoadInstrument(instrId, instrData); } -int TownsAudioInterface::intf_fmSetPitch(va_list &args) { +int TownsAudioInterfaceInternal::intf_fmSetPitch(va_list &args) { int chan = va_arg(args, int); uint16 freq = va_arg(args, int) & 0xffff; return fmSetPitch(chan, freq); } -int TownsAudioInterface::intf_fmSetLevel(va_list &args) { +int TownsAudioInterfaceInternal::intf_fmSetLevel(va_list &args) { int chan = va_arg(args, int); int lvl = va_arg(args, int); return fmSetLevel(chan, lvl); } -int TownsAudioInterface::intf_fmReset(va_list &args) { +int TownsAudioInterfaceInternal::intf_fmReset(va_list &args) { fmReset(); return 0; } -int TownsAudioInterface::intf_setOutputVolume(va_list &args) { +int TownsAudioInterfaceInternal::intf_setOutputVolume(va_list &args) { int chanType = va_arg(args, int); int left = va_arg(args, int); int right = va_arg(args, int); @@ -727,18 +951,20 @@ int TownsAudioInterface::intf_setOutputVolume(va_list &args) { left = (left & 0x7e) >> 1; right = (right & 0x7e) >> 1; - if (chan) + if (chan == 12) _outputVolumeFlags |= flags[chanType]; else _outputVolumeFlags &= ~flags[chanType]; if (chanType > 1) { _outputLevel[chan + chanType] = left; + _outputMute[chan + chanType] = 0; } else { if (chanType == 0) chan -= 8; _outputLevel[chan] = left; _outputLevel[chan + 1] = right; + _outputMute[chan] = _outputMute[chan + 1] = 0; } updateOutputVolume(); @@ -746,38 +972,87 @@ int TownsAudioInterface::intf_setOutputVolume(va_list &args) { return 0; } -int TownsAudioInterface::intf_resetOutputVolume(va_list &args) { +int TownsAudioInterfaceInternal::intf_resetOutputVolume(va_list &args) { memset(_outputLevel, 0, sizeof(_outputLevel)); - _outputMuteFlags = 0; _outputVolumeFlags = 0; updateOutputVolume(); return 0; } -int TownsAudioInterface::intf_updateOutputVolume(va_list &args) { +int TownsAudioInterfaceInternal::intf_getOutputVolume(va_list &args) { + int chanType = va_arg(args, int); + int *left = va_arg(args, int*); + int *right = va_arg(args, int*); + + uint8 chan = (chanType & 0x40) ? 8 : 12; + chanType &= 3; + + if (chanType > 1) { + *left = _outputLevel[chan + chanType] & 0x3f; + } else { + if (chanType == 0) + chan -= 8; + *left = _outputLevel[chan] & 0x3f; + *right = _outputLevel[chan + 1] & 0x3f; + } + + return 0; +} + +int TownsAudioInterfaceInternal::intf_setOutputMute(va_list &args) { int flags = va_arg(args, int); - _outputMuteFlags = flags & 3; + _outputVolumeFlags = flags; + uint8 mute = flags & 3; + uint8 f = flags & 0xff; + + memset(_outputMute, 1, 8); + if (mute & 2) + memset(&_outputMute[12], 1, 4); + if (mute & 1) + memset(&_outputMute[8], 1, 4); + + _outputMute[(f < 0x80) ? 11 : 15] = 0; + f += f; + _outputMute[(f < 0x80) ? 10 : 14] = 0; + f += f; + _outputMute[(f < 0x80) ? 8 : 12] = 0; + f += f; + _outputMute[(f < 0x80) ? 9 : 13] = 0; + f += f; + _outputMute[(f < 0x80) ? 0 : 4] = 0; + f += f; + _outputMute[(f < 0x80) ? 1 : 5] = 0; + f += f; + updateOutputVolume(); return 0; } -int TownsAudioInterface::intf_cdaToggle(va_list &args) { +int TownsAudioInterfaceInternal::intf_cdaToggle(va_list &args) { //int mode = va_arg(args, int); //_unkMask = mode ? 0x7f : 0x3f; return 0; } -int TownsAudioInterface::intf_pcmUpdateEnvelopeGenerator(va_list &args) { +int TownsAudioInterfaceInternal::intf_getOutputVolume2(va_list &args) { + return 0; +} + +int TownsAudioInterfaceInternal::intf_getOutputMute (va_list &args) { + return 0; +} + +int TownsAudioInterfaceInternal::intf_pcmUpdateEnvelopeGenerator(va_list &args) { for (int i = 0; i < 8; i++) pcmUpdateEnvelopeGenerator(i); return 0; } -int TownsAudioInterface::intf_notImpl(va_list &args) { +int TownsAudioInterfaceInternal::intf_notImpl(va_list &args) { return 4; } -void TownsAudioInterface::fmReset() { +void TownsAudioInterfaceInternal::fmReset() { TownsPC98_FmSynth::reset(); _fmChanPlaying = 0; @@ -805,7 +1080,7 @@ void TownsAudioInterface::fmReset() { } } -int TownsAudioInterface::fmKeyOn(int chan, int note, int velo) { +int TownsAudioInterfaceInternal::fmKeyOn(int chan, int note, int velo) { if (chan > 5) return 1; if (note < 12 || note > 107 || (velo & 0x80)) @@ -885,7 +1160,7 @@ int TownsAudioInterface::fmKeyOn(int chan, int note, int velo) { return 0; } -int TownsAudioInterface::fmKeyOff(int chan) { +int TownsAudioInterfaceInternal::fmKeyOff(int chan) { if (chan > 5) return 1; _fmChanPlaying &= ~_chanFlags[chan]; @@ -895,7 +1170,7 @@ int TownsAudioInterface::fmKeyOff(int chan) { return 0; } -int TownsAudioInterface::fmChanOff(int chan) { +int TownsAudioInterfaceInternal::fmChanOff(int chan) { if (chan > 5) return 1; _fmChanPlaying &= ~_chanFlags[chan]; @@ -913,7 +1188,7 @@ int TownsAudioInterface::fmChanOff(int chan) { return 0; } -int TownsAudioInterface::fmSetPanPos(int chan, int value) { +int TownsAudioInterfaceInternal::fmSetPanPos(int chan, int value) { if (chan > 5) return 1; @@ -932,7 +1207,7 @@ int TownsAudioInterface::fmSetPanPos(int chan, int value) { return 0; } -int TownsAudioInterface::fmSetInstrument(int chan, int instrId) { +int TownsAudioInterfaceInternal::fmSetInstrument(int chan, int instrId) { if (chan > 5) return 1; if (instrId > 127) @@ -976,7 +1251,7 @@ int TownsAudioInterface::fmSetInstrument(int chan, int instrId) { return 0; } -int TownsAudioInterface::fmLoadInstrument(int instrId, const uint8 *data) { +int TownsAudioInterfaceInternal::fmLoadInstrument(int instrId, const uint8 *data) { if (instrId > 127) return 3; assert(data); @@ -984,7 +1259,7 @@ int TownsAudioInterface::fmLoadInstrument(int instrId, const uint8 *data) { return 0; } -int TownsAudioInterface::fmSetPitch(int chan, int pitch) { +int TownsAudioInterfaceInternal::fmSetPitch(int chan, int pitch) { if (chan > 5) return 1; @@ -1071,7 +1346,7 @@ int TownsAudioInterface::fmSetPitch(int chan, int pitch) { return 0; } -int TownsAudioInterface::fmSetLevel(int chan, int lvl) { +int TownsAudioInterfaceInternal::fmSetLevel(int chan, int lvl) { if (chan > 5) return 1; if (lvl > 127) @@ -1094,12 +1369,12 @@ int TownsAudioInterface::fmSetLevel(int chan, int lvl) { return 0; } -void TownsAudioInterface::bufferedWriteReg(uint8 part, uint8 regAddress, uint8 value) { +void TownsAudioInterfaceInternal::bufferedWriteReg(uint8 part, uint8 regAddress, uint8 value) { _fmSaveReg[part][regAddress] = value; writeReg(part, regAddress, value); } -void TownsAudioInterface::pcmReset() { +void TownsAudioInterfaceInternal::pcmReset() { _pcmChanOut = 0; _pcmChanReserved = _pcmChanKeyPressed = _pcmChanEffectPlaying = _pcmChanKeyPlaying = 0; _numReservedChannels = 0; @@ -1127,7 +1402,7 @@ void TownsAudioInterface::pcmReset() { } } -int TownsAudioInterface::pcmKeyOn(int chan, int note, int velo) { +int TownsAudioInterfaceInternal::pcmKeyOn(int chan, int note, int velo) { if (chan < 0x40 || chan > 0x47) return 1; @@ -1198,7 +1473,7 @@ int TownsAudioInterface::pcmKeyOn(int chan, int note, int velo) { return 0; } -int TownsAudioInterface::pcmKeyOff(int chan) { +int TownsAudioInterfaceInternal::pcmKeyOff(int chan) { if (chan < 0x40 || chan > 0x47) return 1; @@ -1208,7 +1483,7 @@ int TownsAudioInterface::pcmKeyOff(int chan) { return 0; } -int TownsAudioInterface::pcmChanOff(int chan) { +int TownsAudioInterfaceInternal::pcmChanOff(int chan) { if (chan < 0x40 || chan > 0x47) return 1; @@ -1222,7 +1497,7 @@ int TownsAudioInterface::pcmChanOff(int chan) { return 0; } -int TownsAudioInterface::pcmSetPanPos(int chan, int mode) { +int TownsAudioInterfaceInternal::pcmSetPanPos(int chan, int mode) { if (chan > 0x47) return 1; if (mode & 0x80) @@ -1245,7 +1520,7 @@ int TownsAudioInterface::pcmSetPanPos(int chan, int mode) { return 0; } -int TownsAudioInterface::pcmSetInstrument(int chan, int instrId) { +int TownsAudioInterfaceInternal::pcmSetInstrument(int chan, int instrId) { if (chan > 0x47) return 1; if (instrId > 31) @@ -1255,7 +1530,7 @@ int TownsAudioInterface::pcmSetInstrument(int chan, int instrId) { return 0; } -int TownsAudioInterface::pcmLoadInstrument(int instrId, const uint8 *data) { +int TownsAudioInterfaceInternal::pcmLoadInstrument(int instrId, const uint8 *data) { if (instrId > 31) return 3; assert(data); @@ -1263,7 +1538,7 @@ int TownsAudioInterface::pcmLoadInstrument(int instrId, const uint8 *data) { return 0; } -int TownsAudioInterface::pcmSetPitch(int chan, int pitch) { +int TownsAudioInterfaceInternal::pcmSetPitch(int chan, int pitch) { if (chan > 0x47) return 1; @@ -1293,7 +1568,7 @@ int TownsAudioInterface::pcmSetPitch(int chan, int pitch) { return 0; } -int TownsAudioInterface::pcmSetLevel(int chan, int lvl) { +int TownsAudioInterfaceInternal::pcmSetLevel(int chan, int lvl) { if (chan > 0x47) return 1; @@ -1322,7 +1597,7 @@ int TownsAudioInterface::pcmSetLevel(int chan, int lvl) { return 0; } -void TownsAudioInterface::pcmUpdateEnvelopeGenerator(int chan) { +void TownsAudioInterfaceInternal::pcmUpdateEnvelopeGenerator(int chan) { TownsAudio_PcmChannel *p = &_pcmChan[chan]; if (!p->envCurrentLevel) { _pcmChanKeyPlaying &= ~_chanFlags[chan]; @@ -1364,7 +1639,7 @@ void TownsAudioInterface::pcmUpdateEnvelopeGenerator(int chan) { p->velo = (p->envCurrentLevel >> 8) << 1; } -void TownsAudioInterface::pcmCalcPhaseStep(TownsAudio_PcmChannel *p, TownsAudio_WaveTable *w) { +void TownsAudioInterfaceInternal::pcmCalcPhaseStep(TownsAudio_PcmChannel *p, TownsAudio_WaveTable *w) { int8 diff = p->note - w->baseNote; uint16 r = w->rate + w->rateOffs; uint16 bl = 0; @@ -1393,45 +1668,60 @@ void TownsAudioInterface::pcmCalcPhaseStep(TownsAudio_PcmChannel *p, TownsAudio_ p->step = (s * p->stepPitch) >> 14; } -void TownsAudioInterface::updateOutputVolume() { +void TownsAudioInterfaceInternal::updateOutputVolume() { + // Avoid calls to g_system->getAudioCDManager() functions from the main thread + // since this can cause mutex lockups. + _updateOutputVol = true; +} + +void TownsAudioInterfaceInternal::updateOutputVolumeInternal() { + if (!_ready) + return; + // FM Towns seems to support volumes of 0 - 63 for each channel. // We recalculate sane values for our 0 to 255 volume range and // balance values for our -128 to 127 volume range // CD-AUDIO - uint32 maxVol = MAX(_outputLevel[12], _outputLevel[13]); + uint32 maxVol = MAX(_outputLevel[12] * (_outputMute[12] ^ 1), _outputLevel[13] * (_outputMute[13] ^ 1)); int volume = (int)(((float)(maxVol * 255) / 63.0f)); - int balance = maxVol ? (int)( ( ((int)_outputLevel[13] - _outputLevel[12]) * 127) / (float)maxVol) : 0; + int balance = maxVol ? (int)( ( ((int)_outputLevel[13] * (_outputMute[13] ^ 1) - _outputLevel[12] * (_outputMute[12] ^ 1)) * 127) / (float)maxVol) : 0; g_system->getAudioCDManager()->setVolume(volume); g_system->getAudioCDManager()->setBalance(balance); + + _updateOutputVol = false; } -const uint8 TownsAudioInterface::_chanFlags[] = { +TownsAudioInterfaceInternal *TownsAudioInterfaceInternal::_refInstance = 0; + +int TownsAudioInterfaceInternal::_refCount = 0; + +const uint8 TownsAudioInterfaceInternal::_chanFlags[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; -const uint16 TownsAudioInterface::_frequency[] = { +const uint16 TownsAudioInterfaceInternal::_frequency[] = { 0x028C, 0x02B4, 0x02DC, 0x030A, 0x0338, 0x0368, 0x039C, 0x03D4, 0x040E, 0x044A, 0x048C, 0x04D0 }; -const uint8 TownsAudioInterface::_carrier[] = { +const uint8 TownsAudioInterfaceInternal::_carrier[] = { 0x10, 0x10, 0x10, 0x10, 0x30, 0x70, 0x70, 0xF0 }; -const uint8 TownsAudioInterface::_fmDefaultInstrument[] = { +const uint8 TownsAudioInterfaceInternal::_fmDefaultInstrument[] = { 0x45, 0x4C, 0x45, 0x50, 0x49, 0x41, 0x4E, 0x4F, 0x01, 0x0A, 0x02, 0x01, 0x1E, 0x32, 0x05, 0x00, 0x9C, 0xDC, 0x9C, 0xDC, 0x07, 0x03, 0x14, 0x08, 0x00, 0x03, 0x05, 0x05, 0x55, 0x45, 0x27, 0xA7, 0x04, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -const uint16 TownsAudioInterface::_pcmPhase1[] = { +const uint16 TownsAudioInterfaceInternal::_pcmPhase1[] = { 0x879B, 0x0F37, 0x1F58, 0x306E, 0x4288, 0x55B6, 0x6A08, 0x7F8F, 0x965E, 0xAE88, 0xC882, 0xE341 }; -const uint16 TownsAudioInterface::_pcmPhase2[] = { +const uint16 TownsAudioInterfaceInternal::_pcmPhase2[] = { 0xFEFE, 0xF1A0, 0xE411, 0xD744, 0xCB2F, 0xBFC7, 0xB504, 0xAAE2, 0xA144, 0x9827, 0x8FAC }; @@ -1582,3 +1872,37 @@ void TownsAudio_WaveTable::clear() { data = 0; } +TownsAudioInterface::TownsAudioInterface(Audio::Mixer *mixer, TownsAudioInterfacePluginDriver *driver, bool externalMutexHandling) { + _intf = TownsAudioInterfaceInternal::addNewRef(mixer, this, driver, externalMutexHandling); +} + +TownsAudioInterface::~TownsAudioInterface() { + TownsAudioInterfaceInternal::releaseRef(this); + _intf = 0; +} + +bool TownsAudioInterface::init() { + return _intf->init(); +} + +int TownsAudioInterface::callback(int command, ...) { + va_list args; + va_start(args, command); + + int res = _intf->processCommand(command, args); + + va_end(args); + return res; +} + +void TownsAudioInterface::setMusicVolume(int volume) { + _intf->setMusicVolume(volume); +} + +void TownsAudioInterface::setSoundEffectVolume(int volume) { + _intf->setSoundEffectVolume(volume); +} + +void TownsAudioInterface::setSoundEffectChanMask(int mask) { + _intf->setSoundEffectChanMask(mask); +} diff --git a/audio/softsynth/fmtowns_pc98/towns_audio.h b/audio/softsynth/fmtowns_pc98/towns_audio.h index 2819ab2d57f..4af888f0095 100644 --- a/audio/softsynth/fmtowns_pc98/towns_audio.h +++ b/audio/softsynth/fmtowns_pc98/towns_audio.h @@ -18,15 +18,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOWNS_AUDIO_H #define TOWNS_AUDIO_H -#include "audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h" +#include "audio/mixer.h" + +class TownsAudioInterfaceInternal; class TownsAudioInterfacePluginDriver { public: @@ -34,12 +33,9 @@ public: virtual void timerCallback(int timerId) = 0; }; -class TownsAudio_PcmChannel; -class TownsAudio_WaveTable; - -class TownsAudioInterface : public TownsPC98_FmSynth { +class TownsAudioInterface { public: - TownsAudioInterface(Audio::Mixer *mixer, TownsAudioInterfacePluginDriver *driver); + TownsAudioInterface(Audio::Mixer *mixer, TownsAudioInterfacePluginDriver *driver, bool externalMutexHandling = false); ~TownsAudioInterface(); bool init(); @@ -53,126 +49,7 @@ public: void setSoundEffectChanMask(int mask); private: - void nextTickEx(int32 *buffer, uint32 bufferSize); - - void timerCallbackA(); - void timerCallbackB(); - - typedef int (TownsAudioInterface::*TownsAudioIntfCallback)(va_list &); - const TownsAudioIntfCallback *_intfOpcodes; - - int intf_reset(va_list &args); - int intf_keyOn(va_list &args); - int intf_keyOff(va_list &args); - int intf_setPanPos(va_list &args); - int intf_setInstrument(va_list &args); - int intf_loadInstrument(va_list &args); - int intf_setPitch(va_list &args); - int intf_setLevel(va_list &args); - int intf_chanOff(va_list &args); - int intf_writeReg(va_list &args); - int intf_writeRegBuffer(va_list &args); - int intf_readRegBuffer(va_list &args); - int intf_setTimerA(va_list &args); - int intf_setTimerB(va_list &args); - int intf_enableTimerA(va_list &args); - int intf_enableTimerB(va_list &args); - int intf_loadSamples(va_list &args); - int intf_reserveEffectChannels(va_list &args); - int intf_loadWaveTable(va_list &args); - int intf_unloadWaveTable(va_list &args); - int intf_pcmPlayEffect(va_list &args); - int intf_pcmChanOff(va_list &args); - int intf_pcmEffectPlaying(va_list &args); - int intf_fmKeyOn(va_list &args); - int intf_fmKeyOff(va_list &args); - int intf_fmSetPanPos(va_list &args); - int intf_fmSetInstrument(va_list &args); - int intf_fmLoadInstrument(va_list &args); - int intf_fmSetPitch(va_list &args); - int intf_fmSetLevel(va_list &args); - int intf_fmReset(va_list &args); - int intf_setOutputVolume(va_list &args); - int intf_resetOutputVolume(va_list &args); - int intf_updateOutputVolume(va_list &args); - int intf_cdaToggle(va_list &args); - int intf_pcmUpdateEnvelopeGenerator(va_list &args); - - int intf_notImpl(va_list &args); - - void fmReset(); - int fmKeyOn(int chan, int note, int velo); - int fmKeyOff(int chan); - int fmChanOff(int chan); - int fmSetPanPos(int chan, int mode); - int fmSetInstrument(int chan, int instrId); - int fmLoadInstrument(int instrId, const uint8 *data); - int fmSetPitch(int chan, int pitch); - int fmSetLevel(int chan, int lvl); - - void bufferedWriteReg(uint8 part, uint8 regAddress, uint8 value); - - uint8 _fmChanPlaying; - uint8 _fmChanNote[6]; - int16 _fmChanPitch[6]; - - uint8 *_fmSaveReg[2]; - uint8 *_fmInstruments; - - void pcmReset(); - int pcmKeyOn(int chan, int note, int velo); - int pcmKeyOff(int chan); - int pcmChanOff(int chan); - int pcmSetPanPos(int chan, int mode); - int pcmSetInstrument(int chan, int instrId); - int pcmLoadInstrument(int instrId, const uint8 *data); - int pcmSetPitch(int chan, int pitch); - int pcmSetLevel(int chan, int lvl); - void pcmUpdateEnvelopeGenerator(int chan); - - TownsAudio_PcmChannel *_pcmChan; - uint8 _pcmChanOut; - uint8 _pcmChanReserved; - uint8 _pcmChanKeyPressed; - uint8 _pcmChanEffectPlaying; - uint8 _pcmChanKeyPlaying; - - uint8 _pcmChanNote[8]; - uint8 _pcmChanVelo[8]; - uint8 _pcmChanLevel[8]; - - uint8 _numReservedChannels; - uint8 *_pcmInstruments; - - TownsAudio_WaveTable *_waveTables; - uint8 _numWaveTables; - uint32 _waveTablesTotalDataSize; - - void pcmCalcPhaseStep(TownsAudio_PcmChannel *p, TownsAudio_WaveTable *w); - - void updateOutputVolume(); - uint8 _outputVolumeFlags; - uint8 _outputLevel[16]; - uint8 _outputMuteFlags; - - const float _baserate; - uint32 _timerBase; - uint32 _tickLength; - uint32 _timer; - - uint16 _musicVolume; - uint16 _sfxVolume; - int _pcmSfxChanMask; - - TownsAudioInterfacePluginDriver *_drv; - bool _ready; - - static const uint8 _chanFlags[]; - static const uint16 _frequency[]; - static const uint8 _carrier[]; - static const uint8 _fmDefaultInstrument[]; - static const uint16 _pcmPhase1[]; - static const uint16 _pcmPhase2[]; + TownsAudioInterfaceInternal *_intf; }; #endif diff --git a/audio/softsynth/fmtowns_pc98/towns_euphony.cpp b/audio/softsynth/fmtowns_pc98/towns_euphony.cpp index cd3a348b853..bc2c88b236a 100644 --- a/audio/softsynth/fmtowns_pc98/towns_euphony.cpp +++ b/audio/softsynth/fmtowns_pc98/towns_euphony.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/softsynth/fmtowns_pc98/towns_euphony.h" @@ -31,7 +28,8 @@ TownsEuphonyDriver::TownsEuphonyDriver(Audio::Mixer *mixer) : _activeChannels(0), _sustainChannels(0), _assignedChannels(0), _paraCount(0), _command(0), _tEnable(0), _tMode(0), _tOrdr(0), _tLevel(0), _tTranspose(0), _musicPos(0), _musicStart(0), _playing(false), _eventBuffer(0), _bufferedEventsCount(0), - _tempoControlMode(0) { + _tempoControlMode(0), _timerSetting(0), _tempoDiff(0), _timeStampBase(0), _elapsedEvents(0), _loop(false), + _endOfTrack(false), _suspendParsing(false), _musicTrackSize(0) { _para[0] = _para[1] = 0; _intf = new TownsAudioInterface(mixer, this); resetTempo(); @@ -84,7 +82,7 @@ void TownsEuphonyDriver::reset() { _intf->callback(0); _intf->callback(74); - _intf->callback(70); + _intf->callback(70, 0); _intf->callback(75, 3); setTimerA(true, 1); @@ -223,21 +221,21 @@ void TownsEuphonyDriver::setOutputVolume(int mode, int volLeft, int volRight) { _intf->callback(67, mode, volLeft, volRight); } -int TownsEuphonyDriver::chanEnable(int tableEntry, int val) { +int TownsEuphonyDriver::configChan_enable(int tableEntry, int val) { if (tableEntry > 31) return 3; _tEnable[tableEntry] = val; return 0; } -int TownsEuphonyDriver::chanMode(int tableEntry, int val) { +int TownsEuphonyDriver::configChan_setMode(int tableEntry, int val) { if (tableEntry > 31) return 3; _tMode[tableEntry] = val; return 0; } -int TownsEuphonyDriver::chanOrdr(int tableEntry, int val) { +int TownsEuphonyDriver::configChan_remap(int tableEntry, int val) { if (tableEntry > 31) return 3; if (val < 16) @@ -245,7 +243,7 @@ int TownsEuphonyDriver::chanOrdr(int tableEntry, int val) { return 0; } -int TownsEuphonyDriver::chanVolumeShift(int tableEntry, int val) { +int TownsEuphonyDriver::configChan_adjustVolume(int tableEntry, int val) { if (tableEntry > 31) return 3; if (val <= 40) @@ -253,7 +251,7 @@ int TownsEuphonyDriver::chanVolumeShift(int tableEntry, int val) { return 0; } -int TownsEuphonyDriver::chanNoteShift(int tableEntry, int val) { +int TownsEuphonyDriver::configChan_setTranspose(int tableEntry, int val) { if (tableEntry > 31) return 3; if (val <= 40) @@ -675,8 +673,8 @@ bool TownsEuphonyDriver::evtSetupNote() { uint8 velo = _musicPos[5]; sendEvent(mode, evt); - sendEvent(mode, applyNoteShift(note)); - sendEvent(mode, applyVolumeShift(velo)); + sendEvent(mode, applyTranspose(note)); + sendEvent(mode, applyVolumeAdjust(velo)); jumpNextLoop(); if (_musicPos[0] == 0xfe || _musicPos[0] == 0xfd) @@ -715,7 +713,7 @@ bool TownsEuphonyDriver::evtPolyphonicAftertouch() { uint8 mode = _tMode[_musicPos[1]]; sendEvent(mode, evt); - sendEvent(mode, applyNoteShift(_musicPos[4])); + sendEvent(mode, applyTranspose(_musicPos[4])); sendEvent(mode, _musicPos[5]); return false; @@ -783,7 +781,7 @@ bool TownsEuphonyDriver::evtModeOrdrChange() { return false; } -uint8 TownsEuphonyDriver::applyNoteShift(uint8 in) { +uint8 TownsEuphonyDriver::applyTranspose(uint8 in) { int out = _tTranspose[_musicPos[1]]; if (!out) return in; @@ -798,7 +796,7 @@ uint8 TownsEuphonyDriver::applyNoteShift(uint8 in) { return out & 0xff; } -uint8 TownsEuphonyDriver::applyVolumeShift(uint8 in) { +uint8 TownsEuphonyDriver::applyVolumeAdjust(uint8 in) { int out = _tLevel[_musicPos[1]]; out += (in & 0x7f); out = CLIP(out, 1, 127); diff --git a/audio/softsynth/fmtowns_pc98/towns_euphony.h b/audio/softsynth/fmtowns_pc98/towns_euphony.h index dc403739133..6b30bfb7f5e 100644 --- a/audio/softsynth/fmtowns_pc98/towns_euphony.h +++ b/audio/softsynth/fmtowns_pc98/towns_euphony.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOWNS_EUP_H @@ -58,11 +55,11 @@ public: void setOutputVolume(int chanType, int volLeft, int volRight); - int chanEnable(int tableEntry, int val); - int chanMode(int tableEntry, int val); - int chanOrdr(int tableEntry, int val); - int chanVolumeShift(int tableEntry, int val); - int chanNoteShift(int tableEntry, int val); + int configChan_enable(int tableEntry, int val); + int configChan_setMode(int tableEntry, int val); + int configChan_remap(int tableEntry, int val); + int configChan_adjustVolume(int tableEntry, int val); + int configChan_setTranspose(int tableEntry, int val); int assignChannel(int chan, int tableEntry); @@ -114,8 +111,8 @@ private: return false; } - uint8 applyNoteShift(uint8 in); - uint8 applyVolumeShift(uint8 in); + uint8 applyTranspose(uint8 in); + uint8 applyVolumeAdjust(uint8 in); void sendNoteOff(); void sendNoteOn(); diff --git a/audio/softsynth/fmtowns_pc98/towns_midi.cpp b/audio/softsynth/fmtowns_pc98/towns_midi.cpp new file mode 100644 index 00000000000..4617b0555c1 --- /dev/null +++ b/audio/softsynth/fmtowns_pc98/towns_midi.cpp @@ -0,0 +1,1043 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "audio/softsynth/fmtowns_pc98/towns_midi.h" +#include "audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h" +#include "common/textconsole.h" +#include "common/system.h" + +class TownsMidiOutputChannel { +friend class TownsMidiInputChannel; +public: + TownsMidiOutputChannel(MidiDriver_TOWNS *driver, int chanId); + ~TownsMidiOutputChannel(); + + void noteOn(uint8 msb, uint16 lsb); + void noteOnPitchBend(uint8 msb, uint16 lsb); + void setupProgram(const uint8 *data, uint8 mLevelPara, uint8 tLevelPara); + void setupEffects(int index, uint8 flags, const uint8 *effectData); + void setModWheel(uint8 value); + + void connect(TownsMidiInputChannel *chan); + void disconnect(); + + bool update(); + + enum CheckPriorityStatus { + kDisconnected = -2, + kHighPriority = -1 + }; + + int checkPriority(int pri); + +private: + struct EffectEnvelope { + uint8 state; + int32 currentLevel; + int32 duration; + int32 maxLevel; + int32 startLevel; + uint8 loop; + uint8 stateTargetLevels[4]; + uint8 stateModWheelLevels[4]; + int8 modWheelSensitivity; + int8 modWheelState; + int8 modWheelLast; + uint16 numSteps; + uint32 stepCounter; + int32 incrPerStep; + int8 dir; + uint32 incrPerStepRem; + uint32 incrCountRem; + } *_effectEnvelopes; + + struct EffectDef { + int32 phase; + uint8 type; + uint8 useModWheel; + uint8 loopRefresh; + EffectEnvelope *s; + } *_effectDefs; + + void startEffect(EffectEnvelope *s, const uint8 *effectData); + void updateEffectGenerator(EffectEnvelope *s, EffectDef *d); + int advanceEffectEnvelope(EffectEnvelope *s, EffectDef *d); + void initNextEnvelopeState(EffectEnvelope *s); + int16 getEffectStartLevel(uint8 type); + int getEffectModLevel(int lvl, int mod); + + void keyOn(); + void keyOff(); + void keyOnSetFreq(uint16 frq); + void out(uint8 reg, uint8 val); + + TownsMidiInputChannel *_in; + TownsMidiOutputChannel *_prev; + TownsMidiOutputChannel *_next; + uint8 _adjustModTl; + uint8 _chan; + uint8 _note; + uint8 _operator2Tl; + uint8 _operator1Tl; + uint8 _sustainNoteOff; + int16 _duration; + + uint16 _freq; + int16 _freqAdjust; + + MidiDriver_TOWNS *_driver; + + static const uint8 _chanMap[]; + static const uint8 _chanMap2[]; + static const uint8 _effectDefaults[]; + static const uint16 _effectEnvStepTable[]; + static const uint8 _freqMSB[]; + static const uint16 _freqLSB[]; +}; + +class TownsMidiInputChannel : public MidiChannel { +friend class TownsMidiOutputChannel; +public: + TownsMidiInputChannel(MidiDriver_TOWNS *driver, int chanIndex); + ~TownsMidiInputChannel(); + + MidiDriver *device() { return _driver; } + byte getNumber() { return _chanIndex; } + bool allocate(); + void release(); + + void send(uint32 b); + + void noteOff(byte note); + void noteOn(byte note, byte velocity); + void programChange(byte program); + void pitchBend(int16 bend); + void controlChange(byte control, byte value); + void pitchBendFactor(byte value); + void priority(byte value); + void sysEx_customInstrument(uint32 type, const byte *instr); + +private: + void controlModulationWheel(byte value); + void controlVolume(byte value); + void controlPanPos(byte value); + void controlSustain(byte value); + + void releasePedal(); + + TownsMidiOutputChannel *_out; + + uint8 *_instrument; + uint8 _prg; + uint8 _chanIndex; + uint8 _effectLevel; + uint8 _priority; + uint8 _ctrlVolume; + uint8 _tl; + uint8 _pan; + uint8 _panEff; + uint8 _percS; + int8 _transpose; + uint8 _fld_1f; + int8 _detune; + int8 _modWheel; + uint8 _sustain; + uint8 _pitchBendFactor; + int16 _pitchBend; + uint16 _freqLSB; + + bool _allocated; + + MidiDriver_TOWNS *_driver; + + static const uint8 _programAdjustLevel[]; +}; + +class TownsMidiChanState { +public: + TownsMidiChanState(); + ~TownsMidiChanState() {} + uint8 get(uint8 type); + + uint8 unk1; + uint8 mulAmsFms; + uint8 tl; + uint8 attDec; + uint8 sus; + uint8 fgAlg; + uint8 unk2; +}; + +TownsMidiChanState::TownsMidiChanState() { + unk1 = mulAmsFms = tl = attDec = sus = fgAlg = unk2 = 0; +} + +uint8 TownsMidiChanState::get(uint8 type) { + switch (type) { + case 0: + return unk1; + case 1: + return mulAmsFms; + case 2: + return tl; + case 3: + return attDec; + case 4: + return sus; + case 5: + return fgAlg; + case 6: + return unk2; + default: + break; + } + return 0; +} + +TownsMidiOutputChannel::TownsMidiOutputChannel(MidiDriver_TOWNS *driver, int chanIndex) : _driver(driver), _chan(chanIndex), + _in(0), _prev(0), _next(0), _adjustModTl(0), _operator2Tl(0), _note(0), _operator1Tl(0), _sustainNoteOff(0), _duration(0), _freq(0), _freqAdjust(0) { + _effectEnvelopes = new EffectEnvelope[2]; + _effectDefs = new EffectDef[2]; + + memset(_effectEnvelopes, 0, 2 * sizeof(EffectEnvelope)); + memset(_effectDefs, 0, 2 * sizeof(EffectDef)); + _effectDefs[0].s = &_effectEnvelopes[1]; + _effectDefs[1].s = &_effectEnvelopes[0]; +} + +TownsMidiOutputChannel::~TownsMidiOutputChannel() { + delete[] _effectEnvelopes; + delete[] _effectDefs; +} + +void TownsMidiOutputChannel::noteOn(uint8 msb, uint16 lsb) { + _freq = (msb << 7) + lsb; + _freqAdjust = 0; + keyOnSetFreq(_freq); +} + +void TownsMidiOutputChannel::noteOnPitchBend(uint8 msb, uint16 lsb) { + _freq = (msb << 7) + lsb; + keyOnSetFreq(_freq + _freqAdjust); +} + +void TownsMidiOutputChannel::setupProgram(const uint8 *data, uint8 mLevelPara, uint8 tLevelPara) { + // This driver uses only 2 operators and 2 algorithms (algorithm 5 and 7), + // since it is just a modified AdLib driver. It also uses AdLib programs. + // There are no FM-TOWNS specific programs. This is the reason for the low quality of the FM-TOWNS + // music (unsuitable data is just forced into the wrong audio device). + + static const uint8 mul[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 12, 12, 15, 15 }; + uint8 chan = _chanMap[_chan]; + + uint8 mulAmsFms1 = _driver->_chanState[chan].mulAmsFms = data[0]; + uint8 tl1 = _driver->_chanState[chan].tl = (data[1] | 0x3f) - mLevelPara; + uint8 attDec1 = _driver->_chanState[chan].attDec = ~data[2]; + uint8 sus1 = _driver->_chanState[chan].sus = ~data[3]; + _driver->_chanState[chan].unk2 = data[4]; + chan += 3; + + out(0x30, mul[mulAmsFms1 & 0x0f]); + out(0x40, (tl1 & 0x3f) + 15); + out(0x50, ((attDec1 >> 4) << 1) | ((attDec1 >> 4) & 1)); + out(0x60, ((attDec1 << 1) | (attDec1 & 1)) & 0x1f); + out(0x70, (mulAmsFms1 & 0x20) ^ 0x20 ? (((sus1 & 0x0f) << 1) | 1) : 0); + out(0x80, sus1); + + uint8 mulAmsFms2 = _driver->_chanState[chan].mulAmsFms = data[5]; + uint8 tl2 = _driver->_chanState[chan].tl = (data[6] | 0x3f) - tLevelPara; + uint8 attDec2 = _driver->_chanState[chan].attDec = ~data[7]; + uint8 sus2 = _driver->_chanState[chan].sus = ~data[8]; + _driver->_chanState[chan].unk2 = data[9]; + + uint8 mul2 = mul[mulAmsFms2 & 0x0f]; + tl2 = (tl2 & 0x3f) + 15; + uint8 ar2 = ((attDec2 >> 4) << 1) | ((attDec2 >> 4) & 1); + uint8 dec2 = ((attDec2 << 1) | (attDec2 & 1)) & 0x1f; + uint8 sus2r = (mulAmsFms2 & 0x20) ^ 0x20 ? (((sus2 & 0x0f) << 1) | 1) : 0; + + for (int i = 4; i < 16; i += 4) { + out(0x30 + i, mul2); + out(0x40 + i, tl2); + out(0x50 + i, ar2); + out(0x60 + i, dec2); + out(0x70 + i, sus2r); + out(0x80 + i, sus2); + } + + _driver->_chanState[chan].fgAlg = data[10]; + + uint8 alg = 5 + 2 * (data[10] & 1); + uint8 fb = 4 * (data[10] & 0x0e); + out(0xb0, fb | alg); + uint8 t = mulAmsFms1 | mulAmsFms2; + out(0xb4, (0xc0 | ((t & 0x80) >> 3) | ((t & 0x40) >> 5))); +} + +void TownsMidiOutputChannel::setupEffects(int index, uint8 flags, const uint8 *effectData) { + uint16 effectMaxLevel[] = { 0x2FF, 0x1F, 0x07, 0x3F, 0x0F, 0x0F, 0x0F, 0x03, 0x3F, 0x0F, 0x0F, 0x0F, 0x03, 0x3E, 0x1F }; + uint8 effectType[] = { 0x1D, 0x1C, 0x1B, 0x00, 0x03, 0x04, 0x07, 0x08, 0x0D, 0x10, 0x11, 0x14, 0x15, 0x1e, 0x1f, 0x00 }; + + EffectEnvelope *s = &_effectEnvelopes[index]; + EffectDef *d = &_effectDefs[index]; + + d->phase = 0; + d->useModWheel = flags & 0x40; + s->loop = flags & 0x20; + d->loopRefresh = flags & 0x10; + d->type = effectType[flags & 0x0f]; + s->maxLevel = effectMaxLevel[flags & 0x0f]; + s->modWheelSensitivity = 31; + s->modWheelState = d->useModWheel ? _in->_modWheel >> 2 : 31; + + switch (d->type) { + case 0: + s->startLevel = _operator2Tl; + break; + case 13: + s->startLevel = _operator1Tl; + break; + case 30: + s->startLevel = 31; + d->s->modWheelState = 0; + break; + case 31: + s->startLevel = 0; + d->s->modWheelSensitivity = 0; + break; + default: + s->startLevel = getEffectStartLevel(d->type); + break; + } + + startEffect(s, effectData); +} + +void TownsMidiOutputChannel::setModWheel(uint8 value) { + if (_effectEnvelopes[0].state != kEnvReady && _effectDefs[0].type) + _effectEnvelopes[0].modWheelState = value >> 2; + + if (_effectEnvelopes[1].state != kEnvReady && _effectDefs[1].type) + _effectEnvelopes[1].modWheelState = value >> 2; +} + +void TownsMidiOutputChannel::connect(TownsMidiInputChannel *chan) { + if (!chan) + return; + + _in = chan; + _next = chan->_out; + _prev = 0; + chan->_out = this; + if (_next) + _next->_prev = this; +} + +void TownsMidiOutputChannel::disconnect() { + keyOff(); + + TownsMidiOutputChannel *p = _prev; + TownsMidiOutputChannel *n = _next; + + if (n) + n->_prev = p; + if (p) + p->_next = n; + else + _in->_out = n; + _in = 0; +} + +bool TownsMidiOutputChannel::update() { + if (!_in) + return false; + + if (_duration) { + _duration -= 17; + if (_duration <= 0) { + disconnect(); + return true; + } + } + + for (int i = 0; i < 2; i++) { + if (_effectEnvelopes[i].state != kEnvReady) + updateEffectGenerator(&_effectEnvelopes[i], &_effectDefs[i]); + } + + return false; +} + +int TownsMidiOutputChannel::checkPriority(int pri) { + if (!_in) + return kDisconnected; + + if (!_next && pri >= _in->_priority) + return _in->_priority; + + return kHighPriority; +} + +void TownsMidiOutputChannel::startEffect(EffectEnvelope *s, const uint8 *effectData) { + s->state = kEnvAttacking; + s->currentLevel = 0; + s->modWheelLast = 31; + s->duration = effectData[0] * 63; + s->stateTargetLevels[0] = effectData[1]; + s->stateTargetLevels[1] = effectData[3]; + s->stateTargetLevels[2] = effectData[5]; + s->stateTargetLevels[3] = effectData[6]; + s->stateModWheelLevels[0] = effectData[2]; + s->stateModWheelLevels[1] = effectData[4]; + s->stateModWheelLevels[2] = 0; + s->stateModWheelLevels[3] = effectData[7]; + initNextEnvelopeState(s); +} + +void TownsMidiOutputChannel::updateEffectGenerator(EffectEnvelope *s, EffectDef *d) { + uint8 f = advanceEffectEnvelope(s, d); + + if (f & 1) { + switch (d->type) { + case 0: + _operator2Tl = s->startLevel + d->phase; + break; + case 13: + _operator1Tl = s->startLevel + d->phase; + break; + case 30: + d->s->modWheelState = d->phase; + break; + case 31: + d->s->modWheelSensitivity = d->phase; + break; + default: + break; + } + } + + if (f & 2) { + if (d->loopRefresh) + keyOn(); + } +} + +int TownsMidiOutputChannel::advanceEffectEnvelope(EffectEnvelope *s, EffectDef *d) { + if (s->duration) { + s->duration -= 17; + if (s->duration <= 0) { + s->state = kEnvReady; + return 0; + } + } + + int32 t = s->currentLevel + s->incrPerStep; + + s->incrCountRem += s->incrPerStepRem; + if (s->incrCountRem >= s->numSteps) { + s->incrCountRem -= s->numSteps; + t += s->dir; + } + + int retFlags = 0; + + if (t != s->currentLevel || (s->modWheelState != s->modWheelLast)) { + s->currentLevel = t; + s->modWheelLast = s->modWheelState; + t = getEffectModLevel(t, s->modWheelState); + if (t != d->phase) + d->phase = t; + retFlags |= 1; + } + + if (--s->stepCounter) + return retFlags; + + if (++s->state > kEnvReleasing) { + if (!s->loop) { + s->state = kEnvReady; + return retFlags; + } + s->state = kEnvAttacking; + retFlags |= 2; + } + + initNextEnvelopeState(s); + + return retFlags; +} + +void TownsMidiOutputChannel::initNextEnvelopeState(EffectEnvelope *s) { + uint8 v = s->stateTargetLevels[s->state - 1]; + int32 e = _effectEnvStepTable[_driver->_operatorLevelTable[((v & 0x7f) << 5) + s->modWheelSensitivity]]; + + if (v & 0x80) + e = _driver->randomValue(e); + + if (!e) + e = 1; + + s->numSteps = s->stepCounter = e; + int32 d = 0; + + if (s->state != kEnvSustaining) { + v = s->stateModWheelLevels[s->state - 1]; + e = getEffectModLevel(s->maxLevel, (v & 0x7f) - 31); + + if (v & 0x80) + e = _driver->randomValue(e); + + if (e + s->startLevel > s->maxLevel) { + e = s->maxLevel - s->startLevel; + } else { + if (e + s->startLevel < 0) + e = -s->startLevel; + } + + d = e - s->currentLevel; + } + + s->incrPerStep = d / s->numSteps; + s->dir = (d < 0) ? -1 : 1; + d *= s->dir; + s->incrPerStepRem = d % s->numSteps; + s->incrCountRem = 0; +} + +int16 TownsMidiOutputChannel::getEffectStartLevel(uint8 type) { + uint8 chan = (type < 13) ? _chanMap2[_chan] : ((type < 26) ? _chanMap[_chan] : _chan); + + if (type == 28) + return 15; + else if (type == 29) + return 383; + else if (type > 29) + return 0; + else if (type > 12) + type -= 13; + + const uint8 *def = &_effectDefaults[type << 2]; + uint8 res = (_driver->_chanState[chan].get(def[0] >> 5) & def[2]) >> def[1]; + if (def[3]) + res = def[3] - res; + + return res; +} + +int TownsMidiOutputChannel::getEffectModLevel(int lvl, int mod) { + if (mod == 0) + return 0; + + if (mod == 31) + return lvl; + + if (lvl > 63 || lvl < -63) + return ((lvl + 1) * mod) >> 5; + + if (mod < 0) { + if (lvl < 0) + return _driver->_operatorLevelTable[((-lvl) << 5) - mod]; + else + return -_driver->_operatorLevelTable[(lvl << 5) - mod]; + } else { + if (lvl < 0) + return -_driver->_operatorLevelTable[((-lvl) << 5) + mod]; + else + return _driver->_operatorLevelTable[((-lvl) << 5) + mod]; + } + + return 0; +} + +void TownsMidiOutputChannel::keyOn() { + out(0x28, 0x30); +} + +void TownsMidiOutputChannel::keyOff() { + out(0x28, 0); +} + +void TownsMidiOutputChannel::keyOnSetFreq(uint16 frq) { + uint16 note = (frq << 1) >> 8; + frq = (_freqMSB[note] << 11) | _freqLSB[note] ; + out(0xa4, frq >> 8); + out(0xa0, frq & 0xff); + //out(0x28, 0x00); + out(0x28, 0x30); +} + +void TownsMidiOutputChannel::out(uint8 reg, uint8 val) { + static const uint8 chanRegOffs[] = { 0, 1, 2, 0, 1, 2 }; + static const uint8 keyValOffs[] = { 0, 1, 2, 4, 5, 6 }; + + if (reg == 0x28) + val = (val & 0xf0) | keyValOffs[_chan]; + if (reg < 0x30) + _driver->_intf->callback(17, 0, reg, val); + else + _driver->_intf->callback(17, _chan / 3, (reg & ~3) | chanRegOffs[_chan], val); +} + +const uint8 TownsMidiOutputChannel::_chanMap[] = { + 0, 1, 2, 8, 9, 10 +}; + +const uint8 TownsMidiOutputChannel::_chanMap2[] = { + 3, 4, 5, 11, 12, 13 +}; + +const uint8 TownsMidiOutputChannel::_effectDefaults[] = { + 0x40, 0x00, 0x3F, 0x3F, 0xE0, 0x02, 0x00, 0x00, 0x40, 0x06, 0xC0, 0x00, + 0x20, 0x00, 0x0F, 0x00, 0x60, 0x04, 0xF0, 0x0F, 0x60, 0x00, 0x0F, 0x0F, + 0x80, 0x04, 0xF0, 0x0F, 0x80, 0x00, 0x0F, 0x0F, 0xE0, 0x00, 0x03, 0x00, + 0x20, 0x07, 0x80, 0x00, 0x20, 0x06, 0x40, 0x00, 0x20, 0x05, 0x20, 0x00, + 0x20, 0x04, 0x10, 0x00, 0xC0, 0x00, 0x01, 0x00, 0xC0, 0x01, 0x0E, 0x00 +}; + +const uint16 TownsMidiOutputChannel::_effectEnvStepTable[] = { + 0x0001, 0x0002, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, + 0x000A, 0x000C, 0x000E, 0x0010, 0x0012, 0x0015, 0x0018, 0x001E, + 0x0024, 0x0032, 0x0040, 0x0052, 0x0064, 0x0088, 0x00A0, 0x00C0, + 0x00F0, 0x0114, 0x0154, 0x01CC, 0x0258, 0x035C, 0x04B0, 0x0640 +}; + +const uint8 TownsMidiOutputChannel::_freqMSB[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x80, 0x81, 0x83, 0x85, + 0x87, 0x88, 0x8A, 0x8C, 0x8E, 0x8F, 0x91, 0x93, 0x95, 0x96, 0x98, 0x9A, + 0x9C, 0x9E, 0x9F, 0xA1, 0xA3, 0xA5, 0xA6, 0xA8, 0xAA, 0xAC, 0xAD, 0xAF, + 0xB1, 0xB3, 0xB4, 0xB6, 0xB8, 0xBA, 0xBC, 0xBD, 0xBF, 0xC1, 0xC3, 0xC4, + 0xC6, 0xC8, 0xCA, 0xCB, 0xCD, 0xCF, 0xD1, 0xD2, 0xD4, 0xD6, 0xD8, 0xDA, + 0xDB, 0xDD, 0xDF, 0xE1, 0xE2, 0xE4, 0xE6, 0xE8, 0xE9, 0xEB, 0xED, 0xEF +}; + +const uint16 TownsMidiOutputChannel::_freqLSB[] = { + 0x02D6, 0x02D6, 0x02D6, 0x02D6, 0x02D6, 0x02D6, 0x02D6, 0x02D6, + 0x02D6, 0x02D6, 0x02D6, 0x02D6, 0x02D6, 0x02D6, 0x0301, 0x032F, + 0x0360, 0x0393, 0x03C9, 0x0403, 0x0440, 0x0481, 0x04C6, 0x050E, + 0x055B, 0x02D6, 0x0301, 0x032F, 0x0360, 0x0393, 0x03C9, 0x0403, + 0x0440, 0x0481, 0x04C6, 0x050E, 0x055B, 0x02D6, 0x0301, 0x032F, + 0x0360, 0x0393, 0x03C9, 0x0403, 0x0440, 0x0481, 0x04C6, 0x050E, + 0x055B, 0x02D6, 0x0301, 0x032F, 0x0360, 0x0393, 0x03C9, 0x0403, + 0x0440, 0x0481, 0x04C6, 0x050E, 0x055B, 0x02D6, 0x0301, 0x032F, + 0x0360, 0x0393, 0x03C9, 0x0403, 0x0440, 0x0481, 0x04C6, 0x050E, + 0x055B, 0x02D6, 0x0301, 0x032F, 0x0360, 0x0393, 0x03C9, 0x0403, + 0x0440, 0x0481, 0x04C6, 0x050E, 0x055B, 0x02D6, 0x0301, 0x032F, + 0x0360, 0x0393, 0x03C9, 0x0403, 0x0440, 0x0481, 0x04C6, 0x050E, + 0x055B, 0x055B, 0x055B, 0x055B, 0x055B, 0x055B, 0x055B, 0x055B, + 0x055B, 0x055B, 0x055B, 0x055B, 0x055B, 0x055B, 0x055B, 0x055B, + 0x055B, 0x055B, 0x055B, 0x055B, 0x055B, 0x055B, 0x055B, 0x055B, + 0x055B, 0x055B, 0x055B, 0x055B, 0x055B, 0x055B, 0x055B, 0x055B +}; + +TownsMidiInputChannel::TownsMidiInputChannel(MidiDriver_TOWNS *driver, int chanIndex) : MidiChannel(), _driver(driver), _out(0), _prg(0), _chanIndex(chanIndex), + _effectLevel(0), _priority(0), _ctrlVolume(0), _tl(0), _pan(0), _panEff(0), _transpose(0), _percS(0), _pitchBendFactor(0), _pitchBend(0), _sustain(0), _freqLSB(0), + _fld_1f(0), _detune(0), _modWheel(0), _allocated(false) { + _instrument = new uint8[30]; + memset(_instrument, 0, 30); +} + +TownsMidiInputChannel::~TownsMidiInputChannel() { + delete[] _instrument; +} + +bool TownsMidiInputChannel::allocate() { + if (_allocated) + return false; + _allocated = true; + return true; +} + +void TownsMidiInputChannel::release() { + _allocated = false; +} + +void TownsMidiInputChannel::send(uint32 b) { + _driver->send(b | _chanIndex); +} + +void TownsMidiInputChannel::noteOff(byte note) { + if (!_out) + return; + + for (TownsMidiOutputChannel *oc = _out; oc; oc = oc->_next) { + if (oc->_note != note) + continue; + + if (_sustain) + oc->_sustainNoteOff = 1; + else + oc->disconnect(); + } +} + +void TownsMidiInputChannel::noteOn(byte note, byte velocity) { + TownsMidiOutputChannel *oc = _driver->allocateOutputChannel(_priority); + + if (!oc) + return; + + oc->connect(this); + + oc->_adjustModTl = _instrument[10] & 1; + oc->_note = note; + oc->_sustainNoteOff = 0; + oc->_duration = _instrument[29] * 63; + + oc->_operator1Tl = (_instrument[1] & 0x3f) + _driver->_operatorLevelTable[((velocity >> 1) << 5) + (_instrument[4] >> 2)]; + if (oc->_operator1Tl > 63) + oc->_operator1Tl = 63; + + oc->_operator2Tl = (_instrument[6] & 0x3f) + _driver->_operatorLevelTable[((velocity >> 1) << 5) + (_instrument[9] >> 2)]; + if (oc->_operator2Tl > 63) + oc->_operator2Tl = 63; + + oc->setupProgram(_instrument, oc->_adjustModTl == 1 ? _programAdjustLevel[_driver->_operatorLevelTable[(_tl >> 2) + (oc->_operator1Tl << 5)]] : oc->_operator1Tl, _programAdjustLevel[_driver->_operatorLevelTable[(_tl >> 2) + (oc->_operator2Tl << 5)]]); + oc->noteOn(note + _transpose, _freqLSB); + + if (_instrument[11] & 0x80) + oc->setupEffects(0, _instrument[11], &_instrument[12]); + else + oc->_effectEnvelopes[0].state = kEnvReady; + + if (_instrument[20] & 0x80) + oc->setupEffects(1, _instrument[20], &_instrument[21]); + else + oc->_effectEnvelopes[1].state = kEnvReady; +} + +void TownsMidiInputChannel::programChange(byte program) { + // Not implemented (The loading and assignment of programs + // is handled externally by the SCUMM engine. The programs + // get sent via sysEx_customInstrument.) +} + +void TownsMidiInputChannel::pitchBend(int16 bend) { + _pitchBend = bend; + _freqLSB = ((_pitchBend * _pitchBendFactor) >> 6) + _detune; + for (TownsMidiOutputChannel *oc = _out; oc; oc = oc->_next) + oc->noteOnPitchBend(oc->_note + oc->_in->_transpose, _freqLSB); +} + +void TownsMidiInputChannel::controlChange(byte control, byte value) { + switch (control) { + case 1: + controlModulationWheel(value); + break; + case 7: + controlVolume(value); + break; + case 10: + controlPanPos(value); + break; + case 64: + controlSustain(value); + break; + case 123: + while (_out) + _out->disconnect(); + break; + default: + break; + } +} + +void TownsMidiInputChannel::pitchBendFactor(byte value) { + _pitchBendFactor = value; + _freqLSB = ((_pitchBend * _pitchBendFactor) >> 6) + _detune; + for (TownsMidiOutputChannel *oc = _out; oc; oc = oc->_next) + oc->noteOnPitchBend(oc->_note + oc->_in->_transpose, _freqLSB); +} + +void TownsMidiInputChannel::priority(byte value) { + _priority = value; +} + +void TownsMidiInputChannel::sysEx_customInstrument(uint32 type, const byte *instr) { + memcpy(_instrument, instr, 30); +} + +void TownsMidiInputChannel::controlModulationWheel(byte value) { + _modWheel = value; + for (TownsMidiOutputChannel *oc = _out; oc; oc = oc->_next) + oc->setModWheel(value); +} + +void TownsMidiInputChannel::controlVolume(byte value) { + /* This is all done inside the imuse code + uint16 v1 = _ctrlVolume + 1; + uint16 v2 = value; + if (_chanIndex != 16) { + _ctrlVolume = value; + v2 = _player->getEffectiveVolume(); + } + _tl = (v1 * v2) >> 7;*/ + + _tl = value; +} + +void TownsMidiInputChannel::controlPanPos(byte value) { + // not implemented +} + +void TownsMidiInputChannel::controlSustain(byte value) { + _sustain = value; + if (!value) + releasePedal(); +} + +void TownsMidiInputChannel::releasePedal() { + for (TownsMidiOutputChannel *oc = _out; oc; oc = oc->_next) { + if (oc->_sustainNoteOff) + oc->disconnect(); + } +} + +const uint8 TownsMidiInputChannel::_programAdjustLevel[] = { + 0x00, 0x04, 0x07, 0x0B, 0x0D, 0x10, 0x12, 0x14, + 0x16, 0x18, 0x1A, 0x1B, 0x1D, 0x1E, 0x1F, 0x21, + 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, + 0x2A, 0x2B, 0x2C, 0x2C, 0x2D, 0x2E, 0x2F, 0x2F, + 0x30, 0x31, 0x31, 0x32, 0x33, 0x33, 0x34, 0x35, + 0x35, 0x36, 0x36, 0x37, 0x37, 0x38, 0x38, 0x39, + 0x39, 0x3A, 0x3A, 0x3B, 0x3B, 0x3C, 0x3C, 0x3C, + 0x3D, 0x3D, 0x3E, 0x3E, 0x3E, 0x3F, 0x3F, 0x3F +}; + +MidiDriver_TOWNS::MidiDriver_TOWNS(Audio::Mixer *mixer) : _timerProc(0), _timerProcPara(0), _channels(0), _out(0), + _chanState(0), _operatorLevelTable(0), _tickCounter1(0), _tickCounter2(0), _rand(1), _allocCurPos(0), _isOpen(false) { + // We set exteral mutex handling to true, since this driver is only suitable for use with the SCUMM engine + // which has its own mutex. This causes lockups which cannot always be avoided. + _intf = new TownsAudioInterface(mixer, this, true); + + _channels = new TownsMidiInputChannel*[32]; + for (int i = 0; i < 32; i++) + _channels[i] = new TownsMidiInputChannel(this, i > 8 ? (i + 1) : i); + + _out = new TownsMidiOutputChannel*[6]; + for (int i = 0; i < 6; i++) + _out[i] = new TownsMidiOutputChannel(this, i); + + _chanState = new TownsMidiChanState[32]; + + _operatorLevelTable = new uint8[2048]; + for (int i = 0; i < 64; i++) { + for (int ii = 0; ii < 32; ii++) + _operatorLevelTable[(i << 5) + ii] = ((i * (ii + 1)) >> 5) & 0xff; + } + for (int i = 0; i < 64; i++) + _operatorLevelTable[i << 5] = 0; +} + +MidiDriver_TOWNS::~MidiDriver_TOWNS() { + close(); + delete _intf; + + if (_channels) { + for (int i = 0; i < 32; i++) + delete _channels[i]; + delete[] _channels; + } + _channels = 0; + + if (_out) { + for (int i = 0; i < 6; i++) + delete _out[i]; + delete[] _out; + } + _out = 0; + + delete[] _chanState; + _chanState = 0; + delete[] _operatorLevelTable; + _operatorLevelTable = 0; +} + +int MidiDriver_TOWNS::open() { + if (_isOpen) + return MERR_ALREADY_OPEN; + + if (!_intf->init()) + return MERR_CANNOT_CONNECT; + + _intf->callback(0); + + _intf->callback(21, 255, 1); + _intf->callback(21, 0, 1); + _intf->callback(22, 255, 221); + + _intf->callback(33, 8); + _intf->setSoundEffectChanMask(~0x3f); + + _allocCurPos = 0; + + _isOpen = true; + + return 0; +} + +void MidiDriver_TOWNS::close() { + if (!_isOpen) + return; + + _isOpen = false; + + setTimerCallback(0, 0); + g_system->delayMillis(20); +} + +void MidiDriver_TOWNS::send(uint32 b) { + if (!_isOpen) + return; + + byte param2 = (b >> 16) & 0xFF; + byte param1 = (b >> 8) & 0xFF; + byte cmd = b & 0xF0; + + TownsMidiInputChannel *c = _channels[b & 0x0F]; + + switch (cmd) { + case 0x80: + c->noteOff(param1); + break; + case 0x90: + if (param2) + c->noteOn(param1, param2); + else + c->noteOff(param1); + break; + case 0xB0: + c->controlChange(param1, param2); + break; + case 0xC0: + c->programChange(param1); + break; + case 0xE0: + c->pitchBend((param1 | (param2 << 7)) - 0x2000); + break; + case 0xF0: + warning("MidiDriver_TOWNS: Receiving SysEx command on a send() call"); + break; + + default: + break; + } +} + +void MidiDriver_TOWNS::setTimerCallback(void *timer_param, Common::TimerManager::TimerProc timer_proc) { + _timerProc = timer_proc; + _timerProcPara = timer_param; +} + +uint32 MidiDriver_TOWNS::getBaseTempo() { + return 10080; +} + +MidiChannel *MidiDriver_TOWNS::allocateChannel() { + if (!_isOpen) + return 0; + + for (int i = 0; i < 32; ++i) { + TownsMidiInputChannel *chan = _channels[i]; + if (chan->allocate()) + return chan; + } + + return 0; +} + +MidiChannel *MidiDriver_TOWNS::getPercussionChannel() { + return 0; +} + +void MidiDriver_TOWNS::timerCallback(int timerId) { + if (!_isOpen) + return; + + switch (timerId) { + case 1: + updateParser(); + updateOutputChannels(); + + /*_tickCounter1 += 10000; + while (_tickCounter1 >= 4167) { + _tickCounter1 -= 4167; + unkUpdate(); + }*/ + break; + default: + break; + } +} + +void MidiDriver_TOWNS::updateParser() { + if (_timerProc) + _timerProc(_timerProcPara); +} + +void MidiDriver_TOWNS::updateOutputChannels() { + _tickCounter2 += 10000; + while (_tickCounter2 >= 16667) { + _tickCounter2 -= 16667; + for (int i = 0; i < 6; i++) { + if (_out[i]->update()) + return; + } + } +} + +TownsMidiOutputChannel *MidiDriver_TOWNS::allocateOutputChannel(uint8 pri) { + TownsMidiOutputChannel *res = 0; + + for (int i = 0; i < 6; i++) { + if (++_allocCurPos == 6) + _allocCurPos = 0; + + int s = _out[_allocCurPos]->checkPriority(pri); + if (s == TownsMidiOutputChannel::kDisconnected) + return _out[_allocCurPos]; + + if (s != TownsMidiOutputChannel::kHighPriority) { + pri = s; + res = _out[_allocCurPos]; + } + } + + if (res) + res->disconnect(); + + return res; +} + +int MidiDriver_TOWNS::randomValue(int para) { + _rand = (_rand & 1) ? (_rand >> 1) ^ 0xb8 : (_rand >> 1); + return (_rand * para) >> 8; +} diff --git a/audio/softsynth/fmtowns_pc98/towns_midi.h b/audio/softsynth/fmtowns_pc98/towns_midi.h new file mode 100644 index 00000000000..a98bb1b59c7 --- /dev/null +++ b/audio/softsynth/fmtowns_pc98/towns_midi.h @@ -0,0 +1,83 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TOWNS_MIDI_H +#define TOWNS_MIDI_H + +#include "audio/softsynth/fmtowns_pc98/towns_audio.h" +#include "audio/mididrv.h" + + +class TownsMidiOutputChannel; +class TownsMidiInputChannel; +class TownsMidiChanState; + +class MidiDriver_TOWNS : public MidiDriver, public TownsAudioInterfacePluginDriver { +friend class TownsMidiInputChannel; +friend class TownsMidiOutputChannel; +public: + MidiDriver_TOWNS(Audio::Mixer *mixer); + ~MidiDriver_TOWNS(); + + int open(); + bool isOpen() const { return _isOpen; } + void close(); + + void send(uint32 b); + + void setTimerCallback(void *timer_param, Common::TimerManager::TimerProc timer_proc); + + uint32 getBaseTempo(); + MidiChannel *allocateChannel(); + MidiChannel *getPercussionChannel(); + + void timerCallback(int timerId); + +private: + void updateParser(); + void updateOutputChannels(); + + TownsMidiOutputChannel *allocateOutputChannel(uint8 pri); + + int randomValue(int para); + + TownsMidiInputChannel **_channels; + TownsMidiOutputChannel **_out; + TownsMidiChanState *_chanState; + + Common::TimerManager::TimerProc _timerProc; + void *_timerProcPara; + + TownsAudioInterface *_intf; + + uint32 _tickCounter1; + uint32 _tickCounter2; + uint8 _allocCurPos; + uint8 _rand; + + bool _isOpen; + + uint8 *_operatorLevelTable; +}; + +#endif + diff --git a/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp b/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp index a551276ab1a..49fe97caf18 100644 --- a/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp +++ b/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/softsynth/fmtowns_pc98/towns_pc98_driver.h" @@ -1057,6 +1054,8 @@ TownsPC98_AudioDriver::~TownsPC98_AudioDriver() { _ready = false; deinit(); + Common::StackLock lock(_mutex); + if (_channels) { for (int i = 0; i < _numChan; i++) delete _channels[i]; @@ -1239,7 +1238,6 @@ void TownsPC98_AudioDriver::fadeStep() { if (!_musicPlaying) return; - Common::StackLock lock(_mutex); for (int j = 0; j < _numChan; j++) { if (_updateChannelsFlag & _channels[j]->_idFlag) _channels[j]->fadeStep(); @@ -1264,6 +1262,57 @@ void TownsPC98_AudioDriver::fadeStep() { } } +void TownsPC98_AudioDriver::pause() { + _musicPlaying = false; +} + +void TownsPC98_AudioDriver::cont() { + _musicPlaying = true; +} + +bool TownsPC98_AudioDriver::looping() { + return _looping == _updateChannelsFlag ? true : false; +} + +bool TownsPC98_AudioDriver::musicPlaying() { + return _musicPlaying; +} + +void TownsPC98_AudioDriver::setMusicVolume(int volume) { + _musicVolume = volume; + setVolumeIntern(_musicVolume, _sfxVolume); +} + +void TownsPC98_AudioDriver::setSoundEffectVolume(int volume) { + _sfxVolume = volume; + setVolumeIntern(_musicVolume, _sfxVolume); +} + +void TownsPC98_AudioDriver::timerCallbackA() { + if (_sfxChannels && _sfxPlaying) { + if (_sfxData) + startSoundEffect(); + + _sfxOffs = 3; + _trackPtr = _sfxBuffer; + + for (int i = 0; i < 2; i++) { + if (_updateSfxFlag & _sfxChannels[i]->_idFlag) { + _sfxChannels[i]->processEvents(); + _sfxChannels[i]->processFrequency(); + } + } + + _trackPtr = _musicBuffer; + } + + if (_updateSfxFlag && _finishedSfxFlag == _updateSfxFlag) { + _sfxPlaying = false; + _updateSfxFlag = 0; + setVolumeChannelMasks(-1, 0); + } +} + void TownsPC98_AudioDriver::timerCallbackB() { _sfxOffs = 0; @@ -1297,42 +1346,6 @@ void TownsPC98_AudioDriver::timerCallbackB() { _musicPlaying = false; } -void TownsPC98_AudioDriver::timerCallbackA() { - if (_sfxChannels && _sfxPlaying) { - if (_sfxData) - startSoundEffect(); - - _sfxOffs = 3; - _trackPtr = _sfxBuffer; - - for (int i = 0; i < 2; i++) { - if (_updateSfxFlag & _sfxChannels[i]->_idFlag) { - _sfxChannels[i]->processEvents(); - _sfxChannels[i]->processFrequency(); - } - } - - _trackPtr = _musicBuffer; - } - - if (_updateSfxFlag && _finishedSfxFlag == _updateSfxFlag) { - _sfxPlaying = false; - _updateSfxFlag = 0; - setVolumeChannelMasks(-1, 0); - } -} - -void TownsPC98_AudioDriver::setMusicTempo(uint8 tempo) { - writeReg(0, 0x26, tempo); - writeReg(0, 0x27, 0x33); -} - -void TownsPC98_AudioDriver::setSfxTempo(uint16 tempo) { - writeReg(0, 0x24, tempo & 0xff); - writeReg(0, 0x25, tempo >> 8); - writeReg(0, 0x27, 0x33); -} - void TownsPC98_AudioDriver::startSoundEffect() { int volFlags = 0; @@ -1353,6 +1366,16 @@ void TownsPC98_AudioDriver::startSoundEffect() { _sfxData = 0; } +void TownsPC98_AudioDriver::setMusicTempo(uint8 tempo) { + writeReg(0, 0x26, tempo); + writeReg(0, 0x27, 0x33); +} + +void TownsPC98_AudioDriver::setSfxTempo(uint16 tempo) { + writeReg(0, 0x24, tempo & 0xff); + writeReg(0, 0x25, tempo >> 8); + writeReg(0, 0x27, 0x33); +} const uint8 TownsPC98_AudioDriver::_drvTables[] = { // channel presets 0x00, 0x80, 0x00, 0x00, 0x00, 0x01, diff --git a/audio/softsynth/fmtowns_pc98/towns_pc98_driver.h b/audio/softsynth/fmtowns_pc98/towns_pc98_driver.h index 1227e2626a5..ff58482227d 100644 --- a/audio/softsynth/fmtowns_pc98/towns_pc98_driver.h +++ b/audio/softsynth/fmtowns_pc98/towns_pc98_driver.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOWNS_PC98_AUDIODRIVER_H @@ -53,33 +50,19 @@ public: void fadeStep(); - void pause() { - _musicPlaying = false; - } - void cont() { - _musicPlaying = true; - } + void pause(); + void cont(); - void timerCallbackB(); + bool looping(); + bool musicPlaying(); + + void setMusicVolume(int volume); + void setSoundEffectVolume(int volume); + +private: void timerCallbackA(); + void timerCallbackB(); - bool looping() { - return _looping == _updateChannelsFlag ? true : false; - } - bool musicPlaying() { - return _musicPlaying; - } - - void setMusicVolume(int volume) { - _musicVolume = volume; - setVolumeIntern(_musicVolume, _sfxVolume); - } - void setSoundEffectVolume(int volume) { - _sfxVolume = volume; - setVolumeIntern(_musicVolume, _sfxVolume); - } - -protected: void startSoundEffect(); void setMusicTempo(uint8 tempo); diff --git a/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp b/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp index 9d3751a0cc5..63007ba93c7 100644 --- a/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp +++ b/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h" @@ -42,45 +39,22 @@ public: void recalculateRates(); void generateOutput(int32 phasebuf, int32 *feedbuf, int32 &out); - void feedbackLevel(int32 level) { - _feedbackLevel = level ? level + 6 : 0; - } - void detune(int value) { - _detn = &_detnTbl[value << 5]; - } - void multiple(uint32 value) { - _multiple = value ? (value << 1) : 1; - } - void attackRate(uint32 value) { - _specifiedAttackRate = value; - } + void feedbackLevel(int32 level); + void detune(int value); + void multiple(uint32 value); + void attackRate(uint32 value); bool scaleRate(uint8 value); - void decayRate(uint32 value) { - _specifiedDecayRate = value; - recalculateRates(); - } - void sustainRate(uint32 value) { - _specifiedSustainRate = value; - recalculateRates(); - } - void sustainLevel(uint32 value) { - _sustainLevel = (value == 0x0f) ? 0x3e0 : value << 5; - } - void releaseRate(uint32 value) { - _specifiedReleaseRate = value; - recalculateRates(); - } - void totalLevel(uint32 value) { - _totalLevel = value << 3; - } - void ampModulation(bool enable) { - _ampMod = enable; - } + void decayRate(uint32 value); + void sustainRate(uint32 value); + void sustainLevel(uint32 value); + void releaseRate(uint32 value); + void totalLevel(uint32 value); + void ampModulation(bool enable); void reset(); protected: EnvelopeState _state; - bool _playing; + bool _holdKey; uint32 _feedbackLevel; uint32 _multiple; uint32 _totalLevel; @@ -125,7 +99,7 @@ TownsPC98_FmSynthOperator::TownsPC98_FmSynthOperator(const uint32 timerbase, con _rtt(rtt), _rateTbl(rateTable), _rshiftTbl(shiftTable), _adTbl(attackDecayTable), _fTbl(frqTable), _sinTbl(sineTable), _tLvlTbl(tlevelOut), _detnTbl(detuneTable), _tickLength(timerbase * 2), _specifiedAttackRate(0), _specifiedDecayRate(0), _specifiedReleaseRate(0), _specifiedSustainRate(0), - _phase(0), _state(kEnvReady), _playing(false), _timer(0), _keyScale1(0), + _sustainLevel(0), _phase(0), _state(kEnvReady), _holdKey(false), _timer(0), _keyScale1(0), _keyScale2(0), _currentLevel(1023), _ampMod(false), _tickCount(0) { fs_a.rate = fs_a.shift = fs_d.rate = fs_d.shift = fs_s.rate = fs_s.shift = fs_r.rate = fs_r.shift = 0; @@ -134,19 +108,19 @@ TownsPC98_FmSynthOperator::TownsPC98_FmSynthOperator(const uint32 timerbase, con } void TownsPC98_FmSynthOperator::keyOn() { - if (_playing) + if (_holdKey) return; - _playing = true; + _holdKey = true; _state = kEnvAttacking; _phase = 0; } void TownsPC98_FmSynthOperator::keyOff() { - if (!_playing) + if (!_holdKey) return; - _playing = false; + _holdKey = false; if (_state != kEnvReady) _state = kEnvReleasing; } @@ -202,39 +176,42 @@ void TownsPC98_FmSynthOperator::generateOutput(int32 phasebuf, int32 *feed, int3 int32 targetLevel = 0; EnvelopeState nextState = kEnvReady; - switch (_state) { - case kEnvReady: - return; - case kEnvAttacking: - targetLevel = 0; - nextState = kEnvDecaying; - if ((_specifiedAttackRate << 1) + _keyScale2 < 64) { - targetTime = (1 << fs_a.shift) - 1; - levelIncrement = (~_currentLevel * _adTbl[fs_a.rate + ((_tickCount >> fs_a.shift) & 7)]) >> 4; + for (bool loop = true; loop;) { + switch (_state) { + case kEnvReady: + return; + case kEnvAttacking: + targetLevel = 0; + nextState = _sustainLevel ? kEnvDecaying : kEnvSustaining; + if ((_specifiedAttackRate << 1) + _keyScale2 < 62) { + targetTime = (1 << fs_a.shift) - 1; + levelIncrement = (~_currentLevel * _adTbl[fs_a.rate + ((_tickCount >> fs_a.shift) & 7)]) >> 4; + } else { + _currentLevel = targetLevel; + _state = nextState; + continue; + } + break; + case kEnvDecaying: + targetTime = (1 << fs_d.shift) - 1; + nextState = kEnvSustaining; + targetLevel = _sustainLevel; + levelIncrement = _adTbl[fs_d.rate + ((_tickCount >> fs_d.shift) & 7)]; + break; + case kEnvSustaining: + targetTime = (1 << fs_s.shift) - 1; + nextState = kEnvSustaining; + targetLevel = 1023; + levelIncrement = _adTbl[fs_s.rate + ((_tickCount >> fs_s.shift) & 7)]; + break; + case kEnvReleasing: + targetTime = (1 << fs_r.shift) - 1; + nextState = kEnvReady; + targetLevel = 1023; + levelIncrement = _adTbl[fs_r.rate + ((_tickCount >> fs_r.shift) & 7)]; break; - } else { - _currentLevel = targetLevel; - _state = nextState; } - // Fall through - case kEnvDecaying: - targetTime = (1 << fs_d.shift) - 1; - nextState = kEnvSustaining; - targetLevel = _sustainLevel; - levelIncrement = _adTbl[fs_d.rate + ((_tickCount >> fs_d.shift) & 7)]; - break; - case kEnvSustaining: - targetTime = (1 << fs_s.shift) - 1; - nextState = kEnvSustaining; - targetLevel = 1023; - levelIncrement = _adTbl[fs_s.rate + ((_tickCount >> fs_s.shift) & 7)]; - break; - case kEnvReleasing: - targetTime = (1 << fs_r.shift) - 1; - nextState = kEnvReady; - targetLevel = 1023; - levelIncrement = _adTbl[fs_r.rate + ((_tickCount >> fs_r.shift) & 7)]; - break; + loop = false; } if (!(_tickCount & targetTime)) { @@ -275,6 +252,63 @@ void TownsPC98_FmSynthOperator::generateOutput(int32 phasebuf, int32 *feed, int3 out += *o; } +void TownsPC98_FmSynthOperator::feedbackLevel(int32 level) { + _feedbackLevel = level ? level + 6 : 0; +} + +void TownsPC98_FmSynthOperator::detune(int value) { + _detn = &_detnTbl[value << 5]; +} + +void TownsPC98_FmSynthOperator::multiple(uint32 value) { + _multiple = value ? (value << 1) : 1; +} + +void TownsPC98_FmSynthOperator::attackRate(uint32 value) { + _specifiedAttackRate = value; +} + +bool TownsPC98_FmSynthOperator::scaleRate(uint8 value) { + value = 3 - value; + if (_keyScale1 != value) { + _keyScale1 = value; + return true; + } + + int k = _keyScale2; + int r = _specifiedAttackRate ? (_specifiedAttackRate << 1) + 0x20 : 0; + fs_a.rate = ((r + k) < 94) ? _rateTbl[r + k] : 136; + fs_a.shift = ((r + k) < 94) ? _rshiftTbl[r + k] : 0; + return false; +} + +void TownsPC98_FmSynthOperator::decayRate(uint32 value) { + _specifiedDecayRate = value; + recalculateRates(); +} + +void TownsPC98_FmSynthOperator::sustainRate(uint32 value) { + _specifiedSustainRate = value; + recalculateRates(); + } + +void TownsPC98_FmSynthOperator::sustainLevel(uint32 value) { + _sustainLevel = (value == 0x0f) ? 0x3e0 : value << 5; +} + +void TownsPC98_FmSynthOperator::releaseRate(uint32 value) { + _specifiedReleaseRate = value; + recalculateRates(); +} + +void TownsPC98_FmSynthOperator::totalLevel(uint32 value) { + _totalLevel = value << 3; +} + +void TownsPC98_FmSynthOperator::ampModulation(bool enable) { + _ampMod = enable; +} + void TownsPC98_FmSynthOperator::reset() { keyOff(); _timer = 0; @@ -295,20 +329,6 @@ void TownsPC98_FmSynthOperator::reset() { ampModulation(false); } -bool TownsPC98_FmSynthOperator::scaleRate(uint8 value) { - value = 3 - value; - if (_keyScale1 != value) { - _keyScale1 = value; - return true; - } - - int k = _keyScale2; - int r = _specifiedAttackRate ? (_specifiedAttackRate << 1) + 0x20 : 0; - fs_a.rate = ((r + k) < 94) ? _rateTbl[r + k] : 136; - fs_a.shift = ((r + k) < 94) ? _rshiftTbl[r + k] : 0; - return false; -} - class TownsPC98_FmSynthSquareSineSource { public: TownsPC98_FmSynthSquareSineSource(const uint32 timerbase, const uint32 rtt); @@ -633,7 +653,8 @@ void TownsPC98_FmSynthSquareSineSource::updateRegs() { #ifndef DISABLE_PC98_RHYTHM_CHANNEL TownsPC98_FmSynthPercussionSource::TownsPC98_FmSynthPercussionSource(const uint32 timerbase, const uint32 rtt) : - _rtt(rtt), _tickLength(timerbase * 2), _timer(0), _ready(false), _volMaskA(0), _volMaskB(0), _volumeA(Audio::Mixer::kMaxMixerVolume), _volumeB(Audio::Mixer::kMaxMixerVolume) { + _rtt(rtt), _tickLength(timerbase * 2), _timer(0), _totalLevel(0), _volMaskA(0), _volMaskB(0), + _volumeA(Audio::Mixer::kMaxMixerVolume), _volumeB(Audio::Mixer::kMaxMixerVolume), _ready(false) { memset(_rhChan, 0, sizeof(RhtChannel) * 6); _reg = new uint8 *[40]; @@ -830,7 +851,7 @@ void TownsPC98_FmSynthPercussionSource::advanceInput(RhtChannel *ins) { } #endif // DISABLE_PC98_RHYTHM_CHANNEL -TownsPC98_FmSynth::TownsPC98_FmSynth(Audio::Mixer *mixer, EmuType type) : +TownsPC98_FmSynth::TownsPC98_FmSynth(Audio::Mixer *mixer, EmuType type, bool externalMutexHandling) : _mixer(mixer), _chanInternal(0), _ssg(0), #ifndef DISABLE_PC98_RHYTHM_CHANNEL @@ -841,7 +862,7 @@ TownsPC98_FmSynth::TownsPC98_FmSynth(Audio::Mixer *mixer, EmuType type) : _oprRates(0), _oprRateshift(0), _oprAttackDecay(0), _oprFrq(0), _oprSinTbl(0), _oprLevelOut(0), _oprDetune(0), _rtt(type == kTypeTowns ? 0x514767 : 0x5B8D80), _baserate(55125.0f / (float)mixer->getOutputRate()), _volMaskA(0), _volMaskB(0), _volumeA(255), _volumeB(255), - _regProtectionFlag(false), _ready(false) { + _regProtectionFlag(false), _externalMutex(externalMutexHandling), _ready(false) { memset(&_timers[0], 0, sizeof(ChipTimer)); memset(&_timers[1], 0, sizeof(ChipTimer)); @@ -854,6 +875,8 @@ TownsPC98_FmSynth::~TownsPC98_FmSynth() { if (_ready) deinit(); + Common::StackLock lock(_mutex); + delete _ssg; #ifndef DISABLE_PC98_RHYTHM_CHANNEL delete _prc; @@ -934,10 +957,10 @@ void TownsPC98_FmSynth::writeReg(uint8 part, uint8 regAddress, uint8 value) { if (_regProtectionFlag || !_ready) return; - static const uint8 oprOrdr[] = { 0, 2, 1, 3 }; - Common::StackLock lock(_mutex); + static const uint8 oprOrdr[] = { 0, 2, 1, 3 }; + uint8 h = regAddress & 0xf0; uint8 l = (regAddress & 0x0f); @@ -1084,6 +1107,7 @@ void TownsPC98_FmSynth::writeReg(uint8 part, uint8 regAddress, uint8 value) { if (l == 0) { c->frqTemp = (c->frqTemp & 0xff00) | value; c->updateEnvelopeParameters = true; + c->fmIndex = (c->frqTemp >> 4 & 0x7f); for (int i = 0; i < 4; i++) co[i]->frequency(c->frqTemp); } else if (l == 4) { @@ -1118,21 +1142,37 @@ void TownsPC98_FmSynth::writeReg(uint8 part, uint8 regAddress, uint8 value) { } int TownsPC98_FmSynth::readBuffer(int16 *buffer, const int numSamples) { - Common::StackLock lock(_mutex); - memset(buffer, 0, sizeof(int16) * numSamples); int32 *tmp = new int32[numSamples]; int32 *tmpStart = tmp; memset(tmp, 0, sizeof(int32) * numSamples); int32 samplesLeft = numSamples >> 1; + bool locked = false; + if (_ready) { + _mutex.lock(); + locked = true; + } + while (_ready && samplesLeft) { int32 render = samplesLeft; for (int i = 0; i < 2; i++) { if (_timers[i].enabled && _timers[i].cb) { if (!_timers[i].smpTillCb) { + + if (locked && _externalMutex) { + _mutex.unlock(); + locked = false; + } + (this->*_timers[i].cb)(); + + if (!locked && _externalMutex) { + _mutex.lock(); + locked = true; + } + _timers[i].smpTillCb = _timers[i].smpPerCb; _timers[i].smpTillCbRem += _timers[i].smpPerCbRem; @@ -1175,16 +1215,37 @@ int TownsPC98_FmSynth::readBuffer(int16 *buffer, const int numSamples) { tmp += (render << 1); } + if (locked) + _mutex.unlock(); + delete[] tmpStart; + return numSamples; } +bool TownsPC98_FmSynth::isStereo() const { + return true; +} + +bool TownsPC98_FmSynth::endOfData() const { + return false; +} + +int TownsPC98_FmSynth::getRate() const { + return _mixer->getOutputRate(); +} + void TownsPC98_FmSynth::deinit() { _ready = false; _mixer->stopHandle(_soundHandle); + Common::StackLock lock(_mutex); _timers[0].cb = _timers[1].cb = &TownsPC98_FmSynth::idleTimerCallback; } +void TownsPC98_FmSynth::toggleRegProtection(bool prot) { + _regProtectionFlag = prot; +} + uint8 TownsPC98_FmSynth::readSSGStatus() { return _ssg->chanEnable(); } @@ -1220,7 +1281,7 @@ void TownsPC98_FmSynth::generateTables() { WRITE_BE_UINT32(_oprRates + 32, _numChan == 6 ? 0x90900000 : 0x00081018); WRITE_BE_UINT32(_oprRates + 36, _numChan == 6 ? 0x00001010 : 0x00081018); memset(_oprRates, 0x90, 32); - memset(_oprRates + 96, 0x80, 32); + memset(&_oprRates[96], 0x80, 32); uint8 *dst = (uint8 *)_oprRates + 40; for (int i = 0; i < 40; i += 4) WRITE_BE_UINT32(dst + i, 0x00081018); @@ -1277,8 +1338,8 @@ void TownsPC98_FmSynth::generateTables() { uint8 *dtt = new uint8[128]; memset(dtt, 0, 36); - memset(dtt + 36, 1, 8); - memcpy(dtt + 44, _detSrc, 84); + memset(&dtt[36], 1, 8); + memcpy(&dtt[44], _detSrc, 84); delete[] _oprDetune; _oprDetune = new int32[256]; diff --git a/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h b/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h index 2b916b2cdcc..4f81fa9a5c1 100644 --- a/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h +++ b/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOWNS_PC98_FMSYNTH_H @@ -47,7 +44,7 @@ class TownsPC98_FmSynthPercussionSource; #endif enum EnvelopeState { - kEnvReady, + kEnvReady = 0, kEnvAttacking, kEnvDecaying, kEnvSustaining, @@ -62,7 +59,7 @@ public: kType86 }; - TownsPC98_FmSynth(Audio::Mixer *mixer, EmuType type); + TownsPC98_FmSynth(Audio::Mixer *mixer, EmuType type, bool externalMutexHandling = false); virtual ~TownsPC98_FmSynth(); virtual bool init(); @@ -72,15 +69,9 @@ public: // AudioStream interface int readBuffer(int16 *buffer, const int numSamples); - bool isStereo() const { - return true; - } - bool endOfData() const { - return false; - } - int getRate() const { - return _mixer->getOutputRate(); - } + bool isStereo() const; + bool endOfData() const; + int getRate() const; protected: void deinit(); @@ -89,17 +80,15 @@ protected: // additional output that has to be inserted into the buffer. virtual void nextTickEx(int32 *buffer, uint32 bufferSize) {} - void toggleRegProtection(bool prot) { - _regProtectionFlag = prot; - } + void toggleRegProtection(bool prot); uint8 readSSGStatus(); virtual void timerCallbackA() = 0; virtual void timerCallbackB() = 0; - // The audio driver can store and apply two different audio settings + // The audio driver can store and apply two different volume settings // (usually for music and sound effects). The channel mask will determine - // which channels get effected by the setting. The first bits will be + // which channels get effected by which setting. The first bits will be // the normal fm channels, the next bits the ssg channels and the final // bit the rhythm channel. void setVolumeIntern(int volA, int volB); @@ -110,6 +99,8 @@ protected: const bool _hasPercussion; Common::Mutex _mutex; + bool _externalMutex; + private: void generateTables(); void nextTick(int32 *buffer, uint32 bufferSize); @@ -127,6 +118,7 @@ private: } uint16 frqTemp; + uint8 fmIndex; bool enableLeft; bool enableRight; bool updateEnvelopeParameters; diff --git a/audio/softsynth/fmtowns_pc98/towns_pc98_plugins.cpp b/audio/softsynth/fmtowns_pc98/towns_pc98_plugins.cpp new file mode 100644 index 00000000000..194bfc41f9a --- /dev/null +++ b/audio/softsynth/fmtowns_pc98/towns_pc98_plugins.cpp @@ -0,0 +1,86 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "audio/softsynth/fmtowns_pc98/towns_midi.h" +#include "audio/musicplugin.h" +#include "common/translation.h" +#include "common/error.h" +#include "common/system.h" + + +class TownsEmuMusicPlugin : public MusicPluginObject { +public: + const char *getName() const { + return _s("FM-Towns Audio"); + } + + const char *getId() const { + return "towns"; + } + + MusicDevices getDevices() const; + Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle = 0) const; +}; + +MusicDevices TownsEmuMusicPlugin::getDevices() const { + MusicDevices devices; + devices.push_back(MusicDevice(this, "", MT_TOWNS)); + return devices; +} + +Common::Error TownsEmuMusicPlugin::createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle) const { + *mididriver = new MidiDriver_TOWNS(g_system->getMixer()); + return Common::kNoError; +} + +class PC98EmuMusicPlugin : public MusicPluginObject { +public: + const char *getName() const { + return _s("PC-98 Audio"); + } + + const char *getId() const { + return "pc98"; + } + + MusicDevices getDevices() const; + Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle = 0) const; +}; + +MusicDevices PC98EmuMusicPlugin::getDevices() const { + MusicDevices devices; + devices.push_back(MusicDevice(this, "", MT_PC98)); + return devices; +} + +Common::Error PC98EmuMusicPlugin::createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle) const { + //*mididriver = /**/ + return Common::kNoError; +} + +//#if PLUGIN_ENABLED_DYNAMIC(TOWNS) + //REGISTER_PLUGIN_DYNAMIC(TOWNS, PLUGIN_TYPE_MUSIC, TownsEmuMusicPlugin); + //REGISTER_PLUGIN_DYNAMIC(TOWNS, PLUGIN_TYPE_MUSIC, TownsEmuMusicPlugin); +//#else + REGISTER_PLUGIN_STATIC(TOWNS, PLUGIN_TYPE_MUSIC, TownsEmuMusicPlugin); + REGISTER_PLUGIN_STATIC(PC98, PLUGIN_TYPE_MUSIC, PC98EmuMusicPlugin); +//#endif diff --git a/audio/softsynth/mt32.cpp b/audio/softsynth/mt32.cpp index 5371be60b33..27a5a629c4d 100644 --- a/audio/softsynth/mt32.cpp +++ b/audio/softsynth/mt32.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/scummsys.h" @@ -66,7 +63,7 @@ protected: void generateSamples(int16 *buf, int len); public: - bool _initialising; + bool _initializing; MidiDriver_MT32(Audio::Mixer *mixer); virtual ~MidiDriver_MT32(); @@ -218,7 +215,7 @@ static MT32Emu::File *MT32_OpenFile(void *userData, const char *filename, MT32Em } static void MT32_PrintDebug(void *userData, const char *fmt, va_list list) { - if (((MidiDriver_MT32 *)userData)->_initialising) { + if (((MidiDriver_MT32 *)userData)->_initializing) { char buf[512]; vsnprintf(buf, 512, fmt, list); @@ -242,7 +239,7 @@ static int MT32_Report(void *userData, MT32Emu::ReportType type, const void *rep error("Failed to load MT32_PCM.ROM"); break; case MT32Emu::ReportType_progressInit: - if (((MidiDriver_MT32 *)userData)->_initialising) { + if (((MidiDriver_MT32 *)userData)->_initializing) { drawProgress(*((const float *)reportData)); return eatSystemEvents(); } @@ -286,7 +283,7 @@ MidiDriver_MT32::MidiDriver_MT32(Audio::Mixer *mixer) : MidiDriver_Emulated(mixe // at rates other than 32KHz, thus we produce data at 32KHz and // rely on Mixer to convert. _outputRate = 32000; //_mixer->getOutputRate(); - _initialising = false; + _initializing = false; } MidiDriver_MT32::~MidiDriver_MT32() { @@ -327,11 +324,11 @@ int MidiDriver_MT32::open() { g_system->getPaletteManager()->setPalette(dummy_palette, 0, 3); } - _initialising = true; - drawMessage(-1, _s("Initialising MT-32 Emulator")); + _initializing = true; + drawMessage(-1, _s("Initializing MT-32 Emulator")); if (!_synth->open(prop)) return MERR_DEVICE_NOT_AVAILABLE; - _initialising = false; + _initializing = false; if (screenFormat.bytesPerPixel > 1) g_system->fillScreen(screenFormat.RGBToColor(0, 0, 0)); diff --git a/audio/softsynth/mt32/freeverb.cpp b/audio/softsynth/mt32/freeverb.cpp index c62d4f2cf3b..67f065c20e3 100644 --- a/audio/softsynth/mt32/freeverb.cpp +++ b/audio/softsynth/mt32/freeverb.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Comb filter implementation diff --git a/audio/softsynth/mt32/freeverb.h b/audio/softsynth/mt32/freeverb.h index 8310aca3e3d..39ae4639708 100644 --- a/audio/softsynth/mt32/freeverb.h +++ b/audio/softsynth/mt32/freeverb.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Macro for killing denormalled numbers diff --git a/audio/softsynth/mt32/partial.cpp b/audio/softsynth/mt32/partial.cpp index 5ba9ef6145b..c4f2e94ebe3 100644 --- a/audio/softsynth/mt32/partial.cpp +++ b/audio/softsynth/mt32/partial.cpp @@ -28,7 +28,7 @@ #if defined(MACOSX) || defined(SOLARIS) || defined(__MINGW32__) // Older versions of Mac OS X didn't supply a powf function, so using it // will cause a binary incompatibility when trying to run a binary built -// on a newer OS X release on an olderr one. And Solaris 8 doesn't provide +// on a newer OS X release on an older one. And Solaris 8 doesn't provide // powf, floorf, fabsf etc. at all. // Cross-compiled MinGW32 toolchains suffer from a cross-compile bug in // libstdc++. math/stubs.o should be empty, but it comes with a symbol for @@ -164,7 +164,7 @@ void Partial::startPartial(dpoly *usePoly, const PatchCache *useCache, Partial * structurePosition = patchCache->structurePosition; play = true; - initKeyFollow(poly->freqnum); // Initialises noteVal, filtVal and realVal + initKeyFollow(poly->freqnum); // Initializes noteVal, filtVal and realVal #if MT32EMU_ACCURATENOTES == 0 noteLookup = &synth->tables.noteLookups[noteVal - LOWEST_NOTE]; #else diff --git a/audio/softsynth/mt32/synth.cpp b/audio/softsynth/mt32/synth.cpp index 112527cc71b..322b864b6ee 100644 --- a/audio/softsynth/mt32/synth.cpp +++ b/audio/softsynth/mt32/synth.cpp @@ -34,7 +34,7 @@ #if defined(MACOSX) || defined(SOLARIS) || defined(__MINGW32__) // Older versions of Mac OS X didn't supply a powf function, so using it // will cause a binary incompatibility when trying to run a binary built -// on a newer OS X release on an olderr one. And Solaris 8 doesn't provide +// on a newer OS X release on an older one. And Solaris 8 doesn't provide // powf, floorf, fabsf etc. at all. // Cross-compiled MinGW32 toolchains suffer from a cross-compile bug in // libstdc++. math/stubs.o should be empty, but it comes with a symbol for @@ -426,36 +426,36 @@ bool Synth::open(SynthProperties &useProp) { } } - printDebug("Initialising Timbre Bank A"); + printDebug("Initializing Timbre Bank A"); if (!initTimbres(controlROMMap->timbreAMap, controlROMMap->timbreAOffset, 0)) { return false; } - printDebug("Initialising Timbre Bank B"); + printDebug("Initializing Timbre Bank B"); if (!initTimbres(controlROMMap->timbreBMap, controlROMMap->timbreBOffset, 64)) { return false; } - printDebug("Initialising Timbre Bank R"); + printDebug("Initializing Timbre Bank R"); if (!initRhythmTimbres(controlROMMap->timbreRMap, controlROMMap->timbreRCount)) { return false; } - printDebug("Initialising Timbre Bank M"); - // CM-64 seems to initialise all bytes in this bank to 0. + printDebug("Initializing Timbre Bank M"); + // CM-64 seems to initialize all bytes in this bank to 0. memset(&mt32ram.timbres[128], 0, sizeof (mt32ram.timbres[128]) * 64); partialManager = new PartialManager(this); pcmWaves = new PCMWaveEntry[controlROMMap->pcmCount]; - printDebug("Initialising PCM List"); + printDebug("Initializing PCM List"); initPCMList(controlROMMap->pcmTable, controlROMMap->pcmCount); - printDebug("Initialising Rhythm Temp"); + printDebug("Initializing Rhythm Temp"); memcpy(mt32ram.rhythmSettings, &controlROMData[controlROMMap->rhythmSettings], controlROMMap->rhythmSettingsCount * 4); - printDebug("Initialising Patches"); + printDebug("Initializing Patches"); for (Bit8u i = 0; i < 128; i++) { PatchParam *patch = &mt32ram.patches[i]; patch->timbreGroup = i / 64; @@ -468,9 +468,9 @@ bool Synth::open(SynthProperties &useProp) { patch->dummy = 0; } - printDebug("Initialising System"); + printDebug("Initializing System"); // The MT-32 manual claims that "Standard pitch" is 442Hz. - mt32ram.system.masterTune = 0x40; // Confirmed on CM-64 as 0x4A, but SCUMM games use 0x40 and we don't want to initialise twice + mt32ram.system.masterTune = 0x40; // Confirmed on CM-64 as 0x4A, but SCUMM games use 0x40 and we don't want to initialize twice mt32ram.system.reverbMode = 0; // Confirmed mt32ram.system.reverbTime = 5; // Confirmed mt32ram.system.reverbLevel = 3; // Confirmed @@ -792,7 +792,7 @@ void Synth::writeSysex(unsigned char device, const Bit8u *sysex, Bit32u len) { for (;;) { // Find the appropriate memory region int regionNum; - const MemoryRegion *region = NULL; // Initialised to please compiler + const MemoryRegion *region = NULL; // Initialized to please compiler for (regionNum = 0; regionNum < NUM_REGIONS; regionNum++) { region = &memoryRegions[regionNum]; if (region->contains(addr)) { diff --git a/audio/softsynth/mt32/synth.h b/audio/softsynth/mt32/synth.h index edda4462879..0ef2c9d135d 100644 --- a/audio/softsynth/mt32/synth.h +++ b/audio/softsynth/mt32/synth.h @@ -263,7 +263,7 @@ public: Synth(); ~Synth(); - // Used to initialise the MT-32. Must be called before any other function. + // Used to initialize the MT-32. Must be called before any other function. // Returns true if initialization was sucessful, otherwise returns false. bool open(SynthProperties &useProp); diff --git a/audio/softsynth/mt32/tables.cpp b/audio/softsynth/mt32/tables.cpp index eba4d2a520c..9fdb595467c 100644 --- a/audio/softsynth/mt32/tables.cpp +++ b/audio/softsynth/mt32/tables.cpp @@ -19,6 +19,10 @@ * IN THE SOFTWARE. */ + +// FIXME: Avoid using rand +#define FORBIDDEN_SYMBOL_EXCEPTION_rand + #include #include #include @@ -28,7 +32,7 @@ #if defined(MACOSX) || defined(SOLARIS) || defined(__MINGW32__) // Older versions of Mac OS X didn't supply a powf function, so using it // will cause a binary incompatibility when trying to run a binary built -// on a newer OS X release on an olderr one. And Solaris 8 doesn't provide +// on a newer OS X release on an older one. And Solaris 8 doesn't provide // powf, floorf, fabsf etc. at all. // Cross-compiled MinGW32 toolchains suffer from a cross-compile bug in // libstdc++. math/stubs.o should be empty, but it comes with a symbol for @@ -199,7 +203,7 @@ void Tables::initEnvelopes(float samplerate) { void Tables::initMT32ConstantTables(Synth *synth) { int lf; - synth->printDebug("Initialising Pitch Tables"); + synth->printDebug("Initializing Pitch Tables"); for (lf = -108; lf <= 108; lf++) { tvfKeyfollowMult[lf + 108] = (int)(256 * powf(2.0f, (float)(lf / 24.0f))); //synth->printDebug("KT %d = %d", f, keytable[f+108]); @@ -664,7 +668,7 @@ bool Tables::initNotes(Synth *synth, PCMWaveEntry *pcmWaves, float rate, float m bool abort = false; synth->report(ReportType_progressInit, &progress); for (int f = LOWEST_NOTE; f <= HIGHEST_NOTE; f++) { - synth->printDebug("Initialising note %s%d", NoteNames[f % 12], (f / 12) - 2); + synth->printDebug("Initializing note %s%d", NoteNames[f % 12], (f / 12) - 2); NoteLookup *noteLookup = ¬eLookups[f - LOWEST_NOTE]; file = initNote(synth, noteLookup, (float)f, rate, masterTune, pcmWaves, file); progress = (f - LOWEST_NOTE + 1) / (float)NUM_NOTES; @@ -719,12 +723,12 @@ void Tables::freeNotes() { } } } - initialisedMasterTune = 0.0f; + initializedMasterTune = 0.0f; } Tables::Tables() { - initialisedSampleRate = 0.0f; - initialisedMasterTune = 0.0f; + initializedSampleRate = 0.0f; + initializedMasterTune = 0.0f; memset(¬eLookups, 0, sizeof(noteLookups)); } @@ -733,23 +737,23 @@ bool Tables::init(Synth *synth, PCMWaveEntry *pcmWaves, float sampleRate, float synth->printDebug("Bad sampleRate (%f <= 0.0f)", (double)sampleRate); return false; } - if (initialisedSampleRate == 0.0f) { + if (initializedSampleRate == 0.0f) { initMT32ConstantTables(synth); } - if (initialisedSampleRate != sampleRate) { + if (initializedSampleRate != sampleRate) { initFiltCoeff(sampleRate); initEnvelopes(sampleRate); for (int key = 12; key <= 108; key++) { initDep(&keyLookups[key - 12], (float)key); } } - if (initialisedSampleRate != sampleRate || initialisedMasterTune != masterTune) { + if (initializedSampleRate != sampleRate || initializedMasterTune != masterTune) { freeNotes(); if (!initNotes(synth, pcmWaves, sampleRate, masterTune)) { return false; } - initialisedSampleRate = sampleRate; - initialisedMasterTune = masterTune; + initializedSampleRate = sampleRate; + initializedMasterTune = masterTune; } return true; } diff --git a/audio/softsynth/mt32/tables.h b/audio/softsynth/mt32/tables.h index d9af5114b24..9950323e7be 100644 --- a/audio/softsynth/mt32/tables.h +++ b/audio/softsynth/mt32/tables.h @@ -69,8 +69,8 @@ struct KeyLookup { }; class Tables { - float initialisedSampleRate; - float initialisedMasterTune; + float initializedSampleRate; + float initializedMasterTune; void initMT32ConstantTables(Synth *synth); static Bit16s clampWF(Synth *synth, const char *n, float ampVal, double input); static File *initWave(Synth *synth, NoteLookup *noteLookup, float ampsize, float div2, File *file); diff --git a/audio/softsynth/opl/dosbox.cpp b/audio/softsynth/opl/dosbox.cpp index 7a494d70ec1..e039845b8f1 100644 --- a/audio/softsynth/opl/dosbox.cpp +++ b/audio/softsynth/opl/dosbox.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ /* diff --git a/audio/softsynth/opl/dosbox.h b/audio/softsynth/opl/dosbox.h index 1e92c7f7c93..125dde8aecb 100644 --- a/audio/softsynth/opl/dosbox.h +++ b/audio/softsynth/opl/dosbox.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ /* diff --git a/audio/softsynth/opl/mame.cpp b/audio/softsynth/opl/mame.cpp index 5d790f924f1..9cc35971eb2 100644 --- a/audio/softsynth/opl/mame.cpp +++ b/audio/softsynth/opl/mame.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * LGPL licensed version of MAMEs fmopl (V0.37a modified) by * Tatsuyuki Satoh. Included from LGPL'ed AdPlug. */ @@ -549,7 +546,7 @@ inline void OPL_CALC_RH(FM_OPL *OPL, OPL_CH *CH) { // but EG_STEP = 96.0/EG_ENT, and WHITE_NOISE_db=6.0. So, that's equivalent to // int(OPL->rnd.getRandomBit() * EG_ENT/16). We know that EG_ENT is 4096, or 1024, // or 128, so we can safely avoid any FP ops. - int whitenoise = OPL->rnd.getRandomBit() * (EG_ENT>>4); + int whitenoise = OPL->rnd->getRandomBit() * (EG_ENT>>4); int tone8; @@ -1129,6 +1126,15 @@ FM_OPL *OPLCreate(int type, int clock, int rate) { OPL->rate = rate; OPL->max_ch = max_ch; + // Init the random source. Note: We use a fixed name for it here. + // So if multiple FM_OPL objects exist in parallel, then their + // random sources will have an equal name. At least in the + // current EventRecorder implementation, this causes no problems; + // but this is probably not guaranteed. + // Alas, it does not seem worthwhile to bother much with this + // at the time, so I am leaving it as it is. + OPL->rnd = new Common::RandomSource("mame"); + /* init grobal tables */ OPL_initalize(OPL); @@ -1137,9 +1143,10 @@ FM_OPL *OPLCreate(int type, int clock, int rate) { return OPL; } -/* ---------- Destroy one of vietual YM3812 ---------- */ +/* ---------- Destroy one of virtual YM3812 ---------- */ void OPLDestroy(FM_OPL *OPL) { OPL_UnLockTable(); + delete OPL->rnd; free(OPL); } diff --git a/audio/softsynth/opl/mame.h b/audio/softsynth/opl/mame.h index 4314aa6dba6..803ca897e7b 100644 --- a/audio/softsynth/opl/mame.h +++ b/audio/softsynth/opl/mame.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * LGPL licensed version of MAMEs fmopl (V0.37a modified) by * Tatsuyuki Satoh. Included from LGPL'ed AdPlug. */ @@ -150,7 +147,7 @@ typedef struct fm_opl_f { OPL_UPDATEHANDLER UpdateHandler; /* stream update handler */ int UpdateParam; /* stream update parameter */ - Common::RandomSource rnd; + Common::RandomSource *rnd; } FM_OPL; /* ---------- Generic interface section ---------- */ diff --git a/audio/softsynth/pcspk.cpp b/audio/softsynth/pcspk.cpp index 947c142b736..66af9684631 100644 --- a/audio/softsynth/pcspk.cpp +++ b/audio/softsynth/pcspk.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "audio/softsynth/pcspk.h" diff --git a/audio/softsynth/pcspk.h b/audio/softsynth/pcspk.h index 8f01fa852ba..3641400b1fe 100644 --- a/audio/softsynth/pcspk.h +++ b/audio/softsynth/pcspk.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SOUND_SOFTSYNTH_PCSPK_H diff --git a/audio/softsynth/sid.cpp b/audio/softsynth/sid.cpp index 40dc50e972c..4b8f783ef45 100644 --- a/audio/softsynth/sid.cpp +++ b/audio/softsynth/sid.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/audio/softsynth/sid.h b/audio/softsynth/sid.h index d6e402dc3b8..a0152428448 100644 --- a/audio/softsynth/sid.h +++ b/audio/softsynth/sid.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/audio/softsynth/wave6581.cpp b/audio/softsynth/wave6581.cpp index d1ddad16236..63e08fb1131 100644 --- a/audio/softsynth/wave6581.cpp +++ b/audio/softsynth/wave6581.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/audio/softsynth/ym2612.cpp b/audio/softsynth/ym2612.cpp deleted file mode 100644 index 162c92f05a4..00000000000 --- a/audio/softsynth/ym2612.cpp +++ /dev/null @@ -1,793 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - */ - -#include - -#include "audio/softsynth/ym2612.h" -#include "common/util.h" -#include "audio/musicplugin.h" -#include "common/error.h" -#include "common/system.h" -#include "common/textconsole.h" -#include "common/translation.h" -#include "common/types.h" - -//////////////////////////////////////// -// -// Miscellaneous -// -//////////////////////////////////////// - -static int *sintbl = 0; -static int *powtbl = 0; -static int *frequencyTable = 0; -static int *keycodeTable = 0; -static int *keyscaleTable = 0; -static int *attackOut = 0; - - -//////////////////////////////////////// -// -// Operator2612 implementation -// -//////////////////////////////////////// - -Operator2612::Operator2612 (Voice2612 *owner) : - _owner (owner), - _state (_s_ready), - _currentLevel ((int32)0x7f << 15), - _phase (0), - _lastOutput (0), - _feedbackLevel (0), - _detune (0), - _multiple (1), - _keyScale (0), - _specifiedTotalLevel (127), - _specifiedAttackRate (0), - _specifiedDecayRate (0), - _specifiedSustainRate (0), - _specifiedReleaseRate (15) { - velocity(0); -} - -Operator2612::~Operator2612() -{ } - -void Operator2612::velocity(int velo) { - _velocity = velo; - _totalLevel = ((int32)_specifiedTotalLevel << 15) + - ((int32)(127-_velocity) << 13); - _sustainLevel = ((int32)_specifiedSustainLevel << 17); -} - -void Operator2612::feedbackLevel(int level) { - _feedbackLevel = level; -} - -void Operator2612::setInstrument(byte const *instrument) { - _detune = (instrument[8] >> 4) & 7; - _multiple = instrument[8] & 15; - _specifiedTotalLevel = instrument[12] & 127; - _keyScale = (instrument[16] >> 6) & 3; - _specifiedAttackRate = instrument[16] & 31; - _specifiedDecayRate = instrument[20] & 31; - _specifiedSustainRate = instrument[24] & 31; - _specifiedSustainLevel = (instrument[28] >> 4) & 15; - _specifiedReleaseRate = instrument[28] & 15; - _state = _s_ready; - velocity(_velocity); -} - -void Operator2612::keyOn() { - _state = _s_attacking; - _tickCount = 0; - _phase = 0; - _currentLevel = ((int32)0x7f << 15); -} - -void Operator2612::keyOff() { - if (_state != _s_ready) - _state = _s_releasing; -} - -void Operator2612::frequency(int freq) { - double value; // Use for intermediate computations to avoid int64 arithmetic - int r; - - _frequency = freq / _owner->_rate; - - r = _specifiedAttackRate; - if (r != 0) { - r = r * 2 + (keyscaleTable[freq/262205] >> (3-_keyScale)); - if (r >= 64) - r = 63; - } - - r = 63 - r; - if (_specifiedTotalLevel >= 128) - value = 0; - else { - value = powtbl[(r&3) << 7]; - value *= 1 << (r >> 2); - value *= 41; - value /= 1 << (15 + 5); - value *= 127 - _specifiedTotalLevel; - value /= 127; - } - _attackTime = (int32) value; // 1 ?? == (1 << 12) - if (_attackTime > 0) - _attackTime = (1 << (12+10)) / (_owner->_rate * _attackTime); - - r = _specifiedDecayRate; - if (r != 0) { - r = r * 2 + (keyscaleTable[freq/262205] >> (3-_keyScale)); - if (r >= 64) - r = 63; - } - value = (double) powtbl[(r&3) << 7] * (0x10 << (r>>2)) / 31; - _decayRate = (int32) value / _owner->_rate; - - r = _specifiedSustainRate; - if (r != 0) { - r = r * 2 + (keyscaleTable[freq/262205] >> (3-_keyScale)); - if (r >= 64) - r = 63; - } - value = (double) powtbl[(r&3) << 7] * (0x10 << (r>>2)) / 31; - _sustainRate = (int32) value / _owner->_rate; - - r = _specifiedReleaseRate; - if (r != 0) { - r = r * 2 + 1; // (Translated) I cannot know whether the timing is a good choice or not - r = r * 2 + (keyscaleTable[freq/262205] >> (3-_keyScale)); - // KS - if (r >= 64) - r = 63; - } - value = (double) powtbl[(r&3) << 7] * (0x10 << (r>>2)) / 31; - _releaseRate = (int32) value / _owner->_rate; -} - -void Operator2612::nextTick(const int *phasebuf, int *outbuf, int buflen) { - if (_state == _s_ready) - return; - if (_state == _s_attacking && _attackTime <= 0) { - _currentLevel = 0; - _state = _s_decaying; - } - - int32 levelIncrement = 0; - int32 target = 0; - State next_state = _s_ready; - const int32 zero_level = ((int32)0x7f << 15); - const int phaseIncrement = (_multiple > 0) ? (_frequency * _multiple) : (_frequency / 2); - - int32 output = _lastOutput; - int32 level = _currentLevel + _totalLevel; - - while (buflen) { - switch (_state) { - case _s_ready: - return; - case _s_attacking: - next_state = _s_attacking; - break; - case _s_decaying: - levelIncrement = _decayRate; - target = _sustainLevel + _totalLevel; - next_state = _s_sustaining; - break; - case _s_sustaining: - levelIncrement = _sustainRate; - target = zero_level + _totalLevel; - next_state = _s_ready; - break; - case _s_releasing: - levelIncrement = _releaseRate; - target = zero_level + _totalLevel; - next_state = _s_ready; - break; - } - - bool switching = false; - do { - if (next_state == _s_attacking) { - // Attack phase - ++_tickCount; - int i = (int) (_tickCount * _attackTime); - if (i >= 1024) { - level = _totalLevel; - _state = _s_decaying; - switching = true; - } else { - level = (attackOut[i] << (31 - 8 - 16)) + _totalLevel; - } - } else { - // Decay, Sustain and Release phases - level += levelIncrement; - if (level >= target) { - level = target; - _state = next_state; - switching = true; - } - } - - if (level < zero_level) { - int phaseShift = *phasebuf >> 2; - if (_feedbackLevel) - phaseShift += (output << (_feedbackLevel - 1)) / 1024; - output = sintbl[((_phase >> 7) + phaseShift) & 0x7ff]; - output >>= (level >> 18); - // Here is the original code, which requires 64-bit ints -// output *= powtbl[511 - ((level>>25)&511)]; -// output >>= 16; -// output >>= 1; - // And here's our 32-bit trick for doing it. (Props to Fingolfin!) - // Result varies from original code by max of 1. -// int powVal = powtbl[511 - ((level>>9)&511)]; -// int outputHI = output / 256; -// int powHI = powVal / 256; -// output = (outputHI * powHI) / 2 + (outputHI * (powVal % 256) + powHI * (output % 256)) / 512; - // And here's the even faster code. - // Result varies from original code by max of 8. - output = ((output >> 4) * (powtbl[511-((level>>9)&511)] >> 3)) / 1024; - - _phase += phaseIncrement; - _phase &= 0x3ffff; - } else - output = 0; - - *outbuf += output; - --buflen; - ++phasebuf; - ++outbuf; - } while (buflen && !switching); - } - _lastOutput = output; - _currentLevel = level - _totalLevel; -} - -//////////////////////////////////////// -// -// Voice2612 implementation -// -//////////////////////////////////////// - -Voice2612::Voice2612() { - next = 0; - _control7 = 127; - _note = 40; - _frequency = 440; - _frequencyOffs = 0x2000; - _algorithm = 7; - - _buffer = 0; - _buflen = 0; - - int i; - for (i = 0; i < ARRAYSIZE(_opr); ++i) - _opr[i] = new Operator2612 (this); - velocity(0); -} - -Voice2612::~Voice2612() { - int i; - for (i = 0; i < ARRAYSIZE(_opr); ++i) - delete _opr[i]; - free(_buffer); -} - -void Voice2612::velocity(int velo) { - _velocity = velo; -#if 0 - int v = (velo * _control7) >> 7; -#else - int v = velo + (_control7 - 127) * 4; -#endif - bool iscarrier[8][4] = { - { false, false, false, true, }, //0 - { false, false, false, true, }, //1 - { false, false, false, true, }, //2 - { false, false, false, true, }, //3 - { false, true, false, true, }, //4 - { false, true, true, true, }, //5 - { false, true, true, true, }, //6 - { true, true, true, true, }, //7 - }; - int opr; - for (opr = 0; opr < 4; opr++) - if (iscarrier[_algorithm][opr]) - _opr[opr]->velocity(v); - else - _opr[opr]->velocity(127); -} - -void Voice2612::setControlParameter(int control, int value) { - switch (control) { - case 7: - _control7 = value; - velocity(_velocity); - break; - case 123: - // All notes off - noteOff(_note); - }; -} - -void Voice2612::setInstrument(byte const *instrument) { - if (instrument == NULL) - return; - - _algorithm = instrument[32] & 7; - _opr[0]->feedbackLevel((instrument[32] >> 3) & 7); - _opr[1]->feedbackLevel(0); - _opr[2]->feedbackLevel(0); - _opr[3]->feedbackLevel(0); - _opr[0]->setInstrument(instrument + 0); - _opr[1]->setInstrument(instrument + 2); - _opr[2]->setInstrument(instrument + 1); - _opr[3]->setInstrument(instrument + 3); -} - -void Voice2612::nextTick(int *outbuf, int buflen) { - if (_velocity == 0) - return; - - if (_buflen < buflen) { - free(_buffer); - _buflen = buflen; - _buffer = (int *) malloc(sizeof(int) * buflen * 2); - } - - int *buf1 = _buffer; - int *buf2 = _buffer + buflen; - memset(_buffer, 0, sizeof(int) * buflen * 2); - - switch (_algorithm) { - case 0: - _opr[0]->nextTick(buf1, buf2, buflen); - _opr[1]->nextTick(buf2, buf1, buflen); - memset (buf2, 0, sizeof (int) * buflen); - _opr[2]->nextTick(buf1, buf2, buflen); - _opr[3]->nextTick(buf2, outbuf, buflen); - break; - case 1: - _opr[0]->nextTick(buf1, buf2, buflen); - _opr[1]->nextTick(buf1, buf2, buflen); - _opr[2]->nextTick(buf2, buf1, buflen); - _opr[3]->nextTick(buf1, outbuf, buflen); - break; - case 2: - _opr[1]->nextTick(buf1, buf2, buflen); - _opr[2]->nextTick(buf2, buf1, buflen); - memset(buf2, 0, sizeof(int) * buflen); - _opr[0]->nextTick(buf2, buf1, buflen); - _opr[3]->nextTick(buf1, outbuf, buflen); - break; - case 3: - _opr[0]->nextTick(buf1, buf2, buflen); - _opr[1]->nextTick(buf2, buf1, buflen); - memset(buf2, 0, sizeof(int) * buflen); - _opr[2]->nextTick(buf2, buf1, buflen); - _opr[3]->nextTick(buf1, outbuf, buflen); - break; - case 4: - _opr[0]->nextTick(buf1, buf2, buflen); - _opr[1]->nextTick(buf2, outbuf, buflen); - _opr[2]->nextTick(buf1, buf1, buflen); - _opr[3]->nextTick(buf1, outbuf, buflen); - break; - case 5: - _opr[0]->nextTick(buf1, buf2, buflen); - _opr[1]->nextTick(buf2, outbuf, buflen); - _opr[2]->nextTick(buf2, outbuf, buflen); - _opr[3]->nextTick(buf2, outbuf, buflen); - break; - case 6: - _opr[0]->nextTick(buf1, buf2, buflen); - _opr[1]->nextTick(buf2, outbuf, buflen); - _opr[2]->nextTick(buf1, outbuf, buflen); - _opr[3]->nextTick(buf1, outbuf, buflen); - break; - case 7: - _opr[0]->nextTick(buf1, outbuf, buflen); - _opr[1]->nextTick(buf1, outbuf, buflen); - _opr[2]->nextTick(buf1, outbuf, buflen); - _opr[3]->nextTick(buf1, outbuf, buflen); - break; - }; -} - -void Voice2612::noteOn(int n, int onVelo) { - _note = n; - velocity(onVelo); - recalculateFrequency(); - int i; - for (i = 0; i < ARRAYSIZE(_opr); i++) - _opr[i]->keyOn(); -} - -bool Voice2612::noteOff(int note) { - if (_note != note) - return false; - int i; - for (i = 0; i < ARRAYSIZE(_opr); i++) - _opr[i]->keyOff(); - return true; -} - -void Voice2612::pitchBend(int value) { - _frequencyOffs = value; - recalculateFrequency(); -} - -void Voice2612::recalculateFrequency() { - // - // - // - int32 basefreq = frequencyTable[_note]; - int cfreq = frequencyTable[_note - (_note % 12)]; - int oct = _note / 12; - int fnum = (int) (((double)basefreq * (1 << 13)) / cfreq); - fnum += _frequencyOffs - 0x2000; - if (fnum < 0x2000) { - fnum += 0x2000; - oct--; - } - if (fnum >= 0x4000) { - fnum -= 0x2000; - oct++; - } - - // - _frequency = (int) ((frequencyTable[oct*12] * (double)fnum) / 8); - - int i; - for (i = 0; i < ARRAYSIZE(_opr); i++) - _opr[i]->frequency(_frequency); -} - -//////////////////////////////////////// -// -// MidiChannel_YM2612 -// -//////////////////////////////////////// - -MidiChannel_YM2612::MidiChannel_YM2612() { - _voices = 0; - _next_voice = 0; -} - -MidiChannel_YM2612::~MidiChannel_YM2612() { - removeAllVoices(); -} - -void MidiChannel_YM2612::removeAllVoices() { - if (!_voices) - return; - Voice2612 *last, *voice = _voices; - for (; voice; voice = last) { - last = voice->next; - delete voice; - } - _voices = _next_voice = 0; -} - -void MidiChannel_YM2612::noteOn(byte note, byte onVelo) { - if (!_voices) - return; - _next_voice = _next_voice ? _next_voice : _voices; - _next_voice->noteOn(note, onVelo); - _next_voice = _next_voice->next; -} - -void MidiChannel_YM2612::noteOff(byte note) { - if (!_voices) - return; - if (_next_voice == _voices) - _next_voice = 0; - Voice2612 *voice = _next_voice; - do { - if (!voice) - voice = _voices; - if (voice->noteOff(note)) { - _next_voice = voice; - break; - } - voice = voice->next; - } while (voice != _next_voice); -} - -void MidiChannel_YM2612::controlChange(byte control, byte value) { - // - if (control == 121) { - // Reset controller - removeAllVoices(); - } else { - Voice2612 *voice = _voices; - for (; voice; voice = voice->next) - voice->setControlParameter(control, value); - } -} - -void MidiChannel_YM2612::sysEx_customInstrument(uint32 type, const byte *fmInst) { - if (type != 'EUP ') - return; - Voice2612 *voice = new Voice2612; - voice->next = _voices; - _voices = voice; - voice->_rate = _rate; - voice->setInstrument(fmInst); -} - -void MidiChannel_YM2612::pitchBend(int16 value) { - // - Voice2612 *voice = _voices; - for (; voice; voice = voice->next) - voice->pitchBend(value); -} - -void MidiChannel_YM2612::nextTick(int *outbuf, int buflen) { - Voice2612 *voice = _voices; - for (; voice; voice = voice->next) - voice->nextTick(outbuf, buflen); -} - -void MidiChannel_YM2612::rate(uint16 r) { - _rate = r; - Voice2612 *voice = _voices; - for (; voice; voice = voice->next) - voice->_rate = r; -} - -//////////////////////////////////////// -// -// MidiDriver_YM2612 -// -//////////////////////////////////////// - -MidiDriver_YM2612::MidiDriver_YM2612(Audio::Mixer *mixer) - : MidiDriver_Emulated(mixer) { - _next_voice = 0; - - createLookupTables(); - _volume = 256; - int i; - for (i = 0; i < ARRAYSIZE(_channel); i++) - _channel[i] = new MidiChannel_YM2612; - rate(getRate()); -} - -MidiDriver_YM2612::~MidiDriver_YM2612() { - int i; - for (i = 0; i < ARRAYSIZE(_channel); i++) - delete _channel[i]; - removeLookupTables(); -} - -int MidiDriver_YM2612::open() { - if (_isOpen) - return MERR_ALREADY_OPEN; - - MidiDriver_Emulated::open(); - - _mixer->playStream(Audio::Mixer::kPlainSoundType, &_mixerSoundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true); - return 0; -} - -void MidiDriver_YM2612::close() { - if (!_isOpen) - return; - _isOpen = false; - - _mixer->stopHandle(_mixerSoundHandle); -} - -void MidiDriver_YM2612::send(uint32 b) { - send(b & 0xF, b & 0xFFFFFFF0); -} - -void MidiDriver_YM2612::send(byte chan, uint32 b) { - //byte param3 = (byte) ((b >> 24) & 0xFF); - byte param2 = (byte) ((b >> 16) & 0xFF); - byte param1 = (byte) ((b >> 8) & 0xFF); - byte cmd = (byte) (b & 0xF0); - if (chan > ARRAYSIZE(_channel)) - return; - - switch (cmd) { - case 0x80:// Note Off - _channel[chan]->noteOff(param1); - break; - case 0x90: // Note On - _channel[chan]->noteOn(param1, param2); - break; - case 0xA0: // Aftertouch - break; // Not supported. - case 0xB0: // Control Change - _channel[chan]->controlChange(param1, param2); - break; - case 0xC0: // Program Change - _channel[chan]->programChange(param1); - break; - case 0xD0: // Channel Pressure - break; // Not supported. - case 0xE0: // Pitch Bend - _channel[chan]->pitchBend((param1 | (param2 << 7)) - 0x2000); - break; - case 0xF0: // SysEx - // We should never get here! SysEx information has to be - // sent via high-level semantic methods. - warning("MidiDriver_YM2612: Receiving SysEx command on a send() call"); - break; - - default: - warning("MidiDriver_YM2612: Unknown send() command 0x%02X", cmd); - } -} - -void MidiDriver_YM2612::sysEx(const byte *msg, uint16 length) { - if (msg[0] != 0x7C || msg[1] >= ARRAYSIZE(_channel)) - return; - _channel[msg[1]]->sysEx_customInstrument('EUP ', &msg[2]); -} - -void MidiDriver_YM2612::generateSamples(int16 *data, int len) { - memset(data, 0, 2 * sizeof(int16) * len); - nextTick(data, len); -} - -void MidiDriver_YM2612::nextTick(int16 *buf1, int buflen) { - int *buf0 = (int *)buf1; - - int i; - for (i = 0; i < ARRAYSIZE(_channel); i++) - _channel[i]->nextTick(buf0, buflen); - - for (i = 0; i < buflen; ++i) - buf1[i*2+1] = buf1[i*2] = ((buf0[i] * volume()) >> 10) & 0xffff; -} - -void MidiDriver_YM2612::rate(uint16 r) -{ - int i; - for (i = 0; i < ARRAYSIZE(_channel); i++) - _channel[i]->rate(r); -} - -void MidiDriver_YM2612::createLookupTables() { - { - int i; - sintbl = new int [2048]; - for (i = 0; i < 2048; i++) - sintbl[i] = (int)(0xffff * sin(i/2048.0 * 2.0 * M_PI)); - } - - { - int i; - powtbl = new int [1025]; - for (i = 0; i <= 1024; i++) - powtbl[i] = (int)(0x10000 * pow(2.0, (i - 512) / 512.0)); - } - - { - int i; - int block; - - static int fnum[] = { - 0x026a, 0x028f, 0x02b6, 0x02df, - 0x030b, 0x0339, 0x036a, 0x039e, - 0x03d5, 0x0410, 0x044e, 0x048f, - }; - - // (int)(880.0 * 256.0 * pow(2.0, (note-0x51)/12.0)) - // - frequencyTable = new int [120]; - for (block = -1; block < 9; block++) { - for (i = 0; i < 12; i++) { - double freq = fnum[i] * (166400.0 / 3) * pow(2.0, block-21); - frequencyTable[(block+1)*12+i] = (int)(256.0 * freq); - } - } - - keycodeTable = new int [120]; - // detune - for (block = -1; block < 9; block++) { - for (i = 0; i < 12; i++) { - // see p.204 - int f8 = (fnum[i] >> 7) & 1; - int f9 = (fnum[i] >> 8) & 1; - int f10 = (fnum[i] >> 9) & 1; - int f11 = (fnum[i] >> 10) & 1; - int n4 = f11; - int n3 = (f11&(f10|f9|f8)) | (~f11&f10&f9&f8); - int note = n4*2 + n3; - // see p.207 - keycodeTable[(block+1)*12+i] = block*4 + note; - } - } - } - - { - int freq; - keyscaleTable = new int [8192]; - keyscaleTable[0] = 0; - for (freq = 1; freq < 8192; freq++) { - keyscaleTable[freq] = (int)(log((double)freq) / 9.03 * 32.0) - 1; - // 8368[Hz] (o9c) - } - } - - { - int i; - attackOut = new int [1024]; - for (i = 0; i < 1024; i++) - attackOut[i] = (int)(((0x7fff+0x03a5)*30.0) / (30.0+i)) - 0x03a5; - } -} - -void MidiDriver_YM2612::removeLookupTables() { - delete[] sintbl; - delete[] powtbl; - delete[] frequencyTable; - delete[] keycodeTable; - delete[] keyscaleTable; - delete[] attackOut; - sintbl = powtbl = frequencyTable = keycodeTable = keyscaleTable = attackOut = 0; -} - - -// Plugin interface - -class TownsEmuMusicPlugin : public MusicPluginObject { -public: - const char *getName() const { - return _s("FM Towns Emulator"); - } - - const char *getId() const { - return "towns"; - } - - MusicDevices getDevices() const; - Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle = 0) const; -}; - -MusicDevices TownsEmuMusicPlugin::getDevices() const { - MusicDevices devices; - devices.push_back(MusicDevice(this, "", MT_TOWNS)); - return devices; -} - -Common::Error TownsEmuMusicPlugin::createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle) const { - *mididriver = new MidiDriver_YM2612(g_system->getMixer()); - - return Common::kNoError; -} - -//#if PLUGIN_ENABLED_DYNAMIC(TOWNS) - //REGISTER_PLUGIN_DYNAMIC(TOWNS, PLUGIN_TYPE_MUSIC, TownsEmuMusicPlugin); -//#else - REGISTER_PLUGIN_STATIC(TOWNS, PLUGIN_TYPE_MUSIC, TownsEmuMusicPlugin); -//#endif diff --git a/audio/softsynth/ym2612.h b/audio/softsynth/ym2612.h deleted file mode 100644 index f652b2d9e48..00000000000 --- a/audio/softsynth/ym2612.h +++ /dev/null @@ -1,179 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - */ - -#ifndef SOUND_SOFTSYNTH_Y2612_H -#define SOUND_SOFTSYNTH_Y2612_H - -#include "common/scummsys.h" - -#include "audio/softsynth/emumidi.h" - -//////////////////////////////////////// -// -// Class declarations -// -//////////////////////////////////////// - -class Voice2612; -class Operator2612 { -protected: - Voice2612 *_owner; - enum State { _s_ready, _s_attacking, _s_decaying, _s_sustaining, _s_releasing }; - State _state; - int32 _currentLevel; - int _frequency; - uint32 _phase; - int _lastOutput; - int _feedbackLevel; - int _detune; - int _multiple; - int32 _totalLevel; - int _keyScale; - int _velocity; - int _specifiedTotalLevel; - int _specifiedAttackRate; - int _specifiedDecayRate; - int _specifiedSustainLevel; - int _specifiedSustainRate; - int _specifiedReleaseRate; - int _tickCount; - int _attackTime; - int32 _decayRate; - int32 _sustainLevel; - int32 _sustainRate; - int32 _releaseRate; - -public: - Operator2612 (Voice2612 *owner); - ~Operator2612(); - void feedbackLevel(int level); - void setInstrument(byte const *instrument); - void velocity(int velo); - void keyOn(); - void keyOff(); - void frequency(int freq); - void nextTick(const int *phaseShift, int *outbuf, int buflen); - bool inUse() { return (_state != _s_ready); } -}; - -class Voice2612 { -public: - Voice2612 *next; - uint16 _rate; - -protected: - Operator2612 *_opr[4]; - int _velocity; - int _control7; - int _note; - int _frequencyOffs; - int _frequency; - int _algorithm; - - int *_buffer; - int _buflen; - -public: - Voice2612(); - ~Voice2612(); - void setControlParameter(int control, int value); - void setInstrument(byte const *instrument); - void velocity(int velo); - void nextTick(int *outbuf, int buflen); - void noteOn(int n, int onVelo); - bool noteOff(int note); - void pitchBend(int value); - void recalculateFrequency(); -}; - -class MidiChannel_YM2612 : public MidiChannel { -protected: - uint16 _rate; - Voice2612 *_voices; - Voice2612 *_next_voice; - -public: - void removeAllVoices(); - void nextTick(int *outbuf, int buflen); - void rate(uint16 r); - -public: - MidiChannel_YM2612(); - virtual ~MidiChannel_YM2612(); - - // MidiChannel interface - MidiDriver *device() { return 0; } - byte getNumber() { return 0; } - void release() { } - void send(uint32 b) { } - void noteOff(byte note); - void noteOn(byte note, byte onVelo); - void programChange(byte program) { } - void pitchBend(int16 value); - void controlChange(byte control, byte value); - void pitchBendFactor(byte value) { } - void sysEx_customInstrument(uint32 type, const byte *instr); -}; - -class MidiDriver_YM2612 : public MidiDriver_Emulated { -protected: - MidiChannel_YM2612 *_channel[16]; - - int _next_voice; - int _volume; - -protected: - void nextTick(int16 *buf1, int buflen); - int volume(int val = -1) { if (val >= 0) _volume = val; return _volume; } - void rate(uint16 r); - - void generateSamples(int16 *buf, int len); - -public: - MidiDriver_YM2612(Audio::Mixer *mixer); - virtual ~MidiDriver_YM2612(); - - static void createLookupTables(); - static void removeLookupTables(); - - int open(); - void close(); - void send(uint32 b); - void send(byte channel, uint32 b); // Supports higher than channel 15 - uint32 property(int prop, uint32 param) { return 0; } - - void setPitchBendRange(byte channel, uint range) { } - void sysEx(const byte *msg, uint16 length); - - MidiChannel *allocateChannel() { return 0; } - MidiChannel *getPercussionChannel() { return 0; } - - - // AudioStream API - bool isStereo() const { return true; } - int getRate() const { return _mixer->getOutputRate(); } -}; - -#endif - diff --git a/audio/timestamp.cpp b/audio/timestamp.cpp index cdc5bc3a02f..69b47d16286 100644 --- a/audio/timestamp.cpp +++ b/audio/timestamp.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/timestamp.h" diff --git a/audio/timestamp.h b/audio/timestamp.h index 4130793fc88..ef095a2106a 100644 --- a/audio/timestamp.h +++ b/audio/timestamp.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SOUND_TIMESTAMP_H diff --git a/backends/audiocd/audiocd.h b/backends/audiocd/audiocd.h index f218db7f721..92b7598cb5d 100644 --- a/backends/audiocd/audiocd.h +++ b/backends/audiocd/audiocd.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_AUDIOCD_ABSTRACT_H @@ -111,7 +108,7 @@ public: //@{ /** - * Initialise the specified CD drive for audio playback. + * Initialize the specified CD drive for audio playback. * @param drive the drive id * @return true if the CD drive was inited succesfully */ diff --git a/backends/audiocd/default/default-audiocd.cpp b/backends/audiocd/default/default-audiocd.cpp index 0acc64b7f27..819b9c45225 100644 --- a/backends/audiocd/default/default-audiocd.cpp +++ b/backends/audiocd/default/default-audiocd.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "backends/audiocd/default/default-audiocd.h" diff --git a/backends/audiocd/default/default-audiocd.h b/backends/audiocd/default/default-audiocd.h index d3e0150fb6b..1971ed8f6e3 100644 --- a/backends/audiocd/default/default-audiocd.h +++ b/backends/audiocd/default/default-audiocd.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_AUDIOCD_DEFAULT_H diff --git a/backends/audiocd/sdl/sdl-audiocd.cpp b/backends/audiocd/sdl/sdl-audiocd.cpp index 82c9549a571..b5f97571f3d 100644 --- a/backends/audiocd/sdl/sdl-audiocd.cpp +++ b/backends/audiocd/sdl/sdl-audiocd.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/audiocd/sdl/sdl-audiocd.h b/backends/audiocd/sdl/sdl-audiocd.h index b46afab9f28..85bde353df1 100644 --- a/backends/audiocd/sdl/sdl-audiocd.h +++ b/backends/audiocd/sdl/sdl-audiocd.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_AUDIOCD_SDL_H diff --git a/backends/base-backend.cpp b/backends/base-backend.cpp index f349cc80055..40e702495a3 100644 --- a/backends/base-backend.cpp +++ b/backends/base-backend.cpp @@ -60,15 +60,11 @@ void BaseBackend::fillScreen(uint32 col) { */ -#if defined(UNIX) -#if defined(SAMSUNGTV) -#define DEFAULT_CONFIG_FILE "/dtv/usb/sda1/.scummvmrc" -#else +#if defined(POSIX) #define DEFAULT_CONFIG_FILE ".scummvmrc" #endif -#endif -#if !defined(UNIX) +#if !defined(POSIX) #define DEFAULT_CONFIG_FILE "scummvm.ini" #endif diff --git a/backends/base-backend.h b/backends/base-backend.h index de94d85523a..864c11544ab 100644 --- a/backends/base-backend.h +++ b/backends/base-backend.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_BASE_BACKEND_H diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp index 9befeb00c9f..bb74933596c 100644 --- a/backends/events/default/default-events.cpp +++ b/backends/events/default/default-events.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/events/default/default-events.h b/backends/events/default/default-events.h index 73dc60695b5..3a8025f5e82 100644 --- a/backends/events/default/default-events.h +++ b/backends/events/default/default-events.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(BACKEND_EVENTS_DEFAULT_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER) diff --git a/backends/events/dinguxsdl/dinguxsdl-events.cpp b/backends/events/dinguxsdl/dinguxsdl-events.cpp index 7a7443299c4..946507ccfd5 100644 --- a/backends/events/dinguxsdl/dinguxsdl-events.cpp +++ b/backends/events/dinguxsdl/dinguxsdl-events.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/events/dinguxsdl/dinguxsdl-events.h b/backends/events/dinguxsdl/dinguxsdl-events.h index 1201e5b8ce3..b348bafa788 100644 --- a/backends/events/dinguxsdl/dinguxsdl-events.h +++ b/backends/events/dinguxsdl/dinguxsdl-events.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_EVENTS_SDL_DINGUX_H diff --git a/backends/events/linuxmotosdl/linuxmotosdl-events.cpp b/backends/events/linuxmotosdl/linuxmotosdl-events.cpp index 751e4f06ed7..e859c5291b7 100644 --- a/backends/events/linuxmotosdl/linuxmotosdl-events.cpp +++ b/backends/events/linuxmotosdl/linuxmotosdl-events.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/events/linuxmotosdl/linuxmotosdl-events.h b/backends/events/linuxmotosdl/linuxmotosdl-events.h index 3b59f092457..7b0c8fcc73f 100644 --- a/backends/events/linuxmotosdl/linuxmotosdl-events.h +++ b/backends/events/linuxmotosdl/linuxmotosdl-events.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(BACKEND_EVENTS_SDL_LINUXMOTO_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER) diff --git a/backends/events/samsungtvsdl/samsungtvsdl-events.cpp b/backends/events/samsungtvsdl/samsungtvsdl-events.cpp index deb4e8cc67d..5e3659839a8 100644 --- a/backends/events/samsungtvsdl/samsungtvsdl-events.cpp +++ b/backends/events/samsungtvsdl/samsungtvsdl-events.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/events/samsungtvsdl/samsungtvsdl-events.h b/backends/events/samsungtvsdl/samsungtvsdl-events.h index 453c6473a35..4b9ccc9bf8e 100644 --- a/backends/events/samsungtvsdl/samsungtvsdl-events.h +++ b/backends/events/samsungtvsdl/samsungtvsdl-events.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(BACKEND_EVENTS_SDL_SAMSUNGTV_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER) diff --git a/backends/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp index 6e343b63f55..835d98e718e 100644 --- a/backends/events/sdl/sdl-events.cpp +++ b/backends/events/sdl/sdl-events.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" @@ -282,7 +279,7 @@ bool SdlEventSource::handleKeyDown(SDL_Event &ev, Common::Event &event) { event.type = Common::EVENT_QUIT; return true; } -#elif defined(UNIX) +#elif defined(POSIX) // On other *nix systems, Control-Q quits if ((ev.key.keysym.mod & KMOD_CTRL) && ev.key.keysym.sym == 'q') { event.type = Common::EVENT_QUIT; @@ -326,7 +323,7 @@ bool SdlEventSource::handleKeyUp(SDL_Event &ev, Common::Event &event) { if (ev.key.keysym.sym == 'm' || // Ctrl-m toggles mouse capture #if defined(MACOSX) // Meta - Q, handled below -#elif defined(UNIX) +#elif defined(POSIX) ev.key.keysym.sym == 'q' || // On other *nix systems, Control-Q quits #else ev.key.keysym.sym == 'z' || // Ctrl-z quit @@ -339,7 +336,7 @@ bool SdlEventSource::handleKeyUp(SDL_Event &ev, Common::Event &event) { #if defined(MACOSX) if ((mod & KMOD_META) && ev.key.keysym.sym == 'q') return false; // On Macintosh, Cmd-Q quits -#elif defined(UNIX) +#elif defined(POSIX) // Control Q has already been handled above #else if ((mod & KMOD_ALT) && ev.key.keysym.sym == 'x') diff --git a/backends/events/sdl/sdl-events.h b/backends/events/sdl/sdl-events.h index 436635f78a5..227d6e1607a 100644 --- a/backends/events/sdl/sdl-events.h +++ b/backends/events/sdl/sdl-events.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(BACKEND_EVENTS_SDL_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER) diff --git a/backends/events/symbiansdl/symbiansdl-events.cpp b/backends/events/symbiansdl/symbiansdl-events.cpp index 8c995e7eb75..40bd89b8dc9 100644 --- a/backends/events/symbiansdl/symbiansdl-events.cpp +++ b/backends/events/symbiansdl/symbiansdl-events.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/events/symbiansdl/symbiansdl-events.h b/backends/events/symbiansdl/symbiansdl-events.h index b65d7baf0ed..7186fc91163 100644 --- a/backends/events/symbiansdl/symbiansdl-events.h +++ b/backends/events/symbiansdl/symbiansdl-events.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(BACKEND_EVENTS_SYMBIAN_SDL_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER) diff --git a/backends/events/webossdl/webossdl-events.cpp b/backends/events/webossdl/webossdl-events.cpp index 3f3efe9e2a3..4a17bc20668 100644 --- a/backends/events/webossdl/webossdl-events.cpp +++ b/backends/events/webossdl/webossdl-events.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef WEBOS diff --git a/backends/events/webossdl/webossdl-events.h b/backends/events/webossdl/webossdl-events.h index 3a41111cf2b..c925132d925 100644 --- a/backends/events/webossdl/webossdl-events.h +++ b/backends/events/webossdl/webossdl-events.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(BACKEND_EVENTS_SDL_WEBOS_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER) diff --git a/backends/events/wincesdl/wincesdl-events.cpp b/backends/events/wincesdl/wincesdl-events.cpp index 2505b0fb315..f15a416b76d 100644 --- a/backends/events/wincesdl/wincesdl-events.cpp +++ b/backends/events/wincesdl/wincesdl-events.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/events/wincesdl/wincesdl-events.h b/backends/events/wincesdl/wincesdl-events.h index f5b1026c464..734cc899c05 100644 --- a/backends/events/wincesdl/wincesdl-events.h +++ b/backends/events/wincesdl/wincesdl-events.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_EVENTS_SDL_WINCE_H diff --git a/backends/fs/abstract-fs.cpp b/backends/fs/abstract-fs.cpp index f110e862b7f..372c7423dd8 100644 --- a/backends/fs/abstract-fs.cpp +++ b/backends/fs/abstract-fs.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "backends/fs/abstract-fs.h" diff --git a/backends/fs/abstract-fs.h b/backends/fs/abstract-fs.h index bd591753e86..54e3958972a 100644 --- a/backends/fs/abstract-fs.h +++ b/backends/fs/abstract-fs.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef BACKENDS_ABSTRACT_FS_H diff --git a/backends/fs/amigaos4/amigaos4-fs-factory.cpp b/backends/fs/amigaos4/amigaos4-fs-factory.cpp index 51c2c294d42..a62b581f39c 100644 --- a/backends/fs/amigaos4/amigaos4-fs-factory.cpp +++ b/backends/fs/amigaos4/amigaos4-fs-factory.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #if defined(__amigaos4__) diff --git a/backends/fs/amigaos4/amigaos4-fs-factory.h b/backends/fs/amigaos4/amigaos4-fs-factory.h index 89b3c7008dd..0390e850729 100644 --- a/backends/fs/amigaos4/amigaos4-fs-factory.h +++ b/backends/fs/amigaos4/amigaos4-fs-factory.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef AMIGAOS_FILESYSTEM_FACTORY_H diff --git a/backends/fs/amigaos4/amigaos4-fs.cpp b/backends/fs/amigaos4/amigaos4-fs.cpp index 4f763ef9e8f..fe388c2a6e3 100644 --- a/backends/fs/amigaos4/amigaos4-fs.cpp +++ b/backends/fs/amigaos4/amigaos4-fs.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #if defined(__amigaos4__) diff --git a/backends/fs/amigaos4/amigaos4-fs.h b/backends/fs/amigaos4/amigaos4-fs.h index 83188f89f1d..4e231330f0b 100644 --- a/backends/fs/amigaos4/amigaos4-fs.h +++ b/backends/fs/amigaos4/amigaos4-fs.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef AMIGAOS_FILESYSTEM_H diff --git a/backends/fs/ds/ds-fs-factory.cpp b/backends/fs/ds/ds-fs-factory.cpp index 2d4102eec64..3fd97d07eb2 100644 --- a/backends/fs/ds/ds-fs-factory.cpp +++ b/backends/fs/ds/ds-fs-factory.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ // Disable symbol overrides for FILE as that is used in FLAC headers diff --git a/backends/fs/ds/ds-fs-factory.h b/backends/fs/ds/ds-fs-factory.h index d23a997ee09..ed5804b94a9 100644 --- a/backends/fs/ds/ds-fs-factory.h +++ b/backends/fs/ds/ds-fs-factory.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef DS_FILESYSTEM_FACTORY_H diff --git a/backends/fs/ds/ds-fs.cpp b/backends/fs/ds/ds-fs.cpp index 2308824d57c..6c11ddc6050 100644 --- a/backends/fs/ds/ds-fs.cpp +++ b/backends/fs/ds/ds-fs.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides for FILE as that is used in FLAC headers diff --git a/backends/fs/ds/ds-fs.h b/backends/fs/ds/ds-fs.h index c891dac8f96..a6a6b978707 100644 --- a/backends/fs/ds/ds-fs.h +++ b/backends/fs/ds/ds-fs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef _DS_FS_H diff --git a/backends/fs/fs-factory.h b/backends/fs/fs-factory.h index cfa5b87edd9..6d378955ec5 100644 --- a/backends/fs/fs-factory.h +++ b/backends/fs/fs-factory.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef FILESYSTEM_FACTORY_H diff --git a/backends/fs/n64/n64-fs-factory.cpp b/backends/fs/n64/n64-fs-factory.cpp index e362e3214a1..7cabbf4f7a5 100644 --- a/backends/fs/n64/n64-fs-factory.cpp +++ b/backends/fs/n64/n64-fs-factory.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifdef __N64__ diff --git a/backends/fs/n64/n64-fs-factory.h b/backends/fs/n64/n64-fs-factory.h index 35bad9600a6..5dec7c7eab0 100644 --- a/backends/fs/n64/n64-fs-factory.h +++ b/backends/fs/n64/n64-fs-factory.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef N64_FILESYSTEM_FACTORY_H diff --git a/backends/fs/n64/n64-fs.h b/backends/fs/n64/n64-fs.h index 3a5dd375b9b..d177cae9b46 100644 --- a/backends/fs/n64/n64-fs.h +++ b/backends/fs/n64/n64-fs.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef N64_FILESYSTEM_H diff --git a/backends/fs/posix/posix-fs-factory.cpp b/backends/fs/posix/posix-fs-factory.cpp index 639f57ac06a..ccff8a8b428 100644 --- a/backends/fs/posix/posix-fs-factory.cpp +++ b/backends/fs/posix/posix-fs-factory.cpp @@ -17,12 +17,9 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ -#if defined(UNIX) +#if defined(POSIX) // Re-enable some forbidden symbols to avoid clashes with stat.h and unistd.h. // Also with clock() in sys/time.h in some Mac OS X SDKs. diff --git a/backends/fs/posix/posix-fs-factory.h b/backends/fs/posix/posix-fs-factory.h index 68c1fdd8761..a7075db94ce 100644 --- a/backends/fs/posix/posix-fs-factory.h +++ b/backends/fs/posix/posix-fs-factory.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef POSIX_FILESYSTEM_FACTORY_H diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp index 34edb785048..08a7601c17a 100644 --- a/backends/fs/posix/posix-fs.cpp +++ b/backends/fs/posix/posix-fs.cpp @@ -17,18 +17,16 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ -#if defined(UNIX) +#if defined(POSIX) // Re-enable some forbidden symbols to avoid clashes with stat.h and unistd.h. // Also with clock() in sys/time.h in some Mac OS X SDKs. #define FORBIDDEN_SYMBOL_EXCEPTION_time_h #define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h #define FORBIDDEN_SYMBOL_EXCEPTION_mkdir +#define FORBIDDEN_SYMBOL_EXCEPTION_getenv #include "backends/fs/posix/posix-fs.h" #include "backends/fs/stdiostream.h" @@ -251,4 +249,4 @@ Common::WriteStream *POSIXFilesystemNode::createWriteStream() { return StdioStream::makeFromPath(getPath(), true); } -#endif //#if defined(UNIX) +#endif //#if defined(POSIX) diff --git a/backends/fs/posix/posix-fs.h b/backends/fs/posix/posix-fs.h index 003a0b38d01..e124829c027 100644 --- a/backends/fs/posix/posix-fs.h +++ b/backends/fs/posix/posix-fs.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef POSIX_FILESYSTEM_H diff --git a/backends/fs/ps2/ps2-fs-factory.cpp b/backends/fs/ps2/ps2-fs-factory.cpp index 9e7ec3fa106..cad92b5dec2 100644 --- a/backends/fs/ps2/ps2-fs-factory.cpp +++ b/backends/fs/ps2/ps2-fs-factory.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #if defined(__PLAYSTATION2__) diff --git a/backends/fs/ps2/ps2-fs-factory.h b/backends/fs/ps2/ps2-fs-factory.h index f193982d6ba..9c6709cccf5 100644 --- a/backends/fs/ps2/ps2-fs-factory.h +++ b/backends/fs/ps2/ps2-fs-factory.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef PS2_FILESYSTEM_FACTORY_H diff --git a/backends/fs/ps2/ps2-fs.cpp b/backends/fs/ps2/ps2-fs.cpp index 24cc6bd30a7..3a86cb3d9c3 100644 --- a/backends/fs/ps2/ps2-fs.cpp +++ b/backends/fs/ps2/ps2-fs.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #if defined(__PLAYSTATION2__) diff --git a/backends/fs/ps2/ps2-fs.h b/backends/fs/ps2/ps2-fs.h index 0c37ceeb91a..9323715c7fa 100644 --- a/backends/fs/ps2/ps2-fs.h +++ b/backends/fs/ps2/ps2-fs.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef PS2_FILESYSTEM_H diff --git a/backends/fs/psp/psp-fs-factory.cpp b/backends/fs/psp/psp-fs-factory.cpp index aee541d12a4..ef1df246ba0 100644 --- a/backends/fs/psp/psp-fs-factory.cpp +++ b/backends/fs/psp/psp-fs-factory.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #if defined(__PSP__) diff --git a/backends/fs/psp/psp-fs-factory.h b/backends/fs/psp/psp-fs-factory.h index 36ecb8188b6..aeaa9d6a875 100644 --- a/backends/fs/psp/psp-fs-factory.h +++ b/backends/fs/psp/psp-fs-factory.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef PSP_FILESYSTEM_FACTORY_H diff --git a/backends/fs/psp/psp-fs.cpp b/backends/fs/psp/psp-fs.cpp index 908430b2f94..67f4cd59a77 100644 --- a/backends/fs/psp/psp-fs.cpp +++ b/backends/fs/psp/psp-fs.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #if defined(__PSP__) diff --git a/backends/fs/psp/psp-fs.h b/backends/fs/psp/psp-fs.h index 12d2c540c0e..146debb5f1b 100644 --- a/backends/fs/psp/psp-fs.h +++ b/backends/fs/psp/psp-fs.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef PSP_FILESYSTEM_H diff --git a/backends/fs/psp/psp-stream.cpp b/backends/fs/psp/psp-stream.cpp index 10b80a0639a..da5a46eedb5 100644 --- a/backends/fs/psp/psp-stream.cpp +++ b/backends/fs/psp/psp-stream.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef __PSP__ diff --git a/backends/fs/psp/psp-stream.h b/backends/fs/psp/psp-stream.h index d4497aa79fe..395b27392de 100644 --- a/backends/fs/psp/psp-stream.h +++ b/backends/fs/psp/psp-stream.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PSPSTREAM_H_ diff --git a/backends/fs/stdiostream.cpp b/backends/fs/stdiostream.cpp index d0600f41a61..7342df00295 100644 --- a/backends/fs/stdiostream.cpp +++ b/backends/fs/stdiostream.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use FILE, fopen etc. diff --git a/backends/fs/stdiostream.h b/backends/fs/stdiostream.h index 25800f210ad..1d45600d9c4 100644 --- a/backends/fs/stdiostream.h +++ b/backends/fs/stdiostream.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_FS_STDIOSTREAM_H diff --git a/backends/fs/symbian/symbian-fs-factory.cpp b/backends/fs/symbian/symbian-fs-factory.cpp index 9afacfebf5d..7a60109742e 100644 --- a/backends/fs/symbian/symbian-fs-factory.cpp +++ b/backends/fs/symbian/symbian-fs-factory.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #if defined(__SYMBIAN32__) diff --git a/backends/fs/symbian/symbian-fs-factory.h b/backends/fs/symbian/symbian-fs-factory.h index 2ad75b41eeb..b99d3fb0ec5 100644 --- a/backends/fs/symbian/symbian-fs-factory.h +++ b/backends/fs/symbian/symbian-fs-factory.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SYMBIAN_FILESYSTEM_FACTORY_H diff --git a/backends/fs/symbian/symbian-fs.cpp b/backends/fs/symbian/symbian-fs.cpp index b8fc5e19f6f..fd74c8ca461 100644 --- a/backends/fs/symbian/symbian-fs.cpp +++ b/backends/fs/symbian/symbian-fs.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #if defined (__SYMBIAN32__) diff --git a/backends/fs/symbian/symbian-fs.h b/backends/fs/symbian/symbian-fs.h index 9b0e80c3d66..0db9a889405 100644 --- a/backends/fs/symbian/symbian-fs.h +++ b/backends/fs/symbian/symbian-fs.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SYMBIAN_FILESYSTEM_H diff --git a/backends/fs/symbian/symbianstream.cpp b/backends/fs/symbian/symbianstream.cpp index c926cc65f8c..352595e25a3 100644 --- a/backends/fs/symbian/symbianstream.cpp +++ b/backends/fs/symbian/symbianstream.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/fs/symbian/symbianstream.h b/backends/fs/symbian/symbianstream.h index 45117e0bf09..3ca612e39b6 100644 --- a/backends/fs/symbian/symbianstream.h +++ b/backends/fs/symbian/symbianstream.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_FS_SYMBIANSTDIOSTREAM_H diff --git a/backends/fs/wii/wii-fs.h b/backends/fs/wii/wii-fs.h index fd160624cab..11679d0c363 100644 --- a/backends/fs/wii/wii-fs.h +++ b/backends/fs/wii/wii-fs.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef WII_FILESYSTEM_H diff --git a/backends/fs/windows/windows-fs-factory.cpp b/backends/fs/windows/windows-fs-factory.cpp index 0b240bcbcf3..46df2537480 100644 --- a/backends/fs/windows/windows-fs-factory.cpp +++ b/backends/fs/windows/windows-fs-factory.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #if defined(WIN32) diff --git a/backends/fs/windows/windows-fs-factory.h b/backends/fs/windows/windows-fs-factory.h index cb2b1025388..e7c70f1b552 100644 --- a/backends/fs/windows/windows-fs-factory.h +++ b/backends/fs/windows/windows-fs-factory.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef WINDOWS_FILESYSTEM_FACTORY_H diff --git a/backends/fs/windows/windows-fs.cpp b/backends/fs/windows/windows-fs.cpp index 8345c9d7b41..9e864753c92 100644 --- a/backends/fs/windows/windows-fs.cpp +++ b/backends/fs/windows/windows-fs.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #if defined(WIN32) diff --git a/backends/fs/windows/windows-fs.h b/backends/fs/windows/windows-fs.h index 8e4880ce234..37d1e9099be 100644 --- a/backends/fs/windows/windows-fs.h +++ b/backends/fs/windows/windows-fs.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef WINDOWS_FILESYSTEM_H diff --git a/backends/graphics/default-palette.h b/backends/graphics/default-palette.h index 12436aae515..8f3fcb2db1f 100644 --- a/backends/graphics/default-palette.h +++ b/backends/graphics/default-palette.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_GRAPHICS_DEFAULT_PALETTE_H diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp index 4e2aee3a3b0..6690244fb7c 100644 --- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp +++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h index dd21c8fa2bf..9fb11705030 100644 --- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h +++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_GRAPHICS_SDL_DINGUX_H diff --git a/backends/graphics/gp2xsdl/gp2xsdl-graphics.h b/backends/graphics/gp2xsdl/gp2xsdl-graphics.h index 6fb1a28a98d..341b913acd6 100644 --- a/backends/graphics/gp2xsdl/gp2xsdl-graphics.h +++ b/backends/graphics/gp2xsdl/gp2xsdl-graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_GRAPHICS_SDL_GP2X_H diff --git a/backends/graphics/graphics.h b/backends/graphics/graphics.h index 953171d0898..4e681eb155e 100644 --- a/backends/graphics/graphics.h +++ b/backends/graphics/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_GRAPHICS_ABSTRACT_H diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp index 7d1809f4ac2..42db89ee33c 100644 --- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp +++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h index 8124aca778b..c428f00447b 100644 --- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h +++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_GRAPHICS_SDL_LINUXMOTO_H diff --git a/backends/graphics/null/null-graphics.h b/backends/graphics/null/null-graphics.h index 2c15f569793..673d59814ea 100644 --- a/backends/graphics/null/null-graphics.h +++ b/backends/graphics/null/null-graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_GRAPHICS_NULL_H diff --git a/backends/graphics/opengl/glerrorcheck.cpp b/backends/graphics/opengl/glerrorcheck.cpp index 9989a4cf9d8..682207c7ef7 100644 --- a/backends/graphics/opengl/glerrorcheck.cpp +++ b/backends/graphics/opengl/glerrorcheck.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/graphics/opengl/glerrorcheck.h b/backends/graphics/opengl/glerrorcheck.h index a94699ce1d3..2d5491bdfd1 100644 --- a/backends/graphics/opengl/glerrorcheck.h +++ b/backends/graphics/opengl/glerrorcheck.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(DEBUG) diff --git a/backends/graphics/opengl/gltexture.cpp b/backends/graphics/opengl/gltexture.cpp index 7b7d40f174d..3d1027b44fa 100644 --- a/backends/graphics/opengl/gltexture.cpp +++ b/backends/graphics/opengl/gltexture.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/graphics/opengl/gltexture.h b/backends/graphics/opengl/gltexture.h index 238b0354258..f0cd7aed569 100644 --- a/backends/graphics/opengl/gltexture.h +++ b/backends/graphics/opengl/gltexture.h @@ -18,11 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ +#include "common/scummsys.h" + #ifdef WIN32 #if defined(ARRAYSIZE) && !defined(_WINDOWS_) #undef ARRAYSIZE diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index b85cac809eb..32c0fbca6fc 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h index 1725817730c..daba7748bcb 100644 --- a/backends/graphics/opengl/opengl-graphics.h +++ b/backends/graphics/opengl/opengl-graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_GRAPHICS_OPENGL_H diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index fe86dd20982..3f9ffc9f3ef 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/graphics/openglsdl/openglsdl-graphics.h b/backends/graphics/openglsdl/openglsdl-graphics.h index e9e5ed882de..ba9f94db2d3 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.h +++ b/backends/graphics/openglsdl/openglsdl-graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_GRAPHICS_OPENGLSDL_H diff --git a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp new file mode 100644 index 00000000000..b929b5fe279 --- /dev/null +++ b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp @@ -0,0 +1,58 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "backends/platform/samsungtv/samsungtv.h" +#include "backends/events/samsungtvsdl/samsungtvsdl-events.h" +#include "backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h" + +#if defined(SAMSUNGTV) + +SamsungTVSdlGraphicsManager::SamsungTVSdlGraphicsManager(SdlEventSource *sdlEventSource) + : SdlGraphicsManager(sdlEventSource) { +} + +bool SamsungTVSdlGraphicsManager::hasFeature(OSystem::Feature f) { + return + (f == OSystem::kFeatureAspectRatioCorrection) || + (f == OSystem::kFeatureCursorHasPalette); +} + +void SamsungTVSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) { + switch (f) { + case OSystem::kFeatureAspectRatioCorrection: + SdlGraphicsManager::setFeatureState(f, enable); + break; + default: + break; + } +} + +bool SamsungTVSdlGraphicsManager::getFeatureState(OSystem::Feature f) { + switch (f) { + case OSystem::kFeatureAspectRatioCorrection: + return SdlGraphicsManager::getFeatureState(f); + default: + return false; + } +} + +#endif diff --git a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h new file mode 100644 index 00000000000..dc65c3a6963 --- /dev/null +++ b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h @@ -0,0 +1,41 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef BACKENDS_GRAPHICS_SAMSUNGTV_H +#define BACKENDS_GRAPHICS_SAMSUNGTV_H + +#if defined(SAMSUNGTV) + +#include "backends/graphics/sdl/sdl-graphics.h" + +class SamsungTVSdlGraphicsManager : public SdlGraphicsManager { +public: + SamsungTVSdlGraphicsManager(SdlEventSource *sdlEventSource); + + bool hasFeature(OSystem::Feature f); + void setFeatureState(OSystem::Feature f, bool enable); + bool getFeatureState(OSystem::Feature f); +}; + +#endif + +#endif diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp index 3ae9597f1cb..7a5b7770323 100644 --- a/backends/graphics/sdl/sdl-graphics.cpp +++ b/backends/graphics/sdl/sdl-graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/graphics/sdl/sdl-graphics.h b/backends/graphics/sdl/sdl-graphics.h index 4895b240b0c..86e52a0bf6f 100644 --- a/backends/graphics/sdl/sdl-graphics.h +++ b/backends/graphics/sdl/sdl-graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_GRAPHICS_SDL_H diff --git a/backends/graphics/symbiansdl/symbiansdl-graphics.cpp b/backends/graphics/symbiansdl/symbiansdl-graphics.cpp index d0c8728ce90..4d656cd7cdb 100644 --- a/backends/graphics/symbiansdl/symbiansdl-graphics.cpp +++ b/backends/graphics/symbiansdl/symbiansdl-graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/graphics/symbiansdl/symbiansdl-graphics.h b/backends/graphics/symbiansdl/symbiansdl-graphics.h index 54b871b2652..1bad32a9b62 100644 --- a/backends/graphics/symbiansdl/symbiansdl-graphics.h +++ b/backends/graphics/symbiansdl/symbiansdl-graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_GRAPHICS_SYMBIAN_SDL_H diff --git a/backends/graphics/wincesdl/wincesdl-graphics.cpp b/backends/graphics/wincesdl/wincesdl-graphics.cpp index b15f86e8fe8..80b04ca56d5 100644 --- a/backends/graphics/wincesdl/wincesdl-graphics.cpp +++ b/backends/graphics/wincesdl/wincesdl-graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" @@ -1163,16 +1160,16 @@ void WINCESdlGraphicsManager::adjustMouseEvent(const Common::Event &event) { if (!event.synthetic) { Common::Event newEvent(event); newEvent.synthetic = true; + /* if (!_overlayVisible) { - /* newEvent.mouse.x = newEvent.mouse.x * _scaleFactorXd / _scaleFactorXm; newEvent.mouse.y = newEvent.mouse.y * _scaleFactorYd / _scaleFactorYm; newEvent.mouse.x /= _videoMode.scaleFactor; newEvent.mouse.y /= _videoMode.scaleFactor; - */ if (_videoMode.aspectRatioCorrection) newEvent.mouse.y = aspect2Real(newEvent.mouse.y); } + */ g_system->getEventManager()->pushEvent(newEvent); } } diff --git a/backends/graphics/wincesdl/wincesdl-graphics.h b/backends/graphics/wincesdl/wincesdl-graphics.h index c8d683b158f..b3a8d66f51a 100644 --- a/backends/graphics/wincesdl/wincesdl-graphics.h +++ b/backends/graphics/wincesdl/wincesdl-graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_GRAPHICS_WINCE_SDL_H diff --git a/backends/keymapper/action.cpp b/backends/keymapper/action.cpp index aee4d803563..6ee506e7c37 100644 --- a/backends/keymapper/action.cpp +++ b/backends/keymapper/action.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "backends/keymapper/action.h" diff --git a/backends/keymapper/action.h b/backends/keymapper/action.h index 1ecc81757cf..b15b3aaaad5 100644 --- a/backends/keymapper/action.h +++ b/backends/keymapper/action.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef COMMON_ACTION_H diff --git a/backends/keymapper/hardware-key.h b/backends/keymapper/hardware-key.h index b6d9dbf0423..32df042525e 100644 --- a/backends/keymapper/hardware-key.h +++ b/backends/keymapper/hardware-key.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef COMMON_HARDWARE_KEY_H diff --git a/backends/keymapper/keymap.cpp b/backends/keymapper/keymap.cpp index 93581c622d8..1518cba6939 100644 --- a/backends/keymapper/keymap.cpp +++ b/backends/keymapper/keymap.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "backends/keymapper/keymap.h" diff --git a/backends/keymapper/keymap.h b/backends/keymapper/keymap.h index add417b1a1d..73f22936534 100644 --- a/backends/keymapper/keymap.h +++ b/backends/keymapper/keymap.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef COMMON_KEYMAP_H diff --git a/backends/keymapper/keymapper.cpp b/backends/keymapper/keymapper.cpp index 557900adc10..f5f29a29403 100644 --- a/backends/keymapper/keymapper.cpp +++ b/backends/keymapper/keymapper.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "backends/keymapper/keymapper.h" diff --git a/backends/keymapper/keymapper.h b/backends/keymapper/keymapper.h index 475bde64747..fcb444aa64a 100644 --- a/backends/keymapper/keymapper.h +++ b/backends/keymapper/keymapper.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef COMMON_KEYMAPPER_H diff --git a/backends/keymapper/remap-dialog.cpp b/backends/keymapper/remap-dialog.cpp index 8edc26a5267..7f2df2f0fec 100644 --- a/backends/keymapper/remap-dialog.cpp +++ b/backends/keymapper/remap-dialog.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "backends/keymapper/remap-dialog.h" diff --git a/backends/keymapper/remap-dialog.h b/backends/keymapper/remap-dialog.h index 5721d368a49..f587ae515d3 100644 --- a/backends/keymapper/remap-dialog.h +++ b/backends/keymapper/remap-dialog.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef REMAP_DIALOG_H diff --git a/backends/keymapper/types.h b/backends/keymapper/types.h index db3c33e490c..ed2e498bd0b 100644 --- a/backends/keymapper/types.h +++ b/backends/keymapper/types.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef KEYMAPPER_TYPES_H diff --git a/backends/log/log.cpp b/backends/log/log.cpp index 3ba1d67b16a..c02643b48b3 100644 --- a/backends/log/log.cpp +++ b/backends/log/log.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "backends/log/log.h" diff --git a/backends/log/log.h b/backends/log/log.h index b8691915418..8c95bfc4355 100644 --- a/backends/log/log.h +++ b/backends/log/log.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_LOG_LOG_H diff --git a/backends/midi/alsa.cpp b/backends/midi/alsa.cpp index bc8fab6a560..c006b6b6bf4 100644 --- a/backends/midi/alsa.cpp +++ b/backends/midi/alsa.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ // Disable symbol overrides so that we can use system headers. @@ -167,7 +164,7 @@ int MidiDriver_ALSA::open() { } printf("Connected to Alsa sequencer client [%d:%d]\n", seq_client, seq_port); - printf("ALSA client initialised [%d:0]\n", my_client); + printf("ALSA client initialized [%d:0]\n", my_client); return 0; } @@ -385,7 +382,7 @@ MusicDevices AlsaMusicPlugin::getDevices() const { AlsaDevices alsaDevices = getAlsaDevices(); - // Since the default behaviour is to use the first device in the list, + // Since the default behavior is to use the first device in the list, // try to put something sensible there. We used to have 17:0 and 65:0 // as defaults. diff --git a/backends/midi/camd.cpp b/backends/midi/camd.cpp index aafc7347f0f..88973488cae 100644 --- a/backends/midi/camd.cpp +++ b/backends/midi/camd.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ // Disable symbol overrides so that we can use system headers. diff --git a/backends/midi/coreaudio.cpp b/backends/midi/coreaudio.cpp index 52d32cb5e3f..305b4628366 100644 --- a/backends/midi/coreaudio.cpp +++ b/backends/midi/coreaudio.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ // Disable symbol overrides so that we can use system headers. diff --git a/backends/midi/coremidi.cpp b/backends/midi/coremidi.cpp index 87cd6307baa..1d61dceba24 100644 --- a/backends/midi/coremidi.cpp +++ b/backends/midi/coremidi.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ // Disable symbol overrides so that we can use system headers. diff --git a/backends/midi/dmedia.cpp b/backends/midi/dmedia.cpp index ba6d58d52d4..68e957f9aa8 100644 --- a/backends/midi/dmedia.cpp +++ b/backends/midi/dmedia.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ /* diff --git a/backends/midi/seq.cpp b/backends/midi/seq.cpp index b90a9b19e04..4efad9ceae9 100644 --- a/backends/midi/seq.cpp +++ b/backends/midi/seq.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ /* diff --git a/backends/midi/stmidi.cpp b/backends/midi/stmidi.cpp index 42f829a7a36..53302f8a809 100644 --- a/backends/midi/stmidi.cpp +++ b/backends/midi/stmidi.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ /* diff --git a/backends/midi/timidity.cpp b/backends/midi/timidity.cpp index 84d2846eda2..87cd08659ce 100644 --- a/backends/midi/timidity.cpp +++ b/backends/midi/timidity.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ /* diff --git a/backends/midi/windows.cpp b/backends/midi/windows.cpp index 292bbea79e0..828411cd22c 100644 --- a/backends/midi/windows.cpp +++ b/backends/midi/windows.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ // Disable symbol overrides so that we can use system headers. diff --git a/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp b/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp index 93c779ea5f1..526a01d1bff 100644 --- a/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp +++ b/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if defined(MACOSX) || defined(GP2X) || defined(CAANOO) || defined(GP2XWIZ) diff --git a/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h b/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h index 6304c287dfa..c95294e2c06 100644 --- a/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h +++ b/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_MIXER_DOUBLEBUFFERSDL_H diff --git a/backends/mixer/sdl/sdl-mixer.cpp b/backends/mixer/sdl/sdl-mixer.cpp index 90629954c58..16e7f22db5c 100644 --- a/backends/mixer/sdl/sdl-mixer.cpp +++ b/backends/mixer/sdl/sdl-mixer.cpp @@ -18,11 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ +#include "common/scummsys.h" + #if defined(SDL_BACKEND) #include "backends/mixer/sdl/sdl-mixer.h" diff --git a/backends/mixer/sdl/sdl-mixer.h b/backends/mixer/sdl/sdl-mixer.h index afb38f7f36d..5590c90ab3e 100644 --- a/backends/mixer/sdl/sdl-mixer.h +++ b/backends/mixer/sdl/sdl-mixer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_MIXER_SDL_H diff --git a/backends/mixer/symbiansdl/symbiansdl-mixer.cpp b/backends/mixer/symbiansdl/symbiansdl-mixer.cpp index ef81b464aca..b2462a1cdfa 100644 --- a/backends/mixer/symbiansdl/symbiansdl-mixer.cpp +++ b/backends/mixer/symbiansdl/symbiansdl-mixer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef __SYMBIAN32__ diff --git a/backends/mixer/symbiansdl/symbiansdl-mixer.h b/backends/mixer/symbiansdl/symbiansdl-mixer.h index 9164d95ba2e..e3104e45eb4 100644 --- a/backends/mixer/symbiansdl/symbiansdl-mixer.h +++ b/backends/mixer/symbiansdl/symbiansdl-mixer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_MIXER_SYMBIAN_SDL_H diff --git a/backends/mixer/wincesdl/wincesdl-mixer.cpp b/backends/mixer/wincesdl/wincesdl-mixer.cpp index 17cf0ced49e..36ac310ad96 100644 --- a/backends/mixer/wincesdl/wincesdl-mixer.cpp +++ b/backends/mixer/wincesdl/wincesdl-mixer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef _WIN32_WCE diff --git a/backends/mixer/wincesdl/wincesdl-mixer.h b/backends/mixer/wincesdl/wincesdl-mixer.h index 6c2f1efeee2..8274d39d1cf 100644 --- a/backends/mixer/wincesdl/wincesdl-mixer.h +++ b/backends/mixer/wincesdl/wincesdl-mixer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_MIXER_WINCE_SDL_H diff --git a/backends/modular-backend.cpp b/backends/modular-backend.cpp index b691250289b..c5f147ffe17 100644 --- a/backends/modular-backend.cpp +++ b/backends/modular-backend.cpp @@ -18,11 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ +#define FORBIDDEN_SYMBOL_EXCEPTION_exit + #include "backends/modular-backend.h" #include "backends/fs/fs-factory.h" @@ -280,3 +279,7 @@ FilesystemFactory *ModularBackend::getFilesystemFactory() { assert(_fsFactory); return _fsFactory; } + +void ModularBackend::quit() { + exit(0); +} diff --git a/backends/modular-backend.h b/backends/modular-backend.h index 863d9c2a81f..e46fbfdd214 100644 --- a/backends/modular-backend.h +++ b/backends/modular-backend.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_MODULAR_BACKEND_H @@ -151,8 +148,7 @@ public: virtual Common::SaveFileManager *getSavefileManager(); virtual FilesystemFactory *getFilesystemFactory(); - virtual void quit() { exit(0); } - virtual void setWindowCaption(const char *caption) {} + virtual void quit(); virtual void displayMessageOnOSD(const char *msg); //@} diff --git a/backends/module.mk b/backends/module.mk index c665b66e396..27058bef884 100644 --- a/backends/module.mk +++ b/backends/module.mk @@ -7,20 +7,19 @@ MODULE_OBJS := \ events/default/default-events.o \ fs/abstract-fs.o \ fs/stdiostream.o \ - graphics/opengl/glerrorcheck.o \ - graphics/opengl/gltexture.o \ - graphics/opengl/opengl-graphics.o \ - graphics/openglsdl/openglsdl-graphics.o \ - keymapper/action.o \ - keymapper/keymap.o \ - keymapper/keymapper.o \ - keymapper/remap-dialog.o \ log/log.o \ midi/alsa.o \ midi/dmedia.o \ midi/seq.o \ midi/stmidi.o \ midi/timidity.o \ + saves/savefile.o \ + saves/default/default-saves.o \ + timer/default/default-timer.o + + +ifdef USE_ELF_LOADER +MODULE_OBJS += \ plugins/elf/arm-loader.o \ plugins/elf/elf-loader.o \ plugins/elf/elf-provider.o \ @@ -28,23 +27,38 @@ MODULE_OBJS := \ plugins/elf/mips-loader.o \ plugins/elf/ppc-loader.o \ plugins/elf/shorts-segment-manager.o \ - plugins/elf/version.o \ - saves/savefile.o \ - saves/default/default-saves.o \ - timer/default/default-timer.o \ + plugins/elf/version.o +endif + +ifdef ENABLE_KEYMAPPER +MODULE_OBJS += \ + keymapper/action.o \ + keymapper/keymap.o \ + keymapper/keymapper.o \ + keymapper/remap-dialog.o +endif + +ifdef USE_OPENGL +MODULE_OBJS += \ + graphics/opengl/glerrorcheck.o \ + graphics/opengl/gltexture.o \ + graphics/opengl/opengl-graphics.o \ + graphics/openglsdl/openglsdl-graphics.o +endif + +ifdef ENABLE_VKEYBD +MODULE_OBJS += \ vkeybd/image-map.o \ vkeybd/polygon.o \ vkeybd/virtual-keyboard.o \ vkeybd/virtual-keyboard-gui.o \ vkeybd/virtual-keyboard-parser.o +endif # SDL specific source files. # We cannot just check $BACKEND = sdl, as various other backends # derive from the SDL backend, and they all need the following files. -# TODO: Add SDL_BACKEND to config.mk; this would match the fact that -# we also add -DSDL_BACKEND to the DEFINES. -# However, the latter is only done for *most* SDL based stuff, not always -# so we really should unify the relevant code in configure. +ifdef SDL_BACKEND MODULE_OBJS += \ audiocd/sdl/sdl-audiocd.o \ events/sdl/sdl-events.o \ @@ -54,8 +68,9 @@ MODULE_OBJS += \ mutex/sdl/sdl-mutex.o \ plugins/sdl/sdl-provider.o \ timer/sdl/sdl-timer.o +endif -ifdef UNIX +ifdef POSIX MODULE_OBJS += \ fs/posix/posix-fs.o \ fs/posix/posix-fs-factory.o \ @@ -147,9 +162,10 @@ MODULE_OBJS += \ timer/psp/timer.o endif -ifeq ($(BACKEND),samsungstv) +ifeq ($(BACKEND),samsungtv) MODULE_OBJS += \ - events/samsungtvsdl/samsungtvsdl-events.o + events/samsungtvsdl/samsungtvsdl-events.o \ + graphics/samsungtvsdl/samsungtvsdl-graphics.o endif ifeq ($(BACKEND),webos) @@ -163,7 +179,8 @@ MODULE_OBJS += \ fs/windows/windows-fs.o \ fs/windows/windows-fs-factory.o \ graphics/wincesdl/wincesdl-graphics.o \ - mixer/wincesdl/wincesdl-mixer.o + mixer/wincesdl/wincesdl-mixer.o \ + plugins/win32/win32-provider.o endif ifeq ($(BACKEND),wii) diff --git a/backends/mutex/mutex.h b/backends/mutex/mutex.h index ddf27d59321..9cc16c7a2ce 100644 --- a/backends/mutex/mutex.h +++ b/backends/mutex/mutex.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_MUTEX_ABSTRACT_H diff --git a/backends/mutex/null/null-mutex.h b/backends/mutex/null/null-mutex.h index 54b8f5ce968..fdb32b241cd 100644 --- a/backends/mutex/null/null-mutex.h +++ b/backends/mutex/null/null-mutex.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_MUTEX_NULL_H diff --git a/backends/mutex/sdl/sdl-mutex.cpp b/backends/mutex/sdl/sdl-mutex.cpp index 90fd4c1497a..8491ae468ce 100644 --- a/backends/mutex/sdl/sdl-mutex.cpp +++ b/backends/mutex/sdl/sdl-mutex.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/mutex/sdl/sdl-mutex.h b/backends/mutex/sdl/sdl-mutex.h index 88a19d398a7..914c2a19db2 100644 --- a/backends/mutex/sdl/sdl-mutex.h +++ b/backends/mutex/sdl/sdl-mutex.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_MUTEX_SDL_H diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp index b1d0727d1fa..eeeddb4c77f 100644 --- a/backends/platform/android/android.cpp +++ b/backends/platform/android/android.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if defined(__ANDROID__) diff --git a/backends/platform/android/android.h b/backends/platform/android/android.h index 109d252a992..752a31a4dbf 100644 --- a/backends/platform/android/android.h +++ b/backends/platform/android/android.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef _ANDROID_H_ diff --git a/backends/platform/android/asset-archive.cpp b/backends/platform/android/asset-archive.cpp index 7c21b35281e..fe52a3d8d4d 100644 --- a/backends/platform/android/asset-archive.cpp +++ b/backends/platform/android/asset-archive.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if defined(__ANDROID__) diff --git a/backends/platform/android/asset-archive.h b/backends/platform/android/asset-archive.h index 6ec86e4cd0b..016e3e31a59 100644 --- a/backends/platform/android/asset-archive.h +++ b/backends/platform/android/asset-archive.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef _ANDROID_ASSET_H_ diff --git a/backends/platform/android/events.cpp b/backends/platform/android/events.cpp index 0d74e1c5242..cf1d4b173cd 100644 --- a/backends/platform/android/events.cpp +++ b/backends/platform/android/events.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if defined(__ANDROID__) diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp index ebce58e291c..89e918a34e9 100644 --- a/backends/platform/android/gfx.cpp +++ b/backends/platform/android/gfx.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if defined(__ANDROID__) @@ -182,7 +179,7 @@ void OSystem_Android::initSurface() { JNI::initSurface(); - // Initialise OpenGLES context. + // Initialize OpenGLES context. GLESTexture::initGLExtensions(); if (_game_texture) diff --git a/backends/platform/android/jni.cpp b/backends/platform/android/jni.cpp index 13aef11fa2d..c4daf24e16f 100644 --- a/backends/platform/android/jni.cpp +++ b/backends/platform/android/jni.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if defined(__ANDROID__) diff --git a/backends/platform/android/jni.h b/backends/platform/android/jni.h index d029f1a2a87..1abecf0a375 100644 --- a/backends/platform/android/jni.h +++ b/backends/platform/android/jni.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef _ANDROID_JNI_H_ diff --git a/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java b/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java index c4de6d62f8c..ef9f4cc1e0e 100644 --- a/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java +++ b/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java @@ -260,7 +260,7 @@ public abstract class ScummVM implements SurfaceHolder.Callback, Runnable { if (_audio_track.getState() != AudioTrack.STATE_INITIALIZED) throw new Exception( - String.format("Error initialising AudioTrack: %d", + String.format("Error initializing AudioTrack: %d", _audio_track.getState())); } diff --git a/backends/platform/android/texture.cpp b/backends/platform/android/texture.cpp index c830676c071..e993ed67944 100644 --- a/backends/platform/android/texture.cpp +++ b/backends/platform/android/texture.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if defined(__ANDROID__) diff --git a/backends/platform/android/texture.h b/backends/platform/android/texture.h index 63443262599..dd34ba9d88a 100644 --- a/backends/platform/android/texture.h +++ b/backends/platform/android/texture.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef _ANDROID_TEXTURE_H_ diff --git a/backends/platform/dc/DCLauncherDialog.h b/backends/platform/dc/DCLauncherDialog.h index 0ac7971847d..72df3e15cc9 100644 --- a/backends/platform/dc/DCLauncherDialog.h +++ b/backends/platform/dc/DCLauncherDialog.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ class DCLauncherDialog { diff --git a/backends/platform/dc/Makefile b/backends/platform/dc/Makefile index 11d9421a0ae..0133ffd9e95 100644 --- a/backends/platform/dc/Makefile +++ b/backends/platform/dc/Makefile @@ -1,5 +1,3 @@ -# $URL$ -# $Id$ ronindir = /usr/local/ronin diff --git a/backends/platform/dc/audio.cpp b/backends/platform/dc/audio.cpp index ae63186d8c6..1fee970a909 100644 --- a/backends/platform/dc/audio.cpp +++ b/backends/platform/dc/audio.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/backends/platform/dc/dc-fs.cpp b/backends/platform/dc/dc-fs.cpp index a024b5d70db..16547456c3a 100644 --- a/backends/platform/dc/dc-fs.cpp +++ b/backends/platform/dc/dc-fs.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h index 060eff2b484..e31b817d7c0 100644 --- a/backends/platform/dc/dc.h +++ b/backends/platform/dc/dc.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "backends/base-backend.h" @@ -56,7 +53,7 @@ class DCHardware { }; class DCCDManager : public DefaultAudioCDManager { - // Initialise the specified CD drive for audio playback. + // Initialize the specified CD drive for audio playback. bool openCD(int drive); // Poll cdrom status diff --git a/backends/platform/dc/dcloader.cpp b/backends/platform/dc/dcloader.cpp index db0160b953a..675f7ad8c77 100644 --- a/backends/platform/dc/dcloader.cpp +++ b/backends/platform/dc/dcloader.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/backends/platform/dc/dcloader.h b/backends/platform/dc/dcloader.h index 95b1376b0f5..1782467acd7 100644 --- a/backends/platform/dc/dcloader.h +++ b/backends/platform/dc/dcloader.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DC_DCLOADER_H diff --git a/backends/platform/dc/dcmain.cpp b/backends/platform/dc/dcmain.cpp index a3a12001785..dfce176e90b 100644 --- a/backends/platform/dc/dcmain.cpp +++ b/backends/platform/dc/dcmain.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Allow use of stuff in diff --git a/backends/platform/dc/display.cpp b/backends/platform/dc/display.cpp index 78fa2182dc6..56eef870c03 100644 --- a/backends/platform/dc/display.cpp +++ b/backends/platform/dc/display.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #define RONIN_TIMER_ACCESS diff --git a/backends/platform/dc/dreamcast.mk b/backends/platform/dc/dreamcast.mk index 666e03eecef..9d8a53e25a0 100644 --- a/backends/platform/dc/dreamcast.mk +++ b/backends/platform/dc/dreamcast.mk @@ -1,5 +1,3 @@ -# $URL$ -# $Id$ ronindir = /usr/local/ronin diff --git a/backends/platform/dc/icon.cpp b/backends/platform/dc/icon.cpp index dc19214bed0..cf7afc82e0b 100644 --- a/backends/platform/dc/icon.cpp +++ b/backends/platform/dc/icon.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/backends/platform/dc/icon.h b/backends/platform/dc/icon.h index 41ff2da5fa1..e412e67a844 100644 --- a/backends/platform/dc/icon.h +++ b/backends/platform/dc/icon.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DC_ICON_H diff --git a/backends/platform/dc/input.cpp b/backends/platform/dc/input.cpp index 5d4ed7ce961..7054ad196e0 100644 --- a/backends/platform/dc/input.cpp +++ b/backends/platform/dc/input.cpp @@ -18,11 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ +#define FORBIDDEN_SYMBOL_ALLOW_ALL + #define RONIN_TIMER_ACCESS #include diff --git a/backends/platform/dc/label.cpp b/backends/platform/dc/label.cpp index 5ad75cd20d3..1094dd3fb48 100644 --- a/backends/platform/dc/label.cpp +++ b/backends/platform/dc/label.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/backends/platform/dc/label.h b/backends/platform/dc/label.h index 776a660a84c..6b96175d29f 100644 --- a/backends/platform/dc/label.h +++ b/backends/platform/dc/label.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DC_LABEL_H diff --git a/backends/platform/dc/plugins.cpp b/backends/platform/dc/plugins.cpp index 44b89605134..fff3c147eca 100644 --- a/backends/platform/dc/plugins.cpp +++ b/backends/platform/dc/plugins.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/platform/dc/portdefs.h b/backends/platform/dc/portdefs.h index eaebc0f7dae..ca2b5208a35 100644 --- a/backends/platform/dc/portdefs.h +++ b/backends/platform/dc/portdefs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/backends/platform/dc/selector.cpp b/backends/platform/dc/selector.cpp index 77f34394a12..859f2a40edb 100644 --- a/backends/platform/dc/selector.cpp +++ b/backends/platform/dc/selector.cpp @@ -18,12 +18,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ -#define FORBIDDEN_SYMBOL_EXCEPTION_chdir +#define FORBIDDEN_SYMBOL_ALLOW_ALL #include #include diff --git a/backends/platform/dc/softkbd.cpp b/backends/platform/dc/softkbd.cpp index 112eb0c1c0e..076f826d1ce 100644 --- a/backends/platform/dc/softkbd.cpp +++ b/backends/platform/dc/softkbd.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/backends/platform/dc/softkbd.h b/backends/platform/dc/softkbd.h index bedb9baacad..8f87d12baae 100644 --- a/backends/platform/dc/softkbd.h +++ b/backends/platform/dc/softkbd.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DC_SOFTKBD_H diff --git a/backends/platform/dc/time.cpp b/backends/platform/dc/time.cpp index c87062d5835..c343852321f 100644 --- a/backends/platform/dc/time.cpp +++ b/backends/platform/dc/time.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #define RONIN_TIMER_ACCESS diff --git a/backends/platform/dc/vmsave.cpp b/backends/platform/dc/vmsave.cpp index 63e345efbe3..f18f69efa66 100644 --- a/backends/platform/dc/vmsave.cpp +++ b/backends/platform/dc/vmsave.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Allow use of stuff in diff --git a/backends/platform/dingux/dingux.cpp b/backends/platform/dingux/dingux.cpp index 89a403d5aef..1af53aeae1e 100644 --- a/backends/platform/dingux/dingux.cpp +++ b/backends/platform/dingux/dingux.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if defined(DINGUX) diff --git a/backends/platform/dingux/dingux.h b/backends/platform/dingux/dingux.h index 2db2272f4f2..2a07a8a46a8 100644 --- a/backends/platform/dingux/dingux.h +++ b/backends/platform/dingux/dingux.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SDL_DINGUX_COMMON_H diff --git a/backends/platform/dingux/main.cpp b/backends/platform/dingux/main.cpp index cf25e1cb421..4fc67d874f6 100644 --- a/backends/platform/dingux/main.cpp +++ b/backends/platform/dingux/main.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "backends/platform/dingux/dingux.h" diff --git a/backends/platform/dingux/module.mk b/backends/platform/dingux/module.mk index 2247625a044..b924fec1cfb 100644 --- a/backends/platform/dingux/module.mk +++ b/backends/platform/dingux/module.mk @@ -4,8 +4,10 @@ MODULE_OBJS := \ main.o \ dingux.o -MODULE_DIRS += \ - backends/platform/dingux/ +# We don't use rules.mk but rather manually update OBJS and MODULE_DIRS. +MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) +OBJS := $(MODULE_OBJS) $(OBJS) +MODULE_DIRS += $(sort $(dir $(MODULE_OBJS))) -# We don't use the rules.mk here on purpose -OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) $(OBJS) +# Hack to ensure the SDL backend is built so we can use OSystem_SDL. +-include $(srcdir)/backends/platform/sdl/module.mk diff --git a/backends/platform/ds/arm7/source/main.cpp b/backends/platform/ds/arm7/source/main.cpp index bcaaf8e9369..6b5a0ec321a 100644 --- a/backends/platform/ds/arm7/source/main.cpp +++ b/backends/platform/ds/arm7/source/main.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ ////////////////////////////////////////////////////////////////////// diff --git a/backends/platform/ds/arm9/dist/readme_ds.txt b/backends/platform/ds/arm9/dist/readme_ds.txt index ee1db719f45..24c85ad556b 100644 --- a/backends/platform/ds/arm9/dist/readme_ds.txt +++ b/backends/platform/ds/arm9/dist/readme_ds.txt @@ -679,7 +679,7 @@ not supported. Cdex can do the conversion very well and I recommend using it to convert your audio files, although any CD ripping software can be used, so feel -free to use your favourite program. The format you need to use is +free to use your favorite program. The format you need to use is IMA-ADPCM 4-bit Mono. You may use any sample rate. All other formats will be rejected, including uncompressed WAV files. diff --git a/backends/platform/ds/arm9/makefile b/backends/platform/ds/arm9/makefile index 781738265cf..65fb98ee0dc 100644 --- a/backends/platform/ds/arm9/makefile +++ b/backends/platform/ds/arm9/makefile @@ -245,7 +245,7 @@ ifdef USE_MAD DEFINES += -DUSE_MAD endif -DEFINES += -DREDUCE_MEMORY_USAGE -DDISABLE_DEBUGGER -DUSE_TEXT_CONSOLE -DDISABLE_MASS_ADD -DDISABLE_NES_APU +DEFINES += -DREDUCE_MEMORY_USAGE -DDISABLE_DEBUGGER -DUSE_TEXT_CONSOLE_FOR_DEBUGGER -DDISABLE_MASS_ADD -DDISABLE_NES_APU LDFLAGS = -specs=ds_arm9.specs -mthumb-interwork -mno-fpu -Wl,-Map,map.txt -Wl,--gc-sections diff --git a/backends/platform/ds/arm9/source/adpcm_arm.s b/backends/platform/ds/arm9/source/adpcm_arm.s index 56ffc360e88..4715346cb9c 100644 --- a/backends/platform/ds/arm9/source/adpcm_arm.s +++ b/backends/platform/ds/arm9/source/adpcm_arm.s @@ -18,9 +18,6 @@ @ along with this program@ if not, write to the Free Software @ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @ -@ $URL$ -@ $Id$ -@ @ @author Robin Watts (robin@wss.co.uk) .global ARM_adpcm diff --git a/backends/platform/ds/arm9/source/blitters.cpp b/backends/platform/ds/arm9/source/blitters.cpp index 5d29672ef60..0076b302fd9 100644 --- a/backends/platform/ds/arm9/source/blitters.cpp +++ b/backends/platform/ds/arm9/source/blitters.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "blitters.h" diff --git a/backends/platform/ds/arm9/source/blitters.h b/backends/platform/ds/arm9/source/blitters.h index 88506a44056..7700b4d68d7 100644 --- a/backends/platform/ds/arm9/source/blitters.h +++ b/backends/platform/ds/arm9/source/blitters.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef _BLITTERS_H_ diff --git a/backends/platform/ds/arm9/source/blitters_arm.s b/backends/platform/ds/arm9/source/blitters_arm.s index aac39cc3297..a5e071f7dd3 100644 --- a/backends/platform/ds/arm9/source/blitters_arm.s +++ b/backends/platform/ds/arm9/source/blitters_arm.s @@ -18,9 +18,6 @@ @ along with this program@ if not, write to the Free Software @ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @ -@ $URL$ -@ $Id$ -@ @ @author Robin Watts (robin@wss.co.uk) @ .global timerTickHandler diff --git a/backends/platform/ds/arm9/source/cdaudio.cpp b/backends/platform/ds/arm9/source/cdaudio.cpp index a69aedc91de..6612e0f2daa 100644 --- a/backends/platform/ds/arm9/source/cdaudio.cpp +++ b/backends/platform/ds/arm9/source/cdaudio.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides for FILE as that is used in FLAC headers diff --git a/backends/platform/ds/arm9/source/cdaudio.h b/backends/platform/ds/arm9/source/cdaudio.h index 7a85c97dbd8..fc16f2f2200 100644 --- a/backends/platform/ds/arm9/source/cdaudio.h +++ b/backends/platform/ds/arm9/source/cdaudio.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef _CDAUDIO_H_ diff --git a/backends/platform/ds/arm9/source/dsmain.cpp b/backends/platform/ds/arm9/source/dsmain.cpp index 303e5048739..b3146cc16f3 100644 --- a/backends/platform/ds/arm9/source/dsmain.cpp +++ b/backends/platform/ds/arm9/source/dsmain.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -71,8 +68,7 @@ // - Try discworld? -// Disable symbol overrides for FILE -#define FORBIDDEN_SYMBOL_EXCEPTION_FILE +#define FORBIDDEN_SYMBOL_ALLOW_ALL diff --git a/backends/platform/ds/arm9/source/dsmain.h b/backends/platform/ds/arm9/source/dsmain.h index bd627fa620c..9c0d3262922 100644 --- a/backends/platform/ds/arm9/source/dsmain.h +++ b/backends/platform/ds/arm9/source/dsmain.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef _DSMAIN_H diff --git a/backends/platform/ds/arm9/source/dsoptions.cpp b/backends/platform/ds/arm9/source/dsoptions.cpp index a693d2aee32..263ca58705e 100644 --- a/backends/platform/ds/arm9/source/dsoptions.cpp +++ b/backends/platform/ds/arm9/source/dsoptions.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "dsoptions.h" diff --git a/backends/platform/ds/arm9/source/dsoptions.h b/backends/platform/ds/arm9/source/dsoptions.h index 8ba8e6e4da7..9148060f4b7 100644 --- a/backends/platform/ds/arm9/source/dsoptions.h +++ b/backends/platform/ds/arm9/source/dsoptions.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef _DSOPTIONS_H_ diff --git a/backends/platform/ds/arm9/source/fat/gba_nds_fat.c b/backends/platform/ds/arm9/source/fat/gba_nds_fat.c index 698590418c3..76508a16647 100644 --- a/backends/platform/ds/arm9/source/fat/gba_nds_fat.c +++ b/backends/platform/ds/arm9/source/fat/gba_nds_fat.c @@ -1010,7 +1010,7 @@ DIR_ENT FAT_GetDirEntry ( u32 dirCluster, int entry, int origin) dir.name[0] = FILE_FREE; // default to no file found dir.attrib = 0x00; - // Check if fat has been initialised + // Check if fat has been initialized if (filesysBytePerSec == 0) { return (dir); diff --git a/backends/platform/ds/arm9/source/gbampsave.cpp b/backends/platform/ds/arm9/source/gbampsave.cpp index 462138d3350..db9b1c26094 100644 --- a/backends/platform/ds/arm9/source/gbampsave.cpp +++ b/backends/platform/ds/arm9/source/gbampsave.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides for FILE diff --git a/backends/platform/ds/arm9/source/gbampsave.h b/backends/platform/ds/arm9/source/gbampsave.h index caac0c0b289..492054dc529 100644 --- a/backends/platform/ds/arm9/source/gbampsave.h +++ b/backends/platform/ds/arm9/source/gbampsave.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef _GBAMPSAVE_H_ diff --git a/backends/platform/ds/arm9/source/keys.h b/backends/platform/ds/arm9/source/keys.h index 8d080142322..71c770dcd53 100644 --- a/backends/platform/ds/arm9/source/keys.h +++ b/backends/platform/ds/arm9/source/keys.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h index b745b4dc6ec..4ab2e36322f 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.h +++ b/backends/platform/ds/arm9/source/osystem_ds.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/backends/platform/ds/arm9/source/portdefs.h b/backends/platform/ds/arm9/source/portdefs.h index ad36503e832..f512ce3ea25 100644 --- a/backends/platform/ds/arm9/source/portdefs.h +++ b/backends/platform/ds/arm9/source/portdefs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef _PORTDEFS_H_ @@ -29,8 +26,11 @@ // Include ndstypes.h for uint16 etc. typedefs #include "nds/ndstypes.h" -// Somebody removed these from scummsys.h, but they're still required, so I'm -// adding them here in the hope that they'll stay. +// Define SCUMMVM_DONT_DEFINE_TYPES to prevent scummsys.h from trying to +// re-define those data types. +#define SCUMMVM_DONT_DEFINE_TYPES + +// Include required headers #include #include #include diff --git a/backends/platform/ds/arm9/source/scummhelp.cpp b/backends/platform/ds/arm9/source/scummhelp.cpp index f1e8ba4fb2c..670b46a3b96 100644 --- a/backends/platform/ds/arm9/source/scummhelp.cpp +++ b/backends/platform/ds/arm9/source/scummhelp.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scummhelp.h" diff --git a/backends/platform/ds/arm9/source/scummhelp.h b/backends/platform/ds/arm9/source/scummhelp.h index 4be28dca6a9..79103b35eda 100644 --- a/backends/platform/ds/arm9/source/scummhelp.h +++ b/backends/platform/ds/arm9/source/scummhelp.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef _SCUMMHELP_H_ diff --git a/backends/platform/ds/arm9/source/touchkeyboard.h b/backends/platform/ds/arm9/source/touchkeyboard.h index 7644e48bff7..ae056e84da1 100644 --- a/backends/platform/ds/arm9/source/touchkeyboard.h +++ b/backends/platform/ds/arm9/source/touchkeyboard.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef _TOUCHKEYBOARD_H_ diff --git a/backends/platform/ds/arm9/source/wordcompletion.cpp b/backends/platform/ds/arm9/source/wordcompletion.cpp index a4fc2aed77f..5f3b80c474e 100644 --- a/backends/platform/ds/arm9/source/wordcompletion.cpp +++ b/backends/platform/ds/arm9/source/wordcompletion.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "wordcompletion.h" diff --git a/backends/platform/ds/arm9/source/wordcompletion.h b/backends/platform/ds/arm9/source/wordcompletion.h index 55a0bc8b5a2..3d352f657ad 100644 --- a/backends/platform/ds/arm9/source/wordcompletion.h +++ b/backends/platform/ds/arm9/source/wordcompletion.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ namespace DS { diff --git a/backends/platform/ds/arm9/source/zipreader.cpp b/backends/platform/ds/arm9/source/zipreader.cpp index d4f055ee826..49552a86b2b 100644 --- a/backends/platform/ds/arm9/source/zipreader.cpp +++ b/backends/platform/ds/arm9/source/zipreader.cpp @@ -18,11 +18,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ +#define FORBIDDEN_SYMBOL_ALLOW_ALL #include "common/scummsys.h" #include "zipreader.h" diff --git a/backends/platform/ds/arm9/source/zipreader.h b/backends/platform/ds/arm9/source/zipreader.h index 5429954088c..70f000eb4bb 100644 --- a/backends/platform/ds/arm9/source/zipreader.h +++ b/backends/platform/ds/arm9/source/zipreader.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef _ZIPREADER_H_ diff --git a/backends/platform/ds/commoninclude/NDS/scummvm_ipc.h b/backends/platform/ds/commoninclude/NDS/scummvm_ipc.h index cf6436634af..360b7b03dcf 100644 --- a/backends/platform/ds/commoninclude/NDS/scummvm_ipc.h +++ b/backends/platform/ds/commoninclude/NDS/scummvm_ipc.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SCUMMVM_IPC_INCLUDE diff --git a/backends/platform/gp2x/gp2x-common.h b/backends/platform/gp2x/gp2x-common.h index 2a06cab7887..7efdd7164ca 100644 --- a/backends/platform/gp2x/gp2x-common.h +++ b/backends/platform/gp2x/gp2x-common.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PLATFORM_SDL_GP2X_H diff --git a/backends/platform/gp2x/gp2x-hw.cpp b/backends/platform/gp2x/gp2x-hw.cpp index 8818ff9fe9b..074c668b5f4 100644 --- a/backends/platform/gp2x/gp2x-hw.cpp +++ b/backends/platform/gp2x/gp2x-hw.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/backends/platform/gp2x/gp2x-hw.h b/backends/platform/gp2x/gp2x-hw.h index 872c44f118a..3c66400124f 100644 --- a/backends/platform/gp2x/gp2x-hw.h +++ b/backends/platform/gp2x/gp2x-hw.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/backends/platform/gp2x/gp2x-mem.cpp b/backends/platform/gp2x/gp2x-mem.cpp index 0968087cfd4..8d22bf81304 100644 --- a/backends/platform/gp2x/gp2x-mem.cpp +++ b/backends/platform/gp2x/gp2x-mem.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/backends/platform/gp2x/gp2x-mem.h b/backends/platform/gp2x/gp2x-mem.h index aa49444164c..b2cd00a587e 100644 --- a/backends/platform/gp2x/gp2x-mem.h +++ b/backends/platform/gp2x/gp2x-mem.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/backends/platform/gp2x/gp2x.cpp b/backends/platform/gp2x/gp2x.cpp index 4cdb4cd0d5d..0e28a6b7381 100644 --- a/backends/platform/gp2x/gp2x.cpp +++ b/backends/platform/gp2x/gp2x.cpp @@ -125,7 +125,7 @@ void OSystem_GP2X::initBackend() { ConfMan.setBool("FM_low_quality", true); - /* Initialise any GP2X specific stuff we may want (Batt Status, scaler etc.) */ + /* Initialize any GP2X specific stuff we may want (Batt Status, scaler etc.) */ GP2X_HW::deviceInit(); /* Set Default hardware mixer volume to a preset level (VOLUME_INITIAL). This is done to 'reset' volume level if set by other apps. */ diff --git a/backends/platform/gp2x/module.mk b/backends/platform/gp2x/module.mk index 837ad99d7bb..4846f162cbe 100644 --- a/backends/platform/gp2x/module.mk +++ b/backends/platform/gp2x/module.mk @@ -10,3 +10,6 @@ MODULE_OBJS := \ MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) OBJS := $(MODULE_OBJS) $(OBJS) MODULE_DIRS += $(sort $(dir $(MODULE_OBJS))) + +# Hack to ensure the SDL backend is built so we can use OSystem_SDL. +-include $(srcdir)/backends/platform/sdl/module.mk diff --git a/backends/platform/gph/devices/gp2x/mmuhack/mmuhack.c b/backends/platform/gph/devices/gp2x/mmuhack/mmuhack.c index 7e27262e5f1..2e38bdb2846 100644 --- a/backends/platform/gph/devices/gp2x/mmuhack/mmuhack.c +++ b/backends/platform/gph/devices/gp2x/mmuhack/mmuhack.c @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/backends/platform/gph/gph-backend.cpp b/backends/platform/gph/gph-backend.cpp index 375ee373786..cb52da441da 100644 --- a/backends/platform/gph/gph-backend.cpp +++ b/backends/platform/gph/gph-backend.cpp @@ -141,7 +141,7 @@ void OSystem_GPH::initBackend() { printf("%s\n", "Debug: STDOUT and STDERR redirected to text files."); #endif /* DUMP_STDOUT */ - /* Initialise any GP2X Wiz specific stuff we may want (Batt Status, scaler etc.) */ + /* Initialize any GP2X Wiz specific stuff we may want (Batt Status, scaler etc.) */ WIZ_HW::deviceInit(); /* Set Default hardware mixer volume to a preset level (VOLUME_INITIAL). This is done to 'reset' volume level if set by other apps. */ diff --git a/backends/platform/gph/gph-hw.cpp b/backends/platform/gph/gph-hw.cpp index fa52526f017..2d701580012 100644 --- a/backends/platform/gph/gph-hw.cpp +++ b/backends/platform/gph/gph-hw.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/backends/platform/gph/gph-hw.h b/backends/platform/gph/gph-hw.h index 7276276608a..0a1205156b1 100644 --- a/backends/platform/gph/gph-hw.h +++ b/backends/platform/gph/gph-hw.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/backends/platform/gph/module.mk b/backends/platform/gph/module.mk index a9951494d1c..d8a1a6cd8db 100644 --- a/backends/platform/gph/module.mk +++ b/backends/platform/gph/module.mk @@ -11,4 +11,4 @@ OBJS := $(MODULE_OBJS) $(OBJS) MODULE_DIRS += $(sort $(dir $(MODULE_OBJS))) # Hack to ensure the SDL backend is built so we can use OSystem_SDL. --include $(srcdir)/backends/platform/sdl/module.mk \ No newline at end of file +-include $(srcdir)/backends/platform/sdl/module.mk diff --git a/backends/platform/iphone/blit.cpp b/backends/platform/iphone/blit.cpp index c28f931983e..58de22bf754 100644 --- a/backends/platform/iphone/blit.cpp +++ b/backends/platform/iphone/blit.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/platform/iphone/blit_arm.h b/backends/platform/iphone/blit_arm.h index 2a363630d88..77bb3578ab2 100644 --- a/backends/platform/iphone/blit_arm.h +++ b/backends/platform/iphone/blit_arm.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ extern "C" void blitLandscapeScreenRect16bpp(uint16 *dst, uint16 *src, diff --git a/backends/platform/iphone/blit_arm.s b/backends/platform/iphone/blit_arm.s index 417f3741cfd..04f9a876149 100644 --- a/backends/platform/iphone/blit_arm.s +++ b/backends/platform/iphone/blit_arm.s @@ -18,9 +18,6 @@ @ along with this program@ if not, write to the Free Software @ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @ -@ $URL$ -@ $Id$ -@ @ @author Robin Watts (robin@wss.co.uk) .text diff --git a/backends/platform/iphone/iphone_common.h b/backends/platform/iphone/iphone_common.h index 7c7770f4435..0cbcb77bcb0 100644 --- a/backends/platform/iphone/iphone_common.h +++ b/backends/platform/iphone/iphone_common.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/backends/platform/iphone/iphone_keyboard.h b/backends/platform/iphone/iphone_keyboard.h index 5c17cc34b88..eecad093988 100644 --- a/backends/platform/iphone/iphone_keyboard.h +++ b/backends/platform/iphone/iphone_keyboard.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #import diff --git a/backends/platform/iphone/iphone_keyboard.m b/backends/platform/iphone/iphone_keyboard.m index 53c73767454..1624d029772 100644 --- a/backends/platform/iphone/iphone_keyboard.m +++ b/backends/platform/iphone/iphone_keyboard.m @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #import "iphone_keyboard.h" diff --git a/backends/platform/iphone/iphone_main.m b/backends/platform/iphone/iphone_main.m index 1fb2cc37889..7bb5f0c317b 100644 --- a/backends/platform/iphone/iphone_main.m +++ b/backends/platform/iphone/iphone_main.m @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #import diff --git a/backends/platform/iphone/iphone_video.h b/backends/platform/iphone/iphone_video.h index aed15ecfd5d..8e0ffc19cba 100644 --- a/backends/platform/iphone/iphone_video.h +++ b/backends/platform/iphone/iphone_video.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef _IPHONE_VIDEO__H diff --git a/backends/platform/iphone/iphone_video.m b/backends/platform/iphone/iphone_video.m index 821d3de6340..006603df640 100644 --- a/backends/platform/iphone/iphone_video.m +++ b/backends/platform/iphone/iphone_video.m @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "iphone_video.h" @@ -178,13 +175,18 @@ const char* iPhone_getDocumentsDir() { } bool getLocalMouseCoords(CGPoint *point) { - if (point->x < _screenRect.origin.x || point->x >= _screenRect.origin.x + _screenRect.size.width || - point->y < _screenRect.origin.y || point->y >= _screenRect.origin.y + _screenRect.size.height) { - return false; - } + if (_overlayIsEnabled) { + point->x = point->x / _overlayHeight; + point->y = point->y / _overlayWidth; + } else { + if (point->x < _screenRect.origin.x || point->x >= _screenRect.origin.x + _screenRect.size.width || + point->y < _screenRect.origin.y || point->y >= _screenRect.origin.y + _screenRect.size.height) { + return false; + } - point->x = (point->x - _screenRect.origin.x) / _screenRect.size.width; - point->y = (point->y - _screenRect.origin.y) / _screenRect.size.height; + point->x = (point->x - _screenRect.origin.x) / _screenRect.size.width; + point->y = (point->y - _screenRect.origin.y) / _screenRect.size.height; + } return true; } diff --git a/backends/platform/iphone/osys_events.cpp b/backends/platform/iphone/osys_events.cpp index c30e34dd058..6e2a4b7e1e6 100644 --- a/backends/platform/iphone/osys_events.cpp +++ b/backends/platform/iphone/osys_events.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. @@ -31,6 +28,7 @@ #include "osys_main.h" +static const int kQueuedInputEventDelay = 50; bool OSystem_IPHONE::pollEvent(Common::Event &event) { //printf("pollEvent()\n"); @@ -42,14 +40,7 @@ bool OSystem_IPHONE::pollEvent(Common::Event &event) { _timerCallbackNext = curTime + _timerCallbackTimer; } - if (_needEventRestPeriod) { - // Workaround: Some engines can't handle mouse-down and mouse-up events - // appearing right after each other, without a call returning no input in between. - _needEventRestPeriod = false; - return false; - } - - if (_queuedInputEvent.type != (Common::EventType)0) { + if (_queuedInputEvent.type != (Common::EventType)0 && curTime >= _queuedEventTime) { event = _queuedInputEvent; _queuedInputEvent.type = (Common::EventType)0; return true; @@ -194,7 +185,7 @@ bool OSystem_IPHONE::handleEvent_mouseUp(Common::Event &event, int x, int y) { _queuedInputEvent.mouse.x = _mouseX; _queuedInputEvent.mouse.y = _mouseY; _lastMouseTap = getMillis(); - _needEventRestPeriod = true; + _queuedEventTime = _lastMouseTap + kQueuedInputEventDelay; } else return false; } @@ -235,7 +226,7 @@ bool OSystem_IPHONE::handleEvent_secondMouseUp(Common::Event &event, int x, int event.kbd.flags = _queuedInputEvent.kbd.flags = 0; event.kbd.keycode = _queuedInputEvent.kbd.keycode = Common::KEYCODE_ESCAPE; event.kbd.ascii = _queuedInputEvent.kbd.ascii = Common::ASCII_ESCAPE; - _needEventRestPeriod = true; + _queuedEventTime = curTime + kQueuedInputEventDelay; _lastSecondaryTap = 0; } else if (!_mouseClickAndDragEnabled) { //printf("Rightclick!\n"); @@ -246,7 +237,7 @@ bool OSystem_IPHONE::handleEvent_secondMouseUp(Common::Event &event, int x, int _queuedInputEvent.mouse.x = _mouseX; _queuedInputEvent.mouse.y = _mouseY; _lastSecondaryTap = curTime; - _needEventRestPeriod = true; + _queuedEventTime = curTime + kQueuedInputEventDelay; } else { //printf("Right nothing!\n"); return false; @@ -334,7 +325,7 @@ bool OSystem_IPHONE::handleEvent_mouseSecondDragged(Common::Event &event, int x, event.kbd.flags = _queuedInputEvent.kbd.flags = 0; event.kbd.keycode = _queuedInputEvent.kbd.keycode = Common::KEYCODE_F5; event.kbd.ascii = _queuedInputEvent.kbd.ascii = Common::ASCII_F5; - _needEventRestPeriod = true; + _queuedEventTime = getMillis() + kQueuedInputEventDelay; return true; } @@ -463,7 +454,7 @@ void OSystem_IPHONE::handleEvent_keyPressed(Common::Event &event, int keyPresse event.kbd.flags = _queuedInputEvent.kbd.flags = 0; event.kbd.keycode = _queuedInputEvent.kbd.keycode = (Common::KeyCode)keyPressed; event.kbd.ascii = _queuedInputEvent.kbd.ascii = ascii; - _needEventRestPeriod = true; + _queuedEventTime = getMillis() + kQueuedInputEventDelay; } bool OSystem_IPHONE::handleEvent_swipe(Common::Event &event, int direction) { @@ -530,7 +521,7 @@ bool OSystem_IPHONE::handleEvent_swipe(Common::Event &event, int direction) { event.type = Common::EVENT_KEYDOWN; _queuedInputEvent.type = Common::EVENT_KEYUP; event.kbd.flags = _queuedInputEvent.kbd.flags = 0; - _needEventRestPeriod = true; + _queuedEventTime = getMillis() + kQueuedInputEventDelay; return true; } diff --git a/backends/platform/iphone/osys_main.cpp b/backends/platform/iphone/osys_main.cpp index 813adfbc437..12317ad9355 100644 --- a/backends/platform/iphone/osys_main.cpp +++ b/backends/platform/iphone/osys_main.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. @@ -58,9 +55,9 @@ void *OSystem_IPHONE::s_soundParam = NULL; OSystem_IPHONE::OSystem_IPHONE() : _savefile(NULL), _mixer(NULL), _timer(NULL), _offscreen(NULL), _overlayVisible(false), _fullscreen(NULL), - _mouseHeight(0), _mouseWidth(0), _mouseBuf(NULL), _lastMouseTap(0), - _secondaryTapped(false), _lastSecondaryTap(0), _screenOrientation(kScreenOrientationFlippedLandscape), - _needEventRestPeriod(false), _mouseClickAndDragEnabled(false), + _mouseHeight(0), _mouseWidth(0), _mouseBuf(NULL), _lastMouseTap(0), _queuedEventTime(0), + _secondaryTapped(false), _lastSecondaryTap(0), + _screenOrientation(kScreenOrientationFlippedLandscape), _mouseClickAndDragEnabled(false), _gestureStartX(-1), _gestureStartY(-1), _fullScreenIsDirty(false), _fullScreenOverlayIsDirty(false), _mouseDirty(false), _timeSuspended(0), _lastDragPosX(-1), _lastDragPosY(-1), _screenChangeCount(0), _overlayHeight(0), _overlayWidth(0), _overlayBuffer(0) diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h index 79f596632ff..1ff87967a14 100644 --- a/backends/platform/iphone/osys_main.h +++ b/backends/platform/iphone/osys_main.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "graphics/surface.h" @@ -89,9 +86,9 @@ protected: bool _mouseDirty; long _lastMouseDown; long _lastMouseTap; + long _queuedEventTime; Common::Rect _lastDrawnMouseRect; Common::Event _queuedInputEvent; - bool _needEventRestPeriod; bool _secondaryTapped; long _lastSecondaryDown; long _lastSecondaryTap; diff --git a/backends/platform/iphone/osys_sound.cpp b/backends/platform/iphone/osys_sound.cpp index cd364f57ac0..405543e3806 100644 --- a/backends/platform/iphone/osys_sound.cpp +++ b/backends/platform/iphone/osys_sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/backends/platform/iphone/osys_video.cpp b/backends/platform/iphone/osys_video.cpp index a10efeff40e..263cbd2bcc8 100644 --- a/backends/platform/iphone/osys_video.cpp +++ b/backends/platform/iphone/osys_video.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/backends/platform/linuxmoto/hardwarekeys.cpp b/backends/platform/linuxmoto/hardwarekeys.cpp index a3fdd68c7f8..e10e39a23d4 100644 --- a/backends/platform/linuxmoto/hardwarekeys.cpp +++ b/backends/platform/linuxmoto/hardwarekeys.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "backends/platform/linuxmoto/linuxmoto-sdl.h" diff --git a/backends/platform/linuxmoto/linuxmoto-main.cpp b/backends/platform/linuxmoto/linuxmoto-main.cpp index e9f2e661dee..835ccb03efe 100644 --- a/backends/platform/linuxmoto/linuxmoto-main.cpp +++ b/backends/platform/linuxmoto/linuxmoto-main.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "backends/platform/linuxmoto/linuxmoto-sdl.h" diff --git a/backends/platform/linuxmoto/linuxmoto-sdl.cpp b/backends/platform/linuxmoto/linuxmoto-sdl.cpp index 3bee53cc9c4..844bd19a83a 100644 --- a/backends/platform/linuxmoto/linuxmoto-sdl.cpp +++ b/backends/platform/linuxmoto/linuxmoto-sdl.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "backends/platform/linuxmoto/linuxmoto-sdl.h" diff --git a/backends/platform/linuxmoto/linuxmoto-sdl.h b/backends/platform/linuxmoto/linuxmoto-sdl.h index 78b9f81fd20..97262ccbca9 100644 --- a/backends/platform/linuxmoto/linuxmoto-sdl.h +++ b/backends/platform/linuxmoto/linuxmoto-sdl.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PLATFORM_SDL_LINUXMOTO_H diff --git a/backends/platform/linuxmoto/module.mk b/backends/platform/linuxmoto/module.mk index c604d69da16..4c81aac3f2c 100644 --- a/backends/platform/linuxmoto/module.mk +++ b/backends/platform/linuxmoto/module.mk @@ -10,5 +10,5 @@ MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) OBJS := $(MODULE_OBJS) $(OBJS) MODULE_DIRS += $(sort $(dir $(MODULE_OBJS))) -# HACK: The linuxmoto backend is based on the SDL one, so we load that, too. -include $(srcdir)/backends/platform/sdl/module.mk +# Hack to ensure the SDL backend is built so we can use OSystem_SDL. +-include $(srcdir)/backends/platform/sdl/module.mk diff --git a/backends/platform/n64/framfs_save_manager.cpp b/backends/platform/n64/framfs_save_manager.cpp index 053ed741b3a..983b9aba8d8 100644 --- a/backends/platform/n64/framfs_save_manager.cpp +++ b/backends/platform/n64/framfs_save_manager.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/backends/platform/n64/framfs_save_manager.h b/backends/platform/n64/framfs_save_manager.h index 376bdf10517..d50c17d85bd 100644 --- a/backends/platform/n64/framfs_save_manager.h +++ b/backends/platform/n64/framfs_save_manager.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef __FRAMFS_SAVE_MANAGER__ diff --git a/backends/platform/n64/nintendo64.cpp b/backends/platform/n64/nintendo64.cpp index ff8e7485c90..3e811e73d22 100644 --- a/backends/platform/n64/nintendo64.cpp +++ b/backends/platform/n64/nintendo64.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "osys_n64.h" diff --git a/backends/platform/n64/osys_n64.h b/backends/platform/n64/osys_n64.h index b9acb7c76c7..8c0b34ce32e 100644 --- a/backends/platform/n64/osys_n64.h +++ b/backends/platform/n64/osys_n64.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef __OSYS_N64_H__ diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp index ae8d23d3e2d..094bb839d30 100644 --- a/backends/platform/n64/osys_n64_base.cpp +++ b/backends/platform/n64/osys_n64_base.cpp @@ -18,11 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ +#define FORBIDDEN_SYMBOL_ALLOW_ALL + #include #include // Required for memalign diff --git a/backends/platform/n64/osys_n64_events.cpp b/backends/platform/n64/osys_n64_events.cpp index 69c854750cd..2645cfea2a2 100644 --- a/backends/platform/n64/osys_n64_events.cpp +++ b/backends/platform/n64/osys_n64_events.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include // Needed for "tan()" function diff --git a/backends/platform/n64/osys_n64_utilities.cpp b/backends/platform/n64/osys_n64_utilities.cpp index 88a2970d7d1..8d9f0471d3d 100644 --- a/backends/platform/n64/osys_n64_utilities.cpp +++ b/backends/platform/n64/osys_n64_utilities.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "osys_n64.h" diff --git a/backends/platform/n64/pakfs_save_manager.cpp b/backends/platform/n64/pakfs_save_manager.cpp index 25d82826e52..df9baa4d216 100644 --- a/backends/platform/n64/pakfs_save_manager.cpp +++ b/backends/platform/n64/pakfs_save_manager.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/backends/platform/n64/pakfs_save_manager.h b/backends/platform/n64/pakfs_save_manager.h index b0af464b3a2..69878012947 100644 --- a/backends/platform/n64/pakfs_save_manager.h +++ b/backends/platform/n64/pakfs_save_manager.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef __PAKFS_SAVE_MANAGER__ diff --git a/backends/platform/n64/portdefs.h b/backends/platform/n64/portdefs.h index 9fd714ad9f0..35ef3c71dbc 100644 --- a/backends/platform/n64/portdefs.h +++ b/backends/platform/n64/portdefs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef __N64_PORTDEFS__ @@ -38,5 +35,18 @@ #undef assert #define assert(x) ((x) ? 0 : (print_error("ASSERT TRIGGERED:\n\n("#x")\n%s\nline: %d", __FILE__, __LINE__))) +// Typedef basic data types in a way that is compatible with the N64 SDK. +typedef unsigned char byte; +typedef unsigned char uint8; +typedef signed char int8; +typedef unsigned short int uint16; +typedef signed short int int16; +typedef unsigned int uint32; +typedef signed int int32; + +// Define SCUMMVM_DONT_DEFINE_TYPES to prevent scummsys.h from trying to +// re-define those data types. +#define SCUMMVM_DONT_DEFINE_TYPES + #endif diff --git a/backends/platform/null/null.cpp b/backends/platform/null/null.cpp index 772b2b4722e..b9e901bb5af 100644 --- a/backends/platform/null/null.cpp +++ b/backends/platform/null/null.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "backends/modular-backend.h" @@ -37,7 +34,7 @@ */ #if defined(__amigaos4__) #include "backends/fs/amigaos4/amigaos4-fs-factory.h" -#elif defined(UNIX) +#elif defined(POSIX) #include "backends/fs/posix/posix-fs-factory.h" #elif defined(WIN32) #include "backends/fs/windows/windows-fs-factory.h" @@ -63,7 +60,7 @@ public: OSystem_NULL::OSystem_NULL() { #if defined(__amigaos4__) _fsFactory = new AmigaOSFilesystemFactory(); - #elif defined(UNIX) + #elif defined(POSIX) _fsFactory = new POSIXFilesystemFactory(); #elif defined(WIN32) _fsFactory = new WindowsFilesystemFactory(); diff --git a/backends/platform/openpandora/module.mk b/backends/platform/openpandora/module.mk index 8e60b87aa66..5bd568e1c47 100755 --- a/backends/platform/openpandora/module.mk +++ b/backends/platform/openpandora/module.mk @@ -5,11 +5,10 @@ MODULE_OBJS := \ op-backend.o \ op-main.o -MODULE_DIRS += \ - backends/platform/openpandora/ - -# We don't use the rules.mk here on purpose -OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) $(OBJS) +# We don't use rules.mk but rather manually update OBJS and MODULE_DIRS. +MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) +OBJS := $(MODULE_OBJS) $(OBJS) +MODULE_DIRS += $(sort $(dir $(MODULE_OBJS))) # Hack to ensure the SDL backend is built so we can use OSystem_SDL. -include $(srcdir)/backends/platform/sdl/module.mk diff --git a/backends/platform/openpandora/op-options.cpp b/backends/platform/openpandora/op-options.cpp index f8711b868a3..c60ba58cc7e 100644 --- a/backends/platform/openpandora/op-options.cpp +++ b/backends/platform/openpandora/op-options.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/backends/platform/openpandora/op-options.h b/backends/platform/openpandora/op-options.h index 8c2bb1cc897..ebc83ca00c5 100644 --- a/backends/platform/openpandora/op-options.h +++ b/backends/platform/openpandora/op-options.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/backends/platform/ps2/DmaPipe.cpp b/backends/platform/ps2/DmaPipe.cpp index f3fbdb2c735..c6f6ab72ac1 100644 --- a/backends/platform/ps2/DmaPipe.cpp +++ b/backends/platform/ps2/DmaPipe.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // minimalistic gfx pipe implementation based on Vzzrzzn's GfxPipe. diff --git a/backends/platform/ps2/DmaPipe.h b/backends/platform/ps2/DmaPipe.h index 2b71747cc2d..fd8f55c1548 100644 --- a/backends/platform/ps2/DmaPipe.h +++ b/backends/platform/ps2/DmaPipe.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // minimalistic gfx pipe implementation based on Vzzrzzn's GfxPipe. diff --git a/backends/platform/ps2/Gs2dScreen.cpp b/backends/platform/ps2/Gs2dScreen.cpp index c228a12b26d..332b2a3c038 100644 --- a/backends/platform/ps2/Gs2dScreen.cpp +++ b/backends/platform/ps2/Gs2dScreen.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #define FORBIDDEN_SYMBOL_EXCEPTION_printf diff --git a/backends/platform/ps2/Gs2dScreen.h b/backends/platform/ps2/Gs2dScreen.h index 6e842b3f556..dffdce5b362 100644 --- a/backends/platform/ps2/Gs2dScreen.h +++ b/backends/platform/ps2/Gs2dScreen.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef __GS2DSCREEN_H__ diff --git a/backends/platform/ps2/GsDefs.h b/backends/platform/ps2/GsDefs.h index 515a2640bdd..fab0c40b35d 100644 --- a/backends/platform/ps2/GsDefs.h +++ b/backends/platform/ps2/GsDefs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef __GSDEFS_H__ diff --git a/backends/platform/ps2/asyncfio.cpp b/backends/platform/ps2/asyncfio.cpp index f16efffbd9d..d3d8eb65c76 100644 --- a/backends/platform/ps2/asyncfio.cpp +++ b/backends/platform/ps2/asyncfio.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "asyncfio.h" diff --git a/backends/platform/ps2/asyncfio.h b/backends/platform/ps2/asyncfio.h index b42141523b4..26ee3f63ddc 100644 --- a/backends/platform/ps2/asyncfio.h +++ b/backends/platform/ps2/asyncfio.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #define MAX_HANDLES 32 diff --git a/backends/platform/ps2/eecodyvdfs.c b/backends/platform/ps2/eecodyvdfs.c index 623e8276238..e9d4bc6a5c2 100644 --- a/backends/platform/ps2/eecodyvdfs.c +++ b/backends/platform/ps2/eecodyvdfs.c @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/backends/platform/ps2/eecodyvdfs.h b/backends/platform/ps2/eecodyvdfs.h index b9e2823cb90..4b383795c7e 100644 --- a/backends/platform/ps2/eecodyvdfs.h +++ b/backends/platform/ps2/eecodyvdfs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef EECDVDFS_H diff --git a/backends/platform/ps2/fileio.cpp b/backends/platform/ps2/fileio.cpp index 1919d0f7436..038cccd9ddf 100644 --- a/backends/platform/ps2/fileio.cpp +++ b/backends/platform/ps2/fileio.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/backends/platform/ps2/fileio.h b/backends/platform/ps2/fileio.h index 4dee94c0a53..3fdee5f1dc4 100644 --- a/backends/platform/ps2/fileio.h +++ b/backends/platform/ps2/fileio.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef __PS2FILE_IO__ diff --git a/backends/platform/ps2/icon.cpp b/backends/platform/ps2/icon.cpp index 48afc50c426..9852e6d40b3 100644 --- a/backends/platform/ps2/icon.cpp +++ b/backends/platform/ps2/icon.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "Gs2dScreen.h" diff --git a/backends/platform/ps2/iop/CoDyVDfs/common/codyvdirx.h b/backends/platform/ps2/iop/CoDyVDfs/common/codyvdirx.h index a50a4a737c0..e94e7dc8d63 100644 --- a/backends/platform/ps2/iop/CoDyVDfs/common/codyvdirx.h +++ b/backends/platform/ps2/iop/CoDyVDfs/common/codyvdirx.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CDVDFS_COMMON_H diff --git a/backends/platform/ps2/iop/CoDyVDfs/iop/cdtypes.h b/backends/platform/ps2/iop/CoDyVDfs/iop/cdtypes.h index d8e0e96e594..ebf57328dd3 100644 --- a/backends/platform/ps2/iop/CoDyVDfs/iop/cdtypes.h +++ b/backends/platform/ps2/iop/CoDyVDfs/iop/cdtypes.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef __CDTYPES_H__ diff --git a/backends/platform/ps2/iop/CoDyVDfs/iop/codyvdfs.c b/backends/platform/ps2/iop/CoDyVDfs/iop/codyvdfs.c index b423b44a1de..77a5b93720f 100644 --- a/backends/platform/ps2/iop/CoDyVDfs/iop/codyvdfs.c +++ b/backends/platform/ps2/iop/CoDyVDfs/iop/codyvdfs.c @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/backends/platform/ps2/iop/CoDyVDfs/iop/codyvdfs.h b/backends/platform/ps2/iop/CoDyVDfs/iop/codyvdfs.h index 68738a3222a..902065f3859 100644 --- a/backends/platform/ps2/iop/CoDyVDfs/iop/codyvdfs.h +++ b/backends/platform/ps2/iop/CoDyVDfs/iop/codyvdfs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef __CoDyVDfs_H__ diff --git a/backends/platform/ps2/iop/CoDyVDfs/iop/fiofs.c b/backends/platform/ps2/iop/CoDyVDfs/iop/fiofs.c index a64b2f2f3bf..8aecece3d9c 100644 --- a/backends/platform/ps2/iop/CoDyVDfs/iop/fiofs.c +++ b/backends/platform/ps2/iop/CoDyVDfs/iop/fiofs.c @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cdtypes.h" diff --git a/backends/platform/ps2/iop/CoDyVDfs/iop/fiofs.h b/backends/platform/ps2/iop/CoDyVDfs/iop/fiofs.h index e92576256c6..d0aa9533f24 100644 --- a/backends/platform/ps2/iop/CoDyVDfs/iop/fiofs.h +++ b/backends/platform/ps2/iop/CoDyVDfs/iop/fiofs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef __FIOFS_H__ diff --git a/backends/platform/ps2/iop/CoDyVDfs/iop/irx_imports.h b/backends/platform/ps2/iop/CoDyVDfs/iop/irx_imports.h index 0f17d620f10..69bbc012f88 100644 --- a/backends/platform/ps2/iop/CoDyVDfs/iop/irx_imports.h +++ b/backends/platform/ps2/iop/CoDyVDfs/iop/irx_imports.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef IOP_IRX_IMPORTS_H diff --git a/backends/platform/ps2/iop/CoDyVDfs/iop/rpcfs.c b/backends/platform/ps2/iop/CoDyVDfs/iop/rpcfs.c index a9bfd636c76..3e45a5ff3d2 100644 --- a/backends/platform/ps2/iop/CoDyVDfs/iop/rpcfs.c +++ b/backends/platform/ps2/iop/CoDyVDfs/iop/rpcfs.c @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/backends/platform/ps2/iop/rpckbd/src/irx_imports.h b/backends/platform/ps2/iop/rpckbd/src/irx_imports.h index c868c2d2511..f7d0656bdae 100644 --- a/backends/platform/ps2/iop/rpckbd/src/irx_imports.h +++ b/backends/platform/ps2/iop/rpckbd/src/irx_imports.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef IOP_IRX_IMPORTS_H diff --git a/backends/platform/ps2/irxboot.cpp b/backends/platform/ps2/irxboot.cpp index cc23df6575b..5072e8a52ca 100644 --- a/backends/platform/ps2/irxboot.cpp +++ b/backends/platform/ps2/irxboot.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/backends/platform/ps2/irxboot.h b/backends/platform/ps2/irxboot.h index 82ae06518ca..ef1bfb12564 100644 --- a/backends/platform/ps2/irxboot.h +++ b/backends/platform/ps2/irxboot.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef __IRXBOOT_H__ diff --git a/backends/platform/ps2/ps2debug.h b/backends/platform/ps2/ps2debug.h index 8ef06cf1500..127032ae809 100644 --- a/backends/platform/ps2/ps2debug.h +++ b/backends/platform/ps2/ps2debug.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef __PS2DEBUG_H__ diff --git a/backends/platform/ps2/ps2input.cpp b/backends/platform/ps2/ps2input.cpp index 6da21172ad2..07104a6d979 100644 --- a/backends/platform/ps2/ps2input.cpp +++ b/backends/platform/ps2/ps2input.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #define FORBIDDEN_SYMBOL_EXCEPTION_printf diff --git a/backends/platform/ps2/ps2input.h b/backends/platform/ps2/ps2input.h index eca59501133..c5d2f5b8400 100644 --- a/backends/platform/ps2/ps2input.h +++ b/backends/platform/ps2/ps2input.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef __PS2INPUT_H__ diff --git a/backends/platform/ps2/ps2mutex.cpp b/backends/platform/ps2/ps2mutex.cpp index 974cf00f567..75b3a154820 100644 --- a/backends/platform/ps2/ps2mutex.cpp +++ b/backends/platform/ps2/ps2mutex.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #define FORBIDDEN_SYMBOL_EXCEPTION_printf diff --git a/backends/platform/ps2/ps2pad.cpp b/backends/platform/ps2/ps2pad.cpp index 090a5f2a35e..00512c40c38 100644 --- a/backends/platform/ps2/ps2pad.cpp +++ b/backends/platform/ps2/ps2pad.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #define FORBIDDEN_SYMBOL_EXCEPTION_printf diff --git a/backends/platform/ps2/ps2pad.h b/backends/platform/ps2/ps2pad.h index cf37a720e72..16c7c796d3d 100644 --- a/backends/platform/ps2/ps2pad.h +++ b/backends/platform/ps2/ps2pad.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef __PS2PAD_H__ diff --git a/backends/platform/ps2/ps2time.cpp b/backends/platform/ps2/ps2time.cpp index 4c682cb9f20..2c3275b2b24 100644 --- a/backends/platform/ps2/ps2time.cpp +++ b/backends/platform/ps2/ps2time.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #define FORBIDDEN_SYMBOL_EXCEPTION_time_h diff --git a/backends/platform/ps2/savefilemgr.cpp b/backends/platform/ps2/savefilemgr.cpp index 459920c34a4..421edc3e2e7 100644 --- a/backends/platform/ps2/savefilemgr.cpp +++ b/backends/platform/ps2/savefilemgr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #define FORBIDDEN_SYMBOL_EXCEPTION_printf diff --git a/backends/platform/ps2/savefilemgr.h b/backends/platform/ps2/savefilemgr.h index a87f53d80ce..a25fb063ae4 100644 --- a/backends/platform/ps2/savefilemgr.h +++ b/backends/platform/ps2/savefilemgr.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef __SAVEFILEMGR_H__ diff --git a/backends/platform/ps2/sysdefs.h b/backends/platform/ps2/sysdefs.h index 4aef58b4bd5..01144022330 100644 --- a/backends/platform/ps2/sysdefs.h +++ b/backends/platform/ps2/sysdefs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef __SYSDEFS_H__ diff --git a/backends/platform/ps2/systemps2.cpp b/backends/platform/ps2/systemps2.cpp index aed2378faf0..210454c9aa8 100644 --- a/backends/platform/ps2/systemps2.cpp +++ b/backends/platform/ps2/systemps2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/backends/platform/ps2/systemps2.h b/backends/platform/ps2/systemps2.h index 26e3105cd96..b21a56c184e 100644 --- a/backends/platform/ps2/systemps2.h +++ b/backends/platform/ps2/systemps2.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SYSTEMPS2_H diff --git a/backends/platform/psp/Makefile b/backends/platform/psp/Makefile index dab3c34b519..899bf37e808 100644 --- a/backends/platform/psp/Makefile +++ b/backends/platform/psp/Makefile @@ -1,6 +1,4 @@ # SCUMMVM-PSP MakeFile -# $URL$ -# $Id$ #Use only this section to modify how the makefile behaves ------------ diff --git a/backends/platform/psp/audio.cpp b/backends/platform/psp/audio.cpp index b5a72dccd02..4fab9fdd3fd 100644 --- a/backends/platform/psp/audio.cpp +++ b/backends/platform/psp/audio.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/backends/platform/psp/audio.h b/backends/platform/psp/audio.h index f5179028dc5..34ded5c6381 100644 --- a/backends/platform/psp/audio.h +++ b/backends/platform/psp/audio.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PSP_AUDIO_H diff --git a/backends/platform/psp/cursor.cpp b/backends/platform/psp/cursor.cpp index 420b0398c3b..18a61f3df40 100644 --- a/backends/platform/psp/cursor.cpp +++ b/backends/platform/psp/cursor.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/platform/psp/cursor.h b/backends/platform/psp/cursor.h index 15dcf21dd31..9c24d001fb4 100644 --- a/backends/platform/psp/cursor.h +++ b/backends/platform/psp/cursor.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOUSE_H diff --git a/backends/platform/psp/default_display_client.cpp b/backends/platform/psp/default_display_client.cpp index 34b1a70711e..2ee7ff5b74a 100644 --- a/backends/platform/psp/default_display_client.cpp +++ b/backends/platform/psp/default_display_client.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/platform/psp/default_display_client.h b/backends/platform/psp/default_display_client.h index c7189b01689..e1cd8e7e72f 100644 --- a/backends/platform/psp/default_display_client.h +++ b/backends/platform/psp/default_display_client.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PSP_DEF_DISPLAY_CLIENT_H diff --git a/backends/platform/psp/display_client.cpp b/backends/platform/psp/display_client.cpp index d43e876a170..14b96d9caee 100644 --- a/backends/platform/psp/display_client.cpp +++ b/backends/platform/psp/display_client.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable printf override in common/forbidden.h to avoid diff --git a/backends/platform/psp/display_client.h b/backends/platform/psp/display_client.h index 0e432660315..f190658a264 100644 --- a/backends/platform/psp/display_client.h +++ b/backends/platform/psp/display_client.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PSP_GRAPHICS_H diff --git a/backends/platform/psp/display_manager.cpp b/backends/platform/psp/display_manager.cpp index 471303796b4..899b79727f1 100644 --- a/backends/platform/psp/display_manager.cpp +++ b/backends/platform/psp/display_manager.cpp @@ -18,11 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ +#define FORBIDDEN_SYMBOL_ALLOW_ALL + #include #include #include diff --git a/backends/platform/psp/display_manager.h b/backends/platform/psp/display_manager.h index 4ebd98b524f..5176bee3fe2 100644 --- a/backends/platform/psp/display_manager.h +++ b/backends/platform/psp/display_manager.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PSP_DISPLAY_MAN_H diff --git a/backends/platform/psp/dummy.cpp b/backends/platform/psp/dummy.cpp index a5c887f85d1..86ab30b3e2c 100644 --- a/backends/platform/psp/dummy.cpp +++ b/backends/platform/psp/dummy.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ //#include "common/scummsys.h" diff --git a/backends/platform/psp/image_viewer.cpp b/backends/platform/psp/image_viewer.cpp index e28fc28c6e6..97d582b63a7 100644 --- a/backends/platform/psp/image_viewer.cpp +++ b/backends/platform/psp/image_viewer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/backends/platform/psp/image_viewer.h b/backends/platform/psp/image_viewer.h index a70a4dd4e21..4c3eaf7b4ae 100644 --- a/backends/platform/psp/image_viewer.h +++ b/backends/platform/psp/image_viewer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PSP_IMAGE_VIEWER_H diff --git a/backends/platform/psp/input.cpp b/backends/platform/psp/input.cpp index 665f41504fb..17f8954e3b5 100644 --- a/backends/platform/psp/input.cpp +++ b/backends/platform/psp/input.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/backends/platform/psp/input.h b/backends/platform/psp/input.h index 8c872f50e5a..8315a3766cb 100644 --- a/backends/platform/psp/input.h +++ b/backends/platform/psp/input.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PSP_INPUT_H diff --git a/backends/platform/psp/memory.cpp b/backends/platform/psp/memory.cpp index b9380cbdc6a..5419d60eb3f 100644 --- a/backends/platform/psp/memory.cpp +++ b/backends/platform/psp/memory.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/platform/psp/memory.h b/backends/platform/psp/memory.h index c4a4b752f83..b5e29af634f 100644 --- a/backends/platform/psp/memory.h +++ b/backends/platform/psp/memory.h @@ -19,9 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PSP_MEMORY_H diff --git a/backends/platform/psp/mp3.cpp b/backends/platform/psp/mp3.cpp index fd686513afc..266e31e4452 100644 --- a/backends/platform/psp/mp3.cpp +++ b/backends/platform/psp/mp3.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable printf override in common/forbidden.h to avoid diff --git a/backends/platform/psp/mp3.h b/backends/platform/psp/mp3.h index 95491d5788c..8b01fe4872e 100644 --- a/backends/platform/psp/mp3.h +++ b/backends/platform/psp/mp3.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SOUND_MP3_PSP_H diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index e2a8a88c570..3db743eff33 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Allow use of stuff in diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h index 1e4aea70d3a..00eec3da900 100644 --- a/backends/platform/psp/osys_psp.h +++ b/backends/platform/psp/osys_psp.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef OSYS_PSP_H diff --git a/backends/platform/psp/png_loader.cpp b/backends/platform/psp/png_loader.cpp index 08f370f36db..2f4857569ec 100644 --- a/backends/platform/psp/png_loader.cpp +++ b/backends/platform/psp/png_loader.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/backends/platform/psp/png_loader.h b/backends/platform/psp/png_loader.h index 4119bfef2b3..616a79405e6 100644 --- a/backends/platform/psp/png_loader.h +++ b/backends/platform/psp/png_loader.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PSP_PNG_IMAGE_H diff --git a/backends/platform/psp/portdefs.h b/backends/platform/psp/portdefs.h index dae9b5d49e8..feb0c944ee5 100644 --- a/backends/platform/psp/portdefs.h +++ b/backends/platform/psp/portdefs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PORTDEFS_H diff --git a/backends/platform/psp/powerman.cpp b/backends/platform/psp/powerman.cpp index f00a2c0fdea..fe9dcfa6738 100644 --- a/backends/platform/psp/powerman.cpp +++ b/backends/platform/psp/powerman.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/backends/platform/psp/powerman.h b/backends/platform/psp/powerman.h index 5f09bc77940..e62b1ada8eb 100644 --- a/backends/platform/psp/powerman.h +++ b/backends/platform/psp/powerman.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef POWERMAN_H diff --git a/backends/platform/psp/psp_main.cpp b/backends/platform/psp/psp_main.cpp index b85467f7881..f45000fea4c 100644 --- a/backends/platform/psp/psp_main.cpp +++ b/backends/platform/psp/psp_main.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable printf override in common/forbidden.h to avoid diff --git a/backends/platform/psp/pspkeyboard.cpp b/backends/platform/psp/pspkeyboard.cpp index f2107266927..43c4cada159 100644 --- a/backends/platform/psp/pspkeyboard.cpp +++ b/backends/platform/psp/pspkeyboard.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/backends/platform/psp/pspkeyboard.h b/backends/platform/psp/pspkeyboard.h index ebf21cfd540..bd270da26f8 100644 --- a/backends/platform/psp/pspkeyboard.h +++ b/backends/platform/psp/pspkeyboard.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PSPKEYBOARD_H diff --git a/backends/platform/psp/psppixelformat.cpp b/backends/platform/psp/psppixelformat.cpp index 598cf74256d..e1649791a11 100644 --- a/backends/platform/psp/psppixelformat.cpp +++ b/backends/platform/psp/psppixelformat.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/platform/psp/psppixelformat.h b/backends/platform/psp/psppixelformat.h index 95ec5e385b9..ca85e762112 100644 --- a/backends/platform/psp/psppixelformat.h +++ b/backends/platform/psp/psppixelformat.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PSP_PIXEL_FORMAT_H diff --git a/backends/platform/psp/rtc.cpp b/backends/platform/psp/rtc.cpp index ff2af8573c5..3d6d4295a61 100644 --- a/backends/platform/psp/rtc.cpp +++ b/backends/platform/psp/rtc.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/backends/platform/psp/rtc.h b/backends/platform/psp/rtc.h index 0a7f7ea2e9d..45885c3e662 100644 --- a/backends/platform/psp/rtc.h +++ b/backends/platform/psp/rtc.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef _PSP_RTC_H_ diff --git a/backends/platform/psp/tests.cpp b/backends/platform/psp/tests.cpp index 972e7855556..4d326f30bdf 100644 --- a/backends/platform/psp/tests.cpp +++ b/backends/platform/psp/tests.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // PSP speed and unit tests. Activate in tests.h diff --git a/backends/platform/psp/tests.h b/backends/platform/psp/tests.h index 70ec1f3ff15..9d158812f96 100644 --- a/backends/platform/psp/tests.h +++ b/backends/platform/psp/tests.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef _PSP_TESTS_H_ diff --git a/backends/platform/psp/thread.cpp b/backends/platform/psp/thread.cpp index 3e1303a4e63..5f38a54ab72 100644 --- a/backends/platform/psp/thread.cpp +++ b/backends/platform/psp/thread.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/backends/platform/psp/thread.h b/backends/platform/psp/thread.h index 1ca6ef5c420..a2f3b5eda26 100644 --- a/backends/platform/psp/thread.h +++ b/backends/platform/psp/thread.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PSP_THREAD_H diff --git a/backends/platform/psp/trace.cpp b/backends/platform/psp/trace.cpp index 92ee7b669e4..373e00415b2 100644 --- a/backends/platform/psp/trace.cpp +++ b/backends/platform/psp/trace.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable printf override in common/forbidden.h to avoid diff --git a/backends/platform/psp/trace.h b/backends/platform/psp/trace.h index 39b335b16c9..dda258f2cbb 100644 --- a/backends/platform/psp/trace.h +++ b/backends/platform/psp/trace.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/backends/platform/samsungtv/main.cpp b/backends/platform/samsungtv/main.cpp index a1962dd9040..4f3291613d4 100644 --- a/backends/platform/samsungtv/main.cpp +++ b/backends/platform/samsungtv/main.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h @@ -41,7 +38,7 @@ extern "C" int Game_Main(char *path, char *) { assert(g_system); // Pre initialize the backend - ((OSystem_SDL_SamsungTV *)g_system)->init(); + ((OSystem_POSIX *)g_system)->init(); #ifdef DYNAMIC_MODULES PluginManager::instance().addPluginProvider(new SDLPluginProvider()); @@ -51,7 +48,7 @@ extern "C" int Game_Main(char *path, char *) { int res = scummvm_main(0, 0); // Free OSystem - delete g_system; + delete (OSystem_SDL_SamsungTV *)g_system; return res; } diff --git a/backends/platform/samsungtv/module.mk b/backends/platform/samsungtv/module.mk index 36ad75da6d9..cba09db74cb 100644 --- a/backends/platform/samsungtv/module.mk +++ b/backends/platform/samsungtv/module.mk @@ -8,3 +8,6 @@ MODULE_OBJS := \ MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) OBJS := $(MODULE_OBJS) $(OBJS) MODULE_DIRS += $(sort $(dir $(MODULE_OBJS))) + +# Hack to ensure the SDL backend is built so we can use OSystem_SDL. +-include $(srcdir)/backends/platform/sdl/module.mk diff --git a/backends/platform/samsungtv/samsungtv.cpp b/backends/platform/samsungtv/samsungtv.cpp index 4d6dca74037..1b978d01212 100644 --- a/backends/platform/samsungtv/samsungtv.cpp +++ b/backends/platform/samsungtv/samsungtv.cpp @@ -18,25 +18,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "backends/platform/samsungtv/samsungtv.h" #include "backends/events/samsungtvsdl/samsungtvsdl-events.h" +#include "backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h" #if defined(SAMSUNGTV) OSystem_SDL_SamsungTV::OSystem_SDL_SamsungTV() : - OSystem_POSIX("/dtv/usb/sda1/.scummvmrc") { -} - -bool OSystem_SDL_SamsungTV::hasFeature(Feature f) { - return - (f == OSystem::kFeatureAspectRatioCorrection) || - (f == OSystem::kFeatureCursorHasPalette); + OSystem_POSIX("/mtd_rwarea/.scummvmrc") { } void OSystem_SDL_SamsungTV::initBackend() { @@ -44,27 +36,22 @@ void OSystem_SDL_SamsungTV::initBackend() { if (_eventSource == 0) _eventSource = new SamsungTVSdlEventSource(); + if (_graphicsManager == 0) + _graphicsManager = new SamsungTVSdlGraphicsManager(_eventSource); + // Call parent implementation of this method - OSystem_SDL::initBackend(); + OSystem_POSIX::initBackend(); } -void OSystem_SDL_SamsungTV::setFeatureState(Feature f, bool enable) { - switch (f) { - case OSystem::kFeatureAspectRatioCorrection: - _graphicsManager->setFeatureState(f, enable); - break; - default: - break; - } +void OSystem_SDL_SamsungTV::quit() { + delete this; } -bool OSystem_SDL_SamsungTV::getFeatureState(Feature f) { - switch (f) { - case OSystem::kFeatureAspectRatioCorrection: - return _graphicsManager->getFeatureState(f); - default: - return false; - } +void OSystem_SDL_SamsungTV::fatalError() { + delete this; + // FIXME + warning("fatal error"); + for (;;) {} } #endif diff --git a/backends/platform/samsungtv/samsungtv.h b/backends/platform/samsungtv/samsungtv.h index bccb6baee9f..b7a78a96cd1 100644 --- a/backends/platform/samsungtv/samsungtv.h +++ b/backends/platform/samsungtv/samsungtv.h @@ -18,14 +18,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PLATFORM_SDL_SAMSUNGTV_H #define PLATFORM_SDL_SAMSUNGTV_H +#if defined(SAMSUNGTV) + #include "backends/platform/sdl/posix/posix.h" class OSystem_SDL_SamsungTV : public OSystem_POSIX { @@ -33,10 +32,10 @@ public: OSystem_SDL_SamsungTV(); virtual void initBackend(); - - virtual bool hasFeature(Feature f); - virtual void setFeatureState(Feature f, bool enable); - virtual bool getFeatureState(Feature f); + virtual void quit(); + virtual void fatalError(); }; #endif + +#endif diff --git a/backends/platform/sdl/amigaos/amigaos-main.cpp b/backends/platform/sdl/amigaos/amigaos-main.cpp index beb27fd714c..da83756a40b 100644 --- a/backends/platform/sdl/amigaos/amigaos-main.cpp +++ b/backends/platform/sdl/amigaos/amigaos-main.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/platform/sdl/amigaos/amigaos.cpp b/backends/platform/sdl/amigaos/amigaos.cpp index 77c2c2e21d1..94daacfd144 100644 --- a/backends/platform/sdl/amigaos/amigaos.cpp +++ b/backends/platform/sdl/amigaos/amigaos.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/platform/sdl/amigaos/amigaos.h b/backends/platform/sdl/amigaos/amigaos.h index 92232ec98ac..391a0bfa9af 100644 --- a/backends/platform/sdl/amigaos/amigaos.h +++ b/backends/platform/sdl/amigaos/amigaos.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PLATFORM_SDL_AMIGAOS_H diff --git a/backends/platform/sdl/hardwarekeys.cpp b/backends/platform/sdl/hardwarekeys.cpp index 1a8124bbf31..9a33e357dad 100644 --- a/backends/platform/sdl/hardwarekeys.cpp +++ b/backends/platform/sdl/hardwarekeys.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "backends/platform/sdl/sdl.h" diff --git a/backends/platform/sdl/macosx/macosx-main.cpp b/backends/platform/sdl/macosx/macosx-main.cpp index 94655f8118f..b89264f9e92 100644 --- a/backends/platform/sdl/macosx/macosx-main.cpp +++ b/backends/platform/sdl/macosx/macosx-main.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/platform/sdl/macosx/macosx.cpp b/backends/platform/sdl/macosx/macosx.cpp index 5ea65b6449c..0ef16d9a6eb 100644 --- a/backends/platform/sdl/macosx/macosx.cpp +++ b/backends/platform/sdl/macosx/macosx.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/backends/platform/sdl/macosx/macosx.h b/backends/platform/sdl/macosx/macosx.h index c31cc7a2d07..6d78427522b 100644 --- a/backends/platform/sdl/macosx/macosx.h +++ b/backends/platform/sdl/macosx/macosx.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PLATFORM_SDL_MACOSX_H diff --git a/backends/platform/sdl/main.cpp b/backends/platform/sdl/main.cpp index 14cfaaee57b..1992bdd3f2c 100644 --- a/backends/platform/sdl/main.cpp +++ b/backends/platform/sdl/main.cpp @@ -18,16 +18,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" // Several SDL based ports use a custom main, and hence do not want to compile // of this file. The following "#if" ensures that. -#if !defined(UNIX) && \ +#if !defined(POSIX) && \ !defined(WIN32) && \ !defined(__MAEMO__) && \ !defined(__SYMBIAN32__) && \ @@ -36,6 +33,7 @@ !defined(DINGUX) && \ !defined(CAANOO) && \ !defined(LINUXMOTO) && \ + !defined(SAMSUNGTV) && \ !defined(OPENPANDORA) #include "backends/platform/sdl/sdl.h" diff --git a/backends/platform/sdl/module.mk b/backends/platform/sdl/module.mk index 87a0e3d658e..efc5168d5b3 100644 --- a/backends/platform/sdl/module.mk +++ b/backends/platform/sdl/module.mk @@ -5,7 +5,7 @@ MODULE_OBJS := \ main.o \ sdl.o -ifdef UNIX +ifdef POSIX MODULE_OBJS += \ posix/posix-main.o \ posix/posix.o diff --git a/backends/platform/sdl/posix/posix-main.cpp b/backends/platform/sdl/posix/posix-main.cpp index 9e778ab8991..f78e0013985 100644 --- a/backends/platform/sdl/posix/posix-main.cpp +++ b/backends/platform/sdl/posix/posix-main.cpp @@ -18,14 +18,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" -#if defined(UNIX) && !defined(MACOSX) && !defined(SAMSUNGTV) && !defined(WEBOS) && !defined(LINUXMOTO) && !defined(GPH_DEVICE) && !defined(GP2X) && !defined(DINGUX) && !defined(OPENPANDORA) +#if defined(POSIX) && !defined(MACOSX) && !defined(SAMSUNGTV) && !defined(WEBOS) && !defined(LINUXMOTO) && !defined(GPH_DEVICE) && !defined(GP2X) && !defined(DINGUX) && !defined(OPENPANDORA) #include "backends/platform/sdl/posix/posix.h" #include "backends/plugins/sdl/sdl-provider.h" diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp index 2208f7c3518..21ad7b9e35b 100644 --- a/backends/platform/sdl/posix/posix.cpp +++ b/backends/platform/sdl/posix/posix.cpp @@ -18,17 +18,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ +#define FORBIDDEN_SYMBOL_EXCEPTION_getenv #define FORBIDDEN_SYMBOL_EXCEPTION_mkdir #define FORBIDDEN_SYMBOL_EXCEPTION_time_h //On IRIX, sys/stat.h includes sys/time.h #include "common/scummsys.h" -#ifdef UNIX +#ifdef POSIX #include "backends/platform/sdl/posix/posix.h" #include "backends/saves/posix/posix-saves.h" @@ -63,7 +61,7 @@ void OSystem_POSIX::initBackend() { Common::String OSystem_POSIX::getDefaultConfigFileName() { char configFile[MAXPATHLEN]; - // On UNIX type systems, by default we store the config file inside + // On POSIX type systems, by default we store the config file inside // to the HOME directory of the user. const char *home = getenv("HOME"); if (home != NULL && strlen(home) < MAXPATHLEN) @@ -85,6 +83,9 @@ Common::WriteStream *OSystem_POSIX::createLogFile() { #else logFile += "/.scummvm"; #endif +#ifdef SAMSUNGTV + logFile = "/mtd_ram"; +#endif struct stat sb; diff --git a/backends/platform/sdl/posix/posix.h b/backends/platform/sdl/posix/posix.h index a0a0b89c401..0a4f38e2c4c 100644 --- a/backends/platform/sdl/posix/posix.h +++ b/backends/platform/sdl/posix/posix.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PLATFORM_SDL_POSIX_H diff --git a/backends/platform/sdl/sdl-sys.h b/backends/platform/sdl/sdl-sys.h index 23a25f0a82a..77515ff4e5d 100644 --- a/backends/platform/sdl/sdl-sys.h +++ b/backends/platform/sdl/sdl-sys.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKEND_SDL_SYS_H diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index e6ca423f619..a3fb719ca4d 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -18,12 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #define FORBIDDEN_SYMBOL_EXCEPTION_time_h +#define FORBIDDEN_SYMBOL_EXCEPTION_exit #ifdef WIN32 #define WIN32_LEAN_AND_MEAN diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index dac1f18a88e..e9e9bc56967 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PLATFORM_SDL_H diff --git a/backends/platform/sdl/win32/win32-main.cpp b/backends/platform/sdl/win32/win32-main.cpp index 50743e65a5b..2b3e18e9f09 100644 --- a/backends/platform/sdl/win32/win32-main.cpp +++ b/backends/platform/sdl/win32/win32-main.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp index d6a39ff48f7..93b76f41885 100644 --- a/backends/platform/sdl/win32/win32.cpp +++ b/backends/platform/sdl/win32/win32.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/backends/platform/sdl/win32/win32.h b/backends/platform/sdl/win32/win32.h index 25cb6bfbba4..268449eeff4 100644 --- a/backends/platform/sdl/win32/win32.h +++ b/backends/platform/sdl/win32/win32.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PLATFORM_SDL_WIN32_H diff --git a/backends/platform/symbian/README b/backends/platform/symbian/README index d7e8235e1dc..140f442fb6c 100644 --- a/backends/platform/symbian/README +++ b/backends/platform/symbian/README @@ -6,8 +6,6 @@ Copyright (C) 2002-2008 Jurgen 'SumthinWicked' Braam Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - $URL$ - $Id$ Using parts of snprintf.c by Mark Martinec , April 1999, June 2000 diff --git a/backends/platform/symbian/S60/ScummVM_S60.mmp.in b/backends/platform/symbian/S60/ScummVM_S60.mmp.in index b76a6a9a895..7b401fd3104 100644 --- a/backends/platform/symbian/S60/ScummVM_S60.mmp.in +++ b/backends/platform/symbian/S60/ScummVM_S60.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/S60/ScummVM_S60_App.mmp b/backends/platform/symbian/S60/ScummVM_S60_App.mmp index 40333854af2..940997cc73c 100644 --- a/backends/platform/symbian/S60/ScummVM_S60_App.mmp +++ b/backends/platform/symbian/S60/ScummVM_S60_App.mmp @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v1.pkg b/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v1.pkg index 755720616d6..da69d455d7b 100644 --- a/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v1.pkg +++ b/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v1.pkg @@ -18,9 +18,6 @@ ; along with this program; if not, write to the Free Software ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ; -; $URL$ -; $Id$ -; ; ;;; diff --git a/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v2.pkg b/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v2.pkg index 747f6dff4a0..469c815afb4 100644 --- a/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v2.pkg +++ b/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v2.pkg @@ -18,9 +18,6 @@ ; along with this program; if not, write to the Free Software ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ; -; $URL$ -; $Id$ -; ; ;;; diff --git a/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in b/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in index 4e0a66793ce..aa5e1f9b189 100644 --- a/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in +++ b/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in b/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in index 1929723fb63..09592ef3e32 100644 --- a/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in +++ b/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg b/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg index a5457fca0e2..2cc49a2bc6c 100644 --- a/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg +++ b/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg @@ -17,9 +17,6 @@ ; along with this program; if not, write to the Free Software ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ; -; $URL$ -; $Id$ -; ; ;;; diff --git a/backends/platform/symbian/S80/ScummVM_S80.mmp.in b/backends/platform/symbian/S80/ScummVM_S80.mmp.in index 306dfac9ef4..efd0d0ee324 100644 --- a/backends/platform/symbian/S80/ScummVM_S80.mmp.in +++ b/backends/platform/symbian/S80/ScummVM_S80.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/S80/ScummVM_S80_App.mmp b/backends/platform/symbian/S80/ScummVM_S80_App.mmp index d3fb53c3e6e..e91b504087c 100644 --- a/backends/platform/symbian/S80/ScummVM_S80_App.mmp +++ b/backends/platform/symbian/S80/ScummVM_S80_App.mmp @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/S80/scummvm-CVS-SymbianS80.pkg b/backends/platform/symbian/S80/scummvm-CVS-SymbianS80.pkg index 4cdcace8e0d..c3563b40417 100644 --- a/backends/platform/symbian/S80/scummvm-CVS-SymbianS80.pkg +++ b/backends/platform/symbian/S80/scummvm-CVS-SymbianS80.pkg @@ -18,9 +18,6 @@ ; along with this program; if not, write to the Free Software ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ; -; $URL$ -; $Id$ -; ; ;;; diff --git a/backends/platform/symbian/S90/Scummvm_S90.mmp.in b/backends/platform/symbian/S90/Scummvm_S90.mmp.in index 333bb4a231b..4afdb5c62e7 100644 --- a/backends/platform/symbian/S90/Scummvm_S90.mmp.in +++ b/backends/platform/symbian/S90/Scummvm_S90.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/S90/Scummvm_S90_App.mmp b/backends/platform/symbian/S90/Scummvm_S90_App.mmp index 371ab16bba2..3aa2cc2a65c 100644 --- a/backends/platform/symbian/S90/Scummvm_S90_App.mmp +++ b/backends/platform/symbian/S90/Scummvm_S90_App.mmp @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/S90/scummvm-CVS-SymbianS90.pkg b/backends/platform/symbian/S90/scummvm-CVS-SymbianS90.pkg index 7c206d1b9b0..457f41998b7 100644 --- a/backends/platform/symbian/S90/scummvm-CVS-SymbianS90.pkg +++ b/backends/platform/symbian/S90/scummvm-CVS-SymbianS90.pkg @@ -18,9 +18,6 @@ ; along with this program; if not, write to the Free Software ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ; -; $URL$ -; $Id$ -; ; ;;; diff --git a/backends/platform/symbian/UIQ2/ScummVM.rss b/backends/platform/symbian/UIQ2/ScummVM.rss index 69ca655a679..3550d82f7dd 100644 --- a/backends/platform/symbian/UIQ2/ScummVM.rss +++ b/backends/platform/symbian/UIQ2/ScummVM.rss @@ -18,8 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ */ // ScummVM.RSS diff --git a/backends/platform/symbian/UIQ2/ScummVM_UIQ2.mmp.in b/backends/platform/symbian/UIQ2/ScummVM_UIQ2.mmp.in index 4fda28e9d94..4000b1653db 100644 --- a/backends/platform/symbian/UIQ2/ScummVM_UIQ2.mmp.in +++ b/backends/platform/symbian/UIQ2/ScummVM_UIQ2.mmp.in @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/UIQ2/scummvm-CVS-SymbianUIQ2.pkg b/backends/platform/symbian/UIQ2/scummvm-CVS-SymbianUIQ2.pkg index 537e4f66933..e2b8a851623 100644 --- a/backends/platform/symbian/UIQ2/scummvm-CVS-SymbianUIQ2.pkg +++ b/backends/platform/symbian/UIQ2/scummvm-CVS-SymbianUIQ2.pkg @@ -18,9 +18,6 @@ ; along with this program; if not, write to the Free Software ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ; -; $URL$ -; $Id$ -; ; ;;; diff --git a/backends/platform/symbian/UIQ2/scummvm-CVS-SymbianUIQ2_SE.pkg b/backends/platform/symbian/UIQ2/scummvm-CVS-SymbianUIQ2_SE.pkg index 204c93e46f0..ad3a31cb30e 100644 --- a/backends/platform/symbian/UIQ2/scummvm-CVS-SymbianUIQ2_SE.pkg +++ b/backends/platform/symbian/UIQ2/scummvm-CVS-SymbianUIQ2_SE.pkg @@ -18,9 +18,6 @@ ; along with this program; if not, write to the Free Software ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ; -; $URL$ -; $Id$ -; ; ;;; diff --git a/backends/platform/symbian/UIQ3/ScummVM.rss b/backends/platform/symbian/UIQ3/ScummVM.rss index 505bfcdb94e..cb475682885 100644 --- a/backends/platform/symbian/UIQ3/ScummVM.rss +++ b/backends/platform/symbian/UIQ3/ScummVM.rss @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // ScummVM.RSS diff --git a/backends/platform/symbian/UIQ3/ScummVM_A0000658.rss b/backends/platform/symbian/UIQ3/ScummVM_A0000658.rss index 505bfcdb94e..cb475682885 100644 --- a/backends/platform/symbian/UIQ3/ScummVM_A0000658.rss +++ b/backends/platform/symbian/UIQ3/ScummVM_A0000658.rss @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // ScummVM.RSS diff --git a/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in b/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in index f5bdaac237e..e6f2b691ce2 100644 --- a/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in +++ b/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in b/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in index 2354161e475..3b6a3d9bd7b 100644 --- a/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in +++ b/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg b/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg index 4323c4e5ac3..2187a375a8b 100644 --- a/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg +++ b/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg @@ -18,9 +18,6 @@ ; along with this program; if not, write to the Free Software ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ; -; $URL$ -; $Id$ -; ; ;;; diff --git a/backends/platform/symbian/UIQ3/scummvm_A0000658_loc.rss b/backends/platform/symbian/UIQ3/scummvm_A0000658_loc.rss index a037162d147..a6ee70ab25c 100644 --- a/backends/platform/symbian/UIQ3/scummvm_A0000658_loc.rss +++ b/backends/platform/symbian/UIQ3/scummvm_A0000658_loc.rss @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/backends/platform/symbian/mmp/scummvm_agi.mmp.in b/backends/platform/symbian/mmp/scummvm_agi.mmp.in index e2d98b9ae42..a7dcfb0bb5e 100644 --- a/backends/platform/symbian/mmp/scummvm_agi.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_agi.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_agos.mmp.in b/backends/platform/symbian/mmp/scummvm_agos.mmp.in index 077111d7831..4708a040eca 100644 --- a/backends/platform/symbian/mmp/scummvm_agos.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_agos.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_base.mmp.in b/backends/platform/symbian/mmp/scummvm_base.mmp.in index 2b74bca42b3..9acef57cea8 100644 --- a/backends/platform/symbian/mmp/scummvm_base.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_base.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_cine.mmp.in b/backends/platform/symbian/mmp/scummvm_cine.mmp.in index 2c8118ef13f..aac7d8b5b10 100644 --- a/backends/platform/symbian/mmp/scummvm_cine.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_cine.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_cruise.mmp.in b/backends/platform/symbian/mmp/scummvm_cruise.mmp.in index b43a867da34..fc60bfeace4 100644 --- a/backends/platform/symbian/mmp/scummvm_cruise.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_cruise.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_draci.mmp.in b/backends/platform/symbian/mmp/scummvm_draci.mmp.in index 9f24927f27e..d879a037973 100644 --- a/backends/platform/symbian/mmp/scummvm_draci.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_draci.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_drascula.mmp.in b/backends/platform/symbian/mmp/scummvm_drascula.mmp.in index d8cc6da6ae6..f83bcdb68f9 100644 --- a/backends/platform/symbian/mmp/scummvm_drascula.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_drascula.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_gob.mmp.in b/backends/platform/symbian/mmp/scummvm_gob.mmp.in index ce94f85283a..900f8628461 100644 --- a/backends/platform/symbian/mmp/scummvm_gob.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_gob.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_groovie.mmp.in b/backends/platform/symbian/mmp/scummvm_groovie.mmp.in index 7229edf4aa7..1051e6adea6 100644 --- a/backends/platform/symbian/mmp/scummvm_groovie.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_groovie.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_hugo.mmp.in b/backends/platform/symbian/mmp/scummvm_hugo.mmp.in index b3f9edd1e64..31975d3107a 100644 --- a/backends/platform/symbian/mmp/scummvm_hugo.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_hugo.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_kyra.mmp.in b/backends/platform/symbian/mmp/scummvm_kyra.mmp.in index 654632c2293..453d41bdc1b 100644 --- a/backends/platform/symbian/mmp/scummvm_kyra.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_kyra.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_lastexpress.mmp.in b/backends/platform/symbian/mmp/scummvm_lastexpress.mmp.in index 418730c0640..5d0fe6de36b 100644 --- a/backends/platform/symbian/mmp/scummvm_lastexpress.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_lastexpress.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_lure.mmp.in b/backends/platform/symbian/mmp/scummvm_lure.mmp.in index e1a63b602b3..add33d7d8bb 100644 --- a/backends/platform/symbian/mmp/scummvm_lure.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_lure.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_m4.mmp.in b/backends/platform/symbian/mmp/scummvm_m4.mmp.in index c2e1ce4e8bf..6896dadf108 100644 --- a/backends/platform/symbian/mmp/scummvm_m4.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_m4.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_made.mmp.in b/backends/platform/symbian/mmp/scummvm_made.mmp.in index 91b9ca756da..c51d3ac6185 100644 --- a/backends/platform/symbian/mmp/scummvm_made.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_made.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_mohawk.mmp.in b/backends/platform/symbian/mmp/scummvm_mohawk.mmp.in index 0edba5eb4d0..296c458e39d 100644 --- a/backends/platform/symbian/mmp/scummvm_mohawk.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_mohawk.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_parallaction.mmp.in b/backends/platform/symbian/mmp/scummvm_parallaction.mmp.in index 744a756f4ea..4052a166933 100644 --- a/backends/platform/symbian/mmp/scummvm_parallaction.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_parallaction.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_queen.mmp.in b/backends/platform/symbian/mmp/scummvm_queen.mmp.in index bf887447017..ec4ccff939a 100644 --- a/backends/platform/symbian/mmp/scummvm_queen.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_queen.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_saga.mmp.in b/backends/platform/symbian/mmp/scummvm_saga.mmp.in index a95ee1e7fd5..44e222144c3 100644 --- a/backends/platform/symbian/mmp/scummvm_saga.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_saga.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_sci.mmp.in b/backends/platform/symbian/mmp/scummvm_sci.mmp.in index ca9e712f3fa..12588495cb5 100644 --- a/backends/platform/symbian/mmp/scummvm_sci.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_sci.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_scumm.mmp.in b/backends/platform/symbian/mmp/scummvm_scumm.mmp.in index 0a3cd9bb7d5..381a6060dde 100644 --- a/backends/platform/symbian/mmp/scummvm_scumm.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_scumm.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_sky.mmp.in b/backends/platform/symbian/mmp/scummvm_sky.mmp.in index 1bc23017459..f34c839076a 100644 --- a/backends/platform/symbian/mmp/scummvm_sky.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_sky.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_sword1.mmp.in b/backends/platform/symbian/mmp/scummvm_sword1.mmp.in index 6bf543070bb..58f9f8fa055 100644 --- a/backends/platform/symbian/mmp/scummvm_sword1.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_sword1.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_sword2.mmp.in b/backends/platform/symbian/mmp/scummvm_sword2.mmp.in index cee4143f948..4a19be92ce3 100644 --- a/backends/platform/symbian/mmp/scummvm_sword2.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_sword2.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_teenagent.mmp.in b/backends/platform/symbian/mmp/scummvm_teenagent.mmp.in index fa4ef79692d..6b4812489e2 100644 --- a/backends/platform/symbian/mmp/scummvm_teenagent.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_teenagent.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_tinsel.mmp.in b/backends/platform/symbian/mmp/scummvm_tinsel.mmp.in index 569b79ba3c0..bb56022f20b 100644 --- a/backends/platform/symbian/mmp/scummvm_tinsel.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_tinsel.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_toon.mmp.in b/backends/platform/symbian/mmp/scummvm_toon.mmp.in index f309e6d0fad..05742d5242c 100644 --- a/backends/platform/symbian/mmp/scummvm_toon.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_toon.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_touche.mmp.in b/backends/platform/symbian/mmp/scummvm_touche.mmp.in index ab42afe3045..ea8dd2392cc 100644 --- a/backends/platform/symbian/mmp/scummvm_touche.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_touche.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_tsage.mmp.in b/backends/platform/symbian/mmp/scummvm_tsage.mmp.in index 8265d9e772b..b7eb3290b3d 100644 --- a/backends/platform/symbian/mmp/scummvm_tsage.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_tsage.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/mmp/scummvm_tucker.mmp.in b/backends/platform/symbian/mmp/scummvm_tucker.mmp.in index 434072bc960..0aeb0dc4ecc 100644 --- a/backends/platform/symbian/mmp/scummvm_tucker.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_tucker.mmp.in @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/backends/platform/symbian/res/ScummVmAif.rss b/backends/platform/symbian/res/ScummVmAif.rss index b1ac4faa678..31bf7bd3941 100644 --- a/backends/platform/symbian/res/ScummVmAif.rss +++ b/backends/platform/symbian/res/ScummVmAif.rss @@ -22,8 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ */ #include diff --git a/backends/platform/symbian/res/scummvm.rss b/backends/platform/symbian/res/scummvm.rss index 8239d7e2d3f..62da39e6a8d 100644 --- a/backends/platform/symbian/res/scummvm.rss +++ b/backends/platform/symbian/res/scummvm.rss @@ -22,8 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ */ // ScummVM.RSS diff --git a/backends/platform/symbian/res/scummvm_A0000658.rss b/backends/platform/symbian/res/scummvm_A0000658.rss index d3dae5e143b..5615bbda9fa 100644 --- a/backends/platform/symbian/res/scummvm_A0000658.rss +++ b/backends/platform/symbian/res/scummvm_A0000658.rss @@ -22,8 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ */ // ScummVM.RSS diff --git a/backends/platform/symbian/src/ScummApp.cpp b/backends/platform/symbian/src/ScummApp.cpp index 01af5e7fd9b..c4d9fc88d96 100644 --- a/backends/platform/symbian/src/ScummApp.cpp +++ b/backends/platform/symbian/src/ScummApp.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "backends/platform/symbian/src/ScummApp.h" diff --git a/backends/platform/symbian/src/ScummApp.h b/backends/platform/symbian/src/ScummApp.h index cca8e2a7c94..376964f0a15 100644 --- a/backends/platform/symbian/src/ScummApp.h +++ b/backends/platform/symbian/src/ScummApp.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SCUMMAPP_H diff --git a/backends/platform/symbian/src/ScummVMApp.h b/backends/platform/symbian/src/ScummVMApp.h index aee098f9893..adc39a9ee24 100644 --- a/backends/platform/symbian/src/ScummVMApp.h +++ b/backends/platform/symbian/src/ScummVMApp.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMMVMAPP_H diff --git a/backends/platform/symbian/src/ScummVm.hrh b/backends/platform/symbian/src/ScummVm.hrh index bca5d7291e8..c18048c9229 100644 --- a/backends/platform/symbian/src/ScummVm.hrh +++ b/backends/platform/symbian/src/ScummVm.hrh @@ -22,9 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef ScummHRH diff --git a/backends/platform/symbian/src/SymbianActions.cpp b/backends/platform/symbian/src/SymbianActions.cpp index 1a55a687782..5de386b1da7 100644 --- a/backends/platform/symbian/src/SymbianActions.cpp +++ b/backends/platform/symbian/src/SymbianActions.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "backends/platform/symbian/src/SymbianActions.h" diff --git a/backends/platform/symbian/src/SymbianActions.h b/backends/platform/symbian/src/SymbianActions.h index c652d0be7e6..2b65c6c950e 100644 --- a/backends/platform/symbian/src/SymbianActions.h +++ b/backends/platform/symbian/src/SymbianActions.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SYMBIANACTIONS_H diff --git a/backends/platform/symbian/src/SymbianMain.cpp b/backends/platform/symbian/src/SymbianMain.cpp index 837961e89c3..8da2b239f4e 100644 --- a/backends/platform/symbian/src/SymbianMain.cpp +++ b/backends/platform/symbian/src/SymbianMain.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "backends/platform/symbian/src/portdefs.h" diff --git a/backends/platform/symbian/src/SymbianOS.cpp b/backends/platform/symbian/src/SymbianOS.cpp index bccbec4a525..9cccc81d193 100644 --- a/backends/platform/symbian/src/SymbianOS.cpp +++ b/backends/platform/symbian/src/SymbianOS.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include // for CSDLApp::GetExecutablePathCStr() @ Symbian::GetExecutablePath() diff --git a/backends/platform/symbian/src/SymbianOS.h b/backends/platform/symbian/src/SymbianOS.h index 0142054492b..74a102dc156 100644 --- a/backends/platform/symbian/src/SymbianOS.h +++ b/backends/platform/symbian/src/SymbianOS.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef PLATFORM_SDL_SYMBIAN_H diff --git a/backends/platform/symbian/src/portdefs.h b/backends/platform/symbian/src/portdefs.h index e8a620475e0..86460e65c54 100644 --- a/backends/platform/symbian/src/portdefs.h +++ b/backends/platform/symbian/src/portdefs.h @@ -17,12 +17,11 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ + #ifndef SYMBIAN_PORTDEFS_H #define SYMBIAN_PORTDEFS_H + #include #include #include @@ -40,6 +39,26 @@ #define M_PI 3.14159265358979323846 #endif /* M_PI */ + +// Enable Symbians own datatypes +// This is done for two reasons +// a) uint is already defined by Symbians libc component +// b) Symbian is using its "own" datatyping, and the Scummvm port +// should follow this to ensure the best compability possible. +typedef unsigned char byte; +typedef unsigned char uint8; +typedef signed char int8; +typedef unsigned short int uint16; +typedef signed short int int16; +typedef unsigned long int uint32; +typedef signed long int int32; + +// Define SCUMMVM_DONT_DEFINE_TYPES to prevent scummsys.h from trying to +// re-define those data types. +#define SCUMMVM_DONT_DEFINE_TYPES + +#define SMALL_SCREEN_DEVICE + #define DISABLE_COMMAND_LINE #if defined(USE_TREMOR) && !defined(USE_VORBIS) diff --git a/backends/platform/webos/main.cpp b/backends/platform/webos/main.cpp index eefdd304960..43c7ba18afa 100644 --- a/backends/platform/webos/main.cpp +++ b/backends/platform/webos/main.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h diff --git a/backends/platform/webos/webos.cpp b/backends/platform/webos/webos.cpp index 7db17f4b9f2..bfb19ed3bc5 100644 --- a/backends/platform/webos/webos.cpp +++ b/backends/platform/webos/webos.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "backends/platform/webos/webos.h" diff --git a/backends/platform/webos/webos.h b/backends/platform/webos/webos.h index 1cdba703e0a..850aaf9ce21 100644 --- a/backends/platform/webos/webos.h +++ b/backends/platform/webos/webos.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PLATFORM_SDL_WEBOS_H diff --git a/backends/platform/wii/options.cpp b/backends/platform/wii/options.cpp index ffabc5ae971..8c12ad9b81f 100644 --- a/backends/platform/wii/options.cpp +++ b/backends/platform/wii/options.cpp @@ -175,15 +175,15 @@ void WiiOptionsDialog::handleTickle() { break; case -EBUSY: - label = _("Initialising network"); + label = _("Initializing network"); break; case -ETIMEDOUT: - label = _("Timeout while initialising network"); + label = _("Timeout while initializing network"); break; default: - label = String::format(_("Network not initialised (%d)"), status); + label = String::format(_("Network not initialized (%d)"), status); break; } diff --git a/backends/platform/wince/CEActionsPocket.cpp b/backends/platform/wince/CEActionsPocket.cpp index 3895c7d6fa7..f2c461fcf99 100644 --- a/backends/platform/wince/CEActionsPocket.cpp +++ b/backends/platform/wince/CEActionsPocket.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/backends/platform/wince/CEActionsPocket.h b/backends/platform/wince/CEActionsPocket.h index 72a2064fbf1..fd97c0b1dff 100644 --- a/backends/platform/wince/CEActionsPocket.h +++ b/backends/platform/wince/CEActionsPocket.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CEACTIONSPOCKET_H diff --git a/backends/platform/wince/CEActionsSmartphone.cpp b/backends/platform/wince/CEActionsSmartphone.cpp index 413c52af2b4..fdd52cfc266 100644 --- a/backends/platform/wince/CEActionsSmartphone.cpp +++ b/backends/platform/wince/CEActionsSmartphone.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/backends/platform/wince/CEActionsSmartphone.h b/backends/platform/wince/CEActionsSmartphone.h index 29156bb1524..5535ce13502 100644 --- a/backends/platform/wince/CEActionsSmartphone.h +++ b/backends/platform/wince/CEActionsSmartphone.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CEACTIONSSMARTPHONE_H diff --git a/backends/platform/wince/CEDevice.cpp b/backends/platform/wince/CEDevice.cpp index ffe2523b472..640b1e91697 100644 --- a/backends/platform/wince/CEDevice.cpp +++ b/backends/platform/wince/CEDevice.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "CEDevice.h" diff --git a/backends/platform/wince/CEDevice.h b/backends/platform/wince/CEDevice.h index 24dffca0b3e..b9f815ac712 100644 --- a/backends/platform/wince/CEDevice.h +++ b/backends/platform/wince/CEDevice.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CEDEVICE_H diff --git a/backends/platform/wince/CEException.cpp b/backends/platform/wince/CEException.cpp index 08a327136f4..4a033541126 100644 --- a/backends/platform/wince/CEException.cpp +++ b/backends/platform/wince/CEException.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "CEException.h" diff --git a/backends/platform/wince/CEException.h b/backends/platform/wince/CEException.h index 08a51a3b3c0..3d4616f2826 100644 --- a/backends/platform/wince/CEException.h +++ b/backends/platform/wince/CEException.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/backends/platform/wince/CELauncherDialog.cpp b/backends/platform/wince/CELauncherDialog.cpp index 8824af732f2..9c832dd5857 100644 --- a/backends/platform/wince/CELauncherDialog.cpp +++ b/backends/platform/wince/CELauncherDialog.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. @@ -50,12 +47,9 @@ public: CEAboutDialog() : Dialog(10, 60, 300, 77) { char tempo[100]; - - // FIXME: Fingolfin asks: why is there a FIXME here? Please either clarify what - // needs fixing, or remove it! const int buttonWidth = g_gui.xmlEval()->getVar("Globals.Button.Width", 0); const int buttonHeight = g_gui.xmlEval()->getVar("Globals.Button.Height", 0); - new ButtonWidget(this, (_w - buttonWidth) / 2, 45, buttonWidth, buttonHeight, _("OK"), 0, kCloseCmd, '\r'); // Close dialog - FIXME + new ButtonWidget(this, (_w - buttonWidth) / 2, 55, buttonWidth, buttonHeight, _("OK"), 0, kCloseCmd, '\r'); Common::String videoDriver(_("Using SDL driver ")); SDL_VideoDriverName(tempo, sizeof(tempo)); @@ -64,7 +58,7 @@ public: Common::String displayInfos(_("Display ")); sprintf(tempo, "%dx%d (real %dx%d)", GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), OSystem_WINCE3::getScreenWidth(), OSystem_WINCE3::getScreenHeight()); displayInfos += tempo; - new StaticTextWidget(this, 0, 20, _w, kLineHeight, displayInfos, Graphics::kTextAlignCenter); + new StaticTextWidget(this, 0, 30, _w, kLineHeight, displayInfos, Graphics::kTextAlignCenter); } }; @@ -79,39 +73,22 @@ void CELauncherDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 d } } -void CELauncherDialog::automaticScanDirectory(const Common::FSNode &node) { - // First check if we have a recognized game in the current directory - Common::FSList files; - node.getChildren(files, Common::FSNode::kListFilesOnly); - // detect - GameList candidates(EngineMan.detectGames(files)); - // insert - if (candidates.size() >= 1) { - GameDescriptor result = candidates[0]; - result["path"] = node.getPath(); - addGameToConf(result); - } - // Then recurse on the subdirectories - Common::FSList dirs; - node.getChildren(dirs, Common::FSNode::kListDirectoriesOnly); - for (Common::FSList::const_iterator currentDir = dirs.begin(); currentDir != dirs.end(); ++currentDir) - automaticScanDirectory(*currentDir); - -} - -/* FIXME: We do this here, replicating code of the launcher, because findfirst/next - * returns some illegal paths atm. - */ void CELauncherDialog::addGame() { MessageDialog alert(_("Do you want to perform an automatic scan ?"), _("Yes"), _("No")); if (alert.runModal() == kMessageOK && _browser->runModal() > 0) { - // Clear existing domains - ConfigManager::DomainMap &domains = (ConfigManager::DomainMap &)ConfMan.getGameDomains(); - domains.clear(); - ConfMan.flushToDisk(); - automaticScanDirectory(_browser->getResult()); - ConfMan.flushToDisk(); - updateListing(); + MassAddDialog massAddDlg(_browser->getResult()); + + massAddDlg.runModal(); + + // Update the ListWidget and force a redraw + + // If new target(s) were added, update the ListWidget and move + // the selection to to first newly detected game. + Common::String newTarget = massAddDlg.getFirstAddedTarget(); + if (!newTarget.empty()) { + updateListing(); + selectTarget(newTarget); + } draw(); } else GUILauncherDialog::addGame(); diff --git a/backends/platform/wince/CELauncherDialog.h b/backends/platform/wince/CELauncherDialog.h index 7755e33dcce..ac84cd3e219 100644 --- a/backends/platform/wince/CELauncherDialog.h +++ b/backends/platform/wince/CELauncherDialog.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CELAUNCHERDIALOG_H @@ -29,6 +26,7 @@ #include "base/plugins.h" #include "common/fs.h" #include "gui/launcher.h" +#include "gui/massadd.h" class CELauncherDialog : public GUI::LauncherDialog { public: @@ -36,7 +34,6 @@ public: virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data); protected: void addGame(); - void automaticScanDirectory(const Common::FSNode &node); }; typedef GUI::LauncherDialog GUILauncherDialog; diff --git a/backends/platform/wince/CEScaler.cpp b/backends/platform/wince/CEScaler.cpp index 182a7e0c948..f07a7ec84be 100644 --- a/backends/platform/wince/CEScaler.cpp +++ b/backends/platform/wince/CEScaler.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "graphics/scaler/intern.h" diff --git a/backends/platform/wince/CEScaler.h b/backends/platform/wince/CEScaler.h index 4711f94bbae..de001f7348e 100644 --- a/backends/platform/wince/CEScaler.h +++ b/backends/platform/wince/CEScaler.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CESCALER_H diff --git a/backends/platform/wince/CEgui/CEGUI.h b/backends/platform/wince/CEgui/CEGUI.h index 1107e7d5e59..4e441154766 100644 --- a/backends/platform/wince/CEgui/CEGUI.h +++ b/backends/platform/wince/CEgui/CEGUI.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "ToolbarHandler.h" diff --git a/backends/platform/wince/CEgui/GUIElement.cpp b/backends/platform/wince/CEgui/GUIElement.cpp index e7ffc8d473b..241cf514f3f 100644 --- a/backends/platform/wince/CEgui/GUIElement.cpp +++ b/backends/platform/wince/CEgui/GUIElement.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "backends/platform/sdl/sdl-sys.h" diff --git a/backends/platform/wince/CEgui/GUIElement.h b/backends/platform/wince/CEgui/GUIElement.h index c599ebe9b51..2639de38ca1 100644 --- a/backends/platform/wince/CEgui/GUIElement.h +++ b/backends/platform/wince/CEgui/GUIElement.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CEGUI_GUIELEMENT_H diff --git a/backends/platform/wince/CEgui/ItemAction.cpp b/backends/platform/wince/CEgui/ItemAction.cpp index efbc43ce009..7d6316748b3 100644 --- a/backends/platform/wince/CEgui/ItemAction.cpp +++ b/backends/platform/wince/CEgui/ItemAction.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "ItemAction.h" diff --git a/backends/platform/wince/CEgui/ItemAction.h b/backends/platform/wince/CEgui/ItemAction.h index 4f35b3090d4..7b36eaf11ae 100644 --- a/backends/platform/wince/CEgui/ItemAction.h +++ b/backends/platform/wince/CEgui/ItemAction.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CEGUI_ITEMACTION_H diff --git a/backends/platform/wince/CEgui/ItemSwitch.cpp b/backends/platform/wince/CEgui/ItemSwitch.cpp index 8eb62bf3656..444826201cb 100644 --- a/backends/platform/wince/CEgui/ItemSwitch.cpp +++ b/backends/platform/wince/CEgui/ItemSwitch.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "ItemSwitch.h" diff --git a/backends/platform/wince/CEgui/ItemSwitch.h b/backends/platform/wince/CEgui/ItemSwitch.h index 1ca6f3c2889..724d31363c6 100644 --- a/backends/platform/wince/CEgui/ItemSwitch.h +++ b/backends/platform/wince/CEgui/ItemSwitch.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CEGUI_ITEMSWITCH_H diff --git a/backends/platform/wince/CEgui/Panel.cpp b/backends/platform/wince/CEgui/Panel.cpp index 576da230293..0853bae8f2d 100644 --- a/backends/platform/wince/CEgui/Panel.cpp +++ b/backends/platform/wince/CEgui/Panel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "Panel.h" diff --git a/backends/platform/wince/CEgui/Panel.h b/backends/platform/wince/CEgui/Panel.h index 1a8a580dbab..514ee5b8af6 100644 --- a/backends/platform/wince/CEgui/Panel.h +++ b/backends/platform/wince/CEgui/Panel.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CEGUI_PANEL_H diff --git a/backends/platform/wince/CEgui/PanelItem.cpp b/backends/platform/wince/CEgui/PanelItem.cpp index 8c68c797844..2849e256fbc 100644 --- a/backends/platform/wince/CEgui/PanelItem.cpp +++ b/backends/platform/wince/CEgui/PanelItem.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "PanelItem.h" diff --git a/backends/platform/wince/CEgui/PanelItem.h b/backends/platform/wince/CEgui/PanelItem.h index 9968aa8d5e3..8305311ff20 100644 --- a/backends/platform/wince/CEgui/PanelItem.h +++ b/backends/platform/wince/CEgui/PanelItem.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CEGUI_PANELITEM_H diff --git a/backends/platform/wince/CEgui/PanelKeyboard.cpp b/backends/platform/wince/CEgui/PanelKeyboard.cpp index 3512b34da3c..442d7fc68cb 100644 --- a/backends/platform/wince/CEgui/PanelKeyboard.cpp +++ b/backends/platform/wince/CEgui/PanelKeyboard.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "backends/platform/sdl/sdl-sys.h" diff --git a/backends/platform/wince/CEgui/PanelKeyboard.h b/backends/platform/wince/CEgui/PanelKeyboard.h index b98e6ff3a82..69d6a89bd22 100644 --- a/backends/platform/wince/CEgui/PanelKeyboard.h +++ b/backends/platform/wince/CEgui/PanelKeyboard.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CEGUI_PANELKEYBOARD_H diff --git a/backends/platform/wince/CEgui/SDL_ImageResource.cpp b/backends/platform/wince/CEgui/SDL_ImageResource.cpp index 872b94a442d..507f9ad7feb 100644 --- a/backends/platform/wince/CEgui/SDL_ImageResource.cpp +++ b/backends/platform/wince/CEgui/SDL_ImageResource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "backends/platform/sdl/sdl-sys.h" diff --git a/backends/platform/wince/CEgui/SDL_ImageResource.h b/backends/platform/wince/CEgui/SDL_ImageResource.h index 397ced1434e..08807a5c1f6 100644 --- a/backends/platform/wince/CEgui/SDL_ImageResource.h +++ b/backends/platform/wince/CEgui/SDL_ImageResource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CEGUI_SDL_IMAGERESOURCE_H diff --git a/backends/platform/wince/CEgui/Toolbar.cpp b/backends/platform/wince/CEgui/Toolbar.cpp index c41a30cb435..0e8e82f1f4e 100644 --- a/backends/platform/wince/CEgui/Toolbar.cpp +++ b/backends/platform/wince/CEgui/Toolbar.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "Toolbar.h" diff --git a/backends/platform/wince/CEgui/Toolbar.h b/backends/platform/wince/CEgui/Toolbar.h index 9fdf05ab3f8..c7e62bb3d94 100644 --- a/backends/platform/wince/CEgui/Toolbar.h +++ b/backends/platform/wince/CEgui/Toolbar.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CEGUI_TOOLBAR_H diff --git a/backends/platform/wince/CEgui/ToolbarHandler.cpp b/backends/platform/wince/CEgui/ToolbarHandler.cpp index ed2a72245ac..6f4ac317cd7 100644 --- a/backends/platform/wince/CEgui/ToolbarHandler.cpp +++ b/backends/platform/wince/CEgui/ToolbarHandler.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "backends/platform/sdl/sdl-sys.h" diff --git a/backends/platform/wince/CEgui/ToolbarHandler.h b/backends/platform/wince/CEgui/ToolbarHandler.h index 0f794d7d610..5709cf3f1a1 100644 --- a/backends/platform/wince/CEgui/ToolbarHandler.h +++ b/backends/platform/wince/CEgui/ToolbarHandler.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CEGUI_TOOLBARHANDLER_H diff --git a/backends/platform/wince/CEkeys/CEKeys.h b/backends/platform/wince/CEkeys/CEKeys.h index 87e6d461dae..ac4907704da 100644 --- a/backends/platform/wince/CEkeys/CEKeys.h +++ b/backends/platform/wince/CEkeys/CEKeys.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "EventsBuffer.h" diff --git a/backends/platform/wince/CEkeys/EventsBuffer.cpp b/backends/platform/wince/CEkeys/EventsBuffer.cpp index beea272d2bd..d5818c37319 100644 --- a/backends/platform/wince/CEkeys/EventsBuffer.cpp +++ b/backends/platform/wince/CEkeys/EventsBuffer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "backends/platform/sdl/sdl-sys.h" diff --git a/backends/platform/wince/CEkeys/EventsBuffer.h b/backends/platform/wince/CEkeys/EventsBuffer.h index 9b766c6ca99..235a3e7afdc 100644 --- a/backends/platform/wince/CEkeys/EventsBuffer.h +++ b/backends/platform/wince/CEkeys/EventsBuffer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CEKEYS_EVENTSBUFFER_H diff --git a/backends/platform/wince/Makefile b/backends/platform/wince/Makefile index 21bff06f959..a9741f396fb 100644 --- a/backends/platform/wince/Makefile +++ b/backends/platform/wince/Makefile @@ -1,7 +1,5 @@ # ScummVM Makefile for Windows CE port # Uses the cegcc toolchain. For build info check out the wiki: http://wiki.scummvm.org -# $URL$ -# $Id$ ######################################################################## ## Do you want a debug build or not? diff --git a/backends/platform/wince/README-WinCE.txt b/backends/platform/wince/README-WinCE.txt index 69abd66e697..c48d9ca9982 100644 --- a/backends/platform/wince/README-WinCE.txt +++ b/backends/platform/wince/README-WinCE.txt @@ -1,15 +1,49 @@ ScummVM Windows CE FAQ -Last updated: $Date$ -Release version: 1.1.0 +Last updated: 2011-05-27 +Release version: 1.3.0 ------------------------------------------------------------------------ New in this version ------------------- -1.1.1 +1.3.0: +This is the first official Windows CE release since 1.1.1. + +The following new engines are now included (changes since last WinCE release): + - Draci Engine (Dragon History) + - Hugo Engine (Hugo Trilogy) + - Mohawk Engine (Myst, Riven, Living Book games & Where in Time is Carmen + Sandiego?) + - SCI Engine (Sierra SCI games, see main README for a list of supported games) + - Toon Engine (Toonstruck) + +Also, there are now 4 binaries in this distribution, a single executable +which contains all engines (for devices with enough memory) and 3 smaller +binaries which contain only some of the engines. The following lists all +executables and the engines they contain: + +scummvm.exe: + - all supported engines +scummvm1.exe: + - scumm, agi, cruise, draci, lure, queen, sky, sword1, tinsel, touche +scummvm2.exe: + - agos, cine, drascula, gob, groovie, kyra, made, parallaction, saga, + teenagent, tucker +scummvm3.exe: + - hugo, mohawk, sci, sword2, toon + +There are no other port specific changes. + +1.2.1: +(Note: No official 1.2.1 release) + +1.2.0: +(Note: No official 1.2.0 release) + +1.1.1: Fix to the Normal2xAspect scaler that was causing crashes. -1.1.0 +1.1.0: The TeenAgent engine is now included, but there are no other port specific changes since 1.0.0. diff --git a/backends/platform/wince/missing/io.h b/backends/platform/wince/missing/io.h index 96bc6a9ea16..de492cac684 100644 --- a/backends/platform/wince/missing/io.h +++ b/backends/platform/wince/missing/io.h @@ -1,7 +1,6 @@ /* Header is not present in Windows CE SDK */ /* This stuff will live here until port configuration file is in place */ -#define stricmp _stricmp #define strdup _strdup #ifndef _FILE_DEFINED diff --git a/backends/platform/wince/missing/missing.cpp b/backends/platform/wince/missing/missing.cpp index c855247ae11..ba35f15bb76 100644 --- a/backends/platform/wince/missing/missing.cpp +++ b/backends/platform/wince/missing/missing.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* Original code: diff --git a/backends/platform/wince/module.mk b/backends/platform/wince/module.mk index d1c95f5df48..ddad024084c 100644 --- a/backends/platform/wince/module.mk +++ b/backends/platform/wince/module.mk @@ -21,9 +21,12 @@ MODULE_OBJS := \ ../../../gui/Key.o \ ../../../gui/KeysDialog.o \ missing/missing.o \ - PocketSCUMM.o \ smartLandScale.o +ifndef DYNAMIC_MODULES +MODULE_OBJS += PocketSCUMM.o +endif + # We don't use rules.mk but rather manually update OBJS and MODULE_DIRS. MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) OBJS := $(MODULE_OBJS) $(OBJS) diff --git a/backends/platform/wince/portdefs.h b/backends/platform/wince/portdefs.h index 8ad643946fc..93df6cd39e9 100644 --- a/backends/platform/wince/portdefs.h +++ b/backends/platform/wince/portdefs.h @@ -18,49 +18,49 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ -// Missing string/stdlib/assert declarations for WinCE 2.xx +#ifndef WINCE_PORTDEFS_H +#define WINCE_PORTDEFS_H +#ifndef _WIN32_WCE +#error For use on WinCE only +#endif + +// Missing string/stdlib/assert declarations for WinCE 2.xx #if _WIN32_WCE < 300 -void *calloc(size_t n, size_t s); -int isalnum(int c); -int isdigit(int c); -int isprint(int c); -int isspace(int c); -char *strrchr(const char *s, int c); -char *strdup(const char *s); -int _stricmp(const char *string1, const char *string2); -int stricmp(const char *string1, const char *string2); -void assert(void *expression); -void assert(int expression); -long int strtol(const char *nptr, char **endptr, int base); -char *_strdup(const char *s); -char *strpbrk(const char *s, const char *accept); + #define SMALL_SCREEN_DEVICE + + void *calloc(size_t n, size_t s); + int isalnum(int c); + int isdigit(int c); + int isprint(int c); + int isspace(int c); + char *strrchr(const char *s, int c); + char *strdup(const char *s); + void assert(void *expression); + void assert(int expression); + long int strtol(const char *nptr, char **endptr, int base); + char *_strdup(const char *s); + char *strpbrk(const char *s, const char *accept); #endif -#ifdef _WIN32_WCE #ifndef __GNUC__ -void *bsearch(const void *, const void *, size_t, size_t, int (*x)(const void *, const void *)); -char *getcwd(char *buf, int size); -typedef int ptrdiff_t; -void GetCurrentDirectory(int len, char *buf); -#define INVALID_FILE_ATTRIBUTES 0xffffffff + void *bsearch(const void *, const void *, size_t, size_t, int (*x)(const void *, const void *)); + char *getcwd(char *buf, int size); + typedef int ptrdiff_t; + void GetCurrentDirectory(int len, char *buf); + #define INVALID_FILE_ATTRIBUTES 0xffffffff #else -#include -#undef GetCurrentDirectory -extern "C" void GetCurrentDirectory(int len, char *buf); -#define stricmp _stricmp -#define strnicmp _strnicmp -#define snprintf _snprintf -#define strdup _strdup -#define fopen wce_fopen + #include + #undef GetCurrentDirectory + extern "C" void GetCurrentDirectory(int len, char *buf); + #define snprintf _snprintf + #define strdup _strdup + #define fopen wce_fopen #endif #include @@ -75,7 +75,7 @@ extern "C" void GetCurrentDirectory(int len, char *buf); //#include #ifdef __MINGW32CE__ -void *bsearch(const void *, const void *, size_t, size_t, int (*x)(const void *, const void *)); + void *bsearch(const void *, const void *, size_t, size_t, int (*x)(const void *, const void *)); #endif int remove(const char *path); int _access(const char *path, int mode); @@ -84,4 +84,5 @@ void drawError(char *); #define vsnprintf _vsnprintf + #endif diff --git a/backends/platform/wince/smartLandScale.s b/backends/platform/wince/smartLandScale.s index 4f26462e959..f8771bc524a 100644 --- a/backends/platform/wince/smartLandScale.s +++ b/backends/platform/wince/smartLandScale.s @@ -18,9 +18,6 @@ @ along with this program; if not, write to the Free Software @ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @ -@ $URL$ -@ $Id$ -@ @ @author Robin Watts (robin@wss.co.uk) @ For 16 source pixels 0123456789ABCDEF, we want to produce 11 output diff --git a/backends/platform/wince/stub.cpp b/backends/platform/wince/stub.cpp index 9dad8638e1c..9f42dc76aab 100644 --- a/backends/platform/wince/stub.cpp +++ b/backends/platform/wince/stub.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index b54aebe6bd5..a53bc416678 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -66,6 +63,7 @@ #include "backends/mixer/wincesdl/wincesdl-mixer.h" #ifdef DYNAMIC_MODULES +#include #include "backends/plugins/win32/win32-provider.h" #endif diff --git a/backends/platform/wince/wince-sdl.h b/backends/platform/wince/wince-sdl.h index d7ede8ca81c..a1e46081f9c 100644 --- a/backends/platform/wince/wince-sdl.h +++ b/backends/platform/wince/wince-sdl.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef WINCE_SDL_H diff --git a/backends/platform/wince/wince.mk b/backends/platform/wince/wince.mk index 39be1e84e54..cac3ad4e8f1 100644 --- a/backends/platform/wince/wince.mk +++ b/backends/platform/wince/wince.mk @@ -2,3 +2,10 @@ backends/platform/wince/PocketSCUMM.o: $(srcdir)/backends/platform/wince/PocketS $(QUIET)$(MKDIR) $(*D) $(WINDRES) $(WINDRESFLAGS) -I$(srcdir)/backends/platform/wince $< $@ +ifdef DYNAMIC_MODULES +plugins: backends/platform/wince/stub.o backends/platform/wince/PocketSCUMM.o + $(CXX) backends/platform/wince/stub.o backends/platform/wince/PocketSCUMM.o -L. -lscummvm -o scummvm.exe + +backends/platform/wince/stub.o: $(srcdir)/backends/platform/wince/stub.cpp + $(CXX) -c $(srcdir)/backends/platform/wince/stub.cpp -o backends/platform/wince/stub.o +endif diff --git a/backends/plugins/ds/ds-provider.cpp b/backends/plugins/ds/ds-provider.cpp index d0697371e97..ff4cbe5f96a 100644 --- a/backends/plugins/ds/ds-provider.cpp +++ b/backends/plugins/ds/ds-provider.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/plugins/ds/ds-provider.h b/backends/plugins/ds/ds-provider.h index dcb93c085fe..df8307a52d1 100644 --- a/backends/plugins/ds/ds-provider.h +++ b/backends/plugins/ds/ds-provider.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if defined(DYNAMIC_MODULES) && defined(__DS__) diff --git a/backends/plugins/dynamic-plugin.h b/backends/plugins/dynamic-plugin.h index 775e887105f..d68321b2a91 100644 --- a/backends/plugins/dynamic-plugin.h +++ b/backends/plugins/dynamic-plugin.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_PLUGINS_DYNAMICPLUGIN_H diff --git a/backends/plugins/elf/arm-loader.cpp b/backends/plugins/elf/arm-loader.cpp index 93d3c60f846..12204ef68f1 100644 --- a/backends/plugins/elf/arm-loader.cpp +++ b/backends/plugins/elf/arm-loader.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/plugins/elf/arm-loader.h b/backends/plugins/elf/arm-loader.h index cb4230c1ee0..60bc4f87206 100644 --- a/backends/plugins/elf/arm-loader.h +++ b/backends/plugins/elf/arm-loader.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_PLUGINS_ARM_LOADER_H diff --git a/backends/plugins/elf/elf-loader.cpp b/backends/plugins/elf/elf-loader.cpp index f502fa2776c..b25bcf835b4 100644 --- a/backends/plugins/elf/elf-loader.cpp +++ b/backends/plugins/elf/elf-loader.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/plugins/elf/elf-loader.h b/backends/plugins/elf/elf-loader.h index e11aaf1ad07..a9535076313 100644 --- a/backends/plugins/elf/elf-loader.h +++ b/backends/plugins/elf/elf-loader.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_PLUGINS_ELF_LOADER_H diff --git a/backends/plugins/elf/elf-provider.cpp b/backends/plugins/elf/elf-provider.cpp index 084f5eace79..480f7068c42 100644 --- a/backends/plugins/elf/elf-provider.cpp +++ b/backends/plugins/elf/elf-provider.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/plugins/elf/elf-provider.h b/backends/plugins/elf/elf-provider.h index 8cc9e0a9963..62ea930829d 100644 --- a/backends/plugins/elf/elf-provider.h +++ b/backends/plugins/elf/elf-provider.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_PLUGINS_ELF_PROVIDER_H diff --git a/backends/plugins/elf/elf32.h b/backends/plugins/elf/elf32.h index 48ebf2e7b2e..aecedf5a37e 100644 --- a/backends/plugins/elf/elf32.h +++ b/backends/plugins/elf/elf32.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_ELF_H diff --git a/backends/plugins/elf/memory-manager.cpp b/backends/plugins/elf/memory-manager.cpp index d32ac2da284..39f5e9071d6 100644 --- a/backends/plugins/elf/memory-manager.cpp +++ b/backends/plugins/elf/memory-manager.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/plugins/elf/memory-manager.h b/backends/plugins/elf/memory-manager.h index 7a5f3c25dfc..ac70e5e3bb5 100644 --- a/backends/plugins/elf/memory-manager.h +++ b/backends/plugins/elf/memory-manager.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef ELF_MEMORY_MANAGER_H diff --git a/backends/plugins/elf/mips-loader.cpp b/backends/plugins/elf/mips-loader.cpp index 42af831ef44..8ce1a695830 100644 --- a/backends/plugins/elf/mips-loader.cpp +++ b/backends/plugins/elf/mips-loader.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/plugins/elf/mips-loader.h b/backends/plugins/elf/mips-loader.h index 23bd5980c83..3066589c9bc 100644 --- a/backends/plugins/elf/mips-loader.h +++ b/backends/plugins/elf/mips-loader.h @@ -19,9 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_PLUGINS_MIPS_LOADER_H diff --git a/backends/plugins/elf/ppc-loader.cpp b/backends/plugins/elf/ppc-loader.cpp index ec6d4428761..2f7042c6822 100644 --- a/backends/plugins/elf/ppc-loader.cpp +++ b/backends/plugins/elf/ppc-loader.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/plugins/elf/ppc-loader.h b/backends/plugins/elf/ppc-loader.h index edf2b33965a..9aa6c949f18 100644 --- a/backends/plugins/elf/ppc-loader.h +++ b/backends/plugins/elf/ppc-loader.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_PLUGINS_PPC_LOADER_H diff --git a/backends/plugins/elf/shorts-segment-manager.cpp b/backends/plugins/elf/shorts-segment-manager.cpp index 99a765287b4..b3a9531c2dd 100644 --- a/backends/plugins/elf/shorts-segment-manager.cpp +++ b/backends/plugins/elf/shorts-segment-manager.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/plugins/elf/shorts-segment-manager.h b/backends/plugins/elf/shorts-segment-manager.h index 219648d91d9..8293d55c085 100644 --- a/backends/plugins/elf/shorts-segment-manager.h +++ b/backends/plugins/elf/shorts-segment-manager.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SHORTS_SEGMENT_MANAGER_H diff --git a/backends/plugins/elf/version.cpp b/backends/plugins/elf/version.cpp index 0277c6ae1cd..593a17fb2ba 100644 --- a/backends/plugins/elf/version.cpp +++ b/backends/plugins/elf/version.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "backends/plugins/elf/version.h" diff --git a/backends/plugins/elf/version.h b/backends/plugins/elf/version.h index 726204aeb74..915132e8c4a 100644 --- a/backends/plugins/elf/version.h +++ b/backends/plugins/elf/version.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef BACKENDS_PLUGINS_ELF_VERSION_H diff --git a/backends/plugins/posix/posix-provider.cpp b/backends/plugins/posix/posix-provider.cpp index dd3591a9920..a68a792fa48 100644 --- a/backends/plugins/posix/posix-provider.cpp +++ b/backends/plugins/posix/posix-provider.cpp @@ -18,14 +18,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" -#if defined(DYNAMIC_MODULES) && defined(UNIX) +#if defined(DYNAMIC_MODULES) && defined(POSIX) #include "backends/plugins/posix/posix-provider.h" #include "backends/plugins/dynamic-plugin.h" @@ -80,9 +77,9 @@ public: }; -Plugin* POSIXPluginProvider::createPlugin(const Common::FSNode &node) const { +Plugin *POSIXPluginProvider::createPlugin(const Common::FSNode &node) const { return new POSIXPlugin(node.getPath()); } -#endif // defined(DYNAMIC_MODULES) && defined(UNIX) +#endif // defined(DYNAMIC_MODULES) && defined(POSIX) diff --git a/backends/plugins/posix/posix-provider.h b/backends/plugins/posix/posix-provider.h index b7d8c9f9454..b1186ccf3fd 100644 --- a/backends/plugins/posix/posix-provider.h +++ b/backends/plugins/posix/posix-provider.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_PLUGINS_POSIX_H @@ -28,13 +25,13 @@ #include "base/plugins.h" -#if defined(DYNAMIC_MODULES) && defined(UNIX) +#if defined(DYNAMIC_MODULES) && defined(POSIX) class POSIXPluginProvider : public FilePluginProvider { protected: - Plugin* createPlugin(const Common::FSNode &node) const; + Plugin *createPlugin(const Common::FSNode &node) const; }; -#endif // defined(DYNAMIC_MODULES) && defined(UNIX) +#endif // defined(DYNAMIC_MODULES) && defined(POSIX) #endif diff --git a/backends/plugins/ps2/ps2-provider.cpp b/backends/plugins/ps2/ps2-provider.cpp index 0836ed18b4d..7c7409eaf9a 100644 --- a/backends/plugins/ps2/ps2-provider.cpp +++ b/backends/plugins/ps2/ps2-provider.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/plugins/ps2/ps2-provider.h b/backends/plugins/ps2/ps2-provider.h index 3d4b4b0128d..b9006b17167 100644 --- a/backends/plugins/ps2/ps2-provider.h +++ b/backends/plugins/ps2/ps2-provider.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if defined(DYNAMIC_MODULES) && defined(__PLAYSTATION2__) diff --git a/backends/plugins/psp/psp-provider.cpp b/backends/plugins/psp/psp-provider.cpp index 5fa083c88cd..0c41af24a11 100644 --- a/backends/plugins/psp/psp-provider.cpp +++ b/backends/plugins/psp/psp-provider.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/plugins/psp/psp-provider.h b/backends/plugins/psp/psp-provider.h index 682871fd9a0..0cc04577402 100644 --- a/backends/plugins/psp/psp-provider.h +++ b/backends/plugins/psp/psp-provider.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if defined(DYNAMIC_MODULES) && defined(__PSP__) diff --git a/backends/plugins/sdl/sdl-provider.cpp b/backends/plugins/sdl/sdl-provider.cpp index 5172abc4b0e..00520b48b09 100644 --- a/backends/plugins/sdl/sdl-provider.cpp +++ b/backends/plugins/sdl/sdl-provider.cpp @@ -18,14 +18,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" -#if defined(DYNAMIC_MODULES) && defined(SDL_BACKEND) +#if defined(DYNAMIC_MODULES) && defined(SDL_BACKEND) && !defined(_WIN32_WCE) #include "backends/plugins/sdl/sdl-provider.h" #include "backends/plugins/dynamic-plugin.h" diff --git a/backends/plugins/sdl/sdl-provider.h b/backends/plugins/sdl/sdl-provider.h index 350261a37ff..881aa5cc19f 100644 --- a/backends/plugins/sdl/sdl-provider.h +++ b/backends/plugins/sdl/sdl-provider.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_PLUGINS_SDL_H diff --git a/backends/plugins/wii/wii-provider.cpp b/backends/plugins/wii/wii-provider.cpp index 639616ac159..fa855883488 100644 --- a/backends/plugins/wii/wii-provider.cpp +++ b/backends/plugins/wii/wii-provider.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/plugins/wii/wii-provider.h b/backends/plugins/wii/wii-provider.h index 4ec771490d3..573a8e7e594 100644 --- a/backends/plugins/wii/wii-provider.h +++ b/backends/plugins/wii/wii-provider.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if defined(DYNAMIC_MODULES) && defined(__WII__) diff --git a/backends/plugins/win32/win32-provider.cpp b/backends/plugins/win32/win32-provider.cpp index 793b1bfc0ce..0a08e48e6f7 100644 --- a/backends/plugins/win32/win32-provider.cpp +++ b/backends/plugins/win32/win32-provider.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" @@ -70,12 +67,11 @@ public: bool loadPlugin() { assert(!_dlHandle); - #ifndef _WIN32_WCE +#ifndef _WIN32_WCE _dlHandle = LoadLibrary(_filename.c_str()); - #else - if (!_filename.hasSuffix("scummvm.dll")) // skip loading the core scummvm module - _dlHandle = LoadLibrary(toUnicode(_filename.c_str())); - #endif +#else + _dlHandle = LoadLibrary(toUnicode(_filename.c_str())); +#endif if (!_dlHandle) { debug("Failed loading plugin '%s' (error code %d)", _filename.c_str(), (int32) GetLastError()); @@ -107,7 +103,11 @@ Plugin* Win32PluginProvider::createPlugin(const Common::FSNode &node) const { bool Win32PluginProvider::isPluginFilename(const Common::FSNode &node) const { // Check the plugin suffix Common::String filename = node.getName(); +#ifndef _WIN32_WCE if (!filename.hasSuffix(".dll")) +#else + if (!filename.hasSuffix(".plugin")) +#endif return false; return true; diff --git a/backends/plugins/win32/win32-provider.h b/backends/plugins/win32/win32-provider.h index 53f60283f6c..42c04e6d59f 100644 --- a/backends/plugins/win32/win32-provider.h +++ b/backends/plugins/win32/win32-provider.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_PLUGINS_WIN32_H diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp index 75e10cf810a..237c50a1ba7 100644 --- a/backends/saves/default/default-saves.cpp +++ b/backends/saves/default/default-saves.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/saves/default/default-saves.h b/backends/saves/default/default-saves.h index ea3d9e6d440..1ea87efc675 100644 --- a/backends/saves/default/default-saves.h +++ b/backends/saves/default/default-saves.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(BACKEND_SAVES_DEFAULT_H) && !defined(DISABLE_DEFAULT_SAVEFILEMANAGER) diff --git a/backends/saves/posix/posix-saves.cpp b/backends/saves/posix/posix-saves.cpp index 3a8e5e998e8..e04609be5b9 100644 --- a/backends/saves/posix/posix-saves.cpp +++ b/backends/saves/posix/posix-saves.cpp @@ -18,19 +18,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ -// Enable mkdir +// Enable getenv, mkdir and time.h stuff +#define FORBIDDEN_SYMBOL_EXCEPTION_getenv #define FORBIDDEN_SYMBOL_EXCEPTION_mkdir #define FORBIDDEN_SYMBOL_EXCEPTION_time_h //On IRIX, sys/stat.h includes sys/time.h #include "common/scummsys.h" -#if defined(UNIX) && !defined(DISABLE_DEFAULT_SAVEFILEMANAGER) +#if defined(POSIX) && !defined(DISABLE_DEFAULT_SAVEFILEMANAGER) #include "backends/saves/posix/posix-saves.h" @@ -53,7 +51,7 @@ POSIXSaveFileManager::POSIXSaveFileManager() { // Register default savepath based on HOME #if defined(SAMSUNGTV) - ConfMan.registerDefault("savepath", "/dtv/usb/sda1/.scummvm"); + ConfMan.registerDefault("savepath", "/mtd_wiselink/scummvm savegames"); #else Common::String savePath; const char *home = getenv("HOME"); @@ -62,15 +60,30 @@ POSIXSaveFileManager::POSIXSaveFileManager() { savePath += "/" DEFAULT_SAVE_PATH; ConfMan.registerDefault("savepath", savePath); } + + // The user can override the savepath with the SCUMMVM_SAVEPATH + // environment variable. This is weaker than a --savepath on the + // command line, but overrides the default savepath. + // + // To ensure that the command line option (if given) has precedence, + // we only set the value in the transient domain if it is not + // yet present there. + if (!ConfMan.hasKey("savepath", Common::ConfigManager::kTransientDomain)) { + const char *dir = getenv("SCUMMVM_SAVEPATH"); + if (dir && *dir && strlen(dir) < MAXPATHLEN) { + Common::FSNode saveDir(dir); + if (!saveDir.exists()) { + warning("Ignoring non-existent SCUMMVM_SAVEPATH '%s'", dir); + } else if (!saveDir.isWritable()) { + warning("Ignoring non-writable SCUMMVM_SAVEPATH '%s'", dir); + } else { + ConfMan.set("savepath", dir, Common::ConfigManager::kTransientDomain); + } + } + } #endif } -/* -POSIXSaveFileManager::POSIXSaveFileManager(const Common::String &defaultSavepath) - : DefaultSaveFileManager(defaultSavepath) { -} -*/ -#if defined(UNIX) void POSIXSaveFileManager::checkPath(const Common::FSNode &dir) { const Common::String path = dir.getPath(); clearError(); @@ -135,6 +148,5 @@ void POSIXSaveFileManager::checkPath(const Common::FSNode &dir) { } } } -#endif #endif diff --git a/backends/saves/posix/posix-saves.h b/backends/saves/posix/posix-saves.h index a2543a54fa4..160075d3db0 100644 --- a/backends/saves/posix/posix-saves.h +++ b/backends/saves/posix/posix-saves.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(BACKEND_POSIX_SAVES_H) && !defined(DISABLE_DEFAULT_SAVEFILEMANAGER) @@ -28,7 +25,7 @@ #include "backends/saves/default/default-saves.h" -#if defined(UNIX) +#if defined(POSIX) && !defined(DISABLE_DEFAULT_SAVEFILEMANAGER) /** * Customization of the DefaultSaveFileManager for POSIX platforms. * The only two differences are that the default constructor sets @@ -38,7 +35,6 @@ class POSIXSaveFileManager : public DefaultSaveFileManager { public: POSIXSaveFileManager(); -// POSIXSaveFileManager(const Common::String &defaultSavepath); protected: /** diff --git a/backends/saves/psp/psp-saves.cpp b/backends/saves/psp/psp-saves.cpp index 5752d2fa5f2..006a4e815d8 100644 --- a/backends/saves/psp/psp-saves.cpp +++ b/backends/saves/psp/psp-saves.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable printf override in common/forbidden.h to avoid diff --git a/backends/saves/psp/psp-saves.h b/backends/saves/psp/psp-saves.h index d987f935a9b..de2d8a693ea 100644 --- a/backends/saves/psp/psp-saves.h +++ b/backends/saves/psp/psp-saves.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKEND_PSP_SAVES_H diff --git a/backends/saves/savefile.cpp b/backends/saves/savefile.cpp index 98881460497..edfdd9bc20e 100644 --- a/backends/saves/savefile.cpp +++ b/backends/saves/savefile.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/backends/timer/default/default-timer.cpp b/backends/timer/default/default-timer.cpp index b5060c4c8d5..8480fcc7ee3 100644 --- a/backends/timer/default/default-timer.cpp +++ b/backends/timer/default/default-timer.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/scummsys.h" diff --git a/backends/timer/default/default-timer.h b/backends/timer/default/default-timer.h index 9a353f58c39..66d2e3b0917 100644 --- a/backends/timer/default/default-timer.h +++ b/backends/timer/default/default-timer.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef BACKENDS_TIMER_DEFAULT_H diff --git a/backends/timer/psp/timer.cpp b/backends/timer/psp/timer.cpp index 9e36b434902..ce998436e00 100644 --- a/backends/timer/psp/timer.cpp +++ b/backends/timer/psp/timer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable printf override in common/forbidden.h to avoid diff --git a/backends/timer/psp/timer.h b/backends/timer/psp/timer.h index b2b9e8c811e..76eebfd6a4f 100644 --- a/backends/timer/psp/timer.h +++ b/backends/timer/psp/timer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PSP_TIMER_H diff --git a/backends/timer/sdl/sdl-timer.cpp b/backends/timer/sdl/sdl-timer.cpp index 647ddba2d3b..33596f4bd8b 100644 --- a/backends/timer/sdl/sdl-timer.cpp +++ b/backends/timer/sdl/sdl-timer.cpp @@ -19,9 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/timer/sdl/sdl-timer.h b/backends/timer/sdl/sdl-timer.h index 8c609d728dd..069a266e456 100644 --- a/backends/timer/sdl/sdl-timer.h +++ b/backends/timer/sdl/sdl-timer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BACKENDS_TIMER_SDL_H diff --git a/backends/vkeybd/image-map.cpp b/backends/vkeybd/image-map.cpp index f4b4541d7e8..275ec865ed0 100644 --- a/backends/vkeybd/image-map.cpp +++ b/backends/vkeybd/image-map.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/vkeybd/image-map.h b/backends/vkeybd/image-map.h index 269ad265cd9..3bd8cfa0dbc 100644 --- a/backends/vkeybd/image-map.h +++ b/backends/vkeybd/image-map.h @@ -18,17 +18,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_IMAGEMAP_H #define COMMON_IMAGEMAP_H +#include "common/scummsys.h" + #ifdef ENABLE_VKEYBD -#include "common/scummsys.h" #include "common/hashmap.h" #include "common/hash-str.h" diff --git a/backends/vkeybd/packs/vkeybd_default.zip b/backends/vkeybd/packs/vkeybd_default.zip index 94c46497684..960e9431523 100644 Binary files a/backends/vkeybd/packs/vkeybd_default.zip and b/backends/vkeybd/packs/vkeybd_default.zip differ diff --git a/backends/vkeybd/polygon.cpp b/backends/vkeybd/polygon.cpp index 8becbed5859..ac42cb1d2e3 100644 --- a/backends/vkeybd/polygon.cpp +++ b/backends/vkeybd/polygon.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/vkeybd/polygon.h b/backends/vkeybd/polygon.h index 8b5bd5c1cc4..19a12a04098 100644 --- a/backends/vkeybd/polygon.h +++ b/backends/vkeybd/polygon.h @@ -18,17 +18,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_POLYGON_H #define COMMON_POLYGON_H +#include "common/scummsys.h" + #ifdef ENABLE_VKEYBD -#include "common/scummsys.h" #include "common/array.h" #include "common/rect.h" diff --git a/backends/vkeybd/virtual-keyboard-gui.cpp b/backends/vkeybd/virtual-keyboard-gui.cpp index 9ffda6e3a79..1c05d623161 100644 --- a/backends/vkeybd/virtual-keyboard-gui.cpp +++ b/backends/vkeybd/virtual-keyboard-gui.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/scummsys.h" diff --git a/backends/vkeybd/virtual-keyboard-gui.h b/backends/vkeybd/virtual-keyboard-gui.h index 9bced3aa9bb..da80ef22232 100644 --- a/backends/vkeybd/virtual-keyboard-gui.h +++ b/backends/vkeybd/virtual-keyboard-gui.h @@ -18,18 +18,16 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef COMMON_VIRTUAL_KEYBOARD_GUI_H #define COMMON_VIRTUAL_KEYBOARD_GUI_H +#include "common/scummsys.h" + #ifdef ENABLE_VKEYBD #include "backends/vkeybd/virtual-keyboard.h" -#include "common/scummsys.h" #include "common/rect.h" #include "common/system.h" #include "graphics/font.h" diff --git a/backends/vkeybd/virtual-keyboard-parser.cpp b/backends/vkeybd/virtual-keyboard-parser.cpp index 3ebdfdc6534..e2b35132dcd 100644 --- a/backends/vkeybd/virtual-keyboard-parser.cpp +++ b/backends/vkeybd/virtual-keyboard-parser.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/vkeybd/virtual-keyboard-parser.h b/backends/vkeybd/virtual-keyboard-parser.h index 1327008a80e..eb25ebe6fdb 100644 --- a/backends/vkeybd/virtual-keyboard-parser.h +++ b/backends/vkeybd/virtual-keyboard-parser.h @@ -18,17 +18,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_VIRTUAL_KEYBOARD_PARSER_H #define COMMON_VIRTUAL_KEYBOARD_PARSER_H +#include "common/scummsys.h" + #ifdef ENABLE_VKEYBD -#include "common/scummsys.h" #include "common/xmlparser.h" #include "backends/vkeybd/virtual-keyboard.h" diff --git a/backends/vkeybd/virtual-keyboard.cpp b/backends/vkeybd/virtual-keyboard.cpp index e1a25474e7b..afdb8005628 100644 --- a/backends/vkeybd/virtual-keyboard.cpp +++ b/backends/vkeybd/virtual-keyboard.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/vkeybd/virtual-keyboard.h b/backends/vkeybd/virtual-keyboard.h index 169cd678334..21db5a47dae 100644 --- a/backends/vkeybd/virtual-keyboard.h +++ b/backends/vkeybd/virtual-keyboard.h @@ -18,19 +18,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_VIRTUAL_KEYBOARD_H #define COMMON_VIRTUAL_KEYBOARD_H +#include "common/scummsys.h" + #ifdef ENABLE_VKEYBD class OSystem; -#include "common/scummsys.h" #include "common/events.h" #include "common/hashmap.h" #include "common/hash-str.h" diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 05e1d2c1310..78eea500829 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -18,14 +18,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // FIXME: Avoid using printf #define FORBIDDEN_SYMBOL_EXCEPTION_printf +#define FORBIDDEN_SYMBOL_EXCEPTION_exit + #include "engines/metaengine.h" #include "base/commandLine.h" #include "base/plugins.h" @@ -888,7 +887,8 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha #endif // DISABLE_COMMAND_LINE -Common::Error processSettings(Common::String &command, Common::StringMap &settings) { +bool processSettings(Common::String &command, Common::StringMap &settings, Common::Error &err) { + err = Common::kNoError; #ifndef DISABLE_COMMAND_LINE @@ -897,33 +897,34 @@ Common::Error processSettings(Common::String &command, Common::StringMap &settin // have been loaded. if (command == "list-targets") { listTargets(); - return Common::kNoError; + return true; } else if (command == "list-games") { listGames(); - return Common::kNoError; + return true; } else if (command == "list-saves") { - return listSaves(settings["list-saves"].c_str()); + err = listSaves(settings["list-saves"].c_str()); + return true; } else if (command == "list-themes") { listThemes(); - return Common::kNoError; + return true; } else if (command == "version") { printf("%s\n", gScummVMFullVersion); printf("Features compiled in: %s\n", gScummVMFeatures); - return Common::kNoError; + return true; } else if (command == "help") { printf(HELP_STRING, s_appName); - return Common::kNoError; + return true; } #ifdef DETECTOR_TESTING_HACK else if (command == "test-detector") { runDetectorTest(); - return Common::kNoError; + return true; } #endif #ifdef UPGRADE_ALL_TARGETS_HACK else if (command == "upgrade-targets") { upgradeTargets(); - return Common::kNoError; + return true; } #endif @@ -961,26 +962,6 @@ Common::Error processSettings(Common::String &command, Common::StringMap &settin } - // The user can override the savepath with the SCUMMVM_SAVEPATH - // environment variable. This is weaker than a --savepath on the - // command line, but overrides the default savepath, hence it is - // handled here, just before the command line gets parsed. -#if !defined(_WIN32_WCE) && !defined(__GP32__) && !defined(ANDROID) - if (!settings.contains("savepath")) { - const char *dir = getenv("SCUMMVM_SAVEPATH"); - if (dir && *dir && strlen(dir) < MAXPATHLEN) { - Common::FSNode saveDir(dir); - if (!saveDir.exists()) { - warning("Non-existent SCUMMVM_SAVEPATH save path. It will be ignored"); - } else if (!saveDir.isWritable()) { - warning("Non-writable SCUMMVM_SAVEPATH save path. It will be ignored"); - } else { - settings["savepath"] = dir; - } - } - } -#endif - // Finally, store the command line settings into the config manager. for (Common::StringMap::const_iterator x = settings.begin(); x != settings.end(); ++x) { Common::String key(x->_key); @@ -995,7 +976,7 @@ Common::Error processSettings(Common::String &command, Common::StringMap &settin ConfMan.set(key, value, Common::ConfigManager::kTransientDomain); } - return Common::kArgumentNotProcessed; + return false; } } // End of namespace Base diff --git a/base/commandLine.h b/base/commandLine.h index 6205c914e0f..2798ab09349 100644 --- a/base/commandLine.h +++ b/base/commandLine.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_COMMAND_LINE_H @@ -35,9 +32,28 @@ class String; namespace Base { +/** + * Register various defaults with the ConfigManager. + */ void registerDefaults(); + +/** + * Parse the command line for options and a command; the options + * are stored in the map 'settings, the command (if any) is returned. + */ Common::String parseCommandLine(Common::StringMap &settings, int argc, const char * const *argv); -Common::Error processSettings(Common::String &command, Common::StringMap &settings); + +/** + * Process the command line options and arguments. + * Returns true if everything was handled and ScummVM should quit + * (e.g. because "--help" was specified, and handled). + * + * @param[in] command the command as returned by parseCommandLine + * @param[in] settings the settings as returned by parseCommandLine + * @param[out] err indicates whether any error occurred, and which + * @return true if the command was completely processed and ScummVM should quit, false otherwise + */ +bool processSettings(Common::String &command, Common::StringMap &settings, Common::Error &err); } // End of namespace Base diff --git a/base/main.cpp b/base/main.cpp index b34eb6966aa..906f4c92428 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /*! \mainpage %ScummVM Source Reference @@ -352,8 +349,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { Common::Error res; // TODO: deal with settings that require plugins to be loaded - res = Base::processSettings(command, settings); - if (res.getCode() != Common::kArgumentNotProcessed) { + if (Base::processSettings(command, settings, res)) { if (res.getCode() != Common::kNoError) warning("%s", res.getDesc().c_str()); return res.getCode(); diff --git a/base/main.h b/base/main.h index 93e73f55e69..3d75931454c 100644 --- a/base/main.h +++ b/base/main.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BASE_MAIN_H diff --git a/base/plugins.cpp b/base/plugins.cpp index 38b5626fe26..4a3b2017142 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -228,6 +225,7 @@ public: LINK_PLUGIN(AMIGA) LINK_PLUGIN(APPLEIIGS) LINK_PLUGIN(TOWNS) + LINK_PLUGIN(PC98) #if defined(USE_TIMIDITY) LINK_PLUGIN(TIMIDITY) #endif diff --git a/base/plugins.h b/base/plugins.h index d8f1cb96eed..a1ae7341591 100644 --- a/base/plugins.h +++ b/base/plugins.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BASE_PLUGINS_H @@ -83,7 +80,7 @@ extern int pluginTypeVersions[PLUGIN_TYPE_MAX]; (ENABLE_##ID && !PLUGIN_ENABLED_DYNAMIC(ID)) #define PLUGIN_ENABLED_DYNAMIC(ID) \ - (ENABLE_##ID && (ENABLE_##ID == DYNAMIC_PLUGIN) && DYNAMIC_MODULES) + (ENABLE_##ID && (ENABLE_##ID == DYNAMIC_PLUGIN) && defined(DYNAMIC_MODULES)) // see comments in backends/plugins/elf/elf-provider.cpp #if defined(USE_ELF_LOADER) && defined(ELF_LOADER_CXA_ATEXIT) diff --git a/base/version.cpp b/base/version.cpp index a1f6d60fa0e..30830347140 100644 --- a/base/version.cpp +++ b/base/version.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/base/version.h b/base/version.h index 1ad6d48b8bf..a5c25c03f4d 100644 --- a/base/version.h +++ b/base/version.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef BASE_VERSION_H diff --git a/common/EventDispatcher.cpp b/common/EventDispatcher.cpp index d295cb9f810..e97068c0d02 100644 --- a/common/EventDispatcher.cpp +++ b/common/EventDispatcher.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/events.h" diff --git a/common/EventRecorder.cpp b/common/EventRecorder.cpp index d2ad4bc4751..eb22e1ea885 100644 --- a/common/EventRecorder.cpp +++ b/common/EventRecorder.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/EventRecorder.h" @@ -254,7 +251,7 @@ void EventRecorder::deinit() { g_system->deleteMutex(_recorderMutex); } -void EventRecorder::registerRandomSource(RandomSource &rnd, const char *name) { +void EventRecorder::registerRandomSource(RandomSource &rnd, const String &name) { if (_recordMode == kRecorderRecord) { RandomSourceRecord rec; rec.name = name; diff --git a/common/EventRecorder.h b/common/EventRecorder.h index 19272c4e29c..8377d9e8bd3 100644 --- a/common/EventRecorder.h +++ b/common/EventRecorder.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_EVENTRECORDER_H @@ -54,7 +51,7 @@ public: void deinit(); /** Register random source so it can be serialized in game test purposes */ - void registerRandomSource(RandomSource &rnd, const char *name); + void registerRandomSource(RandomSource &rnd, const String &name); /** TODO: Add documentation, this is only used by the backend */ void processMillis(uint32 &millis); diff --git a/common/algorithm.h b/common/algorithm.h index e5c5f81433f..00c0e1c98f3 100644 --- a/common/algorithm.h +++ b/common/algorithm.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_ALGORITHM_H @@ -237,6 +234,13 @@ void sort(T first, T last) { sort(first, last, Common::Less()); } +// MSVC is complaining about the minus operator being applied to an unsigned type +// We disable this warning for the affected section of code +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable: 4146) +#endif + /** * Euclid's algorithm to compute the greatest common divisor. */ @@ -259,6 +263,10 @@ T gcd(T a, T b) { return b; } +#if defined(_MSC_VER) +#pragma warning(pop) +#endif + } // End of namespace Common #endif diff --git a/common/archive.cpp b/common/archive.cpp index c2c9c8e7026..0ef3893a8c9 100644 --- a/common/archive.cpp +++ b/common/archive.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/archive.h" diff --git a/common/archive.h b/common/archive.h index 375136fa15f..3c75970d604 100644 --- a/common/archive.h +++ b/common/archive.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_ARCHIVE_H diff --git a/common/array.h b/common/array.h index e3aab66dc69..7ab4a1b0425 100644 --- a/common/array.h +++ b/common/array.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_ARRAY_H @@ -27,6 +24,7 @@ #include "common/scummsys.h" #include "common/algorithm.h" +#include "common/textconsole.h" // For error() namespace Common { @@ -75,8 +73,7 @@ public: Array(const Array &array) : _capacity(array._size), _size(array._size), _storage(0) { if (array._storage) { - _storage = new T[_capacity]; - assert(_storage); + allocCapacity(_size); copy(array._storage, array._storage + _size, _storage); } } @@ -86,9 +83,8 @@ public: */ template Array(const T2 *data, int n) { - _capacity = _size = n; - _storage = new T[_capacity]; - assert(_storage); + _size = n; + allocCapacity(n); copy(data, data + _size, _storage); } @@ -182,9 +178,7 @@ public: delete[] _storage; _size = array._size; - _capacity = _size + 32; - _storage = new T[_capacity]; - assert(_storage); + allocCapacity(_size); copy(array._storage, array._storage + _size, _storage); return *this; @@ -241,15 +235,13 @@ public: if (newCapacity <= _capacity) return; - T *old_storage = _storage; - _capacity = newCapacity; - _storage = new T[newCapacity]; - assert(_storage); + T *oldStorage = _storage; + allocCapacity(newCapacity); - if (old_storage) { + if (oldStorage) { // Copy old data - copy(old_storage, old_storage + _size, _storage); - delete[] old_storage; + copy(oldStorage, oldStorage + _size, _storage); + delete[] oldStorage; } } @@ -270,6 +262,17 @@ protected: return capa; } + void allocCapacity(uint capacity) { + _capacity = capacity; + if (capacity) { + _storage = new T[capacity]; + if (!_storage) + ::error("Common::Array: failure to allocate %d bytes", capacity); + } else { + _storage = 0; + } + } + /** * Insert a range of elements coming from this or another array. * Unlike std::vector::insert, this method does not accept @@ -289,29 +292,28 @@ protected: const uint n = last - first; if (n) { const uint idx = pos - _storage; - T *newStorage = _storage; - if (_size + n > _capacity) { + T *oldStorage = _storage; + if (_size + n > _capacity || (_storage <= first && first <= _storage + _size) ) { // If there is not enough space, allocate more and // copy old elements over. - uint newCapacity = roundUpCapacity(_size + n); - newStorage = new T[newCapacity]; - assert(newStorage); - copy(_storage, _storage + idx, newStorage); - pos = newStorage + idx; + // Likewise, if this is a self-insert, we allocate new + // storage to avoid conflicts. This is not the most efficient + // way to ensure that, but probably the simplest on. + allocCapacity(roundUpCapacity(_size + n)); + copy(oldStorage, oldStorage + idx, _storage); + pos = _storage + idx; } // Make room for the new elements by shifting back // existing ones. - copy_backward(_storage + idx, _storage + _size, newStorage + _size + n); + copy_backward(oldStorage + idx, oldStorage + _size, _storage + _size + n); // Insert the new elements. copy(first, last, pos); // Finally, update the internal state - if (newStorage != _storage) { - delete[] _storage; - _capacity = roundUpCapacity(_size + n); - _storage = newStorage; + if (_storage != oldStorage) { + delete[] oldStorage; } _size += n; } diff --git a/common/bufferedstream.h b/common/bufferedstream.h index bb09e77d1d2..55ea8dc13b6 100644 --- a/common/bufferedstream.h +++ b/common/bufferedstream.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_BUFFEREDSTREAM_H diff --git a/common/config-file.cpp b/common/config-file.cpp index cd8f0989fc0..55941131ac9 100644 --- a/common/config-file.cpp +++ b/common/config-file.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-file.h" diff --git a/common/config-file.h b/common/config-file.h index 231162fb3c6..d28ad340363 100644 --- a/common/config-file.h +++ b/common/config-file.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_CONFIG_FILE_H diff --git a/common/config-manager.cpp b/common/config-manager.cpp index 5f5c14f8de2..03fcb20abfe 100644 --- a/common/config-manager.cpp +++ b/common/config-manager.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/common/config-manager.h b/common/config-manager.h index b9e4e32399f..6f3f554459b 100644 --- a/common/config-manager.h +++ b/common/config-manager.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_CONFIG_MANAGER_H diff --git a/common/dcl.cpp b/common/dcl.cpp index efe1de04153..b75f7f3fa69 100644 --- a/common/dcl.cpp +++ b/common/dcl.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/dcl.h" diff --git a/common/dcl.h b/common/dcl.h index 88cf9335cfa..12c4e12772e 100644 --- a/common/dcl.h +++ b/common/dcl.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** diff --git a/common/debug-channels.h b/common/debug-channels.h index 445d0e0261b..54de9d491e6 100644 --- a/common/debug-channels.h +++ b/common/debug-channels.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_DEBUG_CHANNELS_H diff --git a/common/debug.cpp b/common/debug.cpp index a8711055fde..dbbb204debe 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/debug.h" diff --git a/common/debug.h b/common/debug.h index 03de7f4f77e..dc94839082f 100644 --- a/common/debug.h +++ b/common/debug.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_DEBUG_H diff --git a/common/endian.h b/common/endian.h index c645243654b..9cb703858a8 100644 --- a/common/endian.h +++ b/common/endian.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_ENDIAN_H diff --git a/common/error.cpp b/common/error.cpp index b07e5ebd741..a6c52a0ce95 100644 --- a/common/error.cpp +++ b/common/error.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/error.h" @@ -70,9 +67,6 @@ static String errorToString(ErrorCode errorCode) { case kEnginePluginNotSupportSaves: return _s("Engine plugin does not support save states"); - case kArgumentNotProcessed: - return _s("Command line argument not processed"); - case kUnknownError: default: return _s("Unknown error"); diff --git a/common/error.h b/common/error.h index 1ffbba723a9..23c12b67e4c 100644 --- a/common/error.h +++ b/common/error.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_ERROR_H @@ -50,7 +47,6 @@ enum ErrorCode { kUnsupportedGameidError, ///< Engine initialization: Gameid not supported by this (Meta)Engine kUnsupportedColorMode, ///< Engine initialization: Engine does not support backend's color mode - kReadPermissionDenied, ///< Unable to read data due to missing read permission kWritePermissionDenied, ///< Unable to write data due to missing write permission @@ -66,8 +62,6 @@ enum ErrorCode { kEnginePluginNotFound, ///< Failed to find plugin to handle target kEnginePluginNotSupportSaves, ///< Failed if plugin does not support listing save states - kArgumentNotProcessed, ///< Used in command line parsing - kUnknownError ///< Catch-all error, used if no other error code matches }; diff --git a/common/events.h b/common/events.h index 120d7d9dea0..371080c1b27 100644 --- a/common/events.h +++ b/common/events.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_EVENTS_H @@ -309,7 +306,7 @@ public: /** - * Initialise the event manager. + * Initialize the event manager. * @note called after graphics system has been set up */ virtual void init() {} diff --git a/common/file.cpp b/common/file.cpp index 485255bbdb2..381bf12ecf5 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/archive.h" diff --git a/common/file.h b/common/file.h index c3805baed73..86c67c077c6 100644 --- a/common/file.h +++ b/common/file.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_FILE_H diff --git a/common/forbidden.h b/common/forbidden.h index af22b2ee213..c551110d0e0 100644 --- a/common/forbidden.h +++ b/common/forbidden.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_FORBIDDEN_H @@ -128,6 +125,27 @@ #endif +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_getc +#undef getc +#define getc(a) FORBIDDEN_SYMBOL_REPLACEMENT +#endif + +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_getchar +#undef getchar +#define getchar() FORBIDDEN_SYMBOL_REPLACEMENT +#endif + +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_putc +#undef putc +#define putc(a,b) FORBIDDEN_SYMBOL_REPLACEMENT +#endif + +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_putchar +#undef putchar +#define putchar(a) FORBIDDEN_SYMBOL_REPLACEMENT +#endif + + #ifndef FORBIDDEN_SYMBOL_EXCEPTION_setjmp #undef setjmp #define setjmp(a) FORBIDDEN_SYMBOL_REPLACEMENT @@ -143,6 +161,31 @@ #define system(a) FORBIDDEN_SYMBOL_REPLACEMENT #endif +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_exit +#undef exit +#define exit(a) FORBIDDEN_SYMBOL_REPLACEMENT +#endif + +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_getenv +#undef getenv +#define getenv(a) FORBIDDEN_SYMBOL_REPLACEMENT +#endif + +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_putenv +#undef putenv +#define putenv(a) FORBIDDEN_SYMBOL_REPLACEMENT +#endif + +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_setenv +#undef setenv +#define setenv(a,b,c) FORBIDDEN_SYMBOL_REPLACEMENT +#endif + +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_unsetenv +#undef unsetenv +#define unsetenv(a) FORBIDDEN_SYMBOL_REPLACEMENT +#endif + // // Disable various symbols from time.h @@ -247,6 +290,64 @@ #define setvbuf(a,b,c,d) FORBIDDEN_SYMBOL_REPLACEMENT #endif + +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_tmpfile +#undef tmpfile +#define tmpfile() FORBIDDEN_SYMBOL_REPLACEMENT +#endif + +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_tmpnam +#undef tmpnam +#define tmpnam(a) FORBIDDEN_SYMBOL_REPLACEMENT +#endif + +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_tempnam +#undef tempnam +#define tempnam(a,b) FORBIDDEN_SYMBOL_REPLACEMENT +#endif + +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_rand +#undef rand +#define rand() FORBIDDEN_SYMBOL_REPLACEMENT +#endif + +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_srand +#undef srand +#define srand(a) FORBIDDEN_SYMBOL_REPLACEMENT +#endif + +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_random +#undef random +#define random() FORBIDDEN_SYMBOL_REPLACEMENT +#endif + +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_srandom +#undef srandom +#define srandom(a) FORBIDDEN_SYMBOL_REPLACEMENT +#endif + + +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_stricmp +#undef stricmp +#define stricmp(a,b) FORBIDDEN_SYMBOL_REPLACEMENT +#endif + +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_strnicmp +#undef strnicmp +#define strnicmp(a,b,c) FORBIDDEN_SYMBOL_REPLACEMENT +#endif + +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_strcasecmp +#undef strcasecmp +#define strcasecmp(a,b) FORBIDDEN_SYMBOL_REPLACEMENT +#endif + +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_strncasecmp +#undef strncasecmp +#define strncasecmp(a,b,c) FORBIDDEN_SYMBOL_REPLACEMENT +#endif + + /* * We also would like to disable the following symbols; * however, these are also frequently used in regular code, diff --git a/common/frac.h b/common/frac.h index b1e6c518d1c..d4028788252 100644 --- a/common/frac.h +++ b/common/frac.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_FRAC_H diff --git a/common/fs.cpp b/common/fs.cpp index d3cdc0697f8..3dc8c289aad 100644 --- a/common/fs.cpp +++ b/common/fs.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/system.h" diff --git a/common/fs.h b/common/fs.h index f93c11159ef..aeaa14718eb 100644 --- a/common/fs.h +++ b/common/fs.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_FS_H diff --git a/common/func.h b/common/func.h index b89a64e5fbe..e09ab1a4389 100644 --- a/common/func.h +++ b/common/func.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_FUNC_H diff --git a/common/hash-str.h b/common/hash-str.h index 40557037e77..1b8a57827a6 100644 --- a/common/hash-str.h +++ b/common/hash-str.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_HASH_STR_H diff --git a/common/hashmap.cpp b/common/hashmap.cpp index 5fe18f33eed..ff8f9db9ceb 100644 --- a/common/hashmap.cpp +++ b/common/hashmap.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // The hash map (associative array) implementation in this file is diff --git a/common/hashmap.h b/common/hashmap.h index 907a107163c..f2a4d843b8d 100644 --- a/common/hashmap.h +++ b/common/hashmap.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // The hash map (associative array) implementation in this file is diff --git a/common/iff_container.cpp b/common/iff_container.cpp index c447d93f121..02b445ae054 100644 --- a/common/iff_container.cpp +++ b/common/iff_container.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/iff_container.h" diff --git a/common/iff_container.h b/common/iff_container.h index 43a551a2390..1b12ef70e54 100644 --- a/common/iff_container.h +++ b/common/iff_container.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_IFF_CONTAINER_H diff --git a/common/keyboard.h b/common/keyboard.h index 40491fda6be..74b8775a0f6 100644 --- a/common/keyboard.h +++ b/common/keyboard.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_KEYBOARD_H diff --git a/common/list.h b/common/list.h index ad6193c2974..a1e761f55de 100644 --- a/common/list.h +++ b/common/list.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_LIST_H diff --git a/common/list_intern.h b/common/list_intern.h index b7fbaffc47e..daa74467811 100644 --- a/common/list_intern.h +++ b/common/list_intern.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_LIST_INTERN_H diff --git a/common/macresman.cpp b/common/macresman.cpp index 0ecb430532f..70c6e0a7ce5 100644 --- a/common/macresman.cpp +++ b/common/macresman.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/common/macresman.h b/common/macresman.h index f588d8f8539..4d86e46d114 100644 --- a/common/macresman.h +++ b/common/macresman.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** diff --git a/common/md5.cpp b/common/md5.cpp index bea9ca0dc58..52fe8b8f8df 100644 --- a/common/md5.cpp +++ b/common/md5.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ /* diff --git a/common/md5.h b/common/md5.h index e613028a5e7..d1be8c8e391 100644 --- a/common/md5.h +++ b/common/md5.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_MD5_H diff --git a/common/memorypool.cpp b/common/memorypool.cpp index c4dbb5fbbd6..3a570ac50ee 100644 --- a/common/memorypool.cpp +++ b/common/memorypool.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/memorypool.h" diff --git a/common/memorypool.h b/common/memorypool.h index e19d9829137..5ba09cebed8 100644 --- a/common/memorypool.h +++ b/common/memorypool.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_MEMORYPOOL_H diff --git a/common/memstream.h b/common/memstream.h index ac42e1bad9f..69fe6ec18e7 100644 --- a/common/memstream.h +++ b/common/memstream.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_MEMSTREAM_H diff --git a/common/mutex.cpp b/common/mutex.cpp index 8ebfa2254ba..4e6316528c6 100644 --- a/common/mutex.cpp +++ b/common/mutex.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/common/mutex.h b/common/mutex.h index 3addaa6b188..26f69a3996f 100644 --- a/common/mutex.h +++ b/common/mutex.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_MUTEX_H diff --git a/common/noncopyable.h b/common/noncopyable.h index f639d9abf70..0cbe41388a7 100644 --- a/common/noncopyable.h +++ b/common/noncopyable.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_NONCOPYABLE_H diff --git a/common/pack-end.h b/common/pack-end.h index 701b12dccca..04633b7635c 100644 --- a/common/pack-end.h +++ b/common/pack-end.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #if defined(SCUMMVM_USE_PRAGMA_PACK) diff --git a/common/pack-start.h b/common/pack-start.h index 0b2c3eff82a..631a6529d3d 100644 --- a/common/pack-start.h +++ b/common/pack-start.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #if defined(SCUMMVM_USE_PRAGMA_PACK) diff --git a/common/ptr.h b/common/ptr.h index 4d7fff1fc20..e0d026f9645 100644 --- a/common/ptr.h +++ b/common/ptr.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_PTR_H diff --git a/common/queue.h b/common/queue.h index df8dcfe04c1..3a2d6aad4b2 100644 --- a/common/queue.h +++ b/common/queue.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_QUEUE_H diff --git a/common/random.cpp b/common/random.cpp index 9fd9c33e30d..55fa3cbd308 100644 --- a/common/random.cpp +++ b/common/random.cpp @@ -17,23 +17,26 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/random.h" #include "common/system.h" +#include "common/EventRecorder.h" namespace Common { -RandomSource::RandomSource() { +RandomSource::RandomSource(const String &name) { // Use system time as RNG seed. Normally not a good idea, if you are using // a RNG for security purposes, but good enough for our purposes. assert(g_system); uint32 seed = g_system->getMillis(); setSeed(seed); + + // Register this random source with the event recorder. This may end + // up querying or resetting the current seed, so we must call it + // *after* the initial seed has been set. + g_eventRec.registerRandomSource(*this, name); } void RandomSource::setSeed(uint32 seed) { diff --git a/common/random.h b/common/random.h index 8fc5c4cf7da..90f2ed5cb03 100644 --- a/common/random.h +++ b/common/random.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_RANDOM_H @@ -29,6 +26,8 @@ namespace Common { +class String; + /** * Simple random number generator. Although it is definitely not suitable for * cryptographic purposes, it serves our purposes just fine. @@ -38,10 +37,17 @@ private: uint32 _randSeed; public: - RandomSource(); + /** + * Construct a new randomness source with the specific name. + * The name used name must be globally unique, and is used to + * register the randomness source with the active event recorder, + * if any. + */ + RandomSource(const String &name); + void setSeed(uint32 seed); - uint32 getSeed() { + uint32 getSeed() const { return _randSeed; } @@ -51,12 +57,14 @@ public: * @return a random number in the interval [0, max] */ uint getRandomNumber(uint max); + /** * Generates a random bit, i.e. either 0 or 1. - * Identical to getRandomNumber(1), but faster, hopefully. + * Identical to getRandomNumber(1), but potentially faster. * @return a random bit, either 0 or 1 */ uint getRandomBit(); + /** * Generates a random unsigned integer in the interval [min, max]. * @param min the lower bound diff --git a/common/rational.cpp b/common/rational.cpp index af38dd9144e..cb287869bb2 100644 --- a/common/rational.cpp +++ b/common/rational.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/debug.h" diff --git a/common/rational.h b/common/rational.h index bee09d8ddb1..45aa6a7a203 100644 --- a/common/rational.h +++ b/common/rational.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_RATIONAL_H diff --git a/common/rect.h b/common/rect.h index 03ad02d27a8..768d1ebbb96 100644 --- a/common/rect.h +++ b/common/rect.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_RECT_H diff --git a/common/savefile.h b/common/savefile.h index 793aec3ba95..03a7b52add4 100644 --- a/common/savefile.h +++ b/common/savefile.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_SAVEFILE_H @@ -145,7 +142,7 @@ public: /** * Request a list of available savegames with a given DOS-style pattern, - * also known as "glob" in the UNIX world. Refer to the Common::matchString() + * also known as "glob" in the POSIX world. Refer to the Common::matchString() * function to learn about the precise pattern format. * @param pattern Pattern to match. Wildcards like * or ? are available. * @return list of strings for all present file names. diff --git a/common/scummsys.h b/common/scummsys.h index 8ba983fd6cd..62e244585ad 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_SCUMMSYS_H @@ -47,6 +44,9 @@ #if (_MSC_VER < 1500) #define vsnprintf _vsnprintf #endif + // FIXME: Is this actually necessary for WinCE or Windows? + // If yes, please add corresponding comments. Otherwise, let's get rid of it! + #define snprintf _snprintf #endif #if !defined(_WIN32_WCE) @@ -110,21 +110,6 @@ #include "config.h" #endif -// -// Define scumm_stricmp and scumm_strnicmp -// -#if defined(_WIN32_WCE) || defined(_MSC_VER) - #define scumm_stricmp stricmp - #define scumm_strnicmp _strnicmp - #define snprintf _snprintf -#elif defined(__MINGW32__) || defined(__GP32__) || defined(__DS__) - #define scumm_stricmp stricmp - #define scumm_strnicmp strnicmp -#else - #define scumm_stricmp strcasecmp - #define scumm_strnicmp strncasecmp -#endif - // In the following we configure various targets, in particular those // which can't use our "configure" tool and hence don't use config.h. @@ -154,82 +139,47 @@ // #define SCUMMVM_USE_PRAGMA_PACK +// +// Determine the host endianess and whether memory alignment is required. +// +#if !defined(HAVE_CONFIG_H) + #if defined(SDL_BACKEND) + /* need this for the SDL_BYTEORDER define */ + #include -#if defined(HAVE_CONFIG_H) - // All settings should have been set in config.h + #if SDL_BYTEORDER == SDL_LIL_ENDIAN + #define SCUMM_LITTLE_ENDIAN + #elif SDL_BYTEORDER == SDL_BIG_ENDIAN + #define SCUMM_BIG_ENDIAN + #else + #error Neither SDL_BIG_ENDIAN nor SDL_LIL_ENDIAN is set. + #endif -#elif defined(__SYMBIAN32__) + #elif defined(__DC__) || \ + defined(__DS__) || \ + defined(__GP32__) || \ + defined(IPHONE) || \ + defined(__PLAYSTATION2__) || \ + defined(__PSP__) || \ + defined(__SYMBIAN32__) - #define SCUMM_LITTLE_ENDIAN - #define SCUMM_NEED_ALIGNMENT + #define SCUMM_LITTLE_ENDIAN + #define SCUMM_NEED_ALIGNMENT -#elif defined(_WIN32_WCE) + #elif defined(_WIN32_WCE) || defined(_MSC_VER) || defined(__MINGW32__) - #define SCUMM_LITTLE_ENDIAN + #define SCUMM_LITTLE_ENDIAN -#elif defined(_MSC_VER) + #elif defined(__amigaos4__) || defined(__N64__) || defined(__WII__) - #define SCUMM_LITTLE_ENDIAN + #define SCUMM_BIG_ENDIAN + #define SCUMM_NEED_ALIGNMENT -#elif defined(__MINGW32__) - - #define SCUMM_LITTLE_ENDIAN - -#elif defined(SDL_BACKEND) - /* need this for the SDL_BYTEORDER define */ - #include - - #if SDL_BYTEORDER == SDL_LIL_ENDIAN - #define SCUMM_LITTLE_ENDIAN - #elif SDL_BYTEORDER == SDL_BIG_ENDIAN - #define SCUMM_BIG_ENDIAN #else - #error Neither SDL_BIG_ENDIAN nor SDL_LIL_ENDIAN is set. + + #error No system type defined, host endianess unknown. + #endif - -#elif defined(__DC__) - - #define SCUMM_LITTLE_ENDIAN - #define SCUMM_NEED_ALIGNMENT - -#elif defined(__GP32__) - - #define SCUMM_LITTLE_ENDIAN - #define SCUMM_NEED_ALIGNMENT - -#elif defined(__PLAYSTATION2__) - - #define SCUMM_LITTLE_ENDIAN - #define SCUMM_NEED_ALIGNMENT - -#elif defined(__N64__) - - #define SCUMM_BIG_ENDIAN - #define SCUMM_NEED_ALIGNMENT - -#elif defined(__PSP__) - - #define SCUMM_LITTLE_ENDIAN - #define SCUMM_NEED_ALIGNMENT - -#elif defined(__amigaos4__) - - #define SCUMM_BIG_ENDIAN - #define SCUMM_NEED_ALIGNMENT - -#elif defined(__DS__) - - #define SCUMM_NEED_ALIGNMENT - #define SCUMM_LITTLE_ENDIAN - -#elif defined(__WII__) - - #define SCUMM_BIG_ENDIAN - #define SCUMM_NEED_ALIGNMENT - -#else - #error No system type defined - #endif @@ -237,17 +187,7 @@ // Some more system specific settings. // TODO/FIXME: All of these should be moved to backend specific files (such as portdefs.h) // -#if defined(__SYMBIAN32__) - - #define SMALL_SCREEN_DEVICE - -#elif defined(_WIN32_WCE) - - #if _WIN32_WCE < 300 - #define SMALL_SCREEN_DEVICE - #endif - -#elif defined(DINGUX) +#if defined(DINGUX) // Very BAD hack following, used to avoid triggering an assert in uClibc dingux library // "toupper" when pressing keyboard function keys. @@ -306,7 +246,7 @@ #if defined(_MSC_VER) #define NORETURN_PRE __declspec(noreturn) #else - #define NORETURN_PRE + #define NORETURN_PRE #endif #endif @@ -314,7 +254,7 @@ #if defined(__GNUC__) || defined(__INTEL_COMPILER) #define NORETURN_POST __attribute__((__noreturn__)) #else - #define NORETURN_POST + #define NORETURN_POST #endif #endif @@ -332,60 +272,10 @@ // -// Typedef our system types +// Typedef our system types unless they have already been defined by config.h, +// or SCUMMVM_DONT_DEFINE_TYPES is set. // -#if !defined(HAVE_CONFIG_H) && defined(__SYMBIAN32__) - - // Enable Symbians own datatypes - // This is done for two reasons - // a) uint is already defined by Symbians libc component - // b) Symbian is using its "own" datatyping, and the Scummvm port - // should follow this to ensure the best compability possible. - typedef unsigned char byte; - - typedef unsigned char uint8; - typedef signed char int8; - - typedef unsigned short int uint16; - typedef signed short int int16; - - typedef unsigned long int uint32; - typedef signed long int int32; - -#elif !defined(HAVE_CONFIG_H) && defined(__GP32__) - - // Override typenames. uint is already defined by system header files. - typedef unsigned char byte; - - typedef unsigned char uint8; - typedef signed char int8; - - typedef unsigned short int uint16; - typedef signed short int int16; - - typedef unsigned long int uint32; - typedef signed long int int32; - -#elif !defined(HAVE_CONFIG_H) && defined(__N64__) - - typedef unsigned char byte; - - typedef unsigned char uint8; - typedef signed char int8; - - typedef unsigned short int uint16; - typedef signed short int int16; - - typedef unsigned int uint32; - typedef signed int int32; - -#elif !defined(HAVE_CONFIG_H) && defined(__DS__) - - // Do nothing, the SDK defines all types we need in nds/ndstypes.h, - // which we include in our portsdef.h - -#else - +#if !defined(HAVE_CONFIG_H) && !defined(SCUMMVM_DONT_DEFINE_TYPES) typedef unsigned char byte; typedef unsigned char uint8; typedef signed char int8; @@ -397,18 +287,11 @@ #endif - // // Overlay color type (FIXME: shouldn't be declared here) // -#if defined(NEWGUI_256) - // 256 color only on PalmOS - typedef byte OverlayColor; -#else - // 15/16 bit color mode everywhere else... - typedef uint16 OverlayColor; -#endif +typedef uint16 OverlayColor; -#include "common/forbidden.h" +#include "common/forbidden.h" #endif diff --git a/common/serializer.h b/common/serializer.h index b8c62727d4a..b874624d38b 100644 --- a/common/serializer.h +++ b/common/serializer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_SERIALIZER_H diff --git a/common/singleton.h b/common/singleton.h index c5aa35f68d8..2f5fa41877d 100644 --- a/common/singleton.h +++ b/common/singleton.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_SINGLETON_H diff --git a/common/stack.h b/common/stack.h index 5d447d54249..0d13049f2e0 100644 --- a/common/stack.h +++ b/common/stack.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_STACK_H diff --git a/common/str-array.h b/common/str-array.h index 5c8324bdea1..57c76bf3055 100644 --- a/common/str-array.h +++ b/common/str-array.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_STRING_ARRAY_H diff --git a/common/str.cpp b/common/str.cpp index c21e4412dbb..740e7b6a067 100644 --- a/common/str.cpp +++ b/common/str.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/str.h" @@ -836,3 +833,36 @@ size_t strlcat(char *dst, const char *src, size_t size) { } } // End of namespace Common + +// Portable implementation of stricmp / strcasecmp / strcmpi. +// TODO: Rename this to Common::strcasecmp +int scumm_stricmp(const char *s1, const char *s2) { + byte l1, l2; + do { + // Don't use ++ inside tolower, in case the macro uses its + // arguments more than once. + l1 = (byte)*s1++; + l1 = tolower(l1); + l2 = (byte)*s2++; + l2 = tolower(l2); + } while (l1 == l2 && l1 != 0); + return l1 - l2; +} + +// Portable implementation of strnicmp / strncasecmp / strncmpi. +// TODO: Rename this to Common::strncasecmp +int scumm_strnicmp(const char *s1, const char *s2, uint n) { + byte l1, l2; + do { + if (n-- == 0) + return 0; // no difference found so far -> signal equality + + // Don't use ++ inside tolower, in case the macro uses its + // arguments more than once. + l1 = (byte)*s1++; + l1 = tolower(l1); + l2 = (byte)*s2++; + l2 = tolower(l2); + } while (l1 == l2 && l1 != 0); + return l1 - l2; +} diff --git a/common/str.h b/common/str.h index 21c0483a043..7b97dfe9456 100644 --- a/common/str.h +++ b/common/str.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_STRING_H @@ -41,7 +38,7 @@ namespace Common { * a certain length do we allocate a buffer on the heap. * * The presence of \0 characters in the string will cause undefined - * behaviour in some operations. + * behavior in some operations. */ class String { protected: @@ -381,4 +378,7 @@ size_t strlcat(char *dst, const char *src, size_t size); } // End of namespace Common +extern int scumm_stricmp(const char *s1, const char *s2); +extern int scumm_strnicmp(const char *s1, const char *s2, uint n); + #endif diff --git a/common/stream.cpp b/common/stream.cpp index a785ac51648..60b40d0df2b 100644 --- a/common/stream.cpp +++ b/common/stream.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/stream.h" diff --git a/common/stream.h b/common/stream.h index 530b50e4316..26c04e5bf6c 100644 --- a/common/stream.h +++ b/common/stream.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_STREAM_H @@ -45,12 +42,18 @@ public: * Returns true if an I/O failure occurred. * This flag is never cleared automatically. In order to clear it, * client code has to call clearErr() explicitly. + * + * @note The semantics of any implementation of this method are + * supposed to match those of ISO C ferror(). */ virtual bool err() const { return false; } /** * Reset the I/O error status as returned by err(). * For a ReadStream, also reset the end-of-stream status returned by eos(). + * + * @note The semantics of any implementation of this method are + * supposed to match those of ISO C clearerr(). */ virtual void clearErr() {} }; @@ -64,6 +67,9 @@ public: * Write data into the stream. Subclasses must implement this * method; all other write methods are implemented using it. * + * @note The semantics of any implementation of this method are + * supposed to match those of ISO C fwrite(). + * * @param dataPtr pointer to the data to be written * @param dataSize number of bytes to be written * @return the number of bytes which were actually written. @@ -75,6 +81,9 @@ public: * storage medium; unbuffered streams can use the default * implementation. * + * @note The semantics of any implementation of this method are + * supposed to match those of ISO C fflush(). + * * @return true on success, false in case of a failure */ virtual bool flush() { return true; } @@ -158,6 +167,11 @@ public: * Returns true if a read failed because the stream end has been reached. * This flag is cleared by clearErr(). * For a SeekableReadStream, it is also cleared by a successful seek. + * + * @note The semantics of any implementation of this method are + * supposed to match those of ISO C feof(). In particular, in a stream + * with N bytes, reading exactly N bytes from the start should *not* + * set eos; only reading *beyond* the available data should set it. */ virtual bool eos() const = 0; @@ -165,6 +179,10 @@ public: * Read data from the stream. Subclasses must implement this * method; all other read methods are implemented using it. * + * @note The semantics of any implementation of this method are + * supposed to match those of ISO C fread(), in particular where + * it concerns setting error and end of file/stream flags. + * * @param dataPtr pointer to a buffer into which the data is read * @param dataSize number of bytes to be read * @return the number of bytes which were actually read. @@ -338,6 +356,9 @@ public: * position indicator, or end-of-file, respectively. A successful call * to the seek() method clears the end-of-file indicator for the stream. * + * @note The semantics of any implementation of this method are + * supposed to match those of ISO C fseek(). + * * @param offset the relative offset in bytes * @param whence the seek reference: SEEK_SET, SEEK_CUR, or SEEK_END * @return true on success, false in case of a failure diff --git a/common/substream.h b/common/substream.h index 8b83dbda2ee..f4f79ff02fb 100644 --- a/common/substream.h +++ b/common/substream.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_SUBSTREAM_H diff --git a/common/system.cpp b/common/system.cpp index 4e902bcb140..1f2f8cc6d52 100644 --- a/common/system.cpp +++ b/common/system.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/common/system.h b/common/system.h index 540ffde5a53..b584739b773 100644 --- a/common/system.h +++ b/common/system.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_SYSTEM_H @@ -1034,7 +1031,7 @@ public: }; -/** The global OSystem instance. Initialised in main(). */ +/** The global OSystem instance. Initialized in main(). */ extern OSystem *g_system; #endif diff --git a/common/textconsole.cpp b/common/textconsole.cpp index 8d62cd4cb20..f2325ac9ad9 100644 --- a/common/textconsole.cpp +++ b/common/textconsole.cpp @@ -17,11 +17,10 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ +#define FORBIDDEN_SYMBOL_EXCEPTION_exit + #include "common/textconsole.h" #include "common/system.h" #include "common/str.h" diff --git a/common/textconsole.h b/common/textconsole.h index 5a535f32062..364c49b2e9e 100644 --- a/common/textconsole.h +++ b/common/textconsole.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_CONSOLE_H diff --git a/common/timer.h b/common/timer.h index c87c2b32403..40438f078cd 100644 --- a/common/timer.h +++ b/common/timer.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_TIMER_H diff --git a/common/tokenizer.cpp b/common/tokenizer.cpp index 8bca133b5bf..395ff0767aa 100644 --- a/common/tokenizer.cpp +++ b/common/tokenizer.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/tokenizer.h" diff --git a/common/tokenizer.h b/common/tokenizer.h index 0ee6e37da73..84850949970 100644 --- a/common/tokenizer.h +++ b/common/tokenizer.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_TOKENIZER_H diff --git a/common/translation.cpp b/common/translation.cpp index 5494849f4c6..dc71ddc52fa 100644 --- a/common/translation.cpp +++ b/common/translation.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifdef WIN32 diff --git a/common/translation.h b/common/translation.h index f8183b63501..9e5245702e4 100644 --- a/common/translation.h +++ b/common/translation.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_TRANSLATION_H diff --git a/common/types.h b/common/types.h index bed204ae1b8..ab86f3afc2c 100644 --- a/common/types.h +++ b/common/types.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_TYPES_H diff --git a/common/unarj.cpp b/common/unarj.cpp index 4bda7ac7532..f45dddaa38d 100644 --- a/common/unarj.cpp +++ b/common/unarj.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/common/unarj.h b/common/unarj.h index fe23ba5694a..2be514c9366 100644 --- a/common/unarj.h +++ b/common/unarj.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** diff --git a/common/unzip.cpp b/common/unzip.cpp index d56893f3cdc..91f352f40a9 100644 --- a/common/unzip.cpp +++ b/common/unzip.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ /* unzip.c -- IO on .zip files using zlib @@ -352,7 +349,7 @@ typedef struct { z_stream stream; /* zLib stream structure for inflate */ uLong pos_in_zipfile; /* position in byte on the zipfile, for fseek*/ - uLong stream_initialised; /* flag set if stream structure is initialised*/ + uLong stream_initialized; /* flag set if stream structure is initialized*/ uLong offset_local_extrafield;/* offset of the local extra field */ uInt size_local_extrafield;/* size of the local extra field */ @@ -1076,7 +1073,7 @@ int unzOpenCurrentFile (unzFile file) { return UNZ_INTERNALERROR; } - pfile_in_zip_read_info->stream_initialised=0; + pfile_in_zip_read_info->stream_initialized=0; if ((s->cur_file_info.compression_method!=0) && (s->cur_file_info.compression_method!=Z_DEFLATED)) @@ -1099,7 +1096,7 @@ int unzOpenCurrentFile (unzFile file) { err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS); if (err == Z_OK) - pfile_in_zip_read_info->stream_initialised = 1; + pfile_in_zip_read_info->stream_initialized = 1; /* windowBits is passed < 0 to tell that there is no zlib header. * Note that in this case inflate *requires* an extra "dummy" byte * after the compressed stream in order to complete decompression and @@ -1368,7 +1365,7 @@ int unzCloseCurrentFile(unzFile file) { if (pfile_in_zip_read_info->crc32_data != pfile_in_zip_read_info->crc32_wait) err=UNZ_CRCERROR; } - if (pfile_in_zip_read_info->stream_initialised) + if (pfile_in_zip_read_info->stream_initialized) inflateEnd(&pfile_in_zip_read_info->stream); #endif @@ -1376,7 +1373,7 @@ int unzCloseCurrentFile(unzFile file) { free(pfile_in_zip_read_info->read_buffer); pfile_in_zip_read_info->read_buffer = NULL; - pfile_in_zip_read_info->stream_initialised = 0; + pfile_in_zip_read_info->stream_initialized = 0; free(pfile_in_zip_read_info); s->pfile_in_zip_read=NULL; diff --git a/common/unzip.h b/common/unzip.h index fe7acdcc54c..06480b0054e 100644 --- a/common/unzip.h +++ b/common/unzip.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_UNZIP_H diff --git a/common/util.cpp b/common/util.cpp index 22cf33b1308..a7ec1a9de75 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/util.h" diff --git a/common/util.h b/common/util.h index 3af9b490863..5837c8beabd 100644 --- a/common/util.h +++ b/common/util.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef COMMON_UTIL_H diff --git a/common/winexe.cpp b/common/winexe.cpp index 9602e84c883..7cfc1404523 100644 --- a/common/winexe.cpp +++ b/common/winexe.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/str.h" diff --git a/common/winexe.h b/common/winexe.h index ce2f19cb814..bec156d2e77 100644 --- a/common/winexe.h +++ b/common/winexe.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_WINEXE_H diff --git a/common/winexe_ne.cpp b/common/winexe_ne.cpp index 844127b0e18..80266ba87e6 100644 --- a/common/winexe_ne.cpp +++ b/common/winexe_ne.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/common/winexe_ne.h b/common/winexe_ne.h index 29881320408..4a1b2343dfe 100644 --- a/common/winexe_ne.h +++ b/common/winexe_ne.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_WINEXE_NE_H diff --git a/common/winexe_pe.cpp b/common/winexe_pe.cpp index 6bb831b9c60..e5f6a24bcdb 100644 --- a/common/winexe_pe.cpp +++ b/common/winexe_pe.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/array.h" diff --git a/common/winexe_pe.h b/common/winexe_pe.h index 60c4adb916d..cc1d0c9770d 100644 --- a/common/winexe_pe.h +++ b/common/winexe_pe.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_WINEXE_PE_H diff --git a/common/xmlparser.cpp b/common/xmlparser.cpp index e2e1dbdfc73..9bd052fb3df 100644 --- a/common/xmlparser.cpp +++ b/common/xmlparser.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // FIXME: Avoid using fprintf diff --git a/common/xmlparser.h b/common/xmlparser.h index c456fd08265..84fca294a09 100644 --- a/common/xmlparser.h +++ b/common/xmlparser.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef XML_PARSER_H diff --git a/common/zlib.cpp b/common/zlib.cpp index 96e9f8cb159..b047586af05 100644 --- a/common/zlib.cpp +++ b/common/zlib.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use zlib.h diff --git a/common/zlib.h b/common/zlib.h index 641d4553cf4..19250343106 100644 --- a/common/zlib.h +++ b/common/zlib.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_ZLIB_H diff --git a/configure b/configure index 0eec7cd546c..2c81a6dc4fb 100755 --- a/configure +++ b/configure @@ -20,8 +20,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -# $URL$ -# $Id$ # Save the current environment variables for next runs SAVED_CONFIGFLAGS=$@ @@ -137,23 +135,19 @@ _png=auto _theoradec=auto _faad=auto _fluidsynth=auto -_16bit=auto _opengl=auto _opengles=auto _readline=auto # Default option behaviour yes/no _debug_build=auto _release_build=auto +_verbose_build=no _text_console=no _mt32emu=yes _build_scalers=yes _build_hq_scalers=yes -_arm_asm=no -_indeo3=auto _enable_prof=no -_unix=no _global_constructors=no -_elf_loader=no # Default vkeybd/keymapper options _vkeybd=no _keymapper=no @@ -161,12 +155,12 @@ _keymapper=no _translation=yes # Default platform settings _backend=sdl -_endian=unknown -_need_memalign=no -_have_x86=no -_verbose_build=no +_16bit=auto _dynamic_modules=no +_elf_loader=no _plugins_default=static +_plugin_prefix= +_plugin_suffix= _nasm=auto # Default commands _ranlib=ranlib @@ -182,6 +176,15 @@ _sdlpath="$PATH" _nasmpath="$PATH" NASMFLAGS="" NASM="" +# The following variables are automatically detected, and should not +# be modified otherwise. Consider them read-only. +_posix=no +_endian=unknown +_need_memalign=yes +_have_x86=no +_arm_asm=no + + # Directories for installing ScummVM. # This list is closely based on what GNU autoconf does, @@ -749,8 +752,6 @@ Optional Libraries: --with-opengl-prefix=DIR Prefix where OpenGL (ES) is installed (optional) --disable-opengl disable OpenGL (ES) support [autodetect] - --disable-indeo3 disable Indeo3 decoder [autodetect] - --with-png-prefix=DIR Prefix where libpng is installed (optional) --disable-png disable PNG decoder [autodetect] @@ -812,8 +813,6 @@ for ac_option in $@; do --enable-nasm) _nasm=yes ;; --disable-nasm) _nasm=no ;; --enable-mpeg2) _mpeg2=yes ;; - --disable-indeo3) _indeo3=no ;; - --enable-indeo3) _indeo3=yes ;; --disable-png) _png=no ;; --enable-png) _png=yes ;; --disable-theoradec) _theoradec=no ;; @@ -1003,15 +1002,6 @@ caanoo) _host_os=gph-linux _host_cpu=arm _host_alias=arm-none-linux-gnueabi - if test "$_debug_build" = auto; then - # If you want to debug on the Caanoo use '--disable-release --enable-debug' - _debug_build=no - fi - - if test "$_release_build" = auto; then - # Enable release build by default. - _release_build=yes - fi ;; dingux) _host_os=linux @@ -1039,29 +1029,11 @@ gp2x) _host_os=gph-linux _host_cpu=arm _host_alias=arm-open2x-linux - if test "$_debug_build" = auto; then - # If you want to debug on the GP2X use '--disable-release --enable-debug' - _debug_build=no - fi - - if test "$_release_build" = auto; then - # Enable release build by default. - _release_build=yes - fi ;; gp2xwiz) _host_os=gph-linux _host_cpu=arm _host_alias=arm-open2x-linux - if test "$_debug_build" = auto; then - # If you want to debug on the GP2XWiz use '--disable-release --enable-debug' - _debug_build=no - fi - - if test "$_release_build" = auto; then - # Enable release build by default. - _release_build=yes - fi ;; i586-mingw32msvc) _host_os=mingw32msvc @@ -1099,15 +1071,6 @@ openpandora) _host_os=linux _host_cpu=arm _host_alias=arm-angstrom-linux-gnueabi - if test "$_debug_build" = auto; then - # If you want to debug on the OP use '--disable-release --enable-debug' - _debug_build=no - fi - - if test "$_release_build" = auto; then - # Enable release build by default. - _release_build=yes - fi ;; ppc-amigaos) _host_os=amigaos @@ -1117,28 +1080,11 @@ ps2) _host_os=ps2 _host_cpu=mips64r5900el _host_alias=ee - if test "$_debug_build" = auto; then - # Disable debug mode by default. The resulting binaries are far too big in general, - # and one has to disable multiple engines to make it usable. - _debug_build=no - fi - - if test "$_release_build" = auto; then - # Enable release build by default. - _release_build=yes - fi ;; psp) _host_os=psp _host_cpu=mipsallegrexel _host_alias=psp - if test -z "$PSPDEV"; then - PSPDEV=`psp-config --pspdev-path` - fi - if test -d "$PSPDEV/psp/lib"; then - LDFLAGS="$LDFLAGS -L$PSPDEV/psp/lib" - fi - LDFLAGS="$LDFLAGS -L$PSPDEV/psp/sdk/lib -specs=$_srcdir/backends/platform/psp/psp.spec" ;; samsungtv) _host_os=linux @@ -1195,6 +1141,20 @@ fi # Determine extra build flags for debug and/or release builds # +case $_host in +caanoo | gp2x | gp2xwiz | openpandora | ps2) + if test "$_debug_build" = auto; then + # If you want to debug one of these platforms, use '--disable-release --enable-debug' + _debug_build=no + fi + + if test "$_release_build" = auto; then + # Enable release build by default. + _release_build=yes + fi + ;; +esac + if test "$_debug_build" != no; then # debug mode not explicitly disabled -> compile with -g CXXFLAGS="$CXXFLAGS -g" @@ -1205,7 +1165,9 @@ if test "$_release_build" = yes; then # makes it possible to use -Wuninitialized, so let's do that. # We will also add a define, which indicates we are doing # an build for a release version. - CXXFLAGS="$CXXFLAGS -O2 -Wuninitialized -DRELEASE_BUILD" + CXXFLAGS="$CXXFLAGS -O2" + CXXFLAGS="$CXXFLAGS -Wuninitialized" + DEFINES="$DEFINES -DRELEASE_BUILD" fi @@ -1261,9 +1223,15 @@ ps2) fi ;; psp) - PSPSDK=`psp-config --pspsdk-path` + if test -z "$PSPDEV"; then + PSPDEV=`psp-config --pspdev-path` + fi + # TODO: Should we also insist on a valid PSPDEV value? if test -z "$PSPSDK"; then - echo "Please set the path to PSPSDK in your environment." + PSPSDK=`psp-config --pspsdk-path` + fi + if test -z "$PSPSDK"; then + echo "Please set PSPSDK in your environment. export PSPSDK=" exit 1 fi ;; @@ -1426,6 +1394,9 @@ fi echo "$cxx_version" +# +# Bail out now if now useable compiler was found. +# if test "$cxx_verc_fail" = yes ; then echo echo "The version of your compiler is not supported at this time" @@ -1433,6 +1404,54 @@ if test "$cxx_verc_fail" = yes ; then exit 1 fi +# +# Setup compiler specific CXXFLAGS now that we know the compiler version. +# Foremost, this means enabling various warnings. +# In addition, we set CXX_UPDATE_DEP_FLAG for GCC >= 3.0 and for ICC. +# +if test "$have_gcc" = yes ; then + if test "$_cxx_major" -ge "3" ; then + case $_host_os in + # newlib-based system include files suppress non-C89 function + # declarations under __STRICT_ANSI__ + amigaos* | android | dreamcast | ds | gamecube | mingw* | n64 | psp | ps2 | wii | wince ) + ;; + *) + CXXFLAGS="$CXXFLAGS -ansi" + ;; + esac + CXXFLAGS="$CXXFLAGS -W -Wno-unused-parameter" + add_line_to_config_mk 'HAVE_GCC3 = 1' + add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP' + fi; + + if test "$_cxx_major" -eq 4 && test "$_cxx_minor" -ge 3 || \ + test "$_cxx_major" -gt 4 ; then + CXXFLAGS="$CXXFLAGS -Wno-empty-body" + else + CXXFLAGS="$CXXFLAGS -Wconversion" + fi; +elif test "$have_icc" = yes ; then + add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP' +fi; + +# By default, we add -pedantic to the CXXFLAGS to catch some potentially +# non-portable constructs, like use of GNU extensions. +# However, some platforms use GNU extensions in system header files, so +# for these we must not use -pedantic. +case $_host_os in +android | gamecube | psp | wii) + ;; +*) + # ICC does not support pedantic, while GCC and clang do. + if test "$have_icc" = no ; then + CXXFLAGS="$CXXFLAGS -pedantic" + fi + ;; +esac + +# If possible, we want to use -Wglobal-constructors +# However, not all compilers support that, so check whether the active one does. echocheck "whether -Wglobal-constructors work" cat > $TMPC << EOF int main() { return 0; } @@ -1449,23 +1468,37 @@ echo $_global_constructors # echo_n "Checking endianness... " cat > tmp_endianness_check.cpp << EOF -short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +unsigned short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +unsigned short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii() { char* s = (char*) ascii_mm; s = (char*) ascii_ii; } -short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +unsigned short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +unsigned short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic() { char* s = (char*) ebcdic_mm; s = (char*) ebcdic_ii; } int main() { _ascii (); _ebcdic (); return 0; } EOF $CXX $CXXFLAGS -c -o $TMPO.o tmp_endianness_check.cpp if strings $TMPO.o | grep BIGenDianSyS >/dev/null; then _endian=big -else +elif strings $TMPO.o | grep LiTTleEnDian >/dev/null; then _endian=little fi echo $_endian; cc_check_clean tmp_endianness_check.cpp +case $_endian in + big) + add_line_to_config_h '#undef SCUMM_LITTLE_ENDIAN' + add_line_to_config_h '#define SCUMM_BIG_ENDIAN' + ;; + little) + add_line_to_config_h '#define SCUMM_LITTLE_ENDIAN' + add_line_to_config_h '#undef SCUMM_BIG_ENDIAN' + ;; + *) + exit 1 + ;; +esac + # # Determine a data type with the given length # @@ -1514,6 +1547,50 @@ TMPR="$?" echo "$type_4_byte" test $TMPR -eq 0 || exit 1 # check exit code of subshell +# +# Check whether memory alignment is required +# +# For some CPU types, unaligned memory access is either not supported at +# all (and so leads to a crash), requires a super-slow emulation via an +# exception handler, or just results in incorrect results. +# On the other hand, accessing data in a manner that works regardless of +# alignment can be a lot slower than regular access, so we don't want +# to use it if we don't have to. +# +# So we do the following: For CPU families where we know whether unaligned +# access is safe & fast, we enable / disable unaligned access accordingly. +# Otherwise, we just disable memory alignment. +# +# NOTE: In the past, for non-cross compiled builds, we would also run some code +# which would try to test whether unaligned access worked or not. But this test +# could not reliably determine whether unaligned access really worked in all +# situations (and across different implementations of the target CPU arch), nor +# whether it was fast (as opposed to slowly emulated by fault handlers). Hence, +# we do not use this approach anymore. +# +# NOTE: The only kinds of unaligned access we allow are for 2 byte and 4 +# byte loads / stores. No promises are made for bigger sizes, such as 8 +# or 16 byte loads, for which architectures may behave differently than +# for the smaller sizes. +echo_n "Alignment required... " +case $_host_cpu in + i[3-6]86 | x86_64 | ppc*) + # Unaligned access should work + _need_memalign=no + ;; + alpha* | arm* | bfin* | hp* | mips* | sh* | sparc* | ia64 | nv1*) + # Unaligned access is not supported or extremely slow. + _need_memalign=yes + ;; + *) + # Status of unaligned access is unknown, so assume the worst. + _need_memalign=yes + ;; +esac +echo "$_need_memalign" + +define_in_config_h_if_yes $_need_memalign 'SCUMM_NEED_ALIGNMENT' + # # Check whether we can use x86 asm routines # @@ -1527,6 +1604,27 @@ case $_host_cpu in ;; esac echo "$_have_x86" +define_in_config_h_if_yes $_have_x86 'HAVE_X86' + +# +# Check whether to use optimized ARM asm +# +echo_n "Compiling for ARM... " +case $_host_cpu in + arm*) + _arm_asm=yes + ;; + *) + _arm_asm=no + ;; +esac +echo "$_arm_asm" +define_in_config_if_yes "$_arm_asm" 'USE_ARM_SCALER_ASM' +define_in_config_if_yes "$_arm_asm" 'USE_ARM_SOUND_ASM' +define_in_config_if_yes "$_arm_asm" 'USE_ARM_SMUSH_ASM' +define_in_config_if_yes "$_arm_asm" 'USE_ARM_GFX_ASM' +define_in_config_if_yes "$_arm_asm" 'USE_ARM_COSTUME_ASM' + # # Determine build settings @@ -1535,7 +1633,8 @@ echo_n "Checking hosttype... " echo $_host_os case $_host_os in amigaos*) - LDFLAGS="$LDFLAGS -use-dynld -L/sdk/local/newlib/lib" + LDFLAGS="$LDFLAGS -use-dynld" + LDFLAGS="$LDFLAGS -L/sdk/local/newlib/lib" # We have to use 'long' for our 4 byte typedef because AmigaOS already typedefs (u)int32 # as (unsigned) long, and consequently we'd get a compiler error otherwise. type_4_byte='long' @@ -1544,30 +1643,41 @@ case $_host_os in android) case $_host in android) - CXXFLAGS="$CXXFLAGS -march=armv5te -mtune=xscale -msoft-float" + CXXFLAGS="$CXXFLAGS -march=armv5te" + CXXFLAGS="$CXXFLAGS -mtune=xscale" + CXXFLAGS="$CXXFLAGS -msoft-float" ;; android-v7a) - CXXFLAGS="$CXXFLAGS -march=armv7-a -mfloat-abi=softfp -mfpu=vfp" + CXXFLAGS="$CXXFLAGS -march=armv7-a" + CXXFLAGS="$CXXFLAGS -mfloat-abi=softfp" + CXXFLAGS="$CXXFLAGS -mfpu=vfp" LDFLAGS="$LDFLAGS -Wl,--fix-cortex-a8" ;; esac CXXFLAGS="$CXXFLAGS --sysroot=$ANDROID_NDK/platforms/android-4/arch-arm" - CXXFLAGS="$CXXFLAGS -fpic -ffunction-sections -funwind-tables" + CXXFLAGS="$CXXFLAGS -fpic" + CXXFLAGS="$CXXFLAGS -ffunction-sections" + CXXFLAGS="$CXXFLAGS -funwind-tables" if test "$_debug_build" = yes; then - CXXFLAGS="$CXXFLAGS -fno-omit-frame-pointer -fno-strict-aliasing" + CXXFLAGS="$CXXFLAGS -fno-omit-frame-pointer" + CXXFLAGS="$CXXFLAGS -fno-strict-aliasing" else - CXXFLAGS="$CXXFLAGS -fomit-frame-pointer -fstrict-aliasing" + CXXFLAGS="$CXXFLAGS -fomit-frame-pointer" + CXXFLAGS="$CXXFLAGS -fstrict-aliasing" fi CXXFLAGS="$CXXFLAGS -finline-limit=300" - CXXFLAGS="$CXXFLAGS -Os -mthumb-interwork" - CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__" - CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__" + CXXFLAGS="$CXXFLAGS -Os" + CXXFLAGS="$CXXFLAGS -mthumb-interwork" + # FIXME: Why is the following in CXXFLAGS and not in DEFINES? Change or document this. + CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5__" + CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5T__" + CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5E__" + CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5TE__" # supress 'mangling of 'va_list' has changed in GCC 4.4' CXXFLAGS="$CXXFLAGS -Wno-psabi" LDFLAGS="$LDFLAGS --sysroot=$ANDROID_NDK/platforms/android-4/arch-arm" LDFLAGS="$LDFLAGS -mthumb-interwork" add_line_to_config_mk "ANDROID_SDK = $ANDROID_SDK" - _unix=yes _seq_midi=no ;; beos*) @@ -1577,12 +1687,8 @@ case $_host_os in CFLAGS="-I/boot/home/config/include" CXXFLAGS="$CXXFLAGS -fhuge-objects" LIBS="$LIBS -lbind -lsocket" - _unix=yes _seq_midi=no ;; - bsd* | hpux* | netbsd* | openbsd* | sunos*) - _unix=yes - ;; cygwin*) echo ERROR: Cygwin building is not supported by ScummVM anymore. Consider using MinGW. exit 1 @@ -1591,19 +1697,31 @@ case $_host_os in DEFINES="$DEFINES -DMACOSX" LIBS="$LIBS -framework AudioUnit -framework AudioToolbox -framework Carbon -framework CoreMIDI" add_line_to_config_mk 'MACOSX = 1' - _unix=yes ;; dreamcast) - DEFINES="$DEFINES -D__DC__ -DNONSTANDARD_PORT" + DEFINES="$DEFINES -D__DC__" + DEFINES="$DEFINES -DNONSTANDARD_PORT" ;; ds) - # TODO Nintendo DS - DEFINES="$DEFINES -D__DS__ -DNDS -DARM9 -DARM -DNONSTANDARD_PORT" - CXXFLAGS="$CXXFLAGS -isystem $DEVKITPRO/libnds/include -isystem $DEVKITPRO/devkitARM/arm-eabi/include" - CXXFLAGS="$CXXFLAGS -mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer -mthumb-interwork" - CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections -fno-strict-aliasing" + DEFINES="$DEFINES -D__DS__" + DEFINES="$DEFINES -DNDS" + DEFINES="$DEFINES -DARM9" + DEFINES="$DEFINES -DARM" + DEFINES="$DEFINES -DNONSTANDARD_PORT" + CXXFLAGS="$CXXFLAGS -isystem $DEVKITPRO/libnds/include" + CXXFLAGS="$CXXFLAGS -isystem $DEVKITPRO/devkitARM/arm-eabi/include" + CXXFLAGS="$CXXFLAGS -mcpu=arm9tdmi" + CXXFLAGS="$CXXFLAGS -mtune=arm9tdmi" + CXXFLAGS="$CXXFLAGS -fomit-frame-pointer" + CXXFLAGS="$CXXFLAGS -mthumb-interwork" + CXXFLAGS="$CXXFLAGS -ffunction-sections" + CXXFLAGS="$CXXFLAGS -fdata-sections" + CXXFLAGS="$CXXFLAGS -fno-strict-aliasing" CXXFLAGS="$CXXFLAGS -fuse-cxa-atexit" - LDFLAGS="$LDFLAGS -specs=ds_arm9.specs -mthumb-interwork -mno-fpu -Wl,-Map,map.txt" + LDFLAGS="$LDFLAGS -specs=ds_arm9.specs" + LDFLAGS="$LDFLAGS -mthumb-interwork" + LDFLAGS="$LDFLAGS -mno-fpu" + LDFLAGS="$LDFLAGS -Wl,-Map,map.txt" if test "$_dynamic_modules" = no ; then LDFLAGS="$LDFLAGS -Wl,--gc-sections" else @@ -1617,15 +1735,23 @@ case $_host_os in freebsd*) LDFLAGS="$LDFLAGS -L/usr/local/lib" CXXFLAGS="$CXXFLAGS -I/usr/local/include" - _unix=yes ;; gamecube) - CXXFLAGS="$CXXFLAGS -Os -mogc -mcpu=750 -meabi -mhard-float" - CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections -fmodulo-sched" + CXXFLAGS="$CXXFLAGS -Os" + CXXFLAGS="$CXXFLAGS -mogc" + CXXFLAGS="$CXXFLAGS -mcpu=750" + CXXFLAGS="$CXXFLAGS -meabi" + CXXFLAGS="$CXXFLAGS -mhard-float" + CXXFLAGS="$CXXFLAGS -ffunction-sections" + CXXFLAGS="$CXXFLAGS -fdata-sections" + CXXFLAGS="$CXXFLAGS -fmodulo-sched" CXXFLAGS="$CXXFLAGS -fuse-cxa-atexit" CXXFLAGS="$CXXFLAGS -I$DEVKITPRO/libogc/include" # libogc is required to link the cc tests (includes _start()) - LDFLAGS="$LDFLAGS -mogc -mcpu=750 -L$DEVKITPRO/libogc/lib/cube -logc" + LDFLAGS="$LDFLAGS -mogc" + LDFLAGS="$LDFLAGS -mcpu=750" + LDFLAGS="$LDFLAGS -L$DEVKITPRO/libogc/lib/cube" + LDFLAGS="$LDFLAGS -logc" if test "$_dynamic_modules" = "yes" ; then # retarded toolchain patch forces --gc-sections, overwrite it LDFLAGS="$LDFLAGS -Wl,--no-gc-sections" @@ -1635,14 +1761,13 @@ case $_host_os in DEFINES="$DEFINES -DSYSTEM_NOT_SUPPORTING_D_TYPE" # Needs -lnetwork for the timidity MIDI driver LIBS="$LIBS -lnetwork" - _unix=yes _seq_midi=no ;; irix*) - DEFINES="$DEFINES -DIRIX -DSYSTEM_NOT_SUPPORTING_D_TYPE" + DEFINES="$DEFINES -DIRIX" + DEFINES="$DEFINES -DSYSTEM_NOT_SUPPORTING_D_TYPE" LIBS="$LIBS -lmd -lfastm -lm" _ranlib=: - _unix=yes ;; linux* | uclinux*) # When not cross-compiling, enable large file support, but don't @@ -1650,74 +1775,101 @@ case $_host_os in if test -z "$_host"; then CXXFLAGS="$CXXFLAGS $(getconf LFS_CFLAGS 2>/dev/null)" fi - _unix=yes - DEFINES="$DEFINES -DLUA_USE_POSIX" ;; mingw*) - DEFINES="$DEFINES -DWIN32 -D__USE_MINGW_ANSI_STDIO=0" + DEFINES="$DEFINES -DWIN32" + DEFINES="$DEFINES -D__USE_MINGW_ANSI_STDIO=0" LIBS="$LIBS -lmingw32 -lwinmm" OBJS="$OBJS scummvmwinres.o" add_line_to_config_mk 'WIN32 = 1' ;; mint*) DEFINES="$DEFINES -DSYSTEM_NOT_SUPPORTING_D_TYPE" - _unix=yes ;; n64) - DEFINES="$DEFINES -D__N64__ -DLIMIT_FPS -DNONSTANDARD_PORT" - DEFINES="$DEFINES -DDISABLE_DEFAULT_SAVEFILEMANAGER -DDISABLE_COMMAND_LINE" - DEFINES="$DEFINES -DDISABLE_FANCY_THEMES -DDISABLE_DOSBOX_OPL -DDISABLE_SID -DDISABLE_NES_APU" + DEFINES="$DEFINES -D__N64__" + DEFINES="$DEFINES -DLIMIT_FPS" + DEFINES="$DEFINES -DNONSTANDARD_PORT" + DEFINES="$DEFINES -DDISABLE_COMMAND_LINE" + DEFINES="$DEFINES -DDISABLE_DEFAULT_SAVEFILEMANAGER" + DEFINES="$DEFINES -DDISABLE_DOSBOX_OPL" + DEFINES="$DEFINES -DDISABLE_FANCY_THEMES" + DEFINES="$DEFINES -DDISABLE_NES_APU" + DEFINES="$DEFINES -DDISABLE_SID" DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE" ;; - os2-emx*) - _unix=yes # FIXME??? Why?? - ;; ps2) - # TODO ps2 CXXFLAGS="$CXXFLAGS -G2" - DEFINES="$DEFINES -D_EE -D__PLAYSTATION2__" + DEFINES="$DEFINES -D_EE" + DEFINES="$DEFINES -D__PLAYSTATION2__" ;; psp) - CXXFLAGS="$CXXFLAGS -O3 -I$PSPSDK/include -D_PSP_FW_VERSION=150" + if test -d "$PSPDEV/psp/lib"; then + LDFLAGS="$LDFLAGS -L$PSPDEV/psp/lib" + fi + LDFLAGS="$LDFLAGS -L$PSPSDK/lib" + LDFLAGS="$LDFLAGS -specs=$_srcdir/backends/platform/psp/psp.spec" + CXXFLAGS="$CXXFLAGS -O3" + CXXFLAGS="$CXXFLAGS -I$PSPSDK/include" + # FIXME: Why is the following in CXXFLAGS and not in DEFINES? Change or document this. + CXXFLAGS="$CXXFLAGS -D_PSP_FW_VERSION=150" ;; solaris*) - DEFINES="$DEFINES -DSOLARIS -DSYSTEM_NOT_SUPPORTING_D_TYPE" + DEFINES="$DEFINES -DSOLARIS" + DEFINES="$DEFINES -DSYSTEM_NOT_SUPPORTING_D_TYPE" # Needs -lbind -lsocket for the timidity MIDI driver LIBS="$LIBS -lnsl -lsocket" - _unix=yes ;; webos) - CXXFLAGS="$CXXFLAGS -I$WEBOS_PDK/include -I$WEBOS_PDK/include/SDL -I$WEBOS_PDK/device/usr/include" + CXXFLAGS="$CXXFLAGS -I$WEBOS_PDK/include" + CXXFLAGS="$CXXFLAGS -I$WEBOS_PDK/include/SDL" + CXXFLAGS="$CXXFLAGS -I$WEBOS_PDK/device/usr/include" # These compiler options are needed to support the Palm Pixi - CXXFLAGS="$CXXFLAGS -mcpu=arm1136jf-s -mfpu=vfp -mfloat-abi=softfp" - LDFLAGS="$LDFLAGS -L$WEBOS_PDK/device/lib -L$WEBOS_PDK/device/usr/lib" + CXXFLAGS="$CXXFLAGS -mcpu=arm1136jf-s" + CXXFLAGS="$CXXFLAGS -mfpu=vfp " + CXXFLAGS="$CXXFLAGS -mfloat-abi=softfp" + LDFLAGS="$LDFLAGS -L$WEBOS_PDK/device/lib" + LDFLAGS="$LDFLAGS -L$WEBOS_PDK/device/usr/lib" LDFLAGS="$LDFLAGS -Wl,--allow-shlib-undefined" LDFLAGS="$LDFLAGS --sysroot=$WEBOS_PDK/arm-gcc/sysroot" add_line_to_config_mk "WEBOS_SDK = $WEBOS_SDK" - _unix=yes _seq_midi=no ;; wii) - CXXFLAGS="$CXXFLAGS -Os -mrvl -mcpu=750 -meabi -mhard-float" - CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections -fmodulo-sched" + CXXFLAGS="$CXXFLAGS -Os" + CXXFLAGS="$CXXFLAGS -mrvl" + CXXFLAGS="$CXXFLAGS -mcpu=750" + CXXFLAGS="$CXXFLAGS -meabi" + CXXFLAGS="$CXXFLAGS -mhard-float" + CXXFLAGS="$CXXFLAGS -ffunction-sections" + CXXFLAGS="$CXXFLAGS -fdata-sections" + CXXFLAGS="$CXXFLAGS -fmodulo-sched" CXXFLAGS="$CXXFLAGS -fuse-cxa-atexit" CXXFLAGS="$CXXFLAGS -I$DEVKITPRO/libogc/include" # libogc is required to link the cc tests (includes _start()) - LDFLAGS="$LDFLAGS -mrvl -mcpu=750 -L$DEVKITPRO/libogc/lib/wii -logc" + LDFLAGS="$LDFLAGS -mrvl" + LDFLAGS="$LDFLAGS -mcpu=750" + LDFLAGS="$LDFLAGS -L$DEVKITPRO/libogc/lib/wii" + LDFLAGS="$LDFLAGS -logc" if test "$_dynamic_modules" = "yes" ; then # retarded toolchain patch forces --gc-sections, overwrite it LDFLAGS="$LDFLAGS -Wl,--no-gc-sections" fi ;; wince) - CXXFLAGS="$CXXFLAGS -O3 -fno-inline-functions -march=armv4 -mtune=xscale" - DEFINES="$DEFINES -D_WIN32_WCE=300 -D__ARM__ -D_ARM_ -DUNICODE -DFPM_DEFAULT -DNONSTANDARD_PORT" - DEFINES="$DEFINES -DWIN32 -Dcdecl= -D__cdecl__=" - ;; - # given this is a shell script assume some type of unix - *) - echo "WARNING: could not establish system type, assuming unix like" - _unix=yes + CXXFLAGS="$CXXFLAGS -O3" + CXXFLAGS="$CXXFLAGS -fno-inline-functions" + CXXFLAGS="$CXXFLAGS -march=armv4" + CXXFLAGS="$CXXFLAGS -mtune=xscale" + DEFINES="$DEFINES -D_WIN32_WCE=300" + DEFINES="$DEFINES -D__ARM__" + DEFINES="$DEFINES -D_ARM_" + DEFINES="$DEFINES -DUNICODE" + DEFINES="$DEFINES -DFPM_DEFAULT" + DEFINES="$DEFINES -DNONSTANDARD_PORT" + DEFINES="$DEFINES -DWIN32" + DEFINES="$DEFINES -Dcdecl=" + DEFINES="$DEFINES -D__cdecl__=" ;; esac @@ -1726,48 +1878,39 @@ if test -n "$_host"; then echo "Cross-compiling to $_host" case "$_host" in android | android-v7a) - _unix=yes - _need_memalign=yes # we link a .so as default - LDFLAGS="$LDFLAGS -shared -Wl,-Bsymbolic,--no-undefined" + LDFLAGS="$LDFLAGS -shared" + LDFLAGS="$LDFLAGS -Wl,-Bsymbolic,--no-undefined" HOSTEXEPRE=lib HOSTEXEEXT=.so _backend="android" _port_mk="backends/platform/android/android.mk" - _arm_asm=yes _build_scalers=no _seq_midi=no _mt32emu=no _timidity=no ;; arm-linux|arm*-linux-gnueabi|arm-*-linux) - _unix=yes - _need_memalign=yes - _arm_asm=yes ;; arm-riscos|linupy) DEFINES="$DEFINES -DLINUPY" - _unix=yes - _need_memalign=yes ;; bfin*) - _need_memalign=yes ;; caanoo) # This uses the GPH backend. DEFINES="$DEFINES -DGPH_DEVICE" - DEFINES="$DEFINES -DCAANOO -DREDUCE_MEMORY_USAGE" + DEFINES="$DEFINES -DCAANOO" + DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE" if test "$_debug_build" = yes; then DEFINES="$DEFINES -DGPH_DEBUG" else # Use -O3 on the Caanoo for non-debug builds. CXXFLAGS="$CXXFLAGS -O3" fi - CXXFLAGS="$CXXFLAGS -mcpu=arm926ej-s -mtune=arm926ej-s" + CXXFLAGS="$CXXFLAGS -mcpu=arm926ej-s" + CXXFLAGS="$CXXFLAGS -mtune=arm926ej-s" ASFLAGS="$ASFLAGS" - _unix=yes - _need_memalign=yes - _arm_asm=yes _backend="gph" _build_hq_scalers=no _vkeybd=yes @@ -1781,10 +1924,12 @@ if test -n "$_host"; then _strip=$_host-strip ;; dingux) - DEFINES="$DEFINES -DUNIX -DDINGUX -DDISABLE_DOSBOX_OPL -DREDUCE_MEMORY_USAGE" + DEFINES="$DEFINES -DDINGUX" + DEFINES="$DEFINES -DDISABLE_DOSBOX_OPL" + DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE" ASFLAGS="$ASFLAGS" - CXXFLAGS="$CXXFLAGS -msoft-float -mips32" - _need_memalign=yes + CXXFLAGS="$CXXFLAGS -msoft-float" + CXXFLAGS="$CXXFLAGS -mips32" _backend="dingux" _mt32emu=no _vkeybd=yes @@ -1797,9 +1942,14 @@ if test -n "$_host"; then _port_mk="backends/platform/dingux/dingux.mk" ;; dreamcast) - DEFINES="$DEFINES -DDISABLE_DEFAULT_SAVEFILEMANAGER -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE" - CXXFLAGS="$CXXFLAGS -O3 -funroll-loops -fschedule-insns2 -fomit-frame-pointer -fdelete-null-pointer-checks" - _need_memalign=yes + DEFINES="$DEFINES -DDISABLE_DEFAULT_SAVEFILEMANAGER" + DEFINES="$DEFINES -DDISABLE_TEXT_CONSOLE" + DEFINES="$DEFINES -DDISABLE_COMMAND_LINE" + CXXFLAGS="$CXXFLAGS -O3" + CXXFLAGS="$CXXFLAGS -funroll-loops" + CXXFLAGS="$CXXFLAGS -fschedule-insns2" + CXXFLAGS="$CXXFLAGS -fomit-frame-pointer" + CXXFLAGS="$CXXFLAGS -fdelete-null-pointer-checks" _backend="dc" _build_scalers=no _mad=yes @@ -1808,23 +1958,22 @@ if test -n "$_host"; then _port_mk="backends/platform/dc/dreamcast.mk" ;; ds) - # TODO: complete this - DEFINES="$DEFINES -DDISABLE_FANCY_THEMES -DVECTOR_RENDERER_FORMAT=1555" - DEFINES="$DEFINES -DDISABLE_DEFAULT_SAVEFILEMANAGER" - DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE -DSTREAM_AUDIO_FROM_DISK" - DEFINES="$DEFINES -DDISABLE_DOSBOX_OPL -DDISABLE_SID -DDISABLE_NES_APU" DEFINES="$DEFINES -DDISABLE_COMMAND_LINE" - _need_memalign=yes - _arm_asm=yes - add_line_to_config_h '#define DISABLE_TEXT_CONSOLE' + DEFINES="$DEFINES -DDISABLE_DEFAULT_SAVEFILEMANAGER" + DEFINES="$DEFINES -DDISABLE_DOSBOX_OPL" + DEFINES="$DEFINES -DDISABLE_FANCY_THEMES" + DEFINES="$DEFINES -DDISABLE_SID" + DEFINES="$DEFINES -DDISABLE_NES_APU" + DEFINES="$DEFINES -DDISABLE_TEXT_CONSOLE" + DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE" + DEFINES="$DEFINES -DSTREAM_AUDIO_FROM_DISK" + DEFINES="$DEFINES -DVECTOR_RENDERER_FORMAT=1555" _backend="ds" _build_scalers=no _mt32emu=no _port_mk="backends/platform/ds/ds.mk" ;; gamecube) - _endian=big - _need_memalign=yes _backend="wii" _build_scalers=no _mt32emu=no @@ -1840,16 +1989,14 @@ if test -n "$_host"; then gp2x) # This uses the GPH backend. DEFINES="$DEFINES -DGPH_DEVICE" - DEFINES="$DEFINES -DGP2X -DREDUCE_MEMORY_USAGE" + DEFINES="$DEFINES -DGP2X" + DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE" if test "$_debug_build" = yes; then DEFINES="$DEFINES -DGPH_DEBUG" fi CXXFLAGS="$CXXFLAGS -march=armv4t" ASFLAGS="$ASFLAGS -mfloat-abi=soft" LDFLAGS="$LDFLAGS -static" - _unix=yes - _need_memalign=yes - _arm_asm=yes _backend="gph" _build_hq_scalers=no _vkeybd=yes @@ -1861,15 +2008,14 @@ if test -n "$_host"; then gp2xwiz) # This uses the GPH backend. DEFINES="$DEFINES -DGPH_DEVICE" - DEFINES="$DEFINES -DGP2XWIZ -DREDUCE_MEMORY_USAGE" + DEFINES="$DEFINES -DGP2XWIZ" + DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE" if test "$_debug_build" = yes; then DEFINES="$DEFINES -DGPH_DEBUG" fi - CXXFLAGS="$CXXFLAGS -mcpu=arm926ej-s -mtune=arm926ej-s" + CXXFLAGS="$CXXFLAGS -mcpu=arm926ej-s" + CXXFLAGS="$CXXFLAGS -mtune=arm926ej-s" ASFLAGS="$ASFLAGS -mfloat-abi=soft" - _unix=yes - _need_memalign=yes - _arm_asm=yes _backend="gph" _build_hq_scalers=no _vkeybd=yes @@ -1880,18 +2026,12 @@ if test -n "$_host"; then ;; iphone) DEFINES="$DEFINES -DIPHONE" - _unix=yes - _need_memalign=yes - _arm_asm=yes _backend="iphone" _build_hq_scalers=no _seq_midi=no ;; m68k-atari-mint) DEFINES="$DEFINES -DSYSTEM_NOT_SUPPORTING_D_TYPE" - _unix=yes - _endian=big - _need_memalign=yes _ranlib=m68k-atari-mint-ranlib _ar="m68k-atari-mint-ar cru" _seq_midi=no @@ -1905,15 +2045,10 @@ if test -n "$_host"; then mips-sgi*) LDFLAGS="$LDFLAGS -static-libgcc" LIBS="$LIBS -laudio" - _endian=big - _need_memalign=yes ;; motoezx) DEFINES="$DEFINES -DMOTOEZX" ASFLAGS="$ASFLAGS -mfpu=vfp" - _unix=yes - _need_memalign=yes - _arm_asm=yes _backend="linuxmoto" _build_hq_scalers=no _mt32emu=no @@ -1924,9 +2059,6 @@ if test -n "$_host"; then motomagx) DEFINES="$DEFINES -DMOTOMAGX" ASFLAGS="$ASFLAGS -mfpu=vfp" - _unix=yes - _need_memalign=yes - _arm_asm=yes _backend="linuxmoto" _build_hq_scalers=no _mt32emu=no @@ -1935,16 +2067,23 @@ if test -n "$_host"; then _port_mk="backends/platform/linuxmoto/linuxmoto.mk" ;; n64) - CXXFLAGS="$CXXFLAGS -mno-extern-sdata --param max-inline-insns-auto=20 -fomit-frame-pointer" - CXXFLAGS="$CXXFLAGS -march=vr4300 -mtune=vr4300 -mhard-float" - LDFLAGS="$LDFLAGS -march=vr4300 -mtune=vr4300 -nodefaultlibs -nostartfiles -mno-crt0" - LDFLAGS="$LDFLAGS -L$N64SDK/hkz-libn64 -L$N64SDK/lib" + CXXFLAGS="$CXXFLAGS -mno-extern-sdata" + CXXFLAGS="$CXXFLAGS --param max-inline-insns-auto=20" + CXXFLAGS="$CXXFLAGS -fomit-frame-pointer" + CXXFLAGS="$CXXFLAGS -march=vr4300" + CXXFLAGS="$CXXFLAGS -mtune=vr4300" + CXXFLAGS="$CXXFLAGS -mhard-float" + LDFLAGS="$LDFLAGS -march=vr4300" + LDFLAGS="$LDFLAGS -mtune=vr4300" + LDFLAGS="$LDFLAGS -nodefaultlibs" + LDFLAGS="$LDFLAGS -nostartfiles" + LDFLAGS="$LDFLAGS -mno-crt0" + LDFLAGS="$LDFLAGS -L$N64SDK/hkz-libn64" + LDFLAGS="$LDFLAGS -L$N64SDK/lib" LDFLAGS="$LDFLAGS -T n64ld_cpp.x -Xlinker -Map -Xlinker scummvm.map" _backend="n64" - _need_memalign=yes _mt32emu=no _build_scalers=no - _indeo3=no _translation=no _keymapper=no _text_console=no @@ -1959,25 +2098,23 @@ if test -n "$_host"; then ;; neuros) DEFINES="$DEFINES -DNEUROS" - _unix=yes - _need_memalign=yes _backend='null' _build_hq_scalers=no _mt32emu=no ;; openpandora) - DEFINES="$DEFINES -DOPENPANDORA -DREDUCE_MEMORY_USAGE" + DEFINES="$DEFINES -DOPENPANDORA" + DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE" if test "$_release_build" = no; then DEFINES="$DEFINES -DOP_DEBUG" else # Use -O3 on the OpenPandora for non-debug builds. CXXFLAGS="$CXXFLAGS -O3" fi - CXXFLAGS="$CXXFLAGS -march=armv7-a -mtune=cortex-a8 -mfpu=neon" + CXXFLAGS="$CXXFLAGS -march=armv7-a" + CXXFLAGS="$CXXFLAGS -mtune=cortex-a8" + CXXFLAGS="$CXXFLAGS -mfpu=neon" ASFLAGS="$ASFLAGS -mfloat-abi=soft" - _unix=yes - _need_memalign=yes - _arm_asm=yes _backend="openpandora" _build_hq_scalers=yes _vkeybd=no @@ -1986,15 +2123,13 @@ if test -n "$_host"; then _port_mk="backends/platform/openpandora/op-bundle.mk" ;; ppc-amigaos) - _endian=big - # AmigaOS exec allocates memory always in an aligned way - _need_memalign=yes ;; ps2) - # TODO: complete this - DEFINES="$DEFINES -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE -DDISABLE_DOSBOX_OPL" - DEFINES="$DEFINES -DDISABLE_SID -DDISABLE_NES_APU" - _need_memalign=yes + DEFINES="$DEFINES -DDISABLE_TEXT_CONSOLE" + DEFINES="$DEFINES -DDISABLE_COMMAND_LINE" + DEFINES="$DEFINES -DDISABLE_DOSBOX_OPL" + DEFINES="$DEFINES -DDISABLE_SID" + DEFINES="$DEFINES -DDISABLE_NES_APU" _backend="ps2" _build_scalers=no _mt32emu=no @@ -2014,34 +2149,30 @@ if test -n "$_host"; then DEFINES="$DEFINES -D__PS2_DEBUG__" #INCLUDES="$INCLUDES -I$(PS2GDB)/ee" #LDFLAGS="$LDFLAGS -L$(PS2GDB)/lib" - LDFLAGS="$LDFLAGS -lps2gdbStub -lps2ip -ldebug" + LDFLAGS="$LDFLAGS -lps2gdbStub" + LDFLAGS="$LDFLAGS -lps2ip" + LDFLAGS="$LDFLAGS -ldebug" else # If not building for debug mode, strip binaries. CXXFLAGS="$CXXFLAGS -s" fi ;; psp) - _need_memalign=yes _backend="psp" _build_scalers=no _mt32emu=no _port_mk="backends/platform/psp/psp.mk" ;; samsungtv) - DEFINES="$DEFINES -DSAMSUNGTV -DDISABLE_COMMAND_LINE" + DEFINES="$DEFINES -DSAMSUNGTV" + DEFINES="$DEFINES -DDISABLE_COMMAND_LINE" ASFLAGS="$ASFLAGS -mfpu=vfp" HOSTEXEEXT=".so" - _unix=yes - _need_memalign=yes - _arm_asm=yes _backend="samsungtv" _mt32emu=no _vkeybd=yes ;; webos) - _unix=yes - _need_memalign=yes - _arm_asm=yes _backend="webos" _port_mk="backends/platform/webos/webos.mk" _build_scalers=no @@ -2052,8 +2183,6 @@ if test -n "$_host"; then _keymapper=yes ;; wii) - _endian=big - _need_memalign=yes _backend="wii" _build_scalers=no _port_mk="backends/platform/wii/wii.mk" @@ -2067,9 +2196,7 @@ if test -n "$_host"; then add_line_to_config_h "#define USE_WII_KBD" ;; wince) - LDFLAGS="$LDFLAGS -Wl,-Map,scummvm.exe.map -Wl,--stack,65536" - _need_memalign=yes - _arm_asm=yes + LDFLAGS="$LDFLAGS -Wl,--stack,65536" _tremolo=yes _backend="wince" _mt32emu=no @@ -2079,55 +2206,145 @@ if test -n "$_host"; then echo "WARNING: Unknown target, continuing with auto-detected values" ;; esac +fi -else - # - # Check whether memory alignment is required - # - echo_n "Alignment required... " - case $_host_cpu in - alpha*) - # Hardcode alignment requirements for Alpha processsors - _need_memalign=yes - ;; - arm*) - _need_memalign=yes - ;; - mips*) - # Hardcode alignment requirements for MIPS processsors. - # While these can emulate unaligned memory access, this - # emulation is rather slow. - _need_memalign=yes - ;; - sh*) - # Hardcode alignment requirements for SH processsors. - # While these can emulate unaligned memory access, this - # emulation is rather slow. - _need_memalign=yes +# +# Backend related stuff +# +case $_backend in + android) + # ssp at this point so the cxxtests link + if test "$_debug_build" = yes; then + CXXFLAGS="$CXXFLAGS -fstack-protector" + else + CXXFLAGS="$CXXFLAGS -fno-stack-protector" + fi + CXXFLAGS="$CXXFLAGS -Wa,--noexecstack" + LDFLAGS="$LDFLAGS -Wl,-z,noexecstack" + + DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE" + ;; + dc) + INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/dc' + INCLUDES="$INCLUDES "'-isystem $(ronindir)/include' + LDFLAGS="$LDFLAGS -Wl,-Ttext,0x8c010000" + LDFLAGS="$LDFLAGS -nostartfiles" + LDFLAGS="$LDFLAGS "'$(ronindir)/lib/crt0.o' + LDFLAGS="$LDFLAGS "'-L$(ronindir)/lib' + LIBS="$LIBS -lronin -lm" + ;; + dingux) + DEFINES="$DEFINES -DDINGUX" + ;; + ds) + INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/ds/arm9/source' + INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/ds/commoninclude' + INCLUDES="$INCLUDES "'-Ibackends/platform/ds/arm9/data' + ;; + gp2x) + ;; + gph) + ;; + iphone) + OBJCFLAGS="$OBJCFLAGS --std=c99" + LIBS="$LIBS -lobjc -framework UIKit -framework CoreGraphics -framework OpenGLES" + LIBS="$LIBS -framework QuartzCore -framework GraphicsServices -framework CoreFoundation" + LIBS="$LIBS -framework Foundation -framework AudioToolbox -framework CoreAudio" + ;; + linuxmoto) + DEFINES="$DEFINES -DLINUXMOTO" + ;; + n64) + INCLUDES="$INCLUDES "'-I$(N64SDK)/include' + INCLUDES="$INCLUDES "'-I$(N64SDK)/mips64/include' + INCLUDES="$INCLUDES "'-I$(N64SDK)/hkz-libn64' + INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/n64' + LIBS="$LIBS -lpakfs -lframfs -ln64 -ln64utils -lromfs" + LIBS="$LIBS -lm -lstdc++ -lz" + ;; + null) + DEFINES="$DEFINES -DUSE_NULL_DRIVER" + ;; + openpandora) + ;; + ps2) + DEFINES="$DEFINES -D_EE" + DEFINES="$DEFINES -DFORCE_RTL" + INCLUDES="$INCLUDES -I$PS2SDK/ee/include" + INCLUDES="$INCLUDES -I$PS2SDK/common/include" + INCLUDES="$INCLUDES -I$PS2SDK/ports/include" + if test "$_dynamic_modules" = no ; then + LDFLAGS="$LDFLAGS -mno-crt0" + LDFLAGS="$LDFLAGS $PS2SDK/ee/startup/crt0.o" + LDFLAGS="$LDFLAGS -T $PS2SDK/ee/startup/linkfile" + fi + LDFLAGS="$LDFLAGS -L$PS2SDK/ee/lib" + LDFLAGS="$LDFLAGS -L$PS2SDK/ports/lib" + LIBS="$LIBS -lmc -lpad -lmouse -lhdd -lpoweroff -lsjpcm" + LIBS="$LIBS -lm -lc -lfileXio -lkernel -lstdc++" + ;; + psp) + DEFINES="$DEFINES -D__PSP__" + DEFINES="$DEFINES -DDISABLE_COMMAND_LINE" + DEFINES="$DEFINES -DDISABLE_DOSBOX_OPL" + LIBS="$LIBS -lpng" + LIBS="$LIBS -Wl,-Map,mapfile.txt" + ;; + samsungtv) + DEFINES="$DEFINES -DSAMSUNGTV" + LDFLAGS="$LDFLAGS -shared" + LDFLAGS="$LDFLAGS -fpic" + ;; + webos) + # There is no sdl-config in the WebOS PDK so we don't use find_sdlconfig here. + LIBS="$LIBS -lSDL" + DEFINES="$DEFINES -DWEBOS" + DEFINES="$DEFINES -DSDL_BACKEND" + add_line_to_config_mk "SDL_BACKEND = 1" + MODULES="$MODULES backends/platform/sdl" + ;; + wii) + DEFINES="$DEFINES -D__WII__" + DEFINES="$DEFINES -DGEKKO" + case $_host_os in + gamecube) + LIBS="$LIBS -lgxflux -liso9660 -lfat -logc -ldb" ;; *) - # Try to auto-detect.... - cat > $TMPC << EOF -#include -#include -int main(int argc, char **argv) { - unsigned char test[8] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88 }; - signal(SIGBUS, exit); - signal(SIGABRT, exit); - signal(SIGSEGV, exit); - if (*((unsigned int *)(test + 1)) != 0x55443322 && *((unsigned int *)(test + 1)) != 0x22334455) { - return 1; - } - return 0; -} -EOF - _need_memalign=yes - cc_check_no_clean && $TMPO$HOSTEXEEXT && _need_memalign=no - cc_check_clean + LIBS="$LIBS -lgxflux -ldi -liso9660 -ltinysmb -lfat -lwiiuse -lbte -logc -lwiikeyboard -ldb" ;; - esac - echo "$_need_memalign" -fi + esac + ;; + wince) + INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/wince' + INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/wince/CEgui' + INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/wince/CEkeys' + LIBS="$LIBS -static -lSDL" + DEFINES="$DEFINES -DSDL_BACKEND" + add_line_to_config_mk "SDL_BACKEND = 1" + ;; + sdl) + ;; + *) + echo "support for $_backend backend not implemented in configure script yet" + exit 1 + ;; +esac +MODULES="$MODULES backends/platform/$_backend" + +# +# Setup SDL specifics for SDL based backends +# +case $_backend in + dingux | gp2x | gph | linuxmoto | openpandora | samsungtv | sdl) + find_sdlconfig + INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`" + LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`" + DEFINES="$DEFINES -DSDL_BACKEND" + add_line_to_config_mk "SDL_BACKEND = 1" + ;; +esac + # # Enable 16bit support only for backends which support it @@ -2147,29 +2364,38 @@ esac # -# Add the results of the above checks to config.h +# Determine whether host is POSIX compliant, or at least POSIX +# compatible enough to support our POSIX code (including dlsym(), +# mkdir() and some other APIs). # -case $_endian in - big) - add_line_to_config_h '#undef SCUMM_LITTLE_ENDIAN' - add_line_to_config_h '#define SCUMM_BIG_ENDIAN' +# TODO: Instead of basing this on the host name, we should really base +# this on the presence of features (such as the dlsym and mkdir APIs). +# +echo_n "Checking if host is POSIX compliant... " +case $_host_os in + amigaos* | cygwin* | dreamcast | ds | gamecube | mingw* | n64 | ps2 | psp | wii | wince) + _posix=no ;; - little) - add_line_to_config_h '#define SCUMM_LITTLE_ENDIAN' - add_line_to_config_h '#undef SCUMM_BIG_ENDIAN' + android | beos* | bsd* | darwin* | freebsd* | gph-linux | haiku* | hpux* | iphone | irix* | linux* | mint* | netbsd* | openbsd* | solaris* | sunos* | uclinux* | webos) + _posix=yes + ;; + os2-emx*) + _posix=yes # FIXME: Really??? ;; *) - exit 1 + # given this is a shell script, we might assume some type of posix. + # However, the host system might be a totally different one, so + # we can assume nothing about it. + # Indeed, as mentioned further above, we really should test for the + # presences of relevant APIs on the host anyway... + _posix=no ;; esac +echo $_posix -define_in_config_h_if_yes $_have_x86 'HAVE_X86' - -define_in_config_h_if_yes $_need_memalign 'SCUMM_NEED_ALIGNMENT' - -if test "$_unix" = yes ; then - DEFINES="$DEFINES -DUNIX" - add_line_to_config_mk 'UNIX = 1' +if test "$_posix" = yes ; then + DEFINES="$DEFINES -DPOSIX" + add_line_to_config_mk 'POSIX = 1' fi # @@ -2185,16 +2411,15 @@ add_to_config_mk_if_yes "$_verbose_build" 'VERBOSE_BUILD = 1' echo_n "Checking whether building plugins was requested... " echo "$_dynamic_modules" _mak_plugins= -_def_plugin="/* -> plugins disabled */" if test "$_dynamic_modules" = yes ; then echo_n "Checking whether building plugins is supported... " case $_host_os in android) -_def_plugin=' -#define PLUGIN_PREFIX "lib" -#define PLUGIN_SUFFIX ".so" -' + _plugin_prefix="lib" + _plugin_suffix=".so" + CXXFLAGS="$CXXFLAGS -fpic" + LIBS="$LIBS -ldl" # Work around an Android 2.0+ run-time linker bug: # The linker doesn't actually look in previously # loaded libraries when trying to resolve symbols - @@ -2204,47 +2429,29 @@ _def_plugin=' # (otherwise unnecessary) dependency from plugins back # to the main libscummvm.so. _mak_plugins=' -DYNAMIC_MODULES := 1 -PLUGIN_PREFIX := lib -PLUGIN_SUFFIX := .so PLUGIN_EXTRA_DEPS = libscummvm.so -CXXFLAGS += -DDYNAMIC_MODULES -CXXFLAGS += -fpic PLUGIN_LDFLAGS += $(LDFLAGS) -L. -lscummvm PRE_OBJS_FLAGS := -Wl,-export-dynamic -Wl,-whole-archive POST_OBJS_FLAGS := -Wl,-no-whole-archive -LIBS += -ldl ' ;; darwin*) -_def_plugin=' -#define PLUGIN_PREFIX "" -#define PLUGIN_SUFFIX ".plugin" -' + _plugin_prefix="" + _plugin_suffix=".plugin" + LIBS="$LIBS -ldl" _mak_plugins=' -DYNAMIC_MODULES := 1 -PLUGIN_PREFIX := -PLUGIN_SUFFIX := .plugin PLUGIN_EXTRA_DEPS = $(EXECUTABLE) -CXXFLAGS += -DDYNAMIC_MODULES PLUGIN_LDFLAGS += -bundle -bundle_loader $(EXECUTABLE) -exported_symbols_list "$(srcdir)/plugin.exp" PRE_OBJS_FLAGS := -all_load POST_OBJS_FLAGS := -LIBS += -ldl ' ;; dreamcast) -_def_plugin=' -#define PLUGIN_PREFIX "" -#define PLUGIN_SUFFIX ".plg" -' + _plugin_prefix="" + _plugin_suffix=".plg" _mak_plugins=' -DYNAMIC_MODULES := 1 -PLUGIN_PREFIX := -PLUGIN_SUFFIX := .plg PLUGIN_EXTRA_DEPS = $(abspath $(srcdir)/backends/platform/dc/plugin.x $(srcdir)/backends/platform/dc/plugin.syms) $(EXECUTABLE) backends/platform/dc/plugin_head.o -CXXFLAGS += -DDYNAMIC_MODULES -PLUGIN_LDFLAGS = -ml -m4-single-only -nostartfiles -Wl,-q,-T$(srcdir)/backends/platform/dc/plugin.x,--just-symbols,$(EXECUTABLE),--retain-symbols-file,$(srcdir)/backends/platform/dc/plugin.syms -L$(ronindir)/lib backends/platform/dc/plugin_head.o +PLUGIN_LDFLAGS = -ml -m4-single-only -nostartfiles -Wl,-q,-T$(srcdir)/backends/platform/dc/plugin.x,--just-symbols,$(EXECUTABLE),--retain-symbols-file,$(srcdir)/backends/platform/dc/plugin.syms backends/platform/dc/plugin_head.o PRE_OBJS_FLAGS := -Wl,--whole-archive POST_OBJS_FLAGS := -Wl,--no-whole-archive ' @@ -2257,17 +2464,11 @@ PLUGIN_LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/ds/plugin.ld -mthumb-interwo ' ;; freebsd*) -_def_plugin=' -#define PLUGIN_PREFIX "lib" -#define PLUGIN_SUFFIX ".so" -' + _plugin_prefix="lib" + _plugin_suffix=".so" + CXXFLAGS="$CXXFLAGS -fpic" _mak_plugins=' -DYNAMIC_MODULES := 1 -PLUGIN_PREFIX := lib -PLUGIN_SUFFIX := .so PLUGIN_EXTRA_DEPS = -CXXFLAGS += -DDYNAMIC_MODULES -CXXFLAGS += -fpic PLUGIN_LDFLAGS += -shared PRE_OBJS_FLAGS := -Wl,-export-dynamic -Wl,-whole-archive POST_OBJS_FLAGS := -Wl,-no-whole-archive @@ -2281,62 +2482,56 @@ PLUGIN_LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/wii/plugin.ld ' ;; gph*) -_def_plugin=' -#define PLUGIN_PREFIX "" -#define PLUGIN_SUFFIX ".plugin" -' + _plugin_prefix="" + _plugin_suffix=".plugin" + CXXFLAGS="$CXXFLAGS -fpic" + LIBS="$LIBS -ldl" _mak_plugins=' -DYNAMIC_MODULES := 1 -PLUGIN_PREFIX := -PLUGIN_SUFFIX := .plugin PLUGIN_EXTRA_DEPS = $(EXECUTABLE) -CXXFLAGS += -DDYNAMIC_MODULES -CXXFLAGS += -fpic PLUGIN_LDFLAGS += -shared PRE_OBJS_FLAGS := -Wl,-export-dynamic -Wl,-whole-archive POST_OBJS_FLAGS := -Wl,-no-whole-archive -LIBS += -ldl ' ;; linux*) -_def_plugin=' -#define PLUGIN_PREFIX "lib" -#define PLUGIN_SUFFIX ".so" -' + _plugin_prefix="lib" + _plugin_suffix=".so" + CXXFLAGS="$CXXFLAGS -fpic" + LIBS="$LIBS -ldl" _mak_plugins=' -DYNAMIC_MODULES := 1 -PLUGIN_PREFIX := lib -PLUGIN_SUFFIX := .so PLUGIN_EXTRA_DEPS = -CXXFLAGS += -DDYNAMIC_MODULES -CXXFLAGS += -fpic PLUGIN_LDFLAGS += -shared PRE_OBJS_FLAGS := -Wl,-export-dynamic -Wl,-whole-archive POST_OBJS_FLAGS := -Wl,-no-whole-archive -LIBS += -ldl ' ;; *mingw32*) -_def_plugin=' -#define PLUGIN_PREFIX "" -#define PLUGIN_SUFFIX ".dll" -' + _plugin_prefix="" + _plugin_suffix=".dll" _mak_plugins=' -DYNAMIC_MODULES := 1 -PLUGIN_PREFIX := -PLUGIN_SUFFIX := .dll PLUGIN_EXTRA_DEPS = $(EXECUTABLE) -CXXFLAGS += -DDYNAMIC_MODULES PLUGIN_LDFLAGS := -Wl,--enable-auto-import -shared ./libscummvm.a PRE_OBJS_FLAGS := -Wl,--whole-archive POST_OBJS_FLAGS := -Wl,--export-all-symbols -Wl,--no-whole-archive -Wl,--out-implib,./libscummvm.a +' + ;; + wince) + DEFINES="$DEFINES -DUNCACHED_PLUGINS" + HOSTEXEEXT=".dll" + _plugin_prefix="" + _plugin_suffix=".plugin" +_mak_plugins=' +PLUGIN_EXTRA_DEPS = $(EXECUTABLE) +PLUGIN_LDFLAGS := -shared -lscummvm -L. +PRE_OBJS_FLAGS := -Wl,--whole-archive +POST_OBJS_FLAGS := -Wl,--export-all-symbols -Wl,--no-whole-archive -Wl,--out-implib,./libscummvm.a -shared ' ;; ps2) _elf_loader=yes DEFINES="$DEFINES -DMIPS_TARGET" _mak_plugins=' -LDFLAGS += -mno-crt0 $(PS2SDK)/ee/startup/crt0.o -T$(srcdir)/backends/plugins/ps2/main_prog.ld +LDFLAGS += -mno-crt0 $(PS2SDK)/ee/startup/crt0.o -Wl,-T$(srcdir)/backends/plugins/ps2/main_prog.ld PLUGIN_LDFLAGS += -mno-crt0 $(PS2SDK)/ee/startup/crt0.o -Wl,-T$(srcdir)/backends/plugins/ps2/plugin.ld -lstdc++ -lc ' ;; @@ -2349,27 +2544,20 @@ PLUGIN_LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/psp/plugin.ld -lstdc++ -lc ' ;; webos) -_def_plugin=' -#define PLUGIN_PREFIX "lib" -#define PLUGIN_SUFFIX ".so" -' + _plugin_prefix="lib" + _plugin_suffix=".so" + CXXFLAGS="$CXXFLAGS -fpic" + LIBS="$LIBS -ldl" _mak_plugins=' -DYNAMIC_MODULES := 1 -PLUGIN_PREFIX := lib -PLUGIN_SUFFIX := .so PLUGIN_EXTRA_DEPS = -CXXFLAGS += -DDYNAMIC_MODULES -CXXFLAGS += -fpic PLUGIN_LDFLAGS += -shared $(LDFLAGS) PRE_OBJS_FLAGS := -Wl,-export-dynamic -Wl,-whole-archive POST_OBJS_FLAGS := -Wl,-no-whole-archive -LIBS += -ldl ' ;; *) _dynamic_modules=no _mak_plugins= - _def_plugin= ;; esac echo "$_dynamic_modules" @@ -2381,15 +2569,9 @@ fi define_in_config_if_yes "$_elf_loader" 'USE_ELF_LOADER' if test "$_elf_loader" = yes; then - CXXFLAGS="$CXXFLAGS -DDYNAMIC_MODULES" - _def_plugin=' -#define PLUGIN_PREFIX "" -#define PLUGIN_SUFFIX ".plg" -' + _plugin_prefix="" + _plugin_suffix=".plg" _mak_plugins=' -DYNAMIC_MODULES := 1 -PLUGIN_PREFIX := -PLUGIN_SUFFIX := .plg PLUGIN_EXTRA_DEPS = $(EXECUTABLE) PLUGIN_LDFLAGS = -nostartfiles backends/plugins/elf/version.o -Wl,-q,--just-symbols,$(EXECUTABLE),--retain-symbols-file,$(srcdir)/backends/plugins/elf/plugin.syms PRE_OBJS_FLAGS := -Wl,--whole-archive @@ -2397,6 +2579,19 @@ POST_OBJS_FLAGS := -Wl,--no-whole-archive '"$_mak_plugins" fi +# +# Set up some common plugin settings in config.h and config.mk, if enabled +# +define_in_config_if_yes "$_dynamic_modules" 'DYNAMIC_MODULES' + +if test "$_dynamic_modules" = yes ; then + add_line_to_config_h "#define PLUGIN_PREFIX \"$_plugin_prefix\"" + add_line_to_config_h "#define PLUGIN_SUFFIX \"$_plugin_suffix\"" + add_line_to_config_mk "PLUGIN_PREFIX := $_plugin_prefix" + add_line_to_config_mk "PLUGIN_SUFFIX := $_plugin_suffix" +fi + + # # Check whether integrated MT-32 emulator support is requested # @@ -2417,28 +2612,6 @@ define_in_config_if_yes "$_build_scalers" 'USE_SCALERS' define_in_config_if_yes "$_build_hq_scalers" 'USE_HQ_SCALERS' -# -# Check whether to use optimized ARM asm -# -define_in_config_if_yes "$_arm_asm" 'USE_ARM_SCALER_ASM' -define_in_config_if_yes "$_arm_asm" 'USE_ARM_SOUND_ASM' -define_in_config_if_yes "$_arm_asm" 'USE_ARM_SMUSH_ASM' -define_in_config_if_yes "$_arm_asm" 'USE_ARM_GFX_ASM' -define_in_config_if_yes "$_arm_asm" 'USE_ARM_COSTUME_ASM' - -# -# Check whether to compile the Indeo3 decoder -# -if test "$_indeo3" = auto ; then - # Autodetect. Build if either the gob engine or plugins are enabled - if test `get_engine_build gob` = yes || test "$_dynamic_modules" = yes ; then - _indeo3=yes - else - _indeo3=no - fi -fi -define_in_config_if_yes "$_indeo3" 'USE_INDEO3' - # # Check for math lib # @@ -2595,11 +2768,6 @@ fi define_in_config_if_yes "$_png" 'USE_PNG' echo "$_png" -if test `get_engine_build sword25` = yes && test ! "$_png" = yes ; then - echo "...disabling Broken Sword 2.5 engine. PNG is required" - engine_disable sword25 -fi - # # Check for Theora Decoder # @@ -2651,9 +2819,9 @@ echo "$_faad" echocheck "SEQ MIDI" if test "$_seq_midi" = auto ; then # TODO: Test for /dev/sequencer presence? Or maybe just for /dev ? - # For now, we just always enable it when "unix" mode is on (backends + # For now, we just always enable it when "posix" mode is on (backends # that do not want it can disable it by setting _seq_midi=no). - _seq_midi="$_unix" + _seq_midi="$_posix" fi define_in_config_h_if_yes "$_seq_midi" 'USE_SEQ_MIDI' echo "$_seq_midi" @@ -2666,7 +2834,7 @@ if test "$_timidity" = auto ; then # TODO: Is there a good possibility of auto detecting whether we # should include TiMidity support? It can only be used on Unix # currently so we use that as "detection" for now. - _timidity="$_unix" + _timidity="$_posix" fi define_in_config_h_if_yes "$_timidity" 'USE_TIMIDITY' echo "$_timidity" @@ -2691,6 +2859,11 @@ fi define_in_config_if_yes "$_zlib" 'USE_ZLIB' echo "$_zlib" +if test `get_engine_build sword25` = yes && test ! "$_zlib" = yes ; then + echo "...disabling Broken Sword 2.5 engine. ZLib is required" + engine_disable sword25 +fi + # # Check for LibMPEG2 # @@ -2796,7 +2969,7 @@ if test "$_readline" = yes ; then fi define_in_config_h_if_yes "$_readline" 'USE_READLINE' -define_in_config_h_if_yes "$_text_console" 'USE_TEXT_CONSOLE' +define_in_config_h_if_yes "$_text_console" 'USE_TEXT_CONSOLE_FOR_DEBUGGER' # # Check for OpenGL (ES) @@ -2882,6 +3055,7 @@ fi define_in_config_if_yes "$_opengl" "USE_OPENGL" define_in_config_if_yes "$_opengles" "USE_GLES" + # # Check for nasm # @@ -2943,12 +3117,8 @@ define_in_config_if_yes $_nasm 'USE_NASM' # # Enable vkeybd / keymapper # -if test "$_vkeybd" = yes ; then - DEFINES="$DEFINES -DENABLE_VKEYBD" -fi -if test "$_keymapper" = yes ; then - DEFINES="$DEFINES -DENABLE_KEYMAPPER" -fi +define_in_config_if_yes $_vkeybd 'ENABLE_VKEYBD' +define_in_config_if_yes $_keymapper 'ENABLE_KEYMAPPER' # Check whether to build translation support # @@ -3030,10 +3200,6 @@ if test "$_mt32emu" = yes ; then echo_n ", MT-32 emu" fi -if test "$_indeo3" = yes ; then - echo_n ", Indeo3 decoder" -fi - if test "$_text_console" = yes ; then echo_n ", text console" fi @@ -3049,24 +3215,16 @@ else fi # -# Backend related stuff +# Some last-minute backend specific stuff, executed +# after all of CXXFLAGS, LDFLAGS, LIBS etc. have been setup # case $_backend in android) - # ssp at this point so the cxxtests link - if test "$_debug_build" = yes; then - CXXFLAGS="$CXXFLAGS -fstack-protector" - else - CXXFLAGS="$CXXFLAGS -fno-stack-protector" - fi - CXXFLAGS="$CXXFLAGS -Wa,--noexecstack" - LDFLAGS="$LDFLAGS -Wl,-z,noexecstack" - static_libs='' system_libs='' for lib in $LIBS; do case $lib in - -lz|-lm) + -lz|-lm|-ldl) system_libs="$system_libs $lib" ;; *) @@ -3078,167 +3236,15 @@ case $_backend in # -lgcc is carefully placed here - we want to catch # all toolchain symbols in *our* libraries rather # than pick up anything unhygenic from the Android libs. - LIBS="-Wl,-Bstatic $static_libs" - LIBS="$LIBS -Wl,-Bdynamic -lgcc $system_libs -llog -lGLESv1_CM" - DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE" - ;; - dc) - INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/dc -isystem $(ronindir)/include' - LDFLAGS="$LDFLAGS -Wl,-Ttext,0x8c010000 -nostartfiles "'$(ronindir)/lib/crt0.o -L$(ronindir)/lib' - LIBS="$LIBS -lronin -lm" - ;; - dingux) - find_sdlconfig - INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`" - LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`" - DEFINES="$DEFINES -DSDL_BACKEND -DDINGUX" - LDFLAGS="$LDFLAGS " - MODULES="$MODULES backends/platform/sdl" - ;; - ds) - # TODO ds - INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/ds/arm9/source' - INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/ds/commoninclude' - INCLUDES="$INCLUDES "'-Ibackends/platform/ds/arm9/data' - ;; - gp2x) - find_sdlconfig - INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`" - LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`" - LDFLAGS="$LDFLAGS" - DEFINES="$DEFINES -DSDL_BACKEND" - ;; - gph) - find_sdlconfig - INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`" - LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`" - LDFLAGS="$LDFLAGS" - DEFINES="$DEFINES -DSDL_BACKEND" - ;; - iphone) - OBJCFLAGS="$OBJCFLAGS --std=c99" - LIBS="$LIBS -lobjc -framework UIKit -framework CoreGraphics -framework OpenGLES -framework QuartzCore -framework GraphicsServices -framework CoreFoundation -framework Foundation -framework AudioToolbox -framework CoreAudio" - ;; - linuxmoto) - find_sdlconfig - INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`" - LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`" - DEFINES="$DEFINES -DSDL_BACKEND -DLINUXMOTO" + LIBS="-Wl,-Bstatic $static_libs -Wl,-Bdynamic -lgcc $system_libs -llog -lGLESv1_CM" ;; n64) - INCLUDES="$INCLUDES "'-I$(N64SDK)/include' - INCLUDES="$INCLUDES "'-I$(N64SDK)/mips64/include' - INCLUDES="$INCLUDES "'-I$(N64SDK)/hkz-libn64' - INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/n64' - LIBS="$LIBS -lpakfs -lframfs -ln64 -ln64utils -lromfs -lm -lstdc++ -lc -lgcc -lz -lnosys" - ;; - null) - DEFINES="$DEFINES -DUSE_NULL_DRIVER" - ;; - openpandora) - find_sdlconfig - INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`" - LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`" - LDFLAGS="$LDFLAGS" - DEFINES="$DEFINES -DSDL_BACKEND" - ;; - ps2) - # TODO ps2 - DEFINES="$DEFINES -D_EE -DFORCE_RTL" - INCLUDES="$INCLUDES -I$PS2SDK/ee/include -I$PS2SDK/common/include -I$PS2SDK/ports/include" - if test "$_dynamic_modules" = no ; then - LDFLAGS="$LDFLAGS -mno-crt0 $PS2SDK/ee/startup/crt0.o -T $PS2SDK/ee/startup/linkfile" - fi - LDFLAGS="$LDFLAGS -L$PS2SDK/ee/lib -L$PS2SDK/ports/lib" - LIBS="$LIBS -lmc -lpad -lmouse -lhdd -lpoweroff -lsjpcm -lm -lc -lfileXio -lkernel -lstdc++ " - ;; - psp) - DEFINES="$DEFINES -D__PSP__ -DDISABLE_COMMAND_LINE -DDISABLE_DOSBOX_OPL" - LIBS="$LIBS -lpng -Wl,-Map,mapfile.txt" - ;; - samsungtv) - find_sdlconfig - INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`" - LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`" - DEFINES="$DEFINES -DSDL_BACKEND -DSAMSUNGTV" - LDFLAGS="$LDFLAGS -shared -fpic" - MODULES="$MODULES backends/platform/sdl" - ;; - sdl) - find_sdlconfig - INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`" - LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`" - DEFINES="$DEFINES -DSDL_BACKEND" - ;; - webos) - # There is no sdl-config in the WebOS PDK so we don't use find_sdlconfig here. - LIBS="$LIBS -lSDL" - DEFINES="$DEFINES -DSDL_BACKEND -DWEBOS" - MODULES="$MODULES backends/platform/sdl" - ;; - wii) - DEFINES="$DEFINES -D__WII__ -DGEKKO" - case $_host_os in - gamecube) - LIBS="$LIBS -lgxflux -liso9660 -lfat -logc -ldb" - ;; - *) - LIBS="$LIBS -lgxflux -ldi -liso9660 -ltinysmb -lfat -lwiiuse -lbte -logc -lwiikeyboard -ldb" - ;; - esac - ;; - wince) - INCLUDES="$INCLUDES "'-I$(srcdir) -I$(srcdir)/backends/platform/wince -I$(srcdir)/engines -I$(srcdir)/backends/platform/wince/missing/gcc -I$(srcdir)/backends/platform/wince/CEgui -I$(srcdir)/backends/platform/wince/CEkeys' - LIBS="$LIBS -static -lSDL" - DEFINES="$DEFINES -DSDL_BACKEND" - ;; - *) - echo "support for $_backend backend not implemented in configure script yet" - exit 1 + # Move some libs down here, otherwise some symbols requires by libvorbis aren't found + # during linking stage + LIBS="$LIBS -lc -lgcc -lnosys" ;; esac -MODULES="$MODULES backends/platform/$_backend" -# -# Do CXXFLAGS now that we know the compiler version -# -if test "$have_gcc" = yes ; then - if test "$_cxx_major" -ge "3" ; then - case $_host_os in - # newlib-based system include files suppress non-C89 function - # declarations under __STRICT_ANSI__ - amigaos* | android | dreamcast | ds | gamecube | mingw* | n64 | psp | ps2 | wii | wince ) - CXXFLAGS="$CXXFLAGS -W -Wno-unused-parameter" - ;; - *) - CXXFLAGS="$CXXFLAGS -ansi -W -Wno-unused-parameter" - ;; - esac - add_line_to_config_mk 'HAVE_GCC3 = 1' - add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP' - fi; - - if test "$_cxx_major" -eq 4 && test "$_cxx_minor" -ge 3 || \ - test "$_cxx_major" -gt 4 ; then - CXXFLAGS="$CXXFLAGS -Wno-empty-body" - else - CXXFLAGS="$CXXFLAGS -Wconversion" - fi; -elif test "$have_icc" = yes ; then - add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP' -fi; - -# Some platforms use certain GNU extensions in header files -case $_host_os in -android | gamecube | psp | wii) - ;; -*) - # ICC does not support pedantic - if test "$have_icc" = no ; then - CXXFLAGS="$CXXFLAGS -pedantic" - fi - ;; -esac # # Engine selection @@ -3341,9 +3347,6 @@ typedef signed $type_1_byte int8; typedef signed $type_2_byte int16; typedef signed $type_4_byte int32; -/* Plugin settings */ -$_def_plugin - #endif /* CONFIG_H */ EOF diff --git a/devtools/construct-pred-dict.pl b/devtools/construct-pred-dict.pl index a092429ff67..73feeba8935 100755 --- a/devtools/construct-pred-dict.pl +++ b/devtools/construct-pred-dict.pl @@ -20,9 +20,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -# $URL$ -# $Id$ -# # This script constructs dictionary for use with predictive input # diff --git a/devtools/convbdf.c b/devtools/convbdf.c index fc13cff6ced..4b1640dba75 100644 --- a/devtools/convbdf.c +++ b/devtools/convbdf.c @@ -27,9 +27,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include #include diff --git a/devtools/create_drascula/create_drascula.cpp b/devtools/create_drascula/create_drascula.cpp index 9ea2da380a1..20b60ab05f0 100644 --- a/devtools/create_drascula/create_drascula.cpp +++ b/devtools/create_drascula/create_drascula.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * This is a utility for storing all the hardcoded data of Drascula in a separate * data file, used by the game engine */ diff --git a/devtools/create_drascula/create_drascula.h b/devtools/create_drascula/create_drascula.h index 13903e9564d..754050c1729 100644 --- a/devtools/create_drascula/create_drascula.h +++ b/devtools/create_drascula/create_drascula.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CREATE_DRASCULA_H diff --git a/devtools/create_drascula/module.mk b/devtools/create_drascula/module.mk index b5a32d8d00c..bbc2f7bce0f 100644 --- a/devtools/create_drascula/module.mk +++ b/devtools/create_drascula/module.mk @@ -1,5 +1,3 @@ -# $URL$ -# $Id$ MODULE := devtools/create_drascula diff --git a/devtools/create_drascula/staticdata.h b/devtools/create_drascula/staticdata.h index f45af487b11..21b9a826229 100644 --- a/devtools/create_drascula/staticdata.h +++ b/devtools/create_drascula/staticdata.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef STATICDATA_H diff --git a/devtools/create_hugo/create_hugo.cpp b/devtools/create_hugo/create_hugo.cpp index 1dffa0edf17..e54ade2b288 100644 --- a/devtools/create_hugo/create_hugo.cpp +++ b/devtools/create_hugo/create_hugo.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * This is a utility for storing all the hardcoded data of Hugo in a separate * data file, used by the game engine */ diff --git a/devtools/create_hugo/create_hugo.h b/devtools/create_hugo/create_hugo.h index f30c186877b..e176dbb1958 100644 --- a/devtools/create_hugo/create_hugo.h +++ b/devtools/create_hugo/create_hugo.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CREATE_HUGO_H @@ -147,7 +144,7 @@ struct act1 { // Type 1 - Start an object cycle_t cycle; // Direction to start cycling }; -struct act2 { // Type 2 - Initialise an object coords +struct act2 { // Type 2 - Initialize an object coords byte actType; // The type of action int timer; // Time to set off the action int objNumb; // The object number @@ -171,21 +168,21 @@ struct act4 { // Type 4 - Set new backgrou long newBkgColor; // New color }; -struct act5 { // Type 5 - Initialise an object velocity +struct act5 { // Type 5 - Initialize an object velocity byte actType; // The type of action int timer; // Time to set off the action int objNumb; // The object number int vx, vy; // velocity }; -struct act6 { // Type 6 - Initialise an object carrying +struct act6 { // Type 6 - Initialize an object carrying byte actType; // The type of action int timer; // Time to set off the action int objNumb; // The object number bool carriedFl; // carrying }; -struct act7 { // Type 7 - Initialise an object to hero's coords +struct act7 { // Type 7 - Initialize an object to hero's coords byte actType; // The type of action int timer; // Time to set off the action int objNumb; // The object number @@ -197,14 +194,14 @@ struct act8 { // Type 8 - switch to new sc int screenIndex; // The new screen number }; -struct act9 { // Type 9 - Initialise an object state +struct act9 { // Type 9 - Initialize an object state byte actType; // The type of action int timer; // Time to set off the action int objNumb; // The object number byte newState; // New state }; -struct act10 { // Type 10 - Initialise an object path type +struct act10 { // Type 10 - Initialize an object path type byte actType; // The type of action int timer; // Time to set off the action int objNumb; // The object number @@ -293,7 +290,7 @@ struct act21 { // Type 21 - Gameover. Disa int timer; // Time to set off the action }; -struct act22 { // Type 22 - Initialise an object to hero's coords +struct act22 { // Type 22 - Initialize an object to hero's coords byte actType; // The type of action int timer; // Time to set off the action int objNumb; // The object number diff --git a/devtools/create_hugo/enums.h b/devtools/create_hugo/enums.h index 90cb1d54f33..f721c3d4f58 100644 --- a/devtools/create_hugo/enums.h +++ b/devtools/create_hugo/enums.h @@ -1376,7 +1376,7 @@ enum action_t { // Parameters: INIT_MAZE = 30, // 30 - Start special maze hotspot processing EXIT_MAZE = 31, // 31 - Exit special maze processing INIT_PRIORITY = 32, // 32 - Initialize fbg field - INIT_SCREEN = 33, // 33 - Initialise screen field of object + INIT_SCREEN = 33, // 33 - Initialize screen field of object AGSCHEDULE = 34, // 34 - Global schedule - lasts over new screen REMAPPAL = 35, // 35 - Remappe palette - palette index, color COND_NOUN = 36, // 36 - Conditional on noun appearing in line diff --git a/devtools/create_hugo/staticdata.h b/devtools/create_hugo/staticdata.h index c12191c11d5..582d5aaa8e8 100644 --- a/devtools/create_hugo/staticdata.h +++ b/devtools/create_hugo/staticdata.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/devtools/create_hugo/staticdisplay.h b/devtools/create_hugo/staticdisplay.h index 790bf74d3b5..03800017b5c 100644 --- a/devtools/create_hugo/staticdisplay.h +++ b/devtools/create_hugo/staticdisplay.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/devtools/create_hugo/staticengine.h b/devtools/create_hugo/staticengine.h index 362100b8f02..0091182c3cc 100644 --- a/devtools/create_hugo/staticengine.h +++ b/devtools/create_hugo/staticengine.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/devtools/create_hugo/staticfont.h b/devtools/create_hugo/staticfont.h index c5700cdf580..9fa87d194af 100644 --- a/devtools/create_hugo/staticfont.h +++ b/devtools/create_hugo/staticfont.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef STATICFONT_H diff --git a/devtools/create_hugo/staticintro.h b/devtools/create_hugo/staticintro.h index 2fe18b82314..d9880b707ca 100644 --- a/devtools/create_hugo/staticintro.h +++ b/devtools/create_hugo/staticintro.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/devtools/create_hugo/staticmouse.h b/devtools/create_hugo/staticmouse.h index 2d4987a30c5..b4d784210b4 100644 --- a/devtools/create_hugo/staticmouse.h +++ b/devtools/create_hugo/staticmouse.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/devtools/create_hugo/staticparser.h b/devtools/create_hugo/staticparser.h index 9e67e98c26c..a2e28c17908 100644 --- a/devtools/create_hugo/staticparser.h +++ b/devtools/create_hugo/staticparser.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/devtools/create_hugo/staticutil.h b/devtools/create_hugo/staticutil.h index 050655a4de4..9003788ec90 100644 --- a/devtools/create_hugo/staticutil.h +++ b/devtools/create_hugo/staticutil.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/devtools/create_kyradat/create_kyradat.cpp b/devtools/create_kyradat/create_kyradat.cpp index 7a4b8d73a10..6a8e6a0fbe7 100644 --- a/devtools/create_kyradat/create_kyradat.cpp +++ b/devtools/create_kyradat/create_kyradat.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/devtools/create_kyradat/create_kyradat.h b/devtools/create_kyradat/create_kyradat.h index d82e16fed04..22a6db4b39d 100644 --- a/devtools/create_kyradat/create_kyradat.h +++ b/devtools/create_kyradat/create_kyradat.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CREATE_KYRADAT_CREATE_KYRADAT_H diff --git a/devtools/create_kyradat/extract.cpp b/devtools/create_kyradat/extract.cpp index 6b801d14f95..2b6499d3fba 100644 --- a/devtools/create_kyradat/extract.cpp +++ b/devtools/create_kyradat/extract.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/devtools/create_kyradat/extract.h b/devtools/create_kyradat/extract.h index 0903852dd2b..fc473b33d1b 100644 --- a/devtools/create_kyradat/extract.h +++ b/devtools/create_kyradat/extract.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CREATE_KYRADAT_EXTRACT_H diff --git a/devtools/create_kyradat/games.cpp b/devtools/create_kyradat/games.cpp index 75a956cab05..f65ff14e1e7 100644 --- a/devtools/create_kyradat/games.cpp +++ b/devtools/create_kyradat/games.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/devtools/create_kyradat/md5.cpp b/devtools/create_kyradat/md5.cpp index 214b5ef7eda..9f90122981e 100644 --- a/devtools/create_kyradat/md5.cpp +++ b/devtools/create_kyradat/md5.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/devtools/create_kyradat/md5.h b/devtools/create_kyradat/md5.h index dd50efece86..37465210021 100644 --- a/devtools/create_kyradat/md5.h +++ b/devtools/create_kyradat/md5.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_MD5_H diff --git a/devtools/create_kyradat/module.mk b/devtools/create_kyradat/module.mk index 60cd1f8578f..fb458b43ff6 100644 --- a/devtools/create_kyradat/module.mk +++ b/devtools/create_kyradat/module.mk @@ -1,5 +1,3 @@ -# $URL$ -# $Id$ MODULE := devtools/create_kyradat diff --git a/devtools/create_kyradat/pak.cpp b/devtools/create_kyradat/pak.cpp index 4179f42df07..0203285a8fd 100644 --- a/devtools/create_kyradat/pak.cpp +++ b/devtools/create_kyradat/pak.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/devtools/create_kyradat/pak.h b/devtools/create_kyradat/pak.h index ee6dabb6724..cf415676dde 100644 --- a/devtools/create_kyradat/pak.h +++ b/devtools/create_kyradat/pak.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_PAK_H diff --git a/devtools/create_kyradat/search.cpp b/devtools/create_kyradat/search.cpp index 28631fa6522..36b59d948cb 100644 --- a/devtools/create_kyradat/search.cpp +++ b/devtools/create_kyradat/search.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/devtools/create_kyradat/search.h b/devtools/create_kyradat/search.h index 6459606ef81..bd6aa0355b9 100644 --- a/devtools/create_kyradat/search.h +++ b/devtools/create_kyradat/search.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SEARCH_H diff --git a/devtools/create_kyradat/tables.cpp b/devtools/create_kyradat/tables.cpp index 777f2376506..090b32debca 100644 --- a/devtools/create_kyradat/tables.cpp +++ b/devtools/create_kyradat/tables.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/devtools/create_kyradat/tables.h b/devtools/create_kyradat/tables.h index c990043f5d7..b9687a59490 100644 --- a/devtools/create_kyradat/tables.h +++ b/devtools/create_kyradat/tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CREATE_KYRADAT_TABLES_H diff --git a/devtools/create_kyradat/util.cpp b/devtools/create_kyradat/util.cpp index 702a36bc0e5..3b9f621949a 100644 --- a/devtools/create_kyradat/util.cpp +++ b/devtools/create_kyradat/util.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/devtools/create_kyradat/util.h b/devtools/create_kyradat/util.h index 077597ac07d..0d8e15cc375 100644 --- a/devtools/create_kyradat/util.h +++ b/devtools/create_kyradat/util.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef UTIL_H diff --git a/devtools/create_lure/create_lure_dat.cpp b/devtools/create_lure/create_lure_dat.cpp index 4964b269038..c53a6bf81db 100644 --- a/devtools/create_lure/create_lure_dat.cpp +++ b/devtools/create_lure/create_lure_dat.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * This is a utility for extracting needed resource data from different language * version of the Lure of the Temptress lure.exe executable files into a new file * lure.dat - this file is required for the ScummVM Lure of the Temptress module @@ -1923,7 +1920,7 @@ bool validate_executable() { dataSegment = 0xAD20; printf("Detected Spanish version\n"); } else { - printf("Lure executable version not recognised. Checksum = %xh\n", sumTotal); + printf("Lure executable version not recognized. Checksum = %xh\n", sumTotal); return false; } diff --git a/devtools/create_lure/create_lure_dat.h b/devtools/create_lure/create_lure_dat.h index 23090072bd0..9259a8dcc89 100644 --- a/devtools/create_lure/create_lure_dat.h +++ b/devtools/create_lure/create_lure_dat.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CREATE_LURE_DAT_H diff --git a/devtools/create_lure/module.mk b/devtools/create_lure/module.mk index 5d8192cb7af..410cd26ba3e 100644 --- a/devtools/create_lure/module.mk +++ b/devtools/create_lure/module.mk @@ -1,5 +1,3 @@ -# $URL$ -# $Id$ MODULE := devtools/create_lure diff --git a/devtools/create_lure/process_actions.cpp b/devtools/create_lure/process_actions.cpp index 30e7eed9e44..8539391d574 100644 --- a/devtools/create_lure/process_actions.cpp +++ b/devtools/create_lure/process_actions.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/devtools/create_mads/main.cpp b/devtools/create_mads/main.cpp index 26ae2a7558d..c5cd6d5b2ed 100644 --- a/devtools/create_mads/main.cpp +++ b/devtools/create_mads/main.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // HACK to allow building with the SDL backend on MinGW diff --git a/devtools/create_mads/module.mk b/devtools/create_mads/module.mk index c773da83664..20d8deb8af9 100644 --- a/devtools/create_mads/module.mk +++ b/devtools/create_mads/module.mk @@ -1,5 +1,3 @@ -# $URL$ -# $Id$ MODULE := devtools/create_mads diff --git a/devtools/create_mads/parser.cpp b/devtools/create_mads/parser.cpp index c37b3a7a80c..0c6df430468 100644 --- a/devtools/create_mads/parser.cpp +++ b/devtools/create_mads/parser.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include @@ -240,10 +237,10 @@ void close_source_file() { } /** - * Initialises the scanner + * Initializes the scanner */ void init_scanner(const char *name) { - // Initialise character table + // Initialize character table for (int i = 0; i < 256; ++i) char_table[i] = SPECIAL; for (int i = '0'; i <= '9'; ++i) char_table[i] = DIGIT; for (int i = 'A'; i <= 'Z'; ++i) char_table[i] = LETTER; @@ -268,7 +265,7 @@ void quit_scanner() { /** - * Initialises the output + * Initializes the output */ void init_output(const char *destFilename) { dest_file = fopen(destFilename, "wb"); diff --git a/devtools/create_mads/parser.h b/devtools/create_mads/parser.h index d404e8395ff..a7141c497a0 100644 --- a/devtools/create_mads/parser.h +++ b/devtools/create_mads/parser.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CREATE_MADS_PARSER diff --git a/devtools/create_project/codeblocks.cpp b/devtools/create_project/codeblocks.cpp index 8ca139e515b..e73dc110890 100644 --- a/devtools/create_project/codeblocks.cpp +++ b/devtools/create_project/codeblocks.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "config.h" diff --git a/devtools/create_project/codeblocks.h b/devtools/create_project/codeblocks.h index ba75daeafdc..8d35eb068e3 100644 --- a/devtools/create_project/codeblocks.h +++ b/devtools/create_project/codeblocks.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOOLS_CREATE_PROJECT_CODEBLOCKS_H diff --git a/devtools/create_project/config.h b/devtools/create_project/config.h index 1609e9e99a7..fecd95691ec 100644 --- a/devtools/create_project/config.h +++ b/devtools/create_project/config.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOOLS_CREATE_PROJECT_CONFIG_H diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp index de82dd16989..17b3d29d0bb 100644 --- a/devtools/create_project/create_project.cpp +++ b/devtools/create_project/create_project.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // HACK to allow building with the SDL backend on MinGW @@ -639,7 +636,7 @@ bool setEngineBuildState(const std::string &name, EngineDescList &engines, bool if (engine != engines.end()) { engine->enable = enable; - // When we disable an einge, we also need to disable all the sub engines. + // When we disable an engine, we also need to disable all the sub engines. if (!enable && !engine->subEngines.empty()) { for (StringList::const_iterator j = engine->subEngines.begin(); j != engine->subEngines.end(); ++j) { EngineDescList::iterator subEngine = std::find(engines.begin(), engines.end(), *j); @@ -741,7 +738,6 @@ const Feature s_features[] = { { "mt32emu", "USE_MT32EMU", "", true, "integrated MT-32 emulator" }, { "nasm", "USE_NASM", "", true, "IA-32 assembly support" }, // This feature is special in the regard, that it needs additional handling. { "opengl", "USE_OPENGL", "opengl32", true, "OpenGL support" }, - { "indeo3", "USE_INDEO3", "", true, "Indeo3 codec support"}, { "translation", "USE_TRANSLATION", "", true, "Translation support" }, { "vkeybd", "ENABLE_VKEYBD", "", false, "Virtual keyboard support"}, { "langdetect", "USE_DETECTLANG", "", true, "System language detection support" } // This feature actually depends on "translation", there diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h index e4ccd7313aa..9b9e4cfd1bc 100644 --- a/devtools/create_project/create_project.h +++ b/devtools/create_project/create_project.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOOLS_CREATE_PROJECT_H diff --git a/devtools/create_project/module.mk b/devtools/create_project/module.mk index 4382fe176ca..4238452c5de 100644 --- a/devtools/create_project/module.mk +++ b/devtools/create_project/module.mk @@ -1,5 +1,3 @@ -# $URL$ -# $Id$ MODULE := devtools/create_project diff --git a/devtools/create_project/msbuild.cpp b/devtools/create_project/msbuild.cpp index f9a2e936f03..f8ce80acfdb 100644 --- a/devtools/create_project/msbuild.cpp +++ b/devtools/create_project/msbuild.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "config.h" diff --git a/devtools/create_project/msbuild.h b/devtools/create_project/msbuild.h index 98bb65e19be..681c893d958 100644 --- a/devtools/create_project/msbuild.h +++ b/devtools/create_project/msbuild.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOOLS_CREATE_PROJECT_MSBUILD_H diff --git a/devtools/create_project/msvc.cpp b/devtools/create_project/msvc.cpp index af3aa4a519a..aa347b10816 100644 --- a/devtools/create_project/msvc.cpp +++ b/devtools/create_project/msvc.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "config.h" diff --git a/devtools/create_project/msvc.h b/devtools/create_project/msvc.h index 6c8ac33a760..ead4bf949a7 100644 --- a/devtools/create_project/msvc.h +++ b/devtools/create_project/msvc.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOOLS_CREATE_PROJECT_MSVC_H diff --git a/devtools/create_project/scripts/installer.vbs b/devtools/create_project/scripts/installer.vbs index 6bcd794bef4..d752355acdd 100644 --- a/devtools/create_project/scripts/installer.vbs +++ b/devtools/create_project/scripts/installer.vbs @@ -73,7 +73,7 @@ Sub CreateInstaller() Dim commandLine : commandLine = """" & nsisPath & "\makensis.exe"" /V2" & _ " /Dtop_srcdir=""" & rootFolder & """" & _ " /Dbuild_dir=""" & targetFolder & """" & _ - " /Dtext_dir=""" & targetFolder & """" & _ + " /Dtext_dir=""" & rootFolder & """" & _ " /DARCH=""" & arch & """" & _ " """ & rootFolder & "\dists\nsis\scummvm.nsi""" diff --git a/devtools/create_project/scripts/postbuild.cmd b/devtools/create_project/scripts/postbuild.cmd index e78861463af..a5051d82283 100644 --- a/devtools/create_project/scripts/postbuild.cmd +++ b/devtools/create_project/scripts/postbuild.cmd @@ -23,29 +23,30 @@ if "%~5"=="" goto error_installer echo Copying data files echo. -xcopy /F /Y "%~1/AUTHORS" %~2 > NUL 2>&1 -xcopy /F /Y "%~1/COPYING.GPL" %~2 > NUL 2>&1 -xcopy /F /Y "%~1/COPYING" %~2 > NUL 2>&1 -xcopy /F /Y "%~1/COPYING.LGPL" %~2 > NUL 2>&1 -xcopy /F /Y "%~1/COPYRIGHT" %~2 > NUL 2>&1 -xcopy /F /Y "%~1/NEWS" %~2 > NUL 2>&1 -xcopy /F /Y "%~1/README" %~2 > NUL 2>&1 +REM xcopy /F /Y "%~1/AUTHORS" %~2 1>NUL 2>&1 +REM xcopy /F /Y "%~1/COPYING.GPL" %~2 1>NUL 2>&1 +REM xcopy /F /Y "%~1/COPYING" %~2 1>NUL 2>&1 +REM xcopy /F /Y "%~1/COPYING.LGPL" %~2 1>NUL 2>&1 +REM xcopy /F /Y "%~1/COPYRIGHT" %~2 1>NUL 2>&1 +REM xcopy /F /Y "%~1/NEWS" %~2 1>NUL 2>&1 +REM xcopy /F /Y "%~1/README" %~2 1>NUL 2>&1 -xcopy /F /Y "%~1/dists/engine-data/*.dat" %~2 > NUL 2>&1 -xcopy /F /Y "%~1/dists/engine-data/*.tbl" %~2 > NUL 2>&1 -xcopy /F /Y "%~1/dists/engine-data/*.cpt" %~2 > NUL 2>&1 -xcopy /F /Y "%~1/gui/themes/*.zip" %~2 > NUL 2>&1 -xcopy /F /Y "%~1/gui/themes/translations.dat" %~2 > NUL 2>&1 -xcopy /F /Y "%~4/lib/%~3/SDL.dll" %~2 > NUL 2>&1 -xcopy /F /Y "%~4/README-SDL" %~2 > NUL 2>&1 +REM xcopy /F /Y "%~1/dists/engine-data/*.dat" %~2 1>NUL 2>&1 +REM xcopy /F /Y "%~1/dists/engine-data/*.tbl" %~2 1>NUL 2>&1 +REM xcopy /F /Y "%~1/dists/engine-data/*.cpt" %~2 1>NUL 2>&1 +REM xcopy /F /Y "%~1/gui/themes/*.zip" %~2 1>NUL 2>&1 +REM xcopy /F /Y "%~1/gui/themes/translations.dat" %~2 1>NUL 2>&1 -xcopy /F /Y "%~1/backends/vkeybd/packs/vkeybd_default.zip" %~2 > NUL 2>&1 +xcopy /F /Y "%~4/lib/%~3/SDL.dll" "%~2" 1>NUL 2>&1 +xcopy /F /Y "%~4/README-SDL" "%~2" 1>NUL 2>&1 + +xcopy /F /Y "%~1/backends/vkeybd/packs/vkeybd_default.zip" "%~2" 1>NUL 2>&1 if "%~5"=="0" goto done echo Running installer script echo. -@call cscript "%~1/devtools/create_project/scripts/installer.vbs" %~1 %~2 %~3 1>NUL +@call cscript "%~1/devtools/create_project/scripts/installer.vbs" "%~1" "%~2" "%~3" 1>NUL if not %errorlevel% == 0 goto error_script goto done diff --git a/devtools/create_project/scripts/prebuild.cmd b/devtools/create_project/scripts/prebuild.cmd index dd4d12a8514..fbab426137a 100644 --- a/devtools/create_project/scripts/prebuild.cmd +++ b/devtools/create_project/scripts/prebuild.cmd @@ -14,7 +14,7 @@ if "%~1"=="" goto error_root if "%~2"=="" goto error_target REM Run the revision script -@call cscript "%~1/devtools/create_project/scripts/revision.vbs" %~1 %~2 1>NUL +@call cscript "%~1/devtools/create_project/scripts/revision.vbs" "%~1" "%~2" 1>NUL if not %errorlevel% == 0 goto error_script goto done diff --git a/devtools/create_project/scripts/revision.vbs b/devtools/create_project/scripts/revision.vbs index 3e1212521cc..e6fef57030e 100644 --- a/devtools/create_project/scripts/revision.vbs +++ b/devtools/create_project/scripts/revision.vbs @@ -80,6 +80,7 @@ Sub DetermineRevision() If Not DetermineGitVersion() Then If Not DetermineHgVersion() Then Wscript.StdErr.WriteLine "Could not determine the current revision, skipping..." + OutputRevisionHeader "" Exit Sub End If End If @@ -91,6 +92,7 @@ Sub DetermineRevision() If Not DetermineTortoiseSVNVersion() Then If Not DetermineSVNVersion() Then Wscript.StdErr.WriteLine "Could not determine the current revision, skipping..." + OutputRevisionHeader "" Exit Sub End If End If @@ -121,9 +123,13 @@ Sub DetermineRevision() Wscript.StdErr.WriteLine outputInfo & vbCrLf - ' Output revision header file + OutputRevisionHeader revisionString +End Sub + +' Output revision header file +Sub OutputRevisionHeader(str) FSO.CopyFile rootFolder & "\\base\\internal_revision.h.in", targetFolder & "\\internal_revision.h" - FindReplaceInFile targetFolder & "\\internal_revision.h", "@REVISION@", revisionString + FindReplaceInFile targetFolder & "\\internal_revision.h", "@REVISION@", str End Sub Function DetermineTortoiseSVNVersion() diff --git a/devtools/create_project/visualstudio.cpp b/devtools/create_project/visualstudio.cpp index 8642f071fff..4fadfd25098 100644 --- a/devtools/create_project/visualstudio.cpp +++ b/devtools/create_project/visualstudio.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "config.h" diff --git a/devtools/create_project/visualstudio.h b/devtools/create_project/visualstudio.h index 0e4b441e634..dad923e49c6 100644 --- a/devtools/create_project/visualstudio.h +++ b/devtools/create_project/visualstudio.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOOLS_CREATE_PROJECT_VISUALSTUDIO_H diff --git a/devtools/create_teenagent/create_teenagent.cpp b/devtools/create_teenagent/create_teenagent.cpp index 9a9c00d4b45..9551acbaea4 100644 --- a/devtools/create_teenagent/create_teenagent.cpp +++ b/devtools/create_teenagent/create_teenagent.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/devtools/create_teenagent/md5.cpp b/devtools/create_teenagent/md5.cpp index 214b5ef7eda..9f90122981e 100644 --- a/devtools/create_teenagent/md5.cpp +++ b/devtools/create_teenagent/md5.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/devtools/create_teenagent/md5.h b/devtools/create_teenagent/md5.h index dd50efece86..37465210021 100644 --- a/devtools/create_teenagent/md5.h +++ b/devtools/create_teenagent/md5.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_MD5_H diff --git a/devtools/create_teenagent/module.mk b/devtools/create_teenagent/module.mk index 5c9b8761406..a9d102addbb 100644 --- a/devtools/create_teenagent/module.mk +++ b/devtools/create_teenagent/module.mk @@ -1,5 +1,3 @@ -# $URL$ -# $Id$ MODULE := devtools/create_teenagent diff --git a/devtools/create_teenagent/util.h b/devtools/create_teenagent/util.h index 077597ac07d..0d8e15cc375 100644 --- a/devtools/create_teenagent/util.h +++ b/devtools/create_teenagent/util.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef UTIL_H diff --git a/devtools/create_toon/create_toon.cpp b/devtools/create_toon/create_toon.cpp index 3cf252cbcdf..bdd57be7df5 100644 --- a/devtools/create_toon/create_toon.cpp +++ b/devtools/create_toon/create_toon.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * This is a utility for storing all the hardcoded data of Toonstruck in a separate * data file, used by the game engine */ diff --git a/devtools/create_toon/create_toon.h b/devtools/create_toon/create_toon.h index 0695944b179..60b33013f4b 100644 --- a/devtools/create_toon/create_toon.h +++ b/devtools/create_toon/create_toon.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CREATE_TOON_H diff --git a/devtools/create_toon/staticdata.h b/devtools/create_toon/staticdata.h index efcb8930247..2164512337c 100644 --- a/devtools/create_toon/staticdata.h +++ b/devtools/create_toon/staticdata.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef STATICDATA_H diff --git a/devtools/credits.pl b/devtools/credits.pl index c45f16eec9c..b0f40cbe6e6 100755 --- a/devtools/credits.pl +++ b/devtools/credits.pl @@ -5,10 +5,9 @@ # of the credits in other places from this source. In particular: # - The AUTHORS file # - The gui/credits.h header file +# - The Credits.rtf file used by the Mac OS X port # - The credits.xml file, part of the DocBook manual # - Finally, credits.xml, for use on the website (different format than the DocBook one) -# And maybe in the future, also "doc/10.tex", the LaTeX version of the README. -# Although that might soon be obsolete, if the manual evolves enough. # # Initial version written by Fingolfin in December 2004. # @@ -37,7 +36,6 @@ if ($#ARGV >= 0) { $mode = "CPP" if ($ARGV[0] eq "--cpp"); # credits.h (for use by about.cpp) $mode = "XML-DOC" if ($ARGV[0] eq "--xml-docbook"); # credits.xml (DocBook) $mode = "RTF" if ($ARGV[0] eq "--rtf"); # Credits.rtf (Mac OS X About box) - $mode = "TEX" if ($ARGV[0] eq "--tex"); # 10.tex (LaTeX) } if ($mode eq "") { @@ -184,10 +182,6 @@ sub begin_credits { if ($mode eq "TEXT") { #print html_entities_to_ascii($title)."\n"; - } elsif ($mode eq "TEX") { - print "% This file was generated by credits.pl. Do not edit by hand!\n"; - print '\section{Credits}' . "\n"; - print '\begin{trivlist}' . "\n"; } elsif ($mode eq "RTF") { print '{\rtf1\mac\ansicpg10000' . "\n"; print '{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;}' . "\n"; @@ -219,9 +213,6 @@ sub begin_credits { sub end_credits { if ($mode eq "TEXT") { - } elsif ($mode eq "TEX") { - print '\end{trivlist}' . "\n"; - print "\n"; } elsif ($mode eq "RTF") { print "}\n"; } elsif ($mode eq "CPP") { @@ -252,15 +243,6 @@ sub begin_section { } elsif ($section_level eq 1) { print " " x $section_level . "-" x (length $title)."\n"; } - } elsif ($mode eq "TEX") { - print '\item \textbf{'; - if ($section_level eq 0) { - print '\LARGE'; - } elsif ($section_level eq 1) { - print '\large'; - } - print " " . html_entities_to_tex($title) . "}\n"; - print '\begin{list}{}{\setlength{\leftmargin}{0.2cm}}' . "\n"; } elsif ($mode eq "RTF") { $title = html_entities_to_rtf($title); @@ -327,8 +309,6 @@ sub end_section { if ($mode eq "TEXT") { # nothing - } elsif ($mode eq "TEX") { - print '\end{list}' . "\n"; } elsif ($mode eq "RTF") { # nothing } elsif ($mode eq "CPP") { @@ -352,16 +332,12 @@ sub begin_persons { print "\t\t\t\n"; print "\t\t\t\t" . $title . "\n"; #print "\t\t\t\t\n"; - } elsif ($mode eq "TEX") { - print '\item \begin{tabular}[h]{p{0.3\linewidth}p{0.6\linewidth}}' . "\n"; } } sub end_persons { if ($mode eq "TEXT") { print "\n"; - } elsif ($mode eq "TEX") { - print ' \end{tabular}' . "\n"; } elsif ($mode eq "RTF") { # nothing } elsif ($mode eq "XML-WEB") { @@ -392,12 +368,6 @@ sub add_person { print " - " . substr(wrap($multitab, $multitab, $desc), $inner_indent); } print "\n"; - } elsif ($mode eq "TEX") { - $name = $nick if $name eq ""; - $name = html_entities_to_tex($name); - $desc = html_entities_to_tex($desc); - - print " $name & \\textit{$desc}\\\\\n"; } elsif ($mode eq "RTF") { $name = $nick if $name eq ""; $name = html_entities_to_rtf($name); @@ -447,11 +417,6 @@ sub add_paragraph { $tab = " " x ($section_level * 2 + 1); print wrap($tab, $tab, html_entities_to_ascii($text))."\n"; print "\n"; - } elsif ($mode eq "TEX") { - $text = html_entities_to_tex($text); - print '\item' . "\n"; - print $text; - print "\n"; } elsif ($mode eq "RTF") { $text = html_entities_to_rtf($text); # Center text @@ -502,7 +467,7 @@ begin_credits("Credits"); add_person("Jonathan Gray", "khalek", "(retired)"); add_person("Vincent Hamm", "yaz0r", "(retired)"); add_person("Max Horn", "Fingolfin", ""); - add_person("Travis Howell", "Kirben", ""); + add_person("Travis Howell", "Kirben", "(retired)"); add_person("Paweł Kołodziejski", "aquadran", "Codecs, iMUSE, Smush, etc."); add_person("Gregory Montoir", "cyx", ""); add_person("Eugene Sandulenko", "sev", "FT INSANE, MM NES, MM C64, game detection, Herc/CGA"); @@ -511,7 +476,7 @@ begin_credits("Credits"); begin_section("HE"); add_person("Jonathan Gray", "khalek", "(retired)"); - add_person("Travis Howell", "Kirben", ""); + add_person("Travis Howell", "Kirben", "(retired)"); add_person("Gregory Montoir", "cyx", ""); add_person("Eugene Sandulenko", "sev", ""); end_section(); @@ -530,38 +495,12 @@ begin_credits("Credits"); begin_section("AGOS"); add_person("Torbjörn Andersson", "eriktorbjorn", ""); add_person("Paul Gilbert", "dreammaster", ""); - add_person("Travis Howell", "Kirben", ""); + add_person("Travis Howell", "Kirben", "(retired)"); add_person("Oliver Kiehl", "olki", "(retired)"); add_person("Ludvig Strigeus", "ludde", "(retired)"); end_section(); - begin_section("BASS"); # Beneath a Steel Sky - add_person("Robert Göffringmann", "lavosspawn", "(retired)"); - add_person("Oliver Kiehl", "olki", "(retired)"); - add_person("Joost Peters", "joostp", ""); - end_section(); - - begin_section("Broken Sword"); - add_person("Fabio Battaglia", "Hkz", "PSX version support"); - add_person("Thierry Crozat", "criezy", "Mac version support"); - add_person("Robert Göffringmann", "lavosspawn", "(retired)"); - end_section(); - - begin_section("Broken Sword II"); - add_person("Torbjörn Andersson", "eriktorbjorn", ""); - add_person("Fabio Battaglia", "Hkz", "PSX version support"); - add_person("Jonathan Gray", "khalek", "(retired)"); - end_section(); - - begin_section("Broken Sword 2.5"); - add_person("Eugene Sandulenko", "sev", ""); - add_person("Filippos Karapetis", "[md5]", ""); - add_person("Max Horn", "Fingolfin", ""); - add_person("Paul Gilbert", "dreammaster", ""); - add_person("Torbjörn Andersson", "eriktorbjorn", ""); - end_section(); - - begin_section("Cinematique evo 1"); + begin_section("Cine"); add_person("Vincent Hamm", "yaz0r", "(retired)"); add_person("Paweł Kołodziejski", "aquadran", ""); add_person("Gregory Montoir", "cyx", ""); @@ -569,7 +508,7 @@ begin_credits("Credits"); add_person("Eugene Sandulenko", "sev", ""); end_section(); - begin_section("Cinematique evo 2"); + begin_section("CruisE"); add_person("Paul Gilbert", "dreammaster", ""); add_person("Vincent Hamm", "yaz0r", "(retired)"); end_section(); @@ -584,12 +523,6 @@ begin_credits("Credits"); add_person("Paweł Kołodziejski", "aquadran", ""); end_section(); - begin_section("FOTAQ"); # Flight of the Amazon Queen - add_person("David Eriksson", "twogood", "(retired)"); - add_person("Gregory Montoir", "cyx", ""); - add_person("Joost Peters", "joostp", ""); - end_section(); - begin_section("Gob"); add_person("Torbjörn Andersson", "eriktorbjorn", ""); add_person("Arnaud Boutonné", "Strangerke", ""); @@ -617,7 +550,7 @@ begin_credits("Credits"); add_person("Johannes Schickel", "LordHoto", ""); end_section(); - begin_section("Last Express"); + begin_section("Lastexpress"); add_person("Matthew Hoops", "clone2727", ""); add_person("Jordi Vilalta Prat", "jvprat", ""); add_person("Julien Templier", "littleboy", ""); @@ -652,6 +585,12 @@ begin_credits("Credits"); add_person("", "peres", ""); end_section(); + begin_section("Queen"); + add_person("David Eriksson", "twogood", "(retired)"); + add_person("Gregory Montoir", "cyx", ""); + add_person("Joost Peters", "joostp", ""); + end_section(); + begin_section("SAGA"); add_person("Torbjörn Andersson", "eriktorbjorn", ""); add_person("Filippos Karapetis", "[md5]", ""); @@ -671,6 +610,32 @@ begin_credits("Credits"); add_person("Lars Skovlund", "lskovlun", ""); end_section(); + begin_section("Sky"); + add_person("Robert Göffringmann", "lavosspawn", "(retired)"); + add_person("Oliver Kiehl", "olki", "(retired)"); + add_person("Joost Peters", "joostp", ""); + end_section(); + + begin_section("Sword1"); + add_person("Fabio Battaglia", "Hkz", "PSX version support"); + add_person("Thierry Crozat", "criezy", "Mac version support"); + add_person("Robert Göffringmann", "lavosspawn", "(retired)"); + end_section(); + + begin_section("Sword2"); + add_person("Torbjörn Andersson", "eriktorbjorn", ""); + add_person("Fabio Battaglia", "Hkz", "PSX version support"); + add_person("Jonathan Gray", "khalek", "(retired)"); + end_section(); + + begin_section("Sword25"); + add_person("Eugene Sandulenko", "sev", ""); + add_person("Filippos Karapetis", "[md5]", ""); + add_person("Max Horn", "Fingolfin", ""); + add_person("Paul Gilbert", "dreammaster", ""); + add_person("Torbjörn Andersson", "eriktorbjorn", ""); + end_section(); + begin_section("TeenAgent"); add_person("Robert Megone", "sanguine", "Help with callback rewriting"); add_person("Vladimir Menshakov", "whoozle", ""); @@ -747,7 +712,8 @@ begin_credits("Credits"); begin_section("PocketPC / WinCE"); add_person("Nicolas Bacca", "arisme", "(retired)"); - add_person("Kostas Nakos", "Jubanka", ""); + add_person("Ismail Khatib", "CeRiAl", ""); + add_person("Kostas Nakos", "Jubanka", "(retired)"); end_section(); begin_section("PlayStation 2"); @@ -908,7 +874,7 @@ begin_credits("Credits"); end_section(); begin_section("Win32"); - add_person("Travis Howell", "Kirben", ""); + add_person("Travis Howell", "Kirben", "(retired)"); end_section(); begin_section("Win64"); diff --git a/devtools/dist-scummvm.sh b/devtools/dist-scummvm.sh index de76c9f6a91..ac411c55a30 100755 --- a/devtools/dist-scummvm.sh +++ b/devtools/dist-scummvm.sh @@ -23,8 +23,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -# $URL$ -# $Id$ ### configuration diff --git a/devtools/extract-words-tok.pl b/devtools/extract-words-tok.pl index 9209d49eb5f..1157ef557f9 100755 --- a/devtools/extract-words-tok.pl +++ b/devtools/extract-words-tok.pl @@ -20,9 +20,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -# $URL$ -# $Id$ -# # This script extracts AGI words.tok file # diff --git a/devtools/make-scumm-fontdata.c b/devtools/make-scumm-fontdata.c index 991d49831a5..73b21846ec1 100644 --- a/devtools/make-scumm-fontdata.c +++ b/devtools/make-scumm-fontdata.c @@ -18,8 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ */ #include diff --git a/devtools/md5table.c b/devtools/md5table.c index 7d76b7541db..9e57edbc35b 100644 --- a/devtools/md5table.c +++ b/devtools/md5table.c @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/devtools/module.mk b/devtools/module.mk index fdbc13f645b..1ff5ba6da90 100644 --- a/devtools/module.mk +++ b/devtools/module.mk @@ -1,5 +1,3 @@ -# $URL$ -# $Id$ MODULE := devtools diff --git a/devtools/qtable/module.mk b/devtools/qtable/module.mk index 5aab9ad0c77..fbc18f2fe3d 100644 --- a/devtools/qtable/module.mk +++ b/devtools/qtable/module.mk @@ -1,5 +1,3 @@ -# $URL$ -# $Id$ MODULE := devtools/qtable diff --git a/devtools/sci/musicplayer.cpp b/devtools/sci/musicplayer.cpp index 139ce451eff..e4d07798485 100644 --- a/devtools/sci/musicplayer.cpp +++ b/devtools/sci/musicplayer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef HAVE_CONFIG_H diff --git a/devtools/sci/scidisasm.cpp b/devtools/sci/scidisasm.cpp index 39ea7f9c410..9b212c208dc 100644 --- a/devtools/sci/scidisasm.cpp +++ b/devtools/sci/scidisasm.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef HAVE_CONFIG_H diff --git a/devtools/sci/scipack.cpp b/devtools/sci/scipack.cpp index f70d91fabc4..ff52e250615 100644 --- a/devtools/sci/scipack.cpp +++ b/devtools/sci/scipack.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include diff --git a/devtools/sci/scitrace.asm b/devtools/sci/scitrace.asm index 360e0b7ffcf..2e541326f20 100644 --- a/devtools/sci/scitrace.asm +++ b/devtools/sci/scitrace.asm @@ -18,9 +18,6 @@ ; along with this program; if not, write to the Free Software ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ; -; $URL$ -; $Id$ -; ;--------------------------------------------------------------------------- ; ; SCITRACE diff --git a/devtools/skycpt/AsciiCptCompile.cpp b/devtools/skycpt/AsciiCptCompile.cpp index 1169de5aea0..154c13b8cd4 100644 --- a/devtools/skycpt/AsciiCptCompile.cpp +++ b/devtools/skycpt/AsciiCptCompile.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // HACK to allow building with the SDL backend on MinGW diff --git a/devtools/skycpt/KmpSearch.cpp b/devtools/skycpt/KmpSearch.cpp index b0512a8d3e5..95511562953 100644 --- a/devtools/skycpt/KmpSearch.cpp +++ b/devtools/skycpt/KmpSearch.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "stdafx.h" diff --git a/devtools/skycpt/KmpSearch.h b/devtools/skycpt/KmpSearch.h index 6f13ace4a5c..f39b993bd27 100644 --- a/devtools/skycpt/KmpSearch.h +++ b/devtools/skycpt/KmpSearch.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKYCPT_KMPSEARCH_H diff --git a/devtools/skycpt/TextFile.cpp b/devtools/skycpt/TextFile.cpp index ee64d22f5fe..e9887dc87b2 100644 --- a/devtools/skycpt/TextFile.cpp +++ b/devtools/skycpt/TextFile.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "stdafx.h" diff --git a/devtools/skycpt/TextFile.h b/devtools/skycpt/TextFile.h index a9ad65417c3..6c390c050d0 100644 --- a/devtools/skycpt/TextFile.h +++ b/devtools/skycpt/TextFile.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKYCPT_TEXTFILE_H diff --git a/devtools/skycpt/cptcompiler.cpp b/devtools/skycpt/cptcompiler.cpp index 7453b383b62..264646816c1 100644 --- a/devtools/skycpt/cptcompiler.cpp +++ b/devtools/skycpt/cptcompiler.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "stdafx.h" diff --git a/devtools/skycpt/cpthelp.cpp b/devtools/skycpt/cpthelp.cpp index 134e440fd7d..07808880975 100644 --- a/devtools/skycpt/cpthelp.cpp +++ b/devtools/skycpt/cpthelp.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "stdafx.h" diff --git a/devtools/skycpt/cpthelp.h b/devtools/skycpt/cpthelp.h index 722e756edf2..71d760af3f9 100644 --- a/devtools/skycpt/cpthelp.h +++ b/devtools/skycpt/cpthelp.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "stdafx.h" diff --git a/devtools/skycpt/idFinder.cpp b/devtools/skycpt/idFinder.cpp index 53c9f1f1a0b..99e43788678 100644 --- a/devtools/skycpt/idFinder.cpp +++ b/devtools/skycpt/idFinder.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "stdafx.h" diff --git a/devtools/skycpt/module.mk b/devtools/skycpt/module.mk index 84a59cee9f5..eaf1679ba85 100644 --- a/devtools/skycpt/module.mk +++ b/devtools/skycpt/module.mk @@ -1,5 +1,3 @@ -# $URL$ -# $Id$ MODULE := devtools/skycpt diff --git a/devtools/skycpt/stdafx.cpp b/devtools/skycpt/stdafx.cpp index 8a5c78bc36a..e91ca094709 100644 --- a/devtools/skycpt/stdafx.cpp +++ b/devtools/skycpt/stdafx.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "stdafx.h" diff --git a/devtools/skycpt/stdafx.h b/devtools/skycpt/stdafx.h index 3e5c6042eb7..d4d389a2b6c 100644 --- a/devtools/skycpt/stdafx.h +++ b/devtools/skycpt/stdafx.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // stdafx.h : Includedatei fќr Standardsystem-Includedateien, diff --git a/devtools/themeparser.py b/devtools/themeparser.py index 993f7c79bcf..a3524461a0c 100644 --- a/devtools/themeparser.py +++ b/devtools/themeparser.py @@ -22,8 +22,6 @@ " along with this program; if not, write to the Free Software " Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. " - " $URL$ - " $Id$ """ from __future__ import with_statement diff --git a/dists/iphone/scummvm.xcodeproj/project.pbxproj b/dists/iphone/scummvm.xcodeproj/project.pbxproj index 6e44f351d14..d1ab4101d7e 100755 --- a/dists/iphone/scummvm.xcodeproj/project.pbxproj +++ b/dists/iphone/scummvm.xcodeproj/project.pbxproj @@ -10937,7 +10937,7 @@ CONFIG_H, IPHONE_OFFICIAL, IPHONE, - UNIX, + POSIX, SCUMM_LITTLE_ENDIAN, SCUMM_NEED_ALIGNMENT, ENABLE_SCUMM, @@ -11010,7 +11010,7 @@ CONFIG_H, IPHONE_OFFICIAL, IPHONE, - UNIX, + POSIX, SCUMM_LITTLE_ENDIAN, SCUMM_NEED_ALIGNMENT, ENABLE_SCUMM, @@ -11095,7 +11095,7 @@ CONFIG_H, MACOSX, SDL_BACKEND, - UNIX, + POSIX, SCUMM_LITTLE_ENDIAN, SCUMM_NEED_ALIGNMENT, ENABLE_SCUMM, @@ -11181,7 +11181,7 @@ CONFIG_H, MACOSX, SDL_BACKEND, - UNIX, + POSIX, SCUMM_LITTLE_ENDIAN, SCUMM_NEED_ALIGNMENT, ENABLE_SCUMM, diff --git a/dists/nsis/scummvm.nsi b/dists/nsis/scummvm.nsi index aeabcca0396..50ccadaf740 100644 --- a/dists/nsis/scummvm.nsi +++ b/dists/nsis/scummvm.nsi @@ -19,6 +19,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #!define _DEBUG +#!define _INCLUDE_DATA_FILES Name ScummVM @@ -231,6 +232,7 @@ Section "ScummVM" SecMain File /oname=README.txt "${text_dir}\README" File /oname=README-SDL.txt "${build_dir}\README-SDL" +!ifdef _INCLUDE_DATA_FILES # Engine data File "${engine_data}\drascula.dat" File "${engine_data}\hugo.dat" @@ -248,6 +250,7 @@ Section "ScummVM" SecMain File "${theme_data}\scummclassic.zip" File "${theme_data}\scummmodern.zip" File "${theme_data}\translations.dat" +!endif # Main exe and dlls File "${build_dir}\scummvm.exe" @@ -299,6 +302,7 @@ Section -un.Main SecUninstall Delete /REBOOTOK $INSTDIR\README.txt Delete /REBOOTOK $INSTDIR\README-SDL.txt +!ifdef _INCLUDE_DATA_FILES Delete /REBOOTOK $INSTDIR\drascula.dat Delete /REBOOTOK $INSTDIR\hugo.dat Delete /REBOOTOK $INSTDIR\kyra.dat @@ -314,6 +318,7 @@ Section -un.Main SecUninstall Delete /REBOOTOK $INSTDIR\scummclassic.zip Delete /REBOOTOK $INSTDIR\scummmodern.zip Delete /REBOOTOK $INSTDIR\translations.dat +!endif Delete /REBOOTOK $INSTDIR\scummvm.exe Delete /REBOOTOK $INSTDIR\SDL.dll diff --git a/dists/nsis/scummvm.nsi.in b/dists/nsis/scummvm.nsi.in index 766a20633f3..c94e5943f70 100644 --- a/dists/nsis/scummvm.nsi.in +++ b/dists/nsis/scummvm.nsi.in @@ -19,6 +19,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #!define _DEBUG +#!define _INCLUDE_DATA_FILES Name ScummVM @@ -231,6 +232,7 @@ Section "ScummVM" SecMain File /oname=README.txt "${text_dir}\README" File /oname=README-SDL.txt "${build_dir}\README-SDL" +!ifdef _INCLUDE_DATA_FILES # Engine data File "${engine_data}\drascula.dat" File "${engine_data}\hugo.dat" @@ -248,6 +250,7 @@ Section "ScummVM" SecMain File "${theme_data}\scummclassic.zip" File "${theme_data}\scummmodern.zip" File "${theme_data}\translations.dat" +!endif # Main exe and dlls File "${build_dir}\scummvm.exe" @@ -299,6 +302,7 @@ Section -un.Main SecUninstall Delete /REBOOTOK $INSTDIR\README.txt Delete /REBOOTOK $INSTDIR\README-SDL.txt +!ifdef _INCLUDE_DATA_FILES Delete /REBOOTOK $INSTDIR\drascula.dat Delete /REBOOTOK $INSTDIR\hugo.dat Delete /REBOOTOK $INSTDIR\kyra.dat @@ -314,6 +318,7 @@ Section -un.Main SecUninstall Delete /REBOOTOK $INSTDIR\scummclassic.zip Delete /REBOOTOK $INSTDIR\scummmodern.zip Delete /REBOOTOK $INSTDIR\translations.dat +!endif Delete /REBOOTOK $INSTDIR\scummvm.exe Delete /REBOOTOK $INSTDIR\SDL.dll diff --git a/dists/samsungtv/README-SamsungTV b/dists/samsungtv/README-SamsungTV new file mode 100644 index 00000000000..26ded6c7e62 --- /dev/null +++ b/dists/samsungtv/README-SamsungTV @@ -0,0 +1,17 @@ +Notes: + +- Should works on 2009 B series TVs (Full HD): LExxBE65x, LExxBE75x, PSxxB65x, UExxB7xxx, UExxB8xxx, PSxxB85x, LAxxB65x, LAxxB75x, UNxxB7xxx, UAxxB8xxx +- To allow use mouse and keyboard you need load extension first: "SamyGO Mouse And Keyboard" + Download from SamyGO project and run from Content Library: + http://sourceforge.net/projects/samygo/files/SamyGO%20Kernel%20Modules/SamyGO%20Mouse%20and%20Keyboard%20Modules%20v0.01.zip/download +- Buttons on remote controler: EXIT, SOURCE, P+, P-, TV, POWER, CONTENT - cause immediately exit from ScummVM +- Config file is in /mtd_rwarea/.scummvmrc +- Saves are stored in '/mtd_wiselink/scummvm savegames' directory +- Audio is delayed a upto one second, it's TV software issue :/ +- Do not use 3x scalers, they are not fit in TV display frame buffer and you get gfx glitches + +Remote Controler buttons: + +GREEN - emulate key F5 +YELLOW - emulate key F7 - virtual keyboard +BLUE and RETURN - emulate key ESC diff --git a/doc/translations/README-de.txt b/doc/translations/README-de.txt new file mode 100755 index 00000000000..a1d7d6eb5f3 --- /dev/null +++ b/doc/translations/README-de.txt @@ -0,0 +1,178 @@ +Dieses Dokument ist eine auszugsweise Уœbersetzung der englischen +REAMDE-Datei. Das Original-Dokument enthУЄlt viel mehr Informationen. +Sollten Sie hier also nicht das finden, was Sie benУЖtigen und ein wenig +Englisch kУЖnnen, sollten Sie sich die englische README-Datei ansehen. + +FУМr weitere Informationen, KompatiblitУЄtslisten, Einzelheiten zu Spenden, +die neusten verУЖffentlichten Versionen, Fortschrittberichte und mehr +besuchen Sie bitte die ScummVM-Website unter der Adresse: +http://www.scummvm.org/ + +Inhaltsverzeichnis: +------------------ +1.0) EinfУМhrung + * 1.1 Уœber ScummVM + * 1.2 Schnellstart +2.0) Kontakt + * 2.1 Fehler berichten + +1.0) EinfУМhrung: +---- ------------- + +1.1) Уœber ScummVM: +---- -------------- +ScummVM ist ein Programm, welches es Ihnen ermУЖglicht, bestimmte klassische +Grafik-Adventure (unter anderem aus dem Point-and-Click-Bereich) zu spielen, +vorausgesetzt, Sie sind im Besitz der Dateien des Spiels. Das Schlaue daran +ist: ScummVM ersetzt lediglich die Funktion der ausfУМhrbaren Dateien, +die mit den Spielen kamen, was ermУЖglicht, diese Spiele auf Systemen zu spielen, +fУМr welche sie nie erstellt wurden! + +UrsprУМnglich wurde dieses Programm dafУМr entwickelt, um SCUMM-Spiele von +LucasArts auszufУМhren, wie beispielsweise Maniac Mansion, Monkey Island, +Day of the Tentacle oder Sam and Max. SCUMM steht als AbkУМrzung fУМr +т€žScript Creation Utility for Maniac Mansionт€œ (deutsch etwa: +Skripterstellungsdienstprogramm fУМr Maniac Mansion), was das erste +Spiel von LucasArts war, fУМr welches LucasArts dieses System entworfen hatte. +Und viel spУЄter verlieh es seinen Namen an ScummVM (wobei т€žVMт€œ fУМr +т€žVirtuelle Maschineт€œ steht). + +Mit der Zeit wurde UnterstУМtzung fУМr viele Nicht-SCUMM-Spiele hinzugefУМgt. +Einige Adventures, die ScummVM unterstУМtzt, sind unter anderem Simon the +Sorcerer 1 und 2 von Adventure Soft, Beneath A Steel Sky und +Baphomets Fluch 1 und 2 von Revolution, Flight of the Amazon Queen, +Erben der Erde (Wyrmkeep), Gobliiins von Coktel Vision sowie +The Legend of Kyrandia von Westwood Studios. +Sie kУЖnnen eine genaue Liste mit Einzelheiten einsehen, welche Auskunft +darУМber gibt, welche Spiele unterstУМtzt werden und wie gut. Gehen Sie +hierfУМr auf die KompatiblitУЄtsseite. ScummVM wird kontinuierlich +verbessert, also schauen Sie oft vorbei. + +Unter den Systemen, mit denen Sie diese Spiele spielen kУЖnnen, befinden +sich Windows, Linux, Mac OS X, Dreamcast, PocketPC, PalmOS, iPhone, +AmigaOS, BeOS, OS/2, PSP, PS2, SymbianOS/EPOC und viele mehr. + +Zurzeit befindet sich ScummVM immer noch stark in der Entwicklung. +Seien Sie sich bewusst, dass wir zwar versuchen, dass viele Spiele +mit wenigen erheblichen Fehlern durchgespielt werden kУЖnnen, aber es +dennoch zu AbstУМrzen kommen kann und wir keine GewУЄhr УМbernehmen. +Davon abgesehen: Einige Spiele werden seit lУЄngerer Zeit unterstУМtzt +und sollten in jeder stabilen verУЖffentlichten Version gut laufen. +Sie kУЖnnen sich einen Eindruck davon verschaffen, wie gut jedes Spiel +unter ScummVM lУЄuft, indem Sie auf die KompatiblitУЄtsseite schauen. + +Wenn Sie sich ein wenig umsehen, kУЖnnen Sie herausfinden, dass +ScummVM sogar kommerziell genutzt wird, um einige der unterstУМtzen Spiele +auf modernen Plattformen wiederzuverУЖffentlichen. Dies zeigt, dass +verschiedene Firmen mit der QualitУЄt der Software zufrieden sind und wie gut +einige der Spiele mit ihrer Hilfe laufen. + +Wenn Ihnen ScummVM gefУЄllt, kУЖnnen Sie uns gerne etwas Geld spenden, +um uns finanziell zu unterstУМtzen. Dies hilft uns dabei, notwendige +Dienstprogramme zu kaufen, um ScummVM einfacher und schneller zu entwickeln. +Wenn Sie nicht spenden kУЖnnen, dУМrfen Sie auch gerne einen Patch beisteuern. + +1.2) Schnellstart: +---- ------------ +WICHTIG: In der unteren kurzen Anleitung wird davon ausgegangen, dass Sie +ScummVM auf Deutsch benutzen. StandardmУЄУŸig wird ScummVM die Sprache +Ihres Betriebssystems verwenden. Falls ScummVM auf Englisch statt auf +Deutsch erscheint, sollten Sie folgende Schritte ausfУМhren, wenn Sie bei +Schritt 3 angelangt sind und ScummVM gestartet haben: +-Klicken Sie auf "Options". +-Klicken Sie auf den rechten Pfeil in der Reiterleiste und wУЄhlen den + Reiter "Misc" aus. +-WУЄhlen Sie im Feld "GUI Language" "Deutsch" aus und klicken auf "OK". +-BestУЄtigen Sie die erscheinende Nachricht, klicken auf "Quit", um + ScummVM zu beenden und starten dann das Programm erneut. + +Wenn Sie ScummVM lieber in Englisch verwenden mУЖchten, benutzen Sie bitte +die Anleitung in der englischen README-Datei. + + +FУМr die ungelduldigen unter den Benutzern ist hier in fУМnf einfachen +Schritten kurz beschrieben, wie man ScummVM lauffУЄhig macht und das +Programm verwendet. + +1. Laden Sie ScummVM unter der Adresse + herunter und installieren Sie es. + +2. Erstellen Sie ein Verzeichnis auf Ihrer Festplatte und kopieren Sie +die Dateien des Spiels vom Original-DatentrУЄger in dieses Verzeichnis. +Wiederholen Sie diesen Vorgang fУМr jedes Spiel, das Sie spielen mУЖchten. + +3. Starten Sie ScummVM, wУЄhlen Sie "Spiel hinzufУМgen" aus, wУЄhlen Sie das +Verzeichnis mit den Dateien des Spiels aus (versuchen Sie nicht, die +Dateien des Spiels selbst auszuwУЄhlen!) und klicken Sie auf "AuswУЄhlen". + +4. Ein Dialog sollte erscheinen, der Ihnen ermУЖglicht, verschiedene +Einstellungen vorzunehmn, sollten Sie dies wУМnschen (es sollte jedoch in +Ordnung sein, alles voreingestellt zu belassen). BestУЄtigen Sie diesen +Dialog. + +5. WУЄhlen Sie das Spiel aus der Liste aus, welches Sie spielen mУЖchten +und klicken Sie auf "Starten". + +In Zukunft sollte es nun mУЖglich sein, direkt zu Schritt 5 УМberzugehen, +auУŸer Sie wollen noch mehr Spiele hinzufУМgen. + +Tipp: Wenn Sie mehrere Spiele auf einmal hinzufУМgen mУЖchten, drУМcken Sie +die Umschalt-Taste (Shift), bevor Sie auf "Spiel hinzufУМgen" klicken. +Diese SchaltflУЄche wird somit ihren Text zu "Durchsuchen" umУЄndern und +wenn Sie dann auf diese klicken, werden Sie auch dazu aufgefordert, ein +Verzeichnis auszuwУЄhlen, nur dieses Mal wird ScummVM alle +Unterverzeichnisse automatisch nach unterstУМtzen Spielen durchsuchen. + + +2.0) Kontakt: +---- -------- +Der einfachste Weg, um mit dem ScummVM-Team in Verbindung zu treten, ist, +Fehlerberichte einzusenden (siehe Abschnitt 2.1) oder durch Verwendung +des Forums unter der Adresse http://forums.scummvm.org . +Sie kУЖnnen ebenso der Mailing-Liste scummvm-devel betreiten und an diese +E-Mails versenden oder mit uns im IRC chatten (#scummvm unter +irc.freenode.net). Bitte fordern Sie uns nicht dazu auf, ein nicht +unterstУМtztes Spiel zu unterstУМtzen. Lesen Sie zuerst die Seite FAQ +(HУЄufig gestellte Fragen) auf unserer Website. +Bitte beachten Sie Kenntnis, dass die offizielle Sprache des Forums, +der Mailing-Liste und des Chats Englisch ist und keine andere Sprache +dort verwendet werden sollte. + + +2.1) Fehler berichten: +---- --------------- +Um einen Fehler zu berichten, erstellen Sie bitte ein SourceForge-Konto +und folgen Sie dem Link "Bug Tracker" auf der ScummVM-Website. Bitte +stellen Sie sicher, dass sich der Bug wiedererzeugen lУЄsst und immer noch +in der neusten Version von SVN oder des Daily builds auftritt. Bitte +sehen Sie auch auf der Problemliste unten und der KompatiblitУЄtsliste auf +der ScummVM-Website fУМr dieses Spiel nach, um sicherzustellen, dass das +Problem nicht bereits bekannt ist: + + http://www.scummvm.org/compatibility_stable.php + +Bitte berichten Sie keine Fehler zu Spielen, die nicht als durchspielbar +im Bereich "Supported Games" oder der KompatiblitУЄtsliste aufgelistet +sind. Wir -wissen-, dass diese Spiele Fehler aufweisen. + +Bitte liefern Sie folgende Informationen: + - ScummVM-Version (BITTE mit neuster Version von SVN oder + des Daily builds testen) + - Einzelheiten zum Fehler, einschlieУŸlich Anweisungen, um den Fehler + hervorzurufen + - Sprache des Spiels (Englisch, Deutsch, ...) + - Version des Spiels (Version mit Sprachausgabe [Talkie], + Disketten-Version, ...) + - Plattform und gegebenenfalls Compiler (Win32, Linux, FreeBSD, ...) + - FУМgen Sie einen Speicherstand hinzu, wenn es mУЖglich ist. + - Wenn dieser Fehler erst seit kurzem Auftritt, teilen Sie bitte die + letzte Version ohne den Fehler mit und die erste Version mit diesem + Fehler. Auf diese Weise kУЖnnen wir diesen schneller beseitigen, + indem wir die vorgenommen VerУЄnderungen einsehen. + +Zum Schluss mУЖchten wir Sie noch bitten, jeden Punkt einzeln zu +berichten; bitte senden Sie nicht mehrere Punkte mit dem selben Ticket +ein, ansonsten wird es schwierig, den Status jedes einzelnen Fehlers +zu verfolgen. Denken Sie bitte auch daran, dass alle Fehlerberichte in +Englisch verfasst sein mУМssen. + diff --git a/doc/translations/README-fr.txt b/doc/translations/README-fr.txt new file mode 100755 index 00000000000..186f0cd24d6 --- /dev/null +++ b/doc/translations/README-fr.txt @@ -0,0 +1,172 @@ +Ce document est une traduction partielle du fichier README anglais. Le +document original contient bien plus d'informations, donc si vous ne +trouvez pas ce que vous cherchez dans ce document et que vous comprenez +un peu l'anglais, jetez un coup d'oeil au fichier README anglais. + +Pour plus d'informations, liste des jeux compatibles, dУЉtails pour +donner de l'argent, la derniУЈre version disponibles et bien plus encore, +visitez le site web de ScummVM У  l'adresse http://www.scummvm.org/ + +Table des matiУЈres: +------------------- +1.0) Introduction + * 1.1 У€ propos de ScummVM + * 1.2 DУЉmarrage rapide +2.0) Contact + * 2.1 Signaler des bogues + +1.0) Introduction: +---- ------------- + +1.1) У€ propos de ScummVM: +---- -------------------- +ScummVM est un logiciel qui vous permet de jouer certain jeux +d'aventures graphiques de type 'point-and-click' (pointer et cliquer), У  +condition que vous possУЉdiez les fichiers de donnУЉes du jeu. Le plus +astucieux: ScummVM remplace juste les exУЉcutables fournis avec les jeux, +vous permettant de jouer sur les systУЈmes pour lesquels ils n'ont jamais +УЉtУЉ conУЇus! + +A l'origine il a УЉtУЉ conУЇu pour exУЉcuter les jeux basУЉ sur le systУЈme +SCUMM de LucasArts, tels que Maniac Mansion, Monkey Island, Day of the +Tentacle ou Sam et Max. SCUMM est l'acronyme de 'Script Creation Utility +for Maniac Mansion', qui a УЉtУЉ le premier jeu pour lequel LucasArts a +conУЇu ce systУЈme. Et beaucoup plus tard, il donna son nom У  ScummVM +('VM' signifiant Virtual Machine). + +Au cours du temps de nombreux jeux non-SCUMM ont УЉtУЉ ajoutУЉ, et ScummVM +prend dУЉsormais en charge de nombreux jeux Sierra AGI et SCI (tels que +King's Quest 1-6, Space Quest 1-5, ...), Discworld 1 et 2, Simon the +Sorcerer 1 et 2, Beneath A Steel Sky, Lure of the Temptress, Les +Chevaliers de Baphomet (Broken Sword I), Les Boucliers de Quetzalcoatl +(Broken Sword II), L'amazone queen (Flight of the Amazon Queen), +Gobliiins 1-3, la sУЉrie des Legend of Kyrandia, un grand nombre de jeux +pour enfants de Humongous Entertainment (incluant les jeux Marine Malice +et Pouce-Pouce) et beaucoup plus. Vous pouvez trouver une liste complУЈte +et dУЉtaillУЉe sur les aventures qui sont pris en charge et les problУЈmes +connus sur la page de compatibilitУЉ. ScummVM УЉvolue en permanence, donc +vУЉrifier cette liste de compatibilitУЉs souvent. + +Vous pouvez jouer У  ces jeux sur des ordinateurs de bureau classiques +(sous Windows, Linux, Mac OS X, ...), sur des consoles (Dreamcast, +Nintendo DS et Wii, PS2, PSP, ...), smartphones (Android, iPhone, Pocket +PC, Symbian ...) et plus encore. + +У€ ce stade ScummVM est encore en cours de dУЉveloppement. Soyez conscient +que malgrУЉ tous nos efforts pour en faire un logiciel le plus stable +possible, des plantages peuvent survenir. et nous n'offrons aucune +garantie. Cela УЉtant dit, certains jeux sont supportУЉs depuis longtemps +et devrait fonctionner correctement avec une version stable et rУЉcente +de ScummVM. Vous pouvez vous faire une idУЉe du niveau de support d'un +jeu en regardant la page de compatibilitУЉ. En fait, si vous cherchez un +peu vous pourrez dУЉcouvrir que ScummVM est mУЊme utilisУЉ dans le commerce +pour la rУЉ-УЉdition sur les plates-formes modernes de quelques-uns des +jeux supportУЉs. Cela montre que plusieurs entreprises sont satisfaits de +la qualitУЉ du logiciel. + +Si vous aimez ScummVM n'hУЉsitez pas У  faire un don en utilisant le +bouton PayPal sur la page d'accueil ScummVM. Cela nous aidera У  acheter +les services nУЉcessaires pour rendre le dУЉveloppement de ScummVM plus +facile et plus rapide. Si vous ne pouvez pas faire de don, vous pouvez +aussi proposer des patches! + +1.2) DУЉmarrage rapide: +---- ---------------- +IMPORTANT: Les instructions ci-dessous supposent que vous utilisez +ScummVM en FranУЇais. Par dУЉfaut, ScummVM utilise la langue de votre +systУЈme d'exploitation. Si vous prУЉfУЉrez utiliser ScummVM en Anglais, +vous pouvez plutУДt utiliser le guide du fichier README Anglais. + + +Pour les plus impatients, voici comment obtenir ScummVM en cinq УЉtapes +simples. + +1. TУЉlУЉcharger ScummVM sur et +installer l'application. + +2. CrУЉez un rУЉpertoire sur votre disque dur et copier les fichiers de +donnУЉes de jeu У  partir du support original dans ce rУЉpertoire. RУЉpУЉtez +cette opУЉration pour chaque jeu que vous voulez jouer. Utilisez un +rУЉpertoire sУЉparУЉ pour chaque jeu. + +3. Lancez ScummVM. + +Si ScummVM apparaУЎt en anglais au lieu du franУЇais, procУЉdez comme suit +pour changer la langue: +- Cliquez sur 'Options'. +- Cliquez sur la flУЈche droite dans la barre d'onglets et sУЉlectionnez + l'onglet 'Misc'. +- Choisissez 'Francais' dans le champs 'GUI Language' et cliquez sur + 'OK'. Confirmez-le message qui apparaУЎt, cliquez sur 'Quit' pour + quitter ScummVM, puis redУЉmarrer le programme. + +Maintenant cliquez sur 'Ajouter...', puis sУЉlectionnez le rУЉpertoire +contenant les fichiers de donnУЉes du jeu (ne pas essayer de sУЉlectionner +les fichiers de donnУЉes eux-mУЊmes!) et cliquez sur 'Choisir'. + +4. Une boУЎte de dialogue devrait apparaУЎtre vous permettant de +configurer divers paramУЈtres si vous le souhaitez (la valeur par dУЉfaut +devrait convenir dans la plupart des cas). Confirmez la boУЎte de +dialogue. + +5. SУЉlectionnez le jeu que vous voulez jouer dans la liste, et appuyez +sur 'DУЉmarrer'. + +ScummVM se souvient des jeux ajoutУЉs. Donc si vous quittez ScummVM puis +le relancez la liste des jeux contiendra tous les jeux que vous avez +dУЉjУ  ajoutУЉs. Vous pouvez donc passer directement У  l'УЉtape 5, У  moins +que vous vouliez ajouter des jeux supplУЉmentaires. + +Astuce: Si vous souhaitez ajouter plusieurs jeux d'un coup, essayez +d'appuyer et de maintenir la touche Maj (Shift) tout en cliquant sur +'Ajouter...' - son texte changera en 'Ajout Massifт€І'. Vous serez alors +invitez У  sУЉlectioner un rУЉpertoire dans lequel ScummVM parcourra tous +les sous-rУЉpertoire У  la recherche de jeux supportУЉs. + + +2.0) Contact: +---- -------- +La meilleure faУЇon de contacter l'УЉquipe de ScummVM est en soumettant +des rapports de bogues (voir section 2.1) ou en utilisant nos forums +http://forums.scummvm.org. Vous pouvez УЉgalement envoyer un e-mail sur +la liste de diffusion scummvm-devel, ou discuter avec nous sur IRC +(#scummvm sur irc.freenode.net). S'il vous plaУЎt ne nous demandez pas de +supporter un jeu non pris en charge - lire la FAQ sur notre site web +avant. Notez que la langue officielle de la liste de diffusion, forum et +chat est l'Anglais, et aucune autre langues ne doivent УЊtre utilisУЉe. + + +2.1) Reporting Bugs: +---- --------------- +Pour signaler un bogue, veuillez crУЉer un compte SourceForge et suivez +le lien "Bug Tracker" depuis notre page d'accueil. S'il vous plaУЎt +vУЉrifiez que le bogue est reproductible, et se produit encore dans la +'Daily Build' la plus rУЉcente. VУЉrifiez УЉgalement la liste des problУЈmes +connus (ci-dessous) et la liste de compatibilitУЉ sur notre site Web pour +ce jeu, pour s'assurer que le problУЈme n'est pas dУЉjУ  connue: + + http://www.scummvm.org/compatibility_stable.php + +Veuillez ne pas rapporter de bogues sur les jeux qui ne sont pas +rУЉpertoriУЉs comme УЉtant finissable sur la liste de compatibilitУЉ. Nous +savons que ces jeux ont des bogues. + +Veuillez inclure les informations suivantes lorsque vous signalez un +problУЈme: + - Version de ScummVM (veuillez tester avec la 'Daily Build' la plus + rУЉcente) + - DУЉtails du problУЈme, incluant les instructions pour le reproduire + - Langue du jeu (anglais, allemand, ...) + - Version du jeu (talkie, disquette, ...) + - Plate-forme et compilateur (Win32, Linux, Mac, FreeBSD, ...) + - Joindre une sauvegarde si possible + - Si ce problУЈme est rУЉcent, s'il vous plaУЎt notez la derniУЈre + version sans bogue, et la premiУЈre version qui У  le problУЈme. De + cette faУЇon, nous pouvons y remУЉdier plus rapidement, en regardant + les modifications apportУЉes entre ces deux versions. + +Enfin, veuillez signaler chaque problУЈme sУЉparУЉment, sinon, il devient +difficile de suivre l'УЉtat de chaque problУЈme individuel. S'il vous +plaУЎt gardez У  l'esprit УЉgalement que tous les rapports de bogue doivent +УЊtre rУЉdigУЉs en anglais. + diff --git a/doc/translations/README-translation_template.txt b/doc/translations/README-translation_template.txt new file mode 100755 index 00000000000..ec43ebef60e --- /dev/null +++ b/doc/translations/README-translation_template.txt @@ -0,0 +1,158 @@ +This document is a partial translation of the English README file. The +original document has much more information, so if you cannot find what +you need here and can understand a bit of English, try to look at the +English README file. + +For more information, compatibility lists, details on donating, the +latest release, progress reports and more, please visit the ScummVM home +page at: http://www.scummvm.org/ + +Table of Contents: +------------------ +1.0) Introduction + * 1.1 About ScummVM + * 1.2 Quick start +2.0) Contact + * 2.1 Reporting Bugs + +1.0) Introduction: +---- ------------- + +1.1) About ScummVM: +---- -------------- +ScummVM is a program which allows you to run certain classic graphical +point-and-click adventure games, provided you already have their data +files. The clever part about this: ScummVM just replaces the executables +shipped with the game, allowing you to play them on systems for which +they were never designed! + +Originally it was designed to run LucasArts' SCUMM games, such as Maniac +Mansion, Monkey Island, Day of the Tentacle or Sam and Max. SCUMM stands +for 'Script Creation Utility for Maniac Mansion', which was the first +game for which LucasArts designed this system. And much later it gave +its name to ScummVM ('VM' meaning Virtual Machine). + +Over time support for a lot of non-SCUMM games has been added, and +ScummVM now also supports many of Sierra's AGI and SCI games (such as +King's Quest 1-6, Space Quest 1-5, ...), Discworld 1 and 2, Simon the +Sorcerer 1 and 2, Beneath A Steel Sky, Lure of the Temptress, Broken +Sword I and II, Flight of the Amazon Queen, Gobliiins 1-3, The Legend of +Kyrandia series, many of Humongous Entertainment's children's SCUMM +games (including Freddi Fish and Putt Putt games) and many more. You can +find a full list with details on which adventures are supported and how +well on the compatibility page. ScummVM is continually improving, so +check back often. + +Among the systems on which you can play those games are regular desktop +computers (running Windows, Linux, Mac OS X, ...), game consoles +(Dreamcast, Nintendo DS & Wii, PS2, PSP, ...), smartphones (Android, +iPhone, PocketPC, Symbian ...) and more. + +At this time ScummVM is still under heavy development. Be aware that +whilst we attempt to make sure that many games can be completed with few +major bugs, crashes can happen and we offer no warranty. That being +said, some of the games have been supported for a long time and should +work fine with any recent stable release. You can get a feeling of how +well each game is working in ScummVM by looking at the compatibility +page. Actually if you browse a bit around you might discover that +ScummVM is even being used commercially to re-release some of the +supported games on modern platforms. This shows that several companies +are happy with the quality of the software and how well it can run some +of the games. + +If you enjoy ScummVM feel free to donate using the PayPal button on the +ScummVM homepage. This will help us buy utilities needed to develop +ScummVM easier and quicker. If you cannot donate, help and contribute a +patch! + +1.2) Quick start: +---- ------------ +IMPORTANT: This short guide assumes you are using ScummVM in . By default, ScummVM will use your operating system's +language. If you prefer to use ScummVM in English, You may also prefer +to follow the guide from the English REAMDE file. + +For the impatient among you, here is how to get ScummVM running in five +simple steps. + +1. Download ScummVM from and +install it. + +2. Create a directory on your hard drive and copy the game datafiles +from the original media to this directory. Repeat this for every game +you want to play (it is better to use a separate directory for each +game). + +3. Start ScummVM. + +If at this stage ScummVM appears in English instead of , do as follow to change the language: +- Click on 'Options'. +- Click on the right arrow in the tab bar and select the 'Misc' tab. +- Select "" in the 'GUI Language' box and click on + 'OK'. +- Confirm the message box that pops-up, click on 'Quit' to quit ScummVM + and then restart the program. + +Now choose 'Add game', select the directory with the game datafiles (do +not try to select the datafiles themselves!) and press 'Choose' + +4. A dialog should popup allowing you to configure various settings if +you wish to (it should be just fine to leave everything at its default, +though). Confirm the dialog. + +5. Select the game you want to play in the list, and press 'Start'. + +ScummVM remembers the games that you add. So if you close ScummVM, the +next time you start it again the list of game will contain all the games +you previously added. You can therefore go directly to step 5, unless +you want to add more games. + +Hint: If you want to add multiple games in one go, try pressing and +holding the shift key before clicking 'Add game' -- its label will +change to 'Mass Add' and if you press it, you are again asked to select +a directory, only this time ScummVM will search through all +subdirectoriess for supported games. + + +2.0) Contact: +---- -------- +The easiest way to contact the ScummVM team is by submitting bug reports +(see section 2.1) or by using our forums at http://forums.scummvm.org . +You can also join and e-mail the scummvm-devel mailing list, or chat +with us on IRC (#scummvm on irc.freenode.net) Please do not ask us to +support an unsupported game -- read the FAQ on our web site first. Note +that the official language of the forum, mailing list and chat is +English and no other languages should be used. + + +2.1) Reporting Bugs: +---- --------------- +To report a bug, please create a SourceForge account and follow the "Bug +Tracker" link from our homepage. Please make sure the bug is +reproducible, and still occurs in the latest SVN/Daily build version. +Also check the known problems list (below) and the compatibility list on +our website for that game, to ensure the issue is not already known: + + http://www.scummvm.org/compatibility_stable.php + +Please do not report bugs on games that are not listed as being +completeable in the 'Supported Games' section, or compatibility list. We +-know- those games have bugs. + +Please include the following information: + - ScummVM version (PLEASE test the latest SVN/Daily build) + - Bug details, including instructions on reproducing + - Language of game (English, German, ...) + - Version of game (talkie, floppy, ...) + - Platform and Compiler (Win32, Linux, FreeBSD, ...) + - Attach a savegame if possible + - If this bug only occurred recently, please note the last version + without the bug, and the first version including the bug. That way + we can fix it quicker by looking at the changes made. + +Finally, please report each issue separately; do not file multiple +issues on the same ticket. (Otherwise, it gets difficult to track the +status of each individual bug). Please keep also in mind that all the +bug reports must be written in English. + diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index 8170452102b..6874806bc7a 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // FIXME: Avoid using printf diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index 757fb12f336..6ee0822f47e 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef ENGINES_ADVANCED_DETECTOR_H #define ENGINES_ADVANCED_DETECTOR_H diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index a69d19f06c8..78316588b01 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -18,14 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/md5.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/file.h" #include "common/memstream.h" #include "common/savefile.h" @@ -488,10 +484,16 @@ static const GameSettings agiSettings[] = { AgiBase::AgiBase(OSystem *syst, const AGIGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { _noSaveLoadAllowed = false; + _rnd = new Common::RandomSource("agi"); + initFeatures(); initVersion(); } +AgiBase::~AgiBase() { + delete _rnd; +} + AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBase(syst, gameDesc) { // Setup mixer @@ -499,9 +501,6 @@ AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBas parseFeatures(); - _rnd = new Common::RandomSource(); - g_eventRec.registerRandomSource(*_rnd, "agi"); - DebugMan.addDebugChannel(kDebugLevelMain, "Main", "Generic debug level"); DebugMan.addDebugChannel(kDebugLevelResources, "Resources", "Resources debugging"); DebugMan.addDebugChannel(kDebugLevelSprites, "Sprites", "Sprites debugging"); @@ -652,10 +651,11 @@ void AgiEngine::initialize() { } AgiEngine::~AgiEngine() { - // If the engine hasn't been initialized yet via AgiEngine::initialize(), don't attempt to free any resources, - // as they haven't been allocated. Fixes bug #1742432 - AGI: Engine crashes if no game is detected + // If the engine hasn't been initialized yet via + // AgiEngine::initialize(), don't attempt to free any resources, as + // they haven't been allocated. Fixes bug #1742432 - AGI: Engine + // crashes if no game is detected if (_game.state == STATE_INIT) { - delete _rnd; // delete _rnd, as it is allocated in the constructor, not in initialize() return; } @@ -669,7 +669,6 @@ AgiEngine::~AgiEngine() { free(_game.sbufOrig); _gfx->deinitMachine(); delete _gfx; - delete _rnd; delete _console; free(_predictiveDictLine); diff --git a/engines/agi/agi.h b/engines/agi/agi.h index c71a0ebf648..a42148b1ef0 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_H @@ -758,6 +755,7 @@ public: virtual void clearKeyQueue() = 0; AgiBase(OSystem *syst, const AGIGameDescription *gameDesc); + ~AgiBase(); virtual void clearImageStack() = 0; virtual void recordImageStackCall(uint8 type, int16 p1, int16 p2, int16 p3, @@ -971,7 +969,7 @@ public: int showWords(); int loadWords(const char *); void unloadWords(); - int findWord(char *word, int *flen); + int findWord(const char *word, int *flen); void dictionaryWords(char *); // Motion diff --git a/engines/agi/checks.cpp b/engines/agi/checks.cpp index afede0b8365..20276657ff3 100644 --- a/engines/agi/checks.cpp +++ b/engines/agi/checks.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" @@ -268,7 +265,7 @@ void AgiEngine::updatePosition() { * This function adjusts the position of a sprite moving it until * certain criteria is matched. According to priority and control line * data, a sprite may not always appear at the location we specified. - * This behaviour is also known as the "Budin-Sonneveld effect". + * This behavior is also known as the "Budin-Sonneveld effect". * * @param n view table entry number */ diff --git a/engines/agi/console.cpp b/engines/agi/console.cpp index f4b50c0909e..d49bd57ea2e 100644 --- a/engines/agi/console.cpp +++ b/engines/agi/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/console.h b/engines/agi/console.h index e79db420542..308b0f1d1f0 100644 --- a/engines/agi/console.h +++ b/engines/agi/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_CONSOLE_H diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp index 86c1b519a9c..d86fb367097 100644 --- a/engines/agi/cycle.cpp +++ b/engines/agi/cycle.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index fb92344de2b..22d8adf92d1 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // FIXME: Avoid using printf @@ -167,7 +164,7 @@ public: AgiMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "AGI preAGI + v2 + v3 Engine"; + return "AGI preAGI + v2 + v3"; } virtual const char *getOriginalCopyright() const { return "Sierra AGI Engine (C) Sierra On-Line Software"; diff --git a/engines/agi/detection_tables.h b/engines/agi/detection_tables.h index 4689915007d..cd3edf50c61 100644 --- a/engines/agi/detection_tables.h +++ b/engines/agi/detection_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ namespace Agi { diff --git a/engines/agi/font.h b/engines/agi/font.h index 171106145c5..c2516d35205 100644 --- a/engines/agi/font.h +++ b/engines/agi/font.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_FONT_H diff --git a/engines/agi/global.cpp b/engines/agi/global.cpp index ed8e9e8dbe6..fdece0737e5 100644 --- a/engines/agi/global.cpp +++ b/engines/agi/global.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp index f0d38761d01..eb162e4ab0f 100644 --- a/engines/agi/graphics.cpp +++ b/engines/agi/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" @@ -844,7 +841,7 @@ void GfxMgr::setAGIPal(int p0) { // Use only the lowest 6 bits of each color component (Red, Green and Blue) // because VGA used only 6 bits per color component (i.e. VGA had 18-bit colors). - // This should now be identical to the original AGIPAL-hack's behaviour. + // This should now be identical to the original AGIPAL-hack's behavior. bool validVgaPalette = true; for (int i = 0; i < 16 * 3; i++) { if (_agipalPalette[i] >= (1 << 6)) { diff --git a/engines/agi/graphics.h b/engines/agi/graphics.h index 60fbea2285c..037dacd8ded 100644 --- a/engines/agi/graphics.h +++ b/engines/agi/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_GRAPHICS_H diff --git a/engines/agi/id.cpp b/engines/agi/id.cpp index 2e12e45458b..00f8407529c 100644 --- a/engines/agi/id.cpp +++ b/engines/agi/id.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/inv.cpp b/engines/agi/inv.cpp index f1d9523887f..a165a32b29d 100644 --- a/engines/agi/inv.cpp +++ b/engines/agi/inv.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/keyboard.cpp b/engines/agi/keyboard.cpp index 95211f8e3c0..f5810a6e8c2 100644 --- a/engines/agi/keyboard.cpp +++ b/engines/agi/keyboard.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/keyboard.h b/engines/agi/keyboard.h index c4dadb5836a..665ee6a62c8 100644 --- a/engines/agi/keyboard.h +++ b/engines/agi/keyboard.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_KEYBOARD_H diff --git a/engines/agi/loader_v2.cpp b/engines/agi/loader_v2.cpp index 0141a61065d..a2ac6f01117 100644 --- a/engines/agi/loader_v2.cpp +++ b/engines/agi/loader_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" @@ -152,11 +149,11 @@ uint8 *AgiLoader_v2::loadVolRes(struct AgiDir *agid) { fp.read(&x, 5); if ((sig = READ_BE_UINT16((uint8 *) x)) == 0x1234) { agid->len = READ_LE_UINT16((uint8 *) x + 3); - data = (uint8 *) calloc(1, agid->len + 32); + data = (uint8 *)calloc(1, agid->len + 32); if (data != NULL) { fp.read(data, agid->len); } else { - exit(1); + error("AgiLoader_v2::loadVolRes out of memory"); } } else { warning("AgiLoader_v2::loadVolRes: bad signature %04x", sig); diff --git a/engines/agi/loader_v3.cpp b/engines/agi/loader_v3.cpp index 025e755c8b4..29635f935b8 100644 --- a/engines/agi/loader_v3.cpp +++ b/engines/agi/loader_v3.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/logic.cpp b/engines/agi/logic.cpp index cc61d3455a4..22798ba8310 100644 --- a/engines/agi/logic.cpp +++ b/engines/agi/logic.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/logic.h b/engines/agi/logic.h index d285aa1dfb8..fecc2e3b8aa 100644 --- a/engines/agi/logic.h +++ b/engines/agi/logic.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_LOGIC_H diff --git a/engines/agi/lzw.cpp b/engines/agi/lzw.cpp index 495d6458da3..a00281bd49a 100644 --- a/engines/agi/lzw.cpp +++ b/engines/agi/lzw.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /*************************************************************************** diff --git a/engines/agi/lzw.h b/engines/agi/lzw.h index 5e1f74c8195..e3fbafe584f 100644 --- a/engines/agi/lzw.h +++ b/engines/agi/lzw.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_LZW_H diff --git a/engines/agi/menu.cpp b/engines/agi/menu.cpp index b62bcd9ad83..b504cd3e30d 100644 --- a/engines/agi/menu.cpp +++ b/engines/agi/menu.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/menu.h b/engines/agi/menu.h index 724ec3877c3..e659c71fab5 100644 --- a/engines/agi/menu.h +++ b/engines/agi/menu.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_MENU_H diff --git a/engines/agi/motion.cpp b/engines/agi/motion.cpp index 7498aafb5d6..261a7f3e610 100644 --- a/engines/agi/motion.cpp +++ b/engines/agi/motion.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/objects.cpp b/engines/agi/objects.cpp index bea53d7fa40..e04c9742f3e 100644 --- a/engines/agi/objects.cpp +++ b/engines/agi/objects.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp index e1f99456e88..bde62fe2d99 100644 --- a/engines/agi/op_cmd.cpp +++ b/engines/agi/op_cmd.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/version.h" @@ -675,7 +672,7 @@ void AgiEngine::cmd_adj_ego_move_to_x_y(uint8 *p) { // Turn off ego's current movement caused with the mouse if // adj.ego.move.to.x.y is called with other arguments than previously. - // Fixes weird looping behaviour when walking to a ladder in the mines + // Fixes weird looping behavior when walking to a ladder in the mines // (Rooms 147-162) in Gold Rush using the mouse. Sometimes the ego didn't // stop when walking to a ladder using the mouse but kept moving on the // ladder in a horizontally looping manner i.e. from right to left, from diff --git a/engines/agi/op_dbg.cpp b/engines/agi/op_dbg.cpp index f3b4815790c..be73dbefaeb 100644 --- a/engines/agi/op_dbg.cpp +++ b/engines/agi/op_dbg.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/op_test.cpp b/engines/agi/op_test.cpp index f5234d4e6cd..0660a614b61 100644 --- a/engines/agi/op_test.cpp +++ b/engines/agi/op_test.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -170,7 +167,7 @@ uint8 AgiEngine::testSaid(uint8 nwords, uint8 *cc) { // user typed should be correct, but it looks like code 9999 means that // if the string is empty at this point, the entry is also correct... // - // With the removal of this code, the behaviour of the scene was + // With the removal of this code, the behavior of the scene was // corrected for (c = 0; nwords && n; c++, nwords--, n--) { @@ -319,7 +316,7 @@ int AgiEngine::testIfCode(int lognum) { case 0x13: // Unknown test command 19 // My current theory is that this command checks whether the ego is currently moving // and that that movement has been caused using the mouse and not using the keyboard. - // I base this theory on the game's behaviour on an Amiga emulator, not on disassembly. + // I base this theory on the game's behavior on an Amiga emulator, not on disassembly. // This command is used at least in the Amiga version of Gold Rush! v2.05 1989-03-09 // (AGI 2.316) in logics 1, 3, 5, 6, 137 and 192 (Logic.192 revealed this command's nature). // TODO: Check this command's implementation using disassembly just to be sure. diff --git a/engines/agi/opcodes.h b/engines/agi/opcodes.h index 6b62f9ee99b..b0d2051f0b7 100644 --- a/engines/agi/opcodes.h +++ b/engines/agi/opcodes.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_OPCODES_H diff --git a/engines/agi/picture.cpp b/engines/agi/picture.cpp index 8951fc81df9..47e40fb5f19 100644 --- a/engines/agi/picture.cpp +++ b/engines/agi/picture.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/picture.h b/engines/agi/picture.h index 31f8605cde6..f2a6586b938 100644 --- a/engines/agi/picture.h +++ b/engines/agi/picture.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_PICTURE_H diff --git a/engines/agi/preagi.cpp b/engines/agi/preagi.cpp index c51c53e76ed..c1a6cd33fea 100644 --- a/engines/agi/preagi.cpp +++ b/engines/agi/preagi.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -45,8 +42,6 @@ PreAgiEngine::PreAgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : // Setup mixer syncSoundSettings(); - _rnd = new Common::RandomSource(); - DebugMan.addDebugChannel(kDebugLevelMain, "Main", "Generic debug level"); DebugMan.addDebugChannel(kDebugLevelResources, "Resources", "Resources debugging"); DebugMan.addDebugChannel(kDebugLevelSprites, "Sprites", "Sprites debugging"); diff --git a/engines/agi/preagi.h b/engines/agi/preagi.h index 58e08945b6a..1a178497ada 100644 --- a/engines/agi/preagi.h +++ b/engines/agi/preagi.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_PREAGI_H diff --git a/engines/agi/preagi_common.cpp b/engines/agi/preagi_common.cpp index 5bc0c92ab88..d437dc08f22 100644 --- a/engines/agi/preagi_common.cpp +++ b/engines/agi/preagi_common.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/preagi.h" diff --git a/engines/agi/preagi_common.h b/engines/agi/preagi_common.h index 8b6dc0ee597..a557f699775 100644 --- a/engines/agi/preagi_common.h +++ b/engines/agi/preagi_common.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agi/preagi_mickey.cpp b/engines/agi/preagi_mickey.cpp index 64fc4e9ae50..21eb7809162 100644 --- a/engines/agi/preagi_mickey.cpp +++ b/engines/agi/preagi_mickey.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/events.h" diff --git a/engines/agi/preagi_mickey.h b/engines/agi/preagi_mickey.h index 5ef12bfad23..62981375c69 100644 --- a/engines/agi/preagi_mickey.h +++ b/engines/agi/preagi_mickey.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_PREAGI_MICKEY_H diff --git a/engines/agi/preagi_troll.cpp b/engines/agi/preagi_troll.cpp index 76849949c7d..445a9e34ffe 100644 --- a/engines/agi/preagi_troll.cpp +++ b/engines/agi/preagi_troll.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/preagi.h" diff --git a/engines/agi/preagi_troll.h b/engines/agi/preagi_troll.h index f460758b2c8..d9a995072b6 100644 --- a/engines/agi/preagi_troll.h +++ b/engines/agi/preagi_troll.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_PREAGI_TROLL_H diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp index ef35a0b4e0a..1df31ff72a0 100644 --- a/engines/agi/preagi_winnie.cpp +++ b/engines/agi/preagi_winnie.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/preagi.h" diff --git a/engines/agi/preagi_winnie.h b/engines/agi/preagi_winnie.h index 0187d80326f..002eada65c9 100644 --- a/engines/agi/preagi_winnie.h +++ b/engines/agi/preagi_winnie.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_PREAGI_WINNIE_H diff --git a/engines/agi/predictive.cpp b/engines/agi/predictive.cpp index 96ad78ace55..80e89f410ba 100644 --- a/engines/agi/predictive.cpp +++ b/engines/agi/predictive.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp index c8df726fc7b..deda186439a 100644 --- a/engines/agi/saveload.cpp +++ b/engines/agi/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp index b40cef67efd..aa338db0f2c 100644 --- a/engines/agi/sound.cpp +++ b/engines/agi/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" @@ -102,51 +99,53 @@ void SoundMgr::unloadSound(int resnum) { } } +/** + * Start playing a sound resource. The logic here is that when the sound is + * finished we set the given flag to be true. This way the condition can be + * detected by the game. On the other hand, if the game wishes to start + * playing a new sound before the current one is finished, we also let it + * do that. + * @param resnum the sound resource number + * @param flag the flag that is wished to be set true when finished + */ void SoundMgr::startSound(int resnum, int flag) { - AgiSoundEmuType type; - - if (_vm->_game.sounds[resnum] != NULL && _vm->_game.sounds[resnum]->isPlaying()) - return; - - stopSound(); + debugC(3, kDebugLevelSound, "startSound(resnum = %d, flag = %d)", resnum, flag); if (_vm->_game.sounds[resnum] == NULL) // Is this needed at all? return; - type = (AgiSoundEmuType)_vm->_game.sounds[resnum]->type(); + stopSound(); + AgiSoundEmuType type = (AgiSoundEmuType)_vm->_game.sounds[resnum]->type(); if (type != AGI_SOUND_SAMPLE && type != AGI_SOUND_MIDI && type != AGI_SOUND_4CHN) return; + debugC(3, kDebugLevelSound, " type = %d", type); _vm->_game.sounds[resnum]->play(); _playingSound = resnum; - - debugC(3, kDebugLevelSound, "startSound(resnum = %d, flag = %d) type = %d", resnum, flag, type); - _soundGen->play(resnum); + // Reset the flag _endflag = flag; - - // Nat Budin reports that the flag should be reset when sound starts _vm->setflag(_endflag, false); } void SoundMgr::stopSound() { debugC(3, kDebugLevelSound, "stopSound() --> %d", _playingSound); - _endflag = -1; - if (_playingSound != -1) { if (_vm->_game.sounds[_playingSound]) // sanity checking _vm->_game.sounds[_playingSound]->stop(); - _soundGen->stop(); - _playingSound = -1; } + // This is probably not needed most of the time, but there also should + // not be any harm doing it, so do it anyway. if (_endflag != -1) _vm->setflag(_endflag, true); + + _endflag = -1; } int SoundMgr::initSound() { diff --git a/engines/agi/sound.h b/engines/agi/sound.h index b858493cb80..0ee19878c4b 100644 --- a/engines/agi/sound.h +++ b/engines/agi/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_SOUND_H diff --git a/engines/agi/sound_2gs.cpp b/engines/agi/sound_2gs.cpp index f5758ed1405..6d64c29de94 100644 --- a/engines/agi/sound_2gs.cpp +++ b/engines/agi/sound_2gs.cpp @@ -18,13 +18,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" #include "common/fs.h" +#include "common/archive.h" #include "common/md5.h" #include "common/memstream.h" #include "common/str-array.h" @@ -36,47 +34,91 @@ namespace Agi { SoundGen2GS::SoundGen2GS(AgiEngine *vm, Audio::Mixer *pMixer) : SoundGen(vm, pMixer) { - _disabledMidi = !loadInstruments(); + // Allocate memory for the wavetable + _wavetable = new int8[SIERRASTANDARD_SIZE]; + // Apple IIGS AGI MIDI player advances 60 ticks per second. Strategy + // here is to first generate audio for a 1/60th of a second and then + // advance the MIDI player by one tick. Thus, make the output buffer + // to be a 1/60th of a second in length. + _outSize = _sampleRate / 60; + _out = new int16[2 * _outSize]; // stereo + + // Initialize player variables + _nextGen = 0; + _ticks = 0; + + // Not playing anything yet _playingSound = -1; _playing = false; - _sndBuffer = (int16 *)calloc(2, BUFFER_SIZE); - - _midiChannels.resize(16); // Set the amount of available MIDI channels + // Load instruments + _disableMidi = !loadInstruments(); _mixer->playStream(Audio::Mixer::kMusicSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true); } SoundGen2GS::~SoundGen2GS() { _mixer->stopHandle(_soundHandle); - - free(_sndBuffer); + delete[] _wavetable; + delete[] _out; } int SoundGen2GS::readBuffer(int16 *buffer, const int numSamples) { - fillAudio(buffer, numSamples / 2); - + static uint data_available = 0; + static uint data_offset = 0; + uint n = numSamples << 1; + uint8 *p = (uint8*)buffer; + + while (n > data_available) { + memcpy(p, (uint8*)_out + data_offset, data_available); + p += data_available; + n -= data_available; + + advancePlayer(); + + data_available = generateOutput() << 1; + data_offset = 0; + } + + memcpy(p, (uint8*)_out + data_offset, n); + data_offset += n; + data_available -= n; + return numSamples; } +/** + * Initiate the playing of a sound resource. + * @param resnum Resource number + */ void SoundGen2GS::play(int resnum) { AgiSoundEmuType type; _playingSound = resnum; type = (AgiSoundEmuType)_vm->_game.sounds[resnum]->type(); - assert (type == AGI_SOUND_SAMPLE || type == AGI_SOUND_MIDI); + if (_vm->_soundemu != SOUND_EMU_APPLE2GS) { + warning("Trying to play sample or MIDI resource but not using Apple IIGS sound emulation mode"); + return; + } + + haltGenerators(); + switch (type) { case AGI_SOUND_SAMPLE: { IIgsSample *sampleRes = (IIgsSample *) _vm->_game.sounds[_playingSound]; - playSampleSound(sampleRes->getHeader(), sampleRes->getSample()); + const IIgsSampleHeader &header = sampleRes->getHeader(); + _channels[kSfxMidiChannel].setInstrument(&header.instrument); + _channels[kSfxMidiChannel].setVolume(header.volume); + midiNoteOn(kSfxMidiChannel, header.pitch, 127); break; } case AGI_SOUND_MIDI: ((IIgsMidi *) _vm->_game.sounds[_playingSound])->rewind(); + _ticks = 0; break; default: break; @@ -84,213 +126,178 @@ void SoundGen2GS::play(int resnum) { } void SoundGen2GS::stop() { + haltGenerators(); _playingSound = -1; - - // Stops all sounds on all MIDI channels - for (iterator iter = _midiChannels.begin(); iter != _midiChannels.end(); ++iter) - iter->stopSounds(); + _playing = 0; } -void SoundGen2GS::playSound() { +/** + * Fill output buffer by advancing the generators for a 1/60th of a second. + * @return Number of generated samples + */ +uint32 SoundGen2GS::generateOutput() { + memset(_out, 0, _outSize * 2 * 2); + + if (!_playing || _playingSound == -1) + return _outSize * 2; + + int16 *p = _out; + int n = _outSize; + while (n--) { + int outl = 0; + int outr = 0; + for (int k = 0; k < MAX_GENERATORS; k++) { + IIgsGenerator *g = &_generators[k]; + if (!g->ins) + continue; + const IIgsInstrumentHeader *i = g->ins; + + // Advance envelope + int vol = fracToInt(g->a); + if (g->a <= i->env[g->seg].bp) { + g->a += i->env[g->seg].inc * ENVELOPE_COEF; + if (g->a > i->env[g->seg].bp) { + g->a = i->env[g->seg].bp; + g->seg++; + } + } else { + g->a -= i->env[g->seg].inc * ENVELOPE_COEF; + if (g->a < i->env[g->seg].bp) { + g->a = i->env[g->seg].bp; + g->seg++; + } + } + + // TODO: Advance vibrato here. The Apple IIGS uses a LFO with + // triangle wave to modulate the frequency of both oscillators. + // In Apple IIGS the vibrato and the envelope are updated at the + // same time, so the vibrato speed depends on ENVELOPE_COEF. + + // Advance oscillators + int s0 = 0; + int s1 = 0; + if (!g->osc[0].halt) { + s0 = g->osc[0].base[fracToInt(g->osc[0].p)]; + g->osc[0].p += g->osc[0].pd; + if ((uint)fracToInt(g->osc[0].p) >= g->osc[0].size) { + g->osc[0].p -= intToFrac(g->osc[0].size); + if (!g->osc[0].loop) + g->osc[0].halt = 1; + if (g->osc[0].swap) { + g->osc[0].halt = 1; + g->osc[1].halt = 0; + } + } + } + if (!g->osc[1].halt) { + s1 = g->osc[1].base[fracToInt(g->osc[1].p)]; + g->osc[1].p += g->osc[1].pd; + if ((uint)fracToInt(g->osc[1].p) >= g->osc[1].size) { + g->osc[1].p -= intToFrac(g->osc[1].size); + if (!g->osc[1].loop) + g->osc[1].halt = 1; + if (g->osc[1].swap) { + g->osc[0].halt = 0; + g->osc[1].halt = 1; + } + } + } + + // Take envelope and MIDI volume information into account. + // Also amplify. + s0 *= vol * g->vel / 127 * 80 / 256; + s1 *= vol * g->vel / 127 * 80 / 256; + + // Select output channel. + if (g->osc[0].chn) + outl += s0; + else + outr += s0; + + if (g->osc[1].chn) + outl += s1; + else + outr += s1; + } + + if (outl > 32768) + outl = 32768; + if (outl < -32767) + outl = -32767; + if (outr > 32768) + outr = 32768; + if (outr < -32767) + outr = -32767; + + *p++ = outl; + *p++ = outr; + } + + return _outSize * 2; +} + +void SoundGen2GS::advancePlayer() { if (_playingSound == -1) return; if (_vm->_game.sounds[_playingSound]->type() == AGI_SOUND_MIDI) { - playMidiSound(); - //warning("playSound: Trying to play an Apple IIGS MIDI sound. Not yet implemented"); + advanceMidiPlayer(); } else if (_vm->_game.sounds[_playingSound]->type() == AGI_SOUND_SAMPLE) { - //debugC(3, kDebugLevelSound, "playSound: Trying to play an Apple IIGS sample"); - playSampleSound(); + _playing = activeGenerators() > 0; } if (!_playing) { _vm->_sound->soundIsFinished(); - _playingSound = -1; } } -uint32 SoundGen2GS::mixSound() { - int i, b; - - memset(_sndBuffer, 0, BUFFER_SIZE << 1); - - if (!_playing || _playingSound == -1) - return BUFFER_SIZE; - - // Handle Apple IIGS sound mixing here - // TODO: Implement playing both waves in an oscillator - // TODO: Implement swap-mode in an oscillator - for (uint midiChan = 0; midiChan < _midiChannels.size(); midiChan++) { - for (uint gsChan = 0; gsChan < _midiChannels[midiChan]._gsChannels.size(); gsChan++) { - IIgsChannelInfo &channel = _midiChannels[midiChan]._gsChannels[gsChan]; - if (channel.playing()) { // Only mix in actively playing channels - // Frequency multiplier was 1076.0 based on tests made with MESS 0.117. - // Tests made with KEGS32 averaged the multiplier to around 1045. - // So this is a guess but maybe it's 1046.5... i.e. C6's frequency? - double hertz = C6_FREQ * pow(SEMITONE, fracToDouble(channel.note)); - channel.posAdd = doubleToFrac(hertz / getRate()); - channel.vol = doubleToFrac(fracToDouble(channel.envVol) * fracToDouble(channel.chanVol) / 127.0); - double tempVol = fracToDouble(channel.vol)/127.0; - for (i = 0; i < IIGS_BUFFER_SIZE; i++) { - b = channel.relocatedSample[fracToInt(channel.pos)]; - // TODO: Find out what volume/amplification setting is loud enough - // but still doesn't clip when playing many channels on it. - _sndBuffer[i] += (int16) (b * tempVol * 256/4); - channel.pos += channel.posAdd; - - if (channel.pos >= intToFrac(channel.size)) { - if (channel.loop) { - // Don't divide by zero on zero length samples - channel.pos %= intToFrac(channel.size + (channel.size == 0)); - // Probably we should loop the envelope too - channel.envSeg = 0; - channel.envVol = channel.startEnvVol; - } else { - channel.pos = channel.chanVol = 0; - channel.end = true; - break; - } - } - } - - if (channel.envSeg < ENVELOPE_SEGMENT_COUNT) { - const IIgsEnvelopeSegment &seg = channel.ins->env.seg[channel.envSeg]; - // I currently assume enveloping works with the same speed as the MIDI - // (i.e. with 1/60ths of a second ticks). - // TODO: Check if enveloping really works with the same speed as MIDI - frac_t envVolDelta = doubleToFrac(seg.inc/256.0); - if (intToFrac(seg.bp) >= channel.envVol) { - channel.envVol += envVolDelta; - if (channel.envVol >= intToFrac(seg.bp)) { - channel.envVol = intToFrac(seg.bp); - channel.envSeg += 1; - } - } else { - channel.envVol -= envVolDelta; - if (channel.envVol <= intToFrac(seg.bp)) { - channel.envVol = intToFrac(seg.bp); - channel.envSeg += 1; - } - } - } - } - } - } - - removeStoppedSounds(); - - return IIGS_BUFFER_SIZE; -} - -void SoundGen2GS::fillAudio(int16 *stream, uint len) { - uint32 p = 0; - - // current number of audio bytes in _sndBuffer - static uint32 data_available = 0; - // offset of start of audio bytes in _sndBuffer - static uint32 data_offset = 0; - - len <<= 2; - - debugC(5, kDebugLevelSound, "(%p, %d)", (void *)stream, len); - - while (len > data_available) { - memcpy((uint8 *)stream + p, (uint8*)_sndBuffer + data_offset, data_available); - p += data_available; - len -= data_available; - - playSound(); - data_available = mixSound() << 1; - data_offset = 0; - } - - memcpy((uint8 *)stream + p, (uint8*)_sndBuffer + data_offset, len); - data_offset += len; - data_available -= len; -} - -void SoundGen2GS::playSampleSound() { - if (_vm->_soundemu != SOUND_EMU_APPLE2GS) { - warning("Trying to play a sample but not using Apple IIGS sound emulation mode"); - return; - } - - if (_playingSound != -1) - _playing = activeSounds() > 0; -} - -void SoundGen2GS::stopSounds() { - // Stops all sounds on all MIDI channels - for (iterator iter = _midiChannels.begin(); iter != _midiChannels.end(); ++iter) - iter->stopSounds(); -} - -bool SoundGen2GS::playSampleSound(const IIgsSampleHeader &sampleHeader, const int8 *sample) { - stopSounds(); - IIgsMidiChannel &channel = _midiChannels[kSfxMidiChannel]; - - channel.setInstrument(&sampleHeader.instrument, sample); - channel.setVolume(sampleHeader.volume); - channel.noteOn(sampleHeader.pitch, 64); // Use default velocity (i.e. 64) - - return true; -} - -void SoundGen2GS::playMidiSound() { - if (_disabledMidi) +void SoundGen2GS::advanceMidiPlayer() { + if (_disableMidi) return; const uint8 *p; uint8 parm1, parm2; - static uint8 cmd, ch; + static uint8 cmd, chn; if (_playingSound == -1 || _vm->_game.sounds[_playingSound] == NULL) { warning("Error playing Apple IIGS MIDI sound resource"); _playing = false; - return; } IIgsMidi *midiObj = (IIgsMidi *) _vm->_game.sounds[_playingSound]; + _ticks++; _playing = true; p = midiObj->getPtr(); - midiObj->_soundBufTicks++; - while (true) { - uint8 readByte = *p; - // Check for end of MIDI sequence marker (Can also be here before delta-time) - if (readByte == MIDI_BYTE_STOP_SEQUENCE) { + if (*p == MIDI_STOP_SEQUENCE) { debugC(3, kDebugLevelSound, "End of MIDI sequence (Before reading delta-time)"); _playing = false; - midiObj->rewind(); - return; - } else if (readByte == MIDI_BYTE_TIMER_SYNC) { + } + if (*p == MIDI_TIMER_SYNC) { debugC(3, kDebugLevelSound, "Timer sync"); p++; // Jump over the timer sync byte as it's not needed - continue; } - uint8 deltaTime = readByte; - if (midiObj->_midiTicks + deltaTime > midiObj->_soundBufTicks) { + // Check for delta time + uint8 delta = *p; + if (midiObj->_ticks + delta > _ticks) break; - } - midiObj->_midiTicks += deltaTime; - p++; // Jump over the delta-time byte as it was already taken care of + midiObj->_ticks += delta; + p++; // Check for end of MIDI sequence marker (This time it after reading delta-time) - if (*p == MIDI_BYTE_STOP_SEQUENCE) { + if (*p == MIDI_STOP_SEQUENCE) { debugC(3, kDebugLevelSound, "End of MIDI sequence (After reading delta-time)"); _playing = false; - midiObj->rewind(); - return; } @@ -298,36 +305,51 @@ void SoundGen2GS::playMidiSound() { // Otherwise use running status (i.e. previously set command and channel). if (*p & 0x80) { cmd = *p++; - ch = cmd & 0x0f; + chn = cmd & 0x0f; cmd >>= 4; } switch (cmd) { - case MIDI_CMD_NOTE_OFF: + case MIDI_NOTE_OFF: parm1 = *p++; parm2 = *p++; - midiNoteOff(ch, parm1, parm2); + debugC(3, kDebugLevelSound, "channel %X: note off (key = %d, velocity = %d)", chn, parm1, parm2); + midiNoteOff(chn, parm1, parm2); break; - case MIDI_CMD_NOTE_ON: + case MIDI_NOTE_ON: parm1 = *p++; parm2 = *p++; - midiNoteOn(ch, parm1, parm2); + debugC(3, kDebugLevelSound, "channel %X: note on (key = %d, velocity = %d)", chn, parm1, parm2); + midiNoteOn(chn, parm1, parm2); break; - case MIDI_CMD_CONTROLLER: + case MIDI_CONTROLLER: parm1 = *p++; parm2 = *p++; - midiController(ch, parm1, parm2); + debugC(3, kDebugLevelSound, "channel %X: controller %02X = %02X", chn, parm1, parm2); + // The tested Apple IIGS AGI MIDI resources only used + // controllers 0 (Bank select?), 7 (Volume) and 64 (Sustain On/Off). + // Controller 0's parameter was in range 94-127, + // controller 7's parameter was in range 0-127 and + // controller 64's parameter was always 0 (i.e. sustain off). + switch (parm1) { + case 7: + _channels[chn].setVolume(parm2); + break; + } break; - case MIDI_CMD_PROGRAM_CHANGE: + case MIDI_PROGRAM_CHANGE: parm1 = *p++; - midiProgramChange(ch, parm1); + debugC(3, kDebugLevelSound, "channel %X: program change %02X", chn, parm1); + _channels[chn].setInstrument(getInstrument(parm1)); break; - case MIDI_CMD_PITCH_WHEEL: + case MIDI_PITCH_WHEEL: parm1 = *p++; parm2 = *p++; + debugC(3, kDebugLevelSound, "channel %X: pitch wheel (unimplemented)", chn); + break; - uint16 wheelPos = ((parm2 & 0x7F) << 7) | (parm1 & 0x7F); // 14-bit value - midiPitchWheel(wheelPos); + default: + debugC(3, kDebugLevelSound, "channel %X: unimplemented command %02X", chn, cmd); break; } } @@ -335,78 +357,102 @@ void SoundGen2GS::playMidiSound() { midiObj->setPtr(p); } -void SoundGen2GS::midiNoteOff(uint8 channel, uint8 note, uint8 velocity) { - _midiChannels[channel].noteOff(note, velocity); - debugC(3, kDebugLevelSound, "note off, channel %02x, note %02x, velocity %02x", channel, note, velocity); -} - -void SoundGen2GS::midiNoteOn(uint8 channel, uint8 note, uint8 velocity) { - _midiChannels[channel].noteOn(note, velocity); - debugC(3, kDebugLevelSound, "note on, channel %02x, note %02x, velocity %02x", channel, note, velocity); -} - -// TODO: Check if controllers behave differently on different MIDI channels -// TODO: Doublecheck what other controllers than the volume controller do -void SoundGen2GS::midiController(uint8 channel, uint8 controller, uint8 value) { - IIgsMidiChannel &midiChannel = _midiChannels[channel]; - - // The tested Apple IIGS AGI MIDI resources only used - // controllers 0 (Bank select?), 7 (Volume) and 64 (Sustain On/Off). - // Controller 0's parameter was in range 94-127, - // controller 7's parameter was in range 0-127 and - // controller 64's parameter was always 0 (i.e. sustain off). - bool unimplemented = false; - switch (controller) { - case 7: // Volume - midiChannel.setVolume(value); - break; - default: - unimplemented = true; - break; +void SoundGen2GS::midiNoteOff(int channel, int note, int velocity) { + // Release keys within the given MIDI channel + for (int i = 0; i < MAX_GENERATORS; i++) { + if (_generators[i].chn == channel && _generators[i].key == note) + _generators[i].seg = _generators[i].ins->seg; } - debugC(3, kDebugLevelSound, "controller %02x, ch %02x, val %02x%s", controller, channel, value, unimplemented ? " (Unimplemented)" : ""); } -void SoundGen2GS::midiProgramChange(uint8 channel, uint8 program) { - _midiChannels[channel].setInstrument(getInstrument(program), _wave.begin()); - debugC(3, kDebugLevelSound, "program change %02x, channel %02x", program, channel); +void SoundGen2GS::midiNoteOn(int channel, int note, int velocity) { + if (!_channels[channel].getInstrument()) { + debugC(3, kDebugLevelSound, "midiNoteOn(): no instrument specified for channel %d", channel); + return; + } + + // Allocate a generator for the note. + IIgsGenerator* g = allocateGenerator(); + g->ins = _channels[channel].getInstrument(); + const IIgsInstrumentHeader* i = g->ins; + + // Pass information from the MIDI channel to the generator. Take + // velocity into account, although simplistically. + velocity *= 5 / 3; + if (velocity > 127) + velocity = 127; + + g->key = note; + g->vel = velocity * _channels[channel].getVolume() / 127; + g->chn = channel; + + // Instruments can define different samples to be used based on + // what the key is. Find the correct samples for our key. + int wa = 0; + int wb = 0; + while (wa < i->waveCount[0] - 1 && note > i->wave[0][wa].key) + wa++; + while (wb < i->waveCount[1] - 1 && note > i->wave[1][wb].key) + wb++; + + // Prepare the generator. + g->osc[0].base = i->base + i->wave[0][wa].offset; + g->osc[0].size = i->wave[0][wa].size; + g->osc[0].pd = doubleToFrac(midiKeyToFreq(note, (double)i->wave[0][wa].tune / 256.0) / (double)_sampleRate); + g->osc[0].p = 0; + g->osc[0].halt = i->wave[0][wa].halt; + g->osc[0].loop = i->wave[0][wa].loop; + g->osc[0].swap = i->wave[0][wa].swap; + g->osc[0].chn = i->wave[0][wa].chn; + + g->osc[1].base = i->base + i->wave[1][wb].offset; + g->osc[1].size = i->wave[1][wb].size; + g->osc[1].pd = doubleToFrac(midiKeyToFreq(note, (double)i->wave[1][wb].tune / 256.0) / (double)_sampleRate); + g->osc[1].p = 0; + g->osc[1].halt = i->wave[1][wb].halt; + g->osc[1].loop = i->wave[1][wb].loop; + g->osc[1].swap = i->wave[1][wb].swap; + g->osc[1].chn = i->wave[1][wb].chn; + + g->seg = 0; + g->a = 0; + + // Print debug messages for instruments with swap mode or vibrato enabled + if (g->osc[0].swap || g->osc[1].swap) + debugC(2, kDebugLevelSound, "Detected swap mode in a playing instrument. This is rare and is not tested well..."); + if (i->vibDepth > 0) + debugC(2, kDebugLevelSound, "Detected vibrato in a playing instrument. Vibrato is not implemented, playing without..."); } -void SoundGen2GS::midiPitchWheel(uint8 wheelPos) { - // In all the tested Apple IIGS AGI MIDI resources - // pitch wheel commands always used 0x2000 (Center position). - // Therefore it should be quite safe to ignore this command. - debugC(3, kDebugLevelSound, "pitch wheel position %04x (Unimplemented)", wheelPos); +double SoundGen2GS::midiKeyToFreq(int key, double finetune) { + return 440.0 * pow(2.0, (15.0 + (double)key + finetune) / 12.0); } -const IIgsInstrumentHeader* SoundGen2GS::getInstrument(uint8 program) const { - return &_instruments[_midiProgToInst->map(program)]; +void SoundGen2GS::haltGenerators() { + for (int i = 0; i < MAX_GENERATORS; i++) { + _generators[i].osc[0].halt = true; + _generators[i].osc[1].halt = true; + } } -void SoundGen2GS::setProgramChangeMapping(const MidiProgramChangeMapping *mapping) { - _midiProgToInst = mapping; +uint SoundGen2GS::activeGenerators() { + int n = 0; + for (int i = 0; i < MAX_GENERATORS; i++) + if (!_generators[i].osc[0].halt || !_generators[i].osc[1].halt) + n++; + return n; } -void SoundGen2GS::removeStoppedSounds() { - for (Common::Array::iterator iter = _midiChannels.begin(); iter != _midiChannels.end(); ++iter) - iter->removeStoppedSounds(); -} - -uint SoundGen2GS::activeSounds() const { - uint result = 0; - - for (Common::Array::const_iterator iter = _midiChannels.begin(); iter != _midiChannels.end(); ++iter) - result += iter->activeSounds(); - - return result; +void SoundGen2GS::setProgramChangeMapping(const IIgsMidiProgramMapping *mapping) { + _progToInst = mapping; } IIgsMidi::IIgsMidi(uint8 *data, uint32 len, int resnum, SoundMgr &manager) : AgiSound(manager) { _data = data; // Save the resource pointer _ptr = _data + 2; // Set current position to just after the header - _len = len; // Save the resource's length + _len = len; // Save the resource's length _type = READ_LE_UINT16(data); // Read sound resource's type - _midiTicks = _soundBufTicks = 0; + _ticks = 0; _isValid = (_type == AGI_SOUND_MIDI) && (_data != NULL) && (_len >= 2); if (!_isValid) // Check for errors @@ -422,7 +468,7 @@ IIgsMidi::IIgsMidi(uint8 *data, uint32 len, int resnum, SoundMgr &manager) : Agi static bool convertWave(Common::SeekableReadStream &source, int8 *dest, uint length) { // Convert the wave from 8-bit unsigned to 8-bit signed format for (uint i = 0; i < length; i++) - dest[i] = (int8) ((int) source.readByte() - 128); + dest[i] = (int8) ((int) source.readByte() - ZERO_OFFSET); return !(source.eos() || source.err()); } @@ -449,330 +495,136 @@ IIgsSample::IIgsSample(uint8 *data, uint32 len, int resnum, SoundMgr &manager) : _header.pitch &= 0x7F; // Apple IIGS AGI probably did it this way too } - // Finalize the header info using the 8-bit unsigned sample data - _header.finalize(stream); - // Convert sample data from 8-bit unsigned to 8-bit signed format stream.seek(sampleStartPos); _sample = new int8[_header.sampleSize]; - if (_sample != NULL) + if (_sample != NULL) { _isValid = convertWave(stream, _sample, _header.sampleSize); + // Finalize header info using sample data + _header.finalize(_sample); + } } if (!_isValid) // Check for errors warning("Error creating Apple IIGS sample from resource %d (Type %d, length %d)", resnum, _header.type, len); } -/** Reads an Apple IIGS envelope from then given stream. */ -bool IIgsEnvelope::read(Common::SeekableReadStream &stream) { - for (int segNum = 0; segNum < ENVELOPE_SEGMENT_COUNT; segNum++) { - seg[segNum].bp = stream.readByte(); - seg[segNum].inc = stream.readUint16LE(); - } - - return !(stream.eos() || stream.err()); -} - -/** Reads an Apple IIGS wave information structure from the given stream. */ -bool IIgsWaveInfo::read(Common::SeekableReadStream &stream, bool ignoreAddr) { - top = stream.readByte(); - addr = stream.readByte() * 256; - size = (1 << (stream.readByte() & 7)) * 256; - - // Read packed mode byte and parse it into parts - byte packedModeByte = stream.readByte(); - channel = (packedModeByte >> 4) & 1; // Bit 4 - mode = (packedModeByte >> 1) & 3; // Bits 1-2 - halt = (packedModeByte & 1) != 0; // Bit 0 (Converted to boolean) - - relPitch = stream.readSint16LE(); - - // Zero the wave address if we want to ignore the wave address info - if (ignoreAddr) - addr = 0; - - return !(stream.eos() || stream.err()); -} - -bool IIgsWaveInfo::finalize(Common::SeekableReadStream &uint8Wave) { - uint32 startPos = uint8Wave.pos(); // Save stream's starting position - uint8Wave.seek(addr, SEEK_CUR); // Seek to wave's address - - // Calculate the true sample size (A zero ends the sample prematurely) - uint trueSize = size; // Set a default value for the result - for (uint i = 0; i < size; i++) { - if (uint8Wave.readByte() == 0) { - trueSize = i; - // A zero in the sample stream turns off looping - // (At least that's what MESS 0.117 and KEGS32 0.91 seem to do) - if (mode == OSC_MODE_LOOP) - mode = OSC_MODE_ONESHOT; - break; - } - } - size = trueSize; // Set the true sample size - - uint8Wave.seek(startPos); // Seek back to the stream's starting position - - return true; -} - -bool IIgsOscillator::finalize(Common::SeekableReadStream &uint8Wave) { - for (uint i = 0; i < WAVES_PER_OSCILLATOR; i++) - if (!waves[i].finalize(uint8Wave)) - return false; - - return true; -} - -bool IIgsOscillatorList::read(Common::SeekableReadStream &stream, uint oscillatorCount, bool ignoreAddr) { - // First read the A waves and then the B waves for the oscillators - for (uint waveNum = 0; waveNum < WAVES_PER_OSCILLATOR; waveNum++) - for (uint oscNum = 0; oscNum < oscillatorCount; oscNum++) - if (!osc[oscNum].waves[waveNum].read(stream, ignoreAddr)) - return false; - - count = oscillatorCount; // Set the oscillator count - - return true; -} - -bool IIgsOscillatorList::finalize(Common::SeekableReadStream &uint8Wave) { - for (uint i = 0; i < count; i++) - if (!osc[i].finalize(uint8Wave)) - return false; - - return true; -} bool IIgsInstrumentHeader::read(Common::SeekableReadStream &stream, bool ignoreAddr) { - env.read(stream); - relseg = stream.readByte(); - /*byte priority =*/ stream.readByte(); // Not needed? 32 in all tested data. - bendrange = stream.readByte(); - vibdepth = stream.readByte(); - vibspeed = stream.readByte(); - /*byte spare =*/ stream.readByte(); // Not needed? 0 in all tested data. - byte wac = stream.readByte(); // Read A wave count - byte wbc = stream.readByte(); // Read B wave count - oscList.read(stream, wac, ignoreAddr); // Read the oscillators - return (wac == wbc) && !(stream.eos() || stream.err()); // A and B wave counts must match + for (int i = 0; i < ENVELOPE_SEGMENT_COUNT; i++) { + env[i].bp = intToFrac(stream.readByte()); + env[i].inc = intToFrac(stream.readUint16LE()) >> 8; + } + seg = stream.readByte(); + /*priority =*/ stream.readByte(); // Not needed. 32 in all tested data. + bend = stream.readByte(); + vibDepth = stream.readByte(); + vibSpeed = stream.readByte(); + stream.readByte(); // Not needed? 0 in all tested data. + + waveCount[0] = stream.readByte(); + waveCount[1] = stream.readByte(); + for (int i = 0; i < 2; i++) + for (int k = 0; k < waveCount[i]; k++) { + wave[i][k].key = stream.readByte(); + wave[i][k].offset = stream.readByte() << 8; + wave[i][k].size = 0x100 << (stream.readByte() & 7); + uint8 b = stream.readByte(); + wave[i][k].tune = stream.readUint16LE(); + + // For sample resources we ignore the address. + if (ignoreAddr) + wave[i][k].offset = 0; + + // Check for samples that extend out of the wavetable. + if (wave[i][k].offset + wave[i][k].size >= SIERRASTANDARD_SIZE) { + warning("Invalid data detected in the instrument set of Apple IIGS AGI. Continuing anyway..."); + wave[i][k].size = SIERRASTANDARD_SIZE - wave[i][k].offset; + } + + // Parse the generator mode byte to separate fields. + wave[i][k].halt = b & 0x1; // Bit 0 = HALT + wave[i][k].loop = !(b & 0x2); // Bit 1 =!LOOP + wave[i][k].swap = (b & 0x6) == 0x6; // Bit 1&2 = SWAP + wave[k][k].chn = (b >> 4) > 0; // Output channel (left or right) + } + + return !(stream.eos() || stream.err()); } -bool IIgsInstrumentHeader::finalize(Common::SeekableReadStream &uint8Wave) { - return oscList.finalize(uint8Wave); +bool IIgsInstrumentHeader::finalize(int8 *wavetable) { + // Calculate final pointers to sample data and detect true sample size + // in case the sample ends prematurely. + for (int i = 0; i < 2; i++) + for (int k = 0; k < waveCount[i]; k++) { + base = wavetable; + int8 *p = base + wave[i][k].offset; + uint trueSize; + for (trueSize = 0; trueSize < wave[i][k].size; trueSize++) + if (p[trueSize] == -ZERO_OFFSET) + break; + wave[i][k].size = trueSize; + } + + return true; } bool IIgsSampleHeader::read(Common::SeekableReadStream &stream) { - type = stream.readUint16LE(); - pitch = stream.readByte(); - unknownByte_Ofs3 = stream.readByte(); - volume = stream.readByte(); - unknownByte_Ofs5 = stream.readByte(); - instrumentSize = stream.readUint16LE(); - sampleSize = stream.readUint16LE(); + type = stream.readUint16LE(); + pitch = stream.readByte(); + unknownByte_Ofs3 = stream.readByte(); + volume = stream.readByte(); + unknownByte_Ofs5 = stream.readByte(); + instrumentSize = stream.readUint16LE(); + sampleSize = stream.readUint16LE(); // Read the instrument header *ignoring* its wave address info - return instrument.read(stream, true); } -bool IIgsSampleHeader::finalize(Common::SeekableReadStream &uint8Wave) { - return instrument.finalize(uint8Wave); +bool IIgsSampleHeader::finalize(int8 *sample) { + return instrument.finalize(sample); } -void IIgsMidiChannel::stopSounds() { - // Stops all sounds on this single MIDI channel - for (iterator iter = _gsChannels.begin(); iter != _gsChannels.end(); ++iter) - iter->stop(); - - _gsChannels.clear(); -} - -void IIgsMidiChannel::removeStoppedSounds() { - for (int i = _gsChannels.size() - 1; i >= 0; i--) - if (!_gsChannels[i].playing()) - _gsChannels.remove_at(i); -} - -uint IIgsMidiChannel::activeSounds() const { - uint result = 0; - - for (const_iterator iter = _gsChannels.begin(); iter != _gsChannels.end(); ++iter) - if (!iter->end) - result++; - - return result; -} - -void IIgsMidiChannel::setInstrument(const IIgsInstrumentHeader *instrument, const int8 *sample) { - _instrument = instrument; - _sample = sample; - - // Set program on each Apple IIGS channel playing on this MIDI channel - for (iterator iter = _gsChannels.begin(); iter != _gsChannels.end(); ++iter) - iter->setInstrument(instrument, sample); -} - -void IIgsMidiChannel::setVolume(uint8 volume) { - _volume = volume; - - // Set volume on each Apple IIGS channel playing on this MIDI channel - for (iterator iter = _gsChannels.begin(); iter != _gsChannels.end(); ++iter) - iter->setChannelVolume(volume); -} - -void IIgsMidiChannel::noteOff(uint8 note, uint8 velocity) { - // Go through all the notes playing on this MIDI channel - // and turn off the ones that are playing the given note - for (iterator iter = _gsChannels.begin(); iter != _gsChannels.end(); ++iter) - if (iter->origNote == note) - iter->noteOff(velocity); -} - -void IIgsMidiChannel::noteOn(uint8 note, uint8 velocity) { - IIgsChannelInfo channel; - - // Use the default channel volume and instrument - channel.setChannelVolume(_volume); - channel.setInstrument(_instrument, _sample); - - // Set the note on and save the channel - channel.noteOn(note, velocity); - _gsChannels.push_back(channel); -} - -void IIgsChannelInfo::rewind() { - this->envVol = this->startEnvVol; - this->envSeg = 0; - this->pos = intToFrac(0); -} - -void IIgsChannelInfo::setChannelVolume(uint8 volume) { - this->chanVol = intToFrac(volume); -} - -void IIgsChannelInfo::setInstrument(const IIgsInstrumentHeader *instrument, const int8 *sample) { - assert(instrument != NULL && sample != NULL); - this->ins = instrument; - this->unrelocatedSample = sample; -} - -// TODO/FIXME: Implement correctly and fully (Take velocity into account etc) -void IIgsChannelInfo::noteOn(uint8 noteParam, uint8 velocity) { - this->origNote = noteParam; - this->startEnvVol = intToFrac(0); - rewind(); - - const IIgsWaveInfo *waveInfo = NULL; - - for (uint i = 0; i < ins->oscList.count; i++) - if (ins->oscList(i).waves[0].top >= noteParam) - waveInfo = &ins->oscList(i).waves[0]; - - assert(waveInfo != NULL); - - this->relocatedSample = this->unrelocatedSample + waveInfo->addr; - this->posAdd = intToFrac(0); - this->note = intToFrac(noteParam) + doubleToFrac(waveInfo->relPitch/256.0); - this->vol = doubleToFrac(fracToDouble(this->envVol) * fracToDouble(this->chanVol) / 127.0); - this->loop = (waveInfo->mode == OSC_MODE_LOOP); - this->size = waveInfo->size - waveInfo->addr; - this->end = waveInfo->halt; -} - -// TODO/FIXME: Implement correctly and fully (Take release time and velocity into account etc) -void IIgsChannelInfo::noteOff(uint8 velocity) { - this->loop = false; - this->envSeg = ins->relseg; -} - -void IIgsChannelInfo::stop() { - this->end = true; -} - -bool IIgsChannelInfo::playing() { - return !this->end; -} - -/** - * A function object (i.e. a functor) for testing if a Common::FSNode - * object's name is equal (Ignoring case) to a string or to at least - * one of the strings in a list of strings. Can be used e.g. with find_if(). - */ -struct fsnodeNameEqualsIgnoreCase : public Common::UnaryFunction { -// FIXME: This should be replaced; use SearchMan instead - fsnodeNameEqualsIgnoreCase(const Common::StringArray &str) : _str(str) {} - fsnodeNameEqualsIgnoreCase(const Common::String str) { _str.push_back(str); } - bool operator()(const Common::FSNode ¶m) const { - for (Common::StringArray::const_iterator iter = _str.begin(); iter != _str.end(); ++iter) - if (param.getName().equalsIgnoreCase(*iter)) - return true; - return false; - } -private: - Common::StringArray _str; -}; +//### +//### LOADER METHODS +//### bool SoundGen2GS::loadInstruments() { - // Check that the platform is Apple IIGS, as only it uses custom instruments - if (_vm->getPlatform() != Common::kPlatformApple2GS) { - debugC(3, kDebugLevelSound, "Platform isn't Apple IIGS so not loading any instruments"); - return true; - } - // Get info on the particular Apple IIGS AGI game's executable - const IIgsExeInfo *exeInfo = getIIgsExeInfo((enum AgiGameID) _vm->getGameID()); + const IIgsExeInfo *exeInfo = getIIgsExeInfo((enum AgiGameID)_vm->getGameID()); if (exeInfo == NULL) { warning("Unsupported Apple IIGS game, not loading instruments"); return false; } - // List files in the game path - Common::FSList fslist; - Common::FSNode dir(ConfMan.get("path")); - if (!dir.getChildren(fslist, Common::FSNode::kListFilesOnly)) { - warning("Invalid game path (\"%s\"), not loading Apple IIGS instruments", dir.getPath().c_str()); + // Find the executable file and the wavetable file + Common::ArchiveMemberList exeNames, waveNames; + SearchMan.listMatchingMembers(exeNames, "*.SYS16"); + SearchMan.listMatchingMembers(exeNames, "*.SYS"); + SearchMan.listMatchingMembers(waveNames, "SIERRASTANDARD"); + SearchMan.listMatchingMembers(waveNames, "SIERRAST"); + + if (exeNames.empty()) { + warning("Couldn't find Apple IIGS game executable (*.SYS16 or *.SYS), not loading instruments"); + return false; + } + if (waveNames.empty()) { + warning("Couldn't find Apple IIGS wave file (SIERRASTANDARD or SIERRAST), not loading instruments"); return false; } - // Populate executable filenames list (Long filename and short filename) for searching - Common::StringArray exeNames; - exeNames.push_back(Common::String(exeInfo->exePrefix) + ".SYS16"); - exeNames.push_back(Common::String(exeInfo->exePrefix) + ".SYS"); - - // Populate wave filenames list (Long filename and short filename) for searching - Common::StringArray waveNames; - waveNames.push_back("SIERRASTANDARD"); - waveNames.push_back("SIERRAST"); - - // Search for the executable file and the wave file (i.e. check if any of the filenames match) - Common::FSList::const_iterator exeFsnode, waveFsnode; - exeFsnode = Common::find_if(fslist.begin(), fslist.end(), fsnodeNameEqualsIgnoreCase(exeNames)); - waveFsnode = Common::find_if(fslist.begin(), fslist.end(), fsnodeNameEqualsIgnoreCase(waveNames)); - - // Make sure that we found the executable file - if (exeFsnode == fslist.end()) { - warning("Couldn't find Apple IIGS game executable (%s), not loading instruments", exeNames.begin()->c_str()); - return false; - } - - // Make sure that we found the wave file - if (waveFsnode == fslist.end()) { - warning("Couldn't find Apple IIGS wave file (%s), not loading instruments", waveNames.begin()->c_str()); - return false; - } + Common::String exeName = exeNames.front()->getName(); + Common::String waveName = waveNames.front()->getName(); // Set the MIDI program change to instrument number mapping and // load the instrument headers and their sample data. - // None of the tested SIERRASTANDARD-files have zeroes in them so - // there's no need to check for prematurely ending samples here. setProgramChangeMapping(exeInfo->instSet->progToInst); - return loadWaveFile(*waveFsnode, *exeInfo) && loadInstrumentHeaders(*exeFsnode, *exeInfo); + return loadWaveFile(waveName, *exeInfo) && loadInstrumentHeaders(exeName, *exeInfo); } /** Older Apple IIGS AGI MIDI program change to instrument number mapping. */ -static const MidiProgramChangeMapping progToInstMappingV1 = { +static const IIgsMidiProgramMapping progToInstMappingV1 = { {19, 20, 22, 23, 21, 24, 5, 5, 5, 5, 6, 7, 10, 9, 11, 9, 15, 8, 5, 5, 17, 16, 18, 12, 14, 5, 5, 5, 5, 5, @@ -781,8 +633,9 @@ static const MidiProgramChangeMapping progToInstMappingV1 = { 5 }; -/** Newer Apple IIGS AGI MIDI program change to instrument number mapping. */ -static const MidiProgramChangeMapping progToInstMappingV2 = { +/** Newer Apple IIGS AGI MIDI program change to instrument number mapping. + FIXME: Some instrument choices sound wrong. */ +static const IIgsMidiProgramMapping progToInstMappingV2 = { {21, 22, 24, 25, 23, 26, 6, 6, 6, 6, 7, 9, 12, 8, 13, 11, 17, 10, 6, 6, 19, 18, 20, 14, 16, 6, 6, 6, 6, 6, @@ -791,13 +644,39 @@ static const MidiProgramChangeMapping progToInstMappingV2 = { 6 }; -/** Older Apple IIGS AGI instrument set. Used only by Space Quest I (AGI v1.002). */ -static const InstrumentSetInfo instSetV1 = { +// Older Apple IIGS AGI instrument set. Used only by Space Quest I (AGI v1.002). +// +// Instrument 0 uses vibrato. +// Instrument 1 uses vibrato. +// Instrument 3 uses vibrato. +// Instrument 5 has swap mode enabled for the first oscillator. +// Instruemnt 9 uses vibrato. +// Instrument 10 uses vibrato. +// Instrument 12 uses vibrato. +// Instrument 15 uses vibrato. +// Instrument 16 uses vibrato. +// Instrument 18 uses vibrato. +static const IIgsInstrumentSetInfo instSetV1 = { 1192, 26, "7ee16bbc135171ffd6b9120cc7ff1af2", "edd3bf8905d9c238e02832b732fb2e18", &progToInstMappingV1 }; -/** Newer Apple IIGS AGI instrument set (AGI v1.003+). Used by all others than Space Quest I. */ -static const InstrumentSetInfo instSetV2 = { +// Newer Apple IIGS AGI instrument set (AGI v1.003+). Used by all others than Space Quest I. +// +// Instrument 0 uses vibrato. +// Instrument 1 uses vibrato. +// Instrument 3 uses vibrato. +// Instrument 6 has swap mode enabled for the first oscillator. +// Instrument 11 uses vibrato. +// Instrument 12 uses vibrato. +// Instrument 14 uses vibrato. +// Instrument 17 uses vibrato. +// Instrument 18 uses vibrato. +// Instrument 20 uses vibrato. +// +// In KQ1 intro and in LSL intro one (and the same, or at least similar) +// instrument is using vibrato. In PQ intro there is also one instrument +// using vibrato. +static const IIgsInstrumentSetInfo instSetV2 = { 1292, 28, "b7d428955bb90721996de1cbca25e768", "c05fb0b0e11deefab58bc68fbd2a3d07", &progToInstMappingV2 }; @@ -829,15 +708,14 @@ const IIgsExeInfo *SoundGen2GS::getIIgsExeInfo(enum AgiGameID gameid) const { return NULL; } -bool SoundGen2GS::loadInstrumentHeaders(const Common::FSNode &exePath, const IIgsExeInfo &exeInfo) { - bool loadedOk = false; // Was loading successful? +bool SoundGen2GS::loadInstrumentHeaders(Common::String &exePath, const IIgsExeInfo &exeInfo) { Common::File file; // Open the executable file and check that it has correct size file.open(exePath); if (file.size() != (int32)exeInfo.exeSize) { debugC(3, kDebugLevelSound, "Apple IIGS executable (%s) has wrong size (Is %d, should be %d)", - exePath.getPath().c_str(), file.size(), exeInfo.exeSize); + exePath.c_str(), file.size(), exeInfo.exeSize); } // Read the whole executable file into memory @@ -845,50 +723,49 @@ bool SoundGen2GS::loadInstrumentHeaders(const Common::FSNode &exePath, const IIg file.close(); // Check that we got enough data to be able to parse the instruments - if (data && data->size() >= (int32)(exeInfo.instSetStart + exeInfo.instSet->byteCount)) { - // Check instrument set's length (The info's saved in the executable) - data->seek(exeInfo.instSetStart - 4); - uint16 instSetByteCount = data->readUint16LE(); - if (instSetByteCount != exeInfo.instSet->byteCount) { - debugC(3, kDebugLevelSound, "Wrong instrument set size (Is %d, should be %d) in Apple IIGS executable (%s)", - instSetByteCount, exeInfo.instSet->byteCount, exePath.getPath().c_str()); + if (!data || data->size() < (int32)(exeInfo.instSetStart + exeInfo.instSet->byteCount)) { + warning("Error loading instruments from Apple IIGS executable (%s)", exePath.c_str()); + return false; + } + + // Check instrument set's length (The info's saved in the executable) + data->seek(exeInfo.instSetStart - 4); + uint16 instSetByteCount = data->readUint16LE(); + if (instSetByteCount != exeInfo.instSet->byteCount) { + debugC(3, kDebugLevelSound, "Wrong instrument set size (Is %d, should be %d) in Apple IIGS executable (%s)", + instSetByteCount, exeInfo.instSet->byteCount, exePath.c_str()); + } + + // Check instrument set's md5sum + data->seek(exeInfo.instSetStart); + Common::String md5str = Common::computeStreamMD5AsString(*data, exeInfo.instSet->byteCount); + if (md5str != exeInfo.instSet->md5) { + warning("Unknown Apple IIGS instrument set (md5: %s) in %s, trying to use it nonetheless", + md5str.c_str(), exePath.c_str()); + } + + // Read in the instrument set one instrument at a time + data->seek(exeInfo.instSetStart); + + _instruments.clear(); + _instruments.reserve(exeInfo.instSet->instCount); + + IIgsInstrumentHeader instrument; + for (uint i = 0; i < exeInfo.instSet->instCount; i++) { + if (!instrument.read(*data)) { + warning("Error loading Apple IIGS instrument (%d. of %d) from %s, not loading more instruments", + i + 1, exeInfo.instSet->instCount, exePath.c_str()); + break; } + instrument.finalize(_wavetable); + _instruments.push_back(instrument); + } - // Check instrument set's md5sum - data->seek(exeInfo.instSetStart); - - Common::String md5str = Common::computeStreamMD5AsString(*data, exeInfo.instSet->byteCount); - if (md5str != exeInfo.instSet->md5) { - warning("Unknown Apple IIGS instrument set (md5: %s) in %s, trying to use it nonetheless", - md5str.c_str(), exePath.getPath().c_str()); - } - - // Read in the instrument set one instrument at a time - data->seek(exeInfo.instSetStart); - - // Load the instruments - _instruments.clear(); - _instruments.reserve(exeInfo.instSet->instCount); - - IIgsInstrumentHeader instrument; - for (uint i = 0; i < exeInfo.instSet->instCount; i++) { - if (!instrument.read(*data)) { - warning("Error loading Apple IIGS instrument (%d. of %d) from %s, not loading more instruments", - i + 1, exeInfo.instSet->instCount, exePath.getPath().c_str()); - break; - } - _instruments.push_back(instrument); // Add the successfully loaded instrument to the instruments array - } - - // Loading was successful only if all instruments were loaded successfully - loadedOk = (_instruments.size() == exeInfo.instSet->instCount); - } else // Couldn't read enough data from the executable file - warning("Error loading instruments from Apple IIGS executable (%s)", exePath.getPath().c_str()); - - return loadedOk; + // Loading was successful only if all instruments were loaded successfully + return (_instruments.size() == exeInfo.instSet->instCount); } -bool SoundGen2GS::loadWaveFile(const Common::FSNode &wavePath, const IIgsExeInfo &exeInfo) { +bool SoundGen2GS::loadWaveFile(Common::String &wavePath, const IIgsExeInfo &exeInfo) { Common::File file; // Open the wave file and read it into memory @@ -897,23 +774,22 @@ bool SoundGen2GS::loadWaveFile(const Common::FSNode &wavePath, const IIgsExeInfo file.close(); // Check that we got the whole wave file - if (uint8Wave && uint8Wave->size() == SIERRASTANDARD_SIZE) { - // Check wave file's md5sum - Common::String md5str = Common::computeStreamMD5AsString(*uint8Wave, SIERRASTANDARD_SIZE); - if (md5str != exeInfo.instSet->waveFileMd5) { - warning("Unknown Apple IIGS wave file (md5: %s, game: %s).\n" \ - "Please report the information on the previous line to the ScummVM team.\n" \ - "Using the wave file as it is - music may sound weird", md5str.c_str(), exeInfo.exePrefix); - } - - uint8Wave->seek(0); // Seek wave to its start - // Convert the wave file from 8-bit unsigned to 8-bit signed and save the result - _wave.resize(uint8Wave->size()); - return convertWave(*uint8Wave, _wave.begin(), uint8Wave->size()); - } else { // Couldn't read the wave file or it had incorrect size - warning("Error loading Apple IIGS wave file (%s), not loading instruments", wavePath.getPath().c_str()); + if (!uint8Wave || (uint8Wave->size() != SIERRASTANDARD_SIZE)) { + warning("Error loading Apple IIGS wave file (%s), not loading instruments", wavePath.c_str()); return false; } + + // Check wave file's md5sum + Common::String md5str = Common::computeStreamMD5AsString(*uint8Wave, SIERRASTANDARD_SIZE); + if (md5str != exeInfo.instSet->waveFileMd5) { + warning("Unknown Apple IIGS wave file (md5: %s, game: %s).\n" \ + "Please report the information on the previous line to the ScummVM team.\n" \ + "Using the wave file as it is - music may sound weird", md5str.c_str(), exeInfo.exePrefix); + } + + // Convert the wave file to 8-bit signed and save the result + uint8Wave->seek(0); + return convertWave(*uint8Wave, _wavetable, SIERRASTANDARD_SIZE); } } // End of namespace Agi diff --git a/engines/agi/sound_2gs.h b/engines/agi/sound_2gs.h index 76f0642b7bc..1a225300aed 100644 --- a/engines/agi/sound_2gs.h +++ b/engines/agi/sound_2gs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_SOUND_2GS_H @@ -31,45 +28,30 @@ namespace Agi { -#define BUFFER_SIZE 410 +// Sample data in SIERRASTANDARD files is in unsigned 8-bit format. A zero +// occurring in the sample data causes the ES5503 wavetable sound chip in +// Apple IIGS to halt the corresponding oscillator immediately. We preprocess +// the sample data by converting it to signed values and the instruments by +// detecting prematurely stopping samples beforehand. +// +// Note: None of the tested SIERRASTANDARD files have zeroes in them. So in +// practice there is no need to check for them. However, they still do exist +// in the sample resources. +#define ZERO_OFFSET 0x80 -// Apple IIGS MIDI uses 60 ticks per second (Based on tests with Apple IIGS -// KQ1 and SQ1 under MESS 0.124a). So we make the audio buffer size to be a -// 1/60th of a second in length. That should be getSampleRate() / 60 samples -// in length but as getSampleRate() is always 22050 at the moment we just use -// the hardcoded value of 368 (22050/60 = 367.5 which rounds up to 368). -// FIXME: Use getSampleRate() / 60 rather than a hardcoded value -#define IIGS_BUFFER_SIZE 368 +// Apple IIGS envelope update frequency defaults to 100Hz. It can be changed, +// so there might be differences per game, for example. +#define ENVELOPE_COEF 100 / _sampleRate -// MIDI command values (Shifted right by 4 so they're in the lower nibble) -#define MIDI_CMD_NOTE_OFF 0x08 -#define MIDI_CMD_NOTE_ON 0x09 -#define MIDI_CMD_CONTROLLER 0x0B -#define MIDI_CMD_PROGRAM_CHANGE 0x0C -#define MIDI_CMD_PITCH_WHEEL 0x0E -// Whole MIDI byte values (Command and channel info together) -#define MIDI_BYTE_STOP_SEQUENCE 0xFC -#define MIDI_BYTE_TIMER_SYNC 0xF8 +// MIDI player commands +#define MIDI_NOTE_OFF 0x8 +#define MIDI_NOTE_ON 0x9 +#define MIDI_CONTROLLER 0xB +#define MIDI_PROGRAM_CHANGE 0xC +#define MIDI_PITCH_WHEEL 0xE -struct IIgsEnvelopeSegment { - uint8 bp; - uint16 inc; ///< 8b.8b fixed point, very probably little endian -}; - -#define ENVELOPE_SEGMENT_COUNT 8 -struct IIgsEnvelope { - IIgsEnvelopeSegment seg[ENVELOPE_SEGMENT_COUNT]; - - /** Reads an Apple IIGS envelope from then given stream. */ - bool read(Common::SeekableReadStream &stream); -}; - -// 2**(1/12) i.e. the 12th root of 2 -#define SEMITONE 1.059463094359295 - -// C6's frequency is A4's (440 Hz) frequency but one full octave and three semitones higher -// i.e. C6_FREQ = 440 * pow(2.0, 15/12.0) -#define C6_FREQ 1046.502261202395 +#define MIDI_STOP_SEQUENCE 0xFC +#define MIDI_TIMER_SYNC 0xF8 // Size of the SIERRASTANDARD file (i.e. the wave file i.e. the sample data used by the instruments). #define SIERRASTANDARD_SIZE 65536 @@ -78,63 +60,36 @@ struct IIgsEnvelope { // Chosen empirically based on Apple IIGS AGI game data, increase if needed. #define MAX_INSTRUMENTS 28 -struct IIgsWaveInfo { - uint8 top; - uint addr; - uint size; -// Oscillator channel -#define OSC_CHANNEL_RIGHT 0 -#define OSC_CHANNEL_LEFT 1 - uint channel; -// Oscillator mode -#define OSC_MODE_LOOP 0 -#define OSC_MODE_ONESHOT 1 -#define OSC_MODE_SYNC_AM 2 -#define OSC_MODE_SWAP 3 - uint mode; - bool halt; - int16 relPitch; ///< Relative pitch in semitones (Signed 8b.8b fixed point) +// The MIDI player allocates one generator for each note it starts to play. +// Here the maximum number of generators is defined. Feel free to increase +// this if it does not seem to be enough. +#define MAX_GENERATORS 16 - /** Reads an Apple IIGS wave information structure from the given stream. */ - bool read(Common::SeekableReadStream &stream, bool ignoreAddr = false); - bool finalize(Common::SeekableReadStream &uint8Wave); -}; - -// Number of waves per Apple IIGS sound oscillator -#define WAVES_PER_OSCILLATOR 2 - -/** An Apple IIGS sound oscillator. Consists always of two waves. */ -struct IIgsOscillator { - IIgsWaveInfo waves[WAVES_PER_OSCILLATOR]; - - bool finalize(Common::SeekableReadStream &uint8Wave); -}; - -// Maximum number of oscillators in an Apple IIGS instrument. -// Chosen empirically based on Apple IIGS AGI game data, increase if needed. -#define MAX_OSCILLATORS 4 - -/** An Apple IIGS sound oscillator list. */ -struct IIgsOscillatorList { - uint count; ///< Oscillator count - IIgsOscillator osc[MAX_OSCILLATORS]; ///< The oscillators - - /** Indexing operators for easier access to the oscillators. */ - const IIgsOscillator &operator()(uint index) const { return osc[index]; } - IIgsOscillator &operator()(uint index) { return osc[index]; } - - /** Reads an Apple IIGS oscillator list from the given stream. */ - bool read(Common::SeekableReadStream &stream, uint oscillatorCount, bool ignoreAddr = false); - bool finalize(Common::SeekableReadStream &uint8Wave); -}; +#define ENVELOPE_SEGMENT_COUNT 8 +#define MAX_OSCILLATOR_WAVES 127 // Maximum is one for every MIDI key struct IIgsInstrumentHeader { - IIgsEnvelope env; - uint8 relseg; - uint8 bendrange; - uint8 vibdepth; - uint8 vibspeed; - IIgsOscillatorList oscList; + struct { + frac_t bp; ///< Envelope segment breakpoint + frac_t inc; ///< Envelope segment velocity + } env[ENVELOPE_SEGMENT_COUNT]; + uint8 seg; ///< Envelope release segment + uint8 bend; ///< Maximum range for pitch bend + uint8 vibDepth; ///< Vibrato depth + uint8 vibSpeed; ///< Vibrato speed + uint8 waveCount[2]; ///< Wave count for both generators + struct { + uint8 key; ///< Highest MIDI key to use this wave + int offset; ///< Offset of wave data, relative to base + uint size; ///< Wave size + bool halt; ///< Oscillator halted? + bool loop; ///< Loop mode? + bool swap; ///< Swap mode? + bool chn; ///< Output channel (left / right) + int16 tune; ///< Fine tune in semitones (8.8 fixed point) + } wave[2][MAX_OSCILLATOR_WAVES]; + + int8* base; ///< Base of wave data /** * Read an Apple IIGS instrument header from the given stream. @@ -143,7 +98,7 @@ struct IIgsInstrumentHeader { * @return True if successful, false otherwise. */ bool read(Common::SeekableReadStream &stream, bool ignoreAddr = false); - bool finalize(Common::SeekableReadStream &uint8Wave); + bool finalize(int8 *); }; struct IIgsSampleHeader { @@ -162,33 +117,29 @@ struct IIgsSampleHeader { * @return True if successful, false otherwise. */ bool read(Common::SeekableReadStream &stream); - bool finalize(Common::SeekableReadStream &uint8Wave); + bool finalize(int8 *sample); }; -struct IIgsChannelInfo { - const IIgsInstrumentHeader *ins; ///< Instrument info - const int8 *relocatedSample; ///< Source sample data (8-bit signed format) using relocation - const int8 *unrelocatedSample; ///< Source sample data (8-bit signed format) without relocation - frac_t pos; ///< Current sample position - frac_t posAdd; ///< Current sample position adder (Calculated using note, vibrato etc) - uint8 origNote; ///< The original note without the added relative pitch - frac_t note; ///< Note (With the added relative pitch) - frac_t vol; ///< Current volume (Takes both channel volume and enveloping into account) - frac_t chanVol; ///< Channel volume - frac_t startEnvVol; ///< Starting envelope volume - frac_t envVol; ///< Current envelope volume - uint envSeg; ///< Current envelope segment - uint size; ///< Sample size - bool loop; ///< Should we loop the sample? - bool end; ///< Has the playing ended? +class IIgsGenerator { +public: + IIgsGenerator() : ins(NULL), key(-1), chn(-1) {} - void rewind(); ///< Rewinds the sound playing on this channel to its start - void setChannelVolume(uint8 volume); ///< Sets the channel volume - void setInstrument(const IIgsInstrumentHeader *instrument, const int8 *sample); ///< Sets the instrument to be used on this channel - void noteOn(uint8 noteParam, uint8 velocity); ///< Starts playing a note on this channel - void noteOff(uint8 velocity); ///< Releases the note on this channel - void stop(); ///< Stops the note playing on this channel instantly - bool playing(); ///< Is there a note playing on this channel? + const IIgsInstrumentHeader *ins; ///< Currently used instrument + int key; ///< MIDI key + int vel; ///< MIDI velocity (& channel volume) + int chn; ///< MIDI channel + struct { + int8 *base; ///< Sample base pointer + uint size; ///< Sample size + frac_t p; ///< Sample pointer + frac_t pd; ///< Sample pointer delta + bool halt; ///< Is oscillator halted? + bool loop; ///< Is looping enabled? + bool swap; ///< Is swapping enabled? + bool chn; ///< Output channel (left / right) + } osc[2]; + int seg; ///< Current envelope segment + frac_t a; ///< Current envelope amplitude }; class IIgsMidi : public AgiSound { @@ -198,15 +149,14 @@ public: virtual uint16 type() { return _type; } virtual const uint8 *getPtr() { return _ptr; } virtual void setPtr(const uint8 *ptr) { _ptr = ptr; } - virtual void rewind() { _ptr = _data + 2; _midiTicks = _soundBufTicks = 0; } + virtual void rewind() { _ptr = _data + 2; _ticks = 0; } protected: uint8 *_data; ///< Raw sound resource data const uint8 *_ptr; ///< Pointer to the current position in the MIDI data uint32 _len; ///< Length of the raw sound resource uint16 _type; ///< Sound resource type public: - uint _midiTicks; ///< MIDI song position in ticks (1/60ths of a second) - uint _soundBufTicks; ///< Sound buffer position in ticks (1/60ths of a second) + uint _ticks; ///< MIDI song position in ticks (1/60ths of a second) }; class IIgsSample : public AgiSound { @@ -217,12 +167,12 @@ public: const IIgsSampleHeader &getHeader() const { return _header; } const int8 *getSample() const { return _sample; } protected: - IIgsSampleHeader _header; ///< Apple IIGS AGI sample header - int8 *_sample; ///< Sample data (8-bit signed format) + IIgsSampleHeader _header; ///< Apple IIGS AGI sample header + int8 *_sample; ///< Sample data (8-bit signed format) }; /** Apple IIGS MIDI program change to instrument number mapping. */ -struct MidiProgramChangeMapping { +struct IIgsMidiProgramMapping { byte midiProgToInst[44]; ///< Lookup table for the MIDI program number to instrument number mapping byte undefinedInst; ///< The undefined instrument number @@ -233,42 +183,34 @@ struct MidiProgramChangeMapping { }; /** Apple IIGS AGI instrument set information. */ -struct InstrumentSetInfo { - uint byteCount; ///< Length of the whole instrument set in bytes - uint instCount; ///< Amount of instrument in the set - const char *md5; ///< MD5 hex digest of the whole instrument set +struct IIgsInstrumentSetInfo { + uint byteCount; ///< Length of the whole instrument set in bytes + uint instCount; ///< Amount of instrument in the set + const char *md5; ///< MD5 hex digest of the whole instrument set const char *waveFileMd5; ///< MD5 hex digest of the wave file (i.e. the sample data used by the instruments) - const MidiProgramChangeMapping *progToInst; ///< Program change to instrument number mapping + const IIgsMidiProgramMapping *progToInst; ///< Program change to instrument number mapping }; /** Apple IIGS AGI executable file information. */ struct IIgsExeInfo { - enum AgiGameID gameid; ///< Game ID - const char *exePrefix; ///< Prefix of the Apple IIGS AGI executable (e.g. "SQ", "PQ", "KQ4" etc) - uint agiVer; ///< Apple IIGS AGI version number, not strictly needed - uint exeSize; ///< Size of the Apple IIGS AGI executable file in bytes - uint instSetStart; ///< Starting offset of the instrument set inside the executable file - const InstrumentSetInfo *instSet; ///< Information about the used instrument set + enum AgiGameID gameid; ///< Game ID + const char *exePrefix; ///< Prefix of the Apple IIGS AGI executable (e.g. "SQ", "PQ", "KQ4" etc) + uint agiVer; ///< Apple IIGS AGI version number, not strictly needed + uint exeSize; ///< Size of the Apple IIGS AGI executable file in bytes + uint instSetStart; ///< Starting offset of the instrument set inside the executable file + const IIgsInstrumentSetInfo *instSet; ///< Information about the used instrument set }; class IIgsMidiChannel { public: - IIgsMidiChannel() : _instrument(0), _sample(0), _volume(0) {} - uint activeSounds() const; ///< How many active sounds are playing? - void setInstrument(const IIgsInstrumentHeader *instrument, const int8 *sample); - void setVolume(uint8 volume); - void noteOff(uint8 note, uint8 velocity); - void noteOn(uint8 note, uint8 velocity); - void stopSounds(); ///< Clears the channel of any sounds - void removeStoppedSounds(); ///< Removes all stopped sounds from this MIDI channel -public: - typedef Common::Array::const_iterator const_iterator; - typedef Common::Array::iterator iterator; - Common::Array _gsChannels; ///< Apple IIGS channels playing on this MIDI channel -protected: + IIgsMidiChannel() : _instrument(NULL), _volume(127) {} + void setInstrument(const IIgsInstrumentHeader *instrument) { _instrument = instrument; } + const IIgsInstrumentHeader* getInstrument() { return _instrument; } + void setVolume(int volume) { _volume = volume; } + int getVolume() { return _volume; } +private: const IIgsInstrumentHeader *_instrument; ///< Instrument used on this MIDI channel - const int8 *_sample; ///< Sample data used on this MIDI channel - uint8 _volume; ///< MIDI controller number 7 (Volume) + int _volume; ///< MIDI controller number 7 (Volume) }; class SoundGen2GS : public SoundGen, public Audio::AudioStream { @@ -279,73 +221,50 @@ public: void play(int resnum); void stop(void); - // AudioStream API int readBuffer(int16 *buffer, const int numSamples); - bool isStereo() const { - return false; - } - - bool endOfData() const { - return false; - } - - int getRate() const { - // FIXME: Ideally, we should use _sampleRate. - return 22050; - } + bool isStereo() const { return true; } + bool endOfData() const { return false; } + int getRate() const { return _sampleRate; } private: - bool _disabledMidi; - int _playingSound; - bool _playing; - - int16 *_sndBuffer; - -/** - * Class for managing Apple IIGS sound channels. - * TODO: Check what instruments are used by default on the MIDI channels - * FIXME: Some instrument choices sound wrong - */ -private: - typedef Common::Array::const_iterator const_iterator; - typedef Common::Array::iterator iterator; - static const uint kSfxMidiChannel = 0; ///< The MIDI channel used for playing sound effects - + // Loader methods bool loadInstruments(); + bool loadInstrumentHeaders(Common::String &exePath, const IIgsExeInfo &exeInfo); + bool loadWaveFile(Common::String &wavePath, const IIgsExeInfo &exeInfo); + const IIgsExeInfo *getIIgsExeInfo(enum AgiGameID gameid) const; + void setProgramChangeMapping(const IIgsMidiProgramMapping *mapping); - void setProgramChangeMapping(const MidiProgramChangeMapping *mapping); - bool loadInstrumentHeaders(const Common::FSNode &exePath, const IIgsExeInfo &exeInfo); - bool loadWaveFile(const Common::FSNode &wavePath, const IIgsExeInfo &exeInfo); + // Player methods + void advancePlayer(); ///< Advance the player + void advanceMidiPlayer(); ///< Advance MIDI player + uint generateOutput(); ///< Fill the output buffer - // Miscellaneous methods - void fillAudio(int16 *stream, uint len); - uint32 mixSound(); - void playSound(); - uint activeSounds() const; ///< How many active sounds are playing? - void stopSounds(); ///< Stops all sounds - void removeStoppedSounds(); ///< Removes all stopped sounds from the MIDI channels + void haltGenerators(); ///< Halt all generators + uint activeGenerators(); ///< How many generators are active? - // For playing Apple IIGS AGI samples (Sound effects etc) - bool playSampleSound(const IIgsSampleHeader &sampleHeader, const int8 *sample); - void playMidiSound(); - void playSampleSound(); + void midiNoteOff(int channel, int note, int velocity); + void midiNoteOn(int channel, int note, int velocity); + double midiKeyToFreq(int key, double finetune); + IIgsInstrumentHeader* getInstrument(uint8 program) { return &_instruments[_progToInst->map(program)]; }; + IIgsGenerator* allocateGenerator() { IIgsGenerator* g = &_generators[_nextGen++]; _nextGen %= 16; return g; } - // MIDI commands - void midiNoteOff(uint8 channel, uint8 note, uint8 velocity); - void midiNoteOn(uint8 channel, uint8 note, uint8 velocity); - void midiController(uint8 channel, uint8 controller, uint8 value); - void midiProgramChange(uint8 channel, uint8 program); - void midiPitchWheel(uint8 wheelPos); - //protected: - const IIgsInstrumentHeader* getInstrument(uint8 program) const; - //public: - Common::Array _midiChannels; ///< Information about each MIDI channel - //protected: - Common::Array _wave; ///< Sample data used by the Apple IIGS MIDI instruments - const MidiProgramChangeMapping *_midiProgToInst; ///< MIDI program change to instrument number mapping - Common::Array _instruments; ///< Instruments used by the Apple IIGS AGI + bool _disableMidi; ///< Disable MIDI if loading instruments fail + int _playingSound; ///< Resource number for the currently playing sound + bool _playing; ///< True when the resource is still playing + + IIgsGenerator _generators[MAX_GENERATORS]; ///< IIGS sound generators that are used to play single notes + uint _nextGen; ///< Next generator available for allocation + IIgsMidiChannel _channels[16]; ///< MIDI channels + Common::Array _instruments; ///< Instrument data + const IIgsMidiProgramMapping *_progToInst; ///< MIDI program number to instrument mapping + int8 *_wavetable; ///< Sample data used by the instruments + uint _ticks; ///< MIDI ticks (60Hz) + int16 *_out; ///< Output buffer + uint _outSize; ///< Output buffer size + + static const int kSfxMidiChannel = 15; ///< MIDI channel used for playing sample resources }; } // End of namespace Agi diff --git a/engines/agi/sound_coco3.cpp b/engines/agi/sound_coco3.cpp index 858c1c8515d..281f2cb2d40 100644 --- a/engines/agi/sound_coco3.cpp +++ b/engines/agi/sound_coco3.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/sound_coco3.h b/engines/agi/sound_coco3.h index a1cc2718710..7058b770f58 100644 --- a/engines/agi/sound_coco3.h +++ b/engines/agi/sound_coco3.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_SOUND_COCO3_H diff --git a/engines/agi/sound_midi.cpp b/engines/agi/sound_midi.cpp index 997c1edd6bf..d2c99171e29 100644 --- a/engines/agi/sound_midi.cpp +++ b/engines/agi/sound_midi.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Code is based on: diff --git a/engines/agi/sound_midi.h b/engines/agi/sound_midi.h index 5733358feef..92a40024982 100644 --- a/engines/agi/sound_midi.h +++ b/engines/agi/sound_midi.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Music class diff --git a/engines/agi/sound_pcjr.cpp b/engines/agi/sound_pcjr.cpp index 35c960d2606..319b7049ed6 100644 --- a/engines/agi/sound_pcjr.cpp +++ b/engines/agi/sound_pcjr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* Heavily based on code from NAGI diff --git a/engines/agi/sound_pcjr.h b/engines/agi/sound_pcjr.h index 3aad29d2ce3..f50fd0aa82c 100644 --- a/engines/agi/sound_pcjr.h +++ b/engines/agi/sound_pcjr.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_SOUND_PCJR_H diff --git a/engines/agi/sound_sarien.cpp b/engines/agi/sound_sarien.cpp index 6f2f3c5ad36..fc9a57791c7 100644 --- a/engines/agi/sound_sarien.cpp +++ b/engines/agi/sound_sarien.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/random.h" diff --git a/engines/agi/sound_sarien.h b/engines/agi/sound_sarien.h index cea396255c7..22bfff3395a 100644 --- a/engines/agi/sound_sarien.h +++ b/engines/agi/sound_sarien.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_SOUND_SARIEN_H diff --git a/engines/agi/sprite.cpp b/engines/agi/sprite.cpp index e2b74e87bb7..ea0b07f4daa 100644 --- a/engines/agi/sprite.cpp +++ b/engines/agi/sprite.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/sprite.h b/engines/agi/sprite.h index 57fd0dacf2f..68f0e32b865 100644 --- a/engines/agi/sprite.h +++ b/engines/agi/sprite.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_SPRITE_H diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp index f85c4c1cddd..fedfd293626 100644 --- a/engines/agi/text.cpp +++ b/engines/agi/text.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" @@ -92,8 +89,11 @@ void AgiEngine::printText2(int l, const char *msg, int foff, int xoff, int yoff, x1++; // DF: changed the len-1 to len... - if (x1 == len && m[len] != '\n') - y1++, x1 = foff = 0; + // FIXME: m[len] doesn't make sense and may read out of bounds? + if (x1 == len && m[len] != '\n') { + y1++; + x1 = foff = 0; + } } else { y1++; x1 = foff = 0; diff --git a/engines/agi/view.cpp b/engines/agi/view.cpp index fcca1e2a791..0d420caa812 100644 --- a/engines/agi/view.cpp +++ b/engines/agi/view.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/view.h b/engines/agi/view.h index 85f2d6eaf95..0ef443f8e55 100644 --- a/engines/agi/view.h +++ b/engines/agi/view.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_VIEW_H diff --git a/engines/agi/wagparser.cpp b/engines/agi/wagparser.cpp index fab3b5cf504..14159c0147e 100644 --- a/engines/agi/wagparser.cpp +++ b/engines/agi/wagparser.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/agi/wagparser.h b/engines/agi/wagparser.h index c16d4092e75..81cfecef1bc 100644 --- a/engines/agi/wagparser.h +++ b/engines/agi/wagparser.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ namespace Agi { diff --git a/engines/agi/words.cpp b/engines/agi/words.cpp index d8596dec977..4b96fdf7110 100644 --- a/engines/agi/words.cpp +++ b/engines/agi/words.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // @@ -40,7 +37,7 @@ static uint32 wordsFlen; // length of word memory // Local implementation to avoid problems with strndup() used by // gcc 3.2 Cygwin (see #635984) // -static char *myStrndup(char *src, int n) { +static char *myStrndup(const char *src, int n) { char *tmp = strncpy((char *)malloc(n + 1), src, n); tmp[n] = 0; return tmp; @@ -89,11 +86,11 @@ void AgiEngine::unloadWords() { * * Thomas Akesson, November 2001 */ -int AgiEngine::findWord(char *word, int *flen) { +int AgiEngine::findWord(const char *word, int *flen) { int mchr = 0; // matched chars int len, fchr, id = -1; - uint8 *p = words; - uint8 *q = words + wordsFlen; + const uint8 *p = words; + const uint8 *q = words + wordsFlen; *flen = 0; debugC(2, kDebugLevelScripts, "find_word(%s)", word); diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp index 56501b5294e..4d879909c43 100644 --- a/engines/agos/agos.cpp +++ b/engines/agos/agos.cpp @@ -18,13 +18,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" -#include "common/EventRecorder.h" #include "common/file.h" #include "common/fs.h" #include "common/textconsole.h" @@ -60,8 +56,8 @@ static const GameSpecificSettings puzzlepack_settings = { }; #ifdef ENABLE_AGOS2 -AGOSEngine_DIMP::AGOSEngine_DIMP(OSystem *system) - : AGOSEngine_PuzzlePack(system) { +AGOSEngine_DIMP::AGOSEngine_DIMP(OSystem *system, const AGOSGameDescription *gd) + : AGOSEngine_PuzzlePack(system, gd) { _iconToggleCount = 0; _voiceCount = 0; @@ -71,24 +67,24 @@ AGOSEngine_DIMP::AGOSEngine_DIMP(OSystem *system) _tSecondCount = 0; } -AGOSEngine_PuzzlePack::AGOSEngine_PuzzlePack(OSystem *system) - : AGOSEngine_Feeble(system) { +AGOSEngine_PuzzlePack::AGOSEngine_PuzzlePack(OSystem *system, const AGOSGameDescription *gd) + : AGOSEngine_Feeble(system, gd) { _oopsValid = false; _gameTime = 0; } #endif -AGOSEngine_Simon2::AGOSEngine_Simon2(OSystem *system) - : AGOSEngine_Simon1(system) { +AGOSEngine_Simon2::AGOSEngine_Simon2(OSystem *system, const AGOSGameDescription *gd) + : AGOSEngine_Simon1(system, gd) { } -AGOSEngine_Simon1::AGOSEngine_Simon1(OSystem *system) - : AGOSEngine_Waxworks(system) { +AGOSEngine_Simon1::AGOSEngine_Simon1(OSystem *system, const AGOSGameDescription *gd) + : AGOSEngine_Waxworks(system, gd) { } -AGOSEngine_Waxworks::AGOSEngine_Waxworks(OSystem *system) - : AGOSEngine_Elvira2(system) { +AGOSEngine_Waxworks::AGOSEngine_Waxworks(OSystem *system, const AGOSGameDescription *gd) + : AGOSEngine_Elvira2(system, gd) { _boxCR = false; _boxLineCount = 0; @@ -104,16 +100,16 @@ AGOSEngine_Waxworks::AGOSEngine_Waxworks(OSystem *system) memset(_lineCounts, 0, sizeof(_lineCounts)); } -AGOSEngine_Elvira2::AGOSEngine_Elvira2(OSystem *system) - : AGOSEngine_Elvira1(system) { +AGOSEngine_Elvira2::AGOSEngine_Elvira2(OSystem *system, const AGOSGameDescription *gd) + : AGOSEngine_Elvira1(system, gd) { } -AGOSEngine_Elvira1::AGOSEngine_Elvira1(OSystem *system) - : AGOSEngine(system) { +AGOSEngine_Elvira1::AGOSEngine_Elvira1(OSystem *system, const AGOSGameDescription *gd) + : AGOSEngine(system, gd) { } -AGOSEngine::AGOSEngine(OSystem *syst) - : Engine(syst) { +AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd) + : Engine(system), _rnd("agos"), _gameDescription(gd) { _vcPtr = 0; _vcGetOutOfCode = 0; @@ -529,8 +525,6 @@ AGOSEngine::AGOSEngine(OSystem *syst) SearchMan.addSubDirectoryMatching(gameDataDir, "movies"); SearchMan.addSubDirectoryMatching(gameDataDir, "sfx"); SearchMan.addSubDirectoryMatching(gameDataDir, "speech"); - - g_eventRec.registerRandomSource(_rnd, "agos"); } Common::Error AGOSEngine::init() { diff --git a/engines/agos/agos.h b/engines/agos/agos.h index aecf2437a78..aa68a05eeee 100644 --- a/engines/agos/agos.h +++ b/engines/agos/agos.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGOS_AGOS_H @@ -179,6 +176,7 @@ class Debugger; #endif class AGOSEngine : public Engine { +protected: friend class Debugger; // Engine APIs @@ -196,7 +194,6 @@ class AGOSEngine : public Engine { virtual void syncSoundSettings(); virtual void pauseEngineIntern(bool pause); -public: virtual void setupOpcodes(); uint16 _numOpcodes, _opcode; @@ -208,8 +205,9 @@ public: virtual void setupVideoOpcodes(VgaOpcodeProc *op); - const AGOSGameDescription *_gameDescription; + const AGOSGameDescription * const _gameDescription; +public: virtual void setupGame(); int getGameId() const; @@ -587,7 +585,7 @@ protected: byte _hebrewCharWidths[32]; public: - AGOSEngine(OSystem *syst); + AGOSEngine(OSystem *system, const AGOSGameDescription *gd); virtual ~AGOSEngine(); byte *_curSfxFile; @@ -1284,7 +1282,7 @@ class AGOSEngine_PN : public AGOSEngine { void setupBoxes(); int readfromline(); public: - AGOSEngine_PN(OSystem *system); + AGOSEngine_PN(OSystem *system, const AGOSGameDescription *gd); ~AGOSEngine_PN(); virtual void setupGame(); @@ -1526,7 +1524,7 @@ protected: class AGOSEngine_Elvira1 : public AGOSEngine { public: - AGOSEngine_Elvira1(OSystem *system); + AGOSEngine_Elvira1(OSystem *system, const AGOSGameDescription *gd); //~AGOSEngine_Elvira1(); virtual void setupGame(); @@ -1607,7 +1605,7 @@ protected: class AGOSEngine_Elvira2 : public AGOSEngine_Elvira1 { public: - AGOSEngine_Elvira2(OSystem *system); + AGOSEngine_Elvira2(OSystem *system, const AGOSGameDescription *gd); //~AGOSEngine_Elvira2(); virtual void setupGame(); @@ -1702,7 +1700,7 @@ protected: class AGOSEngine_Waxworks : public AGOSEngine_Elvira2 { public: - AGOSEngine_Waxworks(OSystem *system); + AGOSEngine_Waxworks(OSystem *system, const AGOSGameDescription *gd); //~AGOSEngine_Waxworks(); virtual void setupGame(); @@ -1769,7 +1767,7 @@ protected: class AGOSEngine_Simon1 : public AGOSEngine_Waxworks { public: - AGOSEngine_Simon1(OSystem *system); + AGOSEngine_Simon1(OSystem *system, const AGOSGameDescription *gd); //~AGOSEngine_Simon1(); virtual void setupGame(); @@ -1840,7 +1838,7 @@ protected: class AGOSEngine_Simon2 : public AGOSEngine_Simon1 { public: - AGOSEngine_Simon2(OSystem *system); + AGOSEngine_Simon2(OSystem *system, const AGOSGameDescription *gd); //~AGOSEngine_Simon2(); virtual void setupGame(); @@ -1887,7 +1885,7 @@ protected: #ifdef ENABLE_AGOS2 class AGOSEngine_Feeble : public AGOSEngine_Simon2 { public: - AGOSEngine_Feeble(OSystem *system); + AGOSEngine_Feeble(OSystem *system, const AGOSGameDescription *gd); ~AGOSEngine_Feeble(); virtual void setupGame(); @@ -2026,7 +2024,7 @@ protected: class AGOSEngine_FeebleDemo : public AGOSEngine_Feeble { public: - AGOSEngine_FeebleDemo(OSystem *system); + AGOSEngine_FeebleDemo(OSystem *system, const AGOSGameDescription *gd); protected: bool _filmMenuUsed; @@ -2047,7 +2045,7 @@ protected: class AGOSEngine_PuzzlePack : public AGOSEngine_Feeble { public: - AGOSEngine_PuzzlePack(OSystem *system); + AGOSEngine_PuzzlePack(OSystem *system, const AGOSGameDescription *gd); //~AGOSEngine_PuzzlePack(); virtual void setupGame(); @@ -2106,7 +2104,7 @@ protected: class AGOSEngine_DIMP : public AGOSEngine_PuzzlePack { public: - AGOSEngine_DIMP(OSystem *system); + AGOSEngine_DIMP(OSystem *system, const AGOSGameDescription *gd); //~AGOSEngine_DIMP(); virtual void setupOpcodes(); diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp index ee47f62a583..eb78ca3d9b8 100644 --- a/engines/agos/animation.cpp +++ b/engines/agos/animation.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/animation.h b/engines/agos/animation.h index 77b02ffd13e..e1d72072510 100644 --- a/engines/agos/animation.h +++ b/engines/agos/animation.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_AGOS2 diff --git a/engines/agos/charset-fontdata.cpp b/engines/agos/charset-fontdata.cpp index a131bb841bf..b708b4890be 100644 --- a/engines/agos/charset-fontdata.cpp +++ b/engines/agos/charset-fontdata.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/charset.cpp b/engines/agos/charset.cpp index 5e9279c4910..9d27afaa271 100644 --- a/engines/agos/charset.cpp +++ b/engines/agos/charset.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/contain.cpp b/engines/agos/contain.cpp index 932557e798e..ba60c65ff3f 100644 --- a/engines/agos/contain.cpp +++ b/engines/agos/contain.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/cursor.cpp b/engines/agos/cursor.cpp index cf42fe1f360..ef4a1406c94 100644 --- a/engines/agos/cursor.cpp +++ b/engines/agos/cursor.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/debug.cpp b/engines/agos/debug.cpp index bb27557a6b6..9c44342975d 100644 --- a/engines/agos/debug.cpp +++ b/engines/agos/debug.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // AGOS debug functions diff --git a/engines/agos/debug.h b/engines/agos/debug.h index 5865065ac3a..fd5908997fb 100644 --- a/engines/agos/debug.h +++ b/engines/agos/debug.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGOS_DEBUG_H diff --git a/engines/agos/debugger.cpp b/engines/agos/debugger.cpp index 5f46a9bc93e..a313dbbd1e9 100644 --- a/engines/agos/debugger.cpp +++ b/engines/agos/debugger.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/debugger.h b/engines/agos/debugger.h index 43c04c67c20..0ab992ebbe9 100644 --- a/engines/agos/debugger.h +++ b/engines/agos/debugger.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGOS_DEBUGGER_H diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp index c8c70c0ecc3..629a5d63fcc 100644 --- a/engines/agos/detection.cpp +++ b/engines/agos/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -151,44 +148,41 @@ bool AgosMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGame switch (gd->gameType) { case AGOS::GType_PN: - *engine = new AGOS::AGOSEngine_PN(syst); + *engine = new AGOS::AGOSEngine_PN(syst, gd); break; case AGOS::GType_ELVIRA1: - *engine = new AGOS::AGOSEngine_Elvira1(syst); + *engine = new AGOS::AGOSEngine_Elvira1(syst, gd); break; case AGOS::GType_ELVIRA2: - *engine = new AGOS::AGOSEngine_Elvira2(syst); + *engine = new AGOS::AGOSEngine_Elvira2(syst, gd); break; case AGOS::GType_WW: - *engine = new AGOS::AGOSEngine_Waxworks(syst); + *engine = new AGOS::AGOSEngine_Waxworks(syst, gd); break; case AGOS::GType_SIMON1: - *engine = new AGOS::AGOSEngine_Simon1(syst); + *engine = new AGOS::AGOSEngine_Simon1(syst, gd); break; case AGOS::GType_SIMON2: - *engine = new AGOS::AGOSEngine_Simon2(syst); + *engine = new AGOS::AGOSEngine_Simon2(syst, gd); break; #ifdef ENABLE_AGOS2 case AGOS::GType_FF: if (gd->features & GF_DEMO) - *engine = new AGOS::AGOSEngine_FeebleDemo(syst); + *engine = new AGOS::AGOSEngine_FeebleDemo(syst, gd); else - *engine = new AGOS::AGOSEngine_Feeble(syst); + *engine = new AGOS::AGOSEngine_Feeble(syst, gd); break; case AGOS::GType_PP: if (gd->gameId == GID_DIMP) - *engine = new AGOS::AGOSEngine_DIMP(syst); + *engine = new AGOS::AGOSEngine_DIMP(syst, gd); else - *engine = new AGOS::AGOSEngine_PuzzlePack(syst); + *engine = new AGOS::AGOSEngine_PuzzlePack(syst, gd); break; #endif default: res = false; error("AGOS engine: unknown gameType"); } - if (res) { - ((AGOS::AGOSEngine *)*engine)->_gameDescription = gd; - } return res; } diff --git a/engines/agos/detection_tables.h b/engines/agos/detection_tables.h index 963c08849ce..a43d5811738 100644 --- a/engines/agos/detection_tables.h +++ b/engines/agos/detection_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ namespace AGOS { diff --git a/engines/agos/draw.cpp b/engines/agos/draw.cpp index 6b9f65ee2bc..4d66b56a96e 100644 --- a/engines/agos/draw.cpp +++ b/engines/agos/draw.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/event.cpp b/engines/agos/event.cpp index 8799dbaa281..3411e6d6322 100644 --- a/engines/agos/event.cpp +++ b/engines/agos/event.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/feeble.cpp b/engines/agos/feeble.cpp index 843298c6d76..4c82b7e19da 100644 --- a/engines/agos/feeble.cpp +++ b/engines/agos/feeble.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -35,8 +32,8 @@ namespace AGOS { -AGOSEngine_Feeble::AGOSEngine_Feeble(OSystem *system) - : AGOSEngine_Simon2(system) { +AGOSEngine_Feeble::AGOSEngine_Feeble(OSystem *system, const AGOSGameDescription *gd) + : AGOSEngine_Simon2(system, gd) { _interactiveVideo = 0; _moviePlayer = 0; @@ -111,8 +108,8 @@ void AGOSEngine_Feeble::stopInteractiveVideo() { } } -AGOSEngine_FeebleDemo::AGOSEngine_FeebleDemo(OSystem *system) - : AGOSEngine_Feeble(system) { +AGOSEngine_FeebleDemo::AGOSEngine_FeebleDemo(OSystem *system, const AGOSGameDescription *gd) + : AGOSEngine_Feeble(system, gd) { _filmMenuUsed = 0; } diff --git a/engines/agos/gfx.cpp b/engines/agos/gfx.cpp index 4c998dfa5f9..0b045bae012 100644 --- a/engines/agos/gfx.cpp +++ b/engines/agos/gfx.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/icons.cpp b/engines/agos/icons.cpp index 39a7705c542..ead4e49ebb9 100644 --- a/engines/agos/icons.cpp +++ b/engines/agos/icons.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/input.cpp b/engines/agos/input.cpp index 1246149aa57..2ab543a943a 100644 --- a/engines/agos/input.cpp +++ b/engines/agos/input.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/input_pn.cpp b/engines/agos/input_pn.cpp index 9c35fbb3a25..9cc97ff10fb 100644 --- a/engines/agos/input_pn.cpp +++ b/engines/agos/input_pn.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/intern.h b/engines/agos/intern.h index 2f5fc6278f8..18f56be4a46 100644 --- a/engines/agos/intern.h +++ b/engines/agos/intern.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGOS_INTERN_H diff --git a/engines/agos/items.cpp b/engines/agos/items.cpp index 5d1523bbd55..0fb873a7339 100644 --- a/engines/agos/items.cpp +++ b/engines/agos/items.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/menus.cpp b/engines/agos/menus.cpp index 2b103a75cb0..4d62e348209 100644 --- a/engines/agos/menus.cpp +++ b/engines/agos/menus.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/midi.cpp b/engines/agos/midi.cpp index 26e2f2c736d..88f6dd80d18 100644 --- a/engines/agos/midi.cpp +++ b/engines/agos/midi.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -153,7 +150,7 @@ void MidiPlayer::send(uint32 b) { // We have received a "Reset All Controllers" message // and passed it on to the MIDI driver. This may or may // not have affected the volume controller. To ensure - // consistent behaviour, explicitly set the volume to + // consistent behavior, explicitly set the volume to // what we think it should be. if (_current == &_sfx) diff --git a/engines/agos/midi.h b/engines/agos/midi.h index 40f54dbaf06..635e091906d 100644 --- a/engines/agos/midi.h +++ b/engines/agos/midi.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGOS_MIDI_H diff --git a/engines/agos/midiparser_s1d.cpp b/engines/agos/midiparser_s1d.cpp index f96518b5e96..01690247f0b 100644 --- a/engines/agos/midiparser_s1d.cpp +++ b/engines/agos/midiparser_s1d.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/agos/oracle.cpp b/engines/agos/oracle.cpp index 8ff79965e4d..2a3c668c085 100644 --- a/engines/agos/oracle.cpp +++ b/engines/agos/oracle.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/pn.cpp b/engines/agos/pn.cpp index 62d65de2194..667a5c3fc87 100644 --- a/engines/agos/pn.cpp +++ b/engines/agos/pn.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -30,8 +27,8 @@ namespace AGOS { -AGOSEngine_PN::AGOSEngine_PN(OSystem *system) - : AGOSEngine(system) { +AGOSEngine_PN::AGOSEngine_PN(OSystem *system, const AGOSGameDescription *gd) + : AGOSEngine(system, gd) { _stackbase = 0; _tagOfActiveDoline = 0; diff --git a/engines/agos/res.cpp b/engines/agos/res.cpp index 0e818963e2e..a71d4d81509 100644 --- a/engines/agos/res.cpp +++ b/engines/agos/res.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Resource file routines for Simon1/Simon2 diff --git a/engines/agos/res_ami.cpp b/engines/agos/res_ami.cpp index 35432e1cc41..b83d10364af 100644 --- a/engines/agos/res_ami.cpp +++ b/engines/agos/res_ami.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Conversion routines for planar graphics in Amiga versions diff --git a/engines/agos/res_snd.cpp b/engines/agos/res_snd.cpp index 34deff37ab9..819af4fa402 100644 --- a/engines/agos/res_snd.cpp +++ b/engines/agos/res_snd.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/engines/agos/rooms.cpp b/engines/agos/rooms.cpp index 0993197594c..f2629e419e8 100644 --- a/engines/agos/rooms.cpp +++ b/engines/agos/rooms.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp index d6f25814bb3..e6cce36b229 100644 --- a/engines/agos/saveload.cpp +++ b/engines/agos/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" @@ -38,7 +35,7 @@ namespace AGOS { int AGOSEngine::countSaveGames() { - Common::InSaveFile *f; + Common::InSaveFile *f = NULL; Common::StringArray filenames; uint i = 1; char slot[4]; diff --git a/engines/agos/script.cpp b/engines/agos/script.cpp index 94a3f371cc8..68a90e405bb 100644 --- a/engines/agos/script.cpp +++ b/engines/agos/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Item script opcodes for Simon1/Simon2 diff --git a/engines/agos/script_dp.cpp b/engines/agos/script_dp.cpp index 6eb3ca47791..a4ee249f47a 100644 --- a/engines/agos/script_dp.cpp +++ b/engines/agos/script_dp.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/script_e1.cpp b/engines/agos/script_e1.cpp index df37a38a7c6..c7a2f5b0a28 100644 --- a/engines/agos/script_e1.cpp +++ b/engines/agos/script_e1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/script_e2.cpp b/engines/agos/script_e2.cpp index f8af7db2141..79a7e89a89b 100644 --- a/engines/agos/script_e2.cpp +++ b/engines/agos/script_e2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/script_ff.cpp b/engines/agos/script_ff.cpp index 8dfee7f7c71..e2a4d0820ff 100644 --- a/engines/agos/script_ff.cpp +++ b/engines/agos/script_ff.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/script_pn.cpp b/engines/agos/script_pn.cpp index b8ba7fb015b..bde59b71b86 100644 --- a/engines/agos/script_pn.cpp +++ b/engines/agos/script_pn.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agos/agos.h" diff --git a/engines/agos/script_pp.cpp b/engines/agos/script_pp.cpp index 624a1bbebaf..0a599506b58 100644 --- a/engines/agos/script_pp.cpp +++ b/engines/agos/script_pp.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/script_s1.cpp b/engines/agos/script_s1.cpp index dab03026316..0e7e66778e4 100644 --- a/engines/agos/script_s1.cpp +++ b/engines/agos/script_s1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/script_s2.cpp b/engines/agos/script_s2.cpp index a0b14525f23..c646397ac3a 100644 --- a/engines/agos/script_s2.cpp +++ b/engines/agos/script_s2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/script_ww.cpp b/engines/agos/script_ww.cpp index 679c67df641..29a91a15aaf 100644 --- a/engines/agos/script_ww.cpp +++ b/engines/agos/script_ww.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/sound.cpp b/engines/agos/sound.cpp index 25d861acb5d..03932aa4dea 100644 --- a/engines/agos/sound.cpp +++ b/engines/agos/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/agos/sound.h b/engines/agos/sound.h index 9739cfb58f6..a7c4cd73db8 100644 --- a/engines/agos/sound.h +++ b/engines/agos/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGOS_SOUND_H diff --git a/engines/agos/string.cpp b/engines/agos/string.cpp index 1152d6ed04a..1cdd7f6d81e 100644 --- a/engines/agos/string.cpp +++ b/engines/agos/string.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/string_pn.cpp b/engines/agos/string_pn.cpp index 92d85ab96c8..570fbc6200f 100644 --- a/engines/agos/string_pn.cpp +++ b/engines/agos/string_pn.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agos/agos.h" @@ -134,7 +131,7 @@ void AGOSEngine_PN::pcf(uint8 ch) { if (ch == 255) { _bp = 0; _xofs = 0; - return; /* pcf(255) initialises the routine */ + return; /* pcf(255) initializes the routine */ } /* pcf(254) flushes its working _buffer */ if (ch != 254) { if ((ch != 32) || (_bp + _xofs != 50)) diff --git a/engines/agos/subroutine.cpp b/engines/agos/subroutine.cpp index bd07596a461..bd9abb16b51 100644 --- a/engines/agos/subroutine.cpp +++ b/engines/agos/subroutine.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/verb.cpp b/engines/agos/verb.cpp index b05bac1e571..abc45c1acec 100644 --- a/engines/agos/verb.cpp +++ b/engines/agos/verb.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Verb and hitarea handling diff --git a/engines/agos/verb_pn.cpp b/engines/agos/verb_pn.cpp index b36f634ec02..19e8bb2d482 100644 --- a/engines/agos/verb_pn.cpp +++ b/engines/agos/verb_pn.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Verb and hitarea handling diff --git a/engines/agos/vga.cpp b/engines/agos/vga.cpp index 6c07db13c11..de6a6976e5c 100644 --- a/engines/agos/vga.cpp +++ b/engines/agos/vga.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Video script opcodes for Simon1/Simon2 diff --git a/engines/agos/vga.h b/engines/agos/vga.h index 2a2056ca7bf..5a5764532e2 100644 --- a/engines/agos/vga.h +++ b/engines/agos/vga.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGOS_VGA_H diff --git a/engines/agos/vga_e2.cpp b/engines/agos/vga_e2.cpp index 9e163ba91f5..1bde6945f0b 100644 --- a/engines/agos/vga_e2.cpp +++ b/engines/agos/vga_e2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Video script opcodes for Simon1/Simon2 diff --git a/engines/agos/vga_ff.cpp b/engines/agos/vga_ff.cpp index 14a1c60ae53..c8c9673506d 100644 --- a/engines/agos/vga_ff.cpp +++ b/engines/agos/vga_ff.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/vga_pn.cpp b/engines/agos/vga_pn.cpp index d249259ba6d..3bd54005042 100644 --- a/engines/agos/vga_pn.cpp +++ b/engines/agos/vga_pn.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agos/agos.h" diff --git a/engines/agos/vga_s1.cpp b/engines/agos/vga_s1.cpp index a2306d3cdb9..ef05063fc17 100644 --- a/engines/agos/vga_s1.cpp +++ b/engines/agos/vga_s1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/vga_s2.cpp b/engines/agos/vga_s2.cpp index db3a7c18f37..1021ea8f948 100644 --- a/engines/agos/vga_s2.cpp +++ b/engines/agos/vga_s2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/vga_ww.cpp b/engines/agos/vga_ww.cpp index 08b2cee3039..c74f0cf52be 100644 --- a/engines/agos/vga_ww.cpp +++ b/engines/agos/vga_ww.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Video script opcodes for Simon1/Simon2 diff --git a/engines/agos/window.cpp b/engines/agos/window.cpp index 08680c9e458..c55e3dcdda1 100644 --- a/engines/agos/window.cpp +++ b/engines/agos/window.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/zones.cpp b/engines/agos/zones.cpp index d44192d4d26..61efbcb89a4 100644 --- a/engines/agos/zones.cpp +++ b/engines/agos/zones.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/cine/anim.cpp b/engines/cine/anim.cpp index 6b4b29dcfef..410fcca1f31 100644 --- a/engines/cine/anim.cpp +++ b/engines/cine/anim.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** \file diff --git a/engines/cine/anim.h b/engines/cine/anim.h index 2012ef875e4..9c06c260ced 100644 --- a/engines/cine/anim.h +++ b/engines/cine/anim.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_ANIM_H diff --git a/engines/cine/bg.cpp b/engines/cine/bg.cpp index 22fd28a99c8..2bad2183f58 100644 --- a/engines/cine/bg.cpp +++ b/engines/cine/bg.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/cine/bg.h b/engines/cine/bg.h index 9f97bc467d8..c464cd68be2 100644 --- a/engines/cine/bg.h +++ b/engines/cine/bg.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_BG_H diff --git a/engines/cine/bg_list.cpp b/engines/cine/bg_list.cpp index 3ecda4125d7..693fea3294c 100644 --- a/engines/cine/bg_list.cpp +++ b/engines/cine/bg_list.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/cine/bg_list.h b/engines/cine/bg_list.h index 8c1b3cb6ec4..c564b4b43f9 100644 --- a/engines/cine/bg_list.h +++ b/engines/cine/bg_list.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_BGLIST_H diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp index 8104ad38cd9..6f34b0f860e 100644 --- a/engines/cine/cine.cpp +++ b/engines/cine/cine.cpp @@ -18,12 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ -#include "common/EventRecorder.h" #include "common/config-manager.h" #include "common/debug-channels.h" @@ -45,7 +41,10 @@ Sound *g_sound = 0; CineEngine *g_cine = 0; -CineEngine::CineEngine(OSystem *syst, const CINEGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { +CineEngine::CineEngine(OSystem *syst, const CINEGameDescription *gameDesc) + : Engine(syst), + _gameDescription(gameDesc), + _rnd("cine") { // Setup mixer syncSoundSettings(); @@ -56,8 +55,6 @@ CineEngine::CineEngine(OSystem *syst, const CINEGameDescription *gameDesc) : Eng _console = new CineConsole(this); g_cine = this; - - g_eventRec.registerRandomSource(_rnd, "cine"); } CineEngine::~CineEngine() { diff --git a/engines/cine/cine.h b/engines/cine/cine.h index 7de0bdc86f3..371ea0dd1f9 100644 --- a/engines/cine/cine.h +++ b/engines/cine/cine.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_H diff --git a/engines/cine/console.cpp b/engines/cine/console.cpp index dbbeb4c9b76..0a24b2408a1 100644 --- a/engines/cine/console.cpp +++ b/engines/cine/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cine/console.h" diff --git a/engines/cine/console.h b/engines/cine/console.h index 92d059cb637..7c19621e5fa 100644 --- a/engines/cine/console.h +++ b/engines/cine/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_CONSOLE_H diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp index 058c1a1140e..0ef2c87288d 100644 --- a/engines/cine/detection.cpp +++ b/engines/cine/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -93,7 +90,7 @@ public: CineMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Cinematique evo 1 engine"; + return "Cine"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/cine/detection_tables.h b/engines/cine/detection_tables.h index 6e450ebc801..4b293deb626 100644 --- a/engines/cine/detection_tables.h +++ b/engines/cine/detection_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ namespace Cine { diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp index 18feacd08bb..01e05bed6db 100644 --- a/engines/cine/gfx.cpp +++ b/engines/cine/gfx.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cine/cine.h" diff --git a/engines/cine/gfx.h b/engines/cine/gfx.h index da7e3dd572a..737c49cc367 100644 --- a/engines/cine/gfx.h +++ b/engines/cine/gfx.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_GFX_H diff --git a/engines/cine/main_loop.cpp b/engines/cine/main_loop.cpp index 644744d3ed5..bb0545db728 100644 --- a/engines/cine/main_loop.cpp +++ b/engines/cine/main_loop.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/cine/main_loop.h b/engines/cine/main_loop.h index c729b324ca6..4ab29149d86 100644 --- a/engines/cine/main_loop.h +++ b/engines/cine/main_loop.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_MAINLOOP_H diff --git a/engines/cine/msg.cpp b/engines/cine/msg.cpp index 3d58d6ddcdc..b84982b19e2 100644 --- a/engines/cine/msg.cpp +++ b/engines/cine/msg.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/cine/msg.h b/engines/cine/msg.h index fbf99d4b442..8d6291e2df5 100644 --- a/engines/cine/msg.h +++ b/engines/cine/msg.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_MSG_H diff --git a/engines/cine/object.cpp b/engines/cine/object.cpp index d69ddc1271c..afd95c04b03 100644 --- a/engines/cine/object.cpp +++ b/engines/cine/object.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/cine/object.h b/engines/cine/object.h index 5a5ea91286c..8331cf9f890 100644 --- a/engines/cine/object.h +++ b/engines/cine/object.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_OBJECT_H diff --git a/engines/cine/pal.cpp b/engines/cine/pal.cpp index 0f52600db55..779c279ea1b 100644 --- a/engines/cine/pal.cpp +++ b/engines/cine/pal.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cine/cine.h" diff --git a/engines/cine/pal.h b/engines/cine/pal.h index 58d23e5bf07..d41154aa0b2 100644 --- a/engines/cine/pal.h +++ b/engines/cine/pal.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_PAL_H diff --git a/engines/cine/part.cpp b/engines/cine/part.cpp index 17ef01948ca..03cb743b469 100644 --- a/engines/cine/part.cpp +++ b/engines/cine/part.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/cine/part.h b/engines/cine/part.h index 53ebafaa375..3d321f17e1f 100644 --- a/engines/cine/part.h +++ b/engines/cine/part.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_PART_H diff --git a/engines/cine/prc.cpp b/engines/cine/prc.cpp index 183a5374162..d86107a8f8c 100644 --- a/engines/cine/prc.cpp +++ b/engines/cine/prc.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/cine/prc.h b/engines/cine/prc.h index 84058426fa1..ff0147d81ed 100644 --- a/engines/cine/prc.h +++ b/engines/cine/prc.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_PRC_H diff --git a/engines/cine/rel.cpp b/engines/cine/rel.cpp index 4a11995ee11..0af9a2bc1ff 100644 --- a/engines/cine/rel.cpp +++ b/engines/cine/rel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/cine/rel.h b/engines/cine/rel.h index 8d712dc416d..d102791f6bd 100644 --- a/engines/cine/rel.h +++ b/engines/cine/rel.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_REL_H diff --git a/engines/cine/saveload.cpp b/engines/cine/saveload.cpp index 1fc2a8b2fd8..700875e3027 100644 --- a/engines/cine/saveload.cpp +++ b/engines/cine/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/cine/saveload.h b/engines/cine/saveload.h index f88338ed820..49c9c0cef70 100644 --- a/engines/cine/saveload.h +++ b/engines/cine/saveload.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_SAVELOAD_H diff --git a/engines/cine/script.h b/engines/cine/script.h index 756bc930e8b..3fc86c585b0 100644 --- a/engines/cine/script.h +++ b/engines/cine/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_SCRIPT_H diff --git a/engines/cine/script_fw.cpp b/engines/cine/script_fw.cpp index 674bf4dd86f..66150cc5b2c 100644 --- a/engines/cine/script_fw.cpp +++ b/engines/cine/script_fw.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** \file diff --git a/engines/cine/script_os.cpp b/engines/cine/script_os.cpp index aa2c8c33ac8..b452d9a8ee6 100644 --- a/engines/cine/script_os.cpp +++ b/engines/cine/script_os.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** \file diff --git a/engines/cine/sound.cpp b/engines/cine/sound.cpp index 414761159b1..0c3541fae78 100644 --- a/engines/cine/sound.cpp +++ b/engines/cine/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/cine/sound.h b/engines/cine/sound.h index 7b506ab5f39..afc0994a26a 100644 --- a/engines/cine/sound.h +++ b/engines/cine/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_SOUND_H_ diff --git a/engines/cine/texte.cpp b/engines/cine/texte.cpp index fb6818d6905..dc18d081c70 100644 --- a/engines/cine/texte.cpp +++ b/engines/cine/texte.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/cine/texte.h b/engines/cine/texte.h index a23f43913ad..f82127db981 100644 --- a/engines/cine/texte.h +++ b/engines/cine/texte.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_TEXTE_H diff --git a/engines/cine/unpack.cpp b/engines/cine/unpack.cpp index 7915fd1cf80..f68fbbc02c3 100644 --- a/engines/cine/unpack.cpp +++ b/engines/cine/unpack.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/cine/unpack.h b/engines/cine/unpack.h index 32156898676..d22c4944a74 100644 --- a/engines/cine/unpack.h +++ b/engines/cine/unpack.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_UNPACK_H diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp index fdc7a288675..1892a78cca4 100644 --- a/engines/cine/various.cpp +++ b/engines/cine/various.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/cine/various.h b/engines/cine/various.h index 3a14328035f..0c1883c323c 100644 --- a/engines/cine/various.h +++ b/engines/cine/various.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_VARIOUS_H diff --git a/engines/cruise/actor.cpp b/engines/cruise/actor.cpp index 2c83aff7436..94f620ed7b3 100644 --- a/engines/cruise/actor.cpp +++ b/engines/cruise/actor.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/cruise/actor.h b/engines/cruise/actor.h index d55aac1eca3..b409bf7b7ff 100644 --- a/engines/cruise/actor.h +++ b/engines/cruise/actor.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_ACTOR_H diff --git a/engines/cruise/background.cpp b/engines/cruise/background.cpp index 7c63c155d39..1e7e87cf385 100644 --- a/engines/cruise/background.cpp +++ b/engines/cruise/background.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/cruise/background.h b/engines/cruise/background.h index caa90bea0f9..7a8f2d54949 100644 --- a/engines/cruise/background.h +++ b/engines/cruise/background.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_BACKGROUND_H diff --git a/engines/cruise/backgroundIncrust.cpp b/engines/cruise/backgroundIncrust.cpp index 1685044c9dd..39286670ed8 100644 --- a/engines/cruise/backgroundIncrust.cpp +++ b/engines/cruise/backgroundIncrust.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise_main.h" diff --git a/engines/cruise/backgroundIncrust.h b/engines/cruise/backgroundIncrust.h index 19982ee91c4..567df0a51e4 100644 --- a/engines/cruise/backgroundIncrust.h +++ b/engines/cruise/backgroundIncrust.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_BACKGROUNDINCRUST_H diff --git a/engines/cruise/cell.cpp b/engines/cruise/cell.cpp index 19189721e3e..f0fb580ec1f 100644 --- a/engines/cruise/cell.cpp +++ b/engines/cruise/cell.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise_main.h" diff --git a/engines/cruise/cell.h b/engines/cruise/cell.h index 32b34556615..3620a0c945c 100644 --- a/engines/cruise/cell.h +++ b/engines/cruise/cell.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_CELL_H diff --git a/engines/cruise/cruise.cpp b/engines/cruise/cruise.cpp index 9712bd9439f..b57e0ab1885 100644 --- a/engines/cruise/cruise.cpp +++ b/engines/cruise/cruise.cpp @@ -18,12 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ -#include "common/EventRecorder.h" #include "common/file.h" #include "common/debug-channels.h" #include "common/textconsole.h" @@ -44,7 +40,8 @@ namespace Cruise { CruiseEngine *_vm; -CruiseEngine::CruiseEngine(OSystem * syst, const CRUISEGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { +CruiseEngine::CruiseEngine(OSystem * syst, const CRUISEGameDescription *gameDesc) + : Engine(syst), _gameDescription(gameDesc), _rnd("cruise") { DebugMan.addDebugChannel(kCruiseDebugScript, "scripts", "Scripts debug level"); DebugMan.addDebugChannel(kCruiseDebugSound, "sound", "Sound debug level"); @@ -55,8 +52,6 @@ CruiseEngine::CruiseEngine(OSystem * syst, const CRUISEGameDescription *gameDesc // Setup mixer syncSoundSettings(); - - g_eventRec.registerRandomSource(_rnd, "cruise"); } extern void listMemory(); @@ -97,7 +92,7 @@ Common::Error CruiseEngine::run() { mainLoop(); - deinitialise(); + deinitialize(); return Common::kNoError; } @@ -123,7 +118,7 @@ void CruiseEngine::initialize() { _vm->_polyStruct = NULL; } -void CruiseEngine::deinitialise() { +void CruiseEngine::deinitialize() { _vm->_polyStructNorm.clear(); _vm->_polyStructExp.clear(); diff --git a/engines/cruise/cruise.h b/engines/cruise/cruise.h index 8d03d473271..44e3f26d9d2 100644 --- a/engines/cruise/cruise.h +++ b/engines/cruise/cruise.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_CRUISE_H @@ -72,7 +69,7 @@ private: bool _speedFlag; void initialize(); - void deinitialise(); + void deinitialize(); bool loadLanguageStrings(); bool makeLoad(char *saveName); void mainLoop(); diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index e2f2d7468e2..3f13c6cbff2 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/engines/cruise/cruise_main.h b/engines/cruise/cruise_main.h index 8657b4bc21f..9afae4336bb 100644 --- a/engines/cruise/cruise_main.h +++ b/engines/cruise/cruise_main.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_CRUISE_MAIN_H diff --git a/engines/cruise/ctp.cpp b/engines/cruise/ctp.cpp index f1223c12e60..a7b6faec1ca 100644 --- a/engines/cruise/ctp.cpp +++ b/engines/cruise/ctp.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise.h" diff --git a/engines/cruise/ctp.h b/engines/cruise/ctp.h index 0aec9c52d80..340832e6fb0 100644 --- a/engines/cruise/ctp.h +++ b/engines/cruise/ctp.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_CTP_H diff --git a/engines/cruise/dataLoader.cpp b/engines/cruise/dataLoader.cpp index 3ccd1689b86..66bc0fbf468 100644 --- a/engines/cruise/dataLoader.cpp +++ b/engines/cruise/dataLoader.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise_main.h" diff --git a/engines/cruise/dataLoader.h b/engines/cruise/dataLoader.h index f6bea29cde5..96188c7982b 100644 --- a/engines/cruise/dataLoader.h +++ b/engines/cruise/dataLoader.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_DATALOADER_H diff --git a/engines/cruise/debugger.cpp b/engines/cruise/debugger.cpp index 3d3d69be580..a74f600ddd4 100644 --- a/engines/cruise/debugger.cpp +++ b/engines/cruise/debugger.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/debugger.h" diff --git a/engines/cruise/debugger.h b/engines/cruise/debugger.h index 356acdbf842..3cef6b371da 100644 --- a/engines/cruise/debugger.h +++ b/engines/cruise/debugger.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_DEBUGGER_H diff --git a/engines/cruise/decompiler.cpp b/engines/cruise/decompiler.cpp index 3298776d0eb..74a78201bcb 100644 --- a/engines/cruise/decompiler.cpp +++ b/engines/cruise/decompiler.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise_main.h" diff --git a/engines/cruise/delphine-unpack.cpp b/engines/cruise/delphine-unpack.cpp index a78a8af84b5..ee7dbd3c5e6 100644 --- a/engines/cruise/delphine-unpack.cpp +++ b/engines/cruise/delphine-unpack.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp index 63d7328e784..3bd0c1f76f9 100644 --- a/engines/cruise/detection.cpp +++ b/engines/cruise/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -250,7 +247,7 @@ public: CruiseMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Cinematique evo 2 engine"; + return "CruisE"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/cruise/font.cpp b/engines/cruise/font.cpp index 2bf36bbdbd2..a6680f7a025 100644 --- a/engines/cruise/font.cpp +++ b/engines/cruise/font.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/cruise/font.h b/engines/cruise/font.h index 17bb4372cf0..679faf194df 100644 --- a/engines/cruise/font.h +++ b/engines/cruise/font.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_FONT_H diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp index 75b90f7ec8c..27b9be7e79a 100644 --- a/engines/cruise/function.cpp +++ b/engines/cruise/function.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise.h" diff --git a/engines/cruise/function.h b/engines/cruise/function.h index 347c9f23b84..4fba8d3c632 100644 --- a/engines/cruise/function.h +++ b/engines/cruise/function.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_FUNCTION_H diff --git a/engines/cruise/gfxModule.cpp b/engines/cruise/gfxModule.cpp index 4d48c2c466e..7bbcae2259b 100644 --- a/engines/cruise/gfxModule.cpp +++ b/engines/cruise/gfxModule.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/cruise/gfxModule.h b/engines/cruise/gfxModule.h index 1ca2581af50..ce58c65d34e 100644 --- a/engines/cruise/gfxModule.h +++ b/engines/cruise/gfxModule.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_GFXMODULE_H diff --git a/engines/cruise/linker.cpp b/engines/cruise/linker.cpp index afc79924930..e8ef415fe74 100644 --- a/engines/cruise/linker.cpp +++ b/engines/cruise/linker.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/cruise/linker.h b/engines/cruise/linker.h index f513d15845f..ce212f6ceae 100644 --- a/engines/cruise/linker.h +++ b/engines/cruise/linker.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_LINKER_H diff --git a/engines/cruise/mainDraw.cpp b/engines/cruise/mainDraw.cpp index f6b04e6d9d7..814d0aa9e98 100644 --- a/engines/cruise/mainDraw.cpp +++ b/engines/cruise/mainDraw.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise_main.h" @@ -214,7 +211,7 @@ int m_color; This "worked" on many platforms so far, but on OSX apparently the buffers don't occupy contiguous memory, and this causes severe corruption and subsequent crashes. Since I'm not really familiar with how the strange drawing code is supposed to work, - or whether this behaviour is intentional or not, the short-term fix is to allocate a big + or whether this behavior is intentional or not, the short-term fix is to allocate a big buffer and setup pointers within it. This fixes the crashes I'm seeing without causing any (visual) side-effects. If anyone wants to look, this is easily reproduced by starting the game and examining the rug. diff --git a/engines/cruise/mainDraw.h b/engines/cruise/mainDraw.h index 306fb6845de..bb21f515af2 100644 --- a/engines/cruise/mainDraw.h +++ b/engines/cruise/mainDraw.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_MAINDRAW_H diff --git a/engines/cruise/menu.cpp b/engines/cruise/menu.cpp index 36689ca0e30..407858574c2 100644 --- a/engines/cruise/menu.cpp +++ b/engines/cruise/menu.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise.h" diff --git a/engines/cruise/menu.h b/engines/cruise/menu.h index 3ee2ae6579e..d605903cdca 100644 --- a/engines/cruise/menu.h +++ b/engines/cruise/menu.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_MENU_H diff --git a/engines/cruise/mouse.cpp b/engines/cruise/mouse.cpp index 24309030da7..6248bd01d38 100644 --- a/engines/cruise/mouse.cpp +++ b/engines/cruise/mouse.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise_main.h" diff --git a/engines/cruise/mouse.h b/engines/cruise/mouse.h index 509267ad265..a5f5c19073f 100644 --- a/engines/cruise/mouse.h +++ b/engines/cruise/mouse.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_MOUSE_H diff --git a/engines/cruise/object.cpp b/engines/cruise/object.cpp index 8e2be0cf138..b4a3489c1d0 100644 --- a/engines/cruise/object.cpp +++ b/engines/cruise/object.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/cruise/object.h b/engines/cruise/object.h index 625e8e479e7..cbe5872a9da 100644 --- a/engines/cruise/object.h +++ b/engines/cruise/object.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_OBJECT_H diff --git a/engines/cruise/overlay.cpp b/engines/cruise/overlay.cpp index b7a0293f33c..2f4b3758657 100644 --- a/engines/cruise/overlay.cpp +++ b/engines/cruise/overlay.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/memstream.h" diff --git a/engines/cruise/overlay.h b/engines/cruise/overlay.h index 7b2f34b73d4..3b69f2acefc 100644 --- a/engines/cruise/overlay.h +++ b/engines/cruise/overlay.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_OVERLAY_H diff --git a/engines/cruise/perso.cpp b/engines/cruise/perso.cpp index e86daa5befc..85c9b1614ff 100644 --- a/engines/cruise/perso.cpp +++ b/engines/cruise/perso.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise.h" diff --git a/engines/cruise/perso.h b/engines/cruise/perso.h index 19201ecafb4..e0ca479dffe 100644 --- a/engines/cruise/perso.h +++ b/engines/cruise/perso.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_PERSO_H diff --git a/engines/cruise/polys.cpp b/engines/cruise/polys.cpp index 76792a69ba3..964540f802c 100644 --- a/engines/cruise/polys.cpp +++ b/engines/cruise/polys.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise_main.h" diff --git a/engines/cruise/polys.h b/engines/cruise/polys.h index 53ce4672cde..8505f791a6f 100644 --- a/engines/cruise/polys.h +++ b/engines/cruise/polys.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_POLYS_H diff --git a/engines/cruise/saveload.cpp b/engines/cruise/saveload.cpp index 6e75088d45b..63920093732 100644 --- a/engines/cruise/saveload.cpp +++ b/engines/cruise/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise_main.h" diff --git a/engines/cruise/saveload.h b/engines/cruise/saveload.h index 9aa1f89e0f7..695913f46f5 100644 --- a/engines/cruise/saveload.h +++ b/engines/cruise/saveload.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_SAVELOAD_H diff --git a/engines/cruise/script.cpp b/engines/cruise/script.cpp index d6ff784644e..4e76194a450 100644 --- a/engines/cruise/script.cpp +++ b/engines/cruise/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise.h" diff --git a/engines/cruise/script.h b/engines/cruise/script.h index 2a7a85689de..cba4f580f81 100644 --- a/engines/cruise/script.h +++ b/engines/cruise/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_SCRIPT_H diff --git a/engines/cruise/sound.cpp b/engines/cruise/sound.cpp index 322f8084392..290cc220d42 100644 --- a/engines/cruise/sound.cpp +++ b/engines/cruise/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/cruise/sound.h b/engines/cruise/sound.h index 61985ce802b..11aec0b04e2 100644 --- a/engines/cruise/sound.h +++ b/engines/cruise/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_SOUND_H diff --git a/engines/cruise/stack.cpp b/engines/cruise/stack.cpp index 4f36dbec486..985fe8d7fdb 100644 --- a/engines/cruise/stack.cpp +++ b/engines/cruise/stack.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise_main.h" diff --git a/engines/cruise/stack.h b/engines/cruise/stack.h index a7cd3f556d0..fe2d594c9e3 100644 --- a/engines/cruise/stack.h +++ b/engines/cruise/stack.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_STACK_H diff --git a/engines/cruise/staticres.cpp b/engines/cruise/staticres.cpp index 101a2038b07..1565f254d07 100644 --- a/engines/cruise/staticres.cpp +++ b/engines/cruise/staticres.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/staticres.h" diff --git a/engines/cruise/staticres.h b/engines/cruise/staticres.h index af37b14f5eb..a3cf13e41c1 100644 --- a/engines/cruise/staticres.h +++ b/engines/cruise/staticres.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_STATICRES_H diff --git a/engines/cruise/various.cpp b/engines/cruise/various.cpp index 599da22de38..90b072b4786 100644 --- a/engines/cruise/various.cpp +++ b/engines/cruise/various.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise_main.h" diff --git a/engines/cruise/various.h b/engines/cruise/various.h index 9471464b322..b59593961d9 100644 --- a/engines/cruise/various.h +++ b/engines/cruise/various.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_VARIOUS_H diff --git a/engines/cruise/vars.cpp b/engines/cruise/vars.cpp index 07bd646caef..f3813583563 100644 --- a/engines/cruise/vars.cpp +++ b/engines/cruise/vars.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise_main.h" diff --git a/engines/cruise/vars.h b/engines/cruise/vars.h index 54920a14366..ccbf149610e 100644 --- a/engines/cruise/vars.h +++ b/engines/cruise/vars.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_VARS_H diff --git a/engines/cruise/volume.cpp b/engines/cruise/volume.cpp index 5535d5a0163..773a146b9a4 100644 --- a/engines/cruise/volume.cpp +++ b/engines/cruise/volume.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise.h" diff --git a/engines/cruise/volume.h b/engines/cruise/volume.h index a842a30470d..80e1f10db2d 100644 --- a/engines/cruise/volume.h +++ b/engines/cruise/volume.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_VOLUME_H diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp index 7e1f29271e9..75b2ca9296c 100644 --- a/engines/dialogs.cpp +++ b/engines/dialogs.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "base/version.h" diff --git a/engines/dialogs.h b/engines/dialogs.h index 587e91a2bbd..32174031cc9 100644 --- a/engines/dialogs.h +++ b/engines/dialogs.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GLOBAL_DIALOGS_H diff --git a/engines/draci/animation.cpp b/engines/draci/animation.cpp index f2f1727fdd0..6e6f167fbad 100644 --- a/engines/draci/animation.cpp +++ b/engines/draci/animation.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "draci/draci.h" diff --git a/engines/draci/animation.h b/engines/draci/animation.h index bbcf03b02f0..8b2a3d98b8d 100644 --- a/engines/draci/animation.h +++ b/engines/draci/animation.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_ANIMATION_H diff --git a/engines/draci/barchive.cpp b/engines/draci/barchive.cpp index 5307e042504..154073250cc 100644 --- a/engines/draci/barchive.cpp +++ b/engines/draci/barchive.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/draci/barchive.h b/engines/draci/barchive.h index 87ee301de55..52ce79ad2d7 100644 --- a/engines/draci/barchive.h +++ b/engines/draci/barchive.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_BARCHIVE_H diff --git a/engines/draci/console.cpp b/engines/draci/console.cpp index 304b421ac3e..a0013c59fee 100644 --- a/engines/draci/console.cpp +++ b/engines/draci/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "draci/console.h" diff --git a/engines/draci/console.h b/engines/draci/console.h index 9d463f2eb17..714871ffd35 100644 --- a/engines/draci/console.h +++ b/engines/draci/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_CONSOLE_H diff --git a/engines/draci/detection.cpp b/engines/draci/detection.cpp index 78c5c716055..d3483eb5a4e 100644 --- a/engines/draci/detection.cpp +++ b/engines/draci/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "draci/draci.h" @@ -116,7 +113,7 @@ public: DraciMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Draci Historie Engine"; + return "Draci"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp index 45d17ea24f6..cdc91e8d9f5 100644 --- a/engines/draci/draci.cpp +++ b/engines/draci/draci.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" @@ -30,7 +27,6 @@ #include "common/events.h" #include "common/file.h" #include "common/keyboard.h" -#include "common/EventRecorder.h" #include "engines/util.h" @@ -74,7 +70,8 @@ const uint kSoundsFrequency = 13000; const uint kDubbingFrequency = 22050; DraciEngine::DraciEngine(OSystem *syst, const ADGameDescription *gameDesc) - : Engine(syst) { + : Engine(syst), _rnd("draci") { + // Put your engine in a sane state, but do nothing big yet; // in particular, do not load data from files; rather, if you // need to do such things, do them from init(). @@ -95,9 +92,6 @@ DraciEngine::DraciEngine(OSystem *syst, const ADGameDescription *gameDesc) DebugMan.addDebugChannel(kDraciWalkingDebugLevel, "walking", "Walking debug info"); _console = new DraciConsole(this); - - // Don't forget to register your random source - g_eventRec.registerRandomSource(_rnd, "draci"); } bool DraciEngine::hasFeature(EngineFeature f) const { diff --git a/engines/draci/draci.h b/engines/draci/draci.h index 6a597e123e6..83e69ca3328 100644 --- a/engines/draci/draci.h +++ b/engines/draci/draci.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_H diff --git a/engines/draci/font.cpp b/engines/draci/font.cpp index d869d046f3f..b4e799deb7e 100644 --- a/engines/draci/font.cpp +++ b/engines/draci/font.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/draci/font.h b/engines/draci/font.h index 0ccc900465d..3d150f733e6 100644 --- a/engines/draci/font.h +++ b/engines/draci/font.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_FONT_H diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp index e19ec678105..657e3819869 100644 --- a/engines/draci/game.cpp +++ b/engines/draci/game.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/keyboard.h" diff --git a/engines/draci/game.h b/engines/draci/game.h index 0b5b3a03cc7..47821fcf86d 100644 --- a/engines/draci/game.h +++ b/engines/draci/game.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_GAME_H diff --git a/engines/draci/mouse.cpp b/engines/draci/mouse.cpp index 5853d15d219..90c04ed4c34 100644 --- a/engines/draci/mouse.cpp +++ b/engines/draci/mouse.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "draci/draci.h" diff --git a/engines/draci/mouse.h b/engines/draci/mouse.h index c7f492cb6ee..b934475ade2 100644 --- a/engines/draci/mouse.h +++ b/engines/draci/mouse.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_MOUSE_H diff --git a/engines/draci/music.cpp b/engines/draci/music.cpp index 1d725ebb15c..6f3e3c8384b 100644 --- a/engines/draci/music.cpp +++ b/engines/draci/music.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // MIDI and digital music class diff --git a/engines/draci/music.h b/engines/draci/music.h index c0228074e5f..62288a01dc9 100644 --- a/engines/draci/music.h +++ b/engines/draci/music.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Music class diff --git a/engines/draci/saveload.cpp b/engines/draci/saveload.cpp index 32e852d9a6d..ffb1ed7ff4d 100644 --- a/engines/draci/saveload.cpp +++ b/engines/draci/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "draci/draci.h" diff --git a/engines/draci/saveload.h b/engines/draci/saveload.h index ca5f002ecdc..3cc13701db5 100644 --- a/engines/draci/saveload.h +++ b/engines/draci/saveload.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_SAVELOAD_H diff --git a/engines/draci/screen.cpp b/engines/draci/screen.cpp index ab9c49c63a5..8c1a0c40f7f 100644 --- a/engines/draci/screen.cpp +++ b/engines/draci/screen.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/memstream.h" diff --git a/engines/draci/screen.h b/engines/draci/screen.h index e4e910475a3..5a8297feba4 100644 --- a/engines/draci/screen.h +++ b/engines/draci/screen.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_SCREEN_H diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp index a7ce8b27d92..c4df9d9ddeb 100644 --- a/engines/draci/script.cpp +++ b/engines/draci/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/array.h" diff --git a/engines/draci/script.h b/engines/draci/script.h index a75f6bcbc37..72d6f6c3442 100644 --- a/engines/draci/script.h +++ b/engines/draci/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_SCRIPT_H @@ -109,7 +106,7 @@ private: int _jump; bool _endProgram; - /** List of all GPL commands. Initialised in the constructor. */ + /** List of all GPL commands. Initialized in the constructor. */ const GPL2Command *_commandList; const GPL2Operator *_operatorList; const GPL2Function *_functionList; diff --git a/engines/draci/sound.cpp b/engines/draci/sound.cpp index ab2479f811b..bbba9d9cc06 100644 --- a/engines/draci/sound.cpp +++ b/engines/draci/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/archive.h" diff --git a/engines/draci/sound.h b/engines/draci/sound.h index 4f69af7ff0d..358c2286040 100644 --- a/engines/draci/sound.h +++ b/engines/draci/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_SOUND_H diff --git a/engines/draci/sprite.cpp b/engines/draci/sprite.cpp index b4296375f2e..92ce7d31d9c 100644 --- a/engines/draci/sprite.cpp +++ b/engines/draci/sprite.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/memstream.h" diff --git a/engines/draci/sprite.h b/engines/draci/sprite.h index 15e1cf80ca3..c86728914e0 100644 --- a/engines/draci/sprite.h +++ b/engines/draci/sprite.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_SPRITE_H diff --git a/engines/draci/surface.cpp b/engines/draci/surface.cpp index 37a76dbe0e9..8380f8777b5 100644 --- a/engines/draci/surface.cpp +++ b/engines/draci/surface.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "draci/screen.h" diff --git a/engines/draci/surface.h b/engines/draci/surface.h index cb15ecebe4c..71a3722a2ae 100644 --- a/engines/draci/surface.h +++ b/engines/draci/surface.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_SURFACE_H diff --git a/engines/draci/walking.cpp b/engines/draci/walking.cpp index d72e50be07b..9a66c6163ac 100644 --- a/engines/draci/walking.cpp +++ b/engines/draci/walking.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/memstream.h" diff --git a/engines/draci/walking.h b/engines/draci/walking.h index d6c7f0691dc..a43aeb272a4 100644 --- a/engines/draci/walking.h +++ b/engines/draci/walking.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_WALKING_H diff --git a/engines/drascula/actors.cpp b/engines/drascula/actors.cpp index c0b0b7c98bc..9d5d6550fa2 100644 --- a/engines/drascula/actors.cpp +++ b/engines/drascula/actors.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "drascula/drascula.h" diff --git a/engines/drascula/animation.cpp b/engines/drascula/animation.cpp index f939a033d34..c4a8d3eb01d 100644 --- a/engines/drascula/animation.cpp +++ b/engines/drascula/animation.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "drascula/drascula.h" diff --git a/engines/drascula/console.cpp b/engines/drascula/console.cpp index aa9fcc0960f..d2fd32f2e53 100644 --- a/engines/drascula/console.cpp +++ b/engines/drascula/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "drascula/console.h" diff --git a/engines/drascula/console.h b/engines/drascula/console.h index d8d1918a607..894c85ff428 100644 --- a/engines/drascula/console.h +++ b/engines/drascula/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRASCULA_CONSOLE_H diff --git a/engines/drascula/converse.cpp b/engines/drascula/converse.cpp index dcd93d84d70..6f028e6e12a 100644 --- a/engines/drascula/converse.cpp +++ b/engines/drascula/converse.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp index 8729290d526..5a8903db9d7 100644 --- a/engines/drascula/detection.cpp +++ b/engines/drascula/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -299,7 +296,7 @@ public: DrasculaMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Drascula Engine"; + return "Drascula"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index 470f28ccffb..cac7f93f128 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -18,13 +18,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/events.h" -#include "common/EventRecorder.h" #include "common/keyboard.h" #include "common/file.h" #include "common/savefile.h" @@ -100,8 +96,7 @@ DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gam rightMouseButton = 0; *textName = 0; - _rnd = new Common::RandomSource(); - g_eventRec.registerRandomSource(*_rnd, "drascula"); + _rnd = new Common::RandomSource("drascula"); _console = 0; diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h index b70384614fb..f9dcbe2810d 100644 --- a/engines/drascula/drascula.h +++ b/engines/drascula/drascula.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRASCULA_H diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp index 0811fbede17..d133b3609d6 100644 --- a/engines/drascula/graphics.cpp +++ b/engines/drascula/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "drascula/drascula.h" diff --git a/engines/drascula/interface.cpp b/engines/drascula/interface.cpp index 7bb94c25420..eb36baed183 100644 --- a/engines/drascula/interface.cpp +++ b/engines/drascula/interface.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "drascula/drascula.h" diff --git a/engines/drascula/objects.cpp b/engines/drascula/objects.cpp index 630eb08d3c1..07b8464de4a 100644 --- a/engines/drascula/objects.cpp +++ b/engines/drascula/objects.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/drascula/palette.cpp b/engines/drascula/palette.cpp index a75e72e2496..500333badff 100644 --- a/engines/drascula/palette.cpp +++ b/engines/drascula/palette.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "graphics/palette.h" diff --git a/engines/drascula/resource.cpp b/engines/drascula/resource.cpp index cca1e475865..bda25113b77 100644 --- a/engines/drascula/resource.cpp +++ b/engines/drascula/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "drascula/drascula.h" diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp index 35d4eedb5d9..50d44bab79d 100644 --- a/engines/drascula/rooms.cpp +++ b/engines/drascula/rooms.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/array.h" diff --git a/engines/drascula/saveload.cpp b/engines/drascula/saveload.cpp index eacbe6756d9..15f5855bdca 100644 --- a/engines/drascula/saveload.cpp +++ b/engines/drascula/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/drascula/sound.cpp b/engines/drascula/sound.cpp index 5cb1c4486a2..4721d2d3696 100644 --- a/engines/drascula/sound.cpp +++ b/engines/drascula/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/audiostream.h" diff --git a/engines/drascula/talk.cpp b/engines/drascula/talk.cpp index 8cefe0385cd..6d1509fe3c9 100644 --- a/engines/drascula/talk.cpp +++ b/engines/drascula/talk.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "drascula/drascula.h" diff --git a/engines/engine.cpp b/engines/engine.cpp index 2c1d3a732cc..b3cb8bea065 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #define FORBIDDEN_SYMBOL_EXCEPTION_getcwd diff --git a/engines/engine.h b/engines/engine.h index b7afc0f09dc..375df2b0a35 100644 --- a/engines/engine.h +++ b/engines/engine.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef ENGINES_ENGINE_H diff --git a/engines/game.cpp b/engines/game.cpp index a27080cbf87..a14edb8af4d 100644 --- a/engines/game.cpp +++ b/engines/game.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "engines/game.h" diff --git a/engines/game.h b/engines/game.h index c9a3b258539..f9988c29650 100644 --- a/engines/game.h +++ b/engines/game.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef ENGINES_GAME_H diff --git a/engines/gob/console.cpp b/engines/gob/console.cpp index 751956a8482..b8aed37727e 100644 --- a/engines/gob/console.cpp +++ b/engines/gob/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/console.h" diff --git a/engines/gob/console.h b/engines/gob/console.h index 91e62f370e7..b9f9b81d0e9 100644 --- a/engines/gob/console.h +++ b/engines/gob/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_CONSOLE_H diff --git a/engines/gob/databases.cpp b/engines/gob/databases.cpp index 94f641db4ed..497de489ce3 100644 --- a/engines/gob/databases.cpp +++ b/engines/gob/databases.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/gob/databases.h b/engines/gob/databases.h index cb76ae3b86e..fb65d8cf967 100644 --- a/engines/gob/databases.h +++ b/engines/gob/databases.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_DATABASES_H diff --git a/engines/gob/dataio.cpp b/engines/gob/dataio.cpp index aa2743b5ed7..a576cf9487e 100644 --- a/engines/gob/dataio.cpp +++ b/engines/gob/dataio.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/dataio.h b/engines/gob/dataio.h index f2b39aed094..d95f0010973 100644 --- a/engines/gob/dataio.h +++ b/engines/gob/dataio.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_DATAIO_H diff --git a/engines/gob/dbase.cpp b/engines/gob/dbase.cpp index 12c382dbcbd..41bd5308eca 100644 --- a/engines/gob/dbase.cpp +++ b/engines/gob/dbase.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/dbase.h" diff --git a/engines/gob/dbase.h b/engines/gob/dbase.h index 5f260f965f4..3da1ef72708 100644 --- a/engines/gob/dbase.h +++ b/engines/gob/dbase.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_DBASE_H diff --git a/engines/gob/demos/batplayer.cpp b/engines/gob/demos/batplayer.cpp index 700aa6316f9..9c073f0e772 100644 --- a/engines/gob/demos/batplayer.cpp +++ b/engines/gob/demos/batplayer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/demos/batplayer.h b/engines/gob/demos/batplayer.h index e9d9916f6a8..f406ea1bf8a 100644 --- a/engines/gob/demos/batplayer.h +++ b/engines/gob/demos/batplayer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_BATPLAYER_H diff --git a/engines/gob/demos/demoplayer.cpp b/engines/gob/demos/demoplayer.cpp index 715e78adbc3..9aa7a4123d2 100644 --- a/engines/gob/demos/demoplayer.cpp +++ b/engines/gob/demos/demoplayer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" @@ -53,6 +50,9 @@ DemoPlayer::Script DemoPlayer::_scripts[] = { "slide xant.imd 20\nslide tum.imd 20\nslide voile.imd 20\n" \ "slide int.imd 20\nslide voila.imd 1\nslide voilb.imd 1\n"}, {kScriptSourceFile, "coktelplayer.scn"}, + {kScriptSourceFile, "demogb.scn"}, + {kScriptSourceFile, "demoall.scn"}, + {kScriptSourceFile, "demofra.scn"} }; DemoPlayer::DemoPlayer(GobEngine *vm) : _vm(vm) { diff --git a/engines/gob/demos/demoplayer.h b/engines/gob/demos/demoplayer.h index 207b0503639..9ffdb71de1d 100644 --- a/engines/gob/demos/demoplayer.h +++ b/engines/gob/demos/demoplayer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_DEMOPLAYER_H diff --git a/engines/gob/demos/scnplayer.cpp b/engines/gob/demos/scnplayer.cpp index bf81773a154..434c49c4bd8 100644 --- a/engines/gob/demos/scnplayer.cpp +++ b/engines/gob/demos/scnplayer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/demos/scnplayer.h b/engines/gob/demos/scnplayer.h index 1eb0ae4ba86..8627f8ceebb 100644 --- a/engines/gob/demos/scnplayer.h +++ b/engines/gob/demos/scnplayer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SCNPLAYER_H diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp index a1eb8055aa3..be44c05bfb9 100644 --- a/engines/gob/detection.cpp +++ b/engines/gob/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -119,7 +116,7 @@ public: GobMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Gob Engine"; + return "Gob"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/gob/detection_tables.h b/engines/gob/detection_tables.h index 832300f7855..11cca2b65ef 100644 --- a/engines/gob/detection_tables.h +++ b/engines/gob/detection_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ namespace Gob { @@ -4794,6 +4791,60 @@ static const GOBGameDescription gameDescriptions[] = { kFeaturesNone, 0, 0, 0 }, + { + { + "adibou2", + "Non-Interactive Demo", + { + {"demogb.scn", 0, "9291455a908ac0e6aaaca686e532609b", 105}, + {"demogb.vmd", 0, "bc9c1db97db7bec8f566332444fa0090", 14320840}, + {0, 0, 0, 0} + }, + EN_GRB, + kPlatformPC, + ADGF_DEMO, + GUIO_NOSUBTITLES | GUIO_NOSPEECH + }, + kGameTypeAdibou2, + kFeatures640x480 | kFeaturesSCNDemo, + 0, 0, 9 + }, + { + { + "adibou2", + "Non-Interactive Demo", + { + {"demoall.scn", 0, "c8fd308c037b829800006332b2c32674", 106}, + {"demoall.vmd", 0, "4672b2deacc6fca97484840424b1921b", 14263433}, + {0, 0, 0, 0} + }, + DE_DEU, + kPlatformPC, + ADGF_DEMO, + GUIO_NOSUBTITLES | GUIO_NOSPEECH + }, + kGameTypeAdibou2, + kFeatures640x480 | kFeaturesSCNDemo, + 0, 0, 10 + }, + { + { + "adibou2", + "Non-Interactive Demo", + { + {"demofra.scn", 0, "d1b2b1618af384ea1120def8b986c02b", 106}, + {"demofra.vmd", 0, "b494cdec1aac7e54c3f2480512d2880e", 14297100}, + {0, 0, 0, 0} + }, + FR_FRA, + kPlatformPC, + ADGF_DEMO, + GUIO_NOSUBTITLES | GUIO_NOSPEECH + }, + kGameTypeAdibou2, + kFeatures640x480 | kFeaturesSCNDemo, + 0, 0, 11 + }, { AD_TABLE_END_MARKER, kGameTypeNone, kFeaturesNone, 0, 0, 0} }; diff --git a/engines/gob/draw.cpp b/engines/gob/draw.cpp index d193f6bfa4a..580696523f1 100644 --- a/engines/gob/draw.cpp +++ b/engines/gob/draw.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/draw.h b/engines/gob/draw.h index 59bcd58bdb8..57faefa314f 100644 --- a/engines/gob/draw.h +++ b/engines/gob/draw.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_DRAW_H diff --git a/engines/gob/draw_bargon.cpp b/engines/gob/draw_bargon.cpp index d335310dcf0..a2a70927f6f 100644 --- a/engines/gob/draw_bargon.cpp +++ b/engines/gob/draw_bargon.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/gob.h" diff --git a/engines/gob/draw_fascin.cpp b/engines/gob/draw_fascin.cpp index 3f939e77904..69e04f74c97 100644 --- a/engines/gob/draw_fascin.cpp +++ b/engines/gob/draw_fascin.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/draw.h" diff --git a/engines/gob/draw_playtoons.cpp b/engines/gob/draw_playtoons.cpp index edd7b76318a..a443f81ccfe 100644 --- a/engines/gob/draw_playtoons.cpp +++ b/engines/gob/draw_playtoons.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/draw_v1.cpp b/engines/gob/draw_v1.cpp index fd0fb8ae4f2..3873a99d5f2 100644 --- a/engines/gob/draw_v1.cpp +++ b/engines/gob/draw_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/draw_v2.cpp b/engines/gob/draw_v2.cpp index c07f8de69db..cc8f6b5e3c5 100644 --- a/engines/gob/draw_v2.cpp +++ b/engines/gob/draw_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/expression.cpp b/engines/gob/expression.cpp index d053345b4c8..fdb42334441 100644 --- a/engines/gob/expression.cpp +++ b/engines/gob/expression.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/expression.h b/engines/gob/expression.h index 2c27ddc8e74..ecce7c869d2 100644 --- a/engines/gob/expression.h +++ b/engines/gob/expression.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_EXPRESSION_H diff --git a/engines/gob/game.cpp b/engines/gob/game.cpp index 44a730cda0d..926027e15d7 100644 --- a/engines/gob/game.cpp +++ b/engines/gob/game.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/game.h b/engines/gob/game.h index f529f7c025c..b3057ac262c 100644 --- a/engines/gob/game.h +++ b/engines/gob/game.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_GAME_H diff --git a/engines/gob/global.cpp b/engines/gob/global.cpp index 8b8fb3d4c97..1264c098604 100644 --- a/engines/gob/global.cpp +++ b/engines/gob/global.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/gob.h" diff --git a/engines/gob/global.h b/engines/gob/global.h index 24925bc58a1..fa2f2c96372 100644 --- a/engines/gob/global.h +++ b/engines/gob/global.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_GLOBAL_H diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp index 3d697d3693f..ea7e3294807 100644 --- a/engines/gob/gob.cpp +++ b/engines/gob/gob.cpp @@ -18,13 +18,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug-channels.h" -#include "common/EventRecorder.h" #include "backends/audiocd/audiocd.h" #include "base/plugins.h" @@ -113,7 +109,7 @@ void PauseDialog::handleKeyDown(Common::KeyState state) { } -GobEngine::GobEngine(OSystem *syst) : Engine(syst) { +GobEngine::GobEngine(OSystem *syst) : Engine(syst), _rnd("gob") { _sound = 0; _mult = 0; _game = 0; _global = 0; _dataIO = 0; _goblin = 0; _vidPlayer = 0; _init = 0; _inter = 0; @@ -148,8 +144,6 @@ GobEngine::GobEngine(OSystem *syst) : Engine(syst) { DebugMan.addDebugChannel(kDebugVideo, "Video", "IMD/VMD video debug level"); DebugMan.addDebugChannel(kDebugHotspots, "Hotspots", "Hotspots debug level"); DebugMan.addDebugChannel(kDebugDemo, "Demo", "Demo script debug level"); - - g_eventRec.registerRandomSource(_rnd, "gob"); } GobEngine::~GobEngine() { diff --git a/engines/gob/gob.h b/engines/gob/gob.h index 4a928747b04..74c882e0219 100644 --- a/engines/gob/gob.h +++ b/engines/gob/gob.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_GOB_H diff --git a/engines/gob/goblin.cpp b/engines/gob/goblin.cpp index 402b33d5fda..a032588a1ff 100644 --- a/engines/gob/goblin.cpp +++ b/engines/gob/goblin.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/str.h" diff --git a/engines/gob/goblin.h b/engines/gob/goblin.h index c2bcaa57521..3d45da599d7 100644 --- a/engines/gob/goblin.h +++ b/engines/gob/goblin.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_GOBLIN_H diff --git a/engines/gob/goblin_v1.cpp b/engines/gob/goblin_v1.cpp index 3dc4c6611d7..ea46b4b9a19 100644 --- a/engines/gob/goblin_v1.cpp +++ b/engines/gob/goblin_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/goblin_v2.cpp b/engines/gob/goblin_v2.cpp index 2b4a529bdbd..2dbdf39d7de 100644 --- a/engines/gob/goblin_v2.cpp +++ b/engines/gob/goblin_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/goblin_v3.cpp b/engines/gob/goblin_v3.cpp index 0cb3aadc716..38880bfdb64 100644 --- a/engines/gob/goblin_v3.cpp +++ b/engines/gob/goblin_v3.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/gob.h" diff --git a/engines/gob/goblin_v4.cpp b/engines/gob/goblin_v4.cpp index 523357aab1c..0d6a995af99 100644 --- a/engines/gob/goblin_v4.cpp +++ b/engines/gob/goblin_v4.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/gob.h" diff --git a/engines/gob/hotspots.cpp b/engines/gob/hotspots.cpp index 301d594eb9b..f3647af76ef 100644 --- a/engines/gob/hotspots.cpp +++ b/engines/gob/hotspots.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/str.h" diff --git a/engines/gob/hotspots.h b/engines/gob/hotspots.h index 7346c66bb58..8d26ad224e3 100644 --- a/engines/gob/hotspots.h +++ b/engines/gob/hotspots.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_HOTSPOTS_H diff --git a/engines/gob/iniconfig.cpp b/engines/gob/iniconfig.cpp index f08303c0bb5..9b8f1c703ed 100644 --- a/engines/gob/iniconfig.cpp +++ b/engines/gob/iniconfig.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/iniconfig.h" diff --git a/engines/gob/iniconfig.h b/engines/gob/iniconfig.h index fc35315207b..bf60f2d1254 100644 --- a/engines/gob/iniconfig.h +++ b/engines/gob/iniconfig.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_INICONFIG_H diff --git a/engines/gob/init.cpp b/engines/gob/init.cpp index 7a757caadfe..90c2a1602a6 100644 --- a/engines/gob/init.cpp +++ b/engines/gob/init.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/init.h b/engines/gob/init.h index ba4b1f979d2..1cb29040998 100644 --- a/engines/gob/init.h +++ b/engines/gob/init.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_INIT_H diff --git a/engines/gob/init_fascin.cpp b/engines/gob/init_fascin.cpp index 9842b7e7521..b87d8164061 100644 --- a/engines/gob/init_fascin.cpp +++ b/engines/gob/init_fascin.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/init_v1.cpp b/engines/gob/init_v1.cpp index af09626fe74..6772a13eb04 100644 --- a/engines/gob/init_v1.cpp +++ b/engines/gob/init_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/init_v2.cpp b/engines/gob/init_v2.cpp index 78be68d48c6..f10d586a343 100644 --- a/engines/gob/init_v2.cpp +++ b/engines/gob/init_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/init_v3.cpp b/engines/gob/init_v3.cpp index b3816c10e9a..bfbe00849f6 100644 --- a/engines/gob/init_v3.cpp +++ b/engines/gob/init_v3.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/init_v4.cpp b/engines/gob/init_v4.cpp index 3bd50a494d7..ba92c2fc040 100644 --- a/engines/gob/init_v4.cpp +++ b/engines/gob/init_v4.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/init_v6.cpp b/engines/gob/init_v6.cpp index 76f006533f5..947556835a9 100644 --- a/engines/gob/init_v6.cpp +++ b/engines/gob/init_v6.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/init_v7.cpp b/engines/gob/init_v7.cpp index 709cefb69db..b5b51aad2a0 100644 --- a/engines/gob/init_v7.cpp +++ b/engines/gob/init_v7.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/fs.h" diff --git a/engines/gob/inter.cpp b/engines/gob/inter.cpp index 9b4b06eea3a..9df3c06c742 100644 --- a/engines/gob/inter.cpp +++ b/engines/gob/inter.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/inter.h b/engines/gob/inter.h index 1807dc3ad70..78d5e342711 100644 --- a/engines/gob/inter.h +++ b/engines/gob/inter.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_INTER_H diff --git a/engines/gob/inter_bargon.cpp b/engines/gob/inter_bargon.cpp index 4dcdff8c6cb..c2e6a2e9124 100644 --- a/engines/gob/inter_bargon.cpp +++ b/engines/gob/inter_bargon.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/inter_fascin.cpp b/engines/gob/inter_fascin.cpp index 5e820cef024..bab1975abca 100644 --- a/engines/gob/inter_fascin.cpp +++ b/engines/gob/inter_fascin.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/inter_inca2.cpp b/engines/gob/inter_inca2.cpp index 01d3cda33e5..f868f18242e 100644 --- a/engines/gob/inter_inca2.cpp +++ b/engines/gob/inter_inca2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/inter_playtoons.cpp b/engines/gob/inter_playtoons.cpp index c5f9d2df06f..d57d2f354b3 100644 --- a/engines/gob/inter_playtoons.cpp +++ b/engines/gob/inter_playtoons.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp index 8f1ff4c73f1..47b0beaf63a 100644 --- a/engines/gob/inter_v1.cpp +++ b/engines/gob/inter_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/str.h" diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp index 6a42b5ecd4e..84cae3b380b 100644 --- a/engines/gob/inter_v2.cpp +++ b/engines/gob/inter_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/inter_v3.cpp b/engines/gob/inter_v3.cpp index 8a5a8392441..47486b08998 100644 --- a/engines/gob/inter_v3.cpp +++ b/engines/gob/inter_v3.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/inter_v4.cpp b/engines/gob/inter_v4.cpp index 1da92b37662..f89af0e45ad 100644 --- a/engines/gob/inter_v4.cpp +++ b/engines/gob/inter_v4.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/str.h" diff --git a/engines/gob/inter_v5.cpp b/engines/gob/inter_v5.cpp index f5e87bb9363..ed371737bd4 100644 --- a/engines/gob/inter_v5.cpp +++ b/engines/gob/inter_v5.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gui/message.h" diff --git a/engines/gob/inter_v6.cpp b/engines/gob/inter_v6.cpp index 53ebfe75130..589328dfdb5 100644 --- a/engines/gob/inter_v6.cpp +++ b/engines/gob/inter_v6.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/str.h" diff --git a/engines/gob/inter_v7.cpp b/engines/gob/inter_v7.cpp index c318252b689..a36154fe5e4 100644 --- a/engines/gob/inter_v7.cpp +++ b/engines/gob/inter_v7.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/map.cpp b/engines/gob/map.cpp index 503b9340744..57f5f7af487 100644 --- a/engines/gob/map.cpp +++ b/engines/gob/map.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/gob.h" diff --git a/engines/gob/map.h b/engines/gob/map.h index 48a9d1d4ac2..856cf356da0 100644 --- a/engines/gob/map.h +++ b/engines/gob/map.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_MAP_H diff --git a/engines/gob/map_v1.cpp b/engines/gob/map_v1.cpp index 372f5018873..45499b71fe4 100644 --- a/engines/gob/map_v1.cpp +++ b/engines/gob/map_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/memstream.h" diff --git a/engines/gob/map_v2.cpp b/engines/gob/map_v2.cpp index 42c98c4a80d..1db461370f1 100644 --- a/engines/gob/map_v2.cpp +++ b/engines/gob/map_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/stream.h" diff --git a/engines/gob/mult.cpp b/engines/gob/mult.cpp index f744f14fafc..06a7130cefb 100644 --- a/engines/gob/mult.cpp +++ b/engines/gob/mult.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/mult.h b/engines/gob/mult.h index fc83e2dbe36..860e5a12e17 100644 --- a/engines/gob/mult.h +++ b/engines/gob/mult.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_MULT_H diff --git a/engines/gob/mult_v1.cpp b/engines/gob/mult_v1.cpp index 78ee3e60f55..230d0d2b4cb 100644 --- a/engines/gob/mult_v1.cpp +++ b/engines/gob/mult_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/mult_v2.cpp b/engines/gob/mult_v2.cpp index 8018fb15c6f..6593565e6a0 100644 --- a/engines/gob/mult_v2.cpp +++ b/engines/gob/mult_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/palanim.cpp b/engines/gob/palanim.cpp index 755d28c6e92..42aeaf63eb8 100644 --- a/engines/gob/palanim.cpp +++ b/engines/gob/palanim.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/gob/palanim.h b/engines/gob/palanim.h index 6c91665b290..8d8a1e4388c 100644 --- a/engines/gob/palanim.h +++ b/engines/gob/palanim.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_PALANIM_H diff --git a/engines/gob/resources.cpp b/engines/gob/resources.cpp index 0c838ca2465..92eec0ee255 100644 --- a/engines/gob/resources.cpp +++ b/engines/gob/resources.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/gob/resources.h b/engines/gob/resources.h index dec64f6b7c1..39155c51769 100644 --- a/engines/gob/resources.h +++ b/engines/gob/resources.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_RESOURCES_H diff --git a/engines/gob/save/saveconverter.cpp b/engines/gob/save/saveconverter.cpp index 59d313138b4..ec8bcbcfea4 100644 --- a/engines/gob/save/saveconverter.cpp +++ b/engines/gob/save/saveconverter.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" @@ -304,7 +301,7 @@ bool SaveConverter::createStream(SaveWriter &writer) { } /* Stream functions. If the new save data stream is available, redirect the stream - * operations to that stream. Normal stream error behaviour if not. */ + * operations to that stream. Normal stream error behavior if not. */ bool SaveConverter::err() const { if (!_data || !_stream) diff --git a/engines/gob/save/saveconverter.h b/engines/gob/save/saveconverter.h index 8154377b641..d8cf723fd31 100644 --- a/engines/gob/save/saveconverter.h +++ b/engines/gob/save/saveconverter.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SAVE_SAVECONVERTER_H diff --git a/engines/gob/save/saveconverter_v2.cpp b/engines/gob/save/saveconverter_v2.cpp index 1260a262808..7661c478369 100644 --- a/engines/gob/save/saveconverter_v2.cpp +++ b/engines/gob/save/saveconverter_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/save/saveconverter_v3.cpp b/engines/gob/save/saveconverter_v3.cpp index 2f52c789c60..2256575c4be 100644 --- a/engines/gob/save/saveconverter_v3.cpp +++ b/engines/gob/save/saveconverter_v3.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/save/saveconverter_v4.cpp b/engines/gob/save/saveconverter_v4.cpp index ea5afaeebd4..2618a25f379 100644 --- a/engines/gob/save/saveconverter_v4.cpp +++ b/engines/gob/save/saveconverter_v4.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/save/savefile.cpp b/engines/gob/save/savefile.cpp index 45cd2a2b7d3..0713c38684c 100644 --- a/engines/gob/save/savefile.cpp +++ b/engines/gob/save/savefile.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/gob/save/savefile.h b/engines/gob/save/savefile.h index 22eb79f4bf7..01825207e04 100644 --- a/engines/gob/save/savefile.h +++ b/engines/gob/save/savefile.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SAVE_SAVEFILE_H diff --git a/engines/gob/save/savehandler.cpp b/engines/gob/save/savehandler.cpp index 21102ae7868..9e46f1db6f2 100644 --- a/engines/gob/save/savehandler.cpp +++ b/engines/gob/save/savehandler.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/save/savehandler.h b/engines/gob/save/savehandler.h index d12d6bca0dd..afc31f54f1b 100644 --- a/engines/gob/save/savehandler.h +++ b/engines/gob/save/savehandler.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SAVE_SAVEHANDLER_H diff --git a/engines/gob/save/saveload.cpp b/engines/gob/save/saveload.cpp index e490509914a..6b2f710159c 100644 --- a/engines/gob/save/saveload.cpp +++ b/engines/gob/save/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/gob.h" diff --git a/engines/gob/save/saveload.h b/engines/gob/save/saveload.h index dc1c1845048..4d51a5b51c5 100644 --- a/engines/gob/save/saveload.h +++ b/engines/gob/save/saveload.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SAVE_SAVELOAD_H diff --git a/engines/gob/save/saveload_fascin.cpp b/engines/gob/save/saveload_fascin.cpp index 6c3d22ecf39..cf1e7f0c0cd 100644 --- a/engines/gob/save/saveload_fascin.cpp +++ b/engines/gob/save/saveload_fascin.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/save/saveload.h" diff --git a/engines/gob/save/saveload_inca2.cpp b/engines/gob/save/saveload_inca2.cpp index 5fa1b69fa7e..4c3aaf5a0e2 100644 --- a/engines/gob/save/saveload_inca2.cpp +++ b/engines/gob/save/saveload_inca2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/save/saveload.h" diff --git a/engines/gob/save/saveload_playtoons.cpp b/engines/gob/save/saveload_playtoons.cpp index 3f578ce928a..93c1b68b0cc 100644 --- a/engines/gob/save/saveload_playtoons.cpp +++ b/engines/gob/save/saveload_playtoons.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/save/saveload.h" diff --git a/engines/gob/save/saveload_v2.cpp b/engines/gob/save/saveload_v2.cpp index ea639b861a8..b25d4788f75 100644 --- a/engines/gob/save/saveload_v2.cpp +++ b/engines/gob/save/saveload_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/save/saveload.h" diff --git a/engines/gob/save/saveload_v3.cpp b/engines/gob/save/saveload_v3.cpp index 39edddb66fe..3e7a3b9e487 100644 --- a/engines/gob/save/saveload_v3.cpp +++ b/engines/gob/save/saveload_v3.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/save/saveload.h" diff --git a/engines/gob/save/saveload_v4.cpp b/engines/gob/save/saveload_v4.cpp index e6973efd64b..95283db3366 100644 --- a/engines/gob/save/saveload_v4.cpp +++ b/engines/gob/save/saveload_v4.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/save/saveload.h" diff --git a/engines/gob/save/saveload_v6.cpp b/engines/gob/save/saveload_v6.cpp index 248fe0a93f8..c524cad3528 100644 --- a/engines/gob/save/saveload_v6.cpp +++ b/engines/gob/save/saveload_v6.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/save/saveload.h" diff --git a/engines/gob/save/saveload_v7.cpp b/engines/gob/save/saveload_v7.cpp index 2693617798a..3753b4019f1 100644 --- a/engines/gob/save/saveload_v7.cpp +++ b/engines/gob/save/saveload_v7.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/save/saveload.h" diff --git a/engines/gob/scenery.cpp b/engines/gob/scenery.cpp index 9f3a908329e..bb50818ed8a 100644 --- a/engines/gob/scenery.cpp +++ b/engines/gob/scenery.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/scenery.h b/engines/gob/scenery.h index 21bf29deda3..d8312b1128c 100644 --- a/engines/gob/scenery.h +++ b/engines/gob/scenery.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SCENERY_H diff --git a/engines/gob/scenery_v1.cpp b/engines/gob/scenery_v1.cpp index 605b0986935..46ceb354575 100644 --- a/engines/gob/scenery_v1.cpp +++ b/engines/gob/scenery_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/scenery_v2.cpp b/engines/gob/scenery_v2.cpp index 1a0de6f2910..16ce0771693 100644 --- a/engines/gob/scenery_v2.cpp +++ b/engines/gob/scenery_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/script.cpp b/engines/gob/script.cpp index eb374512292..c7e39f94afd 100644 --- a/engines/gob/script.cpp +++ b/engines/gob/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/gob/script.h b/engines/gob/script.h index 0e8ac0d69f3..0095ad0cb6d 100644 --- a/engines/gob/script.h +++ b/engines/gob/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SCRIPT_H diff --git a/engines/gob/sound/adlib.cpp b/engines/gob/sound/adlib.cpp index 4244df68e59..f1ab2a2d791 100644 --- a/engines/gob/sound/adlib.cpp +++ b/engines/gob/sound/adlib.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/gob/sound/adlib.h b/engines/gob/sound/adlib.h index 090841b9d65..934e9966eb5 100644 --- a/engines/gob/sound/adlib.h +++ b/engines/gob/sound/adlib.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SOUND_ADLIB_H diff --git a/engines/gob/sound/bgatmosphere.cpp b/engines/gob/sound/bgatmosphere.cpp index b351d922756..daba72b2d5b 100644 --- a/engines/gob/sound/bgatmosphere.cpp +++ b/engines/gob/sound/bgatmosphere.cpp @@ -18,12 +18,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ -#include "common/EventRecorder.h" +#include "common/array.h" #include "gob/sound/bgatmosphere.h" #include "gob/sound/sounddesc.h" @@ -31,14 +28,12 @@ namespace Gob { BackgroundAtmosphere::BackgroundAtmosphere(Audio::Mixer &mixer) : - SoundMixer(mixer, Audio::Mixer::kMusicSoundType) { + SoundMixer(mixer, Audio::Mixer::kMusicSoundType), _rnd("gobBA") { _playMode = kPlayModeLinear; _queuePos = -1; _shaded = false; _shadable = true; - - g_eventRec.registerRandomSource(_rnd, "gobBA"); } BackgroundAtmosphere::~BackgroundAtmosphere() { diff --git a/engines/gob/sound/bgatmosphere.h b/engines/gob/sound/bgatmosphere.h index 7e58c0b4e92..e88b91d5406 100644 --- a/engines/gob/sound/bgatmosphere.h +++ b/engines/gob/sound/bgatmosphere.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SOUND_BGATMOSPHERE_H diff --git a/engines/gob/sound/cdrom.cpp b/engines/gob/sound/cdrom.cpp index 217aa9c18ed..4ce3372562a 100644 --- a/engines/gob/sound/cdrom.cpp +++ b/engines/gob/sound/cdrom.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/sound/cdrom.h b/engines/gob/sound/cdrom.h index 894744ca154..09d4c94865f 100644 --- a/engines/gob/sound/cdrom.h +++ b/engines/gob/sound/cdrom.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SOUND_CDROM_H diff --git a/engines/gob/sound/infogrames.cpp b/engines/gob/sound/infogrames.cpp index 9fb74107402..febf91719b7 100644 --- a/engines/gob/sound/infogrames.cpp +++ b/engines/gob/sound/infogrames.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/gob/sound/infogrames.h b/engines/gob/sound/infogrames.h index cdcb0a7c390..ee5ffd1cff4 100644 --- a/engines/gob/sound/infogrames.h +++ b/engines/gob/sound/infogrames.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SOUND_INFOGRAMES_H diff --git a/engines/gob/sound/pcspeaker.cpp b/engines/gob/sound/pcspeaker.cpp index 61402eb30ec..bc031e279f7 100644 --- a/engines/gob/sound/pcspeaker.cpp +++ b/engines/gob/sound/pcspeaker.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/sound/pcspeaker.h" diff --git a/engines/gob/sound/pcspeaker.h b/engines/gob/sound/pcspeaker.h index f83d65a6152..fe0ec872e3f 100644 --- a/engines/gob/sound/pcspeaker.h +++ b/engines/gob/sound/pcspeaker.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SOUND_PCSPEAKER_H diff --git a/engines/gob/sound/protracker.cpp b/engines/gob/sound/protracker.cpp index 445d8f8cfb0..fbc03256bbc 100644 --- a/engines/gob/sound/protracker.cpp +++ b/engines/gob/sound/protracker.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/gob/sound/protracker.h b/engines/gob/sound/protracker.h index 0397efb3b72..b4c3be1f612 100644 --- a/engines/gob/sound/protracker.h +++ b/engines/gob/sound/protracker.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SOUND_PROTRACKER_H diff --git a/engines/gob/sound/sound.cpp b/engines/gob/sound/sound.cpp index 1aa63eb9408..0ad17c1e33a 100644 --- a/engines/gob/sound/sound.cpp +++ b/engines/gob/sound/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/gob.h" diff --git a/engines/gob/sound/sound.h b/engines/gob/sound/sound.h index 24e161154b7..585cf367038 100644 --- a/engines/gob/sound/sound.h +++ b/engines/gob/sound/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SOUND_SOUND_H diff --git a/engines/gob/sound/soundblaster.cpp b/engines/gob/sound/soundblaster.cpp index 69610dc9491..4ff555b0e3e 100644 --- a/engines/gob/sound/soundblaster.cpp +++ b/engines/gob/sound/soundblaster.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/sound/soundblaster.h" diff --git a/engines/gob/sound/soundblaster.h b/engines/gob/sound/soundblaster.h index ffe46801dc9..c2704c5482a 100644 --- a/engines/gob/sound/soundblaster.h +++ b/engines/gob/sound/soundblaster.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SOUND_SOUNDBLASTER_H diff --git a/engines/gob/sound/sounddesc.cpp b/engines/gob/sound/sounddesc.cpp index cc1c6b1f6b8..7d876ec4844 100644 --- a/engines/gob/sound/sounddesc.cpp +++ b/engines/gob/sound/sounddesc.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/gob/sound/sounddesc.h b/engines/gob/sound/sounddesc.h index 07eb73e7c8e..f9223de964f 100644 --- a/engines/gob/sound/sounddesc.h +++ b/engines/gob/sound/sounddesc.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SOUND_SOUNDDESC_H diff --git a/engines/gob/sound/soundmixer.cpp b/engines/gob/sound/soundmixer.cpp index 3b6b2e5d52d..a9303bc9274 100644 --- a/engines/gob/sound/soundmixer.cpp +++ b/engines/gob/sound/soundmixer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/gob/sound/soundmixer.h b/engines/gob/sound/soundmixer.h index 5b283b2d84d..2847c3de125 100644 --- a/engines/gob/sound/soundmixer.h +++ b/engines/gob/sound/soundmixer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SOUND_SOUNDMIXER_H diff --git a/engines/gob/surface.cpp b/engines/gob/surface.cpp index 7bd8aae5977..e294209ed70 100644 --- a/engines/gob/surface.cpp +++ b/engines/gob/surface.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/surface.h" diff --git a/engines/gob/surface.h b/engines/gob/surface.h index b84927af70f..866e63490f0 100644 --- a/engines/gob/surface.h +++ b/engines/gob/surface.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SURFACE_H diff --git a/engines/gob/totfile.cpp b/engines/gob/totfile.cpp index 82dd0c38c02..4efe3747935 100644 --- a/engines/gob/totfile.cpp +++ b/engines/gob/totfile.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/str.h" diff --git a/engines/gob/totfile.h b/engines/gob/totfile.h index ce467425e2a..5a23912dbe8 100644 --- a/engines/gob/totfile.h +++ b/engines/gob/totfile.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_TOTFILE_H diff --git a/engines/gob/util.cpp b/engines/gob/util.cpp index 787f85175a8..6d83745602f 100644 --- a/engines/gob/util.cpp +++ b/engines/gob/util.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/gob/util.h b/engines/gob/util.h index 262bff0a7a2..a6a689c1d2c 100644 --- a/engines/gob/util.h +++ b/engines/gob/util.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_UTIL_H diff --git a/engines/gob/variables.cpp b/engines/gob/variables.cpp index 94cfadb9a00..efbf10af69a 100644 --- a/engines/gob/variables.cpp +++ b/engines/gob/variables.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/variables.h b/engines/gob/variables.h index d092a8bc4c3..04775ff86c3 100644 --- a/engines/gob/variables.h +++ b/engines/gob/variables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_VARIABLES_H diff --git a/engines/gob/video.cpp b/engines/gob/video.cpp index 1d74a07bfc6..ee5ff4abff7 100644 --- a/engines/gob/video.cpp +++ b/engines/gob/video.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/video.h b/engines/gob/video.h index 69cdfe49ed8..ecbb579c5fb 100644 --- a/engines/gob/video.h +++ b/engines/gob/video.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_VIDEO_H diff --git a/engines/gob/video_v1.cpp b/engines/gob/video_v1.cpp index 5c2f17d7dd2..397e2bef227 100644 --- a/engines/gob/video_v1.cpp +++ b/engines/gob/video_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/video_v2.cpp b/engines/gob/video_v2.cpp index c908ccf7b17..bf4823ec902 100644 --- a/engines/gob/video_v2.cpp +++ b/engines/gob/video_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/video_v6.cpp b/engines/gob/video_v6.cpp index 23610aded16..e2c952952d8 100644 --- a/engines/gob/video_v6.cpp +++ b/engines/gob/video_v6.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp index de149c97870..651c9a31549 100644 --- a/engines/gob/videoplayer.cpp +++ b/engines/gob/videoplayer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/gob/videoplayer.h b/engines/gob/videoplayer.h index 15f1f066ab0..373832939ab 100644 --- a/engines/gob/videoplayer.h +++ b/engines/gob/videoplayer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_VIDEOPLAYER_H diff --git a/engines/groovie/cell.cpp b/engines/groovie/cell.cpp index e59115cdf5e..82415791564 100644 --- a/engines/groovie/cell.cpp +++ b/engines/groovie/cell.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "groovie/cell.h" diff --git a/engines/groovie/cell.h b/engines/groovie/cell.h index a5feab4017c..32c7b465477 100644 --- a/engines/groovie/cell.h +++ b/engines/groovie/cell.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_CELL_H diff --git a/engines/groovie/cursor.cpp b/engines/groovie/cursor.cpp index 8b62b829e19..abefac54bd7 100644 --- a/engines/groovie/cursor.cpp +++ b/engines/groovie/cursor.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "groovie/cursor.h" diff --git a/engines/groovie/cursor.h b/engines/groovie/cursor.h index e40dc0c4860..87d994b077f 100644 --- a/engines/groovie/cursor.h +++ b/engines/groovie/cursor.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_CURSOR_H diff --git a/engines/groovie/debug.cpp b/engines/groovie/debug.cpp index 0b70e4f83a5..74fe22922c8 100644 --- a/engines/groovie/debug.cpp +++ b/engines/groovie/debug.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "groovie/debug.h" diff --git a/engines/groovie/debug.h b/engines/groovie/debug.h index e21746a426f..76f6d16c655 100644 --- a/engines/groovie/debug.h +++ b/engines/groovie/debug.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_DEBUG_H diff --git a/engines/groovie/detection.cpp b/engines/groovie/detection.cpp index 00116d6e00b..87ad534c96d 100644 --- a/engines/groovie/detection.cpp +++ b/engines/groovie/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "groovie/groovie.h" @@ -236,7 +233,7 @@ public: GroovieMetaEngine() : AdvancedMetaEngine(detectionParams) {} const char *getName() const { - return "Groovie Engine"; + return "Groovie"; } const char *getOriginalCopyright() const { diff --git a/engines/groovie/detection.h b/engines/groovie/detection.h index 2304377a112..aa900cc54da 100644 --- a/engines/groovie/detection.h +++ b/engines/groovie/detection.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_DETECTION_H diff --git a/engines/groovie/font.cpp b/engines/groovie/font.cpp index 13d0df0005d..d29c22dd026 100644 --- a/engines/groovie/font.cpp +++ b/engines/groovie/font.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/array.h" diff --git a/engines/groovie/font.h b/engines/groovie/font.h index 71f8393d285..20aaa4cf236 100644 --- a/engines/groovie/font.h +++ b/engines/groovie/font.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_FONT_H diff --git a/engines/groovie/graphics.cpp b/engines/groovie/graphics.cpp index 71ee231b808..c3ca03750ac 100644 --- a/engines/groovie/graphics.cpp +++ b/engines/groovie/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "groovie/graphics.h" diff --git a/engines/groovie/graphics.h b/engines/groovie/graphics.h index a405822c9c7..c91d895c256 100644 --- a/engines/groovie/graphics.h +++ b/engines/groovie/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_GRAPHICS_H diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp index 71b83b9baa4..9027262a0ce 100644 --- a/engines/groovie/groovie.cpp +++ b/engines/groovie/groovie.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "groovie/groovie.h" diff --git a/engines/groovie/groovie.h b/engines/groovie/groovie.h index 6f1e5bb52e8..eb64cfc60a3 100644 --- a/engines/groovie/groovie.h +++ b/engines/groovie/groovie.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_H diff --git a/engines/groovie/lzss.cpp b/engines/groovie/lzss.cpp index 889a12bd123..a09f6e2311c 100644 --- a/engines/groovie/lzss.cpp +++ b/engines/groovie/lzss.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "groovie/lzss.h" diff --git a/engines/groovie/lzss.h b/engines/groovie/lzss.h index f78bc203516..f60ea14815b 100644 --- a/engines/groovie/lzss.h +++ b/engines/groovie/lzss.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/stream.h" diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp index 70e3abd55ff..26b34580376 100644 --- a/engines/groovie/music.cpp +++ b/engines/groovie/music.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "groovie/music.h" diff --git a/engines/groovie/music.h b/engines/groovie/music.h index 107e52a67c3..5ef6a8e076c 100644 --- a/engines/groovie/music.h +++ b/engines/groovie/music.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_MUSIC_H diff --git a/engines/groovie/player.cpp b/engines/groovie/player.cpp index 090d99e7682..e2a1ff3d566 100644 --- a/engines/groovie/player.cpp +++ b/engines/groovie/player.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/groovie/player.h b/engines/groovie/player.h index e75a5fc3c0d..d8135a99b28 100644 --- a/engines/groovie/player.h +++ b/engines/groovie/player.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_PLAYER_H diff --git a/engines/groovie/resource.cpp b/engines/groovie/resource.cpp index 5701f3a73d9..10cf24a589d 100644 --- a/engines/groovie/resource.cpp +++ b/engines/groovie/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/archive.h" diff --git a/engines/groovie/resource.h b/engines/groovie/resource.h index 0a9a03b42c5..33e15e6b98c 100644 --- a/engines/groovie/resource.h +++ b/engines/groovie/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_RESOURCE_H diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index be9c4f69210..7f477c41fa8 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // ROQ video player based on this specification by Dr. Tim Ferguson: diff --git a/engines/groovie/roq.h b/engines/groovie/roq.h index fd5af9300cd..ddb307065cd 100644 --- a/engines/groovie/roq.h +++ b/engines/groovie/roq.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_ROQ_H diff --git a/engines/groovie/saveload.cpp b/engines/groovie/saveload.cpp index 4e3e4cfcf81..a0463db0bea 100644 --- a/engines/groovie/saveload.cpp +++ b/engines/groovie/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "groovie/saveload.h" diff --git a/engines/groovie/saveload.h b/engines/groovie/saveload.h index 24a0ddfbf85..15ce108c7dd 100644 --- a/engines/groovie/saveload.h +++ b/engines/groovie/saveload.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_SAVELOAD_H diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp index 5c9f119d815..b52a8723fc2 100644 --- a/engines/groovie/script.cpp +++ b/engines/groovie/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "groovie/script.h" @@ -36,7 +33,7 @@ #include "common/archive.h" #include "common/config-manager.h" #include "common/debug-channels.h" -#include "common/EventRecorder.h" +#include "common/events.h" #include "common/file.h" #include "common/macresman.h" @@ -69,7 +66,7 @@ static void debugScript(int level, bool nl, const char *s, ...) { Script::Script(GroovieEngine *vm, EngineVersion version) : _code(NULL), _savedCode(NULL), _stacktop(0), _debugger(NULL), _vm(vm), _videoFile(NULL), _videoRef(0), _staufsMove(NULL), _lastCursor(0xff), - _version(version) { + _version(version), _random("GroovieScripts") { // Initialize the opcode set depending on the engine version switch (version) { @@ -81,9 +78,6 @@ Script::Script(GroovieEngine *vm, EngineVersion version) : break; } - // Initialize the random source - g_eventRec.registerRandomSource(_random, "GroovieScripts"); - // Prepare the variables _bitflags = 0; for (int i = 0; i < 0x400; i++) { diff --git a/engines/groovie/script.h b/engines/groovie/script.h index c5ad6da78be..8cd790af5ec 100644 --- a/engines/groovie/script.h +++ b/engines/groovie/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_SCRIPT_H diff --git a/engines/groovie/vdx.cpp b/engines/groovie/vdx.cpp index b6f06d70115..b3fcf462b24 100644 --- a/engines/groovie/vdx.cpp +++ b/engines/groovie/vdx.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "groovie/vdx.h" diff --git a/engines/groovie/vdx.h b/engines/groovie/vdx.h index 31c7606cb7a..ebe58cb1192 100644 --- a/engines/groovie/vdx.h +++ b/engines/groovie/vdx.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_VDX_H diff --git a/engines/hugo/console.cpp b/engines/hugo/console.cpp index 3ff37ccbc71..0a67b5cd0ae 100644 --- a/engines/hugo/console.cpp +++ b/engines/hugo/console.cpp @@ -18,20 +18,135 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "hugo/console.h" #include "hugo/hugo.h" +#include "hugo/object.h" +#include "hugo/parser.h" +#include "hugo/schedule.h" +#include "hugo/text.h" namespace Hugo { HugoConsole::HugoConsole(HugoEngine *vm) : GUI::Debugger(), _vm(vm) { + DCmd_Register("listscreens", WRAP_METHOD(HugoConsole, Cmd_listScreens)); + DCmd_Register("listobjects", WRAP_METHOD(HugoConsole, Cmd_listObjects)); + DCmd_Register("getobject", WRAP_METHOD(HugoConsole, Cmd_getObject)); + DCmd_Register("getallobjects", WRAP_METHOD(HugoConsole, Cmd_getAllObjects)); + DCmd_Register("gotoscreen", WRAP_METHOD(HugoConsole, Cmd_gotoScreen)); + DCmd_Register("Boundaries", WRAP_METHOD(HugoConsole, Cmd_boundaries)); } HugoConsole::~HugoConsole() { } +static int strToInt(const char *s) { + if (!*s) + // No string at all + return 0; + else if (toupper(s[strlen(s) - 1]) != 'H') + // Standard decimal string + return atoi(s); + + // Hexadecimal string + uint tmp = 0; + int read = sscanf(s, "%xh", &tmp); + if (read < 1) + error("strToInt failed on string \"%s\"", s); + return (int)tmp; +} + +/** + * This command loads up the specified screen number + */ +bool HugoConsole::Cmd_gotoScreen(int argc, const char **argv) { + if ((argc != 2) || (strToInt(argv[1]) > _vm->_numScreens)){ + DebugPrintf("Usage: %s \n", argv[0]); + return true; + } + + _vm->_scheduler->newScreen(strToInt(argv[1])); + return false; +} + +/** + * This command lists all the screens available + */ +bool HugoConsole::Cmd_listScreens(int argc, const char **argv) { + if (argc != 1) { + DebugPrintf("Usage: %s\n", argv[0]); + return true; + } + + DebugPrintf("Available screens for this game are:\n"); + for (int i = 0; i < _vm->_numScreens; i++) + DebugPrintf("%2d - %s\n", i, _vm->_text->getScreenNames(i)); + return true; +} + +/** + * This command lists all the objects available + */ +bool HugoConsole::Cmd_listObjects(int argc, const char **argv) { + if (argc != 1) { + DebugPrintf("Usage: %s\n", argv[0]); + return true; + } + + DebugPrintf("Available objects for this game are:\n"); + for (int i = 0; i < _vm->_object->_numObj; i++) { + if (_vm->_object->_objects[i].genericCmd & TAKE) + DebugPrintf("%2d - %s\n", i, _vm->_text->getNoun(_vm->_object->_objects[i].nounIndex, 2)); + } + return true; +} + +/** + * This command puts an object in the inventory + */ +bool HugoConsole::Cmd_getObject(int argc, const char **argv) { + if ((argc != 2) || (strToInt(argv[1]) > _vm->_object->_numObj)) { + DebugPrintf("Usage: %s \n", argv[0]); + return true; + } + + if (_vm->_object->_objects[strToInt(argv[1])].genericCmd & TAKE) + _vm->_parser->takeObject(&_vm->_object->_objects[strToInt(argv[1])]); + else + DebugPrintf("Object not available\n"); + + return true; +} + +/** + * This command puts all the available objects in the inventory + */ +bool HugoConsole::Cmd_getAllObjects(int argc, const char **argv) { + if (argc != 1) { + DebugPrintf("Usage: %s\n", argv[0]); + return true; + } + + for (int i = 0; i < _vm->_object->_numObj; i++) { + if (_vm->_object->_objects[i].genericCmd & TAKE) + _vm->_parser->takeObject(&_vm->_object->_objects[i]); + } + + return false; +} + +/** + * This command shows and hides boundaries + */ +bool HugoConsole::Cmd_boundaries(int argc, const char **argv) { + if (argc != 1) { + DebugPrintf("Usage: %s\n", argv[0]); + return true; + } + + _vm->getGameStatus().showBoundariesFl = !_vm->getGameStatus().showBoundariesFl; + return false; +} + } // End of namespace Hugo diff --git a/engines/hugo/console.h b/engines/hugo/console.h index 240b108ab67..16317e83d54 100644 --- a/engines/hugo/console.h +++ b/engines/hugo/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef HUGO_CONSOLE_H @@ -39,6 +36,12 @@ public: private: HugoEngine *_vm; + bool Cmd_listScreens(int argc, const char **argv); + bool Cmd_listObjects(int argc, const char **argv); + bool Cmd_getObject(int argc, const char **argv); + bool Cmd_getAllObjects(int argc, const char **argv); + bool Cmd_gotoScreen(int argc, const char **argv); + bool Cmd_boundaries(int argc, const char **argv); }; } // End of namespace Hugo diff --git a/engines/hugo/detection.cpp b/engines/hugo/detection.cpp index 95302c9235d..25b8b16084e 100644 --- a/engines/hugo/detection.cpp +++ b/engines/hugo/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "engines/advancedDetector.h" @@ -164,7 +161,7 @@ public: HugoMetaEngine() : AdvancedMetaEngine(detectionParams) {} const char *getName() const { - return "Hugo Engine"; + return "Hugo"; } const char *getOriginalCopyright() const { diff --git a/engines/hugo/dialogs.cpp b/engines/hugo/dialogs.cpp index f0dc84eae86..6c816141f70 100644 --- a/engines/hugo/dialogs.cpp +++ b/engines/hugo/dialogs.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/substream.h" diff --git a/engines/hugo/dialogs.h b/engines/hugo/dialogs.h index 56dbd41f812..4e710ff2f83 100644 --- a/engines/hugo/dialogs.h +++ b/engines/hugo/dialogs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef HUGO_DIALOGS_H diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp index af4d094ceb0..c716e80d875 100644 --- a/engines/hugo/display.cpp +++ b/engines/hugo/display.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -647,13 +644,13 @@ bool Screen::isOverlapping(const rect_t *rectA, const rect_t *rectB) const { } /** - * Display active boundaries in God Mode ('PPG') + * Display active boundaries (activated in the console) * Light Red = Exit hotspots * Light Green = Visible objects - * White = Fixed objects, parts of background + * White = Fix objects, parts of background */ void Screen::drawBoundaries() { - if (!_vm->getGameStatus().godModeFl) + if (!_vm->getGameStatus().showBoundariesFl) return; _vm->_mouse->drawHotspots(); diff --git a/engines/hugo/display.h b/engines/hugo/display.h index 91e1752df0e..38c63e9fe55 100644 --- a/engines/hugo/display.h +++ b/engines/hugo/display.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/file.cpp b/engines/hugo/file.cpp index ba4e4201111..cde6e108eac 100644 --- a/engines/hugo/file.cpp +++ b/engines/hugo/file.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/file.h b/engines/hugo/file.h index 0e131348f93..3792c01ab47 100644 --- a/engines/hugo/file.h +++ b/engines/hugo/file.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/file_v1d.cpp b/engines/hugo/file_v1d.cpp index 021969f3069..9ebd9d284cb 100644 --- a/engines/hugo/file_v1d.cpp +++ b/engines/hugo/file_v1d.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/file_v1w.cpp b/engines/hugo/file_v1w.cpp index 4f327b3095e..eb2226f18a7 100644 --- a/engines/hugo/file_v1w.cpp +++ b/engines/hugo/file_v1w.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/file_v2d.cpp b/engines/hugo/file_v2d.cpp index 0ad89e987e6..2a663edcfa3 100644 --- a/engines/hugo/file_v2d.cpp +++ b/engines/hugo/file_v2d.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/file_v2w.cpp b/engines/hugo/file_v2w.cpp index 245d4d017e9..1384f02df65 100644 --- a/engines/hugo/file_v2w.cpp +++ b/engines/hugo/file_v2w.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/file_v3d.cpp b/engines/hugo/file_v3d.cpp index 6370fffa4df..7ac0ffc48ac 100644 --- a/engines/hugo/file_v3d.cpp +++ b/engines/hugo/file_v3d.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/game.h b/engines/hugo/game.h index 08e8deb0017..5db57789dc6 100644 --- a/engines/hugo/game.h +++ b/engines/hugo/game.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp index a872a97bae7..a08dbc094b3 100644 --- a/engines/hugo/hugo.cpp +++ b/engines/hugo/hugo.cpp @@ -18,16 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" #include "common/random.h" #include "common/error.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/debug-channels.h" #include "common/config-manager.h" #include "common/textconsole.h" @@ -531,15 +527,16 @@ void HugoEngine::initPlaylist(bool playlist[kMaxTunes]) { */ void HugoEngine::initStatus() { debugC(1, kDebugEngine, "initStatus"); - _status.storyModeFl = false; // Not in story mode - _status.gameOverFl = false; // Hero not knobbled yet - _status.lookFl = false; // Toolbar "look" button - _status.recallFl = false; // Toolbar "recall" button - _status.newScreenFl = false; // Screen not just loaded - _status.godModeFl = false; // No special cheats allowed - _status.doQuitFl = false; - _status.skipIntroFl = false; - _status.helpFl = false; + _status.storyModeFl = false; // Not in story mode + _status.gameOverFl = false; // Hero not knobbled yet + _status.lookFl = false; // Toolbar "look" button + _status.recallFl = false; // Toolbar "recall" button + _status.newScreenFl = false; // Screen not just loaded + _status.godModeFl = false; // No special cheats allowed + _status.showBoundariesFl = false; // Boundaries hidden by default + _status.doQuitFl = false; + _status.skipIntroFl = false; + _status.helpFl = false; // Initialize every start of new game _status.tick = 0; // Tick count @@ -597,10 +594,9 @@ void HugoEngine::initialize() { _scheduler->initEventQueue(); // Init scheduler stuff _screen->initDisplay(); // Create Dibs and palette _file->openDatabaseFiles(); // Open database files - calcMaxScore(); // Initialise maxscore + calcMaxScore(); // Initialize maxscore - _rnd = new Common::RandomSource(); - g_eventRec.registerRandomSource(*_rnd, "hugo"); + _rnd = new Common::RandomSource("hugo"); _rnd->setSeed(42); // Kick random number generator switch (_gameVariant) { diff --git a/engines/hugo/hugo.h b/engines/hugo/hugo.h index b2d241f241f..b5b8d5ea618 100644 --- a/engines/hugo/hugo.h +++ b/engines/hugo/hugo.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef HUGO_H @@ -180,6 +177,8 @@ struct status_t { // Game status (not saved) bool recallFl; // Toolbar "recall" button pressed bool newScreenFl; // New screen just loaded in dib_a bool godModeFl; // Allow DEBUG features in live version + bool showBoundariesFl; // Flag used to show and hide boundaries, + // used by the console bool doQuitFl; bool skipIntroFl; bool helpFl; diff --git a/engines/hugo/intro.cpp b/engines/hugo/intro.cpp index c31d76abd0b..c66c0ef6249 100644 --- a/engines/hugo/intro.cpp +++ b/engines/hugo/intro.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/intro.h b/engines/hugo/intro.h index 772d98e244c..1bb039216a9 100644 --- a/engines/hugo/intro.h +++ b/engines/hugo/intro.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/inventory.cpp b/engines/hugo/inventory.cpp index 45893f6965a..410c4e715c4 100644 --- a/engines/hugo/inventory.cpp +++ b/engines/hugo/inventory.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/inventory.h b/engines/hugo/inventory.h index ec102f3cced..de9e4cd1f0e 100644 --- a/engines/hugo/inventory.h +++ b/engines/hugo/inventory.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/mouse.cpp b/engines/hugo/mouse.cpp index c02908e579f..d2d5b59dae1 100644 --- a/engines/hugo/mouse.cpp +++ b/engines/hugo/mouse.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/mouse.h b/engines/hugo/mouse.h index ae1974b726e..35f9e4e87eb 100644 --- a/engines/hugo/mouse.h +++ b/engines/hugo/mouse.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/object.cpp b/engines/hugo/object.cpp index acf9f6e50ce..e888a1d998d 100644 --- a/engines/hugo/object.cpp +++ b/engines/hugo/object.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/object.h b/engines/hugo/object.h index 41ea7768402..c0933729eb6 100644 --- a/engines/hugo/object.h +++ b/engines/hugo/object.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/object_v1d.cpp b/engines/hugo/object_v1d.cpp index 95bedf4fa28..ecdbb3b4c68 100644 --- a/engines/hugo/object_v1d.cpp +++ b/engines/hugo/object_v1d.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -61,7 +58,7 @@ ObjectHandler_v1d::~ObjectHandler_v1d() { void ObjectHandler_v1d::updateImages() { debugC(5, kDebugObject, "updateImages"); - // Initialise the index array to visible objects in current screen + // Initialize the index array to visible objects in current screen int num_objs = 0; byte objindex[kMaxObjNumb]; // Array of indeces to objects diff --git a/engines/hugo/object_v1w.cpp b/engines/hugo/object_v1w.cpp index 54becd82348..11c09176e5a 100644 --- a/engines/hugo/object_v1w.cpp +++ b/engines/hugo/object_v1w.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -61,7 +58,7 @@ ObjectHandler_v1w::~ObjectHandler_v1w() { void ObjectHandler_v1w::updateImages() { debugC(5, kDebugObject, "updateImages"); - // Initialise the index array to visible objects in current screen + // Initialize the index array to visible objects in current screen int num_objs = 0; byte objindex[kMaxObjNumb]; // Array of indeces to objects diff --git a/engines/hugo/object_v2d.cpp b/engines/hugo/object_v2d.cpp index 7c47bf4f923..c9e51049726 100644 --- a/engines/hugo/object_v2d.cpp +++ b/engines/hugo/object_v2d.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -61,7 +58,7 @@ ObjectHandler_v2d::~ObjectHandler_v2d() { void ObjectHandler_v2d::updateImages() { debugC(5, kDebugObject, "updateImages"); - // Initialise the index array to visible objects in current screen + // Initialize the index array to visible objects in current screen int num_objs = 0; byte objindex[kMaxObjNumb]; // Array of indeces to objects diff --git a/engines/hugo/object_v3d.cpp b/engines/hugo/object_v3d.cpp index 3ff6c56ad3c..07bd5e0c7f4 100644 --- a/engines/hugo/object_v3d.cpp +++ b/engines/hugo/object_v3d.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp index 29a1d5efa32..4a53d67377e 100644 --- a/engines/hugo/parser.cpp +++ b/engines/hugo/parser.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/parser.h b/engines/hugo/parser.h index b00b8d5c438..faa6dc23035 100644 --- a/engines/hugo/parser.h +++ b/engines/hugo/parser.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -100,6 +97,7 @@ public: virtual void lineHandler() = 0; virtual void showInventory() const = 0; + virtual void takeObject(object_t *obj) = 0; protected: HugoEngine *_vm; @@ -138,10 +136,10 @@ public: virtual void lineHandler(); virtual void showInventory() const; + virtual void takeObject(object_t *obj); protected: - virtual void dropObject(object_t *obj); - virtual void takeObject(object_t *obj); + virtual void dropObject(object_t *obj); const char *findNextNoun(const char *noun) const; bool isBackgroundWord_v1(const char *noun, const char *verb, objectList_t obj) const; diff --git a/engines/hugo/parser_v1d.cpp b/engines/hugo/parser_v1d.cpp index b2e515fd42c..ccd428311b6 100644 --- a/engines/hugo/parser_v1d.cpp +++ b/engines/hugo/parser_v1d.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/parser_v1w.cpp b/engines/hugo/parser_v1w.cpp index a39063357bc..b1657c3bf40 100644 --- a/engines/hugo/parser_v1w.cpp +++ b/engines/hugo/parser_v1w.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/parser_v2d.cpp b/engines/hugo/parser_v2d.cpp index 6233f11c293..0095c4d7267 100644 --- a/engines/hugo/parser_v2d.cpp +++ b/engines/hugo/parser_v2d.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/parser_v3d.cpp b/engines/hugo/parser_v3d.cpp index 8c4946c5341..b45e9186b36 100644 --- a/engines/hugo/parser_v3d.cpp +++ b/engines/hugo/parser_v3d.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/route.cpp b/engines/hugo/route.cpp index 68b659cd3ff..af8ec3427d1 100644 --- a/engines/hugo/route.cpp +++ b/engines/hugo/route.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/route.h b/engines/hugo/route.h index 83a36f27ef3..a95dd2151b1 100644 --- a/engines/hugo/route.h +++ b/engines/hugo/route.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/schedule.cpp b/engines/hugo/schedule.cpp index 0e91124a7ed..a099bec21c1 100644 --- a/engines/hugo/schedule.cpp +++ b/engines/hugo/schedule.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -64,7 +61,7 @@ void Scheduler::initCypher() { } /** - * Initialise the timer event queue + * Initialize the timer event queue */ void Scheduler::initEventQueue() { debugC(1, kDebugSchedule, "initEventQueue"); @@ -162,7 +159,7 @@ void Scheduler::processBonus(const int bonusIndex) { * 2. Set the new screen (in the hero object and any carried objects) * 3. Read in the screen files for the new screen * 4. Schedule action list for new screen - * 5. Initialise prompt line and status line + * 5. Initialize prompt line and status line */ void Scheduler::newScreen(const int screenIndex) { debugC(1, kDebugSchedule, "newScreen(%d)", screenIndex); @@ -196,7 +193,7 @@ void Scheduler::newScreen(const int screenIndex) { // 4. Schedule action list for this screen _vm->_scheduler->screenActions(screenIndex); - // 5. Initialise prompt line and status line + // 5. Initialize prompt line and status line _vm->_screen->initNewScreenDisplay(); } @@ -204,7 +201,7 @@ void Scheduler::newScreen(const int screenIndex) { * Transition to a new screen as follows: * 1. Set the new screen (in the hero object and any carried objects) * 2. Read in the screen files for the new screen - * 3. Initialise prompt line and status line + * 3. Initialize prompt line and status line */ void Scheduler::restoreScreen(const int screenIndex) { debugC(1, kDebugSchedule, "restoreScreen(%d)", screenIndex); @@ -215,7 +212,7 @@ void Scheduler::restoreScreen(const int screenIndex) { // 2. Read in new screen files _vm->readScreenFiles(screenIndex); - // 3. Initialise prompt line and status line + // 3. Initialize prompt line and status line _vm->_screen->initNewScreenDisplay(); } @@ -1138,7 +1135,7 @@ void Scheduler::restoreEvents(Common::ReadStream *f) { void Scheduler::insertAction(act *action) { debugC(1, kDebugSchedule, "insertAction() - Action type A%d", action->a0.actType); - // First, get and initialise the event structure + // First, get and initialize the event structure event_t *curEvent = getQueue(); curEvent->action = action; switch (action->a0.actType) { // Assign whether local or global @@ -1211,7 +1208,7 @@ event_t *Scheduler::doAction(event_t *curEvent) { _vm->_object->_objects[action->a1.objIndex].cycleNumb = action->a1.cycleNumb; _vm->_object->_objects[action->a1.objIndex].cycling = action->a1.cycle; break; - case INIT_OBJXY: // act2: Initialise an object + case INIT_OBJXY: // act2: Initialize an object _vm->_object->_objects[action->a2.objIndex].x = action->a2.x; // Coordinates _vm->_object->_objects[action->a2.objIndex].y = action->a2.y; break; @@ -1221,13 +1218,13 @@ event_t *Scheduler::doAction(event_t *curEvent) { case BKGD_COLOR: // act4: Set new background color _vm->_screen->setBackgroundColor(action->a4.newBackgroundColor); break; - case INIT_OBJVXY: // act5: Initialise an object velocity + case INIT_OBJVXY: // act5: Initialize an object velocity _vm->_object->setVelocity(action->a5.objIndex, action->a5.vx, action->a5.vy); break; - case INIT_CARRY: // act6: Initialise an object + case INIT_CARRY: // act6: Initialize an object _vm->_object->setCarry(action->a6.objIndex, action->a6.carriedFl); // carried status break; - case INIT_HF_COORD: // act7: Initialise an object to hero's "feet" coords + case INIT_HF_COORD: // act7: Initialize an object to hero's "feet" coords _vm->_object->_objects[action->a7.objIndex].x = _vm->_hero->x - 1; _vm->_object->_objects[action->a7.objIndex].y = _vm->_hero->y + _vm->_hero->currImagePtr->y2 - 1; _vm->_object->_objects[action->a7.objIndex].screenIndex = *_vm->_screen_p; // Don't forget screen! @@ -1235,10 +1232,10 @@ event_t *Scheduler::doAction(event_t *curEvent) { case NEW_SCREEN: // act8: Start new screen newScreen(action->a8.screenIndex); break; - case INIT_OBJSTATE: // act9: Initialise an object state + case INIT_OBJSTATE: // act9: Initialize an object state _vm->_object->_objects[action->a9.objIndex].state = action->a9.newState; break; - case INIT_PATH: // act10: Initialise an object path and velocity + case INIT_PATH: // act10: Initialize an object path and velocity _vm->_object->setPath(action->a10.objIndex, (path_t) action->a10.newPathType, action->a10.vxPath, action->a10.vyPath); break; case COND_R: // act11: action lists conditional on object state @@ -1287,7 +1284,7 @@ event_t *Scheduler::doAction(event_t *curEvent) { // any objects are to be made invisible! gameStatus.gameOverFl = true; break; - case INIT_HH_COORD: // act22: Initialise an object to hero's actual coords + case INIT_HH_COORD: // act22: Initialize an object to hero's actual coords _vm->_object->_objects[action->a22.objIndex].x = _vm->_hero->x; _vm->_object->_objects[action->a22.objIndex].y = _vm->_hero->y; _vm->_object->_objects[action->a22.objIndex].screenIndex = *_vm->_screen_p;// Don't forget screen! diff --git a/engines/hugo/schedule.h b/engines/hugo/schedule.h index a066fc63c4a..e3107809cf2 100644 --- a/engines/hugo/schedule.h +++ b/engines/hugo/schedule.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -76,7 +73,7 @@ enum action_t { // Parameters: INIT_MAZE, // 30 - Start special maze hotspot processing EXIT_MAZE, // 31 - Exit special maze processing INIT_PRIORITY, // 32 - Initialize fbg field - INIT_SCREEN, // 33 - Initialise screen field of object + INIT_SCREEN, // 33 - Initialize screen field of object AGSCHEDULE, // 34 - Global schedule - lasts over new screen REMAPPAL, // 35 - Remappe palette - palette index, color COND_NOUN, // 36 - Conditional on noun appearing in line @@ -109,7 +106,7 @@ struct act1 { // Type 1 - Start an object cycle_t cycle; // Direction to start cycling }; -struct act2 { // Type 2 - Initialise an object coords +struct act2 { // Type 2 - Initialize an object coords action_t actType; // The type of action int timer; // Time to set off the action int objIndex; // The object number @@ -132,21 +129,21 @@ struct act4 { // Type 4 - Set new backgrou long newBackgroundColor; // New color }; -struct act5 { // Type 5 - Initialise an object velocity +struct act5 { // Type 5 - Initialize an object velocity action_t actType; // The type of action int timer; // Time to set off the action int objIndex; // The object number int vx, vy; // velocity }; -struct act6 { // Type 6 - Initialise an object carrying +struct act6 { // Type 6 - Initialize an object carrying action_t actType; // The type of action int timer; // Time to set off the action int objIndex; // The object number bool carriedFl; // carrying }; -struct act7 { // Type 7 - Initialise an object to hero's coords +struct act7 { // Type 7 - Initialize an object to hero's coords action_t actType; // The type of action int timer; // Time to set off the action int objIndex; // The object number @@ -158,14 +155,14 @@ struct act8 { // Type 8 - switch to new sc int screenIndex; // The new screen number }; -struct act9 { // Type 9 - Initialise an object state +struct act9 { // Type 9 - Initialize an object state action_t actType; // The type of action int timer; // Time to set off the action int objIndex; // The object number byte newState; // New state }; -struct act10 { // Type 10 - Initialise an object path type +struct act10 { // Type 10 - Initialize an object path type action_t actType; // The type of action int timer; // Time to set off the action int objIndex; // The object number @@ -254,7 +251,7 @@ struct act21 { // Type 21 - Gameover. Disa int timer; // Time to set off the action }; -struct act22 { // Type 22 - Initialise an object to hero's coords +struct act22 { // Type 22 - Initialize an object to hero's coords action_t actType; // The type of action int timer; // Time to set off the action int objIndex; // The object number diff --git a/engines/hugo/sound.cpp b/engines/hugo/sound.cpp index d657eb96a6c..9473536a471 100644 --- a/engines/hugo/sound.cpp +++ b/engines/hugo/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/sound.h b/engines/hugo/sound.h index d5f51704aad..33dba9f2a85 100644 --- a/engines/hugo/sound.h +++ b/engines/hugo/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/text.cpp b/engines/hugo/text.cpp index d2dcbe14054..f8b02bdf68c 100644 --- a/engines/hugo/text.cpp +++ b/engines/hugo/text.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/hugo/text.h b/engines/hugo/text.h index 0854bf3f6e4..0ba8de9cdff 100644 --- a/engines/hugo/text.h +++ b/engines/hugo/text.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TEXT_H #define TEXT_H diff --git a/engines/hugo/util.cpp b/engines/hugo/util.cpp index 6846bc98af2..a936a23de11 100644 --- a/engines/hugo/util.cpp +++ b/engines/hugo/util.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/util.h b/engines/hugo/util.h index 85fef01a6e0..d8634c88e0f 100644 --- a/engines/hugo/util.h +++ b/engines/hugo/util.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/kyra/animator_hof.cpp b/engines/kyra/animator_hof.cpp index a563bc2b4fe..4cdb622501b 100644 --- a/engines/kyra/animator_hof.cpp +++ b/engines/kyra/animator_hof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_hof.h" diff --git a/engines/kyra/animator_lok.cpp b/engines/kyra/animator_lok.cpp index 452d5e80627..3e9dd7aa668 100644 --- a/engines/kyra/animator_lok.cpp +++ b/engines/kyra/animator_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_lok.h" diff --git a/engines/kyra/animator_lok.h b/engines/kyra/animator_lok.h index 6d22524a77c..21d24866c8d 100644 --- a/engines/kyra/animator_lok.h +++ b/engines/kyra/animator_lok.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_ANIMATOR_LOK_H diff --git a/engines/kyra/animator_mr.cpp b/engines/kyra/animator_mr.cpp index 47c0e3b03a3..6db2e45b0ee 100644 --- a/engines/kyra/animator_mr.cpp +++ b/engines/kyra/animator_mr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_mr.h" diff --git a/engines/kyra/animator_tim.cpp b/engines/kyra/animator_tim.cpp index fa42042befe..90f4ad89adf 100644 --- a/engines/kyra/animator_tim.cpp +++ b/engines/kyra/animator_tim.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/script_tim.h" diff --git a/engines/kyra/animator_v2.cpp b/engines/kyra/animator_v2.cpp index 07ff4456e59..ad7057f11ac 100644 --- a/engines/kyra/animator_v2.cpp +++ b/engines/kyra/animator_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_v2.h" diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp index 066648b96f8..d0baf8a1335 100644 --- a/engines/kyra/debugger.cpp +++ b/engines/kyra/debugger.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/debugger.h" diff --git a/engines/kyra/debugger.h b/engines/kyra/debugger.h index de45bd0aaaa..70c547381ec 100644 --- a/engines/kyra/debugger.h +++ b/engines/kyra/debugger.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_DEBUGGER_H diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp index 87cda9f3b6f..47a086e08c6 100644 --- a/engines/kyra/detection.cpp +++ b/engines/kyra/detection.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "kyra/kyra_lok.h" @@ -82,7 +79,7 @@ public: KyraMetaEngine() : AdvancedMetaEngine(detectionParams) {} const char *getName() const { - return "Legend of Kyrandia Engine"; + return "Kyra"; } const char *getOriginalCopyright() const { diff --git a/engines/kyra/detection_tables.h b/engines/kyra/detection_tables.h index 5c97df88956..8a948eff009 100644 --- a/engines/kyra/detection_tables.h +++ b/engines/kyra/detection_tables.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ namespace { diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp index 849b65a24bd..b9477c950ab 100644 --- a/engines/kyra/gui.cpp +++ b/engines/kyra/gui.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/gui.h" diff --git a/engines/kyra/gui.h b/engines/kyra/gui.h index ff387debd6c..6afdc431ede 100644 --- a/engines/kyra/gui.h +++ b/engines/kyra/gui.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_GUI_H diff --git a/engines/kyra/gui_hof.cpp b/engines/kyra/gui_hof.cpp index 26e0d8f18ac..1666cdd0e4f 100644 --- a/engines/kyra/gui_hof.cpp +++ b/engines/kyra/gui_hof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/gui_hof.h" diff --git a/engines/kyra/gui_hof.h b/engines/kyra/gui_hof.h index f0e693081ff..a02d14e9f1c 100644 --- a/engines/kyra/gui_hof.h +++ b/engines/kyra/gui_hof.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_GUI_HOF_H diff --git a/engines/kyra/gui_lok.cpp b/engines/kyra/gui_lok.cpp index c31cbe3db2b..eac82ec2c54 100644 --- a/engines/kyra/gui_lok.cpp +++ b/engines/kyra/gui_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/gui_lok.h" diff --git a/engines/kyra/gui_lok.h b/engines/kyra/gui_lok.h index 084a798de49..4d7bfa1ada4 100644 --- a/engines/kyra/gui_lok.h +++ b/engines/kyra/gui_lok.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_GUI_LOK_H diff --git a/engines/kyra/gui_lol.cpp b/engines/kyra/gui_lol.cpp index 2625347d506..4c4dc50503c 100644 --- a/engines/kyra/gui_lol.cpp +++ b/engines/kyra/gui_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/gui_lol.h b/engines/kyra/gui_lol.h index 941f52bd3d0..bc49b21299a 100644 --- a/engines/kyra/gui_lol.h +++ b/engines/kyra/gui_lol.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/gui_mr.cpp b/engines/kyra/gui_mr.cpp index 6eca24fd460..25a77c6cc84 100644 --- a/engines/kyra/gui_mr.cpp +++ b/engines/kyra/gui_mr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/gui_mr.h" diff --git a/engines/kyra/gui_mr.h b/engines/kyra/gui_mr.h index b104626db78..9c8d79b3215 100644 --- a/engines/kyra/gui_mr.h +++ b/engines/kyra/gui_mr.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_GUI_MR_H diff --git a/engines/kyra/gui_v2.cpp b/engines/kyra/gui_v2.cpp index 01922de7cf7..0b82df8cd5b 100644 --- a/engines/kyra/gui_v2.cpp +++ b/engines/kyra/gui_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/gui_v2.h" diff --git a/engines/kyra/gui_v2.h b/engines/kyra/gui_v2.h index 4cc52be554b..0009bf8e54c 100644 --- a/engines/kyra/gui_v2.h +++ b/engines/kyra/gui_v2.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_GUI_V2_H diff --git a/engines/kyra/item.h b/engines/kyra/item.h index 2088f4bd8bc..86b6fc7d46e 100644 --- a/engines/kyra/item.h +++ b/engines/kyra/item.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_ITEM_H diff --git a/engines/kyra/items_hof.cpp b/engines/kyra/items_hof.cpp index d460698272d..73aed2e0676 100644 --- a/engines/kyra/items_hof.cpp +++ b/engines/kyra/items_hof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_hof.h" diff --git a/engines/kyra/items_lok.cpp b/engines/kyra/items_lok.cpp index ed1299d239e..d66eb553f2e 100644 --- a/engines/kyra/items_lok.cpp +++ b/engines/kyra/items_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_lok.h" diff --git a/engines/kyra/items_lol.cpp b/engines/kyra/items_lol.cpp index d4567ad7376..b6388604f5a 100644 --- a/engines/kyra/items_lol.cpp +++ b/engines/kyra/items_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/items_mr.cpp b/engines/kyra/items_mr.cpp index 5659876307b..88c02f56c8c 100644 --- a/engines/kyra/items_mr.cpp +++ b/engines/kyra/items_mr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_mr.h" diff --git a/engines/kyra/items_v2.cpp b/engines/kyra/items_v2.cpp index 90b6194f0d3..29dddc6772d 100644 --- a/engines/kyra/items_v2.cpp +++ b/engines/kyra/items_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_v2.h" diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp index de6aa55b082..9a4f7bc42e4 100644 --- a/engines/kyra/kyra_hof.cpp +++ b/engines/kyra/kyra_hof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_hof.h" diff --git a/engines/kyra/kyra_hof.h b/engines/kyra/kyra_hof.h index 308698484d3..da7486bc297 100644 --- a/engines/kyra/kyra_hof.h +++ b/engines/kyra/kyra_hof.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_KYRA_HOF_H diff --git a/engines/kyra/kyra_lok.cpp b/engines/kyra/kyra_lok.cpp index a04c28cad83..ee67062cddc 100644 --- a/engines/kyra/kyra_lok.cpp +++ b/engines/kyra/kyra_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_lok.h" diff --git a/engines/kyra/kyra_lok.h b/engines/kyra/kyra_lok.h index cfa231e2d03..066c27c69a3 100644 --- a/engines/kyra/kyra_lok.h +++ b/engines/kyra/kyra_lok.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_KYRA_LOK_H diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp index 570ebe0babc..4ce5c5b2cf8 100644 --- a/engines/kyra/kyra_mr.cpp +++ b/engines/kyra/kyra_mr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_mr.h" diff --git a/engines/kyra/kyra_mr.h b/engines/kyra/kyra_mr.h index 912c615757c..0d9d66ce95d 100644 --- a/engines/kyra/kyra_mr.h +++ b/engines/kyra/kyra_mr.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_KYRA_MR_H diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index fb56e4a62a3..75df1d148b0 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_v1.h" @@ -32,12 +29,11 @@ #include "common/error.h" #include "common/config-manager.h" #include "common/debug-channels.h" -#include "common/EventRecorder.h" namespace Kyra { KyraEngine_v1::KyraEngine_v1(OSystem *system, const GameFlags &flags) - : Engine(system), _flags(flags) { + : Engine(system), _flags(flags), _rnd("kyra") { _res = 0; _sound = 0; _text = 0; @@ -81,8 +77,6 @@ KyraEngine_v1::KyraEngine_v1(OSystem *system, const GameFlags &flags) DebugMan.addDebugChannel(kDebugLevelSequence, "Sequence", "Sequence debug level"); DebugMan.addDebugChannel(kDebugLevelMovie, "Movie", "Movie debug level"); DebugMan.addDebugChannel(kDebugLevelTimer, "Timer", "Timer debug level"); - - g_eventRec.registerRandomSource(_rnd, "kyra"); } ::GUI::Debugger *KyraEngine_v1::getDebugger() { @@ -90,7 +84,7 @@ KyraEngine_v1::KyraEngine_v1(OSystem *system, const GameFlags &flags) } void KyraEngine_v1::pauseEngineIntern(bool pause) { - Engine::pauseEngineIntern(pause); + _sound->pause(pause); _timer->pause(pause); } diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h index 08dc831dd94..bb533b14a56 100644 --- a/engines/kyra/kyra_v1.h +++ b/engines/kyra/kyra_v1.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_KYRA_V1_H diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index 16b5ffa4e8b..d0f8d78bd1a 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_v2.h" diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h index 9f0aecd78cf..f21458ab5d7 100644 --- a/engines/kyra/kyra_v2.h +++ b/engines/kyra/kyra_v2.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_KYRA_V2_H diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index ce73bffc898..9b0ae173d5c 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h index a3170c21934..a815fa1a379 100644 --- a/engines/kyra/lol.h +++ b/engines/kyra/lol.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp index 22786c1c7e3..bc9c93f8ca7 100644 --- a/engines/kyra/resource.cpp +++ b/engines/kyra/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/resource.h" diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h index 9948c520012..1c69362bfd8 100644 --- a/engines/kyra/resource.h +++ b/engines/kyra/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_RESOURCE_H diff --git a/engines/kyra/resource_intern.cpp b/engines/kyra/resource_intern.cpp index 1dc084f14da..482bd1a5d6c 100644 --- a/engines/kyra/resource_intern.cpp +++ b/engines/kyra/resource_intern.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/resource_intern.h" diff --git a/engines/kyra/resource_intern.h b/engines/kyra/resource_intern.h index 16f3a1fe914..03c9d871e88 100644 --- a/engines/kyra/resource_intern.h +++ b/engines/kyra/resource_intern.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_RESOURCE_INTERN_H diff --git a/engines/kyra/saveload.cpp b/engines/kyra/saveload.cpp index 81b3ec15ae5..80182d949b4 100644 --- a/engines/kyra/saveload.cpp +++ b/engines/kyra/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_v1.h" diff --git a/engines/kyra/saveload_hof.cpp b/engines/kyra/saveload_hof.cpp index 1fd6c0f3c88..b395a38acda 100644 --- a/engines/kyra/saveload_hof.cpp +++ b/engines/kyra/saveload_hof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_hof.h" diff --git a/engines/kyra/saveload_lok.cpp b/engines/kyra/saveload_lok.cpp index 5af4f1d8cab..7689a904b03 100644 --- a/engines/kyra/saveload_lok.cpp +++ b/engines/kyra/saveload_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_lok.h" diff --git a/engines/kyra/saveload_lol.cpp b/engines/kyra/saveload_lol.cpp index c5240e26248..c81ace26f06 100644 --- a/engines/kyra/saveload_lol.cpp +++ b/engines/kyra/saveload_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/saveload_mr.cpp b/engines/kyra/saveload_mr.cpp index a5e9b9e0f59..0fd3e520f91 100644 --- a/engines/kyra/saveload_mr.cpp +++ b/engines/kyra/saveload_mr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/kyra/scene_hof.cpp b/engines/kyra/scene_hof.cpp index b44c88a0b43..197ef38bf15 100644 --- a/engines/kyra/scene_hof.cpp +++ b/engines/kyra/scene_hof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_hof.h" diff --git a/engines/kyra/scene_lok.cpp b/engines/kyra/scene_lok.cpp index 6200e2ab1e8..6cb3e2a98a4 100644 --- a/engines/kyra/scene_lok.cpp +++ b/engines/kyra/scene_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_lok.h" diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp index ab9f89456bf..305036fc511 100644 --- a/engines/kyra/scene_lol.cpp +++ b/engines/kyra/scene_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/scene_mr.cpp b/engines/kyra/scene_mr.cpp index 4eac4889b62..6b234d9a734 100644 --- a/engines/kyra/scene_mr.cpp +++ b/engines/kyra/scene_mr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_mr.h" diff --git a/engines/kyra/scene_v1.cpp b/engines/kyra/scene_v1.cpp index bc883778929..5319d4e657e 100644 --- a/engines/kyra/scene_v1.cpp +++ b/engines/kyra/scene_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_v1.h" diff --git a/engines/kyra/scene_v2.cpp b/engines/kyra/scene_v2.cpp index 897f2e937f3..fbddb6604e9 100644 --- a/engines/kyra/scene_v2.cpp +++ b/engines/kyra/scene_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_v2.h" diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index 20a1022b26f..b4304a6de07 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/screen.h" diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h index e35b9b37b22..e23f1047605 100644 --- a/engines/kyra/screen.h +++ b/engines/kyra/screen.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SCREEN_H diff --git a/engines/kyra/screen_hof.cpp b/engines/kyra/screen_hof.cpp index f0af53f024f..12824474113 100644 --- a/engines/kyra/screen_hof.cpp +++ b/engines/kyra/screen_hof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/screen_hof.h" diff --git a/engines/kyra/screen_hof.h b/engines/kyra/screen_hof.h index 5117716ac03..08a91338098 100644 --- a/engines/kyra/screen_hof.h +++ b/engines/kyra/screen_hof.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SCREEN_HOF_H diff --git a/engines/kyra/screen_lok.cpp b/engines/kyra/screen_lok.cpp index 2431cde20b5..106ef5df291 100644 --- a/engines/kyra/screen_lok.cpp +++ b/engines/kyra/screen_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/screen_lok.h" diff --git a/engines/kyra/screen_lok.h b/engines/kyra/screen_lok.h index 0d30c35bfd7..3b749129861 100644 --- a/engines/kyra/screen_lok.h +++ b/engines/kyra/screen_lok.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SCREEN_LOK_H diff --git a/engines/kyra/screen_lol.cpp b/engines/kyra/screen_lol.cpp index 20756e1fae5..c6874ca0ede 100644 --- a/engines/kyra/screen_lol.cpp +++ b/engines/kyra/screen_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/screen_lol.h b/engines/kyra/screen_lol.h index 9f4d751d0cc..926183225f0 100644 --- a/engines/kyra/screen_lol.h +++ b/engines/kyra/screen_lol.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/screen_mr.cpp b/engines/kyra/screen_mr.cpp index 4ae52b924d1..2687dc80419 100644 --- a/engines/kyra/screen_mr.cpp +++ b/engines/kyra/screen_mr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/screen_mr.h" diff --git a/engines/kyra/screen_mr.h b/engines/kyra/screen_mr.h index c02fc4bfb26..0cb32409546 100644 --- a/engines/kyra/screen_mr.h +++ b/engines/kyra/screen_mr.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SCREEN_MR_H diff --git a/engines/kyra/screen_v2.cpp b/engines/kyra/screen_v2.cpp index 9c224d15628..64fbe2b834e 100644 --- a/engines/kyra/screen_v2.cpp +++ b/engines/kyra/screen_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/screen_v2.h" diff --git a/engines/kyra/screen_v2.h b/engines/kyra/screen_v2.h index 92aeb3525d7..eb8415be78e 100644 --- a/engines/kyra/screen_v2.h +++ b/engines/kyra/screen_v2.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SCREEN_V2_H diff --git a/engines/kyra/script.cpp b/engines/kyra/script.cpp index 21dfe0bd31d..b185b8ed6f5 100644 --- a/engines/kyra/script.cpp +++ b/engines/kyra/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/script.h" diff --git a/engines/kyra/script.h b/engines/kyra/script.h index faa80a3f215..4250732c7cf 100644 --- a/engines/kyra/script.h +++ b/engines/kyra/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SCRIPT_H diff --git a/engines/kyra/script_hof.cpp b/engines/kyra/script_hof.cpp index 056319e6d46..27cfc808cc4 100644 --- a/engines/kyra/script_hof.cpp +++ b/engines/kyra/script_hof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_hof.h" diff --git a/engines/kyra/script_lok.cpp b/engines/kyra/script_lok.cpp index 30f11383605..2b90d001ca2 100644 --- a/engines/kyra/script_lok.cpp +++ b/engines/kyra/script_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_lok.h" diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp index 3185032218d..2261ef83896 100644 --- a/engines/kyra/script_lol.cpp +++ b/engines/kyra/script_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/script_mr.cpp b/engines/kyra/script_mr.cpp index b3943e1aef9..8ab094ac0c7 100644 --- a/engines/kyra/script_mr.cpp +++ b/engines/kyra/script_mr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_mr.h" diff --git a/engines/kyra/script_tim.cpp b/engines/kyra/script_tim.cpp index 004ceb97bbd..501ae2defdf 100644 --- a/engines/kyra/script_tim.cpp +++ b/engines/kyra/script_tim.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/script_tim.h" diff --git a/engines/kyra/script_tim.h b/engines/kyra/script_tim.h index 7cf7d0a7dd7..89040720c25 100644 --- a/engines/kyra/script_tim.h +++ b/engines/kyra/script_tim.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SCRIPT_TIM_H diff --git a/engines/kyra/script_v1.cpp b/engines/kyra/script_v1.cpp index 13fdcb7d973..b12a08a4170 100644 --- a/engines/kyra/script_v1.cpp +++ b/engines/kyra/script_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_v1.h" diff --git a/engines/kyra/script_v2.cpp b/engines/kyra/script_v2.cpp index 081f9dd5177..2e3a3d2bc4a 100644 --- a/engines/kyra/script_v2.cpp +++ b/engines/kyra/script_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_v2.h" diff --git a/engines/kyra/seqplayer.cpp b/engines/kyra/seqplayer.cpp index 16e89de146c..ce2eafcea55 100644 --- a/engines/kyra/seqplayer.cpp +++ b/engines/kyra/seqplayer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/seqplayer.h" diff --git a/engines/kyra/seqplayer.h b/engines/kyra/seqplayer.h index b75410af537..1f030cde198 100644 --- a/engines/kyra/seqplayer.h +++ b/engines/kyra/seqplayer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SEQPLAYER_H diff --git a/engines/kyra/sequences_hof.cpp b/engines/kyra/sequences_hof.cpp index b268f13fc10..e5042780474 100644 --- a/engines/kyra/sequences_hof.cpp +++ b/engines/kyra/sequences_hof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_hof.h" diff --git a/engines/kyra/sequences_lok.cpp b/engines/kyra/sequences_lok.cpp index 0b39201f85e..5f9bd867247 100644 --- a/engines/kyra/sequences_lok.cpp +++ b/engines/kyra/sequences_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_lok.h" diff --git a/engines/kyra/sequences_lol.cpp b/engines/kyra/sequences_lol.cpp index da1245d7e6f..d11403ad9f7 100644 --- a/engines/kyra/sequences_lol.cpp +++ b/engines/kyra/sequences_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/sequences_mr.cpp b/engines/kyra/sequences_mr.cpp index d3250823c5e..b3adc687c28 100644 --- a/engines/kyra/sequences_mr.cpp +++ b/engines/kyra/sequences_mr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_mr.h" diff --git a/engines/kyra/sequences_v2.cpp b/engines/kyra/sequences_v2.cpp index 4d9cdf0d5da..fb61d7cddf0 100644 --- a/engines/kyra/sequences_v2.cpp +++ b/engines/kyra/sequences_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_v2.h" diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp index 13928242357..3713537afd4 100644 --- a/engines/kyra/sound.cpp +++ b/engines/kyra/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -46,6 +43,10 @@ Sound::Sound(KyraEngine_v1 *vm, Audio::Mixer *mixer) Sound::~Sound() { } +void Sound::pause(bool paused) { + _mixer->pauseAll(paused); +} + bool Sound::voiceFileIsPresent(const char *file) { for (int i = 0; _supportedCodecs[i].fileext; ++i) { Common::String f = file; diff --git a/engines/kyra/sound.h b/engines/kyra/sound.h index 326fef94d1b..566b37ff431 100644 --- a/engines/kyra/sound.h +++ b/engines/kyra/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SOUND_H @@ -104,7 +101,7 @@ public: /** * Load a sound file for playing music - * (and somtimes sound effects) from. + * (and sometimes sound effects) from. */ virtual void loadSoundFile(Common::String file) = 0; @@ -156,6 +153,11 @@ public: */ virtual void beginFadeOut() = 0; + /** + * Stops all audio playback when paused. Continues after end of pause. + */ + virtual void pause(bool paused); + void enableMusic(int enable) { _musicEnabled = enable; } int musicEnabled() const { return _musicEnabled; } void enableSFX(bool enable) { _sfxEnabled = enable; } @@ -278,6 +280,7 @@ public: void stopAllSoundEffects() { _sfx->stopAllSoundEffects(); } void beginFadeOut() { _music->beginFadeOut(); } + void pause(bool paused) { _music->pause(paused); _sfx->pause(paused); } private: Sound *_music, *_sfx; }; diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp index 16f6ca3eaa7..75041b81617 100644 --- a/engines/kyra/sound_adlib.cpp +++ b/engines/kyra/sound_adlib.cpp @@ -34,9 +34,6 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * $URL$ - * $Id$ - * */ @@ -1561,7 +1558,7 @@ int AdLibDriver::update_changeExtraLevel2(uint8 *&dataptr, Channel &channel, uin return 0; } -// Apart from initialising to zero, these two functions are the only ones that +// Apart from initializing to zero, these two functions are the only ones that // modify _vibratoAndAMDepthBits. int AdLibDriver::update_setAMDepth(uint8 *&dataptr, Channel &channel, uint8 value) { diff --git a/engines/kyra/sound_adlib.h b/engines/kyra/sound_adlib.h index aaca1b9138d..58b97e3474d 100644 --- a/engines/kyra/sound_adlib.h +++ b/engines/kyra/sound_adlib.h @@ -34,9 +34,6 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SOUND_ADLIB_H diff --git a/engines/kyra/sound_amiga.cpp b/engines/kyra/sound_amiga.cpp index fed21eba844..dc096704080 100644 --- a/engines/kyra/sound_amiga.cpp +++ b/engines/kyra/sound_amiga.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/sound_intern.h" diff --git a/engines/kyra/sound_digital.cpp b/engines/kyra/sound_digital.cpp index 3d318b7e24d..3f8eddbb0de 100644 --- a/engines/kyra/sound_digital.cpp +++ b/engines/kyra/sound_digital.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/sound.h" diff --git a/engines/kyra/sound_intern.h b/engines/kyra/sound_intern.h index 354f5732bf0..2ba08907899 100644 --- a/engines/kyra/sound_intern.h +++ b/engines/kyra/sound_intern.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SOUND_INTERN_H @@ -74,6 +71,8 @@ public: void stopAllSoundEffects(); void beginFadeOut(); + + void pause(bool paused); private: static void onTimer(void *data); @@ -142,8 +141,6 @@ private: TownsEuphonyDriver *_driver; - Common::Mutex _mutex; - bool _cdaPlaying; const uint8 *_musicFadeTable; diff --git a/engines/kyra/sound_lok.cpp b/engines/kyra/sound_lok.cpp index 83566372bfe..95a632c08c4 100644 --- a/engines/kyra/sound_lok.cpp +++ b/engines/kyra/sound_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_lok.h" diff --git a/engines/kyra/sound_lol.cpp b/engines/kyra/sound_lol.cpp index 10d35e03d52..a7776f0ab62 100644 --- a/engines/kyra/sound_lol.cpp +++ b/engines/kyra/sound_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/sound_midi.cpp b/engines/kyra/sound_midi.cpp index 02ba735a70c..6c003d0a111 100644 --- a/engines/kyra/sound_midi.cpp +++ b/engines/kyra/sound_midi.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/sound_intern.h" @@ -717,6 +714,26 @@ void SoundMidiPC::beginFadeOut() { _fadeStartTime = _vm->_system->getMillis(); } +void SoundMidiPC::pause(bool paused) { + // Stop all mixer related sounds + Sound::pause(paused); + + Common::StackLock lock(_mutex); + + if (paused) { + _music->setMidiDriver(0); + for (int i = 0; i < 3; i++) + _sfx[i]->setMidiDriver(0); + for (int i = 0; i < 16; i++) + _output->stopNotesOnChannel(i); + } else { + _music->setMidiDriver(_output); + for (int i = 0; i < 3; ++i) + _sfx[i]->setMidiDriver(_output); + // Possible TODO (IMHO unnecessary): restore notes and/or update _fadeStartTime + } +} + void SoundMidiPC::onTimer(void *data) { SoundMidiPC *midi = (SoundMidiPC *)data; diff --git a/engines/kyra/sound_pcspk.cpp b/engines/kyra/sound_pcspk.cpp index 46f35af3ab6..051f36dd1b9 100644 --- a/engines/kyra/sound_pcspk.cpp +++ b/engines/kyra/sound_pcspk.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/sound_intern.h" diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp index 6b30824a2f7..73d435f3e51 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/sound_intern.h" @@ -116,7 +113,7 @@ void SoundTowns::haltTrack() { for (int i = 0x40; i < 0x46; i++) _driver->chanVolume(i, 0); for (int i = 0; i < 32; i++) - _driver->chanEnable(i, 0); + _driver->configChan_enable(i, 0); _driver->stopParser(); } @@ -300,8 +297,6 @@ bool SoundTowns::loadInstruments() { if (!twm) return false; - Common::StackLock lock(_mutex); - Screen::decodeFrame4(twm, _musicTrackData, 50570); for (int i = 0; i < 128; i++) _driver->loadInstrument(0, i, &_musicTrackData[i * 48 + 8]); @@ -325,23 +320,21 @@ bool SoundTowns::loadInstruments() { } void SoundTowns::playEuphonyTrack(uint32 offset, int loop) { - Common::StackLock lock(_mutex); - uint8 *twm = _vm->resource()->fileData("twmusic.pak", 0); Screen::decodeFrame4(twm + 19312 + offset, _musicTrackData, 50570); delete[] twm; const uint8 *src = _musicTrackData + 852; for (int i = 0; i < 32; i++) - _driver->chanEnable(i, *src++); + _driver->configChan_enable(i, *src++); for (int i = 0; i < 32; i++) - _driver->chanMode(i, *src++); + _driver->configChan_setMode(i, *src++); for (int i = 0; i < 32; i++) - _driver->chanOrdr(i, *src++); + _driver->configChan_remap(i, *src++); for (int i = 0; i < 32; i++) - _driver->chanVolumeShift(i, *src++); + _driver->configChan_adjustVolume(i, *src++); for (int i = 0; i < 32; i++) - _driver->chanNoteShift(i, *src++); + _driver->configChan_setTranspose(i, *src++); src = _musicTrackData + 1748; for (int i = 0; i < 6; i++) diff --git a/engines/kyra/sprites.cpp b/engines/kyra/sprites.cpp index 23775d29462..e0d1142905e 100644 --- a/engines/kyra/sprites.cpp +++ b/engines/kyra/sprites.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/sprites.h" @@ -28,11 +25,10 @@ #include "kyra/animator_lok.h" #include "common/system.h" -#include "common/EventRecorder.h" namespace Kyra { -Sprites::Sprites(KyraEngine_LoK *vm, OSystem *system) { +Sprites::Sprites(KyraEngine_LoK *vm, OSystem *system) : _rnd("kyraSprites") { _vm = vm; _res = vm->resource(); _screen = vm->screen(); @@ -43,7 +39,6 @@ Sprites::Sprites(KyraEngine_LoK *vm, OSystem *system) { _spriteDefStart = 0; memset(_drawLayerTable, 0, sizeof(_drawLayerTable)); _sceneAnimatorBeaconFlag = 0; - g_eventRec.registerRandomSource(_rnd, "kyraSprites"); } Sprites::~Sprites() { diff --git a/engines/kyra/sprites.h b/engines/kyra/sprites.h index f6c53e6d048..6a4241f13e0 100644 --- a/engines/kyra/sprites.h +++ b/engines/kyra/sprites.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SPRITES_H diff --git a/engines/kyra/sprites_lol.cpp b/engines/kyra/sprites_lol.cpp index 6245ecdd1f7..a77fda043c2 100644 --- a/engines/kyra/sprites_lol.cpp +++ b/engines/kyra/sprites_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index f83546e0dd9..499cc6f301f 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/resource.h" diff --git a/engines/kyra/staticres_lol.cpp b/engines/kyra/staticres_lol.cpp index 3287ee37d6b..cf75a317e1b 100644 --- a/engines/kyra/staticres_lol.cpp +++ b/engines/kyra/staticres_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/resource.h" diff --git a/engines/kyra/text.cpp b/engines/kyra/text.cpp index e0114cda290..2e3acffeb9b 100644 --- a/engines/kyra/text.cpp +++ b/engines/kyra/text.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/text.h" diff --git a/engines/kyra/text.h b/engines/kyra/text.h index c53f2d1d2f4..a95c2c4abca 100644 --- a/engines/kyra/text.h +++ b/engines/kyra/text.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_TEXT_H diff --git a/engines/kyra/text_hof.cpp b/engines/kyra/text_hof.cpp index c961d2bf496..393fa8d11f0 100644 --- a/engines/kyra/text_hof.cpp +++ b/engines/kyra/text_hof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/text_hof.h" diff --git a/engines/kyra/text_hof.h b/engines/kyra/text_hof.h index 8e88918fa41..f371fb18985 100644 --- a/engines/kyra/text_hof.h +++ b/engines/kyra/text_hof.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_TEXT_HOF_H diff --git a/engines/kyra/text_lok.cpp b/engines/kyra/text_lok.cpp index cca8e5aaf52..0ee35749033 100644 --- a/engines/kyra/text_lok.cpp +++ b/engines/kyra/text_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/text.h" diff --git a/engines/kyra/text_lol.cpp b/engines/kyra/text_lol.cpp index c9a77be1b21..346d5100b87 100644 --- a/engines/kyra/text_lol.cpp +++ b/engines/kyra/text_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/text_lol.h b/engines/kyra/text_lol.h index edac1311062..020d4b5e89b 100644 --- a/engines/kyra/text_lol.h +++ b/engines/kyra/text_lol.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/text_mr.cpp b/engines/kyra/text_mr.cpp index 5679dc1ee6b..2cb752fdb3f 100644 --- a/engines/kyra/text_mr.cpp +++ b/engines/kyra/text_mr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/text_mr.h" diff --git a/engines/kyra/text_mr.h b/engines/kyra/text_mr.h index 5803bd0c313..957415490fd 100644 --- a/engines/kyra/text_mr.h +++ b/engines/kyra/text_mr.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_TEXT_MR_H diff --git a/engines/kyra/timer.cpp b/engines/kyra/timer.cpp index 475f17cadc0..9834646a451 100644 --- a/engines/kyra/timer.cpp +++ b/engines/kyra/timer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/timer.h" diff --git a/engines/kyra/timer.h b/engines/kyra/timer.h index d85a48cfa4b..e9cb8b2b0c2 100644 --- a/engines/kyra/timer.h +++ b/engines/kyra/timer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_TIMER_H diff --git a/engines/kyra/timer_hof.cpp b/engines/kyra/timer_hof.cpp index d8f86e30a27..96b14c28f5f 100644 --- a/engines/kyra/timer_hof.cpp +++ b/engines/kyra/timer_hof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_hof.h" diff --git a/engines/kyra/timer_lok.cpp b/engines/kyra/timer_lok.cpp index 3a312c22c6b..e1825d027dd 100644 --- a/engines/kyra/timer_lok.cpp +++ b/engines/kyra/timer_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_lok.h" diff --git a/engines/kyra/timer_lol.cpp b/engines/kyra/timer_lol.cpp index a3dab365c70..4f450f570f5 100644 --- a/engines/kyra/timer_lol.cpp +++ b/engines/kyra/timer_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/timer_mr.cpp b/engines/kyra/timer_mr.cpp index 97ce7c166d5..7d8325cd059 100644 --- a/engines/kyra/timer_mr.cpp +++ b/engines/kyra/timer_mr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_mr.h" diff --git a/engines/kyra/util.cpp b/engines/kyra/util.cpp index 8fd7d4d069d..3776bdc7059 100644 --- a/engines/kyra/util.cpp +++ b/engines/kyra/util.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/util.h" diff --git a/engines/kyra/util.h b/engines/kyra/util.h index 43a861907bb..042da74cd94 100644 --- a/engines/kyra/util.h +++ b/engines/kyra/util.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_UTIL_H diff --git a/engines/kyra/vqa.cpp b/engines/kyra/vqa.cpp index 28071bc1716..04455ae3070 100644 --- a/engines/kyra/vqa.cpp +++ b/engines/kyra/vqa.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Player for Kyrandia 3 VQA movies, based on the information found at diff --git a/engines/kyra/vqa.h b/engines/kyra/vqa.h index b618b2f044c..839bf5ac48b 100644 --- a/engines/kyra/vqa.h +++ b/engines/kyra/vqa.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_VQA_H diff --git a/engines/kyra/wsamovie.cpp b/engines/kyra/wsamovie.cpp index db324d48d43..37102744a81 100644 --- a/engines/kyra/wsamovie.cpp +++ b/engines/kyra/wsamovie.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/wsamovie.h" diff --git a/engines/kyra/wsamovie.h b/engines/kyra/wsamovie.h index f755cdd5579..0d8bfdc8693 100644 --- a/engines/kyra/wsamovie.h +++ b/engines/kyra/wsamovie.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_WSAMOVIE_H diff --git a/engines/lastexpress/data/animation.cpp b/engines/lastexpress/data/animation.cpp index 2bf9bd49998..8ce73993c36 100644 --- a/engines/lastexpress/data/animation.cpp +++ b/engines/lastexpress/data/animation.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Based on Deniz Oezmen's code: http://oezmen.eu/ diff --git a/engines/lastexpress/data/animation.h b/engines/lastexpress/data/animation.h index 9bc2ba99cba..293511b266c 100644 --- a/engines/lastexpress/data/animation.h +++ b/engines/lastexpress/data/animation.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_ANIMATION_H diff --git a/engines/lastexpress/data/archive.cpp b/engines/lastexpress/data/archive.cpp index ab95c28b1e4..3aa5584ca4f 100644 --- a/engines/lastexpress/data/archive.cpp +++ b/engines/lastexpress/data/archive.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Based on the Xentax Wiki documentation: diff --git a/engines/lastexpress/data/archive.h b/engines/lastexpress/data/archive.h index 17b1d661fa6..8e0c46f1834 100644 --- a/engines/lastexpress/data/archive.h +++ b/engines/lastexpress/data/archive.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_HPFARCHIVE_H diff --git a/engines/lastexpress/data/background.cpp b/engines/lastexpress/data/background.cpp index e8236bca865..de6fd7eeae8 100644 --- a/engines/lastexpress/data/background.cpp +++ b/engines/lastexpress/data/background.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Based on Deniz Oezmen's code and Xentax Wiki documentation diff --git a/engines/lastexpress/data/background.h b/engines/lastexpress/data/background.h index 994b216ff90..74dad541aad 100644 --- a/engines/lastexpress/data/background.h +++ b/engines/lastexpress/data/background.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_BACKGROUND_H diff --git a/engines/lastexpress/data/cursor.cpp b/engines/lastexpress/data/cursor.cpp index fca9ed5d45e..86a66b49d9d 100644 --- a/engines/lastexpress/data/cursor.cpp +++ b/engines/lastexpress/data/cursor.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/data/cursor.h" diff --git a/engines/lastexpress/data/cursor.h b/engines/lastexpress/data/cursor.h index d23aa86a951..0e11ec04b8a 100644 --- a/engines/lastexpress/data/cursor.h +++ b/engines/lastexpress/data/cursor.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_CURSOR_H diff --git a/engines/lastexpress/data/font.cpp b/engines/lastexpress/data/font.cpp index d9acbb83829..9a60b88a254 100644 --- a/engines/lastexpress/data/font.cpp +++ b/engines/lastexpress/data/font.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/data/font.h" diff --git a/engines/lastexpress/data/font.h b/engines/lastexpress/data/font.h index 7bcf03ed7d4..7696829b3b5 100644 --- a/engines/lastexpress/data/font.h +++ b/engines/lastexpress/data/font.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_FONT_H diff --git a/engines/lastexpress/data/scene.cpp b/engines/lastexpress/data/scene.cpp index e893d641a5d..2ec8e6935d6 100644 --- a/engines/lastexpress/data/scene.cpp +++ b/engines/lastexpress/data/scene.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/data/scene.h" diff --git a/engines/lastexpress/data/scene.h b/engines/lastexpress/data/scene.h index 9ec18994028..0c0d12b9c05 100644 --- a/engines/lastexpress/data/scene.h +++ b/engines/lastexpress/data/scene.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SCENE_H diff --git a/engines/lastexpress/data/sequence.cpp b/engines/lastexpress/data/sequence.cpp index b986a33d5cd..a27c27de2ee 100644 --- a/engines/lastexpress/data/sequence.cpp +++ b/engines/lastexpress/data/sequence.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Based on Deniz Oezmen's code: http://oezmen.eu/ diff --git a/engines/lastexpress/data/sequence.h b/engines/lastexpress/data/sequence.h index cd16f26ab2d..9987eae48e6 100644 --- a/engines/lastexpress/data/sequence.h +++ b/engines/lastexpress/data/sequence.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SEQUENCE_H diff --git a/engines/lastexpress/data/snd.cpp b/engines/lastexpress/data/snd.cpp index a50fa7be083..3ffe3ca14b9 100644 --- a/engines/lastexpress/data/snd.cpp +++ b/engines/lastexpress/data/snd.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Based on the Xentax Wiki documentation: diff --git a/engines/lastexpress/data/snd.h b/engines/lastexpress/data/snd.h index 61d1c0951ad..95a136ee1cc 100644 --- a/engines/lastexpress/data/snd.h +++ b/engines/lastexpress/data/snd.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SND_H diff --git a/engines/lastexpress/data/subtitle.cpp b/engines/lastexpress/data/subtitle.cpp index 2bc5d3c5ad7..c3a7397b66b 100644 --- a/engines/lastexpress/data/subtitle.cpp +++ b/engines/lastexpress/data/subtitle.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Based on the Xentax Wiki documentation: diff --git a/engines/lastexpress/data/subtitle.h b/engines/lastexpress/data/subtitle.h index 6d8e7535cb9..435408e4bd3 100644 --- a/engines/lastexpress/data/subtitle.h +++ b/engines/lastexpress/data/subtitle.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SUBTITLE_H diff --git a/engines/lastexpress/debug.cpp b/engines/lastexpress/debug.cpp index 520b4cfee35..e1bd9494a9c 100644 --- a/engines/lastexpress/debug.cpp +++ b/engines/lastexpress/debug.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/debug.h" diff --git a/engines/lastexpress/debug.h b/engines/lastexpress/debug.h index e935b35fc09..d9ba6f47a14 100644 --- a/engines/lastexpress/debug.h +++ b/engines/lastexpress/debug.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_DEBUG_H diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp index 1cf51106c6a..7c7c6b0a361 100644 --- a/engines/lastexpress/detection.cpp +++ b/engines/lastexpress/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/lastexpress.h" @@ -210,7 +207,7 @@ public: LastExpressMetaEngine() : AdvancedMetaEngine(detectionParams) {} const char *getName() const { - return "LastExpress Engine"; + return "Lastexpress"; } const char *getOriginalCopyright() const { diff --git a/engines/lastexpress/drawable.h b/engines/lastexpress/drawable.h index e2738763627..5e77b0343a2 100644 --- a/engines/lastexpress/drawable.h +++ b/engines/lastexpress/drawable.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_DRAWABLE_H diff --git a/engines/lastexpress/entities/abbot.cpp b/engines/lastexpress/entities/abbot.cpp index 717bd8af9b8..29bb31b2482 100644 --- a/engines/lastexpress/entities/abbot.cpp +++ b/engines/lastexpress/entities/abbot.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/abbot.h" diff --git a/engines/lastexpress/entities/abbot.h b/engines/lastexpress/entities/abbot.h index 7e7b78b3be4..462f5a491ef 100644 --- a/engines/lastexpress/entities/abbot.h +++ b/engines/lastexpress/entities/abbot.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_ABBOT_H diff --git a/engines/lastexpress/entities/alexei.cpp b/engines/lastexpress/entities/alexei.cpp index 0df76652f94..d723a5607c1 100644 --- a/engines/lastexpress/entities/alexei.cpp +++ b/engines/lastexpress/entities/alexei.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/alexei.h" diff --git a/engines/lastexpress/entities/alexei.h b/engines/lastexpress/entities/alexei.h index 420e6e87fce..262826ae42b 100644 --- a/engines/lastexpress/entities/alexei.h +++ b/engines/lastexpress/entities/alexei.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_ALEXEI_H diff --git a/engines/lastexpress/entities/alouan.cpp b/engines/lastexpress/entities/alouan.cpp index e0a082a1002..715622aaab5 100644 --- a/engines/lastexpress/entities/alouan.cpp +++ b/engines/lastexpress/entities/alouan.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/alouan.h" diff --git a/engines/lastexpress/entities/alouan.h b/engines/lastexpress/entities/alouan.h index 33d5e2f23d0..c6a6beddd94 100644 --- a/engines/lastexpress/entities/alouan.h +++ b/engines/lastexpress/entities/alouan.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_ALOUAN_H diff --git a/engines/lastexpress/entities/anna.cpp b/engines/lastexpress/entities/anna.cpp index 3071c3d0d7e..0bedda41e80 100644 --- a/engines/lastexpress/entities/anna.cpp +++ b/engines/lastexpress/entities/anna.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/anna.h" diff --git a/engines/lastexpress/entities/anna.h b/engines/lastexpress/entities/anna.h index 5297d6f745e..72c6db4bd9a 100644 --- a/engines/lastexpress/entities/anna.h +++ b/engines/lastexpress/entities/anna.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_ANNA_H diff --git a/engines/lastexpress/entities/august.cpp b/engines/lastexpress/entities/august.cpp index 27f989d7df8..f7e7390b90e 100644 --- a/engines/lastexpress/entities/august.cpp +++ b/engines/lastexpress/entities/august.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/august.h" diff --git a/engines/lastexpress/entities/august.h b/engines/lastexpress/entities/august.h index 1a883a0ed5c..2cbb31b968c 100644 --- a/engines/lastexpress/entities/august.h +++ b/engines/lastexpress/entities/august.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_AUGUST_H diff --git a/engines/lastexpress/entities/boutarel.cpp b/engines/lastexpress/entities/boutarel.cpp index e306019f323..0b2040897cb 100644 --- a/engines/lastexpress/entities/boutarel.cpp +++ b/engines/lastexpress/entities/boutarel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/boutarel.h" diff --git a/engines/lastexpress/entities/boutarel.h b/engines/lastexpress/entities/boutarel.h index 0ac051df77e..5eb264631ce 100644 --- a/engines/lastexpress/entities/boutarel.h +++ b/engines/lastexpress/entities/boutarel.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_BOUTAREL_H diff --git a/engines/lastexpress/entities/chapters.cpp b/engines/lastexpress/entities/chapters.cpp index c2ae52a99ed..1252a62d8d7 100644 --- a/engines/lastexpress/entities/chapters.cpp +++ b/engines/lastexpress/entities/chapters.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/chapters.h" diff --git a/engines/lastexpress/entities/chapters.h b/engines/lastexpress/entities/chapters.h index 6a31727c231..353d3a6b5b4 100644 --- a/engines/lastexpress/entities/chapters.h +++ b/engines/lastexpress/entities/chapters.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_CHAPTERS_H diff --git a/engines/lastexpress/entities/cooks.cpp b/engines/lastexpress/entities/cooks.cpp index 558401ecfd9..336f9118007 100644 --- a/engines/lastexpress/entities/cooks.cpp +++ b/engines/lastexpress/entities/cooks.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/cooks.h" diff --git a/engines/lastexpress/entities/cooks.h b/engines/lastexpress/entities/cooks.h index fc3a0cb78ca..3ab7d351619 100644 --- a/engines/lastexpress/entities/cooks.h +++ b/engines/lastexpress/entities/cooks.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_COOKS_H diff --git a/engines/lastexpress/entities/coudert.cpp b/engines/lastexpress/entities/coudert.cpp index 17adce6d58d..e74471ebcad 100644 --- a/engines/lastexpress/entities/coudert.cpp +++ b/engines/lastexpress/entities/coudert.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/coudert.h" diff --git a/engines/lastexpress/entities/coudert.h b/engines/lastexpress/entities/coudert.h index 13dad6f1223..45d13ce9bb8 100644 --- a/engines/lastexpress/entities/coudert.h +++ b/engines/lastexpress/entities/coudert.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_COUDERT_H diff --git a/engines/lastexpress/entities/entity.cpp b/engines/lastexpress/entities/entity.cpp index 38b3dec09fc..22750989fbe 100644 --- a/engines/lastexpress/entities/entity.cpp +++ b/engines/lastexpress/entities/entity.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/entity.h" diff --git a/engines/lastexpress/entities/entity.h b/engines/lastexpress/entities/entity.h index 8c6cc2bafc4..01cf17f791d 100644 --- a/engines/lastexpress/entities/entity.h +++ b/engines/lastexpress/entities/entity.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_ENTITY_H diff --git a/engines/lastexpress/entities/entity39.cpp b/engines/lastexpress/entities/entity39.cpp index d2f7ab0d64c..e786d153a03 100644 --- a/engines/lastexpress/entities/entity39.cpp +++ b/engines/lastexpress/entities/entity39.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/entity39.h" diff --git a/engines/lastexpress/entities/entity39.h b/engines/lastexpress/entities/entity39.h index 344cf5b494a..4335a9566e8 100644 --- a/engines/lastexpress/entities/entity39.h +++ b/engines/lastexpress/entities/entity39.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_ENTITY39_H diff --git a/engines/lastexpress/entities/entity_intern.h b/engines/lastexpress/entities/entity_intern.h index d196989f1da..43d7f702c90 100644 --- a/engines/lastexpress/entities/entity_intern.h +++ b/engines/lastexpress/entities/entity_intern.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_ENTITY_INTERN_H diff --git a/engines/lastexpress/entities/francois.cpp b/engines/lastexpress/entities/francois.cpp index 088996c4490..86b68204999 100644 --- a/engines/lastexpress/entities/francois.cpp +++ b/engines/lastexpress/entities/francois.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/francois.h" diff --git a/engines/lastexpress/entities/francois.h b/engines/lastexpress/entities/francois.h index c924cf677b9..19eca6fb509 100644 --- a/engines/lastexpress/entities/francois.h +++ b/engines/lastexpress/entities/francois.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_FRANCOIS_H diff --git a/engines/lastexpress/entities/gendarmes.cpp b/engines/lastexpress/entities/gendarmes.cpp index 761ba0740e6..f5ae191f9d9 100644 --- a/engines/lastexpress/entities/gendarmes.cpp +++ b/engines/lastexpress/entities/gendarmes.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/gendarmes.h" diff --git a/engines/lastexpress/entities/gendarmes.h b/engines/lastexpress/entities/gendarmes.h index 095a74fa449..e8f9cb2c38f 100644 --- a/engines/lastexpress/entities/gendarmes.h +++ b/engines/lastexpress/entities/gendarmes.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_GENDARMES_H diff --git a/engines/lastexpress/entities/hadija.cpp b/engines/lastexpress/entities/hadija.cpp index 6ed93a239ce..ce2c9718dba 100644 --- a/engines/lastexpress/entities/hadija.cpp +++ b/engines/lastexpress/entities/hadija.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/hadija.h" diff --git a/engines/lastexpress/entities/hadija.h b/engines/lastexpress/entities/hadija.h index bd37a205d9b..d2495955e06 100644 --- a/engines/lastexpress/entities/hadija.h +++ b/engines/lastexpress/entities/hadija.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_HADIJA_H diff --git a/engines/lastexpress/entities/ivo.cpp b/engines/lastexpress/entities/ivo.cpp index ef6bbd32d21..35f4ccfb8ce 100644 --- a/engines/lastexpress/entities/ivo.cpp +++ b/engines/lastexpress/entities/ivo.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/ivo.h" diff --git a/engines/lastexpress/entities/ivo.h b/engines/lastexpress/entities/ivo.h index e726c95af03..cd5cb7b6be1 100644 --- a/engines/lastexpress/entities/ivo.h +++ b/engines/lastexpress/entities/ivo.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_IVO_H diff --git a/engines/lastexpress/entities/kahina.cpp b/engines/lastexpress/entities/kahina.cpp index b8826888533..6472ce0533b 100644 --- a/engines/lastexpress/entities/kahina.cpp +++ b/engines/lastexpress/entities/kahina.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/kahina.h" diff --git a/engines/lastexpress/entities/kahina.h b/engines/lastexpress/entities/kahina.h index 4be9d9fb279..b25053e339c 100644 --- a/engines/lastexpress/entities/kahina.h +++ b/engines/lastexpress/entities/kahina.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_KAHINA_H diff --git a/engines/lastexpress/entities/kronos.cpp b/engines/lastexpress/entities/kronos.cpp index 66ae8be7526..925b0967b7c 100644 --- a/engines/lastexpress/entities/kronos.cpp +++ b/engines/lastexpress/entities/kronos.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/kronos.h" diff --git a/engines/lastexpress/entities/kronos.h b/engines/lastexpress/entities/kronos.h index f73c2453472..4c61b986205 100644 --- a/engines/lastexpress/entities/kronos.h +++ b/engines/lastexpress/entities/kronos.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_KRONOS_H diff --git a/engines/lastexpress/entities/mahmud.cpp b/engines/lastexpress/entities/mahmud.cpp index 9aa042c1ec2..7d30d31a84b 100644 --- a/engines/lastexpress/entities/mahmud.cpp +++ b/engines/lastexpress/entities/mahmud.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/data/scene.h" diff --git a/engines/lastexpress/entities/mahmud.h b/engines/lastexpress/entities/mahmud.h index 647d48b8edc..5feb95cba58 100644 --- a/engines/lastexpress/entities/mahmud.h +++ b/engines/lastexpress/entities/mahmud.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_MAHMUD_H diff --git a/engines/lastexpress/entities/max.cpp b/engines/lastexpress/entities/max.cpp index 1aa391bda07..7e5931322d2 100644 --- a/engines/lastexpress/entities/max.cpp +++ b/engines/lastexpress/entities/max.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/max.h" diff --git a/engines/lastexpress/entities/max.h b/engines/lastexpress/entities/max.h index 93eb165a0f6..17b58475aa1 100644 --- a/engines/lastexpress/entities/max.h +++ b/engines/lastexpress/entities/max.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_MAX_H diff --git a/engines/lastexpress/entities/mertens.cpp b/engines/lastexpress/entities/mertens.cpp index de844db3e93..91082f487e9 100644 --- a/engines/lastexpress/entities/mertens.cpp +++ b/engines/lastexpress/entities/mertens.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/mertens.h" diff --git a/engines/lastexpress/entities/mertens.h b/engines/lastexpress/entities/mertens.h index ccce17795c7..31b7a97dcd6 100644 --- a/engines/lastexpress/entities/mertens.h +++ b/engines/lastexpress/entities/mertens.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_MERTENS_H diff --git a/engines/lastexpress/entities/milos.cpp b/engines/lastexpress/entities/milos.cpp index 01f9362f437..587c43cade9 100644 --- a/engines/lastexpress/entities/milos.cpp +++ b/engines/lastexpress/entities/milos.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/milos.h" diff --git a/engines/lastexpress/entities/milos.h b/engines/lastexpress/entities/milos.h index 6d44d1c4d9c..d58d717f8a8 100644 --- a/engines/lastexpress/entities/milos.h +++ b/engines/lastexpress/entities/milos.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_MILOS_H diff --git a/engines/lastexpress/entities/mmeboutarel.cpp b/engines/lastexpress/entities/mmeboutarel.cpp index 46f7cf40d17..78f2d2fb4b2 100644 --- a/engines/lastexpress/entities/mmeboutarel.cpp +++ b/engines/lastexpress/entities/mmeboutarel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/mmeboutarel.h" diff --git a/engines/lastexpress/entities/mmeboutarel.h b/engines/lastexpress/entities/mmeboutarel.h index 1f1d762dd9e..772451ba15f 100644 --- a/engines/lastexpress/entities/mmeboutarel.h +++ b/engines/lastexpress/entities/mmeboutarel.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_MMEBOUTAREL_H diff --git a/engines/lastexpress/entities/pascale.cpp b/engines/lastexpress/entities/pascale.cpp index a75c76e0ca2..7cf7f7766ee 100644 --- a/engines/lastexpress/entities/pascale.cpp +++ b/engines/lastexpress/entities/pascale.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/pascale.h" diff --git a/engines/lastexpress/entities/pascale.h b/engines/lastexpress/entities/pascale.h index d0098dcf0bd..333ebcae3e3 100644 --- a/engines/lastexpress/entities/pascale.h +++ b/engines/lastexpress/entities/pascale.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_PASCALE_H diff --git a/engines/lastexpress/entities/rebecca.cpp b/engines/lastexpress/entities/rebecca.cpp index a1a8b293292..1cb895d8d67 100644 --- a/engines/lastexpress/entities/rebecca.cpp +++ b/engines/lastexpress/entities/rebecca.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/rebecca.h" diff --git a/engines/lastexpress/entities/rebecca.h b/engines/lastexpress/entities/rebecca.h index bdc9fe1d3bf..e91ee30d4d4 100644 --- a/engines/lastexpress/entities/rebecca.h +++ b/engines/lastexpress/entities/rebecca.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_REBECCA_H diff --git a/engines/lastexpress/entities/salko.cpp b/engines/lastexpress/entities/salko.cpp index c6be25df7d8..4d510bb9bfa 100644 --- a/engines/lastexpress/entities/salko.cpp +++ b/engines/lastexpress/entities/salko.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/salko.h" diff --git a/engines/lastexpress/entities/salko.h b/engines/lastexpress/entities/salko.h index f21724d88ad..63082110530 100644 --- a/engines/lastexpress/entities/salko.h +++ b/engines/lastexpress/entities/salko.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SALKO_H diff --git a/engines/lastexpress/entities/servers0.cpp b/engines/lastexpress/entities/servers0.cpp index 57fa4da1894..1fec7756591 100644 --- a/engines/lastexpress/entities/servers0.cpp +++ b/engines/lastexpress/entities/servers0.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/servers0.h" diff --git a/engines/lastexpress/entities/servers0.h b/engines/lastexpress/entities/servers0.h index 3e1bd21e0d8..2e9165a410e 100644 --- a/engines/lastexpress/entities/servers0.h +++ b/engines/lastexpress/entities/servers0.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SERVERS0_H diff --git a/engines/lastexpress/entities/servers1.cpp b/engines/lastexpress/entities/servers1.cpp index bb3566802d8..cd0a1627550 100644 --- a/engines/lastexpress/entities/servers1.cpp +++ b/engines/lastexpress/entities/servers1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/servers1.h" diff --git a/engines/lastexpress/entities/servers1.h b/engines/lastexpress/entities/servers1.h index 14a6bf09a61..13b30696f09 100644 --- a/engines/lastexpress/entities/servers1.h +++ b/engines/lastexpress/entities/servers1.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SERVERS1_H diff --git a/engines/lastexpress/entities/sophie.cpp b/engines/lastexpress/entities/sophie.cpp index 692c112d629..e0c63f72973 100644 --- a/engines/lastexpress/entities/sophie.cpp +++ b/engines/lastexpress/entities/sophie.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/sophie.h" diff --git a/engines/lastexpress/entities/sophie.h b/engines/lastexpress/entities/sophie.h index 24a70188da5..c2ca348027f 100644 --- a/engines/lastexpress/entities/sophie.h +++ b/engines/lastexpress/entities/sophie.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SOPHIE_H diff --git a/engines/lastexpress/entities/tables.cpp b/engines/lastexpress/entities/tables.cpp index 616188d2534..c372663c40e 100644 --- a/engines/lastexpress/entities/tables.cpp +++ b/engines/lastexpress/entities/tables.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/tables.h" diff --git a/engines/lastexpress/entities/tables.h b/engines/lastexpress/entities/tables.h index e5fe28128b9..7fcfc0499e6 100644 --- a/engines/lastexpress/entities/tables.h +++ b/engines/lastexpress/entities/tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_TABLES_H diff --git a/engines/lastexpress/entities/tatiana.cpp b/engines/lastexpress/entities/tatiana.cpp index d9c9e8350e4..6e25d8c5c7c 100644 --- a/engines/lastexpress/entities/tatiana.cpp +++ b/engines/lastexpress/entities/tatiana.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/tatiana.h" diff --git a/engines/lastexpress/entities/tatiana.h b/engines/lastexpress/entities/tatiana.h index 171f7d62d3c..c457d49b1e5 100644 --- a/engines/lastexpress/entities/tatiana.h +++ b/engines/lastexpress/entities/tatiana.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_TATIANA_H diff --git a/engines/lastexpress/entities/train.cpp b/engines/lastexpress/entities/train.cpp index 0241931bac4..19c6fe279cd 100644 --- a/engines/lastexpress/entities/train.cpp +++ b/engines/lastexpress/entities/train.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/train.h" diff --git a/engines/lastexpress/entities/train.h b/engines/lastexpress/entities/train.h index 95cb0f28bd6..ea9e1d7a073 100644 --- a/engines/lastexpress/entities/train.h +++ b/engines/lastexpress/entities/train.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_TRAIN_H diff --git a/engines/lastexpress/entities/vassili.cpp b/engines/lastexpress/entities/vassili.cpp index c203015d133..09fb5b12233 100644 --- a/engines/lastexpress/entities/vassili.cpp +++ b/engines/lastexpress/entities/vassili.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/vassili.h" diff --git a/engines/lastexpress/entities/vassili.h b/engines/lastexpress/entities/vassili.h index 1862069e25f..843a0651741 100644 --- a/engines/lastexpress/entities/vassili.h +++ b/engines/lastexpress/entities/vassili.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_VASSILI_H diff --git a/engines/lastexpress/entities/verges.cpp b/engines/lastexpress/entities/verges.cpp index 9d5cf6af85e..bc35a105b1b 100644 --- a/engines/lastexpress/entities/verges.cpp +++ b/engines/lastexpress/entities/verges.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/verges.h" diff --git a/engines/lastexpress/entities/verges.h b/engines/lastexpress/entities/verges.h index 40a43eac9de..17a3c8ac401 100644 --- a/engines/lastexpress/entities/verges.h +++ b/engines/lastexpress/entities/verges.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_VERGES_H diff --git a/engines/lastexpress/entities/vesna.cpp b/engines/lastexpress/entities/vesna.cpp index 87742e78a4d..8e09dbf7b08 100644 --- a/engines/lastexpress/entities/vesna.cpp +++ b/engines/lastexpress/entities/vesna.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/vesna.h" diff --git a/engines/lastexpress/entities/vesna.h b/engines/lastexpress/entities/vesna.h index 55a9a989c58..a09664096d9 100644 --- a/engines/lastexpress/entities/vesna.h +++ b/engines/lastexpress/entities/vesna.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_VESNA_H diff --git a/engines/lastexpress/entities/yasmin.cpp b/engines/lastexpress/entities/yasmin.cpp index 2eb5c13862e..7e8b2f73480 100644 --- a/engines/lastexpress/entities/yasmin.cpp +++ b/engines/lastexpress/entities/yasmin.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/yasmin.h" diff --git a/engines/lastexpress/entities/yasmin.h b/engines/lastexpress/entities/yasmin.h index b35c713f8b7..e943a8b1583 100644 --- a/engines/lastexpress/entities/yasmin.h +++ b/engines/lastexpress/entities/yasmin.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_YASMIN_H diff --git a/engines/lastexpress/eventhandler.h b/engines/lastexpress/eventhandler.h index 6f28984d2c8..c561d575410 100644 --- a/engines/lastexpress/eventhandler.h +++ b/engines/lastexpress/eventhandler.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_EVENTHANDLER_H diff --git a/engines/lastexpress/game/action.cpp b/engines/lastexpress/game/action.cpp index d14e295cb34..7540d18ed8a 100644 --- a/engines/lastexpress/game/action.cpp +++ b/engines/lastexpress/game/action.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/action.h" diff --git a/engines/lastexpress/game/action.h b/engines/lastexpress/game/action.h index 6a2e3eb5975..e1a4a532248 100644 --- a/engines/lastexpress/game/action.h +++ b/engines/lastexpress/game/action.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_ACTION_H diff --git a/engines/lastexpress/game/beetle.cpp b/engines/lastexpress/game/beetle.cpp index 665edb79a56..cb6f0a33065 100644 --- a/engines/lastexpress/game/beetle.cpp +++ b/engines/lastexpress/game/beetle.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/beetle.h" diff --git a/engines/lastexpress/game/beetle.h b/engines/lastexpress/game/beetle.h index 661618a2515..d3c47f39e56 100644 --- a/engines/lastexpress/game/beetle.h +++ b/engines/lastexpress/game/beetle.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_BEETLE_H diff --git a/engines/lastexpress/game/entities.cpp b/engines/lastexpress/game/entities.cpp index d124d8cb239..513ad114b09 100644 --- a/engines/lastexpress/game/entities.cpp +++ b/engines/lastexpress/game/entities.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/entities.h" diff --git a/engines/lastexpress/game/entities.h b/engines/lastexpress/game/entities.h index 8cc2072c42f..eb5eae461f3 100644 --- a/engines/lastexpress/game/entities.h +++ b/engines/lastexpress/game/entities.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_ENTITIES_H diff --git a/engines/lastexpress/game/fight.cpp b/engines/lastexpress/game/fight.cpp index 5777ef470b3..ecc43bed2be 100644 --- a/engines/lastexpress/game/fight.cpp +++ b/engines/lastexpress/game/fight.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/fight.h" diff --git a/engines/lastexpress/game/fight.h b/engines/lastexpress/game/fight.h index 44840171842..a33cc93a291 100644 --- a/engines/lastexpress/game/fight.h +++ b/engines/lastexpress/game/fight.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_FIGHT_H diff --git a/engines/lastexpress/game/inventory.cpp b/engines/lastexpress/game/inventory.cpp index c4d43d53d72..adf6ff772ef 100644 --- a/engines/lastexpress/game/inventory.cpp +++ b/engines/lastexpress/game/inventory.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/inventory.h" @@ -127,11 +124,6 @@ void Inventory::init() { _selectedItem = kItemNone; } -// FIXME we need to draw cursors with full background opacity so that whatever is in the background is erased -// this saved us clearing some part of the background when switching between states - -// TODO if we draw inventory objects on screen, we need to load a new scene. -// Signal that the inventory has taken over the screen and stop processing mouse events after we have been called void Inventory::handleMouseEvent(const Common::Event &ev) { _useMagnifier = false; @@ -180,13 +172,39 @@ void Inventory::handleMouseEvent(const Common::Event &ev) { // Selected item if (ev.mouse.x >= 32) { if (_isOpened) { - // If clicked - if (ev.type == Common::EVENT_LBUTTONDOWN) { - if (_highlightedItemIndex != 0) { - error("[Inventory::handleMouseEvent] Click on highlighted item not implemented"); - } + // If we are currently inside inventory with the mouse pressed + if (getFlags()->mouseLeftPressed) { + if (_highlightedItemIndex) + drawHighlight(_highlightedItemIndex, true); } else { - warning("[Inventory::handleMouseEvent] Default handling of open menu not implemented"); + // The user released the mouse button, we need to update the inventory state (clear hightlight and items) + drawItem((CursorStyle)getProgress().portrait, 0, 0, 1); + _engine->getGraphicsManager()->clear(GraphicsManager::kBackgroundInventory, Common::Rect(0, 44, 32, (int16)(40 * _itemsShown + 40))); + _isOpened = false; + askForRedraw(); + + drawSelectedItem(); + + // Load backup scene + if (getState()->sceneUseBackup) { + SceneIndex scene = kSceneNone; + if (getState()->sceneBackup2) { + scene = getState()->sceneBackup2; + getState()->sceneBackup2 = kSceneNone; + + // Load our scene + getScenes()->loadScene(scene); + } else if (!getEvent(kEventKronosBringFirebird) && !getProgress().isEggOpen) { + getState()->sceneUseBackup = false; + scene = getState()->sceneBackup; + + if (getEntities()->getPosition(getScenes()->get(scene)->car, getScenes()->get(scene)->position)) + scene = getScenes()->processIndex(getState()->sceneBackup); + + // Load our scene + getScenes()->loadScene(scene); + } + } } } else { if (_portraitHighlighted) { @@ -195,10 +213,30 @@ void Inventory::handleMouseEvent(const Common::Event &ev) { _portraitHighlighted = false; } + // Magnifier if (_selectedItem != kItemNone && get(_selectedItem)->scene != kSceneNone && _selectedItemRect.contains(ev.mouse)) { - error("[Inventory::handleMouseEvent] Default handling of selected item not implemented"); + + if (!getState()->sceneUseBackup || (getState()->sceneBackup2 && getFirstExaminableItem() == _selectedItem)) + _useMagnifier = true; + + if (getFlags()->mouseLeftPressed) { + if (getState()->sceneUseBackup) { + if (getState()->sceneBackup2 + && getFirstExaminableItem() == _selectedItem) { + SceneIndex sceneIndex = getState()->sceneBackup2; + getState()->sceneBackup2 = kSceneNone; + + getScenes()->loadScene(sceneIndex); + } + } else { + getState()->sceneBackup = getState()->scene; + getState()->sceneUseBackup = true; + + getScenes()->loadScene(get(_selectedItem)->scene); + } + } } } @@ -237,6 +275,7 @@ void Inventory::handleMouseEvent(const Common::Event &ev) { // Reset items and portrait drawItem((CursorStyle)getProgress().portrait, 0, 0, 1); _engine->getGraphicsManager()->clear(GraphicsManager::kBackgroundInventory, Common::Rect(0, 44, 32, (int16)(40 * _itemsShown + 40))); + askForRedraw(); _highlightedItemIndex = 0; _itemsShown = 0; @@ -257,11 +296,10 @@ void Inventory::handleMouseEvent(const Common::Event &ev) { getScenes()->loadScene(entry.scene); } - if (entry.field_2) { + if (entry.field_2) selectItem((InventoryItem)index); - } else { + else drawSelectedItem(); - } // Set inventory as closed (will cause a cleanup on next call) _isOpened = false; diff --git a/engines/lastexpress/game/inventory.h b/engines/lastexpress/game/inventory.h index 9a885438ebf..b1995adce35 100644 --- a/engines/lastexpress/game/inventory.h +++ b/engines/lastexpress/game/inventory.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_INVENTORY_H diff --git a/engines/lastexpress/game/logic.cpp b/engines/lastexpress/game/logic.cpp index 83e067f67c0..0911c60de06 100644 --- a/engines/lastexpress/game/logic.cpp +++ b/engines/lastexpress/game/logic.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/logic.h" diff --git a/engines/lastexpress/game/logic.h b/engines/lastexpress/game/logic.h index fc867d76805..8b7dcef942b 100644 --- a/engines/lastexpress/game/logic.h +++ b/engines/lastexpress/game/logic.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_LOGIC_H diff --git a/engines/lastexpress/game/menu.cpp b/engines/lastexpress/game/menu.cpp index 65b9cd9a915..f9eef26326b 100644 --- a/engines/lastexpress/game/menu.cpp +++ b/engines/lastexpress/game/menu.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/menu.h" diff --git a/engines/lastexpress/game/menu.h b/engines/lastexpress/game/menu.h index 765a611c41d..4b84c065cba 100644 --- a/engines/lastexpress/game/menu.h +++ b/engines/lastexpress/game/menu.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_MENU_H diff --git a/engines/lastexpress/game/object.cpp b/engines/lastexpress/game/object.cpp index 4f296debcb0..a6000759532 100644 --- a/engines/lastexpress/game/object.cpp +++ b/engines/lastexpress/game/object.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/object.h" diff --git a/engines/lastexpress/game/object.h b/engines/lastexpress/game/object.h index 96af4f07a6c..87c9d7d4079 100644 --- a/engines/lastexpress/game/object.h +++ b/engines/lastexpress/game/object.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_OBJECT_H diff --git a/engines/lastexpress/game/savegame.cpp b/engines/lastexpress/game/savegame.cpp index ba9e172b2bf..5d06ecab13a 100644 --- a/engines/lastexpress/game/savegame.cpp +++ b/engines/lastexpress/game/savegame.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/savegame.h" diff --git a/engines/lastexpress/game/savegame.h b/engines/lastexpress/game/savegame.h index 5c0e0e9890d..6f0408487fc 100644 --- a/engines/lastexpress/game/savegame.h +++ b/engines/lastexpress/game/savegame.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SAVELOAD_H diff --git a/engines/lastexpress/game/savepoint.cpp b/engines/lastexpress/game/savepoint.cpp index 30467f8368a..7ec7c241e90 100644 --- a/engines/lastexpress/game/savepoint.cpp +++ b/engines/lastexpress/game/savepoint.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/savepoint.h" diff --git a/engines/lastexpress/game/savepoint.h b/engines/lastexpress/game/savepoint.h index ca507ab8ab6..a3303b4b8a7 100644 --- a/engines/lastexpress/game/savepoint.h +++ b/engines/lastexpress/game/savepoint.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SAVEPOINT_H diff --git a/engines/lastexpress/game/scenes.cpp b/engines/lastexpress/game/scenes.cpp index 15fe0617d8d..e830b1d128a 100644 --- a/engines/lastexpress/game/scenes.cpp +++ b/engines/lastexpress/game/scenes.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/scenes.h" diff --git a/engines/lastexpress/game/scenes.h b/engines/lastexpress/game/scenes.h index b70526839f6..172dde26835 100644 --- a/engines/lastexpress/game/scenes.h +++ b/engines/lastexpress/game/scenes.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SCENEMANAGER_H diff --git a/engines/lastexpress/game/sound.cpp b/engines/lastexpress/game/sound.cpp index 5638f75d000..81ed97481ce 100644 --- a/engines/lastexpress/game/sound.cpp +++ b/engines/lastexpress/game/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/sound.h" @@ -39,6 +36,9 @@ namespace LastExpress { +#define SOUNDCACHE_ENTRY_SIZE 92160 +#define SOUNDCACHE_MAX_SIZE 6 + // Letters & messages const char *messages[24] = { "", @@ -112,14 +112,20 @@ SoundManager::SoundManager(LastExpressEngine *engine) : _engine(engine), _state( memset(&_buffer, 0, sizeof(_buffer)); memset(&_lastWarning, 0, sizeof(_lastWarning)); + // Sound cache + _soundCacheData = malloc(6 * SOUNDCACHE_ENTRY_SIZE); + _drawSubtitles = 0; _currentSubtitle = NULL; } SoundManager::~SoundManager() { - for (Common::List::iterator i = _cache.begin(); i != _cache.end(); ++i) + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) SAFE_DELETE(*i); - _cache.clear(); + _soundList.clear(); + + // Entries in the cache are just pointers to sound list entries + _soundCache.clear(); for (Common::List::iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) SAFE_DELETE(*i); @@ -127,6 +133,8 @@ SoundManager::~SoundManager() { _currentSubtitle = NULL; + free(_soundCacheData); + // Zero passed pointers _engine = NULL; } @@ -137,11 +145,11 @@ SoundManager::~SoundManager() { void SoundManager::handleTimer() { Common::StackLock locker(_mutex); - for (Common::List::iterator i = _cache.begin(); i != _cache.end(); ++i) { + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { SoundEntry *entry = (*i); if (entry->stream == NULL) { SAFE_DELETE(*i); - i = _cache.reverse_erase(i); + i = _soundList.reverse_erase(i); continue; } else if (!entry->soundStream) { entry->soundStream = new StreamedSound(); @@ -157,7 +165,7 @@ void SoundManager::handleTimer() { ////////////////////////////////////////////////////////////////////////// void SoundManager::updateQueue() { // TODO add mutex lock! - //warning("Sound::unknownFunction1: not implemented!"); + warning("Sound::updateQueue: not implemented!"); } void SoundManager::resetQueue(SoundType type1, SoundType type2) { @@ -166,7 +174,7 @@ void SoundManager::resetQueue(SoundType type1, SoundType type2) { Common::StackLock locker(_mutex); - for (Common::List::iterator i = _cache.begin(); i != _cache.end(); ++i) { + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { if ((*i)->type != type1 && (*i)->type != type2) resetEntry(*i); } @@ -200,14 +208,14 @@ void SoundManager::clearQueue() { Common::StackLock locker(_mutex); - for (Common::List::iterator i = _cache.begin(); i != _cache.end(); ++i) { + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { SoundEntry *entry = (*i); // Delete entry removeEntry(entry); SAFE_DELETE(entry); - i = _cache.reverse_erase(i); + i = _soundList.reverse_erase(i); } updateSubtitles(); @@ -241,10 +249,11 @@ void SoundManager::setupEntry(SoundEntry *entry, Common::String name, FlagType f setEntryType(entry, flag); setEntryStatus(entry, flag); - // Add entry to cache - _cache.push_back(entry); + // Add entry to sound list + _soundList.push_back(entry); - setupCache(entry); + // TODO Add entry to cache and load sound data + //setupCache(entry); loadSoundData(entry, name); } @@ -331,15 +340,69 @@ void SoundManager::setEntryStatus(SoundEntry *entry, FlagType flag) const { entry->status.status = (status | kSoundStatusClear4); } +void SoundManager::setInCache(SoundEntry *entry) { + entry->status.status |= kSoundStatusClear2; +} + bool SoundManager::setupCache(SoundEntry *entry) { - warning("Sound::setupCache: not implemented!"); + if (entry->soundData) + return true; + + if (_soundCache.size() >= SOUNDCACHE_MAX_SIZE) { + + SoundEntry *cacheEntry = NULL; + uint32 size = 1000; + + for (Common::List::iterator i = _soundCache.begin(); i != _soundCache.end(); ++i) { + if (!((*i)->status.status & kSoundStatus_180)) { + uint32 newSize = (*i)->field_4C + ((*i)->status.status & kSoundStatusClear1); + + if (newSize < size) { + cacheEntry = (*i); + size = newSize; + } + } + } + + if (entry->field_4C <= size) + return false; + + if (cacheEntry) + setInCache(cacheEntry); + + // TODO: Wait until the cache entry is ready to be removed + while (!(cacheEntry->status.status1 & 1)) + ; + + if (cacheEntry->soundData) + removeFromCache(cacheEntry); + + _soundCache.push_back(entry); + entry->soundData = (char *)_soundCacheData + SOUNDCACHE_ENTRY_SIZE * (_soundCache.size() - 1); + } else { + _soundCache.push_back(entry); + entry->soundData = (char *)_soundCacheData + SOUNDCACHE_ENTRY_SIZE * (_soundCache.size() - 1); + } + return true; } +void SoundManager::removeFromCache(SoundEntry *entry) { + for (Common::List::iterator i = _soundCache.begin(); i != _soundCache.end(); ++i) { + if ((*i) == entry) { + // Remove sound buffer + entry->soundData = NULL; + + // Remove entry from sound cache + i = _soundCache.reverse_erase(i); + } + } +} + void SoundManager::clearStatus() { Common::StackLock locker(_mutex); - for (Common::List::iterator i = _cache.begin(); i != _cache.end(); ++i) + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) (*i)->status.status |= kSoundStatusClear3; } @@ -502,7 +565,7 @@ void SoundManager::unknownFunction4() { // Entry search ////////////////////////////////////////////////////////////////////////// SoundManager::SoundEntry *SoundManager::getEntry(EntityIndex index) { - for (Common::List::iterator i = _cache.begin(); i != _cache.end(); ++i) { + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { if ((*i)->entity == index) return *i; } @@ -514,7 +577,7 @@ SoundManager::SoundEntry *SoundManager::getEntry(Common::String name) { if (!name.contains('.')) name += ".SND"; - for (Common::List::iterator i = _cache.begin(); i != _cache.end(); ++i) { + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { if ((*i)->name2 == name) return *i; } @@ -523,7 +586,7 @@ SoundManager::SoundEntry *SoundManager::getEntry(Common::String name) { } SoundManager::SoundEntry *SoundManager::getEntry(SoundType type) { - for (Common::List::iterator i = _cache.begin(); i != _cache.end(); ++i) { + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { if ((*i)->type == type) return *i; } @@ -546,7 +609,7 @@ void SoundManager::saveLoadWithSerializer(Common::Serializer &s) { // Save or load each entry data if (s.isSaving()) { - for (Common::List::iterator i = _cache.begin(); i != _cache.end(); ++i) { + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { SoundEntry *entry = *i; if (entry->name2.matchString("NISSND?") && (entry->status.status & kFlagType7) != kFlag3) { s.syncAsUint32LE(entry->status.status); // status; @@ -587,7 +650,7 @@ uint32 SoundManager::count() { Common::StackLock locker(_mutex); uint32 numEntries = 0; - for (Common::List::iterator i = _cache.begin(); i != _cache.end(); ++i) + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) if ((*i)->name2.matchString("NISSND?")) ++numEntries; @@ -1889,7 +1952,7 @@ void SoundManager::playLoopingSound() { void SoundManager::stopAllSound() { Common::StackLock locker(_mutex); - for (Common::List::iterator i = _cache.begin(); i != _cache.end(); ++i) + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) (*i)->soundStream->stop(); } diff --git a/engines/lastexpress/game/sound.h b/engines/lastexpress/game/sound.h index a2c69eb8275..ddafc218295 100644 --- a/engines/lastexpress/game/sound.h +++ b/engines/lastexpress/game/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SOUND_H @@ -209,6 +206,7 @@ private: enum SoundStatus { kSoundStatus_20 = 0x20, kSoundStatus_40 = 0x40, + kSoundStatus_180 = 0x180, kSoundStatusRemoved = 0x200, kSoundStatus_400 = 0x400, @@ -250,8 +248,8 @@ private: SoundType type; // int //int field_8; //int field_C; - //int field_10; - //int fileData; + int processedFrameCount; + void *soundData; //int field_18; int field_1C; uint32 time; @@ -265,7 +263,7 @@ private: int field_40; EntityIndex entity; int field_48; - int field_4C; + uint32 field_4C; Common::String name1; //char[16]; Common::String name2; //char[16]; //int next; // offset to the next structure in the list (not used) @@ -278,6 +276,9 @@ private: status.status = 0; type = kSoundTypeNone; + processedFrameCount = 0; + soundData = NULL; + field_1C = 0; time = 0; @@ -346,8 +347,10 @@ private: // Looping sound void playLoopingSound(); - // Sound cache - Common::List _cache; + // Sound entries + Common::List _soundList; ///< List of all sound entries + Common::List _soundCache; ///< List of entries with a data buffer + void *_soundCacheData; SoundEntry *getEntry(EntityIndex index); SoundEntry *getEntry(Common::String name); @@ -356,7 +359,9 @@ private: void setupEntry(SoundEntry *entry, Common::String name, FlagType flag, int a4); void setEntryType(SoundEntry *entry, FlagType flag); void setEntryStatus(SoundEntry *entry, FlagType flag) const; + void setInCache(SoundEntry *entry); bool setupCache(SoundEntry *entry); + void removeFromCache(SoundEntry *entry); void loadSoundData(SoundEntry *entry, Common::String name); void updateEntry(SoundEntry *entry, uint value) const; diff --git a/engines/lastexpress/game/state.cpp b/engines/lastexpress/game/state.cpp index 45cb2c58abb..0cf2ddba401 100644 --- a/engines/lastexpress/game/state.cpp +++ b/engines/lastexpress/game/state.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/state.h" diff --git a/engines/lastexpress/game/state.h b/engines/lastexpress/game/state.h index 663550acc2e..8f71e7d424f 100644 --- a/engines/lastexpress/game/state.h +++ b/engines/lastexpress/game/state.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_STATE_H diff --git a/engines/lastexpress/graphics.cpp b/engines/lastexpress/graphics.cpp index c45baba808f..abbdf2b7661 100644 --- a/engines/lastexpress/graphics.cpp +++ b/engines/lastexpress/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/graphics.h" diff --git a/engines/lastexpress/graphics.h b/engines/lastexpress/graphics.h index 5231d00f6f8..7db7e88989a 100644 --- a/engines/lastexpress/graphics.h +++ b/engines/lastexpress/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_GRAPHICS_H diff --git a/engines/lastexpress/helpers.h b/engines/lastexpress/helpers.h index f9e61b6fe69..594c8b04005 100644 --- a/engines/lastexpress/helpers.h +++ b/engines/lastexpress/helpers.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_HELPERS_H diff --git a/engines/lastexpress/lastexpress.cpp b/engines/lastexpress/lastexpress.cpp index 535f5e86b79..d195fcfad34 100644 --- a/engines/lastexpress/lastexpress.cpp +++ b/engines/lastexpress/lastexpress.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/lastexpress.h" @@ -40,7 +37,6 @@ #include "common/config-manager.h" #include "common/debug-channels.h" -#include "common/EventRecorder.h" #include "engines/util.h" @@ -52,10 +48,16 @@ const char *g_entityNames[] = { "Player", "Anna", "August", "Mertens", "Coudert" namespace LastExpress { LastExpressEngine::LastExpressEngine(OSystem *syst, const ADGameDescription *gd) : - Engine(syst), _gameDescription(gd), _debugger(NULL), _cursor(NULL), - _font(NULL), _logic(NULL), _menu(NULL), _frameCounter(0), _lastFrameCount(0), - _graphicsMan(NULL), _resMan(NULL), _sceneMan(NULL), _soundMan(NULL), - _eventMouse(NULL), _eventTick(NULL), _eventMouseBackup(NULL), _eventTickBackup(NULL) { + Engine(syst), _gameDescription(gd), + _debugger(NULL), _cursor(NULL), + _font(NULL), _logic(NULL), _menu(NULL), + _frameCounter(0), _lastFrameCount(0), + _graphicsMan(NULL), _resMan(NULL), + _sceneMan(NULL), _soundMan(NULL), + _eventMouse(NULL), _eventTick(NULL), + _eventMouseBackup(NULL), _eventTickBackup(NULL), + _random("lastexpress") + { // Setup mixer syncSoundSettings(); @@ -74,8 +76,6 @@ LastExpressEngine::LastExpressEngine(OSystem *syst, const ADGameDescription *gd) DebugMan.addDebugChannel(kLastExpressDebugLogic, "Logic", "Debug logic"); DebugMan.addDebugChannel(kLastExpressDebugScenes, "Scenes", "Debug scenes & hotspots"); DebugMan.addDebugChannel(kLastExpressDebugUnknown, "Unknown", "Debug unknown data"); - - g_eventRec.registerRandomSource(_random, "lastexpress"); } LastExpressEngine::~LastExpressEngine() { diff --git a/engines/lastexpress/lastexpress.h b/engines/lastexpress/lastexpress.h index a602e4956bf..270ab655a15 100644 --- a/engines/lastexpress/lastexpress.h +++ b/engines/lastexpress/lastexpress.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_H diff --git a/engines/lastexpress/resource.cpp b/engines/lastexpress/resource.cpp index dff686a5032..f376a3a2994 100644 --- a/engines/lastexpress/resource.cpp +++ b/engines/lastexpress/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/resource.h" diff --git a/engines/lastexpress/resource.h b/engines/lastexpress/resource.h index ea6508edc3b..7dc909ab34c 100644 --- a/engines/lastexpress/resource.h +++ b/engines/lastexpress/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_RESOURCE_H diff --git a/engines/lastexpress/shared.h b/engines/lastexpress/shared.h index 80e227e6a77..8cebe16d87a 100644 --- a/engines/lastexpress/shared.h +++ b/engines/lastexpress/shared.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SHARED_H diff --git a/engines/lure/animseq.cpp b/engines/lure/animseq.cpp index 9c18cb33aa0..8037563677b 100644 --- a/engines/lure/animseq.cpp +++ b/engines/lure/animseq.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/animseq.h" diff --git a/engines/lure/animseq.h b/engines/lure/animseq.h index 3609837dba7..fde1fab9218 100644 --- a/engines/lure/animseq.h +++ b/engines/lure/animseq.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_ANIMSEQ_H diff --git a/engines/lure/debugger.cpp b/engines/lure/debugger.cpp index fc2029c6c45..68410875f73 100644 --- a/engines/lure/debugger.cpp +++ b/engines/lure/debugger.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -537,7 +534,7 @@ bool Debugger::cmd_showAnim(int argc, const char **argv) { } // Bottle object is used as a handy hotspot holder that doesn't have any - // tick proc behaviour that we need to worry about + // tick proc behavior that we need to worry about Hotspot *hotspot = res.activateHotspot(BOTTLE_HOTSPOT_ID); hotspot->setLayer(0xfe); hotspot->setSize(width, height); diff --git a/engines/lure/debugger.h b/engines/lure/debugger.h index dd1d8b5fc6e..a4d4d689c49 100644 --- a/engines/lure/debugger.h +++ b/engines/lure/debugger.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_DEBUGGER_H diff --git a/engines/lure/decode.cpp b/engines/lure/decode.cpp index 5ffdcf1884a..59390e6e910 100644 --- a/engines/lure/decode.cpp +++ b/engines/lure/decode.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/decode.h" @@ -134,7 +131,7 @@ MemoryBlock *PictureDecoder::egaDecode(MemoryBlock *src, uint32 maxOutputSize) { READ_BIT_DX if (!bitFlag) { - // Get the favourite color + // Get the favorite color v = popTable[tableOffset]; } else { @@ -146,7 +143,7 @@ MemoryBlock *PictureDecoder::egaDecode(MemoryBlock *src, uint32 maxOutputSize) { READ_BIT_DX if (bitFlag) { - // We have no favourite. Could this be a repeat? + // We have no favorite. Could this be a repeat? al = dx >> 11; READ_BITS(5); @@ -187,7 +184,7 @@ MemoryBlock *PictureDecoder::egaDecode(MemoryBlock *src, uint32 maxOutputSize) { } } else { - // Fourth favourite + // Fourth favorite v = popTable[tableOffset + 96]; } @@ -196,10 +193,10 @@ MemoryBlock *PictureDecoder::egaDecode(MemoryBlock *src, uint32 maxOutputSize) { READ_BIT_DX if (bitFlag) { - // Third favourite + // Third favorite v = popTable[tableOffset + 64]; } else { - // Second favourite + // Second favorite v = popTable[tableOffset + 32]; } } diff --git a/engines/lure/decode.h b/engines/lure/decode.h index 9cc594df646..93f617af7e6 100644 --- a/engines/lure/decode.h +++ b/engines/lure/decode.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_DECODE_H diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp index dd2a702e2a3..4d03148e310 100644 --- a/engines/lure/detection.cpp +++ b/engines/lure/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -208,7 +205,7 @@ public: LureMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Lure of the Temptress Engine"; + return "Lure"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/lure/disk.cpp b/engines/lure/disk.cpp index f1838e3d67b..9212508be09 100644 --- a/engines/lure/disk.cpp +++ b/engines/lure/disk.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/lure/disk.h b/engines/lure/disk.h index 79aaf80bbc9..1872fbd0555 100644 --- a/engines/lure/disk.h +++ b/engines/lure/disk.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_DISK_H diff --git a/engines/lure/events.cpp b/engines/lure/events.cpp index f56a57ca34b..fe60b56658b 100644 --- a/engines/lure/events.cpp +++ b/engines/lure/events.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/lure/events.h b/engines/lure/events.h index f04072aa0f0..dd3f82fe198 100644 --- a/engines/lure/events.h +++ b/engines/lure/events.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_EVENTS_H diff --git a/engines/lure/fights.cpp b/engines/lure/fights.cpp index 983033281a9..ab5d992bdb3 100644 --- a/engines/lure/fights.cpp +++ b/engines/lure/fights.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/fights.h" diff --git a/engines/lure/fights.h b/engines/lure/fights.h index 0aa44030d28..89f49d8c6d9 100644 --- a/engines/lure/fights.h +++ b/engines/lure/fights.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_FIGHT_H diff --git a/engines/lure/game.cpp b/engines/lure/game.cpp index 7e13cff0322..9542c35785f 100644 --- a/engines/lure/game.cpp +++ b/engines/lure/game.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/game.h" diff --git a/engines/lure/game.h b/engines/lure/game.h index 123ac0dca74..42818e404b7 100644 --- a/engines/lure/game.h +++ b/engines/lure/game.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_GAME_H diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp index 5644ef798ca..97fbaa72aee 100644 --- a/engines/lure/hotspots.cpp +++ b/engines/lure/hotspots.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/hotspots.h" diff --git a/engines/lure/hotspots.h b/engines/lure/hotspots.h index e9f5d56edd9..a58a34456e6 100644 --- a/engines/lure/hotspots.h +++ b/engines/lure/hotspots.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_HOTSPOTS_H diff --git a/engines/lure/intro.cpp b/engines/lure/intro.cpp index e054408a490..ce330be7c40 100644 --- a/engines/lure/intro.cpp +++ b/engines/lure/intro.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/lure.h" diff --git a/engines/lure/intro.h b/engines/lure/intro.h index f4713c562a3..ad442f1564b 100644 --- a/engines/lure/intro.h +++ b/engines/lure/intro.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_INTRO_H diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp index b0968c19564..3217cf039d4 100644 --- a/engines/lure/lure.cpp +++ b/engines/lure/lure.cpp @@ -18,16 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" #include "common/debug-channels.h" #include "common/system.h" #include "common/savefile.h" -#include "common/EventRecorder.h" #include "engines/util.h" @@ -42,8 +38,8 @@ namespace Lure { static LureEngine *int_engine = NULL; -LureEngine::LureEngine(OSystem *system, const LureGameDescription *gameDesc): Engine(system), _gameDescription(gameDesc) { - g_eventRec.registerRandomSource(_rnd, "lure"); +LureEngine::LureEngine(OSystem *system, const LureGameDescription *gameDesc) + : Engine(system), _gameDescription(gameDesc), _rnd("lure") { DebugMan.addDebugChannel(kLureDebugScripts, "scripts", "Scripts debugging"); DebugMan.addDebugChannel(kLureDebugAnimations, "animations", "Animations debugging"); @@ -55,7 +51,7 @@ LureEngine::LureEngine(OSystem *system, const LureGameDescription *gameDesc): En Common::Error LureEngine::init() { int_engine = this; - _initialised = false; + _initialized = false; _saveLoadAllowed = false; initGraphics(FULL_SCREEN_WIDTH, FULL_SCREEN_HEIGHT, false); @@ -89,12 +85,12 @@ Common::Error LureEngine::init() { _mouse = new Mouse(); _events = new Events(); _menu = new Menu(); - Surface::initialise(); + Surface::initialize(); _room = new Room(); _fights = new FightsManager(); _gameToLoad = -1; - _initialised = true; + _initialized = true; // Setup mixer syncSoundSettings(); @@ -106,9 +102,9 @@ LureEngine::~LureEngine() { // Remove all of our debug levels here DebugMan.clearAllDebugChannels(); - if (_initialised) { - // Delete and deinitialise subsystems - Surface::deinitialise(); + if (_initialized) { + // Delete and deinitialize subsystems + Surface::deinitialize(); Sound.destroy(); delete _fights; delete _room; diff --git a/engines/lure/lure.h b/engines/lure/lure.h index 52b785a09a1..7a67c8b8554 100644 --- a/engines/lure/lure.h +++ b/engines/lure/lure.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_H @@ -68,7 +65,7 @@ struct LureGameDescription; class LureEngine : public Engine { private: - bool _initialised; + bool _initialized; int _gameToLoad; uint8 _saveVersion; Disk *_disk; diff --git a/engines/lure/luredefs.h b/engines/lure/luredefs.h index 0ef7a73b7e6..91fb650af33 100644 --- a/engines/lure/luredefs.h +++ b/engines/lure/luredefs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LUREDEFS_H diff --git a/engines/lure/memory.cpp b/engines/lure/memory.cpp index d3d5067ccea..c5c28fa8bc4 100644 --- a/engines/lure/memory.cpp +++ b/engines/lure/memory.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/memory.h" diff --git a/engines/lure/memory.h b/engines/lure/memory.h index f51c4fc49e6..05bf23a9ab6 100644 --- a/engines/lure/memory.h +++ b/engines/lure/memory.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_MEMORY_H diff --git a/engines/lure/menu.cpp b/engines/lure/menu.cpp index f9a78d8fc80..9919471c76a 100644 --- a/engines/lure/menu.cpp +++ b/engines/lure/menu.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/menu.h" diff --git a/engines/lure/menu.h b/engines/lure/menu.h index fcc63083754..b3016f05606 100644 --- a/engines/lure/menu.h +++ b/engines/lure/menu.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_MENU_H diff --git a/engines/lure/palette.cpp b/engines/lure/palette.cpp index b08ca64dfb8..39755617497 100644 --- a/engines/lure/palette.cpp +++ b/engines/lure/palette.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/lure.h" diff --git a/engines/lure/palette.h b/engines/lure/palette.h index 9420079346b..2af1f55973d 100644 --- a/engines/lure/palette.h +++ b/engines/lure/palette.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_PALETTE_H diff --git a/engines/lure/res.cpp b/engines/lure/res.cpp index 01b0bd0d4a8..fbf9f33b87f 100644 --- a/engines/lure/res.cpp +++ b/engines/lure/res.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/res.h" @@ -348,7 +345,7 @@ void Resources::reloadData() { } delete mb; - // Initialise delay list + // Initialize delay list _delayList.clear(true); // Load miscellaneous data diff --git a/engines/lure/res.h b/engines/lure/res.h index cd6fcde201e..a0a908f53da 100644 --- a/engines/lure/res.h +++ b/engines/lure/res.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_RES_H @@ -117,7 +114,7 @@ public: MemoryBlock *messagesData() { return _messagesData; } uint16 getHotspotScript(uint16 index); HotspotList &activeHotspots() { return _activeHotspots; } - uint16 random() { return _rnd.getRandomNumber(65536) & 0xffff; } + uint16 getRandom() { return _rnd.getRandomNumber(0xffff); } HotspotData *getHotspot(uint16 hotspotId); Hotspot *getActiveHotspot(uint16 hotspotId); HotspotOverrideData *getHotspotOverride(uint16 hotspotId); diff --git a/engines/lure/res_struct.cpp b/engines/lure/res_struct.cpp index 39beb2729ea..222f55b5dc7 100644 --- a/engines/lure/res_struct.cpp +++ b/engines/lure/res_struct.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/disk.h" @@ -418,7 +415,7 @@ HotspotData::HotspotData(HotspotResource *rec) { flags2 = READ_LE_UINT16(&rec->flags2); headerFlags = READ_LE_UINT16(&rec->hdrFlags); - // Initialise runtime fields + // Initialize runtime fields actionCtr = 0; blockedState = BS_NONE; blockedFlag = false; diff --git a/engines/lure/res_struct.h b/engines/lure/res_struct.h index 58ee3f4c025..49b6ef78bae 100644 --- a/engines/lure/res_struct.h +++ b/engines/lure/res_struct.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_RESSTRUCT_H diff --git a/engines/lure/room.cpp b/engines/lure/room.cpp index 4cefe1fabb4..2cb871d73f1 100644 --- a/engines/lure/room.cpp +++ b/engines/lure/room.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/room.h" diff --git a/engines/lure/room.h b/engines/lure/room.h index f24136ac42c..deafa28a666 100644 --- a/engines/lure/room.h +++ b/engines/lure/room.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_ROOM_H diff --git a/engines/lure/screen.cpp b/engines/lure/screen.cpp index e02f492ef25..4eb6fd46a3e 100644 --- a/engines/lure/screen.cpp +++ b/engines/lure/screen.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/screen.h" diff --git a/engines/lure/screen.h b/engines/lure/screen.h index 94bbab932ec..2a2fa6b2f28 100644 --- a/engines/lure/screen.h +++ b/engines/lure/screen.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_SCREEN_H diff --git a/engines/lure/scripts.cpp b/engines/lure/scripts.cpp index 20cbd328ceb..22656dd3fef 100644 --- a/engines/lure/scripts.cpp +++ b/engines/lure/scripts.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/animseq.h" @@ -34,7 +31,6 @@ #include "lure/sound.h" #include "common/stack.h" #include "common/endian.h" -#include "common/EventRecorder.h" namespace Lure { @@ -1131,7 +1127,7 @@ uint16 Script::execute(uint16 startOffset) { break; case S_OPCODE_RANDOM: - param = r.random() >> 8; // make number between 0 to 255 + param = r.getRandom() >> 8; // make number between 0 to 255 break; case S_OPCODE_END: diff --git a/engines/lure/scripts.h b/engines/lure/scripts.h index b5b61408720..7bc8f8c9509 100644 --- a/engines/lure/scripts.h +++ b/engines/lure/scripts.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_SCRIPTS_H diff --git a/engines/lure/sound.cpp b/engines/lure/sound.cpp index da9e136ec37..cf28e0bb747 100644 --- a/engines/lure/sound.cpp +++ b/engines/lure/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/sound.h" diff --git a/engines/lure/sound.h b/engines/lure/sound.h index 7a894d814da..9fa9a912603 100644 --- a/engines/lure/sound.h +++ b/engines/lure/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_SOUND_H @@ -156,7 +153,7 @@ public: uint sfxVolume() const { return _sfxVolume; } // The following methods implement the external sound player module - void musicInterface_Initialise(); + void musicInterface_Initialize(); void musicInterface_Play(uint8 soundNumber, uint8 channelNumber, uint8 numChannels = 4); void musicInterface_Stop(uint8 soundNumber); bool musicInterface_CheckPlaying(uint8 soundNumber); diff --git a/engines/lure/strings.cpp b/engines/lure/strings.cpp index 7c3f3580809..0c9f4b5352a 100644 --- a/engines/lure/strings.cpp +++ b/engines/lure/strings.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/strings.h" diff --git a/engines/lure/strings.h b/engines/lure/strings.h index 8dbca708137..e32921ddb69 100644 --- a/engines/lure/strings.h +++ b/engines/lure/strings.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_STRINGS_H diff --git a/engines/lure/surface.cpp b/engines/lure/surface.cpp index 783401fde24..bfada8fde67 100644 --- a/engines/lure/surface.cpp +++ b/engines/lure/surface.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/decode.h" @@ -36,8 +33,8 @@ namespace Lure { -// These variables hold resources commonly used by the Surfaces, and must be initialised and freed -// by the static Surface methods initialise and deinitailse +// These variables hold resources commonly used by the Surfaces, and must be initialized and freed +// by the static Surface methods initialize and deinitailse static MemoryBlock *int_font = NULL; static MemoryBlock *int_dialog_frame = NULL; @@ -48,7 +45,7 @@ static const byte char8A[8] = {0x40, 0x20, 0x00, 0x90, 0x90, 0x90, 0x68, 0x00}; static const byte char8D[8] = {0x80, 0x40, 0x00, 0xc0, 0x40, 0x40, 0x60, 0x00}; // accented `i static const byte char95[8] = {0x40, 0x20, 0x00, 0x60, 0x90, 0x90, 0x60, 0x00}; // accented `o -void Surface::initialise() { +void Surface::initialize() { Disk &disk = Disk::getReference(); int_font = disk.getEntry(FONT_RESOURCE_ID); int_dialog_frame = disk.getEntry(DIALOG_RESOURCE_ID); @@ -83,7 +80,7 @@ void Surface::initialise() { } } -void Surface::deinitialise() { +void Surface::deinitialize() { delete int_font; delete int_dialog_frame; } diff --git a/engines/lure/surface.h b/engines/lure/surface.h index 9a677cf7490..d56e37632b8 100644 --- a/engines/lure/surface.h +++ b/engines/lure/surface.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_SURFACE_H @@ -52,8 +49,8 @@ public: static void getDialogBounds(Common::Point &size, int charWidth, int numLines, bool squashedLines = true); - static void initialise(); - static void deinitialise(); + static void initialize(); + static void deinitialize(); uint16 width() { return _width; } uint16 height() { return _height; } diff --git a/engines/m4/actor.cpp b/engines/m4/actor.cpp index c61c6fe7d8d..80a36244758 100644 --- a/engines/m4/actor.cpp +++ b/engines/m4/actor.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/m4/actor.h b/engines/m4/actor.h index 96299ab6296..e28c522df80 100644 --- a/engines/m4/actor.h +++ b/engines/m4/actor.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_ACTOR_H diff --git a/engines/m4/animation.cpp b/engines/m4/animation.cpp index 3fe050e604b..39a3f175cd5 100644 --- a/engines/m4/animation.cpp +++ b/engines/m4/animation.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" @@ -64,9 +61,9 @@ MadsAnimation::~MadsAnimation() { #define FILENAME_SIZE 13 /** - * Initialises and loads the data of an animation + * Initializes and loads the data of an animation */ -void MadsAnimation::initialise(const Common::String &filename, uint16 flags, M4Surface *surface, M4Surface *depthSurface) { +void MadsAnimation::initialize(const Common::String &filename, uint16 flags, M4Surface *surface, M4Surface *depthSurface) { MadsPack anim(filename.c_str(), _vm); bool madsRes = filename[0] == '*'; char buffer[20]; @@ -134,7 +131,7 @@ void MadsAnimation::initialise(const Common::String &filename, uint16 flags, M4S if (flags & 0x100) loadInterface(surface, depthSurface); - // Initialise the reference list + // Initialize the reference list for (int i = 0; i < spriteListCount; ++i) _spriteListIndexes.push_back(-1); @@ -269,7 +266,7 @@ void MadsAnimation::initialise(const Common::String &filename, uint16 flags, M4S * Loads an animation file for display */ void MadsAnimation::load(const Common::String &filename, int abortTimers) { - initialise(filename, 0, NULL, NULL); + initialize(filename, 0, NULL, NULL); _messageCtr = 0; _skipLoad = true; @@ -282,7 +279,7 @@ void MadsAnimation::load(const Common::String &filename, int abortTimers) { } */ - // Initialise miscellaneous fields + // Initialize miscellaneous fields _currentFrame = 0; _oldFrameEntry = 0; _nextFrameTimer = _madsVm->_currentTimer; @@ -292,7 +289,7 @@ void MadsAnimation::load(const Common::String &filename, int abortTimers) { if (_madsVm->_scene) _actionNouns = _madsVm->scene()->_action._action; - // Initialise kernel message list + // Initialize kernel message list for (uint i = 0; i < _messages.size(); ++i) _messages[i].kernelMsgIndex = -1; } diff --git a/engines/m4/animation.h b/engines/m4/animation.h index a7a6b57c32e..68a28832419 100644 --- a/engines/m4/animation.h +++ b/engines/m4/animation.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_ANIMATION_H @@ -114,7 +111,7 @@ public: MadsAnimation(MadsM4Engine *vm, MadsView *view); virtual ~MadsAnimation(); - virtual void initialise(const Common::String &filename, uint16 flags, M4Surface *surface, M4Surface *depthSurface); + virtual void initialize(const Common::String &filename, uint16 flags, M4Surface *surface, M4Surface *depthSurface); virtual void load(const Common::String &filename, int abortTimers); virtual void update(); virtual void setCurrentFrame(int frameNumber); diff --git a/engines/m4/assets.cpp b/engines/m4/assets.cpp index c4113e00d07..8ffdeb53e05 100644 --- a/engines/m4/assets.cpp +++ b/engines/m4/assets.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/assets.h" diff --git a/engines/m4/assets.h b/engines/m4/assets.h index 940646b5f24..90670dde53c 100644 --- a/engines/m4/assets.h +++ b/engines/m4/assets.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_ASSETS_H #define M4_ASSETS_H diff --git a/engines/m4/burger_data.h b/engines/m4/burger_data.h index c0532687053..d30e5460235 100644 --- a/engines/m4/burger_data.h +++ b/engines/m4/burger_data.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_BURGER_DATA_H diff --git a/engines/m4/compression.cpp b/engines/m4/compression.cpp index 8fe4fbf1eb7..65a25c14e3e 100644 --- a/engines/m4/compression.cpp +++ b/engines/m4/compression.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/compression.h" @@ -47,16 +44,16 @@ bool MadsPack::isCompressed(Common::SeekableReadStream *stream) { } MadsPack::MadsPack(Common::SeekableReadStream *stream) { - initialise(stream); + initialize(stream); } MadsPack::MadsPack(const char *resourceName, MadsM4Engine* vm) { Common::SeekableReadStream *stream = vm->_resourceManager->get(resourceName); - initialise(stream); + initialize(stream); vm->_resourceManager->toss(resourceName); } -void MadsPack::initialise(Common::SeekableReadStream *stream) { +void MadsPack::initialize(Common::SeekableReadStream *stream) { if (!MadsPack::isCompressed(stream)) error("Attempted to decompress a resource that was not MadsPacked"); @@ -124,7 +121,7 @@ void FabDecompressor::decompress(const byte *srcData, int srcSize, byte *destDat copyOfs = 0xFFFF0000; destP = destData; - // Initialise data fields + // Initialize data fields _srcData = srcData; _srcP = _srcData + 6; _srcSize = srcSize; diff --git a/engines/m4/compression.h b/engines/m4/compression.h index 93c7d9af9e5..cb0ef74eb74 100644 --- a/engines/m4/compression.h +++ b/engines/m4/compression.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_COMPRESSION_H @@ -48,7 +45,7 @@ private: int _count; int _dataOffset; - void initialise(Common::SeekableReadStream *stream); + void initialize(Common::SeekableReadStream *stream); public: static bool isCompressed(Common::SeekableReadStream *stream); MadsPack(Common::SeekableReadStream *stream); diff --git a/engines/m4/console.cpp b/engines/m4/console.cpp index cbcaa046692..fa4ca6d121f 100644 --- a/engines/m4/console.cpp +++ b/engines/m4/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" @@ -150,12 +147,12 @@ bool Console::cmdDumpFile(int argc, const char **argv) { DebugPrintf("If uncompress is 1, the file is uncompressed (for MADS games)\n"); } else { if (argc == 2) { - _vm->dumpFile(strdup(argv[1])); + _vm->dumpFile(argv[1], false); } else { if (argc == 3 && atoi(argv[2]) == 1) - _vm->dumpFile(strdup(argv[1]), true); + _vm->dumpFile(argv[1], true); else - _vm->dumpFile(strdup(argv[1])); + _vm->dumpFile(argv[1], false); } } return true; @@ -270,7 +267,7 @@ bool MadsConsole::cmdObject(int argc, const char **argv) { DebugPrintf("%2d - ", objStart); for (uint objId = objStart; objId < MIN(_vm->globals()->getObjectsSize(), objStart + 5); ++objId) { if (objId != objStart) DebugPrintf(", "); - uint16 descId = _vm->globals()->getObject(objId)->descId; + uint16 descId = _vm->globals()->getObject(objId)->_descId; DebugPrintf("%s", _vm->globals()->getVocab(descId)); } @@ -300,15 +297,15 @@ bool MadsConsole::cmdObject(int argc, const char **argv) { else { const MadsObject *obj = _vm->globals()->getObject(objNum); - DebugPrintf("Object #%d (%s) room=%d article=%d/%s vocabs=%d", objNum, _vm->globals()->getVocab(obj->descId), - obj->roomNumber, (int)obj->article, englishMADSArticleList[obj->article], obj->vocabCount); + DebugPrintf("Object #%d (%s) room=%d article=%d/%s vocabs=%d", objNum, _vm->globals()->getVocab(obj->_descId), + obj->_roomNumber, (int)obj->_article, englishMADSArticleList[obj->_article], obj->_vocabCount); - if (obj->vocabCount > 0) { + if (obj->_vocabCount > 0) { DebugPrintf(" - "); - for (int i = 0; i < obj->vocabCount; ++i) { + for (int i = 0; i < obj->_vocabCount; ++i) { if (i != 0) DebugPrintf(", "); - DebugPrintf("%s (%d)/%d,%d", _vm->globals()->getVocab(obj->vocabList[i].vocabId), - obj->vocabList[i].vocabId, obj->vocabList[i].flags1, obj->vocabList[i].flags2); + DebugPrintf("%s (%d)/%d,%d", _vm->globals()->getVocab(obj->_vocabList[i].vocabId), + obj->_vocabList[i].vocabId, obj->_vocabList[i].flags1, obj->_vocabList[i].flags2); } } DebugPrintf("\n"); diff --git a/engines/m4/console.h b/engines/m4/console.h index 53a47dada9b..fc473b64648 100644 --- a/engines/m4/console.h +++ b/engines/m4/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_CONSOLE_H diff --git a/engines/m4/converse.cpp b/engines/m4/converse.cpp index 46c4b35b798..4630d2e2d62 100644 --- a/engines/m4/converse.cpp +++ b/engines/m4/converse.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/array.h" diff --git a/engines/m4/converse.h b/engines/m4/converse.h index 67ecf20424a..b47e8d2a6be 100644 --- a/engines/m4/converse.h +++ b/engines/m4/converse.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_CONVERSE_H diff --git a/engines/m4/detection.cpp b/engines/m4/detection.cpp index e0983e3327a..1aefe3d02d1 100644 --- a/engines/m4/detection.cpp +++ b/engines/m4/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -417,7 +414,7 @@ public: M4MetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "MADS/M4 engine"; + return "MADS/M4"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/m4/dialogs.cpp b/engines/m4/dialogs.cpp index bc6228658d7..afe2692753d 100644 --- a/engines/m4/dialogs.cpp +++ b/engines/m4/dialogs.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/dialogs.h" diff --git a/engines/m4/dialogs.h b/engines/m4/dialogs.h index 192ba5c23c6..ea3519c9e32 100644 --- a/engines/m4/dialogs.h +++ b/engines/m4/dialogs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_DIALOGS_H diff --git a/engines/m4/events.cpp b/engines/m4/events.cpp index a9641eb542b..f8225fba3ef 100644 --- a/engines/m4/events.cpp +++ b/engines/m4/events.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // TODO: There is a 'please_hyperwalk' variable that gets accessed that is meant to be global, but diff --git a/engines/m4/events.h b/engines/m4/events.h index 1c1418d5f86..6e7cf685557 100644 --- a/engines/m4/events.h +++ b/engines/m4/events.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_EVENTS_H diff --git a/engines/m4/font.cpp b/engines/m4/font.cpp index 582fbaebc74..d4ba714d73a 100644 --- a/engines/m4/font.cpp +++ b/engines/m4/font.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/font.h" diff --git a/engines/m4/font.h b/engines/m4/font.h index 64e54f35b55..b00a393811e 100644 --- a/engines/m4/font.h +++ b/engines/m4/font.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_FONT_H diff --git a/engines/m4/globals.cpp b/engines/m4/globals.cpp index 3db9934cec7..8787f89d04a 100644 --- a/engines/m4/globals.cpp +++ b/engines/m4/globals.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" @@ -526,19 +523,23 @@ void MadsObject::load(Common::SeekableReadStream *stream) { stream->read(obj, 0x30); // Extract object data fields - descId = READ_LE_UINT16(&obj[0]); - roomNumber = READ_LE_UINT16(&obj[2]); - article = (MADSArticles)obj[4]; - vocabCount = obj[5] & 0x7f; + _descId = READ_LE_UINT16(&obj[0]); + _roomNumber = READ_LE_UINT16(&obj[2]); + _article = (MADSArticles)obj[4]; + _vocabCount = obj[5] & 0x7f; // Phantom / Dragon - if (vocabCount > 3) - warning("MadsObject::load(), vocab cound > 3 (it's %d)", vocabCount); + if (_vocabCount > 3) + warning("MadsObject::load(), vocab cound > 3 (it's %d)", _vocabCount); - for (int i = 0; i < vocabCount; ++i) { - vocabList[i].flags1 = obj[6 + i * 4]; - vocabList[i].flags2 = obj[7 + i * 4]; - vocabList[i].vocabId = READ_LE_UINT16(&obj[8 + i * 4]); + for (int i = 0; i < _vocabCount; ++i) { + _vocabList[i].flags1 = obj[6 + i * 4]; + _vocabList[i].flags2 = obj[7 + i * 4]; + _vocabList[i].vocabId = READ_LE_UINT16(&obj[8 + i * 4]); } } +void MadsObject::setRoom(int roomNumber) { + +} + } // End of namespace M4 diff --git a/engines/m4/globals.h b/engines/m4/globals.h index 2d90b7ba770..ae2941c1699 100644 --- a/engines/m4/globals.h +++ b/engines/m4/globals.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_GLOBALS_H @@ -180,13 +177,14 @@ public: MadsObject() {} MadsObject(Common::SeekableReadStream *stream); void load(Common::SeekableReadStream *stream); - bool isInInventory() const { return roomNumber == PLAYER_INVENTORY; } + bool isInInventory() const { return _roomNumber == PLAYER_INVENTORY; } + void setRoom(int roomNumber); - uint16 descId; - uint16 roomNumber; - MADSArticles article; - uint8 vocabCount; - VocabEntry vocabList[3]; + uint16 _descId; + uint16 _roomNumber; + MADSArticles _article; + uint8 _vocabCount; + VocabEntry _vocabList[3]; }; typedef Common::Array > MadsObjectArray; @@ -243,63 +241,6 @@ union DataMapEntry { typedef Common::HashMap DataMapHash; -enum DataMapType {BOOL, UINT16, INT, INT_FN}; - -class DataMapWrapper { - friend class DataMap; -private: - DataMapEntry _value; - DataMapType _type; -public: - DataMapWrapper(bool *v) { _value.boolValue = v; _type = BOOL; } - DataMapWrapper(uint16 *v) { _value.uint16Value = v; _type = UINT16; } - DataMapWrapper(int16 *v) { _value.uint16Value = (uint16 *)v; _type = UINT16; } - DataMapWrapper(int *v) { _value.intValue = v; _type = INT; } - DataMapWrapper(IntFunctionPtr v) { _value.fnPtr = v; _type = INT_FN; } - - uint16 getIntValue() { - if (_type == BOOL) return *_value.boolValue ? 0xffff : 0; - else if (_type == UINT16) return *_value.uint16Value; - else if (_type == INT) return *_value.intValue; - else return _value.fnPtr(); - } - void setIntValue(uint16 v) { - if (_type == BOOL) *_value.boolValue = v != 0; - else if (_type == UINT16) *_value.uint16Value = v; - else if (_type == INT) *_value.intValue = v; - } -}; - -#define MAP_DATA(V) _madsVm->globals()->_dataMap.addMapping(new DataMapWrapper(V)) - -class DataMap { -private: - DataMapHash _data; - Common::Array _mapList; -public: - DataMap() { - _mapList.push_back(NULL); - } - ~DataMap() { - for (uint i = 1; i < _mapList.size(); ++i) - delete _mapList[i]; - } - - void addMapping(DataMapWrapper *v) { _mapList.push_back(v); } - uint16 get(uint16 index) { - if (index < _mapList.size()) - return _mapList[index]->getIntValue(); - - return _data[index]; - } - void set(uint16 index, uint16 v) { - if (index < _mapList.size()) - _mapList[index]->setIntValue(v); - else - _data[index] = v; - } -}; - class MadsGlobals : public Globals { private: struct MessageItem { @@ -328,7 +269,7 @@ public: int previousScene; int16 _nextSceneId; uint16 actionNouns[3]; - DataMap _dataMap; + DataMapHash _dataMap; int _difficultyLevel; void loadMadsVocab(); diff --git a/engines/m4/graphics.cpp b/engines/m4/graphics.cpp index 689a6ab8b49..786c9758505 100644 --- a/engines/m4/graphics.cpp +++ b/engines/m4/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/m4/graphics.h b/engines/m4/graphics.h index 96e81f746eb..242857ba1ad 100644 --- a/engines/m4/graphics.h +++ b/engines/m4/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_GRAPHICS_H diff --git a/engines/m4/gui.cpp b/engines/m4/gui.cpp index 56cf96b5890..6bedfa7e9b5 100644 --- a/engines/m4/gui.cpp +++ b/engines/m4/gui.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/events.h" diff --git a/engines/m4/gui.h b/engines/m4/gui.h index 7e1c8bf0707..2b673d624c7 100644 --- a/engines/m4/gui.h +++ b/engines/m4/gui.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_GUI_H @@ -446,7 +443,7 @@ public: GameInterfaceView(MadsM4Engine *vm, const Common::Rect &rect): View(vm, rect) {} ~GameInterfaceView() {} - virtual void initialise() {} + virtual void initialize() {} virtual void setSelectedObject(int objectNumber) {} virtual void addObjectToInventory(int objectNumber) {} }; diff --git a/engines/m4/hotspot.cpp b/engines/m4/hotspot.cpp index 500464dc09b..a585a9af3df 100644 --- a/engines/m4/hotspot.cpp +++ b/engines/m4/hotspot.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/m4.h" diff --git a/engines/m4/hotspot.h b/engines/m4/hotspot.h index f650d5ff540..86fe21bcab1 100644 --- a/engines/m4/hotspot.h +++ b/engines/m4/hotspot.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_HOTSPOT_H diff --git a/engines/m4/m4.cpp b/engines/m4/m4.cpp index e88140cd26d..93f5ab4cba2 100644 --- a/engines/m4/m4.cpp +++ b/engines/m4/m4.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ //#define SCRIPT_TEST @@ -52,7 +49,6 @@ #include "common/error.h" #include "common/file.h" #include "common/fs.h" -#include "common/EventRecorder.h" #include "common/system.h" #include "common/config-manager.h" #include "common/debug-channels.h" @@ -180,8 +176,7 @@ Common::Error MadsM4Engine::run() { _script = new ScriptInterpreter(this); _ws = new WoodScript(this); //_callbacks = new Callbacks(this); - _random = new Common::RandomSource(); - g_eventRec.registerRandomSource(*_random, "m4"); + _random = new Common::RandomSource("m4"); return Common::kNoError; } @@ -260,7 +255,7 @@ void MadsM4Engine::loadMenu(MenuType menuType, bool loadSaveFromHotkey, bool cal #define DUMP_BUFFER_SIZE 1024 -void MadsM4Engine::dumpFile(const char* filename, bool uncompress) { +void MadsM4Engine::dumpFile(const char *filename, bool uncompress) { Common::DumpFile f; byte buffer[DUMP_BUFFER_SIZE]; Common::SeekableReadStream *fileS = res()->get(filename); @@ -535,7 +530,7 @@ Common::Error MadsEngine::run() { //debugCN(kDebugCore, "%s\n----------\n", _globals->loadMessage(i)); if (getGameType() == GType_RexNebular) { - MadsGameLogic::initialiseGlobals(); + MadsGameLogic::initializeGlobals(); _scene = NULL; loadMenu(MAIN_MENU); diff --git a/engines/m4/m4.h b/engines/m4/m4.h index a43f3e1387f..18c3936db8f 100644 --- a/engines/m4/m4.h +++ b/engines/m4/m4.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_H @@ -168,7 +165,7 @@ public: ResourceManager *res() const { return _resourceManager; } MidiPlayer *midi() { return _midi; } Common::SaveFileManager *saveManager() { return _saveFileMan; } - void dumpFile(const char* filename, bool uncompress = false); + void dumpFile(const char *filename, bool uncompress); void eventHandler(); bool delay(int duration, bool keyAborts = true, bool clickAborts = true); void loadMenu(MenuType menuType, bool loadSaveFromHotkey = false, @@ -226,7 +223,7 @@ public: void startScene(int sceneNum) { if (!_scene) { _scene = new MadsScene(this); - ((MadsScene *)_scene)->initialise(); + ((MadsScene *)_scene)->initialize(); } _scene->show(); _scene->loadScene(101); diff --git a/engines/m4/m4_menus.cpp b/engines/m4/m4_menus.cpp index a20bb2660b2..787d8666f61 100644 --- a/engines/m4/m4_menus.cpp +++ b/engines/m4/m4_menus.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/algorithm.h" // for find() diff --git a/engines/m4/m4_menus.h b/engines/m4/m4_menus.h index ecfd778c954..9abf71e9db3 100644 --- a/engines/m4/m4_menus.h +++ b/engines/m4/m4_menus.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_M4_MENUS_H diff --git a/engines/m4/m4_scene.cpp b/engines/m4/m4_scene.cpp index a0d8a503abe..1a2e00e50de 100644 --- a/engines/m4/m4_scene.cpp +++ b/engines/m4/m4_scene.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/m4/m4_scene.h b/engines/m4/m4_scene.h index 9c2edbc06c9..a0ba497cf74 100644 --- a/engines/m4/m4_scene.h +++ b/engines/m4/m4_scene.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_M4_SCENE_H diff --git a/engines/m4/m4_views.cpp b/engines/m4/m4_views.cpp index 83f23edd3d5..4eb84a74889 100644 --- a/engines/m4/m4_views.cpp +++ b/engines/m4/m4_views.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/m4/m4_views.h b/engines/m4/m4_views.h index e390904aae9..4ca2a745932 100644 --- a/engines/m4/m4_views.h +++ b/engines/m4/m4_views.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_M4_VIEWS_H diff --git a/engines/m4/mads_anim.cpp b/engines/m4/mads_anim.cpp index e7ca9cb14d3..d35b31943ae 100644 --- a/engines/m4/mads_anim.cpp +++ b/engines/m4/mads_anim.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" @@ -606,7 +603,7 @@ static bool tempFlag = true;//****DEBUG - Temporarily allow me to skip several i flags |= 0x100; _activeAnimation = new MadsAnimation(_vm, this); - _activeAnimation->initialise(_currentLine, flags, &_backgroundSurface, &_codeSurface); + _activeAnimation->initialize(_currentLine, flags, &_backgroundSurface, &_codeSurface); if (_startFrame != -1) _activeAnimation->setCurrentFrame(_startFrame); diff --git a/engines/m4/mads_anim.h b/engines/m4/mads_anim.h index b33ea240711..411d575d59a 100644 --- a/engines/m4/mads_anim.h +++ b/engines/m4/mads_anim.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_MADS_ANIM_H diff --git a/engines/m4/mads_logic.cpp b/engines/m4/mads_logic.cpp index 98a0d06412b..b1e57bd7f3f 100644 --- a/engines/m4/mads_logic.cpp +++ b/engines/m4/mads_logic.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" @@ -34,7 +31,7 @@ namespace M4 { -void MadsGameLogic::initialiseGlobals() { +void MadsGameLogic::initializeGlobals() { // Clear the entire globals list Common::set_to(&_madsVm->globals()->_globals[0], &_madsVm->globals()->_globals[TOTAL_NUM_VARIABLES], 0); @@ -172,25 +169,81 @@ const char *MadsSceneLogic::_opcodeStrings[] = { * This method sets up the data map with pointers to all the common game objects. This allows the script engine to * convert game specific offsets for various fields in the original game's data segment into a generic data index * that will be common across all the MADS games - */ -void MadsSceneLogic::initialiseDataMap() { - // The unique order of these items must be maintained - MAP_DATA((uint16 *)&_madsVm->scene()->_abortTimersMode2); - MAP_DATA(&_madsVm->scene()->_abortTimers); - MAP_DATA(&_madsVm->_player._stepEnabled); - MAP_DATA(&_madsVm->scene()->_nextScene); - MAP_DATA(&_madsVm->scene()->_previousScene); - MAP_DATA(&_madsVm->_player._playerPos.x); - MAP_DATA(&_madsVm->_player._playerPos.y); - MAP_DATA(&_madsVm->_player._direction); - MAP_DATA(&_madsVm->_player._visible); - MAP_DATA(&getActiveAnimationBool); - MAP_DATA(&getAnimationCurrentFrame); +void MadsSceneLogic::initializeDataMap() { + // The unique order of these items must be maintained +} +*/ + +uint32 MadsSceneLogic::getDataValue(int dataId) { + switch (dataId) { + case 1: + return _madsVm->scene()->_abortTimersMode2; + case 2: + return _madsVm->scene()->_abortTimers; + case 3: + return _madsVm->_player._stepEnabled ? 0xffff : 0; + case 4: + return _madsVm->scene()->_nextScene; + case 5: + return _madsVm->scene()->_previousScene; + case 6: + return _madsVm->_player._playerPos.x; + case 7: + return _madsVm->_player._playerPos.y; + case 8: + return _madsVm->_player._direction; + case 9: + return _madsVm->_player._visible ? 0xffff : 0; + case 10: + return getActiveAnimationBool(); + case 11: + return getAnimationCurrentFrame(); + default: + // All other data variables get stored in the hash table + return _madsVm->globals()->_dataMap[dataId]; + break; + } } -DataMap &MadsSceneLogic::dataMap() { - return _madsVm->globals()->_dataMap; +void MadsSceneLogic::setDataValue(int dataId, uint16 dataValue) { + switch (dataId) { + case 1: + _madsVm->scene()->_abortTimersMode2 = (AbortTimerMode)dataValue; + break; + case 2: + _madsVm->scene()->_abortTimers = dataValue; + break; + case 3: + _madsVm->_player._stepEnabled = dataValue != 0; + break; + case 4: + _madsVm->scene()->_nextScene = dataValue; + break; + case 5: + _madsVm->scene()->_previousScene = dataValue; + break; + case 6: + _madsVm->_player._playerPos.x = dataValue; + break; + case 7: + _madsVm->_player._playerPos.y = dataValue; + break; + case 8: + _madsVm->_player._direction = dataValue; + break; + case 9: + _madsVm->_player._visible = dataValue != 0; + break; + case 10: + case 11: + error("Tried to set read only data field %d", dataId); + break; + default: + // All other data variables get stored in the hash table + _madsVm->globals()->_dataMap[dataId] = dataValue; + break; + } } const char *MadsSceneLogic::formAnimName(char sepChar, int16 suffixNum) { @@ -329,7 +382,7 @@ void MadsSceneLogic::getPlayerSpritesPrefix2() { /** * Loads the MADS.DAT file and loads the script data for the correct game/language */ -void MadsSceneLogic::initialiseScripts() { +void MadsSceneLogic::initializeScripts() { Common::File f; if (!f.open("mads.dat")) { warning("Could not locate mads.dat file"); @@ -534,7 +587,7 @@ void MadsSceneLogic::execute(uint32 subOffset) { case OP_DLOAD: { // Gets data variable param = getParam(scriptOffset, opcode); - uint16 v = dataMap().get(param); + uint16 v = getDataValue(param); stack.push(ScriptVar(v)); break; } @@ -542,7 +595,7 @@ void MadsSceneLogic::execute(uint32 subOffset) { case OP_DSTORE: { // Stores data variable param = getParam(scriptOffset, opcode); ScriptVar v = stack.pop(); - dataMap().set(param, v.isInt() ? v.get() : 0); + setDataValue(param, v.isInt() ? v.get() : 0); break; } @@ -898,7 +951,7 @@ void MadsSceneLogic::callSubroutine(int subIndex, Common::Stack &stac // object_is_present EXTRACT_PARAMS(1); const MadsObject *obj = _madsVm->globals()->getObject(p[0]); - stack.push(ScriptVar((obj->roomNumber == _madsVm->scene()->_currentScene))); + stack.push(ScriptVar((obj->_roomNumber == _madsVm->scene()->_currentScene))); break; } @@ -925,6 +978,14 @@ void MadsSceneLogic::callSubroutine(int subIndex, Common::Stack &stac break; } + case 26: { + // object_set_room + EXTRACT_PARAMS(2); + MadsObject *obj = _madsVm->globals()->getObject(p[0]); + obj->setRoom(p[1]); + break; + } + default: error("Unknown subroutine %d called", subIndex); break; diff --git a/engines/m4/mads_logic.h b/engines/m4/mads_logic.h index adafe6f93d4..3132094252f 100644 --- a/engines/m4/mads_logic.h +++ b/engines/m4/mads_logic.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * The MADS game logic is all hard-coded into the games, although for Rex at least * it seems to use only a fairly basic set of instructions and function calls, so it should be * possible @@ -88,14 +85,14 @@ private: void getSceneSpriteSet(); void getAnimName(); - DataMap &dataMap(); + uint32 getDataValue(int dataId); + void setDataValue(int dataId, uint16 dataValue); void getCallParameters(int numParams, Common::Stack &stack, ScriptVar *callParams); public: MadsSceneLogic() { _scriptsData = NULL; } ~MadsSceneLogic() { delete _scriptsData; } - void initialiseScripts(); - void initialiseDataMap(); + void initializeScripts(); void selectScene(int sceneNum); void setupScene(); @@ -112,7 +109,7 @@ public: class MadsGameLogic { public: - static void initialiseGlobals(); + static void initializeGlobals(); }; } diff --git a/engines/m4/mads_menus.cpp b/engines/m4/mads_menus.cpp index 437e9d2a6ba..fa65329d762 100644 --- a/engines/m4/mads_menus.cpp +++ b/engines/m4/mads_menus.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" @@ -599,18 +596,18 @@ RexDialogView::RexDialogView(): View(_madsVm, Common::Rect(0, 0, _madsVm->_scree MadsView(this) { _screenType = VIEWID_MENU; - // Initialise class variables + // Initialize class variables _priorSceneId = _madsVm->_scene->getCurrentScene(); _dialogType = DIALOG_NONE; // Load necessary quotes _madsVm->globals()->loadQuoteRange(1, 48); - initialiseLines(); - initialiseGraphics(); + initializeLines(); + initializeGraphics(); } -void RexDialogView::initialiseLines() { +void RexDialogView::initializeLines() { // Set up a list of blank entries for use in the various dialogs for (int i = 0; i < DIALOG_LINES_SIZE; ++i) { DialogTextEntry rec; @@ -625,7 +622,7 @@ void RexDialogView::initialiseLines() { _spriteSlots[0].seqIndex = -1; } -void RexDialogView::initialiseGraphics() { +void RexDialogView::initializeGraphics() { // Set needed palette entries _madsVm->_palette->blockRange(0, 16); _madsVm->_palette->setEntry(10, 0, 255, 0); diff --git a/engines/m4/mads_menus.h b/engines/m4/mads_menus.h index a0fc6fb3bc6..4d3ea5da39f 100644 --- a/engines/m4/mads_menus.h +++ b/engines/m4/mads_menus.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_MADS_MENUS_H @@ -120,8 +117,8 @@ class RexDialogView : public View, public MadsView { private: int _priorSceneId; - void initialiseLines(); - void initialiseGraphics(); + void initializeLines(); + void initializeGraphics(); void loadBackground(); void loadMenuSprites(); protected: diff --git a/engines/m4/mads_player.cpp b/engines/m4/mads_player.cpp index de09e97640f..0b83b54ff5d 100644 --- a/engines/m4/mads_player.cpp +++ b/engines/m4/mads_player.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/m4.h" diff --git a/engines/m4/mads_player.h b/engines/m4/mads_player.h index 6a9b7b4ca1a..bbeefaf3d58 100644 --- a/engines/m4/mads_player.h +++ b/engines/m4/mads_player.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_MADS_PLAYER_H diff --git a/engines/m4/mads_scene.cpp b/engines/m4/mads_scene.cpp index 7b82480ee26..a0acbdd69db 100644 --- a/engines/m4/mads_scene.cpp +++ b/engines/m4/mads_scene.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" @@ -97,12 +94,12 @@ void MadsScene::loadScene2(const char *aaName, int sceneNumber) { // Load scene walk paths loadSceneCodes(_currentScene); - // Initialise the scene animation + // Initialize the scene animation uint16 flags = 0x4100; if (_madsVm->globals()->_config.textWindowStill) flags |= 0x200; - _sceneAnimation->initialise(aaName, flags, _interfaceSurface, NULL); + _sceneAnimation->initialize(aaName, flags, _interfaceSurface, NULL); } /** @@ -116,7 +113,7 @@ void MadsScene::loadSceneTemporary() { {0x00<<2, 0x10<<2, 0x16<<2}}; _vm->_palette->setPalette(&sysColors[0], 4, 3); - _interfaceSurface->initialise(); + _interfaceSurface->initialize(); loadSceneHotspots(_currentScene); @@ -431,7 +428,29 @@ void MadsScene::doSceneStep() { } void MadsScene::doAction() { - warning("TODO MadsScene::doAction"); + AbortTimerMode mode = ABORTMODE_0; + _abortTimersMode2 = mode; + + if ((_action._inProgress || (_abortTimers != 0)) && !_action._v8453A) { + _sceneLogic.doAction(); + mode = _action._inProgress ? ABORTMODE_0 : ABORTMODE_1; + } + + if (_screenObjects._v832EC) + _action._inProgress = false; + else { + if ((_action._inProgress || (_abortTimers != 0)) && (mode == ABORTMODE_0) && (_action._v8453A == mode)) { + // TODO: sound_fn_p(); + mode = _action._inProgress ? ABORTMODE_0 : ABORTMODE_1; + + } + + if ((_action._inProgress || (_abortTimers != 0)) && (mode == ABORTMODE_0) && (_action._v8453A == mode)) { + // Perform a core scene-indepedant action on an object + // object_do_action + } + } + } @@ -599,7 +618,7 @@ void MadsSceneResources::load(int sceneNumber, const char *resName, int v0, M4Su char buffer1[80]; const char *sceneName; - // TODO: Initialise spriteSet / xp_list + // TODO: Initialize spriteSet / xp_list if (sceneNumber > 0) { sceneName = MADSResourceManager::getResourceName(RESPREFIX_RM, sceneNumber, ".DAT"); @@ -671,7 +690,7 @@ void MadsSceneResources::load(int sceneNumber, const char *resName, int v0, M4Su delete stream; - // Initialise a copy of the surfaces if they weren't provided + // Initialize a copy of the surfaces if they weren't provided bool dsFlag = false, ssFlag = false; if (!surface) { surface = new M4Surface(_width, _height); @@ -867,13 +886,13 @@ void MadsInterfaceView::setFontMode(InterfaceFontMode newMode) { } } -void MadsInterfaceView::initialise() { +void MadsInterfaceView::initialize() { // Build up the inventory list _inventoryList.clear(); for (uint i = 0; i < _madsVm->globals()->getObjectsSize(); ++i) { MadsObject *obj = _madsVm->globals()->getObject(i); - if (obj->roomNumber == PLAYER_INVENTORY) + if (obj->_roomNumber == PLAYER_INVENTORY) _inventoryList.push_back(i); } @@ -922,7 +941,7 @@ void MadsInterfaceView::setSelectedObject(int objectNumber) { void MadsInterfaceView::addObjectToInventory(int objectNumber) { if (_inventoryList.indexOf(objectNumber) == -1) { - _madsVm->globals()->getObject(objectNumber)->roomNumber = PLAYER_INVENTORY; + _madsVm->globals()->getObject(objectNumber)->_roomNumber = PLAYER_INVENTORY; _inventoryList.push_back(objectNumber); } @@ -975,7 +994,7 @@ void MadsInterfaceView::onRefresh(RectList *rects, M4Surface *destSurface) { break; const char *descStr = _madsVm->globals()->getVocab(_madsVm->globals()->getObject( - _inventoryList[_topIndex + i])->descId); + _inventoryList[_topIndex + i])->_descId); strcpy(buffer, descStr); if ((buffer[0] >= 'a') && (buffer[0] <= 'z')) buffer[0] -= 'a' - 'A'; @@ -1005,13 +1024,13 @@ void MadsInterfaceView::onRefresh(RectList *rects, M4Surface *destSurface) { // List the vocab actions for the currently selected object MadsObject *obj = _madsVm->globals()->getObject(_selectedObject); - int yIndex = MIN(_highlightedElement - VOCAB_START, obj->vocabCount - 1); + int yIndex = MIN(_highlightedElement - VOCAB_START, obj->_vocabCount - 1); - for (int i = 0; i < obj->vocabCount; ++i) { + for (int i = 0; i < obj->_vocabCount; ++i) { const Common::Rect r(_screenObjects[VOCAB_START + i]); // Get the vocab description and capitalise it - const char *descStr = _madsVm->globals()->getVocab(obj->vocabList[i].vocabId); + const char *descStr = _madsVm->globals()->getVocab(obj->_vocabList[i].vocabId); strcpy(buffer, descStr); if ((buffer[0] >= 'a') && (buffer[0] <= 'z')) buffer[0] -= 'a' - 'A'; @@ -1063,12 +1082,12 @@ bool MadsInterfaceView::onEvent(M4EventType eventType, int32 param1, int x, int } else if ((_highlightedElement >= VOCAB_START) && (_highlightedElement < (VOCAB_START + 5))) { // A vocab action was selected MadsObject *obj = _madsVm->globals()->getObject(_selectedObject); - int vocabIndex = MIN(_highlightedElement - VOCAB_START, obj->vocabCount - 1); + int vocabIndex = MIN(_highlightedElement - VOCAB_START, obj->_vocabCount - 1); if (vocabIndex >= 0) { act._actionMode = ACTMODE_OBJECT; act._actionMode2 = ACTMODE2_2; - act._flags1 = obj->vocabList[1].flags1; - act._flags2 = obj->vocabList[1].flags2; + act._flags1 = obj->_vocabList[1].flags1; + act._flags2 = obj->_vocabList[1].flags2; act._action.verbId = _selectedObject; act._articleNumber = act._flags2; diff --git a/engines/m4/mads_scene.h b/engines/m4/mads_scene.h index 743719d9544..9835de4daf3 100644 --- a/engines/m4/mads_scene.h +++ b/engines/m4/mads_scene.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_MADS_SCENE_H @@ -111,9 +108,8 @@ public: public: MadsScene(MadsEngine *vm); virtual ~MadsScene(); - void initialise() { - _sceneLogic.initialiseScripts(); - _sceneLogic.initialiseDataMap(); + void initialize() { + _sceneLogic.initializeScripts(); } // Methods that differ between engines @@ -181,7 +177,7 @@ public: MadsInterfaceView(MadsM4Engine *vm); ~MadsInterfaceView(); - virtual void initialise(); + virtual void initialize(); virtual void setSelectedObject(int objectNumber); virtual void addObjectToInventory(int objectNumber); int getSelectedObject() { return _selectedObject; } diff --git a/engines/m4/mads_views.cpp b/engines/m4/mads_views.cpp index 33c679c9bd6..b66591a207c 100644 --- a/engines/m4/mads_views.cpp +++ b/engines/m4/mads_views.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/m4_views.h" @@ -103,8 +100,8 @@ void MadsAction::set() { int selectedObject = _madsVm->scene()->getInterface()->getSelectedObject(); MadsObject *objEntry = _madsVm->globals()->getObject(selectedObject); - _action.objectNameId = objEntry->descId; - _currentAction = objEntry->vocabList[_selectedRow].vocabId; + _action.objectNameId = objEntry->_descId; + _currentAction = objEntry->_vocabList[_selectedRow].vocabId; // Set up the status text stirng strcpy(_statusText, useStr); @@ -122,7 +119,7 @@ void MadsAction::set() { int selectedObject = _madsVm->scene()->getInterface()->getSelectedObject(); MadsObject *objEntry = _madsVm->globals()->getObject(selectedObject); - _currentAction = objEntry->vocabList[_selectedRow].vocabId; + _currentAction = objEntry->_vocabList[_selectedRow].vocabId; } appendVocab(_currentAction, true); @@ -168,7 +165,7 @@ void MadsAction::set() { if ((_actionMode2 == ACTMODE2_2) || (_actionMode2 == ACTMODE2_5)) { // Get name from given inventory object int objectId = _madsVm->scene()->getInterface()->getInventoryObject(_hotspotId); - _action.objectNameId = _madsVm->globals()->getObject(objectId)->descId; + _action.objectNameId = _madsVm->globals()->getObject(objectId)->_descId; } else if (_hotspotId < hotspotCount) { // Get name from scene hotspot _action.objectNameId = (*_madsVm->scene()->getSceneResources().hotspots)[_hotspotId].getVocabID(); @@ -187,7 +184,7 @@ void MadsAction::set() { if ((_v86F42 == 2) || (_v86F42 == 5)) { int objectId = _madsVm->scene()->getInterface()->getInventoryObject(_hotspotId); - articleNum = _madsVm->globals()->getObject(objectId)->article; + articleNum = _madsVm->globals()->getObject(objectId)->_article; } else if (_v86F3A < hotspotCount) { articleNum = (*_madsVm->scene()->getSceneResources().hotspots)[_hotspotId].getArticle(); } else { @@ -259,7 +256,7 @@ void MadsAction::startAction() { _madsVm->_player.moveComplete(); _inProgress = true; - _v8453A = 0; + _v8453A = ABORTMODE_0; _savedFields.selectedRow = _selectedRow; _savedFields.articleNumber = _articleNumber; _savedFields.actionMode = _actionMode; @@ -274,7 +271,7 @@ void MadsAction::startAction() { strcpy(_dialogTitle, _statusText); if ((_savedFields.actionMode2 == ACTMODE2_4) && (savedV86F42 == 0)) - _v8453A = true; + _v8453A = ABORTMODE_1; _startWalkFlag = false; int hotspotId = -1; diff --git a/engines/m4/mads_views.h b/engines/m4/mads_views.h index ce5ba9c4e5c..6be2283a325 100644 --- a/engines/m4/mads_views.h +++ b/engines/m4/mads_views.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_MADS_VIEWS_H @@ -37,7 +34,8 @@ namespace M4 { class MadsView; enum MadsActionMode {ACTMODE_NONE = 0, ACTMODE_VERB = 1, ACTMODE_OBJECT = 3, ACTMODE_TALK = 6}; -enum MAdsActionMode2 {ACTMODE2_0 = 0, ACTMODE2_2 = 2, ACTMODE2_4 = 4, ACTMODE2_5 = 5}; +enum MadsActionMode2 {ACTMODE2_0 = 0, ACTMODE2_2 = 2, ACTMODE2_4 = 4, ACTMODE2_5 = 5}; +enum AbortTimerMode {ABORTMODE_0 = 0, ABORTMODE_1 = 1, ABORTMODE_2 = 2}; struct ActionDetails { int verbId; @@ -65,7 +63,7 @@ public: int _currentAction; int8 _flags1, _flags2; MadsActionMode _actionMode; - MAdsActionMode2 _actionMode2; + MadsActionMode2 _actionMode2; int _articleNumber; bool _lookFlag; int _selectedRow; @@ -85,7 +83,7 @@ public: int16 _v86F4C; int _v83338; bool _inProgress; - bool _v8453A; + AbortTimerMode _v8453A; public: MadsAction(MadsView &owner); @@ -99,8 +97,6 @@ public: bool isAction(int verbId, int objectNameId = 0, int indirectObjectId = 0); }; -enum AbortTimerMode {ABORTMODE_0 = 0, ABORTMODE_1 = 1, ABORTMODE_2 = 2}; - class SpriteSlotSubset { public: int spriteListIndex; @@ -450,7 +446,7 @@ protected: public: Animation(MadsM4Engine *vm); virtual ~Animation(); - virtual void initialise(const Common::String &filename, uint16 flags, M4Surface *surface, M4Surface *depthSurface) = 0; + virtual void initialize(const Common::String &filename, uint16 flags, M4Surface *surface, M4Surface *depthSurface) = 0; virtual void load(const Common::String &filename, int v0) = 0; virtual void update() = 0; virtual void setCurrentFrame(int frameNumber) = 0; diff --git a/engines/m4/midi.cpp b/engines/m4/midi.cpp index 24ac60c22e1..bfe77828da6 100644 --- a/engines/m4/midi.cpp +++ b/engines/m4/midi.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // FIXME: This is cribbed together from the SAGA music player. It needs cleanup diff --git a/engines/m4/midi.h b/engines/m4/midi.h index a544fb72aa3..6eef907ce38 100644 --- a/engines/m4/midi.h +++ b/engines/m4/midi.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Music class diff --git a/engines/m4/rails.cpp b/engines/m4/rails.cpp index 39cba9ab844..f51d81c8f40 100644 --- a/engines/m4/rails.cpp +++ b/engines/m4/rails.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -64,9 +61,7 @@ void Rails::clearRails() { delete tempNode; } - for (i = 0; i < _edges.size(); i++) { - _edges.remove_at(i); - } + _edges.clear(); for (j = _noWalkRects.begin(); j != _noWalkRects.end(); ++j) delete (*j); @@ -249,7 +244,7 @@ void Rails::createEdge(int32 node1, int32 node2) { } else { distance = SqrtF16(FixedMul(deltaX, deltaX) + FixedMul(deltaY, deltaY)) << 8; } - _edges.insert_at(index, (int16*)(distance >> 16)); + _edges.insert_at(index, distance >> 16); } debugCN(kDebugCore, "node1 = %d, node2 = %d, valid = %d\n", node1, node2, valid); @@ -315,7 +310,7 @@ int16 Rails::getEdgeLength(int32 node1, int32 node2) { // Find the table entry i.e. tableWidth * node1 + node2 and then subtract // n(n+1)/2, since only the upper triangle of the table is stored index = (MAXRAILNODES-1)*node1 + node2 - 1 - (node1*(node1+1)>>1); - return *_edges[index]; + return _edges[index]; } void Rails::disposePath(RailNode *pathStart) { diff --git a/engines/m4/rails.h b/engines/m4/rails.h index e3183c243f1..80bb55e9de8 100644 --- a/engines/m4/rails.h +++ b/engines/m4/rails.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_RAILS_H @@ -76,7 +73,7 @@ public: private: Common::Array _nodes; - Common::Array _edges; + Common::Array _edges; Common::List _noWalkRects; M4Surface *_walkCodes; diff --git a/engines/m4/resource.cpp b/engines/m4/resource.cpp index 1946797f755..2ae29ca0bb2 100644 --- a/engines/m4/resource.cpp +++ b/engines/m4/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/m4.h" diff --git a/engines/m4/resource.h b/engines/m4/resource.h index eed6e6dcd97..00c54a36806 100644 --- a/engines/m4/resource.h +++ b/engines/m4/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_RESOURCE_H diff --git a/engines/m4/saveload.cpp b/engines/m4/saveload.cpp index 85f0ee99479..aa35385bfec 100644 --- a/engines/m4/saveload.cpp +++ b/engines/m4/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/m4/saveload.h b/engines/m4/saveload.h index 132cb93f007..9b76054e65e 100644 --- a/engines/m4/saveload.h +++ b/engines/m4/saveload.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_SAVELOAD_H diff --git a/engines/m4/scene.cpp b/engines/m4/scene.cpp index c0cbd879b2e..a38be200869 100644 --- a/engines/m4/scene.cpp +++ b/engines/m4/scene.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/m4/scene.h b/engines/m4/scene.h index e0b28e6454f..5086cc0db09 100644 --- a/engines/m4/scene.h +++ b/engines/m4/scene.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_SCENE_H diff --git a/engines/m4/script.cpp b/engines/m4/script.cpp index cc60ec310d8..026c025f457 100644 --- a/engines/m4/script.cpp +++ b/engines/m4/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/m4/script.h b/engines/m4/script.h index 32b57014191..22f07fd062d 100644 --- a/engines/m4/script.h +++ b/engines/m4/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_SCRIPT_H diff --git a/engines/m4/sound.cpp b/engines/m4/sound.cpp index fb90cea5cc6..d10dea5cad6 100644 --- a/engines/m4/sound.cpp +++ b/engines/m4/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/m4.h" diff --git a/engines/m4/sound.h b/engines/m4/sound.h index 8962e67dfd3..99a2292d836 100644 --- a/engines/m4/sound.h +++ b/engines/m4/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Sound class diff --git a/engines/m4/sprite.cpp b/engines/m4/sprite.cpp index cef9917381e..1a3228d1bbb 100644 --- a/engines/m4/sprite.cpp +++ b/engines/m4/sprite.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/rect.h" diff --git a/engines/m4/sprite.h b/engines/m4/sprite.h index d4e5502efdb..af49d8cbafd 100644 --- a/engines/m4/sprite.h +++ b/engines/m4/sprite.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_SPRITE_H diff --git a/engines/m4/staticres.cpp b/engines/m4/staticres.cpp index fc49998adb7..520c0ad58e7 100644 --- a/engines/m4/staticres.cpp +++ b/engines/m4/staticres.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/staticres.h" diff --git a/engines/m4/staticres.h b/engines/m4/staticres.h index 80fc69fc801..e3ead3398b7 100644 --- a/engines/m4/staticres.h +++ b/engines/m4/staticres.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_STATICRES_H diff --git a/engines/m4/viewmgr.cpp b/engines/m4/viewmgr.cpp index 46b4b5af9d4..8eb40f0f17b 100644 --- a/engines/m4/viewmgr.cpp +++ b/engines/m4/viewmgr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // TODO: Views have a _coords rect, so I'm not sure if x/y is needed in the onRefresh diff --git a/engines/m4/viewmgr.h b/engines/m4/viewmgr.h index 211e6087f48..bb4f76cfaaa 100644 --- a/engines/m4/viewmgr.h +++ b/engines/m4/viewmgr.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_VIEWMGR_H diff --git a/engines/m4/woodscript.cpp b/engines/m4/woodscript.cpp index dc24548f84d..42f4fbce982 100644 --- a/engines/m4/woodscript.cpp +++ b/engines/m4/woodscript.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/woodscript.h" diff --git a/engines/m4/woodscript.h b/engines/m4/woodscript.h index a9a884a4b02..95033b9179e 100644 --- a/engines/m4/woodscript.h +++ b/engines/m4/woodscript.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_WOODSCRIPT_H diff --git a/engines/m4/ws_machine.cpp b/engines/m4/ws_machine.cpp index 3a25e3c6222..18a8af76a8c 100644 --- a/engines/m4/ws_machine.cpp +++ b/engines/m4/ws_machine.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/woodscript.h" diff --git a/engines/m4/ws_sequence.cpp b/engines/m4/ws_sequence.cpp index 3ee496da0da..01776ef6ec8 100644 --- a/engines/m4/ws_sequence.cpp +++ b/engines/m4/ws_sequence.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/woodscript.h" diff --git a/engines/made/console.cpp b/engines/made/console.cpp index abf849d5609..c8359887886 100644 --- a/engines/made/console.cpp +++ b/engines/made/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "made/console.h" diff --git a/engines/made/console.h b/engines/made/console.h index 6dc7541f533..8b8484cb5c1 100644 --- a/engines/made/console.h +++ b/engines/made/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_CONSOLE_H diff --git a/engines/made/database.cpp b/engines/made/database.cpp index 4e7a0467b19..6e5a3228f30 100644 --- a/engines/made/database.cpp +++ b/engines/made/database.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/made/database.h b/engines/made/database.h index a71ba925c14..94acef98cd2 100644 --- a/engines/made/database.h +++ b/engines/made/database.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_DATABASE_H diff --git a/engines/made/detection.cpp b/engines/made/detection.cpp index 6a6a70cb30c..4576e2b5ce3 100644 --- a/engines/made/detection.cpp +++ b/engines/made/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -558,7 +555,7 @@ public: MadeMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "MADE Engine"; + return "MADE"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/made/graphics.cpp b/engines/made/graphics.cpp index 388ff60aa8d..3ac73617c17 100644 --- a/engines/made/graphics.cpp +++ b/engines/made/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/made/graphics.h b/engines/made/graphics.h index bf5ec288fff..691f1127c27 100644 --- a/engines/made/graphics.h +++ b/engines/made/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_GRAPHICS_H diff --git a/engines/made/made.cpp b/engines/made/made.cpp index c791b657e72..a9c4587b4c4 100644 --- a/engines/made/made.cpp +++ b/engines/made/made.cpp @@ -18,13 +18,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/events.h" -#include "common/EventRecorder.h" #include "common/keyboard.h" #include "common/config-manager.h" #include "common/stream.h" @@ -75,8 +71,7 @@ MadeEngine::MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc) : Eng if (!scumm_stricmp(g->gameid, gameid)) _gameId = g->id; - _rnd = new Common::RandomSource(); - g_eventRec.registerRandomSource(*_rnd, "made"); + _rnd = new Common::RandomSource("made"); _console = new MadeConsole(this); diff --git a/engines/made/made.h b/engines/made/made.h index 780f59e4420..e9673eed3cd 100644 --- a/engines/made/made.h +++ b/engines/made/made.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_H diff --git a/engines/made/music.cpp b/engines/made/music.cpp index e5bbbc3b426..146d8d6371e 100644 --- a/engines/made/music.cpp +++ b/engines/made/music.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // FIXME: This code is taken from SAGA and needs more work (e.g. setVolume). diff --git a/engines/made/music.h b/engines/made/music.h index f8f70cdad67..1a5bae30405 100644 --- a/engines/made/music.h +++ b/engines/made/music.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Music class diff --git a/engines/made/pmvplayer.cpp b/engines/made/pmvplayer.cpp index 5ab24c1984c..386d6182739 100644 --- a/engines/made/pmvplayer.cpp +++ b/engines/made/pmvplayer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "made/pmvplayer.h" diff --git a/engines/made/pmvplayer.h b/engines/made/pmvplayer.h index 8014a5a0f14..58b6eafd2bf 100644 --- a/engines/made/pmvplayer.h +++ b/engines/made/pmvplayer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_PMVPLAYER_H diff --git a/engines/made/redreader.cpp b/engines/made/redreader.cpp index 2fcd7f43da8..a18c719110c 100644 --- a/engines/made/redreader.cpp +++ b/engines/made/redreader.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "made/redreader.h" diff --git a/engines/made/redreader.h b/engines/made/redreader.h index a6e72c4e00f..84181fb7229 100644 --- a/engines/made/redreader.h +++ b/engines/made/redreader.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_REDREADER_H diff --git a/engines/made/resource.cpp b/engines/made/resource.cpp index 403520bec32..246241561ce 100644 --- a/engines/made/resource.cpp +++ b/engines/made/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/made/resource.h b/engines/made/resource.h index f1aeb7a87c5..8ffebfef50f 100644 --- a/engines/made/resource.h +++ b/engines/made/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_RESOURCE_H diff --git a/engines/made/screen.cpp b/engines/made/screen.cpp index 4a73ba8e387..7a8b4603dc9 100644 --- a/engines/made/screen.cpp +++ b/engines/made/screen.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "made/made.h" diff --git a/engines/made/screen.h b/engines/made/screen.h index e9292240a14..8485c1c4d7f 100644 --- a/engines/made/screen.h +++ b/engines/made/screen.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_SCREEN_H diff --git a/engines/made/screenfx.cpp b/engines/made/screenfx.cpp index 7d1c3ed0a7e..bdc36c87d72 100644 --- a/engines/made/screenfx.cpp +++ b/engines/made/screenfx.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "made/made.h" diff --git a/engines/made/screenfx.h b/engines/made/screenfx.h index 912eb8e0f7e..793fcba2d65 100644 --- a/engines/made/screenfx.h +++ b/engines/made/screenfx.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_SCREENFX_H diff --git a/engines/made/script.cpp b/engines/made/script.cpp index de196f30e05..85e1a6ec6b3 100644 --- a/engines/made/script.cpp +++ b/engines/made/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/made/script.h b/engines/made/script.h index be719eba5f5..0a7cf8e9742 100644 --- a/engines/made/script.h +++ b/engines/made/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_SCRIPT_H diff --git a/engines/made/scriptfuncs.cpp b/engines/made/scriptfuncs.cpp index c0a723438e0..98cfb647ac1 100644 --- a/engines/made/scriptfuncs.cpp +++ b/engines/made/scriptfuncs.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/made/scriptfuncs.h b/engines/made/scriptfuncs.h index b8b2a87d193..481c131248f 100644 --- a/engines/made/scriptfuncs.h +++ b/engines/made/scriptfuncs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_SCRIPTFUNCS_H diff --git a/engines/made/sound.cpp b/engines/made/sound.cpp index 5ff1f73b057..54333eb3d46 100644 --- a/engines/made/sound.cpp +++ b/engines/made/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/made/sound.h b/engines/made/sound.h index 0766c1040cc..8358d279cf4 100644 --- a/engines/made/sound.h +++ b/engines/made/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_SOUND_H diff --git a/engines/metaengine.h b/engines/metaengine.h index ef34506991d..8eb8044b34b 100644 --- a/engines/metaengine.h +++ b/engines/metaengine.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef ENGINES_METAENGINE_H diff --git a/engines/mohawk/bitmap.cpp b/engines/mohawk/bitmap.cpp index 02548d58fcf..d54e2dac6b9 100644 --- a/engines/mohawk/bitmap.cpp +++ b/engines/mohawk/bitmap.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/bitmap.h" diff --git a/engines/mohawk/bitmap.h b/engines/mohawk/bitmap.h index ea8a130dfc0..74218882e84 100644 --- a/engines/mohawk/bitmap.h +++ b/engines/mohawk/bitmap.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_BITMAP_H diff --git a/engines/mohawk/console.cpp b/engines/mohawk/console.cpp index 93cbe87e554..4e5b7186ff0 100644 --- a/engines/mohawk/console.cpp +++ b/engines/mohawk/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/console.h" diff --git a/engines/mohawk/console.h b/engines/mohawk/console.h index cb0e8501cd5..cdb4e1bedf7 100644 --- a/engines/mohawk/console.h +++ b/engines/mohawk/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_CONSOLE_H diff --git a/engines/mohawk/cstime.cpp b/engines/mohawk/cstime.cpp index 46faae08f5b..59bc5ad6614 100644 --- a/engines/mohawk/cstime.cpp +++ b/engines/mohawk/cstime.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cstime.h" @@ -35,15 +32,14 @@ #include "common/config-manager.h" #include "common/error.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/fs.h" #include "common/textconsole.h" +#include "common/system.h" namespace Mohawk { MohawkEngine_CSTime::MohawkEngine_CSTime(OSystem *syst, const MohawkGameDescription *gamedesc) : MohawkEngine(syst, gamedesc) { - _rnd = new Common::RandomSource(); - g_eventRec.registerRandomSource(*_rnd, "cstime"); + _rnd = new Common::RandomSource("cstime"); // If the user just copied the CD contents, the fonts are in a subdirectory. const Common::FSNode gameDataDir(ConfMan.get("path")); diff --git a/engines/mohawk/cstime.h b/engines/mohawk/cstime.h index 40293916dbd..3a1de6a1379 100644 --- a/engines/mohawk/cstime.h +++ b/engines/mohawk/cstime.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_CSTIME_H diff --git a/engines/mohawk/cstime_cases.cpp b/engines/mohawk/cstime_cases.cpp index c4801f822c8..c0a8dfc0e36 100644 --- a/engines/mohawk/cstime_cases.cpp +++ b/engines/mohawk/cstime_cases.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cstime_cases.h" diff --git a/engines/mohawk/cstime_cases.h b/engines/mohawk/cstime_cases.h index 6f7630648e1..1ac9abf87e9 100644 --- a/engines/mohawk/cstime_cases.h +++ b/engines/mohawk/cstime_cases.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_CSTIME_CASES_H diff --git a/engines/mohawk/cstime_game.cpp b/engines/mohawk/cstime_game.cpp index 66dce1da928..2e211110259 100644 --- a/engines/mohawk/cstime_game.cpp +++ b/engines/mohawk/cstime_game.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cstime_game.h" diff --git a/engines/mohawk/cstime_game.h b/engines/mohawk/cstime_game.h index 661fdbaa412..88e813c9992 100644 --- a/engines/mohawk/cstime_game.h +++ b/engines/mohawk/cstime_game.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_CSTIME_GAME_H diff --git a/engines/mohawk/cstime_ui.cpp b/engines/mohawk/cstime_ui.cpp index 106f7ea3199..de7d5bde804 100644 --- a/engines/mohawk/cstime_ui.cpp +++ b/engines/mohawk/cstime_ui.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cstime_game.h" @@ -646,7 +643,7 @@ void CSTimeInterface::startDragging(uint16 id) { _vm->getView()->dragFeature((NewFeature *)invObj->feature, _grabPoint, 4, dragFlags, NULL); if (_vm->getCase()->getId() == 1 && id == 2) { - // Hardcoded behaviour for the torch in the first case. + // Hardcoded behavior for the torch in the first case. if (_vm->getCase()->getCurrScene()->getId() == 4) { // This is the dark tomb. // FIXME: apply torch hack @@ -813,7 +810,7 @@ void CSTimeInterface::stopDragging() { } if (_vm->getCase()->getId() == 1 && _vm->getCase()->getCurrScene()->getId() == 4) { - // Hardcoded behaviour for torches in the dark tomb, in the first case. + // Hardcoded behavior for torches in the dark tomb, in the first case. if (_draggedItem == 1 && foundInvObjHotspot == 0xffff) { // Trying to drag an unlit torch around? _vm->addEvent(CSTimeEvent(kCSTimeEventCharStartFlapping, 0, 16352)); diff --git a/engines/mohawk/cstime_ui.h b/engines/mohawk/cstime_ui.h index 3ec38492d74..27df7cac3ee 100644 --- a/engines/mohawk/cstime_ui.h +++ b/engines/mohawk/cstime_ui.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_CSTIME_UI_H diff --git a/engines/mohawk/cstime_view.cpp b/engines/mohawk/cstime_view.cpp index 12d641a9ff2..37c418f4160 100644 --- a/engines/mohawk/cstime_view.cpp +++ b/engines/mohawk/cstime_view.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cstime_game.h" // debugging.. diff --git a/engines/mohawk/cstime_view.h b/engines/mohawk/cstime_view.h index 8db8794ce5d..ae3283771d8 100644 --- a/engines/mohawk/cstime_view.h +++ b/engines/mohawk/cstime_view.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_CSTIME_VIEW_H diff --git a/engines/mohawk/cursors.cpp b/engines/mohawk/cursors.cpp index 33278609132..f95084de8e4 100644 --- a/engines/mohawk/cursors.cpp +++ b/engines/mohawk/cursors.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" @@ -130,6 +127,13 @@ void MystCursorManager::hideCursor() { } void MystCursorManager::setCursor(uint16 id) { + // Zero means empty cursor + if (id == 0) { + static const byte emptyCursor = 0; + CursorMan.replaceCursor(&emptyCursor, 1, 1, 0, 0, 0); + return; + } + // Both Myst and Myst ME use the "MystBitmap" format for cursor images. MohawkSurface *mhkSurface = _bmpDecoder->decodeImage(_vm->getResource(ID_WDIB, id)); Graphics::Surface *surface = mhkSurface->getSurface(); diff --git a/engines/mohawk/cursors.h b/engines/mohawk/cursors.h index ba9700c9f92..d92b6b42853 100644 --- a/engines/mohawk/cursors.h +++ b/engines/mohawk/cursors.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_CURSORS_H diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp index c14d3327d07..6a73b28246f 100644 --- a/engines/mohawk/detection.cpp +++ b/engines/mohawk/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -191,7 +188,7 @@ public: MohawkMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Mohawk Engine"; + return "Mohawk"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/mohawk/detection_tables.h b/engines/mohawk/detection_tables.h index 36dbcbde7ba..5510643d048 100644 --- a/engines/mohawk/detection_tables.h +++ b/engines/mohawk/detection_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ namespace Mohawk { diff --git a/engines/mohawk/dialogs.cpp b/engines/mohawk/dialogs.cpp index 4c7e52f02f9..6cb455917eb 100644 --- a/engines/mohawk/dialogs.cpp +++ b/engines/mohawk/dialogs.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/mohawk.h" @@ -82,7 +79,9 @@ void PauseDialog::handleKeyDown(Common::KeyState state) { enum { kZipCmd = 'ZIPM', kTransCmd = 'TRAN', - kWaterCmd = 'WATR' + kWaterCmd = 'WATR', + kDropCmd = 'DROP', + kMapCmd = 'SMAP' }; #ifdef ENABLE_MYST @@ -90,6 +89,13 @@ enum { MystOptionsDialog::MystOptionsDialog(MohawkEngine_Myst* vm) : GUI::OptionsDialog("", 120, 120, 360, 200), _vm(vm) { _zipModeCheckbox = new GUI::CheckboxWidget(this, 15, 10, 300, 15, _("~Z~ip Mode Activated"), 0, kZipCmd); _transitionsCheckbox = new GUI::CheckboxWidget(this, 15, 30, 300, 15, _("~T~ransitions Enabled"), 0, kTransCmd); + _dropPageButton = new GUI::ButtonWidget(this, 15, 60, 100, 25, _("~D~rop Page"), 0, kDropCmd); + + // Myst ME only has maps + if (_vm->getFeatures() & GF_ME) + _showMapButton = new GUI::ButtonWidget(this, 15, 95, 100, 25, _("~S~how Map"), 0, kMapCmd); + else + _showMapButton = 0; new GUI::ButtonWidget(this, 95, 160, 120, 25, _("~O~K"), 0, GUI::kOKCmd); new GUI::ButtonWidget(this, 225, 160, 120, 25, _("~C~ancel"), 0, GUI::kCloseCmd); @@ -101,6 +107,12 @@ MystOptionsDialog::~MystOptionsDialog() { void MystOptionsDialog::open() { Dialog::open(); + _dropPageButton->setEnabled(_vm->_gameState->_globals.heldPage != 0); + + if (_showMapButton) + _showMapButton->setEnabled(_vm->_scriptParser && + _vm->_scriptParser->getMap()); + _zipModeCheckbox->setState(_vm->_gameState->_globals.zipMode); _transitionsCheckbox->setState(_vm->_gameState->_globals.transitions); } @@ -113,6 +125,14 @@ void MystOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, ui case kTransCmd: _vm->_gameState->_globals.transitions = _transitionsCheckbox->getState(); break; + case kDropCmd: + _vm->_needsPageDrop = true; + close(); + break; + case kMapCmd: + _vm->_needsShowMap = true; + close(); + break; case GUI::kCloseCmd: close(); break; diff --git a/engines/mohawk/dialogs.h b/engines/mohawk/dialogs.h index 106a1566fc2..853ff308136 100644 --- a/engines/mohawk/dialogs.h +++ b/engines/mohawk/dialogs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_DIALOGS_H @@ -84,6 +81,8 @@ private: MohawkEngine_Myst *_vm; GUI::CheckboxWidget *_zipModeCheckbox; GUI::CheckboxWidget *_transitionsCheckbox; + GUI::ButtonWidget *_dropPageButton; + GUI::ButtonWidget *_showMapButton; }; #endif diff --git a/engines/mohawk/graphics.cpp b/engines/mohawk/graphics.cpp index a1bcb55f7bd..b3653b1fdf1 100644 --- a/engines/mohawk/graphics.cpp +++ b/engines/mohawk/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/resource.h" @@ -296,6 +293,9 @@ MystGraphics::MystGraphics(MohawkEngine_Myst* vm) : GraphicsManager(), _vm(vm) { // Initialize our buffer _backBuffer = new Graphics::Surface(); _backBuffer->create(_vm->_system->getWidth(), _vm->_system->getHeight(), _pixelFormat); + + _nextAllowedDrawTime = _vm->_system->getMillis(); + _enableDrawingTimeSimulation = 0; } MystGraphics::~MystGraphics() { @@ -447,6 +447,8 @@ void MystGraphics::copyImageSectionToScreen(uint16 image, Common::Rect src, Comm debug(3, "\twidth: %d", width); debug(3, "\theight: %d", height); + simulatePreviousDrawDelay(dest); + _vm->_system->copyRectToScreen((byte *)surface->getBasePtr(src.left, top), surface->pitch, dest.left, dest.top, width, height); } @@ -502,10 +504,18 @@ void MystGraphics::copyImageToBackBuffer(uint16 image, Common::Rect dest) { void MystGraphics::copyBackBufferToScreen(Common::Rect r) { r.clip(_viewport); + + simulatePreviousDrawDelay(r); + _vm->_system->copyRectToScreen((byte *)_backBuffer->getBasePtr(r.left, r.top), _backBuffer->pitch, r.left, r.top, r.width(), r.height()); } void MystGraphics::runTransition(uint16 type, Common::Rect rect, uint16 steps, uint16 delay) { + + // Do not artificially delay during transitions + int oldEnableDrawingTimeSimulation = _enableDrawingTimeSimulation; + _enableDrawingTimeSimulation = 0; + switch (type) { case 0: { debugC(kDebugScript, "Left to Right"); @@ -607,6 +617,8 @@ void MystGraphics::runTransition(uint16 type, Common::Rect rect, uint16 steps, u _vm->_system->updateScreen(); break; } + + _enableDrawingTimeSimulation = oldEnableDrawingTimeSimulation; } void MystGraphics::drawRect(Common::Rect rect, RectState state) { @@ -632,6 +644,34 @@ void MystGraphics::drawLine(const Common::Point &p1, const Common::Point &p2, ui _backBuffer->drawLine(p1.x, p1.y, p2.x, p2.y, color); } +void MystGraphics::enableDrawingTimeSimulation(bool enable) { + if (enable) + _enableDrawingTimeSimulation++; + else + _enableDrawingTimeSimulation--; + + if (_enableDrawingTimeSimulation < 0) + _enableDrawingTimeSimulation = 0; +} + +void MystGraphics::simulatePreviousDrawDelay(const Common::Rect &dest) { + uint32 time = 0; + + if (_enableDrawingTimeSimulation) { + time = _vm->_system->getMillis(); + + // Do not draw anything new too quickly after the previous draw call + // so that images stay at least a little while on screen + // This is enabled only for scripted draw calls + if (time < _nextAllowedDrawTime) + _vm->_system->delayMillis(_nextAllowedDrawTime - time); + } + + // Next draw call allowed at DELAY + AERA * COEFF milliseconds from now + time = _vm->_system->getMillis(); + _nextAllowedDrawTime = time + _constantDrawDelay + dest.height() * dest.width() / _proportionalDrawDelay; +} + #endif // ENABLE_MYST #ifdef ENABLE_RIVEN diff --git a/engines/mohawk/graphics.h b/engines/mohawk/graphics.h index c7e9b98d497..d7057f48cf8 100644 --- a/engines/mohawk/graphics.h +++ b/engines/mohawk/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_GRAPHICS_H @@ -131,10 +128,12 @@ public: void runTransition(uint16 type, Common::Rect rect, uint16 steps, uint16 delay); void drawRect(Common::Rect rect, RectState state); void drawLine(const Common::Point &p1, const Common::Point &p2, uint32 color); + void enableDrawingTimeSimulation(bool enable); protected: MohawkSurface *decodeImage(uint16 id); MohawkEngine *getVM() { return (MohawkEngine *)_vm; } + void simulatePreviousDrawDelay(const Common::Rect &dest); private: MohawkEngine_Myst *_vm; @@ -159,6 +158,11 @@ private: Graphics::Surface *_backBuffer; Graphics::PixelFormat _pixelFormat; Common::Rect _viewport; + + int _enableDrawingTimeSimulation; + uint32 _nextAllowedDrawTime; + static const uint _constantDrawDelay = 10; // ms + static const uint _proportionalDrawDelay = 500; // pixels per ms }; #endif // ENABLE_MYST diff --git a/engines/mohawk/installer_archive.cpp b/engines/mohawk/installer_archive.cpp index 5079375896c..83796158a6c 100644 --- a/engines/mohawk/installer_archive.cpp +++ b/engines/mohawk/installer_archive.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/installer_archive.h" diff --git a/engines/mohawk/installer_archive.h b/engines/mohawk/installer_archive.h index d33fbe5bcdd..27877d69f91 100644 --- a/engines/mohawk/installer_archive.h +++ b/engines/mohawk/installer_archive.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/archive.h" diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index 24759658128..375806cda41 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/livingbooks.h" @@ -31,10 +28,10 @@ #include "common/config-manager.h" #include "common/error.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/fs.h" #include "common/archive.h" #include "common/textconsole.h" +#include "common/system.h" #include "graphics/palette.h" @@ -128,8 +125,7 @@ MohawkEngine_LivingBooks::MohawkEngine_LivingBooks(OSystem *syst, const MohawkGa _alreadyShowedIntro = false; - _rnd = new Common::RandomSource(); - g_eventRec.registerRandomSource(*_rnd, "livingbooks"); + _rnd = new Common::RandomSource("livingbooks"); _page = NULL; @@ -293,6 +289,15 @@ void MohawkEngine_LivingBooks::loadBookInfo(const Common::String &filename) { // - fUse254ColorPalette (always true?) // - nKBRequired (4096, RAM requirement?) // - fDebugWindow (always 0?) + + if (_bookInfoFile.hasSection("Globals")) { + const Common::ConfigFile::SectionKeyList globals = _bookInfoFile.getKeys("Globals"); + for (Common::ConfigFile::SectionKeyList::const_iterator i = globals.begin(); i != globals.end(); i++) { + Common::String command = Common::String::format("%s = %s", i->key.c_str(), i->value.c_str()); + debug("global: %s", command.c_str()); + // TODO: run command + } + } } Common::String MohawkEngine_LivingBooks::stringForMode(LBMode mode) { @@ -746,6 +751,9 @@ void LBPage::loadBITL(uint16 resourceId) { case kLBMiniGameItem: res = new LBMiniGameItem(_vm, this, rect); break; + case kLBProxyItem: + res = new LBProxyItem(_vm, this, rect); + break; default: warning("Unknown item type %04x", type); case 3: // often used for buttons @@ -2700,10 +2708,20 @@ int LBItem::runScriptEntry(LBScriptEntry *entry) { break; case kLBOpLoad: + // FIXME + warning("ignoring kLBOpLoad (event 0x%04x, param 0x%04x, target '%s')", + entry->event, entry->param, target->_desc.c_str()); + break; + case kLBOpPreload: + // FIXME + warning("ignoring kLBOpPreload (event 0x%04x, param 0x%04x, target '%s')", + entry->event, entry->param, target->_desc.c_str()); + break; + case kLBOpUnload: // FIXME - warning("ignoring kLBOpLoad/Preload/Unload (event 0x%04x, param 0x%04x, target '%s')", + warning("ignoring kLBOpUnload (event 0x%04x, param 0x%04x, target '%s')", entry->event, entry->param, target->_desc.c_str()); break; @@ -3748,4 +3766,35 @@ bool LBMiniGameItem::togglePlaying(bool playing, bool restart) { return false; } +LBProxyItem::LBProxyItem(MohawkEngine_LivingBooks *vm, LBPage *page, Common::Rect rect) : LBItem(vm, page, rect) { + debug(3, "new LBProxyItem"); + + _page = NULL; +} + +LBProxyItem::~LBProxyItem() { + delete _page; +} + +void LBProxyItem::init() { + Common::String leftover; + Common::String filename = _vm->getFileNameFromConfig("Proxies", _desc.c_str(), leftover); + if (!leftover.empty()) + error("LBProxyItem tried loading proxy '%s' but got leftover '%s'", _desc.c_str(), leftover.c_str()); + uint16 baseId = 0; + for (uint i = 0; i < filename.size(); i++) { + if (filename[i] == ';') { + baseId = atoi(filename.c_str() + i + 1); + filename = Common::String(filename.c_str(), i); + } + } + + debug(1, "LBProxyItem loading archive '%s' with id %d", filename.c_str(), baseId); + MohawkArchive *pageArchive = _vm->createMohawkArchive(); + if (!pageArchive->open(filename)) + error("failed to open archive '%s' (for proxy '%s')", filename.c_str(), _desc.c_str()); + _page = new LBPage(_vm); + _page->open(pageArchive, baseId); +} + } // End of namespace Mohawk diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h index cd3b206d574..de84b0f13fa 100644 --- a/engines/mohawk/livingbooks.h +++ b/engines/mohawk/livingbooks.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_LIVINGBOOKS_H @@ -574,6 +571,17 @@ public: bool togglePlaying(bool playing, bool restart); }; +class LBProxyItem : public LBItem { +public: + LBProxyItem(MohawkEngine_LivingBooks *_vm, LBPage *page, Common::Rect rect); + ~LBProxyItem(); + + void init(); + +protected: + class LBPage *_page; +}; + struct NotifyEvent { NotifyEvent(uint t, uint p) : type(t), param(p), newUnknown(0), newMode(0), newPage(0), newSubpage(0) { } uint type; diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp index 4237c712d96..165ca4a3282 100644 --- a/engines/mohawk/livingbooks_code.cpp +++ b/engines/mohawk/livingbooks_code.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/livingbooks.h" @@ -609,7 +606,7 @@ CodeCommandInfo generalCommandInfo[NUM_GENERAL_COMMANDS] = { { "move", 0 }, { 0, 0 }, { 0, 0 }, - { "setDragParams", 0 }, + { "setDragParams", &LBCode::cmdSetDragParams }, { "resetDragParams", 0 }, { "enableRollover", &LBCode::cmdUnimplemented /* FIXME */ }, { "setCursor", 0 }, @@ -804,6 +801,10 @@ void LBCode::cmdRight(const Common::Array ¶ms) { _stack.push(rect.right); } +void LBCode::cmdSetDragParams(const Common::Array ¶ms) { + warning("ignoring setDragParams"); +} + void LBCode::cmdSetPlayParams(const Common::Array ¶ms) { if (params.size() > 8) error("too many parameters (%d) to setPlayParams", params.size()); @@ -878,7 +879,7 @@ CodeCommandInfo itemCommandInfo[NUM_ITEM_COMMANDS] = { { "isLoaded", 0 }, { "isDragging", 0 }, { "load", 0 }, - { "moveTo", 0 }, + { "moveTo", &LBCode::itemMoveTo }, { "mute", 0 }, { "play", 0 }, { "seek", 0 }, @@ -913,6 +914,10 @@ void LBCode::itemIsPlaying(const Common::Array ¶ms) { _stack.push(0); } +void LBCode::itemMoveTo(const Common::Array ¶ms) { + warning("ignoring moveTo"); +} + void LBCode::itemSetParent(const Common::Array ¶ms) { if (params.size() > 2) error("incorrect number of parameters (%d) to setParent", params.size()); diff --git a/engines/mohawk/livingbooks_code.h b/engines/mohawk/livingbooks_code.h index cd9ac1004aa..9602e2d22d2 100644 --- a/engines/mohawk/livingbooks_code.h +++ b/engines/mohawk/livingbooks_code.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_LIVINGBOOKS_CODE_H @@ -225,12 +222,14 @@ public: void cmdLeft(const Common::Array ¶ms); void cmdBottom(const Common::Array ¶ms); void cmdRight(const Common::Array ¶ms); + void cmdSetDragParams(const Common::Array ¶ms); void cmdSetPlayParams(const Common::Array ¶ms); void cmdSetKeyEvent(const Common::Array ¶ms); void cmdSetHitTest(const Common::Array ¶ms); void cmdKey(const Common::Array ¶ms); void itemSetParent(const Common::Array ¶ms); + void itemMoveTo(const Common::Array ¶ms); void itemIsPlaying(const Common::Array ¶ms); }; diff --git a/engines/mohawk/mohawk.cpp b/engines/mohawk/mohawk.cpp index f63645f1ac1..faf52595b76 100644 --- a/engines/mohawk/mohawk.cpp +++ b/engines/mohawk/mohawk.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/engines/mohawk/mohawk.h b/engines/mohawk/mohawk.h index 8a853d151e7..b189f82040b 100644 --- a/engines/mohawk/mohawk.h +++ b/engines/mohawk/mohawk.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_H diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index 655a38b578b..4f9c3a893ed 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -74,7 +71,8 @@ MohawkEngine_Myst::MohawkEngine_Myst(OSystem *syst, const MohawkGameDescription // original, including bugs, missing bits etc. :) _tweaksEnabled = true; - _currentCursor = _mainCursor = kDefaultMystCursor; + _currentCursor = 0; + _mainCursor = kDefaultMystCursor; _showResourceRects = false; _curCard = 0; _needsUpdate = false; @@ -258,7 +256,10 @@ Common::Error MohawkEngine_Myst::run() { _loadDialog->setSaveMode(false); _optionsDialog = new MystOptionsDialog(this); _cursor = new MystCursorManager(this); - _rnd = new Common::RandomSource(); + _rnd = new Common::RandomSource("myst"); + + // Cursor is visible by default + _cursor->showCursor(); // Load game from launcher/command line if requested if (ConfMan.hasKey("save_slot") && canLoadGameStateCurrently()) { @@ -288,9 +289,6 @@ Common::Error MohawkEngine_Myst::run() { // Test Load Function... loadHelp(10000); - // Set the cursor - _cursor->setCursor(_currentCursor); - Common::Event event; while (!shouldQuit()) { // Update any background videos @@ -343,7 +341,20 @@ Common::Error MohawkEngine_Myst::run() { drawResourceRects(); break; case Common::KEYCODE_F5: + _needsPageDrop = false; + _needsShowMap = false; + runDialog(*_optionsDialog); + + if (_needsPageDrop) { + dropPage(); + _needsPageDrop = false; + } + + if (_needsShowMap) { + _scriptParser->showMap(); + _needsShowMap = false; + } break; default: break; @@ -405,6 +416,11 @@ void MohawkEngine_Myst::changeToStack(uint16 stack, uint16 card, uint16 linkSrcS _curStack = stack; + // Fill screen with black and empty cursor + _cursor->setCursor(0); + _system->fillScreen(_system->getScreenFormat().RGBToColor(0, 0, 0)); + _system->updateScreen(); + _sound->stopSound(); _sound->stopBackgroundMyst(); if (linkSrcSound) @@ -553,7 +569,7 @@ uint16 MohawkEngine_Myst::getCardBackgroundId() { } void MohawkEngine_Myst::drawCardBackground() { - _gfx->copyImageToBackBuffer(getCardBackgroundId(), Common::Rect(0, 0, 544, 333)); + _gfx->copyImageToBackBuffer(getCardBackgroundId(), Common::Rect(0, 0, 544, 332)); } void MohawkEngine_Myst::changeToCard(uint16 card, bool updateScreen) { @@ -631,18 +647,18 @@ void MohawkEngine_Myst::changeToCard(uint16 card, bool updateScreen) { // TODO: Handle Script Resources - // Make sure we have the right cursor showing - _dragResource = 0; - _hoverResource = 0; - _curResource = -1; - checkCurrentResource(); - // Make sure the screen is updated if (updateScreen) { _gfx->copyBackBufferToScreen(Common::Rect(544, 333)); _system->updateScreen(); } + // Make sure we have the right cursor showing + _dragResource = 0; + _hoverResource = 0; + _curResource = -1; + checkCurrentResource(); + // Debug: Show resource rects if (_showResourceRects) drawResourceRects(); @@ -1181,4 +1197,42 @@ bool MohawkEngine_Myst::canSaveGameStateCurrently() { return false; } +void MohawkEngine_Myst::dropPage() { + uint16 page = _gameState->_globals.heldPage; + bool whitePage = page == 13; + bool bluePage = page - 1 < 6; + bool redPage = page - 7 < 6; + + // Play drop page sound + _sound->replaceSoundMyst(800); + + // Drop page + _gameState->_globals.heldPage = 0; + + // Redraw page area + if (whitePage && _gameState->_globals.currentAge == 2) { + redrawArea(41); + } else if (bluePage) { + if (page == 6) { + if (_gameState->_globals.currentAge == 2) + redrawArea(24); + } else { + redrawArea(103); + } + } else if (redPage) { + if (page == 12) { + if (_gameState->_globals.currentAge == 2) + redrawArea(25); + } else if (page == 10) { + if (_gameState->_globals.currentAge == 1) + redrawArea(35); + } else { + redrawArea(102); + } + } + + setMainCursor(kDefaultMystCursor); + checkCursorHints(); +} + } // End of namespace Mohawk diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h index 47e8a6562c8..5edf774ed0c 100644 --- a/engines/mohawk/myst.h +++ b/engines/mohawk/myst.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_MYST_H @@ -168,6 +165,8 @@ public: bool _tweaksEnabled; bool _needsUpdate; + bool _needsPageDrop; + bool _needsShowMap; MystView _view; MystGraphics *_gfx; @@ -210,6 +209,8 @@ private: bool _runExitScript; + void dropPage(); + void loadCard(); void unloadCard(); void runInitScript(); diff --git a/engines/mohawk/myst_areas.cpp b/engines/mohawk/myst_areas.cpp index dc00bff923d..294fcea2f17 100644 --- a/engines/mohawk/myst_areas.cpp +++ b/engines/mohawk/myst_areas.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/graphics.h" diff --git a/engines/mohawk/myst_areas.h b/engines/mohawk/myst_areas.h index aa06d1a5b48..136356ea4f3 100644 --- a/engines/mohawk/myst_areas.h +++ b/engines/mohawk/myst_areas.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_scripts.cpp b/engines/mohawk/myst_scripts.cpp index 71c408ed376..be5b7e1c76c 100644 --- a/engines/mohawk/myst_scripts.cpp +++ b/engines/mohawk/myst_scripts.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" @@ -148,6 +145,7 @@ void MystScriptParser::setupCommonOpcodes() { OPCODE(44, o_restoreMainCursor); // Opcode 45 Not Present OPCODE(46, o_soundWaitStop); + OPCODE(51, o_exitMap); // Opcodes 47 to 99 Not Present OPCODE(0xFFFF, NOP); @@ -157,6 +155,11 @@ void MystScriptParser::setupCommonOpcodes() { void MystScriptParser::runScript(MystScript script, MystResource *invokingResource) { debugC(kDebugScript, "Script Size: %d", script->size()); + + // Scripted drawing takes more time to simulate older hardware + // This way opcodes can't overwrite what the previous ones drew too quickly + _vm->_gfx->enableDrawingTimeSimulation(true); + for (uint16 i = 0; i < script->size(); i++) { MystScriptEntry &entry = script->operator[](i); debugC(kDebugScript, "\tOpcode %d: %d", i, entry.opcode); @@ -168,6 +171,8 @@ void MystScriptParser::runScript(MystScript script, MystResource *invokingResour runOpcode(entry.opcode, entry.var, entry.argc, entry.argv); } + + _vm->_gfx->enableDrawingTimeSimulation(false); } void MystScriptParser::runOpcode(uint16 op, uint16 var, uint16 argc, uint16 *argv) { @@ -918,4 +923,15 @@ void MystScriptParser::o_quit(uint16 op, uint16 var, uint16 argc, uint16 *argv) _vm->quitGame(); } +void MystScriptParser::showMap() { + if (_vm->getCurCard() != getMap()) { + _savedMapCardId = _vm->getCurCard(); + _vm->changeToCard(getMap(), true); + } +} + +void MystScriptParser::o_exitMap(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + _vm->changeToCard(_savedMapCardId, true); +} + } // End of namespace Mohawk diff --git a/engines/mohawk/myst_scripts.h b/engines/mohawk/myst_scripts.h index e4f4cc3cfe9..18f5b27a6d3 100644 --- a/engines/mohawk/myst_scripts.h +++ b/engines/mohawk/myst_scripts.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_H @@ -79,6 +76,9 @@ public: virtual void toggleVar(uint16 var); virtual bool setVarValue(uint16 var, uint16 value); + virtual uint16 getMap() { return 0; } + void showMap(); + void animatedUpdate(uint16 argc, uint16 *argv, uint16 delay); DECLARE_OPCODE(unknown); @@ -122,6 +122,7 @@ public: DECLARE_OPCODE(o_saveMainCursor); DECLARE_OPCODE(o_restoreMainCursor); DECLARE_OPCODE(o_soundWaitStop); + DECLARE_OPCODE(o_exitMap); // Used in multiple stacks DECLARE_OPCODE(o_quit); @@ -147,6 +148,7 @@ protected: MystResource *_invokingResource; uint16 _savedCardId; + uint16 _savedMapCardId; uint16 _savedCursorId; int16 _tempVar; // Generic temp var used by the scripts uint32 _startTime; // Generic start time used by the scripts diff --git a/engines/mohawk/myst_stacks/channelwood.cpp b/engines/mohawk/myst_stacks/channelwood.cpp index cba2583a505..0dd69a673a7 100644 --- a/engines/mohawk/myst_stacks/channelwood.cpp +++ b/engines/mohawk/myst_stacks/channelwood.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" @@ -333,7 +330,7 @@ void Channelwood::o_drawImageChangeCardAndVolume(uint16 op, uint16 var, uint16 a _vm->_gfx->copyImageToScreen(imageId, Common::Rect(0, 0, 544, 333)); _vm->_system->updateScreen(); - _vm->_system->delayMillis(10); + _vm->changeToCard(cardId, true); if (argc == 3) { @@ -351,7 +348,6 @@ void Channelwood::o_waterTankValveOpen(uint16 op, uint16 var, uint16 argc, uint1 for (uint16 imageId = 3601; imageId >= 3595; imageId--) { _vm->_gfx->copyImageToScreen(imageId, rect); _vm->_system->updateScreen(); - _vm->_system->delayMillis(5); } pipeChangeValve(true, 0x80); @@ -666,7 +662,6 @@ void Channelwood::o_waterTankValveClose(uint16 op, uint16 var, uint16 argc, uint for (uint16 imageId = 3595; imageId <= 3601; imageId++) { _vm->_gfx->copyImageToScreen(imageId, rect); _vm->_system->updateScreen(); - _vm->_system->delayMillis(5); } pipeChangeValve(false, 0x80); diff --git a/engines/mohawk/myst_stacks/channelwood.h b/engines/mohawk/myst_stacks/channelwood.h index 5eeaa63e231..a3ea406003f 100644 --- a/engines/mohawk/myst_stacks/channelwood.h +++ b/engines/mohawk/myst_stacks/channelwood.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_CHANNELWOOD_H @@ -52,6 +49,8 @@ private: void toggleVar(uint16 var); bool setVarValue(uint16 var, uint16 value); + virtual uint16 getMap() { return 9932; } + DECLARE_OPCODE(o_bridgeToggle); DECLARE_OPCODE(o_pipeExtend); DECLARE_OPCODE(o_drawImageChangeCardAndVolume); diff --git a/engines/mohawk/myst_stacks/credits.cpp b/engines/mohawk/myst_stacks/credits.cpp index bb8397fd09f..ad593e35422 100644 --- a/engines/mohawk/myst_stacks/credits.cpp +++ b/engines/mohawk/myst_stacks/credits.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_stacks/credits.h b/engines/mohawk/myst_stacks/credits.h index 4f9eaa29443..a1f8b0a7d83 100644 --- a/engines/mohawk/myst_stacks/credits.h +++ b/engines/mohawk/myst_stacks/credits.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_CREDITS_H diff --git a/engines/mohawk/myst_stacks/demo.cpp b/engines/mohawk/myst_stacks/demo.cpp index a2dd148b220..53d946dd666 100644 --- a/engines/mohawk/myst_stacks/demo.cpp +++ b/engines/mohawk/myst_stacks/demo.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_stacks/demo.h b/engines/mohawk/myst_stacks/demo.h index 054dc7befe1..4f8d68759b9 100644 --- a/engines/mohawk/myst_stacks/demo.h +++ b/engines/mohawk/myst_stacks/demo.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_DEMO_H diff --git a/engines/mohawk/myst_stacks/dni.cpp b/engines/mohawk/myst_stacks/dni.cpp index e2a11eb94ff..cf28945c712 100644 --- a/engines/mohawk/myst_stacks/dni.cpp +++ b/engines/mohawk/myst_stacks/dni.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_stacks/dni.h b/engines/mohawk/myst_stacks/dni.h index b50f018d3e5..7f042870827 100644 --- a/engines/mohawk/myst_stacks/dni.h +++ b/engines/mohawk/myst_stacks/dni.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_DNI_H diff --git a/engines/mohawk/myst_stacks/intro.cpp b/engines/mohawk/myst_stacks/intro.cpp index 0d8f67a85be..7d3179fa247 100644 --- a/engines/mohawk/myst_stacks/intro.cpp +++ b/engines/mohawk/myst_stacks/intro.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_stacks/intro.h b/engines/mohawk/myst_stacks/intro.h index 0ecd9e6883a..9fe3920e534 100644 --- a/engines/mohawk/myst_stacks/intro.h +++ b/engines/mohawk/myst_stacks/intro.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_INTRO_H diff --git a/engines/mohawk/myst_stacks/makingof.cpp b/engines/mohawk/myst_stacks/makingof.cpp index e639092ed4b..b5ad647381e 100644 --- a/engines/mohawk/myst_stacks/makingof.cpp +++ b/engines/mohawk/myst_stacks/makingof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_stacks/makingof.h b/engines/mohawk/myst_stacks/makingof.h index 3033bb851ec..d4bc0fd9f2b 100644 --- a/engines/mohawk/myst_stacks/makingof.h +++ b/engines/mohawk/myst_stacks/makingof.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_MAKINGOF_H diff --git a/engines/mohawk/myst_stacks/mechanical.cpp b/engines/mohawk/myst_stacks/mechanical.cpp index c5c11026f5a..d6dd1b54076 100644 --- a/engines/mohawk/myst_stacks/mechanical.cpp +++ b/engines/mohawk/myst_stacks/mechanical.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" @@ -54,11 +51,26 @@ Mechanical::~Mechanical() { void Mechanical::setupOpcodes() { // "Stack-Specific" Opcodes OPCODE(100, o_throneEnablePassage); + OPCODE(101, o_birdCrankStart); + OPCODE(102, NOP); + OPCODE(103, o_birdCrankStop); OPCODE(104, o_snakeBoxTrigger); OPCODE(105, o_fortressStaircaseMovie); OPCODE(106, o_elevatorRotationStart); OPCODE(107, o_elevatorRotationMove); OPCODE(108, o_elevatorRotationStop); + OPCODE(109, o_fortressRotationSpeedStart); + OPCODE(110, o_fortressRotationSpeedMove); + OPCODE(111, o_fortressRotationSpeedStop); + OPCODE(112, o_fortressRotationBrakeStart); + OPCODE(113, o_fortressRotationBrakeMove); + OPCODE(114, o_fortressRotationBrakeStop); + OPCODE(115, o_fortressSimulationSpeedStart); + OPCODE(116, o_fortressSimulationSpeedMove); + OPCODE(117, o_fortressSimulationSpeedStop); + OPCODE(118, o_fortressSimulationBrakeStart); + OPCODE(119, o_fortressSimulationBrakeMove); + OPCODE(120, o_fortressSimulationBrakeStop); OPCODE(121, o_elevatorWindowMovie); OPCODE(122, o_elevatorGoMiddle); OPCODE(123, o_elevatorTopMovie); @@ -75,12 +87,12 @@ void Mechanical::setupOpcodes() { // "Init" Opcodes OPCODE(200, o_throne_init); OPCODE(201, o_fortressStaircase_init); - OPCODE(202, opcode_202); + OPCODE(202, o_bird_init); OPCODE(203, o_snakeBox_init); OPCODE(204, o_elevatorRotation_init); - OPCODE(205, opcode_205); - OPCODE(206, opcode_206); - OPCODE(209, opcode_209); + OPCODE(205, o_fortressRotation_init); + OPCODE(206, o_fortressSimulation_init); + OPCODE(209, o_fortressSimulationStartup_init); // "Exit" Opcodes OPCODE(300, NOP); @@ -89,15 +101,15 @@ void Mechanical::setupOpcodes() { #undef OPCODE void Mechanical::disablePersistentScripts() { - opcode_202_disable(); - opcode_205_disable(); - opcode_206_disable(); - opcode_209_disable(); + _fortressSimulationRunning = false; _elevatorGoingMiddle = false; + _birdSinging = false; + _fortressRotationRunning = false; } void Mechanical::runPersistentScripts() { - opcode_202_run(); + if (_birdSinging) + birdSing_run(); if (_elevatorRotationLeverMoving) elevatorRotation_run(); @@ -105,9 +117,11 @@ void Mechanical::runPersistentScripts() { if (_elevatorGoingMiddle) elevatorGoMiddle_run(); - opcode_205_run(); - opcode_206_run(); - opcode_209_run(); + if (_fortressRotationRunning) + fortressRotation_run(); + + if (_fortressSimulationRunning) + fortressSimulation_run(); } uint16 Mechanical::getVar(uint16 var) { @@ -245,6 +259,38 @@ void Mechanical::o_throneEnablePassage(uint16 op, uint16 var, uint16 argc, uint1 _vm->_resources[argv[0]]->setEnabled(getVar(var)); } +void Mechanical::o_birdCrankStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Mechanical bird crank start", op); + + MystResourceType11 *crank = static_cast(_invokingResource); + + uint16 crankSoundId = crank->getList2(0); + _vm->_sound->replaceSoundMyst(crankSoundId, Audio::Mixer::kMaxChannelVolume, true); + + _birdSingEndTime = 0; + _birdCrankStartTime = _vm->_system->getMillis(); + + MystResourceType6 *crankMovie = static_cast(crank->getSubResource(0)); + crankMovie->playMovie(); +} + +void Mechanical::o_birdCrankStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Mechanical bird crank stop", op); + + MystResourceType11 *crank = static_cast(_invokingResource); + + MystResourceType6 *crankMovie = static_cast(crank->getSubResource(0)); + crankMovie->pauseMovie(true); + + uint16 crankSoundId = crank->getList2(1); + _vm->_sound->replaceSoundMyst(crankSoundId); + + _birdSingEndTime = 2 * _vm->_system->getMillis() - _birdCrankStartTime; + _birdSinging = true; + + _bird->playMovie(); +} + void Mechanical::o_snakeBoxTrigger(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Trigger Playing Of Snake Movie", op); @@ -346,6 +392,164 @@ void Mechanical::o_elevatorRotationStop(uint16 op, uint16 var, uint16 argc, uint _vm->checkCursorHints(); } +void Mechanical::o_fortressRotationSpeedStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation speed lever start", op); + + _vm->_cursor->setCursor(700); + + MystResourceType12 *lever = static_cast(_invokingResource); + lever->drawFrame(0); +} + +void Mechanical::o_fortressRotationSpeedMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation speed lever move", op); + + const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); + MystResourceType12 *lever = static_cast(_invokingResource); + + // Make the handle follow the mouse + int16 maxStep = lever->getNumFrames() - 1; + Common::Rect rect = lever->getRect(); + int16 step = ((rect.top + 65 - mouse.y) * lever->getNumFrames()) / 65; + step = CLIP(step, 0, maxStep); + + _fortressRotationSpeed = step; + + // Draw current frame + lever->drawFrame(step); +} + +void Mechanical::o_fortressRotationSpeedStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation speed lever stop", op); + + MystResourceType12 *lever = static_cast(_invokingResource); + + // Release lever + for (int i = _fortressRotationSpeed; i >= 0; i--) { + lever->drawFrame(i); + _vm->_system->delayMillis(10); + } + + _fortressRotationSpeed = 0; + + _vm->checkCursorHints(); +} + +void Mechanical::o_fortressRotationBrakeStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation brake lever start", op); + + _vm->_cursor->setCursor(700); + + MystResourceType12 *lever = static_cast(_invokingResource); + lever->drawFrame(_fortressRotationBrake); +} + +void Mechanical::o_fortressRotationBrakeMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation brake lever move", op); + + const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); + MystResourceType12 *lever = static_cast(_invokingResource); + + // Make the handle follow the mouse + int16 maxStep = lever->getNumFrames() - 1; + Common::Rect rect = lever->getRect(); + int16 step = ((rect.top + 65 - mouse.y) * lever->getNumFrames()) / 65; + step = CLIP(step, 0, maxStep); + + _fortressRotationBrake = step; + + // Draw current frame + lever->drawFrame(step); +} + +void Mechanical::o_fortressRotationBrakeStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation brake lever stop", op); + + MystResourceType12 *lever = static_cast(_invokingResource); + lever->drawFrame(_fortressRotationBrake); + + _vm->checkCursorHints(); +} + +void Mechanical::o_fortressSimulationSpeedStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation simulator speed lever start", op); + + _vm->_cursor->setCursor(700); + + MystResourceType12 *lever = static_cast(_invokingResource); + lever->drawFrame(0); +} + +void Mechanical::o_fortressSimulationSpeedMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation simulator speed lever move", op); + + const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); + MystResourceType12 *lever = static_cast(_invokingResource); + + // Make the handle follow the mouse + int16 maxStep = lever->getNumFrames() - 1; + Common::Rect rect = lever->getRect(); + int16 step = ((rect.bottom - mouse.y) * lever->getNumFrames()) / rect.height(); + step = CLIP(step, 0, maxStep); + + _fortressSimulationSpeed = step; + + // Draw current frame + lever->drawFrame(step); +} + +void Mechanical::o_fortressSimulationSpeedStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation simulator speed lever stop", op); + + MystResourceType12 *lever = static_cast(_invokingResource); + + // Release lever + for (int i = _fortressSimulationSpeed; i >= 0; i--) { + lever->drawFrame(i); + _vm->_system->delayMillis(10); + } + + _fortressSimulationSpeed = 0; + + _vm->checkCursorHints(); +} + +void Mechanical::o_fortressSimulationBrakeStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation simulator brake lever start", op); + + _vm->_cursor->setCursor(700); + + MystResourceType12 *lever = static_cast(_invokingResource); + lever->drawFrame(_fortressSimulationBrake); +} + +void Mechanical::o_fortressSimulationBrakeMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation simulator brake lever move", op); + + const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); + MystResourceType12 *lever = static_cast(_invokingResource); + + // Make the handle follow the mouse + int16 maxStep = lever->getNumFrames() - 1; + Common::Rect rect = lever->getRect(); + int16 step = ((rect.bottom - mouse.y) * lever->getNumFrames()) / rect.height(); + step = CLIP(step, 0, maxStep); + + _fortressSimulationBrake = step; + + // Draw current frame + lever->drawFrame(step); +} + +void Mechanical::o_fortressSimulationBrakeStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation simulator brake lever stop", op); + + MystResourceType12 *lever = static_cast(_invokingResource); + lever->drawFrame(_fortressSimulationBrake); + + _vm->checkCursorHints(); +} + void Mechanical::o_elevatorWindowMovie(uint16 op, uint16 var, uint16 argc, uint16 *argv) { uint16 startTime = argv[0]; uint16 endTime = argv[1]; @@ -515,25 +719,21 @@ void Mechanical::o_fortressStaircase_init(uint16 op, uint16 var, uint16 argc, ui _vm->_resources[argv[2]]->setEnabled(_state.staircaseState); } -static struct { - bool enabled; -} g_opcode202Parameters; - -void Mechanical::opcode_202_run() { +void Mechanical::birdSing_run() { // Used for Card 6220 (Sirrus' Mechanical Bird) - // TODO: Fill in Function + uint32 time = _vm->_system->getMillis(); + if (_birdSingEndTime < time) { + _bird->pauseMovie(true); + _birdSinging = false; + } } -void Mechanical::opcode_202_disable() { - g_opcode202Parameters.enabled = false; -} +void Mechanical::o_bird_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Mechanical bird init", op); -void Mechanical::opcode_202(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - // Used for Card 6220 (Sirrus' Mechanical Bird) - if (argc == 0) - g_opcode202Parameters.enabled = true; - else - unknown(op, var, argc, argv); + _birdSinging = false; + _birdSingEndTime = 0; + _bird = static_cast(_invokingResource); } void Mechanical::o_snakeBox_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { @@ -567,101 +767,53 @@ void Mechanical::o_elevatorRotation_init(uint16 op, uint16 var, uint16 argc, uin _elevatorRotationLeverMoving = false; } -static struct { - uint16 soundIdPosition[4]; - - bool enabled; -} g_opcode205Parameters; - -void Mechanical::opcode_205_run() { +void Mechanical::fortressRotation_run() { // Used for Card 6156 (Fortress Rotation Controls) // TODO: Fill in function... - // g_opcode205Parameters.soundIdPosition[4] } -void Mechanical::opcode_205_disable() { - g_opcode205Parameters.enabled = false; +void Mechanical::o_fortressRotation_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Fortress rotation init", op); + + _fortressRotationGears = static_cast(_invokingResource); + + _fortressRotationSounds[0] = argv[0]; + _fortressRotationSounds[1] = argv[1]; + _fortressRotationSounds[2] = argv[2]; + _fortressRotationSounds[3] = argv[3]; + + _fortressRotationBrake = 0; + + _fortressRotationRunning = true; } -void Mechanical::opcode_205(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - varUnusedCheck(op, var); - - // Used for Card 6156 (Fortress Rotation Controls) - - if (argc == 4) { - g_opcode205Parameters.soundIdPosition[0] = argv[0]; - g_opcode205Parameters.soundIdPosition[1] = argv[1]; - g_opcode205Parameters.soundIdPosition[2] = argv[2]; - g_opcode205Parameters.soundIdPosition[3] = argv[3]; - - g_opcode205Parameters.enabled = true; - } else - unknown(op, var, argc, argv); -} - -static struct { - uint16 soundIdStart[2]; - uint16 soundIdPosition[4]; - - bool enabled; -} g_opcode206Parameters; - -void Mechanical::opcode_206_run() { - if (g_opcode206Parameters.enabled) { - // Used for Card 6044 (Fortress Rotation Simulator) - - // g_opcode206Parameters.soundIdStart[2] - // g_opcode206Parameters.soundIdPosition[4] - - // TODO: Fill in function... - } -} - -void Mechanical::opcode_206_disable() { - g_opcode206Parameters.enabled = false; -} - -void Mechanical::opcode_206(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - varUnusedCheck(op, var); - +void Mechanical::fortressSimulation_run() { // Used for Card 6044 (Fortress Rotation Simulator) - if (argc == 6) { - g_opcode206Parameters.soundIdStart[0] = argv[0]; - g_opcode206Parameters.soundIdStart[1] = argv[1]; - g_opcode206Parameters.soundIdPosition[0] = argv[2]; - g_opcode206Parameters.soundIdPosition[1] = argv[3]; - g_opcode206Parameters.soundIdPosition[2] = argv[4]; - g_opcode206Parameters.soundIdPosition[3] = argv[5]; - - g_opcode206Parameters.enabled = true; - } else - unknown(op, var, argc, argv); + // TODO: Fill in function... } +void Mechanical::o_fortressSimulation_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Fortress rotation simulator init", op); -static struct { - bool enabled; -} g_opcode209Parameters; + _fortressSimulationHolo = static_cast(_invokingResource); -void Mechanical::opcode_209_run() { - // Used for Card 6044 (Fortress Rotation Simulator) + _fortressSimulationStartSound1 = argv[0]; + _fortressSimulationStartSound2 = argv[1]; - // TODO: Implement Function For Secret Panel State as - // per Opcode 200 function (Mechanical) + _fortressRotationSounds[0] = argv[2]; + _fortressRotationSounds[1] = argv[3]; + _fortressRotationSounds[2] = argv[4]; + _fortressRotationSounds[3] = argv[5]; + + _fortressSimulationBrake = 0; + + _fortressSimulationRunning = true; } -void Mechanical::opcode_209_disable() { - g_opcode209Parameters.enabled = false; -} +void Mechanical::o_fortressSimulationStartup_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Fortress rotation simulator startup init", op); -void Mechanical::opcode_209(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - varUnusedCheck(op, var); - - // Used for Card 6044 (Fortress Rotation Simulator) - if (argc == 0) - g_opcode209Parameters.enabled = true; - else - unknown(op, var, argc, argv); + _fortressSimulationStartup = static_cast(_invokingResource); } } // End of namespace MystStacks diff --git a/engines/mohawk/myst_stacks/mechanical.h b/engines/mohawk/myst_stacks/mechanical.h index 6a0aa30f5cc..3bd7f2d71b6 100644 --- a/engines/mohawk/myst_stacks/mechanical.h +++ b/engines/mohawk/myst_stacks/mechanical.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_MECHANICAL_H @@ -52,23 +49,34 @@ private: void toggleVar(uint16 var); bool setVarValue(uint16 var, uint16 value); - void opcode_202_run(); - void opcode_202_disable(); + virtual uint16 getMap() { return 9931; } + + void birdSing_run(); void elevatorRotation_run(); void elevatorGoMiddle_run(); - void opcode_205_run(); - void opcode_205_disable(); - void opcode_206_run(); - void opcode_206_disable(); - void opcode_209_run(); - void opcode_209_disable(); + void fortressRotation_run(); + void fortressSimulation_run(); DECLARE_OPCODE(o_throneEnablePassage); + DECLARE_OPCODE(o_birdCrankStart); + DECLARE_OPCODE(o_birdCrankStop); DECLARE_OPCODE(o_snakeBoxTrigger); DECLARE_OPCODE(o_fortressStaircaseMovie); DECLARE_OPCODE(o_elevatorRotationStart); DECLARE_OPCODE(o_elevatorRotationMove); DECLARE_OPCODE(o_elevatorRotationStop); + DECLARE_OPCODE(o_fortressRotationSpeedStart); + DECLARE_OPCODE(o_fortressRotationSpeedMove); + DECLARE_OPCODE(o_fortressRotationSpeedStop); + DECLARE_OPCODE(o_fortressRotationBrakeStart); + DECLARE_OPCODE(o_fortressRotationBrakeMove); + DECLARE_OPCODE(o_fortressRotationBrakeStop); + DECLARE_OPCODE(o_fortressSimulationSpeedStart); + DECLARE_OPCODE(o_fortressSimulationSpeedMove); + DECLARE_OPCODE(o_fortressSimulationSpeedStop); + DECLARE_OPCODE(o_fortressSimulationBrakeStart); + DECLARE_OPCODE(o_fortressSimulationBrakeMove); + DECLARE_OPCODE(o_fortressSimulationBrakeStop); DECLARE_OPCODE(o_elevatorWindowMovie); DECLARE_OPCODE(o_elevatorGoMiddle); DECLARE_OPCODE(o_elevatorTopMovie); @@ -84,18 +92,31 @@ private: DECLARE_OPCODE(o_throne_init); DECLARE_OPCODE(o_fortressStaircase_init); - DECLARE_OPCODE(opcode_202); + DECLARE_OPCODE(o_bird_init); DECLARE_OPCODE(o_snakeBox_init); DECLARE_OPCODE(o_elevatorRotation_init); - DECLARE_OPCODE(opcode_205); - DECLARE_OPCODE(opcode_206); - DECLARE_OPCODE(opcode_209); + DECLARE_OPCODE(o_fortressRotation_init); + DECLARE_OPCODE(o_fortressSimulation_init); + DECLARE_OPCODE(o_fortressSimulationStartup_init); MystGameState::Mechanical &_state; bool _mystStaircaseState; // 76 + bool _fortressRotationRunning; + uint16 _fortressRotationSpeed; // 78 + uint16 _fortressRotationBrake; // 80 uint16 _fortressPosition; // 82 + uint16 _fortressRotationSounds[4]; // 86 to 92 + MystResourceType6 *_fortressRotationGears; // 172 + + bool _fortressSimulationRunning; + uint16 _fortressSimulationSpeed; // 96 + uint16 _fortressSimulationBrake; // 98 + uint16 _fortressSimulationStartSound1; // 102 + uint16 _fortressSimulationStartSound2; // 100 + MystResourceType6 *_fortressSimulationHolo; // 160 + MystResourceType6 *_fortressSimulationStartup; // 164 uint16 _elevatorGoingDown; // 112 @@ -113,6 +134,12 @@ private: uint16 _crystalLit; // 130 + bool _birdSinging; // 144 + uint32 _birdCrankStartTime; // 136 + uint32 _birdSingEndTime; // 140 + MystResourceType6 *_bird; // 152 + + MystResourceType6 *_snakeBox; // 156 }; diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp index 2b8ef944427..70abf0ccd37 100644 --- a/engines/mohawk/myst_stacks/myst.cpp +++ b/engines/mohawk/myst_stacks/myst.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" @@ -862,7 +859,6 @@ void Myst::o_fireplaceToggleButton(uint16 op, uint16 var, uint16 argc, uint16 *a for (uint i = 4795; i >= 4779; i--) { _vm->_gfx->copyImageToScreen(i, _invokingResource->getRect()); _vm->_system->updateScreen(); - _vm->_system->delayMillis(1); } _fireplaceLines[var - 17] &= ~bitmask; } else { @@ -870,7 +866,6 @@ void Myst::o_fireplaceToggleButton(uint16 op, uint16 var, uint16 argc, uint16 *a for (uint i = 4779; i <= 4795; i++) { _vm->_gfx->copyImageToScreen(i, _invokingResource->getRect()); _vm->_system->updateScreen(); - _vm->_system->delayMillis(1); } _fireplaceLines[var - 17] |= bitmask; } @@ -2844,11 +2839,17 @@ void Myst::clockGearForwardOneStep(uint16 gear) { } void Myst::clockWeightDownOneStep() { + // The Myst ME version of this video is encoded faster than the original + // The weight goes on the floor one step too early. Original ME engine also has this behavior. + bool updateVideo = !(_vm->getFeatures() & GF_ME) || _clockWeightPosition < (2214 - 246); + // Set video bounds - _clockWeightVideo = _vm->_video->playMovie(_vm->wrapMovieFilename("cl1wlfch", kMystStack) , 124, 0); - _vm->_video->setVideoBounds(_clockWeightVideo, - Audio::Timestamp(0, _clockWeightPosition, 600), - Audio::Timestamp(0, _clockWeightPosition + 246, 600)); + if (updateVideo) { + _clockWeightVideo = _vm->_video->playMovie(_vm->wrapMovieFilename("cl1wlfch", kMystStack) , 124, 0); + _vm->_video->setVideoBounds(_clockWeightVideo, + Audio::Timestamp(0, _clockWeightPosition, 600), + Audio::Timestamp(0, _clockWeightPosition + 246, 600)); + } // Increment value by one step _clockWeightPosition += 246; diff --git a/engines/mohawk/myst_stacks/myst.h b/engines/mohawk/myst_stacks/myst.h index 51dffd0abe1..9510d371d75 100644 --- a/engines/mohawk/myst_stacks/myst.h +++ b/engines/mohawk/myst_stacks/myst.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_MYST_H @@ -52,6 +49,8 @@ private: void toggleVar(uint16 var); bool setVarValue(uint16 var, uint16 value); + virtual uint16 getMap() { return 9934; } + void towerRotationMap_run(); void libraryBookcaseTransform_run(); void generatorControlRoom_run(); diff --git a/engines/mohawk/myst_stacks/preview.cpp b/engines/mohawk/myst_stacks/preview.cpp index fddf6290fb1..37b749f1005 100644 --- a/engines/mohawk/myst_stacks/preview.cpp +++ b/engines/mohawk/myst_stacks/preview.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_stacks/preview.h b/engines/mohawk/myst_stacks/preview.h index 870e4b92723..7e4e418eef6 100644 --- a/engines/mohawk/myst_stacks/preview.h +++ b/engines/mohawk/myst_stacks/preview.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_PREVIEW_H diff --git a/engines/mohawk/myst_stacks/selenitic.cpp b/engines/mohawk/myst_stacks/selenitic.cpp index c670cb6a483..1473742259f 100644 --- a/engines/mohawk/myst_stacks/selenitic.cpp +++ b/engines/mohawk/myst_stacks/selenitic.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" diff --git a/engines/mohawk/myst_stacks/selenitic.h b/engines/mohawk/myst_stacks/selenitic.h index 4ec92b98696..d314c4d8107 100644 --- a/engines/mohawk/myst_stacks/selenitic.h +++ b/engines/mohawk/myst_stacks/selenitic.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_SELENITIC_H @@ -53,6 +50,8 @@ private: void toggleVar(uint16 var); bool setVarValue(uint16 var, uint16 value); + virtual uint16 getMap() { return 9930; } + DECLARE_OPCODE(o_mazeRunnerMove); DECLARE_OPCODE(o_mazeRunnerSoundRepeat); DECLARE_OPCODE(o_soundReceiverSigma); diff --git a/engines/mohawk/myst_stacks/slides.cpp b/engines/mohawk/myst_stacks/slides.cpp index 4057edd9c90..72b299ee6d5 100644 --- a/engines/mohawk/myst_stacks/slides.cpp +++ b/engines/mohawk/myst_stacks/slides.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_stacks/slides.h b/engines/mohawk/myst_stacks/slides.h index 1e0504a6653..8bc61d0e24e 100644 --- a/engines/mohawk/myst_stacks/slides.h +++ b/engines/mohawk/myst_stacks/slides.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_SLIDES_H diff --git a/engines/mohawk/myst_stacks/stoneship.cpp b/engines/mohawk/myst_stacks/stoneship.cpp index 07701c273eb..e0c374a9268 100644 --- a/engines/mohawk/myst_stacks/stoneship.cpp +++ b/engines/mohawk/myst_stacks/stoneship.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" diff --git a/engines/mohawk/myst_stacks/stoneship.h b/engines/mohawk/myst_stacks/stoneship.h index 091fdcd1695..4125412b4d2 100644 --- a/engines/mohawk/myst_stacks/stoneship.h +++ b/engines/mohawk/myst_stacks/stoneship.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_STONESHIP_H @@ -52,6 +49,8 @@ private: void toggleVar(uint16 var); bool setVarValue(uint16 var, uint16 value); + virtual uint16 getMap() { return 9933; } + DECLARE_OPCODE(o_pumpTurnOff); DECLARE_OPCODE(o_brotherDoorOpen); DECLARE_OPCODE(o_cabinBookMovie); diff --git a/engines/mohawk/myst_state.cpp b/engines/mohawk/myst_state.cpp index de71dcf382e..bab4b8dd519 100644 --- a/engines/mohawk/myst_state.cpp +++ b/engines/mohawk/myst_state.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" @@ -103,6 +100,9 @@ bool MystGameState::load(const Common::String &filename) { syncGameState(s, size == 664); delete loadFile; + // Switch us back to the intro stack, to the linking book + _vm->changeToStack(kIntroStack, 5, 0, 0); + // Set our default cursor if (_globals.heldPage == 0 || _globals.heldPage > 13) _vm->setMainCursor(kDefaultMystCursor); @@ -113,9 +113,6 @@ bool MystGameState::load(const Common::String &filename) { else // if (globals.heldPage == 13) _vm->setMainCursor(kWhitePageCursor); - // Switch us back to the intro stack, to the linking book - _vm->changeToStack(kIntroStack, 5, 0, 0); - return true; } diff --git a/engines/mohawk/myst_state.h b/engines/mohawk/myst_state.h index 074c3e5f102..c7a6c0b4ac2 100644 --- a/engines/mohawk/myst_state.h +++ b/engines/mohawk/myst_state.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SAVELOAD_H diff --git a/engines/mohawk/resource.cpp b/engines/mohawk/resource.cpp index 62250b75f24..3a95b831991 100644 --- a/engines/mohawk/resource.cpp +++ b/engines/mohawk/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/resource.h" diff --git a/engines/mohawk/resource.h b/engines/mohawk/resource.h index 07c727951ca..cabce04e384 100644 --- a/engines/mohawk/resource.h +++ b/engines/mohawk/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/engines/mohawk/resource_cache.cpp b/engines/mohawk/resource_cache.cpp index 75f608f5fd1..e73d8c43d36 100644 --- a/engines/mohawk/resource_cache.cpp +++ b/engines/mohawk/resource_cache.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/mohawk/resource_cache.h b/engines/mohawk/resource_cache.h index 32e345cf4bc..b7eac9ebd75 100644 --- a/engines/mohawk/resource_cache.h +++ b/engines/mohawk/resource_cache.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef RESOURCE_CACHE_H diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp index 3d496d0f38e..f407e650f61 100644 --- a/engines/mohawk/riven.cpp +++ b/engines/mohawk/riven.cpp @@ -18,16 +18,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/keyboard.h" #include "common/translation.h" +#include "common/system.h" #include "mohawk/cursors.h" #include "mohawk/graphics.h" @@ -121,8 +118,7 @@ Common::Error MohawkEngine_Riven::run() { _optionsDialog = new RivenOptionsDialog(this); _scriptMan = new RivenScriptManager(this); - _rnd = new Common::RandomSource(); - g_eventRec.registerRandomSource(*_rnd, "riven"); + _rnd = new Common::RandomSource("riven"); // Create the cursor manager if (Common::File::exists("rivendmo.exe")) diff --git a/engines/mohawk/riven.h b/engines/mohawk/riven.h index 3aba5643db5..e01e03895cc 100644 --- a/engines/mohawk/riven.h +++ b/engines/mohawk/riven.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_RIVEN_H diff --git a/engines/mohawk/riven_external.cpp b/engines/mohawk/riven_external.cpp index dc0d66f19bd..8ad05ded131 100644 --- a/engines/mohawk/riven_external.cpp +++ b/engines/mohawk/riven_external.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" diff --git a/engines/mohawk/riven_external.h b/engines/mohawk/riven_external.h index 034cd662f63..5f5d0cb0b2b 100644 --- a/engines/mohawk/riven_external.h +++ b/engines/mohawk/riven_external.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef RIVEN_EXTERNAL_H diff --git a/engines/mohawk/riven_saveload.cpp b/engines/mohawk/riven_saveload.cpp index 35ce7aad84a..35d82d4aa0e 100644 --- a/engines/mohawk/riven_saveload.cpp +++ b/engines/mohawk/riven_saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/resource.h" diff --git a/engines/mohawk/riven_saveload.h b/engines/mohawk/riven_saveload.h index fbd9f7cb369..c1b3fc639eb 100644 --- a/engines/mohawk/riven_saveload.h +++ b/engines/mohawk/riven_saveload.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_SAVELOAD_H diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp index b8f86f993a7..b3d5369a84e 100644 --- a/engines/mohawk/riven_scripts.cpp +++ b/engines/mohawk/riven_scripts.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" diff --git a/engines/mohawk/riven_scripts.h b/engines/mohawk/riven_scripts.h index 2ac805c366b..75d4592e55d 100644 --- a/engines/mohawk/riven_scripts.h +++ b/engines/mohawk/riven_scripts.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef RIVEN_SCRIPTS_H diff --git a/engines/mohawk/riven_vars.cpp b/engines/mohawk/riven_vars.cpp index 7f06a67a1d1..946e2e04964 100644 --- a/engines/mohawk/riven_vars.cpp +++ b/engines/mohawk/riven_vars.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/str.h" diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp index fba87808d2a..6144c89e21f 100644 --- a/engines/mohawk/sound.cpp +++ b/engines/mohawk/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/sound.h" @@ -619,9 +616,16 @@ Audio::SoundHandle *Sound::replaceBackgroundMyst(uint16 id, uint16 volume) { Common::String name = _vm->getResourceName(ID_MSND, convertMystID(id)); + // Only the first eight characters need to be the same to have a match + Common::String prefix; + if (name.size() >= 8) + prefix = Common::String(name.c_str(), name.c_str() + 8); + else + prefix = name; + // Check if sound is already playing if (_mystBackgroundSound.type == kUsedHandle && _vm->_mixer->isSoundHandleActive(_mystBackgroundSound.handle) - && name.equals(_vm->getResourceName(ID_MSND, convertMystID(_mystBackgroundSound.id)))) + && _vm->getResourceName(ID_MSND, convertMystID(_mystBackgroundSound.id)).hasPrefix(prefix)) return &_mystBackgroundSound.handle; // Stop old background sound diff --git a/engines/mohawk/sound.h b/engines/mohawk/sound.h index 702c6f61f36..593f2fcd0bc 100644 --- a/engines/mohawk/sound.h +++ b/engines/mohawk/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_SOUND_H diff --git a/engines/mohawk/video.cpp b/engines/mohawk/video.cpp index 8f57d61cc40..0a74d058c96 100644 --- a/engines/mohawk/video.cpp +++ b/engines/mohawk/video.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/mohawk.h" diff --git a/engines/mohawk/video.h b/engines/mohawk/video.h index e65629a1ec3..efa81edfbdc 100644 --- a/engines/mohawk/video.h +++ b/engines/mohawk/video.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_VIDEO_H diff --git a/engines/mohawk/view.cpp b/engines/mohawk/view.cpp index e5a44122ea3..36e8f8466ea 100644 --- a/engines/mohawk/view.cpp +++ b/engines/mohawk/view.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/view.h" diff --git a/engines/mohawk/view.h b/engines/mohawk/view.h index 14a47eebe42..06ffe605a30 100644 --- a/engines/mohawk/view.h +++ b/engines/mohawk/view.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_VIEW_H diff --git a/engines/parallaction/balloons.cpp b/engines/parallaction/balloons.cpp index 2cf6eebf2a4..f74eef18e17 100644 --- a/engines/parallaction/balloons.cpp +++ b/engines/parallaction/balloons.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "parallaction/graphics.h" diff --git a/engines/parallaction/callables_br.cpp b/engines/parallaction/callables_br.cpp index 0bc6f6762cd..ac5ff885604 100644 --- a/engines/parallaction/callables_br.cpp +++ b/engines/parallaction/callables_br.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "parallaction/parallaction.h" diff --git a/engines/parallaction/callables_ns.cpp b/engines/parallaction/callables_ns.cpp index cfe6ad8954f..77f54fcc98a 100644 --- a/engines/parallaction/callables_ns.cpp +++ b/engines/parallaction/callables_ns.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/parallaction/debug.cpp b/engines/parallaction/debug.cpp index bebbab968be..72f26cb6b9e 100644 --- a/engines/parallaction/debug.cpp +++ b/engines/parallaction/debug.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp index 8e3c2cbeb86..c3719bcd513 100644 --- a/engines/parallaction/detection.cpp +++ b/engines/parallaction/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -253,7 +250,7 @@ public: ParallactionMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Parallaction engine"; + return "Parallaction"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp index 944d9f4b55c..880d41a8a3e 100644 --- a/engines/parallaction/dialogue.cpp +++ b/engines/parallaction/dialogue.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/events.h" diff --git a/engines/parallaction/disk.cpp b/engines/parallaction/disk.cpp index d996b72e900..61172d08969 100644 --- a/engines/parallaction/disk.cpp +++ b/engines/parallaction/disk.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/iff_container.h" diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h index 9af189af686..d1171c31796 100644 --- a/engines/parallaction/disk.h +++ b/engines/parallaction/disk.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PARALLACTION_DISK_H diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp index cea4091ee91..f9e368ab390 100644 --- a/engines/parallaction/disk_br.cpp +++ b/engines/parallaction/disk_br.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "graphics/iff.h" diff --git a/engines/parallaction/disk_ns.cpp b/engines/parallaction/disk_ns.cpp index e695fa87981..05ea60f5102 100644 --- a/engines/parallaction/disk_ns.cpp +++ b/engines/parallaction/disk_ns.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/engines/parallaction/exec.cpp b/engines/parallaction/exec.cpp index 434c4f6ae65..8594d02641e 100644 --- a/engines/parallaction/exec.cpp +++ b/engines/parallaction/exec.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "parallaction/exec.h" diff --git a/engines/parallaction/exec.h b/engines/parallaction/exec.h index df642e0feda..4ca39475149 100644 --- a/engines/parallaction/exec.h +++ b/engines/parallaction/exec.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/parallaction/exec_br.cpp b/engines/parallaction/exec_br.cpp index c879745f65b..0ec1675c48d 100644 --- a/engines/parallaction/exec_br.cpp +++ b/engines/parallaction/exec_br.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "parallaction/exec.h" diff --git a/engines/parallaction/exec_ns.cpp b/engines/parallaction/exec_ns.cpp index ee357576d28..d8fbdea971a 100644 --- a/engines/parallaction/exec_ns.cpp +++ b/engines/parallaction/exec_ns.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "parallaction/exec.h" diff --git a/engines/parallaction/font.cpp b/engines/parallaction/font.cpp index a459e6a600e..cc7f320e1c4 100644 --- a/engines/parallaction/font.cpp +++ b/engines/parallaction/font.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/parallaction/gfxbase.cpp b/engines/parallaction/gfxbase.cpp index ca99624ecd3..24544f46ddb 100644 --- a/engines/parallaction/gfxbase.cpp +++ b/engines/parallaction/gfxbase.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index d33e733677c..cf0cf133333 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -19,9 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h index d6732e6fe42..2f86f3693b5 100644 --- a/engines/parallaction/graphics.h +++ b/engines/parallaction/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PARALLACTION_GRAPHICS_H diff --git a/engines/parallaction/gui.cpp b/engines/parallaction/gui.cpp index db70ebb4329..aa9c29ac575 100644 --- a/engines/parallaction/gui.cpp +++ b/engines/parallaction/gui.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/parallaction/gui.h b/engines/parallaction/gui.h index dc6d1bc71b0..95c5653220b 100644 --- a/engines/parallaction/gui.h +++ b/engines/parallaction/gui.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PARALLACTION_GUI_H diff --git a/engines/parallaction/gui_br.cpp b/engines/parallaction/gui_br.cpp index 41e30824645..c520ad4f253 100644 --- a/engines/parallaction/gui_br.cpp +++ b/engines/parallaction/gui_br.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/parallaction/gui_ns.cpp b/engines/parallaction/gui_ns.cpp index 6b863cc8080..ef1a8a6e7e9 100644 --- a/engines/parallaction/gui_ns.cpp +++ b/engines/parallaction/gui_ns.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/parallaction/input.cpp b/engines/parallaction/input.cpp index 3a47b14deb1..453bf9849db 100644 --- a/engines/parallaction/input.cpp +++ b/engines/parallaction/input.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/events.h" diff --git a/engines/parallaction/input.h b/engines/parallaction/input.h index 77adf7e74e6..a815469ec3a 100644 --- a/engines/parallaction/input.h +++ b/engines/parallaction/input.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PARALLACTION_INPUT_H diff --git a/engines/parallaction/inventory.cpp b/engines/parallaction/inventory.cpp index 2412cc64451..8fd9f56802c 100644 --- a/engines/parallaction/inventory.cpp +++ b/engines/parallaction/inventory.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "parallaction/input.h" diff --git a/engines/parallaction/inventory.h b/engines/parallaction/inventory.h index e4bb9356727..91c06d1e93f 100644 --- a/engines/parallaction/inventory.h +++ b/engines/parallaction/inventory.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PARALLACTION_INVENTORY_H diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp index e1306dc9567..3750602076c 100644 --- a/engines/parallaction/objects.cpp +++ b/engines/parallaction/objects.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/parallaction/objects.h b/engines/parallaction/objects.h index 5260dcbfe8f..387e7af0887 100644 --- a/engines/parallaction/objects.h +++ b/engines/parallaction/objects.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PARALLACTION_ZONE_H diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 516d465671a..9bbc7d0c576 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -18,13 +18,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug-channels.h" -#include "common/EventRecorder.h" #include "common/system.h" #include "common/textconsole.h" @@ -48,7 +44,7 @@ uint32 _globalFlags = 0; Parallaction::Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc), _location(getGameType()), - _dialogueMan(0) { + _dialogueMan(0), _rnd("parallaction") { // Setup mixer syncSoundSettings(); @@ -63,8 +59,6 @@ Parallaction::Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gam DebugMan.addDebugChannel(kDebugAudio, "audio", "Audio debug level"); DebugMan.addDebugChannel(kDebugMenu, "menu", "Menu debug level"); DebugMan.addDebugChannel(kDebugInventory, "inventory", "Inventory debug level"); - - g_eventRec.registerRandomSource(_rnd, "parallaction"); } Parallaction::~Parallaction() { diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index b0b1145d2e6..5554eff3c54 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PARALLACTION_H diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index ca344792cf4..44a8899304a 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index ffc0412b1d1..64cf1b437da 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/parallaction/parser.cpp b/engines/parallaction/parser.cpp index a7b926e4853..5d61c2988c2 100644 --- a/engines/parallaction/parser.cpp +++ b/engines/parallaction/parser.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/parallaction/parser.h b/engines/parallaction/parser.h index 812cf6f7c36..1cf8e2f7ff5 100644 --- a/engines/parallaction/parser.h +++ b/engines/parallaction/parser.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PARALLACTION_PARSER_H diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp index f8818def9a7..e4be53022ed 100644 --- a/engines/parallaction/parser_br.cpp +++ b/engines/parallaction/parser_br.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp index 6c9afe3d857..69763affc8a 100644 --- a/engines/parallaction/parser_ns.cpp +++ b/engines/parallaction/parser_ns.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/parallaction/saveload.cpp b/engines/parallaction/saveload.cpp index 4c77aa3e021..673c6134857 100644 --- a/engines/parallaction/saveload.cpp +++ b/engines/parallaction/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/savefile.h" diff --git a/engines/parallaction/saveload.h b/engines/parallaction/saveload.h index a8f1697a9de..3976ee12906 100644 --- a/engines/parallaction/saveload.h +++ b/engines/parallaction/saveload.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PARALLACTION_SAVELOAD_H diff --git a/engines/parallaction/sound.h b/engines/parallaction/sound.h index 455189d1fca..baca5a7213e 100644 --- a/engines/parallaction/sound.h +++ b/engines/parallaction/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PARALLACTION_MUSIC_H diff --git a/engines/parallaction/sound_br.cpp b/engines/parallaction/sound_br.cpp index abfaa4bf5d0..16ffd24a82f 100644 --- a/engines/parallaction/sound_br.cpp +++ b/engines/parallaction/sound_br.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/stream.h" diff --git a/engines/parallaction/sound_ns.cpp b/engines/parallaction/sound_ns.cpp index 5123695ebc9..917d310738c 100644 --- a/engines/parallaction/sound_ns.cpp +++ b/engines/parallaction/sound_ns.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/parallaction/staticres.cpp b/engines/parallaction/staticres.cpp index 84db3af9a48..73e78cae3cb 100644 --- a/engines/parallaction/staticres.cpp +++ b/engines/parallaction/staticres.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp index 3084707ba82..21ee5ee5d97 100644 --- a/engines/parallaction/walk.cpp +++ b/engines/parallaction/walk.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "parallaction/exec.h" diff --git a/engines/parallaction/walk.h b/engines/parallaction/walk.h index 655c4761069..6796991f9db 100644 --- a/engines/parallaction/walk.h +++ b/engines/parallaction/walk.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PARALLACTION_WALK_H diff --git a/engines/queen/bankman.cpp b/engines/queen/bankman.cpp index 69329efa51c..ea823773dc3 100644 --- a/engines/queen/bankman.cpp +++ b/engines/queen/bankman.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/queen/bankman.h b/engines/queen/bankman.h index ad9610e93b4..9e1e726fbf4 100644 --- a/engines/queen/bankman.h +++ b/engines/queen/bankman.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_BANKMAN_H diff --git a/engines/queen/command.cpp b/engines/queen/command.cpp index 87b24735a85..7876dbfae98 100644 --- a/engines/queen/command.cpp +++ b/engines/queen/command.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -1084,10 +1081,10 @@ void Command::setAreas(uint16 command) { Area *area = _vm->grid()->area(cmdArea->room, areaNum); if (cmdArea->area > 0) { // turn on area - area->mapNeighbours = ABS(area->mapNeighbours); + area->mapNeighbors = ABS(area->mapNeighbors); } else { // turn off area - area->mapNeighbours = -ABS(area->mapNeighbours); + area->mapNeighbors = -ABS(area->mapNeighbors); } } } diff --git a/engines/queen/command.h b/engines/queen/command.h index 5d2f91d9a99..aa72537a9fe 100644 --- a/engines/queen/command.h +++ b/engines/queen/command.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_COMMAND_H @@ -100,7 +97,7 @@ public: Command(QueenEngine *vm); ~Command(); - //! initialise command construction + //! initialize command construction void clear(bool clearTexts); //! execute last constructed command diff --git a/engines/queen/credits.cpp b/engines/queen/credits.cpp index 029ed7d0a89..d503562601c 100644 --- a/engines/queen/credits.cpp +++ b/engines/queen/credits.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/queen/credits.h b/engines/queen/credits.h index 059c651ca77..b89d029a59d 100644 --- a/engines/queen/credits.h +++ b/engines/queen/credits.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_CREDITS_H diff --git a/engines/queen/cutaway.cpp b/engines/queen/cutaway.cpp index 6fb48c7fb03..de54b7e33c4 100644 --- a/engines/queen/cutaway.cpp +++ b/engines/queen/cutaway.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" @@ -1155,10 +1152,10 @@ void Cutaway::updateGameState() { if (areaSubIndex > 0) { Area *area = _vm->grid()->area(areaIndex, areaSubIndex); - area->mapNeighbours = ABS(area->mapNeighbours); + area->mapNeighbors = ABS(area->mapNeighbors); } else { Area *area = _vm->grid()->area(areaIndex, ABS(areaSubIndex)); - area->mapNeighbours = -ABS(area->mapNeighbours); + area->mapNeighbors = -ABS(area->mapNeighbors); } } diff --git a/engines/queen/cutaway.h b/engines/queen/cutaway.h index c395aa4fa2c..a7e3646a595 100644 --- a/engines/queen/cutaway.h +++ b/engines/queen/cutaway.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_CUTAWAY_H diff --git a/engines/queen/debug.cpp b/engines/queen/debug.cpp index a7cf70fbb2b..d09c5d44697 100644 --- a/engines/queen/debug.cpp +++ b/engines/queen/debug.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/engines/queen/debug.h b/engines/queen/debug.h index 9b08ce83e89..01da4a35d61 100644 --- a/engines/queen/debug.h +++ b/engines/queen/debug.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_DEBUG_H diff --git a/engines/queen/defs.h b/engines/queen/defs.h index 5b3475d4002..3d06485ef5e 100644 --- a/engines/queen/defs.h +++ b/engines/queen/defs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_DEFS_H diff --git a/engines/queen/display.cpp b/engines/queen/display.cpp index c78fd8ebccd..83dc1a9f602 100644 --- a/engines/queen/display.cpp +++ b/engines/queen/display.cpp @@ -18,14 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" -#include "common/EventRecorder.h" #include "common/events.h" #include "graphics/cursorman.h" @@ -41,7 +37,7 @@ namespace Queen { Display::Display(QueenEngine *vm, OSystem *system) : _fullscreen(true), _horizontalScroll(0), _bdWidth(0), _bdHeight(0), - _system(system), _vm(vm) { + _system(system), _vm(vm), _rnd("queenDisplay") { initFont(); @@ -76,7 +72,6 @@ Display::Display(QueenEngine *vm, OSystem *system) memset(&_dynalum, 0, sizeof(_dynalum)); setupInkColors(); - g_eventRec.registerRandomSource(_rnd, "queenDisplay"); } Display::~Display() { diff --git a/engines/queen/display.h b/engines/queen/display.h index e7a2ecd4a18..4256b19d72e 100644 --- a/engines/queen/display.h +++ b/engines/queen/display.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_DISPLAY_H @@ -47,7 +44,7 @@ public: Display(QueenEngine *vm, OSystem *system); ~Display(); - //! initialise dynalum for the specified room + //! initialize dynalum for the specified room void dynalumInit(const char *roomName, uint16 roomNum); //! update dynalum for the current room @@ -141,7 +138,7 @@ public: //! show/hide mouse cursor void showMouseCursor(bool show); - //! initialise font, compute justification sizes + //! initialize font, compute justification sizes void initFont(); //! add the specified text to the texts list diff --git a/engines/queen/graphics.cpp b/engines/queen/graphics.cpp index c86f679765c..d9a8a10d704 100644 --- a/engines/queen/graphics.cpp +++ b/engines/queen/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/queen/graphics.h b/engines/queen/graphics.h index ad9a728cfee..9c719ba22c6 100644 --- a/engines/queen/graphics.h +++ b/engines/queen/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_GRAPHICS_H diff --git a/engines/queen/grid.cpp b/engines/queen/grid.cpp index 306b32bc8b5..82b98c01504 100644 --- a/engines/queen/grid.cpp +++ b/engines/queen/grid.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/queen/grid.h b/engines/queen/grid.h index 7003311a98c..f905e3f4fe0 100644 --- a/engines/queen/grid.h +++ b/engines/queen/grid.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_GRID_H diff --git a/engines/queen/input.cpp b/engines/queen/input.cpp index eac855a0cde..5a04b0f8a44 100644 --- a/engines/queen/input.cpp +++ b/engines/queen/input.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/queen/input.h b/engines/queen/input.h index 43a57729c64..93e2bde6386 100644 --- a/engines/queen/input.h +++ b/engines/queen/input.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_INPUT_H diff --git a/engines/queen/journal.cpp b/engines/queen/journal.cpp index 4200168f078..704019641b8 100644 --- a/engines/queen/journal.cpp +++ b/engines/queen/journal.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/queen/journal.h b/engines/queen/journal.h index 123299c6e9f..a9b9ccb2b83 100644 --- a/engines/queen/journal.h +++ b/engines/queen/journal.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_JOURNAL_H diff --git a/engines/queen/logic.cpp b/engines/queen/logic.cpp index e99a739726a..f60ac59ff1d 100644 --- a/engines/queen/logic.cpp +++ b/engines/queen/logic.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -1629,7 +1626,7 @@ void Logic::asmSetLightsOn() { void Logic::asmSetManequinAreaOn() { Area *a = _vm->grid()->area(ROOM_FLODA_FRONTDESK, 7); - a->mapNeighbours = ABS(a->mapNeighbours); + a->mapNeighbors = ABS(a->mapNeighbors); } void Logic::asmPanToJoe() { diff --git a/engines/queen/logic.h b/engines/queen/logic.h index e6924b3e413..608c19e71e5 100644 --- a/engines/queen/logic.h +++ b/engines/queen/logic.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_LOGIC_H diff --git a/engines/queen/midiadlib.cpp b/engines/queen/midiadlib.cpp index af52f7ed2b8..83853cba924 100644 --- a/engines/queen/midiadlib.cpp +++ b/engines/queen/midiadlib.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/queen/music.cpp b/engines/queen/music.cpp index 5d1a06ccb21..858692703c2 100644 --- a/engines/queen/music.cpp +++ b/engines/queen/music.cpp @@ -18,14 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "queen/music.h" #include "queen/queen.h" @@ -40,7 +36,9 @@ namespace Queen { extern MidiDriver *C_Player_CreateAdLibMidiDriver(Audio::Mixer *); MidiMusic::MidiMusic(QueenEngine *vm) - : _isPlaying(false), _isLooping(false), _randomLoop(false), _masterVolume(192), _buf(0) { + : _isPlaying(false), _isLooping(false), + _randomLoop(false), _masterVolume(192), + _buf(0), _rnd("queenMusic") { memset(_channelsTable, 0, sizeof(_channelsTable)); _queuePos = _lastSong = _currentSong = 0; @@ -92,8 +90,6 @@ MidiMusic::MidiMusic(QueenEngine *vm) _parser = MidiParser::createParser_SMF(); _parser->setMidiDriver(this); _parser->setTimerRate(_driver->getBaseTempo()); - - g_eventRec.registerRandomSource(_rnd, "queenMusic"); } MidiMusic::~MidiMusic() { diff --git a/engines/queen/music.h b/engines/queen/music.h index 3e8fc585cae..ea6affcbe52 100644 --- a/engines/queen/music.h +++ b/engines/queen/music.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_MUSIC_H diff --git a/engines/queen/musicdata.cpp b/engines/queen/musicdata.cpp index 865f4cd21df..d3974dcdbf2 100644 --- a/engines/queen/musicdata.cpp +++ b/engines/queen/musicdata.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -496,7 +493,7 @@ const SongData Sound::_song[] = { /* 124 - Dino Horn */ { { 127, 0 }, 128, 128, 128, 0, 1 }, - /* 125 - Tyre Screech */ + /* 125 - Tire Screech */ { { 128, 0 }, 128, 128, 128, 0, 1 }, /* 126 - Oil Splat */ @@ -1241,7 +1238,7 @@ const TuneData Sound::_tune[] = { /* 127 - Dino Horn */ { { 0, 0 }, { 67, 0 }, 2, 0 }, - /* 128 - Tyre Screech */ + /* 128 - Tire Screech */ { { 0, 0 }, { 68, 0 }, 2, 0 }, /* 129 - Oil Splat */ @@ -1700,7 +1697,7 @@ const char *Sound::_sfxName[] = { /* 67 - Dino Horn */ "103sssss", - /* 68 - Tyre Screech */ + /* 68 - Tire Screech */ "125sssss", /* 69 - Chicken */ diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp index 0dde5c7b425..3c1826cd69e 100644 --- a/engines/queen/queen.cpp +++ b/engines/queen/queen.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -31,7 +28,6 @@ #include "common/savefile.h" #include "common/system.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/textconsole.h" #include "engines/util.h" @@ -73,7 +69,7 @@ public: }; const char *QueenMetaEngine::getName() const { - return "Flight of the Amazon Queen"; + return "Queen"; } const char *QueenMetaEngine::getOriginalCopyright() const { @@ -196,8 +192,7 @@ Common::Error QueenMetaEngine::createInstance(OSystem *syst, Engine **engine) co namespace Queen { QueenEngine::QueenEngine(OSystem *syst) - : Engine(syst), _debugger(0) { - g_eventRec.registerRandomSource(randomizer, "queen"); + : Engine(syst), _debugger(0), randomizer("queen") { } QueenEngine::~QueenEngine() { diff --git a/engines/queen/queen.h b/engines/queen/queen.h index 6098a9f5c25..5affe8e01a0 100644 --- a/engines/queen/queen.h +++ b/engines/queen/queen.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_H diff --git a/engines/queen/resource.cpp b/engines/queen/resource.cpp index 62b13e290c5..d837a63cb5c 100644 --- a/engines/queen/resource.cpp +++ b/engines/queen/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/queen/resource.h b/engines/queen/resource.h index 63720a0755d..5c6746e92fc 100644 --- a/engines/queen/resource.h +++ b/engines/queen/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_RESOURCE_H diff --git a/engines/queen/restables.cpp b/engines/queen/restables.cpp index d4c30c7bea4..bc828164b0d 100644 --- a/engines/queen/restables.cpp +++ b/engines/queen/restables.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "queen/resource.h" diff --git a/engines/queen/sound.cpp b/engines/queen/sound.cpp index afb77f39696..ac58dda728c 100644 --- a/engines/queen/sound.cpp +++ b/engines/queen/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/queen/sound.h b/engines/queen/sound.h index a89e3457913..2aabb0d73b4 100644 --- a/engines/queen/sound.h +++ b/engines/queen/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_SOUND_H diff --git a/engines/queen/state.cpp b/engines/queen/state.cpp index 4dcf7a8cd11..a07e68045b2 100644 --- a/engines/queen/state.cpp +++ b/engines/queen/state.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/queen/state.h b/engines/queen/state.h index bdf5e6da51e..1a6725c8008 100644 --- a/engines/queen/state.h +++ b/engines/queen/state.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_STATE_H diff --git a/engines/queen/structs.h b/engines/queen/structs.h index 6b852aaa9c2..6dd98fa1f5a 100644 --- a/engines/queen/structs.h +++ b/engines/queen/structs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_STRUCTS_H @@ -80,7 +77,7 @@ struct Box { struct Area { //! bitmask of connected areas - int16 mapNeighbours; + int16 mapNeighbors; //! coordinates defining area limits Box box; //! scaling factors for bobs actors @@ -89,7 +86,7 @@ struct Area { uint16 object; void readFromBE(byte *&ptr) { - mapNeighbours = (int16)READ_BE_UINT16(ptr); ptr += 2; + mapNeighbors = (int16)READ_BE_UINT16(ptr); ptr += 2; box.readFromBE(ptr); bottomScaleFactor = READ_BE_UINT16(ptr); ptr += 2; topScaleFactor = READ_BE_UINT16(ptr); ptr += 2; @@ -97,7 +94,7 @@ struct Area { } void writeToBE(byte *&ptr) { - WRITE_BE_UINT16(ptr, mapNeighbours); ptr += 2; + WRITE_BE_UINT16(ptr, mapNeighbors); ptr += 2; box.writeToBE(ptr); WRITE_BE_UINT16(ptr, bottomScaleFactor); ptr += 2; WRITE_BE_UINT16(ptr, topScaleFactor); ptr += 2; diff --git a/engines/queen/talk.cpp b/engines/queen/talk.cpp index 18c712b7991..b83bf60435c 100644 --- a/engines/queen/talk.cpp +++ b/engines/queen/talk.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/queen/talk.h b/engines/queen/talk.h index 036dfadbcd7..68196784b18 100644 --- a/engines/queen/talk.h +++ b/engines/queen/talk.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_TALK_H diff --git a/engines/queen/walk.cpp b/engines/queen/walk.cpp index a778ea5b05d..b5c9b97ce08 100644 --- a/engines/queen/walk.cpp +++ b/engines/queen/walk.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" @@ -114,7 +111,7 @@ void Walk::animateJoe() { WalkData *pwd = &_walkData[i]; // area has been turned off, see if we should execute a cutaway - if (pwd->area->mapNeighbours < 0) { + if (pwd->area->mapNeighbors < 0) { // queen.c l.2838-2911 _vm->logic()->handleSpecialArea(pwd->anim.facing, pwd->areaNum, i); _joeMoveBlock = true; @@ -485,7 +482,7 @@ int16 Walk::findAreaPosition(int16 *x, int16 *y, bool recalibrate) { uint16 Walk::findFreeArea(uint16 area) const { uint16 testArea; uint16 freeArea = 0; - uint16 map = ABS(_roomArea[area].mapNeighbours); + uint16 map = ABS(_roomArea[area].mapNeighbors); for (testArea = 1; testArea <= _roomAreaCount; ++testArea) { int b = _roomAreaCount - testArea; if (map & (1 << b)) { diff --git a/engines/queen/walk.h b/engines/queen/walk.h index 0f746213ab3..e5257b7afae 100644 --- a/engines/queen/walk.h +++ b/engines/queen/walk.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_WALK_H diff --git a/engines/saga/actor.cpp b/engines/saga/actor.cpp index 8e2ce4fcc61..86606855e34 100644 --- a/engines/saga/actor.cpp +++ b/engines/saga/actor.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "saga/saga.h" diff --git a/engines/saga/actor.h b/engines/saga/actor.h index 01feacb75bb..451497986d3 100644 --- a/engines/saga/actor.h +++ b/engines/saga/actor.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Actor management module header file diff --git a/engines/saga/actor_path.cpp b/engines/saga/actor_path.cpp index df117841f38..3e10aba6b6f 100644 --- a/engines/saga/actor_path.cpp +++ b/engines/saga/actor_path.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "saga/saga.h" diff --git a/engines/saga/actor_walk.cpp b/engines/saga/actor_walk.cpp index 6aabf273118..5607fcdd66b 100644 --- a/engines/saga/actor_walk.cpp +++ b/engines/saga/actor_walk.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "saga/saga.h" diff --git a/engines/saga/animation.cpp b/engines/saga/animation.cpp index 4aee111aa79..7ec4a593987 100644 --- a/engines/saga/animation.cpp +++ b/engines/saga/animation.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Background animation management module diff --git a/engines/saga/animation.h b/engines/saga/animation.h index c27909115e9..2c42cb72532 100644 --- a/engines/saga/animation.h +++ b/engines/saga/animation.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Background animation management module private header diff --git a/engines/saga/console.cpp b/engines/saga/console.cpp index 228febfe9ce..771925a3216 100644 --- a/engines/saga/console.cpp +++ b/engines/saga/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Console module diff --git a/engines/saga/console.h b/engines/saga/console.h index c2e563e019a..b93638467b6 100644 --- a/engines/saga/console.h +++ b/engines/saga/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Console module header file diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp index b1bcc992953..b23baf4cc3a 100644 --- a/engines/saga/detection.cpp +++ b/engines/saga/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Game detection, general game parameters @@ -134,7 +131,7 @@ public: SagaMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Saga engine [" + return "SAGA [" #if defined(ENABLE_IHNM) && defined(ENABLE_SAGA2) "all games" diff --git a/engines/saga/detection_tables.h b/engines/saga/detection_tables.h index e5796e813bb..f63efd206ba 100644 --- a/engines/saga/detection_tables.h +++ b/engines/saga/detection_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Game detection information and MD5s diff --git a/engines/saga/displayinfo.h b/engines/saga/displayinfo.h index b29f7093239..70c36bafd5b 100644 --- a/engines/saga/displayinfo.h +++ b/engines/saga/displayinfo.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Interface widget display information diff --git a/engines/saga/events.cpp b/engines/saga/events.cpp index cf27ad75599..35f41e30abf 100644 --- a/engines/saga/events.cpp +++ b/engines/saga/events.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Event management module diff --git a/engines/saga/events.h b/engines/saga/events.h index 135c0beb551..581abe17b01 100644 --- a/engines/saga/events.h +++ b/engines/saga/events.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Event management module header file diff --git a/engines/saga/font.cpp b/engines/saga/font.cpp index 2434f7aad87..a5363909ffb 100644 --- a/engines/saga/font.cpp +++ b/engines/saga/font.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Font management and font drawing module diff --git a/engines/saga/font.h b/engines/saga/font.h index 6f66545756a..75d5fa95b98 100644 --- a/engines/saga/font.h +++ b/engines/saga/font.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Font management and font drawing header file diff --git a/engines/saga/font_map.cpp b/engines/saga/font_map.cpp index 6abaeea1510..936c8e779cc 100644 --- a/engines/saga/font_map.cpp +++ b/engines/saga/font_map.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Font module character mapping table ( MS CP-850 to ISO 8859-1 ) diff --git a/engines/saga/gfx.cpp b/engines/saga/gfx.cpp index 4930718b67f..ab0c0f3e4cf 100644 --- a/engines/saga/gfx.cpp +++ b/engines/saga/gfx.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Misc. graphics routines diff --git a/engines/saga/gfx.h b/engines/saga/gfx.h index 56d91043718..c677b763248 100644 --- a/engines/saga/gfx.h +++ b/engines/saga/gfx.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Graphics maniuplation routines - private header file diff --git a/engines/saga/image.cpp b/engines/saga/image.cpp index ac9fe94f2fe..3434d46b42e 100644 --- a/engines/saga/image.cpp +++ b/engines/saga/image.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // SAGA Image resource management routines diff --git a/engines/saga/input.cpp b/engines/saga/input.cpp index e3a3b49396e..69a353da9f8 100644 --- a/engines/saga/input.cpp +++ b/engines/saga/input.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "saga/saga.h" diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index c3773b2cb21..08c5ddc6f9f 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Game interface module diff --git a/engines/saga/interface.h b/engines/saga/interface.h index 09631bf0e88..84533705fe3 100644 --- a/engines/saga/interface.h +++ b/engines/saga/interface.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Game interface module private header file diff --git a/engines/saga/introproc_ihnm.cpp b/engines/saga/introproc_ihnm.cpp index 2053c7158fd..364c4cf3068 100644 --- a/engines/saga/introproc_ihnm.cpp +++ b/engines/saga/introproc_ihnm.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_IHNM diff --git a/engines/saga/introproc_ite.cpp b/engines/saga/introproc_ite.cpp index ae7dedefa59..87fd48e2d2a 100644 --- a/engines/saga/introproc_ite.cpp +++ b/engines/saga/introproc_ite.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Intro sequence scene procedures diff --git a/engines/saga/introproc_saga2.cpp b/engines/saga/introproc_saga2.cpp index 7f04474c616..80d53a2794e 100644 --- a/engines/saga/introproc_saga2.cpp +++ b/engines/saga/introproc_saga2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_SAGA2 diff --git a/engines/saga/isomap.cpp b/engines/saga/isomap.cpp index 6450af268a3..adea59ca9a7 100644 --- a/engines/saga/isomap.cpp +++ b/engines/saga/isomap.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Isometric level module diff --git a/engines/saga/isomap.h b/engines/saga/isomap.h index 7dc7dff8cd9..b35f79b1afe 100644 --- a/engines/saga/isomap.h +++ b/engines/saga/isomap.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Isometric level module - private header diff --git a/engines/saga/itedata.cpp b/engines/saga/itedata.cpp index ab0aa12d18a..44aa48ccee5 100644 --- a/engines/saga/itedata.cpp +++ b/engines/saga/itedata.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Actor and Object data tables diff --git a/engines/saga/itedata.h b/engines/saga/itedata.h index f0f626a51a1..73f0a2aa213 100644 --- a/engines/saga/itedata.h +++ b/engines/saga/itedata.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Actor data table header file diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp index eb0a911555e..21f3cc489e5 100644 --- a/engines/saga/music.cpp +++ b/engines/saga/music.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // MIDI and digital music class diff --git a/engines/saga/music.h b/engines/saga/music.h index 465d61e3667..5a4e662af49 100644 --- a/engines/saga/music.h +++ b/engines/saga/music.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Music class diff --git a/engines/saga/objectmap.cpp b/engines/saga/objectmap.cpp index 9799edc34a4..b9594625e11 100644 --- a/engines/saga/objectmap.cpp +++ b/engines/saga/objectmap.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Object map / Object click-area module diff --git a/engines/saga/objectmap.h b/engines/saga/objectmap.h index 9e7c004fc01..3f71c8f95d6 100644 --- a/engines/saga/objectmap.h +++ b/engines/saga/objectmap.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Object map / Object click-area module header file diff --git a/engines/saga/palanim.cpp b/engines/saga/palanim.cpp index b0b76fc947c..1fefad93abe 100644 --- a/engines/saga/palanim.cpp +++ b/engines/saga/palanim.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Palette animation module diff --git a/engines/saga/palanim.h b/engines/saga/palanim.h index 2d2c3f13997..9959d08e2f1 100644 --- a/engines/saga/palanim.h +++ b/engines/saga/palanim.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Palette animation module header file diff --git a/engines/saga/puzzle.cpp b/engines/saga/puzzle.cpp index 0e08c84e430..d5d83c706fa 100644 --- a/engines/saga/puzzle.cpp +++ b/engines/saga/puzzle.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "saga/saga.h" diff --git a/engines/saga/puzzle.h b/engines/saga/puzzle.h index 312f0d71b11..0f9bd8aeff4 100644 --- a/engines/saga/puzzle.h +++ b/engines/saga/puzzle.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // ITE puzzle scene diff --git a/engines/saga/render.cpp b/engines/saga/render.cpp index 837a9e58792..757374a3a32 100644 --- a/engines/saga/render.cpp +++ b/engines/saga/render.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Main rendering loop diff --git a/engines/saga/render.h b/engines/saga/render.h index f0241e8ecf4..5694bacb35a 100644 --- a/engines/saga/render.h +++ b/engines/saga/render.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Main rendering loop - private header diff --git a/engines/saga/resource.cpp b/engines/saga/resource.cpp index 578ce2d5ab0..72b021309c6 100644 --- a/engines/saga/resource.cpp +++ b/engines/saga/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // RSC Resource file management module diff --git a/engines/saga/resource.h b/engines/saga/resource.h index a21f636f25a..2124f3e29f6 100644 --- a/engines/saga/resource.h +++ b/engines/saga/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // RSC Resource file management header file diff --git a/engines/saga/resource_hrs.cpp b/engines/saga/resource_hrs.cpp index 21cf0ef4c1a..ac16e21c12b 100644 --- a/engines/saga/resource_hrs.cpp +++ b/engines/saga/resource_hrs.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_SAGA2 diff --git a/engines/saga/resource_res.cpp b/engines/saga/resource_res.cpp index 2cc12747afb..4fec9da662d 100644 --- a/engines/saga/resource_res.cpp +++ b/engines/saga/resource_res.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // RSC Resource file management module (SAGA 1, used in IHNM) diff --git a/engines/saga/resource_rsc.cpp b/engines/saga/resource_rsc.cpp index 089757ca27b..bc66e9e30ac 100644 --- a/engines/saga/resource_rsc.cpp +++ b/engines/saga/resource_rsc.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // RSC Resource file management module (SAGA 1, used in ITE) diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp index 62493f5eac5..15bd2aff72b 100644 --- a/engines/saga/saga.cpp +++ b/engines/saga/saga.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" @@ -28,7 +25,6 @@ #include "common/config-manager.h" #include "common/system.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "audio/mixer.h" @@ -59,7 +55,7 @@ namespace Saga { #define MAX_TIME_DELTA 100 SagaEngine::SagaEngine(OSystem *syst, const SAGAGameDescription *gameDesc) - : Engine(syst), _gameDescription(gameDesc) { + : Engine(syst), _gameDescription(gameDesc), _rnd("saga") { _framesEsc = 0; @@ -136,7 +132,6 @@ SagaEngine::SagaEngine(OSystem *syst, const SAGAGameDescription *gameDesc) SearchMan.addSubDirectoryMatching(gameDataDir, "video"); _displayClip.left = _displayClip.top = 0; - g_eventRec.registerRandomSource(_rnd, "saga"); } SagaEngine::~SagaEngine() { diff --git a/engines/saga/saga.h b/engines/saga/saga.h index 4df44a2e186..6d33979028b 100644 --- a/engines/saga/saga.h +++ b/engines/saga/saga.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SAGA_H diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp index 27300377e9d..8d7b718c099 100644 --- a/engines/saga/saveload.cpp +++ b/engines/saga/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/savefile.h" diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp index 8e9e4463ba3..66ee8f45043 100644 --- a/engines/saga/scene.cpp +++ b/engines/saga/scene.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Scene management module diff --git a/engines/saga/scene.h b/engines/saga/scene.h index 156705986d8..adac3b622a3 100644 --- a/engines/saga/scene.h +++ b/engines/saga/scene.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Scene management module private header file diff --git a/engines/saga/script.cpp b/engines/saga/script.cpp index bd1d6e5d84f..9502631f37f 100644 --- a/engines/saga/script.cpp +++ b/engines/saga/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Scripting module: Script resource handling functions diff --git a/engines/saga/script.h b/engines/saga/script.h index fba71edfbaa..227b58a2989 100644 --- a/engines/saga/script.h +++ b/engines/saga/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Scripting module private header diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp index 1e34362dc40..70f987a1295 100644 --- a/engines/saga/sfuncs.cpp +++ b/engines/saga/sfuncs.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Scripting module script function component diff --git a/engines/saga/sfuncs_ihnm.cpp b/engines/saga/sfuncs_ihnm.cpp index dd6bbbe6f82..1a736778465 100644 --- a/engines/saga/sfuncs_ihnm.cpp +++ b/engines/saga/sfuncs_ihnm.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_IHNM diff --git a/engines/saga/shorten.cpp b/engines/saga/shorten.cpp index 8f0baa9d533..39af7aa3db9 100644 --- a/engines/saga/shorten.cpp +++ b/engines/saga/shorten.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/engines/saga/shorten.h b/engines/saga/shorten.h index f320e1dcc5a..f2114bedeb7 100644 --- a/engines/saga/shorten.h +++ b/engines/saga/shorten.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // The code in this file is currently only used in SAGA2. diff --git a/engines/saga/sndres.cpp b/engines/saga/sndres.cpp index 46b13727a03..2433c93e93a 100644 --- a/engines/saga/sndres.cpp +++ b/engines/saga/sndres.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Sound resource management class diff --git a/engines/saga/sndres.h b/engines/saga/sndres.h index e4bae1b1433..9b0eebc834d 100644 --- a/engines/saga/sndres.h +++ b/engines/saga/sndres.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Sound resource class header diff --git a/engines/saga/sound.cpp b/engines/saga/sound.cpp index 8ffce4e6cda..3408125f737 100644 --- a/engines/saga/sound.cpp +++ b/engines/saga/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/engines/saga/sound.h b/engines/saga/sound.h index 15003b515c0..15624a9da55 100644 --- a/engines/saga/sound.h +++ b/engines/saga/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Sound class diff --git a/engines/saga/sprite.cpp b/engines/saga/sprite.cpp index bc3646e8984..81893c7480b 100644 --- a/engines/saga/sprite.cpp +++ b/engines/saga/sprite.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Sprite management module diff --git a/engines/saga/sprite.h b/engines/saga/sprite.h index 2ffb940ccc3..0375d8c63f9 100644 --- a/engines/saga/sprite.h +++ b/engines/saga/sprite.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Sprite management module private header file diff --git a/engines/saga/sthread.cpp b/engines/saga/sthread.cpp index 0b59f3ba175..ec81d8d7331 100644 --- a/engines/saga/sthread.cpp +++ b/engines/saga/sthread.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Scripting module thread management component diff --git a/engines/savestate.cpp b/engines/savestate.cpp index bed19ba3e53..9ed8356d3be 100644 --- a/engines/savestate.cpp +++ b/engines/savestate.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "engines/savestate.h" diff --git a/engines/savestate.h b/engines/savestate.h index 9b64a96aeed..ce78bc4ba38 100644 --- a/engines/savestate.h +++ b/engines/savestate.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef ENGINES_SAVESTATE_H diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 419f5e14151..af945247bad 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Console module @@ -77,6 +74,9 @@ static int parse_reg_t(EngineState *s, const char *str, reg_t *dest, bool mayBeV Console::Console(SciEngine *engine) : GUI::Debugger(), _engine(engine), _debugState(engine->_debugState) { + assert(_engine); + assert(_engine->_gamestate); + // Variables DVar_Register("sleeptime_factor", &g_debug_sleeptime_factor, DVAR_INT, 0); DVar_Register("gc_interval", &engine->_gamestate->scriptGCInterval, DVAR_INT, 0); @@ -3362,20 +3362,22 @@ bool Console::cmdSfx01Track(int argc, const char **argv) { bool Console::cmdQuit(int argc, const char **argv) { if (argc != 2) { - DebugPrintf("%s game - exit gracefully\n", argv[0]); - DebugPrintf("%s now - exit ungracefully\n", argv[0]); - return true; } - if (!scumm_stricmp(argv[1], "game")) { + if (argc == 2 && !scumm_stricmp(argv[1], "now")) { + // Quit ungracefully + g_system->quit(); + } else if (argc == 1 || (argc == 2 && !scumm_stricmp(argv[1], "game"))) { + // Quit gracefully _engine->_gamestate->abortScriptProcessing = kAbortQuitGame; // Terminate VM _debugState.seeking = kDebugSeekNothing; _debugState.runningStep = 0; - } else if (!scumm_stricmp(argv[1], "now")) { - // Quit ungracefully - exit(0); + } else { + DebugPrintf("%s [game] - exit gracefully\n", argv[0]); + DebugPrintf("%s now - exit ungracefully\n", argv[0]); + return true; } return Cmd_Exit(0, 0); @@ -3775,7 +3777,7 @@ int Console::printObject(reg_t pos) { DebugPrintf(" -- member variables:\n"); for (i = 0; (uint)i < obj->getVarCount(); i++) { DebugPrintf(" "); - if (i < var_container->getVarCount()) { + if (var_container && i < var_container->getVarCount()) { uint16 varSelector = var_container->getVarSelector(i); DebugPrintf("[%03x] %s = ", varSelector, _engine->getKernel()->getSelectorName(varSelector).c_str()); } else diff --git a/engines/sci/console.h b/engines/sci/console.h index 93ccc45503a..1e2ebe4ba2f 100644 --- a/engines/sci/console.h +++ b/engines/sci/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Console module header file diff --git a/engines/sci/debug.h b/engines/sci/debug.h index 8ddbbd0d450..765ceca07d7 100644 --- a/engines/sci/debug.h +++ b/engines/sci/debug.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_DEBUG_H diff --git a/engines/sci/decompressor.cpp b/engines/sci/decompressor.cpp index c122fceeb0f..03a06d240d3 100644 --- a/engines/sci/decompressor.cpp +++ b/engines/sci/decompressor.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Resource library diff --git a/engines/sci/decompressor.h b/engines/sci/decompressor.h index 8b6f955ddb3..37a5b5d7cb5 100644 --- a/engines/sci/decompressor.h +++ b/engines/sci/decompressor.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_DECOMPRESSOR_H diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index 6db6cf8353d..61e6cc9d09a 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "engines/advancedDetector.h" @@ -405,7 +402,7 @@ public: SciMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "SCI Engine [SCI0, SCI01, SCI10, SCI11" + return "SCI [SCI0, SCI01, SCI10, SCI11" #ifdef ENABLE_SCI32 ", SCI32" #endif diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h index 829831d3a69..d56d8f03cdb 100644 --- a/engines/sci/detection_tables.h +++ b/engines/sci/detection_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ namespace Sci { diff --git a/engines/sci/engine/features.cpp b/engines/sci/engine/features.cpp index 964097f57d1..a5c1b970f1d 100644 --- a/engines/sci/engine/features.cpp +++ b/engines/sci/engine/features.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/engine/features.h" diff --git a/engines/sci/engine/features.h b/engines/sci/engine/features.h index 8237d43714f..07ba626d15f 100644 --- a/engines/sci/engine/features.h +++ b/engines/sci/engine/features.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_INCLUDE_FEATURES_H diff --git a/engines/sci/engine/gc.cpp b/engines/sci/engine/gc.cpp index e395eeab947..2d71878bda2 100644 --- a/engines/sci/engine/gc.cpp +++ b/engines/sci/engine/gc.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/engine/gc.h" diff --git a/engines/sci/engine/gc.h b/engines/sci/engine/gc.h index 48e1c6b482d..97aa6513b6a 100644 --- a/engines/sci/engine/gc.h +++ b/engines/sci/engine/gc.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index ea6fa31d055..8fb6322f559 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h index 9a55ef630bd..68b16015804 100644 --- a/engines/sci/engine/kernel.h +++ b/engines/sci/engine/kernel.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_KERNEL_H diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h index 16d56d10a8d..31ef64d1090 100644 --- a/engines/sci/engine/kernel_tables.h +++ b/engines/sci/engine/kernel_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_KERNEL_TABLES_H diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp index 725b78341b1..2cd6b198de4 100644 --- a/engines/sci/engine/kevent.cpp +++ b/engines/sci/engine/kevent.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index 0e2f64257a4..ee88d8af156 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/archive.h" @@ -466,7 +463,7 @@ static int findSavegame(Common::Array &saves, int16 savegameId) { // The scripts get IDs ranging from 100->199, because the scripts require us to assign unique ids THAT EVEN STAY BETWEEN // SAVES and the scripts also use "saves-count + 1" to create a new savedgame slot. // SCI1.1 actually recycles ids, in that case we will currently get "0". -// This behaviour is required especially for LSL6. In this game, it's possible to quick save. The scripts will use +// This behavior is required especially for LSL6. In this game, it's possible to quick save. The scripts will use // the last-used id for that feature. If we don't assign sticky ids, the feature will overwrite different saves all the // time. And sadly we can't just use the actual filename ids directly, because of the creation method for new slots. diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index c7a2a26c3df..6c962669221 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" @@ -363,10 +360,29 @@ reg_t kTextSize(EngineState *s, int argc, reg_t *argv) { } else #endif g_sci->_gfxText16->kernelTextSize(g_sci->strSplit(text.c_str(), sep).c_str(), font_nr, maxwidth, &textWidth, &textHeight); - + + // One of the game texts in LB2 German contains loads of spaces in + // its end. We trim the text here, otherwise the graphics code will + // attempt to draw a very large window (larger than the screen) to + // show the text, and crash. + // Fixes bug #3306417. + if (textWidth >= g_sci->_gfxScreen->getDisplayWidth() || + textHeight >= g_sci->_gfxScreen->getDisplayHeight()) { + // TODO: Is this needed for SCI32 as well? + if (g_sci->_gfxText16) { + warning("kTextSize: string would be too big to fit on screen. Trimming it"); + text.trim(); + // Copy over the trimmed string... + s->_segMan->strcpy(argv[1], text.c_str()); + // ...and recalculate bounding box dimensions + g_sci->_gfxText16->kernelTextSize(g_sci->strSplit(text.c_str(), sep).c_str(), font_nr, maxwidth, &textWidth, &textHeight); + } + } + debugC(kDebugLevelStrings, "GetTextSize '%s' -> %dx%d", text.c_str(), textWidth, textHeight); dest[2] = make_reg(0, textHeight); dest[3] = make_reg(0, textWidth); + return s->r_acc; } diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp index 38cd6ef023e..68469f5c9ac 100644 --- a/engines/sci/engine/klists.cpp +++ b/engines/sci/engine/klists.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/engine/features.h" diff --git a/engines/sci/engine/kmath.cpp b/engines/sci/engine/kmath.cpp index 9baf9f5a546..ef795d7e2f2 100644 --- a/engines/sci/engine/kmath.cpp +++ b/engines/sci/engine/kmath.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/engine/state.h" diff --git a/engines/sci/engine/kmenu.cpp b/engines/sci/engine/kmenu.cpp index 3986966a713..02aa1d3ece1 100644 --- a/engines/sci/engine/kmenu.cpp +++ b/engines/sci/engine/kmenu.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp index 80425224bfc..daed248db1e 100644 --- a/engines/sci/engine/kmisc.cpp +++ b/engines/sci/engine/kmisc.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/sci/engine/kmovement.cpp b/engines/sci/engine/kmovement.cpp index f4392df8f2a..31715f19d30 100644 --- a/engines/sci/engine/kmovement.cpp +++ b/engines/sci/engine/kmovement.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/engine/kparse.cpp b/engines/sci/engine/kparse.cpp index 09cf7744b22..59694cb6ee1 100644 --- a/engines/sci/engine/kparse.cpp +++ b/engines/sci/engine/kparse.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* String and parser handling */ diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp index 7786f9b0936..8904a489782 100644 --- a/engines/sci/engine/kpathing.cpp +++ b/engines/sci/engine/kpathing.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" @@ -37,6 +34,8 @@ namespace Sci { +// TODO: Code cleanup + #define AVOIDPATH_DYNMEM_STRING "AvoidPath polyline" #define POLY_LAST_POINT 0x7777 @@ -1177,7 +1176,6 @@ static void change_polygons_opt_0(PathfindingState *s) { static PathfindingState *convert_polygon_set(EngineState *s, reg_t poly_list, Common::Point start, Common::Point end, int width, int height, int opt) { SegManager *segMan = s->_segMan; Polygon *polygon; - int err; int count = 0; PathfindingState *pf_s = new PathfindingState(width, height); @@ -1200,50 +1198,53 @@ static PathfindingState *convert_polygon_set(EngineState *s, reg_t poly_list, Co } } - if (opt == 0) { - Common::Point intersection; - - // Keyboard support - // FIXME: We don't need to dijkstra for keyboard support as we currently do + if (opt == 0) change_polygons_opt_0(pf_s); - // Find nearest intersection - err = nearest_intersection(pf_s, start, end, &intersection); + Common::Point *new_start = fixup_start_point(pf_s, start); + + if (!new_start) { + warning("AvoidPath: Couldn't fixup start position for pathfinding"); + delete pf_s; + return NULL; + } - if (err == PF_FATAL) { - warning("AvoidPath: fatal error finding nearest intersection"); - delete pf_s; - return NULL; - } + Common::Point *new_end = fixup_end_point(pf_s, end); + + if (!new_end) { + warning("AvoidPath: Couldn't fixup end position for pathfinding"); + delete new_start; + delete pf_s; + return NULL; + } - if (err == PF_OK) { - // Intersection was found, prepend original start position after pathfinding - pf_s->_prependPoint = new Common::Point(start); - // Merge new start point into polygon set - pf_s->vertex_start = merge_point(pf_s, intersection); - } else { - // Otherwise we proceed with the original start point - pf_s->vertex_start = merge_point(pf_s, start); + if (opt == 0) { + // Keyboard support. Only the first edge of the path we compute + // here matches the path returned by SSCI. This is assumed to be + // sufficient as all known use cases only use the first two + // vertices of the returned path. + // Pharkas uses this mode for a secondary polygon set containing + // rectangular polygons used to block an actor's path. + + // If we have a prepended point, we do nothing here as the + // actor is in barred territory and should be moved outside of + // it ASAP. This matches the behavior of SSCI. + if (!pf_s->_prependPoint) { + // Actor position is OK, find nearest obstacle. + int err = nearest_intersection(pf_s, start, *new_end, new_start); + + if (err == PF_FATAL) { + warning("AvoidPath: error finding nearest intersection"); + delete new_start; + delete new_end; + delete pf_s; + return NULL; + } + + if (err == PF_OK) + pf_s->_prependPoint = new Common::Point(start); } - // Merge end point into polygon set - pf_s->vertex_end = merge_point(pf_s, end); } else { - Common::Point *new_start = fixup_start_point(pf_s, start); - - if (!new_start) { - warning("AvoidPath: Couldn't fixup start position for pathfinding"); - delete pf_s; - return NULL; - } - - Common::Point *new_end = fixup_end_point(pf_s, end); - - if (!new_end) { - warning("AvoidPath: Couldn't fixup end position for pathfinding"); - delete pf_s; - return NULL; - } - // WORKAROUND LSL5 room 660. Priority glitch due to us choosing a different path // than SSCI. Happens when Patti walks to the control room. if (g_sci->getGameId() == GID_LSL5 && (s->currentRoomNumber() == 660) && (Common::Point(67, 131) == *new_start) && (Common::Point(229, 101) == *new_end)) { @@ -1251,15 +1252,15 @@ static PathfindingState *convert_polygon_set(EngineState *s, reg_t poly_list, Co pf_s->_prependPoint = new_start; new_start = new Common::Point(77, 107); } - - // Merge start and end points into polygon set - pf_s->vertex_start = merge_point(pf_s, *new_start); - pf_s->vertex_end = merge_point(pf_s, *new_end); - - delete new_start; - delete new_end; } + // Merge start and end points into polygon set + pf_s->vertex_start = merge_point(pf_s, *new_start); + pf_s->vertex_end = merge_point(pf_s, *new_end); + + delete new_start; + delete new_end; + // Allocate and build vertex index pf_s->vertex_index = (Vertex**)malloc(sizeof(Vertex *) * (count + 2)); diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp index b9baa3540ae..d83254b2c44 100644 --- a/engines/sci/engine/kscripts.cpp +++ b/engines/sci/engine/kscripts.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" @@ -49,7 +46,7 @@ reg_t kLoad(EngineState *s, int argc, reg_t *argv) { } // Unloads an arbitrary resource of type 'restype' with resource numbber 'resnr' -// behaviour of this call didn't change between sci0->sci1.1 parameter wise, which means getting called with +// behavior of this call didn't change between sci0->sci1.1 parameter wise, which means getting called with // 1 or 3+ parameters is not right according to sierra sci reg_t kUnLoad(EngineState *s, int argc, reg_t *argv) { if (argc >= 2) { @@ -195,7 +192,7 @@ reg_t kDisposeClone(EngineState *s, int argc, reg_t *argv) { } // SCI uses this technique to find out, if it's a clone and if it's supposed to get freed - // At least kq4early relies on this behaviour. The scripts clone "Sound", then set bit 1 manually + // At least kq4early relies on this behavior. The scripts clone "Sound", then set bit 1 manually // and call kDisposeClone later. In that case we may not free it, otherwise we will run into issues // later, because kIsObject would then return false and Sound object wouldn't get checked. uint16 infoSelector = object->getInfoSelector().offset; @@ -262,7 +259,7 @@ reg_t kDisposeScript(EngineState *s, int argc, reg_t *argv) { SegmentId id = s->_segMan->getScriptSegment(script); Script *scr = s->_segMan->getScriptIfLoaded(id); - if (scr) { + if (scr && !scr->isMarkedAsDeleted()) { if (s->_executionStack.back().addr.pc.segment != id) scr->setLockers(1); } diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp index 7fb6ac296e9..33bef58e52f 100644 --- a/engines/sci/engine/ksound.cpp +++ b/engines/sci/engine/ksound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index e79af701588..c3c10bd2a21 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* String and parser handling */ @@ -69,8 +66,9 @@ reg_t kStrCpy(EngineState *s, int argc, reg_t *argv) { s->_segMan->strncpy(argv[0], argv[1], length); else s->_segMan->memcpy(argv[0], argv[1], -length); - } else + } else { s->_segMan->strcpy(argv[0], argv[1]); + } return argv[0]; } diff --git a/engines/sci/engine/kvideo.cpp b/engines/sci/engine/kvideo.cpp index a8d44371489..9a60f39c854 100644 --- a/engines/sci/engine/kvideo.cpp +++ b/engines/sci/engine/kvideo.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "engines/util.h" diff --git a/engines/sci/engine/message.cpp b/engines/sci/engine/message.cpp index ff2d96e8049..f30f4e923e0 100644 --- a/engines/sci/engine/message.cpp +++ b/engines/sci/engine/message.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sci/engine/message.h b/engines/sci/engine/message.h index 43ddb29d784..4444ede3bb6 100644 --- a/engines/sci/engine/message.h +++ b/engines/sci/engine/message.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_MESSAGE_H diff --git a/engines/sci/engine/object.cpp b/engines/sci/engine/object.cpp index 267ba35e3c6..f09f18298ac 100644 --- a/engines/sci/engine/object.cpp +++ b/engines/sci/engine/object.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -61,14 +58,14 @@ void Object::init(byte *buf, reg_t obj_pos, bool initVariables) { if (getSciVersion() <= SCI_VERSION_1_LATE) { _variables.resize(READ_LE_UINT16(data + kOffsetSelectorCounter)); - _baseVars = (uint16 *)(_baseObj + _variables.size() * 2); + _baseVars = (const uint16 *)(_baseObj + _variables.size() * 2); _methodCount = READ_LE_UINT16(data + READ_LE_UINT16(data + kOffsetFunctionArea) - 2); for (int i = 0; i < _methodCount * 2 + 2; ++i) { _baseMethod.push_back(READ_SCI11ENDIAN_UINT16(data + READ_LE_UINT16(data + kOffsetFunctionArea) + i * 2)); } } else if (getSciVersion() >= SCI_VERSION_1_1 && getSciVersion() <= SCI_VERSION_2_1) { _variables.resize(READ_SCI11ENDIAN_UINT16(data + 2)); - _baseVars = (uint16 *)(buf + READ_SCI11ENDIAN_UINT16(data + 4)); + _baseVars = (const uint16 *)(buf + READ_SCI11ENDIAN_UINT16(data + 4)); _methodCount = READ_SCI11ENDIAN_UINT16(buf + READ_SCI11ENDIAN_UINT16(data + 6)); for (int i = 0; i < _methodCount * 2 + 3; ++i) { _baseMethod.push_back(READ_SCI11ENDIAN_UINT16(buf + READ_SCI11ENDIAN_UINT16(data + 6) + i * 2)); diff --git a/engines/sci/engine/object.h b/engines/sci/engine/object.h index 8ae06f2707c..80c8e9e83db 100644 --- a/engines/sci/engine/object.h +++ b/engines/sci/engine/object.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_OBJECT_H @@ -239,7 +236,7 @@ private: void initSelectorsSci3(const byte *buf); const byte *_baseObj; /**< base + object offset within base */ - uint16 *_baseVars; /**< Pointer to the varselector area for this object */ + const uint16 *_baseVars; /**< Pointer to the varselector area for this object */ Common::Array _baseMethod; /**< Pointer to the method selector area for this object */ uint16 *_propertyOffsetsSci3; /**< This is used to enable relocation of property valuesa in SCI3 */ diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index 43d00ebc156..65b5e602ffa 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/stream.h" diff --git a/engines/sci/engine/savegame.h b/engines/sci/engine/savegame.h index 778b0bf137b..ff5bc5204b4 100644 --- a/engines/sci/engine/savegame.h +++ b/engines/sci/engine/savegame.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_SAVEGAME_H diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp index 25bf91c3ad1..a38aa06bc4e 100644 --- a/engines/sci/engine/script.cpp +++ b/engines/sci/engine/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" @@ -383,6 +380,7 @@ void Script::relocateSci3(reg_t block) { } void Script::incrementLockers() { + assert(!_markedAsDeleted); _lockers++; } @@ -396,6 +394,7 @@ int Script::getLockers() const { } void Script::setLockers(int lockers) { + assert(lockers == 0 || !_markedAsDeleted); _lockers = lockers; } @@ -493,7 +492,7 @@ SegmentRef Script::dereference(reg_t pointer) { return ret; } -void Script::initialiseLocals(SegManager *segMan) { +void Script::initializeLocals(SegManager *segMan) { LocalVariables *locals = segMan->allocLocalsSegment(this); if (locals) { if (getSciVersion() > SCI_VERSION_0_EARLY) { @@ -509,7 +508,7 @@ void Script::initialiseLocals(SegManager *segMan) { } } -void Script::initialiseClasses(SegManager *segMan) { +void Script::initializeClasses(SegManager *segMan) { const byte *seeker = 0; uint16 mult = 0; @@ -581,7 +580,7 @@ void Script::initialiseClasses(SegManager *segMan) { } } -void Script::initialiseObjectsSci0(SegManager *segMan, SegmentId segmentId) { +void Script::initializeObjectsSci0(SegManager *segMan, SegmentId segmentId) { bool oldScriptHeader = (getSciVersion() == SCI_VERSION_0_EARLY); // We need to make two passes, as the objects in the script might be in the @@ -633,7 +632,7 @@ void Script::initialiseObjectsSci0(SegManager *segMan, SegmentId segmentId) { relocateSci0Sci21(make_reg(segmentId, relocationBlock - getBuf() + 4)); } -void Script::initialiseObjectsSci11(SegManager *segMan, SegmentId segmentId) { +void Script::initializeObjectsSci11(SegManager *segMan, SegmentId segmentId) { const byte *seeker = _heapStart + 4 + READ_SCI11ENDIAN_UINT16(_heapStart + 2) * 2; while (READ_SCI11ENDIAN_UINT16(seeker) == SCRIPT_OBJECT_MAGIC_NUMBER) { @@ -668,7 +667,7 @@ void Script::initialiseObjectsSci11(SegManager *segMan, SegmentId segmentId) { relocateSci0Sci21(make_reg(segmentId, READ_SCI11ENDIAN_UINT16(_heapStart))); } -void Script::initialiseObjectsSci3(SegManager *segMan, SegmentId segmentId) { +void Script::initializeObjectsSci3(SegManager *segMan, SegmentId segmentId) { const byte *seeker = getSci3ObjectsPointer(); while (READ_SCI11ENDIAN_UINT16(seeker) == SCRIPT_OBJECT_MAGIC_NUMBER) { @@ -682,13 +681,13 @@ void Script::initialiseObjectsSci3(SegManager *segMan, SegmentId segmentId) { relocateSci3(make_reg(segmentId, 0)); } -void Script::initialiseObjects(SegManager *segMan, SegmentId segmentId) { +void Script::initializeObjects(SegManager *segMan, SegmentId segmentId) { if (getSciVersion() <= SCI_VERSION_1_LATE) - initialiseObjectsSci0(segMan, segmentId); + initializeObjectsSci0(segMan, segmentId); else if (getSciVersion() >= SCI_VERSION_1_1 && getSciVersion() <= SCI_VERSION_2_1) - initialiseObjectsSci11(segMan, segmentId); + initializeObjectsSci11(segMan, segmentId); else if (getSciVersion() == SCI_VERSION_3) - initialiseObjectsSci3(segMan, segmentId); + initializeObjectsSci3(segMan, segmentId); } reg_t Script::findCanonicAddress(SegManager *segMan, reg_t addr) const { diff --git a/engines/sci/engine/script.h b/engines/sci/engine/script.h index 18d71577472..ff061e0e36c 100644 --- a/engines/sci/engine/script.h +++ b/engines/sci/engine/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_SCRIPT_H @@ -140,20 +137,20 @@ public: * Initializes the script's local variables * @param segMan A reference to the segment manager */ - void initialiseLocals(SegManager *segMan); + void initializeLocals(SegManager *segMan); /** * Adds the script's classes to the segment manager's class table * @param segMan A reference to the segment manager */ - void initialiseClasses(SegManager *segMan); + void initializeClasses(SegManager *segMan); /** * Initializes the script's objects (SCI0) * @param segMan A reference to the segment manager * @param segmentId The script's segment id */ - void initialiseObjects(SegManager *segMan, SegmentId segmentId); + void initializeObjects(SegManager *segMan, SegmentId segmentId); // script lock operations @@ -283,21 +280,21 @@ private: * @param segMan A reference to the segment manager * @param segmentId The script's segment id */ - void initialiseObjectsSci0(SegManager *segMan, SegmentId segmentId); + void initializeObjectsSci0(SegManager *segMan, SegmentId segmentId); /** * Initializes the script's objects (SCI1.1 - SCI2.1) * @param segMan A reference to the segment manager * @param segmentId The script's segment id */ - void initialiseObjectsSci11(SegManager *segMan, SegmentId segmentId); + void initializeObjectsSci11(SegManager *segMan, SegmentId segmentId); /** * Initializes the script's objects (SCI3) * @param segMan A reference to the segment manager * @param segmentId The script's segment id */ - void initialiseObjectsSci3(SegManager *segMan, SegmentId segmentId); + void initializeObjectsSci3(SegManager *segMan, SegmentId segmentId); }; } // End of namespace Sci diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index 06540e6f43f..2d3d8f6155e 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" @@ -865,6 +862,7 @@ const byte qfg3DialogCrash[] = { 0x34, 0xe7, 0x03, // ldi 3e7 (999) 0x22, // lt? 0x33, // jmp [back] ---> BUG! Infinite loop + 0 }; const uint16 qfg3PatchDialogCrash[] = { @@ -874,50 +872,9 @@ const uint16 qfg3PatchDialogCrash[] = { PATCH_END }; -// Part of script 47 that handles the barter icon checks for the wrong local. -// The local is supposed to contain the value returned by a previous kDisplay -// call, but since the wrong one is checked, it contains junk instead. We -// remove that check here (this doesn't affect the game at all). This occurs -// when attempting to purchase something from a vendor and the barter button is -// available (e.g. when buying the robe or meat from the associated vendors). -// Fixes bug #3292251. -const byte qfg3BarterCrash[] = { - 22, - 0x83, 0x10, // lal 10 ---> BUG! Wrong local - 0x30, 0x11, 0x00, // bnt 0011 ---> the accumulator will now contain garbage, so this check fails - 0x35, 0x00, // ldi 00 - 0xa5, 0x00, // sat 00 - 0x39, 0x03, // pushi 03 - 0x5b, 0x04, 0x00, // lea 04 00 - 0x36, // push - 0x39, 0x6c, // pushi 6c - 0x8b, 0x10, // lsl 10 ---> local 10 contains garbage, so the call below will fail - 0x43, 0x1b, 0x06 // callk Display[1b] 06 -}; - -// Same as above, but for local 0x11 -const byte qfg3BarterCrash2[] = { - 18, - 0x83, 0x11, // lal 11 ---> BUG! Wrong local - 0x30, 0x0d, 0x00, // bnt 000d ---> the accumulator will now contain garbage, so this check fails - 0x39, 0x03, // pushi 03 - 0x5b, 0x04, 0x00, // lea 04 00 - 0x36, // push - 0x39, 0x6c, // pushi 6c - 0x8b, 0x11, // lsl 11 ---> local 11 contains garbage, so the call below will fail - 0x43, 0x1b, 0x06 // callk Display[1b] 06 -}; - -const uint16 qfg3PatchBarterCrash[] = { - 0x35, 0x00, // ldi 00 ---> the accumulator will always be zero, so the problematic code won't run - PATCH_END -}; - // script, description, magic DWORD, adjust const SciScriptSignature qfg3Signatures[] = { { 23, "dialog crash", 1, PATCH_MAGICDWORD(0xe7, 0x03, 0x22, 0x33), -1, qfg3DialogCrash, qfg3PatchDialogCrash }, - { 47, "barter crash", 1, PATCH_MAGICDWORD(0x83, 0x10, 0x30, 0x11), 0, qfg3BarterCrash, qfg3PatchBarterCrash }, - { 47, "barter crash 2", 1, PATCH_MAGICDWORD(0x83, 0x11, 0x30, 0x0d), 0, qfg3BarterCrash2, qfg3PatchBarterCrash }, { 944, "import dialog continuous calls", 1, PATCH_MAGICDWORD(0x2a, 0x31, 0x0b, 0x7a), -1, qfg3SignatureImportDialog, qfg3PatchImportDialog }, SCI_SIGNATUREENTRY_TERMINATOR }; diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 596494d61b8..16098ab2756 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Script debugger functionality. Absolutely not threadsafe. @@ -34,6 +31,10 @@ namespace Sci { +// This table is only used for debugging. Don't include it for devices +// with not enough available memory (e.g. phones), where REDUCE_MEMORY_USAGE +// is defined +#ifndef REDUCE_MEMORY_USAGE const char *opcodeNames[] = { "bnot", "add", "sub", "mul", "div", "mod", "shr", "shl", "xor", "and", @@ -62,6 +63,7 @@ const char *opcodeNames[] = { "-agi", "-ali", "-ati", "-api", "-sgi", "-sli", "-sti", "-spi" }; +#endif // REDUCE_MEMORY_USAGE // Disassembles one command from the heap, returns address of next command or 0 if a ret was encountered. reg_t disassemble(EngineState *s, reg_t pos, bool printBWTag, bool printBytecode) { @@ -113,7 +115,9 @@ reg_t disassemble(EngineState *s, reg_t pos, bool printBWTag, bool printBytecode if (printBWTag) debugN("[%c] ", opsize ? 'B' : 'W'); +#ifndef REDUCE_MEMORY_USAGE debugN("%s", opcodeNames[opcode]); +#endif i = 0; while (g_opcode_formats[opcode][i]) { diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp index 0dc245a991b..ab67da32dbc 100644 --- a/engines/sci/engine/seg_manager.cpp +++ b/engines/sci/engine/seg_manager.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" @@ -1010,9 +1007,9 @@ int SegManager::instantiateScript(int scriptNum) { scr->init(scriptNum, _resMan); scr->load(_resMan); - scr->initialiseLocals(this); - scr->initialiseClasses(this); - scr->initialiseObjects(this, segmentId); + scr->initializeLocals(this); + scr->initializeClasses(this); + scr->initializeObjects(this, segmentId); return segmentId; } @@ -1023,7 +1020,7 @@ void SegManager::uninstantiateScript(int script_nr) { if (!scr || scr->isMarkedAsDeleted()) { // Is it already unloaded? //warning("unloading script 0x%x requested although not loaded", script_nr); - // This is perfectly valid SCI behaviour + // This is perfectly valid SCI behavior return; } diff --git a/engines/sci/engine/seg_manager.h b/engines/sci/engine/seg_manager.h index d402afbf1af..ab5aeacabfc 100644 --- a/engines/sci/engine/seg_manager.h +++ b/engines/sci/engine/seg_manager.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_SEGMAN_H @@ -74,7 +71,7 @@ public: */ Script *allocateScript(int script_nr, SegmentId *seg_id); - // The script must then be initialised; see section (1b.), below. + // The script must then be initialized; see section (1b.), below. /** * Forcefully deallocate a previously allocated script. diff --git a/engines/sci/engine/segment.cpp b/engines/sci/engine/segment.cpp index 2bb77c707af..5d8a81a7f1e 100644 --- a/engines/sci/engine/segment.cpp +++ b/engines/sci/engine/segment.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h index 947953e8c39..009a2558ce8 100644 --- a/engines/sci/engine/segment.h +++ b/engines/sci/engine/segment.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_SEGMENT_H @@ -134,7 +131,7 @@ public: /** * Iterates over all references reachable from the specified object. * Used by the garbage collector. - * @param object object (within the current segment) to analyse + * @param object object (within the current segment) to analyze * @return a list of outgoing references within the object * * @note This function may also choose to report numbers (segment 0) as adresses diff --git a/engines/sci/engine/selector.cpp b/engines/sci/engine/selector.cpp index 957a836e3e9..2edbea9676d 100644 --- a/engines/sci/engine/selector.cpp +++ b/engines/sci/engine/selector.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/engine/selector.h b/engines/sci/engine/selector.h index 8a479842042..f13c13e00cb 100644 --- a/engines/sci/engine/selector.h +++ b/engines/sci/engine/selector.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_SELECTOR_H @@ -47,7 +44,7 @@ struct SelectorCache { Selector underBits; ///< Used by the graphics subroutines to store backupped BG pic data Selector nsTop, nsLeft, nsBottom, nsRight; ///< View boundaries ('now seen') Selector lsTop, lsLeft, lsBottom, lsRight; ///< Used by Animate() subfunctions and scroll list controls - Selector signal; ///< Used by Animate() to control a view's behaviour + Selector signal; ///< Used by Animate() to control a view's behavior Selector illegalBits; ///< Used by CanBeHere Selector brTop, brLeft, brBottom, brRight; ///< Bounding Rectangle // name, key, time diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp index f9d6c70389f..e094ed3bd77 100644 --- a/engines/sci/engine/state.cpp +++ b/engines/sci/engine/state.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h index cd6d56500a8..dcffe6dbb32 100644 --- a/engines/sci/engine/state.h +++ b/engines/sci/engine/state.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_INCLUDE_ENGINE_H diff --git a/engines/sci/engine/static_selectors.cpp b/engines/sci/engine/static_selectors.cpp index 23241de3306..6526eff2dbe 100644 --- a/engines/sci/engine/static_selectors.cpp +++ b/engines/sci/engine/static_selectors.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // We place selector vocab name tables here for any game that doesn't have diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index b4418150147..499574957ef 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" @@ -117,7 +114,9 @@ static bool validate_variable(reg_t *r, reg_t *stack_base, int type, int max, in return true; } +#ifndef REDUCE_MEMORY_USAGE extern const char *opcodeNames[]; // from scriptdebug.cpp +#endif static reg_t read_var(EngineState *s, int type, int index) { if (validate_variable(s->variables[type], s->stack_base, type, s->variablesMax[type], index)) { diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h index 5947579aa34..36eadfa1c26 100644 --- a/engines/sci/engine/vm.h +++ b/engines/sci/engine/vm.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_VM_H diff --git a/engines/sci/engine/vm_types.cpp b/engines/sci/engine/vm_types.cpp index e606fa1f86b..71a28a97613 100644 --- a/engines/sci/engine/vm_types.cpp +++ b/engines/sci/engine/vm_types.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/engine/vm_types.h b/engines/sci/engine/vm_types.h index b927df339e5..dc87cf758a7 100644 --- a/engines/sci/engine/vm_types.h +++ b/engines/sci/engine/vm_types.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_VM_TYPES_H diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp index 20d6cd0dd0c..fa25b02a8f9 100644 --- a/engines/sci/engine/workarounds.cpp +++ b/engines/sci/engine/workarounds.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/engine/kernel.h" @@ -213,7 +210,10 @@ const SciWorkaroundEntry kDisplay_workarounds[] = { { GID_PQ2, 23, 23, 0, "rm23Script", "elements", 0x4ae, 0, { WORKAROUND_IGNORE, 0 } }, // when looking at the 2nd page of pate's file - 0x75 as id { GID_PQ2, 23, 23, 0, "rm23Script", "elements", 0x4c1, 0, { WORKAROUND_IGNORE, 0 } }, // when looking at the 2nd page of pate's file - 0x75 as id (another pq2 version, bug #3043904) { GID_QFG1, 11, 11, 0, "battle", "", -1, 0, { WORKAROUND_IGNORE, 0 } }, // DEMO: When entering battle, 0x75 as id + { GID_QFG3, -1, 47, 0, "barterWin", "open", 0x1426, 0, { WORKAROUND_IGNORE, 0 } }, // sometimes when talking with a vendor that can be bartered with, the wrong local variable is checked and the variable contents are wrong - bug #3292251 + { GID_QFG3, -1, 47, 0, "barterIcon", "show", 0x135c, 0, { WORKAROUND_IGNORE, 0 } }, // sometimes when talking with a vendor that can be bartered with, the wrong local variable is checked and the variable contents are wrong - bug #3292251 { GID_SQ1, -1, 700, 0, "arcadaRegion", "doit", -1, 0, { WORKAROUND_IGNORE, 0 } }, // restoring in some rooms of the arcada (right at the start) + { GID_SQ1, 44, 44, 0, "spinDone", "changeState",0x13b0, 0, { WORKAROUND_IGNORE, 0 } }, // restoring a game at the slot machine in Ulence Flats (bug #3308087) { GID_SQ4, 397, 0, 0, "", "export 12", -1, 0, { WORKAROUND_IGNORE, 0 } }, // FLOPPY: when going into the computer store (bug #3044044) { GID_SQ4, 391, 391, 0, "doCatalog", "mode", 0x84, 0, { WORKAROUND_IGNORE, 0 } }, // CD: clicking on catalog in roboter sale - a parameter is an object { GID_SQ4, 391, 391, 0, "choosePlug", "changeState", -1, 0, { WORKAROUND_IGNORE, 0 } }, // CD: ordering connector in roboter sale - a parameter is an object @@ -230,7 +230,7 @@ const SciWorkaroundEntry kDirLoop_workarounds[] = { const SciWorkaroundEntry kDisposeScript_workarounds[] = { { GID_LAURABOW, 777, 777, 0, "myStab", "changeState", -1, 0, { WORKAROUND_IGNORE, 0 } }, // DEMO: after the will is signed, parameter 0 is an object - bug #3034907 { GID_QFG1, -1, 64, 0, "rm64", "dispose", -1, 0, { WORKAROUND_IGNORE, 0 } }, // when leaving graveyard, parameter 0 is an object - { GID_SQ4, 150, 151, 0, "fightScript", "dispose", -1, 0, { WORKAROUND_IGNORE, 0 } }, // during fight with vohaul, parameter 0 is an object + { GID_SQ4, 150, 151, 0, "fightScript", "dispose", -1, 0, { WORKAROUND_IGNORE, 0 } }, // during fight with Vohaul, parameter 0 is an object { GID_SQ4, 150, 152, 0, "driveCloseUp", "dispose", -1, 0, { WORKAROUND_IGNORE, 0 } }, // when choosing "beam download", parameter 0 is an object SCI_WORKAROUNDENTRY_TERMINATOR }; diff --git a/engines/sci/engine/workarounds.h b/engines/sci/engine/workarounds.h index c7721aa7871..59054ae5522 100644 --- a/engines/sci/engine/workarounds.h +++ b/engines/sci/engine/workarounds.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_WORKAROUNDS_H diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp index 6b5ea64fc44..74879f6c63d 100644 --- a/engines/sci/event.cpp +++ b/engines/sci/event.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" @@ -253,7 +250,7 @@ SciEvent EventManager::getScummVMEvent() { // When Ctrl AND Alt are pressed together with a regular key, Linux will give us control-key, Windows will give // us the actual key. My opinion is that windows is right, because under DOS the keys worked the same, anyway // we support the other case as well - if ((modifiers & Common::KBD_SHIFT) && input.character > 0 && input.character < 27) + if ((modifiers & Common::KBD_ALT) && input.character > 0 && input.character < 27) input.character += 96; // 0x01 -> 'a' if (getSciVersion() <= SCI_VERSION_1_MIDDLE) { diff --git a/engines/sci/event.h b/engines/sci/event.h index be0322f2a47..930001160ad 100644 --- a/engines/sci/event.h +++ b/engines/sci/event.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_EVENT_H diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp index d8f3fa09b02..c36ecd112aa 100644 --- a/engines/sci/graphics/animate.cpp +++ b/engines/sci/graphics/animate.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" @@ -233,7 +230,7 @@ void GfxAnimate::adjustInvalidCels(GfxView *view, AnimateList::iterator it) { // this seems to be completely crazy code // sierra sci checked signed int16 to be above or equal the counts and reseted to 0 in those cases // later during view processing those are compared unsigned again and then set to maximum count - 1 - // Games rely on this behaviour. For example laura bow 1 has a knight standing around in room 37 + // Games rely on this behavior. For example laura bow 1 has a knight standing around in room 37 // which has cel set to 3. This cel does not exist and the actual knight is 0 // In kq5 on the other hand during the intro, when the trunk is opened, cel is set to some real // high number, which is negative when considered signed. This actually requires to get fixed to diff --git a/engines/sci/graphics/animate.h b/engines/sci/graphics/animate.h index b2aadcbead4..5e2e39ea1ac 100644 --- a/engines/sci/graphics/animate.h +++ b/engines/sci/graphics/animate.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_ANIMATE_H diff --git a/engines/sci/graphics/cache.cpp b/engines/sci/graphics/cache.cpp index 25475c727f9..d2bd76ac99b 100644 --- a/engines/sci/graphics/cache.cpp +++ b/engines/sci/graphics/cache.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/sci/graphics/cache.h b/engines/sci/graphics/cache.h index 140c96ecd04..c090cda7d70 100644 --- a/engines/sci/graphics/cache.h +++ b/engines/sci/graphics/cache.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_CACHE_H diff --git a/engines/sci/graphics/compare.cpp b/engines/sci/graphics/compare.cpp index db926f29623..1dbe279f8a5 100644 --- a/engines/sci/graphics/compare.cpp +++ b/engines/sci/graphics/compare.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/sci/graphics/compare.h b/engines/sci/graphics/compare.h index 1079f5f98cd..83b4f49c083 100644 --- a/engines/sci/graphics/compare.h +++ b/engines/sci/graphics/compare.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_GFX_H diff --git a/engines/sci/graphics/controls.cpp b/engines/sci/graphics/controls.cpp index f42946fbea2..0289735c0a1 100644 --- a/engines/sci/graphics/controls.cpp +++ b/engines/sci/graphics/controls.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/sci/graphics/controls.h b/engines/sci/graphics/controls.h index 9beaebe5323..17e7c393189 100644 --- a/engines/sci/graphics/controls.h +++ b/engines/sci/graphics/controls.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_CONTROLS_H diff --git a/engines/sci/graphics/coordadjuster.cpp b/engines/sci/graphics/coordadjuster.cpp index bbeade87b59..2952d4da7ba 100644 --- a/engines/sci/graphics/coordadjuster.cpp +++ b/engines/sci/graphics/coordadjuster.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/sci/graphics/coordadjuster.h b/engines/sci/graphics/coordadjuster.h index 59afd1dcb7c..1b8a3e2679a 100644 --- a/engines/sci/graphics/coordadjuster.h +++ b/engines/sci/graphics/coordadjuster.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_COORDADJUSTER_H diff --git a/engines/sci/graphics/cursor.cpp b/engines/sci/graphics/cursor.cpp index d4d7dcfd4f4..ec49a388146 100644 --- a/engines/sci/graphics/cursor.cpp +++ b/engines/sci/graphics/cursor.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -255,10 +252,10 @@ void GfxCursor::setPosition(Common::Point pos) { // Some games display a new menu, set mouse position somewhere within and // expect it to be in there. This is fine for a real mouse, but on wii using // wii-mote or touch interfaces this won't work. In fact on those platforms - // the menus will close immediately because of that behaviour. + // the menus will close immediately because of that behavior. // We identify those cases and set a reaction-rect. If the mouse it outside // of that rect, we won't report the position back to the scripts. - // As soon as the mouse was inside once, we will revert to normal behaviour + // As soon as the mouse was inside once, we will revert to normal behavior // Currently this code is enabled for all platforms, especially because we can't // differentiate between e.g. Windows used via mouse and Windows used via touchscreen // The workaround won't hurt real-mouse platforms diff --git a/engines/sci/graphics/cursor.h b/engines/sci/graphics/cursor.h index 271cf507e0e..25109b39202 100644 --- a/engines/sci/graphics/cursor.h +++ b/engines/sci/graphics/cursor.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_CURSOR_H diff --git a/engines/sci/graphics/font.cpp b/engines/sci/graphics/font.cpp index 760f4158ea8..fcdd0575094 100644 --- a/engines/sci/graphics/font.cpp +++ b/engines/sci/graphics/font.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/graphics/font.h b/engines/sci/graphics/font.h index 9d2b37c1f2d..8e5c980e2cd 100644 --- a/engines/sci/graphics/font.h +++ b/engines/sci/graphics/font.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_FONT_H diff --git a/engines/sci/graphics/fontsjis.cpp b/engines/sci/graphics/fontsjis.cpp index 73229a6e937..ac58c554230 100644 --- a/engines/sci/graphics/fontsjis.cpp +++ b/engines/sci/graphics/fontsjis.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/graphics/fontsjis.h b/engines/sci/graphics/fontsjis.h index 5538b5c2c5c..c4ae4ab5802 100644 --- a/engines/sci/graphics/fontsjis.h +++ b/engines/sci/graphics/fontsjis.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_FONTSJIS_H diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index 7fafe843fdb..11948d5d38c 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/algorithm.h" diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h index 347ecb9424b..7e5b1a5006e 100644 --- a/engines/sci/graphics/frameout.h +++ b/engines/sci/graphics/frameout.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_FRAMEOUT_H diff --git a/engines/sci/graphics/helpers.h b/engines/sci/graphics/helpers.h index 343f3c7e6ee..773f83a00eb 100644 --- a/engines/sci/graphics/helpers.h +++ b/engines/sci/graphics/helpers.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_HELPERS_H diff --git a/engines/sci/graphics/maciconbar.cpp b/engines/sci/graphics/maciconbar.cpp index 6cf4f269a76..bff145ad536 100644 --- a/engines/sci/graphics/maciconbar.cpp +++ b/engines/sci/graphics/maciconbar.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/graphics/maciconbar.h b/engines/sci/graphics/maciconbar.h index 72609d19ab6..43de37a904c 100644 --- a/engines/sci/graphics/maciconbar.h +++ b/engines/sci/graphics/maciconbar.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_MACICONBAR_H diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp index 50ba77e8324..9d4ab3f589f 100644 --- a/engines/sci/graphics/menu.cpp +++ b/engines/sci/graphics/menu.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/sci/graphics/menu.h b/engines/sci/graphics/menu.h index a6ac4d1d4cd..aa3550da4eb 100644 --- a/engines/sci/graphics/menu.h +++ b/engines/sci/graphics/menu.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_MENU_H diff --git a/engines/sci/graphics/paint.cpp b/engines/sci/graphics/paint.cpp index 27a0bdfc447..7befa99afeb 100644 --- a/engines/sci/graphics/paint.cpp +++ b/engines/sci/graphics/paint.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "graphics/primitives.h" diff --git a/engines/sci/graphics/paint.h b/engines/sci/graphics/paint.h index a79e8993c2a..efeaa38875f 100644 --- a/engines/sci/graphics/paint.h +++ b/engines/sci/graphics/paint.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_PAINT_H diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp index 5172f7cdc06..75fef0a3ec4 100644 --- a/engines/sci/graphics/paint16.cpp +++ b/engines/sci/graphics/paint16.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/graphics/paint16.h b/engines/sci/graphics/paint16.h index 69ddf09ea6a..31916599baf 100644 --- a/engines/sci/graphics/paint16.h +++ b/engines/sci/graphics/paint16.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_PAINT16_H diff --git a/engines/sci/graphics/paint32.cpp b/engines/sci/graphics/paint32.cpp index f277436631b..a9590c829a6 100644 --- a/engines/sci/graphics/paint32.cpp +++ b/engines/sci/graphics/paint32.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/graphics/paint32.h b/engines/sci/graphics/paint32.h index e412bdf1c49..dd4246c507e 100644 --- a/engines/sci/graphics/paint32.h +++ b/engines/sci/graphics/paint32.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_PAINT32_H diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp index 42551e93696..899ef10b33a 100644 --- a/engines/sci/graphics/palette.cpp +++ b/engines/sci/graphics/palette.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/sci/graphics/palette.h b/engines/sci/graphics/palette.h index d2e5151d6ab..9b0c45baf66 100644 --- a/engines/sci/graphics/palette.h +++ b/engines/sci/graphics/palette.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_PALETTE_H diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index 8cdd46268af..6529a6ae640 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/stack.h" diff --git a/engines/sci/graphics/picture.h b/engines/sci/graphics/picture.h index 7cd0d71b67a..78623d5e091 100644 --- a/engines/sci/graphics/picture.h +++ b/engines/sci/graphics/picture.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_PICTURE_H diff --git a/engines/sci/graphics/portrait.cpp b/engines/sci/graphics/portrait.cpp index 3f9ebaa07a5..8cd8cdb0336 100644 --- a/engines/sci/graphics/portrait.cpp +++ b/engines/sci/graphics/portrait.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/archive.h" diff --git a/engines/sci/graphics/portrait.h b/engines/sci/graphics/portrait.h index 7da9425c9df..75baa9a56ba 100644 --- a/engines/sci/graphics/portrait.h +++ b/engines/sci/graphics/portrait.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_PORTRAITS_H diff --git a/engines/sci/graphics/ports.cpp b/engines/sci/graphics/ports.cpp index cc206bd5b9c..9412976d5b8 100644 --- a/engines/sci/graphics/ports.cpp +++ b/engines/sci/graphics/ports.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/sci/graphics/ports.h b/engines/sci/graphics/ports.h index 31ed671daf9..1818eaddb37 100644 --- a/engines/sci/graphics/ports.h +++ b/engines/sci/graphics/ports.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_PORTS_H diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index 56e6759fac3..2446ea545e5 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/timer.h" diff --git a/engines/sci/graphics/screen.h b/engines/sci/graphics/screen.h index bfe0a50b81d..73ea596ba11 100644 --- a/engines/sci/graphics/screen.h +++ b/engines/sci/graphics/screen.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_SCREEN_H diff --git a/engines/sci/graphics/text16.cpp b/engines/sci/graphics/text16.cpp index 6269a584929..c2f71a0e54f 100644 --- a/engines/sci/graphics/text16.cpp +++ b/engines/sci/graphics/text16.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" @@ -469,7 +466,7 @@ void GfxText16::Box(const char *text, bool show, const Common::Rect &rect, TextA if (doubleByteMode) { // Kanji is written by pc98 rom to screen directly. Because of - // GetLongest() behaviour (not cutting off the last char, that causes a + // GetLongest() behavior (not cutting off the last char, that causes a // new line), results in the script thinking that the text would need // less space. The coordinate adjustment in fontsjis.cpp handles the // incorrect centering because of that and this code actually shows all diff --git a/engines/sci/graphics/text16.h b/engines/sci/graphics/text16.h index 3ed23614974..b33c2c4df0d 100644 --- a/engines/sci/graphics/text16.h +++ b/engines/sci/graphics/text16.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_TEXT16_H diff --git a/engines/sci/graphics/transitions.cpp b/engines/sci/graphics/transitions.cpp index dde1be13aba..1256db89691 100644 --- a/engines/sci/graphics/transitions.cpp +++ b/engines/sci/graphics/transitions.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/events.h" diff --git a/engines/sci/graphics/transitions.h b/engines/sci/graphics/transitions.h index a8f0ca6f072..246f681690c 100644 --- a/engines/sci/graphics/transitions.h +++ b/engines/sci/graphics/transitions.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_TRANSITIONS_H diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp index f31cbacb226..5c8e9c3d2ea 100644 --- a/engines/sci/graphics/view.cpp +++ b/engines/sci/graphics/view.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/graphics/view.h b/engines/sci/graphics/view.h index 36914f916c0..19ef2e62f83 100644 --- a/engines/sci/graphics/view.h +++ b/engines/sci/graphics/view.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_VIEW_H diff --git a/engines/sci/parser/grammar.cpp b/engines/sci/parser/grammar.cpp index b330a432e3a..6e02eb75e36 100644 --- a/engines/sci/parser/grammar.cpp +++ b/engines/sci/parser/grammar.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* Functionality to transform the context-free SCI grammar rules into diff --git a/engines/sci/parser/said.cpp b/engines/sci/parser/said.cpp index 666a235cf9d..827e28073a8 100644 --- a/engines/sci/parser/said.cpp +++ b/engines/sci/parser/said.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/engine/state.h" diff --git a/engines/sci/parser/vocabulary.cpp b/engines/sci/parser/vocabulary.cpp index 25043401ccc..a5c4686b3b5 100644 --- a/engines/sci/parser/vocabulary.cpp +++ b/engines/sci/parser/vocabulary.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Main vocabulary support functions and word lookup @@ -395,9 +392,11 @@ void Vocabulary::lookupWord(ResultWordList& retval, const char *word, int word_l // SCI01 was the first version to support // multiple matches, so no need to look further // in earlier versions. - if (getSciVersion() < SCI_VERSION_01) - return; + // In versions that do support multiple matches, it seems + // that SSCI also aborts early when it finds an exact match in the + // dictionary. + return; } // Now try all suffixes diff --git a/engines/sci/parser/vocabulary.h b/engines/sci/parser/vocabulary.h index 6d3e0b301e7..e4a7e41b3cf 100644 --- a/engines/sci/parser/vocabulary.h +++ b/engines/sci/parser/vocabulary.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_SCICORE_VOCABULARY_H diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index a48ae0fad74..308bd92ef42 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Resource library diff --git a/engines/sci/resource.h b/engines/sci/resource.h index e941f666d99..f450f1b3971 100644 --- a/engines/sci/resource.h +++ b/engines/sci/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_RESOURCE_H diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp index 1e0b9c0ddfe..588ea76ea5f 100644 --- a/engines/sci/resource_audio.cpp +++ b/engines/sci/resource_audio.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Resource library diff --git a/engines/sci/resource_intern.h b/engines/sci/resource_intern.h index 969e250e621..e8e66503d80 100644 --- a/engines/sci/resource_intern.h +++ b/engines/sci/resource_intern.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_RESOURCE_INTERN_H diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index 8a81ea72400..cc9042ceb7d 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -18,16 +18,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" #include "common/config-manager.h" #include "common/debug-channels.h" -#include "common/EventRecorder.h" -#include "common/file.h" // for Common::File::exists() #include "engines/advancedDetector.h" #include "engines/util.h" @@ -78,7 +73,7 @@ SciEngine *g_sci = 0; class GfxDriver; SciEngine::SciEngine(OSystem *syst, const ADGameDescription *desc, SciGameId gameId) - : Engine(syst), _gameDescription(desc), _gameId(gameId) { + : Engine(syst), _gameDescription(desc), _gameId(gameId), _rng("sci") { assert(g_sci == 0); g_sci = this; @@ -186,8 +181,6 @@ SciEngine::~SciEngine() { extern void showScummVMDialog(const Common::String &message); Common::Error SciEngine::run() { - g_eventRec.registerRandomSource(_rng, "sci"); - // Assign default values to the config manager, in case settings are missing ConfMan.registerDefault("sci_originalsaveload", "false"); ConfMan.registerDefault("native_fb01", "false"); @@ -220,8 +213,6 @@ Common::Error SciEngine::run() { _gfxScreen = new GfxScreen(_resMan); _gfxScreen->enableUndithering(ConfMan.getBool("disable_dithering")); - // Create debugger console. It requires GFX to be initialized - _console = new Console(this); _kernel = new Kernel(_resMan, segMan); _features = new GameFeatures(segMan, _kernel); @@ -234,6 +225,9 @@ Common::Error SciEngine::run() { _gamestate = new EngineState(segMan); _eventMan = new EventManager(_resMan->detectFontExtended()); + // Create debugger console. It requires GFX and _gamestate to be initialized + _console = new Console(this); + // The game needs to be initialized before the graphics system is initialized, as // the graphics code checks parts of the seg manager upon initialization (e.g. for // the presence of the fastCast object) diff --git a/engines/sci/sci.h b/engines/sci/sci.h index cd50b2402c1..a3404473542 100644 --- a/engines/sci/sci.h +++ b/engines/sci/sci.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_H diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp index 53311b4252d..592caa58149 100644 --- a/engines/sci/sound/audio.cpp +++ b/engines/sci/sound/audio.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/resource.h" diff --git a/engines/sci/sound/audio.h b/engines/sci/sound/audio.h index 4cc8575a21d..e0ba234b12e 100644 --- a/engines/sci/sound/audio.h +++ b/engines/sci/sound/audio.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* Sound engine */ diff --git a/engines/sci/sound/drivers/adlib.cpp b/engines/sci/sound/drivers/adlib.cpp index f00c99d5b51..add3d8851fd 100644 --- a/engines/sci/sound/drivers/adlib.cpp +++ b/engines/sci/sound/drivers/adlib.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/sound/drivers/amigamac.cpp b/engines/sci/sound/drivers/amigamac.cpp index 7ee8d21f866..158b4b08fb3 100644 --- a/engines/sci/sound/drivers/amigamac.cpp +++ b/engines/sci/sound/drivers/amigamac.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/softsynth/emumidi.h" diff --git a/engines/sci/sound/drivers/cms.cpp b/engines/sci/sound/drivers/cms.cpp index 47c59a1e3db..ace96ba4996 100644 --- a/engines/sci/sound/drivers/cms.cpp +++ b/engines/sci/sound/drivers/cms.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sound/drivers/mididriver.h" diff --git a/engines/sci/sound/drivers/fb01.cpp b/engines/sci/sound/drivers/fb01.cpp index f217738bb29..9f3945bbecf 100644 --- a/engines/sci/sound/drivers/fb01.cpp +++ b/engines/sci/sound/drivers/fb01.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/sound/drivers/gm_names.h b/engines/sci/sound/drivers/gm_names.h index b7883494f6e..bfe5ff88c70 100644 --- a/engines/sci/sound/drivers/gm_names.h +++ b/engines/sci/sound/drivers/gm_names.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_SOUND_DRIVERS_GM_NAMES_H @@ -28,6 +25,11 @@ namespace Sci { +// These tables are only used for debugging. Don't include them for devices +// with not enough available memory (e.g. phones), where REDUCE_MEMORY_USAGE +// is defined +#ifndef REDUCE_MEMORY_USAGE + static const char *GmInstrumentNames[] = { /*000*/ "Acoustic Grand Piano", /*001*/ "Bright Acoustic Piano", @@ -215,6 +217,8 @@ static const char *GmPercussionNames[] = { /*81*/ "Open Triangle" }; +#endif // REDUCE_MEMORY_USAGE + } // End of namespace Sci #endif // SCI_SOUND_DRIVERS_GM_NAMES_H diff --git a/engines/sci/sound/drivers/map-mt32-to-gm.h b/engines/sci/sound/drivers/map-mt32-to-gm.h index f7a6256ba4d..12a36aa51c6 100644 --- a/engines/sci/sound/drivers/map-mt32-to-gm.h +++ b/engines/sci/sound/drivers/map-mt32-to-gm.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_SOUND_DRIVERS_MAP_MT32_TO_GM_H diff --git a/engines/sci/sound/drivers/midi.cpp b/engines/sci/sound/drivers/midi.cpp index f36aac3a2a0..93a2308410b 100644 --- a/engines/sci/sound/drivers/midi.cpp +++ b/engines/sci/sound/drivers/midi.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" @@ -819,11 +816,13 @@ void MidiPlayer_Midi::mapMt32ToGm(byte *data, size_t size) { if (_patchMap[i] == MIDI_UNMAPPED) { debugC(kDebugLevelSound, "[Unmapped]"); } else { +#ifndef REDUCE_MEMORY_USAGE if (_patchMap[i] >= 128) { debugC(kDebugLevelSound, "%s [Rhythm]", GmPercussionNames[_patchMap[i] - 128]); } else { debugC(kDebugLevelSound, "%s", GmInstrumentNames[_patchMap[i]]); } +#endif } _keyShift[i] = CLIP(keyshift, 0, 48) - 24; @@ -855,10 +854,12 @@ void MidiPlayer_Midi::mapMt32ToGm(byte *data, size_t size) { } } +#ifndef REDUCE_MEMORY_USAGE if (_percussionMap[ins] == MIDI_UNMAPPED) debugC(kDebugLevelSound, "[Unmapped]"); else debugC(kDebugLevelSound, "%s", GmPercussionNames[_percussionMap[ins]]); +#endif _percussionVelocityScale[ins] = *(data + pos + 4 * i + 3) * 127 / 100; } diff --git a/engines/sci/sound/drivers/mididriver.h b/engines/sci/sound/drivers/mididriver.h index 2038725dbe0..ec66984bd4e 100644 --- a/engines/sci/sound/drivers/mididriver.h +++ b/engines/sci/sound/drivers/mididriver.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_SFX_SOFTSEQ_MIDIDRIVER_H diff --git a/engines/sci/sound/drivers/pcjr.cpp b/engines/sci/sound/drivers/pcjr.cpp index 4b1efb3c87d..1d823b643dd 100644 --- a/engines/sci/sound/drivers/pcjr.cpp +++ b/engines/sci/sound/drivers/pcjr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sound/drivers/mididriver.h" diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp index 0b9d7617b85..95b165468d4 100644 --- a/engines/sci/sound/midiparser_sci.cpp +++ b/engines/sci/sound/midiparser_sci.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/engine/kernel.h" @@ -224,6 +221,7 @@ byte *MidiParser_SCI::midiFilterChannels(int channelMask) { byte command = 0, lastCommand = 0; int delta = 0; int midiParamCount = 0; + bool containsMidiData = false; _mixedData = outData; @@ -250,6 +248,9 @@ byte *MidiParser_SCI::midiFilterChannels(int channelMask) { } } if ((1 << curChannel) & channelMask) { + if (curChannel != 0xF) + containsMidiData = true; + if (command != kEndOfTrack) { // Write delta while (delta > 240) { @@ -307,6 +308,11 @@ byte *MidiParser_SCI::midiFilterChannels(int channelMask) { *outData++ = 0x00; *outData++ = 0x00; + // This occurs in the music tracks of LB1 Amiga, when using the MT-32 + // driver (bug #3297881) + if (!containsMidiData) + warning("MIDI parser: the requested SCI0 sound has no MIDI note data for the currently selected sound driver"); + return _mixedData; } diff --git a/engines/sci/sound/midiparser_sci.h b/engines/sci/sound/midiparser_sci.h index 39de425e182..82f34070a40 100644 --- a/engines/sci/sound/midiparser_sci.h +++ b/engines/sci/sound/midiparser_sci.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_MIDIPARSER_H diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp index c7743ac587a..96cbf135ed9 100644 --- a/engines/sci/sound/music.cpp +++ b/engines/sci/sound/music.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/audiostream.h" diff --git a/engines/sci/sound/music.h b/engines/sci/sound/music.h index dfe5ad1586c..8577ed73137 100644 --- a/engines/sci/sound/music.h +++ b/engines/sci/sound/music.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_MUSIC_H diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index a2b09eab4cb..4ea290ff9e3 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/engines/sci/sound/soundcmd.h b/engines/sci/sound/soundcmd.h index cae72e2cdb4..a542a8b384d 100644 --- a/engines/sci/sound/soundcmd.h +++ b/engines/sci/sound/soundcmd.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_SOUNDCMD_H diff --git a/engines/sci/util.cpp b/engines/sci/util.cpp index f346adddeb5..4f09bb7a553 100644 --- a/engines/sci/util.cpp +++ b/engines/sci/util.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/sci/util.h b/engines/sci/util.h index 7a2abb1873a..0da5063a690 100644 --- a/engines/sci/util.h +++ b/engines/sci/util.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_UTIL_H diff --git a/engines/sci/video/robot_decoder.cpp b/engines/sci/video/robot_decoder.cpp index debc75dffd8..d394fd0b2be 100644 --- a/engines/sci/video/robot_decoder.cpp +++ b/engines/sci/video/robot_decoder.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/archive.h" diff --git a/engines/sci/video/robot_decoder.h b/engines/sci/video/robot_decoder.h index aeb638e0196..3f935824189 100644 --- a/engines/sci/video/robot_decoder.h +++ b/engines/sci/video/robot_decoder.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_VIDEO_ROBOT_DECODER_H diff --git a/engines/sci/video/seq_decoder.cpp b/engines/sci/video/seq_decoder.cpp index 71684968938..abd64911a79 100644 --- a/engines/sci/video/seq_decoder.cpp +++ b/engines/sci/video/seq_decoder.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/sci/video/seq_decoder.h b/engines/sci/video/seq_decoder.h index 70d3985ec5a..f5e8ad9b050 100644 --- a/engines/sci/video/seq_decoder.h +++ b/engines/sci/video/seq_decoder.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_VIDEO_SEQ_DECODER_H diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp index 13581c4b45a..e4057d1f135 100644 --- a/engines/scumm/actor.cpp +++ b/engines/scumm/actor.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" // for setFocusRectangle/clearFocusRectangle @@ -177,9 +174,21 @@ void Actor::setBox(int box) { } void Actor_v3::setupActorScale() { - // TODO: The following could probably be removed - _scalex = 0xFF; - _scaley = 0xFF; + // WORKAROUND bug #1463598: Under certain circumstances, it is possible + // for Henry Sr. to reach the front side of Castle Brunwald (following + // Indy there). But it seems the game has no small costume for Henry, + // hence he is shown as a giant, triple in size compared to Indy. + // To workaround this, we override the scale of Henry. Since V3 games + // like Indy3 don't use the costume scale otherwise, this works fine. + // The scale factor 0x50 was determined by some guess work. + if (_number == 2 && _costume == 7 && _vm->_game.id == GID_INDY3 && _vm->_currentRoom == 12) { + _scalex = 0x50; + _scaley = 0x50; + } else { + // TODO: The following could probably be removed + _scalex = 0xFF; + _scaley = 0xFF; + } } void Actor::setupActorScale() { @@ -2738,7 +2747,7 @@ void Actor::saveLoadWithSerializer(Serializer *ser) { if (ser->isLoading()) { // Not all actor data is saved; so when loading, we first reset - // the actor, to ensure completely reproducible behaviour (else, + // the actor, to ensure completely reproducible behavior (else, // some not saved value in the actor class can cause odd things) initActor(-1); } diff --git a/engines/scumm/actor.h b/engines/scumm/actor.h index 8e699b5a499..1584d0a78b0 100644 --- a/engines/scumm/actor.h +++ b/engines/scumm/actor.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/actor_he.h b/engines/scumm/actor_he.h index bb7bbb6487a..24b632d00e2 100644 --- a/engines/scumm/actor_he.h +++ b/engines/scumm/actor_he.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/akos.cpp b/engines/scumm/akos.cpp index 8acbb8058ed..b6acf01050f 100644 --- a/engines/scumm/akos.cpp +++ b/engines/scumm/akos.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/scumm.h" @@ -30,6 +27,7 @@ #include "scumm/imuse/imuse.h" #include "scumm/imuse_digi/dimuse.h" #include "scumm/he/intern_he.h" +#include "scumm/resource.h" #include "scumm/scumm_v7.h" #include "scumm/sound.h" #include "scumm/util.h" diff --git a/engines/scumm/akos.h b/engines/scumm/akos.h index 9f4f09d4dc8..bd42aedcbdb 100644 --- a/engines/scumm/akos.h +++ b/engines/scumm/akos.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_AKOS_H diff --git a/engines/scumm/base-costume.cpp b/engines/scumm/base-costume.cpp index 2aecb3dfddd..46c68c81b09 100644 --- a/engines/scumm/base-costume.cpp +++ b/engines/scumm/base-costume.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/base-costume.h b/engines/scumm/base-costume.h index d586b211f3e..652655c24ee 100644 --- a/engines/scumm/base-costume.h +++ b/engines/scumm/base-costume.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_BASE_COSTUME_H diff --git a/engines/scumm/bomp.cpp b/engines/scumm/bomp.cpp index 18db89be1f3..845cf707229 100644 --- a/engines/scumm/bomp.cpp +++ b/engines/scumm/bomp.cpp @@ -17,9 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/bomp.h b/engines/scumm/bomp.h index 8f64b54f7c8..b2d042daae5 100644 --- a/engines/scumm/bomp.h +++ b/engines/scumm/bomp.h @@ -17,9 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_BOMP_H diff --git a/engines/scumm/boxes.cpp b/engines/scumm/boxes.cpp index 15d5f04ed5a..64d4d7422c7 100644 --- a/engines/scumm/boxes.cpp +++ b/engines/scumm/boxes.cpp @@ -18,14 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/scumm.h" #include "scumm/actor.h" #include "scumm/boxes.h" +#include "scumm/resource.h" #include "scumm/scumm_v0.h" #include "scumm/scumm_v6.h" #include "scumm/util.h" @@ -728,7 +726,7 @@ int ScummEngine::getNextBox(byte from, byte to) { dest = to; do { dest = itineraryMatrix[numOfBoxes * from + dest]; - } while (dest != Actor::kInvalidBox && !areBoxesNeighbours(from, dest)); + } while (dest != Actor::kInvalidBox && !areBoxesNeighbors(from, dest)); if (dest == Actor::kInvalidBox) dest = -1; @@ -964,7 +962,7 @@ void ScummEngine::calcItineraryMatrix(byte *itineraryMatrix, int num) { // Allocate the adjacent & itinerary matrices adjacentMatrix = (byte *)malloc(boxSize * boxSize); - // Initialise the adjacent matrix: each box has distance 0 to itself, + // Initialize the adjacent matrix: each box has distance 0 to itself, // and distance 1 to its direct neighbors. Initially, it has distance // 255 (= infinity) to all other boxes. for (i = 0; i < num; i++) { @@ -972,7 +970,7 @@ void ScummEngine::calcItineraryMatrix(byte *itineraryMatrix, int num) { if (i == j) { adjacentMatrix[i * boxSize + j] = 0; itineraryMatrix[i * boxSize + j] = j; - } else if (areBoxesNeighbours(i, j)) { + } else if (areBoxesNeighbors(i, j)) { adjacentMatrix[i * boxSize + j] = 1; itineraryMatrix[i * boxSize + j] = j; } else { @@ -1062,8 +1060,8 @@ void ScummEngine::createBoxMatrix() { free(itineraryMatrix); } -/** Check if two boxes are neighbours. */ -bool ScummEngine::areBoxesNeighbours(int box1nr, int box2nr) { +/** Check if two boxes are neighbors. */ +bool ScummEngine::areBoxesNeighbors(int box1nr, int box2nr) { Common::Point tmp; BoxCoords box; BoxCoords box2; @@ -1160,7 +1158,7 @@ bool ScummEngine::areBoxesNeighbours(int box1nr, int box2nr) { return false; } -bool ScummEngine_v0::areBoxesNeighbours(int box1nr, int box2nr) { +bool ScummEngine_v0::areBoxesNeighbors(int box1nr, int box2nr) { int i; const int numOfBoxes = getNumBoxes(); const byte *boxm; diff --git a/engines/scumm/boxes.h b/engines/scumm/boxes.h index a93c9f49193..e554aea1b5d 100644 --- a/engines/scumm/boxes.h +++ b/engines/scumm/boxes.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_BOXES_H diff --git a/engines/scumm/camera.cpp b/engines/scumm/camera.cpp index c12c956134e..4b48acfbdb5 100644 --- a/engines/scumm/camera.cpp +++ b/engines/scumm/camera.cpp @@ -17,9 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/scumm.h" diff --git a/engines/scumm/charset-fontdata.cpp b/engines/scumm/charset-fontdata.cpp index 7f2bbd05b4f..29465584f8e 100644 --- a/engines/scumm/charset-fontdata.cpp +++ b/engines/scumm/charset-fontdata.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp index 9fb76d9d63f..dce6c9c144b 100644 --- a/engines/scumm/charset.cpp +++ b/engines/scumm/charset.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/scumm/charset.h b/engines/scumm/charset.h index 4b2e053c6d8..4c657b475e0 100644 --- a/engines/scumm/charset.h +++ b/engines/scumm/charset.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_CHARSET_H diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp index d0a3ec6e11a..75cde5e33ac 100644 --- a/engines/scumm/costume.cpp +++ b/engines/scumm/costume.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/costume.h b/engines/scumm/costume.h index 367b86839d0..3acf2a1f6c8 100644 --- a/engines/scumm/costume.h +++ b/engines/scumm/costume.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_COSTUME_H diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp index 820605924c6..e9b5260eca3 100644 --- a/engines/scumm/cursor.cpp +++ b/engines/scumm/cursor.cpp @@ -17,9 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/scumm/debugger.cpp b/engines/scumm/debugger.cpp index 4c1942b8659..9cfdfbccc90 100644 --- a/engines/scumm/debugger.cpp +++ b/engines/scumm/debugger.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug-channels.h" @@ -34,6 +31,7 @@ #include "scumm/debugger.h" #include "scumm/imuse/imuse.h" #include "scumm/object.h" +#include "scumm/resource.h" #include "scumm/scumm.h" #include "scumm/sound.h" @@ -376,8 +374,8 @@ bool ScummDebugger::Cmd_Actor(int argc, const char **argv) { DebugPrintf("Actor[%d]._elevation = %d\n", actnum, a->getElevation()); _vm->_fullRedraw = true; } else if (!strcmp(argv[2], "costume")) { - if (value >= _vm->_res->num[rtCostume]) - DebugPrintf("Costume not changed as %d exceeds max of %d\n", value, _vm->_res->num[rtCostume]); + if (value >= (int)_vm->_res->_types[rtCostume].size()) + DebugPrintf("Costume not changed as %d exceeds max of %d\n", value, _vm->_res->_types[rtCostume].size()); else { a->setActorCostume(value); _vm->_fullRedraw = true; @@ -401,14 +399,15 @@ bool ScummDebugger::Cmd_PrintActor(int argc, const char **argv) { int i; Actor *a; - DebugPrintf("+-----------------------------------------------------------+\n"); - DebugPrintf("|# | x | y | w |elev|cos|box|mov| zp|frm|scl|dir| cls |\n"); - DebugPrintf("+--+----+----+---+----+---+---+---+---+---+---+---+---------+\n"); + DebugPrintf("+---------------------------------------------------------------+\n"); + DebugPrintf("|# | x | y | w | h |elev|cos|box|mov| zp|frm|scl|dir| cls |\n"); + DebugPrintf("+--+----+----+---+---+----+---+---+---+---+---+---+---+---------+\n"); for (i = 1; i < _vm->_numActors; i++) { a = _vm->_actors[i]; if (a->_visible) - DebugPrintf("|%2d|%4d|%4d|%3d|%4d|%3d|%3d|%3d|%3d|%3d|%3d|%3d|$%08x|\n", - a->_number, a->getRealPos().x, a->getRealPos().y, a->_width, a->getElevation(), + DebugPrintf("|%2d|%4d|%4d|%3d|%3d|%4d|%3d|%3d|%3d|%3d|%3d|%3d|%3d|$%08x|\n", + a->_number, a->getRealPos().x, a->getRealPos().y, a->_width, a->_bottom - a->_top, + a->getElevation(), a->_costume, a->_walkbox, a->_moving, a->_forceClip, a->_frame, a->_scalex, a->getFacing(), _vm->_classData[a->_number]); } diff --git a/engines/scumm/debugger.h b/engines/scumm/debugger.h index 9a85493bbe7..a9b340d691d 100644 --- a/engines/scumm/debugger.h +++ b/engines/scumm/debugger.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_DEBUGGER_H diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 51b46b033cb..aecd13db5ad 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // FIXME: Avoid using printf @@ -43,6 +40,7 @@ #include "scumm/scumm_v8.h" #include "scumm/file.h" #include "scumm/file_nes.h" +#include "scumm/resource.h" #include "engines/metaengine.h" @@ -70,27 +68,27 @@ static const MD5Table *findInMD5Table(const char *md5) { } Common::String ScummEngine::generateFilename(const int room) const { - const int diskNumber = (room > 0) ? _res->roomno[rtRoom][room] : 0; - char buf[128]; + const int diskNumber = (room > 0) ? _res->_types[rtRoom][room]._roomno : 0; + Common::String result; if (_game.version == 4) { if (room == 0 || room >= 900) { - snprintf(buf, sizeof(buf), "%03d.lfl", room); + result = Common::String::format("%03d.lfl", room); } else { - snprintf(buf, sizeof(buf), "disk%02d.lec", diskNumber); + result = Common::String::format("disk%02d.lec", diskNumber); } } else { switch (_filenamePattern.genMethod) { case kGenDiskNum: - snprintf(buf, sizeof(buf), _filenamePattern.pattern, diskNumber); + result = Common::String::format(_filenamePattern.pattern, diskNumber); break; case kGenRoomNum: - snprintf(buf, sizeof(buf), _filenamePattern.pattern, room); + result = Common::String::format(_filenamePattern.pattern, room); break; case kGenUnchanged: - strncpy(buf, _filenamePattern.pattern, sizeof(buf)); + result = _filenamePattern.pattern; break; default: @@ -98,11 +96,11 @@ Common::String ScummEngine::generateFilename(const int room) const { } } - return buf; + return result; } Common::String ScummEngine_v60he::generateFilename(const int room) const { - char buf[128]; + Common::String result; char id = 0; switch (_filenamePattern.genMethod) { @@ -112,21 +110,21 @@ Common::String ScummEngine_v60he::generateFilename(const int room) const { if (room < 0) { id = '0' - room; } else { - const int diskNumber = (room > 0) ? _res->roomno[rtRoom][room] : 0; + const int diskNumber = (room > 0) ? _res->_types[rtRoom][room]._roomno : 0; id = diskNumber + '0'; } if (_filenamePattern.genMethod == kGenHEPC) { - snprintf(buf, sizeof(buf), "%s.he%c", _filenamePattern.pattern, id); + result = Common::String::format("%s.he%c", _filenamePattern.pattern, id); } else { if (id == '3') { // special case for cursors // For mac they're stored in game binary - strncpy(buf, _filenamePattern.pattern, sizeof(buf)); + result = _filenamePattern.pattern; } else { if (_filenamePattern.genMethod == kGenHEMac) - snprintf(buf, sizeof(buf), "%s (%c)", _filenamePattern.pattern, id); + result = Common::String::format("%s (%c)", _filenamePattern.pattern, id); else - snprintf(buf, sizeof(buf), "%s %c", _filenamePattern.pattern, id); + result = Common::String::format("%s %c", _filenamePattern.pattern, id); } } @@ -137,11 +135,11 @@ Common::String ScummEngine_v60he::generateFilename(const int room) const { return ScummEngine::generateFilename(room); } - return buf; + return result; } Common::String ScummEngine_v70he::generateFilename(const int room) const { - char buf[128]; + Common::String result; char id = 0; switch (_filenamePattern.genMethod) { @@ -158,19 +156,19 @@ Common::String ScummEngine_v70he::generateFilename(const int room) const { id = 'b'; // Special cases for Blue's games, which share common (b) files if (_game.id == GID_BIRTHDAY && !(_game.features & GF_DEMO)) - strcpy(buf, "Blue'sBirthday.(b)"); + result = "Blue'sBirthday.(b)"; else if (_game.id == GID_TREASUREHUNT) - strcpy(buf, "Blue'sTreasureHunt.(b)"); + result = "Blue'sTreasureHunt.(b)"; else - snprintf(buf, sizeof(buf), "%s.(b)", _filenamePattern.pattern); + result = Common::String::format("%s.(b)", _filenamePattern.pattern); break; case 1: id = 'a'; - snprintf(buf, sizeof(buf), "%s.(a)", _filenamePattern.pattern); + result = Common::String::format("%s.(a)", _filenamePattern.pattern); break; default: id = '0'; - snprintf(buf, sizeof(buf), "%s.he0", _filenamePattern.pattern); + result = Common::String::format("%s.he0", _filenamePattern.pattern); } } else if (room < 0) { id = '0' - room; @@ -181,16 +179,16 @@ Common::String ScummEngine_v70he::generateFilename(const int room) const { if (_filenamePattern.genMethod == kGenHEPC) { // For HE >= 98, we already called snprintf above. if (_game.heversion < 98 || room < 0) - snprintf(buf, sizeof(buf), "%s.he%c", _filenamePattern.pattern, id); + result = Common::String::format("%s.he%c", _filenamePattern.pattern, id); } else { if (id == '3') { // special case for cursors // For mac they're stored in game binary - strncpy(buf, _filenamePattern.pattern, sizeof(buf)); + result = _filenamePattern.pattern; } else { if (_filenamePattern.genMethod == kGenHEMac) - snprintf(buf, sizeof(buf), "%s (%c)", _filenamePattern.pattern, id); + result = Common::String::format("%s (%c)", _filenamePattern.pattern, id); else - snprintf(buf, sizeof(buf), "%s %c", _filenamePattern.pattern, id); + result = Common::String::format("%s %c", _filenamePattern.pattern, id); } } @@ -201,40 +199,39 @@ Common::String ScummEngine_v70he::generateFilename(const int room) const { return ScummEngine_v60he::generateFilename(room); } - return buf; + return result; } static Common::String generateFilenameForDetection(const char *pattern, FilenameGenMethod genMethod) { - char buf[128]; + Common::String result; switch (genMethod) { case kGenDiskNum: case kGenRoomNum: - snprintf(buf, sizeof(buf), pattern, 0); + result = Common::String::format(pattern, 0); break; case kGenHEPC: - snprintf(buf, sizeof(buf), "%s.he0", pattern); + result = Common::String::format("%s.he0", pattern); break; case kGenHEMac: - snprintf(buf, sizeof(buf), "%s (0)", pattern); + result = Common::String::format("%s (0)", pattern); break; case kGenHEMacNoParens: - snprintf(buf, sizeof(buf), "%s 0", pattern); + result = Common::String::format("%s 0", pattern); break; case kGenUnchanged: - strncpy(buf, pattern, sizeof(buf)); + result = pattern; break; default: error("generateFilenameForDetection: Unsupported genMethod"); } - buf[sizeof(buf) - 1] = 0; - return buf; + return result; } struct DetectorDesc { @@ -1039,6 +1036,7 @@ Common::Error ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) co // Simply use the first match DetectorResult res(*(results.begin())); debug(1, "Using gameid %s, variant %s, extra %s", res.game.gameid, res.game.variant, res.extra); + debug(1, " SCUMM version %d, HE version %d", res.game.version, res.game.heversion); // Print the MD5 of the game; either verbose using printf, in case of an // unknown MD5, or with a medium debug level in case of a known MD5 (for @@ -1157,7 +1155,7 @@ Common::Error ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) co } const char *ScummMetaEngine::getName() const { - return "SCUMM Engine [" + return "SCUMM [" #if defined(ENABLE_SCUMM_7_8) && defined(ENABLE_HE) "all games" diff --git a/engines/scumm/detection.h b/engines/scumm/detection.h index 9b4ff929e27..720c4bb750e 100644 --- a/engines/scumm/detection.h +++ b/engines/scumm/detection.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_DETECTION_H diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h index 952abdb39ac..7eb1e80132a 100644 --- a/engines/scumm/detection_tables.h +++ b/engines/scumm/detection_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_DETECTION_TABLES_H @@ -187,6 +184,8 @@ using Common::GUIO_NOLAUNCHLOAD; using Common::GUIO_NOMIDI; using Common::GUIO_NOSPEECH; using Common::GUIO_MIDITOWNS; +using Common::GUIO_MIDIADLIB; +using Common::GUIO_MIDIMT32; // The following table contains information about variants of our various // games. We index into it with help of md5table (from scumm-md5.h), to find @@ -245,11 +244,11 @@ static const GameSettings gameVariantsTable[] = { {"monkey", "SEGA", 0, GID_MONKEY, 5, 0, MDT_NONE, GF_AUDIOTRACKS, Common::kPlatformSegaCD, GUIO_NOSPEECH | GUIO_NOMIDI}, {"monkey2", "", 0, GID_MONKEY2, 5, 0, MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, UNK, GUIO_NOSPEECH}, - {"monkey2", "FM-TOWNS", 0, GID_MONKEY2, 5, 0, MDT_TOWNS | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, Common::kPlatformFMTowns, GUIO_NOSPEECH}, + {"monkey2", "FM-TOWNS", 0, GID_MONKEY2, 5, 0, MDT_TOWNS | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, Common::kPlatformFMTowns, GUIO_NOSPEECH | GUIO_MIDITOWNS | GUIO_MIDIADLIB | GUIO_MIDIMT32}, {"atlantis", "", 0, GID_INDY4, 5, 0, MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, UNK, GUIO_NONE}, {"atlantis", "Floppy", 0, GID_INDY4, 5, 0, MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, UNK, GUIO_NOSPEECH}, - {"atlantis", "FM-TOWNS", 0, GID_INDY4, 5, 0, MDT_TOWNS | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, Common::kPlatformFMTowns, GUIO_NONE}, + {"atlantis", "FM-TOWNS", 0, GID_INDY4, 5, 0, MDT_TOWNS | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, Common::kPlatformFMTowns, GUIO_MIDITOWNS | GUIO_MIDIADLIB | GUIO_MIDIMT32}, {"tentacle", "", 0, GID_TENTACLE, 6, 0, MDT_ADLIB | MDT_MIDI | MDT_PREFER_GM, GF_USE_KEY, UNK, GUIO_NONE}, {"tentacle", "Floppy", 0, GID_TENTACLE, 6, 0, MDT_ADLIB | MDT_MIDI | MDT_PREFER_GM, GF_USE_KEY, UNK, GUIO_NOSPEECH}, diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index e396d37e30c..f7f0c7d7ec7 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/config-manager.h" diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h index 40e549471b6..c26aa9f414a 100644 --- a/engines/scumm/dialogs.h +++ b/engines/scumm/dialogs.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_DIALOGS_H diff --git a/engines/scumm/file.cpp b/engines/scumm/file.cpp index 20050e5d4cc..9c161ff1cc6 100644 --- a/engines/scumm/file.cpp +++ b/engines/scumm/file.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/file.h" diff --git a/engines/scumm/file.h b/engines/scumm/file.h index 8a25277ded2..d6dbc06ddcc 100644 --- a/engines/scumm/file.h +++ b/engines/scumm/file.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_FILE_H diff --git a/engines/scumm/file_nes.cpp b/engines/scumm/file_nes.cpp index 47704d6eaf6..0e7130973e7 100644 --- a/engines/scumm/file_nes.cpp +++ b/engines/scumm/file_nes.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/file_nes.h" diff --git a/engines/scumm/file_nes.h b/engines/scumm/file_nes.h index f2ce3e19fdf..2dfb6c54b3d 100644 --- a/engines/scumm/file_nes.h +++ b/engines/scumm/file_nes.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_FILE_NES_H diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index e7abd5610ef..1b913e16b40 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -17,9 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" @@ -221,6 +218,10 @@ Gdi::Gdi(ScummEngine *vm) : _vm(vm) { Gdi::~Gdi() { } +GdiHE::GdiHE(ScummEngine *vm) : Gdi(vm), _tmskPtr(0) { +} + + GdiNES::GdiNES(ScummEngine *vm) : Gdi(vm) { memset(&_NES, 0, sizeof(_NES)); } @@ -582,7 +583,7 @@ void ScummEngine::updateDirtyScreen(VirtScreenNumber slot) { vs->tdirty[i] = vs->h; vs->bdirty[i] = 0; if (i != (_gdi->_numStrips - 1) && vs->bdirty[i + 1] == bottom && vs->tdirty[i + 1] == top) { - // Simple optimizations: if two or more neighbouring strips + // Simple optimizations: if two or more neighboring strips // form one bigger rectangle, coalesce them. w += 8; continue; @@ -1503,6 +1504,15 @@ void Gdi::prepareDrawBitmap(const byte *ptr, VirtScreen *vs, // Do nothing by default } +void GdiHE::prepareDrawBitmap(const byte *ptr, VirtScreen *vs, + const int x, const int y, const int width, const int height, + int stripnr, int numstrip) { + if (_vm->_game.heversion >= 72) { + _tmskPtr = _vm->findResource(MKTAG('T','M','S','K'), ptr); + } else + _tmskPtr = 0; +} + void GdiV1::prepareDrawBitmap(const byte *ptr, VirtScreen *vs, const int x, const int y, const int width, const int height, int stripnr, int numstrip) { @@ -1748,11 +1758,6 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const numzbuf = getZPlanes(ptr, zplane_list, false); - const byte *tmsk_ptr = NULL; - if (_vm->_game.heversion >= 72) { - tmsk_ptr = _vm->findResource(MKTAG('T','M','S','K'), ptr); - } - if (y + height > vs->h) { warning("Gdi::drawBitmap, strip drawn to %d below window bottom %d", y + height, vs->h); } @@ -1815,7 +1820,7 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const clear8Col(frontBuf, vs->pitch, height, vs->format.bytesPerPixel); } - decodeMask(x, y, width, height, stripnr, numzbuf, zplane_list, transpStrip, flag, tmsk_ptr); + decodeMask(x, y, width, height, stripnr, numzbuf, zplane_list, transpStrip, flag); #if 0 // HACK: blit mask(s) onto normal screen. Useful to debug masking @@ -1904,7 +1909,7 @@ bool GdiV2::drawStrip(byte *dstPtr, VirtScreen *vs, int x, int y, const int widt void Gdi::decodeMask(int x, int y, const int width, const int height, int stripnr, int numzbuf, const byte *zplane_list[9], - bool transpStrip, byte flag, const byte *tmsk_ptr) { + bool transpStrip, byte flag) { int i; byte *mask_ptr; const byte *z_plane_ptr; @@ -1960,10 +1965,7 @@ void Gdi::decodeMask(int x, int y, const int width, const int height, if (offs) { z_plane_ptr = zplane_list[i] + offs; - if (tmsk_ptr) { - const byte *tmsk = tmsk_ptr + READ_LE_UINT16(tmsk_ptr + stripnr * 2 + 8); - decompressTMSK(mask_ptr, tmsk, z_plane_ptr, height); - } else if (transpStrip && (flag & dbAllowMaskOr)) { + if (transpStrip && (flag & dbAllowMaskOr)) { decompressMaskImgOr(mask_ptr, z_plane_ptr, height); } else { decompressMaskImg(mask_ptr, z_plane_ptr, height); @@ -1978,9 +1980,46 @@ void Gdi::decodeMask(int x, int y, const int width, const int height, } } +void GdiHE::decodeMask(int x, int y, const int width, const int height, + int stripnr, int numzbuf, const byte *zplane_list[9], + bool transpStrip, byte flag) { + int i; + byte *mask_ptr; + const byte *z_plane_ptr; + + for (i = 1; i < numzbuf; i++) { + uint32 offs; + + if (!zplane_list[i]) + continue; + + offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 8); + + mask_ptr = getMaskBuffer(x, y, i); + + if (offs) { + z_plane_ptr = zplane_list[i] + offs; + + if (_tmskPtr) { + const byte *tmsk = _tmskPtr + READ_LE_UINT16(_tmskPtr + stripnr * 2 + 8); + decompressTMSK(mask_ptr, tmsk, z_plane_ptr, height); + } else if (transpStrip && (flag & dbAllowMaskOr)) { + decompressMaskImgOr(mask_ptr, z_plane_ptr, height); + } else { + decompressMaskImg(mask_ptr, z_plane_ptr, height); + } + + } else { + if (!(transpStrip && (flag & dbAllowMaskOr))) + for (int h = 0; h < height; h++) + mask_ptr[h * _numStrips] = 0; + } + } +} + void GdiNES::decodeMask(int x, int y, const int width, const int height, int stripnr, int numzbuf, const byte *zplane_list[9], - bool transpStrip, byte flag, const byte *tmsk_ptr) { + bool transpStrip, byte flag) { byte *mask_ptr = getMaskBuffer(x, y, 1); drawStripNESMask(mask_ptr, stripnr, y, height); } @@ -1988,7 +2027,7 @@ void GdiNES::decodeMask(int x, int y, const int width, const int height, #ifdef USE_RGB_COLOR void GdiPCEngine::decodeMask(int x, int y, const int width, const int height, int stripnr, int numzbuf, const byte *zplane_list[9], - bool transpStrip, byte flag, const byte *tmsk_ptr) { + bool transpStrip, byte flag) { byte *mask_ptr = getMaskBuffer(x, y, 1); drawStripPCEngineMask(mask_ptr, stripnr, y, height); } @@ -1996,14 +2035,14 @@ void GdiPCEngine::decodeMask(int x, int y, const int width, const int height, void GdiV1::decodeMask(int x, int y, const int width, const int height, int stripnr, int numzbuf, const byte *zplane_list[9], - bool transpStrip, byte flag, const byte *tmsk_ptr) { + bool transpStrip, byte flag) { byte *mask_ptr = getMaskBuffer(x, y, 1); drawStripC64Mask(mask_ptr, stripnr, width, height); } void GdiV2::decodeMask(int x, int y, const int width, const int height, int stripnr, int numzbuf, const byte *zplane_list[9], - bool transpStrip, byte flag, const byte *tmsk_ptr) { + bool transpStrip, byte flag) { // Do nothing here for V2 games - zplane was already handled. } @@ -2371,7 +2410,7 @@ void Gdi::decompressMaskImg(byte *dst, const byte *src, int height) const { } } -void Gdi::decompressTMSK(byte *dst, const byte *tmsk, const byte *src, int height) const { +void GdiHE::decompressTMSK(byte *dst, const byte *tmsk, const byte *src, int height) const { byte srcbits = 0; byte srcFlag = 0; byte maskFlag = 0; diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h index 3f69d75efd5..6da07efd18c 100644 --- a/engines/scumm/gfx.h +++ b/engines/scumm/gfx.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_GFX_H @@ -224,7 +221,6 @@ protected: virtual void writeRoomColor(byte *dst, byte color) const; /* Mask decompressors */ - void decompressTMSK(byte *dst, const byte *tmsk, const byte *src, int height) const; void decompressMaskImgOr(byte *dst, const byte *src, int height) const; void decompressMaskImg(byte *dst, const byte *src, int height) const; @@ -237,7 +233,7 @@ protected: virtual void decodeMask(int x, int y, const int width, const int height, int stripnr, int numzbuf, const byte *zplane_list[9], - bool transpStrip, byte flag, const byte *tmsk_ptr); + bool transpStrip, byte flag); virtual void prepareDrawBitmap(const byte *ptr, VirtScreen *vs, const int x, const int y, const int width, const int height, @@ -273,6 +269,24 @@ public: }; }; +class GdiHE : public Gdi { +protected: + const byte *_tmskPtr; + +protected: + void decompressTMSK(byte *dst, const byte *tmsk, const byte *src, int height) const; + + virtual void decodeMask(int x, int y, const int width, const int height, + int stripnr, int numzbuf, const byte *zplane_list[9], + bool transpStrip, byte flag); + + virtual void prepareDrawBitmap(const byte *ptr, VirtScreen *vs, + const int x, const int y, const int width, const int height, + int stripnr, int numstrip); +public: + GdiHE(ScummEngine *vm); +}; + class GdiNES : public Gdi { protected: struct { @@ -296,7 +310,7 @@ protected: virtual void decodeMask(int x, int y, const int width, const int height, int stripnr, int numzbuf, const byte *zplane_list[9], - bool transpStrip, byte flag, const byte *tmsk_ptr); + bool transpStrip, byte flag); virtual void prepareDrawBitmap(const byte *ptr, VirtScreen *vs, const int x, const int y, const int width, const int height, @@ -339,7 +353,7 @@ protected: virtual void decodeMask(int x, int y, const int width, const int height, int stripnr, int numzbuf, const byte *zplane_list[9], - bool transpStrip, byte flag, const byte *tmsk_ptr); + bool transpStrip, byte flag); virtual void prepareDrawBitmap(const byte *ptr, VirtScreen *vs, const int x, const int y, const int width, const int height, @@ -376,7 +390,7 @@ protected: virtual void decodeMask(int x, int y, const int width, const int height, int stripnr, int numzbuf, const byte *zplane_list[9], - bool transpStrip, byte flag, const byte *tmsk_ptr); + bool transpStrip, byte flag); virtual void prepareDrawBitmap(const byte *ptr, VirtScreen *vs, const int x, const int y, const int width, const int height, @@ -402,7 +416,7 @@ protected: virtual void decodeMask(int x, int y, const int width, const int height, int stripnr, int numzbuf, const byte *zplane_list[9], - bool transpStrip, byte flag, const byte *tmsk_ptr); + bool transpStrip, byte flag); virtual void prepareDrawBitmap(const byte *ptr, VirtScreen *vs, const int x, const int y, const int width, const int height, diff --git a/engines/scumm/gfxARM.s b/engines/scumm/gfxARM.s index 9f7c2949b30..92f89514666 100644 --- a/engines/scumm/gfxARM.s +++ b/engines/scumm/gfxARM.s @@ -18,9 +18,6 @@ @ along with this program@ if not, write to the Free Software @ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @ -@ $URL$ -@ $Id$ -@ @ @author Robin Watts (robin@wss.co.uk) .text diff --git a/engines/scumm/gfx_towns.cpp b/engines/scumm/gfx_towns.cpp index 78c7ef23f17..82bb32cdfbe 100644 --- a/engines/scumm/gfx_towns.cpp +++ b/engines/scumm/gfx_towns.cpp @@ -17,9 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/scumm/he/animation_he.cpp b/engines/scumm/he/animation_he.cpp index e3e25c161cd..74183c24d37 100644 --- a/engines/scumm/he/animation_he.cpp +++ b/engines/scumm/he/animation_he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE diff --git a/engines/scumm/he/animation_he.h b/engines/scumm/he/animation_he.h index f5000bca592..b3405fead0c 100644 --- a/engines/scumm/he/animation_he.h +++ b/engines/scumm/he/animation_he.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(SCUMM_HE_ANIMATION_H) && defined(ENABLE_HE) diff --git a/engines/scumm/he/cup_player_he.cpp b/engines/scumm/he/cup_player_he.cpp index 5cd75a5c62c..84562c12d53 100644 --- a/engines/scumm/he/cup_player_he.cpp +++ b/engines/scumm/he/cup_player_he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE diff --git a/engines/scumm/he/cup_player_he.h b/engines/scumm/he/cup_player_he.h index 93146fdf85a..15bc6b46ba4 100644 --- a/engines/scumm/he/cup_player_he.h +++ b/engines/scumm/he/cup_player_he.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/he/floodfill_he.cpp b/engines/scumm/he/floodfill_he.cpp index 026a8488287..f9d53c6b12f 100644 --- a/engines/scumm/he/floodfill_he.cpp +++ b/engines/scumm/he/floodfill_he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE diff --git a/engines/scumm/he/floodfill_he.h b/engines/scumm/he/floodfill_he.h index cfc672436c8..3f62cc9b810 100644 --- a/engines/scumm/he/floodfill_he.h +++ b/engines/scumm/he/floodfill_he.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(SCUMM_HE_FLOODFILL_HE_H) && defined(ENABLE_HE) diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h index 830e9403229..c49217b650a 100644 --- a/engines/scumm/he/intern_he.h +++ b/engines/scumm/he/intern_he.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_HE_INTERN_HE_H @@ -132,8 +129,8 @@ public: protected: virtual void allocateArrays(); - virtual int readResTypeList(int id); - virtual uint32 getResourceRoomOffset(int type, int idx); + virtual int readResTypeList(ResType type); + virtual uint32 getResourceRoomOffset(ResType type, ResId idx); virtual void setupOpcodes(); virtual void setupScummVars(); @@ -268,7 +265,7 @@ protected: virtual void resetScummVars(); virtual void readArrayFromIndexFile(); - virtual byte *getStringAddress(int i); + virtual byte *getStringAddress(ResId idx); virtual void readMAXS(int blockSize); virtual void redrawBGAreas(); @@ -292,7 +289,7 @@ protected: void copyScriptString(byte *dst, int dstSize); int findObject(int x, int y, int num, int *args); - int getSoundResourceSize(int id); + int getSoundResourceSize(ResId idx); virtual bool handleNextCharsetCode(Actor *a, int *c); virtual int convertMessageToString(const byte *msg, byte *dst, int dstSize); @@ -557,7 +554,8 @@ protected: class ScummEngine_v100he : public ScummEngine_v99he { protected: - int32 _heResId, _heResType; + ResType _heResType; + int32 _heResId; byte _debugInputBuffer[256]; public: diff --git a/engines/scumm/he/logic_he.cpp b/engines/scumm/he/logic_he.cpp index 297c2992db5..a7d808e3160 100644 --- a/engines/scumm/he/logic_he.cpp +++ b/engines/scumm/he/logic_he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE diff --git a/engines/scumm/he/logic_he.h b/engines/scumm/he/logic_he.h index d097d37e758..e05a05f3105 100644 --- a/engines/scumm/he/logic_he.h +++ b/engines/scumm/he/logic_he.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(SCUMM_HE_LOGIC_HE_H) && defined(ENABLE_HE) diff --git a/engines/scumm/he/palette_he.cpp b/engines/scumm/he/palette_he.cpp index 49e43a040b0..44ba8416443 100644 --- a/engines/scumm/he/palette_he.cpp +++ b/engines/scumm/he/palette_he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE diff --git a/engines/scumm/he/resource_he.cpp b/engines/scumm/he/resource_he.cpp index 552c4207558..6b195bec84f 100644 --- a/engines/scumm/he/resource_he.cpp +++ b/engines/scumm/he/resource_he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/scumm.h" @@ -229,7 +226,7 @@ void ScummEngine_v70he::readRoomsOffsets() { num = READ_LE_UINT16(_heV7RoomOffsets); ptr = _heV7RoomOffsets + 2; for (i = 0; i < num; i++) { - _res->roomoffs[rtRoom][i] = READ_LE_UINT32(ptr); + _res->_types[rtRoom][i]._roomoffs = READ_LE_UINT32(ptr); ptr += 4; } } @@ -256,8 +253,6 @@ void ScummEngine_v70he::readGlobalObjects() { #ifdef ENABLE_HE void ScummEngine_v99he::readMAXS(int blockSize) { if (blockSize == 52) { - debug(0, "ScummEngine_v99he readMAXS: MAXS has blocksize %d", blockSize); - _numVariables = _fileHandle->readUint16LE(); _fileHandle->readUint16LE(); _numRoomVariables = _fileHandle->readUint16LE(); @@ -290,8 +285,6 @@ void ScummEngine_v99he::readMAXS(int blockSize) { void ScummEngine_v90he::readMAXS(int blockSize) { if (blockSize == 46) { - debug(0, "ScummEngine_v90he readMAXS: MAXS has blocksize %d", blockSize); - _numVariables = _fileHandle->readUint16LE(); _fileHandle->readUint16LE(); _numRoomVariables = _fileHandle->readUint16LE(); @@ -324,8 +317,6 @@ void ScummEngine_v90he::readMAXS(int blockSize) { void ScummEngine_v72he::readMAXS(int blockSize) { if (blockSize == 40) { - debug(0, "ScummEngine_v72he readMAXS: MAXS has blocksize %d", blockSize); - _numVariables = _fileHandle->readUint16LE(); _fileHandle->readUint16LE(); _numBitVariables = _numRoomVariables = _fileHandle->readUint16LE(); @@ -350,14 +341,14 @@ void ScummEngine_v72he::readMAXS(int blockSize) { ScummEngine_v6::readMAXS(blockSize); } -byte *ScummEngine_v72he::getStringAddress(int i) { - byte *addr = getResourceAddress(rtString, i); +byte *ScummEngine_v72he::getStringAddress(ResId idx) { + byte *addr = getResourceAddress(rtString, idx); if (addr == NULL) return NULL; return ((ScummEngine_v72he::ArrayHeader *)addr)->data; } -int ScummEngine_v72he::getSoundResourceSize(int id) { +int ScummEngine_v72he::getSoundResourceSize(ResId id) { const byte *ptr; int offs, size; diff --git a/engines/scumm/he/resource_he.h b/engines/scumm/he/resource_he.h index 5d7c70db760..9978869ffc3 100644 --- a/engines/scumm/he/resource_he.h +++ b/engines/scumm/he/resource_he.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_HE_RESOURCE_HE_H diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index 69063a18378..e057ab524af 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE @@ -2353,10 +2350,10 @@ void ScummEngine_v100he::o100_debugInput() { void ScummEngine_v100he::o100_isResourceLoaded() { // Reports percentage of resource loaded by queue - int type; + ResType type; byte subOp = fetchScriptByte(); - /* int idx = */ pop(); + int idx = pop(); switch (subOp) { case 25: @@ -2377,13 +2374,15 @@ void ScummEngine_v100he::o100_isResourceLoaded() { default: error("o100_isResourceLoaded: default case %d", subOp); } + debug(7, "o100_isResourceLoaded(%d,%d)", type, idx); push(100); } void ScummEngine_v100he::o100_getResourceSize() { const byte *ptr; - int size, type; + int size; + ResType type; int resid = pop(); byte subOp = fetchScriptByte(); @@ -2402,7 +2401,7 @@ void ScummEngine_v100he::o100_getResourceSize() { type = rtScript; break; case 72: - push (getSoundResourceSize(resid)); + push(getSoundResourceSize(resid)); return; default: error("o100_getResourceSize: default type %d", subOp); diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp index 7ecabd55e13..fb070b3e271 100644 --- a/engines/scumm/he/script_v60he.cpp +++ b/engines/scumm/he/script_v60he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/archive.h" diff --git a/engines/scumm/he/script_v70he.cpp b/engines/scumm/he/script_v70he.cpp index 9b160151b09..adb2fcac2ec 100644 --- a/engines/scumm/he/script_v70he.cpp +++ b/engines/scumm/he/script_v70he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -364,10 +361,10 @@ void ScummEngine_v70he::o70_getStringLen() { void ScummEngine_v70he::o70_isResourceLoaded() { // Reports percentage of resource loaded by queue - int type; + ResType type; byte subOp = fetchScriptByte(); - /* int idx = */ pop(); + int idx = pop(); switch (subOp) { case 18: @@ -388,6 +385,7 @@ void ScummEngine_v70he::o70_isResourceLoaded() { default: error("o70_isResourceLoaded: default case %d", subOp); } + debug(7, "o70_isResourceLoaded(%d,%d)", type, idx); push(100); } diff --git a/engines/scumm/he/script_v71he.cpp b/engines/scumm/he/script_v71he.cpp index a800a7d85ca..3ad9220ac51 100644 --- a/engines/scumm/he/script_v71he.cpp +++ b/engines/scumm/he/script_v71he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp index 17bd29d826b..8f16bf0f3a8 100644 --- a/engines/scumm/he/script_v72he.cpp +++ b/engines/scumm/he/script_v72he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE @@ -624,15 +621,15 @@ void ScummEngine_v72he::o72_getArrayDimSize() { } void ScummEngine_v72he::o72_getNumFreeArrays() { - byte **addr = _res->address[rtString]; + const ResourceManager::ResTypeData &rtd = _res->_types[rtString]; int i, num = 0; for (i = 1; i < _numArray; i++) { - if (!addr[i]) + if (!rtd[i]._address) num++; } - push (num); + push(num); } void ScummEngine_v72he::o72_roomOps() { @@ -1914,7 +1911,8 @@ void ScummEngine_v72he::o72_writeINI() { void ScummEngine_v72he::o72_getResourceSize() { const byte *ptr; - int size, type; + int size; + ResType type; int resid = pop(); if (_game.heversion == 72) { @@ -1926,7 +1924,7 @@ void ScummEngine_v72he::o72_getResourceSize() { switch (subOp) { case 13: - push (getSoundResourceSize(resid)); + push(getSoundResourceSize(resid)); return; case 14: type = rtRoomImage; diff --git a/engines/scumm/he/script_v80he.cpp b/engines/scumm/he/script_v80he.cpp index c225be4b6c8..7970d7806f7 100644 --- a/engines/scumm/he/script_v80he.cpp +++ b/engines/scumm/he/script_v80he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE diff --git a/engines/scumm/he/script_v90he.cpp b/engines/scumm/he/script_v90he.cpp index 1a38a99f17f..6b632d8ff2e 100644 --- a/engines/scumm/he/script_v90he.cpp +++ b/engines/scumm/he/script_v90he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp index 4fd7caebf5b..5c15a85929b 100644 --- a/engines/scumm/he/sound_he.cpp +++ b/engines/scumm/he/sound_he.cpp @@ -18,14 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/actor.h" #include "scumm/file.h" #include "scumm/imuse/imuse.h" +#include "scumm/resource.h" #include "scumm/scumm.h" #include "scumm/he/sound_he.h" #include "scumm/he/intern_he.h" @@ -304,13 +302,13 @@ void SoundHE::setOverrideFreq(int freq) { } void SoundHE::setupHEMusicFile() { - int i, total_size; + int i; Common::File musicFile; Common::String buf(_vm->generateFilename(-4)); if (musicFile.open(buf) == true) { musicFile.seek(4, SEEK_SET); - total_size = musicFile.readUint32BE(); + /*int total_size =*/ musicFile.readUint32BE(); musicFile.seek(16, SEEK_SET); _heMusicTracks = musicFile.readUint32LE(); debug(5, "Total music tracks %d", _heMusicTracks); diff --git a/engines/scumm/he/sound_he.h b/engines/scumm/he/sound_he.h index f3a881972e1..f487acc7dab 100644 --- a/engines/scumm/he/sound_he.h +++ b/engines/scumm/he/sound_he.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_HE_SOUND_HE_H diff --git a/engines/scumm/he/sprite_he.cpp b/engines/scumm/he/sprite_he.cpp index c66eed6ae6e..0b37673e4a5 100644 --- a/engines/scumm/he/sprite_he.cpp +++ b/engines/scumm/he/sprite_he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE diff --git a/engines/scumm/he/sprite_he.h b/engines/scumm/he/sprite_he.h index 73a05af5798..d28c9f19443 100644 --- a/engines/scumm/he/sprite_he.h +++ b/engines/scumm/he/sprite_he.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(SCUMM_HE_SPRITE_HE_H) && defined(ENABLE_HE) diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp index 16cbadd65b3..4107034fe6b 100644 --- a/engines/scumm/he/wiz_he.cpp +++ b/engines/scumm/he/wiz_he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE diff --git a/engines/scumm/he/wiz_he.h b/engines/scumm/he/wiz_he.h index c255e27d145..ce3fbc27c64 100644 --- a/engines/scumm/he/wiz_he.h +++ b/engines/scumm/he/wiz_he.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(SCUMM_HE_WIZ_HE_H) && defined(ENABLE_HE) diff --git a/engines/scumm/help.cpp b/engines/scumm/help.cpp index a3bb85ab423..ae7a1ad3bcb 100644 --- a/engines/scumm/help.cpp +++ b/engines/scumm/help.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -110,7 +107,7 @@ void ScummHelp::updateStrings(byte gameId, byte version, Common::Platform platfo ADD_TEXT(_("* Note that using ctrl-f and")); ADD_TEXT(_(" ctrl-g are not recommended")); ADD_TEXT(_(" since they may cause crashes")); - ADD_TEXT(_(" or incorrect game behaviour.")); + ADD_TEXT(_(" or incorrect game behavior.")); break; case 3: if (gameId == GID_LOOM) diff --git a/engines/scumm/help.h b/engines/scumm/help.h index 152dc99c3e6..9763da8c00f 100644 --- a/engines/scumm/help.h +++ b/engines/scumm/help.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_HELP_H diff --git a/engines/scumm/imuse/imuse.cpp b/engines/scumm/imuse/imuse.cpp index 07fd99c8090..7d971f5ca41 100644 --- a/engines/scumm/imuse/imuse.cpp +++ b/engines/scumm/imuse/imuse.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -33,6 +30,7 @@ #include "scumm/imuse/imuse.h" #include "scumm/imuse/imuse_internal.h" #include "scumm/imuse/instrument.h" +#include "scumm/resource.h" #include "scumm/saveload.h" #include "scumm/scumm.h" @@ -50,7 +48,6 @@ _enable_gs(false), _sc55(false), _midi_adlib(NULL), _midi_native(NULL), -_base_sounds(NULL), _sysex(NULL), _paused(false), _initialized(false), @@ -102,12 +99,11 @@ IMuseInternal::~IMuseInternal() { } } -byte *IMuseInternal::findStartOfSound(int sound) { - byte *ptr = NULL; +byte *IMuseInternal::findStartOfSound(int sound, int ct) { int32 size, pos; + static uint32 id[] = { 'MThd', 'FORM', 'MDhd', 'MDpg' }; - if (_base_sounds) - ptr = _base_sounds[sound]; + byte *ptr = g_scumm->_res->_types[rtSound][sound]._address; if (ptr == NULL) { debug(1, "IMuseInternal::findStartOfSound(): Sound %d doesn't exist", sound); @@ -115,12 +111,13 @@ byte *IMuseInternal::findStartOfSound(int sound) { } // Check for old-style headers first, like 'RO' - if (ptr[4] == 'R' && ptr[5] == 'O'&& ptr[6] != 'L') - return ptr + 4; - if (ptr[8] == 'S' && ptr[9] == 'O') - return ptr + 8; + int trFlag = (kMThd | kFORM); + if (ptr[0] == 'R' && ptr[1] == 'O'&& ptr[2] != 'L') + return ct == trFlag ? ptr : 0; + if (ptr[4] == 'S' && ptr[5] == 'O') + return ct == trFlag ? ptr + 4 : 0; - ptr += 8; + ptr += 4; size = READ_BE_UINT32(ptr); ptr += 4; @@ -129,26 +126,25 @@ byte *IMuseInternal::findStartOfSound(int sound) { size = 48; // Arbitrary; we should find our tag within the first 48 bytes of the resource pos = 0; while (pos < size) { - if (!memcmp(ptr + pos, "MThd", 4) || !memcmp(ptr + pos, "FORM", 4)) - return ptr + pos; + for (int i = 0; i < ARRAYSIZE(id); ++i) { + if ((ct & (1 << i)) && (READ_BE_UINT32(ptr + pos) == id[i])) + return ptr + pos; + } ++pos; // We could probably iterate more intelligently } - debug(3, "IMuseInternal::findStartOfSound(): Failed to align on sound %d", sound); + if (ct == (kMThd | kFORM)) + debug(3, "IMuseInternal::findStartOfSound(): Failed to align on sound %d", sound); + return 0; } bool IMuseInternal::isMT32(int sound) { - byte *ptr = NULL; - uint32 tag; - - if (_base_sounds) - ptr = _base_sounds[sound]; - + byte *ptr = g_scumm->_res->_types[rtSound][sound]._address; if (ptr == NULL) return false; - tag = READ_BE_UINT32(ptr + 4); + uint32 tag = READ_BE_UINT32(ptr); switch (tag) { case MKTAG('A','D','L',' '): case MKTAG('A','S','F','X'): // Special AD class for old AdLib sound effects @@ -167,17 +163,17 @@ bool IMuseInternal::isMT32(int sound) { case MKTAG('M','I','D','I'): // Occurs in Sam & Max // HE games use Roland music - if (ptr[12] == 'H' && ptr[13] == 'S') + if (ptr[8] == 'H' && ptr[9] == 'S') return true; else return false; } // Old style 'RO' has equivalent properties to 'ROL' - if (ptr[4] == 'R' && ptr[5] == 'O') + if (ptr[0] == 'R' && ptr[1] == 'O') return true; // Euphony tracks show as 'SO' and have equivalent properties to 'ADL' - if (ptr[8] == 'S' && ptr[9] == 'O') + if (ptr[4] == 'S' && ptr[5] == 'O') return false; error("Unknown music type: '%c%c%c%c'", (char)tag >> 24, (char)tag >> 16, (char)tag >> 8, (char)tag); @@ -186,16 +182,11 @@ bool IMuseInternal::isMT32(int sound) { } bool IMuseInternal::isMIDI(int sound) { - byte *ptr = NULL; - uint32 tag; - - if (_base_sounds) - ptr = _base_sounds[sound]; - + byte *ptr = g_scumm->_res->_types[rtSound][sound]._address; if (ptr == NULL) return false; - tag = READ_BE_UINT32(ptr + 4); + uint32 tag = READ_BE_UINT32(ptr); switch (tag) { case MKTAG('A','D','L',' '): case MKTAG('A','S','F','X'): // Special AD class for old AdLib sound effects @@ -215,11 +206,11 @@ bool IMuseInternal::isMIDI(int sound) { } // Old style 'RO' has equivalent properties to 'ROL' - if (ptr[4] == 'R' && ptr[5] == 'O') + if (ptr[0] == 'R' && ptr[1] == 'O') return true; // Euphony tracks show as 'SO' and have equivalent properties to 'ADL' // FIXME: Right now we're pretending it's GM. - if (ptr[8] == 'S' && ptr[9] == 'O') + if (ptr[4] == 'S' && ptr[5] == 'O') return true; error("Unknown music type: '%c%c%c%c'", (char)tag >> 24, (char)tag >> 16, (char)tag >> 8, (char)tag); @@ -426,11 +417,6 @@ int32 IMuseInternal::doCommand(int numargs, int a[]) { return doCommand_internal(numargs, a); } -void IMuseInternal::setBase(byte **base) { - Common::StackLock lock(_mutex, "IMuseInternal::setBase()"); - _base_sounds = base; -} - uint32 IMuseInternal::property(int prop, uint32 value) { Common::StackLock lock(_mutex, "IMuseInternal::property()"); switch (prop) { @@ -576,7 +562,7 @@ bool IMuseInternal::startSound_internal(int sound, int offset) { return false; } - void *ptr = findStartOfSound(sound); + byte *ptr = findStartOfSound(sound); if (!ptr) { debug(2, "IMuseInternal::startSound(): Couldn't find sound %d", sound); return false; @@ -596,8 +582,11 @@ bool IMuseInternal::startSound_internal(int sound, int offset) { // Bug #590511 and Patch #607175 (which was reversed to fix // an FOA regression: Bug #622606). Player *player = findActivePlayer(sound); - if (!player) - player = allocate_player(128); + if (!player) { + ptr = findStartOfSound(sound, IMuseInternal::kMDhd); + player = allocate_player(ptr ? (READ_BE_UINT32(&ptr[4]) && ptr[10] ? ptr[10] : 128) : 128); + } + if (!player) return false; @@ -645,6 +634,7 @@ int IMuseInternal::stopSound_internal(int sound) { } int IMuseInternal::stopAllSounds_internal() { + clear_queue(); Player *player = _players; for (int i = ARRAYSIZE(_players); i; i--, player++) { if (player->isActive()) @@ -945,54 +935,22 @@ void IMuseInternal::sequencer_timers(MidiDriver *midi) { } void IMuseInternal::handle_marker(uint id, byte data) { - uint16 *p = 0; - uint pos; - - if (_queue_adding && _queue_sound == id && data == _queue_marker) + if ((_queue_end == _queue_pos) || (_queue_adding && _queue_sound == id && data == _queue_marker)) return; - // Fix for bug #733401, revised for bug #761637: - // It would seem that sometimes a marker is in the queue - // but not at the head position. In the case of our bug, - // this seems to be the result of commands in the queue - // for songs that are no longer playing. So we skip - // ahead to the appropriate marker, effectively chomping - // anything in the queue before it. This fixes the FOA - // end credits music, but needs to be tested for inappopriate - // behavior elsewhere. - pos = _queue_end; - while (pos != _queue_pos) { - p = _cmd_queue[pos].array; - if (p[0] == TRIGGER_ID && p[1] == id && p[2] == data) - break; - pos = (pos + 1) % ARRAYSIZE(_cmd_queue); - } - - if (pos == _queue_pos) + uint16 *p = _cmd_queue[_queue_end].array; + if (p[0] != TRIGGER_ID || id != p[1] || data != p[2]) return; - if (pos != _queue_end) - debug(0, "Skipping entries in iMuse command queue to reach marker"); - _trigger_count--; _queue_cleared = false; - do { - pos = (pos + 1) % ARRAYSIZE(_cmd_queue); - if (_queue_pos == pos) - break; - p = _cmd_queue[pos].array; - if (*p++ != COMMAND_ID) - break; - _queue_end = pos; - - doCommand_internal(p[0], p[1], p[2], p[3], p[4], p[5], p[6], 0); - - if (_queue_cleared) - return; - pos = _queue_end; - } while (1); - - _queue_end = pos; + _queue_end = (_queue_end + 1) % ARRAYSIZE(_cmd_queue); + + while (_queue_end != _queue_pos && _cmd_queue[_queue_end].array[0] == COMMAND_ID && !_queue_cleared) { + p = _cmd_queue[_queue_end].array; + doCommand_internal(p[1], p[2], p[3], p[4], p[5], p[6], p[7], 0); + _queue_end = (_queue_end + 1) % ARRAYSIZE(_cmd_queue); + } } int IMuseInternal::get_channel_volume(uint a) { diff --git a/engines/scumm/imuse/imuse.h b/engines/scumm/imuse/imuse.h index 1e3b0fd756a..8014b134095 100644 --- a/engines/scumm/imuse/imuse.h +++ b/engines/scumm/imuse/imuse.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_IMUSE_H @@ -68,7 +65,6 @@ public: virtual bool get_sound_active(int sound) const = 0; virtual int32 doCommand(int numargs, int args[]) = 0; virtual int clear_queue() = 0; - virtual void setBase(byte **base) = 0; virtual uint32 property(int prop, uint32 value) = 0; virtual void addSysexHandler (byte mfgID, sysexfunc handler) = 0; diff --git a/engines/scumm/imuse/imuse_internal.h b/engines/scumm/imuse/imuse_internal.h index 7d46650d2e2..8808a3655ab 100644 --- a/engines/scumm/imuse/imuse_internal.h +++ b/engines/scumm/imuse/imuse_internal.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_IMUSE_INTERNAL @@ -232,6 +229,7 @@ protected: // Sequencer part int start_seq_sound(int sound, bool reset_vars = true); + void loadStartParameters(int sound); int query_param(int param); public: @@ -397,7 +395,6 @@ protected: TimerCallbackInfo _timer_info_native; uint32 _game_id; - byte **_base_sounds; // Plug-in SysEx handling. Right now this only supports one // custom SysEx handler for the hardcoded IMUSE_SYSEX_ID @@ -449,7 +446,14 @@ protected: static void midiTimerCallback(void *data); void on_timer(MidiDriver *midi); - byte *findStartOfSound(int sound); + enum ChunkType { + kMThd = 1, + kFORM = 2, + kMDhd = 4, // Used in MI2 and INDY4. Contain certain start parameters (priority, volume, etc. ) for the player. + kMDpg = 8 // These chunks exist in DOTT and SAMNMAX. They don't get processed, however. + }; + + byte *findStartOfSound(int sound, int ct = (kMThd | kFORM)); bool isMT32(int sound); bool isMIDI(int sound); int get_queue_sound_status(int sound) const; @@ -513,7 +517,6 @@ public: int save_or_load(Serializer *ser, ScummEngine *scumm); bool get_sound_active(int sound) const; int32 doCommand(int numargs, int args[]); - void setBase(byte **base); uint32 property(int prop, uint32 value); virtual void addSysexHandler(byte mfgID, sysexfunc handler); diff --git a/engines/scumm/imuse/imuse_part.cpp b/engines/scumm/imuse/imuse_part.cpp index 487429c2943..5df8407a96c 100644 --- a/engines/scumm/imuse/imuse_part.cpp +++ b/engines/scumm/imuse/imuse_part.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -140,7 +137,8 @@ void Part::set_pan(int8 pan) { } void Part::set_transpose(int8 transpose) { - _transpose_eff = transpose_clamp((_transpose = transpose) + _player->getTranspose(), -24, 24); + _transpose = transpose; + _transpose_eff = (_transpose == -128) ? 0 : transpose_clamp(_transpose + _player->getTranspose(), -24, 24); sendPitchBend(); } diff --git a/engines/scumm/imuse/imuse_player.cpp b/engines/scumm/imuse/imuse_player.cpp index 4d185d94d7a..0b084f3116c 100644 --- a/engines/scumm/imuse/imuse_player.cpp +++ b/engines/scumm/imuse/imuse_player.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ @@ -93,7 +90,7 @@ Player::~Player() { } bool Player::startSound(int sound, MidiDriver *midi) { - void *ptr; + byte *ptr; int i; // Not sure what the old code was doing, @@ -111,13 +108,8 @@ bool Player::startSound(int sound, MidiDriver *midi) { _active = true; _midi = midi; _id = sound; - _priority = 0x80; - _volume = 0x7F; - _vol_chan = 0xFFFF; - _vol_eff = (_se->get_channel_volume(0xFFFF) << 7) >> 7; - _pan = 0; - _transpose = 0; - _detune = 0; + + loadStartParameters(sound); for (i = 0; i < ARRAYSIZE(_parameterFaders); ++i) _parameterFaders[i].init(); @@ -128,7 +120,7 @@ bool Player::startSound(int sound, MidiDriver *midi) { _midi = NULL; return false; } - + debugC(DEBUG_IMUSE, "Starting music %d", sound); return true; } @@ -202,11 +194,43 @@ int Player::start_seq_sound(int sound, bool reset_vars) { _parser->property(MidiParser::mpSmartJump, 1); _parser->loadMusic(ptr, 0); _parser->setTrack(_track_index); - setSpeed(reset_vars ? 128 : _speed); + + ptr = _se->findStartOfSound(sound, IMuseInternal::kMDhd); + setSpeed(reset_vars ? (ptr ? (READ_BE_UINT32(&ptr[4]) && ptr[15] ? ptr[15] : 128) : 128) : _speed); return 0; } +void Player::loadStartParameters(int sound) { + _priority = 0x80; + _volume = 0x7F; + _vol_chan = 0xFFFF; + _vol_eff = (_se->get_channel_volume(0xFFFF) << 7) >> 7; + _pan = 0; + _transpose = 0; + _detune = 0; + + byte *ptr = _se->findStartOfSound(sound, IMuseInternal::kMDhd); + uint32 size = 0; + + if (ptr) { + ptr += 4; + size = READ_BE_UINT32(ptr); + ptr += 4; + + // MDhd chunks don't get used in MI1 and contain only zeroes. + // We check for volume, priority and speed settings of zero here. + if (size && (ptr[2] | ptr[3] | ptr[7])) { + _priority = ptr[2]; + _volume = ptr[3]; + _pan = ptr[4]; + _transpose = ptr[5]; + _detune = ptr[6]; + setSpeed(ptr[7]); + } + } +} + void Player::uninit_parts() { assert(!_parts || _parts->_player == this); diff --git a/engines/scumm/imuse/instrument.cpp b/engines/scumm/imuse/instrument.cpp index 02996c53d3b..955700fc2b9 100644 --- a/engines/scumm/imuse/instrument.cpp +++ b/engines/scumm/imuse/instrument.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/scumm/imuse/instrument.h b/engines/scumm/imuse/instrument.h index f6108daf164..3555d319e6c 100644 --- a/engines/scumm/imuse/instrument.h +++ b/engines/scumm/imuse/instrument.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_IMUSE_INSTRUMENT_H diff --git a/engines/scumm/imuse/sysex.h b/engines/scumm/imuse/sysex.h index bff80de9e73..7dd38e785e8 100644 --- a/engines/scumm/imuse/sysex.h +++ b/engines/scumm/imuse/sysex.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_IMUSE_SYSEX_H diff --git a/engines/scumm/imuse/sysex_samnmax.cpp b/engines/scumm/imuse/sysex_samnmax.cpp index cdae767abfd..4c4219e7bb5 100644 --- a/engines/scumm/imuse/sysex_samnmax.cpp +++ b/engines/scumm/imuse/sysex_samnmax.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/scumm/imuse/sysex_scumm.cpp b/engines/scumm/imuse/sysex_scumm.cpp index 78028c60562..4eb3bee93c6 100644 --- a/engines/scumm/imuse/sysex_scumm.cpp +++ b/engines/scumm/imuse/sysex_scumm.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ @@ -67,6 +64,11 @@ void sysexHandler_Scumm(Player *player, const byte *msg, uint16 len) { // BYTE 14: Pitchbend range(lower 4 bits) [bug #1088045] // BYTE 15: Program(upper 4 bits) // BYTE 16: Program(lower 4 bits) + + // athrxx (05-21-2011): + // BYTE 9, 10: Transpose (if set to 0x80, this means that part->_transpose_eff will be 0 (also ignoring player->_transpose) + // BYTE 11, 12: Detune + part = player->getPart(p[0] & 0x0F); if (part) { part->set_onoff(p[2] & 0x01); @@ -74,7 +76,9 @@ void sysexHandler_Scumm(Player *player, const byte *msg, uint16 len) { part->set_pri(p[4]); part->volume((p[5] & 0x0F) << 4 |(p[6] & 0x0F)); part->set_pan((p[7] & 0x0F) << 4 | (p[8] & 0x0F)); - part->_percussion = player->_isMIDI ? ((p[9] & 0x08) > 0) : false; + part->_percussion = player->_isMIDI ? ((p[9] & 0x08) > 0) : false; + part->set_transpose((p[9] & 0x0F) << 4 | (p[10] & 0x0F)); + part->set_detune((p[11] & 0x0F) << 4 | (p[12] & 0x0F)); part->pitchBendFactor((p[13] & 0x0F) << 4 | (p[14] & 0x0F)); if (part->_percussion) { if (part->_mc) { diff --git a/engines/scumm/imuse_digi/dimuse.cpp b/engines/scumm/imuse_digi/dimuse.cpp index 3831689def2..23f57a01b93 100644 --- a/engines/scumm/imuse_digi/dimuse.cpp +++ b/engines/scumm/imuse_digi/dimuse.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/system.h" diff --git a/engines/scumm/imuse_digi/dimuse.h b/engines/scumm/imuse_digi/dimuse.h index 1e96aa8827e..d940b6897fd 100644 --- a/engines/scumm/imuse_digi/dimuse.h +++ b/engines/scumm/imuse_digi/dimuse.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #if !defined(SCUMM_IMUSE_DIGI_H) && defined(ENABLE_SCUMM_7_8) diff --git a/engines/scumm/imuse_digi/dimuse_bndmgr.cpp b/engines/scumm/imuse_digi/dimuse_bndmgr.cpp index cb894d77cce..d6e07bd0ec8 100644 --- a/engines/scumm/imuse_digi/dimuse_bndmgr.cpp +++ b/engines/scumm/imuse_digi/dimuse_bndmgr.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/scumm/imuse_digi/dimuse_bndmgr.h b/engines/scumm/imuse_digi/dimuse_bndmgr.h index bed1ac65492..21d3110f8b8 100644 --- a/engines/scumm/imuse_digi/dimuse_bndmgr.h +++ b/engines/scumm/imuse_digi/dimuse_bndmgr.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_IMUSE_DIGI_BUNDLE_MGR_H diff --git a/engines/scumm/imuse_digi/dimuse_codecs.cpp b/engines/scumm/imuse_digi/dimuse_codecs.cpp index c78e313fc27..69cd89320cf 100644 --- a/engines/scumm/imuse_digi/dimuse_codecs.cpp +++ b/engines/scumm/imuse_digi/dimuse_codecs.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/scummsys.h" @@ -209,7 +206,7 @@ int32 decompressADPCM(byte *compInput, byte *compOutput, int channels) { int32 destPos; int16 firstWord; byte initialTablePos[MAX_CHANNELS] = {0, 0}; - int32 initialimcTableEntry[MAX_CHANNELS] = {7, 7}; + //int32 initialimcTableEntry[MAX_CHANNELS] = {7, 7}; int32 initialOutputWord[MAX_CHANNELS] = {0, 0}; int32 totalBitOffset, curTablePos, outputWord; byte *dst; @@ -248,7 +245,7 @@ int32 decompressADPCM(byte *compInput, byte *compOutput, int channels) { for (i = 0; i < channels; i++) { initialTablePos[i] = *src; src += 1; - initialimcTableEntry[i] = READ_BE_UINT32(src); + //initialimcTableEntry[i] = READ_BE_UINT32(src); src += 4; initialOutputWord[i] = READ_BE_UINT32(src); src += 4; diff --git a/engines/scumm/imuse_digi/dimuse_codecs.h b/engines/scumm/imuse_digi/dimuse_codecs.h index 71fd24c3ac6..a38f7234dd7 100644 --- a/engines/scumm/imuse_digi/dimuse_codecs.h +++ b/engines/scumm/imuse_digi/dimuse_codecs.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_IMUSE_DIGI_CODECS_H diff --git a/engines/scumm/imuse_digi/dimuse_music.cpp b/engines/scumm/imuse_digi/dimuse_music.cpp index 5c28917756e..adf25601422 100644 --- a/engines/scumm/imuse_digi/dimuse_music.cpp +++ b/engines/scumm/imuse_digi/dimuse_music.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/scumm/imuse_digi/dimuse_script.cpp b/engines/scumm/imuse_digi/dimuse_script.cpp index 02395eed4dc..bc030cc2423 100644 --- a/engines/scumm/imuse_digi/dimuse_script.cpp +++ b/engines/scumm/imuse_digi/dimuse_script.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/scumm/imuse_digi/dimuse_sndmgr.cpp b/engines/scumm/imuse_digi/dimuse_sndmgr.cpp index 2cd90c4f2be..abd0d68e56d 100644 --- a/engines/scumm/imuse_digi/dimuse_sndmgr.cpp +++ b/engines/scumm/imuse_digi/dimuse_sndmgr.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ @@ -31,6 +28,7 @@ #include "audio/decoders/vorbis.h" #include "audio/decoders/mp3.h" +#include "scumm/resource.h" #include "scumm/scumm.h" #include "scumm/util.h" #include "scumm/imuse_digi/dimuse.h" diff --git a/engines/scumm/imuse_digi/dimuse_sndmgr.h b/engines/scumm/imuse_digi/dimuse_sndmgr.h index 7ae9fdccb01..f869c62eb5f 100644 --- a/engines/scumm/imuse_digi/dimuse_sndmgr.h +++ b/engines/scumm/imuse_digi/dimuse_sndmgr.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_IMUSE_DIGI_SNDMGR_H diff --git a/engines/scumm/imuse_digi/dimuse_tables.cpp b/engines/scumm/imuse_digi/dimuse_tables.cpp index a7ee35b0df9..c27138b765a 100644 --- a/engines/scumm/imuse_digi/dimuse_tables.cpp +++ b/engines/scumm/imuse_digi/dimuse_tables.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/scumm/imuse_digi/dimuse_tables.h b/engines/scumm/imuse_digi/dimuse_tables.h index 942acd721f8..a74941dfea0 100644 --- a/engines/scumm/imuse_digi/dimuse_tables.h +++ b/engines/scumm/imuse_digi/dimuse_tables.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #if !defined(SCUMM_IMUSE_DIGI_TABLES_H) && defined(ENABLE_SCUMM_7_8) diff --git a/engines/scumm/imuse_digi/dimuse_track.cpp b/engines/scumm/imuse_digi/dimuse_track.cpp index 2a08d56163e..0896f9af7d5 100644 --- a/engines/scumm/imuse_digi/dimuse_track.cpp +++ b/engines/scumm/imuse_digi/dimuse_track.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/config-manager.h" diff --git a/engines/scumm/imuse_digi/dimuse_track.h b/engines/scumm/imuse_digi/dimuse_track.h index 8c6625cad13..420db4bb068 100644 --- a/engines/scumm/imuse_digi/dimuse_track.h +++ b/engines/scumm/imuse_digi/dimuse_track.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #if !defined(SCUMM_IMUSE_DIGI_TRACK_H) && defined(ENABLE_SCUMM_7_8) diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp index ab5357f1dda..ff85bd0a619 100644 --- a/engines/scumm/input.cpp +++ b/engines/scumm/input.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -38,6 +35,7 @@ #include "scumm/he/intern_he.h" #include "scumm/he/logic_he.h" #endif +#include "scumm/resource.h" #include "scumm/scumm_v0.h" #include "scumm/scumm_v6.h" #include "scumm/scumm_v8.h" @@ -305,14 +303,14 @@ void ScummEngine::processInput() { if ((_leftBtnPressed & msClicked) && (_rightBtnPressed & msClicked) && _game.version >= 4) { // Pressing both mouse buttons is treated as if you pressed // the cutscene exit key (ESC) in V4+ games. That mimicks - // the behaviour of the original engine where pressing both + // the behavior of the original engine where pressing both // mouse buttons also skips the current cutscene. _mouseAndKeyboardStat = 0; lastKeyHit = Common::KeyState(Common::KEYCODE_ESCAPE); } else if ((_rightBtnPressed & msClicked) && (_game.version <= 3 && _game.id != GID_LOOM)) { // Pressing right mouse button is treated as if you pressed // the cutscene exit key (ESC) in V0-V3 games. That mimicks - // the behaviour of the original engine where pressing right + // the behavior of the original engine where pressing right // mouse button also skips the current cutscene. _mouseAndKeyboardStat = 0; lastKeyHit = Common::KeyState(Common::KEYCODE_ESCAPE); diff --git a/engines/scumm/insane/insane.cpp b/engines/scumm/insane/insane.cpp index a82c0ae408a..b8089ff226d 100644 --- a/engines/scumm/insane/insane.cpp +++ b/engines/scumm/insane/insane.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -31,6 +28,7 @@ #include "scumm/actor.h" #include "scumm/file.h" +#include "scumm/resource.h" #include "scumm/scumm_v7.h" #include "scumm/sound.h" diff --git a/engines/scumm/insane/insane.h b/engines/scumm/insane/insane.h index 499eb70a901..12d44c57f4e 100644 --- a/engines/scumm/insane/insane.h +++ b/engines/scumm/insane/insane.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(SCUMM_INSANE_H) && defined(ENABLE_SCUMM_7_8) diff --git a/engines/scumm/insane/insane_ben.cpp b/engines/scumm/insane/insane_ben.cpp index 05775f1585c..48aaab505a3 100644 --- a/engines/scumm/insane/insane_ben.cpp +++ b/engines/scumm/insane/insane_ben.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/insane/insane_enemy.cpp b/engines/scumm/insane/insane_enemy.cpp index e8d97d38758..68766ab72c3 100644 --- a/engines/scumm/insane/insane_enemy.cpp +++ b/engines/scumm/insane/insane_enemy.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -91,14 +88,13 @@ int32 Insane::enemyHandler(int num, int32 actor1, int32 actor2, int32 probabilit } int32 Insane::enemy0handler(int32 actor1, int32 actor2, int32 probability) { - int32 act1damage, act2damage, act1x, act2x, retval; int32 dist; - retval = 0; - act1damage = _actor[actor1].damage; // ebx - act2damage = _actor[actor2].damage; // ebp - act1x = _actor[actor1].x; // esi - act2x = _actor[actor2].x; // edi + int32 retval = 0; + int32 act1damage = _actor[actor1].damage; // ebx + int32 act2damage = _actor[actor2].damage; // ebp + int32 act1x = _actor[actor1].x; // esi + int32 act2x = _actor[actor2].x; // edi if (!_actor[actor1].defunct) { if (_enHdlVar[EN_ROTT1][1] > _enHdlVar[EN_ROTT1][2]) { @@ -255,14 +251,13 @@ int32 Insane::enemy0initializer(int32 actor1, int32 actor2, int32 probability) { } int32 Insane::enemy1handler(int32 actor1, int32 actor2, int32 probability) { - int32 act1damage, act2damage, act1x, act2x, retval; int32 dist; - retval = 0; - act1damage = _actor[actor1].damage; // ebx - act2damage = _actor[actor2].damage; // ebp - act1x = _actor[actor1].x; // esi - act2x = _actor[actor2].x; // edi + int32 retval = 0; + int32 act1damage = _actor[actor1].damage; // ebx + int32 act2damage = _actor[actor2].damage; // ebp + int32 act1x = _actor[actor1].x; // esi + int32 act2x = _actor[actor2].x; // edi if (!_actor[actor1].defunct) { if (_enHdlVar[EN_ROTT2][1] > _enHdlVar[EN_ROTT2][2]) { @@ -400,14 +395,13 @@ int32 Insane::enemy1initializer(int32 actor1, int32 actor2, int32 probability) { } int32 Insane::enemy2handler(int32 actor1, int32 actor2, int32 probability) { - int32 act1damage, act2damage, act1x, act2x, retval; int32 dist; - retval = 0; - act1damage = _actor[actor1].damage; // ebx - act2damage = _actor[actor2].damage; // ebp - act1x = _actor[actor1].x; // esi - act2x = _actor[actor2].x; // edi + int32 retval = 0; + int32 act1damage = _actor[actor1].damage; // ebx + int32 act2damage = _actor[actor2].damage; // ebp + int32 act1x = _actor[actor1].x; // esi + int32 act2x = _actor[actor2].x; // edi if (!_actor[actor1].defunct) { if (_enHdlVar[EN_ROTT3][1] > _enHdlVar[EN_ROTT3][2]) { @@ -549,14 +543,13 @@ int32 Insane::enemy2initializer(int32 actor1, int32 actor2, int32 probability) { } int32 Insane::enemy3handler(int32 actor1, int32 actor2, int32 probability) { - int32 act1damage, act2damage, act1x, act2x, retval; int32 dist; - retval = 0; - act1damage = _actor[actor1].damage; // ebx - act2damage = _actor[actor2].damage; // ebp - act1x = _actor[actor1].x; // esi - act2x = _actor[actor2].x; // edi + int32 retval = 0; + int32 act1damage = _actor[actor1].damage; // ebx + int32 act2damage = _actor[actor2].damage; // ebp + int32 act1x = _actor[actor1].x; // esi + int32 act2x = _actor[actor2].x; // edi if (!_actor[actor1].defunct) { if (_enHdlVar[EN_VULTF1][1] > _enHdlVar[EN_VULTF1][2]) { @@ -706,14 +699,13 @@ int32 Insane::enemy3initializer(int32 actor1, int32 actor2, int32 probability) { } int32 Insane::enemy4handler(int32 actor1, int32 actor2, int32 probability) { - int32 act1damage, act2damage, act1x, act2x, retval; int32 dist; - retval = 0; - act1damage = _actor[actor1].damage; // ebx - act2damage = _actor[actor2].damage; // ebp - act1x = _actor[actor1].x; // esi - act2x = _actor[actor2].x; // edi + int32 retval = 0; + int32 act1damage = _actor[actor1].damage; // ebx + int32 act2damage = _actor[actor2].damage; // ebp + int32 act1x = _actor[actor1].x; // esi + int32 act2x = _actor[actor2].x; // edi if (!_actor[actor1].defunct) { if (_enHdlVar[EN_VULTM1][1] > _enHdlVar[EN_VULTM1][2]) { @@ -876,15 +868,12 @@ int32 Insane::enemy4initializer(int32 actor1, int32 actor2, int32 probability) { } int32 Insane::enemy5handler(int32 actor1, int32 actor2, int32 probability) { - int32 act1damage, act1x, act2x, retval; - int32 dist; + int32 retval = 0; + int32 act1damage = _actor[actor1].damage; // ebx + int32 act1x = _actor[actor1].x; // esi + int32 act2x = _actor[actor2].x; // ebp - retval = 0; - act1damage = _actor[actor1].damage; // ebx - act1x = _actor[actor1].x; // esi - act2x = _actor[actor2].x; // ebp - - dist = ABS(act1x - act2x); + int32 dist = ABS(act1x - act2x); if (weaponMaxRange(actor1) >= dist) { if (!_enHdlVar[EN_VULTF2][2]) @@ -1022,19 +1011,16 @@ int32 Insane::enemy5initializer(int32 actor1, int32 actor2, int32 probability) { } int32 Insane::enemy6handler(int32 actor1, int32 actor2, int32 probability) { - int32 act1damage, act2damage, act1x, act2x, retval; - int32 dist; - - retval = 0; - act1damage = _actor[actor1].damage; // ebx //ebx - act2damage = _actor[actor2].damage; // ebp // edi - act1x = _actor[actor1].x; // esi - act2x = _actor[actor2].x; // edi + int32 retval = 0; + int32 act1damage = _actor[actor1].damage; // ebx //ebx + //int32 act2damage = _actor[actor2].damage; // ebp // edi + int32 act1x = _actor[actor1].x; // esi + int32 act2x = _actor[actor2].x; // edi if (_actor[actor2].weapon == INV_CHAINSAW) retval = 1; - dist = ABS(act1x - act2x); + int32 dist = ABS(act1x - act2x); if (_actor[actor1].defunct) { /* scenePropIdx[18] */ @@ -1163,15 +1149,12 @@ int32 Insane::enemy6initializer(int32 actor1, int32 actor2, int32 probability) { } int32 Insane::enemy7handler(int32 actor1, int32 actor2, int32 probability) { - int32 act1damage, act1x, act2x, retval; - int32 dist; + int32 retval = 0; + int32 act1damage = _actor[actor1].damage; // ebx + int32 act1x = _actor[actor1].x; // ebp, esi + int32 act2x = _actor[actor2].x; // edi - retval = 0; - act1damage = _actor[actor1].damage; // ebx - act1x = _actor[actor1].x; // ebp, esi - act2x = _actor[actor2].x; // edi - - dist = ABS(act1x - act2x); + int32 dist = ABS(act1x - act2x); if (_enHdlVar[EN_CAVEFISH][1] >= 600) { _enHdlVar[EN_CAVEFISH][2] = 1; diff --git a/engines/scumm/insane/insane_iact.cpp b/engines/scumm/insane/insane_iact.cpp index 265931ecc24..3592d67c186 100644 --- a/engines/scumm/insane/insane_iact.cpp +++ b/engines/scumm/insane/insane_iact.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/scumm_v7.h" diff --git a/engines/scumm/insane/insane_scenes.cpp b/engines/scumm/insane/insane_scenes.cpp index 36a3f5a8b7f..841fedafe22 100644 --- a/engines/scumm/insane/insane_scenes.cpp +++ b/engines/scumm/insane/insane_scenes.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/midiparser_ro.cpp b/engines/scumm/midiparser_ro.cpp index be77e4fd66b..1a31d1ca825 100644 --- a/engines/scumm/midiparser_ro.cpp +++ b/engines/scumm/midiparser_ro.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/music.h b/engines/scumm/music.h index 6285412ffdd..a527c77b728 100644 --- a/engines/scumm/music.h +++ b/engines/scumm/music.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_MUSIC_H diff --git a/engines/scumm/nut_renderer.cpp b/engines/scumm/nut_renderer.cpp index 7f250e45e0b..048b29d68b7 100644 --- a/engines/scumm/nut_renderer.cpp +++ b/engines/scumm/nut_renderer.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/scumm/nut_renderer.h b/engines/scumm/nut_renderer.h index 5783646d111..acccf161fa7 100644 --- a/engines/scumm/nut_renderer.h +++ b/engines/scumm/nut_renderer.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #if !defined(SCUMM_NUT_RENDERER_H) && defined(ENABLE_SCUMM_7_8) diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp index c2547f74f41..ae4bbc45a62 100644 --- a/engines/scumm/object.cpp +++ b/engines/scumm/object.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/actor.h" @@ -104,7 +101,7 @@ void ScummEngine::setOwnerOf(int obj, int owner) { // In Sam & Max this is necessary, or you won't get your stuff back // from the Lost and Found tent after riding the Cone of Tragedy. But // it probably applies to all V6+ games. See bugs #493153 and #907113. - // FT disassembly is checked, behaviour is correct. [sev] + // FT disassembly is checked, behavior is correct. [sev] int arg = (_game.version >= 6) ? obj : 0; @@ -195,8 +192,11 @@ void ScummEngine::clearOwnerOf(int obj) { if (!_inventory[i] && _inventory[i+1]) { _inventory[i] = _inventory[i+1]; _inventory[i+1] = 0; - _res->address[rtInventory][i] = _res->address[rtInventory][i + 1]; - _res->address[rtInventory][i + 1] = NULL; + // FIXME FIXME FIXME: This is incomplete, as we do not touch flags, status... BUG + _res->_types[rtInventory][i]._address = _res->_types[rtInventory][i + 1]._address; + _res->_types[rtInventory][i]._size = _res->_types[rtInventory][i + 1]._size; + _res->_types[rtInventory][i + 1]._address = NULL; + _res->_types[rtInventory][i + 1]._size = 0; } } break; @@ -1799,7 +1799,7 @@ int ScummEngine::findLocalObjectSlot() { int ScummEngine::findFlObjectSlot() { int i; for (i = 1; i < _numFlObject; i++) { - if (_res->address[rtFlObject][i] == NULL) + if (_res->_types[rtFlObject][i]._address == NULL) return i; } error("findFlObjectSlot: Out of FLObject slots"); diff --git a/engines/scumm/object.h b/engines/scumm/object.h index 2a817b2b88b..cdf8b09e6f0 100644 --- a/engines/scumm/object.h +++ b/engines/scumm/object.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_OBJECT_H diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp index b0786c924d7..ba13ff46d9d 100644 --- a/engines/scumm/palette.cpp +++ b/engines/scumm/palette.cpp @@ -17,9 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" @@ -217,7 +214,7 @@ void ScummEngine::resetPalette() { } else { if ((_game.platform == Common::kPlatformAmiga) && _game.version == 4) { // if rendermode is set to EGA we use the full palette from the resources - // else we initialise and then lock down the first 16 colors. + // else we initialize and then lock down the first 16 colors. if (_renderMode != Common::kRenderEGA) setPaletteFromTable(tableAmigaMIPalette, sizeof(tableAmigaMIPalette) / 3); #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE @@ -1009,9 +1006,6 @@ void ScummEngine::setPalColor(int idx, int r, int g, int b) { } void ScummEngine::setCurrentPalette(int palindex) { - // TODO: This method could almost be moved to ScummEngin_v6, the only - // problem is that it is called by ScummEngine::resetRoomSubBlocks(). - // But it should be possible to get rid of that, too (with some care). const byte *pals; _curPalIndex = palindex; diff --git a/engines/scumm/player_mod.cpp b/engines/scumm/player_mod.cpp index 657595fab1c..6411f0a17a5 100644 --- a/engines/scumm/player_mod.cpp +++ b/engines/scumm/player_mod.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/player_mod.h b/engines/scumm/player_mod.h index 3f97c4cab9e..619d83541d1 100644 --- a/engines/scumm/player_mod.h +++ b/engines/scumm/player_mod.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_MOD_H diff --git a/engines/scumm/player_nes.cpp b/engines/scumm/player_nes.cpp index 5f792401e07..3f8bcef8b71 100644 --- a/engines/scumm/player_nes.cpp +++ b/engines/scumm/player_nes.cpp @@ -18,9 +18,6 @@ * aint32 with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DISABLE_NES_APU diff --git a/engines/scumm/player_nes.h b/engines/scumm/player_nes.h index 402eea7bf8c..be1617e0f61 100644 --- a/engines/scumm/player_nes.h +++ b/engines/scumm/player_nes.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_NES_H diff --git a/engines/scumm/player_pce.cpp b/engines/scumm/player_pce.cpp index 46d976773d7..786971c6834 100644 --- a/engines/scumm/player_pce.cpp +++ b/engines/scumm/player_pce.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/scumm/player_pce.h b/engines/scumm/player_pce.h index 42153e8abca..eb6afd892ab 100644 --- a/engines/scumm/player_pce.h +++ b/engines/scumm/player_pce.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_PCE_H diff --git a/engines/scumm/player_sid.cpp b/engines/scumm/player_sid.cpp index 11468f30973..f0f60a39241 100644 --- a/engines/scumm/player_sid.cpp +++ b/engines/scumm/player_sid.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DISABLE_SID diff --git a/engines/scumm/player_sid.h b/engines/scumm/player_sid.h index 71497cc6f4a..baeb7bbef09 100644 --- a/engines/scumm/player_sid.h +++ b/engines/scumm/player_sid.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_SID_H diff --git a/engines/scumm/player_towns.cpp b/engines/scumm/player_towns.cpp index 8922ff17301..e71a8d0587c 100644 --- a/engines/scumm/player_towns.cpp +++ b/engines/scumm/player_towns.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -29,10 +26,8 @@ namespace Scumm { -Player_Towns::Player_Towns(ScummEngine *vm, bool isVersion2) : _vm(vm), _v2(isVersion2), _numSoundMax(isVersion2 ? 256 : 200) { +Player_Towns::Player_Towns(ScummEngine *vm, bool isVersion2) : _vm(vm), _v2(isVersion2), _intf(0), _numSoundMax(isVersion2 ? 256 : 200), _unkFlags(0x33) { memset(_pcmCurrentSound, 0, sizeof(_pcmCurrentSound)); - _unkFlags = 0x33; - _intf = 0; } void Player_Towns::setSfxVolume(int vol) { @@ -505,15 +500,15 @@ void Player_Towns_v1::playEuphonyTrack(int sound, const uint8 *data) { const uint8 *trackData = src + 150; for (int i = 0; i < 32; i++) - _driver->chanEnable(i, *src++); + _driver->configChan_enable(i, *src++); for (int i = 0; i < 32; i++) - _driver->chanMode(i, 0xff); + _driver->configChan_setMode(i, 0xff); for (int i = 0; i < 32; i++) - _driver->chanOrdr(i, *src++); + _driver->configChan_remap(i, *src++); for (int i = 0; i < 32; i++) - _driver->chanVolumeShift(i, *src++); + _driver->configChan_adjustVolume(i, *src++); for (int i = 0; i < 32; i++) - _driver->chanNoteShift(i, *src++); + _driver->configChan_setTranspose(i, *src++); src += 8; for (int i = 0; i < 6; i++) @@ -579,18 +574,18 @@ void Player_Towns_v1::playCdaTrack(int sound, const uint8 *data, bool skipTrackV _cdaCurrentSound = sound; } -Player_Towns_v2::Player_Towns_v2(ScummEngine *vm, IMuse *imuse, Audio::Mixer *mixer, bool disposeIMuse) : Player_Towns(vm, true), _imuse(imuse), _imuseDispose(disposeIMuse) { +Player_Towns_v2::Player_Towns_v2(ScummEngine *vm, Audio::Mixer *mixer, IMuse *imuse, bool disposeIMuse) : Player_Towns(vm, true), _imuse(imuse), _imuseDispose(disposeIMuse), _sblData(0) { _soundOverride = new SoundOvrParameters[_numSoundMax]; memset(_soundOverride, 0, _numSoundMax * sizeof(SoundOvrParameters)); - _sblData = 0; _intf = new TownsAudioInterface(mixer, 0); } Player_Towns_v2::~Player_Towns_v2() { delete _intf; + _intf = 0; if (_imuseDispose) - delete _imuse; + delete _imuse; delete[] _sblData; delete[] _soundOverride; diff --git a/engines/scumm/player_towns.h b/engines/scumm/player_towns.h index fda8bd40426..470020d621e 100644 --- a/engines/scumm/player_towns.h +++ b/engines/scumm/player_towns.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_TOWNS_H @@ -29,6 +26,7 @@ #include "scumm/scumm.h" #include "scumm/imuse/imuse.h" #include "audio/softsynth/fmtowns_pc98/towns_euphony.h" +#include "audio/softsynth/fmtowns_pc98/towns_midi.h" namespace Scumm { @@ -144,7 +142,7 @@ private: class Player_Towns_v2 : public Player_Towns { public: - Player_Towns_v2(ScummEngine *vm, IMuse *imuse, Audio::Mixer *mixer, bool disposeIMuse); + Player_Towns_v2(ScummEngine *vm, Audio::Mixer *mixer, IMuse *imuse, bool disposeIMuse); ~Player_Towns_v2(); bool init(); @@ -172,6 +170,7 @@ private: SoundOvrParameters *_soundOverride; uint8 *_sblData; + IMuse *_imuse; const bool _imuseDispose; }; diff --git a/engines/scumm/player_v1.cpp b/engines/scumm/player_v1.cpp index f2487c0a57a..8afede8c5af 100644 --- a/engines/scumm/player_v1.cpp +++ b/engines/scumm/player_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/player_v1.h b/engines/scumm/player_v1.h index acba13e4755..9e6063adc98 100644 --- a/engines/scumm/player_v1.h +++ b/engines/scumm/player_v1.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_V1_H diff --git a/engines/scumm/player_v2.cpp b/engines/scumm/player_v2.cpp index a66e248eccb..6910f5e0dba 100644 --- a/engines/scumm/player_v2.cpp +++ b/engines/scumm/player_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/player_v2.h" diff --git a/engines/scumm/player_v2.h b/engines/scumm/player_v2.h index 6a0b3d6d5e5..14a0b9c1e0b 100644 --- a/engines/scumm/player_v2.h +++ b/engines/scumm/player_v2.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_V2_H diff --git a/engines/scumm/player_v2a.cpp b/engines/scumm/player_v2a.cpp index cee77024ca5..ed97c4098f8 100644 --- a/engines/scumm/player_v2a.cpp +++ b/engines/scumm/player_v2a.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "engines/engine.h" diff --git a/engines/scumm/player_v2a.h b/engines/scumm/player_v2a.h index d60040bd76d..719d5491eaa 100644 --- a/engines/scumm/player_v2a.h +++ b/engines/scumm/player_v2a.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_V2A_H diff --git a/engines/scumm/player_v2base.cpp b/engines/scumm/player_v2base.cpp index 61c91aae856..0d3ad4b1b33 100644 --- a/engines/scumm/player_v2base.cpp +++ b/engines/scumm/player_v2base.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/player_v2base.h" diff --git a/engines/scumm/player_v2base.h b/engines/scumm/player_v2base.h index bd910b8a780..2f048070ada 100644 --- a/engines/scumm/player_v2base.h +++ b/engines/scumm/player_v2base.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_V2BASE_H diff --git a/engines/scumm/player_v2cms.cpp b/engines/scumm/player_v2cms.cpp index b081a684287..21e7f193b5b 100644 --- a/engines/scumm/player_v2cms.cpp +++ b/engines/scumm/player_v2cms.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/player_v2cms.h" diff --git a/engines/scumm/player_v2cms.h b/engines/scumm/player_v2cms.h index fd939d85056..f7dc0c16b11 100644 --- a/engines/scumm/player_v2cms.h +++ b/engines/scumm/player_v2cms.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_V2CMS_H diff --git a/engines/scumm/player_v3a.cpp b/engines/scumm/player_v3a.cpp index cffbd729ea8..472cd1252b1 100644 --- a/engines/scumm/player_v3a.cpp +++ b/engines/scumm/player_v3a.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/player_v3a.h b/engines/scumm/player_v3a.h index d3d1e5eeb57..9449664e9b1 100644 --- a/engines/scumm/player_v3a.h +++ b/engines/scumm/player_v3a.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_V3A_H diff --git a/engines/scumm/player_v4a.cpp b/engines/scumm/player_v4a.cpp index 53c9e6b93cc..e791736f0e3 100644 --- a/engines/scumm/player_v4a.cpp +++ b/engines/scumm/player_v4a.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "engines/engine.h" diff --git a/engines/scumm/player_v4a.h b/engines/scumm/player_v4a.h index 458a39b5fe6..d01c70f2956 100644 --- a/engines/scumm/player_v4a.h +++ b/engines/scumm/player_v4a.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_V4A_H @@ -70,7 +67,7 @@ private: // byte type; } _sfxSlots[4]; - int8 _initState; // < 0: failed, 0: uninitialised, > 0: initialised + int8 _initState; // < 0: failed, 0: uninitialized, > 0: initialized int getSfxChan(int id) const { for (int i = 0; i < ARRAYSIZE(_sfxSlots); ++i) diff --git a/engines/scumm/proc3ARM.s b/engines/scumm/proc3ARM.s index 5acfa86c295..5833bcf90bd 100644 --- a/engines/scumm/proc3ARM.s +++ b/engines/scumm/proc3ARM.s @@ -18,9 +18,6 @@ @ along with this program@ if not, write to the Free Software @ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @ -@ $URL$ -@ $Id$ -@ @ @author Robin Watts (robin@wss.co.uk) .text diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp index c872a83d145..0448f605936 100644 --- a/engines/scumm/resource.cpp +++ b/engines/scumm/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/str.h" @@ -55,7 +52,7 @@ enum { -extern const char *resTypeFromId(int id); +extern const char *nameOfResType(ResType type); static uint16 newTag2Old(uint32 newTag); static const byte *findResourceSmall(uint32 tag, const byte *searchin); @@ -86,8 +83,8 @@ void ScummEngine::openRoom(const int room) { // Load the disk numer / room offs (special case for room 0 exists because // room 0 contains the data which is used to create the roomno / roomoffs // tables -- hence obviously we mustn't use those when loading room 0. - const uint32 diskNumber = room ? _res->roomno[rtRoom][room] : 0; - const uint32 room_offs = room ? _res->roomoffs[rtRoom][room] : 0; + const uint32 diskNumber = room ? _res->_types[rtRoom][room]._roomno : 0; + const uint32 room_offs = room ? _res->_types[rtRoom][room]._roomoffs : 0; // FIXME: Since room_offs is const, clearly the following loop either // is never entered, or loops forever (if it wasn't for the return/error @@ -97,7 +94,7 @@ void ScummEngine::openRoom(const int room) { while (room_offs != RES_INVALID_OFFSET) { if (room_offs != 0 && room != 0 && _game.heversion < 98) { - _fileOffset = _res->roomoffs[rtRoom][room]; + _fileOffset = _res->_types[rtRoom][room]._roomoffs; return; } @@ -125,7 +122,7 @@ void ScummEngine::openRoom(const int room) { return; deleteRoomOffsets(); readRoomsOffsets(); - _fileOffset = _res->roomoffs[rtRoom][room]; + _fileOffset = _res->_types[rtRoom][room]._roomoffs; if (_fileOffset != 8) return; @@ -160,15 +157,13 @@ void ScummEngine::closeRoom() { /** Delete the currently loaded room offsets. */ void ScummEngine::deleteRoomOffsets() { for (int i = 0; i < _numRooms; i++) { - if (_res->roomoffs[rtRoom][i] != RES_INVALID_OFFSET) - _res->roomoffs[rtRoom][i] = 0; + if (_res->_types[rtRoom][i]._roomoffs != RES_INVALID_OFFSET) + _res->_types[rtRoom][i]._roomoffs = 0; } } /** Read room offsets */ void ScummEngine::readRoomsOffsets() { - debug(9, "readRoomOffsets()"); - if (_game.features & GF_SMALL_HEADER) { _fileHandle->seek(12, SEEK_SET); // Directly searching for the room offset block would be more generic... } else { @@ -179,8 +174,8 @@ void ScummEngine::readRoomsOffsets() { while (num--) { int room = _fileHandle->readByte(); int offset = _fileHandle->readUint32LE(); - if (_res->roomoffs[rtRoom][room] != RES_INVALID_OFFSET) { - _res->roomoffs[rtRoom][room] = offset; + if (_res->_types[rtRoom][room]._roomoffs != RES_INVALID_OFFSET) { + _res->_types[rtRoom][room]._roomoffs = offset; } } } @@ -303,6 +298,7 @@ void ScummEngine::readIndexFile() { break; numblock++; + debug(2, "Reading index block of type '%s', size %d", tag2str(blocktype), itemsize); readIndexBlock(blocktype, itemsize); } @@ -352,7 +348,6 @@ void ScummEngine_v7::readIndexBlock(uint32 blocktype, uint32 itemsize) { char *ptr; switch (blocktype) { case MKTAG('A','N','A','M'): // Used by: The Dig, FT - debug(9, "found ANAM block, reading audio names"); num = _fileHandle->readUint16LE(); ptr = (char*)malloc(num * 9); _fileHandle->read(ptr, num * 9); @@ -421,7 +416,6 @@ void ScummEngine::readIndexBlock(uint32 blocktype, uint32 itemsize) { break; case MKTAG('D','O','B','J'): - debug(9, "found DOBJ block, reading object table"); readGlobalObjects(); break; @@ -488,73 +482,78 @@ void ScummEngine::readArrayFromIndexFile() { error("readArrayFromIndexFile() not supported in pre-V6 games"); } -int ScummEngine::readResTypeList(int id) { - int num; - int i; - - debug(9, "readResTypeList(%s)", resTypeFromId(id)); +int ScummEngine::readResTypeList(ResType type) { + uint num; + ResId idx; if (_game.version == 8) num = _fileHandle->readUint32LE(); else num = _fileHandle->readUint16LE(); - if (num != _res->num[id]) { - error("Invalid number of %ss (%d) in directory", resTypeFromId(id), num); + if (num != _res->_types[type].size()) { + error("Invalid number of %ss (%d) in directory", nameOfResType(type), num); } - for (i = 0; i < num; i++) { - _res->roomno[id][i] = _fileHandle->readByte(); + debug(2, " readResTypeList(%s): %d entries", nameOfResType(type), num); + + + for (idx = 0; idx < num; idx++) { + _res->_types[type][idx]._roomno = _fileHandle->readByte(); } - for (i = 0; i < num; i++) { - _res->roomoffs[id][i] = _fileHandle->readUint32LE(); + for (idx = 0; idx < num; idx++) { + _res->_types[type][idx]._roomoffs = _fileHandle->readUint32LE(); } return num; } -int ScummEngine_v70he::readResTypeList(int id) { - int num; - int i; +int ScummEngine_v70he::readResTypeList(ResType type) { + uint num; + ResId idx; - num = ScummEngine::readResTypeList(id); + num = ScummEngine::readResTypeList(type); - if (id == rtRoom) - for (i = 0; i < num; i++) { - _heV7RoomIntOffsets[i] = _res->roomoffs[rtRoom][i]; + if (type == rtRoom) + for (idx = 0; idx < num; idx++) { + _heV7RoomIntOffsets[idx] = _res->_types[rtRoom][idx]._roomoffs; } - for (i = 0; i < num; i++) { - _res->globsize[id][i] = _fileHandle->readUint32LE(); + for (idx = 0; idx < num; idx++) { + // The globsize is currently not being used + /*_res->_types[type][idx]._globsize =*/ _fileHandle->readUint32LE(); } return num; } -void ResourceManager::allocResTypeData(int id, uint32 tag, int num_, const char *name_, int mode_) { - debug(9, "allocResTypeData(%s/%s,%s,%d,%d)", resTypeFromId(id), name_, tag2str(TO_BE_32(tag)), num_, mode_); - assert(id >= 0 && id < (int)(ARRAYSIZE(this->mode))); +void ResourceManager::allocResTypeData(ResType type, uint32 tag, int num, ResTypeMode mode) { + debug(2, "allocResTypeData(%s,%s,%d,%d)", nameOfResType(type), tag2str(TO_BE_32(tag)), num, mode); + assert(type >= 0 && type < (int)(ARRAYSIZE(_types))); - if (num_ >= 8000) - error("Too many %ss (%d) in directory", name_, num_); + if (num >= 8000) + error("Too many %s resources (%d) in directory", nameOfResType(type), num); - mode[id] = mode_; - num[id] = num_; - tags[id] = tag; - name[id] = name_; - address[id] = (byte **)calloc(num_, sizeof(void *)); - flags[id] = (byte *)calloc(num_, sizeof(byte)); - status[id] = (byte *)calloc(num_, sizeof(byte)); + _types[type]._mode = mode; + _types[type]._tag = tag; - if (mode_) { - roomno[id] = (byte *)calloc(num_, sizeof(byte)); - roomoffs[id] = (uint32 *)calloc(num_, sizeof(uint32)); + // If there was data in there, let's clear it out completely. This is important + // in case we are restarting the game. + _types[type].clear(); + _types[type].resize(num); + +/* + TODO: Use multiple Resource subclasses, one for each res mode; then, + given them serializability. + if (mode) { + _types[type].roomno = (byte *)calloc(num, sizeof(byte)); + _types[type].roomoffs = (uint32 *)calloc(num, sizeof(uint32)); } if (_vm->_game.heversion >= 70) { - globsize[id] = (uint32 *)calloc(num_, sizeof(uint32)); + _types[type].globsize = (uint32 *)calloc(num, sizeof(uint32)); } - +*/ } void ScummEngine::loadCharset(int no) { @@ -588,16 +587,14 @@ void ScummEngine::nukeCharset(int i) { _res->nukeResource(rtCharset, i); } -void ScummEngine::ensureResourceLoaded(int type, int i) { - void *addr = NULL; +void ScummEngine::ensureResourceLoaded(ResType type, ResId idx) { + debugC(DEBUG_RESOURCE, "ensureResourceLoaded(%s,%d)", nameOfResType(type), idx); - debugC(DEBUG_RESOURCE, "ensureResourceLoaded(%s,%d)", resTypeFromId(type), i); - - if ((type == rtRoom) && i > 0x7F && _game.version < 7 && _game.heversion <= 71) { - i = _resourceMapper[i & 0x7F]; + if ((type == rtRoom) && idx > 0x7F && _game.version < 7 && _game.heversion <= 71) { + idx = _resourceMapper[idx & 0x7F]; } - // FIXME: This check used to be "i==0". However, that causes + // FIXME: This check used to be "idx==0". However, that causes // problems when using this function to ensure charset 0 is loaded. // This is done for many games, e.g. Zak256 or Indy3 (EGA and VGA). // For now we restrict the check to anything which is not a charset. @@ -608,27 +605,24 @@ void ScummEngine::ensureResourceLoaded(int type, int i) { // our code base? After all we also have to add special cases for many // of our script opcodes that check for the (invalid) actor 0... so // maybe both issues are related... - if (type != rtCharset && i == 0) + if (type != rtCharset && idx == 0) return; - if (i <= _res->num[type]) - addr = _res->address[type][i]; - - if (addr) + if (idx <= _res->_types[type].size() && _res->_types[type][idx]._address) return; - loadResource(type, i); + loadResource(type, idx); - if (_game.version == 5 && type == rtRoom && i == _roomResource) + if (_game.version == 5 && type == rtRoom && (int)idx == _roomResource) VAR(VAR_ROOM_FLAG) = 1; } -int ScummEngine::loadResource(int type, int idx) { +int ScummEngine::loadResource(ResType type, ResId idx) { int roomNr; uint32 fileOffs; uint32 size, tag; - debugC(DEBUG_RESOURCE, "loadResource(%s,%d)", resTypeFromId(type), idx); + debugC(DEBUG_RESOURCE, "loadResource(%s,%d)", nameOfResType(type), idx); if (type == rtCharset && (_game.features & GF_SMALL_HEADER)) { loadCharset(idx); @@ -637,8 +631,8 @@ int ScummEngine::loadResource(int type, int idx) { roomNr = getResourceRoomNr(type, idx); - if (idx >= _res->num[type]) - error("%s %d undefined %d %d", _res->name[type], idx, _res->num[type], roomNr); + if (idx >= _res->_types[type].size()) + error("%s %d undefined %d %d", nameOfResType(type), idx, _res->_types[type].size(), roomNr); if (roomNr == 0) roomNr = _roomResource; @@ -672,11 +666,19 @@ int ScummEngine::loadResource(int type, int idx) { return readSoundResource(idx); } + // Sanity check: Is this the right tag for this resource type? + // + // Currently disabled for newer HE games because they use different + // tags. For example, for rtRoom, 'ROOM' changed to 'RMDA'; and for + // rtImage, 'AWIZ' and 'MULT' can both occur simultaneously. + // On the long run, it would be preferable to not turn this check off, + // but instead to explicitly support the variations in the HE games. tag = _fileHandle->readUint32BE(); - - if (tag != _res->tags[type] && _game.heversion < 70) { - error("%s %d not in room %d at %d+%d in file %s", - _res->name[type], idx, roomNr, + if (tag != _res->_types[type]._tag && _game.heversion < 70) { + error("Unknown res tag '%s' encountered (expected '%s') " + "while trying to load res (%s,%d) in room %d at %d+%d in file %s", + tag2str(tag), tag2str(_res->_types[type]._tag), + nameOfResType(type), idx, roomNr, _fileOffset, fileOffs, _fileHandle->getName()); } @@ -697,35 +699,33 @@ int ScummEngine::loadResource(int type, int idx) { return 1; } -int ScummEngine::getResourceRoomNr(int type, int idx) { +int ScummEngine::getResourceRoomNr(ResType type, ResId idx) { if (type == rtRoom && _game.heversion < 70) return idx; - return _res->roomno[type][idx]; + return _res->_types[type][idx]._roomno; } -uint32 ScummEngine::getResourceRoomOffset(int type, int idx) { +uint32 ScummEngine::getResourceRoomOffset(ResType type, ResId idx) { if (type == rtRoom) { return (_game.version == 8) ? 8 : 0; } - return _res->roomoffs[type][idx]; + return _res->_types[type][idx]._roomoffs; } -uint32 ScummEngine_v70he::getResourceRoomOffset(int type, int idx) { +uint32 ScummEngine_v70he::getResourceRoomOffset(ResType type, ResId idx) { if (type == rtRoom) { return _heV7RoomIntOffsets[idx]; } - return _res->roomoffs[type][idx]; + return _res->_types[type][idx]._roomoffs; } -int ScummEngine::getResourceSize(int type, int idx) { +int ScummEngine::getResourceSize(ResType type, ResId idx) { byte *ptr = getResourceAddress(type, idx); assert(ptr); - MemBlkHeader *hdr = (MemBlkHeader *)(ptr - sizeof(MemBlkHeader)); - - return hdr->size; + return _res->_types[type][idx]._size; } -byte *ScummEngine::getResourceAddress(int type, int idx) { +byte *ScummEngine::getResourceAddress(ResType type, ResId idx) { byte *ptr; if (_game.heversion >= 80 && type == rtString) @@ -734,33 +734,30 @@ byte *ScummEngine::getResourceAddress(int type, int idx) { if (!_res->validateResource("getResourceAddress", type, idx)) return NULL; - if (!_res->address[type]) { - debugC(DEBUG_RESOURCE, "getResourceAddress(%s,%d), _res->address[type] == NULL", resTypeFromId(type), idx); - return NULL; - } - - if (_res->mode[type] && !_res->address[type][idx]) { + // If the resource is missing, but loadable from the game data files, try to do so. + if (!_res->_types[type][idx]._address && _res->_types[type]._mode != kDynamicResTypeMode) { ensureResourceLoaded(type, idx); } - if (!(ptr = (byte *)_res->address[type][idx])) { - debugC(DEBUG_RESOURCE, "getResourceAddress(%s,%d) == NULL", resTypeFromId(type), idx); + ptr = (byte *)_res->_types[type][idx]._address; + if (!ptr) { + debugC(DEBUG_RESOURCE, "getResourceAddress(%s,%d) == NULL", nameOfResType(type), idx); return NULL; } _res->setResourceCounter(type, idx, 1); - debugC(DEBUG_RESOURCE, "getResourceAddress(%s,%d) == %p", resTypeFromId(type), idx, ptr + sizeof(MemBlkHeader)); - return ptr + sizeof(MemBlkHeader); + debugC(DEBUG_RESOURCE, "getResourceAddress(%s,%d) == %p", nameOfResType(type), idx, ptr); + return ptr; } -byte *ScummEngine::getStringAddress(int i) { - byte *addr = getResourceAddress(rtString, i); +byte *ScummEngine::getStringAddress(ResId idx) { + byte *addr = getResourceAddress(rtString, idx); return addr; } -byte *ScummEngine_v6::getStringAddress(int i) { - byte *addr = getResourceAddress(rtString, i); +byte *ScummEngine_v6::getStringAddress(ResId idx) { + byte *addr = getResourceAddress(rtString, idx); if (addr == NULL) return NULL; // Skip over the ArrayHeader @@ -772,35 +769,42 @@ byte *ScummEngine::getStringAddressVar(int i) { } void ResourceManager::increaseExpireCounter() { - if (!(++_expireCounter)) { - increaseResourceCounter(); + ++_expireCounter; + if (_expireCounter == 0) { // overflow? + increaseResourceCounters(); } } -void ResourceManager::increaseResourceCounter() { - int i, j; - byte counter; - - for (i = rtFirst; i <= rtLast; i++) { - for (j = num[i]; --j >= 0;) { - counter = flags[i][j] & RF_USAGE; +void ResourceManager::increaseResourceCounters() { + for (ResType type = rtFirst; type <= rtLast; type = ResType(type + 1)) { + ResId idx = _types[type].size(); + while (idx-- > 0) { + byte counter = _types[type][idx].getResourceCounter(); if (counter && counter < RF_USAGE_MAX) { - setResourceCounter(i, j, counter + 1); + setResourceCounter(type, idx, counter + 1); } } } } -void ResourceManager::setResourceCounter(int type, int idx, byte flag) { - flags[type][idx] &= ~RF_USAGE; - flags[type][idx] |= flag; +void ResourceManager::setResourceCounter(ResType type, ResId idx, byte counter) { + _types[type][idx].setResourceCounter(counter); +} + +void ResourceManager::Resource::setResourceCounter(byte counter) { + _flags &= RF_LOCK; // Clear lower 7 bits, preserve the lock bit. + _flags |= counter; // Update the usage counter +} + +byte ResourceManager::Resource::getResourceCounter() const { + return _flags & RF_USAGE; } /* 2 bytes safety area to make "precaching" of bytes in the gdi drawer easier */ #define SAFETY_AREA 2 -byte *ResourceManager::createResource(int type, int idx, uint32 size) { - debugC(DEBUG_RESOURCE, "_res->createResource(%s,%d,%d)", resTypeFromId(type), idx, size); +byte *ResourceManager::createResource(ResType type, ResId idx, uint32 size) { + debugC(DEBUG_RESOURCE, "_res->createResource(%s,%d,%d)", nameOfResType(type), idx, size); if (!validateResource("allocating", type, idx)) return NULL; @@ -810,31 +814,62 @@ byte *ResourceManager::createResource(int type, int idx, uint32 size) { // cases. For instance, Zak tries to reload the intro music // while it's playing. See bug #1253171. - if (address[type][idx] && (type == rtSound || type == rtScript || type == rtCostume)) - return address[type][idx] + sizeof(MemBlkHeader); + if (_types[type][idx]._address && (type == rtSound || type == rtScript || type == rtCostume)) + return _types[type][idx]._address; } nukeResource(type, idx); expireResources(size); - void *ptr = calloc(size + sizeof(MemBlkHeader) + SAFETY_AREA, 1); + byte *ptr = (byte *)calloc(size + SAFETY_AREA, 1); if (ptr == NULL) { - error("createResource(%s,%d): Out of memory while allocating %d", resTypeFromId(type), idx, size); + error("createResource(%s,%d): Out of memory while allocating %d", nameOfResType(type), idx, size); } _allocatedSize += size; - address[type][idx] = (byte *)ptr; - ((MemBlkHeader *)ptr)->size = size; + _types[type][idx]._address = ptr; + _types[type][idx]._size = size; setResourceCounter(type, idx, 1); - return (byte *)ptr + sizeof(MemBlkHeader); /* skip header */ + return ptr; } -ResourceManager::ResourceManager(ScummEngine *vm) { - memset(this, 0, sizeof(ResourceManager)); - _vm = vm; -// _allocatedSize = 0; +ResourceManager::Resource::Resource() { + _address = 0; + _size = 0; + _flags = 0; + _status = 0; + _roomno = 0; + _roomoffs = 0; +} + +ResourceManager::Resource::~Resource() { + delete _address; + _address = 0; +} + +void ResourceManager::Resource::nuke() { + delete _address; + _address = 0; + _size = 0; + _flags = 0; + _status &= ~RS_MODIFIED; +} + +ResourceManager::ResTypeData::ResTypeData() { + _mode = kDynamicResTypeMode; + _tag = 0; +} + +ResourceManager::ResTypeData::~ResTypeData() { +} + +ResourceManager::ResourceManager(ScummEngine *vm) : _vm(vm) { + _allocatedSize = 0; + _maxHeapThreshold = 0; + _minHeapThreshold = 0; + _expireCounter = 0; } ResourceManager::~ResourceManager() { @@ -848,30 +883,20 @@ void ResourceManager::setHeapThreshold(int min, int max) { _minHeapThreshold = min; } -bool ResourceManager::validateResource(const char *str, int type, int idx) const { - if (type < rtFirst || type > rtLast || (uint) idx >= (uint)num[type]) { - error("%s Illegal Glob type %s (%d) num %d", str, resTypeFromId(type), type, idx); +bool ResourceManager::validateResource(const char *str, ResType type, ResId idx) const { + if (type < rtFirst || type > rtLast || (uint)idx >= (uint)_types[type].size()) { + error("%s Illegal Glob type %s (%d) num %d", str, nameOfResType(type), type, idx); return false; } return true; } -void ResourceManager::nukeResource(int type, int idx) { - byte *ptr; - - if (!address[type]) - return; - - assert(idx >= 0 && idx < num[type]); - - ptr = address[type][idx]; +void ResourceManager::nukeResource(ResType type, ResId idx) { + byte *ptr = _types[type][idx]._address; if (ptr != NULL) { - debugC(DEBUG_RESOURCE, "nukeResource(%s,%d)", resTypeFromId(type), idx); - address[type][idx] = 0; - flags[type][idx] = 0; - status[type][idx] &= ~RS_MODIFIED; - _allocatedSize -= ((MemBlkHeader *)ptr)->size; - free(ptr); + debugC(DEBUG_RESOURCE, "nukeResource(%s,%d)", nameOfResType(type), idx); + _allocatedSize -= _types[type][idx]._size; + _types[type][idx].nuke(); } } @@ -900,77 +925,96 @@ int ScummEngine::getResourceDataSize(const byte *ptr) const { return READ_BE_UINT32(ptr - 4) - _resourceHeaderSize; } -void ResourceManager::lock(int type, int i) { - if (!validateResource("Locking", type, i)) +void ResourceManager::lock(ResType type, ResId idx) { + if (!validateResource("Locking", type, idx)) return; - flags[type][i] |= RF_LOCK; + _types[type][idx].lock(); } -void ResourceManager::unlock(int type, int i) { - if (!validateResource("Unlocking", type, i)) +void ResourceManager::unlock(ResType type, ResId idx) { + if (!validateResource("Unlocking", type, idx)) return; - flags[type][i] &= ~RF_LOCK; + _types[type][idx].unlock(); } -bool ResourceManager::isLocked(int type, int i) const { - if (!validateResource("isLocked", type, i)) +bool ResourceManager::isLocked(ResType type, ResId idx) const { + if (!validateResource("isLocked", type, idx)) return false; - return (flags[type][i] & RF_LOCK) != 0; + return _types[type][idx].isLocked(); } -bool ScummEngine::isResourceInUse(int type, int i) const { - if (!_res->validateResource("isResourceInUse", type, i)) +void ResourceManager::Resource::lock() { + _flags |= RF_LOCK; +} + +void ResourceManager::Resource::unlock() { + _flags &= ~RF_LOCK; +} + +bool ResourceManager::Resource::isLocked() const { + return (_flags & RF_LOCK) != 0; +} + +bool ScummEngine::isResourceInUse(ResType type, ResId idx) const { + if (!_res->validateResource("isResourceInUse", type, idx)) return false; switch (type) { case rtRoom: - return _roomResource == (byte)i; + return _roomResource == (byte)idx; case rtRoomImage: - return _roomResource == (byte)i; + return _roomResource == (byte)idx; case rtRoomScripts: - return _roomResource == (byte)i; + return _roomResource == (byte)idx; case rtScript: - return isScriptInUse(i); + return isScriptInUse(idx); case rtCostume: - return isCostumeInUse(i); + return isCostumeInUse(idx); case rtSound: // Sound resource 1 is used for queued speech - if (_game.heversion >= 60 && i == 1) + if (_game.heversion >= 60 && idx == 1) return true; else - return _sound->isSoundInUse(i); + return _sound->isSoundInUse(idx); case rtCharset: - return _charset->getCurID() == i; + return _charset->getCurID() == (int)idx; case rtImage: - return _res->isModified(type, i) != 0; + return _res->isModified(type, idx) != 0; case rtSpoolBuffer: - return _sound->isSoundRunning(10000 + i) != 0; + return _sound->isSoundRunning(10000 + idx) != 0; default: return false; } } -void ResourceManager::setModified(int type, int i) { - if (!validateResource("Modified", type, i)) +void ResourceManager::setModified(ResType type, ResId idx) { + if (!validateResource("Modified", type, idx)) return; - status[type][i] |= RS_MODIFIED; + _types[type][idx].setModified(); } -bool ResourceManager::isModified(int type, int i) const { - if (!validateResource("isModified", type, i)) +bool ResourceManager::isModified(ResType type, ResId idx) const { + if (!validateResource("isModified", type, idx)) return false; - return (status[type][i] & RS_MODIFIED) != 0; + return _types[type][idx].isModified(); +} + +void ResourceManager::Resource::setModified() { + _status |= RS_MODIFIED; +} + +bool ResourceManager::Resource::isModified() const { + return (_status & RS_MODIFIED) != 0; } void ResourceManager::expireResources(uint32 size) { - int i, j; - byte flag; byte best_counter; - int best_type, best_res = 0; + ResType best_type; + int best_res = 0; uint32 oldAllocatedSize; if (_expireCounter != 0xFF) { _expireCounter = 0xFF; - increaseResourceCounter(); + increaseResourceCounters(); } if (size + _allocatedSize < _maxHeapThreshold) @@ -979,60 +1023,58 @@ void ResourceManager::expireResources(uint32 size) { oldAllocatedSize = _allocatedSize; do { - best_type = 0; + best_type = rtInvalid; best_counter = 2; - for (i = rtFirst; i <= rtLast; i++) - if (mode[i]) { - for (j = num[i]; --j >= 0;) { - flag = flags[i][j]; - if (!(flag & RF_LOCK) && flag >= best_counter && address[i][j] && !_vm->isResourceInUse(i, j)) { - best_counter = flag; - best_type = i; - best_res = j; + for (ResType type = rtFirst; type <= rtLast; type = ResType(type + 1)) { + if (_types[type]._mode != kDynamicResTypeMode) { + // Resources of this type can be reloaded from the data files, + // so we can potentially unload them to free memory. + ResId idx = _types[type].size(); + while (idx-- > 0) { + Resource &tmp = _types[type][idx]; + byte counter = tmp.getResourceCounter(); + if (!tmp.isLocked() && counter >= best_counter && tmp._address && !_vm->isResourceInUse(type, idx)) { + best_counter = counter; + best_type = type; + best_res = idx; } } } + } if (!best_type) break; nukeResource(best_type, best_res); } while (size + _allocatedSize > _minHeapThreshold); - increaseResourceCounter(); + increaseResourceCounters(); debugC(DEBUG_RESOURCE, "Expired resources, mem %d -> %d", oldAllocatedSize, _allocatedSize); } void ResourceManager::freeResources() { - int i, j; - for (i = rtFirst; i <= rtLast; i++) { - for (j = num[i]; --j >= 0;) { - if (isResourceLoaded(i, j)) - nukeResource(i, j); + for (ResType type = rtFirst; type <= rtLast; type = ResType(type + 1)) { + ResId idx = _types[type].size(); + while (idx-- > 0) { + if (isResourceLoaded(type, idx)) + nukeResource(type, idx); } - free(address[i]); - free(flags[i]); - free(status[i]); - free(roomno[i]); - free(roomoffs[i]); - - free(globsize[i]); + _types[type].clear(); } } -void ScummEngine::loadPtrToResource(int type, int resindex, const byte *source) { +void ScummEngine::loadPtrToResource(ResType type, ResId idx, const byte *source) { byte *alloced; int len; - _res->nukeResource(type, resindex); + _res->nukeResource(type, idx); len = resStrLen(source) + 1; - if (len <= 0) return; - alloced = _res->createResource(type, resindex, len); + alloced = _res->createResource(type, idx, len); if (!source) { // Need to refresh the script pointer, since createResource may @@ -1045,32 +1087,30 @@ void ScummEngine::loadPtrToResource(int type, int resindex, const byte *source) } } -bool ResourceManager::isResourceLoaded(int type, int idx) const { +bool ResourceManager::isResourceLoaded(ResType type, ResId idx) const { if (!validateResource("isResourceLoaded", type, idx)) return false; - return address[type][idx] != NULL; + return _types[type][idx]._address != NULL; } void ResourceManager::resourceStats() { - int i, j; uint32 lockedSize = 0, lockedNum = 0; - byte flag; - for (i = rtFirst; i <= rtLast; i++) - for (j = num[i]; --j >= 0;) { - flag = flags[i][j]; - if (flag & RF_LOCK && address[i][j]) { - lockedSize += ((MemBlkHeader *)address[i][j])->size; + for (ResType type = rtFirst; type <= rtLast; type = ResType(type + 1)) { + ResId idx = _types[type].size(); + while (idx-- > 0) { + Resource &tmp = _types[type][idx]; + if (tmp.isLocked() && tmp._address) { + lockedSize += tmp._size; lockedNum++; } } + } debug(1, "Total allocated size=%d, locked=%d(%d)", _allocatedSize, lockedSize, lockedNum); } void ScummEngine_v5::readMAXS(int blockSize) { - debug(9, "ScummEngine_v5 readMAXS: MAXS has blocksize %d", blockSize); - _numVariables = _fileHandle->readUint16LE(); // 800 _fileHandle->readUint16LE(); // 16 _numBitVariables = _fileHandle->readUint16LE(); // 2048 @@ -1099,8 +1139,6 @@ void ScummEngine_v5::readMAXS(int blockSize) { #ifdef ENABLE_SCUMM_7_8 void ScummEngine_v8::readMAXS(int blockSize) { - debug(9, "ScummEngine_v8 readMAXS: MAXS has blocksize %d", blockSize); - _fileHandle->seek(50, SEEK_CUR); // Skip over SCUMM engine version _fileHandle->seek(50, SEEK_CUR); // Skip over data file version _numVariables = _fileHandle->readUint32LE(); // 1500 @@ -1129,8 +1167,6 @@ void ScummEngine_v8::readMAXS(int blockSize) { } void ScummEngine_v7::readMAXS(int blockSize) { - debug(9, "ScummEngine_v7 readMAXS: MAXS has blocksize %d", blockSize); - _fileHandle->seek(50, SEEK_CUR); // Skip over SCUMM engine version _fileHandle->seek(50, SEEK_CUR); // Skip over data file version _numVariables = _fileHandle->readUint16LE(); @@ -1164,8 +1200,6 @@ void ScummEngine_v7::readMAXS(int blockSize) { void ScummEngine_v6::readMAXS(int blockSize) { if (blockSize == 38) { - debug(0, "ScummEngine_v6 readMAXS: MAXS has blocksize %d", blockSize); - _numVariables = _fileHandle->readUint16LE(); _fileHandle->readUint16LE(); _numBitVariables = _fileHandle->readUint16LE(); @@ -1288,35 +1322,35 @@ void ScummEngine::allocateArrays() { } _res->allocResTypeData(rtCostume, (_game.features & GF_NEW_COSTUMES) ? MKTAG('A','K','O','S') : MKTAG('C','O','S','T'), - _numCostumes, "costume", 1); - _res->allocResTypeData(rtRoom, MKTAG('R','O','O','M'), _numRooms, "room", 1); - _res->allocResTypeData(rtRoomImage, MKTAG('R','M','I','M'), _numRooms, "room image", 1); - _res->allocResTypeData(rtRoomScripts, MKTAG('R','M','S','C'), _numRooms, "room script", 1); - _res->allocResTypeData(rtSound, MKTAG('S','O','U','N'), _numSounds, "sound", 2); - _res->allocResTypeData(rtScript, MKTAG('S','C','R','P'), _numScripts, "script", 1); - _res->allocResTypeData(rtCharset, MKTAG('C','H','A','R'), _numCharsets, "charset", 1); - _res->allocResTypeData(rtObjectName, 0, _numNewNames, "new name", 0); - _res->allocResTypeData(rtInventory, 0, _numInventory, "inventory", 0); - _res->allocResTypeData(rtTemp, 0, 10, "temp", 0); - _res->allocResTypeData(rtScaleTable, 0, 5, "scale table", 0); - _res->allocResTypeData(rtActorName, 0, _numActors, "actor name", 0); - _res->allocResTypeData(rtVerb, 0, _numVerbs, "verb", 0); - _res->allocResTypeData(rtString, 0, _numArray, "array", 0); - _res->allocResTypeData(rtFlObject, 0, _numFlObject, "flobject", 0); - _res->allocResTypeData(rtMatrix, 0, 10, "boxes", 0); - _res->allocResTypeData(rtImage, MKTAG('A','W','I','Z'), _numImages, "images", 1); - _res->allocResTypeData(rtTalkie, MKTAG('T','L','K','E'), _numTalkies, "talkie", 1); + _numCostumes, kStaticResTypeMode); + _res->allocResTypeData(rtRoom, MKTAG('R','O','O','M'), _numRooms, kStaticResTypeMode); + _res->allocResTypeData(rtRoomImage, MKTAG('R','M','I','M'), _numRooms, kStaticResTypeMode); + _res->allocResTypeData(rtRoomScripts, MKTAG('R','M','S','C'), _numRooms, kStaticResTypeMode); + _res->allocResTypeData(rtSound, MKTAG('S','O','U','N'), _numSounds, kSoundResTypeMode); + _res->allocResTypeData(rtScript, MKTAG('S','C','R','P'), _numScripts, kStaticResTypeMode); + _res->allocResTypeData(rtCharset, MKTAG('C','H','A','R'), _numCharsets, kStaticResTypeMode); + _res->allocResTypeData(rtObjectName, 0, _numNewNames, kDynamicResTypeMode); + _res->allocResTypeData(rtInventory, 0, _numInventory, kDynamicResTypeMode); + _res->allocResTypeData(rtTemp, 0, 10, kDynamicResTypeMode); + _res->allocResTypeData(rtScaleTable, 0, 5, kDynamicResTypeMode); + _res->allocResTypeData(rtActorName, 0, _numActors, kDynamicResTypeMode); + _res->allocResTypeData(rtVerb, 0, _numVerbs, kDynamicResTypeMode); + _res->allocResTypeData(rtString, 0, _numArray, kDynamicResTypeMode); + _res->allocResTypeData(rtFlObject, 0, _numFlObject, kDynamicResTypeMode); + _res->allocResTypeData(rtMatrix, 0, 10, kDynamicResTypeMode); + _res->allocResTypeData(rtImage, MKTAG('A','W','I','Z'), _numImages, kStaticResTypeMode); + _res->allocResTypeData(rtTalkie, MKTAG('T','L','K','E'), _numTalkies, kStaticResTypeMode); } void ScummEngine_v70he::allocateArrays() { ScummEngine::allocateArrays(); - _res->allocResTypeData(rtSpoolBuffer, 0, 9, "spool buffer", 1); + _res->allocResTypeData(rtSpoolBuffer, 0, 9, kStaticResTypeMode); _heV7RoomIntOffsets = (uint32 *)calloc(_numRooms, sizeof(uint32)); } -void ScummEngine::dumpResource(const char *tag, int idx, const byte *ptr, int length) { +void ScummEngine::dumpResource(const char *tag, int id, const byte *ptr, int length) { char buf[256]; Common::DumpFile out; @@ -1330,7 +1364,7 @@ void ScummEngine::dumpResource(const char *tag, int idx, const byte *ptr, int le else size = READ_BE_UINT32(ptr + 4); - sprintf(buf, "dumps/%s%d.dmp", tag, idx); + sprintf(buf, "dumps/%s%d.dmp", tag, id); out.open(buf); if (out.isOpen() == false) @@ -1499,10 +1533,10 @@ uint16 newTag2Old(uint32 newTag) { } } -const char *resTypeFromId(int id) { +const char *nameOfResType(ResType type) { static char buf[100]; - switch (id) { + switch (type) { case rtRoom: return "Room"; case rtScript: @@ -1545,10 +1579,8 @@ const char *resTypeFromId(int id) { return "Talkie"; case rtSpoolBuffer: return "SpoolBuffer"; - case rtNumTypes: - return "NumTypes"; default: - sprintf(buf, "%d", id); + sprintf(buf, "rt%d", type); return buf; } } diff --git a/engines/scumm/resource.h b/engines/scumm/resource.h index a14b7173a2a..e8b0c1eaae3 100644 --- a/engines/scumm/resource.h +++ b/engines/scumm/resource.h @@ -17,14 +17,14 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_RESOURCE_H #define SCUMM_RESOURCE_H +#include "common/array.h" +#include "scumm/scumm.h" // for ResType + namespace Scumm { enum { @@ -44,6 +44,185 @@ public: const byte *findNext(uint32 tag); }; +enum { + RES_INVALID_OFFSET = 0xFFFFFFFF +}; + +class ScummEngine; + +/** + * The mode of a resource type indicates whether the resource can be restored + * from the game data files or not. + * This affects for example whether the resource is stored in savestates. + * + * Note that we treat sound resources somewhat differently: On the one hand, + * these behave mostly like a kStaticResTypeMode res type. However, when we + * create a savestate, we do save *some* information about them: Namely, which + * sound resources are loaded in memory at the time the save is made. And when + * loading, we invoke ensureResourceLoaded() for each sound resource that was + * marked in this way. + */ +enum ResTypeMode { + kDynamicResTypeMode = 0, ///!< Resource is generated during runtime and may change + kStaticResTypeMode = 1, ///!< Resource comes from data files, does not change + kSoundResTypeMode = 2 ///!< Resource comes from data files, but may change +}; + +/** + * The 'resource manager' class. Currently doesn't really deserve to be called + * a 'class', at least until somebody gets around to OOfying this more. + */ +class ResourceManager { + //friend class ScummDebugger; + //friend class ScummEngine; +protected: + ScummEngine *_vm; + +public: + class Resource { + public: + /** + * Pointer to the data contained in this resource + */ + byte *_address; + + /** + * Size of this resource, i.e. of the data contained in it. + */ + uint32 _size; + + protected: + /** + * The uppermost bit indicates whether the resources is locked. + * The lower 7 bits contain a counter. This counter measures roughly + * how old the resource is; it starts out with a count of 1 and can go + * as high as 127. When memory falls low resp. when the engine decides + * that it should throw out some unused stuff, then it begins by + * removing the resources with the highest counter (excluding locked + * resources and resources that are known to be in use). + */ + byte _flags; + + /** + * The status of the resource. Currently only one bit is used, which + * indicates whether the resource is modified. + */ + byte _status; + + public: + /** + * The id of the room (resp. the disk) the resource is contained in. + */ + byte _roomno; + + /** + * The offset (in bytes) where the data for this resources can be found + * in the game data file(s), relative to the start of the room the + * resource is contained in. + * + * A value of RES_INVALID_OFFSET indicates a resources that is not contained + * in the game data files. + */ + uint32 _roomoffs; + + public: + Resource(); + ~Resource(); + + void nuke(); + + inline void setResourceCounter(byte counter); + inline byte getResourceCounter() const; + + void lock(); + void unlock(); + bool isLocked() const; + + void setModified(); + bool isModified() const; + }; + + /** + * This struct represents a resource type and all resource of that type. + */ + class ResTypeData : public Common::Array { + friend class ResourceManager; + public: + /** + * The mode of this res type. + */ + ResTypeMode _mode; + + /** + * The 4-byte tag or chunk type associated to this resource type, if any. + * Only applies to resources that are loaded from the game data files. + * This value is only used for debugging purposes. + */ + uint32 _tag; + + public: + ResTypeData(); + ~ResTypeData(); + }; + ResTypeData _types[rtLast + 1]; + +protected: + uint32 _allocatedSize; + uint32 _maxHeapThreshold, _minHeapThreshold; + byte _expireCounter; + +public: + ResourceManager(ScummEngine *vm); + ~ResourceManager(); + + void setHeapThreshold(int min, int max); + + void allocResTypeData(ResType type, uint32 tag, int num, ResTypeMode mode); + void freeResources(); + + byte *createResource(ResType type, ResId idx, uint32 size); + void nukeResource(ResType type, ResId idx); + +// inline Resource &getRes(ResType type, ResId idx) { return _types[type][idx]; } +// inline const Resource &getRes(ResType type, ResId idx) const { return _types[type][idx]; } + + bool isResourceLoaded(ResType type, ResId idx) const; + + void lock(ResType type, ResId idx); + void unlock(ResType type, ResId idx); + bool isLocked(ResType type, ResId idx) const; + + void setModified(ResType type, ResId idx); + bool isModified(ResType type, ResId idx) const; + + /** + * This method increments the _expireCounter, and if it overflows (which happens + * after at most 256 calls), it calls increaseResourceCounter. + * It is invoked in the engine's main loop ScummEngine::scummLoop(). + */ + void increaseExpireCounter(); + + /** + * Update the specified resource's counter. + */ + void setResourceCounter(ResType type, ResId idx, byte counter); + + /** + * Increment the counter of all unlocked loaded resources. + * The maximal count is 255. + * This is called by increaseExpireCounter and expireResources, + * but also by ScummEngine::startScene. + */ + void increaseResourceCounters(); + + void resourceStats(); + +//protected: + bool validateResource(const char *str, ResType type, ResId idx) const; +protected: + void expireResources(uint32 size); +}; + } // End of namespace Scumm #endif diff --git a/engines/scumm/resource_v2.cpp b/engines/scumm/resource_v2.cpp index 3dc3b4d14e5..927ee676a5f 100644 --- a/engines/scumm/resource_v2.cpp +++ b/engines/scumm/resource_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/file.h" @@ -87,40 +84,40 @@ void ScummEngine_v2::readClassicIndexFile() { } for (i = 0; i < _numRooms; i++) { - _res->roomno[rtRoom][i] = i; + _res->_types[rtRoom][i]._roomno = i; } _fileHandle->seek(_numRooms, SEEK_CUR); for (i = 0; i < _numRooms; i++) { - _res->roomoffs[rtRoom][i] = _fileHandle->readUint16LE(); - if (_res->roomoffs[rtRoom][i] == 0xFFFF) - _res->roomoffs[rtRoom][i] = (uint32)RES_INVALID_OFFSET; + _res->_types[rtRoom][i]._roomoffs = _fileHandle->readUint16LE(); + if (_res->_types[rtRoom][i]._roomoffs == 0xFFFF) + _res->_types[rtRoom][i]._roomoffs = (uint32)RES_INVALID_OFFSET; } for (i = 0; i < _numCostumes; i++) { - _res->roomno[rtCostume][i] = _fileHandle->readByte(); + _res->_types[rtCostume][i]._roomno = _fileHandle->readByte(); } for (i = 0; i < _numCostumes; i++) { - _res->roomoffs[rtCostume][i] = _fileHandle->readUint16LE(); - if (_res->roomoffs[rtCostume][i] == 0xFFFF) - _res->roomoffs[rtCostume][i] = (uint32)RES_INVALID_OFFSET; + _res->_types[rtCostume][i]._roomoffs = _fileHandle->readUint16LE(); + if (_res->_types[rtCostume][i]._roomoffs == 0xFFFF) + _res->_types[rtCostume][i]._roomoffs = (uint32)RES_INVALID_OFFSET; } for (i = 0; i < _numScripts; i++) { - _res->roomno[rtScript][i] = _fileHandle->readByte(); + _res->_types[rtScript][i]._roomno = _fileHandle->readByte(); } for (i = 0; i < _numScripts; i++) { - _res->roomoffs[rtScript][i] = _fileHandle->readUint16LE(); - if (_res->roomoffs[rtScript][i] == 0xFFFF) - _res->roomoffs[rtScript][i] = (uint32)RES_INVALID_OFFSET; + _res->_types[rtScript][i]._roomoffs = _fileHandle->readUint16LE(); + if (_res->_types[rtScript][i]._roomoffs == 0xFFFF) + _res->_types[rtScript][i]._roomoffs = (uint32)RES_INVALID_OFFSET; } for (i = 0; i < _numSounds; i++) { - _res->roomno[rtSound][i] = _fileHandle->readByte(); + _res->_types[rtSound][i]._roomno = _fileHandle->readByte(); } for (i = 0; i < _numSounds; i++) { - _res->roomoffs[rtSound][i] = _fileHandle->readUint16LE(); - if (_res->roomoffs[rtSound][i] == 0xFFFF) - _res->roomoffs[rtSound][i] = (uint32)RES_INVALID_OFFSET; + _res->_types[rtSound][i]._roomoffs = _fileHandle->readUint16LE(); + if (_res->_types[rtSound][i]._roomoffs == 0xFFFF) + _res->_types[rtSound][i]._roomoffs = (uint32)RES_INVALID_OFFSET; } } diff --git a/engines/scumm/resource_v3.cpp b/engines/scumm/resource_v3.cpp index 5f23720ce99..55e42e389c4 100644 --- a/engines/scumm/resource_v3.cpp +++ b/engines/scumm/resource_v3.cpp @@ -18,44 +18,42 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/scumm_v3.h" #include "scumm/file.h" +#include "scumm/resource.h" #include "scumm/util.h" namespace Scumm { -extern const char *resTypeFromId(int id); +extern const char *nameOfResType(ResType type); -int ScummEngine_v3old::readResTypeList(int id) { - int num; - int i; +int ScummEngine_v3old::readResTypeList(ResType type) { + uint num; + ResId idx; - debug(9, "readResTypeList(%s)", resTypeFromId(id)); + debug(9, "readResTypeList(%s)", nameOfResType(type)); num = _fileHandle->readByte(); if (num >= 0xFF) { - error("Too many %ss (%d) in directory", resTypeFromId(id), num); + error("Too many %ss (%d) in directory", nameOfResType(type), num); } - if (id == rtRoom) { - for (i = 0; i < num; i++) - _res->roomno[id][i] = i; + if (type == rtRoom) { + for (idx = 0; idx < num; idx++) + _res->_types[type][idx]._roomno = idx; _fileHandle->seek(num, SEEK_CUR); } else { - for (i = 0; i < num; i++) - _res->roomno[id][i] = _fileHandle->readByte(); + for (idx = 0; idx < num; idx++) + _res->_types[type][idx]._roomno = _fileHandle->readByte(); } - for (i = 0; i < num; i++) { - _res->roomoffs[id][i] = _fileHandle->readUint16LE(); - if (_res->roomoffs[id][i] == 0xFFFF) - _res->roomoffs[id][i] = (uint32)RES_INVALID_OFFSET; + for (idx = 0; idx < num; idx++) { + _res->_types[type][idx]._roomoffs = _fileHandle->readUint16LE(); + if (_res->_types[type][idx]._roomoffs == 0xFFFF) + _res->_types[type][idx]._roomoffs = (uint32)RES_INVALID_OFFSET; } return num; diff --git a/engines/scumm/resource_v4.cpp b/engines/scumm/resource_v4.cpp index b1d98494d42..6215e86b89b 100644 --- a/engines/scumm/resource_v4.cpp +++ b/engines/scumm/resource_v4.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -31,23 +28,22 @@ namespace Scumm { -extern const char *resTypeFromId(int id); +extern const char *nameOfResType(ResType type); -int ScummEngine_v4::readResTypeList(int id) { - int num; - int i; +int ScummEngine_v4::readResTypeList(ResType type) { + uint num; - debug(9, "readResTypeList(%s)", resTypeFromId(id)); + debug(9, "readResTypeList(%s)", nameOfResType(type)); num = _fileHandle->readUint16LE(); - if (num != _res->num[id]) { - error("Invalid number of %ss (%d) in directory", resTypeFromId(id), num); + if (num != _res->_types[type].size()) { + error("Invalid number of %ss (%d) in directory", nameOfResType(type), num); } - for (i = 0; i < num; i++) { - _res->roomno[id][i] = _fileHandle->readByte(); - _res->roomoffs[id][i] = _fileHandle->readUint32LE(); + for (ResId idx = 0; idx < num; idx++) { + _res->_types[type][idx]._roomno = _fileHandle->readByte(); + _res->_types[type][idx]._roomoffs = _fileHandle->readUint32LE(); } return num; diff --git a/engines/scumm/room.cpp b/engines/scumm/room.cpp index 06fa0f2c396..8962a0e9719 100644 --- a/engines/scumm/room.cpp +++ b/engines/scumm/room.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -118,7 +115,7 @@ void ScummEngine::startScene(int room, Actor *a, int objectNr) { VAR(VAR_ROOM) = room; _fullRedraw = true; - _res->increaseResourceCounter(); + _res->increaseResourceCounters(); _currentRoom = room; VAR(VAR_ROOM) = room; @@ -468,7 +465,7 @@ void ScummEngine::setupRoomSubBlocks() { * So it is not appropriate to call it after loading a savegame. */ void ScummEngine::resetRoomSubBlocks() { - int i; + ResId i; const byte *ptr; byte *roomptr; @@ -528,14 +525,14 @@ void ScummEngine::resetRoomSubBlocks() { // // Load scale data // - for (i = 1; i < _res->num[rtScaleTable]; i++) + for (i = 1; i < _res->_types[rtScaleTable].size(); i++) _res->nukeResource(rtScaleTable, i); ptr = findResourceData(MKTAG('S','C','A','L'), roomptr); if (ptr) { int s1, s2, y1, y2; if (_game.version == 8) { - for (i = 1; i < _res->num[rtScaleTable]; i++, ptr += 16) { + for (i = 1; i < _res->_types[rtScaleTable].size(); i++, ptr += 16) { s1 = READ_LE_UINT32(ptr); y1 = READ_LE_UINT32(ptr + 4); s2 = READ_LE_UINT32(ptr + 8); @@ -543,7 +540,7 @@ void ScummEngine::resetRoomSubBlocks() { setScaleSlot(i, 0, y1, s1, 0, y2, s2); } } else { - for (i = 1; i < _res->num[rtScaleTable]; i++, ptr += 8) { + for (i = 1; i < _res->_types[rtScaleTable].size(); i++, ptr += 8) { s1 = READ_LE_UINT16(ptr); y1 = READ_LE_UINT16(ptr + 2); s2 = READ_LE_UINT16(ptr + 4); @@ -715,7 +712,6 @@ void ScummEngine_v3old::setupRoomSubBlocks() { } void ScummEngine_v3old::resetRoomSubBlocks() { - int i; const byte *ptr; byte *roomptr; @@ -772,7 +768,7 @@ void ScummEngine_v3old::resetRoomSubBlocks() { size = 0; // Compute matrix size - for (i = 0; i < numOfBoxes; i++) { + for (int i = 0; i < numOfBoxes; i++) { while (*tmp != 0xFF) { size++; tmp++; @@ -797,8 +793,8 @@ void ScummEngine_v3old::resetRoomSubBlocks() { // // No scale data in old bundle games // - for (i = 1; i < _res->num[rtScaleTable]; i++) - _res->nukeResource(rtScaleTable, i); + for (ResId id = 1; id < _res->_types[rtScaleTable].size(); id++) + _res->nukeResource(rtScaleTable, id); } diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index 3bfe51a77ba..f5d219c7213 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -314,7 +311,6 @@ static bool loadSaveGameHeader(Common::SeekableReadStream *in, SaveGameHeader &h bool ScummEngine::loadState(int slot, bool compat) { Common::String filename; Common::SeekableReadStream *in; - int i, j; SaveGameHeader hdr; int sb, sh; @@ -429,10 +425,10 @@ bool ScummEngine::loadState(int slot, bool compat) { memset(gfxUsageBits, 0, sizeof(gfxUsageBits)); // Nuke all resources - for (i = rtFirst; i <= rtLast; i++) - if (i != rtTemp && i != rtBuffer && (i != rtSound || _saveSound || !compat)) - for (j = 0; j < _res->num[i]; j++) { - _res->nukeResource(i, j); + for (ResType type = rtFirst; type <= rtLast; type = ResType(type + 1)) + if (type != rtTemp && type != rtBuffer && (type != rtSound || _saveSound || !compat)) + for (ResId idx = 0; idx < _res->_types[type].size(); idx++) { + _res->nukeResource(type, idx); } resetScummVars(); @@ -520,8 +516,8 @@ bool ScummEngine::loadState(int slot, bool compat) { // loading such an old save game, try to upgrade the old to new format. if (hdr.ver < VER(22)) { // Convert all rtScaleTable resources to matching scale items - for (i = 1; i < _res->num[rtScaleTable]; i++) { - convertScaleTableToScaleSlot(i); + for (ResId idx = 1; idx < _res->_types[rtScaleTable].size(); idx++) { + convertScaleTableToScaleSlot(idx); } } @@ -1119,7 +1115,7 @@ void ScummEngine::saveOrLoad(Serializer *s) { MKEND() }; - int i, j; + int i; int var120Backup; int var98Backup; uint8 md5Backup[16]; @@ -1137,9 +1133,9 @@ void ScummEngine::saveOrLoad(Serializer *s) { // MD5 Operations: Backup on load, compare, and reset. if (s->isLoading()) { char md5str1[32+1], md5str2[32+1]; - for (j = 0; j < 16; j++) { - sprintf(md5str1 + j*2, "%02x", (int)_gameMD5[j]); - sprintf(md5str2 + j*2, "%02x", (int)md5Backup[j]); + for (i = 0; i < 16; i++) { + sprintf(md5str1 + i*2, "%02x", (int)_gameMD5[i]); + sprintf(md5str2 + i*2, "%02x", (int)md5Backup[i]); } debug(2, "Save version: %d", s->getVersion()); @@ -1239,18 +1235,19 @@ void ScummEngine::saveOrLoad(Serializer *s) { // // Save/load resources // - int type, idx; + ResType type; + ResId idx; if (s->getVersion() >= VER(26)) { // New, more robust resource save/load system. This stores the type // and index of each resource. Thus if we increase e.g. the maximum // number of script resources, savegames won't break. if (s->isSaving()) { - for (type = rtFirst; type <= rtLast; type++) { - if (_res->mode[type] != 1 && type != rtTemp && type != rtBuffer) { + for (type = rtFirst; type <= rtLast; type = ResType(type + 1)) { + if (_res->_types[type]._mode != kStaticResTypeMode && type != rtTemp && type != rtBuffer) { s->saveUint16(type); // Save the res type... - for (idx = 0; idx < _res->num[type]; idx++) { + for (idx = 0; idx < _res->_types[type].size(); idx++) { // Only save resources which actually exist... - if (_res->address[type][idx]) { + if (_res->_types[type][idx]._address) { s->saveUint16(idx); // Save the index of the resource saveResource(s, type, idx); } @@ -1260,9 +1257,9 @@ void ScummEngine::saveOrLoad(Serializer *s) { } s->saveUint16(0xFFFF); // End marker } else { - while ((type = s->loadUint16()) != 0xFFFF) { + while ((type = (ResType)s->loadUint16()) != 0xFFFF) { while ((idx = s->loadUint16()) != 0xFFFF) { - assert(0 <= idx && idx < _res->num[type]); + assert(idx < _res->_types[type].size()); loadResource(s, type, idx); } } @@ -1271,15 +1268,15 @@ void ScummEngine::saveOrLoad(Serializer *s) { // Old, fragile resource save/load system. Doesn't save resources // with index 0, and breaks whenever we change the limit on a given // resource type. - for (type = rtFirst; type <= rtLast; type++) - if (_res->mode[type] != 1 && type != rtTemp && type != rtBuffer) { + for (type = rtFirst; type <= rtLast; type = ResType(type + 1)) + if (_res->_types[type]._mode != kStaticResTypeMode && type != rtTemp && type != rtBuffer) { // For V1-V5 games, there used to be no object name resources. // At some point this changed. But since old savegames rely on // unchanged resource counts, we have to hard code the following check if (_game.version < 6 && type == rtObjectName) continue; - for (idx = 1; idx < _res->num[type]; idx++) - saveLoadResource(s, type, idx); + for (idx = 1; idx < _res->_types[type].size(); idx++) + loadResourceOLD(s, type, idx); } } @@ -1390,18 +1387,18 @@ void ScummEngine::saveOrLoad(Serializer *s) { // Save/load a list of the locked objects // if (s->isSaving()) { - for (i = rtFirst; i <= rtLast; i++) - for (j = 1; j < _res->num[i]; j++) { - if (_res->isLocked(i, j)) { - s->saveByte(i); - s->saveUint16(j); + for (type = rtFirst; type <= rtLast; type = ResType(type + 1)) + for (idx = 1; idx < _res->_types[type].size(); idx++) { + if (_res->isLocked(type, idx)) { + s->saveByte(type); + s->saveUint16(idx); } } s->saveByte(0xFF); } else { - while ((i = s->loadByte()) != 0xFF) { - j = s->loadUint16(); - _res->lock(i, j); + while ((type = (ResType)s->loadByte()) != 0xFF) { + idx = s->loadUint16(); + _res->lock(type, idx); } } @@ -1636,69 +1633,44 @@ void ScummEngine_v100he::saveOrLoad(Serializer *s) { } #endif -void ScummEngine::saveLoadResource(Serializer *ser, int type, int idx) { - byte *ptr; +void ScummEngine::loadResourceOLD(Serializer *ser, ResType type, ResId idx) { uint32 size; - if (!_res->mode[type]) { - if (ser->isSaving()) { - ptr = _res->address[type][idx]; - if (ptr == NULL) { - ser->saveUint32(0); - return; - } - - size = ((MemBlkHeader *)ptr)->size; - - ser->saveUint32(size); - ser->saveBytes(ptr + sizeof(MemBlkHeader), size); - + if (type == rtSound && ser->getVersion() >= VER(23)) { + // Save/load only a list of resource numbers that need to be reloaded. + if (ser->loadUint16()) + ensureResourceLoaded(rtSound, idx); + } else if (_res->_types[type]._mode == kDynamicResTypeMode) { + size = ser->loadUint32(); + if (size) { + _res->createResource(type, idx, size); + ser->loadBytes(getResourceAddress(type, idx), size); if (type == rtInventory) { - ser->saveUint16(_inventory[idx]); + _inventory[idx] = ser->loadUint16(); } if (type == rtObjectName && ser->getVersion() >= VER(25)) { - ser->saveUint16(_newNames[idx]); + // Paranoia: We increased the possible number of new names + // to fix bugs #933610 and #936323. The savegame format + // didn't change, but at least during the transition + // period there is a slight chance that we try to load + // more names than we have allocated space for. If so, + // discard them. + if (idx < _numNewNames) + _newNames[idx] = ser->loadUint16(); } - } else { - size = ser->loadUint32(); - if (size) { - _res->createResource(type, idx, size); - ser->loadBytes(getResourceAddress(type, idx), size); - if (type == rtInventory) { - _inventory[idx] = ser->loadUint16(); - } - if (type == rtObjectName && ser->getVersion() >= VER(25)) { - // Paranoia: We increased the possible number of new names - // to fix bugs #933610 and #936323. The savegame format - // didn't change, but at least during the transition - // period there is a slight chance that we try to load - // more names than we have allocated space for. If so, - // discard them. - if (idx < _numNewNames) - _newNames[idx] = ser->loadUint16(); - } - } - } - } else if (_res->mode[type] == 2 && ser->getVersion() >= VER(23)) { - // Save/load only a list of resource numbers that need to be reloaded. - if (ser->isSaving()) { - ser->saveUint16(_res->address[type][idx] ? 1 : 0); - } else { - if (ser->loadUint16()) - ensureResourceLoaded(type, idx); } } } -void ScummEngine::saveResource(Serializer *ser, int type, int idx) { - assert(_res->address[type][idx]); +void ScummEngine::saveResource(Serializer *ser, ResType type, ResId idx) { + assert(_res->_types[type][idx]._address); - if (_res->mode[type] == 0) { - byte *ptr = _res->address[type][idx]; - uint32 size = ((MemBlkHeader *)ptr)->size; + if (_res->_types[type]._mode == kDynamicResTypeMode) { + byte *ptr = _res->_types[type][idx]._address; + uint32 size = _res->_types[type][idx]._size; ser->saveUint32(size); - ser->saveBytes(ptr + sizeof(MemBlkHeader), size); + ser->saveBytes(ptr, size); if (type == rtInventory) { ser->saveUint16(_inventory[idx]); @@ -1709,18 +1681,24 @@ void ScummEngine::saveResource(Serializer *ser, int type, int idx) { } } -void ScummEngine::loadResource(Serializer *ser, int type, int idx) { +void ScummEngine::loadResource(Serializer *ser, ResType type, ResId idx) { if (_game.heversion >= 60 && ser->getVersion() <= VER(65) && ((type == rtSound && idx == 1) || (type == rtSpoolBuffer))) { uint32 size = ser->loadUint32(); assert(size); _res->createResource(type, idx, size); ser->loadBytes(getResourceAddress(type, idx), size); - } else if (_res->mode[type] == 0) { + } else if (type == rtSound) { + // HE Games use sound resource 1 for speech + if (_game.heversion >= 60 && idx == 1) + return; + + ensureResourceLoaded(rtSound, idx); + } else if (_res->_types[type]._mode == kDynamicResTypeMode) { uint32 size = ser->loadUint32(); assert(size); - _res->createResource(type, idx, size); - ser->loadBytes(getResourceAddress(type, idx), size); + byte *ptr = _res->createResource(type, idx, size); + ser->loadBytes(ptr, size); if (type == rtInventory) { _inventory[idx] = ser->loadUint16(); @@ -1728,12 +1706,6 @@ void ScummEngine::loadResource(Serializer *ser, int type, int idx) { if (type == rtObjectName) { _newNames[idx] = ser->loadUint16(); } - } else if (_res->mode[type] == 2) { - // HE Games use sound resource 1 for speech - if (_game.heversion >= 60 && idx == 1) - return; - - ensureResourceLoaded(type, idx); } } diff --git a/engines/scumm/saveload.h b/engines/scumm/saveload.h index eead241b90e..776f40e12bf 100644 --- a/engines/scumm/saveload.h +++ b/engines/scumm/saveload.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SAVELOAD_H diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp index 9e02f126cd1..cfc4b3c419d 100644 --- a/engines/scumm/script.cpp +++ b/engines/scumm/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -39,7 +36,7 @@ namespace Scumm { /* Start executing script 'script' with the given parameters */ void ScummEngine::runScript(int script, bool freezeResistant, bool recursive, int *lvarptr, int cycle) { ScriptSlot *s; - byte *scriptPtr; + //byte *scriptPtr; uint32 scriptOffs; byte scriptType; int slot; @@ -51,7 +48,8 @@ void ScummEngine::runScript(int script, bool freezeResistant, bool recursive, in stopScript(script); if (script < _numGlobalScripts) { - scriptPtr = getResourceAddress(rtScript, script); + // Call getResourceAddress to ensure the resource is loaded & its usage count reset + /*scriptPtr =*/ getResourceAddress(rtScript, script); scriptOffs = _resourceHeaderSize; scriptType = WIO_GLOBAL; @@ -393,26 +391,26 @@ void ScummEngine::getScriptBaseAddress() { break; _scriptOrgPointer = getResourceAddress(rtInventory, idx); assert(idx < _numInventory); - _lastCodePtr = &_res->address[rtInventory][idx]; + _lastCodePtr = &_res->_types[rtInventory][idx]._address; break; case WIO_LOCAL: case WIO_ROOM: /* room script */ if (_game.version == 8) { _scriptOrgPointer = getResourceAddress(rtRoomScripts, _roomResource); - assert(_roomResource < _res->num[rtRoomScripts]); - _lastCodePtr = &_res->address[rtRoomScripts][_roomResource]; + assert(_roomResource < (int)_res->_types[rtRoomScripts].size()); + _lastCodePtr = &_res->_types[rtRoomScripts][_roomResource]._address; } else { _scriptOrgPointer = getResourceAddress(rtRoom, _roomResource); assert(_roomResource < _numRooms); - _lastCodePtr = &_res->address[rtRoom][_roomResource]; + _lastCodePtr = &_res->_types[rtRoom][_roomResource]._address; } break; case WIO_GLOBAL: /* global script */ _scriptOrgPointer = getResourceAddress(rtScript, ss->number); assert(ss->number < _numScripts); - _lastCodePtr = &_res->address[rtScript][ss->number]; + _lastCodePtr = &_res->_types[rtScript][ss->number]._address; break; case WIO_FLOBJECT: /* flobject script */ @@ -421,7 +419,7 @@ void ScummEngine::getScriptBaseAddress() { idx = _objs[idx].fl_object_index; _scriptOrgPointer = getResourceAddress(rtFlObject, idx); assert(idx < _numFlObject); - _lastCodePtr = &_res->address[rtFlObject][idx]; + _lastCodePtr = &_res->_types[rtFlObject][idx]._address; break; default: error("Bad type while getting base address"); @@ -448,7 +446,7 @@ void ScummEngine::resetScriptPointer() { * collected by ResourceManager::expireResources. */ void ScummEngine::refreshScriptPointer() { - if (*_lastCodePtr + sizeof(MemBlkHeader) != _scriptOrgPointer) { + if (*_lastCodePtr != _scriptOrgPointer) { long oldoffs = _scriptPointer - _scriptOrgPointer; getScriptBaseAddress(); _scriptPointer = _scriptOrgPointer + oldoffs; @@ -496,7 +494,11 @@ void ScummEngine::executeOpcode(byte i) { } const char *ScummEngine::getOpcodeDesc(byte i) { +#ifndef REDUCE_MEMORY_USAGE return _opcodes[i].desc; +#else + return ""; +#endif } byte ScummEngine::fetchScriptByte() { @@ -1102,7 +1104,7 @@ void ScummEngine::checkAndRunSentenceScript() { // For now we assume that if there are more than 460 scripts, then // the pair 29/104 is used, else the pair 28/103. - if (_res->num[rtScript] > 460) { + if (_res->_types[rtScript].size() > 460) { if (sentenceScript == 104) sentenceScript = 29; } else { diff --git a/engines/scumm/script.h b/engines/scumm/script.h index 39d5d802b44..7b2c625144b 100644 --- a/engines/scumm/script.h +++ b/engines/scumm/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SCRIPT_H @@ -30,14 +27,19 @@ namespace Scumm { - typedef Common::Functor0 Opcode; struct OpcodeEntry : Common::NonCopyable { Opcode *proc; +#ifndef REDUCE_MEMORY_USAGE const char *desc; +#endif +#ifndef REDUCE_MEMORY_USAGE OpcodeEntry() : proc(0), desc(0) {} +#else + OpcodeEntry() : proc(0) {} +#endif ~OpcodeEntry() { setProc(0, 0); } @@ -47,7 +49,9 @@ struct OpcodeEntry : Common::NonCopyable { delete proc; proc = p; } +#ifndef REDUCE_MEMORY_USAGE desc = d; +#endif } }; diff --git a/engines/scumm/script_v0.cpp b/engines/scumm/script_v0.cpp index 7c3964a3267..1ef16d7106d 100644 --- a/engines/scumm/script_v0.cpp +++ b/engines/scumm/script_v0.cpp @@ -18,15 +18,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/actor.h" #include "scumm/charset.h" #include "scumm/object.h" +#include "scumm/resource.h" #include "scumm/scumm_v0.h" #include "scumm/verbs.h" diff --git a/engines/scumm/script_v2.cpp b/engines/scumm/script_v2.cpp index d7ff8950f87..7f02e899b4a 100644 --- a/engines/scumm/script_v2.cpp +++ b/engines/scumm/script_v2.cpp @@ -18,14 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/actor.h" #include "scumm/charset.h" #include "scumm/object.h" +#include "scumm/resource.h" #include "scumm/scumm_v2.h" #include "scumm/sound.h" #include "scumm/util.h" @@ -740,23 +738,23 @@ void ScummEngine_v2::o2_drawObject() { } void ScummEngine_v2::o2_resourceRoutines() { - const ResTypes resTypes[] = { - rtNumTypes, // Invalid - rtNumTypes, // Invalid + const ResType resTypes[] = { + rtInvalid, + rtInvalid, rtCostume, rtRoom, - rtNumTypes, // Invalid + rtInvalid, rtScript, rtSound }; int resid = getVarOrDirectByte(PARAM_1); int opcode = fetchScriptByte(); - ResTypes type = rtNumTypes; + ResType type = rtInvalid; if (0 <= (opcode >> 4) && (opcode >> 4) < (int)ARRAYSIZE(resTypes)) type = resTypes[opcode >> 4]; - if ((opcode & 0x0f) == 0 || type == rtNumTypes) + if ((opcode & 0x0f) == 0 || type == rtInvalid) return; // HACK V2 Maniac Mansion tries to load an invalid sound resource in demo script. diff --git a/engines/scumm/script_v3.cpp b/engines/scumm/script_v3.cpp index 176eefdeef5..b28d8311015 100644 --- a/engines/scumm/script_v3.cpp +++ b/engines/scumm/script_v3.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/scumm_v3.h" diff --git a/engines/scumm/script_v4.cpp b/engines/scumm/script_v4.cpp index 98001e6854c..1302c8c28d7 100644 --- a/engines/scumm/script_v4.cpp +++ b/engines/scumm/script_v4.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/scumm_v4.h" diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp index ee790f78767..2c8f65496fe 100644 --- a/engines/scumm/script_v5.cpp +++ b/engines/scumm/script_v5.cpp @@ -18,14 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/actor.h" #include "scumm/charset.h" #include "scumm/object.h" +#include "scumm/resource.h" #include "scumm/scumm_v3.h" #include "scumm/scumm_v5.h" #include "scumm/sound.h" @@ -1492,7 +1490,7 @@ void ScummEngine_v5::o5_systemOps() { } void ScummEngine_v5::o5_resourceRoutines() { - const ResTypes resType[4] = { rtScript, rtSound, rtCostume, rtRoom }; + const ResType resType[4] = { rtScript, rtSound, rtCostume, rtRoom }; int resid = 0; int foo, bar; @@ -2648,7 +2646,7 @@ void ScummEngine_v5::decodeParseString() { // In SCUMM V1-V3, there were no 'default' values for the text slot - // values. Hence to achieve correct behaviour, we have to keep the + // values. Hence to achieve correct behavior, we have to keep the // 'default' values in sync with the active values. // // Note: This is needed for Indy3 (Grail Diary). It's also needed diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp index b2df1d0baa5..decd34222da 100644 --- a/engines/scumm/script_v6.cpp +++ b/engines/scumm/script_v6.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -360,11 +357,11 @@ void ScummEngine_v6::nukeArray(int a) { } int ScummEngine_v6::findFreeArrayId() { - byte **addr = _res->address[rtString]; + const ResourceManager::ResTypeData &rtd = _res->_types[rtString]; int i; for (i = 1; i < _numArray; i++) { - if (!addr[i]) + if (!rtd[i]._address) return i; } error("Out of array pointers, %d max", _numArray); diff --git a/engines/scumm/script_v8.cpp b/engines/scumm/script_v8.cpp index 1250a82d33f..c8b92be3c82 100644 --- a/engines/scumm/script_v8.cpp +++ b/engines/scumm/script_v8.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index f43aed53f7b..e8dd6cb548b 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -18,16 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" #include "common/debug-channels.h" #include "common/md5.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/system.h" #include "common/translation.h" @@ -65,6 +61,7 @@ #include "scumm/player_v2a.h" #include "scumm/player_v3a.h" #include "scumm/player_v4a.h" +#include "scumm/resource.h" #include "scumm/he/resource_he.h" #include "scumm/scumm_v0.h" #include "scumm/scumm_v8.h" @@ -113,9 +110,13 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) _language(dr.language), _debugger(0), _currentScript(0xFF), // Let debug() work on init stage - _messageDialog(0), _pauseDialog(0), _versionDialog(0) { + _messageDialog(0), _pauseDialog(0), _versionDialog(0), + _rnd("scumm") + { - if (_game.platform == Common::kPlatformNES) { + if (_game.heversion > 0) { + _gdi = new GdiHE(this); + } else if (_game.platform == Common::kPlatformNES) { _gdi = new GdiNES(this); #ifdef USE_RGB_COLOR } else if (_game.features & GF_16BIT_COLOR) { @@ -574,8 +575,6 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) assert(!_mainMenuDialog); _mainMenuDialog = new ScummMenuDialog(this); #endif - - g_eventRec.registerRandomSource(_rnd, "scumm"); } @@ -1184,10 +1183,6 @@ Common::Error ScummEngine::init() { resetScumm(); resetScummVars(); - if (_imuse) { - _imuse->setBase(_res->address[rtSound]); - } - if (_game.version >= 5 && _game.version <= 7) _sound->setupSound(); @@ -1233,7 +1228,7 @@ void ScummEngine::setupScumm() { requestLoad(ConfMan.getInt("save_slot")); } - _res->allocResTypeData(rtBuffer, 0, 10, "buffer", 0); + _res->allocResTypeData(rtBuffer, 0, 10, kDynamicResTypeMode); setupScummVars(); @@ -1833,22 +1828,22 @@ void ScummEngine::setupMusic(int midi) { MidiDriver *nativeMidiDriver = 0; MidiDriver *adlibMidiDriver = 0; - if (_musicType != MDT_ADLIB) + if (_musicType != MDT_ADLIB && _musicType != MDT_TOWNS) nativeMidiDriver = MidiDriver::createMidi(dev); if (nativeMidiDriver != NULL && _native_mt32) nativeMidiDriver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE); bool multi_midi = ConfMan.getBool("multi_midi") && _musicType != MDT_NONE && (midi & MDT_ADLIB); - if (_musicType == MDT_ADLIB || multi_midi) { - adlibMidiDriver = MidiDriver::createMidi(MidiDriver::detectDevice(MDT_ADLIB)); + if (_musicType == MDT_ADLIB || MDT_TOWNS || multi_midi) { + adlibMidiDriver = MidiDriver::createMidi(MidiDriver::detectDevice(_musicType == MDT_TOWNS ? MDT_TOWNS : MDT_ADLIB)); adlibMidiDriver->property(MidiDriver::PROP_OLD_ADLIB, (_game.features & GF_SMALL_HEADER) ? 1 : 0); } _imuse = IMuse::create(_system, nativeMidiDriver, adlibMidiDriver); if (_game.platform == Common::kPlatformFMTowns) { - _musicEngine = _townsPlayer = new Player_Towns_v2(this, _imuse, _mixer, true); + _musicEngine = _townsPlayer = new Player_Towns_v2(this, _mixer, _imuse, true); if (!_townsPlayer->init()) - error("Failed to initialize FM-Towns audio driver"); + error("ScummEngine::setupMusic(): Failed to initialize FM-Towns audio driver"); } else { _musicEngine = _imuse; } @@ -1860,7 +1855,6 @@ void ScummEngine::setupMusic(int midi) { _imuse->property(IMuse::PROP_GAME_ID, _game.id); if (ConfMan.hasKey("tempo")) _imuse->property(IMuse::PROP_TEMPO_BASE, ConfMan.getInt("tempo")); - // YM2162 driver can't handle midi->getPercussionChannel(), NULL shouldn't init MT-32/GM/GS if (midi != MDT_NONE) { _imuse->property(IMuse::PROP_NATIVE_MT32, _native_mt32); if (MidiDriver::getMusicType(dev) != MT_MT32) // MT-32 Emulation shouldn't be GM/GS initialized @@ -2422,13 +2416,16 @@ void ScummEngine::pauseGame() { } void ScummEngine::restart() { -// TODO: Check this function - we should probably be reinitting a lot more stuff, and I suspect -// this leaks memory like a sieve + // FIXME: This function *leaks memory*, and quite a lot so. For example, + // we re-init the resource manager, which causes readMAXS() to be called + // again, which allocates some memory. There are many other leaks, though. -// Fingolfin seez: An alternate way to implement restarting would be to create -// a save state right after startup ... to this end we could introduce a SaveFile -// subclass which is implemented using a memory buffer (i.e. no actual file is -// created). Then to restart we just have to load that pseudo save state. + // TODO: We should also probably be reinitting a lot more stuff. + + // Fingolfin seez: An alternate way to implement restarting would be to create + // a save state right after startup ... to this end we could introduce a SaveFile + // subclass which is implemented using a memory buffer (i.e. no actual file is + // created). Then to restart we just have to load that pseudo save state. int i; @@ -2448,23 +2445,12 @@ void ScummEngine::restart() { for (i = 1; i < _numGlobalObjects; i++) clearOwnerOf(i); - // Reallocate arrays - // FIXME: This should already be called by readIndexFile. - // FIXME: regardless of that, allocateArrays and allocResTypeData leaks - // heavily, which should be fixed. - allocateArrays(); - - // Reread index (reset objectstate etc) readIndexFile(); // Reinit scumm variables resetScumm(); resetScummVars(); - if (_imuse) { - _imuse->setBase(_res->address[rtSound]); - } - // Reinit sound engine if (_game.version >= 5 && _game.version <= 7) _sound->setupSound(); diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index 62c6c70e5a9..d1804d323e7 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_H @@ -47,7 +44,7 @@ #ifdef __DS__ /* This disables the dual layer mode which is used in FM-Towns versions - * of SCUMM games and which emulates the behaviour of the original code. + * of SCUMM games and which emulates the behavior of the original code. * The only purpose is code size reduction for certain backends. * SCUMM 3 (FM-Towns) games will run in normal (DOS VGA) mode, which should * work just fine in most situations. Some glitches might occur. SCUMM 5 games @@ -171,17 +168,6 @@ enum { DEBUG_SMUSH = 1 << 10 // Track SMUSH }; -/** - * Internal header for any memory block allocated by the resource manager. - * - * @todo Hide MemBlkHeader; no code outside the resource manager should - * have to use it, ever. Currently script code needs it to detect whether - * some scripts have moved (in fetchScriptByte()). - */ -struct MemBlkHeader { - uint32 size; -}; - struct VerbSlot; struct ObjectData; @@ -242,7 +228,7 @@ enum ScummGameId { GID_TENTACLE, GID_ZAK, - GID_HEGAME, // Generic name for all HE games with default behaviour + GID_HEGAME, // Generic name for all HE games with default behavior GID_PUTTDEMO, GID_FBEAR, GID_PUTTMOON, @@ -322,7 +308,8 @@ struct SaveStateMetaInfos { * WARNING: Do not change the order of these, as the savegame format relies * on it; any change made here will break savegame compatibility! */ -enum ResTypes { +enum ResType { + rtInvalid = 0, rtFirst = 1, rtRoom = 1, rtScript = 2, @@ -345,75 +332,12 @@ enum ResTypes { rtImage = 19, rtTalkie = 20, rtSpoolBuffer = 21, - rtLast = 21, - rtNumTypes = 22 + rtLast = 21 }; -enum { - RES_INVALID_OFFSET = 0xFFFFFFFF -}; +typedef uint16 ResId; -/** - * The 'resource manager' class. Currently doesn't really deserve to be called - * a 'class', at least until somebody gets around to OOfying this more. - */ -class ResourceManager { - //friend class ScummDebugger; - //friend class ScummEngine; -protected: - ScummEngine *_vm; - -public: - byte mode[rtNumTypes]; - uint16 num[rtNumTypes]; - uint32 tags[rtNumTypes]; - const char *name[rtNumTypes]; - byte **address[rtNumTypes]; -protected: - byte *flags[rtNumTypes]; - byte *status[rtNumTypes]; -public: - byte *roomno[rtNumTypes]; - uint32 *roomoffs[rtNumTypes]; - uint32 *globsize[rtNumTypes]; - -protected: - uint32 _allocatedSize; - uint32 _maxHeapThreshold, _minHeapThreshold; - byte _expireCounter; - -public: - ResourceManager(ScummEngine *vm); - ~ResourceManager(); - - void setHeapThreshold(int min, int max); - - void allocResTypeData(int id, uint32 tag, int num, const char *name, int mode); - void freeResources(); - - byte *createResource(int type, int index, uint32 size); - void nukeResource(int type, int i); - - bool isResourceLoaded(int type, int index) const; - - void lock(int type, int i); - void unlock(int type, int i); - bool isLocked(int type, int i) const; - - void setModified(int type, int i); - bool isModified(int type, int i) const; - - void increaseExpireCounter(); - void setResourceCounter(int type, int index, byte flag); - void increaseResourceCounter(); - - void resourceStats(); - -//protected: - bool validateResource(const char *str, int type, int index) const; -protected: - void expireResources(uint32 size); -}; +class ResourceManager; /** * Base class for all SCUMM engines. @@ -654,9 +578,9 @@ protected: bool saveState(int slot, bool compat); bool loadState(int slot, bool compat); virtual void saveOrLoad(Serializer *s); - void saveLoadResource(Serializer *ser, int type, int index); // "Obsolete" - void saveResource(Serializer *ser, int type, int index); - void loadResource(Serializer *ser, int type, int index); + void saveResource(Serializer *ser, ResType type, ResId idx); + void loadResource(Serializer *ser, ResType type, ResId idx); + void loadResourceOLD(Serializer *ser, ResType type, ResId idx); // "Obsolete" Common::String makeSavegameName(int slot, bool temporary) const { return makeSavegameName(_targetName, slot, temporary); @@ -689,9 +613,11 @@ protected: protected: /* Script VM - should be in Script class */ uint32 _localScriptOffsets[1024]; - const byte *_scriptPointer, *_scriptOrgPointer; - byte _opcode, _currentScript; + const byte *_scriptPointer; + const byte *_scriptOrgPointer; const byte * const *_lastCodePtr; + byte _opcode; + byte _currentScript; int _scummStackPos; int _vmStack[150]; @@ -787,26 +713,26 @@ protected: void askForDisk(const char *filename, int disknum); // TODO: Use Common::String bool openResourceFile(const Common::String &filename, byte encByte); // TODO: Use Common::String - void loadPtrToResource(int type, int i, const byte *ptr); - virtual int readResTypeList(int id); -// void allocResTypeData(int id, uint32 tag, int num, const char *name, int mode); + void loadPtrToResource(ResType type, ResId idx, const byte *ptr); + virtual int readResTypeList(ResType type); +// void allocResTypeData(ResType type, uint32 tag, int num, int mode); // byte *createResource(int type, int index, uint32 size); - int loadResource(int type, int i); -// void nukeResource(int type, int i); - int getResourceRoomNr(int type, int idx); - virtual uint32 getResourceRoomOffset(int type, int idx); - int getResourceSize(int type, int idx); + int loadResource(ResType type, ResId idx); +// void nukeResource(ResType type, ResId idx); + int getResourceRoomNr(ResType type, ResId idx); + virtual uint32 getResourceRoomOffset(ResType type, ResId idx); + int getResourceSize(ResType type, ResId idx); public: - byte *getResourceAddress(int type, int i); - virtual byte *getStringAddress(int i); + byte *getResourceAddress(ResType type, ResId idx); + virtual byte *getStringAddress(ResId idx); byte *getStringAddressVar(int i); - void ensureResourceLoaded(int type, int i); + void ensureResourceLoaded(ResType type, ResId idx); protected: - int readSoundResource(int index); - int readSoundResourceSmallHeader(int index); - bool isResourceInUse(int type, int i) const; + int readSoundResource(ResId idx); + int readSoundResourceSmallHeader(ResId idx); + bool isResourceInUse(ResType type, ResId idx) const; virtual void setupRoomSubBlocks(); virtual void resetRoomSubBlocks(); @@ -1194,7 +1120,7 @@ protected: void calcItineraryMatrix(byte *itineraryMatrix, int num); void createBoxMatrix(); - virtual bool areBoxesNeighbours(int i, int j); + virtual bool areBoxesNeighbors(int i, int j); /* String class */ public: diff --git a/engines/scumm/scumm_v0.h b/engines/scumm/scumm_v0.h index 9ffb19a959d..af481df0e0a 100644 --- a/engines/scumm/scumm_v0.h +++ b/engines/scumm/scumm_v0.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SCRIPT_V0_H @@ -97,7 +94,7 @@ protected: virtual void resetSentence(bool walking); - virtual bool areBoxesNeighbours(int box1nr, int box2nr); + virtual bool areBoxesNeighbors(int box1nr, int box2nr); /* Version C64 script opcodes */ void o_stopCurrentScript(); diff --git a/engines/scumm/scumm_v2.h b/engines/scumm/scumm_v2.h index 687ccd6ab39..47c5fa2626f 100644 --- a/engines/scumm/scumm_v2.h +++ b/engines/scumm/scumm_v2.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SCRIPT_V2_H diff --git a/engines/scumm/scumm_v3.h b/engines/scumm/scumm_v3.h index 6e8d593a35a..f11ca16a50f 100644 --- a/engines/scumm/scumm_v3.h +++ b/engines/scumm/scumm_v3.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SCRIPT_V3_H @@ -62,7 +59,7 @@ public: ScummEngine_v3old(OSystem *syst, const DetectorResult &dr); protected: - virtual int readResTypeList(int id); + virtual int readResTypeList(ResType type); virtual void readIndexFile(); virtual void setupRoomSubBlocks(); virtual void resetRoomSubBlocks(); diff --git a/engines/scumm/scumm_v4.h b/engines/scumm/scumm_v4.h index 653cfc228e5..e21e4b26ae1 100644 --- a/engines/scumm/scumm_v4.h +++ b/engines/scumm/scumm_v4.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SCRIPT_V4_H @@ -59,7 +56,7 @@ protected: virtual void scummLoop_handleSaveLoad(); - virtual int readResTypeList(int id); + virtual int readResTypeList(ResType type); virtual void readIndexFile(); virtual void loadCharset(int no); virtual void resetRoomObjects(); diff --git a/engines/scumm/scumm_v5.h b/engines/scumm/scumm_v5.h index 71222470f4f..b8a61c16772 100644 --- a/engines/scumm/scumm_v5.h +++ b/engines/scumm/scumm_v5.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SCRIPT_V5_H diff --git a/engines/scumm/scumm_v6.h b/engines/scumm/scumm_v6.h index eb55b835967..c42a49a9f5c 100644 --- a/engines/scumm/scumm_v6.h +++ b/engines/scumm/scumm_v6.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SCRIPT_V6_H @@ -110,7 +107,7 @@ protected: virtual void decodeParseString(int a, int b); virtual void readArrayFromIndexFile(); - virtual byte *getStringAddress(int i); + virtual byte *getStringAddress(ResId idx); virtual void readMAXS(int blockSize); virtual void palManipulateInit(int resID, int start, int end, int time); diff --git a/engines/scumm/scumm_v7.h b/engines/scumm/scumm_v7.h index c4bb3525be9..81bb25e0b58 100644 --- a/engines/scumm/scumm_v7.h +++ b/engines/scumm/scumm_v7.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SCRIPT_V7_H diff --git a/engines/scumm/scumm_v8.h b/engines/scumm/scumm_v8.h index 94619eb7ac5..43bfad1fc97 100644 --- a/engines/scumm/scumm_v8.h +++ b/engines/scumm/scumm_v8.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SCRIPT_V8_H diff --git a/engines/scumm/smush/channel.cpp b/engines/scumm/smush/channel.cpp index 95b76532629..7f71d0549b1 100644 --- a/engines/scumm/smush/channel.cpp +++ b/engines/scumm/smush/channel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/smush/channel.h b/engines/scumm/smush/channel.h index 717a294d964..839aeaa9701 100644 --- a/engines/scumm/smush/channel.h +++ b/engines/scumm/smush/channel.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SMUSH_CHANNEL_H diff --git a/engines/scumm/smush/codec1.cpp b/engines/scumm/smush/codec1.cpp index d0d92fcd797..79d97d2ce33 100644 --- a/engines/scumm/smush/codec1.cpp +++ b/engines/scumm/smush/codec1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/smush/codec37.cpp b/engines/scumm/smush/codec37.cpp index 9dbbc6816fe..dcc8ee3c19b 100644 --- a/engines/scumm/smush/codec37.cpp +++ b/engines/scumm/smush/codec37.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/smush/codec37.h b/engines/scumm/smush/codec37.h index 96033ade31e..bcb858b0b55 100644 --- a/engines/scumm/smush/codec37.h +++ b/engines/scumm/smush/codec37.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SMUSH_CODEC37_H diff --git a/engines/scumm/smush/codec47.cpp b/engines/scumm/smush/codec47.cpp index 47286ba4fc2..4b503a0a38f 100644 --- a/engines/scumm/smush/codec47.cpp +++ b/engines/scumm/smush/codec47.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/smush/codec47.h b/engines/scumm/smush/codec47.h index cfa467de4ee..0e5156db5c6 100644 --- a/engines/scumm/smush/codec47.h +++ b/engines/scumm/smush/codec47.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SMUSH_CODEC_47_H diff --git a/engines/scumm/smush/codec47ARM.s b/engines/scumm/smush/codec47ARM.s index 73341c117fc..a91f9325580 100644 --- a/engines/scumm/smush/codec47ARM.s +++ b/engines/scumm/smush/codec47ARM.s @@ -18,9 +18,6 @@ @ along with this program@ if not, write to the Free Software @ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @ -@ $URL$ -@ $Id$ -@ @ @author Robin Watts (robin@wss.co.uk) @ @ This file, provides an ARM optimised version of sections of codec47.cpp. diff --git a/engines/scumm/smush/imuse_channel.cpp b/engines/scumm/smush/imuse_channel.cpp index 32fa99a870b..f2c4f993e4a 100644 --- a/engines/scumm/smush/imuse_channel.cpp +++ b/engines/scumm/smush/imuse_channel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/smush/saud_channel.cpp b/engines/scumm/smush/saud_channel.cpp index f730acf804e..2f1ca512f00 100644 --- a/engines/scumm/smush/saud_channel.cpp +++ b/engines/scumm/smush/saud_channel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/smush/smush_font.cpp b/engines/scumm/smush/smush_font.cpp index 75abe9a7722..7765bf12928 100644 --- a/engines/scumm/smush/smush_font.cpp +++ b/engines/scumm/smush/smush_font.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/smush/smush_font.h b/engines/scumm/smush/smush_font.h index 312d6dbc782..5de4a725c63 100644 --- a/engines/scumm/smush/smush_font.h +++ b/engines/scumm/smush/smush_font.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SMUSH_FONT_H diff --git a/engines/scumm/smush/smush_mixer.cpp b/engines/scumm/smush/smush_mixer.cpp index 4ab0d7c7338..d2b4b5a482f 100644 --- a/engines/scumm/smush/smush_mixer.cpp +++ b/engines/scumm/smush/smush_mixer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/smush/smush_mixer.h b/engines/scumm/smush/smush_mixer.h index 3d62fdc722e..75a88892429 100644 --- a/engines/scumm/smush/smush_mixer.h +++ b/engines/scumm/smush/smush_mixer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SMUSH_MIXER_H diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp index 2e395583724..66502572de5 100644 --- a/engines/scumm/smush/smush_player.cpp +++ b/engines/scumm/smush/smush_player.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "engines/engine.h" diff --git a/engines/scumm/smush/smush_player.h b/engines/scumm/smush/smush_player.h index af7942c193b..5a2024060e3 100644 --- a/engines/scumm/smush/smush_player.h +++ b/engines/scumm/smush/smush_player.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(SCUMM_SMUSH_PLAYER_H) && defined(ENABLE_SCUMM_7_8) diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index a38119584f9..c22da8e7c7a 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -32,6 +29,7 @@ #include "scumm/imuse/imuse.h" #include "scumm/imuse_digi/dimuse.h" #include "scumm/player_towns.h" +#include "scumm/resource.h" #include "scumm/scumm.h" #include "scumm/sound.h" #include "scumm/util.h" @@ -1066,7 +1064,7 @@ void Sound::saveLoadWithSerializer(Serializer *ser) { #pragma mark --- Sound resource handling --- #pragma mark - -static void convertMac0Resource(ResourceManager *res, int idx, byte *src_ptr, int size); +static void convertMac0Resource(ResourceManager *res, ResId idx, byte *src_ptr, int size); /* @@ -1076,7 +1074,7 @@ static void convertMac0Resource(ResourceManager *res, int idx, byte *src_ptr, in * could stand a thorough cleanup! */ -int ScummEngine::readSoundResource(int idx) { +int ScummEngine::readSoundResource(ResId idx) { uint32 pos, total_size, size, tag, basetag, max_total_size; int pri, best_pri; uint32 best_size = 0, best_offs = 0; @@ -1120,7 +1118,7 @@ int ScummEngine::readSoundResource(int idx) { break; case MKTAG('A','D','L',' '): pri = 1; - if (_musicType == MDT_ADLIB) + if (_musicType == MDT_ADLIB || _musicType == MDT_TOWNS) pri = 10; break; case MKTAG('A','M','I',' '): @@ -1226,7 +1224,7 @@ int ScummEngine::readSoundResource(int idx) { if (!dmuFile.open(buffer)) { error("Can't open music file %s", buffer); - _res->roomoffs[rtSound][idx] = RES_INVALID_OFFSET; + _res->_types[rtSound][idx]._roomoffs = RES_INVALID_OFFSET; return 0; } dmuFile.seek(4, SEEK_SET); @@ -1250,7 +1248,7 @@ int ScummEngine::readSoundResource(int idx) { } error("Unrecognized base tag 0x%08x in sound %d", basetag, idx); } - _res->roomoffs[rtSound][idx] = RES_INVALID_OFFSET; + _res->_types[rtSound][idx]._roomoffs = RES_INVALID_OFFSET; return 0; } @@ -1429,7 +1427,7 @@ static byte Mac0ToGMInstrument(uint32 type, int &transpose) { } } -static void convertMac0Resource(ResourceManager *res, int idx, byte *src_ptr, int size) { +static void convertMac0Resource(ResourceManager *res, ResId idx, byte *src_ptr, int size) { /* From Markus Magnuson (superqult) we got this information: Mac0 @@ -1620,7 +1618,7 @@ static void convertMac0Resource(ResourceManager *res, int idx, byte *src_ptr, in #endif } -static void convertADResource(ResourceManager *res, const GameSettings& game, int idx, byte *src_ptr, int size) { +static void convertADResource(ResourceManager *res, const GameSettings& game, ResId idx, byte *src_ptr, int size) { // We will ignore the PPQN in the original resource, because // it's invalid anyway. We use a constant PPQN of 480. const int ppqn = 480; @@ -2003,7 +2001,7 @@ static void convertADResource(ResourceManager *res, const GameSettings& game, in } -int ScummEngine::readSoundResourceSmallHeader(int idx) { +int ScummEngine::readSoundResourceSmallHeader(ResId idx) { uint32 pos, total_size, size, tag; uint32 ad_size = 0, ad_offs = 0; uint32 ro_size = 0, ro_offs = 0; @@ -2125,7 +2123,7 @@ int ScummEngine::readSoundResourceSmallHeader(int idx) { _fileHandle->read(_res->createResource(rtSound, idx, ro_size - 4), ro_size - 4); return 1; } - _res->roomoffs[rtSound][idx] = RES_INVALID_OFFSET; + _res->_types[rtSound][idx]._roomoffs = RES_INVALID_OFFSET; return 0; } diff --git a/engines/scumm/sound.h b/engines/scumm/sound.h index 39b4af805df..03659ceff1f 100644 --- a/engines/scumm/sound.h +++ b/engines/scumm/sound.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_SOUND_H diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp index 2dfa9da723b..4b3207c6bf0 100644 --- a/engines/scumm/string.cpp +++ b/engines/scumm/string.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -35,6 +32,7 @@ #ifdef ENABLE_HE #include "scumm/he/intern_he.h" #endif +#include "scumm/resource.h" #include "scumm/scumm.h" #include "scumm/scumm_v6.h" #include "scumm/scumm_v8.h" @@ -354,7 +352,7 @@ bool ScummEngine::handleNextCharsetCode(Actor *a, int *code) { bool ScummEngine_v72he::handleNextCharsetCode(Actor *a, int *code) { const int charsetCode = (_game.heversion >= 80) ? 127 : 64; uint32 talk_sound_a = 0; - uint32 talk_sound_b = 0; + //uint32 talk_sound_b = 0; int i, c = 0; char value[32]; bool endLoop = false; @@ -385,7 +383,7 @@ bool ScummEngine_v72he::handleNextCharsetCode(Actor *a, int *code) { i++; } value[i] = 0; - talk_sound_b = atoi(value); + //talk_sound_b = atoi(value); ((SoundHE *)_sound)->startHETalkSound(talk_sound_a); break; case 104: @@ -408,7 +406,7 @@ bool ScummEngine_v72he::handleNextCharsetCode(Actor *a, int *code) { } value[i] = 0; talk_sound_a = atoi(value); - talk_sound_b = 0; + //talk_sound_b = 0; ((SoundHE *)_sound)->startHETalkSound(talk_sound_a); break; case 119: @@ -1212,7 +1210,8 @@ int ScummEngine::convertVerbMessage(byte *dst, int dstSize, int var) { num = readVar(var); if (num) { for (k = 1; k < _numVerbs; k++) { - if (num == _verbs[k].verbid && !_verbs[k].type && !_verbs[k].saveid) { + // Fix ZAK FM-TOWNS bug #1013617 by emulating exact (inconsistant?) behavior of the original code + if (num == _verbs[k].verbid && !_verbs[k].type && (!_verbs[k].saveid || (_game.version == 3 && _game.platform == Common::kPlatformFMTowns))) { const byte *ptr = getResourceAddress(rtVerb, k); return convertMessageToString(ptr, dst, dstSize); } diff --git a/engines/scumm/usage_bits.cpp b/engines/scumm/usage_bits.cpp index da262defc97..10645fea105 100644 --- a/engines/scumm/usage_bits.cpp +++ b/engines/scumm/usage_bits.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/usage_bits.h b/engines/scumm/usage_bits.h index b3d582f7b9b..3da1e791eac 100644 --- a/engines/scumm/usage_bits.h +++ b/engines/scumm/usage_bits.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_USAGE_BITS_H diff --git a/engines/scumm/util.cpp b/engines/scumm/util.cpp index 5c3e4c9d0c9..47a6bad6ec3 100644 --- a/engines/scumm/util.cpp +++ b/engines/scumm/util.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/util.h" diff --git a/engines/scumm/util.h b/engines/scumm/util.h index 0d33987c314..f8f999624c9 100644 --- a/engines/scumm/util.h +++ b/engines/scumm/util.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_UTIL_H diff --git a/engines/scumm/vars.cpp b/engines/scumm/vars.cpp index 48fe0a20ed0..56f8de2ad15 100644 --- a/engines/scumm/vars.cpp +++ b/engines/scumm/vars.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp index 6d5eb3fad72..69caceb53a4 100644 --- a/engines/scumm/verbs.cpp +++ b/engines/scumm/verbs.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/actor.h" diff --git a/engines/scumm/verbs.h b/engines/scumm/verbs.h index 83e924edac7..fb4dc969e2f 100644 --- a/engines/scumm/verbs.h +++ b/engines/scumm/verbs.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_VERBS_H diff --git a/engines/sky/autoroute.cpp b/engines/sky/autoroute.cpp index d6974837c66..5273b218072 100644 --- a/engines/sky/autoroute.cpp +++ b/engines/sky/autoroute.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/autoroute.h b/engines/sky/autoroute.h index c40cf647d5b..2d01be01ecc 100644 --- a/engines/sky/autoroute.h +++ b/engines/sky/autoroute.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_AUTOROUTE_H diff --git a/engines/sky/compact.cpp b/engines/sky/compact.cpp index 672fb38ca98..66ce92f8fcb 100644 --- a/engines/sky/compact.cpp +++ b/engines/sky/compact.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/compact.h b/engines/sky/compact.h index 4861273146d..a7b85205393 100644 --- a/engines/sky/compact.h +++ b/engines/sky/compact.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_COMPACT_H diff --git a/engines/sky/control.cpp b/engines/sky/control.cpp index f31f0f6ba90..9efa6ce7692 100644 --- a/engines/sky/control.cpp +++ b/engines/sky/control.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/control.h b/engines/sky/control.h index e4428c1876f..6aa7a41c627 100644 --- a/engines/sky/control.h +++ b/engines/sky/control.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_CONTROL_H diff --git a/engines/sky/debug.cpp b/engines/sky/debug.cpp index df55966a9a8..ebc1ee377db 100644 --- a/engines/sky/debug.cpp +++ b/engines/sky/debug.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/debug.h b/engines/sky/debug.h index ff94cbc8add..71b20833857 100644 --- a/engines/sky/debug.h +++ b/engines/sky/debug.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_DEBUG_H diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp index 6871fc96042..6844d2eacb0 100644 --- a/engines/sky/detection.cpp +++ b/engines/sky/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sky/control.h" @@ -82,7 +79,7 @@ public: }; const char *SkyMetaEngine::getName() const { - return "Beneath a Steel Sky"; + return "Sky"; } const char *SkyMetaEngine::getOriginalCopyright() const { diff --git a/engines/sky/disk.cpp b/engines/sky/disk.cpp index 3795c4166d4..a06c5c9be81 100644 --- a/engines/sky/disk.cpp +++ b/engines/sky/disk.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/disk.h b/engines/sky/disk.h index 0cdcbb4d0f0..320c38eebd2 100644 --- a/engines/sky/disk.h +++ b/engines/sky/disk.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_DISK_H diff --git a/engines/sky/grid.cpp b/engines/sky/grid.cpp index e2a96ebf1e3..6a9dc502a73 100644 --- a/engines/sky/grid.cpp +++ b/engines/sky/grid.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sky/compact.h" diff --git a/engines/sky/grid.h b/engines/sky/grid.h index 823462f8dd4..6e0e9aabaa6 100644 --- a/engines/sky/grid.h +++ b/engines/sky/grid.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_GRID_H diff --git a/engines/sky/hufftext.cpp b/engines/sky/hufftext.cpp index 677ea4817eb..0592f094d93 100644 --- a/engines/sky/hufftext.cpp +++ b/engines/sky/hufftext.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sky/text.h" diff --git a/engines/sky/intro.cpp b/engines/sky/intro.cpp index 506a6699c1d..f1ea4d2df23 100644 --- a/engines/sky/intro.cpp +++ b/engines/sky/intro.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/intro.h b/engines/sky/intro.h index d7a55b95bba..98af6e36648 100644 --- a/engines/sky/intro.h +++ b/engines/sky/intro.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_INTRO_H diff --git a/engines/sky/logic.cpp b/engines/sky/logic.cpp index f9ebd0fb64e..616670b0fda 100644 --- a/engines/sky/logic.cpp +++ b/engines/sky/logic.cpp @@ -18,14 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" #include "common/rect.h" -#include "common/EventRecorder.h" #include "common/textconsole.h" #include "sky/autoroute.h" @@ -71,8 +67,8 @@ void Logic::setupLogicTable() { _logicTable = logicTable; } -Logic::Logic(SkyCompact *skyCompact, Screen *skyScreen, Disk *skyDisk, Text *skyText, MusicBase *skyMusic, Mouse *skyMouse, Sound *skySound) { - g_eventRec.registerRandomSource(_rnd, "sky"); +Logic::Logic(SkyCompact *skyCompact, Screen *skyScreen, Disk *skyDisk, Text *skyText, MusicBase *skyMusic, Mouse *skyMouse, Sound *skySound) + : _rnd("sky") { _skyCompact = skyCompact; _skyScreen = skyScreen; @@ -1894,7 +1890,7 @@ bool Logic::fnCheckRequest(uint32 a, uint32 b, uint32 c) { } bool Logic::fnStartMenu(uint32 firstObject, uint32 b, uint32 c) { - /// initialise the top menu bar + /// initialize the top menu bar // firstObject is o0 for game menu, k0 for linc uint i; @@ -1943,7 +1939,7 @@ bool Logic::fnStartMenu(uint32 firstObject, uint32 b, uint32 c) { else if (menuLength < _scriptVariables[SCROLL_OFFSET] + 11) _scriptVariables[SCROLL_OFFSET] = menuLength - 11; - // (6) AND FINALLY, INITIALISE THE 11 OBJECTS SO THEY APPEAR ON SCREEEN + // (6) AND FINALLY, INITIALIZE THE 11 OBJECTS SO THEY APPEAR ON SCREEEN uint16 rollingX = TOP_LEFT_X + 28; for (i = 0; i < 11; i++) { diff --git a/engines/sky/logic.h b/engines/sky/logic.h index da1d9ed997f..9f8df258705 100644 --- a/engines/sky/logic.h +++ b/engines/sky/logic.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_LOGIC_H diff --git a/engines/sky/mouse.cpp b/engines/sky/mouse.cpp index 611010fa465..98f942889ec 100644 --- a/engines/sky/mouse.cpp +++ b/engines/sky/mouse.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/mouse.h b/engines/sky/mouse.h index 6237b9fd29e..1ba0167fb55 100644 --- a/engines/sky/mouse.h +++ b/engines/sky/mouse.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_MOUSE_H diff --git a/engines/sky/music/adlibchannel.cpp b/engines/sky/music/adlibchannel.cpp index 9b3c4338abb..896b58aa22a 100644 --- a/engines/sky/music/adlibchannel.cpp +++ b/engines/sky/music/adlibchannel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/music/adlibchannel.h b/engines/sky/music/adlibchannel.h index cbcf722e4e0..44ac0d79d06 100644 --- a/engines/sky/music/adlibchannel.h +++ b/engines/sky/music/adlibchannel.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_MUSIC_ADLIBCHANNEL_H diff --git a/engines/sky/music/adlibmusic.cpp b/engines/sky/music/adlibmusic.cpp index da46964ef93..1b5518fcb1d 100644 --- a/engines/sky/music/adlibmusic.cpp +++ b/engines/sky/music/adlibmusic.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/music/adlibmusic.h b/engines/sky/music/adlibmusic.h index 848c8eaf292..2782a07be68 100644 --- a/engines/sky/music/adlibmusic.h +++ b/engines/sky/music/adlibmusic.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_MUSIC_ADLIBMUSIC_H diff --git a/engines/sky/music/gmchannel.cpp b/engines/sky/music/gmchannel.cpp index be0afa88947..215d6490b9a 100644 --- a/engines/sky/music/gmchannel.cpp +++ b/engines/sky/music/gmchannel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gmchannel.h" diff --git a/engines/sky/music/gmchannel.h b/engines/sky/music/gmchannel.h index e831b034244..f16de401db9 100644 --- a/engines/sky/music/gmchannel.h +++ b/engines/sky/music/gmchannel.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_MUSIC_GMCHANNEL_H diff --git a/engines/sky/music/gmmusic.cpp b/engines/sky/music/gmmusic.cpp index 6a8529f287c..d0ba1505cb5 100644 --- a/engines/sky/music/gmmusic.cpp +++ b/engines/sky/music/gmmusic.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sky/music/gmmusic.h" diff --git a/engines/sky/music/gmmusic.h b/engines/sky/music/gmmusic.h index baabf2c9ea7..0f54a930e4e 100644 --- a/engines/sky/music/gmmusic.h +++ b/engines/sky/music/gmmusic.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_MUSIC_GMMUSIC_H diff --git a/engines/sky/music/mt32music.cpp b/engines/sky/music/mt32music.cpp index 4f47e511c75..d068a221b2f 100644 --- a/engines/sky/music/mt32music.cpp +++ b/engines/sky/music/mt32music.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sky/music/mt32music.h" diff --git a/engines/sky/music/mt32music.h b/engines/sky/music/mt32music.h index 0b5573ffff1..74962daac3f 100644 --- a/engines/sky/music/mt32music.h +++ b/engines/sky/music/mt32music.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_MUSIC_MT32MUSIC_H diff --git a/engines/sky/music/musicbase.cpp b/engines/sky/music/musicbase.cpp index 748637f9d01..60d0f352e7b 100644 --- a/engines/sky/music/musicbase.cpp +++ b/engines/sky/music/musicbase.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sky/music/musicbase.h" diff --git a/engines/sky/music/musicbase.h b/engines/sky/music/musicbase.h index 1ad78b2cf72..c175876380d 100644 --- a/engines/sky/music/musicbase.h +++ b/engines/sky/music/musicbase.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_MUSIC_MUSICBASE_H diff --git a/engines/sky/rnc_deco.cpp b/engines/sky/rnc_deco.cpp index eb8307764d6..27fae035145 100644 --- a/engines/sky/rnc_deco.cpp +++ b/engines/sky/rnc_deco.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/rnc_deco.h b/engines/sky/rnc_deco.h index 38429383a31..96a75a9750a 100644 --- a/engines/sky/rnc_deco.h +++ b/engines/sky/rnc_deco.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_RNC_DECO_H diff --git a/engines/sky/screen.cpp b/engines/sky/screen.cpp index a209571b379..2797ed2fea0 100644 --- a/engines/sky/screen.cpp +++ b/engines/sky/screen.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/screen.h b/engines/sky/screen.h index 5e226c49ed4..bf8b69a95a0 100644 --- a/engines/sky/screen.h +++ b/engines/sky/screen.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_SCREEN_H diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp index f10ec1083ae..72abc26f326 100644 --- a/engines/sky/sky.cpp +++ b/engines/sky/sky.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/engines/sky/sky.h b/engines/sky/sky.h index 58ac3ed26e4..0b5f4c5c1cc 100644 --- a/engines/sky/sky.h +++ b/engines/sky/sky.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_H diff --git a/engines/sky/skydefs.h b/engines/sky/skydefs.h index e3f3f3101f7..070e185d553 100644 --- a/engines/sky/skydefs.h +++ b/engines/sky/skydefs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_DEFS_H diff --git a/engines/sky/sound.cpp b/engines/sky/sound.cpp index 7191f6cd00c..e94a2a61d9c 100644 --- a/engines/sky/sound.cpp +++ b/engines/sky/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -316,7 +313,7 @@ static const Sfx fx_hello_helga = { } }; -static const Sfx fx_statue_on_armour = { +static const Sfx fx_statue_on_armor = { 8, 0, { @@ -988,7 +985,7 @@ static const Sfx *musicList[] = { &fx_null, // 365 &fx_break_crystals, // 366 &fx_disintegrate, // 367 - &fx_statue_on_armour, // 368 + &fx_statue_on_armor, // 368 &fx_null, // 369 &fx_null, // 360 &fx_ping, // 371 diff --git a/engines/sky/sound.h b/engines/sky/sound.h index ce060ce6894..da0d91911b4 100644 --- a/engines/sky/sound.h +++ b/engines/sky/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_SOUND_H diff --git a/engines/sky/struc.h b/engines/sky/struc.h index 987f074ed13..c2ebf1bad09 100644 --- a/engines/sky/struc.h +++ b/engines/sky/struc.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_STRUC_H diff --git a/engines/sky/text.cpp b/engines/sky/text.cpp index 2464d935811..3e119b3b203 100644 --- a/engines/sky/text.cpp +++ b/engines/sky/text.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/text.h b/engines/sky/text.h index 06aabf5094a..cf0d707ce9f 100644 --- a/engines/sky/text.h +++ b/engines/sky/text.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_TEXT_H diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp index 7c17befcff8..b66cc6b5a73 100644 --- a/engines/sword1/animation.cpp +++ b/engines/sword1/animation.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" @@ -129,7 +126,7 @@ bool MoviePlayer::load(uint32 id) { continue; } - _movieTexts.push_back(new MovieText(startFrame, endFrame, ptr)); + _movieTexts.push_back(MovieText(startFrame, endFrame, ptr)); lastEnd = endFrame; } f.close(); @@ -164,8 +161,7 @@ void MoviePlayer::play() { _textMan->releaseText(2, false); - while (!_movieTexts.empty()) - delete _movieTexts.remove_at(_movieTexts.size() - 1); + _movieTexts.clear(); while (_snd->isSoundHandleActive(*_bgSoundHandle)) _system->delayMillis(100); @@ -182,8 +178,8 @@ void MoviePlayer::play() { void MoviePlayer::performPostProcessing(byte *screen) { if (!_movieTexts.empty()) { - if (_decoder->getCurFrame() == _movieTexts[0]->_startFrame) { - _textMan->makeTextSprite(2, (uint8 *)_movieTexts[0]->_text, 600, LETTER_COL); + if (_decoder->getCurFrame() == _movieTexts.front()._startFrame) { + _textMan->makeTextSprite(2, (const uint8 *)_movieTexts.front()._text.c_str(), 600, LETTER_COL); FrameHeader *frame = _textMan->giveSpriteData(2); _textWidth = frame->width; @@ -191,9 +187,9 @@ void MoviePlayer::performPostProcessing(byte *screen) { _textX = 320 - _textWidth / 2; _textY = 420 - _textHeight; } - if (_decoder->getCurFrame() == _movieTexts[0]->_endFrame) { + if (_decoder->getCurFrame() == _movieTexts.front()._endFrame) { _textMan->releaseText(2, false); - delete _movieTexts.remove_at(0); + _movieTexts.pop_front(); } } diff --git a/engines/sword1/animation.h b/engines/sword1/animation.h index 7bfd839826b..fc3061bbf9a 100644 --- a/engines/sword1/animation.h +++ b/engines/sword1/animation.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_ANIMATION_H @@ -30,7 +27,7 @@ #include "video/smk_decoder.h" #include "video/video_decoder.h" -#include "common/array.h" +#include "common/list.h" #include "audio/audiostream.h" @@ -48,14 +45,11 @@ class MovieText { public: uint16 _startFrame; uint16 _endFrame; - char *_text; - MovieText(int startFrame, int endFrame, const char *text) { + Common::String _text; + MovieText(int startFrame, int endFrame, const Common::String &text) { _startFrame = startFrame; _endFrame = endFrame; - _text = strdup(text); - } - ~MovieText() { - free(_text); + _text = text; } }; @@ -83,7 +77,7 @@ protected: Text *_textMan; Audio::Mixer *_snd; OSystem *_system; - Common::Array _movieTexts; + Common::List _movieTexts; int _textX, _textY, _textWidth, _textHeight; byte _white, _black; DecoderType _decoderType; diff --git a/engines/sword1/collision.h b/engines/sword1/collision.h index 4079136da19..9a9eeec4295 100644 --- a/engines/sword1/collision.h +++ b/engines/sword1/collision.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_COLLISION_H diff --git a/engines/sword1/console.cpp b/engines/sword1/console.cpp index 79792c22084..603efd308e7 100644 --- a/engines/sword1/console.cpp +++ b/engines/sword1/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sword1/console.h" diff --git a/engines/sword1/console.h b/engines/sword1/console.h index 7ee8d2935f1..260fe95d523 100644 --- a/engines/sword1/console.h +++ b/engines/sword1/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_CONSOLE_H diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp index d8ddd53e2ef..86947db8aeb 100644 --- a/engines/sword1/control.cpp +++ b/engines/sword1/control.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/sword1/control.h b/engines/sword1/control.h index db910f521ff..6c0cf8b1ef9 100644 --- a/engines/sword1/control.h +++ b/engines/sword1/control.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_CONTROL_H diff --git a/engines/sword1/debug.cpp b/engines/sword1/debug.cpp index 39f280748c9..6f82d0f49a5 100644 --- a/engines/sword1/debug.cpp +++ b/engines/sword1/debug.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/sword1/debug.h b/engines/sword1/debug.h index 444d68b399a..e4f004dc630 100644 --- a/engines/sword1/debug.h +++ b/engines/sword1/debug.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_DEBUG_H diff --git a/engines/sword1/detection.cpp b/engines/sword1/detection.cpp index fa8277033cc..8ffd96d3081 100644 --- a/engines/sword1/detection.cpp +++ b/engines/sword1/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sword1/sword1.h" @@ -82,7 +79,7 @@ static const char *g_filesToCheck[NUM_FILES_TO_CHECK] = { // these files have to class SwordMetaEngine : public MetaEngine { public: virtual const char *getName() const { - return "Broken Sword"; + return "Sword1"; } virtual const char *getOriginalCopyright() const { return "Broken Sword Games (C) Revolution"; diff --git a/engines/sword1/eventman.cpp b/engines/sword1/eventman.cpp index 9200e6a229e..d95adebd863 100644 --- a/engines/sword1/eventman.cpp +++ b/engines/sword1/eventman.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sword1/eventman.h b/engines/sword1/eventman.h index 7a50b9a2973..25cb886a34e 100644 --- a/engines/sword1/eventman.h +++ b/engines/sword1/eventman.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_EVENTMAN_H diff --git a/engines/sword1/logic.cpp b/engines/sword1/logic.cpp index 3da3c457d0c..00f7112c050 100644 --- a/engines/sword1/logic.cpp +++ b/engines/sword1/logic.cpp @@ -18,14 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" #include "common/util.h" -#include "common/EventRecorder.h" #include "common/textconsole.h" #include "sword1/logic.h" @@ -53,8 +49,8 @@ namespace Sword1 { uint32 Logic::_scriptVars[NUM_SCRIPT_VARS]; -Logic::Logic(SwordEngine *vm, ObjectMan *pObjMan, ResMan *resMan, Screen *pScreen, Mouse *pMouse, Sound *pSound, Music *pMusic, Menu *pMenu, OSystem *system, Audio::Mixer *mixer) { - g_eventRec.registerRandomSource(_rnd, "sword1"); +Logic::Logic(SwordEngine *vm, ObjectMan *pObjMan, ResMan *resMan, Screen *pScreen, Mouse *pMouse, Sound *pSound, Music *pMusic, Menu *pMenu, OSystem *system, Audio::Mixer *mixer) + : _rnd("sword1") { _vm = vm; _objMan = pObjMan; diff --git a/engines/sword1/logic.h b/engines/sword1/logic.h index 989b852e776..13ddbc989bd 100644 --- a/engines/sword1/logic.h +++ b/engines/sword1/logic.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_LOGIC_H @@ -33,6 +30,8 @@ #include "common/random.h" #include "audio/mixer.h" +class OSystem; + namespace Sword1 { #define NON_ZERO_SCRIPT_VARS 95 diff --git a/engines/sword1/memman.cpp b/engines/sword1/memman.cpp index f315895eb05..9fd763084a6 100644 --- a/engines/sword1/memman.cpp +++ b/engines/sword1/memman.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sword1/memman.h b/engines/sword1/memman.h index b489eae2f99..3f822189ebf 100644 --- a/engines/sword1/memman.h +++ b/engines/sword1/memman.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_MEMMAN_H diff --git a/engines/sword1/menu.cpp b/engines/sword1/menu.cpp index 582bea82f88..3a99602fec4 100644 --- a/engines/sword1/menu.cpp +++ b/engines/sword1/menu.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sword1/menu.h b/engines/sword1/menu.h index f45f59a1e05..ea062f1a498 100644 --- a/engines/sword1/menu.h +++ b/engines/sword1/menu.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_MENU_H diff --git a/engines/sword1/mouse.cpp b/engines/sword1/mouse.cpp index 87e476e5040..cbf951aebc7 100644 --- a/engines/sword1/mouse.cpp +++ b/engines/sword1/mouse.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/sword1/mouse.h b/engines/sword1/mouse.h index 3a7ea747fb6..44a6f76ad73 100644 --- a/engines/sword1/mouse.h +++ b/engines/sword1/mouse.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_MOUSE_H diff --git a/engines/sword1/music.cpp b/engines/sword1/music.cpp index 49f9f7271bb..a291d80f857 100644 --- a/engines/sword1/music.cpp +++ b/engines/sword1/music.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sword1/music.h b/engines/sword1/music.h index 7a3d1e5de6d..104bc1c5362 100644 --- a/engines/sword1/music.h +++ b/engines/sword1/music.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_MUSIC_H diff --git a/engines/sword1/object.h b/engines/sword1/object.h index 58aefc2775a..5a6fd49c0bd 100644 --- a/engines/sword1/object.h +++ b/engines/sword1/object.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_OBJECT_H diff --git a/engines/sword1/objectman.cpp b/engines/sword1/objectman.cpp index dde14985918..8de29615d56 100644 --- a/engines/sword1/objectman.cpp +++ b/engines/sword1/objectman.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sword1/objectman.h b/engines/sword1/objectman.h index f4b8fe8906b..23047c14ea3 100644 --- a/engines/sword1/objectman.h +++ b/engines/sword1/objectman.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // this is the object manager. our equivalent to protocol.c and coredata.c diff --git a/engines/sword1/resman.cpp b/engines/sword1/resman.cpp index f7b9eb89082..807679a40ea 100644 --- a/engines/sword1/resman.cpp +++ b/engines/sword1/resman.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sword1/resman.h b/engines/sword1/resman.h index ee1d55cd140..82074e5740d 100644 --- a/engines/sword1/resman.h +++ b/engines/sword1/resman.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_RESMAN_H diff --git a/engines/sword1/router.cpp b/engines/sword1/router.cpp index 3694ed24598..aaf475912db 100644 --- a/engines/sword1/router.cpp +++ b/engines/sword1/router.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" @@ -264,7 +261,7 @@ int32 Router::getRoute() { // of a line // scan through the nodes linking each node to its nearest - // neighbour until no more nodes change + // neighbor until no more nodes change // This is the routine that finds a route using scan() diff --git a/engines/sword1/router.h b/engines/sword1/router.h index 97fa42488b2..31c4291eedc 100644 --- a/engines/sword1/router.h +++ b/engines/sword1/router.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_ROUTER_H diff --git a/engines/sword1/screen.cpp b/engines/sword1/screen.cpp index de96f6e7b42..1da89a1091c 100644 --- a/engines/sword1/screen.cpp +++ b/engines/sword1/screen.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sword1/screen.h b/engines/sword1/screen.h index 88326a730e7..ece37b0ecc8 100644 --- a/engines/sword1/screen.h +++ b/engines/sword1/screen.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_SCREEN_H diff --git a/engines/sword1/sound.cpp b/engines/sword1/sound.cpp index c970e727486..f7ab9ca1de1 100644 --- a/engines/sword1/sound.cpp +++ b/engines/sword1/sound.cpp @@ -18,16 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" #include "common/util.h" -#include "common/EventRecorder.h" #include "common/memstream.h" #include "common/textconsole.h" @@ -49,8 +45,8 @@ namespace Sword1 { #define SOUND_SPEECH_ID 1 #define SPEECH_FLAGS (Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN) -Sound::Sound(const char *searchPath, Audio::Mixer *mixer, ResMan *pResMan) { - g_eventRec.registerRandomSource(_rnd, "sword1sound"); +Sound::Sound(const char *searchPath, Audio::Mixer *mixer, ResMan *pResMan) + : _rnd("sword1sound") { strcpy(_filePath, searchPath); _mixer = mixer; _resMan = pResMan; diff --git a/engines/sword1/sound.h b/engines/sword1/sound.h index b6fcd6706fc..a6313f85eb3 100644 --- a/engines/sword1/sound.h +++ b/engines/sword1/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_SOUND_H diff --git a/engines/sword1/staticres.cpp b/engines/sword1/staticres.cpp index 84f1dc9d456..402e349576b 100644 --- a/engines/sword1/staticres.cpp +++ b/engines/sword1/staticres.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp index 3b3eaaf8b94..23dff4dec2d 100644 --- a/engines/sword1/sword1.cpp +++ b/engines/sword1/sword1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sword1/sword1.h" diff --git a/engines/sword1/sword1.h b/engines/sword1/sword1.h index dbb683cd741..c83cb764612 100644 --- a/engines/sword1/sword1.h +++ b/engines/sword1/sword1.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_H diff --git a/engines/sword1/sworddefs.h b/engines/sword1/sworddefs.h index 26c155dc4c3..15736dcae06 100644 --- a/engines/sword1/sworddefs.h +++ b/engines/sword1/sworddefs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_SWORDDEFS_H @@ -502,7 +499,7 @@ enum ScriptVariableNames { CASE_2_LOCKED_FLAG, CASE_3_LOCKED_FLAG, CASE_4_LOCKED_FLAG, - SEEN_ARMOUR_28_FLAG, + SEEN_ARMOR_28_FLAG, CLOSED_WINDOW_28_FLAG, WINDOW_28_FLAG, WINDOW_DRAUGHT_FLAG, @@ -1408,7 +1405,7 @@ enum ScriptVariableNames { SEEN_STATUE_FLAG, SYRIA_DEAD_FLAG, SYRIA_NICHE_FLAG, - ARMOUR_HIDE_FLAG, + ARMOR_HIDE_FLAG, CANDLE59_FLAG, CANDLE_BURNT, CHALICE_FLAG, diff --git a/engines/sword1/swordres.h b/engines/sword1/swordres.h index 7f6a6352ada..384c240283b 100644 --- a/engines/sword1/swordres.h +++ b/engines/sword1/swordres.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_SWORDRES_H diff --git a/engines/sword1/text.cpp b/engines/sword1/text.cpp index 7c655330673..2d4b07020fd 100644 --- a/engines/sword1/text.cpp +++ b/engines/sword1/text.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -76,7 +73,7 @@ uint32 Text::lowTextManager(uint8 *ascii, int32 width, uint8 pen) { return textObjId; } -void Text::makeTextSprite(uint8 slot, uint8 *text, uint16 maxWidth, uint8 pen) { +void Text::makeTextSprite(uint8 slot, const uint8 *text, uint16 maxWidth, uint8 pen) { LineInfo lines[MAX_LINES]; uint16 numLines = analyzeSentence(text, maxWidth, lines); @@ -118,7 +115,7 @@ uint16 Text::charWidth(uint8 ch) { return _resMan->getUint16(_resMan->fetchFrame(_font, ch - SPACE)->width); } -uint16 Text::analyzeSentence(uint8 *text, uint16 maxWidth, LineInfo *line) { +uint16 Text::analyzeSentence(const uint8 *text, uint16 maxWidth, LineInfo *line) { uint16 lineNo = 0; bool firstWord = true; diff --git a/engines/sword1/text.h b/engines/sword1/text.h index 9bfc88fce02..2224fbcac5e 100644 --- a/engines/sword1/text.h +++ b/engines/sword1/text.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_TEXT_H @@ -52,11 +49,11 @@ public: ~Text(); FrameHeader *giveSpriteData(uint32 textTarget); uint32 lowTextManager(uint8 *text, int32 width, uint8 pen); - void makeTextSprite(uint8 slot, uint8 *text, uint16 maxWidth, uint8 pen); + void makeTextSprite(uint8 slot, const uint8 *text, uint16 maxWidth, uint8 pen); void releaseText(uint32 id, bool updateCount = true); private: - uint16 analyzeSentence(uint8 *text, uint16 maxWidth, LineInfo *info); + uint16 analyzeSentence(const uint8 *text, uint16 maxWidth, LineInfo *info); uint16 charWidth(uint8 ch); uint16 copyChar(uint8 ch, uint8 *sprPtr, uint16 sprWidth, uint8 pen); uint8 *_font; diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp index a5a2499b01a..5c5ff6c7ee2 100644 --- a/engines/sword2/animation.cpp +++ b/engines/sword2/animation.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/file.h" diff --git a/engines/sword2/animation.h b/engines/sword2/animation.h index afe7dfcc68c..1f5fced03b6 100644 --- a/engines/sword2/animation.h +++ b/engines/sword2/animation.h @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_ANIMATION_H diff --git a/engines/sword2/anims.cpp b/engines/sword2/anims.cpp index 7fd36fcc866..91a68e0044e 100644 --- a/engines/sword2/anims.cpp +++ b/engines/sword2/anims.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ // --------------------------------------------------------------------------- diff --git a/engines/sword2/console.cpp b/engines/sword2/console.cpp index bca3cd6184d..957b2431e05 100644 --- a/engines/sword2/console.cpp +++ b/engines/sword2/console.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ @@ -782,19 +779,19 @@ bool Debugger::Cmd_Sfx(int argc, const char **argv) { } bool Debugger::Cmd_English(int argc, const char **argv) { - _vm->initialiseFontResourceFlags(DEFAULT_TEXT); + _vm->initializeFontResourceFlags(DEFAULT_TEXT); DebugPrintf("Default fonts selected\n"); return true; } bool Debugger::Cmd_Finnish(int argc, const char **argv) { - _vm->initialiseFontResourceFlags(FINNISH_TEXT); + _vm->initializeFontResourceFlags(FINNISH_TEXT); DebugPrintf("Finnish fonts selected\n"); return true; } bool Debugger::Cmd_Polish(int argc, const char **argv) { - _vm->initialiseFontResourceFlags(POLISH_TEXT); + _vm->initializeFontResourceFlags(POLISH_TEXT); DebugPrintf("Polish fonts selected\n"); return true; } diff --git a/engines/sword2/console.h b/engines/sword2/console.h index 2de82997809..09e456564d0 100644 --- a/engines/sword2/console.h +++ b/engines/sword2/console.h @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_CONSOLE_H diff --git a/engines/sword2/controls.cpp b/engines/sword2/controls.cpp index 4332f2811c4..6ce447a4cc7 100644 --- a/engines/sword2/controls.cpp +++ b/engines/sword2/controls.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ @@ -621,7 +618,7 @@ public: // The sound mute switches have 0 as their "down" state and 1 as // their "up" state, so this function is needed to get consistent - // behaviour. + // behavior. void reverseStates() { _upState = 1; diff --git a/engines/sword2/controls.h b/engines/sword2/controls.h index 043330c1782..ca41867462f 100644 --- a/engines/sword2/controls.h +++ b/engines/sword2/controls.h @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_CONTROL_H diff --git a/engines/sword2/debug.cpp b/engines/sword2/debug.cpp index cb3c3b6a306..b3d28e90c29 100644 --- a/engines/sword2/debug.cpp +++ b/engines/sword2/debug.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/debug.h b/engines/sword2/debug.h index 768f339dbd8..90d9b6b63ce 100644 --- a/engines/sword2/debug.h +++ b/engines/sword2/debug.h @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_DEBUG_H diff --git a/engines/sword2/defs.h b/engines/sword2/defs.h index c729ff02870..dbd4d23d008 100644 --- a/engines/sword2/defs.h +++ b/engines/sword2/defs.h @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_DEFS_H diff --git a/engines/sword2/events.cpp b/engines/sword2/events.cpp index 24101e271c4..1310c04b823 100644 --- a/engines/sword2/events.cpp +++ b/engines/sword2/events.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/function.cpp b/engines/sword2/function.cpp index e0990ea120d..60ee6176a45 100644 --- a/engines/sword2/function.cpp +++ b/engines/sword2/function.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/header.cpp b/engines/sword2/header.cpp index 6ab88d159da..9c50db90d45 100644 --- a/engines/sword2/header.cpp +++ b/engines/sword2/header.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sword2/header.h" diff --git a/engines/sword2/header.h b/engines/sword2/header.h index ed63c806bc1..ceecdd1a928 100644 --- a/engines/sword2/header.h +++ b/engines/sword2/header.h @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_HEADER_H diff --git a/engines/sword2/icons.cpp b/engines/sword2/icons.cpp index 8336178ae52..a555e63449a 100644 --- a/engines/sword2/icons.cpp +++ b/engines/sword2/icons.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ @@ -150,7 +147,7 @@ void Mouse::buildMenu() { } } - // Initialise the menu from the master list. + // Initialize the menu from the master list. for (i = 0; i < 15; i++) { uint32 res = _masterMenuList[i].icon_resource; diff --git a/engines/sword2/interpreter.cpp b/engines/sword2/interpreter.cpp index a3804366d4b..e7fb979d69f 100644 --- a/engines/sword2/interpreter.cpp +++ b/engines/sword2/interpreter.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ @@ -267,7 +264,7 @@ int Logic::runScript2(byte *scriptData, byte *objectData, byte *offsetPtr) { // int32_TYPE 1 numberOfScripts // int32_TYPE numberOfScripts The offsets for each script - // Initialise some stuff + // Initialize some stuff uint32 ip = 0; // Code pointer int scriptNumber; @@ -377,7 +374,7 @@ int Logic::runScript2(byte *scriptData, byte *objectData, byte *offsetPtr) { // sets variable 913 to 1 (probably to stop him from // turning around every now and then). The script may // then go on to set the variable to different values - // to trigger various behaviours in him, but if you + // to trigger various behaviors in him, but if you // have run out of these cases the script won't ever // set it back to 0 again. // @@ -617,7 +614,7 @@ int Logic::runScript2(byte *scriptData, byte *objectData, byte *offsetPtr) { // The scripts do not always call the mcode command // with as many parameters as it can accept. To keep - // things predictable, initialise the remaining + // things predictable, initialize the remaining // parameters to 0. for (i = STACK_SIZE - 1; i >= value; i--) { diff --git a/engines/sword2/interpreter.h b/engines/sword2/interpreter.h index 1eb66cfa3c5..ec19034962f 100644 --- a/engines/sword2/interpreter.h +++ b/engines/sword2/interpreter.h @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_INTERPRETER_H diff --git a/engines/sword2/layers.cpp b/engines/sword2/layers.cpp index 47cc3ec232a..b13006cd706 100644 --- a/engines/sword2/layers.cpp +++ b/engines/sword2/layers.cpp @@ -20,12 +20,9 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ -// high level layer initialising +// high level layer initializing // the system supports: // 1 optional background parallax layer @@ -100,7 +97,7 @@ void Screen::initBackground(int32 res, int32 new_palette) { debug(2, "layers=%d width=%d depth=%d", screen_head.noLayers, screen_head.width, screen_head.height); - // initialise the driver back buffer + // initialize the driver back buffer setLocationMetrics(screen_head.width, screen_head.height); for (i = 0; i < screen_head.noLayers; i++) { @@ -183,22 +180,22 @@ void Screen::initBackground(int32 res, int32 new_palette) { for (i = 0; i < 2; i++) { if (screenLayerTable.bg_parallax[i]) - initialiseBackgroundLayer(_vm->fetchBackgroundParallaxLayer(file, i)); + initializeBackgroundLayer(_vm->fetchBackgroundParallaxLayer(file, i)); else - initialiseBackgroundLayer(NULL); + initializeBackgroundLayer(NULL); } // Normal backround layer - initialiseBackgroundLayer(_vm->fetchBackgroundLayer(file)); + initializeBackgroundLayer(_vm->fetchBackgroundLayer(file)); // Foreground parallax layers for (i = 0; i < 2; i++) { if (screenLayerTable.fg_parallax[i]) - initialiseBackgroundLayer(_vm->fetchForegroundParallaxLayer(file, i)); + initializeBackgroundLayer(_vm->fetchForegroundParallaxLayer(file, i)); else - initialiseBackgroundLayer(NULL); + initializeBackgroundLayer(NULL); } _vm->_resman->closeResource(_thisScreen.background_layer_id); @@ -246,7 +243,7 @@ void Screen::initPsxBackground(int32 res, int32 new_palette) { debug(2, "layers=%d width=%d depth=%d", screen_head.noLayers, screen_head.width, screen_head.height); - // initialise the driver back buffer + // initialize the driver back buffer setLocationMetrics(screen_head.width, screen_head.height); for (i = 0; i < screen_head.noLayers; i++) { @@ -282,15 +279,15 @@ void Screen::initPsxBackground(int32 res, int32 new_palette) { _thisScreen.feet_y = 340; // Background parallax layers - initialisePsxParallaxLayer(_vm->fetchBackgroundParallaxLayer(file, 0)); - initialisePsxParallaxLayer(NULL); + initializePsxParallaxLayer(_vm->fetchBackgroundParallaxLayer(file, 0)); + initializePsxParallaxLayer(NULL); // Normal backround layer - initialisePsxBackgroundLayer(_vm->fetchBackgroundLayer(file)); + initializePsxBackgroundLayer(_vm->fetchBackgroundLayer(file)); // Foreground parallax layers - initialisePsxParallaxLayer(_vm->fetchForegroundParallaxLayer(file, 1)); - initialisePsxParallaxLayer(NULL); + initializePsxParallaxLayer(_vm->fetchForegroundParallaxLayer(file, 1)); + initializePsxParallaxLayer(NULL); _vm->_resman->closeResource(_thisScreen.background_layer_id); diff --git a/engines/sword2/logic.cpp b/engines/sword2/logic.cpp index c27bd76ff47..f634737d4e4 100644 --- a/engines/sword2/logic.cpp +++ b/engines/sword2/logic.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/logic.h b/engines/sword2/logic.h index e40a12bba30..87c03952210 100644 --- a/engines/sword2/logic.h +++ b/engines/sword2/logic.h @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ // logic management diff --git a/engines/sword2/maketext.cpp b/engines/sword2/maketext.cpp index fda30981c80..e279284d76b 100644 --- a/engines/sword2/maketext.cpp +++ b/engines/sword2/maketext.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ // MAKETEXT - Constructs a single-frame text sprite: returns a handle to a @@ -115,7 +112,7 @@ byte *FontRenderer::makeTextSprite(byte *sentence, uint16 maxWidth, uint8 pen, u // Get details of sentence breakdown into array of LineInfo structures // and get the number of lines involved - uint16 noOfLines = analyseSentence(sentence, maxWidth, fontRes, (LineInfo *)line); + uint16 noOfLines = analyzeSentence(sentence, maxWidth, fontRes, (LineInfo *)line); // Construct the sprite based on the info gathered - returns floating // mem block @@ -126,7 +123,7 @@ byte *FontRenderer::makeTextSprite(byte *sentence, uint16 maxWidth, uint8 pen, u return textSprite; } -uint16 FontRenderer::analyseSentence(byte *sentence, uint16 maxWidth, uint32 fontRes, LineInfo *line) { +uint16 FontRenderer::analyzeSentence(byte *sentence, uint16 maxWidth, uint32 fontRes, LineInfo *line) { // joinWidth = how much extra space is needed to append a word to a // line. NB. SPACE requires TWICE the '_charSpacing' to join a word // to line @@ -202,7 +199,7 @@ uint16 FontRenderer::analyseSentence(byte *sentence, uint16 maxWidth, uint32 fon * @param sentence pointer to a null-terminated string * @param fontRes the font resource id * @param pen the text color, or zero to use the source colors - * @param line array of LineInfo structures, created by analyseSentence() + * @param line array of LineInfo structures, created by analyzeSentence() * @param noOfLines the number of lines, i.e. the number of elements in 'line' * @return a handle to a floating memory block containing the text sprite * @note The sentence must contain no leading, trailing or extra spaces. @@ -639,7 +636,7 @@ void FontRenderer::killTextBloc(uint32 bloc_number) { #define SAVE_LINE_NO 1 -void Sword2Engine::initialiseFontResourceFlags() { +void Sword2Engine::initializeFontResourceFlags() { byte *textFile = _resman->openResource(TEXT_RES); // If language is Polish or Finnish it requires alternate fonts. @@ -652,11 +649,11 @@ void Sword2Engine::initialiseFontResourceFlags() { char *textLine = (char *)fetchTextLine(textFile, SAVE_LINE_NO) + 2; if (strcmp(textLine, "tallenna") == 0) - initialiseFontResourceFlags(FINNISH_TEXT); + initializeFontResourceFlags(FINNISH_TEXT); else if (strcmp(textLine, "zapisz") == 0) - initialiseFontResourceFlags(POLISH_TEXT); + initializeFontResourceFlags(POLISH_TEXT); else - initialiseFontResourceFlags(DEFAULT_TEXT); + initializeFontResourceFlags(DEFAULT_TEXT); // Get the game name for the windows application @@ -680,10 +677,10 @@ void Sword2Engine::initialiseFontResourceFlags() { } /** - * Called from initialiseFontResourceFlags(), and also from console.cpp + * Called from initializeFontResourceFlags(), and also from console.cpp */ -void Sword2Engine::initialiseFontResourceFlags(uint8 language) { +void Sword2Engine::initializeFontResourceFlags(uint8 language) { switch (language) { case FINNISH_TEXT: _speechFontId = FINNISH_SPEECH_FONT_ID; diff --git a/engines/sword2/maketext.h b/engines/sword2/maketext.h index 52740d9de99..726c23a5f90 100644 --- a/engines/sword2/maketext.h +++ b/engines/sword2/maketext.h @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_MAKETEXT_H @@ -94,7 +91,7 @@ private: // each line - negative for overlap uint8 _borderPen; // output pen color of character borders - uint16 analyseSentence(byte *sentence, uint16 maxWidth, uint32 fontRes, LineInfo *line); + uint16 analyzeSentence(byte *sentence, uint16 maxWidth, uint32 fontRes, LineInfo *line); byte *buildTextSprite(byte *sentence, uint32 fontRes, uint8 pen, LineInfo *line, uint16 noOfLines); uint16 charWidth(byte ch, uint32 fontRes); uint16 charHeight(uint32 fontRes); diff --git a/engines/sword2/memory.cpp b/engines/sword2/memory.cpp index 2b3784164e8..5fd2d4e78e8 100644 --- a/engines/sword2/memory.cpp +++ b/engines/sword2/memory.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ // The new memory manager, now only used by the resource manager. The original diff --git a/engines/sword2/memory.h b/engines/sword2/memory.h index e00eacb0326..3f511dd5dbd 100644 --- a/engines/sword2/memory.h +++ b/engines/sword2/memory.h @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_MEMORY_H diff --git a/engines/sword2/menu.cpp b/engines/sword2/menu.cpp index 921a3c77b5e..4d63c4cce88 100644 --- a/engines/sword2/menu.cpp +++ b/engines/sword2/menu.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/mouse.cpp b/engines/sword2/mouse.cpp index 3a26ab17b79..c5fed49347b 100644 --- a/engines/sword2/mouse.cpp +++ b/engines/sword2/mouse.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/mouse.h b/engines/sword2/mouse.h index a45d786088b..dc4bd5fc0a5 100644 --- a/engines/sword2/mouse.h +++ b/engines/sword2/mouse.h @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_MOUSE_H diff --git a/engines/sword2/music.cpp b/engines/sword2/music.cpp index ae6e2f12689..63116e954a6 100644 --- a/engines/sword2/music.cpp +++ b/engines/sword2/music.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ // One feature still missing is the original's DipMusic() function which, as diff --git a/engines/sword2/object.h b/engines/sword2/object.h index 94a968e58d2..32d9701e27e 100644 --- a/engines/sword2/object.h +++ b/engines/sword2/object.h @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_OBJECT_H diff --git a/engines/sword2/palette.cpp b/engines/sword2/palette.cpp index a52160db25a..c3a3d24075a 100644 --- a/engines/sword2/palette.cpp +++ b/engines/sword2/palette.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/protocol.cpp b/engines/sword2/protocol.cpp index 3d16e4ea4c8..caa1a21798f 100644 --- a/engines/sword2/protocol.cpp +++ b/engines/sword2/protocol.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/file.h" diff --git a/engines/sword2/render.cpp b/engines/sword2/render.cpp index a47f8abe0df..1e068d60616 100644 --- a/engines/sword2/render.cpp +++ b/engines/sword2/render.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ @@ -345,10 +342,10 @@ void Screen::renderParallax(byte *ptr, int16 l) { #define LIMIT_FRAME_RATE /** - * Initialises the timers before the render loop is entered. + * Initializes the timers before the render loop is entered. */ -void Screen::initialiseRenderCycle() { +void Screen::initializeRenderCycle() { _initialTime = _vm->_system->getMillis(); _totalTime = _initialTime + (1000 / _vm->getFramesPerSecond()); } @@ -402,7 +399,7 @@ bool Screen::endRenderCycle() { renderCountIndex = 0; if (_renderTooSlow) { - initialiseRenderCycle(); + initializeRenderCycle(); return true; } @@ -464,13 +461,13 @@ void Screen::resetRenderEngine() { * or a NULL pointer in order of background parallax to foreground parallax. */ -int32 Screen::initialiseBackgroundLayer(byte *parallax) { +int32 Screen::initializeBackgroundLayer(byte *parallax) { Parallax p; uint16 i, j, k; byte *data; byte *dst; - debug(2, "initialiseBackgroundLayer"); + debug(2, "initializeBackgroundLayer"); assert(_layer < MAXLAYERS); @@ -591,14 +588,14 @@ int32 Screen::initialiseBackgroundLayer(byte *parallax) { * ratio correction), while PC backgrounds are in tiles of 64x64. */ -int32 Screen::initialisePsxBackgroundLayer(byte *parallax) { +int32 Screen::initializePsxBackgroundLayer(byte *parallax) { uint16 bgXres, bgYres; uint16 trueXres, stripeNumber, totStripes; uint32 baseAddress, stripePos; uint16 i, j; byte *dst; - debug(2, "initialisePsxBackgroundLayer"); + debug(2, "initializePsxBackgroundLayer"); assert(_layer < MAXLAYERS); @@ -701,14 +698,14 @@ int32 Screen::initialisePsxBackgroundLayer(byte *parallax) { * can be understood by renderParallax functions. */ -int32 Screen::initialisePsxParallaxLayer(byte *parallax) { +int32 Screen::initializePsxParallaxLayer(byte *parallax) { uint16 plxXres, plxYres; uint16 xTiles, yTiles; uint16 i, j, k; byte *data; byte *dst; - debug(2, "initialisePsxParallaxLayer"); + debug(2, "initializePsxParallaxLayer"); assert(_layer < MAXLAYERS); diff --git a/engines/sword2/resman.cpp b/engines/sword2/resman.cpp index 36280cfda27..a0561641d74 100644 --- a/engines/sword2/resman.cpp +++ b/engines/sword2/resman.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/resman.h b/engines/sword2/resman.h index 75748e15686..494e64dae62 100644 --- a/engines/sword2/resman.h +++ b/engines/sword2/resman.h @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_RESMAN_H diff --git a/engines/sword2/router.cpp b/engines/sword2/router.cpp index c2b4d2e67ff..d3f274dd2c6 100644 --- a/engines/sword2/router.cpp +++ b/engines/sword2/router.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ @@ -323,7 +320,7 @@ int32 Router::getRoute() { // of a line // scan through the nodes linking each node to its nearest - // neighbour until no more nodes change + // neighbor until no more nodes change // This is the routine that finds a route using scan() diff --git a/engines/sword2/router.h b/engines/sword2/router.h index 1ad3dd74c4e..7196ea8df45 100644 --- a/engines/sword2/router.h +++ b/engines/sword2/router.h @@ -20,16 +20,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_ROUTER_H #define SWORD2_ROUTER_H // This used to be a variable, but it was never set. Actually, it wasn't even -// initialised! +// initialized! // // Define this to force the use of slidy router (so solid path not used when // ending walk in ANY direction) diff --git a/engines/sword2/saveload.cpp b/engines/sword2/saveload.cpp index 94ef8975b44..870170e3780 100644 --- a/engines/sword2/saveload.cpp +++ b/engines/sword2/saveload.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ // --------------------------------------------------------------------------- diff --git a/engines/sword2/saveload.h b/engines/sword2/saveload.h index ceaa9712a49..f74b7ba493d 100644 --- a/engines/sword2/saveload.h +++ b/engines/sword2/saveload.h @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_SAVELOAD_H diff --git a/engines/sword2/screen.cpp b/engines/sword2/screen.cpp index a83e581fd48..0cb951fdfc9 100644 --- a/engines/sword2/screen.cpp +++ b/engines/sword2/screen.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ // --------------------------------------------------------------------------- @@ -64,11 +61,11 @@ Screen::Screen(Sword2Engine *vm, int16 width, int16 height) { _dirtyGrid = (byte *)calloc(_gridWide, _gridDeep); if (!_dirtyGrid) - error("Could not initialise dirty grid"); + error("Could not initialize dirty grid"); _buffer = (byte *)malloc(width * height); if (!_buffer) - error("Could not initialise display"); + error("Could not initialize display"); for (int i = 0; i < ARRAYSIZE(_blockSurfaces); i++) _blockSurfaces[i] = NULL; @@ -1228,11 +1225,11 @@ void Screen::rollCredits() { void Screen::splashScreen() { byte *bgfile = _vm->_resman->openResource(2950); - initialiseBackgroundLayer(NULL); - initialiseBackgroundLayer(NULL); - initialiseBackgroundLayer(_vm->fetchBackgroundLayer(bgfile)); - initialiseBackgroundLayer(NULL); - initialiseBackgroundLayer(NULL); + initializeBackgroundLayer(NULL); + initializeBackgroundLayer(NULL); + initializeBackgroundLayer(_vm->fetchBackgroundLayer(bgfile)); + initializeBackgroundLayer(NULL); + initializeBackgroundLayer(NULL); _vm->fetchPalette(bgfile, _palette); setPalette(0, 256, _palette, RDPAL_FADE); diff --git a/engines/sword2/screen.h b/engines/sword2/screen.h index 9ef4f280499..11e323d0a71 100644 --- a/engines/sword2/screen.h +++ b/engines/sword2/screen.h @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_SCREEN_H @@ -393,12 +390,12 @@ public: void resetRenderLists(); void setLocationMetrics(uint16 w, uint16 h); - int32 initialiseBackgroundLayer(byte *parallax); - int32 initialisePsxParallaxLayer(byte *parallax); // These are used to initialize psx backgrounds and - int32 initialisePsxBackgroundLayer(byte *parallax); // parallaxes, which are different from pc counterparts. + int32 initializeBackgroundLayer(byte *parallax); + int32 initializePsxParallaxLayer(byte *parallax); // These are used to initialize psx backgrounds and + int32 initializePsxBackgroundLayer(byte *parallax); // parallaxes, which are different from pc counterparts. void closeBackgroundLayer(); - void initialiseRenderCycle(); + void initializeRenderCycle(); void initBackground(int32 res, int32 new_palette); void initPsxBackground(int32 res, int32 new_palette); diff --git a/engines/sword2/scroll.cpp b/engines/sword2/scroll.cpp index 11ba546cf38..cc864eb493c 100644 --- a/engines/sword2/scroll.cpp +++ b/engines/sword2/scroll.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/sound.cpp b/engines/sword2/sound.cpp index 3cf8523113c..19e244e61cd 100644 --- a/engines/sword2/sound.cpp +++ b/engines/sword2/sound.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ // --------------------------------------------------------------------------- diff --git a/engines/sword2/sound.h b/engines/sword2/sound.h index c37e006b760..9a59ef27a82 100644 --- a/engines/sword2/sound.h +++ b/engines/sword2/sound.h @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ /***************************************************************************** diff --git a/engines/sword2/speech.cpp b/engines/sword2/speech.cpp index ec8e1983770..cdc86a1e394 100644 --- a/engines/sword2/speech.cpp +++ b/engines/sword2/speech.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/sprite.cpp b/engines/sword2/sprite.cpp index 9a258121783..8d260947f11 100644 --- a/engines/sword2/sprite.cpp +++ b/engines/sword2/sprite.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/endian.h" diff --git a/engines/sword2/startup.cpp b/engines/sword2/startup.cpp index ea1751eb5fb..b39141fe325 100644 --- a/engines/sword2/startup.cpp +++ b/engines/sword2/startup.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index 58f3547ff76..62a391923dd 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "base/plugins.h" @@ -31,7 +28,6 @@ #include "common/file.h" #include "common/fs.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/savefile.h" #include "common/system.h" #include "common/textconsole.h" @@ -80,7 +76,7 @@ static const GameSettings sword2_settings[] = { class Sword2MetaEngine : public MetaEngine { public: virtual const char *getName() const { - return "Broken Sword II"; + return "Sword2"; } virtual const char *getOriginalCopyright() const { return "Broken Sword Games (C) Revolution"; @@ -255,7 +251,7 @@ Common::Error Sword2MetaEngine::createInstance(OSystem *syst, Engine **engine) c namespace Sword2 { -Sword2Engine::Sword2Engine(OSystem *syst) : Engine(syst) { +Sword2Engine::Sword2Engine(OSystem *syst) : Engine(syst), _rnd("sword2") { // Add default file directories const Common::FSNode gameDataDir(ConfMan.get("path")); SearchMan.addSubDirectoryMatching(gameDataDir, "clusters"); @@ -295,8 +291,6 @@ Sword2Engine::Sword2Engine(OSystem *syst) : Engine(syst) { _gameSpeed = 1; _gmmLoadSlot = -1; // Used to manage GMM Loading - - g_eventRec.registerRandomSource(_rnd, "sword2"); } Sword2Engine::~Sword2Engine() { @@ -431,7 +425,7 @@ Common::Error Sword2Engine::run() { setInputEventFilter(RD_LEFTBUTTONUP | RD_RIGHTBUTTONUP | RD_WHEELUP | RD_WHEELDOWN); setupPersistentResources(); - initialiseFontResourceFlags(); + initializeFontResourceFlags(); if (_features & GF_DEMO) _logic->writeVar(DEMO, 1); @@ -469,7 +463,7 @@ Common::Error Sword2Engine::run() { } else startGame(); - _screen->initialiseRenderCycle(); + _screen->initializeRenderCycle(); while (1) { _debugger->onFrame(); diff --git a/engines/sword2/sword2.h b/engines/sword2/sword2.h index e741c51ce1f..e4c9dcca3c8 100644 --- a/engines/sword2/sword2.h +++ b/engines/sword2/sword2.h @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_H @@ -236,8 +233,8 @@ public: void sleepUntil(uint32 time); - void initialiseFontResourceFlags(); - void initialiseFontResourceFlags(uint8 language); + void initializeFontResourceFlags(); + void initializeFontResourceFlags(uint8 language); bool initStartMenu(); void registerStartPoint(int32 key, char *name); diff --git a/engines/sword2/sync.cpp b/engines/sword2/sync.cpp index ee4c6b22386..12e3c356987 100644 --- a/engines/sword2/sync.cpp +++ b/engines/sword2/sync.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/walker.cpp b/engines/sword2/walker.cpp index 79712998185..89ee6e18cc4 100644 --- a/engines/sword2/walker.cpp +++ b/engines/sword2/walker.cpp @@ -20,9 +20,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ // WALKER.CPP by James (14nov96) diff --git a/engines/sword25/console.cpp b/engines/sword25/console.cpp index 902d9a5b720..5d15f189ab2 100644 --- a/engines/sword25/console.cpp +++ b/engines/sword25/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sword25/console.h" diff --git a/engines/sword25/console.h b/engines/sword25/console.h index dcf8082d3c4..9e2516ccf0d 100644 --- a/engines/sword25/console.h +++ b/engines/sword25/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD25_CONSOLE_H diff --git a/engines/sword25/detection.cpp b/engines/sword25/detection.cpp index fe24675f8a2..edb8c305455 100644 --- a/engines/sword25/detection.cpp +++ b/engines/sword25/detection.cpp @@ -18,15 +18,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" #include "engines/advancedDetector.h" #include "sword25/sword25.h" +#include "sword25/detection_tables.h" #include "sword25/kernel/persistenceservice.h" namespace Sword25 { @@ -38,38 +36,6 @@ static const PlainGameDescriptor Sword25Game[] = { {0, 0} }; -namespace Sword25 { - -// TODO: Need to decide whether we're going to implement code to detect all the various languages allowed, -// both by the core data package, as well as the extra languages added by the patch file; also, I don't -// think that all the languages supported by the game currently have constants in ScummVM -static const ADGameDescription gameDescriptions[] = { - { - "sword25", - "", - AD_ENTRY1s("data.b25c", "f8b6e03ada2d2f6cf27fbc11ad1572e9", 654310588), - Common::EN_ANY, - Common::kPlatformUnknown, - ADGF_NO_FLAGS, - Common::GUIO_NONE - }, - { - "sword25", - "Extracted", - {{"_includes.lua", 0, 0, -1}, - {"boot.lua", 0, 0, -1}, - {"kernel.lua", 0, 0, -1}, - AD_LISTEND}, - Common::EN_ANY, - Common::kPlatformUnknown, - GF_EXTRACTED, - Common::GUIO_NONE - }, - AD_TABLE_END_MARKER -}; - -} // End of namespace Sword25 - static const char *directoryGlobs[] = { "system", // Used by extracted dats 0 @@ -105,7 +71,7 @@ public: Sword25MetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "The Broken Sword 2.5 Engine"; + return "Sword25"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/sword25/detection_tables.h b/engines/sword25/detection_tables.h new file mode 100644 index 00000000000..ca586b4f016 --- /dev/null +++ b/engines/sword25/detection_tables.h @@ -0,0 +1,129 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +namespace Sword25 { + +using Common::GUIO_NONE; +using Common::GUIO_NOSPEECH; +using Common::GUIO_NOSFX; +using Common::GUIO_NOMUSIC; + +static const ADGameDescription gameDescriptions[] = { + { + "sword25", + "", + AD_ENTRY1s("data.b25c", "f8b6e03ada2d2f6cf27fbc11ad1572e9", 654310588), + Common::EN_ANY, + Common::kPlatformUnknown, + ADGF_NO_FLAGS, + Common::GUIO_NONE + }, + { + "sword25", + "", + AD_ENTRY1s("lang_fr.b25c", "690caf157387e06d2c3d1ca53c43f428", 1006043), + Common::FR_FRA, + Common::kPlatformUnknown, + ADGF_NO_FLAGS, + Common::GUIO_NONE + }, + { + "sword25", + "", + AD_ENTRY1s("data.b25c", "f8b6e03ada2d2f6cf27fbc11ad1572e9", 654310588), + Common::DE_DEU, + Common::kPlatformUnknown, + ADGF_NO_FLAGS, + Common::GUIO_NONE + }, + { + "sword25", + "", + AD_ENTRY1s("lang_hr.b25c", "e881054d1f8ec1e527422fc521c25405", 1273217), + Common::HU_HUN, + Common::kPlatformUnknown, + ADGF_NO_FLAGS, + Common::GUIO_NONE + }, + { + "sword25", + "", + AD_ENTRY1s("lang_it.b25c", "f3325666da0515cc2b42062e953c0889", 996197), + Common::IT_ITA, + Common::kPlatformUnknown, + ADGF_NO_FLAGS, + Common::GUIO_NONE + }, + { + "sword25", + "", + AD_ENTRY1s("lang_pl.b25c", "49dc1a20f95391a808e475c49be2bac0", 1281799), + Common::PL_POL, + Common::kPlatformUnknown, + ADGF_NO_FLAGS, + Common::GUIO_NONE + }, + { + "sword25", + "", + AD_ENTRY1s("lang_pt.b25c", "1df701432f9e13dcefe1adeb890b9c69", 993812), + Common::PT_BRA, + Common::kPlatformUnknown, + ADGF_NO_FLAGS, + Common::GUIO_NONE + }, + { + "sword25", + "", + AD_ENTRY1s("lang_ru.b25c", "deb33dd2f90a71ff60181918a8ce5063", 1235378), + Common::RU_RUS, + Common::kPlatformUnknown, + ADGF_NO_FLAGS, + Common::GUIO_NONE + }, + { + "sword25", + "", + AD_ENTRY1s("lang_es.b25c", "384c19072d83725f351bb9ecb4d3f02b", 987965), + Common::ES_ESP, + Common::kPlatformUnknown, + ADGF_NO_FLAGS, + Common::GUIO_NONE + }, + + // Extracted version + { + "sword25", + "Extracted", + {{"_includes.lua", 0, 0, -1}, + {"boot.lua", 0, 0, -1}, + {"kernel.lua", 0, 0, -1}, + AD_LISTEND}, + Common::EN_ANY, + Common::kPlatformUnknown, + GF_EXTRACTED, + Common::GUIO_NONE + }, + AD_TABLE_END_MARKER +}; + +} // End of namespace Sword25 diff --git a/engines/sword25/fmv/movieplayer.cpp b/engines/sword25/fmv/movieplayer.cpp index 975f08be22e..d0ad41de22e 100644 --- a/engines/sword25/fmv/movieplayer.cpp +++ b/engines/sword25/fmv/movieplayer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -49,7 +46,7 @@ namespace Sword25 { #define FLT_EPSILON 1.192092896e-07F /* smallest such that 1.0+FLT_EPSILON != 1.0 */ #ifdef USE_THEORADEC -MoviePlayer::MoviePlayer(Kernel *pKernel) : Service(pKernel), _decoder(g_system->getMixer()) { +MoviePlayer::MoviePlayer(Kernel *pKernel) : Service(pKernel), _decoder() { if (!registerScriptBindings()) error("Script bindings could not be registered."); else @@ -122,21 +119,23 @@ bool MoviePlayer::pause() { void MoviePlayer::update() { if (_decoder.isVideoLoaded()) { - const Graphics::Surface *s = _decoder.decodeNextFrame(); - if (s) { - // Transfer the next frame - assert(s->format.bytesPerPixel == 4); - -#ifdef THEORA_INDIRECT_RENDERING - byte *frameData = (byte *)s->getBasePtr(0, 0); - _outputBitmap->setContent(frameData, s->pitch * s->h, 0, s->pitch); -#else - g_system->copyRectToScreen((byte *)s->getBasePtr(0, 0), s->pitch, _outX, _outY, MIN(s->w, _backSurface->w), MIN(s->h, _backSurface->h)); - g_system->updateScreen(); -#endif - } else { + if (_decoder.endOfVideo()) { // Movie complete, so unload the movie unloadMovie(); + } else { + const Graphics::Surface *s = _decoder.decodeNextFrame(); + if (s) { + // Transfer the next frame + assert(s->format.bytesPerPixel == 4); + +#ifdef THEORA_INDIRECT_RENDERING + byte *frameData = (byte *)s->getBasePtr(0, 0); + _outputBitmap->setContent(frameData, s->pitch * s->h, 0, s->pitch); +#else + g_system->copyRectToScreen((byte *)s->getBasePtr(0, 0), s->pitch, _outX, _outY, MIN(s->w, _backSurface->w), MIN(s->h, _backSurface->h)); + g_system->updateScreen(); +#endif + } } } } @@ -146,7 +145,7 @@ bool MoviePlayer::isMovieLoaded() { } bool MoviePlayer::isPaused() { - return _decoder.isPaused(); + return _decoder.isPaused() || _decoder.endOfVideo(); } float MoviePlayer::getScaleFactor() { diff --git a/engines/sword25/fmv/movieplayer.h b/engines/sword25/fmv/movieplayer.h index df0792c8a87..1d256e56ba8 100644 --- a/engines/sword25/fmv/movieplayer.h +++ b/engines/sword25/fmv/movieplayer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/fmv/movieplayer_script.cpp b/engines/sword25/fmv/movieplayer_script.cpp index dce90484389..8359059b854 100644 --- a/engines/sword25/fmv/movieplayer_script.cpp +++ b/engines/sword25/fmv/movieplayer_script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/fmv/theora_decoder.cpp b/engines/sword25/fmv/theora_decoder.cpp index 86236fbd21b..be6d940d232 100644 --- a/engines/sword25/fmv/theora_decoder.cpp +++ b/engines/sword25/fmv/theora_decoder.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -42,7 +39,8 @@ #ifdef USE_THEORADEC #include "common/system.h" #include "common/textconsole.h" -#include "graphics/conversion.h" +#include "common/util.h" +#include "graphics/yuv_to_rgb.h" #include "audio/decoders/raw.h" #include "sword25/kernel/common.h" @@ -54,15 +52,14 @@ static double rint(double v) { return floor(v + 0.5); } -TheoraDecoder::TheoraDecoder(Audio::Mixer *mixer, Audio::Mixer::SoundType soundType) : _mixer(mixer) { +TheoraDecoder::TheoraDecoder(Audio::Mixer::SoundType soundType) { _fileStream = 0; - _surface = 0; _theoraPacket = 0; _vorbisPacket = 0; _theoraDecode = 0; _theoraSetup = 0; - _stateFlag = false; + _nextFrameStartTime = 0.0; _soundType = soundType; _audStream = 0; @@ -70,7 +67,7 @@ TheoraDecoder::TheoraDecoder(Audio::Mixer *mixer, Audio::Mixer::SoundType soundT ogg_sync_init(&_oggSync); - _curFrame = 0; + _curFrame = -1; _audiobuf = (ogg_int16_t *)malloc(AUDIOFD_FRAGSIZE * sizeof(ogg_int16_t)); reset(); @@ -103,6 +100,8 @@ int TheoraDecoder::bufferData() { bool TheoraDecoder::loadStream(Common::SeekableReadStream *stream) { close(); + _endOfAudio = false; + _endOfVideo = false; _fileStream = stream; // start up Ogg stream synchronization layer @@ -118,7 +117,8 @@ bool TheoraDecoder::loadStream(Common::SeekableReadStream *stream) { // Ogg file open; parse the headers // Only interested in Vorbis/Theora streams - while (!_stateFlag) { + bool foundHeader = false; + while (!foundHeader) { int ret = bufferData(); if (ret == 0) @@ -131,7 +131,7 @@ bool TheoraDecoder::loadStream(Common::SeekableReadStream *stream) { if (!ogg_page_bos(&_oggPage)) { // don't leak the page; get it into the appropriate stream queuePage(&_oggPage); - _stateFlag = true; + foundHeader = true; break; } @@ -275,22 +275,39 @@ bool TheoraDecoder::loadStream(Common::SeekableReadStream *stream) { vorbis_block_init(&_vorbisDSP, &_vorbisBlock); debug(3, "Ogg logical stream %lx is Vorbis %d channel %ld Hz audio.", _vorbisOut.serialno, _vorbisInfo.channels, _vorbisInfo.rate); + + _audStream = Audio::makeQueuingAudioStream(_vorbisInfo.rate, _vorbisInfo.channels); + + // Get enough audio data to start us off + while (_audStream->numQueuedStreams() == 0) { + // Queue more data + bufferData(); + while (ogg_sync_pageout(&_oggSync, &_oggPage) > 0) + queuePage(&_oggPage); + + queueAudio(); + } + + if (_audStream) + g_system->getMixer()->playStream(Audio::Mixer::kPlainSoundType, _audHandle, _audStream); } else { // tear down the partial vorbis setup vorbis_info_clear(&_vorbisInfo); vorbis_comment_clear(&_vorbisComment); + _endOfAudio = true; } - // open audio - if (_vorbisPacket) { - _audStream = createAudioStream(); - if (_audStream && _mixer) - _mixer->playStream(_soundType, _audHandle, _audStream); - } + _surface.create(_theoraInfo.frame_width, _theoraInfo.frame_height, g_system->getScreenFormat()); - _surface = new Graphics::Surface(); + // Set up a display surface + _displaySurface.pixels = _surface.getBasePtr(_theoraInfo.pic_x, _theoraInfo.pic_y); + _displaySurface.w = _theoraInfo.pic_width; + _displaySurface.h = _theoraInfo.pic_height; + _displaySurface.format = _surface.format; + _displaySurface.pitch = _surface.pitch; - _surface->create(_theoraInfo.frame_width, _theoraInfo.frame_height, g_system->getScreenFormat()); + // Set the frame rate + _frameRate = Common::Rational(_theoraInfo.fps_numerator, _theoraInfo.fps_denominator); return true; } @@ -303,8 +320,8 @@ void TheoraDecoder::close() { vorbis_comment_clear(&_vorbisComment); vorbis_info_clear(&_vorbisInfo); - if (_mixer) - _mixer->stopHandle(*_audHandle); + g_system->getMixer()->stopHandle(*_audHandle); + _audStream = 0; _vorbisPacket = false; } @@ -325,57 +342,16 @@ void TheoraDecoder::close() { delete _fileStream; _fileStream = 0; - _surface->free(); - delete _surface; - _surface = 0; + _surface.free(); + _displaySurface.pixels = 0; + _displaySurface.free(); reset(); } const Graphics::Surface *TheoraDecoder::decodeNextFrame() { - int i, j; - - // we want a video and audio frame ready to go at all times. If - // we have to buffer incoming, buffer the compressed data (ie, let - // ogg do the buffering) - while (_vorbisPacket && !_audiobufReady) { - int ret; - float **pcm; - - // if there's pending, decoded audio, grab it - if ((ret = vorbis_synthesis_pcmout(&_vorbisDSP, &pcm)) > 0) { - int count = _audiobufFill / 2; - int maxsamples = ((AUDIOFD_FRAGSIZE - _audiobufFill) / _vorbisInfo.channels) >> 1; - for (i = 0; i < ret && i < maxsamples; i++) - for (j = 0; j < _vorbisInfo.channels; j++) { - int val = CLIP((int)rint(pcm[j][i] * 32767.f), -32768, 32767); - _audiobuf[count++] = val; - } - - vorbis_synthesis_read(&_vorbisDSP, i); - _audiobufFill += (i * _vorbisInfo.channels) << 1; - - if (_audiobufFill == AUDIOFD_FRAGSIZE) - _audiobufReady = true; - -#if ENABLE_THEORA_SEEKING - if (_vorbisDSP.granulepos >= 0) - _audiobufGranulePos = _vorbisDSP.granulepos - ret + i; - else - _audiobufGranulePos += i; -#endif - } else { - - // no pending audio; is there a pending packet to decode? - if (ogg_stream_packetout(&_vorbisOut, &_oggPacket) > 0) { - if (vorbis_synthesis(&_vorbisBlock, &_oggPacket) == 0) // test for success! - vorbis_synthesis_blockin(&_vorbisDSP, &_vorbisBlock); - } else // we need more data; break out to suck in another page - break; - } - } - - while (_theoraPacket && !_videobufReady) { + // First, let's get our frame + while (_theoraPacket) { // theora is one in, one out... if (ogg_stream_packetout(&_theoraOut, &_oggPacket) > 0) { @@ -385,85 +361,124 @@ const Graphics::Surface *TheoraDecoder::decodeNextFrame() { _ppInc = 0; } -#if ENABLE_THEORA_SEEKING - // HACK: This should be set after a seek or a gap, but we might not have - // a granulepos for the first packet (we only have them for the last - // packet on a page), so we just set it as often as we get it. - // To do this right, we should back-track from the last packet on the - // page and compute the correct granulepos for the first packet after - // a seek or a gap. - if (_oggPacket.granulepos >= 0) { - th_decode_ctl(_theoraDecode, TH_DECCTL_SET_GRANPOS, &_oggPacket.granulepos, sizeof(_oggPacket.granulepos)); - } - - if (th_decode_packetin(_theoraDecode, &_oggPacket, &_videobufGranulePos) == 0) { - _videobufTime = th_granule_time(_theoraDecode, _videobufGranulePos); -#else if (th_decode_packetin(_theoraDecode, &_oggPacket, NULL) == 0) { -#endif _curFrame++; - _videobufReady = true; + + // Convert YUV data to RGB data + th_ycbcr_buffer yuv; + th_decode_ycbcr_out(_theoraDecode, yuv); + translateYUVtoRGBA(yuv); + + if (_curFrame == 0) + _startTime = g_system->getMillis(); + + double time = th_granule_time(_theoraDecode, _oggPacket.granulepos); + + // We need to calculate when the next frame should be shown + // This is all in floating point because that's what the Ogg code gives us + // Ogg is a lossy container format, so it doesn't always list the time to the + // next frame. In such cases, we need to calculate it ourselves. + if (time == -1.0) + _nextFrameStartTime += _frameRate.getInverse().toDouble(); + else + _nextFrameStartTime = time; + + // break out + break; } - } else - break; + } else { + // If we can't get any more frames, we're done. + if (_theoraOut.e_o_s || _fileStream->eos()) { + _endOfVideo = true; + break; + } + + // Queue more data + bufferData(); + while (ogg_sync_pageout(&_oggSync, &_oggPage) > 0) + queuePage(&_oggPage); + } + + // Update audio if we can + queueAudio(); } - if (!_videobufReady && !_audiobufReady && _fileStream->eos()) { - return NULL; - } - - if (!_videobufReady || !_audiobufReady) { - // no data yet for somebody. Grab another page + // Force at least some audio to be buffered + // TODO: 5 is very arbitrary. We probably should do something like QuickTime does. + while (!_endOfAudio && _audStream->numQueuedStreams() < 5) { bufferData(); - while (ogg_sync_pageout(&_oggSync, &_oggPage) > 0) { + while (ogg_sync_pageout(&_oggSync, &_oggPage) > 0) queuePage(&_oggPage); + + bool queuedAudio = queueAudio(); + if ((_vorbisOut.e_o_s || _fileStream->eos()) && !queuedAudio) { + _endOfAudio = true; + break; } } - // If playback has begun, top audio buffer off immediately. - if (_stateFlag && _audiobufReady) { - _audStream->queueBuffer((byte *)_audiobuf, AUDIOFD_FRAGSIZE, DisposeAfterUse::NO, Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN | Audio::FLAG_STEREO); + return &_displaySurface; +} - // The audio mixer is now responsible for the old audio buffer. - // We need to create a new one. - _audiobuf = (ogg_int16_t *)malloc(AUDIOFD_FRAGSIZE * sizeof(ogg_int16_t)); - _audiobufFill = 0; - _audiobufReady = false; +bool TheoraDecoder::queueAudio() { + if (!_audStream) + return false; + + bool queuedAudio = false; + + for (;;) { + float **pcm; + + // if there's pending, decoded audio, grab it + int ret = vorbis_synthesis_pcmout(&_vorbisDSP, &pcm); + if (ret > 0) { + int count = _audiobufFill / 2; + int maxsamples = ((AUDIOFD_FRAGSIZE - _audiobufFill) / _vorbisInfo.channels) >> 1; + int i; + for (i = 0; i < ret && i < maxsamples; i++) + for (int j = 0; j < _vorbisInfo.channels; j++) { + int val = CLIP((int)rint(pcm[j][i] * 32767.f), -32768, 32767); + _audiobuf[count++] = val; + } + + vorbis_synthesis_read(&_vorbisDSP, i); + _audiobufFill += (i * _vorbisInfo.channels) << 1; + + if (_audiobufFill == AUDIOFD_FRAGSIZE) { + byte flags = Audio::FLAG_16BITS | Audio::FLAG_STEREO; +#ifdef SCUMM_LITTLE_ENDIAN + flags |= Audio::FLAG_LITTLE_ENDIAN; +#endif + _audStream->queueBuffer((byte *)_audiobuf, AUDIOFD_FRAGSIZE, DisposeAfterUse::NO, flags); + + // The audio mixer is now responsible for the old audio buffer. + // We need to create a new one. + _audiobuf = (ogg_int16_t *)malloc(AUDIOFD_FRAGSIZE * sizeof(ogg_int16_t)); + _audiobufFill = 0; + queuedAudio = true; + } + } else { + // no pending audio; is there a pending packet to decode? + if (ogg_stream_packetout(&_vorbisOut, &_oggPacket) > 0) { + if (vorbis_synthesis(&_vorbisBlock, &_oggPacket) == 0) // test for success! + vorbis_synthesis_blockin(&_vorbisDSP, &_vorbisBlock); + } else // we've buffered all we have, break out for now + return queuedAudio; + } } - // are we at or past time for this video frame? - if (_stateFlag && _videobufReady) { - th_ycbcr_buffer yuv; - - th_decode_ycbcr_out(_theoraDecode, yuv); - - // Convert YUV data to RGB data - translateYUVtoRGBA(yuv, (byte *)_surface->getBasePtr(0, 0)); - - _videobufReady = false; - } - - // if our buffers either don't exist or are ready to go, - // we can begin playback - if ((!_theoraPacket || _videobufReady) && - (!_vorbisPacket || _audiobufReady)) - _stateFlag = true; - - // same if we've run out of input - if (_fileStream->eos()) - _stateFlag = true; - - return _surface; + // Unreachable + return false; } void TheoraDecoder::reset() { - FixedRateVideoDecoder::reset(); + VideoDecoder::reset(); + + // FIXME: This does a rewind() instead of a reset()! if (_fileStream) _fileStream->seek(0); - _videobufReady = false; - #if ENABLE_THEORA_SEEKING _videobufGranulePos = -1; _audiobufGranulePos = 0; @@ -473,36 +488,39 @@ void TheoraDecoder::reset() { _audiobufFill = 0; _audiobufReady = false; - _curFrame = 0; + _curFrame = -1; _theoraPacket = 0; _vorbisPacket = 0; - _stateFlag = false; } bool TheoraDecoder::endOfVideo() const { - return !isVideoLoaded(); + return !isVideoLoaded() || (_endOfVideo && (!_audStream || (_audStream->endOfData() && _endOfAudio))); } +uint32 TheoraDecoder::getTimeToNextFrame() const { + if (endOfVideo() || _curFrame < 0) + return 0; + + uint32 elapsedTime = getElapsedTime(); + uint32 nextFrameStartTime = (uint32)(_nextFrameStartTime * 1000); + + if (nextFrameStartTime <= elapsedTime) + return 0; + + return nextFrameStartTime - elapsedTime; +} uint32 TheoraDecoder::getElapsedTime() const { - if (_audStream && _mixer) - return _mixer->getSoundElapsedTime(*_audHandle); + if (_audStream) + return g_system->getMixer()->getSoundElapsedTime(*_audHandle); - return FixedRateVideoDecoder::getElapsedTime(); + return VideoDecoder::getElapsedTime(); } -Audio::QueuingAudioStream *TheoraDecoder::createAudioStream() { - return Audio::makeQueuingAudioStream(_vorbisInfo.rate, _vorbisInfo.channels); -} - -static void convertYUVtoBGRA(int y, int u, int v, byte *dst) { - byte r, g, b; - Graphics::YUV2RGB(y, u, v, r, g, b); - *(dst + 0) = b; - *(dst + 1) = g; - *(dst + 2) = r; - *(dst + 3) = 0xFF; +void TheoraDecoder::pauseVideoIntern(bool pause) { + if (_audStream) + g_system->getMixer()->pauseHandle(*_audHandle, pause); } enum TheoraYUVBuffers { @@ -511,7 +529,7 @@ enum TheoraYUVBuffers { kBufferV = 2 }; -void TheoraDecoder::translateYUVtoRGBA(th_ycbcr_buffer &YUVBuffer, byte *pixelData) { +void TheoraDecoder::translateYUVtoRGBA(th_ycbcr_buffer &YUVBuffer) { // Width and height of all buffers have to be divisible by 2. assert((YUVBuffer[kBufferY].width & 1) == 0); assert((YUVBuffer[kBufferY].height & 1) == 0); @@ -524,40 +542,7 @@ void TheoraDecoder::translateYUVtoRGBA(th_ycbcr_buffer &YUVBuffer, byte *pixelDa assert(YUVBuffer[kBufferU].height == YUVBuffer[kBufferY].height >> 1); assert(YUVBuffer[kBufferV].height == YUVBuffer[kBufferY].height >> 1); - const byte *ySrc = YUVBuffer[kBufferY].data; - const byte *uSrc = YUVBuffer[kBufferU].data; - const byte *vSrc = YUVBuffer[kBufferV].data; - byte *dst = pixelData; - int u = 0, v = 0; - - const int blockSize = YUVBuffer[kBufferY].width << 2; - const int halfHeight = YUVBuffer[kBufferY].height >> 1; - const int halfWidth = YUVBuffer[kBufferY].width >> 1; - const int yStep = (YUVBuffer[kBufferY].stride << 1) - YUVBuffer[kBufferY].width; - // The UV step is usually 0, since in most cases stride == width. - // The asserts at the top ensure that the U and V steps are equal - // (and they must always be equal) - const int uvStep = YUVBuffer[kBufferU].stride - YUVBuffer[kBufferU].width; - const int stride = YUVBuffer[kBufferY].stride; - - for (int h = 0; h < halfHeight; ++h) { - for (int w = 0; w < halfWidth; ++w) { - u = *uSrc++; - v = *vSrc++; - - for (int i = 0; i <= 1; i++) { - convertYUVtoBGRA(*ySrc, u, v, dst); - convertYUVtoBGRA(*(ySrc + stride), u, v, dst + blockSize); - ySrc++; - dst += 4; // BGRA - } - } - - dst += blockSize; - ySrc += yStep; - uSrc += uvStep; - vSrc += uvStep; - } + Graphics::convertYUV420ToRGB(&_surface, YUVBuffer[kBufferY].data, YUVBuffer[kBufferU].data, YUVBuffer[kBufferV].data, YUVBuffer[kBufferY].width, YUVBuffer[kBufferY].height, YUVBuffer[kBufferY].stride, YUVBuffer[kBufferU].stride); } } // End of namespace Sword25 diff --git a/engines/sword25/fmv/theora_decoder.h b/engines/sword25/fmv/theora_decoder.h index 4ed2af5f98b..e8cc5ab8b90 100644 --- a/engines/sword25/fmv/theora_decoder.h +++ b/engines/sword25/fmv/theora_decoder.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD25_THEORADECODER_H @@ -44,8 +41,6 @@ namespace Common { class SeekableReadStream; } -//#define ENABLE_THEORA_SEEKING // enables the extra calculations used for video seeking - namespace Sword25 { /** @@ -54,9 +49,9 @@ namespace Sword25 { * Video decoder used in engines: * - sword25 */ -class TheoraDecoder : public Video::FixedRateVideoDecoder { +class TheoraDecoder : public Video::VideoDecoder { public: - TheoraDecoder(Audio::Mixer *mixer = 0, Audio::Mixer::SoundType soundType = Audio::Mixer::kMusicSoundType); + TheoraDecoder(Audio::Mixer::SoundType soundType = Audio::Mixer::kMusicSoundType); virtual ~TheoraDecoder(); /** @@ -74,51 +69,40 @@ public: */ const Graphics::Surface *decodeNextFrame(); - bool isVideoLoaded() const { - return _fileStream != 0; - } - bool isPaused() const { - return (FixedRateVideoDecoder::isPaused() || !isVideoLoaded()); - } + bool isVideoLoaded() const { return _fileStream != 0; } + uint16 getWidth() const { return _displaySurface.w; } + uint16 getHeight() const { return _displaySurface.h; } - uint16 getWidth() const { - return _surface->w; - } - uint16 getHeight() const { - return _surface->h; - } uint32 getFrameCount() const { // It is not possible to get frame count easily // I.e. seeking is required assert(0); return 0; } - Graphics::PixelFormat getPixelFormat() const { - return Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24); - } + Graphics::PixelFormat getPixelFormat() const { return _displaySurface.format; } uint32 getElapsedTime() const; + uint32 getTimeToNextFrame() const; bool endOfVideo() const; protected: - Common::Rational getFrameRate() const { - return _frameRate; - } + void pauseVideoIntern(bool pause); private: void queuePage(ogg_page *page); + bool queueAudio(); int bufferData(); - Audio::QueuingAudioStream *createAudioStream(); - void translateYUVtoRGBA(th_ycbcr_buffer &YUVBuffer, byte *pixelData); + void translateYUVtoRGBA(th_ycbcr_buffer &YUVBuffer); -private: Common::SeekableReadStream *_fileStream; - Graphics::Surface *_surface; + Graphics::Surface _surface; + Graphics::Surface _displaySurface; Common::Rational _frameRate; - uint32 _frameCount; + double _nextFrameStartTime; + bool _endOfVideo; + bool _endOfAudio; - Audio::Mixer *_mixer; Audio::Mixer::SoundType _soundType; Audio::SoundHandle *_audHandle; Audio::QueuingAudioStream *_audStream; @@ -139,25 +123,15 @@ private: int _theoraPacket; int _vorbisPacket; - bool _stateFlag; int _ppLevelMax; int _ppLevel; int _ppInc; - // single frame video buffering - bool _videobufReady; - // single audio fragment audio buffering int _audiobufFill; bool _audiobufReady; ogg_int16_t *_audiobuf; - -#if ENABLE_THEORA_SEEKING - double _videobufTime; - ogg_int64_t _videobufGranulePos; - ogg_int64_t _audiobufGranulePos; // time position of last sample -#endif }; } // End of namespace Sword25 diff --git a/engines/sword25/gfx/animation.cpp b/engines/sword25/gfx/animation.cpp index 5b56d708cb4..22a4dfb71b3 100644 --- a/engines/sword25/gfx/animation.cpp +++ b/engines/sword25/gfx/animation.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/animation.h b/engines/sword25/gfx/animation.h index a530c02b127..55deacd3339 100644 --- a/engines/sword25/gfx/animation.h +++ b/engines/sword25/gfx/animation.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/animationdescription.cpp b/engines/sword25/gfx/animationdescription.cpp index 68ba7b63a66..da0a660df9d 100644 --- a/engines/sword25/gfx/animationdescription.cpp +++ b/engines/sword25/gfx/animationdescription.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/animationdescription.h b/engines/sword25/gfx/animationdescription.h index 88cbb235036..3b11686bb99 100644 --- a/engines/sword25/gfx/animationdescription.h +++ b/engines/sword25/gfx/animationdescription.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/animationresource.cpp b/engines/sword25/gfx/animationresource.cpp index f9347e3dad4..a9c9cf9c293 100644 --- a/engines/sword25/gfx/animationresource.cpp +++ b/engines/sword25/gfx/animationresource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/animationresource.h b/engines/sword25/gfx/animationresource.h index 0cbaf0a507b..2a1e3ce882c 100644 --- a/engines/sword25/gfx/animationresource.h +++ b/engines/sword25/gfx/animationresource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/animationtemplate.cpp b/engines/sword25/gfx/animationtemplate.cpp index 835ae09fe81..19924302b9f 100644 --- a/engines/sword25/gfx/animationtemplate.cpp +++ b/engines/sword25/gfx/animationtemplate.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/animationtemplate.h b/engines/sword25/gfx/animationtemplate.h index 06be94719d1..b61ecfcf54a 100644 --- a/engines/sword25/gfx/animationtemplate.h +++ b/engines/sword25/gfx/animationtemplate.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/animationtemplateregistry.cpp b/engines/sword25/gfx/animationtemplateregistry.cpp index c41a7cde559..43c099c89d2 100644 --- a/engines/sword25/gfx/animationtemplateregistry.cpp +++ b/engines/sword25/gfx/animationtemplateregistry.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/animationtemplateregistry.h b/engines/sword25/gfx/animationtemplateregistry.h index 574ccce136b..d3d02b2ac8f 100644 --- a/engines/sword25/gfx/animationtemplateregistry.h +++ b/engines/sword25/gfx/animationtemplateregistry.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/bitmap.cpp b/engines/sword25/gfx/bitmap.cpp index 9010a9c981c..593a4269756 100644 --- a/engines/sword25/gfx/bitmap.cpp +++ b/engines/sword25/gfx/bitmap.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/bitmap.h b/engines/sword25/gfx/bitmap.h index 741269c423c..caa12385584 100644 --- a/engines/sword25/gfx/bitmap.h +++ b/engines/sword25/gfx/bitmap.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/bitmapresource.h b/engines/sword25/gfx/bitmapresource.h index 9feca82184c..f1278f38858 100644 --- a/engines/sword25/gfx/bitmapresource.h +++ b/engines/sword25/gfx/bitmapresource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/dynamicbitmap.cpp b/engines/sword25/gfx/dynamicbitmap.cpp index 46c2af55d71..137d943575a 100644 --- a/engines/sword25/gfx/dynamicbitmap.cpp +++ b/engines/sword25/gfx/dynamicbitmap.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/dynamicbitmap.h b/engines/sword25/gfx/dynamicbitmap.h index 1737bdf5fc0..35ed9a93413 100644 --- a/engines/sword25/gfx/dynamicbitmap.h +++ b/engines/sword25/gfx/dynamicbitmap.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/fontresource.cpp b/engines/sword25/gfx/fontresource.cpp index 0f0496e9aba..f99987fc918 100644 --- a/engines/sword25/gfx/fontresource.cpp +++ b/engines/sword25/gfx/fontresource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/fontresource.h b/engines/sword25/gfx/fontresource.h index 47aa581a9e0..511f485658b 100644 --- a/engines/sword25/gfx/fontresource.h +++ b/engines/sword25/gfx/fontresource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/graphicengine.cpp b/engines/sword25/gfx/graphicengine.cpp index fbaa69d09cc..6b1c2bc514b 100644 --- a/engines/sword25/gfx/graphicengine.cpp +++ b/engines/sword25/gfx/graphicengine.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/graphicengine.h b/engines/sword25/gfx/graphicengine.h index 8d12168b628..33097639668 100644 --- a/engines/sword25/gfx/graphicengine.h +++ b/engines/sword25/gfx/graphicengine.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -109,7 +106,7 @@ public: // --------- /** - * Initialises the graphics engine and sets the screen mode. Returns + * Initializes the graphics engine and sets the screen mode. Returns * true if initialisation failed. * @note This method should be called immediately after the * initialisation of all services. diff --git a/engines/sword25/gfx/graphicengine_script.cpp b/engines/sword25/gfx/graphicengine_script.cpp index d8daaab32cb..b4334195a17 100644 --- a/engines/sword25/gfx/graphicengine_script.cpp +++ b/engines/sword25/gfx/graphicengine_script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/image/art.cpp b/engines/sword25/gfx/image/art.cpp index 69f9425a530..cd7cfb6b69f 100644 --- a/engines/sword25/gfx/image/art.cpp +++ b/engines/sword25/gfx/image/art.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/image/art.h b/engines/sword25/gfx/image/art.h index fe3bbd4982a..bfeb31cc305 100644 --- a/engines/sword25/gfx/image/art.h +++ b/engines/sword25/gfx/image/art.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/image/image.h b/engines/sword25/gfx/image/image.h index 7029402c4a3..f1934656dae 100644 --- a/engines/sword25/gfx/image/image.h +++ b/engines/sword25/gfx/image/image.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/image/imgloader.cpp b/engines/sword25/gfx/image/imgloader.cpp new file mode 100644 index 00000000000..1df0fba70c6 --- /dev/null +++ b/engines/sword25/gfx/image/imgloader.cpp @@ -0,0 +1,85 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +/* + * This code is based on Broken Sword 2.5 engine + * + * Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer + * + * Licensed under GNU GPL v2 + * + */ + +#include "common/memstream.h" +#include "sword25/gfx/image/image.h" +#include "sword25/gfx/image/imgloader.h" +#include "graphics/pixelformat.h" +#include "graphics/png.h" + +namespace Sword25 { + +bool ImgLoader::decodePNGImage(const byte *fileDataPtr, uint fileSize, byte *&uncompressedDataPtr, int &width, int &height, int &pitch) { + Common::MemoryReadStream *fileStr = new Common::MemoryReadStream(fileDataPtr, fileSize, DisposeAfterUse::NO); + Graphics::PNG *png = new Graphics::PNG(); + if (!png->read(fileStr)) // the fileStr pointer, and thus pFileData will be deleted after this is done + error("Error while reading PNG image"); + + Graphics::PixelFormat format = Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24); + Graphics::Surface *pngSurface = png->getSurface(format); + + width = pngSurface->w; + height = pngSurface->h; + uncompressedDataPtr = new byte[pngSurface->pitch * pngSurface->h]; + memcpy(uncompressedDataPtr, (byte *)pngSurface->pixels, pngSurface->pitch * pngSurface->h); + pngSurface->free(); + + delete pngSurface; + delete png; + + // Signal success + return true; +} + +bool ImgLoader::decodeThumbnailImage(const byte *pFileData, uint fileSize, byte *&pUncompressedData, int &width, int &height, int &pitch) { + const byte *src = pFileData + 4; // skip header + width = READ_LE_UINT16(src); src += 2; + height = READ_LE_UINT16(src); src += 2; + src++; // version, ignored for now + pitch = width * 4; + + uint32 totalSize = pitch * height; + pUncompressedData = new byte[totalSize]; + uint32 *dst = (uint32 *)pUncompressedData; // treat as uint32, for pixelformat output + const Graphics::PixelFormat format = Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24); + byte r, g, b; + + for (uint32 i = 0; i < totalSize / 4; i++) { + r = *src++; + g = *src++; + b = *src++; + *dst++ = format.RGBToColor(r, g, b); + } + + return true; +} + +} // End of namespace Sword25 diff --git a/engines/sword25/gfx/image/pngloader.h b/engines/sword25/gfx/image/imgloader.h similarity index 63% rename from engines/sword25/gfx/image/pngloader.h rename to engines/sword25/gfx/image/imgloader.h index fea6ece0e9c..735ab9203c0 100644 --- a/engines/sword25/gfx/image/pngloader.h +++ b/engines/sword25/gfx/image/imgloader.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -32,30 +29,22 @@ * */ -#ifndef SWORD25_PNGLOADER2_H -#define SWORD25_PNGLOADER2_H +#ifndef SWORD25_IMGLOADER_H +#define SWORD25_IMGLOADER_H #include "sword25/kernel/common.h" #include "sword25/gfx/graphicengine.h" namespace Sword25 { -// Define to use ScummVM's PNG decoder, instead of libpng -#define USE_INTERNAL_PNG_DECODER - /** * Class for loading PNG files, and PNG data embedded into savegames. * * Originally written by Malte Thiesen. */ -class PNGLoader { +class ImgLoader { protected: - PNGLoader() {} // Protected constructor to prevent instances - - static bool doDecodeImage(const byte *fileDataPtr, uint fileSize, byte *&uncompressedDataPtr, int &width, int &height, int &pitch); -#ifndef USE_INTERNAL_PNG_DECODER - static bool doImageProperties(const byte *fileDataPtr, uint fileSize, int &width, int &height); -#endif + ImgLoader() {} // Protected constructor to prevent instances public: @@ -73,28 +62,15 @@ public: * @remark This function does not free the image buffer passed to it, * it is the callers responsibility to do so. */ - static bool decodeImage(const byte *pFileData, uint fileSize, + static bool decodePNGImage(const byte *pFileData, uint fileSize, byte *&pUncompressedData, int &width, int &height, int &pitch); -#ifndef USE_INTERNAL_PNG_DECODER - /** - * Extract the properties of an image. - * @param[in] fileDatePtr pointer to the image data - * @param[in] fileSize size of the image data in bytes - * @param[out] width if successful, this is set to the width of the image - * @param[out] height if successful, this is set to the height of the image - * @return returns true if extraction of the properties was successful, false in case of an error - * - * @remark This function does not free the image buffer passed to it, - * it is the callers responsibility to do so. - */ - static bool imageProperties(const byte *fileDatePtr, uint fileSize, - int &width, - int &height); -#endif - + static bool decodeThumbnailImage(const byte *pFileData, uint fileSize, + byte *&pUncompressedData, + int &width, int &height, + int &pitch); }; } // End of namespace Sword25 diff --git a/engines/sword25/gfx/image/pngloader.cpp b/engines/sword25/gfx/image/pngloader.cpp deleted file mode 100644 index d3c119b1a0e..00000000000 --- a/engines/sword25/gfx/image/pngloader.cpp +++ /dev/null @@ -1,295 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -/* - * This code is based on Broken Sword 2.5 engine - * - * Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer - * - * Licensed under GNU GPL v2 - * - */ - -#ifndef USE_INTERNAL_PNG_DECODER -// Disable symbol overrides so that we can use png.h -#define FORBIDDEN_SYMBOL_ALLOW_ALL -#endif - -#include "common/memstream.h" -#include "sword25/gfx/image/image.h" -#include "sword25/gfx/image/pngloader.h" -#ifndef USE_INTERNAL_PNG_DECODER -#include -#else -#include "graphics/pixelformat.h" -#include "graphics/png.h" -#endif - -namespace Sword25 { - -/** - * Load a NULL-terminated string from the given stream. - */ -static Common::String loadString(Common::ReadStream &in, uint maxSize = 999) { - Common::String result; - - while (!in.eos() && (result.size() < maxSize)) { - char ch = (char)in.readByte(); - if (ch == '\0') - break; - - result += ch; - } - - return result; -} - -/** - * Check if the given data is a savegame, and if so, locate the - * offset to the image data. - * @return offset to image data if fileDataPtr contains a savegame; 0 otherwise - */ -static uint findEmbeddedPNG(const byte *fileDataPtr, uint fileSize) { - if (fileSize < 100) - return 0; - if (memcmp(fileDataPtr, "BS25SAVEGAME", 12)) - return 0; - - // Read in the header - Common::MemoryReadStream stream(fileDataPtr, fileSize); - stream.seek(0, SEEK_SET); - - // Read header information of savegame - uint compressedGamedataSize; - loadString(stream); // Marker - loadString(stream); // Version - loadString(stream); // Description - Common::String gameSize = loadString(stream); - compressedGamedataSize = atoi(gameSize.c_str()); - loadString(stream); - - // Return the offset of where the thumbnail starts - return static_cast(stream.pos() + compressedGamedataSize); -} - -#ifndef USE_INTERNAL_PNG_DECODER -static void png_user_read_data(png_structp png_ptr, png_bytep data, png_size_t length) { - const byte **ref = (const byte **)png_get_io_ptr(png_ptr); - memcpy(data, *ref, length); - *ref += length; -} - -static bool doIsCorrectImageFormat(const byte *fileDataPtr, uint fileSize) { - return (fileSize > 8) && png_check_sig(const_cast(fileDataPtr), 8); -} -#endif - -bool PNGLoader::doDecodeImage(const byte *fileDataPtr, uint fileSize, byte *&uncompressedDataPtr, int &width, int &height, int &pitch) { -#ifndef USE_INTERNAL_PNG_DECODER - png_structp png_ptr = NULL; - png_infop info_ptr = NULL; - - int bitDepth; - int colorType; - int interlaceType; - int i; - - // Check for valid PNG signature - if (!doIsCorrectImageFormat(fileDataPtr, fileSize)) { - error("png_check_sig failed"); - } - - // Create both PNG structures - png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); - if (!png_ptr) { - error("Could not create libpng read struct."); - } - - info_ptr = png_create_info_struct(png_ptr); - if (!info_ptr) { - error("Could not create libpng info struct."); - } - - // Use alternative reading function - const byte **ref = &fileDataPtr; - png_set_read_fn(png_ptr, (void *)ref, png_user_read_data); - - // Read PNG header - png_read_info(png_ptr, info_ptr); - - // Read out PNG informations - - png_uint_32 w, h; - png_get_IHDR(png_ptr, info_ptr, &w, &h, &bitDepth, &colorType, &interlaceType, NULL, NULL); - width = w; - height = h; - - // Calculate pitch of output image - pitch = GraphicEngine::calcPitch(GraphicEngine::CF_ARGB32, width); - - // Allocate memory for the final image data. - // To keep memory framentation low this happens before allocating memory for temporary image data. - uncompressedDataPtr = new byte[pitch * height]; - if (!uncompressedDataPtr) { - error("Could not allocate memory for output image."); - } - - // Images of all color formates will be transformed into ARGB images - if (bitDepth == 16) - png_set_strip_16(png_ptr); - if (colorType == PNG_COLOR_TYPE_PALETTE) - png_set_expand(png_ptr); - if (bitDepth < 8) - png_set_expand(png_ptr); - if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) - png_set_expand(png_ptr); - if (colorType == PNG_COLOR_TYPE_GRAY || - colorType == PNG_COLOR_TYPE_GRAY_ALPHA) - png_set_gray_to_rgb(png_ptr); - - png_set_bgr(png_ptr); - - if (colorType != PNG_COLOR_TYPE_RGB_ALPHA) - png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER); - - // After the transformations have been registered, the image data is read again. - png_read_update_info(png_ptr, info_ptr); - png_get_IHDR(png_ptr, info_ptr, &w, &h, &bitDepth, &colorType, NULL, NULL, NULL); - width = w; - height = h; - - if (interlaceType == PNG_INTERLACE_NONE) { - // PNGs without interlacing can simply be read row by row. - for (i = 0; i < height; i++) { - png_read_row(png_ptr, uncompressedDataPtr + i * pitch, NULL); - } - } else { - // PNGs with interlacing require us to allocate an auxillary - // buffer with pointers to all row starts. - - // Allocate row pointer buffer - png_bytep *pRowPtr = new png_bytep[height]; - if (!pRowPtr) { - error("Could not allocate memory for row pointers."); - } - - // Initialize row pointers - for (i = 0; i < height; i++) - pRowPtr[i] = uncompressedDataPtr + i * pitch; - - // Read image data - png_read_image(png_ptr, pRowPtr); - - // Free row pointer buffer - delete[] pRowPtr; - } - - // Read additional data at the end. - png_read_end(png_ptr, NULL); - - // Destroy libpng structures - png_destroy_read_struct(&png_ptr, &info_ptr, NULL); -#else - Common::MemoryReadStream *fileStr = new Common::MemoryReadStream(fileDataPtr, fileSize, DisposeAfterUse::NO); - Graphics::PNG *png = new Graphics::PNG(); - if (!png->read(fileStr)) // the fileStr pointer, and thus pFileData will be deleted after this is done - error("Error while reading PNG image"); - - Graphics::PixelFormat format = Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24); - Graphics::Surface *pngSurface = png->getSurface(format); - - width = pngSurface->w; - height = pngSurface->h; - uncompressedDataPtr = new byte[pngSurface->pitch * pngSurface->h]; - memcpy(uncompressedDataPtr, (byte *)pngSurface->pixels, pngSurface->pitch * pngSurface->h); - pngSurface->free(); - - delete pngSurface; - delete png; - -#endif - // Signal success - return true; -} - -bool PNGLoader::decodeImage(const byte *fileDataPtr, uint fileSize, byte *&uncompressedDataPtr, int &width, int &height, int &pitch) { - uint pngOffset = findEmbeddedPNG(fileDataPtr, fileSize); - return doDecodeImage(fileDataPtr + pngOffset, fileSize - pngOffset, uncompressedDataPtr, width, height, pitch); -} - -#ifndef USE_INTERNAL_PNG_DECODER -bool PNGLoader::doImageProperties(const byte *fileDataPtr, uint fileSize, int &width, int &height) { - // Check for valid PNG signature - if (!doIsCorrectImageFormat(fileDataPtr, fileSize)) - return false; - - png_structp png_ptr = NULL; - png_infop info_ptr = NULL; - - // Create both PNG structures - png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); - if (!png_ptr) { - error("Could not create libpng read struct."); - } - - info_ptr = png_create_info_struct(png_ptr); - if (!info_ptr) { - error("Could not create libpng info struct."); - } - - // Use alternative reading function - const byte **ref = &fileDataPtr; - png_set_read_fn(png_ptr, (void *)ref, png_user_read_data); - - // Read PNG Header - png_read_info(png_ptr, info_ptr); - - // Read out PNG informations - int bitDepth; - int colorType; - png_uint_32 w, h; - png_get_IHDR(png_ptr, info_ptr, &w, &h, &bitDepth, &colorType, NULL, NULL, NULL); - - width = w; - height = h; - - // Destroy libpng structures - png_destroy_read_struct(&png_ptr, &info_ptr, NULL); - - return true; - -} - -bool PNGLoader::imageProperties(const byte *fileDataPtr, uint fileSize, int &width, int &height) { - uint pngOffset = findEmbeddedPNG(fileDataPtr, fileSize); - return doImageProperties(fileDataPtr + pngOffset, fileSize - pngOffset, width, height); -} - -#else - // We don't need to read the image properties here... -#endif - - -} // End of namespace Sword25 diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp index 132c516c123..a9c9de4f0c1 100644 --- a/engines/sword25/gfx/image/renderedimage.cpp +++ b/engines/sword25/gfx/image/renderedimage.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -38,25 +35,64 @@ #include "common/savefile.h" #include "sword25/package/packagemanager.h" -#include "sword25/gfx/image/pngloader.h" +#include "sword25/gfx/image/imgloader.h" #include "sword25/gfx/image/renderedimage.h" #include "common/system.h" namespace Sword25 { -// Duplicated from kernel/persistenceservice.cpp -static Common::String generateSavegameFilename(uint slotID) { - char buffer[100]; - // NOTE: This is hardcoded to sword25 - snprintf(buffer, 100, "%s.%.3d", "sword25", slotID); - return Common::String(buffer); -} - // ----------------------------------------------------------------------------- // CONSTRUCTION / DESTRUCTION // ----------------------------------------------------------------------------- +/** + * Load a NULL-terminated string from the given stream. + */ +static Common::String loadString(Common::SeekableReadStream &in, uint maxSize = 999) { + Common::String result; + + while (!in.eos() && (result.size() < maxSize)) { + char ch = (char)in.readByte(); + if (ch == '\0') + break; + + result += ch; + } + + return result; +} + +static byte *readSavegameThumbnail(const Common::String &filename, uint &fileSize, bool &isPNG) { + byte *pFileData; + Common::SaveFileManager *sfm = g_system->getSavefileManager(); + Common::InSaveFile *file = sfm->openForLoading(lastPathComponent(filename, '/')); + if (!file) + error("Save file \"%s\" could not be loaded.", filename.c_str()); + + // Seek to the actual PNG image + loadString(*file); // Marker (BS25SAVEGAME) + loadString(*file); // Version + loadString(*file); // Description + uint32 compressedGamedataSize = atoi(loadString(*file).c_str()); + loadString(*file); // Uncompressed game data size + file->skip(compressedGamedataSize); // Skip the game data and move to the thumbnail itself + uint32 thumbnailStart = file->pos(); + + fileSize = file->size() - thumbnailStart; + + // Check if the thumbnail is in our own format, or a PNG file. + uint32 header = file->readUint32BE(); + isPNG = (header != MKTAG('S','C','R','N')); + file->seek(-4, SEEK_CUR); + + pFileData = new byte[fileSize]; + file->read(pFileData, fileSize); + delete file; + + return pFileData; +} + RenderedImage::RenderedImage(const Common::String &filename, bool &result) : _data(0), _width(0), @@ -72,15 +108,10 @@ RenderedImage::RenderedImage(const Common::String &filename, bool &result) : byte *pFileData; uint fileSize; + bool isPNG = true; + if (filename.hasPrefix("/saves")) { - // A savegame thumbnail - Common::SaveFileManager *sfm = g_system->getSavefileManager(); - int slotNum = atoi(filename.c_str() + filename.size() - 3); - Common::InSaveFile *file = sfm->openForLoading(generateSavegameFilename(slotNum)); - fileSize = file->size(); - pFileData = new byte[fileSize]; - file->read(pFileData, fileSize); - delete file; + pFileData = readSavegameThumbnail(filename, fileSize, isPNG); } else { pFileData = pPackage->getFile(filename, &fileSize); } @@ -90,18 +121,14 @@ RenderedImage::RenderedImage(const Common::String &filename, bool &result) : return; } -#ifndef USE_INTERNAL_PNG_DECODER - // Determine image properties - if (!PNGLoader::imageProperties(pFileData, fileSize, _width, _height)) { - error("Could not read image properties."); - delete[] pFileData; - return; - } -#endif - // Uncompress the image int pitch; - if (!PNGLoader::decodeImage(pFileData, fileSize, _data, _width, _height, pitch)) { + if (isPNG) + result = ImgLoader::decodePNGImage(pFileData, fileSize, _data, _width, _height, pitch); + else + result = ImgLoader::decodeThumbnailImage(pFileData, fileSize, _data, _width, _height, pitch); + + if (!result) { error("Could not decode image."); delete[] pFileData; return; @@ -112,7 +139,6 @@ RenderedImage::RenderedImage(const Common::String &filename, bool &result) : _doCleanup = true; - result = true; return; } diff --git a/engines/sword25/gfx/image/renderedimage.h b/engines/sword25/gfx/image/renderedimage.h index e3f23747da3..f92a5b39b4f 100644 --- a/engines/sword25/gfx/image/renderedimage.h +++ b/engines/sword25/gfx/image/renderedimage.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/image/swimage.cpp b/engines/sword25/gfx/image/swimage.cpp index 0f3814eb545..0b9cc11df2e 100644 --- a/engines/sword25/gfx/image/swimage.cpp +++ b/engines/sword25/gfx/image/swimage.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -33,7 +30,7 @@ */ #include "sword25/package/packagemanager.h" -#include "sword25/gfx/image/pngloader.h" +#include "sword25/gfx/image/imgloader.h" #include "sword25/gfx/image/swimage.h" namespace Sword25 { @@ -56,18 +53,10 @@ SWImage::SWImage(const Common::String &filename, bool &result) : return; } -#ifndef USE_INTERNAL_PNG_DECODER - // Determine image properties - if (!PNGLoader::imageProperties(pFileData, fileSize, _width, _height)) { - error("Could not read image properties."); - return; - } -#endif - // Uncompress the image int pitch; byte *pUncompressedData; - if (!PNGLoader::decodeImage(pFileData, fileSize, pUncompressedData, _width, _height, pitch)) { + if (!ImgLoader::decodePNGImage(pFileData, fileSize, pUncompressedData, _width, _height, pitch)) { error("Could not decode image."); return; } diff --git a/engines/sword25/gfx/image/swimage.h b/engines/sword25/gfx/image/swimage.h index a914c4f41f8..5f348958b25 100644 --- a/engines/sword25/gfx/image/swimage.h +++ b/engines/sword25/gfx/image/swimage.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/image/vectorimage.cpp b/engines/sword25/gfx/image/vectorimage.cpp index 241e80bad3e..9235ec2fcf0 100644 --- a/engines/sword25/gfx/image/vectorimage.cpp +++ b/engines/sword25/gfx/image/vectorimage.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/image/vectorimage.h b/engines/sword25/gfx/image/vectorimage.h index 79a7519dda1..959f251c143 100644 --- a/engines/sword25/gfx/image/vectorimage.h +++ b/engines/sword25/gfx/image/vectorimage.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/image/vectorimagerenderer.cpp b/engines/sword25/gfx/image/vectorimagerenderer.cpp index 99a47015fbb..97dad3346de 100644 --- a/engines/sword25/gfx/image/vectorimagerenderer.cpp +++ b/engines/sword25/gfx/image/vectorimagerenderer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/panel.cpp b/engines/sword25/gfx/panel.cpp index 955c317399d..6d5b2a623d1 100644 --- a/engines/sword25/gfx/panel.cpp +++ b/engines/sword25/gfx/panel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -50,12 +47,12 @@ Panel::Panel(RenderObjectPtr parentPtr, int width, int height, uin _height = height; if (_width < 0) { - error("Tried to initialise a panel with an invalid width (%d).", _width); + error("Tried to initialize a panel with an invalid width (%d).", _width); return; } if (_height < 0) { - error("Tried to initialise a panel with an invalid height (%d).", _height); + error("Tried to initialize a panel with an invalid height (%d).", _height); return; } diff --git a/engines/sword25/gfx/panel.h b/engines/sword25/gfx/panel.h index 6fe96369a63..cbf04ce40f7 100644 --- a/engines/sword25/gfx/panel.h +++ b/engines/sword25/gfx/panel.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/renderobject.cpp b/engines/sword25/gfx/renderobject.cpp index b044d906f36..a977eb80bad 100644 --- a/engines/sword25/gfx/renderobject.cpp +++ b/engines/sword25/gfx/renderobject.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/renderobject.h b/engines/sword25/gfx/renderobject.h index 7b7b9047f7a..0b54ccc24bd 100644 --- a/engines/sword25/gfx/renderobject.h +++ b/engines/sword25/gfx/renderobject.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/renderobjectmanager.cpp b/engines/sword25/gfx/renderobjectmanager.cpp index 1f7938f41f9..38289991eb9 100644 --- a/engines/sword25/gfx/renderobjectmanager.cpp +++ b/engines/sword25/gfx/renderobjectmanager.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/renderobjectmanager.h b/engines/sword25/gfx/renderobjectmanager.h index 8511382d6ea..9e7efd8e60c 100644 --- a/engines/sword25/gfx/renderobjectmanager.h +++ b/engines/sword25/gfx/renderobjectmanager.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/renderobjectptr.h b/engines/sword25/gfx/renderobjectptr.h index c22c6e83e7a..7b7f190a01f 100644 --- a/engines/sword25/gfx/renderobjectptr.h +++ b/engines/sword25/gfx/renderobjectptr.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/renderobjectregistry.h b/engines/sword25/gfx/renderobjectregistry.h index 988b676aa8c..92d8c9b8309 100644 --- a/engines/sword25/gfx/renderobjectregistry.h +++ b/engines/sword25/gfx/renderobjectregistry.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/rootrenderobject.h b/engines/sword25/gfx/rootrenderobject.h index e4e3fba3c87..4782fad1754 100644 --- a/engines/sword25/gfx/rootrenderobject.h +++ b/engines/sword25/gfx/rootrenderobject.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/screenshot.cpp b/engines/sword25/gfx/screenshot.cpp index 6ea2b574d65..4f9ba1d3c54 100644 --- a/engines/sword25/gfx/screenshot.cpp +++ b/engines/sword25/gfx/screenshot.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -32,90 +29,37 @@ * */ -// Disable symbol overrides so that we can use png.h -#define FORBIDDEN_SYMBOL_ALLOW_ALL - #include "common/memstream.h" #include "common/textconsole.h" #include "sword25/gfx/screenshot.h" #include "sword25/kernel/filesystemutil.h" -#include namespace Sword25 { -#include "common/pack-start.h" -struct RGB_PIXEL { - byte red; - byte green; - byte blue; -} PACKED_STRUCT; -#include "common/pack-end.h" - -void userWriteFn(png_structp png_ptr, png_bytep data, png_size_t length) { - static_cast(png_get_io_ptr(png_ptr))->write(data, length); -} - -void userFlushFn(png_structp png_ptr) { -} +#define THUMBNAIL_VERSION 1 bool Screenshot::saveToFile(Graphics::Surface *data, Common::WriteStream *stream) { - // Reserve buffer space - RGB_PIXEL *pixelBuffer = new RGB_PIXEL[data->w * data->h]; - // Convert the RGBA data to RGB const byte *pSrc = (const byte *)data->getBasePtr(0, 0); - RGB_PIXEL *pDest = pixelBuffer; + + // Write our own custom header + stream->writeUint32BE(MKTAG('S','C','R','N')); // SCRN, short for "Screenshot" + stream->writeUint16LE(data->w); + stream->writeUint16LE(data->h); + stream->writeByte(THUMBNAIL_VERSION); for (uint y = 0; y < data->h; y++) { for (uint x = 0; x < data->w; x++) { + // This is only called by createThumbnail below, which + // provides a fake 'surface' with LE data in it. uint32 srcPixel = READ_LE_UINT32(pSrc); pSrc += sizeof(uint32); - pDest->red = (srcPixel >> 16) & 0xff; - pDest->green = (srcPixel >> 8) & 0xff; - pDest->blue = srcPixel & 0xff; - ++pDest; + stream->writeByte((srcPixel >> 16) & 0xff); // R + stream->writeByte((srcPixel >> 8) & 0xff); // G + stream->writeByte(srcPixel & 0xff); // B } } - png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); - if (!png_ptr) - error("Could not create PNG write-struct."); - - png_infop info_ptr = png_create_info_struct(png_ptr); - if (!info_ptr) - error("Could not create PNG info-struct."); - - // The compression buffer must be large enough to the entire image. - // This ensures that only an IDAT chunk is created. - // When buffer size is used 110% of the raw data size to be sure. - png_set_compression_buffer_size(png_ptr, (data->w * data->h * 3 * 110) / 100); - - // Initialise PNG-Info structure - png_set_IHDR(png_ptr, info_ptr, - data->w, // Width - data->h, // Height - 8, // Bits depth - PNG_COLOR_TYPE_RGB, // Color type - PNG_INTERLACE_NONE, // No interlacing - PNG_COMPRESSION_TYPE_DEFAULT, // Compression type - PNG_FILTER_TYPE_DEFAULT); // Filter Type - - // Rowpointer erstellen - png_bytep *rowPointers = new png_bytep[data->h]; - for (uint i = 0; i < data->h; i++) { - rowPointers[i] = (png_bytep)&pixelBuffer[data->w * i]; - } - png_set_rows(png_ptr, info_ptr, &rowPointers[0]); - - // Write out the png data to the file - png_set_write_fn(png_ptr, (void *)stream, userWriteFn, userFlushFn); - png_write_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL); - - png_destroy_write_struct(&png_ptr, &info_ptr); - - delete[] pixelBuffer; - delete[] rowPointers; - return true; } @@ -148,7 +92,7 @@ Common::SeekableReadStream *Screenshot::createThumbnail(Graphics::Surface *data) for (int j = 0; j < 4; ++j) { const uint32 *srcP = (const uint32 *)data->getBasePtr(x * 4, y * 4 + j + 50); for (int i = 0; i < 4; ++i) { - uint32 pixel = READ_LE_UINT32(srcP + i); + uint32 pixel = READ_UINT32(srcP + i); alpha += (pixel >> 24); red += (pixel >> 16) & 0xff; green += (pixel >> 8) & 0xff; diff --git a/engines/sword25/gfx/screenshot.h b/engines/sword25/gfx/screenshot.h index a0f615f9e6c..e2e2dfc7f5d 100644 --- a/engines/sword25/gfx/screenshot.h +++ b/engines/sword25/gfx/screenshot.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/staticbitmap.cpp b/engines/sword25/gfx/staticbitmap.cpp index 2e8d1ba0717..60ad94e20f5 100644 --- a/engines/sword25/gfx/staticbitmap.cpp +++ b/engines/sword25/gfx/staticbitmap.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/staticbitmap.h b/engines/sword25/gfx/staticbitmap.h index b5b4c4f5a22..e66ede02b44 100644 --- a/engines/sword25/gfx/staticbitmap.h +++ b/engines/sword25/gfx/staticbitmap.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/text.cpp b/engines/sword25/gfx/text.cpp index b1c17085654..8e18d2936d7 100644 --- a/engines/sword25/gfx/text.cpp +++ b/engines/sword25/gfx/text.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/text.h b/engines/sword25/gfx/text.h index 42c1cd7c5df..a0d668014f4 100644 --- a/engines/sword25/gfx/text.h +++ b/engines/sword25/gfx/text.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/timedrenderobject.cpp b/engines/sword25/gfx/timedrenderobject.cpp index e3b4d1990c8..e35b0ae95bf 100644 --- a/engines/sword25/gfx/timedrenderobject.cpp +++ b/engines/sword25/gfx/timedrenderobject.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/timedrenderobject.h b/engines/sword25/gfx/timedrenderobject.h index 6fee19882a5..44c3b405281 100644 --- a/engines/sword25/gfx/timedrenderobject.h +++ b/engines/sword25/gfx/timedrenderobject.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/input/inputengine.cpp b/engines/sword25/input/inputengine.cpp index 769baafeed5..bb9c2c8b40a 100644 --- a/engines/sword25/input/inputengine.cpp +++ b/engines/sword25/input/inputengine.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/input/inputengine.h b/engines/sword25/input/inputengine.h index 40f801dde25..f79890a9fd0 100644 --- a/engines/sword25/input/inputengine.h +++ b/engines/sword25/input/inputengine.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -175,7 +172,7 @@ public: /// -------------------------------------------------------------- /** - * Initialises the input engine + * Initializes the input engine * @return Returns a true on success, otherwise false. */ bool init(); diff --git a/engines/sword25/input/inputengine_script.cpp b/engines/sword25/input/inputengine_script.cpp index d4f2719b629..db2619294c5 100644 --- a/engines/sword25/input/inputengine_script.cpp +++ b/engines/sword25/input/inputengine_script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/common.h b/engines/sword25/kernel/common.h index 487bfc5c787..8cfc81e981e 100644 --- a/engines/sword25/kernel/common.h +++ b/engines/sword25/kernel/common.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/filesystemutil.cpp b/engines/sword25/kernel/filesystemutil.cpp index e5ec6c15db9..281e7986df0 100644 --- a/engines/sword25/kernel/filesystemutil.cpp +++ b/engines/sword25/kernel/filesystemutil.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/filesystemutil.h b/engines/sword25/kernel/filesystemutil.h index b75454c1c80..bb100123d9e 100644 --- a/engines/sword25/kernel/filesystemutil.h +++ b/engines/sword25/kernel/filesystemutil.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/inputpersistenceblock.cpp b/engines/sword25/kernel/inputpersistenceblock.cpp index 26c924dc827..c1cd771e39b 100644 --- a/engines/sword25/kernel/inputpersistenceblock.cpp +++ b/engines/sword25/kernel/inputpersistenceblock.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/inputpersistenceblock.h b/engines/sword25/kernel/inputpersistenceblock.h index f6ab2564608..f643b06bc17 100644 --- a/engines/sword25/kernel/inputpersistenceblock.h +++ b/engines/sword25/kernel/inputpersistenceblock.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/kernel.cpp b/engines/sword25/kernel/kernel.cpp index 99fec520401..d6388eee2b4 100644 --- a/engines/sword25/kernel/kernel.cpp +++ b/engines/sword25/kernel/kernel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -57,7 +54,8 @@ Kernel::Kernel() : _input(0), _package(0), _script(0), - _fmv(0) + _fmv(0), + _rnd("sword25") { _instance = this; @@ -65,7 +63,7 @@ Kernel::Kernel() : // Create the resource manager _resourceManager = new ResourceManager(this); - // Initialise the script engine + // Initialize the script engine _script = new LuaScriptEngine(this); if (!_script || !_script->init()) { _initSuccess = false; diff --git a/engines/sword25/kernel/kernel.h b/engines/sword25/kernel/kernel.h index 3abf43d2392..adf69f92d6e 100644 --- a/engines/sword25/kernel/kernel.h +++ b/engines/sword25/kernel/kernel.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -82,7 +79,7 @@ public: uint getMilliTicks(); /** - * Specifies whether the kernel was successfully initialised + * Specifies whether the kernel was successfully initialized */ bool getInitSuccess() const { return _initSuccess; diff --git a/engines/sword25/kernel/kernel_script.cpp b/engines/sword25/kernel/kernel_script.cpp index 43a144b2c66..27a221d45f1 100644 --- a/engines/sword25/kernel/kernel_script.cpp +++ b/engines/sword25/kernel/kernel_script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/objectregistry.h b/engines/sword25/kernel/objectregistry.h index 69d961ae913..d9a7c353f7e 100644 --- a/engines/sword25/kernel/objectregistry.h +++ b/engines/sword25/kernel/objectregistry.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/outputpersistenceblock.cpp b/engines/sword25/kernel/outputpersistenceblock.cpp index a8a39cb822c..cf28ea401fb 100644 --- a/engines/sword25/kernel/outputpersistenceblock.cpp +++ b/engines/sword25/kernel/outputpersistenceblock.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/outputpersistenceblock.h b/engines/sword25/kernel/outputpersistenceblock.h index 71dbe68a522..12351d22e21 100644 --- a/engines/sword25/kernel/outputpersistenceblock.h +++ b/engines/sword25/kernel/outputpersistenceblock.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/persistable.h b/engines/sword25/kernel/persistable.h index 25cf70fda04..18072118478 100644 --- a/engines/sword25/kernel/persistable.h +++ b/engines/sword25/kernel/persistable.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/persistenceblock.h b/engines/sword25/kernel/persistenceblock.h index 4a64eff11b4..d8440faa502 100644 --- a/engines/sword25/kernel/persistenceblock.h +++ b/engines/sword25/kernel/persistenceblock.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/persistenceservice.cpp b/engines/sword25/kernel/persistenceservice.cpp index 6bb2b1b102c..17e9199b5ca 100644 --- a/engines/sword25/kernel/persistenceservice.cpp +++ b/engines/sword25/kernel/persistenceservice.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -32,11 +29,9 @@ * */ -// Disable symbol overrides so that we can use zlib.h -#define FORBIDDEN_SYMBOL_ALLOW_ALL - #include "common/fs.h" #include "common/savefile.h" +#include "common/zlib.h" #include "sword25/kernel/kernel.h" #include "sword25/kernel/persistenceservice.h" #include "sword25/kernel/inputpersistenceblock.h" @@ -47,7 +42,6 @@ #include "sword25/input/inputengine.h" #include "sword25/math/regionregistry.h" #include "sword25/script/script.h" -#include namespace Sword25 { @@ -291,34 +285,23 @@ bool PersistenceService::saveGame(uint slotID, const Common::String &screenshotF error("Unable to persist modules for savegame file \"%s\".", filename.c_str()); } - // Daten komprimieren. - uLongf compressedLength = writer.getDataSize() + (writer.getDataSize() + 500) / 1000 + 12; - Bytef *compressionBuffer = new Bytef[compressedLength]; - - if (compress2(&compressionBuffer[0], &compressedLength, reinterpret_cast(writer.getData()), writer.getDataSize(), 6) != Z_OK) { - error("Unable to compress savegame data in savegame file \"%s\".", filename.c_str()); - } - - // Lфnge der komprimierten Daten und der unkomprimierten Daten in die Datei schreiben. + // Write the save game data uncompressed, since the final saved game will be + // compressed anyway. char sBuffer[10]; - snprintf(sBuffer, 10, "%ld", compressedLength); + snprintf(sBuffer, 10, "%u", writer.getDataSize()); file->writeString(sBuffer); file->writeByte(0); snprintf(sBuffer, 10, "%u", writer.getDataSize()); file->writeString(sBuffer); file->writeByte(0); - - // Komprimierte Daten in die Datei schreiben. - file->write(reinterpret_cast(&compressionBuffer[0]), compressedLength); - if (file->err()) { - error("Unable to write game data to savegame file \"%s\".", filename.c_str()); - } + file->write(writer.getData(), writer.getDataSize()); // Get the screenshot Common::SeekableReadStream *thumbnail = Kernel::getInstance()->getGfx()->getThumbnail(); if (thumbnail) { - byte *buffer = new Byte[FILE_COPY_BUFFER_SIZE]; + byte *buffer = new byte[FILE_COPY_BUFFER_SIZE]; + thumbnail->seek(0, SEEK_SET); while (!thumbnail->eos()) { int bytesRead = thumbnail->read(&buffer[0], FILE_COPY_BUFFER_SIZE); file->write(&buffer[0], bytesRead); @@ -331,7 +314,6 @@ bool PersistenceService::saveGame(uint slotID, const Common::String &screenshotF file->finalize(); delete file; - delete[] compressionBuffer; // Savegameinformationen fќr diesen Slot aktualisieren. _impl->readSlotSavegameInformation(slotID); @@ -372,7 +354,7 @@ bool PersistenceService::loadGame(uint slotID) { #endif byte *compressedDataBuffer = new byte[curSavegameInfo.gamedataLength]; - byte *uncompressedDataBuffer = new Bytef[curSavegameInfo.gamedataUncompressedLength]; + byte *uncompressedDataBuffer = new byte[curSavegameInfo.gamedataUncompressedLength]; Common::String filename = generateSavegameFilename(slotID); file = sfm->openForLoading(filename); @@ -385,15 +367,22 @@ bool PersistenceService::loadGame(uint slotID) { return false; } - // Spieldaten dekomprimieren. - uLongf uncompressedBufferSize = curSavegameInfo.gamedataUncompressedLength; - if (uncompress(reinterpret_cast(&uncompressedDataBuffer[0]), &uncompressedBufferSize, - reinterpret_cast(&compressedDataBuffer[0]), curSavegameInfo.gamedataLength) != Z_OK) { - error("Unable to decompress the gamedata from savegame file \"%s\".", filename.c_str()); - delete[] uncompressedDataBuffer; - delete[] compressedDataBuffer; - delete file; - return false; + // Uncompress game data, if needed. + unsigned long uncompressedBufferSize = curSavegameInfo.gamedataUncompressedLength; + + if (uncompressedBufferSize > curSavegameInfo.gamedataLength) { + // Older saved game, where the game data was compressed again. + if (!Common::uncompress(reinterpret_cast(&uncompressedDataBuffer[0]), &uncompressedBufferSize, + reinterpret_cast(&compressedDataBuffer[0]), curSavegameInfo.gamedataLength)) { + error("Unable to decompress the gamedata from savegame file \"%s\".", filename.c_str()); + delete[] uncompressedDataBuffer; + delete[] compressedDataBuffer; + delete file; + return false; + } + } else { + // Newer saved game with uncompressed game data, copy it as-is. + memcpy(uncompressedDataBuffer, compressedDataBuffer, uncompressedBufferSize); } InputPersistenceBlock reader(&uncompressedDataBuffer[0], curSavegameInfo.gamedataUncompressedLength); diff --git a/engines/sword25/kernel/persistenceservice.h b/engines/sword25/kernel/persistenceservice.h index 0db109d1b01..f73962892c0 100644 --- a/engines/sword25/kernel/persistenceservice.h +++ b/engines/sword25/kernel/persistenceservice.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/resmanager.cpp b/engines/sword25/kernel/resmanager.cpp index b77d79e8ea8..cc3316250ac 100644 --- a/engines/sword25/kernel/resmanager.cpp +++ b/engines/sword25/kernel/resmanager.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/resmanager.h b/engines/sword25/kernel/resmanager.h index f8006bd62d6..6b95a45b6e7 100644 --- a/engines/sword25/kernel/resmanager.h +++ b/engines/sword25/kernel/resmanager.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/resource.cpp b/engines/sword25/kernel/resource.cpp index f16cb3aaf21..656355cc177 100644 --- a/engines/sword25/kernel/resource.cpp +++ b/engines/sword25/kernel/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/resource.h b/engines/sword25/kernel/resource.h index 5c6108a281d..7c8175c9c91 100644 --- a/engines/sword25/kernel/resource.h +++ b/engines/sword25/kernel/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/resservice.h b/engines/sword25/kernel/resservice.h index 65b2dc4b36b..69b0688e326 100644 --- a/engines/sword25/kernel/resservice.h +++ b/engines/sword25/kernel/resservice.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/service.h b/engines/sword25/kernel/service.h index ef8858bb7d0..576776bb5f0 100644 --- a/engines/sword25/kernel/service.h +++ b/engines/sword25/kernel/service.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/math/geometry.h b/engines/sword25/math/geometry.h index 60898df635e..bdbd5b2052a 100644 --- a/engines/sword25/math/geometry.h +++ b/engines/sword25/math/geometry.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/math/geometry_script.cpp b/engines/sword25/math/geometry_script.cpp index 4b5e0550fe4..70798f7692c 100644 --- a/engines/sword25/math/geometry_script.cpp +++ b/engines/sword25/math/geometry_script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/math/line.h b/engines/sword25/math/line.h index d57fce68f79..9eaa2d3c8c6 100644 --- a/engines/sword25/math/line.h +++ b/engines/sword25/math/line.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/math/polygon.cpp b/engines/sword25/math/polygon.cpp index e8385c60c87..2e7836ff77e 100644 --- a/engines/sword25/math/polygon.cpp +++ b/engines/sword25/math/polygon.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -62,7 +59,7 @@ Polygon::~Polygon() { } bool Polygon::init(int vertexCount_, const Vertex *vertices_) { - // Rember the old obstate to restore it if an error occurs whilst initialising it with the new data + // Rember the old obstate to restore it if an error occurs whilst initializing it with the new data int oldvertexCount = this->vertexCount; Vertex *oldvertices = this->vertices; diff --git a/engines/sword25/math/polygon.h b/engines/sword25/math/polygon.h index 4bb28f827ab..ffdbf14f6bf 100644 --- a/engines/sword25/math/polygon.h +++ b/engines/sword25/math/polygon.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -81,15 +78,15 @@ public: virtual ~Polygon(); /** - * Initialises the BS_Polygon with a list of Vertecies. + * Initializes the BS_Polygon with a list of Vertecies. * * The Vertices need to define a polygon must not have self-intersections. - * If a polygon already has verticies, this will re-initialise it with the new list. + * If a polygon already has verticies, this will re-initialize it with the new list. * * @param VertexCount The number of vertices being passed * @param Vertecies An array of BS_Vertex objects representing the vertices in the polygon. * @return Returns false if the Vertecies have self-intersections. In this case, - * the object is not initialised. + * the object is not initialized. */ bool init(int vertexCount_, const Vertex *vertices_); diff --git a/engines/sword25/math/region.cpp b/engines/sword25/math/region.cpp index 5d08b0c14e0..7681ef6d9f3 100644 --- a/engines/sword25/math/region.cpp +++ b/engines/sword25/math/region.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -118,7 +115,7 @@ bool Region::init(const Polygon &contour, const Common::Array *pHoles) } - // Initialise bounding box + // Initialize bounding box updateBoundingBox(); _valid = true; diff --git a/engines/sword25/math/region.h b/engines/sword25/math/region.h index fa65b4b7ade..0fd72236313 100644 --- a/engines/sword25/math/region.h +++ b/engines/sword25/math/region.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -76,12 +73,12 @@ public: virtual ~Region(); /** - * Initialises a BS_Region object + * Initializes a BS_Region object * @param Contour A polygon indicating the outline of the region * @param pHoles A pointer to an array of polygons representing the hole state in the region. * If the region has no holes, it must be passed as NULL. The default value is NULL. * @return Returns true if the initialisation was successful, otherwise false. - * @remark If the region was already initialised, the old state will be deleted. + * @remark If the region was already initialized, the old state will be deleted. */ virtual bool init(const Polygon &contour, const Common::Array *pHoles = NULL); diff --git a/engines/sword25/math/regionregistry.cpp b/engines/sword25/math/regionregistry.cpp index 978a1807f71..dff85602050 100644 --- a/engines/sword25/math/regionregistry.cpp +++ b/engines/sword25/math/regionregistry.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/math/regionregistry.h b/engines/sword25/math/regionregistry.h index db3e021e250..9e0a28bea76 100644 --- a/engines/sword25/math/regionregistry.h +++ b/engines/sword25/math/regionregistry.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/math/vertex.cpp b/engines/sword25/math/vertex.cpp index 3746ec94106..b486d35e7ec 100644 --- a/engines/sword25/math/vertex.cpp +++ b/engines/sword25/math/vertex.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/math/vertex.h b/engines/sword25/math/vertex.h index 0e6d14502cf..4cb0eaca300 100644 --- a/engines/sword25/math/vertex.h +++ b/engines/sword25/math/vertex.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -46,7 +43,8 @@ #include #include "common/rect.h" #include "sword25/kernel/common.h" -#include "sword25/util/lua/lua.h" + +struct lua_State; #if defined(MACOSX) || defined(SOLARIS) || defined(__MINGW32__) #define sqrtf(x) ((float)sqrt(x)) diff --git a/engines/sword25/math/walkregion.cpp b/engines/sword25/math/walkregion.cpp index 8306553f7b2..bace4d54bc8 100644 --- a/engines/sword25/math/walkregion.cpp +++ b/engines/sword25/math/walkregion.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -104,7 +101,7 @@ static void initDijkstraNodes(DijkstraNode::Container &dijkstraNodes, const Regi // Allocate sufficient space in the array dijkstraNodes.resize(nodes.size()); - // Initialise all the nodes which are visible from the starting node + // Initialize all the nodes which are visible from the starting node DijkstraNode::Iter dijkstraIter = dijkstraNodes.begin(); for (Common::Array::const_iterator nodesIter = nodes.begin(); nodesIter != nodes.end(); nodesIter++, dijkstraIter++) { @@ -176,7 +173,7 @@ void reverseArray(Common::Array &arr) { bool WalkRegion::findPath(const Vertex &start, const Vertex &end, BS_Path &path) const { // This is an implementation of Dijkstra's algorithm - // Initialise edge node list + // Initialize edge node list DijkstraNode::Container dijkstraNodes; initDijkstraNodes(dijkstraNodes, *this, start, _nodes); @@ -250,7 +247,7 @@ void WalkRegion::initNodeVector() { } void WalkRegion::computeVisibilityMatrix() { - // Initialise visibility matrix + // Initialize visibility matrix _visibilityMatrix = Common::Array< Common::Array >(); for (uint idx = 0; idx < _nodes.size(); ++idx) { Common::Array arr; diff --git a/engines/sword25/math/walkregion.h b/engines/sword25/math/walkregion.h index e8bf40beccf..7dded1980b5 100644 --- a/engines/sword25/math/walkregion.h +++ b/engines/sword25/math/walkregion.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/module.mk b/engines/sword25/module.mk index da91c848b58..302120c5005 100644 --- a/engines/sword25/module.mk +++ b/engines/sword25/module.mk @@ -24,7 +24,7 @@ MODULE_OBJS := \ gfx/text.o \ gfx/timedrenderobject.o \ gfx/image/art.o \ - gfx/image/pngloader.o \ + gfx/image/imgloader.o \ gfx/image/renderedimage.o \ gfx/image/swimage.o \ gfx/image/vectorimage.o \ @@ -60,7 +60,6 @@ MODULE_OBJS := \ util/lua/ldblib.o \ util/lua/ldebug.o \ util/lua/ldo.o \ - util/lua/ldump.o \ util/lua/lfunc.o \ util/lua/lgc.o \ util/lua/linit.o \ @@ -79,10 +78,9 @@ MODULE_OBJS := \ util/lua/ltable.o \ util/lua/ltablib.o \ util/lua/ltm.o \ - util/lua/lundump.o \ util/lua/lvm.o \ util/lua/lzio.o \ - util/lua/print.o \ + util/lua/scummvm_file.o \ util/pluto/pdep.o \ util/pluto/pluto.o \ util/pluto/plzio.o diff --git a/engines/sword25/package/packagemanager.cpp b/engines/sword25/package/packagemanager.cpp index 7a64fe2e295..5c869203c6d 100644 --- a/engines/sword25/package/packagemanager.cpp +++ b/engines/sword25/package/packagemanager.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/package/packagemanager.h b/engines/sword25/package/packagemanager.h index 3a976b32fa8..3c4c4e89c57 100644 --- a/engines/sword25/package/packagemanager.h +++ b/engines/sword25/package/packagemanager.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/package/packagemanager_script.cpp b/engines/sword25/package/packagemanager_script.cpp index eab66f7531d..229ec37459e 100644 --- a/engines/sword25/package/packagemanager_script.cpp +++ b/engines/sword25/package/packagemanager_script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/script/lua_extensions.cpp b/engines/sword25/script/lua_extensions.cpp index 5ba38afc369..bf502d719ee 100644 --- a/engines/sword25/script/lua_extensions.cpp +++ b/engines/sword25/script/lua_extensions.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/script/luabindhelper.cpp b/engines/sword25/script/luabindhelper.cpp index 03a1802a040..8fbbe7e2723 100644 --- a/engines/sword25/script/luabindhelper.cpp +++ b/engines/sword25/script/luabindhelper.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/script/luabindhelper.h b/engines/sword25/script/luabindhelper.h index 94f52743f34..0cb6d37bdcc 100644 --- a/engines/sword25/script/luabindhelper.h +++ b/engines/sword25/script/luabindhelper.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/script/luacallback.cpp b/engines/sword25/script/luacallback.cpp index 809676796e6..cee0531b8af 100644 --- a/engines/sword25/script/luacallback.cpp +++ b/engines/sword25/script/luacallback.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/script/luacallback.h b/engines/sword25/script/luacallback.h index e097f5b499b..796af8598b8 100644 --- a/engines/sword25/script/luacallback.h +++ b/engines/sword25/script/luacallback.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/script/luascript.cpp b/engines/sword25/script/luascript.cpp index cce01d58c76..9d394309e67 100644 --- a/engines/sword25/script/luascript.cpp +++ b/engines/sword25/script/luascript.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -115,7 +112,7 @@ bool LuaScriptEngine::init() { // Place the error handler function in the Lua registry, and remember the index _pcallErrorhandlerRegistryIndex = luaL_ref(_state, LUA_REGISTRYINDEX); - // Initialise the Pluto-Persistence library + // Initialize the Pluto-Persistence library luaopen_pluto(_state); lua_pop(_state, 1); @@ -180,7 +177,7 @@ bool LuaScriptEngine::executeFile(const Common::String &fileName) { } bool LuaScriptEngine::executeString(const Common::String &code) { - return executeBuffer((byte *)code.c_str(), code.size(), "???"); + return executeBuffer((const byte *)code.c_str(), code.size(), "???"); } namespace { diff --git a/engines/sword25/script/luascript.h b/engines/sword25/script/luascript.h index b66c32176a8..1a4a38c3bec 100644 --- a/engines/sword25/script/luascript.h +++ b/engines/sword25/script/luascript.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -39,7 +36,8 @@ #include "common/str-array.h" #include "sword25/kernel/common.h" #include "sword25/script/script.h" -#include "sword25/util/lua/lua.h" + +struct lua_State; namespace Sword25 { @@ -51,7 +49,7 @@ public: virtual ~LuaScriptEngine(); /** - * Initialises the scripting engine + * Initializes the scripting engine * @return Returns true if successful, otherwise false. */ virtual bool init(); diff --git a/engines/sword25/script/script.h b/engines/sword25/script/script.h index 9ca146026e0..04f248fe7ec 100644 --- a/engines/sword25/script/script.h +++ b/engines/sword25/script/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -57,7 +54,7 @@ public: // ----------------------------------------------------------------------------- /** - * Initialises the scrip tengine. Returns true if successful, false otherwise. + * Initializes the scrip tengine. Returns true if successful, false otherwise. */ virtual bool init() = 0; diff --git a/engines/sword25/sfx/soundengine.cpp b/engines/sword25/sfx/soundengine.cpp index 08f0f5b4ae5..20622b20980 100644 --- a/engines/sword25/sfx/soundengine.cpp +++ b/engines/sword25/sfx/soundengine.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -154,13 +151,17 @@ bool SoundEngine::playSound(const Common::String &fileName, SOUND_TYPES type, fl uint SoundEngine::playSoundEx(const Common::String &fileName, SOUND_TYPES type, float volume, float pan, bool loop, int loopStart, int loopEnd, uint layer) { Common::SeekableReadStream *in = Kernel::getInstance()->getPackage()->getStream(fileName); +#ifdef USE_VORBIS Audio::SeekableAudioStream *stream = Audio::makeVorbisStream(in, DisposeAfterUse::YES); +#endif uint id; SndHandle *handle = getHandle(&id); debugC(1, kDebugSound, "SoundEngine::playSoundEx(%s, %d, %f, %f, %d, %d, %d, %d)", fileName.c_str(), type, volume, pan, loop, loopStart, loopEnd, layer); +#ifdef USE_VORBIS _mixer->playStream(getType(type), &(handle->handle), stream, -1, (byte)(volume * 255), (int8)(pan * 127)); +#endif return id; } diff --git a/engines/sword25/sfx/soundengine.h b/engines/sword25/sfx/soundengine.h index 576582b478d..4dbd475846f 100644 --- a/engines/sword25/sfx/soundengine.h +++ b/engines/sword25/sfx/soundengine.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -91,7 +88,7 @@ public: ~SoundEngine() {} /** - * Initialises the sound engine + * Initializes the sound engine * @param SampleRate Specifies the sample rate to use. * @param Channels The maximum number of channels. The default is 32. * @return Returns true on success, otherwise false. diff --git a/engines/sword25/sfx/soundengine_script.cpp b/engines/sword25/sfx/soundengine_script.cpp index d347cf5eb4e..d7771967a33 100644 --- a/engines/sword25/sfx/soundengine_script.cpp +++ b/engines/sword25/sfx/soundengine_script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/sword25.cpp b/engines/sword25/sword25.cpp index 38c1c891090..b111746c32a 100644 --- a/engines/sword25/sword25.cpp +++ b/engines/sword25/sword25.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -97,7 +94,7 @@ Common::Error Sword25Engine::run() { } Common::Error Sword25Engine::appStart() { - // Initialise the graphics mode to ARGB8888 + // Initialize the graphics mode to ARGB8888 Graphics::PixelFormat format = Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24); initGraphics(800, 600, true, &format); if (format != g_system->getScreenFormat()) @@ -145,7 +142,7 @@ bool Sword25Engine::appMain() { } bool Sword25Engine::appEnd() { - // The kernel is shutdown, and un-initialises all subsystems + // The kernel is shutdown, and un-initializes all subsystems Kernel::deleteInstance(); AnimationTemplateRegistry::destroy(); diff --git a/engines/sword25/sword25.h b/engines/sword25/sword25.h index 5bd27b311fa..5d11aa69e54 100644 --- a/engines/sword25/sword25.h +++ b/engines/sword25/sword25.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD25_H diff --git a/engines/sword25/util/lua/lapi.cpp b/engines/sword25/util/lua/lapi.cpp index b1118db3683..16f8460e39e 100644 --- a/engines/sword25/util/lua/lapi.cpp +++ b/engines/sword25/util/lua/lapi.cpp @@ -26,9 +26,8 @@ #include "lstring.h" #include "ltable.h" #include "ltm.h" -#include "lundump.h" #include "lvm.h" - +#include "common/textconsole.h" const char lua_ident[] = @@ -876,17 +875,8 @@ LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data, LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data) { - int status; - TValue *o; - lua_lock(L); - api_checknelems(L, 1); - o = L->top - 1; - if (isLfunction(o)) - status = luaU_dump(L, clvalue(o)->l.p, writer, data, 0); - else - status = 1; - lua_unlock(L); - return status; + error("lua_dump not supported: Handling of precompiled LUA scripts has been removed in ScummVM"); + return 1; // error } diff --git a/engines/sword25/util/lua/lauxlib.cpp b/engines/sword25/util/lua/lauxlib.cpp index 53c05566255..8978cd5613e 100644 --- a/engines/sword25/util/lua/lauxlib.cpp +++ b/engines/sword25/util/lua/lauxlib.cpp @@ -6,7 +6,6 @@ #include -#include #include #include #include @@ -23,7 +22,8 @@ #include "lua.h" #include "lauxlib.h" - +#include "scummvm_file.h" +#include "common/textconsole.h" #define FREELIST_REF 0 /* free list of references */ @@ -521,7 +521,7 @@ LUALIB_API void luaL_unref (lua_State *L, int t, int ref) { typedef struct LoadF { int extraline; - FILE *f; + Sword25::Sword25FileProxy *f; char buff[LUAL_BUFFERSIZE]; } LoadF; @@ -534,27 +534,31 @@ static const char *getF (lua_State *L, void *ud, size_t *size) { *size = 1; return "\n"; } - if (feof(lf->f)) return NULL; - *size = fread(lf->buff, 1, sizeof(lf->buff), lf->f); + if (lf->f->eof()) return NULL; + *size = lf->f->read(lf->buff, 1, sizeof(lf->buff)); return (*size > 0) ? lf->buff : NULL; } static int errfile (lua_State *L, const char *what, int fnameindex) { - const char *serr = strerror(errno); - const char *filename = lua_tostring(L, fnameindex) + 1; - lua_pushfstring(L, "cannot %s %s: %s", what, filename, serr); - lua_remove(L, fnameindex); - return LUA_ERRFILE; + const char *serr = "General error"; + const char *filename = lua_tostring(L, fnameindex) + 1; + lua_pushfstring(L, "cannot %s %s: %s", what, filename, serr); + lua_remove(L, fnameindex); + return LUA_ERRFILE; } LUALIB_API int luaL_loadfile (lua_State *L, const char *filename) { LoadF lf; int status, readstatus; - int c; +// int c; int fnameindex = lua_gettop(L) + 1; /* index of filename on the stack */ lf.extraline = 0; + + lua_pushfstring(L, "@%s", filename); + lf.f = new Sword25::Sword25FileProxy(filename, "r"); +/* if (filename == NULL) { lua_pushliteral(L, "=stdin"); lf.f = stdin; @@ -564,23 +568,25 @@ LUALIB_API int luaL_loadfile (lua_State *L, const char *filename) { lf.f = fopen(filename, "r"); if (lf.f == NULL) return errfile(L, "open", fnameindex); } - c = getc(lf.f); - if (c == '#') { /* Unix exec. file? */ + + c = lf.f->getc(); + if (c == '#') { // Unix exec. file? lf.extraline = 1; - while ((c = getc(lf.f)) != EOF && c != '\n') ; /* skip first line */ - if (c == '\n') c = getc(lf.f); + while ((c = lf.f->getc()) != EOF && c != '\n') ; // skip first line + if (c == '\n') c = lf.f->getc(); } - if (c == LUA_SIGNATURE[0] && filename) { /* binary file? */ - lf.f = freopen(filename, "rb", lf.f); /* reopen in binary mode */ + if (c == LUA_SIGNATURE[0] && filename) { // binary file? + lf.f = freopen(filename, "rb", lf.f); // reopen in binary mode if (lf.f == NULL) return errfile(L, "reopen", fnameindex); - /* skip eventual `#!...' */ - while ((c = getc(lf.f)) != EOF && c != LUA_SIGNATURE[0]) ; + // skip eventual `#!...' + while ((c = lf.f->getc()) != EOF && c != LUA_SIGNATURE[0]) ; lf.extraline = 0; } ungetc(c, lf.f); +*/ status = lua_load(L, getF, &lf, lua_tostring(L, -1)); - readstatus = ferror(lf.f); - if (filename) fclose(lf.f); /* close file (even in case of errors) */ + readstatus = 0; //ferror(lf.f); + if (filename) delete lf.f; // close file (even in case of errors) if (readstatus) { lua_settop(L, fnameindex); /* ignore results from `lua_load' */ return errfile(L, "read", fnameindex); @@ -638,7 +644,7 @@ static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { static int panic (lua_State *L) { (void)L; /* to avoid warnings */ - fprintf(stderr, "PANIC: unprotected error in call to Lua API (%s)\n", + warning("PANIC: unprotected error in call to Lua API (%s)\n", lua_tostring(L, -1)); return 0; } diff --git a/engines/sword25/util/lua/ldo.cpp b/engines/sword25/util/lua/ldo.cpp index 07508fbb141..bbcdf98b3d7 100644 --- a/engines/sword25/util/lua/ldo.cpp +++ b/engines/sword25/util/lua/ldo.cpp @@ -5,6 +5,16 @@ */ +// FIXME: LUAI_THROW and LUAI_TRY use either throw/catch or setjmp/longjmp. +// Neither of these is supported in ScummVM. So we need to come up +// with a replacement. The most simple, direct and crude approach: +// Replace "throw" with an "error()" call. Of course we only +// would want to do that if this actually never happens... +#define FORBIDDEN_SYMBOL_EXCEPTION_setjmp +#define FORBIDDEN_SYMBOL_EXCEPTION_longjmp + +#include "common/textconsole.h" + #include #include #include @@ -26,10 +36,9 @@ #include "lstring.h" #include "ltable.h" #include "ltm.h" -#include "lundump.h" #include "lvm.h" #include "lzio.h" - +#include "common/textconsole.h" @@ -94,6 +103,11 @@ static void resetstack (lua_State *L, int status) { void luaD_throw (lua_State *L, int errcode) { if (L->errorJmp) { L->errorJmp->status = errcode; + // FIXME: LUAI_THROW and LUAI_TRY use either throw/catch or setjmp/longjmp. + // Neither of these is supported in ScummVM. So we need to come up + // with a replacement. The most simple, direct and crude approach: + // Replace "throw" with an "error()" call. Of course we only + // would want to do that if this actually never happens... LUAI_THROW(L, L->errorJmp); } else { @@ -103,7 +117,7 @@ void luaD_throw (lua_State *L, int errcode) { lua_unlock(L); G(L)->panic(L); } - exit(EXIT_FAILURE); + error("luaD_throw failure"); } } @@ -113,6 +127,11 @@ int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) { lj.status = 0; lj.previous = L->errorJmp; /* chain new error handler */ L->errorJmp = &lj; + // FIXME: LUAI_THROW and LUAI_TRY use either throw/catch or setjmp/longjmp. + // Neither of these is supported in ScummVM. So we need to come up + // with a replacement. The most simple, direct and crude approach: + // Replace "throw" with an "error()" call. Of course we only + // would want to do that if this actually never happens... LUAI_TRY(L, &lj, (*f)(L, ud); ); @@ -494,8 +513,9 @@ static void f_parser (lua_State *L, void *ud) { struct SParser *p = cast(struct SParser *, ud); int c = luaZ_lookahead(p->z); luaC_checkGC(L); - tf = ((c == LUA_SIGNATURE[0]) ? luaU_undump : luaY_parser)(L, p->z, - &p->buff, p->name); + if (c == LUA_SIGNATURE[0]) + error("Handling of precompiled LUA scripts has been removed in ScummVM"); + tf = luaY_parser(L, p->z, &p->buff, p->name); cl = luaF_newLclosure(L, tf->nups, hvalue(gt(L))); cl->l.p = tf; for (i = 0; i < tf->nups; i++) /* initialize eventual upvalues */ diff --git a/engines/sword25/util/lua/ldump.cpp b/engines/sword25/util/lua/ldump.cpp deleted file mode 100644 index 3ce16542d63..00000000000 --- a/engines/sword25/util/lua/ldump.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/* -** $Id$ -** save precompiled Lua chunks -** See Copyright Notice in lua.h -*/ - -#include - -#define ldump_c -#define LUA_CORE - -#include "lua.h" - -#include "lobject.h" -#include "lstate.h" -#include "lundump.h" - -typedef struct { - lua_State* L; - lua_Writer writer; - void* data; - int strip; - int status; -} DumpState; - -#define DumpMem(b,n,size,D) DumpBlock(b,(n)*(size),D) -#define DumpVar(x,D) DumpMem(&x,1,sizeof(x),D) - -static void DumpBlock(const void* b, size_t size, DumpState* D) -{ - if (D->status==0) - { - lua_unlock(D->L); - D->status=(*D->writer)(D->L,b,size,D->data); - lua_lock(D->L); - } -} - -static void DumpChar(int y, DumpState* D) -{ - char x=(char)y; - DumpVar(x,D); -} - -static void DumpInt(int x, DumpState* D) -{ - DumpVar(x,D); -} - -static void DumpNumber(lua_Number x, DumpState* D) -{ - DumpVar(x,D); -} - -static void DumpVector(const void* b, int n, size_t size, DumpState* D) -{ - DumpInt(n,D); - DumpMem(b,n,size,D); -} - -static void DumpString(const TString* s, DumpState* D) -{ - if (s==NULL || getstr(s)==NULL) - { - size_t size=0; - DumpVar(size,D); - } - else - { - size_t size=s->tsv.len+1; /* include trailing '\0' */ - DumpVar(size,D); - DumpBlock(getstr(s),size,D); - } -} - -#define DumpCode(f,D) DumpVector(f->code,f->sizecode,sizeof(Instruction),D) - -static void DumpFunction(const Proto* f, const TString* p, DumpState* D); - -static void DumpConstants(const Proto* f, DumpState* D) -{ - int i,n=f->sizek; - DumpInt(n,D); - for (i=0; ik[i]; - DumpChar(ttype(o),D); - switch (ttype(o)) - { - case LUA_TNIL: - break; - case LUA_TBOOLEAN: - DumpChar(bvalue(o),D); - break; - case LUA_TNUMBER: - DumpNumber(nvalue(o),D); - break; - case LUA_TSTRING: - DumpString(rawtsvalue(o),D); - break; - default: - lua_assert(0); /* cannot happen */ - break; - } - } - n=f->sizep; - DumpInt(n,D); - for (i=0; ip[i],f->source,D); -} - -static void DumpDebug(const Proto* f, DumpState* D) -{ - int i,n; - n= (D->strip) ? 0 : f->sizelineinfo; - DumpVector(f->lineinfo,n,sizeof(int),D); - n= (D->strip) ? 0 : f->sizelocvars; - DumpInt(n,D); - for (i=0; ilocvars[i].varname,D); - DumpInt(f->locvars[i].startpc,D); - DumpInt(f->locvars[i].endpc,D); - } - n= (D->strip) ? 0 : f->sizeupvalues; - DumpInt(n,D); - for (i=0; iupvalues[i],D); -} - -static void DumpFunction(const Proto* f, const TString* p, DumpState* D) -{ - DumpString((f->source==p || D->strip) ? NULL : f->source,D); - DumpInt(f->linedefined,D); - DumpInt(f->lastlinedefined,D); - DumpChar(f->nups,D); - DumpChar(f->numparams,D); - DumpChar(f->is_vararg,D); - DumpChar(f->maxstacksize,D); - DumpCode(f,D); - DumpConstants(f,D); - DumpDebug(f,D); -} - -static void DumpHeader(DumpState* D) -{ - char h[LUAC_HEADERSIZE]; - luaU_header(h); - DumpBlock(h,LUAC_HEADERSIZE,D); -} - -/* -** dump Lua function as precompiled chunk -*/ -int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip) -{ - DumpState D; - D.L=L; - D.writer=w; - D.data=data; - D.strip=strip; - D.status=0; - DumpHeader(&D); - DumpFunction(f,NULL,&D); - return D.status; -} diff --git a/engines/sword25/util/lua/liolib.cpp b/engines/sword25/util/lua/liolib.cpp index aa44dcafa38..b505d1e4df0 100644 --- a/engines/sword25/util/lua/liolib.cpp +++ b/engines/sword25/util/lua/liolib.cpp @@ -5,7 +5,6 @@ */ -#include #include #include #include @@ -17,7 +16,8 @@ #include "lauxlib.h" #include "lualib.h" - +#include "common/textconsole.h" +#include "scummvm_file.h" #define IO_INPUT 1 @@ -28,7 +28,7 @@ static const char *const fnames[] = {"input", "output"}; static int pushresult (lua_State *L, int i, const char *filename) { - int en = errno; /* calls to Lua API may change this value */ + int en = 0; /*errno;*/ // Currently hardcoded for ScumMVM, this may need to be changed if (i) { lua_pushboolean(L, 1); return 1; @@ -36,55 +36,56 @@ static int pushresult (lua_State *L, int i, const char *filename) { else { lua_pushnil(L); if (filename) - lua_pushfstring(L, "%s: %s", filename, strerror(en)); + lua_pushfstring(L, "%s: %s", filename, "General error" /*strerror(en)*/); else - lua_pushfstring(L, "%s", strerror(en)); + lua_pushfstring(L, "%s", "General error" /*strerror(en)*/); lua_pushinteger(L, en); return 3; } } - +/* static void fileerror (lua_State *L, int arg, const char *filename) { - lua_pushfstring(L, "%s: %s", filename, strerror(errno)); + lua_pushfstring(L, "%s: %s", filename, "LUA I/O error descriptions have been removed in ScummVM"); luaL_argerror(L, arg, lua_tostring(L, -1)); } - +*/ #define tofilep(L) ((FILE **)luaL_checkudata(L, 1, LUA_FILEHANDLE)) - +#define tofileProxy(L) ((Sword25::Sword25FileProxy **)luaL_checkudata(L, 1, LUA_FILEHANDLE)) static int io_type (lua_State *L) { + return luaL_error(L, "%s", "LUA I/O has been removed in ScummVM"); +/* void *ud; luaL_checkany(L, 1); ud = lua_touserdata(L, 1); lua_getfield(L, LUA_REGISTRYINDEX, LUA_FILEHANDLE); if (ud == NULL || !lua_getmetatable(L, 1) || !lua_rawequal(L, -2, -1)) - lua_pushnil(L); /* not a file */ + lua_pushnil(L); // not a file else if (*((FILE **)ud) == NULL) lua_pushliteral(L, "closed file"); else lua_pushliteral(L, "file"); return 1; +*/ } - -static FILE *tofile (lua_State *L) { - FILE **f = tofilep(L); +static Sword25::Sword25FileProxy *tofile (lua_State *L) { + Sword25::Sword25FileProxy **f = tofileProxy(L); if (*f == NULL) luaL_error(L, "attempt to use a closed file"); return *f; } - /* ** When creating file handles, always creates a `closed' file handle ** before opening the actual file; so, if there is a memory error, the ** file is not left opened. */ -static FILE **newfile (lua_State *L) { - FILE **pf = (FILE **)lua_newuserdata(L, sizeof(FILE *)); +static Sword25::Sword25FileProxy **newfile (lua_State *L) { + Sword25::Sword25FileProxy **pf = (Sword25::Sword25FileProxy **)lua_newuserdata(L, sizeof(Sword25::Sword25FileProxy *)); *pf = NULL; /* file handle is currently `closed' */ luaL_getmetatable(L, LUA_FILEHANDLE); lua_setmetatable(L, -2); @@ -106,10 +107,13 @@ static int io_noclose (lua_State *L) { ** function to close 'popen' files */ static int io_pclose (lua_State *L) { + error("LUA I/O has been removed in ScummVM"); +/* FILE **p = tofilep(L); int ok = lua_pclose(L, *p); *p = NULL; return pushresult(L, ok, NULL); + */ } @@ -117,52 +121,63 @@ static int io_pclose (lua_State *L) { ** function to close regular files */ static int io_fclose (lua_State *L) { + error("LUA I/O has been removed in ScummVM"); + /* FILE **p = tofilep(L); int ok = (fclose(*p) == 0); *p = NULL; return pushresult(L, ok, NULL); + */ } - +/* static int aux_close (lua_State *L) { lua_getfenv(L, 1); lua_getfield(L, -1, "__close"); return (lua_tocfunction(L, -1))(L); } - +*/ static int io_close (lua_State *L) { if (lua_isnone(L, 1)) lua_rawgeti(L, LUA_ENVIRONINDEX, IO_OUTPUT); - tofile(L); /* make sure argument is a file */ - return aux_close(L); + + Sword25::Sword25FileProxy **f = tofileProxy(L); + delete *f; + *f = NULL; + + return 0; } static int io_gc (lua_State *L) { - FILE *f = *tofilep(L); - /* ignore closed files */ - if (f != NULL) - aux_close(L); + Sword25::Sword25FileProxy **f = tofileProxy(L); + // ignore closed files + if (*f != NULL) + delete *f; + return 0; } static int io_tostring (lua_State *L) { + error("LUA I/O has been removed in ScummVM"); + /* FILE *f = *tofilep(L); if (f == NULL) lua_pushliteral(L, "file (closed)"); else lua_pushfstring(L, "file (%p)", f); return 1; + */ } static int io_open (lua_State *L) { const char *filename = luaL_checkstring(L, 1); const char *mode = luaL_optstring(L, 2, "r"); - FILE **pf = newfile(L); - *pf = fopen(filename, mode); + Sword25::Sword25FileProxy **pf = newfile(L); + *pf = new Sword25::Sword25FileProxy(filename, mode); return (*pf == NULL) ? pushresult(L, 0, filename) : 1; } @@ -172,21 +187,22 @@ static int io_open (lua_State *L) { ** correct __close for 'popen' files */ static int io_popen (lua_State *L) { + error("LUA I/O has been removed in ScummVM"); +/* const char *filename = luaL_checkstring(L, 1); const char *mode = luaL_optstring(L, 2, "r"); FILE **pf = newfile(L); *pf = lua_popen(L, filename, mode); return (*pf == NULL) ? pushresult(L, 0, filename) : 1; + */ } static int io_tmpfile (lua_State *L) { - FILE **pf = newfile(L); - *pf = tmpfile(); - return (*pf == NULL) ? pushresult(L, 0, NULL) : 1; + return luaL_error(L, "%s", "LUA I/O error descriptions have been removed in ScummVM"); } - +/* static FILE *getiofile (lua_State *L, int findex) { FILE *f; lua_rawgeti(L, LUA_ENVIRONINDEX, findex); @@ -195,8 +211,8 @@ static FILE *getiofile (lua_State *L, int findex) { luaL_error(L, "standard %s file is closed", fnames[findex - 1]); return f; } - - +*/ +/* static int g_iofile (lua_State *L, int f, const char *mode) { if (!lua_isnoneornil(L, 1)) { const char *filename = lua_tostring(L, 1); @@ -207,24 +223,26 @@ static int g_iofile (lua_State *L, int f, const char *mode) { fileerror(L, 1, filename); } else { - tofile(L); /* check that it's a valid file handle */ + tofile(L); // check that it's a valid file handle lua_pushvalue(L, 1); } lua_rawseti(L, LUA_ENVIRONINDEX, f); } - /* return current value */ + // return current value lua_rawgeti(L, LUA_ENVIRONINDEX, f); return 1; } - +*/ static int io_input (lua_State *L) { - return g_iofile(L, IO_INPUT, "r"); + error("LUA I/O has been removed in ScummVM"); +// return g_iofile(L, IO_INPUT, "r"); } static int io_output (lua_State *L) { - return g_iofile(L, IO_OUTPUT, "w"); + error("LUA I/O has been removed in ScummVM"); +// return g_iofile(L, IO_OUTPUT, "w"); } @@ -246,8 +264,10 @@ static int f_lines (lua_State *L) { static int io_lines (lua_State *L) { - if (lua_isnoneornil(L, 1)) { /* no arguments? */ - /* will iterate over default input */ + error("LUA I/O has been removed in ScummVM"); +/* + if (lua_isnoneornil(L, 1)) { // no arguments? + // will iterate over default input lua_rawgeti(L, LUA_ENVIRONINDEX, IO_INPUT); return f_lines(L); } @@ -260,6 +280,7 @@ static int io_lines (lua_State *L) { aux_lines(L, lua_gettop(L), 1); return 1; } + */ } @@ -269,18 +290,18 @@ static int io_lines (lua_State *L) { ** ======================================================= */ - -static int read_number (lua_State *L, FILE *f) { +/* +static int read_number (lua_State *L, Sword25::Sword25FileProxy *f) { lua_Number d; if (fscanf(f, LUA_NUMBER_SCAN, &d) == 1) { lua_pushnumber(L, d); return 1; } - else return 0; /* read fails */ + else return 0; // read fails } -static int test_eof (lua_State *L, FILE *f) { +static int test_eof (lua_State *L, Sword25::Sword25FileProxy *f) { int c = getc(f); ungetc(c, f); lua_pushlstring(L, NULL, 0); @@ -288,56 +309,56 @@ static int test_eof (lua_State *L, FILE *f) { } -static int read_line (lua_State *L, FILE *f) { +static int read_line (lua_State *L, Sword25::Sword25FileProxy *f) { luaL_Buffer b; luaL_buffinit(L, &b); for (;;) { size_t l; char *p = luaL_prepbuffer(&b); - if (fgets(p, LUAL_BUFFERSIZE, f) == NULL) { /* eof? */ - luaL_pushresult(&b); /* close buffer */ - return (lua_objlen(L, -1) > 0); /* check whether read something */ + if (fgets(p, LUAL_BUFFERSIZE, f) == NULL) { // eof? + luaL_pushresult(&b); // close buffer + return (lua_objlen(L, -1) > 0); // check whether read something } l = strlen(p); if (l == 0 || p[l-1] != '\n') luaL_addsize(&b, l); else { - luaL_addsize(&b, l - 1); /* do not include `eol' */ - luaL_pushresult(&b); /* close buffer */ - return 1; /* read at least an `eol' */ + luaL_addsize(&b, l - 1); // do not include `eol' + luaL_pushresult(&b); // close buffer + return 1; // read at least an `eol' } } } -static int read_chars (lua_State *L, FILE *f, size_t n) { - size_t rlen; /* how much to read */ - size_t nr; /* number of chars actually read */ +static int read_chars (lua_State *L, Sword25::Sword25FileProxy *f, size_t n) { + size_t rlen; // how much to read + size_t nr; // number of chars actually read luaL_Buffer b; luaL_buffinit(L, &b); - rlen = LUAL_BUFFERSIZE; /* try to read that much each time */ + rlen = LUAL_BUFFERSIZE; // try to read that much each time do { char *p = luaL_prepbuffer(&b); - if (rlen > n) rlen = n; /* cannot read more than asked */ + if (rlen > n) rlen = n; // cannot read more than asked nr = fread(p, sizeof(char), rlen, f); luaL_addsize(&b, nr); - n -= nr; /* still have to read `n' chars */ - } while (n > 0 && nr == rlen); /* until end of count or eof */ - luaL_pushresult(&b); /* close buffer */ + n -= nr; // still have to read `n' chars + } while (n > 0 && nr == rlen); // until end of count or eof + luaL_pushresult(&b); // close buffer return (n == 0 || lua_objlen(L, -1) > 0); } -static int g_read (lua_State *L, FILE *f, int first) { +static int g_read (lua_State *L, Sword25::Sword25FileProxy *f, int first) { int nargs = lua_gettop(L) - 1; int success; int n; clearerr(f); - if (nargs == 0) { /* no arguments? */ + if (nargs == 0) { // no arguments? success = read_line(L, f); - n = first+1; /* to return 1 result */ + n = first+1; // to return 1 result } - else { /* ensure stack space for all results and for auxlib's buffer */ + else { // ensure stack space for all results and for auxlib's buffer luaL_checkstack(L, nargs+LUA_MINSTACK, "too many arguments"); success = 1; for (n = first; nargs-- && success; n++) { @@ -349,15 +370,15 @@ static int g_read (lua_State *L, FILE *f, int first) { const char *p = lua_tostring(L, n); luaL_argcheck(L, p && p[0] == '*', n, "invalid option"); switch (p[1]) { - case 'n': /* number */ + case 'n': // number success = read_number(L, f); break; - case 'l': /* line */ + case 'l': // line success = read_line(L, f); break; - case 'a': /* file */ - read_chars(L, f, ~((size_t)0)); /* read MAX_SIZE_T chars */ - success = 1; /* always success */ + case 'a': // file + read_chars(L, f, ~((size_t)0)); // read MAX_SIZE_T chars + success = 1; // always success break; default: return luaL_argerror(L, n, "invalid format"); @@ -368,58 +389,66 @@ static int g_read (lua_State *L, FILE *f, int first) { if (ferror(f)) return pushresult(L, 0, NULL); if (!success) { - lua_pop(L, 1); /* remove last result */ - lua_pushnil(L); /* push nil instead */ + lua_pop(L, 1); // remove last result + lua_pushnil(L); // push nil instead } return n - first; } - +*/ static int io_read (lua_State *L) { - return g_read(L, getiofile(L, IO_INPUT), 1); + error("LUA I/O has been removed in ScummVM"); +// return g_read(L, getiofile(L, IO_INPUT), 1); } static int f_read (lua_State *L) { - return g_read(L, tofile(L), 2); + error("LUA I/O has been removed in ScummVM"); +// return g_read(L, tofile(L), 2); } static int io_readline (lua_State *L) { + error("LUA I/O has been removed in ScummVM"); +/* FILE *f = *(FILE **)lua_touserdata(L, lua_upvalueindex(1)); int sucess; - if (f == NULL) /* file is already closed? */ + if (f == NULL) // file is already closed? luaL_error(L, "file is already closed"); sucess = read_line(L, f); if (ferror(f)) - return luaL_error(L, "%s", strerror(errno)); + return luaL_error(L, "%s", "LUA I/O error descriptions have been removed in ScummVM"); if (sucess) return 1; - else { /* EOF */ - if (lua_toboolean(L, lua_upvalueindex(2))) { /* generator created file? */ + else { // EOF + if (lua_toboolean(L, lua_upvalueindex(2))) { // generator created file? lua_settop(L, 0); lua_pushvalue(L, lua_upvalueindex(1)); - aux_close(L); /* close it */ + aux_close(L); // close it } return 0; } +*/ } /* }====================================================== */ -static int g_write (lua_State *L, FILE *f, int arg) { +static int g_write (lua_State *L, Sword25::Sword25FileProxy *f, int arg) { int nargs = lua_gettop(L) - 1; int status = 1; for (; nargs--; arg++) { if (lua_type(L, arg) == LUA_TNUMBER) { - /* optimization: could be done exactly as for strings */ - status = status && - fprintf(f, LUA_NUMBER_FMT, lua_tonumber(L, arg)) > 0; - } + // optimization: could be done exactly as for strings + if (status) { + char buffer[20]; + sprintf(buffer, LUA_NUMBER_FMT, lua_tonumber(L, arg)); + status = f->write(buffer, strlen(buffer)) == strlen(buffer); + } + } else { size_t l; const char *s = luaL_checklstring(L, arg, &l); - status = status && (fwrite(s, sizeof(char), l, f) == l); + status = status && (f->write(s, l) == l); } } return pushresult(L, status, NULL); @@ -427,7 +456,8 @@ static int g_write (lua_State *L, FILE *f, int arg) { static int io_write (lua_State *L) { - return g_write(L, getiofile(L, IO_OUTPUT), 1); + error("LUA I/O has been removed in ScummVM"); +// return g_write(L, getiofile(L, IO_OUTPUT), 1); } @@ -437,6 +467,8 @@ static int f_write (lua_State *L) { static int f_seek (lua_State *L) { + error("LUA I/O has been removed in ScummVM"); + /* static const int mode[] = {SEEK_SET, SEEK_CUR, SEEK_END}; static const char *const modenames[] = {"set", "cur", "end", NULL}; FILE *f = tofile(L); @@ -444,15 +476,18 @@ static int f_seek (lua_State *L) { long offset = luaL_optlong(L, 3, 0); op = fseek(f, offset, mode[op]); if (op) - return pushresult(L, 0, NULL); /* error */ + return pushresult(L, 0, NULL); // error else { lua_pushinteger(L, ftell(f)); return 1; } +*/ } static int f_setvbuf (lua_State *L) { + error("LUA I/O has been removed in ScummVM"); + /* static const int mode[] = {_IONBF, _IOFBF, _IOLBF}; static const char *const modenames[] = {"no", "full", "line", NULL}; FILE *f = tofile(L); @@ -460,17 +495,20 @@ static int f_setvbuf (lua_State *L) { lua_Integer sz = luaL_optinteger(L, 3, LUAL_BUFFERSIZE); int res = setvbuf(f, NULL, mode[op], sz); return pushresult(L, res == 0, NULL); + */ } static int io_flush (lua_State *L) { - return pushresult(L, fflush(getiofile(L, IO_OUTPUT)) == 0, NULL); + error("LUA I/O has been removed in ScummVM"); +// return pushresult(L, fflush(getiofile(L, IO_OUTPUT)) == 0, NULL); } static int f_flush (lua_State *L) { - return pushresult(L, fflush(tofile(L)) == 0, NULL); + error("LUA I/O has been removed in ScummVM"); +// return pushresult(L, fflush(tofile(L)) == 0, NULL); } @@ -511,18 +549,18 @@ static void createmeta (lua_State *L) { luaL_register(L, NULL, flib); /* file methods */ } - +/* static void createstdfile (lua_State *L, FILE *f, int k, const char *fname) { *newfile(L) = f; if (k > 0) { lua_pushvalue(L, -1); lua_rawseti(L, LUA_ENVIRONINDEX, k); } - lua_pushvalue(L, -2); /* copy environment */ - lua_setfenv(L, -2); /* set it */ + lua_pushvalue(L, -2); // copy environment + lua_setfenv(L, -2); // set it lua_setfield(L, -3, fname); } - +*/ static void newfenv (lua_State *L, lua_CFunction cls) { lua_createtable(L, 0, 1); @@ -540,9 +578,11 @@ LUALIB_API int luaopen_io (lua_State *L) { luaL_register(L, LUA_IOLIBNAME, iolib); /* create (and set) default files */ newfenv(L, io_noclose); /* close function for default files */ +/* createstdfile(L, stdin, IO_INPUT, "stdin"); createstdfile(L, stdout, IO_OUTPUT, "stdout"); createstdfile(L, stderr, 0, "stderr"); +*/ lua_pop(L, 1); /* pop environment for default files */ lua_getfield(L, -1, "popen"); newfenv(L, io_pclose); /* create environment for 'popen' */ diff --git a/engines/sword25/util/lua/llex.cpp b/engines/sword25/util/lua/llex.cpp index fdde2b8e5f3..4d73a6a6003 100644 --- a/engines/sword25/util/lua/llex.cpp +++ b/engines/sword25/util/lua/llex.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include #define llex_c @@ -176,9 +176,23 @@ static void buffreplace (LexState *ls, char from, char to) { static void trydecpoint (LexState *ls, SemInfo *seminfo) { /* format error: try to update decimal point separator */ - struct lconv *cv = localeconv(); + // Normally we'd use localeconv() to get the decimal point separator, but + // annoyingly that is not available on some platforms, e.g. Android. Figure + // it out by formatting a known value and extract the separator from that + // instead. The result could be cached, but considering the game I doubt + // this will ever be a bottleneck. Note that the separator is assumed to fit + // in a char, but that was a limitation in the original code as well. char old = ls->decpoint; - ls->decpoint = (cv ? cv->decimal_point[0] : '.'); + char buf[5]; + int i; + sprintf(buf, "%.1f", 1.0); + ls->decpoint = '.'; + for (i = 0; buf[i]; i++) { + if (!isspace(buf[i]) && !isdigit(buf[i])) { + ls->decpoint = buf[i]; + break; + } + } buffreplace(ls, old, ls->decpoint); /* try updated decimal separator */ if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) { /* format error with correct decimal point: no more options */ diff --git a/engines/sword25/util/lua/lmathlib.cpp b/engines/sword25/util/lua/lmathlib.cpp index 7e64d757892..6c36bbcf4e2 100644 --- a/engines/sword25/util/lua/lmathlib.cpp +++ b/engines/sword25/util/lua/lmathlib.cpp @@ -5,6 +5,10 @@ */ +// FIXME: rand and srand should be replaced by a RandomSource +#define FORBIDDEN_SYMBOL_EXCEPTION_rand +#define FORBIDDEN_SYMBOL_EXCEPTION_srand + #include // MSVC does not define M_PI, M_SQRT2 and other math defines by default. // _USE_MATH_DEFINES must be defined in order to have these defined, thus diff --git a/engines/sword25/util/lua/loadlib.cpp b/engines/sword25/util/lua/loadlib.cpp index 2549e2bdb11..9795a575f5c 100644 --- a/engines/sword25/util/lua/loadlib.cpp +++ b/engines/sword25/util/lua/loadlib.cpp @@ -9,10 +9,6 @@ */ -#include -#include - - #define loadlib_c #define LUA_LIB @@ -35,18 +31,6 @@ #define LIB_FAIL "open" -/* error codes for ll_loadfunc */ -#define ERRLIB 1 -#define ERRFUNC 2 - -#define setprogdir(L) ((void)0) - - -static void ll_unloadlib (void *lib); -static void *ll_load (lua_State *L, const char *path); -static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym); - - /* ** {====================================================== ** Fallback for other systems @@ -60,24 +44,6 @@ static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym); #define DLMSG "dynamic libraries not enabled; check your Lua installation" -static void ll_unloadlib (void *lib) { - (void)lib; /* to avoid warnings */ -} - - -static void *ll_load (lua_State *L, const char *path) { - (void)path; /* to avoid warnings */ - lua_pushliteral(L, DLMSG); - return NULL; -} - - -static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { - (void)lib; (void)sym; /* to avoid warnings */ - lua_pushliteral(L, DLMSG); - return NULL; -} - /* }====================================================== */ @@ -108,39 +74,33 @@ static void **ll_register (lua_State *L, const char *path) { */ static int gctm (lua_State *L) { void **lib = (void **)luaL_checkudata(L, 1, "_LOADLIB"); - if (*lib) ll_unloadlib(*lib); *lib = NULL; /* mark library as closed */ return 0; } -static int ll_loadfunc (lua_State *L, const char *path, const char *sym) { - void **reg = ll_register(L, path); - if (*reg == NULL) *reg = ll_load(L, path); - if (*reg == NULL) - return ERRLIB; /* unable to load library */ - else { - lua_CFunction f = ll_sym(L, *reg, sym); - if (f == NULL) - return ERRFUNC; /* unable to find function */ - lua_pushcfunction(L, f); - return 0; /* return function */ - } -} +/* error codes for ll_loadfunc */ +#define ERRLIB 1 +#define ERRFUNC 2 static int ll_loadlib (lua_State *L) { const char *path = luaL_checkstring(L, 1); - const char *init = luaL_checkstring(L, 2); - int stat = ll_loadfunc(L, path, init); - if (stat == 0) /* no errors? */ - return 1; /* return the loaded function */ - else { /* error; error message is on stack top */ - lua_pushnil(L); - lua_insert(L, -2); - lua_pushstring(L, (stat == ERRLIB) ? LIB_FAIL : "init"); - return 3; /* return nil, error message, and where */ +// const char *init = luaL_checkstring(L, 2); + int stat; + void **reg = ll_register(L, path); + if (*reg == NULL) { + stat = ERRLIB; /* unable to load library */ + } else { + stat = ERRFUNC; /* unable to find function */ } + lua_pushliteral(L, DLMSG); + + /* error; error message is on stack top */ + lua_pushnil(L); + lua_insert(L, -2); + lua_pushstring(L, (stat == ERRLIB) ? LIB_FAIL : "init"); + return 3; /* return nil, error message, and where */ } @@ -152,109 +112,6 @@ static int ll_loadlib (lua_State *L) { */ -static int readable (const char *filename) { - FILE *f = fopen(filename, "r"); /* try to open file */ - if (f == NULL) return 0; /* open failed */ - fclose(f); - return 1; -} - - -static const char *pushnexttemplate (lua_State *L, const char *path) { - const char *l; - while (*path == *LUA_PATHSEP) path++; /* skip separators */ - if (*path == '\0') return NULL; /* no more templates */ - l = strchr(path, *LUA_PATHSEP); /* find next separator */ - if (l == NULL) l = path + strlen(path); - lua_pushlstring(L, path, l - path); /* template */ - return l; -} - - -static const char *findfile (lua_State *L, const char *name, - const char *pname) { - const char *path; - name = luaL_gsub(L, name, ".", LUA_DIRSEP); - lua_getfield(L, LUA_ENVIRONINDEX, pname); - path = lua_tostring(L, -1); - if (path == NULL) - luaL_error(L, LUA_QL("package.%s") " must be a string", pname); - lua_pushliteral(L, ""); /* error accumulator */ - while ((path = pushnexttemplate(L, path)) != NULL) { - const char *filename; - filename = luaL_gsub(L, lua_tostring(L, -1), LUA_PATH_MARK, name); - lua_remove(L, -2); /* remove path template */ - if (readable(filename)) /* does file exist and is readable? */ - return filename; /* return that file name */ - lua_pushfstring(L, "\n\tno file " LUA_QS, filename); - lua_remove(L, -2); /* remove file name */ - lua_concat(L, 2); /* add entry to possible error message */ - } - return NULL; /* not found */ -} - - -static void loaderror (lua_State *L, const char *filename) { - luaL_error(L, "error loading module " LUA_QS " from file " LUA_QS ":\n\t%s", - lua_tostring(L, 1), filename, lua_tostring(L, -1)); -} - - -static int loader_Lua (lua_State *L) { - const char *filename; - const char *name = luaL_checkstring(L, 1); - filename = findfile(L, name, "path"); - if (filename == NULL) return 1; /* library not found in this path */ - if (luaL_loadfile(L, filename) != 0) - loaderror(L, filename); - return 1; /* library loaded successfully */ -} - - -static const char *mkfuncname (lua_State *L, const char *modname) { - const char *funcname; - const char *mark = strchr(modname, *LUA_IGMARK); - if (mark) modname = mark + 1; - funcname = luaL_gsub(L, modname, ".", LUA_OFSEP); - funcname = lua_pushfstring(L, POF"%s", funcname); - lua_remove(L, -2); /* remove 'gsub' result */ - return funcname; -} - - -static int loader_C (lua_State *L) { - const char *funcname; - const char *name = luaL_checkstring(L, 1); - const char *filename = findfile(L, name, "cpath"); - if (filename == NULL) return 1; /* library not found in this path */ - funcname = mkfuncname(L, name); - if (ll_loadfunc(L, filename, funcname) != 0) - loaderror(L, filename); - return 1; /* library loaded successfully */ -} - - -static int loader_Croot (lua_State *L) { - const char *funcname; - const char *filename; - const char *name = luaL_checkstring(L, 1); - const char *p = strchr(name, '.'); - int stat; - if (p == NULL) return 0; /* is root */ - lua_pushlstring(L, name, p - name); - filename = findfile(L, lua_tostring(L, -1), "cpath"); - if (filename == NULL) return 1; /* root not found */ - funcname = mkfuncname(L, name); - if ((stat = ll_loadfunc(L, filename, funcname)) != 0) { - if (stat != ERRFUNC) loaderror(L, filename); /* real error */ - lua_pushfstring(L, "\n\tno module " LUA_QS " in file " LUA_QS, - name, filename); - return 1; /* function not found */ - } - return 1; -} - - static int loader_preload (lua_State *L) { const char *name = luaL_checkstring(L, 1); lua_getfield(L, LUA_ENVIRONINDEX, "preload"); @@ -407,23 +264,11 @@ static int ll_seeall (lua_State *L) { -/* auxiliary mark (for internal use) */ -#define AUXMARK "\1" - static void setpath (lua_State *L, const char *fieldname, const char *envname, const char *def) { - const char *path = getenv(envname); - if (path == NULL) /* no environment variable? */ - lua_pushstring(L, def); /* use default */ - else { - /* replace ";;" by ";AUXMARK;" and then AUXMARK by default path */ - path = luaL_gsub(L, path, LUA_PATHSEP LUA_PATHSEP, - LUA_PATHSEP AUXMARK LUA_PATHSEP); - luaL_gsub(L, path, AUXMARK, def); - lua_remove(L, -2); - } - setprogdir(L); - lua_setfield(L, -2, fieldname); + // no environment variable -> use default + lua_pushstring(L, def); + lua_setfield(L, -2, fieldname); } @@ -442,7 +287,7 @@ static const luaL_Reg ll_funcs[] = { static const lua_CFunction loaders[] = - {loader_preload, loader_Lua, loader_C, loader_Croot, NULL}; + {loader_preload, NULL}; LUALIB_API int luaopen_package (lua_State *L) { diff --git a/engines/sword25/util/lua/loslib.cpp b/engines/sword25/util/lua/loslib.cpp index 035925ceb54..b61f8c65e10 100644 --- a/engines/sword25/util/lua/loslib.cpp +++ b/engines/sword25/util/lua/loslib.cpp @@ -4,11 +4,9 @@ ** See Copyright Notice in lua.h */ +// FIXME: Get rid of all time.h stuff +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h -#include -#include -#include -#include #include #define loslib_c @@ -19,54 +17,53 @@ #include "lauxlib.h" #include "lualib.h" - -static int os_pushresult (lua_State *L, int i, const char *filename) { - int en = errno; /* calls to Lua API may change this value */ - if (i) { - lua_pushboolean(L, 1); - return 1; - } - else { - lua_pushnil(L); - lua_pushfstring(L, "%s: %s", filename, strerror(en)); - lua_pushinteger(L, en); - return 3; - } -} +#include "common/system.h" +#include "common/textconsole.h" static int os_execute (lua_State *L) { - lua_pushinteger(L, system(luaL_optstring(L, 1, NULL))); + // Non-portable call, removed in ScummVM. + // FIXME: Is this ever invoked? If so, investigate that code further. + lua_pushinteger(L, -1); // signal that an error occurred return 1; } static int os_remove (lua_State *L) { - const char *filename = luaL_checkstring(L, 1); - return os_pushresult(L, remove(filename) == 0, filename); + // Non-portable call that deletes a file. Removed in ScummVM. + // This call is invoked in sword25 when loading games in order to remove the + // temporary savegame thumbnail that the original engine code created. We + // embed the thumbnail in the savegame instead, so this call is not needed at + // all. + return 1; } static int os_rename (lua_State *L) { - const char *fromname = luaL_checkstring(L, 1); - const char *toname = luaL_checkstring(L, 2); - return os_pushresult(L, rename(fromname, toname) == 0, fromname); + // Non-portable call, removed in ScummVM. + return 1; } static int os_tmpname (lua_State *L) { + // Non-portable call, removed in ScummVM. + // FIXME: Why do we return an error in tmpname, but for other + // removed methods we just do nothing? return luaL_error(L, "unable to generate a unique filename"); } static int os_getenv (lua_State *L) { - lua_pushstring(L, getenv(luaL_checkstring(L, 1))); /* if NULL push nil */ + // Non-portable call, removed in ScummVM. + // FIXME: Is this ever invoked? If so, investigate that code further. + lua_pushstring(L, NULL); return 1; } static int os_clock (lua_State *L) { - lua_pushnumber(L, ((lua_Number)clock())/(lua_Number)CLOCKS_PER_SEC); + // Non-portable call to clock() replaced by invocation of OSystem::getMillis. + lua_pushnumber(L, ((lua_Number)g_system->getMillis())/(lua_Number)1000); return 1; } @@ -117,6 +114,12 @@ static int getfield (lua_State *L, const char *key, int d) { static int os_date (lua_State *L) { const char *s = luaL_optstring(L, 1, "%c"); + // FIXME: Rewrite the code below to use OSystem::getTimeAndDate + // Alternatively, remove it, if sword25 does not use it. + // + // The former would mean sacrificing the ability to choose the timezone, *or* + // we would have to drive an effort to add time zone support to OSystem (is it + // worth that, though???) time_t t = luaL_opt(L, (time_t)luaL_checknumber, 2, time(NULL)); struct tm *stm; if (*s == '!') { /* UTC? */ @@ -162,6 +165,8 @@ static int os_date (lua_State *L) { static int os_time (lua_State *L) { + // FIXME: Rewrite the code below to use OSystem::getTimeAndDate. + // Alternatively, remove it, if sword25 does not use it. time_t t; if (lua_isnoneornil(L, 1)) /* called without args? */ t = time(NULL); /* get current time */ @@ -187,6 +192,9 @@ static int os_time (lua_State *L) { static int os_difftime (lua_State *L) { + // FIXME: difftime is not portable, unfortunately. + // So we either have to replace this code, or just remove it, + // depending on whether sword25 actually uses it. lua_pushnumber(L, difftime((time_t)(luaL_checknumber(L, 1)), (time_t)(luaL_optnumber(L, 2, 0)))); return 1; @@ -196,19 +204,20 @@ static int os_difftime (lua_State *L) { static int os_setlocale (lua_State *L) { - static const int cat[] = {LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, - LC_NUMERIC, LC_TIME}; - static const char *const catnames[] = {"all", "collate", "ctype", "monetary", - "numeric", "time", NULL}; - const char *l = luaL_optstring(L, 1, NULL); - int op = luaL_checkoption(L, 2, "all", catnames); - lua_pushstring(L, setlocale(cat[op], l)); + // Non-portable call to set the numeric locale. Removed in ScummVM, as it's + // not used in sword25. return 1; } static int os_exit (lua_State *L) { - exit(luaL_optint(L, 1, EXIT_SUCCESS)); + // FIXME: Using exit is not portable! + // Using OSystem::quit() isn't really a great idea, either. + // We really would prefer to let the main run loop exit, so that + // our main() can perform cleanup. + if (0 == luaL_optint(L, 1, EXIT_SUCCESS)) + g_system->quit(); + error("LUA os_exit invokes with non-zero exit value"); } static const luaL_Reg syslib[] = { diff --git a/engines/sword25/util/lua/lua.h b/engines/sword25/util/lua/lua.h index 088a511cf96..417cdadf8bf 100644 --- a/engines/sword25/util/lua/lua.h +++ b/engines/sword25/util/lua/lua.h @@ -9,6 +9,8 @@ #ifndef lua_h #define lua_h +#include "common/scummsys.h" + #include #include diff --git a/engines/sword25/util/lua/luaconf.h b/engines/sword25/util/lua/luaconf.h index 669b0e7a49c..f3509e969b0 100644 --- a/engines/sword25/util/lua/luaconf.h +++ b/engines/sword25/util/lua/luaconf.h @@ -183,7 +183,11 @@ #define LUAI_DATA /* empty */ #elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \ - defined(__ELF__) + defined(__ELF__) && !defined(__PLAYSTATION2__) +/* +** The PS2 gcc compiler doesn't like the visibility attribute, so +** we use the normal "extern" definitions in the block below +*/ #define LUAI_FUNC __attribute__((visibility("hidden"))) extern #define LUAI_DATA LUAI_FUNC @@ -345,7 +349,7 @@ /* @@ LUA_COMPAT_LSTR controls compatibility with old long string nesting @* facility. -** CHANGE it to 2 if you want the old behaviour, or undefine it to turn +** CHANGE it to 2 if you want the old behavior, or undefine it to turn ** off the advisory error when nesting [[...]]. */ #define LUA_COMPAT_LSTR 1 @@ -633,33 +637,6 @@ union luai_Cast { double l_d; long l_l; }; #define LUA_MAXCAPTURES 32 -/* -@@ lua_tmpnam is the function that the OS library uses to create a -@* temporary name. -@@ LUA_TMPNAMBUFSIZE is the maximum size of a name created by lua_tmpnam. -** CHANGE them if you have an alternative to tmpnam (which is considered -** insecure) or if you want the original tmpnam anyway. By default, Lua -** uses tmpnam except when POSIX is available, where it uses mkstemp. -*/ -#if defined(loslib_c) || defined(luaall_c) - -#if defined(LUA_USE_MKSTEMP) -#include -#define LUA_TMPNAMBUFSIZE 32 -#define lua_tmpnam(b,e) { \ - strcpy(b, "/tmp/lua_XXXXXX"); \ - e = mkstemp(b); \ - if (e != -1) close(e); \ - e = (e == -1); } - -#else -#define LUA_TMPNAMBUFSIZE L_tmpnam -#define lua_tmpnam(b,e) { e = (tmpnam(b) == NULL); } -#endif - -#endif - - /* @@ lua_popen spawns a new process connected to the current one through @* the file streams. diff --git a/engines/sword25/util/lua/lundump.cpp b/engines/sword25/util/lua/lundump.cpp deleted file mode 100644 index 4ffc623575b..00000000000 --- a/engines/sword25/util/lua/lundump.cpp +++ /dev/null @@ -1,225 +0,0 @@ -/* -** $Id$ -** load precompiled Lua chunks -** See Copyright Notice in lua.h -*/ - -#include - -#define lundump_c -#define LUA_CORE - -#include "lua.h" - -#include "ldebug.h" -#include "ldo.h" -#include "lfunc.h" -#include "lmem.h" -#include "lobject.h" -#include "lstring.h" -#include "lundump.h" -#include "lzio.h" - -typedef struct { - lua_State* L; - ZIO* Z; - Mbuffer* b; - const char* name; -} LoadState; - -#ifdef LUAC_TRUST_BINARIES -#define IF(c,s) -#define error(S,s) -#else -#define IF(c,s) if (c) error(S,s) - -static void error(LoadState* S, const char* why) -{ - luaO_pushfstring(S->L,"%s: %s in precompiled chunk",S->name,why); - luaD_throw(S->L,LUA_ERRSYNTAX); -} -#endif - -#define LoadMem(S,b,n,size) LoadBlock(S,b,(n)*(size)) -#define LoadByte(S) (lu_byte)LoadChar(S) -#define LoadVar(S,x) LoadMem(S,&x,1,sizeof(x)) -#define LoadVector(S,b,n,size) LoadMem(S,b,n,size) - -static void LoadBlock(LoadState* S, void* b, size_t size) -{ - size_t r=luaZ_read(S->Z,b,size); - UNUSED(r); - IF (r!=0, "unexpected end"); -} - -static int LoadChar(LoadState* S) -{ - char x; - LoadVar(S,x); - return x; -} - -static int LoadInt(LoadState* S) -{ - int x; - LoadVar(S,x); - IF (x<0, "bad integer"); - return x; -} - -static lua_Number LoadNumber(LoadState* S) -{ - lua_Number x; - LoadVar(S,x); - return x; -} - -static TString* LoadString(LoadState* S) -{ - size_t size; - LoadVar(S,size); - if (size==0) - return NULL; - else - { - char* s=luaZ_openspace(S->L,S->b,size); - LoadBlock(S,s,size); - return luaS_newlstr(S->L,s,size-1); /* remove trailing '\0' */ - } -} - -static void LoadCode(LoadState* S, Proto* f) -{ - int n=LoadInt(S); - f->code=luaM_newvector(S->L,n,Instruction); - f->sizecode=n; - LoadVector(S,f->code,n,sizeof(Instruction)); -} - -static Proto* LoadFunction(LoadState* S, TString* p); - -static void LoadConstants(LoadState* S, Proto* f) -{ - int i,n; - n=LoadInt(S); - f->k=luaM_newvector(S->L,n,TValue); - f->sizek=n; - for (i=0; ik[i]); - for (i=0; ik[i]; - int t=LoadChar(S); - switch (t) - { - case LUA_TNIL: - setnilvalue(o); - break; - case LUA_TBOOLEAN: - setbvalue(o,LoadChar(S)); - break; - case LUA_TNUMBER: - setnvalue(o,LoadNumber(S)); - break; - case LUA_TSTRING: - setsvalue2n(S->L,o,LoadString(S)); - break; - default: - error(S,"bad constant"); - break; - } - } - n=LoadInt(S); - f->p=luaM_newvector(S->L,n,Proto*); - f->sizep=n; - for (i=0; ip[i]=NULL; - for (i=0; ip[i]=LoadFunction(S,f->source); -} - -static void LoadDebug(LoadState* S, Proto* f) -{ - int i,n; - n=LoadInt(S); - f->lineinfo=luaM_newvector(S->L,n,int); - f->sizelineinfo=n; - LoadVector(S,f->lineinfo,n,sizeof(int)); - n=LoadInt(S); - f->locvars=luaM_newvector(S->L,n,LocVar); - f->sizelocvars=n; - for (i=0; ilocvars[i].varname=NULL; - for (i=0; ilocvars[i].varname=LoadString(S); - f->locvars[i].startpc=LoadInt(S); - f->locvars[i].endpc=LoadInt(S); - } - n=LoadInt(S); - f->upvalues=luaM_newvector(S->L,n,TString*); - f->sizeupvalues=n; - for (i=0; iupvalues[i]=NULL; - for (i=0; iupvalues[i]=LoadString(S); -} - -static Proto* LoadFunction(LoadState* S, TString* p) -{ - Proto* f=luaF_newproto(S->L); - setptvalue2s(S->L,S->L->top,f); incr_top(S->L); - f->source=LoadString(S); if (f->source==NULL) f->source=p; - f->linedefined=LoadInt(S); - f->lastlinedefined=LoadInt(S); - f->nups=LoadByte(S); - f->numparams=LoadByte(S); - f->is_vararg=LoadByte(S); - f->maxstacksize=LoadByte(S); - LoadCode(S,f); - LoadConstants(S,f); - LoadDebug(S,f); - IF (!luaG_checkcode(f), "bad code"); - S->L->top--; - return f; -} - -static void LoadHeader(LoadState* S) -{ - char h[LUAC_HEADERSIZE]; - char s[LUAC_HEADERSIZE]; - luaU_header(h); - LoadBlock(S,s,LUAC_HEADERSIZE); - IF (memcmp(h,s,LUAC_HEADERSIZE)!=0, "bad header"); -} - -/* -** load precompiled chunk -*/ -Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name) -{ - LoadState S; - if (*name=='@' || *name=='=') - S.name=name+1; - else if (*name==LUA_SIGNATURE[0]) - S.name="binary string"; - else - S.name=name; - S.L=L; - S.Z=Z; - S.b=buff; - LoadHeader(&S); - return LoadFunction(&S,luaS_newliteral(L,"=?")); -} - -/* -* make header -*/ -void luaU_header (char* h) -{ - int x=1; - memcpy(h,LUA_SIGNATURE,sizeof(LUA_SIGNATURE)-1); - h+=sizeof(LUA_SIGNATURE)-1; - *h++=(char)LUAC_VERSION; - *h++=(char)LUAC_FORMAT; - *h++=(char)*(char*)&x; /* endianness */ - *h++=(char)sizeof(int); - *h++=(char)sizeof(size_t); - *h++=(char)sizeof(Instruction); - *h++=(char)sizeof(lua_Number); - *h++=(char)(((lua_Number)0.5)==0); /* is lua_Number integral? */ -} diff --git a/engines/sword25/util/lua/lundump.h b/engines/sword25/util/lua/lundump.h deleted file mode 100644 index f791a4f1736..00000000000 --- a/engines/sword25/util/lua/lundump.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -** $Id$ -** load precompiled Lua chunks -** See Copyright Notice in lua.h -*/ - -#ifndef lundump_h -#define lundump_h - -#include "lobject.h" -#include "lzio.h" - -/* load one chunk; from lundump.c */ -LUAI_FUNC Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name); - -/* make header; from lundump.c */ -LUAI_FUNC void luaU_header (char* h); - -/* dump one chunk; from ldump.c */ -LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip); - -#ifdef luac_c -/* print one chunk; from print.c */ -LUAI_FUNC void luaU_print (const Proto* f, int full); -#endif - -/* for header of binary files -- this is Lua 5.1 */ -#define LUAC_VERSION 0x51 - -/* for header of binary files -- this is the official format */ -#define LUAC_FORMAT 0 - -/* size of header of binary files */ -#define LUAC_HEADERSIZE 12 - -#endif diff --git a/engines/sword25/util/lua/lvm.cpp b/engines/sword25/util/lua/lvm.cpp index ae70fe2645d..fb700c20a28 100644 --- a/engines/sword25/util/lua/lvm.cpp +++ b/engines/sword25/util/lua/lvm.cpp @@ -202,7 +202,7 @@ static int l_strcmp (const TString *ls, const TString *rs) { const char *r = getstr(rs); size_t lr = rs->tsv.len; for (;;) { - int temp = strcoll(l, r); + int temp = strcmp(l, r); if (temp != 0) return temp; else { /* strings are equal up to a `\0' */ size_t len = strlen(l); /* index of first `\0' in both strings */ diff --git a/engines/sword25/util/lua/print.cpp b/engines/sword25/util/lua/print.cpp deleted file mode 100644 index 22039c98614..00000000000 --- a/engines/sword25/util/lua/print.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/* -** $Id$ -** print bytecodes -** See Copyright Notice in lua.h -*/ - -#include -#include - -#define luac_c -#define LUA_CORE - -#include "ldebug.h" -#include "lobject.h" -#include "lopcodes.h" -#include "lundump.h" - -#define PrintFunction luaU_print - -#define Sizeof(x) ((int)sizeof(x)) -#define VOID(p) ((const void*)(p)) - -static void PrintString(const TString* ts) -{ - const char* s=getstr(ts); - size_t i,n=ts->tsv.len; - putchar('"'); - for (i=0; ik[i]; - switch (ttype(o)) - { - case LUA_TNIL: - printf("nil"); - break; - case LUA_TBOOLEAN: - printf(bvalue(o) ? "true" : "false"); - break; - case LUA_TNUMBER: - printf(LUA_NUMBER_FMT,nvalue(o)); - break; - case LUA_TSTRING: - PrintString(rawtsvalue(o)); - break; - default: /* cannot happen */ - printf("? type=%d",ttype(o)); - break; - } -} - -static void PrintCode(const Proto* f) -{ - const Instruction* code=f->code; - int pc,n=f->sizecode; - for (pc=0; pc0) printf("[%d]\t",line); else printf("[-]\t"); - printf("%-9s\t",luaP_opnames[o]); - switch (getOpMode(o)) - { - case iABC: - printf("%d",a); - if (getBMode(o)!=OpArgN) printf(" %d",ISK(b) ? (-1-INDEXK(b)) : b); - if (getCMode(o)!=OpArgN) printf(" %d",ISK(c) ? (-1-INDEXK(c)) : c); - break; - case iABx: - if (getBMode(o)==OpArgK) printf("%d %d",a,-1-bx); else printf("%d %d",a,bx); - break; - case iAsBx: - if (o==OP_JMP) printf("%d",sbx); else printf("%d %d",a,sbx); - break; - } - switch (o) - { - case OP_LOADK: - printf("\t; "); PrintConstant(f,bx); - break; - case OP_GETUPVAL: - case OP_SETUPVAL: - printf("\t; %s", (f->sizeupvalues>0) ? getstr(f->upvalues[b]) : "-"); - break; - case OP_GETGLOBAL: - case OP_SETGLOBAL: - printf("\t; %s",svalue(&f->k[bx])); - break; - case OP_GETTABLE: - case OP_SELF: - if (ISK(c)) { printf("\t; "); PrintConstant(f,INDEXK(c)); } - break; - case OP_SETTABLE: - case OP_ADD: - case OP_SUB: - case OP_MUL: - case OP_DIV: - case OP_POW: - case OP_EQ: - case OP_LT: - case OP_LE: - if (ISK(b) || ISK(c)) - { - printf("\t; "); - if (ISK(b)) PrintConstant(f,INDEXK(b)); else printf("-"); - printf(" "); - if (ISK(c)) PrintConstant(f,INDEXK(c)); else printf("-"); - } - break; - case OP_JMP: - case OP_FORLOOP: - case OP_FORPREP: - printf("\t; to %d",sbx+pc+2); - break; - case OP_CLOSURE: - printf("\t; %p",VOID(f->p[bx])); - break; - case OP_SETLIST: - if (c==0) printf("\t; %d",(int)code[++pc]); - else printf("\t; %d",c); - break; - default: - break; - } - printf("\n"); - } -} - -#define SS(x) (x==1)?"":"s" -#define S(x) x,SS(x) - -static void PrintHeader(const Proto* f) -{ - const char* s=getstr(f->source); - if (*s=='@' || *s=='=') - s++; - else if (*s==LUA_SIGNATURE[0]) - s="(bstring)"; - else - s="(string)"; - printf("\n%s <%s:%d,%d> (%d instruction%s, %d bytes at %p)\n", - (f->linedefined==0)?"main":"function",s, - f->linedefined,f->lastlinedefined, - S(f->sizecode),f->sizecode*Sizeof(Instruction),VOID(f)); - printf("%d%s param%s, %d slot%s, %d upvalue%s, ", - f->numparams,f->is_vararg?"+":"",SS(f->numparams), - S(f->maxstacksize),S(f->nups)); - printf("%d local%s, %d constant%s, %d function%s\n", - S(f->sizelocvars),S(f->sizek),S(f->sizep)); -} - -static void PrintConstants(const Proto* f) -{ - int i,n=f->sizek; - printf("constants (%d) for %p:\n",n,VOID(f)); - for (i=0; isizelocvars; - printf("locals (%d) for %p:\n",n,VOID(f)); - for (i=0; ilocvars[i].varname),f->locvars[i].startpc+1,f->locvars[i].endpc+1); - } -} - -static void PrintUpvalues(const Proto* f) -{ - int i,n=f->sizeupvalues; - printf("upvalues (%d) for %p:\n",n,VOID(f)); - if (f->upvalues==NULL) return; - for (i=0; iupvalues[i])); - } -} - -void PrintFunction(const Proto* f, int full) -{ - int i,n=f->sizep; - PrintHeader(f); - PrintCode(f); - if (full) - { - PrintConstants(f); - PrintLocals(f); - PrintUpvalues(f); - } - for (i=0; ip[i],full); -} diff --git a/engines/sword25/util/lua/scummvm_file.cpp b/engines/sword25/util/lua/scummvm_file.cpp new file mode 100644 index 00000000000..3c0377d0ee3 --- /dev/null +++ b/engines/sword25/util/lua/scummvm_file.cpp @@ -0,0 +1,205 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "sword25/util/lua/scummvm_file.h" +#include "common/config-manager.h" +#include "common/util.h" + +namespace Sword25 { + +Sword25FileProxy::Sword25FileProxy(const Common::String &filename, const Common::String &mode) { + assert(filename.contains("config.lua")); + if (mode == "r") + setupConfigFile(); +} + +void Sword25FileProxy::setupConfigFile() { + double sfxVolume = ConfMan.hasKey("sfx_volume") ? 1.0 : 1.0 * ConfMan.getInt("sfx_volume") / 255.0; + double musicVolume = ConfMan.hasKey("music_volume") ? 0.5 : 1.0 * ConfMan.getInt("music_volume") / 255.0; + double speechVolume = ConfMan.hasKey("speech_volume") ? 1.0 : 1.0 * ConfMan.getInt("speech_volume") / 255.0; + bool subtitles = ConfMan.hasKey("subtitles") ? true : ConfMan.getBool("subtitles"); + + _readData = Common::String::format( +"GAME_LANGUAGE = \"%s\"\r\n\ +GAME_SUBTITLES = %s\r\n\ +MAX_MEMORY_USAGE = 256000000\r\n\ +GFX_VSYNC_ACTIVE = true\r\n\ +SFX_SAMPLING_RATE = 44100\r\n\ +SFX_CHANNEL_COUNT = 32\r\n\ +SFX_SOUND_VOLUME = %f\r\n\ +SFX_MUSIC_VOLUME = %f\r\n\ +SFX_SPEECH_VOLUME = %f\r\n", + getLanguage().c_str(), subtitles ? "true" : "false", sfxVolume, musicVolume, speechVolume); + + _readPos = 0; +} + +Sword25FileProxy::~Sword25FileProxy() { + if (!_settings.empty()) + writeSettings(); +} + +size_t Sword25FileProxy::read(void *ptr, size_t size, size_t count) { + size_t bytesRead = MIN(_readData.size() - _readPos, size * count); + memmove(ptr, &_readData.c_str()[_readPos], bytesRead); + _readPos += bytesRead; + return bytesRead / size; +} + +size_t Sword25FileProxy::write(const char *ptr, size_t count) { + // Loop through the provided line(s) + while (*ptr) { + if ((*ptr == '-') && (*(ptr + 1) == '-')) { + // Comment line to skip over + while ((*ptr != '\r') && (*ptr != '\n')) + ++ptr; + } else { + // Legitimate data + const char *p = strchr(ptr, '\n'); + if (!p) p = ptr + strlen(ptr); + while ((*p == '\r') || (*p == '\n')) + ++p; + + _settings += Common::String(ptr, p - ptr); + ptr = p; + } + + while ((*ptr == '\r') || (*ptr == '\n')) + ++ptr; + } + + return count; +} + +void Sword25FileProxy::writeSettings() { + // Loop through the setting lines + const char *pSrc = _settings.c_str(); + while (*pSrc) { + if ((*pSrc != '\r') && (*pSrc != '\n')) { + const char *p = strchr(pSrc, '='); + assert(p); + + // Get the setting name + const char *pEnd = p - 1; + while (*pEnd == ' ') + --pEnd; + Common::String settingName(pSrc, pEnd - pSrc + 1); + + // Get the setting value + const char *pStart = p + 1; + while (*pStart == ' ') + ++pStart; + + pEnd = pStart + 1; + while ((*pEnd != '\r') && (*pEnd != '\n') && (*pEnd != '\0')) + ++pEnd; + Common::String value(pStart + (*pStart == '"' ? 1 : 0), pEnd - pStart - (*pStart == '"' ? 2 : 0)); + + // Update the setting + updateSetting(settingName, value); + pSrc = pEnd; + } + + // Move to next line + while ((*pSrc == '\r') || (*pSrc == '\n')) + ++pSrc; + } + + ConfMan.flushToDisk(); +} + +void Sword25FileProxy::updateSetting(const Common::String &setting, const Common::String &value) { + if (setting == "GAME_LANGUAGE") + setLanguage(value); + else if (setting == "GAME_SUBTITLES") + ConfMan.setBool("subtitles", value == "true"); + else if (setting == "SFX_SOUND_VOLUME") { + double v = strtod(value.c_str(), NULL); + ConfMan.setInt("sfx_volume", (int)(v * 255)); + } else if (setting == "SFX_MUSIC_VOLUME") { + double v = strtod(value.c_str(), NULL); + ConfMan.setInt("music_volume", (int)(v * 255)); + } else if (setting == "SFX_SPEECH_VOLUME") { + double v = strtod(value.c_str(), NULL); + ConfMan.setInt("speech_volume", (int)(v * 255)); + } else { + // All other settings are ignored + } +} + +/** + * Get the language code used by the game for each language it supports + */ +Common::String Sword25FileProxy::getLanguage() { + Common::Language lang = Common::parseLanguage(ConfMan.get("language")); + switch (lang) { + case Common::EN_ANY: + return "en"; + case Common::DE_DEU: + return "de"; + case Common::ES_ESP: + return "es"; + case Common::FR_FRA: + return "fr"; + case Common::HU_HUN: + return "hr"; + case Common::IT_ITA: + return "it"; + case Common::PL_POL: + return "pl"; + case Common::PT_BRA: + return "pt"; + case Common::RU_RUS: + return "ru"; + default: + error("Unknown language '%s' encountered", ConfMan.get("language").c_str()); + break; + } +} + +/** + * Set the language code fro the game + */ +void Sword25FileProxy::setLanguage(const Common::String &lang) { + if (lang == "en") + ConfMan.set("language", Common::getLanguageCode(Common::EN_ANY)); + else if (lang == "de") + ConfMan.set("language", Common::getLanguageCode(Common::DE_DEU)); + else if (lang == "es") + ConfMan.set("language", Common::getLanguageCode(Common::ES_ESP)); + else if (lang == "fr") + ConfMan.set("language", Common::getLanguageCode(Common::FR_FRA)); + else if (lang == "hr") + ConfMan.set("language", Common::getLanguageCode(Common::HU_HUN)); + else if (lang == "it") + ConfMan.set("language", Common::getLanguageCode(Common::IT_ITA)); + else if (lang == "pl") + ConfMan.set("language", Common::getLanguageCode(Common::PL_POL)); + else if (lang == "pt") + ConfMan.set("language", Common::getLanguageCode(Common::PT_BRA)); + else if (lang == "ru") + ConfMan.set("language", Common::getLanguageCode(Common::RU_RUS)); + else + error("Unknown language encountered"); +} + +} // End of namespace Sword25 diff --git a/engines/sword25/util/lua/scummvm_file.h b/engines/sword25/util/lua/scummvm_file.h new file mode 100644 index 00000000000..a4cbd2a6cf4 --- /dev/null +++ b/engines/sword25/util/lua/scummvm_file.h @@ -0,0 +1,56 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef SWORD25_SCUMMVM_FILE_H +#define SWORD25_SCUMMVM_FILE_H + +#include "common/str.h" + +namespace Sword25 { + +/** + * The following class acts as a proxy interface to the I/O code, pretending that the ScummVM + * settings are a properly formatted 'config.lua' file + */ +class Sword25FileProxy { +private: + Common::String _readData; + uint _readPos; + Common::String _settings; + + void setupConfigFile(); + Common::String getLanguage(); + void setLanguage(const Common::String &lang); + void writeSettings(); + void updateSetting(const Common::String &setting, const Common::String &value); +public: + Sword25FileProxy(const Common::String &filename, const Common::String &mode); + ~Sword25FileProxy(); + + bool eof() const { return _readPos >= _readData.size(); } + size_t read(void *ptr, size_t size, size_t count); + size_t write(const char *ptr, size_t count); +}; + +} // End of namespace Sword25 + +#endif diff --git a/engines/teenagent/actor.cpp b/engines/teenagent/actor.cpp index 9dd30f43c34..717c022c389 100644 --- a/engines/teenagent/actor.cpp +++ b/engines/teenagent/actor.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "teenagent/actor.h" @@ -34,10 +31,9 @@ namespace TeenAgent { Actor::Actor() : head_index(0), idle_type(0) {} //idle animation lists at dseg: 0x6540 -Common::Rect Actor::renderIdle(Graphics::Surface *surface, const Common::Point &position, uint8 orientation, int delta_frame, uint zoom) { - static Common::RandomSource random; +Common::Rect Actor::renderIdle(Graphics::Surface *surface, const Common::Point &position, uint8 orientation, int delta_frame, uint zoom, Common::RandomSource &rnd) { if (index == 0) { - idle_type = random.getRandomNumber(2); + idle_type = rnd.getRandomNumber(2); debug(0, "switched to idle animation %u", idle_type); } @@ -47,7 +43,7 @@ Common::Rect Actor::renderIdle(Graphics::Surface *surface, const Common::Point & frames_idle = res->dseg.ptr(res->dseg.get_word(0x6540 + idle_type * 2)) + index; index += delta_frame; if (*frames_idle == 0) { - idle_type = random.getRandomNumber(2); + idle_type = rnd.getRandomNumber(2); debug(0, "switched to idle animation %u[loop]", idle_type); index = 3; //put 4th frame (base 1) if idle animation loops } diff --git a/engines/teenagent/actor.h b/engines/teenagent/actor.h index 1afe2c3d336..9a7d3955476 100644 --- a/engines/teenagent/actor.h +++ b/engines/teenagent/actor.h @@ -17,14 +17,15 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "teenagent/animation.h" #include "common/rect.h" +namespace Common { +class RandomSource; +} + namespace TeenAgent { class Actor : public Animation { @@ -33,7 +34,7 @@ class Actor : public Animation { public: Actor(); Common::Rect render(Graphics::Surface *surface, const Common::Point &position, uint8 orientation, int delta_frame, bool head, uint zoom); - Common::Rect renderIdle(Graphics::Surface *surface, const Common::Point &position, uint8 orientation, int delta_frame, uint zoom); + Common::Rect renderIdle(Graphics::Surface *surface, const Common::Point &position, uint8 orientation, int delta_frame, uint zoom, Common::RandomSource &rnd); }; } // End of namespace TeenAgent diff --git a/engines/teenagent/animation.cpp b/engines/teenagent/animation.cpp index 623966f265b..af54bca6a4f 100644 --- a/engines/teenagent/animation.cpp +++ b/engines/teenagent/animation.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "teenagent/animation.h" diff --git a/engines/teenagent/animation.h b/engines/teenagent/animation.h index 31c3fa7eafa..e98bb42ea0a 100644 --- a/engines/teenagent/animation.h +++ b/engines/teenagent/animation.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TEENAGENT_ANIMATION_H diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp index f4be917eac4..ae498478a4e 100644 --- a/engines/teenagent/callbacks.cpp +++ b/engines/teenagent/callbacks.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "teenagent/scene.h" @@ -39,7 +36,7 @@ namespace TeenAgent { void TeenAgentEngine::rejectMessage() { Resources * res = Resources::instance(); //random reject message: - uint i = random.getRandomNumber(3); + uint i = _rnd.getRandomNumber(3); //debug(0, "reject message: %s", (const char *)res->dseg.ptr(res->dseg.get_word(0x339e + 2 * i))); displayMessage(res->dseg.get_word(0x339e + 2 * i)); } @@ -3007,7 +3004,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) { moveTo(153, 163, 4); playActorAnimation(973); if (CHECK_FLAG(0xDBC1, 0)) { - SET_FLAG(0xDBC1, random.getRandomNumber(5) + 1); + SET_FLAG(0xDBC1, _rnd.getRandomNumber(5) + 1); } loadScene(30, 18, 159, 2); return true; diff --git a/engines/teenagent/console.cpp b/engines/teenagent/console.cpp index 60f7854f099..2f4d7cc9c30 100644 --- a/engines/teenagent/console.cpp +++ b/engines/teenagent/console.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "teenagent/console.h" diff --git a/engines/teenagent/console.h b/engines/teenagent/console.h index d6c24d4d8fd..ab2f0685202 100644 --- a/engines/teenagent/console.h +++ b/engines/teenagent/console.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TEENAGENT_CONSOLE_H diff --git a/engines/teenagent/detection.cpp b/engines/teenagent/detection.cpp index d741039e8da..5012e6af65c 100644 --- a/engines/teenagent/detection.cpp +++ b/engines/teenagent/detection.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/system.h" @@ -116,7 +113,7 @@ public: } virtual const char *getName() const { - return "Teen Agent Engine"; + return "TeenAgent"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/teenagent/dialog.cpp b/engines/teenagent/dialog.cpp index 2479da42a1b..400bd7cec2a 100644 --- a/engines/teenagent/dialog.cpp +++ b/engines/teenagent/dialog.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "teenagent/dialog.h" diff --git a/engines/teenagent/dialog.h b/engines/teenagent/dialog.h index 51597db6d9a..3bb7d818c18 100644 --- a/engines/teenagent/dialog.h +++ b/engines/teenagent/dialog.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TEENAGENT_DIALOG_H diff --git a/engines/teenagent/font.cpp b/engines/teenagent/font.cpp index 2d98ae9de75..f7558b60f2c 100644 --- a/engines/teenagent/font.cpp +++ b/engines/teenagent/font.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "teenagent/font.h" diff --git a/engines/teenagent/font.h b/engines/teenagent/font.h index 29a8121435c..773edaf4e22 100644 --- a/engines/teenagent/font.h +++ b/engines/teenagent/font.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TEENAGENT_FONT_H diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp index 4d18d68502d..8430f42c610 100644 --- a/engines/teenagent/inventory.cpp +++ b/engines/teenagent/inventory.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/memstream.h" @@ -46,22 +43,22 @@ Inventory::Inventory(TeenAgentEngine *engine) { if (!s) error("no inventory background"); debug(0, "loading inventory background..."); - background.load(s, Surface::kTypeOns); + _background.load(s, Surface::kTypeOns); } uint32 items_size = varia.getSize(4); if (items_size == 0) error("invalid inventory items size"); debug(0, "loading items, size: %u", items_size); - items = new byte[items_size]; - varia.read(4, items, items_size); + _items = new byte[items_size]; + varia.read(4, _items, items_size); - byte offsets = items[0]; + byte offsets = _items[0]; assert(offsets == 92); for (byte i = 0; i < offsets; ++i) { - offset[i] = READ_LE_UINT16(items + i * 2 + 1); + _offset[i] = READ_LE_UINT16(_items + i * 2 + 1); } - offset[92] = items_size; + _offset[92] = items_size; Resources *res = Resources::instance(); for (byte i = 0; i <= 92; ++i) { @@ -69,31 +66,31 @@ Inventory::Inventory(TeenAgentEngine *engine) { uint16 obj_addr = res->dseg.get_word(0xc4a4 + i * 2); if (obj_addr != 0) io.load(res->dseg.ptr(obj_addr)); - objects.push_back(io); + _objects.push_back(io); } - inventory = res->dseg.ptr(0xc48d); + _inventory = res->dseg.ptr(0xc48d); for (int y = 0; y < 4; ++y) for (int x = 0; x < 6; ++x) { int i = y * 6 + x; - graphics[i].rect.left = 28 + 45 * x - 1; - graphics[i].rect.top = 23 + 31 * y - 1; - graphics[i].rect.right = graphics[i].rect.left + 40; - graphics[i].rect.bottom = graphics[i].rect.top + 26; + _graphics[i]._rect.left = 28 + 45 * x - 1; + _graphics[i]._rect.top = 23 + 31 * y - 1; + _graphics[i]._rect.right = _graphics[i]._rect.left + 40; + _graphics[i]._rect.bottom = _graphics[i]._rect.top + 26; } varia.close(); - hovered_obj = selected_obj = NULL; + _hoveredObj = _selectedObj = NULL; } Inventory::~Inventory() { - delete[] items; + delete[] _items; } bool Inventory::has(byte item) const { for (int i = 0; i < 24; ++i) { - if (inventory[i] == item) + if (_inventory[i] == item) return true; } return false; @@ -103,32 +100,32 @@ void Inventory::remove(byte item) { debug(0, "removing %u from inventory", item); int i; for (i = 0; i < 24; ++i) { - if (inventory[i] == item) { + if (_inventory[i] == item) { break; } } for (; i < 23; ++i) { - inventory[i] = inventory[i + 1]; - graphics[i].free(); + _inventory[i] = _inventory[i + 1]; + _graphics[i].free(); } - inventory[23] = 0; - graphics[23].free(); + _inventory[23] = 0; + _graphics[23].free(); } void Inventory::clear() { debug(0, "clearing inventory"); for (int i = 0; i < 24; ++i) { - inventory[i] = 0; - graphics[i].free(); + _inventory[i] = 0; + _graphics[i].free(); } } void Inventory::reload() { for (int i = 0; i < 24; ++i) { - graphics[i].free(); - uint item = inventory[i]; + _graphics[i].free(); + uint item = _inventory[i]; if (item != 0) - graphics[i].load(this, item); + _graphics[i].load(this, item); } } @@ -137,8 +134,8 @@ void Inventory::add(byte item) { return; debug(0, "adding %u to inventory", item); for (int i = 0; i < 24; ++i) { - if (inventory[i] == 0) { - inventory[i] = item; + if (_inventory[i] == 0) { + _inventory[i] = item; return; } } @@ -168,27 +165,27 @@ bool Inventory::processEvent(const Common::Event &event) { if (!_active) { if (event.mouse.y < 5) activate(true); - mouse = event.mouse; + _mouse = event.mouse; return false; } - if (event.mouse.x < 17 || event.mouse.x >= 303 || (event.mouse.y - mouse.y > 0 && event.mouse.y >= 153)) { + if (event.mouse.x < 17 || event.mouse.x >= 303 || (event.mouse.y - _mouse.y > 0 && event.mouse.y >= 153)) { activate(false); - mouse = event.mouse; + _mouse = event.mouse; return false; } - mouse = event.mouse; - hovered_obj = NULL; + _mouse = event.mouse; + _hoveredObj = NULL; for (int i = 0; i < 24; ++i) { - byte item = inventory[i]; + byte item = _inventory[i]; if (item == 0) continue; - graphics[i].hovered = graphics[i].rect.in(mouse); - if (graphics[i].hovered) - hovered_obj = &objects[item]; + _graphics[i]._hovered = _graphics[i]._rect.in(_mouse); + if (_graphics[i]._hovered) + _hoveredObj = &_objects[item]; } return true; @@ -197,22 +194,22 @@ bool Inventory::processEvent(const Common::Event &event) { if (!_active) return false; - if (hovered_obj == NULL) + if (_hoveredObj == NULL) return true; - debug(0, "lclick on %u:%s", hovered_obj->id, hovered_obj->name.c_str()); + debug(0, "lclick on %u:%s", _hoveredObj->id, _hoveredObj->name.c_str()); - if (selected_obj == NULL) { - if (tryObjectCallback(hovered_obj)) + if (_selectedObj == NULL) { + if (tryObjectCallback(_hoveredObj)) return true; //activate(false); - int w = res->font7.render(NULL, 0, 0, hovered_obj->description, 0xd1); - _engine->scene->displayMessage(hovered_obj->description, 0xd1, Common::Point((320 - w) / 2, 162)); + int w = res->font7.render(NULL, 0, 0, _hoveredObj->description, 0xd1); + _engine->scene->displayMessage(_hoveredObj->description, 0xd1, Common::Point((320 - w) / 2, 162)); return true; } - int id1 = selected_obj->id; - int id2 = hovered_obj->id; + int id1 = _selectedObj->id; + int id2 = _hoveredObj->id; if (id1 == id2) return true; @@ -249,15 +246,15 @@ bool Inventory::processEvent(const Common::Event &event) { if (!_active) return false; - if (hovered_obj != NULL) { - debug(0, "rclick object %u:%s", hovered_obj->id, hovered_obj->name.c_str()); - if (hovered_obj->id != 51 && tryObjectCallback(hovered_obj)) //do not process callback for banknote on r-click + if (_hoveredObj != NULL) { + debug(0, "rclick object %u:%s", _hoveredObj->id, _hoveredObj->name.c_str()); + if (_hoveredObj->id != 51 && tryObjectCallback(_hoveredObj)) //do not process callback for banknote on r-click return true; } - selected_obj = hovered_obj; - if (selected_obj) - debug(0, "selected object %s", selected_obj->name.c_str()); + _selectedObj = _hoveredObj; + if (_selectedObj) + debug(0, "selected object %s", _selectedObj->name.c_str()); return true; case Common::EVENT_KEYDOWN: @@ -282,13 +279,13 @@ bool Inventory::processEvent(const Common::Event &event) { void Inventory::Item::free() { - animation.free(); - surface.free(); + _animation.free(); + _surface.free(); } void Inventory::Item::backgroundEffect(Graphics::Surface *s) { - uint w = rect.right - rect.left, h = rect.bottom - rect.top; - byte *line = (byte *)s->getBasePtr(rect.left, rect.top); + uint w = _rect.right - _rect.left, h = _rect.bottom - _rect.top; + byte *line = (byte *)s->getBasePtr(_rect.left, _rect.top); for(uint y = 0; y < h; ++y, line += s->pitch) { byte *dst = line; for(uint x = 0; x < w; ++x, ++dst) { @@ -298,54 +295,54 @@ void Inventory::Item::backgroundEffect(Graphics::Surface *s) { } void Inventory::Item::load(Inventory *inventory, uint item_id) { - InventoryObject *obj = &inventory->objects[item_id]; + InventoryObject *obj = &inventory->_objects[item_id]; if (obj->animated) { - if (animation.empty()) { - debug(0, "loading item %d from offset %x", obj->id, inventory->offset[obj->id - 1]); - Common::MemoryReadStream s(inventory->items + inventory->offset[obj->id - 1], inventory->offset[obj->id] - inventory->offset[obj->id - 1]); - animation.load(&s, Animation::kTypeInventory); + if (_animation.empty()) { + debug(0, "loading item %d from offset %x", obj->id, inventory->_offset[obj->id - 1]); + Common::MemoryReadStream s(inventory->_items + inventory->_offset[obj->id - 1], inventory->_offset[obj->id] - inventory->_offset[obj->id - 1]); + _animation.load(&s, Animation::kTypeInventory); } } else { - if (surface.empty()) { - debug(0, "loading item %d from offset %x", obj->id, inventory->offset[obj->id - 1]); - Common::MemoryReadStream s(inventory->items + inventory->offset[obj->id - 1], inventory->offset[obj->id] - inventory->offset[obj->id - 1]); - surface.load(&s, Surface::kTypeOns); + if (_surface.empty()) { + debug(0, "loading item %d from offset %x", obj->id, inventory->_offset[obj->id - 1]); + Common::MemoryReadStream s(inventory->_items + inventory->_offset[obj->id - 1], inventory->_offset[obj->id] - inventory->_offset[obj->id - 1]); + _surface.load(&s, Surface::kTypeOns); } } } void Inventory::Item::render(Inventory *inventory, uint item_id, Graphics::Surface *dst, int delta) { - InventoryObject *obj = &inventory->objects[item_id]; + InventoryObject *obj = &inventory->_objects[item_id]; Resources *res = Resources::instance(); backgroundEffect(dst); - rect.render(dst, hovered ? 233 : 234); + _rect.render(dst, _hovered ? 233 : 234); load(inventory, item_id); if (obj->animated) { - if (hovered) { - Surface *s = animation.currentFrame(delta); - if (animation.currentIndex() == 0) - s = animation.currentFrame(1); //force index to be 1 here + if (_hovered) { + Surface *s = _animation.currentFrame(delta); + if (_animation.currentIndex() == 0) + s = _animation.currentFrame(1); //force index to be 1 here if (s != NULL) - s->render(dst, rect.left + 1, rect.top + 1); + s->render(dst, _rect.left + 1, _rect.top + 1); } else { - Surface *s = animation.firstFrame(); + Surface *s = _animation.firstFrame(); if (s != NULL) - s->render(dst, rect.left + 1, rect.top + 1); + s->render(dst, _rect.left + 1, _rect.top + 1); } } else { - surface.render(dst, rect.left + 1, rect.top + 1); + _surface.render(dst, _rect.left + 1, _rect.top + 1); } Common::String name; - if (inventory->selected_obj) { - name = inventory->selected_obj->name; + if (inventory->_selectedObj) { + name = inventory->_selectedObj->name; name += " & "; } - if (inventory->selected_obj != inventory->hovered_obj) + if (inventory->_selectedObj != inventory->_hoveredObj) name += obj->name; - if (hovered && inventory->_engine->scene->getMessage().empty()) { + if (_hovered && inventory->_engine->scene->getMessage().empty()) { int w = res->font7.render(NULL, 0, 0, name, 0xd1, true); res->font7.render(dst, (320 - w) / 2, 180, name, 0xd1, true); } @@ -355,17 +352,17 @@ void Inventory::render(Graphics::Surface *surface, int delta) { if (!_active) return; - background.render(surface); + _background.render(surface); for (int y = 0; y < 4; y++) { for (int x = 0; x < 6; x++) { int idx = x + 6 * y; - byte item = inventory[idx]; + byte item = _inventory[idx]; if (item == 0) continue; //debug(0, "%d,%d -> %u", x0, y0, item); - graphics[idx].render(this, item, surface, delta); + _graphics[idx].render(this, item, surface, delta); } } } diff --git a/engines/teenagent/inventory.h b/engines/teenagent/inventory.h index ad73ff25a96..55c58a1c22c 100644 --- a/engines/teenagent/inventory.h +++ b/engines/teenagent/inventory.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TEENAGENT_INVENTORY_H @@ -54,37 +51,40 @@ public: bool processEvent(const Common::Event &event); - InventoryObject *selectedObject() { return selected_obj; } - void resetSelectedObject() { selected_obj = NULL; } + InventoryObject *selectedObject() { return _selectedObj; } + void resetSelectedObject() { _selectedObj = NULL; } private: TeenAgentEngine *_engine; - Surface background; - byte *items; - uint offset[93]; + Surface _background; + byte *_items; + uint _offset[93]; + + Common::Array _objects; + byte *_inventory; - Common::Array objects; - byte *inventory; struct Item { - Animation animation; - Surface surface; - Rect rect; - bool hovered; + Animation _animation; + Surface _surface; + Rect _rect; + bool _hovered; - Item() : hovered(false) {} + Item() : _hovered(false) {} void free(); void load(Inventory *inventory, uint item_id); void backgroundEffect(Graphics::Surface *s); void render(Inventory *inventory, uint item_id, Graphics::Surface *surface, int delta); - } graphics[24]; + }; + + Item _graphics[24]; bool _active; - Common::Point mouse; - int hovered; + Common::Point _mouse; bool tryObjectCallback(InventoryObject *obj); - InventoryObject *hovered_obj, *selected_obj; + InventoryObject *_hoveredObj; + InventoryObject *_selectedObj; }; } // End of namespace TeenAgent diff --git a/engines/teenagent/music.cpp b/engines/teenagent/music.cpp index f0be5165f6f..0f70f4b0822 100644 --- a/engines/teenagent/music.cpp +++ b/engines/teenagent/music.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "teenagent/music.h" diff --git a/engines/teenagent/music.h b/engines/teenagent/music.h index 52a347bf10b..bf36ac70575 100644 --- a/engines/teenagent/music.h +++ b/engines/teenagent/music.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TEEN_MUSIC_H diff --git a/engines/teenagent/objects.cpp b/engines/teenagent/objects.cpp index e6442d38092..74e3a4944df 100644 --- a/engines/teenagent/objects.cpp +++ b/engines/teenagent/objects.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/debug.h" diff --git a/engines/teenagent/objects.h b/engines/teenagent/objects.h index 59e9d732fcf..d1e4388a15b 100644 --- a/engines/teenagent/objects.h +++ b/engines/teenagent/objects.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/teenagent/pack.cpp b/engines/teenagent/pack.cpp index 8584e05807d..aada922f7df 100644 --- a/engines/teenagent/pack.cpp +++ b/engines/teenagent/pack.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "teenagent/pack.h" diff --git a/engines/teenagent/pack.h b/engines/teenagent/pack.h index a24091e1537..09168676e21 100644 --- a/engines/teenagent/pack.h +++ b/engines/teenagent/pack.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ diff --git a/engines/teenagent/resources.cpp b/engines/teenagent/resources.cpp index 69908239ab5..9e69383215f 100644 --- a/engines/teenagent/resources.cpp +++ b/engines/teenagent/resources.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "teenagent/resources.h" diff --git a/engines/teenagent/resources.h b/engines/teenagent/resources.h index d49602c3c55..c2eb32dbd47 100644 --- a/engines/teenagent/resources.h +++ b/engines/teenagent/resources.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TEENAGENT_RESOURCES_H diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp index ee431b2ab5e..ef18b95f5a2 100644 --- a/engines/teenagent/scene.cpp +++ b/engines/teenagent/scene.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/config-manager.h" @@ -807,7 +804,7 @@ bool Scene::render(bool tick_game, bool tick_mark, uint32 delta) { if (_idle_timer < 50) actor_animation_position = teenagent.render(surface, position, orientation, 0, actor_talking, zoom); else - actor_animation_position = teenagent_idle.renderIdle(surface, position, orientation, mark_delta, zoom); + actor_animation_position = teenagent_idle.renderIdle(surface, position, orientation, mark_delta, zoom, _engine->_rnd); } } diff --git a/engines/teenagent/scene.h b/engines/teenagent/scene.h index 28def3a0644..bc101847fa1 100644 --- a/engines/teenagent/scene.h +++ b/engines/teenagent/scene.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TEENAGENT_SCENE_H diff --git a/engines/teenagent/segment.cpp b/engines/teenagent/segment.cpp index 829c84765de..cb17190da7f 100644 --- a/engines/teenagent/segment.cpp +++ b/engines/teenagent/segment.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "teenagent/segment.h" diff --git a/engines/teenagent/segment.h b/engines/teenagent/segment.h index 98bd9ca0c91..303198b0719 100644 --- a/engines/teenagent/segment.h +++ b/engines/teenagent/segment.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TEENAGENT_SEGMENT_H diff --git a/engines/teenagent/surface.cpp b/engines/teenagent/surface.cpp index 545b0f75f0b..2e23c7a8ed7 100644 --- a/engines/teenagent/surface.cpp +++ b/engines/teenagent/surface.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "teenagent/surface.h" diff --git a/engines/teenagent/surface.h b/engines/teenagent/surface.h index 82c13c84bdd..5f74176c686 100644 --- a/engines/teenagent/surface.h +++ b/engines/teenagent/surface.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TEENAGENT_SURFACE_H diff --git a/engines/teenagent/surface_list.cpp b/engines/teenagent/surface_list.cpp index 972c7a41860..e98153a9354 100644 --- a/engines/teenagent/surface_list.cpp +++ b/engines/teenagent/surface_list.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "teenagent/surface.h" diff --git a/engines/teenagent/surface_list.h b/engines/teenagent/surface_list.h index 23e0ff423af..d949a722d6c 100644 --- a/engines/teenagent/surface_list.h +++ b/engines/teenagent/surface_list.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TEENAGENT_SURFACE_LIST_H__ diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp index ec1e945f8d6..f076dbc0a16 100644 --- a/engines/teenagent/teenagent.cpp +++ b/engines/teenagent/teenagent.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/config-manager.h" @@ -50,7 +47,9 @@ namespace TeenAgent { -TeenAgentEngine::TeenAgentEngine(OSystem *system, const ADGameDescription *gd) : Engine(system), action(kActionNone), _gameDescription(gd) { +TeenAgentEngine::TeenAgentEngine(OSystem *system, const ADGameDescription *gd) + : Engine(system), action(kActionNone), _gameDescription(gd), + _rnd("teenagent") { music = new MusicPlayer(); console = 0; @@ -399,8 +398,8 @@ bool TeenAgentEngine::showMetropolis() { //generate colors matrix memmove(colors + 320, colors + 480, 8480); for(uint c = 0; c < 17; ++c) { - byte x = (random.getRandomNumber(184) + 5) & 0xff; - uint offset = 8800 + random.getRandomNumber(158); + byte x = (_rnd.getRandomNumber(184) + 5) & 0xff; + uint offset = 8800 + _rnd.getRandomNumber(158); colors[offset++] = x; colors[offset++] = x; } diff --git a/engines/teenagent/teenagent.h b/engines/teenagent/teenagent.h index a43ee68f56a..bc802da8bcb 100644 --- a/engines/teenagent/teenagent.h +++ b/engines/teenagent/teenagent.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TEENAGENT_ENGINE_H @@ -50,7 +47,7 @@ class Scene; class MusicPlayer; class Console; -class TeenAgentEngine: public Engine { +class TeenAgentEngine : public Engine { public: enum Action { kActionNone, kActionExamine, kActionUse }; @@ -120,7 +117,7 @@ public: void fadeOut(); void wait(uint16 frames); - Common::RandomSource random; + Common::RandomSource _rnd; Scene *scene; Inventory *inventory; diff --git a/engines/testbed/config-params.cpp b/engines/testbed/config-params.cpp index c9f3932539e..9a5062185b2 100644 --- a/engines/testbed/config-params.cpp +++ b/engines/testbed/config-params.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/config-manager.h" diff --git a/engines/testbed/config-params.h b/engines/testbed/config-params.h index 7a0e1cf5f22..e982f62c723 100644 --- a/engines/testbed/config-params.h +++ b/engines/testbed/config-params.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_CONFIG_PARAMS_H diff --git a/engines/testbed/config.cpp b/engines/testbed/config.cpp index 4f871db8d22..6adf82952f2 100644 --- a/engines/testbed/config.cpp +++ b/engines/testbed/config.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/stream.h" diff --git a/engines/testbed/config.h b/engines/testbed/config.h index cf1948b412f..c0df65ad321 100644 --- a/engines/testbed/config.h +++ b/engines/testbed/config.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_CONFIG_H diff --git a/engines/testbed/detection.cpp b/engines/testbed/detection.cpp index b08cca291a6..91518b2b8ea 100644 --- a/engines/testbed/detection.cpp +++ b/engines/testbed/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "engines/advancedDetector.h" diff --git a/engines/testbed/events.cpp b/engines/testbed/events.cpp index 37b0a7ead4c..78de87e1332 100644 --- a/engines/testbed/events.cpp +++ b/engines/testbed/events.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/events.h" diff --git a/engines/testbed/events.h b/engines/testbed/events.h index 607bba79d58..00a659bd33a 100644 --- a/engines/testbed/events.h +++ b/engines/testbed/events.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_EVENTS_H diff --git a/engines/testbed/fs.cpp b/engines/testbed/fs.cpp index f9512249101..e2bedb18981 100644 --- a/engines/testbed/fs.cpp +++ b/engines/testbed/fs.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/config-manager.h" diff --git a/engines/testbed/fs.h b/engines/testbed/fs.h index c51d898c9d2..1cb7b3a8710 100644 --- a/engines/testbed/fs.h +++ b/engines/testbed/fs.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_FS_H diff --git a/engines/testbed/graphics.cpp b/engines/testbed/graphics.cpp index c8558e30f4a..b38b83f222f 100644 --- a/engines/testbed/graphics.cpp +++ b/engines/testbed/graphics.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/events.h" diff --git a/engines/testbed/graphics.h b/engines/testbed/graphics.h index a4e698b44cd..7fa8f9d7085 100644 --- a/engines/testbed/graphics.h +++ b/engines/testbed/graphics.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_GRAPHICS_H diff --git a/engines/testbed/midi.cpp b/engines/testbed/midi.cpp index 7ec24aa6702..54be866b4c5 100644 --- a/engines/testbed/midi.cpp +++ b/engines/testbed/midi.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/archive.h" diff --git a/engines/testbed/midi.h b/engines/testbed/midi.h index 676229570ee..02550a6eb2c 100644 --- a/engines/testbed/midi.h +++ b/engines/testbed/midi.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_MIDI_H diff --git a/engines/testbed/misc.cpp b/engines/testbed/misc.cpp index 36687f570e6..35b3c6bfe2e 100644 --- a/engines/testbed/misc.cpp +++ b/engines/testbed/misc.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "testbed/misc.h" diff --git a/engines/testbed/misc.h b/engines/testbed/misc.h index 395955c7fe3..415fe82903f 100644 --- a/engines/testbed/misc.h +++ b/engines/testbed/misc.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_MISC_H diff --git a/engines/testbed/savegame.cpp b/engines/testbed/savegame.cpp index 0ffd3672fa6..b19c8e38721 100644 --- a/engines/testbed/savegame.cpp +++ b/engines/testbed/savegame.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/savefile.h" diff --git a/engines/testbed/savegame.h b/engines/testbed/savegame.h index dc41ff9b650..2c9ec83470d 100644 --- a/engines/testbed/savegame.h +++ b/engines/testbed/savegame.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_SAVEGAME_H diff --git a/engines/testbed/sound.cpp b/engines/testbed/sound.cpp index dca116368ed..bb7ae2c055f 100644 --- a/engines/testbed/sound.cpp +++ b/engines/testbed/sound.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "audio/softsynth/pcspk.h" diff --git a/engines/testbed/sound.h b/engines/testbed/sound.h index b797ecb2b06..76d0c7bb612 100644 --- a/engines/testbed/sound.h +++ b/engines/testbed/sound.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_SOUND_H diff --git a/engines/testbed/template.h b/engines/testbed/template.h index 849d157a032..847777f34b9 100644 --- a/engines/testbed/template.h +++ b/engines/testbed/template.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_TEMPLATE_H diff --git a/engines/testbed/testbed.cpp b/engines/testbed/testbed.cpp index 179be2bb8ba..41a705e2929 100644 --- a/engines/testbed/testbed.cpp +++ b/engines/testbed/testbed.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/debug-channels.h" diff --git a/engines/testbed/testbed.h b/engines/testbed/testbed.h index ca803a4cecd..6933efa0f07 100644 --- a/engines/testbed/testbed.h +++ b/engines/testbed/testbed.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_H diff --git a/engines/testbed/testsuite.cpp b/engines/testbed/testsuite.cpp index fa8764e8690..77211b3e64f 100644 --- a/engines/testbed/testsuite.cpp +++ b/engines/testbed/testsuite.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/config-manager.h" diff --git a/engines/testbed/testsuite.h b/engines/testbed/testsuite.h index 94b3d70fd4e..3a3a78b9bb7 100644 --- a/engines/testbed/testsuite.h +++ b/engines/testbed/testsuite.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_TESTSUITE_H diff --git a/engines/tinsel/actors.cpp b/engines/tinsel/actors.cpp index 9ec253e5120..4e9847f8b4f 100644 --- a/engines/tinsel/actors.cpp +++ b/engines/tinsel/actors.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Handles things to do with actors, delegates much moving actor stuff. */ @@ -437,7 +434,7 @@ void StartTaggedActors(SCNHANDLE ah, int numActors, bool bRunScript) { memset(taggedActors, 0, sizeof(taggedActors)); numTaggedActors = numActors; } else { - // Only actors with code blocks got (x, y) re-initialised, so... + // Only actors with code blocks got (x, y) re-initialized, so... for (i = 0; i < NumActors; i++) { actorInfo[i].x = actorInfo[i].y = 0; actorInfo[i].mtype = 0; diff --git a/engines/tinsel/actors.h b/engines/tinsel/actors.h index 2be42b00e66..e707db77ba4 100644 --- a/engines/tinsel/actors.h +++ b/engines/tinsel/actors.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Prototypes of actor functions */ diff --git a/engines/tinsel/adpcm.cpp b/engines/tinsel/adpcm.cpp index 530395d7545..4ea835586b7 100644 --- a/engines/tinsel/adpcm.cpp +++ b/engines/tinsel/adpcm.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/stream.h" diff --git a/engines/tinsel/adpcm.h b/engines/tinsel/adpcm.h index 79d537eef6e..3e899d94c38 100644 --- a/engines/tinsel/adpcm.h +++ b/engines/tinsel/adpcm.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_ADPCM_H diff --git a/engines/tinsel/anim.cpp b/engines/tinsel/anim.cpp index 61c8b676241..034296ccc74 100644 --- a/engines/tinsel/anim.cpp +++ b/engines/tinsel/anim.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * This file contains utilities to handle object animation. */ diff --git a/engines/tinsel/anim.h b/engines/tinsel/anim.h index 97065f6a545..0c60cf84d42 100644 --- a/engines/tinsel/anim.h +++ b/engines/tinsel/anim.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Object animation definitions */ diff --git a/engines/tinsel/background.cpp b/engines/tinsel/background.cpp index 79f051420ba..72397db97fb 100644 --- a/engines/tinsel/background.cpp +++ b/engines/tinsel/background.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Background handling code. */ @@ -40,7 +37,7 @@ namespace Tinsel { const BACKGND *pCurBgnd = NULL; /** - * Called to initialise a background. + * Called to initialize a background. * @param pBgnd Pointer to data struct for current background */ @@ -152,7 +149,7 @@ int PlayfieldGetCenterX(int which) { * @param which Which playfield */ -OBJECT *GetPlayfieldList(int which) { +OBJECT **GetPlayfieldList(int which) { PLAYFIELD *pPlayfield; // pointer to relavent playfield // make sure there is a background @@ -165,7 +162,7 @@ OBJECT *GetPlayfieldList(int which) { pPlayfield = pCurBgnd->fieldArray + which; // return the display list pointer for this playfield - return pPlayfield->pDispList; + return &pPlayfield->pDispList; } /** @@ -205,10 +202,10 @@ void DrawBackgnd() { pPlay->bMoved = true; // sort the display list for this background - just in case somebody has changed object Z positions - SortObjectList(pPlay->pDispList); + SortObjectList(&pPlay->pDispList); // generate clipping rects for all objects that have moved etc. - FindMovingObjects(pPlay->pDispList, &ptWin, + FindMovingObjects(&pPlay->pDispList, &ptWin, &pPlay->rcClip, false, pPlay->bMoved); // clear playfield moved flag @@ -235,8 +232,7 @@ void DrawBackgnd() { if (IntersectRectangle(rcPlayClip, pPlay->rcClip, *r)) // redraw all objects within this clipping rect - UpdateClipRect(pPlay->pDispList, - &ptWin, &rcPlayClip); + UpdateClipRect(&pPlay->pDispList, &ptWin, &rcPlayClip); } } diff --git a/engines/tinsel/background.h b/engines/tinsel/background.h index 06789e50bf0..34f1bd6dd28 100644 --- a/engines/tinsel/background.h +++ b/engines/tinsel/background.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Data structures used for handling backgrounds */ @@ -76,7 +73,7 @@ struct BACKGND { |* Background Function Prototypes *| \*----------------------------------------------------------------------*/ -void InitBackground( // called to initialise a background +void InitBackground( // called to initialize a background const BACKGND *pBgnd); // pointer to data struct for current background void StartupBackground(CORO_PARAM, SCNHANDLE hFilm); @@ -96,7 +93,7 @@ void PlayfieldGetPos( // Returns the xy position of the specified playfield in int PlayfieldGetCenterX( // Returns the xy position of the specified playfield in the current background int which); // which playfield -OBJECT *GetPlayfieldList( // Returns the display list for the specified playfield +OBJECT **GetPlayfieldList( // Returns the display list for the specified playfield int which); // which playfield void KillPlayfieldList( // Kills all the objects on the display list for the specified playfield diff --git a/engines/tinsel/bg.cpp b/engines/tinsel/bg.cpp index 0e67c3a06ed..cf692e16eaf 100644 --- a/engines/tinsel/bg.cpp +++ b/engines/tinsel/bg.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Plays the background film of a scene. */ @@ -129,7 +126,7 @@ static void BGmainProcess(CORO_PARAM, const void *param) { // Get the MULTI_INIT structure pmi = (const MULTI_INIT *)LockMem(FROM_LE_32(pReel->mobj)); - // Initialise and insert the object, and initialise its script. + // Initialize and insert the object, and initialize its script. pBG[0] = MultiInitObject(pmi); MultiInsertObject(GetPlayfieldList(FIELD_WORLD), pBG[0]); InitStepAnimScript(&thisAnim[0], pBG[0], FROM_LE_32(pReel->script), BGspeed); @@ -144,7 +141,7 @@ static void BGmainProcess(CORO_PARAM, const void *param) { // Get the MULTI_INIT structure pmi = (PMULTI_INIT) LockMem(FROM_LE_32(pFilm->reels[i].mobj)); - // Initialise and insert the object, and initialise its script. + // Initialize and insert the object, and initialize its script. pBG[i] = MultiInitObject(pmi); MultiInsertObject(GetPlayfieldList(FIELD_WORLD), pBG[i]); MultiSetZPosition(pBG[i], 0); @@ -179,7 +176,7 @@ static void BGmainProcess(CORO_PARAM, const void *param) { pFilm = (const FILM *)LockMem(hBackground); assert(bgReels == (int32)FROM_LE_32(pFilm->numreels)); - // Just re-initialise the scripts. + // Just re-initialize the scripts. for (int i = 0; i < bgReels; i++) { InitStepAnimScript(&thisAnim[i], pBG[i], pFilm->reels[i].script, BGspeed); StepAnimScript(&thisAnim[i]); @@ -205,7 +202,7 @@ static void BGotherProcess(CORO_PARAM, const void *param) { CORO_BEGIN_CODE(_ctx); - // Initialise and insert the object, and initialise its script. + // Initialize and insert the object, and initialize its script. _ctx->pObj = MultiInitObject(pmi); MultiInsertObject(GetPlayfieldList(FIELD_WORLD), _ctx->pObj); diff --git a/engines/tinsel/bmv.cpp b/engines/tinsel/bmv.cpp index 793febdc21d..24d47b920f4 100644 --- a/engines/tinsel/bmv.cpp +++ b/engines/tinsel/bmv.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * The movie player. */ @@ -388,7 +385,7 @@ void BMVPlayer::MoviePalette(int paletteOffset) { SetTextPal(talkColor); } -void BMVPlayer::InitialiseMovieSound() { +void BMVPlayer::InitializeMovieSound() { _audioStream = Audio::makeQueuingAudioStream(22050, true); audioStarted = false; } @@ -666,7 +663,7 @@ void BMVPlayer::LoadSlots(int number) { /** * Called from the foreground when starting playback of a movie. */ -void BMVPlayer::InitialiseBMV() { +void BMVPlayer::InitializeBMV() { if (!stream.open(szMovieFile)) error(CANNOT_FIND_FILE, szMovieFile); @@ -683,7 +680,7 @@ void BMVPlayer::InitialiseBMV() { // Pass the sceen buffer to the decompresser InitBMV(screenBuffer); - // Initialise some stuff + // Initialize some stuff nextUseOffset = 0; nextSoundOffset = 0; wrapUseOffset = -1; @@ -708,8 +705,8 @@ void BMVPlayer::InitialiseBMV() { while (numAdvancePackets < ADVANCE_SOUND) LoadSlots(1); - // Initialise the sound channel - InitialiseMovieSound(); + // Initialize the sound channel + InitializeMovieSound(); } /** @@ -1069,7 +1066,7 @@ void BMVPlayer::FettleBMV() { // First time in with this movie - InitialiseBMV(); + InitializeBMV(); for (i = 0; i < ADVANCE_SOUND;) { if (DoSoundFrame()) diff --git a/engines/tinsel/bmv.h b/engines/tinsel/bmv.h index d90d68fc13c..eadf65c3aab 100644 --- a/engines/tinsel/bmv.h +++ b/engines/tinsel/bmv.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Plays films within a scene, takes into account the actor in each 'column'. */ @@ -137,7 +134,7 @@ private: void InitBMV(byte *memoryBuffer); void PrepAudio(const byte *sourceData, int blobCount, byte *destPtr); void MoviePalette(int paletteOffset); - void InitialiseMovieSound(); + void InitializeMovieSound(); void StartMovieSound(); void FinishMovieSound(); void MovieAudio(int audioOffset, int blobs); @@ -147,7 +144,7 @@ private: int MovieCommand(char cmd, int commandOffset); int FollowingPacket(int thisPacket, bool bReallyImportant); void LoadSlots(int number); - void InitialiseBMV(); + void InitializeBMV(); bool MaintainBuffer(); bool DoBMVFrame(); bool DoSoundFrame(); diff --git a/engines/tinsel/cliprect.cpp b/engines/tinsel/cliprect.cpp index 5f287d3eab0..76feede83f8 100644 --- a/engines/tinsel/cliprect.cpp +++ b/engines/tinsel/cliprect.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * This file contains the clipping rectangle code. */ @@ -108,10 +105,10 @@ static bool LooseIntersectRectangle(const Common::Rect &pSrc1, const Common::Rec * @param bNoVelocity When reset, objects pos is updated with velocity * @param bScrolled) When set, playfield has scrolled */ -void FindMovingObjects(OBJECT *pObjList, Common::Point *pWin, Common::Rect *pClip, bool bNoVelocity, bool bScrolled) { +void FindMovingObjects(OBJECT **pObjList, Common::Point *pWin, Common::Rect *pClip, bool bNoVelocity, bool bScrolled) { OBJECT *pObj; // object list traversal pointer - for (pObj = pObjList->pNext; pObj != NULL; pObj = pObj->pNext) { + for (pObj = *pObjList; pObj != NULL; pObj = pObj->pNext) { if (!bNoVelocity) { // we want to add velocities to objects position @@ -206,16 +203,16 @@ void MergeClipRect() { * @param pWin Window top left position * @param pClip Pointer to clip rectangle */ -void UpdateClipRect(OBJECT *pObjList, Common::Point *pWin, Common::Rect *pClip) { +void UpdateClipRect(OBJECT **pObjList, Common::Point *pWin, Common::Rect *pClip) { int x, y, right, bottom; // object corners int hclip, vclip; // total size of object clipping DRAWOBJECT currentObj; // filled in to draw the current object in list OBJECT *pObj; // object list iterator - // Initialise the fields of the drawing object to empty + // Initialize the fields of the drawing object to empty memset(¤tObj, 0, sizeof(DRAWOBJECT)); - for (pObj = pObjList->pNext; pObj != NULL; pObj = pObj->pNext) { + for (pObj = *pObjList; pObj != NULL; pObj = pObj->pNext) { if (pObj->flags & DMA_ABS) { // object position is absolute x = fracToInt(pObj->xPos); diff --git a/engines/tinsel/cliprect.h b/engines/tinsel/cliprect.h index 7bbb6bdc25e..101289b8379 100644 --- a/engines/tinsel/cliprect.h +++ b/engines/tinsel/cliprect.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Clipping rectangle defines */ @@ -58,7 +55,7 @@ bool UnionRectangle( // Creates the union of two rectangles const Common::Rect &pSrc2); // a source rectangle void FindMovingObjects( // Creates clipping rectangles for all the objects that have moved on the specified object list - OBJECT *pObjList, // playfield display list to draw + OBJECT **pObjList, // playfield display list to draw Common::Point *pWin, // playfield window top left position Common::Rect *pClip, // playfield clipping rectangle bool bVelocity, // when set, objects pos is updated with velocity @@ -67,7 +64,7 @@ void FindMovingObjects( // Creates clipping rectangles for all the objects that void MergeClipRect(); // Merges any clipping rectangles that overlap void UpdateClipRect( // Redraws all objects within this clipping rectangle - OBJECT *pObjList, // object list to draw + OBJECT **pObjList, // object list to draw Common::Point *pWin, // window top left position Common::Rect *pClip); // pointer to clip rectangle diff --git a/engines/tinsel/config.cpp b/engines/tinsel/config.cpp index a206ebf03b2..fd278db9723 100644 --- a/engines/tinsel/config.cpp +++ b/engines/tinsel/config.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * This file contains configuration functionality */ diff --git a/engines/tinsel/config.h b/engines/tinsel/config.h index dcfaf47b0cd..8b6b6757668 100644 --- a/engines/tinsel/config.h +++ b/engines/tinsel/config.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_CONFIG_H diff --git a/engines/tinsel/coroutine.cpp b/engines/tinsel/coroutine.cpp index b568cb4a463..998d98b52a5 100644 --- a/engines/tinsel/coroutine.cpp +++ b/engines/tinsel/coroutine.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "tinsel/coroutine.h" diff --git a/engines/tinsel/coroutine.h b/engines/tinsel/coroutine.h index b14030c708d..b62c40b4e5d 100644 --- a/engines/tinsel/coroutine.h +++ b/engines/tinsel/coroutine.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_COROUTINE_H diff --git a/engines/tinsel/cursor.cpp b/engines/tinsel/cursor.cpp index 66dc47df1f2..8248609a811 100644 --- a/engines/tinsel/cursor.cpp +++ b/engines/tinsel/cursor.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Cursor and cursor trails. */ @@ -80,7 +77,7 @@ static int nextTrail = 0; static bool bWhoa = false; // Set by DropCursor() at the end of a scene // - causes cursor processes to do nothing - // Reset when main cursor has re-initialised + // Reset when main cursor has re-initialized static uint16 restart = 0; // When main cursor has been bWhoa-ed, it waits // for this to be set to 0x8000. @@ -109,8 +106,8 @@ static int lastCursorX = 0, lastCursorY = 0; static void DoCursorMove(); /** - * Initialise and insert a cursor trail object, set its Z-pos, and hide - * it. Also initialise its animation script. + * Initialize and insert a cursor trail object, set its Z-pos, and hide + * it. Also initialize its animation script. */ static void InitCurTrailObj(int i, int x, int y) { const FREEL *pfr; // pointer to reel @@ -130,13 +127,13 @@ static void InitCurTrailObj(int i, int x, int y) { assert(BgPal()); // No background palette pim->hImgPal = TO_LE_32(BgPal()); - // Initialise and insert the object, set its Z-pos, and hide it + // Initialize and insert the object, set its Z-pos, and hide it ntrailData[i].trailObj = MultiInitObject(pmi); MultiInsertObject(GetPlayfieldList(FIELD_STATUS), ntrailData[i].trailObj); MultiSetZPosition(ntrailData[i].trailObj, Z_CURSORTRAIL); MultiSetAniXY(ntrailData[i].trailObj, x, y); - // Initialise the animation script + // Initialize the animation script InitStepAnimScript(&ntrailData[i].trailAnim, ntrailData[i].trailObj, FROM_LE_32(pfr->script), ONE_SECOND / FROM_LE_32(pfilm->frate)); StepAnimScript(&ntrailData[i].trailAnim); } @@ -230,7 +227,7 @@ void GetCursorXY(int *x, int *y, bool absolute) { } /** - * Re-initialise the main cursor to use the main cursor reel. + * Re-initialize the main cursor to use the main cursor reel. * Called from TINLIB.C to restore cursor after hiding it. * Called from INVENTRY.C to restore cursor after customising it. */ @@ -388,11 +385,11 @@ void SetAuxCursor(SCNHANDLE hFilm) { ACoY = (short)((FROM_LE_16(pim->imgHeight) & ~C16_FLAG_MASK)/2 - ((int16) FROM_LE_16(pim->anioffY))); - // Initialise and insert the auxillary cursor object + // Initialize and insert the auxillary cursor object AcurObj = MultiInitObject(pmi); MultiInsertObject(GetPlayfieldList(FIELD_STATUS), AcurObj); - // Initialise the animation and set its position + // Initialize the animation and set its position InitStepAnimScript(&AcurAnim, AcurObj, FROM_LE_32(pfr->script), ONE_SECOND / FROM_LE_32(pfilm->frate)); MultiSetAniXY(AcurObj, x - ACoX, y - ACoY); MultiSetZPosition(AcurObj, Z_ACURSOR); @@ -473,7 +470,7 @@ static void DoCursorMove() { } /** - * Initialise cursor object. + * Initialize cursor object. */ static void InitCurObj() { const FILM *pFilm; @@ -503,7 +500,7 @@ static void InitCurObj() { } /** - * Initialise the cursor position. + * Initialize the cursor position. */ static void InitCurPos() { Common::Point ptMouse = _vm->getMousePosition(); @@ -533,7 +530,7 @@ static void CursorStoppedCheck(CORO_PARAM) { while (restart != 0x8000) CORO_SLEEP(1); - // Re-initialise + // Re-initialize InitCurObj(); InitCurPos(); InventoryIconCursor(false); // May be holding something @@ -659,7 +656,7 @@ void DropCursor() { * RestartCursor is called when a new scene is starting up. */ void RestartCursor() { - restart = 0x8000; // Get the main cursor to re-initialise + restart = 0x8000; // Get the main cursor to re-initialize } /** diff --git a/engines/tinsel/cursor.h b/engines/tinsel/cursor.h index 71e846297cb..4e32aa3a197 100644 --- a/engines/tinsel/cursor.h +++ b/engines/tinsel/cursor.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Clipping rectangle defines */ diff --git a/engines/tinsel/debugger.cpp b/engines/tinsel/debugger.cpp index ed877587c75..12613260328 100644 --- a/engines/tinsel/debugger.cpp +++ b/engines/tinsel/debugger.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tinsel/tinsel.h" diff --git a/engines/tinsel/debugger.h b/engines/tinsel/debugger.h index e803f165668..ff4ccd519f1 100644 --- a/engines/tinsel/debugger.h +++ b/engines/tinsel/debugger.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_DEBUGGER_H diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp index 70bf398baf9..27b16c5b93e 100644 --- a/engines/tinsel/detection.cpp +++ b/engines/tinsel/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -107,7 +104,7 @@ public: TinselMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Tinsel Engine"; + return "Tinsel"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/tinsel/detection_tables.h b/engines/tinsel/detection_tables.h index 6894cd0c47c..c86db9e4381 100644 --- a/engines/tinsel/detection_tables.h +++ b/engines/tinsel/detection_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ namespace Tinsel { diff --git a/engines/tinsel/dialogs.cpp b/engines/tinsel/dialogs.cpp index 281dd2da558..6ca070b67aa 100644 --- a/engines/tinsel/dialogs.cpp +++ b/engines/tinsel/dialogs.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Handles the inventory and conversation windows. * * And the save/load game windows. Some of this will be platform @@ -1322,7 +1319,7 @@ extern int WhichItemHeld() { } /** - * Called from the cursor module when it re-initialises (at the start of + * Called from the cursor module when it re-initializes (at the start of * a new scene). For if we are holding something at scene-change time. */ extern void InventoryIconCursor(bool bNewItem) { diff --git a/engines/tinsel/dialogs.h b/engines/tinsel/dialogs.h index f81a59a0b79..8c48eb8b76a 100644 --- a/engines/tinsel/dialogs.h +++ b/engines/tinsel/dialogs.h @@ -19,9 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Inventory related functions */ diff --git a/engines/tinsel/drives.cpp b/engines/tinsel/drives.cpp index d252e45cf5d..5977d3b7187 100644 --- a/engines/tinsel/drives.cpp +++ b/engines/tinsel/drives.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * CD/drive handling functions */ diff --git a/engines/tinsel/drives.h b/engines/tinsel/drives.h index 709c0d2392b..907071d2f84 100644 --- a/engines/tinsel/drives.h +++ b/engines/tinsel/drives.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * CD/drive handling functions */ diff --git a/engines/tinsel/dw.h b/engines/tinsel/dw.h index aed4c50408e..21f6db946e8 100644 --- a/engines/tinsel/dw.h +++ b/engines/tinsel/dw.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_DW_H diff --git a/engines/tinsel/effect.cpp b/engines/tinsel/effect.cpp index 95785e58401..22027b0f027 100644 --- a/engines/tinsel/effect.cpp +++ b/engines/tinsel/effect.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Handles effect polygons. diff --git a/engines/tinsel/events.cpp b/engines/tinsel/events.cpp index 4e61a6ef291..e701ddca995 100644 --- a/engines/tinsel/events.cpp +++ b/engines/tinsel/events.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Main purpose is to process user events. * Also provides a couple of utility functions. */ diff --git a/engines/tinsel/events.h b/engines/tinsel/events.h index a491f1e036e..f2b4d7f6634 100644 --- a/engines/tinsel/events.h +++ b/engines/tinsel/events.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * User events processing and utility functions */ diff --git a/engines/tinsel/faders.cpp b/engines/tinsel/faders.cpp index 99a8b9ff142..86d117af818 100644 --- a/engines/tinsel/faders.cpp +++ b/engines/tinsel/faders.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Palette Fader and Flasher processes. */ diff --git a/engines/tinsel/faders.h b/engines/tinsel/faders.h index b30a26d893b..dc0b903d7ea 100644 --- a/engines/tinsel/faders.h +++ b/engines/tinsel/faders.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Data structures used by the fader and flasher processes */ diff --git a/engines/tinsel/film.h b/engines/tinsel/film.h index 231fbf28db0..edb8dc268df 100644 --- a/engines/tinsel/film.h +++ b/engines/tinsel/film.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_FILM_H // prevent multiple includes diff --git a/engines/tinsel/font.cpp b/engines/tinsel/font.cpp index f57a6d5d542..e857dca5093 100644 --- a/engines/tinsel/font.cpp +++ b/engines/tinsel/font.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "tinsel/actors.h" diff --git a/engines/tinsel/font.h b/engines/tinsel/font.h index e5f5ece201e..83bc12354e9 100644 --- a/engines/tinsel/font.h +++ b/engines/tinsel/font.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_FONT_H // prevent multiple includes diff --git a/engines/tinsel/graphics.cpp b/engines/tinsel/graphics.cpp index bdcd3207f9d..6a5d626de85 100644 --- a/engines/tinsel/graphics.cpp +++ b/engines/tinsel/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Low level graphics interface. */ diff --git a/engines/tinsel/graphics.h b/engines/tinsel/graphics.h index de160824414..d34f069f6a1 100644 --- a/engines/tinsel/graphics.h +++ b/engines/tinsel/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Low level graphics interface. */ diff --git a/engines/tinsel/handle.cpp b/engines/tinsel/handle.cpp index 6f5f92c9692..eeb83b1f986 100644 --- a/engines/tinsel/handle.cpp +++ b/engines/tinsel/handle.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * This file contains the handle based Memory Manager code */ @@ -246,9 +243,6 @@ void LoadCDGraphData(MEMHANDLE *pH) { * @param next Handle of end of range + 1 */ void LoadExtraGraphData(SCNHANDLE start, SCNHANDLE next) { - if (start == cdBaseHandle) - return; - OpenCDGraphFile(); MemoryDiscard((handleTable + cdPlayHandle)->_node); // Free it diff --git a/engines/tinsel/handle.h b/engines/tinsel/handle.h index c3c303a1e92..e681bfc131d 100644 --- a/engines/tinsel/handle.h +++ b/engines/tinsel/handle.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Graphics Memory Manager data structures */ diff --git a/engines/tinsel/heapmem.cpp b/engines/tinsel/heapmem.cpp index e8c4ed23ee0..026dc9457e5 100644 --- a/engines/tinsel/heapmem.cpp +++ b/engines/tinsel/heapmem.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * This file contains the handle based Memory Manager code. */ @@ -103,7 +100,7 @@ static void MemoryStats() { #endif /** - * Initialises the memory manager. + * Initializes the memory manager. */ void MemoryInit() { // place first node on free list @@ -136,7 +133,7 @@ void MemoryInit() { } /** - * Deinitialises the memory manager. + * Deinitializes the memory manager. */ void MemoryDeinit() { const MEM_NODE *pHeap = &heapSentinel; diff --git a/engines/tinsel/heapmem.h b/engines/tinsel/heapmem.h index 95cc0285f2e..7b29a3eccea 100644 --- a/engines/tinsel/heapmem.h +++ b/engines/tinsel/heapmem.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * This file contains the handle based Memory Manager defines */ @@ -38,8 +35,8 @@ struct MEM_NODE; |* Memory Function Prototypes *| \*----------------------------------------------------------------------*/ -void MemoryInit(); // initialises the memory manager -void MemoryDeinit(); // deinitialises the memory manager +void MemoryInit(); // initializes the memory manager +void MemoryDeinit(); // deinitializes the memory manager // reserves a memory node for a movable & discardable block MEM_NODE *MemoryNoAlloc(); diff --git a/engines/tinsel/mareels.cpp b/engines/tinsel/mareels.cpp index 5d9672972a4..bd267a2c65d 100644 --- a/engines/tinsel/mareels.cpp +++ b/engines/tinsel/mareels.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Functions to set up moving actors' reels. */ diff --git a/engines/tinsel/mareels.h b/engines/tinsel/mareels.h index c31ceafbf4a..2ff5ca906e1 100644 --- a/engines/tinsel/mareels.h +++ b/engines/tinsel/mareels.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_MAREELS_H // prevent multiple includes diff --git a/engines/tinsel/move.cpp b/engines/tinsel/move.cpp index 5fc555f9b00..e20f28d5289 100644 --- a/engines/tinsel/move.cpp +++ b/engines/tinsel/move.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Handles walking and use of the path system. * * Contains the dodgiest code in the whole system. @@ -581,7 +578,7 @@ static void SetMoverUltDest(PMOVER pActor, int x, int y) { * Set intermediate destination. * * If in final destination path, go straight to target. - * If in a neighbouring path to the final destination, if the target path + * If in a neighboring path to the final destination, if the target path * is a follow nodes path, head for the end node, otherwise head straight * for the target. * Otherwise, head towards the pseudo-center or end node of the first diff --git a/engines/tinsel/move.h b/engines/tinsel/move.h index 027a89f67ed..a307e5c0818 100644 --- a/engines/tinsel/move.h +++ b/engines/tinsel/move.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_MOVE_H // prevent multiple includes diff --git a/engines/tinsel/multiobj.cpp b/engines/tinsel/multiobj.cpp index 9a7dac5929f..c48fefdd22d 100644 --- a/engines/tinsel/multiobj.cpp +++ b/engines/tinsel/multiobj.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * This file contains utilities to handle multi-part objects. */ @@ -32,7 +29,7 @@ namespace Tinsel { /** - * Initialise a multi-part object using a list of images to init + * Initialize a multi-part object using a list of images to init * each object piece. One object is created for each image in the list. * All objects are given the same palette as the first image. A pointer * to the first (master) object created is returned. @@ -93,7 +90,7 @@ OBJECT *MultiInitObject(const MULTI_INIT *pInitTbl) { */ -void MultiInsertObject(OBJECT *pObjList, OBJECT *pInsObj) { +void MultiInsertObject(OBJECT **pObjList, OBJECT *pInsObj) { // validate object pointer assert(isValidObject(pInsObj)); @@ -114,7 +111,7 @@ void MultiInsertObject(OBJECT *pObjList, OBJECT *pInsObj) { * @param pMultiObj Multi-part object to be deleted */ -void MultiDeleteObject(OBJECT *pObjList, OBJECT *pMultiObj) { +void MultiDeleteObject(OBJECT **pObjList, OBJECT *pMultiObj) { // validate object pointer assert(isValidObject(pMultiObj)); diff --git a/engines/tinsel/multiobj.h b/engines/tinsel/multiobj.h index b94d63e79f7..a0f977553ad 100644 --- a/engines/tinsel/multiobj.h +++ b/engines/tinsel/multiobj.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Multi-part object definitions */ @@ -56,15 +53,15 @@ typedef MULTI_INIT *PMULTI_INIT; |* Multi Object Function Prototypes *| \*----------------------------------------------------------------------*/ -OBJECT *MultiInitObject( // Initialise a multi-part object +OBJECT *MultiInitObject( // Initialize a multi-part object const MULTI_INIT *pInitTbl); // pointer to multi-object initialisation table void MultiInsertObject( // Insert a multi-part object onto a object list - OBJECT *pObjList, // list to insert multi-part object onto + OBJECT **pObjList, // list to insert multi-part object onto OBJECT *pInsObj); // head of multi-part object to insert void MultiDeleteObject( // Delete all the pieces of a multi-part object - OBJECT *pObjList, // list to delete multi-part object from + OBJECT **pObjList, // list to delete multi-part object from OBJECT *pMultiObj); // multi-part object to be deleted void MultiHideObject( // Hide a multi-part object diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp index 12bcff829bd..d6478f5caeb 100644 --- a/engines/tinsel/music.cpp +++ b/engines/tinsel/music.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // FIXME: This code is taken from MADE and may need more work (e.g. setVolume). diff --git a/engines/tinsel/music.h b/engines/tinsel/music.h index 9003e60078f..d43fed268d3 100644 --- a/engines/tinsel/music.h +++ b/engines/tinsel/music.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Music class diff --git a/engines/tinsel/object.cpp b/engines/tinsel/object.cpp index ad02a614a58..cbe5b0a88fb 100644 --- a/engines/tinsel/object.cpp +++ b/engines/tinsel/object.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * This file contains the Object Manager code. */ @@ -165,13 +162,13 @@ void CopyObject(OBJECT *pDest, OBJECT *pSrc) { * @param pInsObj Object to insert */ -void InsertObject(OBJECT *pObjList, OBJECT *pInsObj) { - OBJECT *pPrev, *pObj; // object list traversal pointers +void InsertObject(OBJECT **pObjList, OBJECT *pInsObj) { + OBJECT **pAnchor, *pObj; // object list traversal pointers // validate object pointer assert(isValidObject(pInsObj)); - for (pPrev = pObjList, pObj = pObjList->pNext; pObj != NULL; pPrev = pObj, pObj = pObj->pNext) { + for (pAnchor = pObjList, pObj = *pAnchor; pObj != NULL; pAnchor = &pObj->pNext, pObj = *pAnchor) { // check Z order if (pInsObj->zPos < pObj->zPos) { // object Z is lower than list Z - insert here @@ -185,9 +182,9 @@ void InsertObject(OBJECT *pObjList, OBJECT *pInsObj) { } } - // insert obj between pPrev and pObj + // insert obj between pAnchor and pObj pInsObj->pNext = pObj; - pPrev->pNext = pInsObj; + *pAnchor = pInsObj; } @@ -197,8 +194,8 @@ void InsertObject(OBJECT *pObjList, OBJECT *pInsObj) { * @param pObjList List to delete object from * @param pDelObj Object to delete */ -void DelObject(OBJECT *pObjList, OBJECT *pDelObj) { - OBJECT *pPrev, *pObj; // object list traversal pointers +void DelObject(OBJECT **pObjList, OBJECT *pDelObj) { + OBJECT **pAnchor, *pObj; // object list traversal pointers const Common::Rect rcScreen(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); // validate object pointer @@ -210,7 +207,7 @@ void DelObject(OBJECT *pObjList, OBJECT *pDelObj) { assert(numObj >= 0); #endif - for (pPrev = pObjList, pObj = pObjList->pNext; pObj != NULL; pPrev = pObj, pObj = pObj->pNext) { + for (pAnchor = pObjList, pObj = *pAnchor; pObj != NULL; pAnchor = &pObj->pNext, pObj = *pAnchor) { if (pObj == pDelObj) { // found object to delete @@ -220,7 +217,7 @@ void DelObject(OBJECT *pObjList, OBJECT *pDelObj) { } // make PREV next = OBJ next - removes OBJ from list - pPrev->pNext = pObj->pNext; + *pAnchor = pObj->pNext; // place free list in OBJ next pObj->pNext = pFreeObjects; @@ -248,12 +245,12 @@ void DelObject(OBJECT *pObjList, OBJECT *pDelObj) { * Sort the specified object list in Z Y order. * @param pObjList List to sort */ -void SortObjectList(OBJECT *pObjList) { +void SortObjectList(OBJECT **pObjList) { OBJECT *pPrev, *pObj; // object list traversal pointers OBJECT head; // temporary head of list - because pObjList is not usually a OBJECT // put at head of list - head.pNext = pObjList->pNext; + head.pNext = *pObjList; // set head of list dummy OBJ Z Y values to lowest possible head.yPos = intToFrac(MIN_INT16); @@ -348,7 +345,7 @@ void GetAniPosition(OBJECT *pObj, int *pPosX, int *pPosY) { } /** - * Initialise a object using a OBJ_INIT structure to supply parameters. + * Initialize a object using a OBJ_INIT structure to supply parameters. * @param pInitTbl Pointer to object initialisation table */ OBJECT *InitObject(const OBJ_INIT *pInitTbl) { @@ -489,7 +486,7 @@ void AnimateObject(OBJECT *pAniObj, SCNHANDLE hNewImg) { * @param height Height of rectangle */ OBJECT *RectangleObject(SCNHANDLE hPal, int color, int width, int height) { - // template for initialising the rectangle object + // template for initializing the rectangle object static const OBJ_INIT rectObj = {0, DMA_CONST, OID_EFFECTS, 0, 0, 0}; PALQ *pPalQ; // palette queue pointer @@ -525,7 +522,7 @@ OBJECT *RectangleObject(SCNHANDLE hPal, int color, int width, int height) { * @param height Height of rectangle */ OBJECT *TranslucentObject(int width, int height) { - // template for initialising the rectangle object + // template for initializing the rectangle object static const OBJ_INIT rectObj = {0, DMA_TRANS, OID_EFFECTS, 0, 0, 0}; // allocate and init a new object diff --git a/engines/tinsel/object.h b/engines/tinsel/object.h index 9f10c06cd28..5644ddf19cc 100644 --- a/engines/tinsel/object.h +++ b/engines/tinsel/object.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Object Manager data structures */ @@ -137,24 +134,15 @@ void CopyObject( // copy one object to another OBJECT *pSrc); // source object void InsertObject( // insert a object onto a sorted object list - OBJECT *pObjList, // list to insert object onto + OBJECT **pObjList, // list to insert object onto OBJECT *pInsObj); // object to insert void DelObject( // delete a object from a object list and add to free list - OBJECT *pObjList, // list to delete object from + OBJECT **pObjList, // list to delete object from OBJECT *pDelObj); // object to delete void SortObjectList( // re-sort an object list - OBJECT *pObjList); // list to sort - -OBJECT *GetNextObject( // object list iterator - returns next obj in list - OBJECT *pObjList, // which object list - OBJECT *pStrtObj); // object to start from - when NULL will start from beginning of list - -OBJECT *FindObject( // Searches the specified obj list for a object matching the specified OID - OBJECT *pObjList, // object list to search - int oidDesired, // object identifer of object to find - int oidMask); // mask to apply to object identifiers before comparison + OBJECT **pObjList); // list to sort void GetAniOffset( // returns the anim offsets of a image, takes into account orientation SCNHANDLE hImg, // image to get animation offset of diff --git a/engines/tinsel/palette.cpp b/engines/tinsel/palette.cpp index 08773376030..f2437bd17e9 100644 --- a/engines/tinsel/palette.cpp +++ b/engines/tinsel/palette.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Palette Allocator for IBM PC. */ diff --git a/engines/tinsel/palette.h b/engines/tinsel/palette.h index 694eff504dd..af58a7ffbdd 100644 --- a/engines/tinsel/palette.h +++ b/engines/tinsel/palette.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Palette Allocator Definitions */ diff --git a/engines/tinsel/pcode.cpp b/engines/tinsel/pcode.cpp index a1cc02a8320..0834e7df242 100644 --- a/engines/tinsel/pcode.cpp +++ b/engines/tinsel/pcode.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Virtual processor. */ @@ -351,7 +348,7 @@ void FreeMasterInterpretContext() { } /** - * Allocate and initialise an interpret context. + * Allocate and initialize an interpret context. * Called from a process prior to Interpret(). * @param gsort which sort of code * @param hCode Handle to code to execute @@ -388,7 +385,7 @@ INT_CONTEXT *InitInterpretContext(GSORT gsort, SCNHANDLE hCode, TINSEL_EVENT eve } /** - * Allocate and initialise an interpret context with restored data. + * Allocate and initialize an interpret context with restored data. */ INT_CONTEXT *RestoreInterpretContext(INT_CONTEXT *ric) { INT_CONTEXT *ic; diff --git a/engines/tinsel/pcode.h b/engines/tinsel/pcode.h index f31f2eb5c61..971a42d7bd2 100644 --- a/engines/tinsel/pcode.h +++ b/engines/tinsel/pcode.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Virtual processor definitions */ @@ -77,7 +74,7 @@ struct INT_CONTEXT { int ip; ///< instruction pointer bool bHalt; ///< set to exit interpeter bool escOn; - int myEscape; ///< only initialised to prevent compiler warning! + int myEscape; ///< only initialized to prevent compiler warning! uint32 waitNumber1; // The waiting numbert uint32 waitNumber2; // The wait for number diff --git a/engines/tinsel/pdisplay.cpp b/engines/tinsel/pdisplay.cpp index 5022f4757a2..7439c6f77de 100644 --- a/engines/tinsel/pdisplay.cpp +++ b/engines/tinsel/pdisplay.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * CursorPositionProcess() * TagProcess() * PointProcess() diff --git a/engines/tinsel/pdisplay.h b/engines/tinsel/pdisplay.h index 4e19f1a78a0..aefaf015bd6 100644 --- a/engines/tinsel/pdisplay.h +++ b/engines/tinsel/pdisplay.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Tag related methods */ diff --git a/engines/tinsel/pid.h b/engines/tinsel/pid.h index d6f87bdf986..4f63045cb46 100644 --- a/engines/tinsel/pid.h +++ b/engines/tinsel/pid.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * List of all process identifiers */ diff --git a/engines/tinsel/play.cpp b/engines/tinsel/play.cpp index 145634b9dde..71e07721a60 100644 --- a/engines/tinsel/play.cpp +++ b/engines/tinsel/play.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Plays films within a scene, takes into account the actor in each 'column'. | */ diff --git a/engines/tinsel/play.h b/engines/tinsel/play.h index 2e981b1e2ef..041b7096a8b 100644 --- a/engines/tinsel/play.h +++ b/engines/tinsel/play.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Plays films within a scene, takes into account the actor in each 'column'. */ diff --git a/engines/tinsel/polygons.cpp b/engines/tinsel/polygons.cpp index f49dddeef42..6fc1c65ec55 100644 --- a/engines/tinsel/polygons.cpp +++ b/engines/tinsel/polygons.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "tinsel/actors.h" @@ -1278,13 +1275,13 @@ HPOLYGON GetPolyHandle(int i) { // ************************************************************************** // -// Code called to initialise or wrap up a scene: +// Code called to initialize or wrap up a scene: // // ************************************************************************** /** * Called at the start of a scene, when all polygons have been - * initialised, to work out which paths are adjacent to which. + * initialized, to work out which paths are adjacent to which. */ static int DistinctCorners(HPOLYGON hp1, HPOLYGON hp2) { const POLYGON *pp1, *pp2; @@ -1596,7 +1593,7 @@ static PPOLYGON GetPolyEntry() { /** * Variation of GetPolyEntry from Tinsel 1 that splits up getting a new - * polygon structure from initialising it + * polygon structure from initializing it */ static PPOLYGON CommonInits(PTYPE polyType, int pno, const Poly &ptp, bool bRestart) { int i; @@ -1660,14 +1657,14 @@ static void PseudoCenter(POLYGON *p) { } /** - * Initialise an EXIT polygon. + * Initialize an EXIT polygon. */ static void InitExit(const Poly &ptp, int pno, bool bRestart) { CommonInits(EXIT, pno, ptp, bRestart); } /** - * Initialise a PATH or NPATH polygon. + * Initialize a PATH or NPATH polygon. */ static void InitPath(const Poly &ptp, bool NodePath, int pno, bool bRestart) { PPOLYGON p = CommonInits(PATH, pno, ptp, bRestart); @@ -1679,14 +1676,14 @@ static void InitPath(const Poly &ptp, bool NodePath, int pno, bool bRestart) { /** - * Initialise a BLOCKING polygon. + * Initialize a BLOCKING polygon. */ static void InitBlock(const Poly &ptp, int pno, bool bRestart) { CommonInits(BLOCK, pno, ptp, bRestart); } /** - * Initialise an extra BLOCKING polygon related to a moving actor. + * Initialize an extra BLOCKING polygon related to a moving actor. * The width of the polygon depends on the width of the actor which is * trying to walk through the actor you first thought of. * This is for dynamic blocking. @@ -1721,7 +1718,7 @@ HPOLYGON InitExtraBlock(PMOVER ca, PMOVER ta) { } /** - * Initialise an EFFECT polygon. + * Initialize an EFFECT polygon. */ static void InitEffect(const Poly &ptp, int pno, bool bRestart) { CommonInits(EFFECT, pno, ptp, bRestart); @@ -1729,7 +1726,7 @@ static void InitEffect(const Poly &ptp, int pno, bool bRestart) { /** - * Initialise a REFER polygon. + * Initialize a REFER polygon. */ static void InitRefer(const Poly &ptp, int pno, bool bRestart) { PPOLYGON p = CommonInits(REFER, pno, ptp, bRestart); @@ -1739,7 +1736,7 @@ static void InitRefer(const Poly &ptp, int pno, bool bRestart) { /** - * Initialise a TAG polygon. + * Initialize a TAG polygon. */ static void InitTag(const Poly &ptp, int pno, bool bRestart) { CommonInits(TAG, pno, ptp, bRestart); @@ -1784,7 +1781,7 @@ static void KillDeadPolygons() { } /** - * Called at the start of a scene to initialise the polys in that scene. + * Called at the start of a scene to initialize the polys in that scene. */ void InitPolygons(SCNHANDLE ph, int numPoly, bool bRestart) { pHandle = ph; diff --git a/engines/tinsel/polygons.h b/engines/tinsel/polygons.h index cf8f9e98c2f..6d36d555d8f 100644 --- a/engines/tinsel/polygons.h +++ b/engines/tinsel/polygons.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Definition of POLYGON structure and functions in POLYGONS.C */ diff --git a/engines/tinsel/rince.cpp b/engines/tinsel/rince.cpp index 38ac0a2ce6f..ca196aac92d 100644 --- a/engines/tinsel/rince.cpp +++ b/engines/tinsel/rince.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Should really be called "moving actors.c" */ diff --git a/engines/tinsel/rince.h b/engines/tinsel/rince.h index 5d09a1e9451..93fd1911724 100644 --- a/engines/tinsel/rince.h +++ b/engines/tinsel/rince.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Should really be called "moving actors.h" */ diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp index 50f6d8d00b4..caaf9a13f8b 100644 --- a/engines/tinsel/saveload.cpp +++ b/engines/tinsel/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Save and restore scene and game. */ diff --git a/engines/tinsel/savescn.cpp b/engines/tinsel/savescn.cpp index aa359d281fc..89d68a611e9 100644 --- a/engines/tinsel/savescn.cpp +++ b/engines/tinsel/savescn.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Save and restore scene and game. */ @@ -153,14 +150,14 @@ void DoRestoreScene(SAVED_DATA *sd, bool bFadeOut) { RestoreSceneCount = RS_COUNT; // Set restore scene count } -void InitialiseSaveScenes() { +void InitializeSaveScenes() { if (ssData == NULL) { ssData = (SAVED_DATA *)calloc(MAX_NEST, sizeof(SAVED_DATA)); if (ssData == NULL) { error("Cannot allocate memory for scene changes"); } } else { - // Re-initialise - no scenes saved + // Re-initialize - no scenes saved savedSceneCount = 0; } } diff --git a/engines/tinsel/savescn.h b/engines/tinsel/savescn.h index 271cdd5eb1c..894af0d6b8f 100644 --- a/engines/tinsel/savescn.h +++ b/engines/tinsel/savescn.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Should really be called "moving actors.h" */ @@ -99,7 +96,7 @@ void ProcessSRQueue(); void RequestSaveGame(char *name, char *desc, SAVED_DATA *sd, int *ssCount, SAVED_DATA *ssData); void RequestRestoreGame(int num, SAVED_DATA *sd, int *ssCount, SAVED_DATA *ssData); -void InitialiseSaveScenes(); +void InitializeSaveScenes(); void FreeSaveScenes(); } // End of namespace Tinsel diff --git a/engines/tinsel/scene.cpp b/engines/tinsel/scene.cpp index b82bac32cce..89b0da7d65d 100644 --- a/engines/tinsel/scene.cpp +++ b/engines/tinsel/scene.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Starts up new scenes. */ @@ -204,8 +201,8 @@ void SendSceneTinselProcess(TINSEL_EVENT event) { /** * Get the SCENE_STRUC - * Initialise polygons for the scene - * Initialise the actors for this scene + * Initialize polygons for the scene + * Initialize the actors for this scene * Run the appropriate entrance code (if any) * Get the default refer type */ @@ -247,10 +244,10 @@ static void LoadScene(SCNHANDLE scene, int entry) { if (entry == NO_ENTRY_NUM) { // Restoring scene - // Initialise all the polygons for this scene + // Initialize all the polygons for this scene InitPolygons(FROM_LE_32(ss->hPoly), FROM_LE_32(ss->numPoly), true); - // Initialise the actors for this scene + // Initialize the actors for this scene StartTaggedActors(FROM_LE_32(ss->hTaggedActor), FROM_LE_32(ss->numTaggedActor), false); if (TinselV2) @@ -260,10 +257,10 @@ static void LoadScene(SCNHANDLE scene, int entry) { } else { // Genuine new scene - // Initialise all the polygons for this scene + // Initialize all the polygons for this scene InitPolygons(FROM_LE_32(ss->hPoly), FROM_LE_32(ss->numPoly), false); - // Initialise the actors for this scene + // Initialize the actors for this scene StartTaggedActors(FROM_LE_32(ss->hTaggedActor), FROM_LE_32(ss->numTaggedActor), true); // Run the appropriate entrance code (if any) diff --git a/engines/tinsel/scene.h b/engines/tinsel/scene.h index 2ef7da12897..baaff27a3e3 100644 --- a/engines/tinsel/scene.h +++ b/engines/tinsel/scene.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Scene parsing defines */ diff --git a/engines/tinsel/sched.cpp b/engines/tinsel/sched.cpp index 37c04abd221..b24d6bf9b84 100644 --- a/engines/tinsel/sched.cpp +++ b/engines/tinsel/sched.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Process scheduler. */ diff --git a/engines/tinsel/sched.h b/engines/tinsel/sched.h index bfeaa8750a9..a1eafcdc47a 100644 --- a/engines/tinsel/sched.h +++ b/engines/tinsel/sched.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Data structures used by the process scheduler */ diff --git a/engines/tinsel/scn.cpp b/engines/tinsel/scn.cpp index 20d75b6b93e..70093447fff 100644 --- a/engines/tinsel/scn.cpp +++ b/engines/tinsel/scn.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * A (some would say very) small collection of utility functions. */ diff --git a/engines/tinsel/scn.h b/engines/tinsel/scn.h index c9cafd9eeaf..2e3a02cdda8 100644 --- a/engines/tinsel/scn.h +++ b/engines/tinsel/scn.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_SCN_H // prevent multiple includes diff --git a/engines/tinsel/scroll.cpp b/engines/tinsel/scroll.cpp index 3da970915f2..d75e649be30 100644 --- a/engines/tinsel/scroll.cpp +++ b/engines/tinsel/scroll.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Handles scrolling */ @@ -419,7 +416,7 @@ void ScrollProcess(CORO_PARAM, const void *) { CORO_BEGIN_CODE(_ctx); // In Tinsel v2, scenes may play movies, so the background may not always - // already be initialised like it is in v1 + // already be initialized like it is in v1 while (!GetBgObject()) CORO_SLEEP(1); diff --git a/engines/tinsel/scroll.h b/engines/tinsel/scroll.h index 438b0490695..62562b20b2e 100644 --- a/engines/tinsel/scroll.h +++ b/engines/tinsel/scroll.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_SCROLL_H // prevent multiple includes diff --git a/engines/tinsel/sound.cpp b/engines/tinsel/sound.cpp index ec42ca5da4b..bf48dd1511c 100644 --- a/engines/tinsel/sound.cpp +++ b/engines/tinsel/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * sound functionality */ diff --git a/engines/tinsel/sound.h b/engines/tinsel/sound.h index 2b0ef4599e3..d7083b3b217 100644 --- a/engines/tinsel/sound.h +++ b/engines/tinsel/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * This file contains the Sound Driver data structures etc. */ diff --git a/engines/tinsel/strres.cpp b/engines/tinsel/strres.cpp index 2dc0e833d1c..f3a72789937 100644 --- a/engines/tinsel/strres.cpp +++ b/engines/tinsel/strres.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * String resource managment routines */ diff --git a/engines/tinsel/strres.h b/engines/tinsel/strres.h index 497259584c0..a63824a863c 100644 --- a/engines/tinsel/strres.h +++ b/engines/tinsel/strres.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * String resource managment routines */ diff --git a/engines/tinsel/sysvar.cpp b/engines/tinsel/sysvar.cpp index ad795fd2196..88053f15c6b 100644 --- a/engines/tinsel/sysvar.cpp +++ b/engines/tinsel/sysvar.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * System variable handling. */ @@ -115,7 +112,7 @@ static SCNHANDLE systemStrings[SS_MAX_VALID]; // FIXME: Avoid non-const global v //----------------- FUNCTIONS -------------------------------- /** - * Initialises the system variable list + * Initializes the system variable list */ void InitSysVars() { diff --git a/engines/tinsel/sysvar.h b/engines/tinsel/sysvar.h index 4cdb1364b4e..65bf5584339 100644 --- a/engines/tinsel/sysvar.h +++ b/engines/tinsel/sysvar.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * System variable handling. */ diff --git a/engines/tinsel/text.cpp b/engines/tinsel/text.cpp index 3652d6ed3e1..ecb1e153f34 100644 --- a/engines/tinsel/text.cpp +++ b/engines/tinsel/text.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Text utilities. */ @@ -107,7 +104,7 @@ int JustifyText(char *szStr, int xPos, const FONT *pFont, int mode) { * @param mode Mode flags for the string * @param sleepTime Sleep time between each character (if non-zero) */ -OBJECT *ObjectTextOut(OBJECT *pList, char *szStr, int color, +OBJECT *ObjectTextOut(OBJECT **pList, char *szStr, int color, int xPos, int yPos, SCNHANDLE hFont, int mode, int sleepTime) { int xJustify; // x position of text after justification int yOffset; // offset to next line of text diff --git a/engines/tinsel/text.h b/engines/tinsel/text.h index ea804f58d75..4c80300c460 100644 --- a/engines/tinsel/text.h +++ b/engines/tinsel/text.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Text utility defines */ @@ -98,7 +95,7 @@ struct TEXTOUT { * @param mode mode flags for the string * @param sleepTime Sleep time between each character (if non-zero) */ -OBJECT *ObjectTextOut(OBJECT *pList, char *szStr, int color, +OBJECT *ObjectTextOut(OBJECT **pList, char *szStr, int color, int xPos, int yPos, SCNHANDLE hFont, int mode, int sleepTime = 0); OBJECT *ObjectTextOutIndirect( // output a string of text diff --git a/engines/tinsel/timers.cpp b/engines/tinsel/timers.cpp index c1a4cd0ff58..1c3ff9b2605 100644 --- a/engines/tinsel/timers.cpp +++ b/engines/tinsel/timers.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Handles timers. * * Note: As part of the transition to ScummVM, the ticks field of a timer has been changed diff --git a/engines/tinsel/timers.h b/engines/tinsel/timers.h index 1456d9a1d50..9bf85d9c35d 100644 --- a/engines/tinsel/timers.h +++ b/engines/tinsel/timers.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Handles timers. */ diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp index afd409ce27b..7613c1a897c 100644 --- a/engines/tinsel/tinlib.cpp +++ b/engines/tinsel/tinlib.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Glitter library functions. * * In the main called only from PCODE.C @@ -2752,7 +2749,7 @@ static void SetTag(CORO_PARAM, int tagno) { } /** - * Initialise a timer. + * Initialize a timer. */ static void SetTimer(int timerno, int start, bool up, bool frame) { StartTimer(timerno, start, up != 0, frame != 0); @@ -3002,7 +2999,7 @@ static void StartProcess(CORO_PARAM, uint32 procID) { } /** - * Initialise a timer. + * Initialize a timer. */ static void StartTimerFn(int timerno, int start, bool up, int fs) { StartTimer(timerno, start, up, fs); diff --git a/engines/tinsel/tinlib.h b/engines/tinsel/tinlib.h index 7bd2a19d55a..7c8c2ffbf6b 100644 --- a/engines/tinsel/tinlib.h +++ b/engines/tinsel/tinlib.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Text utility defines */ diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp index 20d4f1d31a0..6c1898b08cf 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -18,16 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug-channels.h" #include "common/endian.h" #include "common/error.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/keyboard.h" #include "common/fs.h" #include "common/config-manager.h" @@ -709,7 +705,7 @@ void LoadBasicChunks() { int numObjects; // Allocate RAM for savescene data - InitialiseSaveScenes(); + InitializeSaveScenes(); // CHUNK_TOTAL_ACTORS seems to be missing in the released version, hard coding a value // TODO: Would be nice to just change 511 to MAX_SAVED_ALIVES @@ -818,7 +814,7 @@ const char *TinselEngine::_textFiles[][3] = { TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc) : - Engine(syst), _gameDescription(gameDesc) { + Engine(syst), _gameDescription(gameDesc), _random("tinsel") { _vm = this; _config = new Config(this); @@ -909,8 +905,6 @@ Common::Error TinselEngine::run() { _screenSurface.create(320, 200, Graphics::PixelFormat::createFormatCLUT8()); } - g_eventRec.registerRandomSource(_random, "tinsel"); - _console = new Console(); _scheduler = new Scheduler(); diff --git a/engines/tinsel/tinsel.h b/engines/tinsel/tinsel.h index 35ea43074ca..d0875f9fdfd 100644 --- a/engines/tinsel/tinsel.h +++ b/engines/tinsel/tinsel.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_H diff --git a/engines/tinsel/token.cpp b/engines/tinsel/token.cpp index fe152edcaac..c7490a100b0 100644 --- a/engines/tinsel/token.cpp +++ b/engines/tinsel/token.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * To ensure exclusive use of resources and exclusive control responsibilities. */ diff --git a/engines/tinsel/token.h b/engines/tinsel/token.h index b750b92ae41..8169ef1c7a8 100644 --- a/engines/tinsel/token.h +++ b/engines/tinsel/token.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_TOKEN_H diff --git a/engines/toon/anim.cpp b/engines/toon/anim.cpp index 856acbd9861..23bd0f64873 100644 --- a/engines/toon/anim.cpp +++ b/engines/toon/anim.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/toon/anim.h b/engines/toon/anim.h index dfb6842b0ec..13c501b9100 100644 --- a/engines/toon/anim.h +++ b/engines/toon/anim.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOON_ANIM_H diff --git a/engines/toon/audio.cpp b/engines/toon/audio.cpp index 026450d3c92..ae67d1900eb 100644 --- a/engines/toon/audio.cpp +++ b/engines/toon/audio.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" @@ -396,7 +393,6 @@ void AudioStreamInstance::decodeADPCM(uint8 *comp, int16 *dest, int32 packetSize void AudioStreamInstance::play(bool fade, Audio::Mixer::SoundType soundType) { debugC(1, kDebugAudio, "play(%d)", (fade) ? 1 : 0); - Audio::SoundHandle soundHandle; _stopped = false; _fadingIn = fade; _fadeTime = 0; diff --git a/engines/toon/audio.h b/engines/toon/audio.h index 5feae9c5a1e..52ca21b0757 100644 --- a/engines/toon/audio.h +++ b/engines/toon/audio.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOON_AUDIO_H diff --git a/engines/toon/character.cpp b/engines/toon/character.cpp index 29a61ffd78d..06c6e21d219 100644 --- a/engines/toon/character.cpp +++ b/engines/toon/character.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/debug.h" diff --git a/engines/toon/character.h b/engines/toon/character.h index e870d81813f..b48991732c2 100644 --- a/engines/toon/character.h +++ b/engines/toon/character.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_CHARACTER_H diff --git a/engines/toon/console.cpp b/engines/toon/console.cpp index 3c34792580e..8037dca4cb9 100644 --- a/engines/toon/console.cpp +++ b/engines/toon/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "toon/console.h" diff --git a/engines/toon/console.h b/engines/toon/console.h index 0662f205337..25ce7627a12 100644 --- a/engines/toon/console.h +++ b/engines/toon/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOON_CONSOLE_H diff --git a/engines/toon/conversation.cpp b/engines/toon/conversation.cpp index fc846288efa..01ee1efaed3 100644 --- a/engines/toon/conversation.cpp +++ b/engines/toon/conversation.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "toon/conversation.h" diff --git a/engines/toon/conversation.h b/engines/toon/conversation.h index 0380210e022..3e459a9734a 100644 --- a/engines/toon/conversation.h +++ b/engines/toon/conversation.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_CONVERSATION_H diff --git a/engines/toon/detection.cpp b/engines/toon/detection.cpp index ef023564bc4..1056f6ec0d3 100644 --- a/engines/toon/detection.cpp +++ b/engines/toon/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -150,7 +147,7 @@ public: ToonMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Toon Engine"; + return "Toon"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/toon/drew.cpp b/engines/toon/drew.cpp index 77333c4a9fd..89438fb35ce 100644 --- a/engines/toon/drew.cpp +++ b/engines/toon/drew.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/toon/drew.h b/engines/toon/drew.h index f248e4aa515..3357b998465 100644 --- a/engines/toon/drew.h +++ b/engines/toon/drew.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_DREW_H diff --git a/engines/toon/flux.cpp b/engines/toon/flux.cpp index 833fdbf5ce3..b752e65c820 100644 --- a/engines/toon/flux.cpp +++ b/engines/toon/flux.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/debug.h" diff --git a/engines/toon/flux.h b/engines/toon/flux.h index 136dedd4153..c208bc5bda3 100644 --- a/engines/toon/flux.h +++ b/engines/toon/flux.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_FLUX_H diff --git a/engines/toon/font.cpp b/engines/toon/font.cpp index 9367d790363..4c491ae2b37 100644 --- a/engines/toon/font.cpp +++ b/engines/toon/font.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/debug.h" diff --git a/engines/toon/font.h b/engines/toon/font.h index 739d215e369..168c61f27e3 100644 --- a/engines/toon/font.h +++ b/engines/toon/font.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_FONT_H diff --git a/engines/toon/hotspot.cpp b/engines/toon/hotspot.cpp index 1c1e23e39e0..62458ad8008 100644 --- a/engines/toon/hotspot.cpp +++ b/engines/toon/hotspot.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/debug.h" diff --git a/engines/toon/hotspot.h b/engines/toon/hotspot.h index aabcd531fe2..49ac1a4af83 100644 --- a/engines/toon/hotspot.h +++ b/engines/toon/hotspot.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_HOTSPOT_H diff --git a/engines/toon/movie.cpp b/engines/toon/movie.cpp index 64b80c29b37..2318eaaac7a 100644 --- a/engines/toon/movie.cpp +++ b/engines/toon/movie.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/debug.h" diff --git a/engines/toon/movie.h b/engines/toon/movie.h index bed2ceceaeb..7e443fd8ab8 100644 --- a/engines/toon/movie.h +++ b/engines/toon/movie.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_MOVIE_H diff --git a/engines/toon/path.cpp b/engines/toon/path.cpp index 26355863f60..c116d636632 100644 --- a/engines/toon/path.cpp +++ b/engines/toon/path.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/debug.h" diff --git a/engines/toon/path.h b/engines/toon/path.h index 03d2b188e56..329127c9ced 100644 --- a/engines/toon/path.h +++ b/engines/toon/path.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_PATH_H diff --git a/engines/toon/picture.cpp b/engines/toon/picture.cpp index ce28f9c68b4..0257964fb5e 100644 --- a/engines/toon/picture.cpp +++ b/engines/toon/picture.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "toon/picture.h" diff --git a/engines/toon/picture.h b/engines/toon/picture.h index 6aca408364d..23edbc91da1 100644 --- a/engines/toon/picture.h +++ b/engines/toon/picture.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_PICTURE_H diff --git a/engines/toon/resource.cpp b/engines/toon/resource.cpp index f9f65b423b7..cef916c7de0 100644 --- a/engines/toon/resource.cpp +++ b/engines/toon/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "toon/resource.h" diff --git a/engines/toon/resource.h b/engines/toon/resource.h index d6ed29b81b0..0cecad81878 100644 --- a/engines/toon/resource.h +++ b/engines/toon/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_RESOURCE_H diff --git a/engines/toon/script.cpp b/engines/toon/script.cpp index 8703666781c..eed781295a5 100644 --- a/engines/toon/script.cpp +++ b/engines/toon/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/debug.h" diff --git a/engines/toon/script.h b/engines/toon/script.h index b6d28e11716..9dd00dca802 100644 --- a/engines/toon/script.h +++ b/engines/toon/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_SCRIPT_H diff --git a/engines/toon/script_func.cpp b/engines/toon/script_func.cpp index 8f75097bd45..693f308707e 100644 --- a/engines/toon/script_func.cpp +++ b/engines/toon/script_func.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/debug.h" diff --git a/engines/toon/script_func.h b/engines/toon/script_func.h index 76b7b0ada1f..ef1cb59f47d 100644 --- a/engines/toon/script_func.h +++ b/engines/toon/script_func.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef SCRIPT_FUNC_H diff --git a/engines/toon/state.cpp b/engines/toon/state.cpp index af37ea9e68d..8e4abbd7092 100644 --- a/engines/toon/state.cpp +++ b/engines/toon/state.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/debug.h" diff --git a/engines/toon/state.h b/engines/toon/state.h index 63505fd5fbb..4004b8b4f09 100644 --- a/engines/toon/state.h +++ b/engines/toon/state.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_STATE_H diff --git a/engines/toon/text.cpp b/engines/toon/text.cpp index 94a3ea5aa77..0f72d58b3b3 100644 --- a/engines/toon/text.cpp +++ b/engines/toon/text.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/debug.h" diff --git a/engines/toon/text.h b/engines/toon/text.h index 9a35471e4f2..b8f4a96a6ac 100644 --- a/engines/toon/text.h +++ b/engines/toon/text.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_TEXT_H diff --git a/engines/toon/tools.cpp b/engines/toon/tools.cpp index ff72e69543b..c9aa470deb6 100644 --- a/engines/toon/tools.cpp +++ b/engines/toon/tools.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/debug.h" diff --git a/engines/toon/tools.h b/engines/toon/tools.h index 1434ca26c79..44c0fc46441 100644 --- a/engines/toon/tools.h +++ b/engines/toon/tools.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_TOOLS_H diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp index 81c4d313e45..44c747c4c49 100644 --- a/engines/toon/toon.cpp +++ b/engines/toon/toon.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/system.h" @@ -28,7 +25,6 @@ #include "common/debug-channels.h" #include "common/archive.h" #include "common/config-manager.h" -#include "common/EventRecorder.h" #include "common/savefile.h" #include "common/memstream.h" @@ -783,8 +779,6 @@ Common::Error ToonEngine::run() { if (!loadToonDat()) return Common::kUnknownError; - g_eventRec.registerRandomSource(_rnd, "toon"); - initGraphics(TOON_SCREEN_WIDTH, TOON_SCREEN_HEIGHT, true); init(); @@ -818,7 +812,8 @@ Common::Error ToonEngine::run() { } ToonEngine::ToonEngine(OSystem *syst, const ADGameDescription *gameDescription) - : Engine(syst), _gameDescription(gameDescription), _language(gameDescription->language) { + : Engine(syst), _gameDescription(gameDescription), + _language(gameDescription->language), _rnd("toon") { _system = syst; _tickLength = 16; _currentPicture = NULL; @@ -2860,7 +2855,7 @@ void ToonEngine::playSFX(int32 id, int32 volume) { } void ToonEngine::playSoundWrong() { - _audioManager->playSFX(rand() & 7, 128, true); + _audioManager->playSFX(randRange(0,7), 128, true); } void ToonEngine::getTextPosition(int32 characterId, int32 *retX, int32 *retY) { diff --git a/engines/toon/toon.h b/engines/toon/toon.h index 373437d658c..1eaa5022a9f 100644 --- a/engines/toon/toon.h +++ b/engines/toon/toon.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_TOON_H diff --git a/engines/touche/console.cpp b/engines/touche/console.cpp index adcabb2fc5e..51ef5fc6391 100644 --- a/engines/touche/console.cpp +++ b/engines/touche/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "touche/console.h" diff --git a/engines/touche/console.h b/engines/touche/console.h index de14867b32c..e3cdc9d48b7 100644 --- a/engines/touche/console.h +++ b/engines/touche/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOUCHE_CONSOLE_H diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp index 06d15664a58..b7f9c092aa7 100644 --- a/engines/touche/detection.cpp +++ b/engines/touche/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -159,7 +156,7 @@ public: ToucheMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Touche Engine"; + return "Touche"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/touche/graphics.cpp b/engines/touche/graphics.cpp index ab711beba08..6e565327ba5 100644 --- a/engines/touche/graphics.cpp +++ b/engines/touche/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/touche/graphics.h b/engines/touche/graphics.h index 9c928f983ca..4b769b0a667 100644 --- a/engines/touche/graphics.h +++ b/engines/touche/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOUCHE_GRAPHICS_H diff --git a/engines/touche/menu.cpp b/engines/touche/menu.cpp index eb10c618933..f469a958034 100644 --- a/engines/touche/menu.cpp +++ b/engines/touche/menu.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/touche/midi.cpp b/engines/touche/midi.cpp index c89375d876f..da14baa484a 100644 --- a/engines/touche/midi.cpp +++ b/engines/touche/midi.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/engines/touche/midi.h b/engines/touche/midi.h index bde4950b937..24f9da0474a 100644 --- a/engines/touche/midi.h +++ b/engines/touche/midi.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOUCHE_MIDI_H diff --git a/engines/touche/opcodes.cpp b/engines/touche/opcodes.cpp index 5df0ca35481..18677eae262 100644 --- a/engines/touche/opcodes.cpp +++ b/engines/touche/opcodes.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/touche/resource.cpp b/engines/touche/resource.cpp index 93406dcb8bd..8f4752e9121 100644 --- a/engines/touche/resource.cpp +++ b/engines/touche/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/touche/saveload.cpp b/engines/touche/saveload.cpp index 42b68d015cb..82ed03ad45a 100644 --- a/engines/touche/saveload.cpp +++ b/engines/touche/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/touche/staticres.cpp b/engines/touche/staticres.cpp index 74aa7954de9..f7b1482f80f 100644 --- a/engines/touche/staticres.cpp +++ b/engines/touche/staticres.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp index 15a2b1c53a7..81d6adf5811 100644 --- a/engines/touche/touche.cpp +++ b/engines/touche/touche.cpp @@ -18,16 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" #include "common/debug-channels.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/fs.h" #include "common/system.h" #include "common/archive.h" @@ -48,7 +44,7 @@ namespace Touche { ToucheEngine::ToucheEngine(OSystem *system, Common::Language language) - : Engine(system), _midiPlayer(0), _language(language) { + : Engine(system), _midiPlayer(0), _language(language), _rnd("touche") { _saveLoadCurrentPage = 0; _saveLoadCurrentSlot = 0; _hideInventoryTexts = false; @@ -87,8 +83,6 @@ ToucheEngine::ToucheEngine(OSystem *system, Common::Language language) DebugMan.addDebugChannel(kDebugMenu, "Menu", "Menu debug level"); _console = new ToucheConsole(this); - - g_eventRec.registerRandomSource(_rnd, "touche"); } ToucheEngine::~ToucheEngine() { diff --git a/engines/touche/touche.h b/engines/touche/touche.h index 1580d072e68..c8d75047546 100644 --- a/engines/touche/touche.h +++ b/engines/touche/touche.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOUCHE_ENGINE_H diff --git a/engines/tsage/blueforce_logic.cpp b/engines/tsage/blueforce_logic.cpp new file mode 100644 index 00000000000..9813bef6f71 --- /dev/null +++ b/engines/tsage/blueforce_logic.cpp @@ -0,0 +1,120 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "tsage/blueforce_logic.h" +#include "tsage/scenes.h" +#include "tsage/tsage.h" +#include "tsage/staticres.h" + +namespace tSage { + +void BlueForceGame::start() { + // Start the game + _globals->_sceneManager.changeScene(20); + + _globals->_events.setCursor(CURSOR_WALK); +} + +Scene *BlueForceGame::createScene(int sceneNumber) { + switch (sceneNumber) { + case 20: + case 50: + case 60: + error("Scene group 0 not implemented"); + case 100: + case 109: + case 110: + case 114: + case 115: + case 125: + case 140: + case 150: + case 160: + case 180: + case 190: + error("Scene group 1 not implemented"); + case 200: + case 210: + case 220: + case 225: + case 265: + case 270: + case 271: + case 280: + error("Scene group 2 not implemented"); + case 300: + case 315: + case 325: + case 330: + case 340: + case 342: + case 350: + case 355: + case 360: + case 370: + case 380: + case 385: + case 390: + error("Scene group 3 not implemented"); + case 410: + case 415: + case 440: + case 450: + error("Scene group 4 not implemented"); + case 550: + case 551: + case 560: + case 570: + case 580: + case 590: + error("Scene group 5 not implemented"); + case 600: + case 620: + case 666: + case 690: + error("Scene group 6 not implemented"); + case 710: + error("Scene group 7 not implemented"); + case 800: + case 810: + case 820: + case 830: + case 840: + case 850: + case 860: + case 870: + case 880: + error("Scene group 8 not implemented"); + case 900: + case 910: + case 920: + case 930: + case 935: + case 940: + error("Scene group 9 not implemented"); + default: + error("Unknown scene number - %d", sceneNumber); + break; + } +} + +} // End of namespace tSage diff --git a/engines/tsage/blueforce_logic.h b/engines/tsage/blueforce_logic.h new file mode 100644 index 00000000000..9237e50a137 --- /dev/null +++ b/engines/tsage/blueforce_logic.h @@ -0,0 +1,42 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TSAGE_BLUEFORCE_LOGIC_H +#define TSAGE_BLUEFORCE_LOGIC_H + +#include "common/scummsys.h" +#include "tsage/events.h" +#include "tsage/core.h" +#include "tsage/scenes.h" +#include "tsage/globals.h" + +namespace tSage { + +class BlueForceGame: public Game { +public: + virtual void start(); + virtual Scene *createScene(int sceneNumber); +}; + +} // End of namespace tSage + +#endif diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp index 789ec8fa8d2..5fa36142e7c 100644 --- a/engines/tsage/converse.cpp +++ b/engines/tsage/converse.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/str-array.h" @@ -421,8 +418,10 @@ int ConversationChoiceDialog::execute(const Common::StringArray &choiceList) { Event event; while (!_vm->getEventManager()->shouldQuit()) { while (!_globals->_events.getEvent(event, EVENT_KEYPRESS | EVENT_BUTTON_DOWN | EVENT_MOUSE_MOVE) && - !_vm->getEventManager()->shouldQuit()) - ; + !_vm->getEventManager()->shouldQuit()) { + g_system->delayMillis(10); + g_system->updateScreen(); + } if (_vm->getEventManager()->shouldQuit()) break; diff --git a/engines/tsage/converse.h b/engines/tsage/converse.h index f8c5bc7b14c..6876fa41cbf 100644 --- a/engines/tsage/converse.h +++ b/engines/tsage/converse.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_CONVERSE_H diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 8ad920e6fd2..8c1bd2fd399 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -18,12 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" +#include "common/config-manager.h" #include "engines/engine.h" #include "graphics/palette.h" #include "tsage/tsage.h" @@ -2914,15 +2912,22 @@ void Region::uniteRect(const Rect &rect) { void SceneRegions::load(int sceneNum) { clear(); - - byte *regionData = _resourceManager->getResource(RES_CONTROL, sceneNum, 9999, true); + bool altRegions = _vm->getFeatures() & GF_ALT_REGIONS; + byte *regionData = _resourceManager->getResource(RES_CONTROL, sceneNum, altRegions ? 1 : 9999, true); if (regionData) { int regionCount = READ_LE_UINT16(regionData); for (int regionCtr = 0; regionCtr < regionCount; ++regionCtr) { - int rlbNum = READ_LE_UINT16(regionData + regionCtr * 6 + 2); + int regionId = READ_LE_UINT16(regionData + regionCtr * 6 + 2); - push_back(Region(sceneNum, rlbNum)); + if (altRegions) { + // Load data from within this resource + uint32 dataOffset = READ_LE_UINT32(regionData + regionCtr * 6 + 4); + push_back(Region(regionId, regionData + dataOffset)); + } else { + // Load region from a separate resource + push_back(Region(sceneNum, regionId)); + } } DEALLOCATE(regionData); @@ -3477,52 +3482,11 @@ void SceneHandler::postInit(SceneObjectList *OwnerList) { void SceneHandler::process(Event &event) { // Main keypress handler - if ((event.eventType == EVENT_KEYPRESS) && !event.handled) { - switch (event.kbd.keycode) { - case Common::KEYCODE_F1: - // F1 - Help - MessageDialog::show((_vm->getFeatures() & GF_DEMO) ? DEMO_HELP_MSG : HELP_MSG, OK_BTN_STRING); - break; + if (!event.handled) { + _globals->_game->processEvent(event); - case Common::KEYCODE_F2: { - // F2 - Sound Options - ConfigDialog *dlg = new ConfigDialog(); - dlg->runModal(); - delete dlg; + if (event.eventType == EVENT_KEYPRESS) _globals->_events.setCursorFromFlag(); - break; - } - - case Common::KEYCODE_F3: - // F3 - Quit - _globals->_game->quitGame(); - event.handled = false; - break; - - case Common::KEYCODE_F4: - // F4 - Restart - _globals->_game->restartGame(); - _globals->_events.setCursorFromFlag(); - break; - - case Common::KEYCODE_F7: - // F7 - Restore - _globals->_game->restoreGame(); - _globals->_events.setCursorFromFlag(); - break; - - case Common::KEYCODE_F10: - // F10 - Pause - GfxDialog::setPalette(); - MessageDialog::show(GAME_PAUSED_MSG, OK_BTN_STRING); - _globals->_events.setCursorFromFlag(); - break; - - default: - break; - } - - _globals->_events.setCursorFromFlag(); } // Check for displaying right-click dialog @@ -3643,22 +3607,4 @@ void SceneHandler::saveListener(Serializer &ser) { warning("TODO: SceneHandler::saveListener"); } -/*--------------------------------------------------------------------------*/ - -void Game::execute() { - // Main game loop - bool activeFlag = false; - do { - // Process all currently atcive game handlers - activeFlag = false; - for (SynchronizedList::iterator i = _handlers.begin(); i != _handlers.end(); ++i) { - GameHandler *gh = *i; - if (gh->_lockCtr.getCtr() == 0) { - gh->execute(); - activeFlag = true; - } - } - } while (activeFlag && !_vm->getEventManager()->shouldQuit()); -} - } // End of namespace tSage diff --git a/engines/tsage/core.h b/engines/tsage/core.h index 001b478fc9d..71130e5b0ba 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_CORE_H @@ -912,30 +909,6 @@ public: static void saveListener(Serializer &ser); }; -/*--------------------------------------------------------------------------*/ - -class Game { -protected: - SynchronizedList _handlers; - - static bool notLockedFn(GameHandler *g); - virtual void handleSaveLoad(bool saveFlag, int &saveSlot, Common::String &saveName) {} -public: - virtual ~Game() {} - - void addHandler(GameHandler *entry) { _handlers.push_back(entry); } - void removeHandler(GameHandler *entry) { _handlers.remove(entry); } - - void execute(); - virtual void start() = 0; - virtual void restart() {} - virtual void restartGame() {} - virtual void saveGame() {} - virtual void restoreGame() {} - virtual void quitGame() {} - virtual void endGame(int resNum, int lineNum) {} -}; - } // End of namespace tSage #endif diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp index 7944bad7768..5288c98b725 100644 --- a/engines/tsage/debugger.cpp +++ b/engines/tsage/debugger.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tsage/debugger.h" @@ -66,13 +63,13 @@ bool Debugger::Cmd_Scene(int argc, const char **argv) { if (argc < 2) { DebugPrintf("Usage: %s [prior scene #]\n", argv[0]); return true; - } else { - if (argc == 3) - _globals->_sceneManager._sceneNumber = strToInt(argv[2]); + } - _globals->_sceneManager.changeScene(strToInt(argv[1])); - return false; - } + if (argc == 3) + _globals->_sceneManager._sceneNumber = strToInt(argv[2]); + + _globals->_sceneManager.changeScene(strToInt(argv[1])); + return false; } /** @@ -380,7 +377,8 @@ bool Debugger::Cmd_MoveObject(int argc, const char **argv) { RING_INVENTORY._jar._sceneNumber = sceneNum; break; default: - DebugPrintf("Invlid object Id %s\n", argv[1]); + DebugPrintf("Invalid object Id %s\n", argv[1]); + break; } return true; diff --git a/engines/tsage/debugger.h b/engines/tsage/debugger.h index eeb5bc86f61..3c14cd7bed4 100644 --- a/engines/tsage/debugger.h +++ b/engines/tsage/debugger.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_DEBUGGER_H diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp index ba7b459304a..20c20022576 100644 --- a/engines/tsage/detection.cpp +++ b/engines/tsage/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -91,7 +88,7 @@ public: } virtual const char *getName() const { - return "TsAGE Engine"; + return "TsAGE"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/tsage/detection_tables.h b/engines/tsage/detection_tables.h index d165900d55d..dc55f2a66d6 100644 --- a/engines/tsage/detection_tables.h +++ b/engines/tsage/detection_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ namespace tSage { @@ -112,7 +109,34 @@ static const tSageGameDescription gameDescriptions[] = { GType_BlueForce, GF_FLOPPY }, - + // Blue Force floppy + { + { + "blueforce", + "Floppy", + AD_ENTRY1s("blue.rlb", "17c3993415e8a2cf93040eef7e88ec93", 1156508), + Common::EN_ANY, + Common::kPlatformPC, + ADGF_NO_FLAGS, + Common::GUIO_NONE + }, + GType_BlueForce, + GF_FLOPPY + }, + // Blue Force CD and First Wave use the same files + { + { + "blueforce", + "CD", + AD_ENTRY1s("blue.rlb", "ac29f38184cb3b874ea18523059872ba", 63863322), + Common::EN_ANY, + Common::kPlatformPC, + ADGF_NO_FLAGS, + Common::GUIO_NONE + }, + GType_BlueForce, + GF_CD + }, { AD_TABLE_END_MARKER, 0, 0 } }; diff --git a/engines/tsage/dialogs.cpp b/engines/tsage/dialogs.cpp index f8e35f74f91..759deebbefb 100644 --- a/engines/tsage/dialogs.cpp +++ b/engines/tsage/dialogs.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/translation.h" @@ -73,12 +70,11 @@ MessageDialog::MessageDialog(const Common::String &message, const Common::String int MessageDialog::show(const Common::String &message, const Common::String &btn1Message, const Common::String &btn2Message) { // Ensure that the cursor is the arrow - _globals->_events.pushCursor(CURSOR_ARROW); - _globals->_events.showCursor(); + _globals->_events.setCursor(CURSOR_ARROW); int result = show2(message, btn1Message, btn2Message); - _globals->_events.popCursor(); + _globals->_events.setCursorFromFlag(); return result; } @@ -472,8 +468,10 @@ void InventoryDialog::execute() { while (!_vm->getEventManager()->shouldQuit()) { // Get events Event event; - while (!_globals->_events.getEvent(event) && !_vm->getEventManager()->shouldQuit()) - ; + while (!_globals->_events.getEvent(event) && !_vm->getEventManager()->shouldQuit()) { + g_system->delayMillis(10); + g_system->updateScreen(); + } if (_vm->getEventManager()->shouldQuit()) return; diff --git a/engines/tsage/dialogs.h b/engines/tsage/dialogs.h index c24fa2dd3b0..a50307f775d 100644 --- a/engines/tsage/dialogs.h +++ b/engines/tsage/dialogs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_DIALOGS_H diff --git a/engines/tsage/events.cpp b/engines/tsage/events.cpp index e51c5da479b..e889c56c4d7 100644 --- a/engines/tsage/events.cpp +++ b/engines/tsage/events.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/events.h" @@ -38,7 +35,7 @@ namespace tSage { EventsClass::EventsClass() { _currentCursor = CURSOR_NONE; - hideCursor(); + _lastCursor = CURSOR_NONE; _frameNumber = 0; _priorFrameTime = 0; _prevDelayFrame = 0; @@ -140,17 +137,11 @@ bool EventsClass::getEvent(Event &evt, int eventMask) { * @cursorType Specified cursor number */ void EventsClass::setCursor(CursorType cursorType) { + if (cursorType == _lastCursor) + return; + + _lastCursor = cursorType; _globals->clearFlag(122); - - if ((_currentCursor == cursorType) && CursorMan.isVisible()) - return; - - if (cursorType == CURSOR_NONE) { - if (CursorMan.isVisible()) - CursorMan.showMouse(false); - return; - } - CursorMan.showMouse(true); const byte *cursor; @@ -158,10 +149,15 @@ void EventsClass::setCursor(CursorType cursorType) { uint size; switch (cursorType) { - case OBJECT_STUNNER: - // Stunner cursor - cursor = _resourceManager->getSubResource(4, 1, 6, &size); + case CURSOR_NONE: + // No cursor _globals->setFlag(122); + + if (_vm->getFeatures() & GF_DEMO) { + CursorMan.showMouse(false); + return; + } + cursor = _resourceManager->getSubResource(4, 1, 6, &size); break; case CURSOR_LOOK: @@ -215,8 +211,8 @@ void EventsClass::pushCursor(CursorType cursorType) { uint size; switch (cursorType) { - case CURSOR_CROSSHAIRS: - // Crosshairs cursor + case CURSOR_NONE: + // No cursor cursor = _resourceManager->getSubResource(4, 1, 6, &size); break; @@ -273,19 +269,19 @@ void EventsClass::setCursor(Graphics::Surface &cursor, int transColor, const Com } void EventsClass::setCursorFromFlag() { - setCursor(_globals->getFlag(122) ? CURSOR_CROSSHAIRS : _currentCursor); + setCursor(isCursorVisible() ? _currentCursor : CURSOR_NONE); } void EventsClass::showCursor() { - CursorMan.showMouse(true); + setCursor(_currentCursor); } void EventsClass::hideCursor() { - CursorMan.showMouse(false); + setCursor(CURSOR_NONE); } bool EventsClass::isCursorVisible() const { - return CursorMan.isVisible(); + return !_globals->getFlag(122); } /** diff --git a/engines/tsage/events.h b/engines/tsage/events.h index d2dbd9e0582..9a7bdbe82c0 100644 --- a/engines/tsage/events.h +++ b/engines/tsage/events.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_EVENTS_H @@ -80,6 +77,7 @@ public: Common::Point _mousePos; CursorType _currentCursor; + CursorType _lastCursor; void setCursor(CursorType cursorType); void pushCursor(CursorType cursorType); diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index c6e13447145..e629396501b 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -18,13 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tsage/globals.h" #include "tsage/tsage.h" +#include "tsage/blueforce_logic.h" +#include "tsage/ringworld_demo.h" #include "tsage/ringworld_logic.h" namespace tSage { @@ -52,8 +51,9 @@ static SavedObject *classFactoryProc(const Common::String &className) { /*--------------------------------------------------------------------------*/ Globals::Globals() : - _dialogCenter(160, 140), - _gfxManagerInstance(_screenSurface) { + _dialogCenter(160, 140), + _gfxManagerInstance(_screenSurface), + _randomSource("tsage") { reset(); _stripNum = 0; @@ -64,6 +64,13 @@ Globals::Globals() : _fontColors.background = 0; _fontColors.foreground = 0; _dialogCenter.y = 80; + } else if ((_vm->getGameID() == GType_Ringworld) && (_vm->getFeatures() & GF_CD)) { + _gfxFontNumber = 50; + _gfxColors.background = 53; + _gfxColors.foreground = 0; + _fontColors.background = 51; + _fontColors.foreground = 54; + warning("TODO: Check the 3 additional colors"); } else { _gfxFontNumber = 50; _gfxColors.background = 53; @@ -84,11 +91,19 @@ Globals::Globals() : _scrollFollower = NULL; _inventory = NULL; - if (!(_vm->getFeatures() & GF_DEMO)) { - _inventory = new RingworldInvObjectList(); - _game = new RingworldGame(); - } else { - _game = new RingworldDemoGame(); + switch (_vm->getGameID()) { + case GType_Ringworld: + if (!(_vm->getFeatures() & GF_DEMO)) { + _inventory = new RingworldInvObjectList(); + _game = new RingworldGame(); + } else { + _game = new RingworldDemoGame(); + } + break; + + case GType_BlueForce: + _game = new BlueForceGame(); + break; } } diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index 3a6fab5b70f..6b3df587b68 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_GLOBALS_H @@ -76,15 +73,15 @@ public: void reset(); void setFlag(int flagNum) { - assert((flagNum > 0) && (flagNum < MAX_FLAGS)); + assert((flagNum >= 0) && (flagNum < MAX_FLAGS)); _flags[flagNum] = true; } void clearFlag(int flagNum) { - assert((flagNum > 0) && (flagNum < MAX_FLAGS)); + assert((flagNum >= 0) && (flagNum < MAX_FLAGS)); _flags[flagNum] = false; } bool getFlag(int flagNum) const { - assert((flagNum > 0) && (flagNum < MAX_FLAGS)); + assert((flagNum >= 0) && (flagNum < MAX_FLAGS)); return _flags[flagNum]; } diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index c50da6beef6..cc11343c9cd 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tsage/events.h" @@ -673,12 +670,18 @@ void GfxElement::drawFrame() { * @event Event to process */ bool GfxElement::focusedEvent(Event &event) { + Common::Point mousePos = event.mousePos; bool highlightFlag = false; - while (!_vm->getEventManager()->shouldQuit()) { + // HACK: It should use the GfxManager object to figure out the relative + // position, but for now this seems like the easiest way. + int xOffset = mousePos.x - _globals->_events._mousePos.x; + int yOffset = mousePos.y - _globals->_events._mousePos.y; + + while (event.eventType != EVENT_BUTTON_UP && !_vm->getEventManager()->shouldQuit()) { g_system->delayMillis(10); - if (_bounds.contains(event.mousePos)) { + if (_bounds.contains(mousePos)) { if (!highlightFlag) { // First highlight call to show the highlight highlightFlag = true; @@ -690,8 +693,12 @@ bool GfxElement::focusedEvent(Event &event) { highlight(); } - if (_globals->_events.getEvent(event, EVENT_BUTTON_UP)) - break; + if (_globals->_events.getEvent(event, EVENT_MOUSE_MOVE | EVENT_BUTTON_UP)) { + if (event.eventType == EVENT_MOUSE_MOVE) { + mousePos.x = event.mousePos.x + xOffset; + mousePos.y = event.mousePos.y + yOffset; + } + } } if (highlightFlag) { @@ -867,7 +874,7 @@ GfxDialog::~GfxDialog() { void GfxDialog::setDefaults() { GfxElement::setDefaults(); - // Initialise the embedded graphics manager + // Initialize the embedded graphics manager _gfxManager.setDefaults(); // Figure out a rect needed for all the added elements @@ -970,9 +977,10 @@ GfxButton *GfxDialog::execute(GfxButton *defaultButton) { // Event loop GfxButton *selectedButton = NULL; - while (!_vm->getEventManager()->shouldQuit()) { + bool breakFlag = false; + while (!_vm->getEventManager()->shouldQuit() && !breakFlag) { Event event; - while (_globals->_events.getEvent(event)) { + while (_globals->_events.getEvent(event) && !breakFlag) { // Adjust mouse positions to be relative within the dialog event.mousePos.x -= _gfxManager._bounds.left; event.mousePos.y -= _gfxManager._bounds.top; @@ -981,19 +989,25 @@ GfxButton *GfxDialog::execute(GfxButton *defaultButton) { if ((*i)->process(event)) selectedButton = static_cast(*i); } - } - if (selectedButton) - break; - else if (!event.handled) { - if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_ESCAPE)) { - selectedButton = NULL; - break; - } else if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_RETURN)) { - selectedButton = defaultButton; + if (selectedButton) { + breakFlag = true; break; + } else if (!event.handled) { + if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_ESCAPE)) { + selectedButton = NULL; + breakFlag = true; + break; + } else if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_RETURN)) { + selectedButton = defaultButton; + breakFlag = true; + break; + } } } + + g_system->delayMillis(10); + g_system->updateScreen(); } _gfxManager.deactivate(); @@ -1195,7 +1209,7 @@ int GfxFont::getStringWidth(const char *s) { /** * Returns the maximum number of characters for words that will fit into a given width * - * @s Message to be analysed + * @s Message to be analyzed * @maxWidth Maximum allowed width */ int GfxFont::getStringFit(const char *&s, int maxWidth) { @@ -1241,7 +1255,7 @@ int GfxFont::getStringFit(const char *&s, int maxWidth) { * Fills out the passed rect with the dimensions of a given string word-wrapped to a * maximum specified width * - * @s Message to be analysed + * @s Message to be analyzed * @bounds Rectangle to put output size into * @maxWidth Maximum allowed line width in pixels */ diff --git a/engines/tsage/graphics.h b/engines/tsage/graphics.h index 8be46294935..b2695200397 100644 --- a/engines/tsage/graphics.h +++ b/engines/tsage/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef RING_GRAPHICS_H @@ -43,8 +40,8 @@ class Region; */ class Rect : public Common::Rect, public Serialisable { public: - Rect() : Common::Rect() {}; - Rect(int16 x1, int16 y1, int16 x2, int16 y2) : Common::Rect(x1, y1, x2, y2) {}; + Rect() : Common::Rect() {} + Rect(int16 x1, int16 y1, int16 x2, int16 y2) : Common::Rect(x1, y1, x2, y2) {} void set(int16 x1, int16 y1, int16 x2, int16 y2); void collapse(int dx, int dy); @@ -63,7 +60,7 @@ public: uint8 foreground; uint8 background; - GfxColors() : foreground(0), background(0) {}; + GfxColors() : foreground(0), background(0) {} }; class LineSlice { @@ -95,8 +92,8 @@ public: Graphics::Surface lockSurface(); void unlockSurface(); void create(int width, int height); - void setBounds(const Rect &bounds) { _bounds = bounds; }; - const Rect &getBounds() const { return _bounds; }; + void setBounds(const Rect &bounds) { _bounds = bounds; } + const Rect &getBounds() const { return _bounds; } void copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, Region *priorityRegion = NULL); void copyFrom(GfxSurface &src, Rect destBounds, Region *priorityRegion = NULL) { @@ -190,8 +187,8 @@ public: virtual void setDefaults(); virtual void remove() { _owner = NULL; } virtual void highlight(); - virtual void draw() {}; - virtual bool process(Event &event) { return false; }; + virtual void draw() {} + virtual bool process(Event &event) { return false; } virtual bool focusedEvent(Event &event); }; @@ -232,7 +229,7 @@ private: public: Common::String _message; public: - GfxButton() : GfxElement() {}; + GfxButton() : GfxElement() {} virtual ~GfxButton() {} void setText(const Common::String &s) { @@ -274,7 +271,7 @@ public: _surface.setBounds(_bounds); return _surface.lockSurface(); } - void unlockSurface() { _surface.unlockSurface(); }; + void unlockSurface() { _surface.unlockSurface(); } void fillArea(int xp, int yp, int color); void fillRect(const Rect &bounds, int color); void fillRect2(int xs, int ys, int width, int height, int color); diff --git a/engines/tsage/module.mk b/engines/tsage/module.mk index 2f9194a9bac..aefc8b0992c 100644 --- a/engines/tsage/module.mk +++ b/engines/tsage/module.mk @@ -1,6 +1,7 @@ MODULE := engines/tsage MODULE_OBJS := \ + blueforce_logic.o \ converse.o \ core.o \ debugger.o \ diff --git a/engines/tsage/resources.cpp b/engines/tsage/resources.cpp index 2b678a848af..676d319ba95 100644 --- a/engines/tsage/resources.cpp +++ b/engines/tsage/resources.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/engines/tsage/resources.h b/engines/tsage/resources.h index 7b518cabd64..efbb86b24e7 100644 --- a/engines/tsage/resources.h +++ b/engines/tsage/resources.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef RING_RESOURCES_H diff --git a/engines/tsage/ringworld_demo.cpp b/engines/tsage/ringworld_demo.cpp index 29438c03476..3ad414fa20e 100644 --- a/engines/tsage/ringworld_demo.cpp +++ b/engines/tsage/ringworld_demo.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tsage/ringworld_demo.h" @@ -30,6 +27,80 @@ namespace tSage { +void RingworldDemoGame::start() { + // Start the demo's single scene + _globals->_sceneManager.changeScene(1); + + _globals->_events.setCursor(CURSOR_NONE); +} + +Scene *RingworldDemoGame::createScene(int sceneNumber) { + // The demo only has a single scene, so ignore the scene number and always return it + return new RingworldDemoScene(); +} + +void RingworldDemoGame::quitGame() { + _globals->_events.setCursor(CURSOR_ARROW); + MessageDialog *dlg = new MessageDialog(DEMO_EXIT_MSG, EXIT_BTN_STRING, DEMO_BTN_STRING); + dlg->draw(); + + GfxButton *selectedButton = dlg->execute(&dlg->_btn2); + bool exitFlag = selectedButton != &dlg->_btn2; + + delete dlg; + _globals->_events.hideCursor(); + + if (exitFlag) + _vm->quitGame(); +} + +void RingworldDemoGame::pauseGame() { + _globals->_events.setCursor(CURSOR_ARROW); + MessageDialog *dlg = new MessageDialog(DEMO_PAUSED_MSG, EXIT_BTN_STRING, DEMO_RESUME_BTN_STRING); + dlg->draw(); + + GfxButton *selectedButton = dlg->execute(&dlg->_btn2); + bool exitFlag = selectedButton != &dlg->_btn2; + + delete dlg; + _globals->_events.hideCursor(); + + if (exitFlag) + _vm->quitGame(); +} + +void RingworldDemoGame::processEvent(Event &event) { + if (event.eventType == EVENT_KEYPRESS) { + switch (event.kbd.keycode) { + case Common::KEYCODE_F1: + // F1 - Help + MessageDialog::show(DEMO_HELP_MSG, OK_BTN_STRING); + break; + + case Common::KEYCODE_F2: { + // F2 - Sound Options + ConfigDialog *dlg = new ConfigDialog(); + dlg->runModal(); + delete dlg; + _globals->_events.setCursorFromFlag(); + break; + } + + case Common::KEYCODE_F3: + // F3 - Quit + quitGame(); + event.handled = false; + break; + + default: + break; + } + } else if (event.eventType == EVENT_BUTTON_DOWN) { + pauseGame(); + event.handled = true; + } +} + /*-------------------------------------------------------------------------- * Ringworld Demo scene * diff --git a/engines/tsage/ringworld_demo.h b/engines/tsage/ringworld_demo.h index 63ffe565554..7492c1e871a 100644 --- a/engines/tsage/ringworld_demo.h +++ b/engines/tsage/ringworld_demo.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_RINGWORLD_DEMO_H @@ -34,6 +31,15 @@ namespace tSage { +class RingworldDemoGame: public Game { +private: + void pauseGame(); +public: + virtual void start(); + virtual Scene *createScene(int sceneNumber); + virtual void quitGame(); + virtual void processEvent(Event &event); +}; class RingworldDemoScene: public Scene { public: diff --git a/engines/tsage/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp index d334e0ce1ff..95c9da9fe71 100644 --- a/engines/tsage/ringworld_logic.cpp +++ b/engines/tsage/ringworld_logic.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -42,10 +39,7 @@ namespace tSage { -Scene *SceneFactory::createScene(int sceneNumber) { - if (_vm->getFeatures() & GF_DEMO) - return new RingworldDemoScene(); - +Scene *RingworldGame::createScene(int sceneNumber) { switch (sceneNumber) { /* Scene group 1 */ // Kziniti Palace (Introduction) @@ -1328,10 +1322,9 @@ void RingworldGame::handleSaveLoad(bool saveFlag, int &saveSlot, Common::String } void RingworldGame::start() { - // Set some default flags and cursor + // Set some default flags _globals->setFlag(12); _globals->setFlag(34); - _globals->_events.setCursor(CURSOR_WALK); // Set the screen to scroll in response to the player moving off-screen _globals->_scrollFollower = &_globals->_player; @@ -1341,8 +1334,12 @@ void RingworldGame::start() { RING_INVENTORY._scanner._sceneNumber = 1; RING_INVENTORY._ring._sceneNumber = 1; - // Switch to the title screen - _globals->_sceneManager.setNewScene(1000); + + if (ConfMan.hasKey("save_slot")) + _globals->_sceneHandler._loadGameSlot = ConfMan.getInt("save_slot"); + else + // Switch to the title screen + _globals->_sceneManager.setNewScene(1000); _globals->_events.showCursor(); } @@ -1416,11 +1413,14 @@ void RingworldGame::endGame(int resNum, int lineNum) { // Savegames exist, so prompt for Restore/Restart bool breakFlag; do { - if (MessageDialog::show(msg, RESTART_BTN_STRING, RESTORE_BTN_STRING) == 0) { + if (_vm->shouldQuit()) { + breakFlag = true; + } else if (MessageDialog::show(msg, RESTART_BTN_STRING, RESTORE_BTN_STRING) == 0) { + restart(); breakFlag = true; } else { handleSaveLoad(false, _globals->_sceneHandler._loadGameSlot, _globals->_sceneHandler._saveName); - breakFlag = _globals->_sceneHandler._loadGameSlot > 0; + breakFlag = _globals->_sceneHandler._loadGameSlot >= 0; } } while (!breakFlag); } @@ -1428,16 +1428,52 @@ void RingworldGame::endGame(int resNum, int lineNum) { _globals->_events.setCursorFromFlag(); } -/*--------------------------------------------------------------------------*/ +void RingworldGame::processEvent(Event &event) { + if (event.eventType == EVENT_KEYPRESS) { + switch (event.kbd.keycode) { + case Common::KEYCODE_F1: + // F1 - Help + MessageDialog::show(HELP_MSG, OK_BTN_STRING); + break; -void RingworldDemoGame::start() { - // Start the demo's single scene - _globals->_sceneManager.changeScene(1); - - _globals->_events.setCursor(CURSOR_NONE); -} + case Common::KEYCODE_F2: { + // F2 - Sound Options + ConfigDialog *dlg = new ConfigDialog(); + dlg->runModal(); + delete dlg; + _globals->_events.setCursorFromFlag(); + break; + } -void RingworldDemoGame::restart() { + case Common::KEYCODE_F3: + // F3 - Quit + quitGame(); + event.handled = false; + break; + + case Common::KEYCODE_F4: + // F4 - Restart + restartGame(); + _globals->_events.setCursorFromFlag(); + break; + + case Common::KEYCODE_F7: + // F7 - Restore + restoreGame(); + _globals->_events.setCursorFromFlag(); + break; + + case Common::KEYCODE_F10: + // F10 - Pause + GfxDialog::setPalette(); + MessageDialog::show(GAME_PAUSED_MSG, OK_BTN_STRING); + _globals->_events.setCursorFromFlag(); + break; + + default: + break; + } + } } } // End of namespace tSage diff --git a/engines/tsage/ringworld_logic.h b/engines/tsage/ringworld_logic.h index e84779e6ada..19b0f10b421 100644 --- a/engines/tsage/ringworld_logic.h +++ b/engines/tsage/ringworld_logic.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_RINGWORLD_LOGIC_H @@ -454,21 +451,11 @@ public: virtual void restoreGame(); virtual void quitGame(); virtual void endGame(int resNum, int lineNum); -}; -class RingworldDemoGame: public Game { -protected: - virtual void restart(); -public: - virtual void start(); - virtual void restartGame() {} - virtual void saveGame() {} - virtual void restoreGame() {} - virtual void quitGame() {} - virtual void endGame(int resNum, int lineNum) {} + virtual Scene *createScene(int sceneNumber); + virtual void processEvent(Event &event); }; - } // End of namespace tSage #endif diff --git a/engines/tsage/ringworld_scenes1.cpp b/engines/tsage/ringworld_scenes1.cpp index e5ec60c690f..b6daadbef77 100644 --- a/engines/tsage/ringworld_scenes1.cpp +++ b/engines/tsage/ringworld_scenes1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tsage/ringworld_scenes1.h" @@ -1762,6 +1759,8 @@ Scene50::Scene50() : _item3(8, OBJECT_STUNNER, 50, 14, OBJECT_SCANNER, 50, 13, CURSOR_LOOK, 50, 3, LIST_END), _item4(9, OBJECT_SCANNER, 40, 39, OBJECT_STUNNER, 40, 40, CURSOR_USE, 40, 41, CURSOR_LOOK, 50, 5, LIST_END), _item5(10, OBJECT_SCANNER, 50, 17, OBJECT_STUNNER, 50, 18, CURSOR_LOOK, 50, 6, CURSOR_USE, 30, 8, LIST_END) { + + _doorwayRect = Rect(80, 108, 160, 112); } void Scene50::postInit(SceneObjectList *OwnerList) { @@ -1824,7 +1823,6 @@ void Scene50::postInit(SceneObjectList *OwnerList) { _item0.setBounds(Rect(200, 0, 320, 200)); _globals->_sceneItems.addItems(&_item3, &_item4, &_item5, &_item0, NULL); - _doorwayRect = Rect(80, 108, 160, 112); } void Scene50::signal() { @@ -1843,6 +1841,8 @@ void Scene50::signal() { } void Scene50::dispatch() { + Scene::dispatch(); + if ((_sceneMode != 55) && _doorwayRect.contains(_globals->_player._position)) { // Player in house doorway, start player moving to within _globals->_player.disableControl(); diff --git a/engines/tsage/ringworld_scenes1.h b/engines/tsage/ringworld_scenes1.h index be6d8e63371..554b261f2cb 100644 --- a/engines/tsage/ringworld_scenes1.h +++ b/engines/tsage/ringworld_scenes1.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_RINGWORLD_SCENES1_H @@ -443,7 +440,6 @@ class Scene95 : public Scene { public: Action1 _action1; - int _field326; SceneObject _object1, _object2, _object3; SoundHandler _soundHandler; diff --git a/engines/tsage/ringworld_scenes10.cpp b/engines/tsage/ringworld_scenes10.cpp index 65e415748d6..0b4186531df 100644 --- a/engines/tsage/ringworld_scenes10.cpp +++ b/engines/tsage/ringworld_scenes10.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "graphics/cursorman.h" @@ -52,7 +49,7 @@ void Object9350::draw() { } /*-------------------------------------------------------------------------- - * Scene 9100 + * Scene 9100 - Near beach: Slave washing clothes * *--------------------------------------------------------------------------*/ void Scene9100::SceneHotspot1::doAction(int action) { @@ -177,7 +174,7 @@ void Scene9100::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 9150 + * Scene 9150 - Castle: Outside the bulwarks * *--------------------------------------------------------------------------*/ void Scene9150::Object3::signal() { @@ -297,7 +294,7 @@ void Scene9150::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 9200 + * Scene 9200 - Castle: Near the fountain * *--------------------------------------------------------------------------*/ void Scene9200::SceneHotspot1::doAction(int action) { @@ -473,7 +470,7 @@ void Scene9200::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 9300 + * Scene 9300 - Castle: In front of a large guarded door * *--------------------------------------------------------------------------*/ void Scene9300::signal() { @@ -540,7 +537,7 @@ void Scene9300::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 9350 + * Scene 9350 - Castle: In a hallway * *--------------------------------------------------------------------------*/ @@ -626,7 +623,7 @@ void Scene9350::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 9360 + * Scene 9360 - Castle: In a hallway * *--------------------------------------------------------------------------*/ @@ -704,7 +701,7 @@ void Scene9360::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 9400 + * Scene 9400 - Castle: Black-Smith room * *--------------------------------------------------------------------------*/ Scene9400::Scene9400() { @@ -822,8 +819,14 @@ void Scene9400::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager, this, 9400, &_globals->_player, &_object1, &_object3, NULL); } +void Scene9400::synchronize(Serializer &s) { + Scene::synchronize(s); + if (s.getVersion() >= 3) + s.syncAsSint16LE(_field1032); +} + /*-------------------------------------------------------------------------- - * Scene 9450 + * Scene 9450 - Castle: Dining room * *--------------------------------------------------------------------------*/ void Scene9450::Object2::signal() { @@ -1006,7 +1009,7 @@ void Scene9450::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 9500 + * Scene 9500 - Castle: Bedroom * *--------------------------------------------------------------------------*/ void Scene9500::Hotspot1::doAction(int action) { @@ -1227,7 +1230,7 @@ void Scene9500::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 9700 + * Scene 9700 - Castle: Balcony * *--------------------------------------------------------------------------*/ void Scene9700::signal() { @@ -1299,7 +1302,7 @@ void Scene9700::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 9750 + * Scene 9750 - Castle: In the garden * *--------------------------------------------------------------------------*/ void Scene9750::signal() { @@ -1335,7 +1338,7 @@ void Scene9750::postInit(SceneObjectList *OwnerList) { /*-------------------------------------------------------------------------- - * Scene 9850 + * Scene 9850 - Castle: Dressing room * *--------------------------------------------------------------------------*/ void Scene9850::Object6::doAction(int action) { @@ -1639,7 +1642,7 @@ void Scene9850::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 9900 + * Scene 9900 - Ending * *--------------------------------------------------------------------------*/ void Scene9900::strAction1::signal() { @@ -1780,6 +1783,15 @@ void Scene9900::strAction2::dispatch() { Action::dispatch(); } +void Scene9900::strAction2::synchronize(Serializer &s) { + Action::synchronize(s); + if (s.getVersion() >= 3) { + s.syncAsSint16LE(_lineNum); + s.syncAsSint16LE(_txtArray1Index); + s.syncAsSint16LE(_var3); + } +} + void Scene9900::strAction3::signal() { const byte mask3[3] = {0xff, 0, 0}; const byte mask4[3] = {0, 0, 0}; @@ -1985,7 +1997,7 @@ void Scene9900::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 9999 + * Scene 9999 - Space travel * *--------------------------------------------------------------------------*/ diff --git a/engines/tsage/ringworld_scenes10.h b/engines/tsage/ringworld_scenes10.h index 93987aa64be..aa415557183 100644 --- a/engines/tsage/ringworld_scenes10.h +++ b/engines/tsage/ringworld_scenes10.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_RINGWORLD_SCENES10_H @@ -241,6 +238,7 @@ public: virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void signal(); virtual void dispatch(); + virtual void synchronize(Serializer &s); }; class Scene9450 : public Scene2 { @@ -471,6 +469,7 @@ class Scene9900 : public Scene { virtual void signal(); virtual void dispatch(); + virtual void synchronize(Serializer &s); }; class strAction3 : public Action { diff --git a/engines/tsage/ringworld_scenes2.cpp b/engines/tsage/ringworld_scenes2.cpp index 6a8db81adf3..4378eac7245 100644 --- a/engines/tsage/ringworld_scenes2.cpp +++ b/engines/tsage/ringworld_scenes2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -113,6 +110,8 @@ void Scene1000::Action3::signal() { setDelay(240); break; case 5: { + _globals->_player.enableControl(); + const char *SEEN_INTRO = "seen_intro"; if (!ConfMan.hasKey(SEEN_INTRO) || !ConfMan.getBool(SEEN_INTRO)) { // First time being played, so show the introduction @@ -478,13 +477,14 @@ void Scene1001::Action1::signal() { case 19: { _globals->_soundHandler.startSound(91); byte adjustData[4] = {0xff, 0xff, 0xff, 0}; - _globals->_scenePalette.fade(adjustData, true, 0); + _globals->_scenePalette.fade(adjustData, false, 0); scene->_object1._strip = 7; scene->_object1._frame = 1; scene->_object1.setPosition(Common::Point(314, 112)); scene->_object1.addMover(NULL); setDelay(2); + break; } case 20: _globals->_scenePalette.loadPalette(16); diff --git a/engines/tsage/ringworld_scenes2.h b/engines/tsage/ringworld_scenes2.h index 75843d35708..7731b45ae87 100644 --- a/engines/tsage/ringworld_scenes2.h +++ b/engines/tsage/ringworld_scenes2.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_RINGWORLD_SCENES2_H diff --git a/engines/tsage/ringworld_scenes3.cpp b/engines/tsage/ringworld_scenes3.cpp index f788f9a28ba..a19f15eca60 100644 --- a/engines/tsage/ringworld_scenes3.cpp +++ b/engines/tsage/ringworld_scenes3.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -491,11 +488,11 @@ void Scene2100::Action1::signal() { switch (_actionIndex++) { case 0: _globals->_player.disableControl(); - if (!scene->_field1800) + if (!scene->_sitFl) setDelay(1); else { setAction(&scene->_sequenceManager, this, 2102, &_globals->_player, NULL); - scene->_field1800 = 0; + scene->_sitFl = 0; } break; case 1: { @@ -634,7 +631,7 @@ void Scene2100::Action4::signal() { switch (_actionIndex++) { case 0: _globals->_player.disableControl(); - if (!scene->_field1800) + if (!scene->_sitFl) setDelay(1); else setAction(&scene->_sequenceManager, this, 2102, &_globals->_player, NULL); @@ -658,6 +655,7 @@ void Scene2100::Action4::signal() { } void Scene2100::Action5::signal() { + // Quinn enters the cokpit after Seeker decided to enter the cave alone Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -1150,6 +1148,7 @@ void Scene2100::Action14::signal() { case 12: scene->_object3.setStrip(2); setDelay(30); + break; case 13: scene->_object3.fixPriority(1); scene->_soundHandler.startSound(162); @@ -1403,6 +1402,7 @@ void Scene2100::Hotspot8::doAction(int action) { } void Scene2100::Hotspot10::doAction(int action) { + // Quinn's Console Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; switch (action) { @@ -1410,13 +1410,15 @@ void Scene2100::Hotspot10::doAction(int action) { SceneItem::display2(2100, 13); break; case CURSOR_USE: - if (scene->_field1800) { + if (scene->_sitFl) { _globals->_player.disableControl(); scene->_sceneMode = 2102; scene->setAction(&scene->_sequenceManager, scene, 2102, &_globals->_player, NULL); } else if (_globals->getFlag(13)) { SceneItem::display2(2100, 28); } else { + _globals->_player.disableControl(); + scene->_sceneMode = 2101; scene->setAction(&scene->_sequenceManager, scene, 2101, &_globals->_player, NULL); } break; @@ -1473,24 +1475,23 @@ void Scene2100::Object2::doAction(int action) { case CURSOR_TALK: if (_globals->getFlag(72)) { _globals->_player.disableControl(); - if (!_globals->getFlag(52)) + if (!_globals->getFlag(52)) { + scene->_sceneMode = 2111; scene->setAction(&scene->_sequenceManager, scene, 2111, NULL); - else { + } else { scene->_sceneMode = _globals->getFlag(53) ? 2112 : 2110; scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, NULL); } - } else { - if (_globals->getFlag(14)) + } else if (_globals->getFlag(13)) { + SceneItem::display2(2100, 31); + } else if (_globals->getFlag(14)) { SceneItem::display2(2100, 32); - else { + } else { _globals->setFlag(14); _globals->_player.disableControl(); scene->_sceneMode = 2108; scene->setAction(&scene->_sequenceManager, scene, 2109, NULL); - } } - - scene->setAction(&scene->_action4); break; default: SceneHotspot::doAction(action); @@ -1499,18 +1500,19 @@ void Scene2100::Object2::doAction(int action) { } void Scene2100::Object3::doAction(int action) { + // Miranda Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: - if (!_globals->getFlag(59)) + if (_globals->getFlag(59)) SceneItem::display2(2100, 34); else error("***I have no response."); break; case CURSOR_TALK: - if (!_globals->getFlag(59)) { + if (_globals->getFlag(59)) { _globals->_player.disableControl(); scene->_sceneMode = 2108; scene->setAction(&scene->_sequenceManager, scene, 2108, NULL); @@ -1536,6 +1538,14 @@ Scene2100::Scene2100() : _hotspot12(0, CURSOR_LOOK, 2100, 24, CURSOR_USE, 2100, 25, LIST_END), _hotspot13(0, CURSOR_LOOK, 2100, 17, LIST_END), _hotspot15(0, CURSOR_LOOK, 2100, 22, CURSOR_USE, 2100, 23, LIST_END) { + _area1.setup(2153, 2, 1, 2100); + _area1._pt = Common::Point(200, 31); + _area2.setup(2153, 3, 1, 2150); + _area2._pt = Common::Point(200, 50); + _area3.setup(2153, 4, 1, 2320); + _area3._pt = Common::Point(200, 75); + _area4.setup(2153, 1, 1, OBJECT_TRANSLATOR); + _area4._pt = Common::Point(237, 77); } void Scene2100::postInit(SceneObjectList *OwnerList) { @@ -1662,15 +1672,6 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { &_hotspot13, &_hotspot12, &_hotspot8, &_object1, &_hotspot2, &_hotspot3, &_hotspot4, &_hotspot5, &_hotspot6, &_hotspot7, &_hotspot1, NULL); - _area1.setup(2153, 2, 1, 2100); - _area1._pt = Common::Point(200, 31); - _area2.setup(2153, 3, 1, 2150); - _area2._pt = Common::Point(200, 50); - _area3.setup(2153, 4, 1, 2320); - _area3._pt = Common::Point(200, 75); - _area4.setup(2153, 1, 1, OBJECT_TRANSLATOR); - _area4._pt = Common::Point(237, 77); - _globals->_player.postInit(); if (_globals->getFlag(13)) { _globals->_player.setVisage(2170); @@ -1685,7 +1686,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _globals->_player._moveDiff.x = 4; _globals->_player.changeZoom(-1); _globals->_player.disableControl(); - _field1800 = 0; + _sitFl = 0; switch (_globals->_sceneManager._previousScene) { case 2120: @@ -1750,6 +1751,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_action14); } else { _globals->_player.disableControl(); + _globals->_player.fixPriority(1); _globals->_player.setPosition(Common::Point(157, 56)); _sceneMode = 2104; @@ -1820,7 +1822,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _globals->_player.fixPriority(152); _globals->_player.setStrip(2); - _field1800 = 1; + _sitFl = 1; _object4.postInit(); _object4.setVisage(2102); @@ -1854,7 +1856,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _globals->_player.fixPriority(152); _globals->_player.setStrip(2); - _field1800 = 1; + _sitFl = 1; setAction(&_action16); } break; @@ -1928,12 +1930,12 @@ void Scene2100::stripCallback(int v) { void Scene2100::signal() { switch (_sceneMode) { case 2101: - _field1800 = 1; + _sitFl = 1; _globals->_player._uiEnabled = true; _globals->_events.setCursor(CURSOR_USE); break; case 2102: - _field1800 = 0; + _sitFl = 0; _globals->_player.enableControl(); break; case 2103: @@ -1957,6 +1959,12 @@ void Scene2100::signal() { } } +void Scene2100::synchronize(Serializer &s) { + Scene::synchronize(s); + if (s.getVersion() >= 3) + s.syncAsSint16LE(_sitFl); +} + /*-------------------------------------------------------------------------- * Scene 2120 - Encyclopedia * @@ -2163,12 +2171,19 @@ void Scene2120::Action1::dispatch() { /*--------------------------------------------------------------------------*/ +Scene2120::Scene2120(): Scene() { + _listRect = Rect(18, 48, 260, 177); + _dbMode = 0; + _prevDbMode = 0; + _visageVisable = false; + _subjectIndex = 0; +} + void Scene2120::postInit(SceneObjectList *OwnerList) { loadScene(2120); setZoomPercents(0, 100, 200, 100); _globals->_player.disableControl(); - _listRect = Rect(18, 48, 260, 177); _subjectButton.setBounds(Rect(266, 13, 320, 56)); _nextPageButton.setBounds(Rect(266, 56, 320, 98)); _previousPageButton.setBounds(Rect(266, 98, 320, 140)); @@ -2185,11 +2200,6 @@ void Scene2120::postInit(SceneObjectList *OwnerList) { _arrowHotspot._frame = 1; _arrowHotspot.setPosition(Common::Point(400, 200)); - _dbMode = 0; - _prevDbMode = 0; - _visageVisable = false; - _subjectIndex = 0; - setAction(&_action1); _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; @@ -2471,6 +2481,17 @@ Scene2150::Scene2150() : _hotspot8(16, CURSOR_LOOK, 2150, 8, LIST_END), _hotspot9(0, CURSOR_LOOK, 2150, 9, CURSOR_USE, 2150, 13, LIST_END), _hotspot11(0, CURSOR_LOOK, 2150, 12, LIST_END) { + _rect1 = Rect(260, 70, 270, 77); + _rect2 = Rect(222, 142, 252, 150); + _area1.setup(2153, 2, 1, 2100); + _area1._pt = Common::Point(200, 31); + _area2.setup(2153, 3, 1, 2150); + _area2._pt = Common::Point(200, 50); + _area3.setup(2153, 4, 1, 2320); + _area3._pt = Common::Point(200, 75); + _area4.setup(2153, 1, 1, 10); + _area4._pt = Common::Point(237, 77); + } void Scene2150::postInit(SceneObjectList *OwnerList) { @@ -2484,7 +2505,7 @@ void Scene2150::postInit(SceneObjectList *OwnerList) { _hotspot7.setVisage(2152); _hotspot7._frame = 1; _hotspot7._strip = 2; - _hotspot7.animate(ANIM_MODE_8, NULL); + _hotspot7.animate(ANIM_MODE_8, 0, NULL); _hotspot7.setPosition(Common::Point(122, 62)); _hotspot7.changeZoom(100); _hotspot7.fixPriority(76); @@ -2521,9 +2542,6 @@ void Scene2150::postInit(SceneObjectList *OwnerList) { _hotspot10.setStrip(5); _hotspot10.setPosition(Common::Point(59, 56)); - _rect1 = Rect(260, 70, 270, 77); - _rect2 = Rect(222, 142, 252, 150); - _globals->_player.postInit(); _globals->_player.setVisage(_globals->getFlag(13) ? 2170 : 0); _globals->_player.animate(ANIM_MODE_1, NULL); @@ -2539,15 +2557,6 @@ void Scene2150::postInit(SceneObjectList *OwnerList) { _globals->_sceneItems.addItems(&_hotspot1, &_hotspot2, &_hotspot3, &_hotspot4, &_hotspot5, &_hotspot6, &_hotspot7, &_hotspot10, &_hotspot9, &_hotspot11, &_hotspot8, NULL); - _area1.setup(2153, 2, 1, 2100); - _area1._pt = Common::Point(200, 31); - _area2.setup(2153, 3, 1, 2150); - _area2._pt = Common::Point(200, 50); - _area3.setup(2153, 4, 1, 2320); - _area3._pt = Common::Point(200, 75); - _area4.setup(2153, 1, 1, 10); - _area4._pt = Common::Point(237, 77); - switch (_globals->_sceneManager._previousScene) { case 2120: _globals->_soundHandler.startSound(160); @@ -4216,7 +4225,7 @@ void Scene2280::Hotspot18::doAction(int action) { /*--------------------------------------------------------------------------*/ Scene2280::Scene2280() : - _hotspot3(0, CURSOR_LOOK, 2280, 30, CURSOR_USE, 31, 0, LIST_END), + _hotspot3(0, CURSOR_LOOK, 2280, 30, CURSOR_USE, 2280, 31, LIST_END), _hotspot5(0, CURSOR_LOOK, 2280, 35, CURSOR_USE, 2280, 36, LIST_END), _hotspot6(0, CURSOR_LOOK, 2280, 19, CURSOR_USE, 2280, 20, LIST_END), _hotspot9(0, CURSOR_LOOK, 2280, 5, CURSOR_USE, 2280, 6, LIST_END), @@ -4366,6 +4375,7 @@ void Scene2280::synchronize(Serializer &s) { *--------------------------------------------------------------------------*/ void Scene2300::Action1::signal() { + // Quinn and Seeker Scene2300 *scene = (Scene2300 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -4436,6 +4446,7 @@ void Scene2300::Action1::signal() { break; case 8: _globals->_game->endGame(2300, 0); + remove(); break; case 9: if (scene->_hotspot5._mover) @@ -4508,6 +4519,7 @@ void Scene2300::Action1::signal() { } void Scene2300::Action2::signal() { + // Miranda tearing cables Scene2300 *scene = (Scene2300 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -4574,6 +4586,7 @@ void Scene2300::Action2::signal() { } void Scene2300::Action3::signal() { + // Stunned Miranda Scene2300 *scene = (Scene2300 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -4626,6 +4639,7 @@ void Scene2300::Action3::signal() { } void Scene2300::Action4::signal() { + // Ennemies coming Scene2300 *scene = (Scene2300 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -4664,6 +4678,7 @@ void Scene2300::Action4::signal() { /*--------------------------------------------------------------------------*/ void Scene2300::Hotspot5::doAction(int action) { + // Ennemies Scene2300 *scene = (Scene2300 *)_globals->_sceneManager._scene; switch (action) { @@ -4686,6 +4701,7 @@ void Scene2300::Hotspot5::doAction(int action) { } void Scene2300::Hotspot7::doAction(int action) { + // Miranda Scene2300 *scene = (Scene2300 *)_globals->_sceneManager._scene; switch (action) { @@ -4851,6 +4867,14 @@ Scene2310::Scene2310() { _pageList[18].set(18, 2, 3, 0, 1, 4); _pageList[19].set(19, 3, 0, 1, 4, 2); _pageList[20].set(20, 4, 0, 3, 1, 2); + + _rectList[0].set(135, 70, 151, 140); + _rectList[1].set(151, 70, 167, 140); + _rectList[2].set(167, 70, 183, 140); + _rectList[3].set(183, 70, 199, 140); + _rectList[4].set(199, 70, 215, 140); + + _wireIndex = 5; } void Scene2310::postInit(SceneObjectList *OwnerList) { @@ -4867,16 +4891,9 @@ void Scene2310::postInit(SceneObjectList *OwnerList) { _wireList[idx].setPosition(pointList[idx]); } - _rectList[0].set(135, 70, 151, 140); - _rectList[1].set(151, 70, 167, 140); - _rectList[2].set(167, 70, 183, 140); - _rectList[3].set(183, 70, 199, 140); - _rectList[4].set(199, 70, 215, 140); - _globals->_player.disableControl(); _globals->_events.setCursor(CURSOR_WALK); - _wireIndex = 5; if (_vm->getFeatures() & GF_CD) _pageIndex = _globals->_randomSource.getRandomNumber(14) + 2; else @@ -5156,6 +5173,7 @@ void Scene2320::Action3::signal() { } void Scene2320::Action4::signal() { + // Fly Cycle actions Scene2320 *scene = (Scene2320 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -5222,11 +5240,13 @@ void Scene2320::Action4::signal() { setDelay(13); break; case 9: - if (!_globals->getFlag(109)) { - SceneItem::display2(2320, 19); - } else { - _globals->_sceneManager.changeScene(7600); - } + // Quinn sits in the flycycle + scene->_hotspot16.hide(); + _globals->_player.setVisage(2323); + _globals->_player.setPosition(Common::Point(303, 176)); + _globals->_player.setStrip(2); + _globals->_player.setFrame(1); + _globals->_player.animate(ANIM_MODE_5, this); break; case 10: if (_globals->getFlag(109)) { @@ -5283,6 +5303,7 @@ void Scene2320::Action4::signal() { break; } case 18: { + scene->_hotspot16.fixPriority(149); Common::Point pt(320, 202); PlayerMover *mover = new PlayerMover(); scene->_hotspot16.addMover(mover, &pt, this); @@ -5582,6 +5603,7 @@ void Scene2320::Hotspot8::doAction(int action) { } void Scene2320::Hotspot10::doAction(int action) { + // Seeker Scene2320 *scene = (Scene2320 *)_globals->_sceneManager._scene; switch (action) { @@ -5675,6 +5697,7 @@ void Scene2320::Hotspot12::doAction(int action) { } void Scene2320::Hotspot14::doAction(int action) { + // Right Console Scene2320 *scene = (Scene2320 *)_globals->_sceneManager._scene; switch (action) { @@ -5727,6 +5750,7 @@ void Scene2320::Hotspot14::doAction(int action) { } void Scene2320::Hotspot15::doAction(int action) { + // Left console (Flycycle console) Scene2320 *scene = (Scene2320 *)_globals->_sceneManager._scene; switch (action) { @@ -5755,6 +5779,14 @@ Scene2320::Scene2320() : _hotspot4(0, CURSOR_LOOK, 2320, 14, LIST_END), _hotspot13(0, CURSOR_LOOK, 2320, 12, LIST_END) { + _area1.setup(2153, 2, 1, 2100); + _area1._pt = Common::Point(200, 31); + _area2.setup(2153, 3, 1, 2150); + _area2._pt = Common::Point(200, 50); + _area3.setup(2153, 4, 1, 2320); + _area3._pt = Common::Point(200, 75); + _area4.setup(2153, 1, 1, 10); + _area4._pt = Common::Point(237, 77); } void Scene2320::postInit(SceneObjectList *OwnerList) { @@ -5807,15 +5839,6 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { _globals->_sceneItems.push_back(&_hotspot8); } - _area1.setup(2153, 2, 1, 2100); - _area1._pt = Common::Point(200, 31); - _area2.setup(2153, 3, 1, 2150); - _area2._pt = Common::Point(200, 50); - _area3.setup(2153, 4, 1, 2320); - _area3._pt = Common::Point(200, 75); - _area4.setup(2153, 1, 1, 10); - _area4._pt = Common::Point(237, 77); - if (_globals->getFlag(43)) { _hotspot11.postInit(); _hotspot11.setVisage(2705); @@ -5891,7 +5914,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { _globals->_player.disableControl(); _globals->_player.animate(ANIM_MODE_NONE, NULL); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); + _globals->_player.setObjectWrapper(NULL); _globals->_player.setVisage(2347); _globals->_player.setStrip(2); _globals->_player.setFrame(5); diff --git a/engines/tsage/ringworld_scenes3.h b/engines/tsage/ringworld_scenes3.h index a25bf8834b2..cc237a1f91e 100644 --- a/engines/tsage/ringworld_scenes3.h +++ b/engines/tsage/ringworld_scenes3.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_RINGWORLD_SCENES3_H @@ -281,13 +278,14 @@ public: Action15 _action15; Action16 _action16; Action17 _action17; - int _field1800; + int _sitFl; SceneArea _area1, _area2, _area3, _area4; Scene2100(); virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void stripCallback(int v); virtual void signal(); + virtual void synchronize(Serializer &s); }; class Scene2120 : public Scene { @@ -323,6 +321,7 @@ public: int _subjectIndex; int _lineOffset; + Scene2120(); virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void synchronize(Serializer &s); }; diff --git a/engines/tsage/ringworld_scenes4.cpp b/engines/tsage/ringworld_scenes4.cpp index c42b7819f25..883da9b5b13 100644 --- a/engines/tsage/ringworld_scenes4.cpp +++ b/engines/tsage/ringworld_scenes4.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/engines/tsage/ringworld_scenes4.h b/engines/tsage/ringworld_scenes4.h index 53ea7be4912..389c67b83a4 100644 --- a/engines/tsage/ringworld_scenes4.h +++ b/engines/tsage/ringworld_scenes4.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_RINGWORLD_SCENES4_H diff --git a/engines/tsage/ringworld_scenes5.cpp b/engines/tsage/ringworld_scenes5.cpp index dd9c33f0e50..8cdb0a46fb5 100644 --- a/engines/tsage/ringworld_scenes5.cpp +++ b/engines/tsage/ringworld_scenes5.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -325,6 +322,7 @@ void Scene4000::Action7::signal() { } void Scene4000::Action8::signal() { + // Climb down right Chimney using a rope Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -338,7 +336,7 @@ void Scene4000::Action8::signal() { case 1: _globals->_player.setVisage(4008); _globals->_player.setStrip(5); - _globals->_player.setPriority(16); + _globals->_player.fixPriority(16); _globals->_player.setFrame(1); _globals->_player.setPosition(Common::Point(283, 52)); _globals->_player.animate(ANIM_MODE_5, this); @@ -988,7 +986,6 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _globals->_player.enableControl(); if (RING_INVENTORY._ladder._sceneNumber != 4000) { - _hotspot8.postInit(); _hotspot8.setVisage(4017); _hotspot8.animate(ANIM_MODE_1, NULL); _hotspot8.setPosition(Common::Point(199, 188)); @@ -1008,8 +1005,9 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _olo.setObjectWrapper(new SceneObjectWrapper()); _olo.setPosition(Common::Point(219, 150)); + _sceneMode = 4010; _globals->_player.disableControl(); - setAction(&_sequenceManager1, this, 4010, &_globals->_player, NULL); + setAction(&_sequenceManager1, this, 4010, &_globals->_player, &_olo, NULL); } if (_globals->_stripNum == 4000) { @@ -1136,6 +1134,10 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { void Scene4000::signal() { switch (_sceneMode) { + case 4010: + _globals->setFlag(38); + _olo.remove(); + // Deliberate fall-through case 4001: _globals->_player.enableControl(); break; @@ -1168,10 +1170,6 @@ void Scene4000::signal() { case 4009: _globals->_sceneManager.changeScene(2200); break; - case 4010: - _globals->setFlag(38); - _olo.remove(); - break; case 4012: _globals->_player.checkAngle(&_theTech); _globals->_sceneManager.changeScene(4025); @@ -1461,7 +1459,7 @@ void Scene4025::Hole::doAction(int action) { void Scene4025::Peg::synchronize(Serializer &s) { SceneObject::synchronize(s); s.syncAsSint16LE(_field88); - SYNC_POINTER(_armStrip); + s.syncAsSint16LE(_armStrip); } void Scene4025::Peg::doAction(int action) { @@ -1830,10 +1828,10 @@ Scene4045::Scene4045() : _hotspot7(9, CURSOR_LOOK, 4045, 0, CURSOR_USE, 4045, 15, LIST_END), _hotspot8(10, CURSOR_LOOK, 4045, 2, LIST_END), _hotspot9(11, CURSOR_LOOK, 4045, 3, CURSOR_USE, 4045, 15, LIST_END), - _hotspot10(12, CURSOR_LOOK, 4045, 4, CURSOR_USE, 4045, 19, LIST_END), + _hotspot10(12, CURSOR_LOOK, 4045, 4, CURSOR_USE, 4100, 19, LIST_END), _hotspot11(13, CURSOR_LOOK, 4045, 6, CURSOR_USE, 4045, 15, LIST_END), - _hotspot12(14, CURSOR_LOOK, 4045, 7, CURSOR_USE, 4045, 29, LIST_END), - _hotspot13(15, CURSOR_LOOK, 4045, 8, CURSOR_USE, 4045, 19, LIST_END), + _hotspot12(14, CURSOR_LOOK, 4045, 7, CURSOR_USE, 4150, 29, LIST_END), + _hotspot13(15, CURSOR_LOOK, 4045, 8, CURSOR_USE, 4100, 19, LIST_END), _hotspot14(0, CURSOR_LOOK, 4045, 10, LIST_END) { _hotspot14.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); @@ -2001,7 +1999,7 @@ void Scene4045::dispatch() { } /*-------------------------------------------------------------------------- - * Scene 4000 - Village - Temple + * Scene 4050 - Village - Outside * *--------------------------------------------------------------------------*/ @@ -2715,6 +2713,10 @@ void Scene4100::postInit(SceneObjectList *OwnerList) { setAction(&_action4); _globals->clearFlag(43); + } else { + // Workaround: In the original, the mouse is hidden when Quinn + // goes back to scene 4150 then to scene 4100. This enables everything. + _globals->_player.enableControl(); } _globals->_player.setPosition(Common::Point(252, 139)); @@ -2981,7 +2983,7 @@ Scene4150::Scene4150() : _hotspot11(0, CURSOR_LOOK, 4150, 6, CURSOR_USE, 4150, 29, LIST_END), _hotspot12(0, CURSOR_LOOK, 4150, 7, CURSOR_USE, 4150, 29, LIST_END), _hotspot17(0, CURSOR_LOOK, 4150, 10, CURSOR_USE, 4150, 27, OBJECT_STUNNER, 4150, 32, LIST_END), - _hotspot18(0, CURSOR_LOOK, 4150, 11, CURSOR_USE, 4150, 32, OBJECT_STUNNER, 4150, 27, LIST_END), + _hotspot18(0, CURSOR_LOOK, 4150, 11, CURSOR_USE, 4150, 27, OBJECT_STUNNER, 4150, 32, LIST_END), _hotspot19(0, CURSOR_LOOK, 4150, 12, CURSOR_USE, 4150, 29, LIST_END), _hotspot20(0, CURSOR_LOOK, 4150, 13, CURSOR_USE, 4150, 29, LIST_END), _hotspot21(0, CURSOR_LOOK, 4150, 13, CURSOR_USE, 4150, 29, LIST_END), @@ -3091,6 +3093,7 @@ void Scene4150::dispatch() { if (!_action && (_globals->_player._position.x >= 316)) { _globals->_soundHandler.proc1(NULL); + _soundHandler.proc1(NULL); _globals->_player.disableControl(); _sceneMode = 4152; setAction(&_sequenceManager, this, 4152, &_globals->_player, NULL); diff --git a/engines/tsage/ringworld_scenes5.h b/engines/tsage/ringworld_scenes5.h index 6c44395f9c8..a2991c72830 100644 --- a/engines/tsage/ringworld_scenes5.h +++ b/engines/tsage/ringworld_scenes5.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_RINGWORLD_SCENES5_H @@ -300,8 +297,8 @@ public: DisplayHotspot _hotspot7, _hotspot8, _hotspot9, _hotspot10; DisplayHotspot _hotspot11, _hotspot12, _hotspot13, _hotspot14; Action1 _action1; - Action _action2; - Action _action3; + Action2 _action2; + Action3 _action3; Scene4045(); virtual void postInit(SceneObjectList *OwnerList = NULL); diff --git a/engines/tsage/ringworld_scenes6.cpp b/engines/tsage/ringworld_scenes6.cpp index 973104a952e..6c4b62ccd73 100644 --- a/engines/tsage/ringworld_scenes6.cpp +++ b/engines/tsage/ringworld_scenes6.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tsage/ringworld_scenes6.h" @@ -135,6 +132,7 @@ void Scene5000::Action2::signal() { ADD_MOVER(_globals->_player, 213, 98); break; case 4: + _globals->_player.fixPriority(20); ADD_MOVER(_globals->_player, 215, 115); break; case 5: @@ -218,7 +216,7 @@ void Scene5000::Action3::signal() { break; case 4: scene->_hotspot7.fixPriority(19); - ADD_MOVER(scene->_hotspot7, 213, 98); + ADD_MOVER(scene->_hotspot7, 215, 115); break; case 5: scene->_hotspot7.changeZoom(46); @@ -714,6 +712,7 @@ void Scene5100::Action2::signal() { } void Scene5100::Action3::signal() { + // Quinns shots flesheater Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -748,7 +747,7 @@ void Scene5100::Action3::signal() { scene->_hotspot2.setAction(NULL); scene->_hotspot3.setStrip2(1); - ADD_PLAYER_MOVER_THIS(scene->_hotspot3, 1200, 100); + ADD_PLAYER_MOVER_NULL(scene->_hotspot3, 1200, 100); } else { scene->_hotspot3.setVisage(5130); scene->_hotspot3._strip = 1; @@ -809,6 +808,7 @@ void Scene5100::Action4::signal() { } void Scene5100::Action5::signal() { + // Quinns forgot the statis box in the throne room, and goes back Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -945,6 +945,7 @@ void Scene5100::Hotspot9::doAction(int action) { } void Scene5100::Hotspot17::doAction(int action) { + // Rock blocking pit entrance Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene; switch (action) { @@ -1390,8 +1391,7 @@ void Scene5100::dispatch() { if (_globals->getFlag(61) && !_globals->getFlag(62) && ((_globals->_player._position.x - _hotspot2._position.x) < 160) && - (_globals->_sceneManager._previousScene != 5200) && - (_globals->_sceneManager._previousScene != 5150)) { + (_globals->_sceneManager._previousScene != 5200) && (_sceneMode != 5150)) { setAction(NULL); _sceneMode = 5150; _soundHandler.startSound(208); @@ -1747,6 +1747,7 @@ void Scene5200::dispatch() { *--------------------------------------------------------------------------*/ void Scene5300::Action1::signal() { + // Seeker waking up Scene5300 *scene = (Scene5300 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -1780,7 +1781,8 @@ void Scene5300::Action1::signal() { _globals->_player.enableControl(); remove(); } else { - _globals->getFlag(60); + _globals->setFlag(60); + scene->_hotspot2._numFrames = 10; if (_globals->getFlag(67)) { scene->_sceneMode = 5310; @@ -1858,8 +1860,8 @@ void Scene5300::Hotspot1::doAction(int action) { break; } } - void Scene5300::Hotspot2::doAction(int action) { + // Seeker Scene5300 *scene = (Scene5300 *)_globals->_sceneManager._scene; switch (action) { @@ -1886,11 +1888,17 @@ void Scene5300::Hotspot2::doAction(int action) { _globals->_player.disableControl(); if (RING_INVENTORY._stasisBox._sceneNumber != 1) { + scene->_sceneMode = 5316; scene->setAction(&scene->_sequenceManager, scene, 5316, NULL); } else { _globals->setFlag(60); - scene->_sceneMode = _globals->getFlag(67) ? 5315 : 5347; - scene->setAction(&scene->_sequenceManager, scene, 5315, this); + if (_globals->getFlag(67)) { + scene->_sceneMode = 5315; + scene->setAction(&scene->_sequenceManager, scene, 5315, this, NULL); + } else { + scene->_sceneMode = 5347; + scene->setAction(&scene->_sequenceManager, scene, 5347, NULL); + } } } break; @@ -1927,6 +1935,7 @@ void Scene5300::Hotspot2::doAction(int action) { } void Scene5300::Hotspot5::doAction(int action) { + // Sharp bone Scene5300 *scene = (Scene5300 *)_globals->_sceneManager._scene; switch (action) { @@ -2071,6 +2080,7 @@ void Scene5300::postInit(SceneObjectList *OwnerList) { _globals->_player.disableControl(); if (_globals->getFlag(107) && _globals->getFlag(106)) { + _hotspot2.setVisage(2806); _hotspot2.postInit(); _hotspot2.setObjectWrapper(new SceneObjectWrapper()); _hotspot2.animate(ANIM_MODE_1, NULL); @@ -2178,7 +2188,7 @@ void Scene5300::signal() { setAction(&_sequenceManager, this, 5315, &_hotspot2, NULL); break; case 5315: - _globals->_stripNum = 5315; + _globals->_stripNum = 5302; _globals->_sceneManager.changeScene(5100); break; } diff --git a/engines/tsage/ringworld_scenes6.h b/engines/tsage/ringworld_scenes6.h index 0d81bb3b785..6ac73d4bff2 100644 --- a/engines/tsage/ringworld_scenes6.h +++ b/engines/tsage/ringworld_scenes6.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_RINGWORLD_SCENES6_H diff --git a/engines/tsage/ringworld_scenes8.cpp b/engines/tsage/ringworld_scenes8.cpp index 43bff50b47e..934c7494fa4 100644 --- a/engines/tsage/ringworld_scenes8.cpp +++ b/engines/tsage/ringworld_scenes8.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "graphics/cursorman.h" @@ -37,12 +34,21 @@ void NamedHotspotMult::synchronize(Serializer &s) { s.syncAsSint16LE(_lookLineNum); } +void SceneObject7700::synchronize(Serializer &s) { + SceneObject::synchronize(s); + if (s.getVersion() >= 3) { + s.syncAsSint16LE(_lookLineNum); + s.syncAsSint16LE(_defltLineNum); + } +} + /*-------------------------------------------------------------------------- - * Scene 7000 + * Scene 7000 - Landing near beach * *--------------------------------------------------------------------------*/ void Scene7000::Action1::signal() { + // Quinn walks from the lander to the seaside (action6) then discuss with Skeenar Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -114,12 +120,13 @@ void Scene7000::Action3::dispatch() { Action::dispatch(); if (_actionIndex == 4) - scene->_object4.setPosition(scene->_object3._position); + scene->_object4.setPosition(Common::Point(scene->_object3._position.x, scene->_object3._position.y + 15)); } /*--------------------------------------------------------------------------*/ void Scene7000::Action3::signal() { + // Lander is landing Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -255,6 +262,7 @@ void Scene7000::Action5::signal() { /*--------------------------------------------------------------------------*/ void Scene7000::Action6::signal() { + // Quinn walks from the lander to the seaside switch (_actionIndex++) { case 0: _globals->_player.disableControl(); @@ -356,6 +364,7 @@ void Scene7000::Hotspot1::doAction(int action) { /*--------------------------------------------------------------------------*/ void Scene7000::Object1::doAction(int action) { + // Skeenar Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; switch (action) { @@ -434,10 +443,10 @@ void Scene7000::Object1::doAction(int action) { scene->_sceneMode = 7005; scene->setAction(&scene->_sequenceManager, scene, 7013, NULL); } else if (_globals->getFlag(13)) { - _globals->_sceneManager._sceneNumber = 7002; + scene->_sceneMode = 7002; scene->setAction(&scene->_sequenceManager, scene, 7014, NULL); } else { - _globals->_sceneManager._sceneNumber = 7002; + scene->_sceneMode = 7002; scene->setAction(&scene->_sequenceManager, scene, 7002, NULL); } break; @@ -647,7 +656,7 @@ void Scene7000::signal() { /*-------------------------------------------------------------------------- - * Scene 7100 + * Scene 7100 - Underwater: swimming * *--------------------------------------------------------------------------*/ @@ -1131,7 +1140,7 @@ void Scene7100::postInit(SceneObjectList *OwnerList) { _globals->_soundHandler.startSound(270); } /*-------------------------------------------------------------------------- - * Scene 7200 + * Scene 7200 - Underwater: Entering the cave * *--------------------------------------------------------------------------*/ @@ -1297,7 +1306,7 @@ void Scene7200::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 7300 + * Scene 7300 - Underwater: Lord Poria * *--------------------------------------------------------------------------*/ @@ -1492,7 +1501,7 @@ void Scene7300::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 7600 + * Scene 7600 - Floating Buildings: Outside * *--------------------------------------------------------------------------*/ @@ -1597,7 +1606,7 @@ void Scene7600::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 7700 + * Scene 7700 - Floating Buildings: In the lab * *--------------------------------------------------------------------------*/ @@ -2523,4 +2532,13 @@ Scene7700::Scene7700() { _prof._state = 0; } +void Scene7700::synchronize(Serializer &s) { + Scene::synchronize(s); + if (s.getVersion() >= 3) { + s.syncAsSint16LE(_field977); + s.syncAsSint16LE(_field979); + s.syncAsSint16LE(_field97B); + } +} + } // End of namespace tSage diff --git a/engines/tsage/ringworld_scenes8.h b/engines/tsage/ringworld_scenes8.h index 713520c6a08..8b183e895ff 100644 --- a/engines/tsage/ringworld_scenes8.h +++ b/engines/tsage/ringworld_scenes8.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_RINGWORLD_SCENES8_H @@ -48,11 +45,7 @@ class SceneObject7700 : public SceneObjectExt { public: int _lookLineNum, _defltLineNum; - virtual void synchronize(Serializer &s) { - SceneObject::synchronize(s); - s.syncAsSint16LE(_lookLineNum); - s.syncAsSint16LE(_defltLineNum); - } + virtual void synchronize(Serializer &s); virtual Common::String getClassName() { return "SceneObject7700"; } }; @@ -489,6 +482,7 @@ public: virtual void signal(); virtual void process(Event &event); virtual void dispatch(); + virtual void synchronize(Serializer &s); }; } // End of namespace tSage diff --git a/engines/tsage/saveload.cpp b/engines/tsage/saveload.cpp index a0091bfd6ad..56df32146a1 100644 --- a/engines/tsage/saveload.cpp +++ b/engines/tsage/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/savefile.h" @@ -67,14 +64,12 @@ Saver::~Saver() { void Serializer::syncPointer(SavedObject **ptr, Common::Serializer::Version minVersion, Common::Serializer::Version maxVersion) { - int idx; + int idx = 0; assert(ptr); if (isSaving()) { // Get the object index for the given pointer and write it out - if (!*ptr) { - idx = 0; - } else { + if (*ptr) { idx = _saver->blockIndexOf(*ptr); assert(idx > 0); } @@ -211,6 +206,7 @@ Common::Error Saver::restore(int slot) { // Final post-restore notifications _macroRestoreFlag = false; _loadNotifiers.notify(false); + _globals->_events.setCursor(_globals->_player._uiEnabled ? CURSOR_WALK : CURSOR_NONE); return Common::kNoError; } diff --git a/engines/tsage/saveload.h b/engines/tsage/saveload.h index cf7d087e6eb..51b76965905 100644 --- a/engines/tsage/saveload.h +++ b/engines/tsage/saveload.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_SAVELOAD_H @@ -36,7 +33,7 @@ namespace tSage { typedef void (*SaveNotifierFn)(bool postFlag); -#define TSAGE_SAVEGAME_VERSION 2 +#define TSAGE_SAVEGAME_VERSION 3 class SavedObject; @@ -118,7 +115,7 @@ template class SynchronizedList : public Common::List { public: void synchronize(Serializer &s) { - int entryCount; + int entryCount = 0; if (s.isLoading()) { this->clear(); diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp index f554d546f62..4625661b624 100644 --- a/engines/tsage/scenes.cpp +++ b/engines/tsage/scenes.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tsage/scenes.h" @@ -130,7 +127,7 @@ void SceneManager::sceneChange() { } Scene *SceneManager::getNewScene() { - return SceneFactory::createScene(_nextSceneNumber); + return _globals->_game->createScene(_nextSceneNumber); } void SceneManager::fadeInIfNecessary() { @@ -230,6 +227,11 @@ void SceneManager::setBgOffset(const Common::Point &pt, int loadCount) { void SceneManager::listenerSynchronize(Serializer &s) { s.validate("SceneManager"); + if (s.isLoading() && !_globals->_sceneManager._scene) + // Loading a savegame straight from the launcher, so instantiate a blank placeholder scene + // in order for the savegame loading to work correctly + _globals->_sceneManager._scene = new Scene(); + _altSceneObjects.synchronize(s); s.syncAsSint32LE(_sceneNumber); s.syncAsUint16LE(_globals->_sceneManager._scene->_activeScreenNumber); @@ -322,7 +324,7 @@ void Scene::loadSceneData(int sceneNum) { // Load the priority regions _priorities.load(sceneNum); - // Initialise the section enabled list + // Initialize the section enabled list Common::set_to(&_enabledSections[0], &_enabledSections[16 * 16], 0xffff); _globals->_sceneOffset.x = (_sceneBounds.left / 160) * 160; @@ -461,36 +463,54 @@ void Scene::drawAltObjects() { } void Scene::setZoomPercents(int yStart, int minPercent, int yEnd, int maxPercent) { - int var_6 = 0; + int currDiff = 0; int v = 0; while (v < yStart) _zoomPercents[v++] = minPercent; int diff1 = ABS(maxPercent - minPercent); int diff2 = ABS(yEnd - yStart); - int var_8 = MAX(diff1, diff2); + int remainingDiff = MAX(diff1, diff2); - while (var_8-- != 0) { - _zoomPercents[v] = minPercent; - if (diff2 <= diff1) { - ++minPercent; - var_6 += diff2; - if (var_6 >= diff1) { - var_6 -= diff1; - ++v; - } - } else { - ++v; - var_6 += diff1; - if (var_6 >= diff2) { - var_6 -= diff2; - ++minPercent; - } - } + while (remainingDiff-- != 0) { + _zoomPercents[v] = minPercent; + if (diff2 <= diff1) { + ++minPercent; + currDiff += diff2; + if (currDiff >= diff1) { + currDiff -= diff1; + ++v; + } + } else { + ++v; + currDiff += diff1; + if (currDiff >= diff2) { + currDiff -= diff2; + ++minPercent; + } + } } while (yEnd < 256) _zoomPercents[yEnd++] = minPercent; } +/*--------------------------------------------------------------------------*/ + +void Game::execute() { + // Main game loop + bool activeFlag = false; + do { + // Process all currently atcive game handlers + activeFlag = false; + for (SynchronizedList::iterator i = _handlers.begin(); i != _handlers.end(); ++i) { + GameHandler *gh = *i; + if (gh->_lockCtr.getCtr() == 0) { + gh->execute(); + activeFlag = true; + } + } + } while (activeFlag && !_vm->getEventManager()->shouldQuit()); +} + } // End of namespace tSage diff --git a/engines/tsage/scenes.h b/engines/tsage/scenes.h index 11637de1a7e..b3c009c4fe9 100644 --- a/engines/tsage/scenes.h +++ b/engines/tsage/scenes.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_SCENES_H @@ -111,6 +108,30 @@ public: static void loadNotifier(bool postFlag); }; +class Game { +protected: + SynchronizedList _handlers; + + static bool notLockedFn(GameHandler *g); + virtual void handleSaveLoad(bool saveFlag, int &saveSlot, Common::String &saveName) {} +public: + virtual ~Game() {} + + void addHandler(GameHandler *entry) { _handlers.push_back(entry); } + void removeHandler(GameHandler *entry) { _handlers.remove(entry); } + + void execute(); + virtual void start() = 0; + virtual void restart() {} + virtual void restartGame() {} + virtual void saveGame() {} + virtual void restoreGame() {} + virtual void quitGame() {} + virtual void endGame(int resNum, int lineNum) {} + virtual Scene *createScene(int sceneNumber) = 0; + virtual void processEvent(Event &event) {} +}; + } // End of namespace tSage #endif diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 9d50316baf6..defec1cebdc 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tsage/core.h" diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 45815de69fa..03ae77b7039 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_SOUND_H diff --git a/engines/tsage/staticres.cpp b/engines/tsage/staticres.cpp index bc85718035d..9f36268ce31 100644 --- a/engines/tsage/staticres.cpp +++ b/engines/tsage/staticres.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tsage/staticres.h" @@ -115,6 +112,10 @@ const char *SCENE6100_VERY_WELL = "Very well. I will retrieve the stasis box and Wait for it's return in the lander bay."; const char *DEMO_HELP_MSG = " Help...\rF2 - Sound Options\rF3 - Exit demo\r\rPress ENTER\rto continue"; -const char *DEMO_PAUSED_MSG = " demo is paused"; +const char *DEMO_PAUSED_MSG = "Ringworld\x14 demo is paused"; +const char *DEMO_EXIT_MSG = "Press ENTER to resume the Ringworld\x14 demo. Press ESC to exit"; +const char *EXIT_BTN_STRING = "Exit"; +const char *DEMO_BTN_STRING = "Demo"; +const char *DEMO_RESUME_BTN_STRING = "Resume"; } // End of namespace tSage diff --git a/engines/tsage/staticres.h b/engines/tsage/staticres.h index 0db349f8a77..fa935117796 100644 --- a/engines/tsage/staticres.h +++ b/engines/tsage/staticres.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_STATICRES_H @@ -82,6 +79,12 @@ extern const char *SCENE6100_VERY_WELL; // Demo messages extern const char *DEMO_HELP_MSG; extern const char *DEMO_PAUSED_MSG; +extern const char *DEMO_HELP_MSG; +extern const char *DEMO_PAUSED_MSG; +extern const char *DEMO_EXIT_MSG; +extern const char *EXIT_BTN_STRING; +extern const char *DEMO_BTN_STRING; +extern const char *DEMO_RESUME_BTN_STRING; } // End of namespace tSage diff --git a/engines/tsage/tsage.cpp b/engines/tsage/tsage.cpp index 8813fc7e451..6fae9785c04 100644 --- a/engines/tsage/tsage.cpp +++ b/engines/tsage/tsage.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug-channels.h" @@ -63,7 +60,7 @@ bool TSageEngine::hasFeature(EngineFeature f) const { (f == kSupportsSavingDuringRuntime); } -void TSageEngine::initialise() { +void TSageEngine::initialize() { _saver = new Saver(); // Set up the resource manager @@ -71,16 +68,22 @@ void TSageEngine::initialise() { if (_vm->getFeatures() & GF_DEMO) { // Add the single library file associated with the demo _resourceManager->addLib(getPrimaryFilename()); - } else { + } else if (_vm->getGameID() == GType_Ringworld) { _resourceManager->addLib("RING.RLB"); _resourceManager->addLib("TSAGE.RLB"); + } else if (_vm->getGameID() == GType_BlueForce) { + _resourceManager->addLib("BLUE.RLB"); + if (_vm->getFeatures() & GF_FLOPPY) { + _resourceManager->addLib("FILES.RLB"); + _resourceManager->addLib("TSAGE.RLB"); + } } _globals = new Globals(); _globals->gfxManager().setDefaults(); } -void TSageEngine::deinitialise() { +void TSageEngine::deinitialize() { delete _globals; delete _resourceManager; delete _saver; @@ -88,12 +91,12 @@ void TSageEngine::deinitialise() { Common::Error TSageEngine::run() { // Basic initialisation - initialise(); + initialize(); _globals->_sceneHandler.registerHandler(); _globals->_game->execute(); - deinitialise(); + deinitialize(); return Common::kNoError; } diff --git a/engines/tsage/tsage.h b/engines/tsage/tsage.h index 06c66d8f424..e3d37257cde 100644 --- a/engines/tsage/tsage.h +++ b/engines/tsage/tsage.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_H @@ -89,8 +86,8 @@ public: virtual Common::Error saveGameState(int slot, const char *desc); Common::String generateSaveName(int slot); - void initialise(); - void deinitialise(); + void initialize(); + void deinitialize(); }; extern TSageEngine *_vm; diff --git a/engines/tucker/console.cpp b/engines/tucker/console.cpp index 34be3dd9fd1..e0f2debc30f 100644 --- a/engines/tucker/console.cpp +++ b/engines/tucker/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tucker/console.h" diff --git a/engines/tucker/console.h b/engines/tucker/console.h index fe91c1bb703..6be56d55949 100644 --- a/engines/tucker/console.h +++ b/engines/tucker/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TUCKER_CONSOLE_H diff --git a/engines/tucker/detection.cpp b/engines/tucker/detection.cpp index 7404abc2e7d..9b466d682d7 100644 --- a/engines/tucker/detection.cpp +++ b/engines/tucker/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -146,7 +143,7 @@ public: } virtual const char *getName() const { - return "Tucker Engine"; + return "Tucker"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/tucker/graphics.cpp b/engines/tucker/graphics.cpp index 163719197d6..e6fb70ac16a 100644 --- a/engines/tucker/graphics.cpp +++ b/engines/tucker/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tucker/graphics.h" diff --git a/engines/tucker/graphics.h b/engines/tucker/graphics.h index c5b723e6323..2b4a57d65d3 100644 --- a/engines/tucker/graphics.h +++ b/engines/tucker/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TUCKER_GRAPHICS_H diff --git a/engines/tucker/locations.cpp b/engines/tucker/locations.cpp index ee117d233d3..70b17e41915 100644 --- a/engines/tucker/locations.cpp +++ b/engines/tucker/locations.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tucker/tucker.h" diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp index aeb4399deeb..467500b1212 100644 --- a/engines/tucker/resource.cpp +++ b/engines/tucker/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/tucker/saveload.cpp b/engines/tucker/saveload.cpp index 52c6bf19cea..754e8deae98 100644 --- a/engines/tucker/saveload.cpp +++ b/engines/tucker/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/savefile.h" diff --git a/engines/tucker/sequences.cpp b/engines/tucker/sequences.cpp index d747b346ee2..23ae3380cd3 100644 --- a/engines/tucker/sequences.cpp +++ b/engines/tucker/sequences.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/tucker/staticres.cpp b/engines/tucker/staticres.cpp index aec0c999b40..ef778b6f542 100644 --- a/engines/tucker/staticres.cpp +++ b/engines/tucker/staticres.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tucker/tucker.h" diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp index ed3046867be..2bd7c47b629 100644 --- a/engines/tucker/tucker.cpp +++ b/engines/tucker/tucker.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -44,7 +41,7 @@ namespace Tucker { TuckerEngine::TuckerEngine(OSystem *system, Common::Language language, uint32 flags) - : Engine(system), _gameLang(language), _gameFlags(flags) { + : Engine(system), _gameLang(language), _gameFlags(flags), _rnd("tucker") { _console = new TuckerConsole(this); } diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h index 532892fd481..b011d65cbb8 100644 --- a/engines/tucker/tucker.h +++ b/engines/tucker/tucker.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TUCKER_ENGINE_H diff --git a/engines/util.h b/engines/util.h index 5bfc4f8ad96..53899cb341d 100644 --- a/engines/util.h +++ b/engines/util.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef ENGINES_UTIL_H diff --git a/graphics/VectorRenderer.cpp b/graphics/VectorRenderer.cpp index e3ca0bf5886..4dbcd9845f6 100644 --- a/graphics/VectorRenderer.cpp +++ b/graphics/VectorRenderer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h index 9285fa21c50..ec8a8f7245d 100644 --- a/graphics/VectorRenderer.h +++ b/graphics/VectorRenderer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef VECTOR_RENDERER_H diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp index 3eb8b1345f3..a2cb693b788 100644 --- a/graphics/VectorRendererSpec.cpp +++ b/graphics/VectorRendererSpec.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/graphics/VectorRendererSpec.h b/graphics/VectorRendererSpec.h index 07d37e18475..3ba7d88e4e3 100644 --- a/graphics/VectorRendererSpec.h +++ b/graphics/VectorRendererSpec.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef VECTOR_RENDERER_SPEC_H diff --git a/graphics/colormasks.h b/graphics/colormasks.h index 824d980ca3c..2a2523f4b39 100644 --- a/graphics/colormasks.h +++ b/graphics/colormasks.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GRAPHICS_COLORMASKS_H diff --git a/graphics/conversion.cpp b/graphics/conversion.cpp index c9679432fab..713a06ea742 100644 --- a/graphics/conversion.cpp +++ b/graphics/conversion.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "graphics/conversion.h" diff --git a/graphics/conversion.h b/graphics/conversion.h index 2759f3bb5e0..6babc763e22 100644 --- a/graphics/conversion.h +++ b/graphics/conversion.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GRAPHICS_CONVERSION_H diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp index 8f31421a8ba..297b583d544 100644 --- a/graphics/cursorman.cpp +++ b/graphics/cursorman.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "graphics/cursorman.h" diff --git a/graphics/cursorman.h b/graphics/cursorman.h index 2f3891aee7c..1e7ce836119 100644 --- a/graphics/cursorman.h +++ b/graphics/cursorman.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GRAPHICS_CURSORMAN_H diff --git a/graphics/dither.cpp b/graphics/dither.cpp index 5f423d1c7ac..3876db152b4 100644 --- a/graphics/dither.cpp +++ b/graphics/dither.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "graphics/dither.h" diff --git a/graphics/dither.h b/graphics/dither.h index e5f67b9c713..dbde03df823 100644 --- a/graphics/dither.h +++ b/graphics/dither.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GRAPHICS_DITHER_H diff --git a/graphics/font.cpp b/graphics/font.cpp index 7fa39d07db8..cdf90906252 100644 --- a/graphics/font.cpp +++ b/graphics/font.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/stream.h" @@ -33,23 +30,23 @@ namespace Graphics { -void free_font(NewFontData* pf); +void free_font(NewFontData *pf); NewFont::~NewFont() { - if (font) { - free_font(font); + if (_font) { + free_font(_font); } } int NewFont::getCharWidth(byte chr) const { // If no width table is specified, return the maximum width - if (!desc.width) - return desc.maxwidth; + if (!_desc.width) + return _desc.maxwidth; // If this character is not included in the font, use the default char. - if (chr < desc.firstchar || desc.firstchar + desc.size < chr) { - chr = desc.defaultchar; + if (chr < _desc.firstchar || _desc.firstchar + _desc.size < chr) { + chr = _desc.defaultchar; } - return desc.width[chr - desc.firstchar]; + return _desc.width[chr - _desc.firstchar]; } @@ -77,38 +74,38 @@ void drawCharIntern(byte *ptr, uint pitch, const bitmap_t *src, int h, int minX, void NewFont::drawChar(Surface *dst, byte chr, const int tx, const int ty, const uint32 color) const { assert(dst != 0); - assert(desc.bits != 0 && desc.maxwidth <= 16); + assert(_desc.bits != 0 && _desc.maxwidth <= 16); assert(dst->format.bytesPerPixel == 1 || dst->format.bytesPerPixel == 2); // If this character is not included in the font, use the default char. - if (chr < desc.firstchar || chr >= desc.firstchar + desc.size) { - chr = desc.defaultchar; + if (chr < _desc.firstchar || chr >= _desc.firstchar + _desc.size) { + chr = _desc.defaultchar; } - chr -= desc.firstchar; + chr -= _desc.firstchar; int bbw, bbh, bbx, bby; // Get the bounding box of the character - if (!desc.bbx) { - bbw = desc.fbbw; - bbh = desc.fbbh; - bbx = desc.fbbx; - bby = desc.fbby; + if (!_desc.bbx) { + bbw = _desc.fbbw; + bbh = _desc.fbbh; + bbx = _desc.fbbx; + bby = _desc.fbby; } else { - bbw = desc.bbx[chr].w; - bbh = desc.bbx[chr].h; - bbx = desc.bbx[chr].x; - bby = desc.bbx[chr].y; + bbw = _desc.bbx[chr].w; + bbh = _desc.bbx[chr].h; + bbx = _desc.bbx[chr].x; + bby = _desc.bbx[chr].y; } - byte *ptr = (byte *)dst->getBasePtr(tx + bbx, ty + desc.ascent - bby - bbh); + byte *ptr = (byte *)dst->getBasePtr(tx + bbx, ty + _desc.ascent - bby - bbh); - const bitmap_t *tmp = desc.bits + (desc.offset ? desc.offset[chr] : (chr * desc.fbbh)); + const bitmap_t *tmp = _desc.bits + (_desc.offset ? _desc.offset[chr] : (chr * _desc.fbbh)); - int y = MIN(bbh, ty + desc.ascent - bby); + int y = MIN(bbh, ty + _desc.ascent - bby); tmp += bbh - y; - y -= MAX(0, ty + desc.ascent - bby - dst->h); + y -= MAX(0, ty + _desc.ascent - bby - dst->h); if (dst->format.bytesPerPixel == 1) drawCharIntern(ptr, dst->pitch, tmp, y, MAX(0, -(tx + bbx)), MIN(bbw, dst->w - tx - bbx), color); @@ -618,47 +615,47 @@ bool NewFont::cacheFontData(const NewFont &font, const Common::String &filename) return false; } - cacheFile.writeUint16BE(font.desc.maxwidth); - cacheFile.writeUint16BE(font.desc.height); - cacheFile.writeUint16BE(font.desc.fbbw); - cacheFile.writeUint16BE(font.desc.fbbh); - cacheFile.writeSint16BE(font.desc.fbbx); - cacheFile.writeSint16BE(font.desc.fbby); - cacheFile.writeUint16BE(font.desc.ascent); - cacheFile.writeUint16BE(font.desc.firstchar); - cacheFile.writeUint16BE(font.desc.size); - cacheFile.writeUint16BE(font.desc.defaultchar); - cacheFile.writeUint32BE(font.desc.bits_size); + cacheFile.writeUint16BE(font._desc.maxwidth); + cacheFile.writeUint16BE(font._desc.height); + cacheFile.writeUint16BE(font._desc.fbbw); + cacheFile.writeUint16BE(font._desc.fbbh); + cacheFile.writeSint16BE(font._desc.fbbx); + cacheFile.writeSint16BE(font._desc.fbby); + cacheFile.writeUint16BE(font._desc.ascent); + cacheFile.writeUint16BE(font._desc.firstchar); + cacheFile.writeUint16BE(font._desc.size); + cacheFile.writeUint16BE(font._desc.defaultchar); + cacheFile.writeUint32BE(font._desc.bits_size); - for (long i = 0; i < font.desc.bits_size; ++i) { - cacheFile.writeUint16BE(font.desc.bits[i]); + for (long i = 0; i < font._desc.bits_size; ++i) { + cacheFile.writeUint16BE(font._desc.bits[i]); } - if (font.desc.offset) { + if (font._desc.offset) { cacheFile.writeByte(1); - for (int i = 0; i < font.desc.size; ++i) { - cacheFile.writeUint32BE(font.desc.offset[i]); + for (int i = 0; i < font._desc.size; ++i) { + cacheFile.writeUint32BE(font._desc.offset[i]); } } else { cacheFile.writeByte(0); } - if (font.desc.width) { + if (font._desc.width) { cacheFile.writeByte(1); - for (int i = 0; i < font.desc.size; ++i) { - cacheFile.writeByte(font.desc.width[i]); + for (int i = 0; i < font._desc.size; ++i) { + cacheFile.writeByte(font._desc.width[i]); } } else { cacheFile.writeByte(0); } - if (font.desc.bbx) { + if (font._desc.bbx) { cacheFile.writeByte(1); - for (int i = 0; i < font.desc.size; ++i) { - cacheFile.writeByte(font.desc.bbx[i].w); - cacheFile.writeByte(font.desc.bbx[i].h); - cacheFile.writeByte(font.desc.bbx[i].x); - cacheFile.writeByte(font.desc.bbx[i].y); + for (int i = 0; i < font._desc.size; ++i) { + cacheFile.writeByte(font._desc.bbx[i].w); + cacheFile.writeByte(font._desc.bbx[i].h); + cacheFile.writeByte(font._desc.bbx[i].x); + cacheFile.writeByte(font._desc.bbx[i].y); } } else { cacheFile.writeByte(0); diff --git a/graphics/font.h b/graphics/font.h index 9e6e180ec39..7a992674d2a 100644 --- a/graphics/font.h +++ b/graphics/font.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GRAPHICS_FONT_H @@ -160,15 +157,15 @@ struct NewFontData; class NewFont : public Font { protected: - FontDesc desc; - NewFontData *font; + FontDesc _desc; + NewFontData *_font; public: - NewFont(const FontDesc &d, NewFontData *font_ = 0) : desc(d), font(font_) {} + NewFont(const FontDesc &desc, NewFontData *font = 0) : _desc(desc), _font(font) {} ~NewFont(); - virtual int getFontHeight() const { return desc.height; } - virtual int getMaxCharWidth() const { return desc.maxwidth; } + virtual int getFontHeight() const { return _desc.height; } + virtual int getMaxCharWidth() const { return _desc.maxwidth; } virtual int getCharWidth(byte chr) const; virtual void drawChar(Surface *dst, byte chr, int x, int y, uint32 color) const; diff --git a/graphics/fontman.cpp b/graphics/fontman.cpp index bbd75bfca2b..f937e55b69e 100644 --- a/graphics/fontman.cpp +++ b/graphics/fontman.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "graphics/font.h" diff --git a/graphics/fontman.h b/graphics/fontman.h index 34b457ae83c..d3b84ffa7ca 100644 --- a/graphics/fontman.h +++ b/graphics/fontman.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GRAPHICS_FONTMAN_H diff --git a/graphics/fonts/scummfont.cpp b/graphics/fonts/scummfont.cpp index 3331b72c477..1ff1e51fdc1 100644 --- a/graphics/fonts/scummfont.cpp +++ b/graphics/fonts/scummfont.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "graphics/font.h" diff --git a/graphics/fonts/winfont.cpp b/graphics/fonts/winfont.cpp index 7db9a233f69..0e87769f2f5 100644 --- a/graphics/fonts/winfont.cpp +++ b/graphics/fonts/winfont.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/file.h" diff --git a/graphics/fonts/winfont.h b/graphics/fonts/winfont.h index c31d45e2cee..b6c1be70643 100644 --- a/graphics/fonts/winfont.h +++ b/graphics/fonts/winfont.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GRAPHICS_WINFONT_H diff --git a/graphics/iff.cpp b/graphics/iff.cpp index fee71de4859..4bb971f2993 100644 --- a/graphics/iff.cpp +++ b/graphics/iff.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "graphics/iff.h" diff --git a/graphics/iff.h b/graphics/iff.h index fc837a3ea20..4d881483727 100644 --- a/graphics/iff.h +++ b/graphics/iff.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ /* @@ -114,7 +111,7 @@ void decodePBM(Common::ReadStream &input, Surface &surface, byte *colors); * Decode a given PackBits encoded stream. * * PackBits is an RLE compression algorithm introduced by Apple. It is also - * used to encode ILBM and PBM subtypes of IFF files, and some flavours of + * used to encode ILBM and PBM subtypes of IFF files, and some flavors of * TIFF. * * As there is no compression across row boundaries in the above formats, diff --git a/graphics/imagedec.cpp b/graphics/imagedec.cpp index f45f0ce5ef3..eb595a750e8 100644 --- a/graphics/imagedec.cpp +++ b/graphics/imagedec.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "graphics/imagedec.h" diff --git a/graphics/imagedec.h b/graphics/imagedec.h index 7ea987b1e42..da45ecca4f4 100644 --- a/graphics/imagedec.h +++ b/graphics/imagedec.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GRAPHICS_IMAGEDEC_H diff --git a/graphics/jpeg.cpp b/graphics/jpeg.cpp index 70ffb06f6b6..c97a540d33f 100644 --- a/graphics/jpeg.cpp +++ b/graphics/jpeg.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "graphics/conversion.h" diff --git a/graphics/jpeg.h b/graphics/jpeg.h index 3e26e9add29..bda0c082407 100644 --- a/graphics/jpeg.h +++ b/graphics/jpeg.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GRAPHICS_JPEG_H diff --git a/graphics/maccursor.cpp b/graphics/maccursor.cpp index e086e22fca8..8ad6c959611 100644 --- a/graphics/maccursor.cpp +++ b/graphics/maccursor.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/graphics/maccursor.h b/graphics/maccursor.h index fac78d97a49..cca7f3456bb 100644 --- a/graphics/maccursor.h +++ b/graphics/maccursor.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** diff --git a/graphics/module.mk b/graphics/module.mk index 59621dc525e..a9051c868a0 100644 --- a/graphics/module.mk +++ b/graphics/module.mk @@ -25,7 +25,8 @@ MODULE_OBJS := \ thumbnail.o \ VectorRenderer.o \ VectorRendererSpec.o \ - wincursor.o + wincursor.o \ + yuv_to_rgb.o ifdef USE_SCALERS MODULE_OBJS += \ diff --git a/graphics/palette.h b/graphics/palette.h index 14e433f153d..77891c3fdc0 100644 --- a/graphics/palette.h +++ b/graphics/palette.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GRAPHICS_PALETTE_H @@ -58,7 +55,7 @@ public: * @param start the first palette entry to be updated * @param num the number of palette entries to be updated * - * @note It is an error if start+num exceeds 256, behaviour is undefined + * @note It is an error if start+num exceeds 256, behavior is undefined * in that case (the backend may ignore it silently or assert). * @note It is an error if this function gets called when the pixel format * in use (the return value of getScreenFormat) has more than one diff --git a/graphics/pict.cpp b/graphics/pict.cpp index acade48515d..80bcb7a71e9 100644 --- a/graphics/pict.cpp +++ b/graphics/pict.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" @@ -327,8 +324,8 @@ void PictDecoder::outputPixelBuffer(byte *&out, byte value, byte bitsPerPixel) { } // Compressed QuickTime details can be found here: -// http://developer.apple.com/documentation/QuickTime/Rm/CompressDecompress/ImageComprMgr/B-Chapter/2TheImageCompression.html -// http://developer.apple.com/documentation/QuickTime/Rm/CompressDecompress/ImageComprMgr/F-Chapter/6WorkingwiththeImage.html +// http://developer.apple.com/legacy/mac/library/#documentation/QuickTime/Rm/CompressDecompress/ImageComprMgr/B-Chapter/2TheImageCompression.html +// http://developer.apple.com/legacy/mac/library/#documentation/QuickTime/Rm/CompressDecompress/ImageComprMgr/F-Chapter/6WorkingwiththeImage.html // I'm just ignoring that because Myst ME uses none of that extra stuff. The offset is always the same. void PictDecoder::decodeCompressedQuickTime(Common::SeekableReadStream *stream) { diff --git a/graphics/pict.h b/graphics/pict.h index 22f36aafe75..485c88b7335 100644 --- a/graphics/pict.h +++ b/graphics/pict.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GRAPHICS_PICT_H diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h index fa457386501..e0cf6ce4016 100644 --- a/graphics/pixelformat.h +++ b/graphics/pixelformat.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GRAPHICS_PIXELFORMAT_H diff --git a/graphics/png.cpp b/graphics/png.cpp index 3cdb9f7ccad..e6dceab3fa1 100644 --- a/graphics/png.cpp +++ b/graphics/png.cpp @@ -18,12 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "graphics/png.h" + +#ifdef GRAPHICS_PNG_H + #include "graphics/pixelformat.h" #include "graphics/surface.h" @@ -492,3 +492,5 @@ void PNG::readTransparencyChunk(uint32 chunkLength) { } } // End of Graphics namespace + +#endif // GRAPHICS_PNG_H diff --git a/graphics/png.h b/graphics/png.h index 21e0f35be1b..3f8ea853208 100644 --- a/graphics/png.h +++ b/graphics/png.h @@ -18,16 +18,25 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* * PNG decoder used in engines: * - sword25 + * Dependencies: + * - zlib */ +// Currently, only the sword25 engine uses the PNG decoder, so skip compiling +// it if sword25 is not enabled, or if zlib (a required dependency) is not +// enabled. + +#if !(defined(ENABLE_SWORD25) || defined(USE_ZLIB)) + +// Do not compile the PNG decoder code + +#else + #ifndef GRAPHICS_PNG_H #define GRAPHICS_PNG_H @@ -167,3 +176,5 @@ private: } // End of Graphics namespace #endif // GRAPHICS_PNG_H + +#endif // Engine and zlib guard diff --git a/graphics/primitives.cpp b/graphics/primitives.cpp index b98b2cefa50..9834af65bab 100644 --- a/graphics/primitives.cpp +++ b/graphics/primitives.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/util.h" diff --git a/graphics/primitives.h b/graphics/primitives.h index 0c96c1545a3..6055404b960 100644 --- a/graphics/primitives.h +++ b/graphics/primitives.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GRAPHICS_PRIMITIVES_H diff --git a/graphics/scaler.cpp b/graphics/scaler.cpp index 304d194a1ae..a35fb9046e2 100644 --- a/graphics/scaler.cpp +++ b/graphics/scaler.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "graphics/scaler/intern.h" @@ -199,7 +196,7 @@ void Normal2x(const uint8 *srcPtr, #else /** - * Trivial nearest-neighbour 2x scaler. + * Trivial nearest-neighbor 2x scaler. */ void Normal2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { @@ -224,7 +221,7 @@ void Normal2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPit #endif /** - * Trivial nearest-neighbour 3x scaler. + * Trivial nearest-neighbor 3x scaler. */ void Normal3x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { @@ -257,7 +254,7 @@ void Normal3x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPit #define interpolate_1_1_1_1 interpolate16_1_1_1_1 /** - * Trivial nearest-neighbour 1.5x scaler. + * Trivial nearest-neighbor 1.5x scaler. */ template void Normal1o5xTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, diff --git a/graphics/scaler.h b/graphics/scaler.h index 577a91ccc14..1e5b7966314 100644 --- a/graphics/scaler.h +++ b/graphics/scaler.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GRAPHICS_SCALER_H diff --git a/graphics/scaler/2xsai.cpp b/graphics/scaler/2xsai.cpp index 43a5b2fd1dd..2afdd9385d5 100644 --- a/graphics/scaler/2xsai.cpp +++ b/graphics/scaler/2xsai.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "graphics/scaler/intern.h" diff --git a/graphics/scaler/Normal2xARM.s b/graphics/scaler/Normal2xARM.s index e75d9175672..9afe3f34f04 100644 --- a/graphics/scaler/Normal2xARM.s +++ b/graphics/scaler/Normal2xARM.s @@ -18,9 +18,6 @@ @ along with this program@ if not, write to the Free Software @ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @ -@ $URL$ -@ $Id$ -@ @ @author Robin Watts (robin@wss.co.uk) .text diff --git a/graphics/scaler/aspect.cpp b/graphics/scaler/aspect.cpp index 85b79ab6cd9..64a1cd15345 100644 --- a/graphics/scaler/aspect.cpp +++ b/graphics/scaler/aspect.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "graphics/scaler/intern.h" diff --git a/graphics/scaler/aspect.h b/graphics/scaler/aspect.h index 850b8f0b85e..bb354c79ac3 100644 --- a/graphics/scaler/aspect.h +++ b/graphics/scaler/aspect.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GRAPHICS_SCALER_ASPECT_H diff --git a/graphics/scaler/downscaler.cpp b/graphics/scaler/downscaler.cpp index 3aad4168f17..fa174904750 100644 --- a/graphics/scaler/downscaler.cpp +++ b/graphics/scaler/downscaler.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "graphics/scaler/downscaler.h" #include "graphics/scaler/intern.h" diff --git a/graphics/scaler/downscaler.h b/graphics/scaler/downscaler.h index 158b1879402..97e55dc3d5f 100644 --- a/graphics/scaler/downscaler.h +++ b/graphics/scaler/downscaler.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GRAPHICS_SCALER_DOWNSCALER_H diff --git a/graphics/scaler/downscalerARM.s b/graphics/scaler/downscalerARM.s index 3422e687621..e4662522aa3 100644 --- a/graphics/scaler/downscalerARM.s +++ b/graphics/scaler/downscalerARM.s @@ -18,9 +18,6 @@ @ along with this program; if not, write to the Free Software @ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @ -@ $URL$ -@ $Id$ -@ @ @author Robin Watts (robin@wss.co.uk) .text diff --git a/graphics/scaler/hq2x.cpp b/graphics/scaler/hq2x.cpp index 02c63c8be5c..246e8f62d72 100644 --- a/graphics/scaler/hq2x.cpp +++ b/graphics/scaler/hq2x.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "graphics/scaler/intern.h" diff --git a/graphics/scaler/hq3x.cpp b/graphics/scaler/hq3x.cpp index f588c2ad890..7f7867d5a6d 100644 --- a/graphics/scaler/hq3x.cpp +++ b/graphics/scaler/hq3x.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "graphics/scaler/intern.h" diff --git a/graphics/scaler/intern.h b/graphics/scaler/intern.h index 7317745e629..255cc1a5110 100644 --- a/graphics/scaler/intern.h +++ b/graphics/scaler/intern.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GRAPHICS_SCALER_INTERN_H diff --git a/graphics/scaler/scale2xARM.s b/graphics/scaler/scale2xARM.s index bf4b886bd7b..563a22eeb13 100644 --- a/graphics/scaler/scale2xARM.s +++ b/graphics/scaler/scale2xARM.s @@ -18,9 +18,6 @@ @ along with this program@ if not, write to the Free Software @ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @ -@ $URL$ -@ $Id$ -@ @ @author Robin Watts (robin@wss.co.uk) .text diff --git a/graphics/scaler/thumbnail_intern.cpp b/graphics/scaler/thumbnail_intern.cpp index d78648c3252..154763070a9 100644 --- a/graphics/scaler/thumbnail_intern.cpp +++ b/graphics/scaler/thumbnail_intern.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/graphics/sjis.cpp b/graphics/sjis.cpp index caa53a4f63c..660abf556c4 100644 --- a/graphics/sjis.cpp +++ b/graphics/sjis.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/scummsys.h" diff --git a/graphics/sjis.h b/graphics/sjis.h index 86bc167b520..21ced62b1dc 100644 --- a/graphics/sjis.h +++ b/graphics/sjis.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ // The code in this file is currently only used in KYRA and SCI. diff --git a/graphics/surface.cpp b/graphics/surface.cpp index 88bdcfc8224..cee8e614381 100644 --- a/graphics/surface.cpp +++ b/graphics/surface.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/algorithm.h" @@ -45,8 +42,10 @@ void Surface::drawLine(int x0, int y0, int x1, int y1, uint32 color) { Graphics::drawLine(x0, y0, x1, y1, color, plotPoint, this); else if (format.bytesPerPixel == 2) Graphics::drawLine(x0, y0, x1, y1, color, plotPoint, this); + else if (format.bytesPerPixel == 4) + Graphics::drawLine(x0, y0, x1, y1, color, plotPoint, this); else - error("Surface::drawLine: bytesPerPixel must be 1 or 2"); + error("Surface::drawLine: bytesPerPixel must be 1, 2, or 4"); } void Surface::create(uint16 width, uint16 height, const PixelFormat &f) { @@ -91,12 +90,15 @@ void Surface::hLine(int x, int y, int x2, uint32 color) { if (format.bytesPerPixel == 1) { byte *ptr = (byte *)getBasePtr(x, y); - memset(ptr, (byte)color, x2-x+1); + memset(ptr, (byte)color, x2 - x + 1); } else if (format.bytesPerPixel == 2) { uint16 *ptr = (uint16 *)getBasePtr(x, y); - Common::set_to(ptr, ptr + (x2-x+1), (uint16)color); + Common::set_to(ptr, ptr + (x2 - x + 1), (uint16)color); + } else if (format.bytesPerPixel == 4) { + uint32 *ptr = (uint32 *)getBasePtr(x, y); + Common::set_to(ptr, ptr + (x2 - x + 1), color); } else { - error("Surface::hLine: bytesPerPixel must be 1 or 2"); + error("Surface::hLine: bytesPerPixel must be 1, 2, or 4"); } } @@ -123,10 +125,17 @@ void Surface::vLine(int x, int y, int y2, uint32 color) { uint16 *ptr = (uint16 *)getBasePtr(x, y); while (y++ <= y2) { *ptr = (uint16)color; - ptr += pitch/2; + ptr += pitch / 2; + } + + } else if (format.bytesPerPixel == 4) { + uint32 *ptr = (uint32 *)getBasePtr(x, y); + while (y++ <= y2) { + *ptr = color; + ptr += pitch / 4; } } else { - error("Surface::vLine: bytesPerPixel must be 1 or 2"); + error("Surface::vLine: bytesPerPixel must be 1, 2, or 4"); } } @@ -148,7 +157,7 @@ void Surface::fillRect(Common::Rect r, uint32 color) { } else if (format.bytesPerPixel == 4) { useMemset = false; } else if (format.bytesPerPixel != 1) { - error("Surface::fillRect: bytesPerPixel must be 1, 2 or 4"); + error("Surface::fillRect: bytesPerPixel must be 1, 2, or 4"); } if (useMemset) { @@ -162,7 +171,7 @@ void Surface::fillRect(Common::Rect r, uint32 color) { uint16 *ptr = (uint16 *)getBasePtr(r.left, r.top); while (height--) { Common::set_to(ptr, ptr + width, (uint16)color); - ptr += pitch/2; + ptr += pitch / 2; } } else { uint32 *ptr = (uint32 *)getBasePtr(r.left, r.top); @@ -175,10 +184,10 @@ void Surface::fillRect(Common::Rect r, uint32 color) { } void Surface::frameRect(const Common::Rect &r, uint32 color) { - hLine(r.left, r.top, r.right-1, color); - hLine(r.left, r.bottom-1, r.right-1, color); - vLine(r.left, r.top, r.bottom-1, color); - vLine(r.right-1, r.top, r.bottom-1, color); + hLine(r.left, r.top, r.right - 1, color); + hLine(r.left, r.bottom - 1, r.right - 1, color); + vLine(r.left, r.top, r.bottom - 1, color); + vLine(r.right - 1, r.top, r.bottom - 1, color); } void Surface::move(int dx, int dy, int height) { @@ -186,8 +195,8 @@ void Surface::move(int dx, int dy, int height) { if ((dx == 0 && dy == 0) || height <= 0) return; - if (format.bytesPerPixel != 1 && format.bytesPerPixel != 2) - error("Surface::move: bytesPerPixel must be 1 or 2"); + if (format.bytesPerPixel != 1 && format.bytesPerPixel != 2 && format.bytesPerPixel != 4) + error("Surface::move: bytesPerPixel must be 1, 2, or 4"); byte *src, *dst; int x, y; @@ -226,6 +235,10 @@ void Surface::move(int dx, int dy, int height) { *(uint16 *)dst = *(const uint16 *)src; src -= 2; dst -= 2; + } else if (format.bytesPerPixel == 4) { + *(uint32 *)dst = *(const uint32 *)src; + src -= 4; + dst -= 4; } } src += pitch + (pitch - dx * format.bytesPerPixel); @@ -243,6 +256,10 @@ void Surface::move(int dx, int dy, int height) { *(uint16 *)dst = *(const uint16 *)src; src += 2; dst += 2; + } else if (format.bytesPerPixel == 4) { + *(uint32 *)dst = *(const uint32 *)src; + src += 4; + dst += 4; } } src += pitch - (pitch + dx * format.bytesPerPixel); diff --git a/graphics/surface.h b/graphics/surface.h index 1b54690aa9b..2a0f71955ad 100644 --- a/graphics/surface.h +++ b/graphics/surface.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GRAPHICS_SURFACE_H diff --git a/graphics/thumbnail.cpp b/graphics/thumbnail.cpp index 32ab04ed243..5fad25967e5 100644 --- a/graphics/thumbnail.cpp +++ b/graphics/thumbnail.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "graphics/thumbnail.h" diff --git a/graphics/thumbnail.h b/graphics/thumbnail.h index 0bfeeda2ed6..bf48fd11898 100644 --- a/graphics/thumbnail.h +++ b/graphics/thumbnail.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GRAPHICS_THUMBNAIL_H diff --git a/graphics/wincursor.cpp b/graphics/wincursor.cpp index bae64f9303a..6208f5f0530 100644 --- a/graphics/wincursor.cpp +++ b/graphics/wincursor.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/ptr.h" diff --git a/graphics/wincursor.h b/graphics/wincursor.h index 717a1be588e..86693db88b2 100644 --- a/graphics/wincursor.h +++ b/graphics/wincursor.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GRAPHICS_WINCURSOR_H diff --git a/graphics/yuv_to_rgb.cpp b/graphics/yuv_to_rgb.cpp new file mode 100644 index 00000000000..037ea9a007c --- /dev/null +++ b/graphics/yuv_to_rgb.cpp @@ -0,0 +1,258 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +// The YUV to RGB conversion code is derived from SDL's YUV overlay code, which +// in turn appears to be derived from mpeg_play. The following copyright +// notices have been included in accordance with the original license. Please +// note that the term "software" in this context only applies to the +// buildLookup() and plotYUV*() functions below. + +// Copyright (c) 1995 The Regents of the University of California. +// All rights reserved. +// +// Permission to use, copy, modify, and distribute this software and its +// documentation for any purpose, without fee, and without written agreement is +// hereby granted, provided that the above copyright notice and the following +// two paragraphs appear in all copies of this software. +// +// IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR +// DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT +// OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF +// CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +// ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO +// PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + +// Copyright (c) 1995 Erik Corry +// All rights reserved. +// +// Permission to use, copy, modify, and distribute this software and its +// documentation for any purpose, without fee, and without written agreement is +// hereby granted, provided that the above copyright notice and the following +// two paragraphs appear in all copies of this software. +// +// IN NO EVENT SHALL ERIK CORRY BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, +// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF +// THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF ERIK CORRY HAS BEEN ADVISED +// OF THE POSSIBILITY OF SUCH DAMAGE. +// +// ERIK CORRY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +// PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" +// BASIS, AND ERIK CORRY HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, +// UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + +// Portions of this software Copyright (c) 1995 Brown University. +// All rights reserved. +// +// Permission to use, copy, modify, and distribute this software and its +// documentation for any purpose, without fee, and without written agreement +// is hereby granted, provided that the above copyright notice and the +// following two paragraphs appear in all copies of this software. +// +// IN NO EVENT SHALL BROWN UNIVERSITY BE LIABLE TO ANY PARTY FOR +// DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT +// OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF BROWN +// UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// BROWN UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +// PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" +// BASIS, AND BROWN UNIVERSITY HAS NO OBLIGATION TO PROVIDE MAINTENANCE, +// SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + +#include "common/scummsys.h" +#include "common/singleton.h" + +#include "graphics/surface.h" + +namespace Graphics { + +class YUVToRGBLookup { +public: + YUVToRGBLookup(Graphics::PixelFormat format); + ~YUVToRGBLookup(); + + int16 *_colorTab; + uint32 *_rgbToPix; +}; + +YUVToRGBLookup::YUVToRGBLookup(Graphics::PixelFormat format) { + _colorTab = new int16[4 * 256]; // 2048 bytes + + int16 *Cr_r_tab = &_colorTab[0 * 256]; + int16 *Cr_g_tab = &_colorTab[1 * 256]; + int16 *Cb_g_tab = &_colorTab[2 * 256]; + int16 *Cb_b_tab = &_colorTab[3 * 256]; + + _rgbToPix = new uint32[3 * 768]; // 9216 bytes + + uint32 *r_2_pix_alloc = &_rgbToPix[0 * 768]; + uint32 *g_2_pix_alloc = &_rgbToPix[1 * 768]; + uint32 *b_2_pix_alloc = &_rgbToPix[2 * 768]; + + int16 CR, CB; + int i; + + // Generate the tables for the display surface + + for (i = 0; i < 256; i++) { + // Gamma correction (luminescence table) and chroma correction + // would be done here. See the Berkeley mpeg_play sources. + + CR = CB = (i - 128); + Cr_r_tab[i] = (int16) ( (0.419 / 0.299) * CR) + 0 * 768 + 256; + Cr_g_tab[i] = (int16) (-(0.299 / 0.419) * CR) + 1 * 768 + 256; + Cb_g_tab[i] = (int16) (-(0.114 / 0.331) * CB); + Cb_b_tab[i] = (int16) ( (0.587 / 0.331) * CB) + 2 * 768 + 256; + } + + // Set up entries 0-255 in rgb-to-pixel value tables. + for (i = 0; i < 256; i++) { + r_2_pix_alloc[i + 256] = format.RGBToColor(i, 0, 0); + g_2_pix_alloc[i + 256] = format.RGBToColor(0, i, 0); + b_2_pix_alloc[i + 256] = format.RGBToColor(0, 0, i); + } + + // Spread out the values we have to the rest of the array so that we do + // not need to check for overflow. + for (i = 0; i < 256; i++) { + r_2_pix_alloc[i] = r_2_pix_alloc[256]; + r_2_pix_alloc[i + 512] = r_2_pix_alloc[511]; + g_2_pix_alloc[i] = g_2_pix_alloc[256]; + g_2_pix_alloc[i + 512] = g_2_pix_alloc[511]; + b_2_pix_alloc[i] = b_2_pix_alloc[256]; + b_2_pix_alloc[i + 512] = b_2_pix_alloc[511]; + } +} + +YUVToRGBLookup::~YUVToRGBLookup() { + delete[] _rgbToPix; + delete[] _colorTab; +} + +class YUVToRGBManager : public Common::Singleton { +public: + const YUVToRGBLookup *getLookup(Graphics::PixelFormat format); + +private: + friend class Common::Singleton; + YUVToRGBManager(); + ~YUVToRGBManager(); + + Graphics::PixelFormat _lastFormat; + YUVToRGBLookup *_lookup; +}; + +YUVToRGBManager::YUVToRGBManager() { + _lookup = 0; +} + +YUVToRGBManager::~YUVToRGBManager() { + delete _lookup; +} + +const YUVToRGBLookup *YUVToRGBManager::getLookup(Graphics::PixelFormat format) { + if (_lastFormat == format) + return _lookup; + + delete _lookup; + _lookup = new YUVToRGBLookup(format); + _lastFormat = format; + return _lookup; +} + +} // End of namespace Graphics + +DECLARE_SINGLETON(Graphics::YUVToRGBManager); + +#define YUVToRGBMan (Graphics::YUVToRGBManager::instance()) + +namespace Graphics { + +#define PUT_PIXEL(s, d) \ + L = &rgbToPix[(s)]; \ + *((PixelInt *)(d)) = (L[cr_r] | L[crb_g] | L[cb_b]) + +template +void convertYUV420ToRGB(byte *dstPtr, int dstPitch, const YUVToRGBLookup *lookup, const byte *ySrc, const byte *uSrc, const byte *vSrc, int yWidth, int yHeight, int yPitch, int uvPitch) { + int halfHeight = yHeight >> 1; + int halfWidth = yWidth >> 1; + + // Keep the tables in pointers here to avoid a dereference on each pixel + const int16 *Cr_r_tab = lookup->_colorTab; + const int16 *Cr_g_tab = Cr_r_tab + 256; + const int16 *Cb_g_tab = Cr_g_tab + 256; + const int16 *Cb_b_tab = Cb_g_tab + 256; + const uint32 *rgbToPix = lookup->_rgbToPix; + + for (int h = 0; h < halfHeight; h++) { + for (int w = 0; w < halfWidth; w++) { + register const uint32 *L; + + int16 cr_r = Cr_r_tab[*vSrc]; + int16 crb_g = Cr_g_tab[*vSrc] + Cb_g_tab[*uSrc]; + int16 cb_b = Cb_b_tab[*uSrc]; + ++uSrc; + ++vSrc; + + PUT_PIXEL(*ySrc, dstPtr); + PUT_PIXEL(*(ySrc + yPitch), dstPtr + dstPitch); + ySrc++; + dstPtr += sizeof(PixelInt); + PUT_PIXEL(*ySrc, dstPtr); + PUT_PIXEL(*(ySrc + yPitch), dstPtr + dstPitch); + ySrc++; + dstPtr += sizeof(PixelInt); + } + + dstPtr += dstPitch; + ySrc += (yPitch << 1) - yWidth; + uSrc += uvPitch - halfWidth; + vSrc += uvPitch - halfWidth; + } +} + +void convertYUV420ToRGB(Graphics::Surface *dst, const byte *ySrc, const byte *uSrc, const byte *vSrc, int yWidth, int yHeight, int yPitch, int uvPitch) { + // Sanity checks + assert(dst && dst->pixels); + assert(dst->format.bytesPerPixel == 2 || dst->format.bytesPerPixel == 4); + assert(ySrc && uSrc && vSrc); + assert((yWidth & 1) == 0); + assert((yHeight & 1) == 0); + + const YUVToRGBLookup *lookup = YUVToRGBMan.getLookup(dst->format); + + // Use a templated function to avoid an if check on every pixel + if (dst->format.bytesPerPixel == 2) + convertYUV420ToRGB((byte *)dst->pixels, dst->pitch, lookup, ySrc, uSrc, vSrc, yWidth, yHeight, yPitch, uvPitch); + else + convertYUV420ToRGB((byte *)dst->pixels, dst->pitch, lookup, ySrc, uSrc, vSrc, yWidth, yHeight, yPitch, uvPitch); +} + +} // End of namespace Graphics diff --git a/graphics/yuv_to_rgb.h b/graphics/yuv_to_rgb.h new file mode 100644 index 00000000000..9b561f20029 --- /dev/null +++ b/graphics/yuv_to_rgb.h @@ -0,0 +1,58 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +/** + * @file + * YUV to RGB conversion used in engines: + * - sword25 + */ + +#ifndef GRAPHICS_YUV_TO_RGB_H +#define GRAPHICS_YUV_TO_RGB_H + +#include "common/scummsys.h" +#include "graphics/surface.h" + +namespace Graphics { + +struct Surface; + +/** + * Convert a YUV420 image to an RGB surface + * + * @param dst the destination surface + * @param ySrc the source of the y component + * @param uSrc the source of the u component + * @param vSrc the source of the v component + * @param yWidth the width of the y surface (must be divisible by 2) + * @param yHeight the height of the y surface (must be divisible by 2) + * @param yPitch the pitch of the y surface + * @param uvPitch the pitch of the u and v surfaces + */ +void convertYUV420ToRGB(Graphics::Surface *dst, const byte *ySrc, const byte *uSrc, const byte *vSrc, int yWidth, int yHeight, int yPitch, int uvPitch); + +} // End of namespace Graphics + +#endif diff --git a/gui/Actions.cpp b/gui/Actions.cpp index f44479a5a86..0c80844ff92 100644 --- a/gui/Actions.cpp +++ b/gui/Actions.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gui/Actions.h" diff --git a/gui/Actions.h b/gui/Actions.h index 67faa03cbad..039fb9019cf 100644 --- a/gui/Actions.h +++ b/gui/Actions.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GUI_ACTIONS_H diff --git a/gui/Key.cpp b/gui/Key.cpp index d3680509c06..fa29971e123 100644 --- a/gui/Key.cpp +++ b/gui/Key.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gui/Key.h" diff --git a/gui/Key.h b/gui/Key.h index e64745115f9..f8f8983c97c 100644 --- a/gui/Key.h +++ b/gui/Key.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GUI_KEY_H diff --git a/gui/KeysDialog.cpp b/gui/KeysDialog.cpp index 897dd8c7411..f28b039763c 100644 --- a/gui/KeysDialog.cpp +++ b/gui/KeysDialog.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gui/KeysDialog.h" diff --git a/gui/KeysDialog.h b/gui/KeysDialog.h index 4626e0245ac..2dd6076a021 100644 --- a/gui/KeysDialog.h +++ b/gui/KeysDialog.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KEYSDIALOG_H diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp index 098cb8e0ac8..678b5f0ea40 100644 --- a/gui/ThemeEngine.cpp +++ b/gui/ThemeEngine.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h index 08560c86354..cc446ac6b0c 100644 --- a/gui/ThemeEngine.h +++ b/gui/ThemeEngine.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GUI_THEME_ENGINE_H diff --git a/gui/ThemeEval.cpp b/gui/ThemeEval.cpp index 64e18f93a3c..9d57d2408bb 100644 --- a/gui/ThemeEval.cpp +++ b/gui/ThemeEval.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gui/ThemeEval.h" diff --git a/gui/ThemeEval.h b/gui/ThemeEval.h index 65bed3e271b..f76a613bc48 100644 --- a/gui/ThemeEval.h +++ b/gui/ThemeEval.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GUI_THEME_EVAL_H diff --git a/gui/ThemeLayout.cpp b/gui/ThemeLayout.cpp index fbfc498bcb3..6a6fd9e3433 100644 --- a/gui/ThemeLayout.cpp +++ b/gui/ThemeLayout.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/gui/ThemeLayout.h b/gui/ThemeLayout.h index 76d3f7d3802..ba28fae1aca 100644 --- a/gui/ThemeLayout.h +++ b/gui/ThemeLayout.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef THEME_LAYOUT_H diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp index 230dad8cc57..56ee6df5ccd 100644 --- a/gui/ThemeParser.cpp +++ b/gui/ThemeParser.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gui/ThemeEngine.h" diff --git a/gui/ThemeParser.h b/gui/ThemeParser.h index cab1050b476..39a951e0076 100644 --- a/gui/ThemeParser.h +++ b/gui/ThemeParser.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef THEME_PARSER_H diff --git a/gui/Tooltip.cpp b/gui/Tooltip.cpp index a7cb0610e7f..85e5856cffc 100644 --- a/gui/Tooltip.cpp +++ b/gui/Tooltip.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/util.h" diff --git a/gui/Tooltip.h b/gui/Tooltip.h index f5e2bb08a88..9ab536b3492 100644 --- a/gui/Tooltip.h +++ b/gui/Tooltip.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GUI_TOOLTIP_H diff --git a/gui/about.cpp b/gui/about.cpp index 0389f4c8daf..00dbc5fe0ba 100644 --- a/gui/about.cpp +++ b/gui/about.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "engines/metaengine.h" diff --git a/gui/about.h b/gui/about.h index b49365c5e5a..65062ab79d2 100644 --- a/gui/about.h +++ b/gui/about.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef ABOUT_DIALOG_H diff --git a/gui/browser.cpp b/gui/browser.cpp index 2c7459623fc..2b4f2541565 100644 --- a/gui/browser.cpp +++ b/gui/browser.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "gui/browser.h" diff --git a/gui/browser.h b/gui/browser.h index eb3498e654a..e5cc12ad8e2 100644 --- a/gui/browser.h +++ b/gui/browser.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef BROWSER_DIALOG_H diff --git a/gui/browser_osx.mm b/gui/browser_osx.mm index 37699c364cb..017b31b9a8e 100644 --- a/gui/browser_osx.mm +++ b/gui/browser_osx.mm @@ -18,8 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ */ // Disable symbol overrides so that we can use system headers diff --git a/gui/chooser.cpp b/gui/chooser.cpp index ecc8ebd8941..6ae08161dfc 100644 --- a/gui/chooser.cpp +++ b/gui/chooser.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/translation.h" diff --git a/gui/chooser.h b/gui/chooser.h index 79a20383c5d..d7e795b3441 100644 --- a/gui/chooser.h +++ b/gui/chooser.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef CHOOSER_DIALOG_H diff --git a/gui/console.cpp b/gui/console.cpp index cbab1b212e0..b656d23a091 100644 --- a/gui/console.cpp +++ b/gui/console.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "gui/console.h" diff --git a/gui/console.h b/gui/console.h index 7136043de91..442047ef786 100644 --- a/gui/console.h +++ b/gui/console.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef CONSOLE_DIALOG_H diff --git a/gui/credits.h b/gui/credits.h index 7ad480032e4..1b13b31829d 100644 --- a/gui/credits.h +++ b/gui/credits.h @@ -24,6 +24,7 @@ static const char *credits[] = { "C2""(retired)", "C0""Max Horn", "C0""Travis Howell", +"C2""(retired)", "C0""Pawel Kolodziejski", "C2""Codecs, iMUSE, Smush, etc.", "C0""Gregory Montoir", @@ -36,6 +37,7 @@ static const char *credits[] = { "C0""Jonathan Gray", "C2""(retired)", "C0""Travis Howell", +"C2""(retired)", "C0""Gregory Montoir", "C0""Eugene Sandulenko", "", @@ -54,41 +56,13 @@ static const char *credits[] = { "C0""Torbj\366rn Andersson", "C0""Paul Gilbert", "C0""Travis Howell", +"C2""(retired)", "C0""Oliver Kiehl", "C2""(retired)", "C0""Ludvig Strigeus", "C2""(retired)", "", -"C1""BASS", -"C0""Robert G\366ffringmann", -"C2""(retired)", -"C0""Oliver Kiehl", -"C2""(retired)", -"C0""Joost Peters", -"", -"C1""Broken Sword", -"C0""Fabio Battaglia", -"C2""PSX version support", -"C0""Thierry Crozat", -"C2""Mac version support", -"C0""Robert G\366ffringmann", -"C2""(retired)", -"", -"C1""Broken Sword II", -"C0""Torbj\366rn Andersson", -"C0""Fabio Battaglia", -"C2""PSX version support", -"C0""Jonathan Gray", -"C2""(retired)", -"", -"C1""Broken Sword 2.5", -"C0""Eugene Sandulenko", -"C0""Filippos Karapetis", -"C0""Max Horn", -"C0""Paul Gilbert", -"C0""Torbj\366rn Andersson", -"", -"C1""Cinematique evo 1", +"C1""Cine", "C0""Vincent Hamm", "C2""(retired)", "C0""Pawel Kolodziejski", @@ -96,7 +70,7 @@ static const char *credits[] = { "C0""Kari Salminen", "C0""Eugene Sandulenko", "", -"C1""Cinematique evo 2", +"C1""CruisE", "C0""Paul Gilbert", "C0""Vincent Hamm", "C2""(retired)", @@ -109,12 +83,6 @@ static const char *credits[] = { "C0""Filippos Karapetis", "C0""Pawel Kolodziejski", "", -"C1""FOTAQ", -"C0""David Eriksson", -"C2""(retired)", -"C0""Gregory Montoir", -"C0""Joost Peters", -"", "C1""Gob", "C0""Torbj\366rn Andersson", "C0""Arnaud Boutonn\351", @@ -139,7 +107,7 @@ static const char *credits[] = { "C0""Gregory Montoir", "C0""Johannes Schickel", "", -"C1""Last Express", +"C1""Lastexpress", "C0""Matthew Hoops", "C0""Jordi Vilalta Prat", "C0""Julien Templier", @@ -168,6 +136,12 @@ static const char *credits[] = { "C1""Parallaction", "C0""peres", "", +"C1""Queen", +"C0""David Eriksson", +"C2""(retired)", +"C0""Gregory Montoir", +"C0""Joost Peters", +"", "C1""SAGA", "C0""Torbj\366rn Andersson", "C0""Filippos Karapetis", @@ -185,6 +159,35 @@ static const char *credits[] = { "C0""Jordi Vilalta Prat", "C0""Lars Skovlund", "", +"C1""Sky", +"C0""Robert G\366ffringmann", +"C2""(retired)", +"C0""Oliver Kiehl", +"C2""(retired)", +"C0""Joost Peters", +"", +"C1""Sword1", +"C0""Fabio Battaglia", +"C2""PSX version support", +"C0""Thierry Crozat", +"C2""Mac version support", +"C0""Robert G\366ffringmann", +"C2""(retired)", +"", +"C1""Sword2", +"C0""Torbj\366rn Andersson", +"C0""Fabio Battaglia", +"C2""PSX version support", +"C0""Jonathan Gray", +"C2""(retired)", +"", +"C1""Sword25", +"C0""Eugene Sandulenko", +"C0""Filippos Karapetis", +"C0""Max Horn", +"C0""Paul Gilbert", +"C0""Torbj\366rn Andersson", +"", "C1""TeenAgent", "C0""Robert Megone", "C2""Help with callback rewriting", @@ -246,7 +249,9 @@ static const char *credits[] = { "C1""PocketPC / WinCE", "C0""Nicolas Bacca", "C2""(retired)", +"C0""Ismail Khatib", "C0""Kostas Nakos", +"C2""(retired)", "", "C1""PlayStation 2", "C0""Robert G\366ffringmann", @@ -406,6 +411,7 @@ static const char *credits[] = { "", "C1""Win32", "C0""Travis Howell", +"C2""(retired)", "", "C1""Win64", "C0""Chris Gray", diff --git a/gui/debugger.cpp b/gui/debugger.cpp index 2282bc3a1ca..2f49cb2bbe7 100644 --- a/gui/debugger.cpp +++ b/gui/debugger.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // NB: This is really only necessary if USE_READLINE is defined @@ -32,7 +29,7 @@ #include "engines/engine.h" #include "gui/debugger.h" -#ifndef USE_TEXT_CONSOLE +#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER #include "gui/console.h" #elif defined(USE_READLINE) #include @@ -47,7 +44,7 @@ Debugger::Debugger() { _isActive = false; _errStr = NULL; _firstTime = true; -#ifndef USE_TEXT_CONSOLE +#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER _debuggerDialog = new GUI::ConsoleDialog(1.0f, 0.67f); _debuggerDialog->setInputCallback(debuggerInputCallback, this); _debuggerDialog->setCompletionCallback(debuggerCompletionCallback, this); @@ -69,7 +66,7 @@ Debugger::Debugger() { } Debugger::~Debugger() { -#ifndef USE_TEXT_CONSOLE +#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER delete _debuggerDialog; #endif } @@ -81,7 +78,7 @@ int Debugger::DebugPrintf(const char *format, ...) { va_start(argptr, format); int count; -#ifndef USE_TEXT_CONSOLE +#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER count = _debuggerDialog->vprintFormat(1, format, argptr); #else count = ::vprintf(format, argptr); @@ -128,7 +125,7 @@ void Debugger::onFrame() { } } -#if defined(USE_TEXT_CONSOLE) && defined(USE_READLINE) +#if defined(USE_TEXT_CONSOLE_FOR_DEBUGGER) && defined(USE_READLINE) namespace { Debugger *g_readline_debugger; @@ -143,7 +140,7 @@ void Debugger::enter() { // TODO: Having three I/O methods #ifdef-ed in this file is not the // cleanest approach to this... -#ifndef USE_TEXT_CONSOLE +#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER if (_firstTime) { DebugPrintf("Debugger started, type 'exit' to return to the game.\n"); DebugPrintf("Type 'help' to see a little list of commands and variables.\n"); @@ -366,7 +363,7 @@ bool Debugger::tabComplete(const char *input, Common::String &completion) const return true; } -#if defined(USE_TEXT_CONSOLE) && defined(USE_READLINE) +#if defined(USE_TEXT_CONSOLE_FOR_DEBUGGER) && defined(USE_READLINE) char *Debugger::readlineComplete(const char *input, int state) { static CommandsMap::const_iterator iter; @@ -420,7 +417,7 @@ bool Debugger::Cmd_Exit(int argc, const char **argv) { // Print a list of all registered commands (and variables, if any), // nicely word-wrapped. bool Debugger::Cmd_Help(int argc, const char **argv) { -#ifndef USE_TEXT_CONSOLE +#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER const int charsPerLine = _debuggerDialog->getCharsPerLine(); #elif defined(USE_READLINE) int charsPerLine, rows; @@ -523,7 +520,7 @@ bool Debugger::Cmd_DebugFlagDisable(int argc, const char **argv) { } // Console handler -#ifndef USE_TEXT_CONSOLE +#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER bool Debugger::debuggerInputCallback(GUI::ConsoleDialog *console, const char *input, void *refCon) { Debugger *debugger = (Debugger *)refCon; diff --git a/gui/debugger.h b/gui/debugger.h index 95719b0e0d8..6da569e0f8e 100644 --- a/gui/debugger.h +++ b/gui/debugger.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GUI_DEBUGGER_H @@ -32,7 +29,7 @@ namespace GUI { -#ifndef USE_TEXT_CONSOLE +#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER class ConsoleDialog; #endif @@ -147,7 +144,7 @@ private: */ bool _firstTime; -#ifndef USE_TEXT_CONSOLE +#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER GUI::ConsoleDialog *_debuggerDialog; #endif @@ -197,7 +194,7 @@ protected: bool Cmd_DebugFlagEnable(int argc, const char **argv); bool Cmd_DebugFlagDisable(int argc, const char **argv); -#ifndef USE_TEXT_CONSOLE +#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER private: static bool debuggerInputCallback(GUI::ConsoleDialog *console, const char *input, void *refCon); static bool debuggerCompletionCallback(GUI::ConsoleDialog *console, const char *input, Common::String &completion, void *refCon); diff --git a/gui/dialog.cpp b/gui/dialog.cpp index 15e47141c81..2ec86412578 100644 --- a/gui/dialog.cpp +++ b/gui/dialog.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/rect.h" diff --git a/gui/dialog.h b/gui/dialog.h index c298ef107bd..a324450996a 100644 --- a/gui/dialog.h +++ b/gui/dialog.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GUI_DIALOG_H diff --git a/gui/error.cpp b/gui/error.cpp index f6da795d402..75bdab1a2ad 100644 --- a/gui/error.cpp +++ b/gui/error.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/error.h" diff --git a/gui/error.h b/gui/error.h index f048a0cd09e..f193136d746 100644 --- a/gui/error.h +++ b/gui/error.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GUI_ERROR_H diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp index 19ca66b7b1d..f56a9097d56 100644 --- a/gui/gui-manager.cpp +++ b/gui/gui-manager.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/events.h" @@ -300,7 +297,7 @@ void GuiManager::runLoop() { // dialog-related events since they were probably generated while the old dialog // was still visible, and therefore not intended for the new one. // - // This hopefully fixes strange behaviour/crashes with pop-up widgets. (Most easily + // This hopefully fixes strange behavior/crashes with pop-up widgets. (Most easily // triggered in 3x mode or when running ScummVM under Valgrind.) if (activeDialog != getTopDialog() && event.type != Common::EVENT_SCREEN_CHANGED) continue; diff --git a/gui/gui-manager.h b/gui/gui-manager.h index ac4118bb06f..10f9e6a29f3 100644 --- a/gui/gui-manager.h +++ b/gui/gui-manager.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GUIMANAGER_H diff --git a/gui/launcher.cpp b/gui/launcher.cpp index aed57decd3c..792b5bbfbe1 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "base/version.h" diff --git a/gui/launcher.h b/gui/launcher.h index 274fc45bb48..f27b4df202b 100644 --- a/gui/launcher.h +++ b/gui/launcher.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GUI_LAUNCHER_DIALOG_H diff --git a/gui/massadd.cpp b/gui/massadd.cpp index 80d580d2a0a..7b641d71e5b 100644 --- a/gui/massadd.cpp +++ b/gui/massadd.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "engines/metaengine.h" diff --git a/gui/massadd.h b/gui/massadd.h index 6aad392b0d6..15cef7ba681 100644 --- a/gui/massadd.h +++ b/gui/massadd.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef MASSADD_DIALOG_H diff --git a/gui/message.cpp b/gui/message.cpp index 5cb4cec3d3c..6c2f489a4c7 100644 --- a/gui/message.cpp +++ b/gui/message.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/str.h" diff --git a/gui/message.h b/gui/message.h index 5c3308e4256..9da8417b5f6 100644 --- a/gui/message.h +++ b/gui/message.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef MESSAGE_DIALOG_H diff --git a/gui/object.cpp b/gui/object.cpp index 6564fe2b68c..2ec42df9d72 100644 --- a/gui/object.cpp +++ b/gui/object.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/textconsole.h" diff --git a/gui/object.h b/gui/object.h index 3b181fd8a34..34ff0d47f22 100644 --- a/gui/object.h +++ b/gui/object.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GUI_OBJECT_H diff --git a/gui/options.cpp b/gui/options.cpp index 547ab0f3c62..5cb70bc5e41 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "gui/browser.h" @@ -308,8 +305,14 @@ void OptionsDialog::close() { if (getResult()) { // Graphic options + bool graphicsModeChanged = false; if (_fullscreenCheckbox) { if (_enableGraphicSettings) { + if (ConfMan.getBool("fullscreen", _domain) != _fullscreenCheckbox->getState()) + graphicsModeChanged = true; + if (ConfMan.getBool("aspect_ratio", _domain) != _aspectCheckbox->getState()) + graphicsModeChanged = true; + ConfMan.setBool("fullscreen", _fullscreenCheckbox->getState(), _domain); ConfMan.setBool("aspect_ratio", _aspectCheckbox->getState(), _domain); ConfMan.setBool("disable_dithering", _disableDitheringCheckbox->getState(), _domain); @@ -321,6 +324,8 @@ void OptionsDialog::close() { while (gm->name) { if (gm->id == (int)_gfxPopUp->getSelectedTag()) { + if (ConfMan.get("gfx_mode", _domain) != gm->name) + graphicsModeChanged = true; ConfMan.set("gfx_mode", gm->name, _domain); isSet = true; break; @@ -341,6 +346,61 @@ void OptionsDialog::close() { ConfMan.removeKey("render_mode", _domain); } } + + // Setup graphics again if needed + if (_domain == Common::ConfigManager::kApplicationDomain && graphicsModeChanged) { + g_system->beginGFXTransaction(); + g_system->setGraphicsMode(ConfMan.get("gfx_mode", _domain).c_str()); + + if (ConfMan.hasKey("aspect_ratio")) + g_system->setFeatureState(OSystem::kFeatureAspectRatioCorrection, ConfMan.getBool("aspect_ratio", _domain)); + if (ConfMan.hasKey("fullscreen")) + g_system->setFeatureState(OSystem::kFeatureFullscreenMode, ConfMan.getBool("fullscreen", _domain)); + OSystem::TransactionError gfxError = g_system->endGFXTransaction(); + + // Since this might change the screen resolution we need to give + // the GUI a chance to update it's internal state. Otherwise we might + // get a crash when the GUI tries to grab the overlay. + // + // This fixes bug #3303501 "Switching from HQ2x->HQ3x crashes ScummVM" + // + // It is important that this is called *before* any of the current + // dialog's widgets are destroyed (for example before + // Dialog::close) is called, to prevent crashes caused by invalid + // widgets being referenced or similar errors. + g_gui.checkScreenChange(); + + if (gfxError != OSystem::kTransactionSuccess) { + // Revert ConfMan to what OSystem is using. + Common::String message = "Failed to apply some of the graphic options changes:"; + + if (gfxError & OSystem::kTransactionModeSwitchFailed) { + const OSystem::GraphicsMode *gm = g_system->getSupportedGraphicsModes(); + while (gm->name) { + if (gm->id == g_system->getGraphicsMode()) { + ConfMan.set("gfx_mode", gm->name, _domain); + break; + } + gm++; + } + message += "\nthe video mode could not be changed."; + } + + if (gfxError & OSystem::kTransactionAspectRatioFailed) { + ConfMan.setBool("aspect_ratio", g_system->getFeatureState(OSystem::kFeatureAspectRatioCorrection), _domain); + message += "\nthe fullscreen setting could not be changed"; + } + + if (gfxError & OSystem::kTransactionFullscreenFailed) { + ConfMan.setBool("fullscreen", g_system->getFeatureState(OSystem::kFeatureFullscreenMode), _domain); + message += "\nthe aspect ratio setting could not be changed"; + } + + // And display the error + GUI::MessageDialog dialog(message); + dialog.runModal(); + } + } // Volume options if (_musicVolumeSlider) { diff --git a/gui/options.h b/gui/options.h index c097a3a9e9a..f17669a3cc8 100644 --- a/gui/options.h +++ b/gui/options.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef OPTIONS_DIALOG_H diff --git a/gui/saveload.cpp b/gui/saveload.cpp index 41b6018e3be..7c7394a71d7 100644 --- a/gui/saveload.cpp +++ b/gui/saveload.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/config-manager.h" diff --git a/gui/saveload.h b/gui/saveload.h index 06f1251e11d..adaf311fd21 100644 --- a/gui/saveload.h +++ b/gui/saveload.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GUI_SAVELOAD_DIALOG_H diff --git a/gui/themebrowser.cpp b/gui/themebrowser.cpp index 0056a5d55b4..831cee19966 100644 --- a/gui/themebrowser.cpp +++ b/gui/themebrowser.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "gui/themebrowser.h" diff --git a/gui/themebrowser.h b/gui/themebrowser.h index bd6b11fb46e..9da57622db4 100644 --- a/gui/themebrowser.h +++ b/gui/themebrowser.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GUI_THEMEBROWSER_H diff --git a/gui/themes/scummclassic/classic_gfx.stx b/gui/themes/scummclassic/classic_gfx.stx index 3fd00abbb9b..c0fcc9f0831 100644 --- a/gui/themes/scummclassic/classic_gfx.stx +++ b/gui/themes/scummclassic/classic_gfx.stx @@ -19,9 +19,6 @@ - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - - $URL$ - - $Id$ - - --> diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx index f09c29e3605..4b42b4f36d7 100644 --- a/gui/themes/scummclassic/classic_layout.stx +++ b/gui/themes/scummclassic/classic_layout.stx @@ -19,9 +19,6 @@ - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - - $URL$ - - $Id$ - - --> diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx index a440be76948..4db6cc4bfcc 100644 --- a/gui/themes/scummclassic/classic_layout_lowres.stx +++ b/gui/themes/scummclassic/classic_layout_lowres.stx @@ -19,9 +19,6 @@ - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - - $URL$ - - $Id$ - - --> diff --git a/gui/themes/scummmodern/scummmodern_gfx.stx b/gui/themes/scummmodern/scummmodern_gfx.stx index a325d4982ba..80177054f41 100644 --- a/gui/themes/scummmodern/scummmodern_gfx.stx +++ b/gui/themes/scummmodern/scummmodern_gfx.stx @@ -19,9 +19,6 @@ - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - - $URL$ - - $Id$ - - --> diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx index c0433ceb9ab..e77284e5ac8 100644 --- a/gui/themes/scummmodern/scummmodern_layout.stx +++ b/gui/themes/scummmodern/scummmodern_layout.stx @@ -19,9 +19,6 @@ - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - - $URL$ - - $Id$ - - --> diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx index 06916a80f1a..e95fa2d5844 100644 --- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx +++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx @@ -19,9 +19,6 @@ - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - - $URL$ - - $Id$ - - --> diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat index f025a053375..d696cc0d750 100644 Binary files a/gui/themes/translations.dat and b/gui/themes/translations.dat differ diff --git a/gui/widget.cpp b/gui/widget.cpp index d3c8d3402db..29838961dfe 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/scummsys.h" diff --git a/gui/widget.h b/gui/widget.h index 9acccd96840..70f2da4c989 100644 --- a/gui/widget.h +++ b/gui/widget.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GUI_WIDGET_H diff --git a/gui/widgets/editable.cpp b/gui/widgets/editable.cpp index 2ee3575bc6d..4a0ee54828d 100644 --- a/gui/widgets/editable.cpp +++ b/gui/widgets/editable.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/rect.h" @@ -96,6 +93,28 @@ bool EditableWidget::handleKeyDown(Common::KeyState state) { if (_caretVisible) drawCaret(true); + // Remap numeric keypad if NUM lock is *not* active. + // This code relies on the fact that the various KEYCODE_KP* values are + // consecutive. + if (0 == (state.flags & Common::KBD_NUM) + && Common::KEYCODE_KP0 <= state.keycode + && state.keycode <= Common::KEYCODE_KP_PERIOD) { + const Common::KeyCode remap[11] = { + Common::KEYCODE_INSERT, // KEYCODE_KP0 + Common::KEYCODE_END, // KEYCODE_KP1 + Common::KEYCODE_DOWN, // KEYCODE_KP2 + Common::KEYCODE_PAGEDOWN, // KEYCODE_KP3 + Common::KEYCODE_LEFT, // KEYCODE_KP4 + Common::KEYCODE_INVALID, // KEYCODE_KP5 + Common::KEYCODE_RIGHT, // KEYCODE_KP6 + Common::KEYCODE_HOME, // KEYCODE_KP7 + Common::KEYCODE_UP, // KEYCODE_KP8 + Common::KEYCODE_PAGEUP, // KEYCODE_KP9 + Common::KEYCODE_DELETE, // KEYCODE_KP_PERIOD + }; + state.keycode = remap[state.keycode - Common::KEYCODE_KP0]; + } + switch (state.keycode) { case Common::KEYCODE_RETURN: case Common::KEYCODE_KP_ENTER: @@ -120,27 +139,6 @@ bool EditableWidget::handleKeyDown(Common::KeyState state) { forcecaret = true; break; - // Keypad & special keys - // - if num lock is set, we always go to the default case - // - if num lock is not set, we either fall down to the special key case - // or ignore the key press in case of 0 (INSERT), 2 (DOWN), 3 (PGDWN) - // 5, 8 (UP) and 9 (PGUP) - - case Common::KEYCODE_KP0: - case Common::KEYCODE_KP2: - case Common::KEYCODE_KP3: - case Common::KEYCODE_KP5: - case Common::KEYCODE_KP8: - case Common::KEYCODE_KP9: - if (state.flags & Common::KBD_NUM) - defaultKeyDownHandler(state, dirty, forcecaret, handled); - break; - - case Common::KEYCODE_KP_PERIOD: - if (state.flags & Common::KBD_NUM) { - defaultKeyDownHandler(state, dirty, forcecaret, handled); - break; - } case Common::KEYCODE_DELETE: if (_caretPos < (int)_editString.size()) { _editString.deleteChar(_caretPos); @@ -151,22 +149,15 @@ bool EditableWidget::handleKeyDown(Common::KeyState state) { forcecaret = true; break; - case Common::KEYCODE_KP1: - if (state.flags & Common::KBD_NUM) { - defaultKeyDownHandler(state, dirty, forcecaret, handled); - break; - } + case Common::KEYCODE_DOWN: case Common::KEYCODE_END: + // Move caret to end dirty = setCaretPos(_editString.size()); forcecaret = true; break; - case Common::KEYCODE_KP4: - if (state.flags & Common::KBD_NUM) { - defaultKeyDownHandler(state, dirty, forcecaret, handled); - break; - } case Common::KEYCODE_LEFT: + // Move caret one left (if possible) if (_caretPos > 0) { dirty = setCaretPos(_caretPos - 1); } @@ -174,12 +165,8 @@ bool EditableWidget::handleKeyDown(Common::KeyState state) { dirty = true; break; - case Common::KEYCODE_KP6: - if (state.flags & Common::KBD_NUM) { - defaultKeyDownHandler(state, dirty, forcecaret, handled); - break; - } case Common::KEYCODE_RIGHT: + // Move caret one right (if possible) if (_caretPos < (int)_editString.size()) { dirty = setCaretPos(_caretPos + 1); } @@ -187,16 +174,43 @@ bool EditableWidget::handleKeyDown(Common::KeyState state) { dirty = true; break; - case Common::KEYCODE_KP7: - if (state.flags & Common::KBD_NUM) { - defaultKeyDownHandler(state, dirty, forcecaret, handled); - break; - } + case Common::KEYCODE_UP: case Common::KEYCODE_HOME: + // Move caret to start dirty = setCaretPos(0); forcecaret = true; break; +#ifdef MACOSX + // Let ctrl-a / ctrl-e move the caret to the start / end of the line. + // + // These shortcuts go back a long time for command line programs. As + // for edit fields in GUIs, they are supported natively on Mac OS X, + // which is why I enabled these shortcuts there. + // On other systems (Windows, Gnome), Ctrl-A by default means + // "select all", which is why I didn't enable the shortcuts there + // for now, to avoid potential confusion. + // + // But since we don't support text selection, and since at least Gnome + // can be configured to also support ctrl-a and ctrl-e, we may want + // to extend this code to other targets, maybe even all. I'll leave + // this to other porters to decide, though. + case Common::KEYCODE_a: + case Common::KEYCODE_e: + if (state.flags & Common::KBD_CTRL) { + if (state.keycode == Common::KEYCODE_a) { + // Move caret to start + dirty = setCaretPos(0); + forcecaret = true; + } else if (state.keycode == Common::KEYCODE_e) { + // Move caret to end + dirty = setCaretPos(_editString.size()); + forcecaret = true; + } + break; + } +#endif + default: defaultKeyDownHandler(state, dirty, forcecaret, handled); } diff --git a/gui/widgets/editable.h b/gui/widgets/editable.h index e0b63759191..4b51ac91453 100644 --- a/gui/widgets/editable.h +++ b/gui/widgets/editable.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GUI_WIDGETS_EDITABLE_H diff --git a/gui/widgets/edittext.cpp b/gui/widgets/edittext.cpp index 106262bafe8..d4a4407ee00 100644 --- a/gui/widgets/edittext.cpp +++ b/gui/widgets/edittext.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "gui/widgets/edittext.h" diff --git a/gui/widgets/edittext.h b/gui/widgets/edittext.h index b94e58780c8..a34dc4b5dd0 100644 --- a/gui/widgets/edittext.h +++ b/gui/widgets/edittext.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GUI_WIDGETS_EDITTEXT_H diff --git a/gui/widgets/list.cpp b/gui/widgets/list.cpp index 1f7846c5034..a0877fc68ad 100644 --- a/gui/widgets/list.cpp +++ b/gui/widgets/list.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/system.h" @@ -41,7 +38,7 @@ ListWidget::ListWidget(Dialog *boss, const String &name, const char *tooltip, ui _scrollBar = NULL; _textWidth = NULL; - // This ensures that _entriesPerPage is properly initialised. + // This ensures that _entriesPerPage is properly initialized. reflowLayout(); _scrollBar = new ScrollBarWidget(this, _w - _scrollBarWidth + 1, 0, _scrollBarWidth, _h); @@ -73,7 +70,7 @@ ListWidget::ListWidget(Dialog *boss, int x, int y, int w, int h, const char *too _scrollBar = NULL; _textWidth = NULL; - // This ensures that _entriesPerPage is properly initialised. + // This ensures that _entriesPerPage is properly initialized. reflowLayout(); _scrollBar = new ScrollBarWidget(this, _w - _scrollBarWidth + 1, 0, _scrollBarWidth, _h); @@ -590,6 +587,7 @@ void ListWidget::startEditMode() { if (_editable && !_editMode && _selectedItem >= 0) { _editMode = true; setEditString(_list[_selectedItem]); + _caretPos = _editString.size(); // Force caret to the *end* of the selection. if (_listColors.empty()) { _editColor = ThemeEngine::kFontColorNormal; } else { diff --git a/gui/widgets/list.h b/gui/widgets/list.h index 4bc9adc5ef5..41fae37a71c 100644 --- a/gui/widgets/list.h +++ b/gui/widgets/list.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GUI_WIDGETS_LIST_H diff --git a/gui/widgets/popup.cpp b/gui/widgets/popup.cpp index cab556065f9..1a552e97c03 100644 --- a/gui/widgets/popup.cpp +++ b/gui/widgets/popup.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/system.h" diff --git a/gui/widgets/popup.h b/gui/widgets/popup.h index b3b3e308374..34983adbeb0 100644 --- a/gui/widgets/popup.h +++ b/gui/widgets/popup.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GUI_WIDGETS_POPUP_H diff --git a/gui/widgets/scrollbar.cpp b/gui/widgets/scrollbar.cpp index 38383c0e555..cc8e587668f 100644 --- a/gui/widgets/scrollbar.cpp +++ b/gui/widgets/scrollbar.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/rect.h" diff --git a/gui/widgets/scrollbar.h b/gui/widgets/scrollbar.h index 53a3369fb4d..3b248ce8a41 100644 --- a/gui/widgets/scrollbar.h +++ b/gui/widgets/scrollbar.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GUI_WIDGETS_SCROLLBAR_H diff --git a/gui/widgets/tab.cpp b/gui/widgets/tab.cpp index 721fb88cf8c..66f33907ca9 100644 --- a/gui/widgets/tab.cpp +++ b/gui/widgets/tab.cpp @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #include "common/util.h" diff --git a/gui/widgets/tab.h b/gui/widgets/tab.h index aec68cca0a5..b19036979e2 100644 --- a/gui/widgets/tab.h +++ b/gui/widgets/tab.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef GUI_WIDGETS_TAB_H diff --git a/po/de_DE.po b/po/de_DE.po index f5ded40e597..ac167b785f5 100755 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -2188,15 +2188,15 @@ msgstr "Drehen" #: backends/platform/wince/CELauncherDialog.cpp:60 msgid "Using SDL driver " -msgstr "SDL-Treiber verwenden" +msgstr "Verwende SDL-Treiber " #: backends/platform/wince/CELauncherDialog.cpp:64 msgid "Display " -msgstr "Anzeige" +msgstr "Anzeige " #: backends/platform/wince/CELauncherDialog.cpp:106 msgid "Do you want to perform an automatic scan ?" -msgstr "Mіchten Sie eine automatische Durchsuchung vornehmen?" +msgstr "Mіchten Sie eine automatische Suche durchfќhren?" #: backends/platform/wince/wince-sdl.cpp:486 msgid "Map right click action" diff --git a/po/ru_RU.po b/po/ru_RU.po old mode 100644 new mode 100755 index c6adbe96454..fdc7bd8fa25 --- a/po/ru_RU.po +++ b/po/ru_RU.po @@ -261,12 +261,12 @@ msgstr " #: gui/launcher.cpp:295 msgid "Game Path:" -msgstr "Путь к игре: " +msgstr "Путь к игре:" #: gui/launcher.cpp:297 msgctxt "lowres" msgid "Game Path:" -msgstr "Где игра: " +msgstr "Где игра:" #: gui/launcher.cpp:302 gui/options.cpp:1037 msgid "Extra Path:" @@ -283,7 +283,7 @@ msgstr " #: gui/launcher.cpp:309 gui/options.cpp:1025 msgid "Save Path:" -msgstr "Сохранения игр: " +msgstr "Сохранения игр:" #: gui/launcher.cpp:309 gui/launcher.cpp:311 gui/launcher.cpp:312 #: gui/options.cpp:1025 gui/options.cpp:1027 gui/options.cpp:1028 @@ -470,7 +470,7 @@ msgstr " #: gui/launcher.cpp:881 msgid "Do you really want to remove this game configuration?" -msgstr "Вы действительно хотите удалить установки для этой игры?" +msgstr "Вы действительно хотите удалить настройки для этой игры?" #: gui/launcher.cpp:945 msgid "This game does not support loading games from the launcher." @@ -593,11 +593,12 @@ msgstr " #: gui/options.cpp:676 msgid "EGA undithering" -msgstr "" +msgstr "EGA без растра" #: gui/options.cpp:676 msgid "Enable undithering in EGA games that support it" msgstr "" +"Включает режим без растрирования в EGA играх, которые поддерживают такой режим" #: gui/options.cpp:684 msgid "Preferred Device:" @@ -656,11 +657,11 @@ msgstr " #: gui/options.cpp:745 msgid "Don't use General MIDI music" -msgstr "" +msgstr "Не использовать музыку для General MIDI" #: gui/options.cpp:756 gui/options.cpp:817 msgid "Use first available device" -msgstr "" +msgstr "Использовать первое доступное устройство" #: gui/options.cpp:768 msgid "SoundFont:" @@ -726,9 +727,8 @@ msgstr "" "Выключает маппинг General MIDI для игр с звуковой дорожкой для Roland MT-32" #: gui/options.cpp:807 -#, fuzzy msgid "Don't use Roland MT-32 music" -msgstr "Настоящий Roland MT-32 (запретить GM)" +msgstr "Не использовать музыку для MT-32" #: gui/options.cpp:834 msgid "Text and Speech:" @@ -744,7 +744,7 @@ msgstr " #: gui/options.cpp:840 msgid "Both" -msgstr "Всё" +msgstr "Оба" #: gui/options.cpp:842 msgid "Subtitle speed:" @@ -766,7 +766,7 @@ msgstr " #: gui/options.cpp:850 msgctxt "lowres" msgid "Both" -msgstr "Всё" +msgstr "Оба" #: gui/options.cpp:850 msgid "Show subtitles and play speech" @@ -1005,20 +1005,17 @@ msgstr " #: common/error.cpp:42 msgid "No error" -msgstr "" +msgstr "Нет ошибки" #: common/error.cpp:44 -#, fuzzy msgid "Game data not found" msgstr "Нет файлов игры" #: common/error.cpp:46 -#, fuzzy msgid "Game id not supported" -msgstr "Game Id не поддерживается" +msgstr "Game id не поддерживается" #: common/error.cpp:48 -#, fuzzy msgid "Unsupported color mode" msgstr "Неподдерживаемый режим цвета" @@ -1031,7 +1028,6 @@ msgid "Write permission denied" msgstr "Недостаточно прав для записи" #: common/error.cpp:56 -#, fuzzy msgid "Path does not exist" msgstr "Путь не найден" @@ -1048,9 +1044,8 @@ msgid "Cannot create file" msgstr "Не могу создать файл" #: common/error.cpp:65 -#, fuzzy msgid "Reading data failed" -msgstr "Ошибка чтения" +msgstr "Ошибка чтения данных" #: common/error.cpp:67 msgid "Writing data failed" @@ -1058,25 +1053,23 @@ msgstr " #: common/error.cpp:70 msgid "Could not find suitable engine plugin" -msgstr "" +msgstr "Не могу найти подходящий плагин для движка" #: common/error.cpp:72 -#, fuzzy msgid "Engine plugin does not support save states" -msgstr "Движок не поддерживает уровень отладки '%s'" +msgstr "Движок не поддерживает сохранения" #: common/error.cpp:75 msgid "Command line argument not processed" -msgstr "" +msgstr "Параметры командной строки не обработаны" #: common/error.cpp:79 -#, fuzzy msgid "Unknown error" msgstr "Неизвестная ошибка" #: common/util.cpp:276 msgid "Hercules Green" -msgstr "Hercules Зеленый" +msgstr "Hercules Зелёный" #: common/util.cpp:277 msgid "Hercules Amber" @@ -1085,7 +1078,7 @@ msgstr "Hercules #: common/util.cpp:284 msgctxt "lowres" msgid "Hercules Green" -msgstr "Hercules Зеленый" +msgstr "Hercules Зелёный" #: common/util.cpp:285 msgctxt "lowres" @@ -1128,7 +1121,7 @@ msgstr "~ #: engines/dialogs.cpp:119 engines/cruise/menu.cpp:216 #: engines/sci/engine/kfile.cpp:577 msgid "Save game:" -msgstr "Сохранить игру: " +msgstr "Сохранить игру:" #: engines/dialogs.cpp:119 engines/cruise/menu.cpp:216 #: engines/sci/engine/kfile.cpp:577 @@ -1138,7 +1131,7 @@ msgstr " #: backends/platform/wince/CEActionsSmartphone.cpp:48 #: backends/platform/wince/CEActionsSmartphone.cpp:231 msgid "Save" -msgstr "Записать" +msgstr "Сохранить" #: engines/dialogs.cpp:315 engines/mohawk/dialogs.cpp:92 #: engines/mohawk/dialogs.cpp:130 @@ -1169,35 +1162,31 @@ msgstr "~ #: engines/scumm/help.cpp:76 msgid "Common keyboard commands:" -msgstr "" +msgstr "Общие клавиатурные команды:" #: engines/scumm/help.cpp:77 msgid "Save / Load dialog" -msgstr "" +msgstr "Диалог записи / чтения" #: engines/scumm/help.cpp:79 -#, fuzzy msgid "Skip line of text" msgstr "Пропустить строку" #: engines/scumm/help.cpp:80 msgid "Esc" -msgstr "" +msgstr "Esc" #: engines/scumm/help.cpp:80 -#, fuzzy msgid "Skip cutscene" -msgstr "Пропустить строку" +msgstr "Пропустить заставку" #: engines/scumm/help.cpp:81 -#, fuzzy msgid "Space" -msgstr "Озв" +msgstr "Пробел" #: engines/scumm/help.cpp:81 -#, fuzzy msgid "Pause game" -msgstr "Сохранить игру: " +msgstr "Пауза игры" #: engines/scumm/help.cpp:82 engines/scumm/help.cpp:87 #: engines/scumm/help.cpp:98 engines/scumm/help.cpp:99 @@ -1205,23 +1194,21 @@ msgstr " #: engines/scumm/help.cpp:102 engines/scumm/help.cpp:103 #: engines/scumm/help.cpp:104 engines/scumm/help.cpp:105 msgid "Ctrl" -msgstr "" +msgstr "Ctrl" #: engines/scumm/help.cpp:82 -#, fuzzy msgid "Load game state 1-10" -msgstr "Загрузить игру:" +msgstr "Загрузить игру 1-10" #: engines/scumm/help.cpp:83 engines/scumm/help.cpp:87 #: engines/scumm/help.cpp:89 engines/scumm/help.cpp:103 #: engines/scumm/help.cpp:104 engines/scumm/help.cpp:105 msgid "Alt" -msgstr "" +msgstr "Alt" #: engines/scumm/help.cpp:83 -#, fuzzy msgid "Save game state 1-10" -msgstr "Сохранить игру: " +msgstr "Сохранить игру 1-10" #: engines/scumm/help.cpp:85 engines/scumm/help.cpp:87 #: backends/platform/symbian/src/SymbianActions.cpp:55 @@ -1232,478 +1219,464 @@ msgstr " #: engines/scumm/help.cpp:89 engines/scumm/help.cpp:92 msgid "Enter" -msgstr "" +msgstr "Ввод" #: engines/scumm/help.cpp:89 msgid "Toggle fullscreen" -msgstr "" +msgstr "Переключить на весь экран" #: engines/scumm/help.cpp:90 -#, fuzzy msgid "Music volume up / down" -msgstr "Громк. музыки:" +msgstr "Громкость музыки увеличить/уменьшить" #: engines/scumm/help.cpp:91 msgid "Text speed slower / faster" -msgstr "" +msgstr "Скорость текста быстрее/медленнее" #: engines/scumm/help.cpp:92 msgid "Simulate left mouse button" -msgstr "" +msgstr "Эмуляция нажатия левой клавиши мыши" #: engines/scumm/help.cpp:93 msgid "Tab" -msgstr "" +msgstr "Tab" #: engines/scumm/help.cpp:93 msgid "Simulate right mouse button" -msgstr "" +msgstr "Эмуляция правой клавиши мыши" #: engines/scumm/help.cpp:96 msgid "Special keyboard commands:" -msgstr "" +msgstr "Специальнве клавиатурные команды:" #: engines/scumm/help.cpp:97 -#, fuzzy msgid "Show / Hide console" -msgstr "Показать/Убрать курсор" +msgstr "Показать/Убрать консоль" #: engines/scumm/help.cpp:98 msgid "Start the debugger" -msgstr "" +msgstr "Запуск отладчика" #: engines/scumm/help.cpp:99 msgid "Show memory consumption" -msgstr "" +msgstr "Показать потребление памяти" #: engines/scumm/help.cpp:100 msgid "Run in fast mode (*)" -msgstr "" +msgstr "Запустить быстрый режим (*)" #: engines/scumm/help.cpp:101 msgid "Run in really fast mode (*)" -msgstr "" +msgstr "Запустить очень быстрый режим (*)" #: engines/scumm/help.cpp:102 msgid "Toggle mouse capture" -msgstr "" +msgstr "Переключение перехвата мыши" #: engines/scumm/help.cpp:103 msgid "Switch between graphics filters" -msgstr "" +msgstr "Переключение между графическими фильтрами" #: engines/scumm/help.cpp:104 msgid "Increase / Decrease scale factor" -msgstr "" +msgstr "Увеличить/уменьшить масштаб" #: engines/scumm/help.cpp:105 -#, fuzzy msgid "Toggle aspect-ratio correction" -msgstr "Коррекция соотношения сторон" +msgstr "Переключение коррекции соотношения сторон" #: engines/scumm/help.cpp:110 msgid "* Note that using ctrl-f and" -msgstr "" +msgstr "* Использование ctrl-f и" #: engines/scumm/help.cpp:111 msgid " ctrl-g are not recommended" -msgstr "" +msgstr " ctrl-g не рекомендуется" #: engines/scumm/help.cpp:112 msgid " since they may cause crashes" -msgstr "" +msgstr " так как они могут привести к" #: engines/scumm/help.cpp:113 msgid " or incorrect game behaviour." -msgstr "" +msgstr " неверной работе игры." #: engines/scumm/help.cpp:117 msgid "Spinning drafts on the keyboard:" -msgstr "" +msgstr "Изменяемые черновики на клавиатуре:" #: engines/scumm/help.cpp:119 -#, fuzzy msgid "Main game controls:" -msgstr "Изменить опции игры" +msgstr "Основное управление игрой:" #: engines/scumm/help.cpp:124 engines/scumm/help.cpp:139 #: engines/scumm/help.cpp:164 -#, fuzzy msgid "Push" -msgstr "Пауза" +msgstr "Толкать" #: engines/scumm/help.cpp:125 engines/scumm/help.cpp:140 #: engines/scumm/help.cpp:165 msgid "Pull" -msgstr "" +msgstr "Тянуть" #: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141 #: engines/scumm/help.cpp:166 engines/scumm/help.cpp:199 #: engines/scumm/help.cpp:209 msgid "Give" -msgstr "" +msgstr "Дать" #: engines/scumm/help.cpp:127 engines/scumm/help.cpp:142 #: engines/scumm/help.cpp:167 engines/scumm/help.cpp:192 #: engines/scumm/help.cpp:210 msgid "Open" -msgstr "" +msgstr "Открыть" #: engines/scumm/help.cpp:129 -#, fuzzy msgid "Go to" -msgstr "Вверх" +msgstr "Идти" #: engines/scumm/help.cpp:130 msgid "Get" -msgstr "" +msgstr "Взять" #: engines/scumm/help.cpp:131 engines/scumm/help.cpp:155 #: engines/scumm/help.cpp:173 engines/scumm/help.cpp:200 #: engines/scumm/help.cpp:215 engines/scumm/help.cpp:226 #: engines/scumm/help.cpp:251 msgid "Use" -msgstr "" +msgstr "Использовать" #: engines/scumm/help.cpp:132 engines/scumm/help.cpp:144 msgid "Read" -msgstr "" +msgstr "Читать" #: engines/scumm/help.cpp:133 engines/scumm/help.cpp:150 msgid "New kid" -msgstr "" +msgstr "Новый перс" #: engines/scumm/help.cpp:134 engines/scumm/help.cpp:156 #: engines/scumm/help.cpp:174 msgid "Turn on" -msgstr "" +msgstr "Включить" #: engines/scumm/help.cpp:135 engines/scumm/help.cpp:157 #: engines/scumm/help.cpp:175 -#, fuzzy msgid "Turn off" -msgstr "Звук вкл/выкл" +msgstr "Выключить" #: engines/scumm/help.cpp:145 engines/scumm/help.cpp:170 #: engines/scumm/help.cpp:196 msgid "Walk to" -msgstr "" +msgstr "Идти к" #: engines/scumm/help.cpp:146 engines/scumm/help.cpp:171 #: engines/scumm/help.cpp:197 engines/scumm/help.cpp:212 #: engines/scumm/help.cpp:229 msgid "Pick up" -msgstr "" +msgstr "Поднять" #: engines/scumm/help.cpp:147 engines/scumm/help.cpp:172 msgid "What is" -msgstr "" +msgstr "Что такое" #: engines/scumm/help.cpp:149 msgid "Unlock" -msgstr "" +msgstr "Открыть" #: engines/scumm/help.cpp:152 msgid "Put on" -msgstr "" +msgstr "Положить" #: engines/scumm/help.cpp:153 msgid "Take off" -msgstr "" +msgstr "Поднять" #: engines/scumm/help.cpp:159 msgid "Fix" -msgstr "" +msgstr "Исправить" #: engines/scumm/help.cpp:161 -#, fuzzy msgid "Switch" -msgstr "Озв" +msgstr "Переключить" #: engines/scumm/help.cpp:169 engines/scumm/help.cpp:230 msgid "Look" -msgstr "" +msgstr "Смотреть" #: engines/scumm/help.cpp:176 engines/scumm/help.cpp:225 msgid "Talk" -msgstr "" +msgstr "Говорить" #: engines/scumm/help.cpp:177 -#, fuzzy msgid "Travel" -msgstr "Записать" +msgstr "Путешествовать" #: engines/scumm/help.cpp:178 msgid "To Henry / To Indy" -msgstr "" +msgstr "Генри/Инди" #: engines/scumm/help.cpp:181 msgid "play C minor on distaff" -msgstr "" +msgstr "играть до минор на прялке" #: engines/scumm/help.cpp:182 msgid "play D on distaff" -msgstr "" +msgstr "играть ре на прялке" #: engines/scumm/help.cpp:183 msgid "play E on distaff" -msgstr "" +msgstr "играть ми на прялке" #: engines/scumm/help.cpp:184 msgid "play F on distaff" -msgstr "" +msgstr "играть фа на прялке" #: engines/scumm/help.cpp:185 msgid "play G on distaff" -msgstr "" +msgstr "играть соль на прялке" #: engines/scumm/help.cpp:186 msgid "play A on distaff" -msgstr "" +msgstr "играть ля на прялке" #: engines/scumm/help.cpp:187 msgid "play B on distaff" -msgstr "" +msgstr "играть си на прялке" #: engines/scumm/help.cpp:188 msgid "play C major on distaff" -msgstr "" +msgstr "играть до мажор на прялке" #: engines/scumm/help.cpp:194 engines/scumm/help.cpp:216 msgid "puSh" -msgstr "" +msgstr "толкать" #: engines/scumm/help.cpp:195 engines/scumm/help.cpp:217 msgid "pull (Yank)" -msgstr "" +msgstr "тянуть (цеплять)" #: engines/scumm/help.cpp:198 engines/scumm/help.cpp:214 #: engines/scumm/help.cpp:249 msgid "Talk to" -msgstr "" +msgstr "Говорить с" #: engines/scumm/help.cpp:201 engines/scumm/help.cpp:213 msgid "Look at" -msgstr "" +msgstr "Смотреть на" #: engines/scumm/help.cpp:202 msgid "turn oN" -msgstr "" +msgstr "включить" #: engines/scumm/help.cpp:203 msgid "turn oFf" -msgstr "" +msgstr "выключить" #: engines/scumm/help.cpp:219 -#, fuzzy msgid "KeyUp" -msgstr "Клавиши" +msgstr "Вверх" #: engines/scumm/help.cpp:219 msgid "Highlight prev dialogue" -msgstr "" +msgstr "Подсветить предыдущий диалог" #: engines/scumm/help.cpp:220 -#, fuzzy msgid "KeyDown" msgstr "Вниз" #: engines/scumm/help.cpp:220 msgid "Highlight next dialogue" -msgstr "" +msgstr "Подсветить следующий диалог" #: engines/scumm/help.cpp:224 msgid "Walk" -msgstr "" +msgstr "Идти" #: engines/scumm/help.cpp:227 engines/scumm/help.cpp:236 #: engines/scumm/help.cpp:243 engines/scumm/help.cpp:250 msgid "Inventory" -msgstr "" +msgstr "Инвентарь" #: engines/scumm/help.cpp:228 msgid "Object" -msgstr "" +msgstr "Объект" #: engines/scumm/help.cpp:231 msgid "Black and White / Color" -msgstr "" +msgstr "Черно-белый/Цветной" #: engines/scumm/help.cpp:234 msgid "Eyes" -msgstr "" +msgstr "Глаза" #: engines/scumm/help.cpp:235 -#, fuzzy msgid "Tongue" -msgstr "Зона" +msgstr "Язык" #: engines/scumm/help.cpp:237 msgid "Punch" -msgstr "" +msgstr "Удар" #: engines/scumm/help.cpp:238 msgid "Kick" -msgstr "" +msgstr "Ногой" #: engines/scumm/help.cpp:241 engines/scumm/help.cpp:248 msgid "Examine" -msgstr "" +msgstr "Проверить" #: engines/scumm/help.cpp:242 msgid "Regular cursor" -msgstr "" +msgstr "Обычный курсор" #: engines/scumm/help.cpp:244 msgid "Comm" -msgstr "" +msgstr "Комм" #: engines/scumm/help.cpp:247 msgid "Save / Load / Options" -msgstr "" +msgstr "Загрузить/Сохранить/Настройки" #: engines/scumm/help.cpp:256 -#, fuzzy msgid "Other game controls:" -msgstr "Изменить опции игры" +msgstr "Остальное управление игрой:" #: engines/scumm/help.cpp:258 engines/scumm/help.cpp:268 msgid "Inventory:" -msgstr "" +msgstr "Инвентарь:" #: engines/scumm/help.cpp:259 engines/scumm/help.cpp:275 msgid "Scroll list up" -msgstr "" +msgstr "Прокрутить список вверх" #: engines/scumm/help.cpp:260 engines/scumm/help.cpp:276 msgid "Scroll list down" -msgstr "" +msgstr "Прокрутить список вниз" #: engines/scumm/help.cpp:261 engines/scumm/help.cpp:269 msgid "Upper left item" -msgstr "" +msgstr "Верхний левый предмет" #: engines/scumm/help.cpp:262 engines/scumm/help.cpp:271 msgid "Lower left item" -msgstr "" +msgstr "Нижний левый предмет" #: engines/scumm/help.cpp:263 engines/scumm/help.cpp:272 msgid "Upper right item" -msgstr "" +msgstr "Верхний правый предмет" #: engines/scumm/help.cpp:264 engines/scumm/help.cpp:274 msgid "Lower right item" -msgstr "" +msgstr "Нижний правый предмет" #: engines/scumm/help.cpp:270 msgid "Middle left item" -msgstr "" +msgstr "Средний левый предмет" #: engines/scumm/help.cpp:273 msgid "Middle right item" -msgstr "" +msgstr "Средний правый предмет" #: engines/scumm/help.cpp:280 engines/scumm/help.cpp:285 -#, fuzzy msgid "Switching characters:" -msgstr "Сменить героя" +msgstr "Смена героя:" #: engines/scumm/help.cpp:282 msgid "Second kid" -msgstr "" +msgstr "Второй герой" #: engines/scumm/help.cpp:283 msgid "Third kid" -msgstr "" +msgstr "Третий герой" #: engines/scumm/help.cpp:295 msgid "Fighting controls (numpad):" -msgstr "" +msgstr "Управление боем (цифровые клавиши)" #: engines/scumm/help.cpp:296 engines/scumm/help.cpp:297 #: engines/scumm/help.cpp:298 msgid "Step back" -msgstr "" +msgstr "Шаг назад" #: engines/scumm/help.cpp:299 msgid "Block high" -msgstr "" +msgstr "Защита сверху" #: engines/scumm/help.cpp:300 msgid "Block middle" -msgstr "" +msgstr "Защита посередине" #: engines/scumm/help.cpp:301 msgid "Block low" -msgstr "" +msgstr "Защита снизу" #: engines/scumm/help.cpp:302 msgid "Punch high" -msgstr "" +msgstr "Удар сверху" #: engines/scumm/help.cpp:303 msgid "Punch middle" -msgstr "" +msgstr "Удар посередине" #: engines/scumm/help.cpp:304 msgid "Punch low" -msgstr "" +msgstr "Удар снизу" #: engines/scumm/help.cpp:307 msgid "These are for Indy on left." -msgstr "" +msgstr "Это когда Инди слева." #: engines/scumm/help.cpp:308 msgid "When Indy is on the right," -msgstr "" +msgstr "Когда Инди справа," #: engines/scumm/help.cpp:309 msgid "7, 4, and 1 are switched with" -msgstr "" +msgstr "7, 4 и 1 меняются с" #: engines/scumm/help.cpp:310 msgid "9, 6, and 3, respectively." -msgstr "" +msgstr "9, 6 и 3 соответственно." #: engines/scumm/help.cpp:317 msgid "Biplane controls (numpad):" -msgstr "" +msgstr "Управление самолётом (цифровые клавиши)" #: engines/scumm/help.cpp:318 msgid "Fly to upper left" -msgstr "" +msgstr "Лететь влево-вверх" #: engines/scumm/help.cpp:319 msgid "Fly to left" -msgstr "" +msgstr "Лететь влево" #: engines/scumm/help.cpp:320 msgid "Fly to lower left" -msgstr "" +msgstr "Лететь влево-вниз" #: engines/scumm/help.cpp:321 msgid "Fly upwards" -msgstr "" +msgstr "Лететь вверх" #: engines/scumm/help.cpp:322 msgid "Fly straight" -msgstr "" +msgstr "Лететь прямо" #: engines/scumm/help.cpp:323 msgid "Fly down" -msgstr "" +msgstr "Лететь вниз" #: engines/scumm/help.cpp:324 msgid "Fly to upper right" -msgstr "" +msgstr "Лететь вправо-вверх" #: engines/scumm/help.cpp:325 msgid "Fly to right" -msgstr "" +msgstr "Лететь вправо" #: engines/scumm/help.cpp:326 msgid "Fly to lower right" -msgstr "" +msgstr "Лететь вправо-вниз" #: engines/scumm/scumm.cpp:2255 engines/agos/saveload.cpp:192 #, c-format @@ -1723,7 +1696,7 @@ msgid "" "\n" "%s" msgstr "" -"Не удалось загрузить игру из файлва:\n" +"Не удалось загрузить игру из файла:\n" "\n" "%s" @@ -1744,6 +1717,9 @@ msgid "" "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " "directory inside the Tentacle game directory." msgstr "" +"Сейчас должна запуститься игра Maniax Mansion. Но ScummVM пока это не умеет. " +"Чтобы сыграть, нажмите 'Новая игра' в стартовом меню ScummVM, а затем выберите " +"директорию Maniac внутри директории с игрой Tentacle." #: engines/mohawk/dialogs.cpp:89 engines/mohawk/dialogs.cpp:127 msgid "~Z~ip Mode Activated" @@ -1924,15 +1900,15 @@ msgstr " #: backends/graphics/opengl/opengl-graphics.cpp:133 msgid "OpenGL Normal" -msgstr "" +msgstr "OpenGL без увеличения" #: backends/graphics/opengl/opengl-graphics.cpp:134 msgid "OpenGL Conserve" -msgstr "" +msgstr "OpenGL с сохранением" #: backends/graphics/opengl/opengl-graphics.cpp:135 msgid "OpenGL Original" -msgstr "" +msgstr "OpenGL изначальный" #: backends/platform/symbian/src/SymbianActions.cpp:41 #: backends/platform/wince/CEActionsSmartphone.cpp:42 diff --git a/po/uk_UA.po b/po/uk_UA.po index 03822b83d05..8903d18541a 100644 --- a/po/uk_UA.po +++ b/po/uk_UA.po @@ -154,7 +154,7 @@ msgid "" "Language of the game. This will not turn your Spanish game version into " "English" msgstr "" -"Мова гри. Зміна цього параметру не перетворить гру на англійській в " +"Мова гри. Зміна цього параметру не перетворить гру англійською в " "українську" #: gui/launcher.cpp:191 gui/launcher.cpp:205 gui/options.cpp:80 @@ -302,7 +302,7 @@ msgstr " #: gui/options.cpp:1202 gui/options.cpp:1209 gui/options.cpp:1308 msgctxt "path" msgid "None" -msgstr "Не заданий" +msgstr "Не завданий" #: gui/launcher.cpp:333 gui/launcher.cpp:415 #: backends/platform/wii/options.cpp:56 @@ -391,7 +391,7 @@ msgstr "~ #: gui/launcher.cpp:578 gui/launcher.cpp:585 msgid "Remove game from the list. The game data files stay intact" -msgstr "Видалити гру зі списку. Не видаляє гру з жорсткого диска" +msgstr "Видалити гру зі списку. Не видаляє гру з жорсткого диску" #: gui/launcher.cpp:581 msgctxt "lowres" @@ -410,7 +410,7 @@ msgstr "~ #: gui/launcher.cpp:593 msgid "Search in game list" -msgstr "Пошук в списку ігор" +msgstr "Пошук у списку ігор" #: gui/launcher.cpp:597 gui/launcher.cpp:1111 msgid "Search:" @@ -437,7 +437,7 @@ msgid "" "Do you really want to run the mass game detector? This could potentially add " "a huge number of games." msgstr "" -"Ви дійсно хочете запустити детектор усіх ігор? Це потенційно може додати " +"Чи ви дійсно хочете запустити детектор усіх ігор? Це потенційно може додати " "велику кількість ігор." #: gui/launcher.cpp:732 gui/launcher.cpp:881 @@ -504,7 +504,7 @@ msgstr "... #: gui/massadd.cpp:244 msgid "Scan complete!" -msgstr "Пошук закінчений!" +msgstr "Пошук закінчено!" #: gui/massadd.cpp:247 #, c-format @@ -577,7 +577,7 @@ msgstr " #: gui/options.cpp:662 gui/options.cpp:663 msgid "Special dithering modes supported by some games" -msgstr "Спеціальні режими рендерингу, які підтримують деякі ігри" +msgstr "Спеціальні режими растрування, які підтримують деякі ігри" #: gui/options.cpp:672 msgid "Fullscreen mode" @@ -593,11 +593,11 @@ msgstr " #: gui/options.cpp:676 msgid "EGA undithering" -msgstr "EGA без згладжування" +msgstr "EGA без растрування" #: gui/options.cpp:676 msgid "Enable undithering in EGA games that support it" -msgstr "Вімкнути без згладжування в EGA іграх які підтримують це." +msgstr "Вімкнути без растрування в EGA іграх які підтримують це" #: gui/options.cpp:684 msgid "Preferred Device:" @@ -605,7 +605,7 @@ msgstr " #: gui/options.cpp:684 msgid "Music Device:" -msgstr "Музич. Пристрій:" +msgstr "Музич. пристрій:" #: gui/options.cpp:684 gui/options.cpp:686 msgid "Specifies preferred sound device or sound card emulator" @@ -623,7 +623,7 @@ msgstr " #: gui/options.cpp:686 msgctxt "lowres" msgid "Music Device:" -msgstr "Музичний Пристрій:" +msgstr "Музичний пристрій:" #: gui/options.cpp:712 msgid "AdLib emulator:" @@ -655,7 +655,7 @@ msgstr " #: gui/options.cpp:745 msgid "Don't use General MIDI music" -msgstr "не використовувати General MIDI музику" +msgstr "Не використовувати General MIDI музику" #: gui/options.cpp:756 gui/options.cpp:817 msgid "Use first available device" @@ -721,7 +721,7 @@ msgstr " #: gui/options.cpp:798 msgid "Turns off General MIDI mapping for games with Roland MT-32 soundtrack" msgstr "" -"Вимикає маппінг General MIDI для ігор із звуковою доріжкою для Roland MT-32" +"Вимикає мапінг General MIDI для ігор із звуковою доріжкою для Roland MT-32" #: gui/options.cpp:807 msgid "Don't use Roland MT-32 music" @@ -821,17 +821,17 @@ msgstr " #: gui/options.cpp:1037 gui/options.cpp:1039 gui/options.cpp:1040 msgid "Specifies path to additional data used by all games or ScummVM" msgstr "" -"Вказує шлях до додаткових файлів даних, використовуваних усіма іграми, або " +"Вказує шлях до додаткових файлів даних, використовуваних усіма іграми або " "ScummVM" #: gui/options.cpp:1044 msgid "Plugins Path:" -msgstr "Шлях до плагінів:" +msgstr "Шлях до втулків:" #: gui/options.cpp:1046 msgctxt "lowres" msgid "Plugins Path:" -msgstr "Шлях до плагінів:" +msgstr "Шлях до втулків:" #: gui/options.cpp:1055 msgid "Misc" @@ -893,15 +893,15 @@ msgstr " #: gui/options.cpp:1291 msgid "Select directory for plugins" -msgstr "Виберіть папку з плагинами" +msgstr "Виберіть папку зі втулками" #: gui/options.cpp:1335 msgid "" "The theme you selected does not support your current language. If you want " "to use this theme you need to switch to another language first." msgstr "" -"Вибрану тему не підтримує поточна мова. Якщо ви хочете використовувати цю " -"тему потрібно в першу чергу змінити мову." +"Вибрана тема не підтримує поточну мову. Якщо ви хочете використовувати цю " +"тему, потрібно в першу чергу змінити мову." #: gui/saveload.cpp:61 gui/saveload.cpp:242 msgid "No date saved" @@ -1002,22 +1002,19 @@ msgstr " #: common/error.cpp:42 msgid "No error" -msgstr "" +msgstr "Немає помилки" #: common/error.cpp:44 -#, fuzzy msgid "Game data not found" msgstr "Немає файлів гри" #: common/error.cpp:46 -#, fuzzy msgid "Game id not supported" msgstr "Game Id не підтримується" #: common/error.cpp:48 -#, fuzzy msgid "Unsupported color mode" -msgstr "Режим Кольору не підтримується" +msgstr "Режим кольору не підтримується" #: common/error.cpp:51 msgid "Read permission denied" @@ -1028,9 +1025,8 @@ msgid "Write permission denied" msgstr "Недостатньо прав для запису" #: common/error.cpp:56 -#, fuzzy msgid "Path does not exist" -msgstr "Шлях не знайдений" +msgstr "Шлях не знайдено" #: common/error.cpp:58 msgid "Path not a directory" @@ -1045,7 +1041,6 @@ msgid "Cannot create file" msgstr "Не можу створити файл" #: common/error.cpp:65 -#, fuzzy msgid "Reading data failed" msgstr "Помилка читання" @@ -1055,19 +1050,17 @@ msgstr " #: common/error.cpp:70 msgid "Could not find suitable engine plugin" -msgstr "" +msgstr "Не можу знайти необхідеого втулка для движка." #: common/error.cpp:72 -#, fuzzy msgid "Engine plugin does not support save states" msgstr "Движок не підтримує рівень відладки '%s'" #: common/error.cpp:75 msgid "Command line argument not processed" -msgstr "" +msgstr "Аргументи командного рядку не оброблені" #: common/error.cpp:79 -#, fuzzy msgid "Unknown error" msgstr "Невідома помилка" @@ -1170,7 +1163,7 @@ msgstr " #: engines/scumm/help.cpp:77 msgid "Save / Load dialog" -msgstr "Зберегти / Завантажити діалог" +msgstr "Діалог збереження/завантаження" #: engines/scumm/help.cpp:79 msgid "Skip line of text" @@ -1231,11 +1224,11 @@ msgstr " #: engines/scumm/help.cpp:90 msgid "Music volume up / down" -msgstr "Гучність музики вверх/вниз" +msgstr "Гучність музики вище/нижче" #: engines/scumm/help.cpp:91 msgid "Text speed slower / faster" -msgstr "Швидкість тексту повільніше / швидше" +msgstr "Швидкість тексту повільніше/швидше" #: engines/scumm/help.cpp:92 msgid "Simulate left mouse button" @@ -1255,7 +1248,7 @@ msgstr " #: engines/scumm/help.cpp:97 msgid "Show / Hide console" -msgstr "Показати / Сховати консоль" +msgstr "Показати/cховати консоль" #: engines/scumm/help.cpp:98 msgid "Start the debugger" @@ -1283,7 +1276,7 @@ msgstr " #: engines/scumm/help.cpp:104 msgid "Increase / Decrease scale factor" -msgstr "Збільшення / зменшення масштабу" +msgstr "Збільшення/зменшення масштабу" #: engines/scumm/help.cpp:105 msgid "Toggle aspect-ratio correction" @@ -1291,11 +1284,11 @@ msgstr " #: engines/scumm/help.cpp:110 msgid "* Note that using ctrl-f and" -msgstr "* Зауважимо, що використання Ctrl-F і" +msgstr "* Зауважимо, що використання ctrl-f і" #: engines/scumm/help.cpp:111 msgid " ctrl-g are not recommended" -msgstr " ctrl-G не рекомендується" +msgstr " ctrl-g не рекомендується" #: engines/scumm/help.cpp:112 msgid " since they may cause crashes" @@ -1307,7 +1300,7 @@ msgstr " #: engines/scumm/help.cpp:117 msgid "Spinning drafts on the keyboard:" -msgstr "Спінінг проекти на клавіатурі:" +msgstr "Змінні чорновики на клавіатурі:" #: engines/scumm/help.cpp:119 msgid "Main game controls:" @@ -1381,7 +1374,7 @@ msgstr " #: engines/scumm/help.cpp:147 engines/scumm/help.cpp:172 msgid "What is" -msgstr "Що це" +msgstr "Що є" #: engines/scumm/help.cpp:149 msgid "Unlock" @@ -1397,7 +1390,7 @@ msgstr " #: engines/scumm/help.cpp:159 msgid "Fix" -msgstr "Зафіксувати" +msgstr "Налагодити" #: engines/scumm/help.cpp:161 msgid "Switch" @@ -1417,39 +1410,39 @@ msgstr " #: engines/scumm/help.cpp:178 msgid "To Henry / To Indy" -msgstr "До Генрі / ДО Інді" +msgstr "У Генрі / У Інді" #: engines/scumm/help.cpp:181 msgid "play C minor on distaff" -msgstr "грати C незначний на прядці" +msgstr "грати до мінор на прядці" #: engines/scumm/help.cpp:182 msgid "play D on distaff" -msgstr "грати D на прядці" +msgstr "грати ре на прядці" #: engines/scumm/help.cpp:183 msgid "play E on distaff" -msgstr "грати E на прядці" +msgstr "грати мі на прядці" #: engines/scumm/help.cpp:184 msgid "play F on distaff" -msgstr "грати F на прядці" +msgstr "грати фа на прядці" #: engines/scumm/help.cpp:185 msgid "play G on distaff" -msgstr "грати G на прядці" +msgstr "грати соль на прядці" #: engines/scumm/help.cpp:186 msgid "play A on distaff" -msgstr "грати A на прядці" +msgstr "грати ля на прядці" #: engines/scumm/help.cpp:187 msgid "play B on distaff" -msgstr "грати B на прядці" +msgstr "грати сі на прядці" #: engines/scumm/help.cpp:188 msgid "play C major on distaff" -msgstr "грати C значний yf ghzlws" +msgstr "грати до мажор на прядці" #: engines/scumm/help.cpp:194 engines/scumm/help.cpp:216 msgid "puSh" @@ -1507,7 +1500,7 @@ msgstr " #: engines/scumm/help.cpp:231 msgid "Black and White / Color" -msgstr "Чорний і Білий / Колір" +msgstr "Чорнобілий/Кольоровий" #: engines/scumm/help.cpp:234 msgid "Eyes" @@ -1531,7 +1524,7 @@ msgstr " #: engines/scumm/help.cpp:242 msgid "Regular cursor" -msgstr "Регулярний курсор" +msgstr "Звичайний курсор" #: engines/scumm/help.cpp:244 msgid "Comm" @@ -1551,11 +1544,11 @@ msgstr " #: engines/scumm/help.cpp:259 engines/scumm/help.cpp:275 msgid "Scroll list up" -msgstr "Прокручення списку вверх" +msgstr "Прокручення списку догори" #: engines/scumm/help.cpp:260 engines/scumm/help.cpp:276 msgid "Scroll list down" -msgstr "Прокручення списку вниз" +msgstr "Прокручення списку донизу" #: engines/scumm/help.cpp:261 engines/scumm/help.cpp:269 msgid "Upper left item" @@ -1612,7 +1605,7 @@ msgstr " #: engines/scumm/help.cpp:301 msgid "Block low" -msgstr "Блокувати нище" +msgstr "Блокувати нижче" #: engines/scumm/help.cpp:302 msgid "Punch high" @@ -1624,7 +1617,7 @@ msgstr " #: engines/scumm/help.cpp:304 msgid "Punch low" -msgstr "Бити нище" +msgstr "Бити нижче" #: engines/scumm/help.cpp:307 msgid "These are for Indy on left." @@ -1636,7 +1629,7 @@ msgstr " #: engines/scumm/help.cpp:309 msgid "7, 4, and 1 are switched with" -msgstr "7, 4, і 1 перемикаються з" +msgstr "7, 4, і 1 перемикаються на" #: engines/scumm/help.cpp:310 msgid "9, 6, and 3, respectively." @@ -1648,11 +1641,11 @@ msgstr " #: engines/scumm/help.cpp:318 msgid "Fly to upper left" -msgstr "Летіти вище вліво" +msgstr "Летіти догори наліво" #: engines/scumm/help.cpp:319 msgid "Fly to left" -msgstr "Летіти вліво" +msgstr "Летіти наліво" #: engines/scumm/help.cpp:320 msgid "Fly to lower left" @@ -1660,7 +1653,7 @@ msgstr " #: engines/scumm/help.cpp:321 msgid "Fly upwards" -msgstr "Летіти вгору" +msgstr "Летіти догори" #: engines/scumm/help.cpp:322 msgid "Fly straight" @@ -1668,11 +1661,11 @@ msgstr " #: engines/scumm/help.cpp:323 msgid "Fly down" -msgstr "Летіти вниз" +msgstr "Летіти донизу" #: engines/scumm/help.cpp:324 msgid "Fly to upper right" -msgstr "Летіти вище вправо" +msgstr "Летіти догори направо" #: engines/scumm/help.cpp:325 msgid "Fly to right" @@ -1680,7 +1673,7 @@ msgstr " #: engines/scumm/help.cpp:326 msgid "Fly to lower right" -msgstr "Летіти нижче вправо" +msgstr "Летіти донизу направо" #: engines/scumm/scumm.cpp:2255 engines/agos/saveload.cpp:192 #, c-format @@ -1689,7 +1682,7 @@ msgid "" "\n" "%s" msgstr "" -"Не вдалося зберегти стан гри в файл:\n" +"Не вдалося зберегти стан гри у файл:\n" "\n" "%s" @@ -1721,18 +1714,21 @@ msgid "" "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " "directory inside the Tentacle game directory." msgstr "" +"Зазвичай, зараз би запустився Maniac Mansion. Проте ScummVM ще цього не вміє. " +"Щоб грати у нього, оберіть 'Додати гру' у початковому меню ScummVM, і виберіть " +"папку Maniac всередені пвпки з грою Tentacle." #: engines/mohawk/dialogs.cpp:89 engines/mohawk/dialogs.cpp:127 msgid "~Z~ip Mode Activated" -msgstr "Режим швидкого переходу активований" +msgstr "Режим швидкого переходу активовано" #: engines/mohawk/dialogs.cpp:90 msgid "~T~ransitions Enabled" -msgstr "Переходи активовані" +msgstr "Переходи активовано" #: engines/mohawk/dialogs.cpp:128 msgid "~W~ater Effect Enabled" -msgstr "Ефекти води включені" +msgstr "Ефекти води включено" #: engines/sci/engine/kfile.cpp:680 msgid "Restore game:" @@ -1832,11 +1828,11 @@ msgstr " #: backends/platform/ds/arm9/source/dsoptions.cpp:71 msgid "Touch X Offset" -msgstr "Зміщення торкань по осі X" +msgstr "Зміщення дотиків по осі X" #: backends/platform/ds/arm9/source/dsoptions.cpp:78 msgid "Touch Y Offset" -msgstr "Зміщення торкань по осі Y" +msgstr "Зміщення дотиків по осі Y" #: backends/platform/ds/arm9/source/dsoptions.cpp:90 msgid "Use laptop trackpad-style cursor control" @@ -1860,7 +1856,7 @@ msgstr " #: backends/platform/ds/arm9/source/dsoptions.cpp:110 msgid "Hardware scale (fast, but low quality)" -msgstr "Хардварное масштабування (швидко, але низької якості)" +msgstr "Хардварне масштабування (швидко, але низької якості)" #: backends/platform/ds/arm9/source/dsoptions.cpp:111 msgid "Software scale (good quality, but slower)" @@ -1884,11 +1880,11 @@ msgstr " #: backends/platform/iphone/osys_events.cpp:360 msgid "Touchpad mode enabled." -msgstr "Режим тачпаду увімкнений." +msgstr "Режим тачпаду увімкнено." #: backends/platform/iphone/osys_events.cpp:362 msgid "Touchpad mode disabled." -msgstr "Режим тачпаду вимкнений." +msgstr "Режим тачпаду вимкнено." #: backends/graphics/sdl/sdl-graphics.cpp:47 msgid "Normal (no scaling)" @@ -1905,7 +1901,7 @@ msgstr "OpenGL #: backends/graphics/opengl/opengl-graphics.cpp:134 msgid "OpenGL Conserve" -msgstr "OpenGL консервований" +msgstr "OpenGL збережений #: backends/graphics/opengl/opengl-graphics.cpp:135 msgid "OpenGL Original" @@ -1914,22 +1910,22 @@ msgstr "OpenGL #: backends/platform/symbian/src/SymbianActions.cpp:41 #: backends/platform/wince/CEActionsSmartphone.cpp:42 msgid "Up" -msgstr "Вверх" +msgstr "Догори" #: backends/platform/symbian/src/SymbianActions.cpp:42 #: backends/platform/wince/CEActionsSmartphone.cpp:43 msgid "Down" -msgstr "Вниз" +msgstr "Донизу" #: backends/platform/symbian/src/SymbianActions.cpp:43 #: backends/platform/wince/CEActionsSmartphone.cpp:44 msgid "Left" -msgstr "Вліво" +msgstr "Наліво" #: backends/platform/symbian/src/SymbianActions.cpp:44 #: backends/platform/wince/CEActionsSmartphone.cpp:45 msgid "Right" -msgstr "Вправо" +msgstr "Направо" #: backends/platform/symbian/src/SymbianActions.cpp:45 #: backends/platform/wince/CEActionsPocket.cpp:63 @@ -1951,7 +1947,7 @@ msgstr " #: backends/platform/wince/CEActionsPocket.cpp:57 #: backends/platform/wince/CEActionsSmartphone.cpp:51 msgid "Multi Function" -msgstr "Мультіфункція" +msgstr "Мультифункція" #: backends/platform/symbian/src/SymbianActions.cpp:51 msgid "Swap character" @@ -1983,7 +1979,7 @@ msgstr " #: backends/events/symbiansdl/symbiansdl-events.cpp:187 msgid "Do you want to quit ?" -msgstr "Ви хочите вийти?" +msgstr "Ви хочете вийти?" #: backends/platform/wii/options.cpp:51 msgid "Video" @@ -1991,7 +1987,7 @@ msgstr " #: backends/platform/wii/options.cpp:54 msgid "Current video mode:" -msgstr "Текучий відеорежим:" +msgstr "Поточний відеорежим:" #: backends/platform/wii/options.cpp:56 msgid "Double-strike" @@ -2071,7 +2067,7 @@ msgstr " #: backends/platform/wii/options.cpp:143 msgid "DVD Mounted successfully" -msgstr "DVD підключений успішно" +msgstr "DVD підключено успішно" #: backends/platform/wii/options.cpp:146 msgid "Error while mounting the DVD" @@ -2079,11 +2075,11 @@ msgstr " #: backends/platform/wii/options.cpp:148 msgid "DVD not mounted" -msgstr "DVD не підключений" +msgstr "DVD не підключено" #: backends/platform/wii/options.cpp:161 msgid "Network up, share mounted" -msgstr "Мережа працює, папка підключена" +msgstr "Мережа працює, папку підключено" #: backends/platform/wii/options.cpp:163 msgid "Network up" @@ -2095,11 +2091,11 @@ msgstr ", #: backends/platform/wii/options.cpp:168 msgid ", share not mounted" -msgstr ", папка не підключена" +msgstr ", папку не підключено" #: backends/platform/wii/options.cpp:174 msgid "Network down" -msgstr "Мережа вимкнена" +msgstr "Мережу вимкнено" #: backends/platform/wii/options.cpp:178 msgid "Initialising network" @@ -2107,12 +2103,12 @@ msgstr " #: backends/platform/wii/options.cpp:182 msgid "Timeout while initialising network" -msgstr "Час підключення до мережі витік" +msgstr "Час підключення до мережі вийшов" #: backends/platform/wii/options.cpp:186 #, c-format msgid "Network not initialised (%d)" -msgstr "Мережа не налагоджена (%d)" +msgstr "Мережу не налагоджено (%d)" #: backends/platform/wince/CEActionsPocket.cpp:49 msgid "Hide Toolbar" @@ -2132,7 +2128,7 @@ msgstr " #: backends/platform/wince/CEActionsPocket.cpp:53 msgid "Show/Hide Cursor" -msgstr "Показати/Сховати курсор" +msgstr "Показати/сховати курсор" #: backends/platform/wince/CEActionsPocket.cpp:54 msgid "Free look" @@ -2149,23 +2145,23 @@ msgstr " #: backends/platform/wince/CEActionsPocket.cpp:58 #: backends/platform/wince/CEActionsSmartphone.cpp:52 msgid "Bind Keys" -msgstr "призначити клавіші" +msgstr "Призначити клавіші" #: backends/platform/wince/CEActionsPocket.cpp:59 msgid "Cursor Up" -msgstr "Курсор вверх" +msgstr "Курсор догори" #: backends/platform/wince/CEActionsPocket.cpp:60 msgid "Cursor Down" -msgstr "Курсор вниз" +msgstr "Курсор донизу" #: backends/platform/wince/CEActionsPocket.cpp:61 msgid "Cursor Left" -msgstr "Курсор вліво" +msgstr "Курсор наліво" #: backends/platform/wince/CEActionsPocket.cpp:62 msgid "Cursor Right" -msgstr "Курсор вправо" +msgstr "Курсор направо" #: backends/platform/wince/CEActionsPocket.cpp:268 #: backends/platform/wince/CEActionsSmartphone.cpp:231 @@ -2203,7 +2199,7 @@ msgstr " #: backends/platform/wince/wince-sdl.cpp:490 msgid "You must map a key to the 'Right Click' action to play this game" -msgstr "Ви повинні пере" +msgstr "Ви повинні призначити кнопку до дії 'Правий клік', щоб грати у цю гру" #: backends/platform/wince/wince-sdl.cpp:499 msgid "Map hide toolbar action" @@ -2212,7 +2208,7 @@ msgstr " #: backends/platform/wince/wince-sdl.cpp:503 msgid "You must map a key to the 'Hide toolbar' action to play this game" msgstr "" -"Ви повинні перепризначити кнопку для дії 'Сховати Панель інстр.', щоб грати " +"Ви повинні перепризначити кнопку для дії 'Сховати Панель інстр.', щоб грати " "в цю гру" #: backends/platform/wince/wince-sdl.cpp:512 diff --git a/ports.mk b/ports.mk index 958453ab0f9..8e7914dd3f6 100644 --- a/ports.mk +++ b/ports.mk @@ -1,12 +1,10 @@ # This file contains port specific Makefile rules. It is automatically # included by the default (main) Makefile. # -# $URL$ -# $Id$ # -# UNIX specific +# POSIX specific # install: $(INSTALL) -d "$(DESTDIR)$(bindir)" @@ -168,38 +166,39 @@ osxsnap: bundle scummvmwinres.o: $(srcdir)/icons/scummvm.ico $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) $(srcdir)/dists/scummvm.rc $(QUIET_WINDRES)$(WINDRES) -DHAVE_CONFIG_H $(WINDRESFLAGS) $(DEFINES) -I. -I$(srcdir) $(srcdir)/dists/scummvm.rc scummvmwinres.o -# Special target to create a win32 snapshot binary -win32dist: $(EXECUTABLE) - mkdir -p $(WIN32PATH) - $(STRIP) $(EXECUTABLE) -o $(WIN32PATH)/$(EXECUTABLE) - cp $(DIST_FILES_THEMES) $(WIN32PATH) +# Special target to prepare data files for distribution / installer creation +win32data: $(EXECUTABLE) + mkdir -p $(srcdir)/$(WIN32PATH) + cp $(srcdir)/AUTHORS $(srcdir)/$(WIN32PATH) + cp $(srcdir)/COPYING $(srcdir)/$(WIN32PATH) + cp $(srcdir)/COPYING.LGPL $(srcdir)/$(WIN32PATH) + cp $(srcdir)/COPYRIGHT $(srcdir)/$(WIN32PATH) + cp $(srcdir)/NEWS $(srcdir)/$(WIN32PATH) + cp $(srcdir)/README $(srcdir)/$(WIN32PATH) + cp /usr/local/README-SDL.txt $(srcdir)/$(WIN32PATH)/README-SDL + unix2dos $(srcdir)/$(WIN32PATH)/*.* + $(STRIP) $(EXECUTABLE) -o $(srcdir)/$(WIN32PATH)/$(EXECUTABLE) + cp $(DIST_FILES_THEMES) $(srcdir)/$(WIN32PATH) ifdef DIST_FILES_ENGINEDATA - cp $(DIST_FILES_ENGINEDATA) $(WIN32PATH) + cp $(DIST_FILES_ENGINEDATA) $(srcdir)/$(WIN32PATH) endif - cp $(srcdir)/AUTHORS $(WIN32PATH)/AUTHORS.txt - cp $(srcdir)/COPYING $(WIN32PATH)/COPYING.txt - cp $(srcdir)/COPYING.LGPL $(WIN32PATH)/COPYING.LGPL.txt - cp $(srcdir)/COPYRIGHT $(WIN32PATH)/COPYRIGHT.txt - cp $(srcdir)/NEWS $(WIN32PATH)/NEWS.txt - cp $(srcdir)/README $(WIN32PATH)/README.txt - cp /usr/local/README-SDL.txt $(WIN32PATH) - cp /usr/local/bin/SDL.dll $(WIN32PATH) - cp $(srcdir)/icons/scummvm.ico $(WIN32PATH) - cp $(srcdir)/dists/win32/ScummVM.iss $(WIN32PATH) - unix2dos $(WIN32PATH)/*.txt + cp /usr/local/bin/SDL.dll $(srcdir)/$(WIN32PATH) -# Special target to create a win32 installer -# (extensions for text files are removed, as they are read -# as-is by the setup script and renamed there) -win32setup: win32dist - mv $(WIN32PATH)/AUTHORS.txt $(WIN32PATH)/AUTHORS - mv $(WIN32PATH)/COPYING.txt $(WIN32PATH)/COPYING - mv $(WIN32PATH)/COPYING.LGPL.txt $(WIN32PATH)/COPYING.LGPL - mv $(WIN32PATH)/COPYRIGHT.txt $(WIN32PATH)/COPYRIGHT - mv $(WIN32PATH)/NEWS.txt $(WIN32PATH)/NEWS - mv $(WIN32PATH)/README.txt $(WIN32PATH)/README - mv $(WIN32PATH)/README-SDL.txt $(WIN32PATH)/README-SDL - makensis -V2 -Dtop_srcdir="../../$(srcdir)" -Dtext_dir="../../$(WIN32PATH)" -Dbuild_dir="../../$(WIN32PATH)" $(srcdir)/dists/nsis/scummvm.nsi +# Special target to create a win32 snapshot binary (for Inno Setup) +win32dist: win32data + cp $(srcdir)/icons/scummvm.ico $(srcdir)/$(WIN32PATH) + cp $(srcdir)/dists/win32/ScummVM.iss $(srcdir)/$(WIN32PATH) + mv $(WIN32PATH)/AUTHORS $(srcdir)/$(WIN32PATH)/AUTHORS.txt + mv $(WIN32PATH)/COPYING $(srcdir)/$(WIN32PATH)/COPYING.txt + mv $(WIN32PATH)/COPYING.LGPL $(srcdir)/$(WIN32PATH)/COPYING.LGPL.txt + mv $(WIN32PATH)/COPYRIGHT $(srcdir)/$(WIN32PATH)/COPYRIGHT.txt + mv $(WIN32PATH)/NEWS $(srcdir)/$(WIN32PATH)/NEWS.txt + mv $(WIN32PATH)/README $(srcdir)/$(WIN32PATH)/README.txt + mv $(WIN32PATH)/README-SDL $(srcdir)/$(WIN32PATH)/README-SDL.txt + +# Special target to create a win32 NSIS installer +win32setup: win32data + makensis -V2 -Dtop_srcdir="../.." -Dtext_dir="../../$(WIN32PATH)" -Dbuild_dir="../../$(WIN32PATH)" $(srcdir)/dists/nsis/scummvm.nsi # # AmigaOS specific diff --git a/rules.mk b/rules.mk index c531d49a293..d03f549405d 100644 --- a/rules.mk +++ b/rules.mk @@ -1,8 +1,6 @@ ############################################### # Common build rules, used by the sub modules and their module.mk files # -# $URL$ -# $Id$ ############################################### diff --git a/test/common/array.h b/test/common/array.h index f17edd39843..c10270436f4 100644 --- a/test/common/array.h +++ b/test/common/array.h @@ -107,6 +107,34 @@ class ArrayTestSuite : public CxxTest::TestSuite } + void test_self_insert() { + Common::Array array; + int i; + + // Insert some data -- and make sure we have enough space for + // *twice* as much data. This way, there is no need to allocate + // new storage, so if the insert() operation is "clever", it + // will try to reuse the existing storage. + // This in turn may uncover bugs if the insertion code does not + // expect self-insertions. + array.reserve(128); + for (i = 0; i < 64; ++i) + array.push_back(i); + + // Now insert the array into the middle of itself + array.insert_at(12, array); + + // Verify integrity + TS_ASSERT_EQUALS(array.size(), 128UL); + + for (i = 0; i < 12; ++i) + TS_ASSERT_EQUALS(array[i], i); + for (i = 0; i < 64; ++i) + TS_ASSERT_EQUALS(array[i+12], i); + for (i = 12; i < 64; ++i) + TS_ASSERT_EQUALS(array[i+64], i); + } + void test_remove_at() { Common::Array array; diff --git a/test/common/str.h b/test/common/str.h index 5d9fe29af9d..0dee16a493c 100644 --- a/test/common/str.h +++ b/test/common/str.h @@ -378,4 +378,21 @@ class StringTestSuite : public CxxTest::TestSuite TS_ASSERT_EQUALS(Common::strlcat(test4, appendString, 11), strlen(resultString)); TS_ASSERT_EQUALS(strcmp(test4, resultString), 0); } + + void test_scumm_stricmp() { + TS_ASSERT_EQUALS(scumm_stricmp("abCd", "abCd"), 0); + TS_ASSERT_EQUALS(scumm_stricmp("abCd", "ABCd"), 0); + TS_ASSERT_LESS_THAN(scumm_stricmp("abCd", "ABCe"), 0); + TS_ASSERT_LESS_THAN(scumm_stricmp("abCd", "ABCde"), 0); + } + + void test_scumm_strnicmp() { + TS_ASSERT_EQUALS(scumm_strnicmp("abCd", "abCd", 3), 0); + TS_ASSERT_EQUALS(scumm_strnicmp("abCd", "ABCd", 4), 0); + TS_ASSERT_EQUALS(scumm_strnicmp("abCd", "ABCd", 5), 0); + TS_ASSERT_EQUALS(scumm_strnicmp("abCd", "ABCe", 3), 0); + TS_ASSERT_LESS_THAN(scumm_strnicmp("abCd", "ABCe", 4), 0); + TS_ASSERT_EQUALS(scumm_strnicmp("abCd", "ABCde", 4), 0); + TS_ASSERT_LESS_THAN(scumm_strnicmp("abCd", "ABCde", 5), 0); + } }; diff --git a/test/module.mk b/test/module.mk index 3542ae29034..4e5cbf62e16 100644 --- a/test/module.mk +++ b/test/module.mk @@ -9,7 +9,7 @@ TESTS := $(srcdir)/test/common/*.h $(srcdir)/test/audio/*.h TEST_LIBS := audio/libaudio.a common/libcommon.a # -TEST_FLAGS := --runner=StdioPrinter +TEST_FLAGS := --runner=StdioPrinter --no-std --no-eh TEST_CFLAGS := -I$(srcdir)/test/cxxtest TEST_LDFLAGS := $(LIBS) TEST_CXXFLAGS := $(filter-out -Wglobal-constructors,$(CXXFLAGS)) diff --git a/video/avi_decoder.cpp b/video/avi_decoder.cpp index 47322c86b75..96859523048 100644 --- a/video/avi_decoder.cpp +++ b/video/avi_decoder.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/stream.h" @@ -402,10 +399,8 @@ Codec *AviDecoder::createCodec() { return new MSRLEDecoder(_bmInfo.width, _bmInfo.height, _bmInfo.bitCount); case ID_CVID: return new CinepakDecoder(_bmInfo.bitCount); -#ifdef USE_INDEO3 case ID_IV32: return new Indeo3Decoder(_bmInfo.width, _bmInfo.height); -#endif #ifdef VIDEO_CODECS_TRUEMOTION1_H case ID_DUCK: return new TrueMotion1Decoder(_bmInfo.width, _bmInfo.height); diff --git a/video/avi_decoder.h b/video/avi_decoder.h index 0154b57ea61..540a76855d0 100644 --- a/video/avi_decoder.h +++ b/video/avi_decoder.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef VIDEO_AVI_PLAYER_H diff --git a/video/codecs/cdtoons.cpp b/video/codecs/cdtoons.cpp index 51e3c23eaa9..9bdc794fa69 100644 --- a/video/codecs/cdtoons.cpp +++ b/video/codecs/cdtoons.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "video/codecs/cdtoons.h" diff --git a/video/codecs/cdtoons.h b/video/codecs/cdtoons.h index dafe5e56ef6..8f6d3acb6ed 100644 --- a/video/codecs/cdtoons.h +++ b/video/codecs/cdtoons.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef VIDEO_CODECS_CDTOONS_H diff --git a/video/codecs/cinepak.cpp b/video/codecs/cinepak.cpp index 2a782dbafe3..c8b23dfc3fc 100644 --- a/video/codecs/cinepak.cpp +++ b/video/codecs/cinepak.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "video/codecs/cinepak.h" diff --git a/video/codecs/cinepak.h b/video/codecs/cinepak.h index 34e4fe98eb4..67000bf58a4 100644 --- a/video/codecs/cinepak.h +++ b/video/codecs/cinepak.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef VIDEO_CODECS_CINEPAK_H diff --git a/video/codecs/codec.h b/video/codecs/codec.h index 4a33d831382..8e4691ca3ca 100644 --- a/video/codecs/codec.h +++ b/video/codecs/codec.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef VIDEO_CODECS_CODEC_H diff --git a/video/codecs/indeo3.cpp b/video/codecs/indeo3.cpp index b4f6c6ffe32..7bf7fc8235f 100644 --- a/video/codecs/indeo3.cpp +++ b/video/codecs/indeo3.cpp @@ -18,15 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" -#ifdef USE_INDEO3 - /* Intel Indeo 3 decompressor, derived from ffmpeg. * * Original copyright note: * Intel Indeo 3 (IV31, IV32, etc.) video decoder for ffmpeg @@ -3519,5 +3514,3 @@ const uint32 Indeo3Decoder::correctionhighorder[] = { }; } // End of namespace Video - -#endif // USE_INDEO3 diff --git a/video/codecs/indeo3.h b/video/codecs/indeo3.h index a9ae480f179..a07d779dec8 100644 --- a/video/codecs/indeo3.h +++ b/video/codecs/indeo3.h @@ -18,15 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" -#ifdef USE_INDEO3 - /* Intel Indeo 3 decompressor, derived from ffmpeg. * * Original copyright note: @@ -90,5 +85,3 @@ private: } // End of namespace Video #endif // VIDEO_CODECS_INDEO3_H - -#endif // USE_INDEO3 diff --git a/video/codecs/mjpeg.cpp b/video/codecs/mjpeg.cpp index 2ef854039b2..248a80d714b 100644 --- a/video/codecs/mjpeg.cpp +++ b/video/codecs/mjpeg.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/video/codecs/mjpeg.h b/video/codecs/mjpeg.h index d1395a82487..8a446ee005c 100644 --- a/video/codecs/mjpeg.h +++ b/video/codecs/mjpeg.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef VIDEO_CODECS_MJPEG_H diff --git a/video/codecs/msrle.cpp b/video/codecs/msrle.cpp index 19309bc7aa9..fa03a59efd8 100644 --- a/video/codecs/msrle.cpp +++ b/video/codecs/msrle.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Based off ffmpeg's msrledec.c diff --git a/video/codecs/msrle.h b/video/codecs/msrle.h index 130bb8c4ef1..2aea66d1134 100644 --- a/video/codecs/msrle.h +++ b/video/codecs/msrle.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef VIDEO_CODECS_MSRLE_H diff --git a/video/codecs/msvideo1.cpp b/video/codecs/msvideo1.cpp index 93e9aaae64e..06e46400250 100644 --- a/video/codecs/msvideo1.cpp +++ b/video/codecs/msvideo1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Based off ffmpeg's msvideo.cpp diff --git a/video/codecs/msvideo1.h b/video/codecs/msvideo1.h index c476538a8e6..767eece580e 100644 --- a/video/codecs/msvideo1.h +++ b/video/codecs/msvideo1.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef VIDEO_CODECS_MSVIDEO1_H diff --git a/video/codecs/qtrle.cpp b/video/codecs/qtrle.cpp index 0ae27f62846..f01720ec86e 100644 --- a/video/codecs/qtrle.cpp +++ b/video/codecs/qtrle.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // QuickTime RLE Decoder diff --git a/video/codecs/qtrle.h b/video/codecs/qtrle.h index 20fe2c32429..6f8e113ca5c 100644 --- a/video/codecs/qtrle.h +++ b/video/codecs/qtrle.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef VIDEO_CODECS_QTRLE_H diff --git a/video/codecs/rpza.cpp b/video/codecs/rpza.cpp index 0c06661c506..df5738202ee 100644 --- a/video/codecs/rpza.cpp +++ b/video/codecs/rpza.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Based off ffmpeg's RPZA decoder diff --git a/video/codecs/rpza.h b/video/codecs/rpza.h index c6b1f43a9a7..809a69f4444 100644 --- a/video/codecs/rpza.h +++ b/video/codecs/rpza.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef VIDEO_CODECS_RPZA_H diff --git a/video/codecs/smc.cpp b/video/codecs/smc.cpp index bbd60734977..2eedb62a0f6 100644 --- a/video/codecs/smc.cpp +++ b/video/codecs/smc.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Based off ffmpeg's SMC decoder diff --git a/video/codecs/smc.h b/video/codecs/smc.h index b2bc6128577..f2caca977ae 100644 --- a/video/codecs/smc.h +++ b/video/codecs/smc.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef VIDEO_CODECS_SMC_H diff --git a/video/codecs/truemotion1.cpp b/video/codecs/truemotion1.cpp index b7d1f406d71..b8a3c0ab371 100644 --- a/video/codecs/truemotion1.cpp +++ b/video/codecs/truemotion1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Based on the TrueMotion 1 decoder by Alex Beregszaszi & Mike Melanson in FFmpeg diff --git a/video/codecs/truemotion1.h b/video/codecs/truemotion1.h index 4a51fcb33a7..33fbedca93b 100644 --- a/video/codecs/truemotion1.h +++ b/video/codecs/truemotion1.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Based on the TrueMotion 1 decoder by Alex Beregszaszi & Mike Melanson in FFmpeg diff --git a/video/codecs/truemotion1data.h b/video/codecs/truemotion1data.h index 06d30c44360..fabec435668 100644 --- a/video/codecs/truemotion1data.h +++ b/video/codecs/truemotion1data.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Based on the TrueMotion 1 decoder by Alex Beregszaszi & Mike Melanson in FFmpeg diff --git a/video/coktel_decoder.cpp b/video/coktel_decoder.cpp index 4448c9162eb..8ea2d08acb8 100644 --- a/video/coktel_decoder.cpp +++ b/video/coktel_decoder.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" @@ -1627,11 +1624,7 @@ bool VMDDecoder::openExternalCodec() { if (_videoCodec == kVideoCodecIndeo3) { _isPaletted = false; -#ifdef USE_INDEO3 _codec = new Indeo3Decoder(_width, _height); -#else - warning("VMDDecoder::openExternalCodec(): Indeo3 decoder not compiled in"); -#endif } else { warning("VMDDecoder::openExternalCodec(): Unknown video codec FourCC \"%s\"", diff --git a/video/coktel_decoder.h b/video/coktel_decoder.h index 46007d55da0..8ad14560374 100644 --- a/video/coktel_decoder.h +++ b/video/coktel_decoder.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Currently, only GOB and SCI32 games play IMDs and VMDs, so skip compiling if GOB and SCI32 is disabled. diff --git a/video/dxa_decoder.cpp b/video/dxa_decoder.cpp index 9e3f59705c7..561719a27d4 100644 --- a/video/dxa_decoder.cpp +++ b/video/dxa_decoder.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/video/dxa_decoder.h b/video/dxa_decoder.h index 498f4630d43..4eb4a8958da 100644 --- a/video/dxa_decoder.h +++ b/video/dxa_decoder.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef VIDEO_DXA_DECODER_H diff --git a/video/flic_decoder.cpp b/video/flic_decoder.cpp index 47a9244a138..bdcdedc1420 100644 --- a/video/flic_decoder.cpp +++ b/video/flic_decoder.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "video/flic_decoder.h" diff --git a/video/flic_decoder.h b/video/flic_decoder.h index 4ca8615de12..9badc3da2e2 100644 --- a/video/flic_decoder.h +++ b/video/flic_decoder.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef VIDEO_FLICDECODER_H diff --git a/video/mpeg_player.cpp b/video/mpeg_player.cpp index f583853183f..fa98860a387 100644 --- a/video/mpeg_player.cpp +++ b/video/mpeg_player.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // The YUV to RGB conversion code is derived from SDL's YUV overlay code, which diff --git a/video/mpeg_player.h b/video/mpeg_player.h index dde272a9c69..dca0a98a2f8 100644 --- a/video/mpeg_player.h +++ b/video/mpeg_player.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef VIDEO_MPEG_PLAYER_H diff --git a/video/qt_decoder.cpp b/video/qt_decoder.cpp index d9ad65c9a0b..328c3fb21b4 100644 --- a/video/qt_decoder.cpp +++ b/video/qt_decoder.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/video/qt_decoder.h b/video/qt_decoder.h index 6f7eb9450cb..d8beda0f83b 100644 --- a/video/qt_decoder.h +++ b/video/qt_decoder.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/video/smk_decoder.cpp b/video/smk_decoder.cpp index 7a95eedf6a4..05a20ecd8da 100644 --- a/video/smk_decoder.cpp +++ b/video/smk_decoder.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Based on http://wiki.multimedia.cx/index.php?title=Smacker diff --git a/video/smk_decoder.h b/video/smk_decoder.h index b4eda88203d..72cd32a222a 100644 --- a/video/smk_decoder.h +++ b/video/smk_decoder.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef VIDEO_SMK_PLAYER_H diff --git a/video/video_decoder.cpp b/video/video_decoder.cpp index dde2c090821..e1122132a8f 100644 --- a/video/video_decoder.cpp +++ b/video/video_decoder.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "video/video_decoder.h" diff --git a/video/video_decoder.h b/video/video_decoder.h index b5574fd3fc5..52ced4777c7 100644 --- a/video/video_decoder.h +++ b/video/video_decoder.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef VIDEO_DECODER_H