diff options
504 files changed, 10353 insertions, 9153 deletions
diff --git a/.gitignore b/.gitignore index 906c6a8a83..ef404048c0 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ lib*.a /.project /.cproject /.settings +/Icon.* /build @@ -71,9 +72,15 @@ lib*.a /dists/codeblocks/*.layout /dists/codeblocks/scummvm* +#Ignore XCode user data and build files +xcuserdata +project.xcworkspace /dists/iphone/build -/dists/iphone/scummvm.xcodeproj/*.mode1v3 -/dists/iphone/scummvm.xcodeproj/*.pbxuser +/dists/iphone/scummvm.xcodeproj +/dists/iphone/create_project +/dists/macosx/build +/dists/macosx/scummvm.xcodeproj +/dists/macosx/create_project /dists/msvc*/[Dd]ebug*/ /dists/msvc*/[Rr]elease*/ @@ -49,40 +49,18 @@ ScummVM Team Oliver Kiehl - (retired) Ludvig Strigeus - (retired) - Beneath a Steel Sky: - 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) - Draci Historie: + Draci: Denis Kasak Robert Spalek @@ -90,11 +68,6 @@ ScummVM Team Filippos Karapetis Pawel Kolodziejski - Flight of the Amazon Queen: - David Eriksson - (retired) - Gregory Montoir - Joost Peters - Gob: Torbjorn Andersson Arnaud Boutonne @@ -118,12 +91,12 @@ ScummVM Team Gregory Montoir Johannes Schickel - Last Express: + Lastexpress: Matthew Hoops Jordi Vilalta Prat Julien Templier - Lure of the Temptress: + Lure: Paul Gilbert M4: @@ -147,6 +120,11 @@ ScummVM Team Parallaction: peres + Queen: + David Eriksson - (retired) + Gregory Montoir + Joost Peters + SAGA: Torbjorn Andersson Filippos Karapetis @@ -164,7 +142,29 @@ ScummVM Team Jordi Vilalta Prat Lars Skovlund - Teen Agent: + 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) @@ -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 @@ -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 @@ -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. @@ -2052,8 +2052,7 @@ compiler. Several compilers, including GCC, mingw and recent versions of Microsoft Visual C++ are supported. If you wish to use MP3-compressed CD tracks or .SOU files, you will need to install the MAD library; likewise you will need the appropriate libraries for Ogg Vorbis and FLAC -compressed sound. For MPEG2 support, libmpeg2 is required. For -compressed save states, zlib is required. +compressed sound. For compressed save states, zlib is required. Some parts of ScummVM, particularly scalers, have highly optimized versions written in assembler. If you wish to use this option, you will @@ -2137,7 +2136,7 @@ debug messages (see http://www.sysinternals.com/ntw2k/freeware/debugview.shtml). Maemo: * Get Scratchbox environment with Maemo 2.2 rootstrap (2.2 is for 770 and up) - * Install libmad, Tremor, FLAC, libmpeg2 from source + * Install libmad, Tremor, FLAC from source * patch scummvm source (some stuff is currently too dirty to be in svn directly) patch -p1 < backends/platform/maemo/scummvm-[currentversion]-maemo.patch * update debian/changelog diff --git a/audio/audiostream.cpp b/audio/audiostream.cpp index e6587a6543..547aa77526 100644 --- a/audio/audiostream.cpp +++ b/audio/audiostream.cpp @@ -30,6 +30,7 @@ #include "audio/audiostream.h" #include "audio/decoders/flac.h" #include "audio/decoders/mp3.h" +#include "audio/decoders/quicktime.h" #include "audio/decoders/raw.h" #include "audio/decoders/vorbis.h" @@ -48,7 +49,7 @@ struct StreamFileFormat { }; static const StreamFileFormat STREAM_FILEFORMATS[] = { - /* decoderName, fileExt, openStreamFuntion */ + /* decoderName, fileExt, openStreamFunction */ #ifdef USE_FLAC { "FLAC", ".flac", makeFLACStream }, { "FLAC", ".fla", makeFLACStream }, @@ -59,6 +60,7 @@ static const StreamFileFormat STREAM_FILEFORMATS[] = { #ifdef USE_MAD { "MPEG Layer 3", ".mp3", makeMP3Stream }, #endif + { "MPEG-4 Audio", ".m4a", makeQuickTimeStream }, { NULL, NULL, NULL } // Terminator }; diff --git a/audio/decoders/aac.cpp b/audio/decoders/aac.cpp new file mode 100644 index 0000000000..7949b5b561 --- /dev/null +++ b/audio/decoders/aac.cpp @@ -0,0 +1,177 @@ +/* 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 "audio/decoders/aac.h" + +#ifdef USE_FAAD + +#include "common/debug.h" +#include "common/stream.h" +#include "common/textconsole.h" +#include "common/util.h" + +#include "audio/audiostream.h" + +#include <neaacdec.h> + +namespace Audio { + +class AACStream : public AudioStream { +public: + AACStream(Common::SeekableReadStream *stream, + DisposeAfterUse::Flag disposeStream, + Common::SeekableReadStream *extraData, + DisposeAfterUse::Flag disposeExtraData); + ~AACStream(); + + int readBuffer(int16 *buffer, const int numSamples); + + bool endOfData() const { return _inBufferPos >= _inBufferSize && !_remainingSamples; } + bool isStereo() const { return _channels == 2; } + int getRate() const { return _rate; } + +private: + NeAACDecHandle _handle; + byte _channels; + unsigned long _rate; + + byte *_inBuffer; + uint32 _inBufferSize; + uint32 _inBufferPos; + + int16 *_remainingSamples; + uint32 _remainingSamplesSize; + uint32 _remainingSamplesPos; + + void init(Common::SeekableReadStream *extraData); +}; + +AACStream::AACStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeStream, + Common::SeekableReadStream *extraData, DisposeAfterUse::Flag disposeExtraData) { + + _remainingSamples = 0; + _inBufferPos = 0; + + init(extraData); + + // Copy all the data to a pointer so it can be passed through + // (At least MPEG-4 chunks shouldn't be large) + _inBufferSize = stream->size(); + _inBuffer = new byte[_inBufferSize]; + stream->read(_inBuffer, _inBufferSize); + + if (disposeStream == DisposeAfterUse::YES) + delete stream; + + if (disposeExtraData == DisposeAfterUse::YES) + delete extraData; +} + +AACStream::~AACStream() { + NeAACDecClose(_handle); + delete[] _inBuffer; + delete[] _remainingSamples; +} + +void AACStream::init(Common::SeekableReadStream *extraData) { + // Open the library + _handle = NeAACDecOpen(); + + // Configure the library to our needs + NeAACDecConfigurationPtr conf = NeAACDecGetCurrentConfiguration(_handle); + conf->outputFormat = FAAD_FMT_16BIT; // We only support 16bit audio + conf->downMatrix = 1; // Convert from 5.1 to stereo if required + NeAACDecSetConfiguration(_handle, conf); + + // Copy the extra data to a buffer + extraData->seek(0); + byte *extraDataBuf = new byte[extraData->size()]; + extraData->read(extraDataBuf, extraData->size()); + + // Initialize with our extra data + // NOTE: This code assumes the extra data is coming from an MPEG-4 file! + int err = NeAACDecInit2(_handle, extraDataBuf, extraData->size(), &_rate, &_channels); + delete[] extraDataBuf; + + if (err < 0) + error("Could not initialize AAC decoder: %s", NeAACDecGetErrorMessage(err)); +} + +int AACStream::readBuffer(int16 *buffer, const int numSamples) { + int samples = 0; + + assert((numSamples % _channels) == 0); + + // Dip into our remaining samples pool if it's available + if (_remainingSamples) { + samples = MIN<int>(numSamples, _remainingSamplesSize - _remainingSamplesPos); + + memcpy(buffer, _remainingSamples + _remainingSamplesPos, samples * 2); + _remainingSamplesPos += samples; + + if (_remainingSamplesPos == _remainingSamplesSize) { + delete[] _remainingSamples; + _remainingSamples = 0; + } + } + + // Decode until we have enough samples (or there's no more left) + while (samples < numSamples && !endOfData()) { + NeAACDecFrameInfo frameInfo; + uint16 *decodedSamples = (uint16 *)NeAACDecDecode(_handle, &frameInfo, _inBuffer + _inBufferPos, _inBufferSize - _inBufferPos); + + if (frameInfo.error != 0) + error("Failed to decode AAC frame: %s", NeAACDecGetErrorMessage(frameInfo.error)); + + int decodedSampleSize = frameInfo.samples; + int copySamples = (decodedSampleSize > (numSamples - samples)) ? (numSamples - samples) : decodedSampleSize; + + memcpy(buffer + samples, decodedSamples, copySamples * 2); + samples += copySamples; + + // Copy leftover samples for use in a later readBuffer() call + if (copySamples != decodedSampleSize) { + _remainingSamplesSize = decodedSampleSize - copySamples; + _remainingSamples = new int16[_remainingSamplesSize]; + _remainingSamplesPos = 0; + memcpy(_remainingSamples, decodedSamples + copySamples, _remainingSamplesSize * 2); + } + + _inBufferPos += frameInfo.bytesconsumed; + } + + return samples; +} + +// Factory function +AudioStream *makeAACStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeStream, + Common::SeekableReadStream *extraData, DisposeAfterUse::Flag disposeExtraData) { + + return new AACStream(stream, disposeStream, extraData, disposeExtraData); +} + +} // End of namespace Audio + +#endif // #ifdef USE_FAAD diff --git a/audio/decoders/aac.h b/audio/decoders/aac.h new file mode 100644 index 0000000000..f14fa9488b --- /dev/null +++ b/audio/decoders/aac.h @@ -0,0 +1,66 @@ +/* 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 + * Sound decoder used in engines: + * - groovie + */ + +#ifndef SOUND_AAC_H +#define SOUND_AAC_H + +#include "common/scummsys.h" +#include "common/types.h" + +#ifdef USE_FAAD + +namespace Common { + class SeekableReadStream; +} + +namespace Audio { + +class AudioStream; + +/** + * Create a new AudioStream from the AAC data in the given stream. + * + * @param stream the SeekableReadStream from which to read the AAC data + * @param disposeStream whether to delete the stream after use + * @param extraData the SeekableReadStream from which to read the AAC extra data + * @param disposeExtraData whether to delete the extra data stream after use + * @return a new AudioStream, or NULL, if an error occurred + */ +AudioStream *makeAACStream( + Common::SeekableReadStream *stream, + DisposeAfterUse::Flag disposeStream, + Common::SeekableReadStream *extraData, + DisposeAfterUse::Flag disposeExtraData = DisposeAfterUse::NO); + +} // End of namespace Audio + +#endif // #ifdef USE_FAAD +#endif // #ifndef SOUND_AAC_H diff --git a/audio/decoders/flac.cpp b/audio/decoders/flac.cpp index b818d4f7e9..d06a7b9c0e 100644 --- a/audio/decoders/flac.cpp +++ b/audio/decoders/flac.cpp @@ -303,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/video/codecs/qdm2.cpp b/audio/decoders/qdm2.cpp index 10310ce2a0..a178c363b5 100644 --- a/video/codecs/qdm2.cpp +++ b/audio/decoders/qdm2.cpp @@ -23,19 +23,19 @@ // Based off ffmpeg's QDM2 decoder #include "common/scummsys.h" -#include "video/codecs/qdm2.h" +#include "audio/decoders/qdm2.h" -#ifdef VIDEO_CODECS_QDM2_H +#ifdef AUDIO_QDM2_H #include "audio/audiostream.h" -#include "video/codecs/qdm2data.h" +#include "audio/decoders/qdm2data.h" #include "common/array.h" #include "common/debug.h" #include "common/stream.h" #include "common/textconsole.h" -namespace Video { +namespace Audio { enum { SOFTCLIP_THRESHOLD = 27600, @@ -150,7 +150,7 @@ struct RDFTContext { FFTContext fft; }; -class QDM2Stream : public Audio::AudioStream { +class QDM2Stream : public AudioStream { public: QDM2Stream(Common::SeekableReadStream *stream, Common::SeekableReadStream *extraData); ~QDM2Stream(); @@ -3270,10 +3270,10 @@ int QDM2Stream::readBuffer(int16 *buffer, const int numSamples) { return decodedSamples; } -Audio::AudioStream *makeQDM2Stream(Common::SeekableReadStream *stream, Common::SeekableReadStream *extraData) { +AudioStream *makeQDM2Stream(Common::SeekableReadStream *stream, Common::SeekableReadStream *extraData) { return new QDM2Stream(stream, extraData); } -} // End of namespace Video +} // End of namespace Audio #endif diff --git a/video/codecs/qdm2.h b/audio/decoders/qdm2.h index bb9228550a..c0ec647bfd 100644 --- a/video/codecs/qdm2.h +++ b/audio/decoders/qdm2.h @@ -23,18 +23,16 @@ // Only compile if Mohawk is enabled or if we're building dynamic modules #if defined(ENABLE_MOHAWK) || defined(DYNAMIC_MODULES) -#ifndef VIDEO_CODECS_QDM2_H -#define VIDEO_CODECS_QDM2_H +#ifndef AUDIO_QDM2_H +#define AUDIO_QDM2_H namespace Common { class SeekableReadStream; } namespace Audio { -class AudioStream; -} -namespace Video { +class AudioStream; /** * Create a new AudioStream from the QDM2 data in the given stream. @@ -43,9 +41,9 @@ namespace Video { * @param extraData the QuickTime extra data stream * @return a new AudioStream, or NULL, if an error occurred */ -Audio::AudioStream *makeQDM2Stream(Common::SeekableReadStream *stream, Common::SeekableReadStream *extraData); +AudioStream *makeQDM2Stream(Common::SeekableReadStream *stream, Common::SeekableReadStream *extraData); -} // End of namespace Video +} // End of namespace Audio -#endif // VIDEO_CODECS_QDM2_H +#endif // AUDIO_QDM2_H #endif // Mohawk/Plugins guard diff --git a/video/codecs/qdm2data.h b/audio/decoders/qdm2data.h index 995873207f..d92bc0ff80 100644 --- a/video/codecs/qdm2data.h +++ b/audio/decoders/qdm2data.h @@ -20,12 +20,12 @@ * */ -#ifndef VIDEO_CODECS_QDM2DATA_H -#define VIDEO_CODECS_QDM2DATA_H +#ifndef AUDIO_QDM2DATA_H +#define AUDIO_QDM2DATA_H #include "common/scummsys.h" -namespace Video { +namespace Audio { /// VLC TABLES @@ -523,6 +523,6 @@ static const float type34_delta[10] = { // FIXME: covers 8 entries.. 0.138071194291115f,0.333333343267441f,0.60947573184967f,1.0f,0.0f, }; -} // End of namespace Video +} // End of namespace Audio #endif diff --git a/audio/decoders/quicktime.cpp b/audio/decoders/quicktime.cpp new file mode 100644 index 0000000000..0f2e76658b --- /dev/null +++ b/audio/decoders/quicktime.cpp @@ -0,0 +1,421 @@ +/* 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 "common/debug.h" +#include "common/util.h" +#include "common/memstream.h" +#include "common/stream.h" +#include "common/textconsole.h" + +#include "audio/audiostream.h" +#include "audio/decoders/quicktime.h" +#include "audio/decoders/quicktime_intern.h" + +// Codecs +#include "audio/decoders/aac.h" +#include "audio/decoders/adpcm.h" +#include "audio/decoders/qdm2.h" +#include "audio/decoders/raw.h" + +namespace Audio { + +QuickTimeAudioDecoder::QuickTimeAudioDecoder() : Common::QuickTimeParser() { + _audStream = 0; +} + +QuickTimeAudioDecoder::~QuickTimeAudioDecoder() { + delete _audStream; +} + +bool QuickTimeAudioDecoder::loadAudioFile(const Common::String &filename) { + if (!Common::QuickTimeParser::parseFile(filename)) + return false; + + init(); + return true; +} + +bool QuickTimeAudioDecoder::loadAudioStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeFileHandle) { + if (!Common::QuickTimeParser::parseStream(stream, disposeFileHandle)) + return false; + + init(); + return true; +} + +void QuickTimeAudioDecoder::init() { + Common::QuickTimeParser::init(); + + _audioTrackIndex = -1; + + // Find an audio stream + for (uint32 i = 0; i < _tracks.size(); i++) + if (_tracks[i]->codecType == CODEC_TYPE_AUDIO && _audioTrackIndex < 0) + _audioTrackIndex = i; + + // Initialize audio, if present + if (_audioTrackIndex >= 0) { + AudioSampleDesc *entry = (AudioSampleDesc *)_tracks[_audioTrackIndex]->sampleDescs[0]; + + if (entry->isAudioCodecSupported()) { + _audStream = makeQueuingAudioStream(entry->_sampleRate, entry->_channels == 2); + _curAudioChunk = 0; + + // Make sure the bits per sample transfers to the sample size + if (entry->getCodecTag() == MKTAG('r', 'a', 'w', ' ') || entry->getCodecTag() == MKTAG('t', 'w', 'o', 's')) + _tracks[_audioTrackIndex]->sampleSize = (entry->_bitsPerSample / 8) * entry->_channels; + } + } +} + +Common::QuickTimeParser::SampleDesc *QuickTimeAudioDecoder::readSampleDesc(Track *track, uint32 format) { + if (track->codecType == CODEC_TYPE_AUDIO) { + debug(0, "Audio Codec FourCC: \'%s\'", tag2str(format)); + + AudioSampleDesc *entry = new AudioSampleDesc(track, format); + + uint16 stsdVersion = _fd->readUint16BE(); + _fd->readUint16BE(); // revision level + _fd->readUint32BE(); // vendor + + entry->_channels = _fd->readUint16BE(); // channel count + entry->_bitsPerSample = _fd->readUint16BE(); // sample size + + _fd->readUint16BE(); // compression id = 0 + _fd->readUint16BE(); // packet size = 0 + + entry->_sampleRate = (_fd->readUint32BE() >> 16); + + debug(0, "stsd version =%d", stsdVersion); + if (stsdVersion == 0) { + // Not used, except in special cases. See below. + entry->_samplesPerFrame = entry->_bytesPerFrame = 0; + } else if (stsdVersion == 1) { + // Read QT version 1 fields. In version 0 these dont exist. + entry->_samplesPerFrame = _fd->readUint32BE(); + debug(0, "stsd samples_per_frame =%d",entry->_samplesPerFrame); + _fd->readUint32BE(); // bytes per packet + entry->_bytesPerFrame = _fd->readUint32BE(); + debug(0, "stsd bytes_per_frame =%d", entry->_bytesPerFrame); + _fd->readUint32BE(); // bytes per sample + } else { + warning("Unsupported QuickTime STSD audio version %d", stsdVersion); + delete entry; + return 0; + } + + // Version 0 videos (such as the Riven ones) don't have this set, + // but we need it later on. Add it in here. + if (format == MKTAG('i', 'm', 'a', '4')) { + entry->_samplesPerFrame = 64; + entry->_bytesPerFrame = 34 * entry->_channels; + } + + if (entry->_sampleRate == 0 && track->timeScale > 1) + entry->_sampleRate = track->timeScale; + + return entry; + } + + return 0; +} + +bool QuickTimeAudioDecoder::isOldDemuxing() const { + assert(_audioTrackIndex >= 0); + return _tracks[_audioTrackIndex]->timeToSampleCount == 1 && _tracks[_audioTrackIndex]->timeToSample[0].duration == 1; +} + +void QuickTimeAudioDecoder::queueNextAudioChunk() { + AudioSampleDesc *entry = (AudioSampleDesc *)_tracks[_audioTrackIndex]->sampleDescs[0]; + Common::MemoryWriteStreamDynamic *wStream = new Common::MemoryWriteStreamDynamic(); + + _fd->seek(_tracks[_audioTrackIndex]->chunkOffsets[_curAudioChunk]); + + // First, we have to get the sample count + uint32 sampleCount = entry->getAudioChunkSampleCount(_curAudioChunk); + assert(sampleCount); + + if (isOldDemuxing()) { + // Old-style audio demuxing + + // Then calculate the right sizes + while (sampleCount > 0) { + uint32 samples = 0, size = 0; + + if (entry->_samplesPerFrame >= 160) { + samples = entry->_samplesPerFrame; + size = entry->_bytesPerFrame; + } else if (entry->_samplesPerFrame > 1) { + samples = MIN<uint32>((1024 / entry->_samplesPerFrame) * entry->_samplesPerFrame, sampleCount); + size = (samples / entry->_samplesPerFrame) * entry->_bytesPerFrame; + } else { + samples = MIN<uint32>(1024, sampleCount); + size = samples * _tracks[_audioTrackIndex]->sampleSize; + } + + // Now, we read in the data for this data and output it + byte *data = (byte *)malloc(size); + _fd->read(data, size); + wStream->write(data, size); + free(data); + sampleCount -= samples; + } + } else { + // New-style audio demuxing + + // Find our starting sample + uint32 startSample = 0; + for (uint32 i = 0; i < _curAudioChunk; i++) + startSample += entry->getAudioChunkSampleCount(i); + + for (uint32 i = 0; i < sampleCount; i++) { + uint32 size = (_tracks[_audioTrackIndex]->sampleSize != 0) ? _tracks[_audioTrackIndex]->sampleSize : _tracks[_audioTrackIndex]->sampleSizes[i + startSample]; + + // Now, we read in the data for this data and output it + byte *data = (byte *)malloc(size); + _fd->read(data, size); + wStream->write(data, size); + free(data); + } + } + + // Now queue the buffer + _audStream->queueAudioStream(entry->createAudioStream(new Common::MemoryReadStream(wStream->getData(), wStream->size(), DisposeAfterUse::YES))); + delete wStream; + + _curAudioChunk++; +} + +void QuickTimeAudioDecoder::setAudioStreamPos(const Timestamp &where) { + if (!_audStream) + return; + + // Re-create the audio stream + delete _audStream; + Audio::QuickTimeAudioDecoder::AudioSampleDesc *entry = (Audio::QuickTimeAudioDecoder::AudioSampleDesc *)_tracks[_audioTrackIndex]->sampleDescs[0]; + _audStream = Audio::makeQueuingAudioStream(entry->_sampleRate, entry->_channels == 2); + + // First, we need to track down what audio sample we need + Audio::Timestamp curAudioTime = where.convertToFramerate(_tracks[_audioTrackIndex]->timeScale); + uint32 sample = curAudioTime.totalNumberOfFrames(); + uint32 seekSample = sample; + + if (!isOldDemuxing()) { + // We shouldn't have audio samples that are a different duration + // That would be quite bad! + if (_tracks[_audioTrackIndex]->timeToSampleCount != 1) { + warning("Failed seeking"); + return; + } + + // Note that duration is in terms of *one* channel + // This eases calculation a bit + seekSample /= _tracks[_audioTrackIndex]->timeToSample[0].duration; + } + + // Now to track down what chunk it's in + uint32 totalSamples = 0; + _curAudioChunk = 0; + for (uint32 i = 0; i < _tracks[_audioTrackIndex]->chunkCount; i++, _curAudioChunk++) { + uint32 chunkSampleCount = entry->getAudioChunkSampleCount(i); + + if (seekSample < totalSamples + chunkSampleCount) + break; + + totalSamples += chunkSampleCount; + } + + // Reposition the audio stream + queueNextAudioChunk(); + if (sample != totalSamples) { + // HACK: Skip a certain amount of samples from the stream + // (There's got to be a better way to do this!) + int skipSamples = (sample - totalSamples) * entry->_channels; + + int16 *tempBuffer = new int16[skipSamples]; + _audStream->readBuffer(tempBuffer, skipSamples); + delete[] tempBuffer; + } +} + +QuickTimeAudioDecoder::AudioSampleDesc::AudioSampleDesc(Common::QuickTimeParser::Track *parentTrack, uint32 codecTag) : Common::QuickTimeParser::SampleDesc(parentTrack, codecTag) { + _channels = 0; + _sampleRate = 0; + _samplesPerFrame = 0; + _bytesPerFrame = 0; + _bitsPerSample = 0; +} + +bool QuickTimeAudioDecoder::AudioSampleDesc::isAudioCodecSupported() const { + // Check if the codec is a supported codec + if (_codecTag == MKTAG('t', 'w', 'o', 's') || _codecTag == MKTAG('r', 'a', 'w', ' ') || _codecTag == MKTAG('i', 'm', 'a', '4')) + return true; + +#ifdef AUDIO_QDM2_H + if (_codecTag == MKTAG('Q', 'D', 'M', '2')) + return true; +#endif + + if (_codecTag == MKTAG('m', 'p', '4', 'a')) { + Common::String audioType; + switch (_parentTrack->objectTypeMP4) { + case 0x40: // AAC +#ifdef USE_FAAD + return true; +#else + audioType = "AAC"; + break; +#endif + default: + audioType = "Unknown"; + break; + } + warning("No MPEG-4 audio (%s) support", audioType.c_str()); + } else + warning("Audio Codec Not Supported: \'%s\'", tag2str(_codecTag)); + + return false; +} + +uint32 QuickTimeAudioDecoder::AudioSampleDesc::getAudioChunkSampleCount(uint chunk) const { + uint32 sampleCount = 0; + + for (uint32 j = 0; j < _parentTrack->sampleToChunkCount; j++) + if (chunk >= _parentTrack->sampleToChunk[j].first) + sampleCount = _parentTrack->sampleToChunk[j].count; + + return sampleCount; +} + +AudioStream *QuickTimeAudioDecoder::AudioSampleDesc::createAudioStream(Common::SeekableReadStream *stream) const { + if (!stream) + return 0; + + if (_codecTag == MKTAG('t', 'w', 'o', 's') || _codecTag == MKTAG('r', 'a', 'w', ' ')) { + // Fortunately, most of the audio used in Myst videos is raw... + uint16 flags = 0; + if (_codecTag == MKTAG('r', 'a', 'w', ' ')) + flags |= FLAG_UNSIGNED; + if (_channels == 2) + flags |= FLAG_STEREO; + if (_bitsPerSample == 16) + flags |= FLAG_16BITS; + uint32 dataSize = stream->size(); + byte *data = (byte *)malloc(dataSize); + stream->read(data, dataSize); + delete stream; + return makeRawStream(data, dataSize, _sampleRate, flags); + } else if (_codecTag == MKTAG('i', 'm', 'a', '4')) { + // Riven uses this codec (as do some Myst ME videos) + return makeADPCMStream(stream, DisposeAfterUse::YES, stream->size(), kADPCMApple, _sampleRate, _channels, 34); + } else if (_codecTag == MKTAG('m', 'p', '4', 'a')) { + // The 7th Guest iOS uses an MPEG-4 codec +#ifdef USE_FAAD + if (_parentTrack->objectTypeMP4 == 0x40) + return makeAACStream(stream, DisposeAfterUse::YES, _parentTrack->extraData); +#endif +#ifdef AUDIO_QDM2_H + } else if (_codecTag == MKTAG('Q', 'D', 'M', '2')) { + // Myst ME uses this codec for many videos + return makeQDM2Stream(stream, _parentTrack->extraData); +#endif + } + + error("Unsupported audio codec"); + + return NULL; +} + +/** + * A wrapper around QuickTimeAudioDecoder that implements the RewindableAudioStream API + */ +class QuickTimeAudioStream : public SeekableAudioStream, public QuickTimeAudioDecoder { +public: + QuickTimeAudioStream() {} + ~QuickTimeAudioStream() {} + + bool openFromFile(const Common::String &filename) { + return QuickTimeAudioDecoder::loadAudioFile(filename) && _audioTrackIndex >= 0 && _audStream; + } + + bool openFromStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeFileHandle) { + return QuickTimeAudioDecoder::loadAudioStream(stream, disposeFileHandle) && _audioTrackIndex >= 0 && _audStream; + } + + // AudioStream API + int readBuffer(int16 *buffer, const int numSamples) { + int samples = 0; + + while (samples < numSamples && !endOfData()) { + if (_audStream->numQueuedStreams() == 0) + queueNextAudioChunk(); + + samples += _audStream->readBuffer(buffer + samples, numSamples - samples); + } + + return samples; + } + + bool isStereo() const { return _audStream->isStereo(); } + int getRate() const { return _audStream->getRate(); } + bool endOfData() const { return _curAudioChunk >= _tracks[_audioTrackIndex]->chunkCount && _audStream->endOfData(); } + + // SeekableAudioStream API + bool seek(const Timestamp &where) { + if (where > getLength()) + return false; + + setAudioStreamPos(where); + return true; + } + + Timestamp getLength() const { + return Timestamp(0, _tracks[_audioTrackIndex]->duration, _tracks[_audioTrackIndex]->timeScale); + } +}; + +SeekableAudioStream *makeQuickTimeStream(const Common::String &filename) { + QuickTimeAudioStream *audioStream = new QuickTimeAudioStream(); + + if (!audioStream->openFromFile(filename)) { + delete audioStream; + return 0; + } + + return audioStream; +} + +SeekableAudioStream *makeQuickTimeStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse) { + QuickTimeAudioStream *audioStream = new QuickTimeAudioStream(); + + if (!audioStream->openFromStream(stream, disposeAfterUse)) { + delete audioStream; + return 0; + } + + return audioStream; +} + +} // End of namespace Audio diff --git a/audio/decoders/quicktime.h b/audio/decoders/quicktime.h new file mode 100644 index 0000000000..ff81ec9390 --- /dev/null +++ b/audio/decoders/quicktime.h @@ -0,0 +1,70 @@ +/* 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 + * Sound decoder used in engines: + * - groovie + * - mohawk + * - sci + */ + +#ifndef AUDIO_QUICKTIME_H +#define AUDIO_QUICKTIME_H + +#include "common/scummsys.h" +#include "common/types.h" + +namespace Common { + class SeekableReadStream; + class String; +} + +namespace Audio { + +class SeekableAudioStream; + +/** + * Try to load a QuickTime sound file from the given file name and create a SeekableAudioStream + * from that data. + * + * @param filename the filename of the file from which to read the data + * @return a new SeekableAudioStream, or NULL, if an error occurred + */ +SeekableAudioStream *makeQuickTimeStream(const Common::String &filename); + +/** + * Try to load a QuickTime sound file from the given seekable stream and create a SeekableAudioStream + * from that data. + * + * @param stream the SeekableReadStream from which to read the data + * @param disposeAfterUse whether to delete the stream after use + * @return a new SeekableAudioStream, or NULL, if an error occurred + */ +SeekableAudioStream *makeQuickTimeStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::YES); + +} // End of namespace Audio + +#endif diff --git a/audio/decoders/quicktime_intern.h b/audio/decoders/quicktime_intern.h new file mode 100644 index 0000000000..f288d5604b --- /dev/null +++ b/audio/decoders/quicktime_intern.h @@ -0,0 +1,99 @@ +/* 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$ + * + */ + +/** + * Internal interface to the QuickTime audio decoder. + * + * This is available so that the QuickTimeVideoDecoder can use + * this directly. + */ + +#ifndef AUDIO_QUICKTIME_INTERN_H +#define AUDIO_QUICKTIME_INTERN_H + +#include "common/quicktime.h" +#include "common/scummsys.h" +#include "common/types.h" + +namespace Common { + class SeekableReadStream; + class String; +} + +namespace Audio { + +class AudioStream; +class QueuingAudioStream; + +class QuickTimeAudioDecoder : public Common::QuickTimeParser { +public: + QuickTimeAudioDecoder(); + virtual ~QuickTimeAudioDecoder(); + + /** + * Load a QuickTime audio file + * @param filename the filename to load + */ + bool loadAudioFile(const Common::String &filename); + + /** + * Load a QuickTime audio file from a SeekableReadStream + * @param stream the stream to load + */ + bool loadAudioStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeFileHandle); + +protected: + class AudioSampleDesc : public Common::QuickTimeParser::SampleDesc { + public: + AudioSampleDesc(Common::QuickTimeParser::Track *parentTrack, uint32 codecTag); + + bool isAudioCodecSupported() const; + uint32 getAudioChunkSampleCount(uint chunk) const; + AudioStream *createAudioStream(Common::SeekableReadStream *stream) const; + + // TODO: Make private in the long run + uint16 _bitsPerSample; + uint16 _channels; + uint32 _sampleRate; + uint32 _samplesPerFrame; + uint32 _bytesPerFrame; + }; + + // Common::QuickTimeParser API + virtual Common::QuickTimeParser::SampleDesc *readSampleDesc(Track *track, uint32 format); + + void init(); + void setAudioStreamPos(const Timestamp &where); + bool isOldDemuxing() const; + void queueNextAudioChunk(); + + int _audioTrackIndex; + uint _curAudioChunk; + QueuingAudioStream *_audStream; +}; + +} // End of namespace Audio + +#endif diff --git a/audio/fmopl.h b/audio/fmopl.h index fbce36f077..b88325a52e 100644 --- a/audio/fmopl.h +++ b/audio/fmopl.h @@ -23,7 +23,10 @@ #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 7beb76352c..5839f5b9d7 100644 --- a/audio/mididrv.cpp +++ b/audio/mididrv.cpp @@ -197,7 +197,7 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) { // detected since they are hard coded and cannot be disabled. for (int l = (flags & (MDT_PREFER_GM | MDT_PREFER_MT32)) ? 1 : 0; l < 2; ++l) { if ((flags & MDT_MIDI) && (l == 1)) { - // If a preferred MT32 or GM device has been selected that device gets returned + // If a preferred MT32 or GM device has been selected that device gets returned. if (flags & MDT_PREFER_MT32) hdl = getDeviceHandle(ConfMan.get("mt32_device")); else if (flags & MDT_PREFER_GM) @@ -207,20 +207,20 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) { const MusicType type = getMusicType(hdl); - // If have a "Don't use GM/MT-32" setting we skip this part and jump + // If we have a "Don't use GM/MT-32" setting we skip this part and jump // to AdLib, PC Speaker etc. detection right away. if (type != MT_NULL) { if (type != MT_AUTO && type != MT_INVALID) { if (flags & MDT_PREFER_MT32) - // If we have a preferred MT32 device we disable the gm/mt32 mapping (more about this in mididrv.h) + // If we have a preferred MT32 device we disable the gm/mt32 mapping (more about this in mididrv.h). _forceTypeMT32 = true; return hdl; } - // If we have no specific device selected (neither in the scummvm nor in the game domain) - // and no preferred MT32 or GM device selected we arrive here. - // If MT32 is preferred we try for the first available device with music type 'MT_MT32' (usually the mt32 emulator) + // If no specific device is selected (neither in the scummvm nor in the game domain) + // and there is no preferred MT32 or GM device selected either we arrive here. + // If MT32 is preferred we try for the first available device with music type 'MT_MT32' (usually the mt32 emulator). if (flags & MDT_PREFER_MT32) { for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) { MusicDevices i = (**m)->getDevices(); @@ -260,7 +260,7 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) { else if (flags & MDT_APPLEIIGS) tp = MT_APPLEIIGS; else if (l == 0) - // if we haven't tried to find a MIDI device yet we do this now. + // If we haven't tried to find a MIDI device yet we do this now. continue; else tp = MT_AUTO; @@ -292,7 +292,7 @@ MidiDriver::DeviceHandle MidiDriver::getDeviceHandle(const Common::String &ident const MusicPlugin::List p = MusicMan.getPlugins(); if (p.begin() == p.end()) - error("Music plugins must be loaded prior to calling this method"); + error("MidiDriver::getDeviceHandle: Music plugins must be loaded prior to calling this method"); for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); m++) { MusicDevices i = (**m)->getDevices(); diff --git a/audio/midiparser_xmidi.cpp b/audio/midiparser_xmidi.cpp index 84e1aa2ec7..7c3cf102d1 100644 --- a/audio/midiparser_xmidi.cpp +++ b/audio/midiparser_xmidi.cpp @@ -237,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/mods/tfmx.cpp b/audio/mods/tfmx.cpp index afc7d3b40b..a89da78af1 100644 --- a/audio/mods/tfmx.cpp +++ b/audio/mods/tfmx.cpp @@ -332,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; @@ -700,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/module.mk b/audio/module.mk index 840b6d6692..46cb9944e1 100644 --- a/audio/module.mk +++ b/audio/module.mk @@ -13,12 +13,15 @@ MODULE_OBJS := \ musicplugin.o \ null.o \ timestamp.o \ + decoders/aac.o \ decoders/adpcm.o \ decoders/aiff.o \ decoders/flac.o \ decoders/iff_sound.o \ decoders/mac_snd.o \ decoders/mp3.o \ + decoders/qdm2.o \ + decoders/quicktime.o \ decoders/raw.o \ decoders/vag.o \ decoders/voc.o \ diff --git a/audio/softsynth/adlib.cpp b/audio/softsynth/adlib.cpp index 60de8fad60..4025a667ac 100644 --- a/audio/softsynth/adlib.cpp +++ b/audio/softsynth/adlib.cpp @@ -857,6 +857,7 @@ void AdLibPercussionChannel::sysEx_customInstrument(uint32 type, const byte *ins // Allocate memory for the new instruments if (!_customInstruments[note]) { _customInstruments[note] = new AdLibInstrument; + memset(_customInstruments[note], 0, sizeof(AdLibInstrument)); } // Save the new instrument data diff --git a/audio/softsynth/fmtowns_pc98/towns_audio.cpp b/audio/softsynth/fmtowns_pc98/towns_audio.cpp index 719bc981ee..beee5f1cad 100644 --- a/audio/softsynth/fmtowns_pc98/towns_audio.cpp +++ b/audio/softsynth/fmtowns_pc98/towns_audio.cpp @@ -28,87 +28,117 @@ #include "common/textconsole.h" #include "backends/audiocd/audiocd.h" +class TownsAudio_WaveTable { +friend class TownsAudioInterfaceInternal; +friend class TownsAudio_PcmChannel; +public: + TownsAudio_WaveTable(); + ~TownsAudio_WaveTable(); + +private: + void readHeader(const uint8 *buffer); + void readData(const uint8 *buffer); + void clear(); + + char name[9]; + int32 id; + uint32 size; + uint32 loopStart; + uint32 loopLen; + uint16 rate; + uint16 rateOffs; + uint16 baseNote; + int8 *data; +}; class TownsAudio_PcmChannel { -friend class TownsAudioInterfaceIntern; public: TownsAudio_PcmChannel(); ~TownsAudio_PcmChannel(); -private: - void loadExtData(uint8 *buffer, uint32 size); - void setupLoop(uint32 start, uint32 len); void clear(); + void loadData(TownsAudio_WaveTable *w); + void loadData(uint8 *buffer, uint32 size); + + int initInstrument(uint8 ¬e, TownsAudio_WaveTable *&tables, int numTables); + void keyOn(uint8 note, uint8 velo, TownsAudio_WaveTable *w); + void keyOff(); + + void updateEnvelopeGenerator(); + + void setInstrument(uint8 *instr); + void setLevel(uint8 lvl); + void setPitch(uint32 pt); + void setBalance(uint8 blc); + + void updateOutput(); + int32 currentSampleLeft(); + int32 currentSampleRight(); + + bool _keyPressed; + bool _reserved; + bool _activeKey; + bool _activeEffect; + bool _activeOutput; + +private: + void setupLoop(uint32 loopStart, uint32 len); + void setNote(uint8 note, TownsAudio_WaveTable *w, bool stepLimit = false); + void setVelo(uint8 velo); + void envAttack(); void envDecay(); void envSustain(); void envRelease(); - uint8 *curInstrument; - uint8 note; - uint8 velo; + uint8 *_curInstrument; - int8 *data; - int8 *dataEnd; + uint8 _note; - int8 *loopEnd; - uint32 loopLen; + uint8 _velo; + uint8 _level; + uint8 _tl; - uint16 stepNote; - uint16 stepPitch; - uint16 step; + uint8 _panLeft; + uint8 _panRight; - uint8 panLeft; - uint8 panRight; + int8 *_data; + int8 *_dataEnd; - uint32 pos; + int8 *_loopEnd; + uint32 _loopLen; - uint8 envTotalLevel; - uint8 envAttackRate; - uint8 envDecayRate; - uint8 envSustainLevel; - uint8 envSustainRate; - uint8 envReleaseRate; + uint16 _stepNote; + uint16 _stepPitch; + uint16 _step; - int16 envStep; - int16 envCurrentLevel; + uint32 _pos; - EnvelopeState envState; + uint8 _envTotalLevel; + uint8 _envAttackRate; + uint8 _envDecayRate; + uint8 _envSustainLevel; + uint8 _envSustainRate; + uint8 _envReleaseRate; + int16 _envStep; + int16 _envCurrentLevel; - int8 *extData; -}; + EnvelopeState _envState; -class TownsAudio_WaveTable { -friend class TownsAudioInterfaceIntern; -public: - TownsAudio_WaveTable(); - ~TownsAudio_WaveTable(); - -private: - void readHeader(const uint8 *buffer); - void readData(const uint8 *buffer); - void clear(); + int8 *_extData; - char name[9]; - int32 id; - uint32 size; - uint32 loopStart; - uint32 loopLen; - uint16 rate; - uint16 rateOffs; - uint16 baseNote; - int8 *data; + static const uint16 _pcmPhase1[]; + static const uint16 _pcmPhase2[]; }; -class TownsAudioInterfaceIntern : public TownsPC98_FmSynth { +class TownsAudioInterfaceInternal : public TownsPC98_FmSynth { public: - TownsAudioInterfaceIntern(Audio::Mixer *mixer, TownsAudioInterfacePluginDriver *driver); - ~TownsAudioInterfaceIntern(); + TownsAudioInterfaceInternal(Audio::Mixer *mixer, TownsAudioInterface *owner, TownsAudioInterfacePluginDriver *driver, bool externalMutexHandling = false); + ~TownsAudioInterfaceInternal(); - static TownsAudioInterfaceIntern *addNewRef(Audio::Mixer *mixer, TownsAudioInterfacePluginDriver *driver); - static void releaseRef(); - bool checkPluginDriver(TownsAudioInterfacePluginDriver *driver); + static TownsAudioInterfaceInternal *addNewRef(Audio::Mixer *mixer, TownsAudioInterface *owner, TownsAudioInterfacePluginDriver *driver, bool externalMutexHandling = false); + static void releaseRef(TownsAudioInterface *owner); bool init(); @@ -122,12 +152,15 @@ public: 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 (TownsAudioInterfaceIntern::*TownsAudioIntfCallback)(va_list &); + typedef int (TownsAudioInterfaceInternal::*TownsAudioIntfCallback)(va_list &); const TownsAudioIntfCallback *_intfOpcodes; int intf_reset(va_list &args); @@ -200,18 +233,8 @@ private: 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; @@ -220,12 +243,12 @@ private: 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; @@ -237,28 +260,27 @@ private: int _pcmSfxChanMask; TownsAudioInterfacePluginDriver *_drv; + void *_drvOwner; bool _ready; - static TownsAudioInterfaceIntern *_refInstance; + 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[]; }; -TownsAudioInterfaceIntern::TownsAudioInterfaceIntern(Audio::Mixer *mixer, TownsAudioInterfacePluginDriver *driver) : TownsPC98_FmSynth(mixer, kTypeTowns), +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), + _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), _ready(false) { + _outputVolumeFlags(0), _fmChanPlaying(0), + _numReservedChannels(0), _numWaveTables(0), _updateOutputVol(false), _ready(false) { -#define INTCB(x) &TownsAudioInterfaceIntern::intf_##x +#define INTCB(x) &TownsAudioInterfaceInternal::intf_##x static const TownsAudioIntfCallback intfCb[] = { // 0 INTCB(reset), @@ -371,9 +393,6 @@ TownsAudioInterfaceIntern::TownsAudioInterfaceIntern(Audio::Mixer *mixer, TownsA 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)); @@ -381,10 +400,12 @@ TownsAudioInterfaceIntern::TownsAudioInterfaceIntern(Audio::Mixer *mixer, TownsA _tickLength = 2 * _timerBase; } -TownsAudioInterfaceIntern::~TownsAudioInterfaceIntern() { +TownsAudioInterfaceInternal::~TownsAudioInterfaceInternal() { _ready = false; deinit(); + Common::StackLock lock(_mutex); + delete[] _fmSaveReg[0]; delete[] _fmSaveReg[1]; delete[] _fmInstruments; @@ -393,47 +414,34 @@ TownsAudioInterfaceIntern::~TownsAudioInterfaceIntern() { delete[] _pcmChan; } -TownsAudioInterfaceIntern *TownsAudioInterfaceIntern::addNewRef(Audio::Mixer *mixer, TownsAudioInterfacePluginDriver *driver) { +TownsAudioInterfaceInternal *TownsAudioInterfaceInternal::addNewRef(Audio::Mixer *mixer, TownsAudioInterface *owner, TownsAudioInterfacePluginDriver *driver, bool externalMutexHandling) { _refCount++; if (_refCount == 1 && _refInstance == 0) - _refInstance = new TownsAudioInterfaceIntern(mixer, driver); + _refInstance = new TownsAudioInterfaceInternal(mixer, owner, driver, externalMutexHandling); else if (_refCount < 2 || _refInstance == 0) - error("TownsAudioInterfaceIntern::addNewRef(): Internal reference management failure"); - else if (!_refInstance->checkPluginDriver(driver)) - error("TownsAudioInterfaceIntern::addNewRef(): Plugin driver conflict"); + error("TownsAudioInterfaceInternal::addNewRef(): Internal reference management failure"); + else if (!_refInstance->assignPluginDriver(owner, driver, externalMutexHandling)) + error("TownsAudioInterfaceInternal::addNewRef(): Plugin driver conflict"); return _refInstance; } -void TownsAudioInterfaceIntern::releaseRef() { +void TownsAudioInterfaceInternal::releaseRef(TownsAudioInterface *owner) { if (!_refCount) return; _refCount--; - if (!_refCount) { + if (_refCount) { + if (_refInstance) + _refInstance->removePluginDriver(owner); + } else { delete _refInstance; _refInstance = 0; } } -bool TownsAudioInterfaceIntern::checkPluginDriver(TownsAudioInterfacePluginDriver *driver) { - if (_refCount <= 1) - return true; - - if (_drv) { - if (driver && driver != _drv) - return false; - } else { - lock(); - _drv = driver; - unlock(); - } - - return true; -} - -bool TownsAudioInterfaceIntern::init() { +bool TownsAudioInterfaceInternal::init() { if (_ready) return true; @@ -457,7 +465,7 @@ bool TownsAudioInterfaceIntern::init() { return true; } -int TownsAudioInterfaceIntern::callback(int command, ...) { +int TownsAudioInterfaceInternal::callback(int command, ...) { if (!_ready) return 1; @@ -470,79 +478,95 @@ int TownsAudioInterfaceIntern::callback(int command, ...) { return res; } -int TownsAudioInterfaceIntern::processCommand(int command, va_list &args) { +int TownsAudioInterfaceInternal::processCommand(int command, va_list &args) { if (!_ready) return 1; if (command < 0 || command > 81) return 4; - lock(); + Common::StackLock lock(_mutex); int res = (this->*_intfOpcodes[command])(args); - unlock(); return res; } -void TownsAudioInterfaceIntern::setMusicVolume(int volume) { +void TownsAudioInterfaceInternal::setMusicVolume(int volume) { _musicVolume = CLIP<uint16>(volume, 0, Audio::Mixer::kMaxMixerVolume); setVolumeIntern(_musicVolume, _sfxVolume); } -void TownsAudioInterfaceIntern::setSoundEffectVolume(int volume) { +void TownsAudioInterfaceInternal::setSoundEffectVolume(int volume) { _sfxVolume = CLIP<uint16>(volume, 0, Audio::Mixer::kMaxMixerVolume); setVolumeIntern(_musicVolume, _sfxVolume); } -void TownsAudioInterfaceIntern::setSoundEffectChanMask(int mask) { +void TownsAudioInterfaceInternal::setSoundEffectChanMask(int mask) { _pcmSfxChanMask = mask >> 6; mask &= 0x3f; setVolumeChannelMasks(~mask, mask); } -void TownsAudioInterfaceIntern::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) { _timer -= 0x514767; - for (int ii = 0; ii < 8; ii++) { - if ((_pcmChanKeyPlaying & _chanFlags[ii]) || (_pcmChanEffectPlaying & _chanFlags[ii])) { - TownsAudio_PcmChannel *s = &_pcmChan[ii]; - s->pos += s->step; - - if (&s->data[s->pos >> 11] >= s->loopEnd) { - if (s->loopLen) { - s->pos -= s->loopLen; - } else { - s->pos = 0; - _pcmChanEffectPlaying &= ~_chanFlags[ii]; - _pcmChanKeyPlaying &= ~_chanFlags[ii]; - } - } - } - } + for (int ii = 0; ii < 8; ii++) + _pcmChan[ii].updateOutput(); } int32 finOutL = 0; int32 finOutR = 0; for (int ii = 0; ii < 8; ii++) { - if (_pcmChanOut & _chanFlags[ii]) { - int32 o = _pcmChan[ii].data[_pcmChan[ii].pos >> 11] * _pcmChan[ii].velo; - if ((1 << ii) & (~_pcmSfxChanMask)) - o = (o * _musicVolume) / Audio::Mixer::kMaxMixerVolume; - if ((1 << ii) & _pcmSfxChanMask) - o = (o * _sfxVolume) / Audio::Mixer::kMaxMixerVolume; - if (_pcmChan[ii].panLeft) - finOutL += ((o * _pcmChan[ii].panLeft) >> 3); - if (_pcmChan[ii].panRight) - finOutR += ((o * _pcmChan[ii].panRight) >> 3); - if (!((_pcmChanKeyPlaying & _chanFlags[ii]) || (_pcmChanEffectPlaying & _chanFlags[ii]))) - _pcmChanOut &= ~_chanFlags[ii]; + if (_pcmChan[ii]._activeOutput) { + int32 oL = _pcmChan[ii].currentSampleLeft(); + int32 oR = _pcmChan[ii].currentSampleRight(); + if ((1 << ii) & (~_pcmSfxChanMask)) { + oL = (oR * _musicVolume) / Audio::Mixer::kMaxMixerVolume; + oR = (oR * _musicVolume) / Audio::Mixer::kMaxMixerVolume; + } + if ((1 << ii) & _pcmSfxChanMask) { + oL = (oL * _sfxVolume) / Audio::Mixer::kMaxMixerVolume; + oR = (oR * _sfxVolume) / Audio::Mixer::kMaxMixerVolume; + } + finOutL += oL; + finOutR += oR; + + if (!(_pcmChan[ii]._activeKey || _pcmChan[ii]._activeEffect)) + _pcmChan[ii]._activeOutput = false; } } @@ -551,12 +575,12 @@ void TownsAudioInterfaceIntern::nextTickEx(int32 *buffer, uint32 bufferSize) { } } -void TownsAudioInterfaceIntern::timerCallbackA() { +void TownsAudioInterfaceInternal::timerCallbackA() { if (_drv && _ready) _drv->timerCallback(0); } -void TownsAudioInterfaceIntern::timerCallbackB() { +void TownsAudioInterfaceInternal::timerCallbackB() { if (_ready) { if (_drv) _drv->timerCallback(1); @@ -564,62 +588,62 @@ void TownsAudioInterfaceIntern::timerCallbackB() { } } -int TownsAudioInterfaceIntern::intf_reset(va_list &args) { +int TownsAudioInterfaceInternal::intf_reset(va_list &args) { fmReset(); pcmReset(); callback(68); return 0; } -int TownsAudioInterfaceIntern::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 TownsAudioInterfaceIntern::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 TownsAudioInterfaceIntern::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 TownsAudioInterfaceIntern::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 TownsAudioInterfaceIntern::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 TownsAudioInterfaceIntern::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 TownsAudioInterfaceIntern::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 TownsAudioInterfaceIntern::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 TownsAudioInterfaceIntern::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); @@ -630,7 +654,7 @@ int TownsAudioInterfaceIntern::intf_writeReg(va_list &args) { return 0; } -int TownsAudioInterfaceIntern::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); @@ -642,7 +666,7 @@ int TownsAudioInterfaceIntern::intf_writeRegBuffer(va_list &args) { return 0; } -int TownsAudioInterfaceIntern::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 *); @@ -655,7 +679,7 @@ int TownsAudioInterfaceIntern::intf_readRegBuffer(va_list &args) { return 0; } -int TownsAudioInterfaceIntern::intf_setTimerA(va_list &args) { +int TownsAudioInterfaceInternal::intf_setTimerA(va_list &args) { int enable = va_arg(args, int); int tempo = va_arg(args, int); @@ -670,7 +694,7 @@ int TownsAudioInterfaceIntern::intf_setTimerA(va_list &args) { return 0; } -int TownsAudioInterfaceIntern::intf_setTimerB(va_list &args) { +int TownsAudioInterfaceInternal::intf_setTimerB(va_list &args) { int enable = va_arg(args, int); int tempo = va_arg(args, int); @@ -684,17 +708,17 @@ int TownsAudioInterfaceIntern::intf_setTimerB(va_list &args) { return 0; } -int TownsAudioInterfaceIntern::intf_enableTimerA(va_list &args) { +int TownsAudioInterfaceInternal::intf_enableTimerA(va_list &args) { bufferedWriteReg(0, 0x27, _fmSaveReg[0][0x27] | 0x15); return 0; } -int TownsAudioInterfaceIntern::intf_enableTimerB(va_list &args) { +int TownsAudioInterfaceInternal::intf_enableTimerB(va_list &args) { bufferedWriteReg(0, 0x27, _fmSaveReg[0][0x27] | 0x2a); return 0; } -int TownsAudioInterfaceIntern::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*); @@ -717,7 +741,7 @@ int TownsAudioInterfaceIntern::intf_loadSamples(va_list &args) { return 0; } -int TownsAudioInterfaceIntern::intf_reserveEffectChannels(va_list &args) { +int TownsAudioInterfaceInternal::intf_reserveEffectChannels(va_list &args) { int numChan = va_arg(args, int); if (numChan > 8) return 3; @@ -729,27 +753,24 @@ int TownsAudioInterfaceIntern::intf_reserveEffectChannels(va_list &args) { if (numChan < _numReservedChannels) { int c = 8 - _numReservedChannels; - for (int i = numChan; i; i--) { - uint8 f = ~_chanFlags[c--]; - _pcmChanEffectPlaying &= f; - } + for (int i = numChan; i; i--) + _pcmChan[c--]._activeEffect = false; } else { int c = 7 - _numReservedChannels; for (int i = numChan - _numReservedChannels; i; i--) { - uint8 f = ~_chanFlags[c--]; - _pcmChanKeyPressed &= f; - _pcmChanKeyPlaying &= f; + _pcmChan[c]._keyPressed = false; + _pcmChan[c--]._activeKey = false; } } - static const uint8 reserveChanFlags[] = { 0x00, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE, 0xFF }; _numReservedChannels = numChan; - _pcmChanReserved = reserveChanFlags[_numReservedChannels]; + for (int i = 0; i < 8; i++) + _pcmChan[i]._reserved = i >= (8 - _numReservedChannels) ? true : false; return 0; } -int TownsAudioInterfaceIntern::intf_loadWaveTable(va_list &args) { +int TownsAudioInterfaceInternal::intf_loadWaveTable(va_list &args) { uint8 *data = va_arg(args, uint8 *); if (_numWaveTables > 127) return 3; @@ -776,7 +797,7 @@ int TownsAudioInterfaceIntern::intf_loadWaveTable(va_list &args) { return 0; } -int TownsAudioInterfaceIntern::intf_unloadWaveTable(va_list &args) { +int TownsAudioInterfaceInternal::intf_unloadWaveTable(va_list &args) { int id = va_arg(args, int); if (id == -1) { @@ -803,7 +824,7 @@ int TownsAudioInterfaceIntern::intf_unloadWaveTable(va_list &args) { return 0; } -int TownsAudioInterfaceIntern::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); @@ -817,10 +838,10 @@ int TownsAudioInterfaceIntern::intf_pcmPlayEffect(va_list &args) { chan -= 0x40; - if (!(_pcmChanReserved & _chanFlags[chan])) + if (!_pcmChan[chan]._reserved) return 7; - if ((_pcmChanEffectPlaying & _chanFlags[chan])) + if (_pcmChan[chan]._activeEffect) return 2; TownsAudio_WaveTable w; @@ -834,87 +855,74 @@ int TownsAudioInterfaceIntern::intf_pcmPlayEffect(va_list &args) { TownsAudio_PcmChannel *p = &_pcmChan[chan]; - _pcmChanNote[chan] = note; - _pcmChanVelo[chan] = velo; - - p->note = note; - p->velo = velo << 1; - - p->loadExtData(data + 32, w.size); - p->setupLoop(w.loopStart, w.loopLen); - - pcmCalcPhaseStep(p, &w); - if (p->step > 2048) - p->step = 2048; - - _pcmChanEffectPlaying |= _chanFlags[chan]; - _pcmChanOut |= _chanFlags[chan]; + p->loadData(data + 32, w.size); + p->keyOn(note, velo, &w); return 0; } -int TownsAudioInterfaceIntern::intf_pcmChanOff(va_list &args) { +int TownsAudioInterfaceInternal::intf_pcmChanOff(va_list &args) { int chan = va_arg(args, int); pcmChanOff(chan); return 0; } -int TownsAudioInterfaceIntern::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; chan -= 0x40; - return (_pcmChanEffectPlaying & _chanFlags[chan]) ? 1 : 0; + return _pcmChan[chan]._activeEffect ? 1 : 0; } -int TownsAudioInterfaceIntern::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 TownsAudioInterfaceIntern::intf_fmKeyOff(va_list &args) { +int TownsAudioInterfaceInternal::intf_fmKeyOff(va_list &args) { int chan = va_arg(args, int); return fmKeyOff(chan); } -int TownsAudioInterfaceIntern::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 TownsAudioInterfaceIntern::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 TownsAudioInterfaceIntern::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 TownsAudioInterfaceIntern::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 TownsAudioInterfaceIntern::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 TownsAudioInterfaceIntern::intf_fmReset(va_list &args) { +int TownsAudioInterfaceInternal::intf_fmReset(va_list &args) { fmReset(); return 0; } -int TownsAudioInterfaceIntern::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); @@ -951,14 +959,14 @@ int TownsAudioInterfaceIntern::intf_setOutputVolume(va_list &args) { return 0; } -int TownsAudioInterfaceIntern::intf_resetOutputVolume(va_list &args) { +int TownsAudioInterfaceInternal::intf_resetOutputVolume(va_list &args) { memset(_outputLevel, 0, sizeof(_outputLevel)); _outputVolumeFlags = 0; updateOutputVolume(); return 0; } -int TownsAudioInterfaceIntern::intf_getOutputVolume(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*); @@ -978,7 +986,7 @@ int TownsAudioInterfaceIntern::intf_getOutputVolume(va_list &args) { return 0; } -int TownsAudioInterfaceIntern::intf_setOutputMute(va_list &args) { +int TownsAudioInterfaceInternal::intf_setOutputMute(va_list &args) { int flags = va_arg(args, int); _outputVolumeFlags = flags; uint8 mute = flags & 3; @@ -1007,31 +1015,31 @@ int TownsAudioInterfaceIntern::intf_setOutputMute(va_list &args) { return 0; } -int TownsAudioInterfaceIntern::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 TownsAudioInterfaceIntern::intf_getOutputVolume2(va_list &args) { +int TownsAudioInterfaceInternal::intf_getOutputVolume2(va_list &args) { return 0; } -int TownsAudioInterfaceIntern::intf_getOutputMute (va_list &args) { +int TownsAudioInterfaceInternal::intf_getOutputMute (va_list &args) { return 0; } -int TownsAudioInterfaceIntern::intf_pcmUpdateEnvelopeGenerator(va_list &args) { +int TownsAudioInterfaceInternal::intf_pcmUpdateEnvelopeGenerator(va_list &args) { for (int i = 0; i < 8; i++) - pcmUpdateEnvelopeGenerator(i); + _pcmChan[i].updateEnvelopeGenerator(); return 0; } -int TownsAudioInterfaceIntern::intf_notImpl(va_list &args) { +int TownsAudioInterfaceInternal::intf_notImpl(va_list &args) { return 4; } -void TownsAudioInterfaceIntern::fmReset() { +void TownsAudioInterfaceInternal::fmReset() { TownsPC98_FmSynth::reset(); _fmChanPlaying = 0; @@ -1059,7 +1067,7 @@ void TownsAudioInterfaceIntern::fmReset() { } } -int TownsAudioInterfaceIntern::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)) @@ -1139,7 +1147,7 @@ int TownsAudioInterfaceIntern::fmKeyOn(int chan, int note, int velo) { return 0; } -int TownsAudioInterfaceIntern::fmKeyOff(int chan) { +int TownsAudioInterfaceInternal::fmKeyOff(int chan) { if (chan > 5) return 1; _fmChanPlaying &= ~_chanFlags[chan]; @@ -1149,7 +1157,7 @@ int TownsAudioInterfaceIntern::fmKeyOff(int chan) { return 0; } -int TownsAudioInterfaceIntern::fmChanOff(int chan) { +int TownsAudioInterfaceInternal::fmChanOff(int chan) { if (chan > 5) return 1; _fmChanPlaying &= ~_chanFlags[chan]; @@ -1167,7 +1175,7 @@ int TownsAudioInterfaceIntern::fmChanOff(int chan) { return 0; } -int TownsAudioInterfaceIntern::fmSetPanPos(int chan, int value) { +int TownsAudioInterfaceInternal::fmSetPanPos(int chan, int value) { if (chan > 5) return 1; @@ -1186,7 +1194,7 @@ int TownsAudioInterfaceIntern::fmSetPanPos(int chan, int value) { return 0; } -int TownsAudioInterfaceIntern::fmSetInstrument(int chan, int instrId) { +int TownsAudioInterfaceInternal::fmSetInstrument(int chan, int instrId) { if (chan > 5) return 1; if (instrId > 127) @@ -1230,7 +1238,7 @@ int TownsAudioInterfaceIntern::fmSetInstrument(int chan, int instrId) { return 0; } -int TownsAudioInterfaceIntern::fmLoadInstrument(int instrId, const uint8 *data) { +int TownsAudioInterfaceInternal::fmLoadInstrument(int instrId, const uint8 *data) { if (instrId > 127) return 3; assert(data); @@ -1238,7 +1246,7 @@ int TownsAudioInterfaceIntern::fmLoadInstrument(int instrId, const uint8 *data) return 0; } -int TownsAudioInterfaceIntern::fmSetPitch(int chan, int pitch) { +int TownsAudioInterfaceInternal::fmSetPitch(int chan, int pitch) { if (chan > 5) return 1; @@ -1325,7 +1333,7 @@ int TownsAudioInterfaceIntern::fmSetPitch(int chan, int pitch) { return 0; } -int TownsAudioInterfaceIntern::fmSetLevel(int chan, int lvl) { +int TownsAudioInterfaceInternal::fmSetLevel(int chan, int lvl) { if (chan > 5) return 1; if (lvl > 127) @@ -1348,20 +1356,14 @@ int TownsAudioInterfaceIntern::fmSetLevel(int chan, int lvl) { return 0; } -void TownsAudioInterfaceIntern::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 TownsAudioInterfaceIntern::pcmReset() { - _pcmChanOut = 0; - _pcmChanReserved = _pcmChanKeyPressed = _pcmChanEffectPlaying = _pcmChanKeyPlaying = 0; +void TownsAudioInterfaceInternal::pcmReset() { _numReservedChannels = 0; - memset(_pcmChanNote, 0, 8); - memset(_pcmChanVelo, 0, 8); - memset(_pcmChanLevel, 0, 8); - for (int i = 0; i < 8; i++) _pcmChan[i].clear(); @@ -1381,7 +1383,7 @@ void TownsAudioInterfaceIntern::pcmReset() { } } -int TownsAudioInterfaceIntern::pcmKeyOn(int chan, int note, int velo) { +int TownsAudioInterfaceInternal::pcmKeyOn(int chan, int note, int velo) { if (chan < 0x40 || chan > 0x47) return 1; @@ -1389,94 +1391,43 @@ int TownsAudioInterfaceIntern::pcmKeyOn(int chan, int note, int velo) { return 3; chan -= 0x40; - - if ((_pcmChanReserved & _chanFlags[chan]) || (_pcmChanKeyPressed & _chanFlags[chan])) - return 2; - - _pcmChanNote[chan] = note; - _pcmChanVelo[chan] = velo; - + uint8 noteT = note; TownsAudio_PcmChannel *p = &_pcmChan[chan]; - p->note = note; - uint8 *instr = _pcmChan[chan].curInstrument; - int i = 0; - for (; i < 8; i++) { - if (note <= instr[16 + 2 * i]) - break; - } - - if (i == 8) - return 8; - - int il = i << 3; - p->note += instr[il + 70]; - - p->envTotalLevel = instr[il + 64]; - p->envAttackRate = instr[il + 65]; - p->envDecayRate = instr[il + 66]; - p->envSustainLevel = instr[il + 67]; - p->envSustainRate = instr[il + 68]; - p->envReleaseRate = instr[il + 69]; - p->envStep = 0; - - int32 id = (int32)READ_LE_UINT32(&instr[i * 4 + 32]); - - for (i = 0; i < _numWaveTables; i++) { - if (id == _waveTables[i].id) - break; - } - - if (i == _numWaveTables) - return 9; - - TownsAudio_WaveTable *w = &_waveTables[i]; - - p->data = w->data; - p->dataEnd = w->data + w->size; - p->setupLoop(w->loopStart, w->loopLen); - - pcmCalcPhaseStep(p, w); - - uint32 lvl = _pcmChanLevel[chan] * _pcmChanVelo[chan]; - p->envTotalLevel = ((p->envTotalLevel * lvl) >> 14) & 0xff; - p->envSustainLevel = ((p->envSustainLevel * lvl) >> 14) & 0xff; + if (p->_reserved || p->_keyPressed) + return 2; - p->envAttack(); - p->velo = (p->envCurrentLevel >> 8) << 1; + TownsAudio_WaveTable *w = _waveTables; + int res = p->initInstrument(noteT, w, _numWaveTables); + if (res) + return res; - _pcmChanKeyPressed |= _chanFlags[chan]; - _pcmChanKeyPlaying |= _chanFlags[chan]; - _pcmChanOut |= _chanFlags[chan]; + p->loadData(w); + p->keyOn(noteT, velo, w); return 0; } -int TownsAudioInterfaceIntern::pcmKeyOff(int chan) { +int TownsAudioInterfaceInternal::pcmKeyOff(int chan) { if (chan < 0x40 || chan > 0x47) return 1; chan -= 0x40; - _pcmChanKeyPressed &= ~_chanFlags[chan]; - _pcmChan[chan].envRelease(); + _pcmChan[chan].keyOff(); return 0; } -int TownsAudioInterfaceIntern::pcmChanOff(int chan) { +int TownsAudioInterfaceInternal::pcmChanOff(int chan) { if (chan < 0x40 || chan > 0x47) return 1; chan -= 0x40; - - _pcmChanKeyPressed &= ~_chanFlags[chan]; - _pcmChanEffectPlaying &= ~_chanFlags[chan]; - _pcmChanKeyPlaying &= ~_chanFlags[chan]; - _pcmChanOut &= ~_chanFlags[chan]; + _pcmChan[chan]._keyPressed = _pcmChan[chan]._activeEffect = _pcmChan[chan]._activeKey = _pcmChan[chan]._activeOutput = false; return 0; } -int TownsAudioInterfaceIntern::pcmSetPanPos(int chan, int mode) { +int TownsAudioInterfaceInternal::pcmSetPanPos(int chan, int mode) { if (chan > 0x47) return 1; if (mode & 0x80) @@ -1493,23 +1444,23 @@ int TownsAudioInterfaceIntern::pcmSetPanPos(int chan, int mode) { blc = ((119 + mode) ^ (mode << 4)) & 0xff; } - _pcmChan[chan].panLeft = blc & 0x0f; - _pcmChan[chan].panRight = blc >> 4; + _pcmChan[chan].setBalance(blc); return 0; } -int TownsAudioInterfaceIntern::pcmSetInstrument(int chan, int instrId) { +int TownsAudioInterfaceInternal::pcmSetInstrument(int chan, int instrId) { if (chan > 0x47) return 1; if (instrId > 31) return 3; chan -= 0x40; - _pcmChan[chan].curInstrument = &_pcmInstruments[instrId * 128]; + _pcmChan[chan].setInstrument(&_pcmInstruments[instrId * 128]); + return 0; } -int TownsAudioInterfaceIntern::pcmLoadInstrument(int instrId, const uint8 *data) { +int TownsAudioInterfaceInternal::pcmLoadInstrument(int instrId, const uint8 *data) { if (instrId > 31) return 3; assert(data); @@ -1517,7 +1468,7 @@ int TownsAudioInterfaceIntern::pcmLoadInstrument(int instrId, const uint8 *data) return 0; } -int TownsAudioInterfaceIntern::pcmSetPitch(int chan, int pitch) { +int TownsAudioInterfaceInternal::pcmSetPitch(int chan, int pitch) { if (chan > 0x47) return 1; @@ -1534,20 +1485,12 @@ int TownsAudioInterfaceIntern::pcmSetPitch(int chan, int pitch) { else if (pitch > 0) pts = (((pitch + 0x2001) << 16) / 0x2000) >> 2; - p->stepPitch = pts & 0xffff; - p->step = (p->stepNote * p->stepPitch) >> 14; - -// if (_pcmChanUnkFlag & _chanFlags[chan]) -// unk[chan] = (((p->step * 1000) << 11) / 98) / 20833; - - /*else*/ - if ((_pcmChanEffectPlaying & _chanFlags[chan]) && (p->step > 2048)) - p->step = 2048; + p->setPitch(pts); return 0; } -int TownsAudioInterfaceIntern::pcmSetLevel(int chan, int lvl) { +int TownsAudioInterfaceInternal::pcmSetLevel(int chan, int lvl) { if (chan > 0x47) return 1; @@ -1555,99 +1498,21 @@ int TownsAudioInterfaceIntern::pcmSetLevel(int chan, int lvl) { return 3; chan -= 0x40; - TownsAudio_PcmChannel *p = &_pcmChan[chan]; - - if (_pcmChanReserved & _chanFlags[chan]) { - _pcmChanVelo[chan] = lvl; - p->velo = lvl << 1; - } else { - int32 t = p->envStep * lvl; - if (_pcmChanLevel[chan]) - t /= _pcmChanLevel[chan]; - p->envStep = t; - t = p->envCurrentLevel * lvl; - if (_pcmChanLevel[chan]) - t /= _pcmChanLevel[chan]; - p->envCurrentLevel = t; - _pcmChanLevel[chan] = lvl; - p->velo = p->envCurrentLevel >> 8; - } + _pcmChan[chan].setLevel(lvl); return 0; } -void TownsAudioInterfaceIntern::pcmUpdateEnvelopeGenerator(int chan) { - TownsAudio_PcmChannel *p = &_pcmChan[chan]; - if (!p->envCurrentLevel) { - _pcmChanKeyPlaying &= ~_chanFlags[chan]; - p->envState = kEnvReady; - } - - if (!(_pcmChanKeyPlaying & _chanFlags[chan])) - return; - - switch (p->envState) { - case kEnvAttacking: - if (((p->envCurrentLevel + p->envStep) >> 8) > p->envTotalLevel) { - p->envDecay(); - return; - } else { - p->envCurrentLevel += p->envStep; - } - break; - - case kEnvDecaying: - if (((p->envCurrentLevel - p->envStep) >> 8) < p->envSustainLevel) { - p->envSustain(); - return; - } else { - p->envCurrentLevel -= p->envStep; - } - break; - - case kEnvSustaining: - case kEnvReleasing: - p->envCurrentLevel -= p->envStep; - if (p->envCurrentLevel <= 0) - p->envCurrentLevel = 0; - break; - - default: - break; - } - p->velo = (p->envCurrentLevel >> 8) << 1; +void TownsAudioInterfaceInternal::updateOutputVolume() { + // Avoid calls to g_system->getAudioCDManager() functions from the main thread + // since this can cause mutex lockups. + _updateOutputVol = true; } -void TownsAudioInterfaceIntern::pcmCalcPhaseStep(TownsAudio_PcmChannel *p, TownsAudio_WaveTable *w) { - int8 diff = p->note - w->baseNote; - uint16 r = w->rate + w->rateOffs; - uint16 bl = 0; - uint32 s = 0; - - if (diff < 0) { - diff *= -1; - bl = diff % 12; - diff /= 12; - s = (r >> diff); - if (bl) - s = (s * _pcmPhase2[bl]) >> 16; - - } else if (diff > 0) { - bl = diff % 12; - diff /= 12; - s = (r << diff); - if (bl) - s += ((s * _pcmPhase1[bl]) >> 16); - - } else { - s = r; - } - - p->stepNote = s & 0xffff; - p->step = (s * p->stepPitch) >> 14; -} +void TownsAudioInterfaceInternal::updateOutputVolumeInternal() { + if (!_ready) + return; -void TownsAudioInterfaceIntern::updateOutputVolume() { // 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 @@ -1660,41 +1525,35 @@ void TownsAudioInterfaceIntern::updateOutputVolume() { g_system->getAudioCDManager()->setVolume(volume); g_system->getAudioCDManager()->setBalance(balance); + + _updateOutputVol = false; } -TownsAudioInterfaceIntern *TownsAudioInterfaceIntern::_refInstance = 0; +TownsAudioInterfaceInternal *TownsAudioInterfaceInternal::_refInstance = 0; -int TownsAudioInterfaceIntern::_refCount = 0; +int TownsAudioInterfaceInternal::_refCount = 0; -const uint8 TownsAudioInterfaceIntern::_chanFlags[] = { +const uint8 TownsAudioInterfaceInternal::_chanFlags[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; -const uint16 TownsAudioInterfaceIntern::_frequency[] = { +const uint16 TownsAudioInterfaceInternal::_frequency[] = { 0x028C, 0x02B4, 0x02DC, 0x030A, 0x0338, 0x0368, 0x039C, 0x03D4, 0x040E, 0x044A, 0x048C, 0x04D0 }; -const uint8 TownsAudioInterfaceIntern::_carrier[] = { +const uint8 TownsAudioInterfaceInternal::_carrier[] = { 0x10, 0x10, 0x10, 0x10, 0x30, 0x70, 0x70, 0xF0 }; -const uint8 TownsAudioInterfaceIntern::_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 TownsAudioInterfaceIntern::_pcmPhase1[] = { - 0x879B, 0x0F37, 0x1F58, 0x306E, 0x4288, 0x55B6, 0x6A08, 0x7F8F, 0x965E, 0xAE88, 0xC882, 0xE341 -}; - -const uint16 TownsAudioInterfaceIntern::_pcmPhase2[] = { - 0xFEFE, 0xF1A0, 0xE411, 0xD744, 0xCB2F, 0xBFC7, 0xB504, 0xAAE2, 0xA144, 0x9827, 0x8FAC -}; - TownsAudio_PcmChannel::TownsAudio_PcmChannel() { - extData = 0; + _extData = 0; clear(); } @@ -1702,97 +1561,313 @@ TownsAudio_PcmChannel::~TownsAudio_PcmChannel() { clear(); } -void TownsAudio_PcmChannel::loadExtData(uint8 *buffer, uint32 size) { - delete[] extData; - extData = new int8[size]; +void TownsAudio_PcmChannel::clear() { + _curInstrument = 0; + _note = _tl = _level = _velo = 0; + + _data = 0; + _dataEnd = 0; + _loopLen = 0; + + _pos = 0; + _loopEnd = 0; + + _step = 0; + _stepNote = 0x4000; + _stepPitch = 0x4000; + + _panLeft = _panRight = 7; + + _envTotalLevel = _envAttackRate = _envDecayRate = _envSustainLevel = _envSustainRate = _envReleaseRate = 0; + _envStep = _envCurrentLevel = 0; + + _envState = kEnvReady; + + _activeKey = _activeEffect = _activeOutput = _keyPressed = _reserved = false; + + delete[] _extData; + _extData = 0; +} + +void TownsAudio_PcmChannel::loadData(TownsAudio_WaveTable *w) { + _data = w->data; + _dataEnd = w->data + w->size; +} + +void TownsAudio_PcmChannel::loadData(uint8 *buffer, uint32 size) { + delete[] _extData; + _extData = new int8[size]; int8 *src = (int8 *)buffer; - int8 *dst = extData; + int8 *dst = _extData; for (uint32 i = 0; i < size; i++) *dst++ = *src & 0x80 ? (*src++ & 0x7f) : -*src++; - data = extData; - dataEnd = extData + size; - pos = 0; + _data = _extData; + _dataEnd = _extData + size; + _pos = 0; } -void TownsAudio_PcmChannel::setupLoop(uint32 start, uint32 len) { - loopLen = len << 11; - loopEnd = loopLen ? &data[(start + loopLen) >> 11] : dataEnd; - pos = start; +int TownsAudio_PcmChannel::initInstrument(uint8 ¬e, TownsAudio_WaveTable *&tables, int numTables) { + int i = 0; + for (; i < 8; i++) { + if (note <= _curInstrument[16 + 2 * i]) + break; + } + + if (i == 8) + return 8; + + uint8 *d = &_curInstrument[(i << 3) + 64]; + _envTotalLevel = d[0]; + _envAttackRate = d[1]; + _envDecayRate = d[2]; + _envSustainLevel = d[3]; + _envSustainRate = d[4]; + _envReleaseRate = d[5]; + _envStep = 0; + note += d[6]; + + int32 id = (int32)READ_LE_UINT32(&_curInstrument[i * 4 + 32]); + + for (i = 0; i < numTables; i++) { + if (id == tables[i].id) + break; + } + + if (i == numTables) + return 9; + + tables = &tables[i]; + return 0; } -void TownsAudio_PcmChannel::clear() { - curInstrument = 0; - note = 0; - velo = 0; +void TownsAudio_PcmChannel::keyOn(uint8 note, uint8 velo, TownsAudio_WaveTable *w) { + setupLoop(w->loopStart, w->loopLen); + setNote(note, w, _reserved); + setVelo(velo); - data = 0; - dataEnd = 0; - loopLen = 0; + if (_reserved) + _activeEffect = true; + else + _keyPressed = _activeKey = true; + + _activeOutput = true; +} - pos = 0; - loopEnd = 0; +void TownsAudio_PcmChannel::keyOff() { + _keyPressed = false; + envRelease(); +} - step = 0; - stepNote = 0x4000; - stepPitch = 0x4000; +void TownsAudio_PcmChannel::updateEnvelopeGenerator() { + if (!_envCurrentLevel) { + _activeKey = false; + _envState = kEnvReady; + } - panLeft = panRight = 7; + if (!_activeKey) + return; - envTotalLevel = envAttackRate = envDecayRate = envSustainLevel = envSustainRate = envReleaseRate = 0; - envStep = envCurrentLevel = 0; + switch (_envState) { + case kEnvAttacking: + if (((_envCurrentLevel + _envStep) >> 8) > _envTotalLevel) { + envDecay(); + return; + } else { + _envCurrentLevel += _envStep; + } + break; + + case kEnvDecaying: + if (((_envCurrentLevel - _envStep) >> 8) < _envSustainLevel) { + envSustain(); + return; + } else { + _envCurrentLevel -= _envStep; + } + break; + + case kEnvSustaining: + case kEnvReleasing: + _envCurrentLevel -= _envStep; + if (_envCurrentLevel <= 0) + _envCurrentLevel = 0; + break; + + default: + break; + } + _tl = (_envCurrentLevel >> 8) << 1; +} - envState = kEnvReady; +void TownsAudio_PcmChannel::setInstrument(uint8 *instr) { + _curInstrument = instr; +} + +void TownsAudio_PcmChannel::setLevel(uint8 lvl) { + if (_reserved) { + _velo = lvl; + _tl = lvl << 1; + } else { + int32 t = _envStep * lvl; + if (_level) + t /= _level; + _envStep = t; + t = _envCurrentLevel * lvl; + if (_level) + t /= _level; + _envCurrentLevel = t; + _level = lvl; + _tl = _envCurrentLevel >> 8; + } +} + +void TownsAudio_PcmChannel::setPitch(uint32 pt) { + _stepPitch = pt & 0xffff; + _step = (_stepNote * _stepPitch) >> 14; + +// if (_pcmChanUnkFlag & _chanFlags[chan]) +// unk[chan] = (((p->step * 1000) << 11) / 98) / 20833; + + /*else*/ + if (_activeEffect && (_step > 2048)) + _step = 2048; +} + +void TownsAudio_PcmChannel::setBalance(uint8 blc) { + _panLeft = blc & 0x0f; + _panRight = blc >> 4; +} + +void TownsAudio_PcmChannel::updateOutput() { + if (_activeKey || _activeEffect) { + _pos += _step; + + if (&_data[_pos >> 11] >= _loopEnd) { + if (_loopLen) { + _pos -= _loopLen; + } else { + _pos = 0; + _activeKey = _activeEffect = false; + } + } + } +} + +int32 TownsAudio_PcmChannel::currentSampleLeft() { + return (_activeOutput && _panLeft) ? (((_data[_pos >> 11] * _tl) * _panLeft) >> 3) : 0; +} - delete[] extData; - extData = 0; +int32 TownsAudio_PcmChannel::currentSampleRight() { + return (_activeOutput && _panRight) ? (((_data[_pos >> 11] * _tl) * _panRight) >> 3) : 0; +} + +void TownsAudio_PcmChannel::setupLoop(uint32 loopStart, uint32 len) { + _loopLen = len << 11; + _loopEnd = _loopLen ? &_data[(loopStart + _loopLen) >> 11] : _dataEnd; + _pos = loopStart; +} + +void TownsAudio_PcmChannel::setNote(uint8 note, TownsAudio_WaveTable *w, bool stepLimit) { + _note = note; + int8 diff = _note - w->baseNote; + uint16 r = w->rate + w->rateOffs; + uint16 bl = 0; + uint32 s = 0; + + if (diff < 0) { + diff *= -1; + bl = diff % 12; + diff /= 12; + s = (r >> diff); + if (bl) + s = (s * _pcmPhase2[bl]) >> 16; + + } else if (diff > 0) { + bl = diff % 12; + diff /= 12; + s = (r << diff); + if (bl) + s += ((s * _pcmPhase1[bl]) >> 16); + + } else { + s = r; + } + + _stepNote = s & 0xffff; + _step = (s * _stepPitch) >> 14; + + if (stepLimit && _step > 2048) + _step = 2048; +} + +void TownsAudio_PcmChannel::setVelo(uint8 velo) { + if (_reserved) { + _velo = velo; + _tl = velo << 1; + } else { + _velo = velo; + uint32 lvl = _level * _velo; + _envTotalLevel = ((_envTotalLevel * lvl) >> 14) & 0xff; + _envSustainLevel = ((_envSustainLevel * lvl) >> 14) & 0xff; + envAttack(); + _tl = (_envCurrentLevel >> 8) << 1; + } } void TownsAudio_PcmChannel::envAttack() { - envState = kEnvAttacking; - int16 t = envTotalLevel << 8; - if (envAttackRate == 127) { - envStep = 0; - } else if (envAttackRate) { - envStep = t / envAttackRate; - envCurrentLevel = 1; + _envState = kEnvAttacking; + int16 t = _envTotalLevel << 8; + if (_envAttackRate == 127) { + _envCurrentLevel = _envStep = 0; + } else if (_envAttackRate) { + _envStep = t / _envAttackRate; + _envCurrentLevel = 1; } else { - envCurrentLevel = t; + _envCurrentLevel = t; envDecay(); } } void TownsAudio_PcmChannel::envDecay() { - envState = kEnvDecaying; - int16 t = envTotalLevel - envSustainLevel; - if (t < 0 || envDecayRate == 127) { - envStep = 0; - } else if (envDecayRate) { - envStep = (t << 8) / envDecayRate; + _envState = kEnvDecaying; + int16 t = _envTotalLevel - _envSustainLevel; + if (t < 0 || _envDecayRate == 127) { + _envStep = 0; + } else if (_envDecayRate) { + _envStep = (t << 8) / _envDecayRate; } else { - envCurrentLevel = envSustainLevel << 8; + _envCurrentLevel = _envSustainLevel << 8; envSustain(); } } void TownsAudio_PcmChannel::envSustain() { - envState = kEnvSustaining; - if (envSustainLevel && envSustainRate) - envStep = (envSustainRate == 127) ? 0 : (envCurrentLevel / envSustainRate) >> 1; + _envState = kEnvSustaining; + if (_envSustainLevel && _envSustainRate) + _envStep = (_envSustainRate == 127) ? 0 : (_envCurrentLevel / _envSustainRate) >> 1; else - envStep = envCurrentLevel = 1; + _envStep = _envCurrentLevel = 1; } void TownsAudio_PcmChannel::envRelease() { - envState = kEnvReleasing; - if (envReleaseRate == 127) - envStep = 0; - else if (envReleaseRate) - envStep = envCurrentLevel / envReleaseRate; + _envState = kEnvReleasing; + if (_envReleaseRate == 127) + _envStep = 0; + else if (_envReleaseRate) + _envStep = _envCurrentLevel / _envReleaseRate; else - envStep = envCurrentLevel = 1; + _envStep = _envCurrentLevel = 1; } +const uint16 TownsAudio_PcmChannel::_pcmPhase1[] = { + 0x879B, 0x0F37, 0x1F58, 0x306E, 0x4288, 0x55B6, 0x6A08, 0x7F8F, 0x965E, 0xAE88, 0xC882, 0xE341 +}; + +const uint16 TownsAudio_PcmChannel::_pcmPhase2[] = { + 0xFEFE, 0xF1A0, 0xE411, 0xD744, 0xCB2F, 0xBFC7, 0xB504, 0xAAE2, 0xA144, 0x9827, 0x8FAC +}; + TownsAudio_WaveTable::TownsAudio_WaveTable() { data = 0; clear(); @@ -1840,12 +1915,12 @@ void TownsAudio_WaveTable::clear() { data = 0; } -TownsAudioInterface::TownsAudioInterface(Audio::Mixer *mixer, TownsAudioInterfacePluginDriver *driver) { - _intf = TownsAudioInterfaceIntern::addNewRef(mixer, driver); +TownsAudioInterface::TownsAudioInterface(Audio::Mixer *mixer, TownsAudioInterfacePluginDriver *driver, bool externalMutexHandling) { + _intf = TownsAudioInterfaceInternal::addNewRef(mixer, this, driver, externalMutexHandling); } TownsAudioInterface::~TownsAudioInterface() { - TownsAudioInterfaceIntern::releaseRef(); + TownsAudioInterfaceInternal::releaseRef(this); _intf = 0; } diff --git a/audio/softsynth/fmtowns_pc98/towns_audio.h b/audio/softsynth/fmtowns_pc98/towns_audio.h index 2c58d46d06..4af888f009 100644 --- a/audio/softsynth/fmtowns_pc98/towns_audio.h +++ b/audio/softsynth/fmtowns_pc98/towns_audio.h @@ -25,7 +25,7 @@ #include "audio/mixer.h" -class TownsAudioInterfaceIntern; +class TownsAudioInterfaceInternal; class TownsAudioInterfacePluginDriver { public: @@ -35,7 +35,7 @@ public: class TownsAudioInterface { public: - TownsAudioInterface(Audio::Mixer *mixer, TownsAudioInterfacePluginDriver *driver); + TownsAudioInterface(Audio::Mixer *mixer, TownsAudioInterfacePluginDriver *driver, bool externalMutexHandling = false); ~TownsAudioInterface(); bool init(); @@ -49,7 +49,7 @@ public: void setSoundEffectChanMask(int mask); private: - TownsAudioInterfaceIntern *_intf; + TownsAudioInterfaceInternal *_intf; }; #endif diff --git a/audio/softsynth/fmtowns_pc98/towns_midi.cpp b/audio/softsynth/fmtowns_pc98/towns_midi.cpp index e67a78e9dc..4617b0555c 100644 --- a/audio/softsynth/fmtowns_pc98/towns_midi.cpp +++ b/audio/softsynth/fmtowns_pc98/towns_midi.cpp @@ -25,8 +25,6 @@ #include "common/textconsole.h" #include "common/system.h" -enum EnvelopeState; - class TownsMidiOutputChannel { friend class TownsMidiInputChannel; public: @@ -836,20 +834,9 @@ const uint8 TownsMidiInputChannel::_programAdjustLevel[] = { 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) { - _intf = new TownsAudioInterface(mixer, this); -} - -MidiDriver_TOWNS::~MidiDriver_TOWNS() { - close(); - delete _intf; -} - -int MidiDriver_TOWNS::open() { - if (_isOpen) - return MERR_ALREADY_OPEN; - - if (!_intf->init()) - return MERR_CANNOT_CONNECT; + // 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++) @@ -868,6 +855,38 @@ int MidiDriver_TOWNS::open() { } 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); @@ -878,9 +897,7 @@ int MidiDriver_TOWNS::open() { _intf->callback(33, 8); _intf->setSoundEffectChanMask(~0x3f); - _tickCounter1 = _tickCounter2 = 0; - _allocCurPos = 0; - _rand = 1; + _allocCurPos = 0; _isOpen = true; @@ -895,25 +912,6 @@ void MidiDriver_TOWNS::close() { setTimerCallback(0, 0); g_system->delayMillis(20); - - 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; } void MidiDriver_TOWNS::send(uint32 b) { diff --git a/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp b/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp index e35da91cbb..49fe97caf1 100644 --- a/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp +++ b/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp @@ -1054,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]; @@ -1145,7 +1147,7 @@ void TownsPC98_AudioDriver::loadMusicData(uint8 *data, bool loadPaused) { reset(); - lock(); + Common::StackLock lock(_mutex); uint8 *src_a = _trackPtr = _musicBuffer = data; for (uint8 i = 0; i < 3; i++) { @@ -1176,7 +1178,6 @@ void TownsPC98_AudioDriver::loadMusicData(uint8 *data, bool loadPaused) { _finishedChannelsFlag = _finishedSSGFlag = _finishedRhythmFlag = 0; _musicPlaying = (loadPaused ? false : true); - unlock(); } void TownsPC98_AudioDriver::loadSoundEffectData(uint8 *data, uint8 trackNum) { @@ -1195,17 +1196,16 @@ void TownsPC98_AudioDriver::loadSoundEffectData(uint8 *data, uint8 trackNum) { return; } - lock(); + Common::StackLock lock(_mutex); _sfxData = _sfxBuffer = data; _sfxOffsets[0] = READ_LE_UINT16(&_sfxData[(trackNum << 2)]); _sfxOffsets[1] = READ_LE_UINT16(&_sfxData[(trackNum << 2) + 2]); _sfxPlaying = true; _finishedSfxFlag = 0; - unlock(); } void TownsPC98_AudioDriver::reset() { - lock(); + Common::StackLock lock(_mutex); _musicPlaying = false; _sfxPlaying = false; @@ -1232,7 +1232,6 @@ void TownsPC98_AudioDriver::reset() { if (_rhythmChannel) _rhythmChannel->reset(); #endif - unlock(); } void TownsPC98_AudioDriver::fadeStep() { @@ -1263,37 +1262,30 @@ void TownsPC98_AudioDriver::fadeStep() { } } -void TownsPC98_AudioDriver::timerCallbackB() { - _sfxOffs = 0; - - if (_musicPlaying) { - _musicTickCounter++; - - for (int i = 0; i < _numChan; i++) { - if (_updateChannelsFlag & _channels[i]->_idFlag) { - _channels[i]->processEvents(); - _channels[i]->processFrequency(); - } - } +void TownsPC98_AudioDriver::pause() { + _musicPlaying = false; +} + +void TownsPC98_AudioDriver::cont() { + _musicPlaying = true; +} - for (int i = 0; i < _numSSG; i++) { - if (_updateSSGFlag & _ssgChannels[i]->_idFlag) { - _ssgChannels[i]->processEvents(); - _ssgChannels[i]->processFrequency(); - } - } +bool TownsPC98_AudioDriver::looping() { + return _looping == _updateChannelsFlag ? true : false; +} -#ifndef DISABLE_PC98_RHYTHM_CHANNEL - if (_hasPercussion) - if (_updateRhythmFlag & _rhythmChannel->_idFlag) - _rhythmChannel->processEvents(); -#endif - } +bool TownsPC98_AudioDriver::musicPlaying() { + return _musicPlaying; +} - toggleRegProtection(false); +void TownsPC98_AudioDriver::setMusicVolume(int volume) { + _musicVolume = volume; + setVolumeIntern(_musicVolume, _sfxVolume); +} - if (_finishedChannelsFlag == _updateChannelsFlag && _finishedSSGFlag == _updateSSGFlag && _finishedRhythmFlag == _updateRhythmFlag) - _musicPlaying = false; +void TownsPC98_AudioDriver::setSoundEffectVolume(int volume) { + _sfxVolume = volume; + setVolumeIntern(_musicVolume, _sfxVolume); } void TownsPC98_AudioDriver::timerCallbackA() { @@ -1321,15 +1313,37 @@ void TownsPC98_AudioDriver::timerCallbackA() { } } -void TownsPC98_AudioDriver::setMusicTempo(uint8 tempo) { - writeReg(0, 0x26, tempo); - writeReg(0, 0x27, 0x33); -} +void TownsPC98_AudioDriver::timerCallbackB() { + _sfxOffs = 0; -void TownsPC98_AudioDriver::setSfxTempo(uint16 tempo) { - writeReg(0, 0x24, tempo & 0xff); - writeReg(0, 0x25, tempo >> 8); - writeReg(0, 0x27, 0x33); + if (_musicPlaying) { + _musicTickCounter++; + + for (int i = 0; i < _numChan; i++) { + if (_updateChannelsFlag & _channels[i]->_idFlag) { + _channels[i]->processEvents(); + _channels[i]->processFrequency(); + } + } + + for (int i = 0; i < _numSSG; i++) { + if (_updateSSGFlag & _ssgChannels[i]->_idFlag) { + _ssgChannels[i]->processEvents(); + _ssgChannels[i]->processFrequency(); + } + } + +#ifndef DISABLE_PC98_RHYTHM_CHANNEL + if (_hasPercussion) + if (_updateRhythmFlag & _rhythmChannel->_idFlag) + _rhythmChannel->processEvents(); +#endif + } + + toggleRegProtection(false); + + if (_finishedChannelsFlag == _updateChannelsFlag && _finishedSSGFlag == _updateSSGFlag && _finishedRhythmFlag == _updateRhythmFlag) + _musicPlaying = false; } void TownsPC98_AudioDriver::startSoundEffect() { @@ -1352,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 46ee23895b..ff58482227 100644 --- a/audio/softsynth/fmtowns_pc98/towns_pc98_driver.h +++ b/audio/softsynth/fmtowns_pc98/towns_pc98_driver.h @@ -50,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 bc5aa32823..63007ba93c 100644 --- a/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp +++ b/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp @@ -851,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 @@ -861,7 +861,8 @@ TownsPC98_FmSynth::TownsPC98_FmSynth(Audio::Mixer *mixer, EmuType type) : _hasPercussion(type == kType86 ? true : false), _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), _lock(0), _ready(false) { + _volMaskA(0), _volMaskB(0), _volumeA(255), _volumeB(255), + _regProtectionFlag(false), _externalMutex(externalMutexHandling), _ready(false) { memset(&_timers[0], 0, sizeof(ChipTimer)); memset(&_timers[1], 0, sizeof(ChipTimer)); @@ -874,6 +875,8 @@ TownsPC98_FmSynth::~TownsPC98_FmSynth() { if (_ready) deinit(); + Common::StackLock lock(_mutex); + delete _ssg; #ifndef DISABLE_PC98_RHYTHM_CHANNEL delete _prc; @@ -928,7 +931,7 @@ bool TownsPC98_FmSynth::init() { } void TownsPC98_FmSynth::reset() { - lock(); + Common::StackLock lock(_mutex); for (int i = 0; i < _numChan; i++) { for (int ii = 0; ii < 4; ii++) _chanInternal[i].opr[ii]->reset(); @@ -948,14 +951,13 @@ void TownsPC98_FmSynth::reset() { if (_prc) _prc->reset(); #endif - unlock(); } void TownsPC98_FmSynth::writeReg(uint8 part, uint8 regAddress, uint8 value) { if (_regProtectionFlag || !_ready) return; - lock(); + Common::StackLock lock(_mutex); static const uint8 oprOrdr[] = { 0, 2, 1, 3 }; @@ -1137,7 +1139,6 @@ void TownsPC98_FmSynth::writeReg(uint8 part, uint8 regAddress, uint8 value) { default: warning("TownsPC98_FmSynth: UNKNOWN ADDRESS %d", regAddress); } - unlock(); } int TownsPC98_FmSynth::readBuffer(int16 *buffer, const int numSamples) { @@ -1146,15 +1147,32 @@ int TownsPC98_FmSynth::readBuffer(int16 *buffer, const int numSamples) { int32 *tmpStart = tmp; memset(tmp, 0, sizeof(int32) * numSamples); int32 samplesLeft = numSamples >> 1; - _lock |= 0x10000; - while (_ready && !(_lock & 0xffff) && samplesLeft) { + 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; @@ -1197,26 +1215,43 @@ int TownsPC98_FmSynth::readBuffer(int16 *buffer, const int numSamples) { tmp += (render << 1); } - _lock &= ~0x10000; + 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; - while (_lock) - g_system->delayMillis(20); _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(); } void TownsPC98_FmSynth::setVolumeIntern(int volA, int volB) { - lock(); + Common::StackLock lock(_mutex); _volumeA = CLIP<uint16>(volA, 0, Audio::Mixer::kMaxMixerVolume); _volumeB = CLIP<uint16>(volB, 0, Audio::Mixer::kMaxMixerVolume); if (_ssg) @@ -1225,11 +1260,10 @@ void TownsPC98_FmSynth::setVolumeIntern(int volA, int volB) { if (_prc) _prc->setVolumeIntern(_volumeA, _volumeB); #endif - unlock(); } void TownsPC98_FmSynth::setVolumeChannelMasks(int channelMaskA, int channelMaskB) { - lock(); + Common::StackLock lock(_mutex); _volMaskA = channelMaskA; _volMaskB = channelMaskB; if (_ssg) @@ -1238,17 +1272,6 @@ void TownsPC98_FmSynth::setVolumeChannelMasks(int channelMaskA, int channelMaskB if (_prc) _prc->setVolumeChannelMasks(_volMaskA >> (_numChan + _numSSG), _volMaskB >> (_numChan + _numSSG)); #endif - unlock(); -} - -void TownsPC98_FmSynth::lock() { - _mutex.lock(); - _lock++; -} - -void TownsPC98_FmSynth::unlock() { - _mutex.unlock(); - _lock--; } void TownsPC98_FmSynth::generateTables() { diff --git a/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h b/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h index f7bcc90585..4f81fa9a5c 100644 --- a/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h +++ b/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h @@ -59,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(); @@ -69,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(); @@ -86,29 +80,27 @@ 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); void setVolumeChannelMasks(int channelMaskA, int channelMaskB); - void lock(); - void unlock(); - const int _numChan; const int _numSSG; const bool _hasPercussion; + Common::Mutex _mutex; + bool _externalMutex; + private: void generateTables(); void nextTick(int32 *buffer, uint32 bufferSize); @@ -182,9 +174,6 @@ private: Audio::Mixer *_mixer; Audio::SoundHandle _soundHandle; - int _lock; - Common::Mutex _mutex; - #ifndef DISABLE_PC98_RHYTHM_CHANNEL static const uint8 _percussionData[]; #endif diff --git a/audio/softsynth/mt32.cpp b/audio/softsynth/mt32.cpp index a9a612f410..27a5a629c4 100644 --- a/audio/softsynth/mt32.cpp +++ b/audio/softsynth/mt32.cpp @@ -63,7 +63,7 @@ protected: void generateSamples(int16 *buf, int len); public: - bool _initialising; + bool _initializing; MidiDriver_MT32(Audio::Mixer *mixer); virtual ~MidiDriver_MT32(); @@ -215,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); @@ -239,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(); } @@ -283,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() { @@ -324,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/partial.cpp b/audio/softsynth/mt32/partial.cpp index d06634dc91..c4f2e94ebe 100644 --- a/audio/softsynth/mt32/partial.cpp +++ b/audio/softsynth/mt32/partial.cpp @@ -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 5e74b262ae..322b864b6e 100644 --- a/audio/softsynth/mt32/synth.cpp +++ b/audio/softsynth/mt32/synth.cpp @@ -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 edda446287..0ef2c9d135 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 25ee0436db..9fdb595467 100644 --- a/audio/softsynth/mt32/tables.cpp +++ b/audio/softsynth/mt32/tables.cpp @@ -203,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]); @@ -668,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; @@ -723,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)); } @@ -737,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 d9af5114b2..9950323e7b 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/mame.cpp b/audio/softsynth/opl/mame.cpp index b380a15345..74699ba4c6 100644 --- a/audio/softsynth/opl/mame.cpp +++ b/audio/softsynth/opl/mame.cpp @@ -546,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; @@ -754,8 +754,10 @@ static int OPLOpenTable(void) { } static void OPLCloseTable(void) { +#ifndef __DS__ free(TL_TABLE); free(SIN_TABLE); +#endif free(AMS_TABLE); free(VIB_TABLE); free(ENV_CURVE); @@ -1126,6 +1128,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); @@ -1134,9 +1145,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 4c40949483..803ca897e7 100644 --- a/audio/softsynth/opl/mame.h +++ b/audio/softsynth/opl/mame.h @@ -147,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/backends/audiocd/audiocd.h b/backends/audiocd/audiocd.h index a4aeb41e74..92b7598cb5 100644 --- a/backends/audiocd/audiocd.h +++ b/backends/audiocd/audiocd.h @@ -108,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/base-backend.cpp b/backends/base-backend.cpp index 68ec5efe62..40e702495a 100644 --- a/backends/base-backend.cpp +++ b/backends/base-backend.cpp @@ -18,6 +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 "backends/base-backend.h" @@ -57,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/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp index cadb10a954..835d98e718 100644 --- a/backends/events/sdl/sdl-events.cpp +++ b/backends/events/sdl/sdl-events.cpp @@ -279,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; @@ -323,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 @@ -336,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/fs/posix/posix-fs-factory.cpp b/backends/fs/posix/posix-fs-factory.cpp index c94e90ccde..ccff8a8b42 100644 --- a/backends/fs/posix/posix-fs-factory.cpp +++ b/backends/fs/posix/posix-fs-factory.cpp @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#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.cpp b/backends/fs/posix/posix-fs.cpp index 4d69a51a03..08a7601c17 100644 --- a/backends/fs/posix/posix-fs.cpp +++ b/backends/fs/posix/posix-fs.cpp @@ -19,13 +19,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#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" @@ -248,4 +249,4 @@ Common::WriteStream *POSIXFilesystemNode::createWriteStream() { return StdioStream::makeFromPath(getPath(), true); } -#endif //#if defined(UNIX) +#endif //#if defined(POSIX) diff --git a/backends/graphics/opengl/gltexture.h b/backends/graphics/opengl/gltexture.h index 63d5e3a733..f0cd7aed56 100644 --- a/backends/graphics/opengl/gltexture.h +++ b/backends/graphics/opengl/gltexture.h @@ -20,6 +20,8 @@ * */ +#include "common/scummsys.h" + #ifdef WIN32 #if defined(ARRAYSIZE) && !defined(_WINDOWS_) #undef ARRAYSIZE diff --git a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp new file mode 100644 index 0000000000..18629d949a --- /dev/null +++ b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp @@ -0,0 +1,60 @@ +/* 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 "common/scummsys.h" + +#if defined(SAMSUNGTV) + +#include "backends/platform/samsungtv/samsungtv.h" +#include "backends/events/samsungtvsdl/samsungtvsdl-events.h" +#include "backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h" + +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 0000000000..dc65c3a696 --- /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/midi/alsa.cpp b/backends/midi/alsa.cpp index 28e44b445a..c006b6b6bf 100644 --- a/backends/midi/alsa.cpp +++ b/backends/midi/alsa.cpp @@ -164,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; } @@ -382,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/mixer/sdl/sdl-mixer.cpp b/backends/mixer/sdl/sdl-mixer.cpp index 61e7f051e5..16e7f22db5 100644 --- a/backends/mixer/sdl/sdl-mixer.cpp +++ b/backends/mixer/sdl/sdl-mixer.cpp @@ -20,6 +20,8 @@ * */ +#include "common/scummsys.h" + #if defined(SDL_BACKEND) #include "backends/mixer/sdl/sdl-mixer.h" diff --git a/backends/modular-backend.cpp b/backends/modular-backend.cpp index fe3991af65..c5f147ffe1 100644 --- a/backends/modular-backend.cpp +++ b/backends/modular-backend.cpp @@ -20,6 +20,8 @@ * */ +#define FORBIDDEN_SYMBOL_EXCEPTION_exit + #include "backends/modular-backend.h" #include "backends/fs/fs-factory.h" @@ -277,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 43148b6e4a..e46fbfdd21 100644 --- a/backends/modular-backend.h +++ b/backends/modular-backend.h @@ -148,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 15af3ab763..27058bef88 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) diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp index 62226eb8b1..89e918a34e 100644 --- a/backends/platform/android/gfx.cpp +++ b/backends/platform/android/gfx.cpp @@ -179,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/org/inodes/gus/scummvm/ScummVM.java b/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java index c4de6d62f8..ef9f4cc1e0 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/dc/Makefile b/backends/platform/dc/Makefile index 0133ffd9e9..6da32a9049 100644 --- a/backends/platform/dc/Makefile +++ b/backends/platform/dc/Makefile @@ -11,9 +11,13 @@ CXX = sh-elf-g++ -ml -m4-single-only LD = $(CXX) CXXFLAGS= -O3 -Wno-multichar -funroll-loops -fschedule-insns2 -fomit-frame-pointer -fdelete-null-pointer-checks -fno-exceptions DEFINES = -D__DC__ -DNONSTANDARD_PORT -DUSE_MAD -DUSE_ZLIB -DDISABLE_DEFAULT_SAVEFILEMANAGER -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE -DUSE_RGB_COLOR +# For release builds: +#DEFINES += -DNOSERIAL LDFLAGS = -Wl,-Ttext,0x8c010000 -nostartfiles $(ronindir)/lib/crt0.o INCLUDES= -I./ -I$(srcdir) -I$(ronindir)/include/ -I$(srcdir)/engines LIBS = -L$(ronindir)/lib -lmad -lronin -lz -lm +# For release builds: +#LIBS = -L$(ronindir)/lib -lmad -lronin-noserial -lz -lm EXECUTABLE = scummvm.elf DEPDIR = .deps CXX_UPDATE_DEP_FLAG = -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h index 81f93a077e..e31b817d7c 100644 --- a/backends/platform/dc/dc.h +++ b/backends/platform/dc/dc.h @@ -53,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/input.cpp b/backends/platform/dc/input.cpp index 17bc317407..7054ad196e 100644 --- a/backends/platform/dc/input.cpp +++ b/backends/platform/dc/input.cpp @@ -20,6 +20,8 @@ * */ +#define FORBIDDEN_SYMBOL_ALLOW_ALL + #define RONIN_TIMER_ACCESS #include <common/scummsys.h> diff --git a/backends/platform/dc/selector.cpp b/backends/platform/dc/selector.cpp index 5c349923fc..859f2a40ed 100644 --- a/backends/platform/dc/selector.cpp +++ b/backends/platform/dc/selector.cpp @@ -20,7 +20,7 @@ * */ -#define FORBIDDEN_SYMBOL_EXCEPTION_chdir +#define FORBIDDEN_SYMBOL_ALLOW_ALL #include <common/scummsys.h> #include <engines/engine.h> diff --git a/backends/platform/dingux/module.mk b/backends/platform/dingux/module.mk index 2247625a04..b924fec1cf 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/arm9/dist/readme_ds.txt b/backends/platform/ds/arm9/dist/readme_ds.txt index ee1db719f4..24c85ad556 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 781738265c..1b21b41a9b 100644 --- a/backends/platform/ds/arm9/makefile +++ b/backends/platform/ds/arm9/makefile @@ -75,7 +75,7 @@ else ifdef DS_BUILD_K else - # USE_MAD = 1 + USE_MAD = 1 endif endif endif @@ -245,7 +245,9 @@ 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 +# for release builds: +#DEFINES += -DNDEBUG LDFLAGS = -specs=ds_arm9.specs -mthumb-interwork -mno-fpu -Wl,-Map,map.txt -Wl,--gc-sections @@ -259,7 +261,7 @@ BACKEND := ds INCLUDES= -I$(portdir)/$(BUILD) -I$(srcdir) -I$(srcdir)/engines \ -I$(portdir)/data -I$(portdir)/../commoninclude \ -I$(portdir)/source -I$(portdir)/source/mad \ - -I$(libndsdir)/include -include $(srcdir)/common/scummsys.h + -I$(libndsdir)/include -include $(portdir)/source/portdefs.h LIBS = -lm -L$(libndsdir)/lib -L$(portdir)/lib -lnds9 diff --git a/backends/platform/ds/arm9/source/dsmain.cpp b/backends/platform/ds/arm9/source/dsmain.cpp index 3fa4a0283a..dfd906d816 100644 --- a/backends/platform/ds/arm9/source/dsmain.cpp +++ b/backends/platform/ds/arm9/source/dsmain.cpp @@ -68,8 +68,7 @@ // - Try discworld? -// Disable symbol overrides for FILE -#define FORBIDDEN_SYMBOL_EXCEPTION_FILE +#define FORBIDDEN_SYMBOL_ALLOW_ALL @@ -576,7 +575,7 @@ void initGame() { for (int r = 0; r < NUM_SUPPORTED_GAMES; r++) { if (!stricmp(gameName, gameList[r].gameId)) { s_currentGame = &gameList[r]; - // consolePrintf("Game list num: %d\n", s_currentGame); + // consolePrintf("Game list num: %d\n", r); } } } @@ -1669,8 +1668,7 @@ void addEventsToQueue() { if (!keyboardEnable) { - - if ((isScrollingWithDPad() || (indyFightState)) && (displayModeIs8Bit)) { + if ((!isScrollingWithDPad() || (indyFightState)) && (displayModeIs8Bit)) { // Controls specific to the control method if (s_currentGame->control == CONT_SKY) { 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 698590418c..76508a1664 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/portdefs.h b/backends/platform/ds/arm9/source/portdefs.h index 580eb680eb..f512ce3ea2 100644 --- a/backends/platform/ds/arm9/source/portdefs.h +++ b/backends/platform/ds/arm9/source/portdefs.h @@ -26,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 <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/backends/platform/ds/arm9/source/zipreader.cpp b/backends/platform/ds/arm9/source/zipreader.cpp index 392a186e79..49552a86b2 100644 --- a/backends/platform/ds/arm9/source/zipreader.cpp +++ b/backends/platform/ds/arm9/source/zipreader.cpp @@ -20,6 +20,7 @@ * */ +#define FORBIDDEN_SYMBOL_ALLOW_ALL #include "common/scummsys.h" #include "zipreader.h" diff --git a/backends/platform/gp2x/gp2x.cpp b/backends/platform/gp2x/gp2x.cpp index 4cdb4cd0d5..0e28a6b738 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 837ad99d7b..4846f162cb 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/build/caanoo-config-alleng.sh b/backends/platform/gph/build/caanoo-config-alleng.sh index 97fed942fa..b7836508ed 100644 --- a/backends/platform/gph/build/caanoo-config-alleng.sh +++ b/backends/platform/gph/build/caanoo-config-alleng.sh @@ -8,10 +8,10 @@ echo and let all the build work be done from the backend/build folder. # Edit the configure line to suit. cd ../../../.. -./configure --backend=caanoo --disable-mt32emu --host=caanoo --disable-alsa --disable-flac \ +./configure --backend=caanoo --disable-mt32emu --host=caanoo \ + --disable-alsa --disable-flac \ --disable-nasm --disable-vorbis --disable-hq-scalers \ --with-sdl-prefix=/opt/arm-caanoo/arm-none-linux-gnueabi/usr/bin \ - --with-mpeg2-prefix=/opt/arm-caanoo/arm-none-linux-gnueabi/usr \ --enable-tremor --with-tremor-prefix=/opt/arm-caanoo/arm-none-linux-gnueabi/usr \ --enable-zlib --with-zlib-prefix=/opt/arm-caanoo/arm-none-linux-gnueabi/usr \ --enable-mad --with-mad-prefix=/opt/arm-caanoo/arm-none-linux-gnueabi/usr \ diff --git a/backends/platform/gph/build/caanoo-config.sh b/backends/platform/gph/build/caanoo-config.sh index 11d597481a..fe191647e6 100644 --- a/backends/platform/gph/build/caanoo-config.sh +++ b/backends/platform/gph/build/caanoo-config.sh @@ -8,10 +8,10 @@ echo and let all the build work be done from the backend/build folder. # Edit the configure line to suit. cd ../../../.. -./configure --backend=caanoo --disable-mt32emu --host=caanoo --disable-alsa --disable-flac \ +./configure --backend=caanoo --disable-mt32emu --host=caanoo \ + --disable-alsa --disable-flac \ --disable-nasm --disable-vorbis --disable-hq-scalers \ --with-sdl-prefix=/opt/arm-caanoo/arm-none-linux-gnueabi/usr/bin \ - --with-mpeg2-prefix=/opt/arm-caanoo/arm-none-linux-gnueabi/usr \ --enable-tremor --with-tremor-prefix=/opt/arm-caanoo/arm-none-linux-gnueabi/usr \ --enable-zlib --with-zlib-prefix=/opt/arm-caanoo/arm-none-linux-gnueabi/usr \ --enable-mad --with-mad-prefix=/opt/arm-caanoo/arm-none-linux-gnueabi/usr \ diff --git a/backends/platform/gph/build/gp2x-config-alleng.sh b/backends/platform/gph/build/gp2x-config-alleng.sh index 4a3526d50c..83a4fe2046 100644 --- a/backends/platform/gph/build/gp2x-config-alleng.sh +++ b/backends/platform/gph/build/gp2x-config-alleng.sh @@ -17,7 +17,13 @@ export DEFINES=-DNDEBUG # Edit the configure line to suit. cd ../../../.. -./configure --backend=gp2x --disable-mt32emu --host=gp2x --disable-flac --disable-nasm --disable-hq-scalers --with-sdl-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin --with-mpeg2-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 --enable-tremor --with-tremor-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 --enable-zlib --with-zlib-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 --enable-mad --with-mad-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 --enable-all-engines --enable-vkeybd +./configure --backend=gp2x --disable-mt32emu --host=gp2x \ + --disable-flac --disable-nasm --disable-hq-scalers \ + --with-sdl-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin \ + --enable-tremor --with-tremor-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 \ + --enable-zlib --with-zlib-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 \ + --enable-mad --with-mad-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 \ + --enable-all-engines --enable-vkeybd #--enable-plugins --default-dynamic echo Generating config for GP2X complete. Check for errors. diff --git a/backends/platform/gph/build/gp2x-config.sh b/backends/platform/gph/build/gp2x-config.sh index 9092b0b1ea..f474c4d0d4 100644 --- a/backends/platform/gph/build/gp2x-config.sh +++ b/backends/platform/gph/build/gp2x-config.sh @@ -17,7 +17,13 @@ export DEFINES=-DNDEBUG # Edit the configure line to suit. cd ../../../.. -./configure --backend=gp2x --disable-mt32emu --host=gp2x --disable-flac --disable-nasm --disable-hq-scalers --with-sdl-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin --with-mpeg2-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 --enable-tremor --with-tremor-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 --enable-zlib --with-zlib-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 --enable-mad --with-mad-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 --enable-vkeybd --enable-plugins --default-dynamic +./configure --backend=gp2x --disable-mt32emu --host=gp2x \ + --disable-flac --disable-nasm --disable-hq-scalers \ + --with-sdl-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin \ + --enable-tremor --with-tremor-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 \ + --enable-zlib --with-zlib-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 \ + --enable-mad --with-mad-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 \ + --enable-vkeybd --enable-plugins --default-dynamic # --disable-release --enable-debug # --enable-plugins --default-dynamic diff --git a/backends/platform/gph/build/gp2xwiz-config-alleng.sh b/backends/platform/gph/build/gp2xwiz-config-alleng.sh index 9ec8a09cd2..ff905d0585 100644 --- a/backends/platform/gph/build/gp2xwiz-config-alleng.sh +++ b/backends/platform/gph/build/gp2xwiz-config-alleng.sh @@ -16,8 +16,9 @@ export LDFLAGS=-L/opt/open2x/gcc-4.1.1-glibc-2.3.6/lib # Edit the configure line to suit. cd ../../../.. -./configure --backend=gph --disable-mt32emu --host=gp2xwiz --disable-flac --disable-nasm --disable-hq-scalers \ - --with-sdl-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin --with-mpeg2-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 \ +./configure --backend=gph --disable-mt32emu --host=gp2xwiz \ + --disable-flac --disable-nasm --disable-hq-scalers \ + --with-sdl-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin \ --enable-tremor --with-tremor-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 \ --enable-zlib --with-zlib-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 \ --enable-mad --with-mad-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 \ diff --git a/backends/platform/gph/build/gp2xwiz-config.sh b/backends/platform/gph/build/gp2xwiz-config.sh index ac7c34ad12..7be103602b 100644 --- a/backends/platform/gph/build/gp2xwiz-config.sh +++ b/backends/platform/gph/build/gp2xwiz-config.sh @@ -16,8 +16,9 @@ export LDFLAGS=-L/opt/open2x/gcc-4.1.1-glibc-2.3.6/lib # Edit the configure line to suit. cd ../../../.. -./configure --backend=gph --disable-mt32emu --host=gp2xwiz --disable-flac --disable-nasm --disable-hq-scalers \ - --with-sdl-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin --with-mpeg2-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 \ +./configure --backend=gph --disable-mt32emu --host=gp2xwiz \ + --disable-flac --disable-nasm --disable-hq-scalers \ + --with-sdl-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin \ --enable-tremor --with-tremor-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 \ --enable-zlib --with-zlib-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 \ --enable-mad --with-mad-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 \ diff --git a/backends/platform/gph/gph-backend.cpp b/backends/platform/gph/gph-backend.cpp index 375ee37378..cb52da441d 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/module.mk b/backends/platform/gph/module.mk index a9951494d1..d8a1a6cd8d 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/linuxmoto/module.mk b/backends/platform/linuxmoto/module.mk index c604d69da1..4c81aac3f2 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/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp index fb3b1dbd93..094bb839d3 100644 --- a/backends/platform/n64/osys_n64_base.cpp +++ b/backends/platform/n64/osys_n64_base.cpp @@ -20,6 +20,8 @@ * */ +#define FORBIDDEN_SYMBOL_ALLOW_ALL + #include <romfs.h> #include <malloc.h> // Required for memalign diff --git a/backends/platform/n64/portdefs.h b/backends/platform/n64/portdefs.h index e62551355d..35ef3c71db 100644 --- a/backends/platform/n64/portdefs.h +++ b/backends/platform/n64/portdefs.h @@ -35,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 7dd127fefa..b9e901bb5a 100644 --- a/backends/platform/null/null.cpp +++ b/backends/platform/null/null.cpp @@ -34,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" @@ -60,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/build/config-alleng.sh b/backends/platform/openpandora/build/config-alleng.sh index f3fa1a0f94..4028f5f4de 100755 --- a/backends/platform/openpandora/build/config-alleng.sh +++ b/backends/platform/openpandora/build/config-alleng.sh @@ -19,7 +19,6 @@ export DEFINES=-DNDEBUG cd ../../../.. ./configure --backend=openpandora --host=openpandora --disable-nasm \ --with-sdl-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/bin \ - --with-mpeg2-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr \ --disable-vorbis --enable-tremor --with-tremor-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr \ --enable-zlib --with-zlib-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr \ --enable-mad --with-mad-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr \ diff --git a/backends/platform/openpandora/build/config.sh b/backends/platform/openpandora/build/config.sh index 9bc52a9bc4..92476c5525 100755 --- a/backends/platform/openpandora/build/config.sh +++ b/backends/platform/openpandora/build/config.sh @@ -19,7 +19,6 @@ export DEFINES=-DNDEBUG cd ../../../.. ./configure --backend=openpandora --host=openpandora --disable-nasm \ --with-sdl-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/bin \ - --with-mpeg2-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr \ --disable-vorbis --enable-tremor --with-tremor-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr \ --enable-zlib --with-zlib-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr \ --enable-mad --with-mad-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr \ diff --git a/backends/platform/openpandora/module.mk b/backends/platform/openpandora/module.mk index 8e60b87aa6..5bd568e1c4 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/ps2/Makefile.gdb b/backends/platform/ps2/Makefile.gdb index 48dcebc1d4..1e2510d3f4 100644 --- a/backends/platform/ps2/Makefile.gdb +++ b/backends/platform/ps2/Makefile.gdb @@ -1,7 +1,7 @@ # $Header: Exp $ include $(PS2SDK)/Defs.make -PS2_EXTRA = /media/disk/nw8240/extras/scummvm/ports +PS2_EXTRA = /works/devel/ps2/sdk-extra PS2_EXTRA_INCS = /zlib/include /libmad/ee/include /SjPcm/ee/src /tremor PS2_EXTRA_LIBS = /zlib/lib /libmad/ee/lib /SjPcm/ee/lib /tremor/tremor @@ -9,31 +9,44 @@ ENABLED=STATIC_PLUGIN ENABLE_SCUMM = $(ENABLED) ENABLE_SCUMM_7_8 = $(ENABLED) -#ENABLE_HE = $(ENABLED) -#ENABLE_AGI = $(ENABLED) -#ENABLE_AGOS = $(ENABLED) -#ENABLE_CINE = $(ENABLED) -#ENABLE_CRUISE = $(ENABLED) -#ENABLE_DRASCULA = $(ENABLED) -#ENABLE_GOB = $(ENABLED) -#ENABLE_KYRA = $(ENABLED) -#ENABLE_LURE = $(ENABLED) - # ENABLE_M4 = $(ENABLED) -#ENABLE_MADE = $(ENABLED) -#ENABLE_PARALLACTION = $(ENABLED) -#ENABLE_QUEEN = $(ENABLED) -#ENABLE_SAGA = $(ENABLED) -#ENABLE_SAGA2 = $(ENABLED) -#ENABLE_IHNM = $(ENABLED) -#ENABLE_SKY = $(ENABLED) -#ENABLE_SWORD1 = $(ENABLED) -#ENABLE_SWORD2 = $(ENABLED) - # ENABLE_TINSEL = $(ENABLED) -#ENABLE_TOUCHE = $(ENABLED) +# ENABLE_HE = $(ENABLED) +# ENABLE_AGI = $(ENABLED) +# ENABLE_AGOS = $(ENABLED) +# ENABLE_AGOS2 = $(ENABLED) +# ENABLE_CINE = $(ENABLED) +# ENABLE_CRUISE = $(ENABLED) +# ENABLE_DRACI = $(ENABLED) +# ENABLE_DRASCULA = $(ENABLED) +# ENABLE_GOB = $(ENABLED) +# ENABLE_GROOVIE = $(ENABLED) +## ENABLE_GROOVIE2 = $(ENABLED) +# ENABLE_HUGO = $(ENABLED) +# ENABLE_IHNM = $(ENABLED) +# ENABLE_KYRA = $(ENABLED) +## ENABLE_LOL = $(ENABLED) +# ENABLE_LURE = $(ENABLED) +## ENABLE_M4 = $(ENABLED) +# ENABLE_MADE = $(ENABLED) +# ENABLE_MOHAWK = $(ENABLED) +# ENABLE_PARALLACTION = $(ENABLED) +# ENABLE_QUEEN = $(ENABLED) +# ENABLE_SAGA = $(ENABLED) +# ENABLE_SAGA2 = $(ENABLED) +# ENABLE_SCI = $(ENABLED) +## ENABLE_SCI32 = $(ENABLED) +# ENABLE_SKY = $(ENABLED) +# ENABLE_SWORD1 = $(ENABLED) +# ENABLE_SWORD2 = $(ENABLED) +# ENABLE_TEENAGENT = $(ENABLED) +# ENABLE_TINSEL = $(ENABLED) +# ENABLE_TOON = $(ENABLED) +# ENABLE_TOUCHE = $(ENABLED) +# ENABLE_TUCKER = $(ENABLED) + HAVE_GCC3 = true -CC = ee-gcc +CC = ee-gcc CXX = ee-g++ AS = ee-gcc LD = ee-gcc @@ -48,35 +61,36 @@ VPATH = $(srcdir) INCDIR = ../../../ # DEPDIR = .deps -DEFINES = -DUSE_VORBIS -DUSE_TREMOR -DUSE_MAD -DUSE_ZLIB -DFORCE_RTL -D_EE -D__PLAYSTATION2__ -D__PS2_DEBUG__ -g -Wall -Wno-multichar - +DEFINES = -DUSE_VORBIS -DUSE_TREMOR -DUSE_MAD -DUSE_ZLIB -DFORCE_RTL -DDISABLE_SAVEGAME_SORTING -D_EE -D__PLAYSTATION2__ -D__PS2_DEBUG__ -g -Wall -Wno-multichar -fno-rtti -fno-exceptions # -DNO_ADAPTOR +# for release builds: +#DEFINES += -DRELEASE_BUILD INCLUDES = $(addprefix -I$(PS2_EXTRA),$(PS2_EXTRA_INCS)) INCLUDES += -I $(PS2GDB)/ee -I $(PS2SDK)/ee/include -I $(PS2SDK)/common/include -I ./common -I . -I $(srcdir) -I $(srcdir)/engines +CXX_UPDATE_DEP_FLAG = -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP + TARGET = elf/scummvm.elf -OBJS := backends/platform/ps2/DmaPipe.o \ - backends/platform/ps2/Gs2dScreen.o \ - backends/platform/ps2/irxboot.o \ - backends/platform/ps2/ps2input.o \ - backends/platform/ps2/ps2pad.o \ - backends/platform/ps2/savefilemgr.o \ - backends/platform/ps2/fileio.o \ - backends/platform/ps2/asyncfio.o \ - backends/platform/ps2/icon.o \ - backends/platform/ps2/cd.o \ - backends/platform/ps2/eecodyvdfs.o \ - backends/platform/ps2/rpckbd.o \ - backends/platform/ps2/systemps2.o \ - backends/platform/ps2/ps2mutex.o \ - backends/platform/ps2/ps2time.o \ - backends/platform/ps2/ps2debug.o +OBJS := $(srcdir)/backends/platform/ps2/DmaPipe.o \ + $(srcdir)/backends/platform/ps2/Gs2dScreen.o \ + $(srcdir)/backends/platform/ps2/irxboot.o \ + $(srcdir)/backends/platform/ps2/ps2input.o \ + $(srcdir)/backends/platform/ps2/ps2pad.o \ + $(srcdir)/backends/platform/ps2/savefilemgr.o \ + $(srcdir)/backends/platform/ps2/fileio.o \ + $(srcdir)/backends/platform/ps2/asyncfio.o \ + $(srcdir)/backends/platform/ps2/icon.o \ + $(srcdir)/backends/platform/ps2/cd.o \ + $(srcdir)/backends/platform/ps2/eecodyvdfs.o \ + $(srcdir)/backends/platform/ps2/rpckbd.o \ + $(srcdir)/backends/platform/ps2/systemps2.o \ + $(srcdir)/backends/platform/ps2/ps2mutex.o \ + $(srcdir)/backends/platform/ps2/ps2time.o \ + $(srcdir)/backends/platform/ps2/ps2debug.o MODULE_DIRS += . -BACKEND := ps2 - include $(srcdir)/Makefile.common LDFLAGS += -mno-crt0 $(PS2SDK)/ee/startup/crt0.o -T $(PS2SDK)/ee/startup/linkfile diff --git a/backends/platform/ps2/Makefile.ps2 b/backends/platform/ps2/Makefile.ps2 index 472ba5ec3a..77cc735c5f 100644 --- a/backends/platform/ps2/Makefile.ps2 +++ b/backends/platform/ps2/Makefile.ps2 @@ -12,28 +12,41 @@ ENABLE_SCUMM_7_8 = $(ENABLED) ENABLE_HE = $(ENABLED) ENABLE_AGI = $(ENABLED) ENABLE_AGOS = $(ENABLED) +ENABLE_AGOS2 = $(ENABLED) ENABLE_CINE = $(ENABLED) ENABLE_CRUISE = $(ENABLED) +ENABLE_DRACI = $(ENABLED) ENABLE_DRASCULA = $(ENABLED) ENABLE_GOB = $(ENABLED) +ENABLE_GROOVIE = $(ENABLED) +# ENABLE_GROOVIE2 = $(ENABLED) +ENABLE_HUGO = $(ENABLED) +ENABLE_IHNM = $(ENABLED) ENABLE_KYRA = $(ENABLED) +# ENABLE_LOL = $(ENABLED) ENABLE_LURE = $(ENABLED) # ENABLE_M4 = $(ENABLED) ENABLE_MADE = $(ENABLED) +ENABLE_MOHAWK = $(ENABLED) ENABLE_PARALLACTION = $(ENABLED) ENABLE_QUEEN = $(ENABLED) ENABLE_SAGA = $(ENABLED) -ENABLE_SAGA2 = $(ENABLED) -ENABLE_IHNM = $(ENABLED) +# ENABLE_SAGA2 = $(ENABLED) +ENABLE_SCI = $(ENABLED) +# ENABLE_SCI32 = $(ENABLED) ENABLE_SKY = $(ENABLED) ENABLE_SWORD1 = $(ENABLED) ENABLE_SWORD2 = $(ENABLED) -# ENABLE_TINSEL = $(ENABLED) +ENABLE_TEENAGENT = $(ENABLED) +ENABLE_TINSEL = $(ENABLED) +ENABLE_TOON = $(ENABLED) ENABLE_TOUCHE = $(ENABLED) +ENABLE_TUCKER = $(ENABLED) + HAVE_GCC3 = true -CC = ee-gcc +CC = ee-gcc CXX = ee-g++ AS = ee-gcc LD = ee-gcc @@ -48,30 +61,33 @@ VPATH = $(srcdir) INCDIR = ../../../ # DEPDIR = .deps -DEFINES = -DUSE_VORBIS -DUSE_TREMOR -DUSE_MAD -DUSE_ZLIB -DFORCE_RTL -D_EE -D__PLAYSTATION2__ -O2 -Wall -Wno-multichar - +DEFINES = -DUSE_VORBIS -DUSE_TREMOR -DUSE_MAD -DUSE_ZLIB -DFORCE_RTL -DDISABLE_SAVEGAME_SORTING -D_EE -D__PLAYSTATION2__ -G2 -O2 -Wall -Wno-multichar -fno-rtti -fno-exceptions # -DNO_ADAPTOR +# for release builds: +#DEFINES += -DRELEASE_BUILD INCLUDES = $(addprefix -I$(PS2_EXTRA),$(PS2_EXTRA_INCS)) INCLUDES += -I $(PS2SDK)/ee/include -I $(PS2SDK)/common/include -I ./common -I . -I $(srcdir) -I $(srcdir)/engines +CXX_UPDATE_DEP_FLAG = -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP + TARGET = elf/scummvm.elf -OBJS := backends/platform/ps2/DmaPipe.o \ - backends/platform/ps2/Gs2dScreen.o \ - backends/platform/ps2/irxboot.o \ - backends/platform/ps2/ps2input.o \ - backends/platform/ps2/ps2pad.o \ - backends/platform/ps2/savefilemgr.o \ - backends/platform/ps2/fileio.o \ - backends/platform/ps2/asyncfio.o \ - backends/platform/ps2/icon.o \ - backends/platform/ps2/cd.o \ - backends/platform/ps2/eecodyvdfs.o \ - backends/platform/ps2/rpckbd.o \ - backends/platform/ps2/systemps2.o \ - backends/platform/ps2/ps2mutex.o \ - backends/platform/ps2/ps2time.o \ - backends/platform/ps2/ps2debug.o +OBJS := $(srcdir)/backends/platform/ps2/DmaPipe.o \ + $(srcdir)/backends/platform/ps2/Gs2dScreen.o \ + $(srcdir)/backends/platform/ps2/irxboot.o \ + $(srcdir)/backends/platform/ps2/ps2input.o \ + $(srcdir)/backends/platform/ps2/ps2pad.o \ + $(srcdir)/backends/platform/ps2/savefilemgr.o \ + $(srcdir)/backends/platform/ps2/fileio.o \ + $(srcdir)/backends/platform/ps2/asyncfio.o \ + $(srcdir)/backends/platform/ps2/icon.o \ + $(srcdir)/backends/platform/ps2/cd.o \ + $(srcdir)/backends/platform/ps2/eecodyvdfs.o \ + $(srcdir)/backends/platform/ps2/rpckbd.o \ + $(srcdir)/backends/platform/ps2/systemps2.o \ + $(srcdir)/backends/platform/ps2/ps2mutex.o \ + $(srcdir)/backends/platform/ps2/ps2time.o \ + $(srcdir)/backends/platform/ps2/ps2debug.o MODULE_DIRS += . diff --git a/backends/platform/psp/display_manager.cpp b/backends/platform/psp/display_manager.cpp index d6e982cd8f..899b79727f 100644 --- a/backends/platform/psp/display_manager.cpp +++ b/backends/platform/psp/display_manager.cpp @@ -20,6 +20,8 @@ * */ +#define FORBIDDEN_SYMBOL_ALLOW_ALL + #include <pspgu.h> #include <pspdisplay.h> #include <pspthreadman.h> diff --git a/backends/platform/samsungtv/main.cpp b/backends/platform/samsungtv/main.cpp index a3253c12f1..8274bb00a2 100644 --- a/backends/platform/samsungtv/main.cpp +++ b/backends/platform/samsungtv/main.cpp @@ -22,12 +22,14 @@ #define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h +#include "common/scummsys.h" + +#if defined(SAMSUNGTV) + #include "backends/platform/samsungtv/samsungtv.h" #include "backends/plugins/sdl/sdl-provider.h" #include "base/main.h" -#if defined(SAMSUNGTV) - #include <unistd.h> extern "C" int Game_Main(char *path, char *) { @@ -38,7 +40,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()); @@ -48,7 +50,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 36ad75da6d..cba09db74c 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 2cc520e6fa..9718eed1fe 100644 --- a/backends/platform/samsungtv/samsungtv.cpp +++ b/backends/platform/samsungtv/samsungtv.cpp @@ -20,20 +20,18 @@ * */ -#include "backends/platform/samsungtv/samsungtv.h" -#include "backends/events/samsungtvsdl/samsungtvsdl-events.h" +#include "common/scummsys.h" #if defined(SAMSUNGTV) +#include "backends/platform/samsungtv/samsungtv.h" +#include "backends/events/samsungtvsdl/samsungtvsdl-events.h" +#include "backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h" +#include "common/textconsole.h" + 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() { @@ -41,27 +39,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 22a96495b7..b7a78a96cd 100644 --- a/backends/platform/samsungtv/samsungtv.h +++ b/backends/platform/samsungtv/samsungtv.h @@ -23,6 +23,8 @@ #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 { @@ -30,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/main.cpp b/backends/platform/sdl/main.cpp index e8bb9210c3..1992bdd3f2 100644 --- a/backends/platform/sdl/main.cpp +++ b/backends/platform/sdl/main.cpp @@ -24,7 +24,7 @@ // 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__) && \ @@ -33,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 87a0e3d658..efc5168d5b 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 ffc28b354c..f78e001398 100644 --- a/backends/platform/sdl/posix/posix-main.cpp +++ b/backends/platform/sdl/posix/posix-main.cpp @@ -22,7 +22,7 @@ #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 1122e9b20a..21ad7b9e35 100644 --- a/backends/platform/sdl/posix/posix.cpp +++ b/backends/platform/sdl/posix/posix.cpp @@ -20,12 +20,13 @@ * */ +#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" @@ -60,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) @@ -82,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/sdl.cpp b/backends/platform/sdl/sdl.cpp index 5cb409794b..a3fb719ca4 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -21,6 +21,7 @@ */ #define FORBIDDEN_SYMBOL_EXCEPTION_time_h +#define FORBIDDEN_SYMBOL_EXCEPTION_exit #ifdef WIN32 #define WIN32_LEAN_AND_MEAN diff --git a/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl b/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl index cb1c508fa1..82c15ec3db 100644 --- a/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl +++ b/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl @@ -104,9 +104,6 @@ #$SDK_LibraryDirs{'S90'}{'esdl.lib'} = "$SdlBase\\S90"; #$SDK_LibraryDirs{'UIQ2'}{'esdl.lib'} = "$SdlBase\\UIQ2" #$SDK_LibraryDirs{'UIQ3'}{'esdl.lib'} = "$SdlBase\\UIQ3"; - - ## HardlySupported(TM) :P - #$SDK_LibraryDirs{'ALL'}{'libmpeg2.lib'} = "$DevBase\\mpeg2dec-0.4.0\\epoc"; } # now you can add $VariationSets only built on this PC below this line :) @@ -145,7 +142,6 @@ # $SDK_LibraryDirs{'S60v1'}{'esdl.lib'} = $SDK_LibraryDirs{'S60v2'}{'esdl.lib'} = $SDK_LibraryDirs{'S60v3'}{'esdl.lib'} = "C:\\S\\ESDL\\epoc\\S60"; # $SDK_LibraryDirs{'S80'}{'esdl.lib'} = "C:\\S\\ESDL\\epoc\\S80"; # $SDK_LibraryDirs{'S90'}{'esdl.lib'} = "C:\\S\\ESDL\\epoc\\S90"; - #$SDK_LibraryDirs{'ALL'}{'libmpeg2.lib'} = "C:\\S\\mpeg2dec-0.4.0\\epoc"; } # now you can add $VariationSets only built on this PC below this line :) @@ -183,7 +179,6 @@ $SDK_LibraryDirs{'S90'}{'esdl.lib'} = "E:\\WICKED\\ESDL\\epoc\\S90"; $SDK_LibraryDirs{'S60v3'}{'esdl.lib'} = "E:\\WICKED\\ESDL\\epoc\\S60\\S60V3"; $SDK_LibraryDirs{'UIQ3'}{'esdl.lib'} = "E:\\WICKED\\ESDL\\epoc\\UIQ\\UIQ3"; - #$SDK_LibraryDirs{'ALL'}{'libmpeg2.lib'} = "C:\\S\\mpeg2dec-0.4.0\\epoc"; } # now you can add $VariationSets only built on this PC below this line :) @@ -221,7 +216,6 @@ $SDK_LibraryDirs{'S90'}{'esdl.lib'} = "E:\\WICKED\\ESDL\\epoc\\S90"; $SDK_LibraryDirs{'S60v3'}{'esdl.lib'} = "E:\\WICKED\\ESDL\\epoc\\S60\\S60V3"; $SDK_LibraryDirs{'UIQ3'}{'esdl.lib'} = "E:\\WICKED\\ESDL\\epoc\\UIQ\\UIQ3"; - #$SDK_LibraryDirs{'ALL'}{'libmpeg2.lib'} = "C:\\S\\mpeg2dec-0.4.0\\epoc"; } # now you can add $VariationSets only built on this PC below this line :) @@ -259,7 +253,6 @@ $SDK_LibraryDirs{'S90'}{'esdl.lib'} = "E:\\WICKED\\ESDL\\epoc\\S90"; $SDK_LibraryDirs{'S60v3'}{'esdl.lib'} = "E:\\WICKED\\ESDL\\epoc\\S60\\S60V3"; $SDK_LibraryDirs{'UIQ3'}{'esdl.lib'} = "E:\\WICKED\\ESDL\\epoc\\UIQ\\UIQ3"; - #$SDK_LibraryDirs{'ALL'}{'libmpeg2.lib'} = "C:\\S\\mpeg2dec-0.4.0\\epoc"; } # now you can add $VariationSets only built on this PC below this line :) diff --git a/backends/platform/symbian/README b/backends/platform/symbian/README index 140f442fb6..1f49c52f02 100644 --- a/backends/platform/symbian/README +++ b/backends/platform/symbian/README @@ -114,9 +114,6 @@ Building ScummVM - flac, the Free Lossless Audio Codec http://flac.sourceforge.net/ - - libmpeg2, a free MPEG-2 video stream decoder - http://libmpeg2.sourceforge.net - Compiling ScummVM ----------------- diff --git a/backends/platform/symbian/src/portdefs.h b/backends/platform/symbian/src/portdefs.h index ebcd273659..86460e65c5 100644 --- a/backends/platform/symbian/src/portdefs.h +++ b/backends/platform/symbian/src/portdefs.h @@ -18,8 +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. */ + #ifndef SYMBIAN_PORTDEFS_H #define SYMBIAN_PORTDEFS_H + #include <assert.h> #include <stdarg.h> #include <string.h> @@ -37,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/wii/options.cpp b/backends/platform/wii/options.cpp index ffabc5ae97..8c12ad9b81 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/Makefile b/backends/platform/wince/Makefile index a9741f396f..7f8d45b3de 100644 --- a/backends/platform/wince/Makefile +++ b/backends/platform/wince/Makefile @@ -47,7 +47,6 @@ ENABLE_MADE = STATIC_PLUGIN ## Pick which libraries you want to use here USE_MAD = 1 -#USE_MPEG2 = 1 #USE_TREMOR = 1 USE_TREMOLO = 1 #USE_FLAC = 1 @@ -133,11 +132,6 @@ DEFINES += -DUSE_MAD LIBS += -lmad endif -ifdef USE_MPEG2 -DEFINES += -DUSE_MPEG2 -LIBS += -lmpeg2 -endif - ifdef USE_TREMOR DEFINES += -DUSE_TREMOR -DUSE_VORBIS LIBS += -ltremorce diff --git a/backends/platform/wince/README-WinCE.txt b/backends/platform/wince/README-WinCE.txt index 69abd66e69..c48d9ca998 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 96bc6a9ea1..de492cac68 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/portdefs.h b/backends/platform/wince/portdefs.h index 1f8b9bb3ca..93df6cd39e 100644 --- a/backends/platform/wince/portdefs.h +++ b/backends/platform/wince/portdefs.h @@ -20,44 +20,47 @@ * */ -// 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 <math.h> -#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 <math.h> + #undef GetCurrentDirectory + extern "C" void GetCurrentDirectory(int len, char *buf); + #define snprintf _snprintf + #define strdup _strdup + #define fopen wce_fopen #endif #include <windows.h> @@ -72,7 +75,7 @@ extern "C" void GetCurrentDirectory(int len, char *buf); //#include <direct.h> #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); @@ -81,4 +84,5 @@ void drawError(char *); #define vsnprintf _vsnprintf + #endif diff --git a/backends/plugins/posix/posix-provider.cpp b/backends/plugins/posix/posix-provider.cpp index 39ed247436..a68a792fa4 100644 --- a/backends/plugins/posix/posix-provider.cpp +++ b/backends/plugins/posix/posix-provider.cpp @@ -22,7 +22,7 @@ #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" @@ -77,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 7d6d6ada4d..b1186ccf3f 100644 --- a/backends/plugins/posix/posix-provider.h +++ b/backends/plugins/posix/posix-provider.h @@ -25,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/win32/win32-provider.cpp b/backends/plugins/win32/win32-provider.cpp index bcbc6bde9e..0a08e48e6f 100644 --- a/backends/plugins/win32/win32-provider.cpp +++ b/backends/plugins/win32/win32-provider.cpp @@ -67,19 +67,11 @@ public: bool loadPlugin() { assert(!_dlHandle); - #ifndef _WIN32_WCE +#ifndef _WIN32_WCE _dlHandle = LoadLibrary(_filename.c_str()); - #else - if (!_filename.hasSuffix("scummvm.dll") && - !_filename.hasSuffix("libstdc++-6.dll") && - !_filename.hasSuffix("libgcc_s_sjlj-1.dll")) { - // skip loading the core scummvm module and runtime dlls - _dlHandle = LoadLibrary(toUnicode(_filename.c_str())); - } else { - // do not generate misleading error message - return false; - } - #endif +#else + _dlHandle = LoadLibrary(toUnicode(_filename.c_str())); +#endif if (!_dlHandle) { debug("Failed loading plugin '%s' (error code %d)", _filename.c_str(), (int32) GetLastError()); @@ -111,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/saves/posix/posix-saves.cpp b/backends/saves/posix/posix-saves.cpp index 5145a03c11..e04609be5b 100644 --- a/backends/saves/posix/posix-saves.cpp +++ b/backends/saves/posix/posix-saves.cpp @@ -21,13 +21,14 @@ */ -// 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" @@ -50,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"); @@ -59,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(); @@ -132,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 b7ee7ff5b8..160075d3db 100644 --- a/backends/saves/posix/posix-saves.h +++ b/backends/saves/posix/posix-saves.h @@ -25,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 @@ -35,7 +35,6 @@ class POSIXSaveFileManager : public DefaultSaveFileManager { public: POSIXSaveFileManager(); -// POSIXSaveFileManager(const Common::String &defaultSavepath); protected: /** diff --git a/backends/vkeybd/image-map.h b/backends/vkeybd/image-map.h index 020bf70c67..3bd8cfa0db 100644 --- a/backends/vkeybd/image-map.h +++ b/backends/vkeybd/image-map.h @@ -23,9 +23,10 @@ #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/polygon.h b/backends/vkeybd/polygon.h index bc76dfb4d7..19a12a0409 100644 --- a/backends/vkeybd/polygon.h +++ b/backends/vkeybd/polygon.h @@ -23,9 +23,10 @@ #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.h b/backends/vkeybd/virtual-keyboard-gui.h index e3798569fb..da80ef2223 100644 --- a/backends/vkeybd/virtual-keyboard-gui.h +++ b/backends/vkeybd/virtual-keyboard-gui.h @@ -23,10 +23,11 @@ #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.h b/backends/vkeybd/virtual-keyboard-parser.h index a5d0e0e4f1..eb25ebe6fd 100644 --- a/backends/vkeybd/virtual-keyboard-parser.h +++ b/backends/vkeybd/virtual-keyboard-parser.h @@ -23,9 +23,10 @@ #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.h b/backends/vkeybd/virtual-keyboard.h index 4936275e23..21db5a47da 100644 --- a/backends/vkeybd/virtual-keyboard.h +++ b/backends/vkeybd/virtual-keyboard.h @@ -23,11 +23,12 @@ #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 1ca4a642c8..e34cde4779 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -23,6 +23,8 @@ // 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" @@ -50,7 +52,7 @@ static const char USAGE_STRING[] = ; // DONT FIXME: DO NOT ORDER ALPHABETICALLY, THIS IS ORDERED BY IMPORTANCE/CATEGORY! :) -#if defined(__SYMBIAN32__) || defined(__GP32__) || defined(ANDROID) +#if defined(__SYMBIAN32__) || defined(__GP32__) || defined(ANDROID) || defined(__DS__) static const char HELP_STRING[] = "NoUsageString"; // save more data segment space #else static const char HELP_STRING[] = @@ -144,7 +146,7 @@ static void usage(const char *s, ...) { vsnprintf(buf, STRINGBUFLEN, s, va); va_end(va); -#if !(defined(__GP32__) || defined (__SYMBIAN32__)) +#if !(defined(__GP32__) || defined (__SYMBIAN32__) || defined(__DS__)) printf(USAGE_STRING, s_appName, buf, s_appName, s_appName); #endif exit(1); @@ -885,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 @@ -894,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 @@ -958,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); @@ -992,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 4e611d97bf..2798ab0934 100644 --- a/base/commandLine.h +++ b/base/commandLine.h @@ -32,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 4ed70a5587..906f4c9242 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -349,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/plugins.h b/base/plugins.h index 247564171d..a1ae734159 100644 --- a/base/plugins.h +++ b/base/plugins.h @@ -80,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 6a670c1a40..3083034714 100644 --- a/base/version.cpp +++ b/base/version.cpp @@ -112,5 +112,9 @@ const char *gScummVMFeatures = "" #ifdef USE_THEORADEC "Theora " #endif + +#ifdef USE_FAAD + "AAC " +#endif ; diff --git a/common/algorithm.h b/common/algorithm.h index be810d6e9d..00c0e1c98f 100644 --- a/common/algorithm.h +++ b/common/algorithm.h @@ -234,6 +234,13 @@ void sort(T first, T last) { sort(first, last, Common::Less<typename T::ValueType>()); } +// 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. */ @@ -256,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/error.cpp b/common/error.cpp index f150f268c0..a6c52a0ce9 100644 --- a/common/error.cpp +++ b/common/error.cpp @@ -67,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 c06cec4a0b..23c12b67e4 100644 --- a/common/error.h +++ b/common/error.h @@ -47,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 @@ -63,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 11eb0c316e..371080c1b2 100644 --- a/common/events.h +++ b/common/events.h @@ -306,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/forbidden.h b/common/forbidden.h index d769ff38be..c551110d0e 100644 --- a/common/forbidden.h +++ b/common/forbidden.h @@ -125,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 @@ -140,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 @@ -281,6 +327,27 @@ #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/module.mk b/common/module.mk index a57de6a4b8..5f6a529595 100644 --- a/common/module.mk +++ b/common/module.mk @@ -17,6 +17,7 @@ MODULE_OBJS := \ memorypool.o \ md5.o \ mutex.o \ + quicktime.o \ random.o \ rational.o \ str.o \ diff --git a/common/quicktime.cpp b/common/quicktime.cpp new file mode 100644 index 0000000000..57534b301a --- /dev/null +++ b/common/quicktime.cpp @@ -0,0 +1,814 @@ +/* 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$ + * + */ + +// +// Heavily based on ffmpeg code. +// +// Copyright (c) 2001 Fabrice Bellard. +// First version by Francois Revol revol@free.fr +// Seek function by Gael Chardon gael.dev@4now.net +// + +#include "common/debug.h" +#include "common/endian.h" +#include "common/macresman.h" +#include "common/memstream.h" +#include "common/quicktime.h" +#include "common/textconsole.h" +#include "common/util.h" +#include "common/zlib.h" + +namespace Common { + +//////////////////////////////////////////// +// QuickTimeParser +//////////////////////////////////////////// + +QuickTimeParser::QuickTimeParser() { + _beginOffset = 0; + _fd = 0; + _scaleFactorX = 1; + _scaleFactorY = 1; + _resFork = new Common::MacResManager(); + _disposeFileHandle = DisposeAfterUse::YES; + + initParseTable(); +} + +QuickTimeParser::~QuickTimeParser() { + close(); + delete _resFork; +} + +bool QuickTimeParser::parseFile(const Common::String &filename) { + if (!_resFork->open(filename) || !_resFork->hasDataFork()) + return false; + + _foundMOOV = false; + _disposeFileHandle = DisposeAfterUse::YES; + + Atom atom = { 0, 0, 0xffffffff }; + + if (_resFork->hasResFork()) { + // Search for a 'moov' resource + Common::MacResIDArray idArray = _resFork->getResIDArray(MKTAG('m', 'o', 'o', 'v')); + + if (!idArray.empty()) + _fd = _resFork->getResource(MKTAG('m', 'o', 'o', 'v'), idArray[0]); + + if (_fd) { + atom.size = _fd->size(); + if (readDefault(atom) < 0 || !_foundMOOV) + return false; + } + delete _fd; + + atom.type = 0; + atom.offset = 0; + atom.size = 0xffffffff; + } + + _fd = _resFork->getDataFork(); + + if (readDefault(atom) < 0 || !_foundMOOV) + return false; + + init(); + return true; +} + +bool QuickTimeParser::parseStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeFileHandle) { + _fd = stream; + _foundMOOV = false; + _disposeFileHandle = disposeFileHandle; + + Atom atom = { 0, 0, 0xffffffff }; + + if (readDefault(atom) < 0 || !_foundMOOV) { + close(); + return false; + } + + init(); + return true; +} + +void QuickTimeParser::init() { + // Remove unknown/unhandled tracks + for (uint32 i = 0; i < _tracks.size(); i++) { + if (_tracks[i]->codecType == CODEC_TYPE_MOV_OTHER) { + delete _tracks[i]; + _tracks.remove_at(i); + i--; + } + } + + // Adjust time scale + for (uint32 i = 0; i < _tracks.size(); i++) + if (!_tracks[i]->timeScale) + _tracks[i]->timeScale = _timeScale; +} + +void QuickTimeParser::initParseTable() { + static const ParseTable p[] = { + { &QuickTimeParser::readDefault, MKTAG('d', 'i', 'n', 'f') }, + { &QuickTimeParser::readLeaf, MKTAG('d', 'r', 'e', 'f') }, + { &QuickTimeParser::readDefault, MKTAG('e', 'd', 't', 's') }, + { &QuickTimeParser::readELST, MKTAG('e', 'l', 's', 't') }, + { &QuickTimeParser::readHDLR, MKTAG('h', 'd', 'l', 'r') }, + { &QuickTimeParser::readDefault, MKTAG('m', 'd', 'a', 't') }, + { &QuickTimeParser::readMDHD, MKTAG('m', 'd', 'h', 'd') }, + { &QuickTimeParser::readDefault, MKTAG('m', 'd', 'i', 'a') }, + { &QuickTimeParser::readDefault, MKTAG('m', 'i', 'n', 'f') }, + { &QuickTimeParser::readMOOV, MKTAG('m', 'o', 'o', 'v') }, + { &QuickTimeParser::readMVHD, MKTAG('m', 'v', 'h', 'd') }, + { &QuickTimeParser::readLeaf, MKTAG('s', 'm', 'h', 'd') }, + { &QuickTimeParser::readDefault, MKTAG('s', 't', 'b', 'l') }, + { &QuickTimeParser::readSTCO, MKTAG('s', 't', 'c', 'o') }, + { &QuickTimeParser::readSTSC, MKTAG('s', 't', 's', 'c') }, + { &QuickTimeParser::readSTSD, MKTAG('s', 't', 's', 'd') }, + { &QuickTimeParser::readSTSS, MKTAG('s', 't', 's', 's') }, + { &QuickTimeParser::readSTSZ, MKTAG('s', 't', 's', 'z') }, + { &QuickTimeParser::readSTTS, MKTAG('s', 't', 't', 's') }, + { &QuickTimeParser::readTKHD, MKTAG('t', 'k', 'h', 'd') }, + { &QuickTimeParser::readTRAK, MKTAG('t', 'r', 'a', 'k') }, + { &QuickTimeParser::readLeaf, MKTAG('u', 'd', 't', 'a') }, + { &QuickTimeParser::readLeaf, MKTAG('v', 'm', 'h', 'd') }, + { &QuickTimeParser::readCMOV, MKTAG('c', 'm', 'o', 'v') }, + { &QuickTimeParser::readWAVE, MKTAG('w', 'a', 'v', 'e') }, + { &QuickTimeParser::readESDS, MKTAG('e', 's', 'd', 's') }, + { 0, 0 } + }; + + _parseTable = p; +} + +int QuickTimeParser::readDefault(Atom atom) { + uint32 total_size = 0; + Atom a; + int err = 0; + + a.offset = atom.offset; + + while(((total_size + 8) < atom.size) && !_fd->eos() && _fd->pos() < _fd->size() && !err) { + a.size = atom.size; + a.type = 0; + + if (atom.size >= 8) { + a.size = _fd->readUint32BE(); + a.type = _fd->readUint32BE(); + + // Some QuickTime videos with resource forks have mdat chunks + // that are of size 0. Adjust it so it's the correct size. + if (a.type == MKTAG('m', 'd', 'a', 't') && a.size == 0) + a.size = _fd->size(); + } + + total_size += 8; + a.offset += 8; + debug(4, "type: %08x %.4s sz: %x %x %x", a.type, tag2str(a.type), a.size, atom.size, total_size); + + if (a.size == 1) { // 64 bit extended size + warning("64 bit extended size is not supported in QuickTime"); + return -1; + } + + if (a.size == 0) { + a.size = atom.size - total_size; + if (a.size <= 8) + break; + } + + uint32 i = 0; + + for (; _parseTable[i].type != 0 && _parseTable[i].type != a.type; i++) + ; // Empty + + if (a.size < 8) + break; + + a.size -= 8; + + if (_parseTable[i].type == 0) { // skip leaf atoms data + debug(0, ">>> Skipped [%s]", tag2str(a.type)); + + _fd->seek(a.size, SEEK_CUR); + } else { + uint32 start_pos = _fd->pos(); + err = (this->*_parseTable[i].func)(a); + + uint32 left = a.size - _fd->pos() + start_pos; + + if (left > 0) // skip garbage at atom end + _fd->seek(left, SEEK_CUR); + } + + a.offset += a.size; + total_size += a.size; + } + + if (!err && total_size < atom.size) + _fd->seek(atom.size - total_size, SEEK_SET); + + return err; +} + +int QuickTimeParser::readLeaf(Atom atom) { + if (atom.size > 1) + _fd->seek(atom.size, SEEK_SET); + + return 0; +} + +int QuickTimeParser::readMOOV(Atom atom) { + if (readDefault(atom) < 0) + return -1; + + // We parsed the 'moov' atom, so we don't need anything else + _foundMOOV = true; + return 1; +} + +int QuickTimeParser::readCMOV(Atom atom) { +#ifdef USE_ZLIB + // Read in the dcom atom + _fd->readUint32BE(); + if (_fd->readUint32BE() != MKTAG('d', 'c', 'o', 'm')) + return -1; + if (_fd->readUint32BE() != MKTAG('z', 'l', 'i', 'b')) { + warning("Unknown cmov compression type"); + return -1; + } + + // Read in the cmvd atom + uint32 compressedSize = _fd->readUint32BE() - 12; + if (_fd->readUint32BE() != MKTAG('c', 'm', 'v', 'd')) + return -1; + uint32 uncompressedSize = _fd->readUint32BE(); + + // Read in data + byte *compressedData = (byte *)malloc(compressedSize); + _fd->read(compressedData, compressedSize); + + // Create uncompressed stream + byte *uncompressedData = (byte *)malloc(uncompressedSize); + + // Uncompress the data + unsigned long dstLen = uncompressedSize; + if (!Common::uncompress(uncompressedData, &dstLen, compressedData, compressedSize)) { + warning ("Could not uncompress cmov chunk"); + free(compressedData); + free(uncompressedData); + return -1; + } + + // Load data into a new MemoryReadStream and assign _fd to be that + Common::SeekableReadStream *oldStream = _fd; + _fd = new Common::MemoryReadStream(uncompressedData, uncompressedSize, DisposeAfterUse::YES); + + // Read the contents of the uncompressed data + Atom a = { MKTAG('m', 'o', 'o', 'v'), 0, uncompressedSize }; + int err = readDefault(a); + + // Assign the file handle back to the original handle + free(compressedData); + delete _fd; + _fd = oldStream; + + return err; +#else + warning ("zlib not found, cannot read QuickTime cmov atom"); + return -1; +#endif +} + +int QuickTimeParser::readMVHD(Atom atom) { + byte version = _fd->readByte(); // version + _fd->readByte(); _fd->readByte(); _fd->readByte(); // flags + + if (version == 1) { + warning("QuickTime version 1"); + _fd->readUint32BE(); _fd->readUint32BE(); + _fd->readUint32BE(); _fd->readUint32BE(); + } else { + _fd->readUint32BE(); // creation time + _fd->readUint32BE(); // modification time + } + + _timeScale = _fd->readUint32BE(); // time scale + debug(0, "time scale = %i\n", _timeScale); + + // duration + _duration = (version == 1) ? (_fd->readUint32BE(), _fd->readUint32BE()) : _fd->readUint32BE(); + _fd->readUint32BE(); // preferred scale + + _fd->readUint16BE(); // preferred volume + + _fd->seek(10, SEEK_CUR); // reserved + + // We only need two values from the movie display matrix. Most of the values are just + // skipped. xMod and yMod are 16:16 fixed point numbers, the last part of the 3x3 matrix + // is 2:30. + uint32 xMod = _fd->readUint32BE(); + _fd->skip(12); + uint32 yMod = _fd->readUint32BE(); + _fd->skip(16); + + _scaleFactorX = Common::Rational(0x10000, xMod); + _scaleFactorY = Common::Rational(0x10000, yMod); + + _scaleFactorX.debugPrint(1, "readMVHD(): scaleFactorX ="); + _scaleFactorY.debugPrint(1, "readMVHD(): scaleFactorY ="); + + _fd->readUint32BE(); // preview time + _fd->readUint32BE(); // preview duration + _fd->readUint32BE(); // poster time + _fd->readUint32BE(); // selection time + _fd->readUint32BE(); // selection duration + _fd->readUint32BE(); // current time + _fd->readUint32BE(); // next track ID + + return 0; +} + +int QuickTimeParser::readTRAK(Atom atom) { + Track *track = new Track(); + + if (!track) + return -1; + + track->codecType = CODEC_TYPE_MOV_OTHER; + track->startTime = 0; // XXX: check + _tracks.push_back(track); + + return readDefault(atom); +} + +int QuickTimeParser::readTKHD(Atom atom) { + Track *track = _tracks.back(); + byte version = _fd->readByte(); + + _fd->readByte(); _fd->readByte(); + _fd->readByte(); // flags + // + //MOV_TRACK_ENABLED 0x0001 + //MOV_TRACK_IN_MOVIE 0x0002 + //MOV_TRACK_IN_PREVIEW 0x0004 + //MOV_TRACK_IN_POSTER 0x0008 + // + + if (version == 1) { + _fd->readUint32BE(); _fd->readUint32BE(); + _fd->readUint32BE(); _fd->readUint32BE(); + } else { + _fd->readUint32BE(); // creation time + _fd->readUint32BE(); // modification time + } + + /* track->id = */_fd->readUint32BE(); // track id (NOT 0 !) + _fd->readUint32BE(); // reserved + //track->startTime = 0; // check + (version == 1) ? (_fd->readUint32BE(), _fd->readUint32BE()) : _fd->readUint32BE(); // highlevel (considering edits) duration in movie timebase + _fd->readUint32BE(); // reserved + _fd->readUint32BE(); // reserved + + _fd->readUint16BE(); // layer + _fd->readUint16BE(); // alternate group + _fd->readUint16BE(); // volume + _fd->readUint16BE(); // reserved + + // We only need the two values from the displacement matrix for a track. + // See readMVHD() for more information. + uint32 xMod = _fd->readUint32BE(); + _fd->skip(12); + uint32 yMod = _fd->readUint32BE(); + _fd->skip(16); + + track->scaleFactorX = Common::Rational(0x10000, xMod); + track->scaleFactorY = Common::Rational(0x10000, yMod); + + track->scaleFactorX.debugPrint(1, "readTKHD(): scaleFactorX ="); + track->scaleFactorY.debugPrint(1, "readTKHD(): scaleFactorY ="); + + // these are fixed-point, 16:16 + // uint32 tkWidth = _fd->readUint32BE() >> 16; // track width + // uint32 tkHeight = _fd->readUint32BE() >> 16; // track height + + return 0; +} + +// edit list atom +int QuickTimeParser::readELST(Atom atom) { + Track *track = _tracks.back(); + + _fd->readByte(); // version + _fd->readByte(); _fd->readByte(); _fd->readByte(); // flags + + track->editCount = _fd->readUint32BE(); + track->editList = new EditListEntry[track->editCount]; + + debug(2, "Track %d edit list count: %d", _tracks.size() - 1, track->editCount); + + for (uint32 i = 0; i < track->editCount; i++){ + track->editList[i].trackDuration = _fd->readUint32BE(); + track->editList[i].mediaTime = _fd->readSint32BE(); + track->editList[i].mediaRate = Common::Rational(_fd->readUint32BE(), 0x10000); + debugN(3, "\tDuration = %d, Media Time = %d, ", track->editList[i].trackDuration, track->editList[i].mediaTime); + track->editList[i].mediaRate.debugPrint(3, "Media Rate ="); + } + + if (track->editCount != 1) + warning("Multiple edit list entries. Things may go awry"); + + return 0; +} + +int QuickTimeParser::readHDLR(Atom atom) { + Track *track = _tracks.back(); + + _fd->readByte(); // version + _fd->readByte(); _fd->readByte(); _fd->readByte(); // flags + + // component type + uint32 ctype = _fd->readUint32BE(); + uint32 type = _fd->readUint32BE(); // component subtype + + debug(0, "ctype= %s (0x%08lx)", tag2str(ctype), (long)ctype); + debug(0, "stype= %s", tag2str(type)); + + if (ctype == MKTAG('m', 'h', 'l', 'r')) // MOV + debug(0, "MOV detected"); + else if (ctype == 0) + debug(0, "MPEG-4 detected"); + + if (type == MKTAG('v', 'i', 'd', 'e')) + track->codecType = CODEC_TYPE_VIDEO; + else if (type == MKTAG('s', 'o', 'u', 'n')) + track->codecType = CODEC_TYPE_AUDIO; + + _fd->readUint32BE(); // component manufacture + _fd->readUint32BE(); // component flags + _fd->readUint32BE(); // component flags mask + + if (atom.size <= 24) + return 0; // nothing left to read + + // .mov: PASCAL string + byte len = _fd->readByte(); + _fd->seek(len, SEEK_CUR); + + _fd->seek(atom.size - (_fd->pos() - atom.offset), SEEK_CUR); + + return 0; +} + +int QuickTimeParser::readMDHD(Atom atom) { + Track *track = _tracks.back(); + byte version = _fd->readByte(); + + if (version > 1) + return 1; // unsupported + + _fd->readByte(); _fd->readByte(); + _fd->readByte(); // flags + + if (version == 1) { + _fd->readUint32BE(); _fd->readUint32BE(); + _fd->readUint32BE(); _fd->readUint32BE(); + } else { + _fd->readUint32BE(); // creation time + _fd->readUint32BE(); // modification time + } + + track->timeScale = _fd->readUint32BE(); + track->duration = (version == 1) ? (_fd->readUint32BE(), _fd->readUint32BE()) : _fd->readUint32BE(); // duration + + _fd->readUint16BE(); // language + _fd->readUint16BE(); // quality + + return 0; +} + +int QuickTimeParser::readSTSD(Atom atom) { + Track *track = _tracks.back(); + + _fd->readByte(); // version + _fd->readByte(); _fd->readByte(); _fd->readByte(); // flags + + uint32 entryCount = _fd->readUint32BE(); + track->sampleDescs.resize(entryCount); + + for (uint32 i = 0; i < entryCount; i++) { // Parsing Sample description table + Atom a = { 0, 0, 0 }; + uint32 start_pos = _fd->pos(); + int size = _fd->readUint32BE(); // size + uint32 format = _fd->readUint32BE(); // data format + + _fd->readUint32BE(); // reserved + _fd->readUint16BE(); // reserved + _fd->readUint16BE(); // index + + track->sampleDescs[i] = readSampleDesc(track, format); + + debug(0, "size=%d 4CC= %s codec_type=%d", size, tag2str(format), track->codecType); + + if (!track->sampleDescs[i]) { + // other codec type, just skip (rtp, mp4s, tmcd ...) + _fd->seek(size - (_fd->pos() - start_pos), SEEK_CUR); + } + + // this will read extra atoms at the end (wave, alac, damr, avcC, SMI ...) + a.size = size - (_fd->pos() - start_pos); + if (a.size > 8) + readDefault(a); + else if (a.size > 0) + _fd->seek(a.size, SEEK_CUR); + } + + return 0; +} + +int QuickTimeParser::readSTSC(Atom atom) { + Track *track = _tracks.back(); + + _fd->readByte(); // version + _fd->readByte(); _fd->readByte(); _fd->readByte(); // flags + + track->sampleToChunkCount = _fd->readUint32BE(); + + debug(0, "track[%i].stsc.entries = %i", _tracks.size() - 1, track->sampleToChunkCount); + + track->sampleToChunk = new SampleToChunkEntry[track->sampleToChunkCount]; + + if (!track->sampleToChunk) + return -1; + + for (uint32 i = 0; i < track->sampleToChunkCount; i++) { + track->sampleToChunk[i].first = _fd->readUint32BE() - 1; + track->sampleToChunk[i].count = _fd->readUint32BE(); + track->sampleToChunk[i].id = _fd->readUint32BE(); + //warning("Sample to Chunk[%d]: First = %d, Count = %d", i, track->sampleToChunk[i].first, track->sampleToChunk[i].count); + } + + return 0; +} + +int QuickTimeParser::readSTSS(Atom atom) { + Track *track = _tracks.back(); + + _fd->readByte(); // version + _fd->readByte(); _fd->readByte(); _fd->readByte(); // flags + + track->keyframeCount = _fd->readUint32BE(); + + debug(0, "keyframeCount = %d", track->keyframeCount); + + track->keyframes = new uint32[track->keyframeCount]; + + if (!track->keyframes) + return -1; + + for (uint32 i = 0; i < track->keyframeCount; i++) { + track->keyframes[i] = _fd->readUint32BE() - 1; // Adjust here, the frames are based on 1 + debug(6, "keyframes[%d] = %d", i, track->keyframes[i]); + + } + return 0; +} + +int QuickTimeParser::readSTSZ(Atom atom) { + Track *track = _tracks.back(); + + _fd->readByte(); // version + _fd->readByte(); _fd->readByte(); _fd->readByte(); // flags + + track->sampleSize = _fd->readUint32BE(); + track->sampleCount = _fd->readUint32BE(); + + debug(5, "sampleSize = %d sampleCount = %d", track->sampleSize, track->sampleCount); + + if (track->sampleSize) + return 0; // there isn't any table following + + track->sampleSizes = new uint32[track->sampleCount]; + + if (!track->sampleSizes) + return -1; + + for(uint32 i = 0; i < track->sampleCount; i++) { + track->sampleSizes[i] = _fd->readUint32BE(); + debug(6, "sampleSizes[%d] = %d", i, track->sampleSizes[i]); + } + + return 0; +} + +int QuickTimeParser::readSTTS(Atom atom) { + Track *track = _tracks.back(); + uint32 totalSampleCount = 0; + + _fd->readByte(); // version + _fd->readByte(); _fd->readByte(); _fd->readByte(); // flags + + track->timeToSampleCount = _fd->readUint32BE(); + track->timeToSample = new TimeToSampleEntry[track->timeToSampleCount]; + + debug(0, "track[%d].stts.entries = %d", _tracks.size() - 1, track->timeToSampleCount); + + for (int32 i = 0; i < track->timeToSampleCount; i++) { + track->timeToSample[i].count = _fd->readUint32BE(); + track->timeToSample[i].duration = _fd->readUint32BE(); + + debug(1, "\tCount = %d, Duration = %d", track->timeToSample[i].count, track->timeToSample[i].duration); + + totalSampleCount += track->timeToSample[i].count; + } + + track->frameCount = totalSampleCount; + return 0; +} + +int QuickTimeParser::readSTCO(Atom atom) { + Track *track = _tracks.back(); + + _fd->readByte(); // version + _fd->readByte(); _fd->readByte(); _fd->readByte(); // flags + + track->chunkCount = _fd->readUint32BE(); + track->chunkOffsets = new uint32[track->chunkCount]; + + if (!track->chunkOffsets) + return -1; + + for (uint32 i = 0; i < track->chunkCount; i++) { + // WORKAROUND/HACK: The offsets in Riven videos (ones inside the Mohawk archives themselves) + // have offsets relative to the archive and not the video. This is quite nasty. We subtract + // the initial offset of the stream to get the correct value inside of the stream. + track->chunkOffsets[i] = _fd->readUint32BE() - _beginOffset; + } + + return 0; +} + +int QuickTimeParser::readWAVE(Atom atom) { + if (_tracks.empty()) + return 0; + + Track *track = _tracks.back(); + + if (atom.size > (1 << 30)) + return -1; + + if (track->sampleDescs[0]->getCodecTag() == MKTAG('Q', 'D', 'M', '2')) // Read extra data for QDM2 + track->extraData = _fd->readStream(atom.size - 8); + else if (atom.size > 8) + return readDefault(atom); + else + _fd->skip(atom.size); + + return 0; +} + +enum { + kMP4IODescTag = 2, + kMP4ESDescTag = 3, + kMP4DecConfigDescTag = 4, + kMP4DecSpecificDescTag = 5 +}; + +static int readMP4DescLength(Common::SeekableReadStream *stream) { + int length = 0; + int count = 4; + + while (count--) { + byte c = stream->readByte(); + length = (length << 7) | (c & 0x7f); + + if (!(c & 0x80)) + break; + } + + return length; +} + +static void readMP4Desc(Common::SeekableReadStream *stream, byte &tag, int &length) { + tag = stream->readByte(); + length = readMP4DescLength(stream); +} + +int QuickTimeParser::readESDS(Atom atom) { + if (_tracks.empty()) + return 0; + + Track *track = _tracks.back(); + + _fd->readUint32BE(); // version + flags + + byte tag; + int length; + + readMP4Desc(_fd, tag, length); + _fd->readUint16BE(); // id + if (tag == kMP4ESDescTag) + _fd->readByte(); // priority + + // Check if we've got the Config MPEG-4 header + readMP4Desc(_fd, tag, length); + if (tag != kMP4DecConfigDescTag) + return 0; + + track->objectTypeMP4 = _fd->readByte(); + _fd->readByte(); // stream type + _fd->readUint16BE(); _fd->readByte(); // buffer size + _fd->readUint32BE(); // max bitrate + _fd->readUint32BE(); // avg bitrate + + // Check if we've got the Specific MPEG-4 header + readMP4Desc(_fd, tag, length); + if (tag != kMP4DecSpecificDescTag) + return 0; + + track->extraData = _fd->readStream(length); + + debug(0, "MPEG-4 object type = %02x", track->objectTypeMP4); + return 0; +} + +void QuickTimeParser::close() { + for (uint32 i = 0; i < _tracks.size(); i++) + delete _tracks[i]; + + _tracks.clear(); + + if (_disposeFileHandle == DisposeAfterUse::YES) + delete _fd; + + _fd = 0; +} + +QuickTimeParser::SampleDesc::SampleDesc(Track *parentTrack, uint32 codecTag) { + _parentTrack = parentTrack; + _codecTag = codecTag; +} + +QuickTimeParser::Track::Track() { + chunkCount = 0; + chunkOffsets = 0; + timeToSampleCount = 0; + timeToSample = 0; + sampleToChunkCount = 0; + sampleToChunk = 0; + sampleSize = 0; + sampleCount = 0; + sampleSizes = 0; + keyframeCount = 0; + keyframes = 0; + timeScale = 0; + width = 0; + height = 0; + codecType = CODEC_TYPE_MOV_OTHER; + editCount = 0; + editList = 0; + extraData = 0; + frameCount = 0; + duration = 0; + startTime = 0; + objectTypeMP4 = 0; +} + +QuickTimeParser::Track::~Track() { + delete[] chunkOffsets; + delete[] timeToSample; + delete[] sampleToChunk; + delete[] sampleSizes; + delete[] keyframes; + delete[] editList; + delete extraData; + + for (uint32 i = 0; i < sampleDescs.size(); i++) + delete sampleDescs[i]; +} + +} // End of namespace Video diff --git a/common/quicktime.h b/common/quicktime.h new file mode 100644 index 0000000000..cb2bed1202 --- /dev/null +++ b/common/quicktime.h @@ -0,0 +1,213 @@ +/* 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$ + * + */ + +// +// Heavily based on ffmpeg code. +// +// Copyright (c) 2001 Fabrice Bellard. +// First version by Francois Revol revol@free.fr +// Seek function by Gael Chardon gael.dev@4now.net +// + +#ifndef COMMON_QUICKTIME_H +#define COMMON_QUICKTIME_H + +#include "common/array.h" +#include "common/scummsys.h" +#include "common/stream.h" +#include "common/rational.h" + +namespace Common { + class MacResManager; + +/** + * Parser for QuickTime/MPEG-4 files. + * + * File parser used in engines: + * - groovie + * - mohawk + * - sci + */ +class QuickTimeParser { +public: + QuickTimeParser(); + virtual ~QuickTimeParser(); + + /** + * Load a QuickTime file + * @param filename the filename to load + */ + bool parseFile(const Common::String &filename); + + /** + * Load a QuickTime file from a SeekableReadStream + * @param stream the stream to load + * @param disposeFileHandle whether to delete the stream after use + */ + bool parseStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeFileHandle = DisposeAfterUse::YES); + + /** + * Close a QuickTime file + */ + void close(); + + /** + * Set the beginning offset of the video so we can modify the offsets in the stco + * atom of videos inside the Mohawk archives + * @param the beginning offset of the video + */ + void setChunkBeginOffset(uint32 offset) { _beginOffset = offset; } + + bool isOpen() const { return _fd != 0; } + +protected: + // This is the file handle from which data is read from. It can be the actual file handle or a decompressed stream. + Common::SeekableReadStream *_fd; + + DisposeAfterUse::Flag _disposeFileHandle; + + struct Atom { + uint32 type; + uint32 offset; + uint32 size; + }; + + struct ParseTable { + int (QuickTimeParser::*func)(Atom atom); + uint32 type; + }; + + struct TimeToSampleEntry { + int count; + int duration; + }; + + struct SampleToChunkEntry { + uint32 first; + uint32 count; + uint32 id; + }; + + struct EditListEntry { + uint32 trackDuration; + int32 mediaTime; + Common::Rational mediaRate; + }; + + struct Track; + + class SampleDesc { + public: + SampleDesc(Track *parentTrack, uint32 codecTag); + virtual ~SampleDesc() {} + + uint32 getCodecTag() const { return _codecTag; } + + protected: + Track *_parentTrack; + uint32 _codecTag; + }; + + enum CodecType { + CODEC_TYPE_MOV_OTHER, + CODEC_TYPE_VIDEO, + CODEC_TYPE_AUDIO + }; + + struct Track { + Track(); + ~Track(); + + uint32 chunkCount; + uint32 *chunkOffsets; + int timeToSampleCount; + TimeToSampleEntry *timeToSample; + uint32 sampleToChunkCount; + SampleToChunkEntry *sampleToChunk; + uint32 sampleSize; + uint32 sampleCount; + uint32 *sampleSizes; + uint32 keyframeCount; + uint32 *keyframes; + int32 timeScale; + + uint16 width; + uint16 height; + CodecType codecType; + + Common::Array<SampleDesc *> sampleDescs; + + uint32 editCount; + EditListEntry *editList; + + Common::SeekableReadStream *extraData; + + uint32 frameCount; + uint32 duration; + uint32 startTime; + Common::Rational scaleFactorX; + Common::Rational scaleFactorY; + + byte objectTypeMP4; + }; + + virtual SampleDesc *readSampleDesc(Track *track, uint32 format) = 0; + + const ParseTable *_parseTable; + bool _foundMOOV; + uint32 _timeScale; + uint32 _duration; + Common::Rational _scaleFactorX; + Common::Rational _scaleFactorY; + Common::Array<Track *> _tracks; + uint32 _beginOffset; + Common::MacResManager *_resFork; + + void initParseTable(); + void init(); + + int readDefault(Atom atom); + int readLeaf(Atom atom); + int readELST(Atom atom); + int readHDLR(Atom atom); + int readMDHD(Atom atom); + int readMOOV(Atom atom); + int readMVHD(Atom atom); + int readTKHD(Atom atom); + int readTRAK(Atom atom); + int readSTCO(Atom atom); + int readSTSC(Atom atom); + int readSTSD(Atom atom); + int readSTSS(Atom atom); + int readSTSZ(Atom atom); + int readSTTS(Atom atom); + int readCMOV(Atom atom); + int readWAVE(Atom atom); + int readESDS(Atom atom); +}; + +} // End of namespace Common + +#endif diff --git a/common/savefile.h b/common/savefile.h index 40f316267f..03a7b52add 100644 --- a/common/savefile.h +++ b/common/savefile.h @@ -142,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 2420349245..a425befecf 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -40,10 +40,42 @@ #if defined(WIN32) #ifdef _MSC_VER - // vsnprintf is already defined in Visual Studio 2008 - #if (_MSC_VER < 1500) - #define vsnprintf _vsnprintf - #endif + + // FIXME: The placement of the workaround functions for MSVC below + // require us to include stdio.h and stdarg.h for MSVC here. This + // is not exactly nice... + // We should think of a better way of doing this. + #include <stdio.h> + #include <stdarg.h> + + // MSVC's vsnprintf is either non-existant (2003) or bugged since it + // does not always include a terminating NULL (2005+). To work around + // that we fix up the _vsnprintf included. Note that the return value + // will still not match C99's specs! + inline int vsnprintf_msvc(char *str, size_t size, const char *format, va_list args) { + // We do not pass size - 1 here, to ensure we would get the same + // return value as when we would use _vsnprintf directly, since + // for example Common::String::format relies on this. + int retValue = _vsnprintf(str, size, format, args); + str[size - 1] = 0; + return retValue; + } + + #define vsnprintf vsnprintf_msvc + + // Visual Studio does not include snprintf in its standard C library. + // Instead it includes a function called _snprintf with somewhat + // similar semantics. The minor difference is that the return value in + // case the formatted string exceeds the buffer size is different. + // A much more dangerous one is that _snprintf does not always include + // a terminating null (Whoops!). Instead we map to our fixed vsnprintf. + inline int snprintf(char *str, size_t size, const char *format, ...) { + va_list args; + va_start(args, format); + int len = vsnprintf(str, size, format, args); + va_end(args); + return len; + } #endif #if !defined(_WIN32_WCE) @@ -107,21 +139,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. @@ -151,88 +168,50 @@ // #define SCUMMVM_USE_PRAGMA_PACK +// +// Determine the host endianess and whether memory alignment is required. +// +#if !defined(HAVE_CONFIG_H) -#if defined(HAVE_CONFIG_H) - // All settings should have been set in config.h - -#elif defined(__SYMBIAN32__) - - #define SCUMM_LITTLE_ENDIAN - #define SCUMM_NEED_ALIGNMENT + #if defined(__DC__) || \ + defined(__DS__) || \ + defined(__GP32__) || \ + defined(IPHONE) || \ + defined(__PLAYSTATION2__) || \ + defined(__PSP__) || \ + defined(__SYMBIAN32__) -#elif defined(_WIN32_WCE) + #define SCUMM_LITTLE_ENDIAN + #define SCUMM_NEED_ALIGNMENT - #define SCUMM_LITTLE_ENDIAN + #elif defined(_WIN32_WCE) || defined(_MSC_VER) || defined(__MINGW32__) -#elif defined(_MSC_VER) + #define SCUMM_LITTLE_ENDIAN - #define SCUMM_LITTLE_ENDIAN + #elif defined(__amigaos4__) || defined(__N64__) || defined(__WII__) -#elif defined(__MINGW32__) + #define SCUMM_BIG_ENDIAN + #define SCUMM_NEED_ALIGNMENT - #define SCUMM_LITTLE_ENDIAN + #elif defined(SDL_BACKEND) + // On SDL based ports, we try to use SDL_BYTEORDER to determine the + // endianess. We explicitly do this as the *last* thing we try, so that + // platform specific settings have precedence. + #include <SDL_endian.h> -#elif defined(SDL_BACKEND) - /* need this for the SDL_BYTEORDER define */ - #include <SDL_byteorder.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 - #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(__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 - -#elif defined(IPHONE) - - #define SCUMM_LITTLE_ENDIAN - #define SCUMM_NEED_ALIGNMENT + #error No system type defined, host endianess unknown. -#else - #error No system type defined - + #endif #endif @@ -240,17 +219,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. @@ -309,7 +278,7 @@ #if defined(_MSC_VER) #define NORETURN_PRE __declspec(noreturn) #else - #define NORETURN_PRE + #define NORETURN_PRE #endif #endif @@ -317,7 +286,7 @@ #if defined(__GNUC__) || defined(__INTEL_COMPILER) #define NORETURN_POST __attribute__((__noreturn__)) #else - #define NORETURN_POST + #define NORETURN_POST #endif #endif @@ -335,87 +304,25 @@ // -// 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) - - #if 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(__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(__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(__DS__) - - // Do nothing, the SDK defines all types we need in nds/ndstypes.h, - // which we include in our portsdef.h - - #else - - typedef unsigned char byte; - typedef unsigned char uint8; - typedef signed char int8; - typedef unsigned short uint16; - typedef signed short int16; - typedef unsigned int uint32; - typedef signed int int32; - typedef unsigned int uint; - - #endif - +#if !defined(HAVE_CONFIG_H) && !defined(SCUMMVM_DONT_DEFINE_TYPES) + typedef unsigned char byte; + typedef unsigned char uint8; + typedef signed char int8; + typedef unsigned short uint16; + typedef signed short int16; + typedef unsigned int uint32; + typedef signed int int32; + typedef unsigned int uint; #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" diff --git a/common/str.cpp b/common/str.cpp index 08a6cb6822..740e7b6a06 100644 --- a/common/str.cpp +++ b/common/str.cpp @@ -833,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 b76e4f8448..7b97dfe945 100644 --- a/common/str.h +++ b/common/str.h @@ -38,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: @@ -378,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/system.h b/common/system.h index e02779fe47..b584739b77 100644 --- a/common/system.h +++ b/common/system.h @@ -1031,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 0bd233d206..f2325ac9ad 100644 --- a/common/textconsole.cpp +++ b/common/textconsole.cpp @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#define FORBIDDEN_SYMBOL_EXCEPTION_exit + #include "common/textconsole.h" #include "common/system.h" #include "common/str.h" diff --git a/common/unzip.cpp b/common/unzip.cpp index f0590dcbfd..91f352f40a 100644 --- a/common/unzip.cpp +++ b/common/unzip.cpp @@ -349,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 */ @@ -1073,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)) @@ -1096,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 @@ -1365,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 @@ -1373,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/util.cpp b/common/util.cpp index eed7009f90..a7ec1a9de7 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -211,6 +211,7 @@ const PlatformDescription g_platforms[] = { { "windows", "win", "win", "Windows", kPlatformWindows }, { "playstation", "psx", "psx", "Sony PlayStation", kPlatformPSX }, { "cdi", "cdi", "cdi", "Philips CD-i", kPlatformCDi }, + { "ios", "ios", "ios", "Apple iOS", kPlatformIOS }, { 0, 0, 0, "Default", kPlatformUnknown } }; diff --git a/common/util.h b/common/util.h index 5d965c4d31..5837c8beab 100644 --- a/common/util.h +++ b/common/util.h @@ -172,6 +172,7 @@ enum Platform { kPlatformWii, kPlatformPSX, kPlatformCDi, + kPlatformIOS, kPlatformUnknown = -1 }; @@ -88,7 +88,7 @@ add_engine groovie "Groovie" yes "groovie2" add_engine groovie2 "Groovie 2 games" no add_engine hugo "Hugo Trilogy" yes add_engine kyra "Legend of Kyrandia" yes "lol" -add_engine lol "Lands of Lore" no +add_engine lol "Lands of Lore" yes add_engine lastexpress "The Last Express" no add_engine lure "Lure of the Temptress" yes add_engine m4 "M4/MADS" no @@ -131,27 +131,23 @@ _alsa=auto _seq_midi=auto _timidity=auto _zlib=auto -_mpeg2=no _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 @@ -159,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 @@ -180,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, @@ -741,20 +746,18 @@ Optional Libraries: --with-zlib-prefix=DIR Prefix where zlib is installed (optional) --disable-zlib disable zlib (compression) support [autodetect] - --with-mpeg2-prefix=DIR Prefix where libmpeg2 is installed (optional) - --enable-mpeg2 enable mpeg2 codec for cutscenes [no] - --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] --with-theoradec-prefix=DIR Prefix where libtheoradec is installed (optional) --disable-theoradec disable Theora decoder [autodetect] + --with-faad-prefix=DIR Prefix where libfaad is installed (optional) + --disable-faad disable AAC decoder [autodetect] + --with-fluidsynth-prefix=DIR Prefix where libfluidsynth is installed (optional) --disable-fluidsynth disable fluidsynth MIDI driver [autodetect] @@ -806,13 +809,12 @@ for ac_option in $@; do --disable-zlib) _zlib=no ;; --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 ;; --enable-theoradec) _theoradec=yes ;; + --disable-faad) _faad=no ;; + --enable-faad) _faad=yes ;; --disable-fluidsynth) _fluidsynth=no ;; --enable-readline) _readline=yes ;; --disable-readline) _readline=no ;; @@ -836,11 +838,6 @@ for ac_option in $@; do FLUIDSYNTH_CFLAGS="-I$arg/include" FLUIDSYNTH_LIBS="-L$arg/lib" ;; - --with-mpeg2-prefix=*) - arg=`echo $ac_option | cut -d '=' -f 2` - MPEG2_CFLAGS="-I$arg/include" - MPEG2_LIBS="-L$arg/lib" - ;; --with-alsa-prefix=*) arg=`echo $ac_option | cut -d '=' -f 2` ALSA_CFLAGS="-I$arg/include" @@ -881,6 +878,11 @@ for ac_option in $@; do THEORADEC_CFLAGS="-I$arg/include" THEORADEC_LIBS="-L$arg/lib" ;; + --with-faad-prefix=*) + arg=`echo $ac_option | cut -d '=' -f 2` + FAAD_CFLAGS="-I$arg/include" + FAAD_LIBS="-L$arg/lib" + ;; --with-zlib-prefix=*) arg=`echo $ac_option | cut -d '=' -f 2` ZLIB_CFLAGS="-I$arg/include" @@ -991,15 +993,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 @@ -1027,29 +1020,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 @@ -1087,15 +1062,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 @@ -1105,28 +1071,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 @@ -1183,6 +1132,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" @@ -1193,7 +1156,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 @@ -1249,9 +1214,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 + PSPSDK=`psp-config --pspsdk-path` + fi if test -z "$PSPSDK"; then - echo "Please set the path to PSPSDK in your environment." + echo "Please set PSPSDK in your environment. export PSPSDK=<path to psp sdk>" exit 1 fi ;; @@ -1414,6 +1385,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" @@ -1421,6 +1395,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; } @@ -1437,23 +1459,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 # @@ -1503,6 +1539,50 @@ 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 # echo_n "Compiling for x86... " @@ -1515,6 +1595,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 @@ -1523,7 +1624,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' @@ -1532,30 +1634,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*) @@ -1565,12 +1678,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 @@ -1579,19 +1688,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 @@ -1605,15 +1726,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" @@ -1623,14 +1752,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 @@ -1638,74 +1766,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 -D_WIN32_WCE=300 " - DEFINES="$DEFINES -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 @@ -1714,48 +1869,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 @@ -1769,10 +1915,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 @@ -1785,9 +1933,17 @@ 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" + if test "$_release_build" = yes; then + DEFINES="$DEFINES -DNOSERIAL" + fi + 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 @@ -1796,23 +1952,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 @@ -1828,16 +1983,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 @@ -1849,15 +2002,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 @@ -1868,18 +2020,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 @@ -1893,15 +2039,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 @@ -1912,9 +2053,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 @@ -1923,16 +2061,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 @@ -1947,25 +2092,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 @@ -1974,15 +2117,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 @@ -2002,34 +2143,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 @@ -2040,8 +2177,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" @@ -2056,8 +2191,6 @@ if test -n "$_host"; then ;; wince) LDFLAGS="$LDFLAGS -Wl,--stack,65536" - _need_memalign=yes - _arm_asm=yes _tremolo=yes _backend="wince" _mt32emu=no @@ -2067,55 +2200,149 @@ 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' + if test "$_release_build" = yes; then + LIBS="$LIBS -lronin-noserial -lm" + else + LIBS="$LIBS -lronin -lm" + fi + ;; + 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 <stdlib.h> -#include <signal.h> -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 @@ -2135,29 +2362,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 # @@ -2173,16 +2409,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 - @@ -2192,47 +2427,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 ' @@ -2245,17 +2462,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 @@ -2269,52 +2480,34 @@ 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 @@ -2323,16 +2516,10 @@ POST_OBJS_FLAGS := -Wl,--export-all-symbols -Wl,--no-whole-archive -Wl,--out-im wince) DEFINES="$DEFINES -DUNCACHED_PLUGINS" HOSTEXEEXT=".dll" -_def_plugin=' -#define PLUGIN_PREFIX "" -#define PLUGIN_SUFFIX ".dll" -' + _plugin_prefix="" + _plugin_suffix=".plugin" _mak_plugins=' -DYNAMIC_MODULES := 1 -PLUGIN_PREFIX := -PLUGIN_SUFFIX := .dll PLUGIN_EXTRA_DEPS = $(EXECUTABLE) -CXXFLAGS += -DDYNAMIC_MODULES 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 @@ -2342,7 +2529,7 @@ POST_OBJS_FLAGS := -Wl,--export-all-symbols -Wl,--no-whole-archive -Wl,--out-im _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 ' ;; @@ -2355,27 +2542,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" @@ -2387,15 +2567,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 @@ -2404,6 +2578,19 @@ POST_OBJS_FLAGS := -Wl,--no-whole-archive 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 # define_in_config_if_yes "$_mt32emu" 'USE_MT32EMU' @@ -2424,28 +2611,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 # cat > $TMPC << EOF @@ -2628,14 +2793,33 @@ if test ! "$_theoradec" = notsupported ; then fi # +# Check for the AAC decoder +# +echocheck "libfaad" +if test "$_faad" = auto ; then + _faad=no + cat > $TMPC << EOF +#include <neaacdec.h> +int main(void) { NeAACDecGetCapabilities(); return 0; } +EOF + cc_check $FAAD_CFLAGS $FAAD_LIBS -lfaad && _faad=yes +fi +if test "$_faad" = yes ; then + LIBS="$LIBS $FAAD_LIBS -lfaad" + INCLUDES="$INCLUDES $FAAD_CFLAGS" +fi +define_in_config_if_yes "$_faad" 'USE_FAAD' +echo "$_faad" + +# # Check for SEQ MIDI # 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" @@ -2648,7 +2832,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" @@ -2679,49 +2863,6 @@ if test `get_engine_build sword25` = yes && test ! "$_zlib" = yes ; then fi # -# Check for LibMPEG2 -# -echocheck "libmpeg2 >= 0.3.2" -if test "$_mpeg2" = auto ; then - _mpeg2=no - cat > $TMPC << EOF -typedef signed $type_1_byte int8_t; -typedef signed $type_2_byte int16_t; -typedef signed $type_4_byte int32_t; - -typedef unsigned $type_1_byte uint8_t; -typedef unsigned $type_2_byte uint16_t; -typedef unsigned $type_4_byte uint32_t; - -#include <mpeg2dec/mpeg2.h> -int main(void) { - /* mpeg2_state_t first appears in 0.4.0 */ - mpeg2_state_t state; - - #ifdef MPEG2_RELEASE - if (MPEG2_RELEASE >= MPEG2_VERSION(0, 3, 2)) - return 0; - #endif - return 1; -} -EOF - - if test -n "$_host"; then - # don't execute while cross compiling - cc_check $MPEG2_CFLAGS $MPEG2_LIBS -lmpeg2 && _mpeg2=yes - else - cc_check_no_clean $MPEG2_CFLAGS $MPEG2_LIBS -lmpeg2 && $TMPO$HOSTEXEEXT && _mpeg2=yes - cc_check_clean - fi -fi -if test "$_mpeg2" = yes ; then - INCLUDES="$INCLUDES $MPEG2_CFLAGS" - LIBS="$LIBS $MPEG2_LIBS -lmpeg2" -fi -define_in_config_if_yes "$_mpeg2" 'USE_MPEG2' -echo "$_mpeg2" - -# # Check for libfluidsynth # echocheck "libfluidsynth" @@ -2783,7 +2924,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) @@ -2869,6 +3010,7 @@ fi define_in_config_if_yes "$_opengl" "USE_OPENGL" define_in_config_if_yes "$_opengles" "USE_GLES" + # # Check for nasm # @@ -2930,12 +3072,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 # @@ -3017,10 +3155,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 @@ -3036,24 +3170,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" ;; *) @@ -3065,167 +3191,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 @@ -3328,9 +3302,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/README b/devtools/README index b1c0f21cb0..7db5259e7c 100644 --- a/devtools/README +++ b/devtools/README @@ -65,7 +65,7 @@ create_lure (dreammaster) create_project (LordHoto, Littleboy) -------------- - Creates project files for Visual Studio 2005, 2008, 2010 and + Creates project files for Visual Studio 2005, 2008, 2010, Xcode and Code::Blocks out of the configure / Makefile based build system. It also offers a way to enable or disable certain engines and the use of external libraries similar to configure. Run the tool without diff --git a/devtools/create_hugo/create_hugo.h b/devtools/create_hugo/create_hugo.h index 16d15fe317..e176dbb195 100644 --- a/devtools/create_hugo/create_hugo.h +++ b/devtools/create_hugo/create_hugo.h @@ -144,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 @@ -168,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 @@ -194,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 @@ -290,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 90cb1d54f3..f721c3d4f5 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_kyradat/module.mk b/devtools/create_kyradat/module.mk index fb458b43ff..4241f82e34 100644 --- a/devtools/create_kyradat/module.mk +++ b/devtools/create_kyradat/module.mk @@ -14,5 +14,8 @@ MODULE_OBJS := \ # Set the name of the executable TOOL_EXECUTABLE := create_kyradat +# Link against common code (for scumm_stricmp) +TOOL_DEPS := common/libcommon.a + # Include common rules include $(srcdir)/rules.mk diff --git a/devtools/create_lure/create_lure_dat.cpp b/devtools/create_lure/create_lure_dat.cpp index c55252410c..c53a6bf81d 100644 --- a/devtools/create_lure/create_lure_dat.cpp +++ b/devtools/create_lure/create_lure_dat.cpp @@ -1920,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_mads/parser.cpp b/devtools/create_mads/parser.cpp index 2daaff0d33..0c6df43046 100644 --- a/devtools/create_mads/parser.cpp +++ b/devtools/create_mads/parser.cpp @@ -237,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; @@ -265,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_project/codeblocks/create_project.cbp b/devtools/create_project/codeblocks/create_project.cbp index 25b12d8cc2..1b592d5e96 100644 --- a/devtools/create_project/codeblocks/create_project.cbp +++ b/devtools/create_project/codeblocks/create_project.cbp @@ -47,6 +47,8 @@ <Unit filename="..\msvc.h" /> <Unit filename="..\visualstudio.cpp" /> <Unit filename="..\visualstudio.h" /> + <Unit filename="..\xcode.cpp" /> + <Unit filename="..\xcode.h" /> <Extensions> <code_completion /> <envvars /> diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp index b75b22a290..29bc5bfcd5 100644 --- a/devtools/create_project/create_project.cpp +++ b/devtools/create_project/create_project.cpp @@ -28,11 +28,12 @@ #include "config.h" #include "create_project.h" -#include "codeblocks.h" +#include "codeblocks.h" #include "msvc.h" #include "visualstudio.h" #include "msbuild.h" +#include "xcode.h" #include <fstream> #include <iostream> @@ -107,13 +108,14 @@ typedef std::list<FSNode> FileList; enum ProjectType { kProjectNone, kProjectCodeBlocks, - kProjectMSVC + kProjectMSVC, + kProjectXcode }; int main(int argc, char *argv[]) { #ifndef USE_WIN32_API // Initialize random number generator for UUID creation - std::srand(std::time(0)); + std::srand((uint)std::time(0)); #endif if (argc < 2) { @@ -175,6 +177,14 @@ int main(int argc, char *argv[]) { projectType = kProjectMSVC; + } else if (!std::strcmp(argv[i], "--xcode")) { + if (projectType != kProjectNone) { + std::cerr << "ERROR: You cannot pass more than one project type!\n"; + return -1; + } + + projectType = kProjectXcode; + } else if (!std::strcmp(argv[i], "--msvc-version")) { if (i + 1 >= argc) { std::cerr << "ERROR: Missing \"version\" parameter for \"--msvc-version\"!\n"; @@ -463,6 +473,32 @@ int main(int argc, char *argv[]) { provider = new CreateProjectTool::MSBuildProvider(globalWarnings, projectWarnings, msvcVersion); break; + + case kProjectXcode: + //////////////////////////////////////////////////////////////////////////// + // Xcode is also using GCC behind the scenes. See Code::Blocks comment + // for info on all warnings + //////////////////////////////////////////////////////////////////////////// + globalWarnings.push_back("-Wall"); + globalWarnings.push_back("-Wno-long-long"); + globalWarnings.push_back("-Wno-multichar"); + globalWarnings.push_back("-Wno-unknown-pragmas"); + globalWarnings.push_back("-Wno-reorder"); + globalWarnings.push_back("-Wpointer-arith"); + globalWarnings.push_back("-Wcast-qual"); + globalWarnings.push_back("-Wcast-align"); + globalWarnings.push_back("-Wshadow"); + globalWarnings.push_back("-Wimplicit"); + globalWarnings.push_back("-Wnon-virtual-dtor"); + globalWarnings.push_back("-Wwrite-strings"); + // The following are not warnings at all... We should consider adding them to + // a different list of parameters. + globalWarnings.push_back("-fno-rtti"); + globalWarnings.push_back("-fno-exceptions"); + globalWarnings.push_back("-fcheck-new"); + + provider = new CreateProjectTool::XCodeProvider(globalWarnings, projectWarnings); + break; } provider->createProject(setup); @@ -501,6 +537,7 @@ void displayHelp(const char *exe) { "Project specific settings:\n" " --codeblock build Code::Blocks project files\n" " --msvc build Visual Studio project files\n" + " --xcode build XCode project files\n" " --file-prefix prefix allow overwriting of relative file prefix in the\n" " MSVC project files. By default the prefix is the\n" " \"path\\to\\source\" argument\n" @@ -636,7 +673,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); @@ -729,7 +766,6 @@ const Feature s_features[] = { { "flac", "USE_FLAC", "libFLAC_static", true, "FLAC support" }, { "png", "USE_PNG", "libpng", true, "libpng support" }, { "theora", "USE_THEORADEC", "libtheora_static", true, "Theora decoding support" }, - { "mpeg2", "USE_MPEG2", "libmpeg2", false, "mpeg2 codec for cutscenes" }, // Feature flags { "scalers", "USE_SCALERS", "", true, "Scalers" }, @@ -738,7 +774,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/module.mk b/devtools/create_project/module.mk index 4238452c5d..0db070fa7c 100644 --- a/devtools/create_project/module.mk +++ b/devtools/create_project/module.mk @@ -6,11 +6,17 @@ MODULE_OBJS := \ codeblocks.o \ msvc.o \ visualstudio.o \ - msbuild.o + msbuild.o \ + xcode.o # Set the name of the executable TOOL_EXECUTABLE := create_project +# Set custom build flags for create_project.o: It uses C++ iostreams, +# which make use of global constructors. So we don't want warnings for +# that. +$(srcdir)/devtools/create_project/create_project.o: CXXFLAGS:=$(filter-out -Wglobal-constructors,$(CXXFLAGS)) + # Include common rules include $(srcdir)/rules.mk diff --git a/devtools/create_project/msvc10/create_project.vcxproj b/devtools/create_project/msvc10/create_project.vcxproj index bf5e415b5d..3d7f8fdd3d 100644 --- a/devtools/create_project/msvc10/create_project.vcxproj +++ b/devtools/create_project/msvc10/create_project.vcxproj @@ -58,10 +58,12 @@ <TargetMachine>MachineX86</TargetMachine> </Link> <PostBuildEvent> - <Command>xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\msvc10\ + <Command>@echo off +xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\msvc10\ xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\msvc9\ xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\msvc8\ -xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\codeblocks\</Command> +xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\codeblocks\ +xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\iphone\</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> @@ -98,6 +100,7 @@ xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\codeblocks\</Command> <ClCompile Include="..\msbuild.cpp" /> <ClCompile Include="..\msvc.cpp" /> <ClCompile Include="..\visualstudio.cpp" /> + <ClCompile Include="..\xcode.cpp" /> </ItemGroup> <ItemGroup> <ClInclude Include="..\codeblocks.h" /> @@ -106,6 +109,7 @@ xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\codeblocks\</Command> <ClInclude Include="..\msbuild.h" /> <ClInclude Include="..\msvc.h" /> <ClInclude Include="..\visualstudio.h" /> + <ClInclude Include="..\xcode.h" /> </ItemGroup> <ItemGroup> <None Include="..\scripts\installer.vbs" /> diff --git a/devtools/create_project/msvc10/create_project.vcxproj.filters b/devtools/create_project/msvc10/create_project.vcxproj.filters index b5e870824e..5ecd6c3dde 100644 --- a/devtools/create_project/msvc10/create_project.vcxproj.filters +++ b/devtools/create_project/msvc10/create_project.vcxproj.filters @@ -27,6 +27,9 @@ <ClInclude Include="..\visualstudio.h"> <Filter>Header Files</Filter> </ClInclude> + <ClInclude Include="..\xcode.h"> + <Filter>Header Files</Filter> + </ClInclude> <ClInclude Include="..\config.h"> <Filter>Header Files</Filter> </ClInclude> @@ -47,6 +50,9 @@ <ClCompile Include="..\visualstudio.cpp"> <Filter>Source Files</Filter> </ClCompile> + <ClCompile Include="..\xcode.cpp"> + <Filter>Source Files</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <None Include="..\scripts\prebuild.cmd"> diff --git a/devtools/create_project/msvc8/create_project.vcproj b/devtools/create_project/msvc8/create_project.vcproj index 639b23d6e7..6e9e0d5cb0 100644 --- a/devtools/create_project/msvc8/create_project.vcproj +++ b/devtools/create_project/msvc8/create_project.vcproj @@ -184,6 +184,10 @@ RelativePath="..\visualstudio.cpp" > </File> + <File + RelativePath="..\xcode.cpp" + > + </File> </Filter> <Filter Name="Header Files" @@ -214,6 +218,10 @@ RelativePath="..\visualstudio.h" > </File> + <File + RelativePath="..\xcode.h" + > + </File> </Filter> <Filter Name="Scripts" diff --git a/devtools/create_project/msvc9/create_project.vcproj b/devtools/create_project/msvc9/create_project.vcproj index f56cbd711c..dc914248fb 100644 --- a/devtools/create_project/msvc9/create_project.vcproj +++ b/devtools/create_project/msvc9/create_project.vcproj @@ -185,6 +185,10 @@ RelativePath="..\visualstudio.cpp" > </File> + <File + RelativePath="..\xcode.cpp" + > + </File> </Filter> <Filter Name="Header Files" @@ -215,6 +219,10 @@ RelativePath="..\visualstudio.h" > </File> + <File + RelativePath="..\xcode.h" + > + </File> </Filter> <Filter Name="Scripts" diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp new file mode 100755 index 0000000000..77ac88f85d --- /dev/null +++ b/devtools/create_project/xcode.cpp @@ -0,0 +1,933 @@ +/* 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 "xcode.h" + +#include <fstream> +#include <algorithm> + +#if defined(_WIN32) || defined(WIN32) +#include <windows.h> +#else +#include <sys/param.h> +#include <sys/stat.h> +#include <dirent.h> +#include <errno.h> +#endif + +namespace CreateProjectTool { + +#define DEBUG_XCODE_HASH 0 + +#define ADD_DEFINE(defines, name) \ + defines.push_back(name); + +#define ADD_SETTING(config, key, value) \ + config.settings[key] = Setting(value, "", SettingsNoQuote); + +#define ADD_SETTING_ORDER(config, key, value, order) \ + config.settings[key] = Setting(value, "", SettingsNoQuote, 0, order); + +#define ADD_SETTING_ORDER_NOVALUE(config, key, comment, order) \ + config.settings[key] = Setting("", comment, SettingsNoValue, 0, order); + +#define ADD_SETTING_QUOTE(config, key, value) \ + config.settings[key] = Setting(value); + +#define ADD_SETTING_QUOTE_VAR(config, key, value) \ + config.settings[key] = Setting(value, "", SettingsQuoteVariable); + +#define ADD_SETTING_LIST(config, key, values, flags, indent) \ + config.settings[key] = Setting(values, flags, indent); + +#define REMOVE_SETTING(config, key) \ + config.settings.erase(key); + +#define ADD_BUILD_FILE(id, name, comment) { \ + Object *buildFile = new Object(this, id, name, "PBXBuildFile", "PBXBuildFile", comment); \ + buildFile->addProperty("fileRef", getHash(name), name, SettingsNoValue); \ + _buildFile.add(buildFile); \ + _buildFile.flags = SettingsSingleItem; \ +} + +#define ADD_FILE_REFERENCE(name, properties) { \ + Object *fileRef = new Object(this, name, name, "PBXFileReference", "PBXFileReference", name); \ + if (!properties.fileEncoding.empty()) fileRef->addProperty("fileEncoding", properties.fileEncoding, "", SettingsNoValue); \ + if (!properties.lastKnownFileType.empty()) fileRef->addProperty("lastKnownFileType", properties.lastKnownFileType, "", SettingsNoValue); \ + if (!properties.fileName.empty()) fileRef->addProperty("name", properties.fileName, "", SettingsNoValue); \ + if (!properties.filePath.empty()) fileRef->addProperty("path", properties.filePath, "", SettingsNoValue); \ + if (!properties.sourceTree.empty()) fileRef->addProperty("sourceTree", properties.sourceTree, "", SettingsNoValue); \ + _fileReference.add(fileRef); \ + _fileReference.flags = SettingsSingleItem; \ +} + +XCodeProvider::XCodeProvider(StringList &global_warnings, std::map<std::string, StringList> &project_warnings, const int version) + : ProjectProvider(global_warnings, project_warnings, version) { +} + +void XCodeProvider::createWorkspace(const BuildSetup &setup) { + // Create project folder + std::string workspace = setup.outputDir + '/' + "scummvm.xcodeproj"; + +#if defined(_WIN32) || defined(WIN32) + if (!CreateDirectory(workspace.c_str(), NULL)) + if (GetLastError() != ERROR_ALREADY_EXISTS) + error("Could not create folder \"" + setup.outputDir + '/' + "scummvm.xcodeproj\""); +#else + if (mkdir(workspace.c_str(), 0777) == -1) { + if (errno == EEXIST) { + // Try to open as a folder (might be a file / symbolic link) + DIR *dirp = opendir(workspace.c_str()); + if (dirp == NULL) { + error("Could not create folder \"" + setup.outputDir + '/' + "scummvm.xcodeproj\""); + } else { + // The folder exists, just close the stream and return + closedir(dirp); + } + } else { + error("Could not create folder \"" + setup.outputDir + '/' + "scummvm.xcodeproj\""); + } + } +#endif + + // Setup global objects + setupDefines(setup); + _targets.push_back("ScummVM-iPhone"); + _targets.push_back("ScummVM-OS X"); + _targets.push_back("ScummVM-Simulator"); + + setupCopyFilesBuildPhase(); + setupFrameworksBuildPhase(); + setupNativeTarget(); + setupProject(); + setupResourcesBuildPhase(); + setupBuildConfiguration(); +} + +// We are done with constructing all the object graph and we got through every project, output the main project file +// (this is kind of a hack since other providers use separate project files) +void XCodeProvider::createOtherBuildFiles(const BuildSetup &setup) { + // This needs to be done at the end when all build files have been accounted for + setupSourcesBuildPhase(); + + ouputMainProjectFile(setup); +} + +// Store information about a project here, for use at the end +void XCodeProvider::createProjectFile(const std::string &, const std::string &, const BuildSetup &setup, const std::string &moduleDir, + const StringList &includeList, const StringList &excludeList) { + std::string modulePath; + if (!moduleDir.compare(0, setup.srcDir.size(), setup.srcDir)) { + modulePath = moduleDir.substr(setup.srcDir.size()); + if (!modulePath.empty() && modulePath.at(0) == '/') + modulePath.erase(0, 1); + } + + std::ofstream project; + if (modulePath.size()) + addFilesToProject(moduleDir, project, includeList, excludeList, setup.filePrefix + '/' + modulePath); + else + addFilesToProject(moduleDir, project, includeList, excludeList, setup.filePrefix); +} + +////////////////////////////////////////////////////////////////////////// +// Main Project file +////////////////////////////////////////////////////////////////////////// +void XCodeProvider::ouputMainProjectFile(const BuildSetup &setup) { + std::ofstream project((setup.outputDir + '/' + "scummvm.xcodeproj" + '/' + "project.pbxproj").c_str()); + if (!project) + error("Could not open \"" + setup.outputDir + '/' + "scummvm.xcodeproj" + '/' + "project.pbxproj\" for writing"); + + ////////////////////////////////////////////////////////////////////////// + // Header + project << "// !$*UTF8*$!\n" + "{\n" + "\t" << writeSetting("archiveVersion", "1", "", SettingsNoQuote) << ";\n" + "\tclasses = {\n" + "\t};\n" + "\t" << writeSetting("objectVersion", "46", "", SettingsNoQuote) << ";\n" + "\tobjects = {\n"; + + ////////////////////////////////////////////////////////////////////////// + // List of objects + project << _buildFile.toString(); + project << _copyFilesBuildPhase.toString(); + project << _fileReference.toString(); + project << _frameworksBuildPhase.toString(); + project << _groups.toString(); + project << _nativeTarget.toString(); + project << _project.toString(); + project << _resourcesBuildPhase.toString(); + project << _sourcesBuildPhase.toString(); + project << _buildConfiguration.toString(); + project << _configurationList.toString(); + + ////////////////////////////////////////////////////////////////////////// + // Footer + project << "\t};\n" + "\t" << writeSetting("rootObject", getHash("PBXProject"), "Project object", SettingsNoQuote) << ";\n" + "}\n"; + +} + +////////////////////////////////////////////////////////////////////////// +// Files +////////////////////////////////////////////////////////////////////////// +void XCodeProvider::writeFileListToProject(const FileNode &dir, std::ofstream &projectFile, const int indentation, + const StringList &duplicate, const std::string &objPrefix, const std::string &filePrefix) { + + // Add comments for shared lists + _buildFile.comment = "PBXBuildFile"; + _fileReference.comment = "PBXFileReference"; + + // Init root group + _groups.comment = "PBXGroup"; + Object *group = new Object(this, "PBXGroup", "PBXGroup", "PBXGroup", "", ""); + + //Property children; + //children.flags = SettingsAsList; + //group->properties["children"] = children; + group->addProperty("children", "", "", SettingsNoValue|SettingsAsList); + + group->addProperty("sourceTree", "<group>", "", SettingsNoValue|SettingsQuoteVariable); + + _groups.add(group); + + // TODO Add files +} + +////////////////////////////////////////////////////////////////////////// +// Setup functions +////////////////////////////////////////////////////////////////////////// +void XCodeProvider::setupCopyFilesBuildPhase() { + // Nothing to do here +} + +/** + * Sets up the frameworks build phase. + * + * (each native target has different build rules) + */ +void XCodeProvider::setupFrameworksBuildPhase() { + _frameworksBuildPhase.comment = "PBXFrameworksBuildPhase"; + + // Setup framework file properties + std::map<std::string, FileProperty> properties; + + // Frameworks + properties["ApplicationServices.framework"] = FileProperty("wrapper.framework", "ApplicationServices.framework", "System/Library/Frameworks/ApplicationServices.framework", "SDKROOT"); + properties["AudioToolbox.framework"] = FileProperty("wrapper.framework", "AudioToolbox.framework", "System/Library/Frameworks/AudioToolbox.framework", "SDKROOT"); + properties["AudioUnit.framework"] = FileProperty("wrapper.framework", "AudioUnit.framework", "System/Library/Frameworks/AudioUnit.framework", "SDKROOT"); + properties["Carbon.framework"] = FileProperty("wrapper.framework", "Carbon.framework", "System/Library/Frameworks/Carbon.framework", "SDKROOT"); + properties["Cocoa.framework"] = FileProperty("wrapper.framework", "Cocoa.framework", "System/Library/Frameworks/Cocoa.framework", "SDKROOT"); + properties["CoreAudio.framework"] = FileProperty("wrapper.framework", "CoreAudio.framework", "System/Library/Frameworks/CoreAudio.framework", "SDKROOT"); + properties["CoreFoundation.framework"] = FileProperty("wrapper.framework", "CoreFoundation.framework", "System/Library/Frameworks/CoreFoundation.framework", "SDKROOT"); + properties["CoreMIDI.framework"] = FileProperty("wrapper.framework", "CoreMIDI.framework", "System/Library/Frameworks/CoreMIDI.framework", "SDKROOT"); + properties["Foundation.framework"] = FileProperty("wrapper.framework", "Foundation.framework", "System/Library/Frameworks/Foundation.framework", "SDKROOT"); + properties["IOKit.framework"] = FileProperty("wrapper.framework", "IOKit.framework", "System/Library/Frameworks/IOKit.framework", "SDKROOT"); + properties["OpenGLES.framework"] = FileProperty("wrapper.framework", "OpenGLES.framework", "System/Library/Frameworks/OpenGLES.framework", "SDKROOT"); + properties["QuartzCore.framework"] = FileProperty("wrapper.framework", "QuartzCore.framework", "System/Library/Frameworks/QuartzCore.framework", "SDKROOT"); + properties["QuickTime.framework"] = FileProperty("wrapper.framework", "QuickTime.framework", "System/Library/Frameworks/QuickTime.framework", "SDKROOT"); + properties["UIKit.framework"] = FileProperty("wrapper.framework", "UIKit.framework", "System/Library/Frameworks/UIKit.framework", "SDKROOT"); + + // Local libraries + properties["libFLAC.a"] = FileProperty("archive.ar", "libFLAC.a", "lib/libFLAC.a", "\"<group>\""); + properties["libmad.a"] = FileProperty("archive.ar", "libmad.a", "lib/libmad.a", "\"<group>\""); + //properties["libmpeg2.a"] = FileProperty("archive.ar", "libmpeg2.a", "lib/libmpeg2.a", "\"<group>\""); + properties["libvorbisidec.a"] = FileProperty("archive.ar", "libvorbisidec.a", "lib/libvorbisidec.a", "\"<group>\""); + + ////////////////////////////////////////////////////////////////////////// + // iPhone + Object *framework_iPhone = new Object(this, "PBXFrameworksBuildPhase_" + _targets[0], "PBXFrameworksBuildPhase", "PBXFrameworksBuildPhase", "", "Frameworks"); + + framework_iPhone->addProperty("buildActionMask", "2147483647", "", SettingsNoValue); + framework_iPhone->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue); + + // List of frameworks + Property iPhone_files; + iPhone_files.hasOrder = true; + iPhone_files.flags = SettingsAsList; + + ValueList frameworks_iPhone; + frameworks_iPhone.push_back("CoreAudio.framework"); + frameworks_iPhone.push_back("CoreFoundation.framework"); + frameworks_iPhone.push_back("Foundation.framework"); + frameworks_iPhone.push_back("UIKit.framework"); + frameworks_iPhone.push_back("AudioToolbox.framework"); + frameworks_iPhone.push_back("QuartzCore.framework"); + frameworks_iPhone.push_back("libmad.a"); + //frameworks_iPhone.push_back("libmpeg2.a"); + frameworks_iPhone.push_back("libFLAC.a"); + frameworks_iPhone.push_back("libvorbisidec.a"); + frameworks_iPhone.push_back("OpenGLES.framework"); + + int order = 0; + for (ValueList::iterator framework = frameworks_iPhone.begin(); framework != frameworks_iPhone.end(); framework++) { + std::string id = "Frameworks_" + *framework + "_iphone"; + std::string comment = *framework + " in Frameworks"; + + ADD_SETTING_ORDER_NOVALUE(iPhone_files, getHash(id), comment, order++); + ADD_BUILD_FILE(id, *framework, comment); + ADD_FILE_REFERENCE(*framework, properties[*framework]); + } + + framework_iPhone->properties["files"] = iPhone_files; + + _frameworksBuildPhase.add(framework_iPhone); + + ////////////////////////////////////////////////////////////////////////// + // ScummVM-OS X + Object *framework_OSX = new Object(this, "PBXFrameworksBuildPhase_" + _targets[1], "PBXFrameworksBuildPhase", "PBXFrameworksBuildPhase", "", "Frameworks"); + + framework_OSX->addProperty("buildActionMask", "2147483647", "", SettingsNoValue); + framework_OSX->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue); + + // List of frameworks + Property osx_files; + osx_files.hasOrder = true; + osx_files.flags = SettingsAsList; + + ValueList frameworks_osx; + frameworks_osx.push_back("CoreFoundation.framework"); + frameworks_osx.push_back("Foundation.framework"); + frameworks_osx.push_back("AudioToolbox.framework"); + frameworks_osx.push_back("QuickTime.framework"); + frameworks_osx.push_back("CoreMIDI.framework"); + frameworks_osx.push_back("CoreAudio.framework"); + frameworks_osx.push_back("QuartzCore.framework"); + frameworks_osx.push_back("Carbon.framework"); + frameworks_osx.push_back("ApplicationServices.framework"); + frameworks_osx.push_back("IOKit.framework"); + frameworks_osx.push_back("Cocoa.framework"); + frameworks_osx.push_back("AudioUnit.framework"); + + order = 0; + for (ValueList::iterator framework = frameworks_osx.begin(); framework != frameworks_osx.end(); framework++) { + std::string id = "Frameworks_" + *framework + "_osx"; + std::string comment = *framework + " in Frameworks"; + + ADD_SETTING_ORDER_NOVALUE(osx_files, getHash(id), comment, order++); + ADD_BUILD_FILE(id, *framework, comment); + ADD_FILE_REFERENCE(*framework, properties[*framework]); + } + + framework_OSX->properties["files"] = osx_files; + + _frameworksBuildPhase.add(framework_OSX); + + ////////////////////////////////////////////////////////////////////////// + // Simulator + Object *framework_simulator = new Object(this, "PBXFrameworksBuildPhase_" + _targets[2], "PBXFrameworksBuildPhase", "PBXFrameworksBuildPhase", "", "Frameworks"); + + framework_simulator->addProperty("buildActionMask", "2147483647", "", SettingsNoValue); + framework_simulator->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue); + + // List of frameworks + Property simulator_files; + simulator_files.hasOrder = true; + simulator_files.flags = SettingsAsList; + + ValueList frameworks_simulator; + frameworks_simulator.push_back("CoreAudio.framework"); + frameworks_simulator.push_back("CoreFoundation.framework"); + frameworks_simulator.push_back("Foundation.framework"); + frameworks_simulator.push_back("UIKit.framework"); + frameworks_simulator.push_back("AudioToolbox.framework"); + frameworks_simulator.push_back("QuartzCore.framework"); + frameworks_simulator.push_back("OpenGLES.framework"); + + order = 0; + for (ValueList::iterator framework = frameworks_simulator.begin(); framework != frameworks_simulator.end(); framework++) { + std::string id = "Frameworks_" + *framework + "_simulator"; + std::string comment = *framework + " in Frameworks"; + + ADD_SETTING_ORDER_NOVALUE(simulator_files, getHash(id), comment, order++); + ADD_BUILD_FILE(id, *framework, comment); + ADD_FILE_REFERENCE(*framework, properties[*framework]); + } + + framework_simulator->properties["files"] = simulator_files; + + _frameworksBuildPhase.add(framework_simulator); +} + +void XCodeProvider::setupNativeTarget() { + _nativeTarget.comment = "PBXNativeTarget"; + + // Output native target section + for (unsigned int i = 0; i < _targets.size(); i++) { + Object *target = new Object(this, "PBXNativeTarget_" + _targets[i], "PBXNativeTarget", "PBXNativeTarget", "", _targets[i]); + + target->addProperty("buildConfigurationList", getHash("XCConfigurationList_" + _targets[i]), "Build configuration list for PBXNativeTarget \"" + _targets[i] + "\"", SettingsNoValue); + + Property buildPhases; + buildPhases.hasOrder = true; + buildPhases.flags = SettingsAsList; + buildPhases.settings[getHash("PBXResourcesBuildPhase_" + _targets[i])] = Setting("", "Resources", SettingsNoValue, 0, 0); + buildPhases.settings[getHash("PBXSourcesBuildPhase_" + _targets[i])] = Setting("", "Sources", SettingsNoValue, 0, 1); + buildPhases.settings[getHash("PBXFrameworksBuildPhase_" + _targets[i])] = Setting("", "Frameworks", SettingsNoValue, 0, 2); + target->properties["buildPhases"] = buildPhases; + + target->addProperty("buildRules", "", "", SettingsNoValue|SettingsAsList); + + target->addProperty("dependencies", "", "", SettingsNoValue|SettingsAsList); + + target->addProperty("name", _targets[i], "", SettingsNoValue|SettingsQuoteVariable); + target->addProperty("productName", "scummvm", "", SettingsNoValue); + target->addProperty("productReference", getHash("PBXFileReference_ScummVM.app_" + _targets[i]), "ScummVM.app", SettingsNoValue); + target->addProperty("productType", "com.apple.product-type.application", "", SettingsNoValue|SettingsQuoteVariable); + + _nativeTarget.add(target); + } +} + +void XCodeProvider::setupProject() { + _project.comment = "PBXProject"; + + Object *project = new Object(this, "PBXProject", "PBXProject", "PBXProject", "", "Project object"); + + project->addProperty("buildConfigurationList", getHash("XCConfigurationList_scummvm"), "Build configuration list for PBXProject \"scummvm\"", SettingsNoValue); + project->addProperty("compatibilityVersion", "Xcode 3.2", "", SettingsNoValue|SettingsQuoteVariable); + project->addProperty("developmentRegion", "English", "", SettingsNoValue); + project->addProperty("hasScannedForEncodings", "1", "", SettingsNoValue); + + // List of known regions + Property regions; + regions.flags = SettingsAsList; + ADD_SETTING_ORDER_NOVALUE(regions, "English", "", 0); + ADD_SETTING_ORDER_NOVALUE(regions, "Japanese", "", 1); + ADD_SETTING_ORDER_NOVALUE(regions, "French", "", 2); + ADD_SETTING_ORDER_NOVALUE(regions, "German", "", 3); + project->properties["knownRegions"] = regions; + + project->addProperty("mainGroup", getHash("PBXGroup_CustomTemplate"), "CustomTemplate", SettingsNoValue); + project->addProperty("projectDirPath", "", "", SettingsNoValue|SettingsQuoteVariable); + project->addProperty("projectRoot", "", "", SettingsNoValue|SettingsQuoteVariable); + + // List of targets + Property targets; + targets.flags = SettingsAsList; + targets.settings[getHash("PBXNativeTarget_" + _targets[0])] = Setting("", _targets[0], SettingsNoValue, 0, 0); + targets.settings[getHash("PBXNativeTarget_" + _targets[1])] = Setting("", _targets[1], SettingsNoValue, 0, 1); + targets.settings[getHash("PBXNativeTarget_" + _targets[2])] = Setting("", _targets[2], SettingsNoValue, 0, 2); + project->properties["targets"] = targets; + + _project.add(project); +} + +void XCodeProvider::setupResourcesBuildPhase() { + _resourcesBuildPhase.comment = "PBXResourcesBuildPhase"; + + // Setup resource file properties + std::map<std::string, FileProperty> properties; + properties["scummclassic.zip"] = FileProperty("archive.zip", "", "scummclassic.zip", "\"<group>\""); + properties["scummmodern.zip"] = FileProperty("archive.zip", "", "scummmodern.zip", "\"<group>\""); + + properties["kyra.dat"] = FileProperty("file", "", "kyra.dat", "\"<group>\""); + properties["lure.dat"] = FileProperty("file", "", "lure.dat", "\"<group>\""); + properties["queen.tbl"] = FileProperty("file", "", "queen.tbl", "\"<group>\""); + properties["sky.cpt"] = FileProperty("file", "", "sky.cpt", "\"<group>\""); + properties["drascula.dat"] = FileProperty("file", "", "drascula.dat", "\"<group>\""); + properties["hugo.dat"] = FileProperty("file", "", "hugo.dat", "\"<group>\""); + properties["m4.dat"] = FileProperty("file", "", "m4.dat", "\"<group>\""); + properties["teenagent.dat"] = FileProperty("file", "", "teenagent.dat", "\"<group>\""); + properties["toon.dat"] = FileProperty("file", "", "toon.dat", "\"<group>\""); + + properties["Default.png"] = FileProperty("image.png", "", "Default.png", "\"<group>\""); + properties["icon.png"] = FileProperty("image.png", "", "icon.png", "\"<group>\""); + properties["icon-72.png"] = FileProperty("image.png", "", "icon-72.png", "\"<group>\""); + properties["icon4.png"] = FileProperty("image.png", "", "icon4.png", "\"<group>\""); + + // Same as for containers: a rule for each native target + for (unsigned int i = 0; i < _targets.size(); i++) { + Object *resource = new Object(this, "PBXResourcesBuildPhase_" + _targets[i], "PBXResourcesBuildPhase", "PBXResourcesBuildPhase", "", "Resources"); + + resource->addProperty("buildActionMask", "2147483647", "", SettingsNoValue); + + // Add default files + Property files; + files.hasOrder = true; + files.flags = SettingsAsList; + + ValueList files_list; + files_list.push_back("scummclassic.zip"); + files_list.push_back("scummmodern.zip"); + files_list.push_back("kyra.dat"); + files_list.push_back("lure.dat"); + files_list.push_back("queen.tbl"); + files_list.push_back("sky.cpt"); + files_list.push_back("Default.png"); + files_list.push_back("icon.png"); + files_list.push_back("icon-72.png"); + files_list.push_back("icon4.png"); + files_list.push_back("drascula.dat"); + files_list.push_back("hugo.dat"); + files_list.push_back("m4.dat"); + files_list.push_back("teenagent.dat"); + files_list.push_back("toon.dat"); + + int order = 0; + for (ValueList::iterator file = files_list.begin(); file != files_list.end(); file++) { + std::string id = "PBXResources_" + *file; + std::string comment = *file + " in Resources"; + + ADD_SETTING_ORDER_NOVALUE(files, getHash(id), comment, order++); + // TODO Fix crash when adding build file for data + //ADD_BUILD_FILE(id, *file, comment); + ADD_FILE_REFERENCE(*file, properties[*file]); + } + + // Add custom files depending on the target + if (_targets[i] == "ScummVM-OS X") { + files.settings[getHash("PBXResources_scummvm.icns")] = Setting("", "scummvm.icns in Resources", SettingsNoValue, 0, 6); + + // Remove 2 iphone icon files + files.settings.erase(getHash("PBXResources_Default.png")); + files.settings.erase(getHash("PBXResources_icon.png")); + } + + resource->properties["files"] = files; + + resource->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue); + + _resourcesBuildPhase.add(resource); + } +} + +void XCodeProvider::setupSourcesBuildPhase() { + // TODO +} + +// Setup all build configurations +void XCodeProvider::setupBuildConfiguration() { + + _buildConfiguration.comment = "XCBuildConfiguration"; + _buildConfiguration.flags = SettingsAsList; + + ///**************************************** + // * iPhone + // ****************************************/ + + // Debug + Object *iPhone_Debug_Object = new Object(this, "XCBuildConfiguration_ScummVM-iPhone_Debug", _targets[0] /* ScummVM-iPhone */, "XCBuildConfiguration", "PBXNativeTarget", "Debug"); + Property iPhone_Debug; + ADD_SETTING_QUOTE(iPhone_Debug, "ARCHS", "$(ARCHS_UNIVERSAL_IPHONE_OS)"); + ADD_SETTING_QUOTE(iPhone_Debug, "CODE_SIGN_IDENTITY", "iPhone Developer"); + ADD_SETTING_QUOTE_VAR(iPhone_Debug, "CODE_SIGN_IDENTITY[sdk=iphoneos*]", "iPhone Developer"); + ADD_SETTING(iPhone_Debug, "COMPRESS_PNG_FILES", "NO"); + ADD_SETTING(iPhone_Debug, "COPY_PHASE_STRIP", "NO"); + ADD_SETTING_QUOTE(iPhone_Debug, "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym"); + ValueList iPhone_FrameworkSearchPaths; + iPhone_FrameworkSearchPaths.push_back("$(inherited)"); + iPhone_FrameworkSearchPaths.push_back("\"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\""); + ADD_SETTING_LIST(iPhone_Debug, "FRAMEWORK_SEARCH_PATHS", iPhone_FrameworkSearchPaths, SettingsAsList, 5); + ADD_SETTING(iPhone_Debug, "GCC_DYNAMIC_NO_PIC", "NO"); + ADD_SETTING(iPhone_Debug, "GCC_ENABLE_CPP_EXCEPTIONS", "NO"); + ADD_SETTING(iPhone_Debug, "GCC_ENABLE_FIX_AND_CONTINUE", "NO"); + ADD_SETTING(iPhone_Debug, "GCC_OPTIMIZATION_LEVEL", "0"); + ADD_SETTING(iPhone_Debug, "GCC_PRECOMPILE_PREFIX_HEADER", "NO"); + ADD_SETTING_QUOTE(iPhone_Debug, "GCC_PREFIX_HEADER", ""); + ADD_SETTING(iPhone_Debug, "GCC_THUMB_SUPPORT", "NO"); + ADD_SETTING(iPhone_Debug, "GCC_UNROLL_LOOPS", "YES"); + ValueList iPhone_HeaderSearchPaths; + iPhone_HeaderSearchPaths.push_back("../../engines/"); + iPhone_HeaderSearchPaths.push_back("../../"); + iPhone_HeaderSearchPaths.push_back("include/"); + ADD_SETTING_LIST(iPhone_Debug, "HEADER_SEARCH_PATHS", iPhone_HeaderSearchPaths, SettingsAsList|SettingsNoQuote, 5); + ADD_SETTING(iPhone_Debug, "INFOPLIST_FILE", "Info.plist"); + ValueList iPhone_LibPaths; + iPhone_LibPaths.push_back("$(inherited)"); + iPhone_LibPaths.push_back("\"$(SRCROOT)/lib\""); + ADD_SETTING_LIST(iPhone_Debug, "LIBRARY_SEARCH_PATHS", iPhone_LibPaths, SettingsAsList, 5); + ADD_SETTING(iPhone_Debug, "ONLY_ACTIVE_ARCH", "YES"); + ADD_SETTING(iPhone_Debug, "PREBINDING", "NO"); + ADD_SETTING(iPhone_Debug, "PRODUCT_NAME", "ScummVM"); + ADD_SETTING_QUOTE(iPhone_Debug, "PROVISIONING_PROFILE", "EF590570-5FAC-4346-9071-D609DE2B28D8"); + ADD_SETTING_QUOTE_VAR(iPhone_Debug, "PROVISIONING_PROFILE[sdk=iphoneos*]", ""); + ADD_SETTING(iPhone_Debug, "SDKROOT", "iphoneos4.0"); + ADD_SETTING_QUOTE(iPhone_Debug, "TARGETED_DEVICE_FAMILY", "1,2"); + + iPhone_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue); + iPhone_Debug_Object->properties["buildSettings"] = iPhone_Debug; + + // Release + Object *iPhone_Release_Object = new Object(this, "XCBuildConfiguration_ScummVM-iPhone_Release", _targets[0] /* ScummVM-iPhone */, "XCBuildConfiguration", "PBXNativeTarget", "Release"); + Property iPhone_Release(iPhone_Debug); + ADD_SETTING(iPhone_Release, "GCC_OPTIMIZATION_LEVEL", "3"); + ADD_SETTING(iPhone_Release, "COPY_PHASE_STRIP", "YES"); + REMOVE_SETTING(iPhone_Release, "GCC_DYNAMIC_NO_PIC"); + ADD_SETTING(iPhone_Release, "WRAPPER_EXTENSION", "app"); + + iPhone_Release_Object->addProperty("name", "Release", "", SettingsNoValue); + iPhone_Release_Object->properties["buildSettings"] = iPhone_Release; + + _buildConfiguration.add(iPhone_Debug_Object); + _buildConfiguration.add(iPhone_Release_Object); + + /**************************************** + * scummvm + ****************************************/ + + // Debug + Object *scummvm_Debug_Object = new Object(this, "XCBuildConfiguration_scummvm_Debug", "scummvm", "XCBuildConfiguration", "PBXProject", "Debug"); + Property scummvm_Debug; + ADD_SETTING(scummvm_Debug, "ALWAYS_SEARCH_USER_PATHS", "NO"); + ADD_SETTING_QUOTE(scummvm_Debug, "ARCHS", "$(ARCHS_STANDARD_32_BIT)"); + ADD_SETTING_QUOTE(scummvm_Debug, "CODE_SIGN_IDENTITY", "Don't Code Sign"); + ADD_SETTING_QUOTE_VAR(scummvm_Debug, "CODE_SIGN_IDENTITY[sdk=iphoneos*]", "Don't Code Sign"); + ADD_SETTING_QUOTE(scummvm_Debug, "FRAMEWORK_SEARCH_PATHS", ""); + ADD_SETTING(scummvm_Debug, "GCC_C_LANGUAGE_STANDARD", "c99"); + ADD_SETTING(scummvm_Debug, "GCC_ENABLE_CPP_EXCEPTIONS", "NO"); + ADD_SETTING(scummvm_Debug, "GCC_ENABLE_CPP_RTTI", "NO"); + ADD_SETTING(scummvm_Debug, "GCC_INPUT_FILETYPE", "automatic"); + ADD_SETTING(scummvm_Debug, "GCC_OPTIMIZATION_LEVEL", "0"); + ValueList scummvm_defines(_defines); + ADD_DEFINE(scummvm_defines, "IPHONE"); + ADD_DEFINE(scummvm_defines, "XCODE"); + ADD_DEFINE(scummvm_defines, "IPHONE_OFFICIAL"); + ADD_SETTING_LIST(scummvm_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, SettingsNoQuote|SettingsAsList, 5); + ADD_SETTING(scummvm_Debug, "GCC_THUMB_SUPPORT", "NO"); + ADD_SETTING(scummvm_Debug, "GCC_USE_GCC3_PFE_SUPPORT", "NO"); + ADD_SETTING(scummvm_Debug, "GCC_WARN_ABOUT_RETURN_TYPE", "YES"); + ADD_SETTING(scummvm_Debug, "GCC_WARN_UNUSED_VARIABLE", "YES"); + ValueList scummvm_HeaderPaths; + scummvm_HeaderPaths.push_back("include/"); + scummvm_HeaderPaths.push_back("../../engines/"); + scummvm_HeaderPaths.push_back("../../"); + ADD_SETTING_LIST(scummvm_Debug, "HEADER_SEARCH_PATHS", scummvm_HeaderPaths, SettingsNoQuote|SettingsAsList, 5); + ADD_SETTING_QUOTE(scummvm_Debug, "LIBRARY_SEARCH_PATHS", ""); + ADD_SETTING(scummvm_Debug, "ONLY_ACTIVE_ARCH", "YES"); + ADD_SETTING_QUOTE(scummvm_Debug, "OTHER_CFLAGS", ""); + ADD_SETTING_QUOTE(scummvm_Debug, "OTHER_LDFLAGS", "-lz"); + ADD_SETTING(scummvm_Debug, "PREBINDING", "NO"); + ADD_SETTING(scummvm_Debug, "SDKROOT", "macosx10.6"); + + scummvm_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue); + scummvm_Debug_Object->properties["buildSettings"] = scummvm_Debug; + + // Release + Object *scummvm_Release_Object = new Object(this, "XCBuildConfiguration_scummvm_Release", "scummvm", "XCBuildConfiguration", "PBXProject", "Release"); + Property scummvm_Release(scummvm_Debug); + REMOVE_SETTING(scummvm_Release, "GCC_C_LANGUAGE_STANDARD"); // Not sure why we remove that, or any of the other warnings + REMOVE_SETTING(scummvm_Release, "GCC_WARN_ABOUT_RETURN_TYPE"); + REMOVE_SETTING(scummvm_Release, "GCC_WARN_UNUSED_VARIABLE"); + REMOVE_SETTING(scummvm_Release, "ONLY_ACTIVE_ARCH"); + + scummvm_Release_Object->addProperty("name", "Release", "", SettingsNoValue); + scummvm_Release_Object->properties["buildSettings"] = scummvm_Release; + + _buildConfiguration.add(scummvm_Debug_Object); + _buildConfiguration.add(scummvm_Release_Object); + + /**************************************** + * ScummVM-OS X + ****************************************/ + + // Debug + Object *scummvmOSX_Debug_Object = new Object(this, "XCBuildConfiguration_ScummVM-OSX_Debug", _targets[1] /* ScummVM-OS X */, "XCBuildConfiguration", "PBXNativeTarget", "Debug"); + Property scummvmOSX_Debug; + ADD_SETTING_QUOTE(scummvmOSX_Debug, "ARCHS", "$(NATIVE_ARCH)"); + ADD_SETTING(scummvmOSX_Debug, "COMPRESS_PNG_FILES", "NO"); + ADD_SETTING(scummvmOSX_Debug, "COPY_PHASE_STRIP", "NO"); + ADD_SETTING_QUOTE(scummvmOSX_Debug, "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym"); + ADD_SETTING_QUOTE(scummvmOSX_Debug, "FRAMEWORK_SEARCH_PATHS", ""); + ADD_SETTING(scummvmOSX_Debug, "GCC_C_LANGUAGE_STANDARD", "c99"); + ADD_SETTING(scummvmOSX_Debug, "GCC_ENABLE_CPP_EXCEPTIONS", "NO"); + ADD_SETTING(scummvmOSX_Debug, "GCC_ENABLE_CPP_RTTI", "NO"); + ADD_SETTING(scummvmOSX_Debug, "GCC_DYNAMIC_NO_PIC", "NO"); + ADD_SETTING(scummvmOSX_Debug, "GCC_ENABLE_FIX_AND_CONTINUE", "NO"); + ADD_SETTING(scummvmOSX_Debug, "GCC_OPTIMIZATION_LEVEL", "0"); + ADD_SETTING(scummvmOSX_Debug, "GCC_PRECOMPILE_PREFIX_HEADER", "NO"); + ADD_SETTING_QUOTE(scummvmOSX_Debug, "GCC_PREFIX_HEADER", ""); + ValueList scummvmOSX_defines(_defines); + ADD_DEFINE(scummvmOSX_defines, "SDL_BACKEND"); + ADD_DEFINE(scummvmOSX_defines, "MACOSX"); + ADD_SETTING_LIST(scummvmOSX_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmOSX_defines, SettingsNoQuote|SettingsAsList, 5); + ADD_SETTING_QUOTE(scummvmOSX_Debug, "GCC_VERSION", ""); + ValueList scummvmOSX_HeaderPaths; + scummvmOSX_HeaderPaths.push_back("/opt/local/include/SDL"); + scummvmOSX_HeaderPaths.push_back("/opt/local/include"); + scummvmOSX_HeaderPaths.push_back("include/"); + scummvmOSX_HeaderPaths.push_back("../../engines/"); + scummvmOSX_HeaderPaths.push_back("../../"); + ADD_SETTING_LIST(scummvmOSX_Debug, "HEADER_SEARCH_PATHS", scummvmOSX_HeaderPaths, SettingsNoQuote|SettingsAsList, 5); + ADD_SETTING_QUOTE(scummvmOSX_Debug, "INFOPLIST_FILE", "$(SRCROOT)/../macosx/Info.plist"); + ValueList scummvmOSX_LibPaths; + scummvmOSX_LibPaths.push_back("/sw/lib"); + scummvmOSX_LibPaths.push_back("/opt/local/lib"); + scummvmOSX_LibPaths.push_back("\"$(inherited)\""); + scummvmOSX_LibPaths.push_back("\"\\\\\\\"$(SRCROOT)/lib\\\\\\\"\""); // mmmh, all those slashes, it's almost Christmas \o/ + ADD_SETTING_LIST(scummvmOSX_Debug, "LIBRARY_SEARCH_PATHS", scummvmOSX_LibPaths, SettingsNoQuote|SettingsAsList, 5); + ADD_SETTING_QUOTE(scummvmOSX_Debug, "OTHER_CFLAGS", ""); + ValueList scummvmOSX_LdFlags; + scummvmOSX_LdFlags.push_back("-lSDLmain"); + scummvmOSX_LdFlags.push_back("-logg"); + scummvmOSX_LdFlags.push_back("-lvorbisfile"); + scummvmOSX_LdFlags.push_back("-lvorbis"); + scummvmOSX_LdFlags.push_back("-lmad"); + scummvmOSX_LdFlags.push_back("-lFLAC"); + scummvmOSX_LdFlags.push_back("-lSDL"); + scummvmOSX_LdFlags.push_back("-lz"); + ADD_SETTING_LIST(scummvmOSX_Debug, "OTHER_LDFLAGS", scummvmOSX_LdFlags, SettingsAsList, 5); + ADD_SETTING(scummvmOSX_Debug, "PREBINDING", "NO"); + ADD_SETTING(scummvmOSX_Debug, "PRODUCT_NAME", "ScummVM"); + + scummvmOSX_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue); + scummvmOSX_Debug_Object->properties["buildSettings"] = scummvmOSX_Debug; + + // Release + Object *scummvmOSX_Release_Object = new Object(this, "XCBuildConfiguration_ScummVMOSX_Release", _targets[1] /* ScummVM-OS X */, "XCBuildConfiguration", "PBXNativeTarget", "Release"); + Property scummvmOSX_Release(scummvmOSX_Debug); + ADD_SETTING(scummvmOSX_Release, "COPY_PHASE_STRIP", "YES"); + REMOVE_SETTING(scummvmOSX_Release, "GCC_DYNAMIC_NO_PIC"); + REMOVE_SETTING(scummvmOSX_Release, "GCC_OPTIMIZATION_LEVEL"); + ADD_SETTING(scummvmOSX_Release, "WRAPPER_EXTENSION", "app"); + + scummvmOSX_Release_Object->addProperty("name", "Release", "", SettingsNoValue); + scummvmOSX_Release_Object->properties["buildSettings"] = scummvmOSX_Release; + + _buildConfiguration.add(scummvmOSX_Debug_Object); + _buildConfiguration.add(scummvmOSX_Release_Object); + + /**************************************** + * ScummVM-Simulator + ****************************************/ + + // Debug + Object *scummvmSimulator_Debug_Object = new Object(this, "XCBuildConfiguration_ScummVM-Simulator_Debug", _targets[2] /* ScummVM-Simulator */, "XCBuildConfiguration", "PBXNativeTarget", "Debug"); + Property scummvmSimulator_Debug(iPhone_Debug); + ADD_SETTING_QUOTE(scummvmSimulator_Debug, "FRAMEWORK_SEARCH_PATHS", "$(inherited)"); + ADD_SETTING_LIST(scummvmSimulator_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, SettingsNoQuote|SettingsAsList, 5); + ADD_SETTING(scummvmSimulator_Debug, "SDKROOT", "iphonesimulator3.2"); + REMOVE_SETTING(scummvmSimulator_Debug, "TARGETED_DEVICE_FAMILY"); + + scummvmSimulator_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue); + scummvmSimulator_Debug_Object->properties["buildSettings"] = scummvmSimulator_Debug; + + // Release + Object *scummvmSimulator_Release_Object = new Object(this, "XCBuildConfiguration_ScummVM-Simulator_Release", _targets[2] /* ScummVM-Simulator */, "XCBuildConfiguration", "PBXNativeTarget", "Release"); + Property scummvmSimulator_Release(scummvmSimulator_Debug); + ADD_SETTING(scummvmSimulator_Release, "COPY_PHASE_STRIP", "YES"); + REMOVE_SETTING(scummvmSimulator_Release, "GCC_DYNAMIC_NO_PIC"); + ADD_SETTING(scummvmSimulator_Release, "WRAPPER_EXTENSION", "app"); + + scummvmSimulator_Release_Object->addProperty("name", "Release", "", SettingsNoValue); + scummvmSimulator_Release_Object->properties["buildSettings"] = scummvmSimulator_Release; + + _buildConfiguration.add(scummvmSimulator_Debug_Object); + _buildConfiguration.add(scummvmSimulator_Release_Object); + + ////////////////////////////////////////////////////////////////////////// + // Configuration List + _configurationList.comment = "XCConfigurationList"; + _configurationList.flags = SettingsAsList; + + // Warning: This assumes we have all configurations with a Debug & Release pair + for (std::vector<Object *>::iterator config = _buildConfiguration.objects.begin(); config != _buildConfiguration.objects.end(); config++) { + + Object *configList = new Object(this, "XCConfigurationList_" + (*config)->name, (*config)->name, "XCConfigurationList", "", "Build configuration list for " + (*config)->refType + " \"" + (*config)->name + "\""); + + Property buildConfigs; + buildConfigs.flags = SettingsAsList; + + buildConfigs.settings[getHash((*config)->id)] = Setting("", "Debug", SettingsNoValue, 0, 0); + buildConfigs.settings[getHash((*(++config))->id)] = Setting("", "Release", SettingsNoValue, 0, 1); + + configList->properties["buildConfigurations"] = buildConfigs; + + configList->addProperty("defaultConfigurationIsVisible", "0", "", SettingsNoValue); + configList->addProperty("defaultConfigurationName", "Release", "", SettingsNoValue); + + _configurationList.add(configList); + } +} + +////////////////////////////////////////////////////////////////////////// +// Misc +////////////////////////////////////////////////////////////////////////// + +// Setup global defines +void XCodeProvider::setupDefines(const BuildSetup &setup) { + + for (StringList::const_iterator i = setup.defines.begin(); i != setup.defines.end(); ++i) { + if (*i == "HAVE_NASM") // Not supported on Mac (TODO: change how it's handled in main class or add it only in MSVC/CodeBlocks providers?) + continue; + + ADD_DEFINE(_defines, *i); + } + // Add special defines for Mac support + ADD_DEFINE(_defines, "CONFIG_H"); + ADD_DEFINE(_defines, "SCUMM_NEED_ALIGNMENT"); + ADD_DEFINE(_defines, "SCUMM_LITTLE_ENDIAN"); + ADD_DEFINE(_defines, "UNIX"); + ADD_DEFINE(_defines, "SCUMMVM"); + ADD_DEFINE(_defines, "USE_TREMOR"); +} + +////////////////////////////////////////////////////////////////////////// +// Object hash +////////////////////////////////////////////////////////////////////////// + +// TODO use md5 to compute a file hash (and fall back to standard key generation if not passed a file) +std::string XCodeProvider::getHash(std::string key) { + +#if DEBUG_XCODE_HASH + return key; +#else + // Check to see if the key is already in the dictionary + std::map<std::string, std::string>::iterator hashIterator = _hashDictionnary.find(key); + if (hashIterator != _hashDictionnary.end()) + return hashIterator->second; + + // Generate a new key from the file hash and insert it into the dictionary + std::string hash = newHash(); + _hashDictionnary[key] = hash; + + return hash; +#endif +} + +bool isSeparator (char s) { return (s == '-'); } + +std::string XCodeProvider::newHash() const { + std::string hash = createUUID(); + + // Remove { and - from UUID and resize to 96-bits uppercase hex string + hash.erase(remove_if(hash.begin(), hash.end(), isSeparator), hash.end()); + + hash.resize(24); + std::transform(hash.begin(), hash.end(), hash.begin(), toupper); + + return hash; +} + +////////////////////////////////////////////////////////////////////////// +// Output +////////////////////////////////////////////////////////////////////////// + +std::string replace(std::string input, const std::string find, std::string replaceStr) { + std::string::size_type pos = 0; + std::string::size_type findLen = find.length(); + std::string::size_type replaceLen = replaceStr.length(); + + if (findLen == 0 ) + return input; + + for (;(pos = input.find(find, pos)) != std::string::npos;) { + input.replace(pos, findLen, replaceStr); + pos += replaceLen; + } + + return input; +} + +std::string XCodeProvider::writeProperty(const std::string &variable, Property &prop, int flags) const { + std::string output; + + output += (flags & SettingsSingleItem ? "" : "\t\t\t") + variable + " = "; + + if (prop.settings.size() > 1 || (prop.flags & SettingsSingleItem)) + output += (prop.flags & SettingsAsList) ? "(\n" : "{\n"; + + OrderedSettingList settings = prop.getOrderedSettingList(); + for (OrderedSettingList::const_iterator setting = settings.begin(); setting != settings.end(); ++setting) { + if (settings.size() > 1 || (prop.flags & SettingsSingleItem)) + output += (flags & SettingsSingleItem ? " " : "\t\t\t\t"); + + output += writeSetting((*setting).first, (*setting).second); + + if ((prop.flags & SettingsAsList) && prop.settings.size() > 1) { + output += (prop.settings.size() > 0) ? ",\n" : "\n"; + } else { + output += ";"; + output += (flags & SettingsSingleItem ? " " : "\n"); + } + } + + if (prop.settings.size() > 1 || (prop.flags & SettingsSingleItem)) + output += (prop.flags & SettingsAsList) ? "\t\t\t);\n" : "\t\t\t};\n"; + + return output; +} + +std::string XCodeProvider::writeSetting(const std::string &variable, std::string value, std::string comment, int flags, int indent) const { + return writeSetting(variable, Setting(value, comment, flags, indent)); +} +// Heavily modified (not in a good way) function, imported from QMake XCode project generator (licensed under the QT license) +std::string XCodeProvider::writeSetting(const std::string &variable, const Setting &setting) const { + std::string output; + const std::string quote = (setting.flags & SettingsNoQuote) ? "" : "\""; + const std::string escape_quote = quote.empty() ? "" : "\\" + quote; + std::string newline = "\n"; + + // Get indent level + for (int i = 0; i < setting.indent; ++i) + newline += "\t"; + + // Setup variable + std::string var = (setting.flags & SettingsQuoteVariable) ? "\"" + variable + "\"" : variable; + + // Output a list + if (setting.flags & SettingsAsList) { + + output += var + ((setting.flags & SettingsNoValue) ? "(" : " = (") + newline; + + for (unsigned int i = 0, count = 0; i < setting.entries.size(); ++i) { + + std::string value = setting.entries.at(i).value; + if(!value.empty()) { + if (count++ > 0) + output += "," + newline; + + output += quote + replace(value, quote, escape_quote) + quote; + + std::string comment = setting.entries.at(i).comment; + if (!comment.empty()) + output += " /* " + comment + " */"; + } + + } + // Add closing ")" on new line + newline.resize(newline.size() - 1); + output += (setting.flags & SettingsNoValue) ? "\t\t\t)" : "," + newline + ")"; + } else { + output += var; + + output += (setting.flags & SettingsNoValue) ? "" : " = " + quote; + + for(unsigned int i = 0; i < setting.entries.size(); ++i) { + std::string value = setting.entries.at(i).value; + if(i) + output += " "; + output += value; + + std::string comment = setting.entries.at(i).comment; + if (!comment.empty()) + output += " /* " + comment + " */"; + } + + output += (setting.flags & SettingsNoValue) ? "" : quote; + } + return output; +} + +} // End of CreateProjectTool namespace diff --git a/devtools/create_project/xcode.h b/devtools/create_project/xcode.h new file mode 100644 index 0000000000..f86e7c555c --- /dev/null +++ b/devtools/create_project/xcode.h @@ -0,0 +1,307 @@ +/* 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 TOOLS_CREATE_PROJECT_XCODE_H +#define TOOLS_CREATE_PROJECT_XCODE_H + +#include "create_project.h" + +#include <algorithm> +#include <vector> + +namespace CreateProjectTool { + +class XCodeProvider : public ProjectProvider { +public: + XCodeProvider(StringList &global_warnings, std::map<std::string, StringList> &project_warnings, const int version = 0); + +protected: + + void createWorkspace(const BuildSetup &setup); + + void createOtherBuildFiles(const BuildSetup &setup); + + void createProjectFile(const std::string &name, const std::string &uuid, const BuildSetup &setup, const std::string &moduleDir, + const StringList &includeList, const StringList &excludeList); + + void writeFileListToProject(const FileNode &dir, std::ofstream &projectFile, const int indentation, + const StringList &duplicate, const std::string &objPrefix, const std::string &filePrefix); + +private: + enum { + SettingsAsList = 0x01, + SettingsSingleItem = 0x02, + SettingsNoQuote = 0x04, + SettingsQuoteVariable = 0x08, + SettingsNoValue = 0x10 + }; + + // File properties + struct FileProperty { + std::string fileEncoding; + std::string lastKnownFileType; + std::string fileName; + std::string filePath; + std::string sourceTree; + + FileProperty(std::string fileType = "", std::string name = "", std::string path = "", std::string source = "") : + fileEncoding(""), lastKnownFileType(fileType), fileName(name), filePath(path), sourceTree(source) + { + } + }; + + ////////////////////////////////////////////////////////////////////////// + // XCObject and children + typedef std::vector<std::string> ValueList; + + struct Entry { + std::string value; + std::string comment; + + Entry(std::string val, std::string cmt) : value(val), comment(cmt) {} + }; + + typedef std::vector<Entry> EntryList; + + struct Setting { + EntryList entries; + int flags; + int indent; + int order; + + explicit Setting(std::string value = "", std::string comment = "", int flgs = 0, int idt = 0, int ord = -1) : flags(flgs), indent(idt), order(ord) { + entries.push_back(Entry(value, comment)); + } + + explicit Setting(ValueList values, int flgs = 0, int idt = 0, int ord = -1) : flags(flgs), indent(idt), order(ord) { + for (unsigned int i = 0; i < values.size(); i++) + entries.push_back(Entry(values[i], "")); + } + + explicit Setting(EntryList ents, int flgs = 0, int idt = 0, int ord = -1) : entries(ents), flags(flgs), indent(idt), order(ord) {} + + void addEntry(std::string value, std::string comment = "") { + entries.push_back(Entry(value, comment)); + } + }; + + typedef std::map<std::string, Setting> SettingList; + typedef std::pair<std::string, Setting> SettingPair; + typedef std::vector<SettingPair> OrderedSettingList; + + static bool OrderSortPredicate(const SettingPair& s1, const SettingPair& s2) { + return s1.second.order < s2.second.order; + } + + struct Property { + public: + SettingList settings; + int flags; + bool hasOrder; + + Property() : flags(0), hasOrder(false) {} + + // Constructs a simple Property + explicit Property(std::string name, std::string value = "", std::string comment = "", int flgs = 0, int indent = 0, bool order = false) : flags(flgs), hasOrder(order) { + Setting setting(value, comment, flags, indent); + + settings[name] = setting; + } + + Property(std::string name, ValueList values, int flgs = 0, int indent = 0, bool order = false) : flags(flgs), hasOrder(order) { + Setting setting(values, flags, indent); + + settings[name] = setting; + } + + // Copy constructor + Property(const Property &rhs) { + settings = rhs.settings; + flags = rhs.flags; + } + + OrderedSettingList getOrderedSettingList() { + OrderedSettingList list; + + // Prepare vector to sort + for (SettingList::const_iterator setting = settings.begin(); setting != settings.end(); ++setting) + list.push_back(SettingPair(setting->first, setting->second)); + + // Sort vector using setting order + if (hasOrder) + std::sort(list.begin(), list.end(), OrderSortPredicate); + + return list; + } + }; + + typedef std::map<std::string, Property> PropertyList; + + // Main object struct + // This is all a big hack unfortunately, but making everything all properly abstracted would + // be overkill since we only have to generate a single project + struct Object { + public: + std::string id; // Unique identifier for this object + std::string name; // Name (may not be unique - for ex. configuration entries) + std::string refType; // Type of object this references (if any) + std::string comment; // Main comment (empty for no comment) + + PropertyList properties; // List of object properties, including output configuration + + // Constructs an object and add a default type property + Object(XCodeProvider *objectParent, std::string objectId, std::string objectName, std::string objectType, std::string objectRefType = "", std::string objectComment = "") + : id(objectId), name(objectName), refType(objectRefType), comment(objectComment), parent(objectParent) { + assert(objectParent); + assert(!objectId.empty()); + assert(!objectName.empty()); + assert(!objectType.empty()); + + addProperty("isa", objectType, "", SettingsNoQuote|SettingsNoValue); + } + + // Add a simple Property with just a name and a value + void addProperty(std::string propName, std::string propValue, std::string propComment = "", int propFlags = 0, int propIndent = 0) { + properties[propName] = Property(propValue, "", propComment, propFlags, propIndent); + } + + std::string toString(int flags = 0) { + std::string output; + output = "\t\t" + parent->getHash(id) + (comment.empty() ? "" : " /* " + comment + " */") + " = {"; + + if (flags & SettingsAsList) + output += "\n"; + + // Special case: always output the isa property first + output += parent->writeProperty("isa", properties["isa"], flags); + + // Write each property + for (PropertyList::iterator property = properties.begin(); property != properties.end(); ++property) { + if ((*property).first == "isa") + continue; + + output += parent->writeProperty((*property).first, (*property).second, flags); + } + + if (flags & SettingsAsList) + output += "\t\t"; + + output += "};\n"; + + return output; + } + + private: + XCodeProvider *parent; + + // Returns the type property (should always be the first in the properties map) + std::string getType() { + assert(!properties.empty()); + assert(!properties["isa"].settings.empty()); + + SettingList::iterator it = properties["isa"].settings.begin(); + + return (*it).first; + } + }; + + struct ObjectList { + private: + std::map<std::string, bool> objectMap; + + public: + std::vector<Object *> objects; + std::string comment; + int flags; + + void add(Object *obj) { + std::map<std::string, bool>::iterator it = objectMap.find(obj->id); + if (it != objectMap.end() && it->second == true) + return; + + objects.push_back(obj); + objectMap[obj->id] = true; + } + + std::string toString() { + std::string output; + + if (!comment.empty()) + output = "\n/* Begin " + comment + " section */\n"; + + for (std::vector<Object *>::iterator object = objects.begin(); object != objects.end(); ++object) + output += (*object)->toString(flags); + + if (!comment.empty()) + output += "/* End " + comment + " section */\n"; + + return output; + } + }; + + // All objects + std::map<std::string, std::string> _hashDictionnary; + ValueList _defines; + + // Targets + ValueList _targets; + + // Lists of objects + ObjectList _buildFile; + ObjectList _copyFilesBuildPhase; + ObjectList _fileReference; + ObjectList _frameworksBuildPhase; + ObjectList _groups; + ObjectList _nativeTarget; + ObjectList _project; + ObjectList _resourcesBuildPhase; + ObjectList _sourcesBuildPhase; + ObjectList _buildConfiguration; + ObjectList _configurationList; + + void ouputMainProjectFile(const BuildSetup &setup); + + // Setup objects + void setupCopyFilesBuildPhase(); + void setupFrameworksBuildPhase(); + void setupNativeTarget(); + void setupProject(); + void setupResourcesBuildPhase(); + void setupSourcesBuildPhase(); + void setupBuildConfiguration(); + + // Misc + void setupDefines(const BuildSetup &setup); // Setup the list of defines to be used on build configurations + + // Hash generation + std::string getHash(std::string key); + std::string newHash() const; + + // Output + std::string writeProperty(const std::string &variable, Property &property, int flags = 0) const; + std::string writeSetting(const std::string &variable, std::string name, std::string comment = "", int flags = 0, int indent = 0) const; + std::string writeSetting(const std::string &variable, const Setting &setting) const; +}; + +} // End of CreateProjectTool namespace + +#endif // TOOLS_CREATE_PROJECT_XCODE_H diff --git a/devtools/create_project/xcode/create_project.xcodeproj/project.pbxproj b/devtools/create_project/xcode/create_project.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..f13bcf6969 --- /dev/null +++ b/devtools/create_project/xcode/create_project.xcodeproj/project.pbxproj @@ -0,0 +1,255 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + F9A66C691396D4DF00CEE494 /* codeblocks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9A66C5F1396D4DF00CEE494 /* codeblocks.cpp */; }; + F9A66C6A1396D4DF00CEE494 /* create_project.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9A66C621396D4DF00CEE494 /* create_project.cpp */; }; + F9A66C6B1396D4DF00CEE494 /* msbuild.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9A66C651396D4DF00CEE494 /* msbuild.cpp */; }; + F9A66C6C1396D4DF00CEE494 /* msvc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9A66C671396D4DF00CEE494 /* msvc.cpp */; }; + F9A66C6F1396D4E800CEE494 /* visualstudio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9A66C6D1396D4E800CEE494 /* visualstudio.cpp */; }; + F9A66C871396E2F500CEE494 /* xcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9A66C861396E2F500CEE494 /* xcode.cpp */; }; + F9A66C91139704A400CEE494 /* create_project in CopyFiles */ = {isa = PBXBuildFile; fileRef = F9A66C271396D36100CEE494 /* create_project */; }; + F9BA99141398064E00C276C2 /* create_project in CopyFiles */ = {isa = PBXBuildFile; fileRef = F9A66C271396D36100CEE494 /* create_project */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + F9A66C251396D36100CEE494 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 12; + dstPath = ../../../../../dists/iphone; + dstSubfolderSpec = 16; + files = ( + F9A66C91139704A400CEE494 /* create_project in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F9BA99131398063A00C276C2 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ../../../../../dists/macosx; + dstSubfolderSpec = 16; + files = ( + F9BA99141398064E00C276C2 /* create_project in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + F9A66C271396D36100CEE494 /* create_project */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = create_project; sourceTree = BUILT_PRODUCTS_DIR; }; + F9A66C491396D47500CEE494 /* installer.vbs */ = {isa = PBXFileReference; lastKnownFileType = text; name = installer.vbs; path = ../scripts/installer.vbs; sourceTree = "<group>"; }; + F9A66C4A1396D47500CEE494 /* postbuild.cmd */ = {isa = PBXFileReference; lastKnownFileType = text; name = postbuild.cmd; path = ../scripts/postbuild.cmd; sourceTree = "<group>"; }; + F9A66C4B1396D47500CEE494 /* prebuild.cmd */ = {isa = PBXFileReference; lastKnownFileType = text; name = prebuild.cmd; path = ../scripts/prebuild.cmd; sourceTree = "<group>"; }; + F9A66C4C1396D47500CEE494 /* revision.vbs */ = {isa = PBXFileReference; lastKnownFileType = text; name = revision.vbs; path = ../scripts/revision.vbs; sourceTree = "<group>"; }; + F9A66C5F1396D4DF00CEE494 /* codeblocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = codeblocks.cpp; path = ../codeblocks.cpp; sourceTree = "<group>"; }; + F9A66C601396D4DF00CEE494 /* codeblocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = codeblocks.h; path = ../codeblocks.h; sourceTree = "<group>"; }; + F9A66C611396D4DF00CEE494 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = config.h; path = ../config.h; sourceTree = "<group>"; }; + F9A66C621396D4DF00CEE494 /* create_project.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = create_project.cpp; path = ../create_project.cpp; sourceTree = "<group>"; }; + F9A66C631396D4DF00CEE494 /* create_project.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = create_project.h; path = ../create_project.h; sourceTree = "<group>"; }; + F9A66C641396D4DF00CEE494 /* module.mk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = module.mk; path = ../module.mk; sourceTree = "<group>"; }; + F9A66C651396D4DF00CEE494 /* msbuild.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = msbuild.cpp; path = ../msbuild.cpp; sourceTree = "<group>"; }; + F9A66C661396D4DF00CEE494 /* msbuild.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = msbuild.h; path = ../msbuild.h; sourceTree = "<group>"; }; + F9A66C671396D4DF00CEE494 /* msvc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = msvc.cpp; path = ../msvc.cpp; sourceTree = "<group>"; }; + F9A66C681396D4DF00CEE494 /* msvc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = msvc.h; path = ../msvc.h; sourceTree = "<group>"; }; + F9A66C6D1396D4E800CEE494 /* visualstudio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = visualstudio.cpp; path = ../visualstudio.cpp; sourceTree = "<group>"; }; + F9A66C6E1396D4E800CEE494 /* visualstudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = visualstudio.h; path = ../visualstudio.h; sourceTree = "<group>"; }; + F9A66C841396E2D800CEE494 /* xcode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = xcode.h; path = ../xcode.h; sourceTree = "<group>"; }; + F9A66C861396E2F500CEE494 /* xcode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = xcode.cpp; path = ../xcode.cpp; sourceTree = "<group>"; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + F9A66C241396D36100CEE494 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + F9A66C1C1396D36100CEE494 = { + isa = PBXGroup; + children = ( + F9A66C861396E2F500CEE494 /* xcode.cpp */, + F9A66C841396E2D800CEE494 /* xcode.h */, + F9A66C6D1396D4E800CEE494 /* visualstudio.cpp */, + F9A66C6E1396D4E800CEE494 /* visualstudio.h */, + F9A66C5F1396D4DF00CEE494 /* codeblocks.cpp */, + F9A66C601396D4DF00CEE494 /* codeblocks.h */, + F9A66C611396D4DF00CEE494 /* config.h */, + F9A66C621396D4DF00CEE494 /* create_project.cpp */, + F9A66C631396D4DF00CEE494 /* create_project.h */, + F9A66C641396D4DF00CEE494 /* module.mk */, + F9A66C651396D4DF00CEE494 /* msbuild.cpp */, + F9A66C661396D4DF00CEE494 /* msbuild.h */, + F9A66C671396D4DF00CEE494 /* msvc.cpp */, + F9A66C681396D4DF00CEE494 /* msvc.h */, + F9A66C481396D45D00CEE494 /* Scripts */, + F9A66C281396D36100CEE494 /* Products */, + ); + sourceTree = "<group>"; + }; + F9A66C281396D36100CEE494 /* Products */ = { + isa = PBXGroup; + children = ( + F9A66C271396D36100CEE494 /* create_project */, + ); + name = Products; + sourceTree = "<group>"; + }; + F9A66C481396D45D00CEE494 /* Scripts */ = { + isa = PBXGroup; + children = ( + F9A66C491396D47500CEE494 /* installer.vbs */, + F9A66C4A1396D47500CEE494 /* postbuild.cmd */, + F9A66C4B1396D47500CEE494 /* prebuild.cmd */, + F9A66C4C1396D47500CEE494 /* revision.vbs */, + ); + name = Scripts; + sourceTree = "<group>"; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + F9A66C261396D36100CEE494 /* create_project */ = { + isa = PBXNativeTarget; + buildConfigurationList = F9A66C301396D36100CEE494 /* Build configuration list for PBXNativeTarget "create_project" */; + buildPhases = ( + F9A66C231396D36100CEE494 /* Sources */, + F9A66C241396D36100CEE494 /* Frameworks */, + F9A66C251396D36100CEE494 /* CopyFiles */, + F9BA99131398063A00C276C2 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = create_project; + productName = create_project; + productReference = F9A66C271396D36100CEE494 /* create_project */; + productType = "com.apple.product-type.tool"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + F9A66C1E1396D36100CEE494 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = F9A66C211396D36100CEE494 /* Build configuration list for PBXProject "create_project" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = F9A66C1C1396D36100CEE494; + productRefGroup = F9A66C281396D36100CEE494 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + F9A66C261396D36100CEE494 /* create_project */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + F9A66C231396D36100CEE494 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F9A66C691396D4DF00CEE494 /* codeblocks.cpp in Sources */, + F9A66C6A1396D4DF00CEE494 /* create_project.cpp in Sources */, + F9A66C6B1396D4DF00CEE494 /* msbuild.cpp in Sources */, + F9A66C6C1396D4DF00CEE494 /* msvc.cpp in Sources */, + F9A66C6F1396D4E800CEE494 /* visualstudio.cpp in Sources */, + F9A66C871396E2F500CEE494 /* xcode.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + F9A66C2E1396D36100CEE494 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = DEBUG; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.5; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + F9A66C2F1396D36100CEE494 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.5; + SDKROOT = macosx; + }; + name = Release; + }; + F9A66C311396D36100CEE494 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + F9A66C321396D36100CEE494 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + F9A66C211396D36100CEE494 /* Build configuration list for PBXProject "create_project" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F9A66C2E1396D36100CEE494 /* Debug */, + F9A66C2F1396D36100CEE494 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F9A66C301396D36100CEE494 /* Build configuration list for PBXNativeTarget "create_project" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F9A66C311396D36100CEE494 /* Debug */, + F9A66C321396D36100CEE494 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = F9A66C1E1396D36100CEE494 /* Project object */; +} diff --git a/devtools/credits.pl b/devtools/credits.pl index f515844e4d..b0f40cbe6e 100755 --- a/devtools/credits.pl +++ b/devtools/credits.pl @@ -500,33 +500,7 @@ begin_credits("Credits"); add_person("Ludvig Strigeus", "ludde", "(retired)"); end_section(); - begin_section("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", ""); @@ -534,12 +508,12 @@ 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(); - begin_section("Draci Historie"); + begin_section("Draci"); add_person("Denis Kasak", "dkasak13", ""); add_person("Robert Špalek", "spalek", ""); end_section(); @@ -549,12 +523,6 @@ begin_credits("Credits"); add_person("Paweł Kołodziejski", "aquadran", ""); end_section(); - begin_section("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", ""); @@ -582,13 +550,13 @@ 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", ""); end_section(); - begin_section("Lure of the Temptress"); + begin_section("Lure"); add_person("Paul Gilbert", "dreammaster", ""); end_section(); @@ -617,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]", ""); @@ -636,7 +610,33 @@ begin_credits("Credits"); add_person("Lars Skovlund", "lskovlun", ""); end_section(); - begin_section("Teen Agent"); + 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", ""); end_section(); @@ -712,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"); diff --git a/dists/iphone/readme.txt b/dists/iphone/readme.txt new file mode 100644 index 0000000000..b115ed335c --- /dev/null +++ b/dists/iphone/readme.txt @@ -0,0 +1,7 @@ +The Xcode project files can now be created automatically from the GCC +files using the create_project tool inside the /tools/create_project folder. + +To create the default project files, build create_project.exe, copy it inside +this folder and run the create_xcode.bat file for a default build. You can +run create_project.exe with no parameters to check the possible command-line +options. diff --git a/dists/iphone/scummvm.xcodeproj/project.pbxproj b/dists/iphone/scummvm.xcodeproj/project.pbxproj index 08b67b61b3..b9b276d654 100755 --- a/dists/iphone/scummvm.xcodeproj/project.pbxproj +++ b/dists/iphone/scummvm.xcodeproj/project.pbxproj @@ -36,6 +36,7 @@ 8CB5A9E41253FDF500CB6BC7 /* teenagent.dat in Resources */ = {isa = PBXBuildFile; fileRef = 8CB5A9D81253FDF500CB6BC7 /* teenagent.dat */; }; 8CD1ED0B126202AB00FA198C /* detection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECC6126202AA00FA198C /* detection.cpp */; }; 8CD1ED0C126202AB00FA198C /* display.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECC7126202AA00FA198C /* display.cpp */; }; + 8CD1ED0D126202AB00FA198C /* engine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECC9126202AA00FA198C /* engine.cpp */; }; 8CD1ED0E126202AB00FA198C /* file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECCB126202AA00FA198C /* file.cpp */; }; 8CD1ED0F126202AB00FA198C /* hugo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECCF126202AA00FA198C /* hugo.cpp */; }; 8CD1ED10126202AB00FA198C /* intro.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECD1126202AA00FA198C /* intro.cpp */; }; @@ -67,6 +68,7 @@ 8CD1ED2E126202AB00FA198C /* toon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ED09126202AA00FA198C /* toon.cpp */; }; 8CD1ED2F126202AB00FA198C /* detection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECC6126202AA00FA198C /* detection.cpp */; }; 8CD1ED30126202AB00FA198C /* display.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECC7126202AA00FA198C /* display.cpp */; }; + 8CD1ED31126202AB00FA198C /* engine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECC9126202AA00FA198C /* engine.cpp */; }; 8CD1ED32126202AB00FA198C /* file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECCB126202AA00FA198C /* file.cpp */; }; 8CD1ED33126202AB00FA198C /* hugo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECCF126202AA00FA198C /* hugo.cpp */; }; 8CD1ED34126202AB00FA198C /* intro.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECD1126202AA00FA198C /* intro.cpp */; }; @@ -98,6 +100,7 @@ 8CD1ED52126202AB00FA198C /* toon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ED09126202AA00FA198C /* toon.cpp */; }; 8CD1ED53126202AB00FA198C /* detection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECC6126202AA00FA198C /* detection.cpp */; }; 8CD1ED54126202AB00FA198C /* display.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECC7126202AA00FA198C /* display.cpp */; }; + 8CD1ED55126202AB00FA198C /* engine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECC9126202AA00FA198C /* engine.cpp */; }; 8CD1ED56126202AB00FA198C /* file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECCB126202AA00FA198C /* file.cpp */; }; 8CD1ED57126202AB00FA198C /* hugo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECCF126202AA00FA198C /* hugo.cpp */; }; 8CD1ED58126202AB00FA198C /* intro.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECD1126202AA00FA198C /* intro.cpp */; }; @@ -235,14 +238,41 @@ DF093EA80F63CB26002D821E /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477910D81F4E900B6D1FB /* console.cpp */; }; DF093EA90F63CB26002D821E /* debugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477940D81F4E900B6D1FB /* debugger.cpp */; }; DF093EAA0F63CB26002D821E /* dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477960D81F4E900B6D1FB /* dialog.cpp */; }; + DF093EAB0F63CB26002D821E /* editable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477980D81F4E900B6D1FB /* editable.cpp */; }; + DF093EAC0F63CB26002D821E /* EditTextWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4779A0D81F4E900B6D1FB /* EditTextWidget.cpp */; }; DF093EAD0F63CB26002D821E /* Key.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4779E0D81F4E900B6D1FB /* Key.cpp */; }; DF093EAE0F63CB26002D821E /* launcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A20D81F4E900B6D1FB /* launcher.cpp */; }; + DF093EAF0F63CB26002D821E /* ListWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A40D81F4E900B6D1FB /* ListWidget.cpp */; }; DF093EB00F63CB26002D821E /* massadd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A60D81F4E900B6D1FB /* massadd.cpp */; }; DF093EB10F63CB26002D821E /* message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A80D81F4E900B6D1FB /* message.cpp */; }; DF093EB20F63CB26002D821E /* object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477AD0D81F4E900B6D1FB /* object.cpp */; }; DF093EB30F63CB26002D821E /* options.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477AF0D81F4E900B6D1FB /* options.cpp */; }; + DF093EB40F63CB26002D821E /* PopUpWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477B10D81F4E900B6D1FB /* PopUpWidget.cpp */; }; + DF093EB50F63CB26002D821E /* ScrollBarWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477B30D81F4E900B6D1FB /* ScrollBarWidget.cpp */; }; + DF093EB60F63CB26002D821E /* TabWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477B50D81F4E900B6D1FB /* TabWidget.cpp */; }; DF093EB70F63CB26002D821E /* themebrowser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477BA0D81F4E900B6D1FB /* themebrowser.cpp */; }; DF093EB80F63CB26002D821E /* widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477C40D81F4E900B6D1FB /* widget.cpp */; }; + DF093EBB0F63CB26002D821E /* audiocd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477CB0D81F4E900B6D1FB /* audiocd.cpp */; }; + DF093EBC0F63CB26002D821E /* audiostream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477CD0D81F4E900B6D1FB /* audiostream.cpp */; }; + DF093EBE0F63CB26002D821E /* fmopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D10D81F4E900B6D1FB /* fmopl.cpp */; }; + DF093EC00F63CB26002D821E /* mididrv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D50D81F4E900B6D1FB /* mididrv.cpp */; }; + DF093EC10F63CB26002D821E /* midiparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D70D81F4E900B6D1FB /* midiparser.cpp */; }; + DF093EC20F63CB26002D821E /* midiparser_smf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D90D81F4E900B6D1FB /* midiparser_smf.cpp */; }; + DF093EC30F63CB26002D821E /* midiparser_xmidi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477DA0D81F4E900B6D1FB /* midiparser_xmidi.cpp */; }; + DF093EC40F63CB26002D821E /* mixer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477DB0D81F4E900B6D1FB /* mixer.cpp */; }; + DF093EC50F63CB26002D821E /* infogrames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477DE0D81F4E900B6D1FB /* infogrames.cpp */; }; + DF093EC60F63CB26002D821E /* module.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E00D81F4E900B6D1FB /* module.cpp */; }; + DF093EC70F63CB26002D821E /* paula.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E20D81F4E900B6D1FB /* paula.cpp */; }; + DF093EC80F63CB26002D821E /* protracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E40D81F4E900B6D1FB /* protracker.cpp */; }; + DF093EC90F63CB26002D821E /* rjp1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E60D81F4E900B6D1FB /* rjp1.cpp */; }; + DF093ECA0F63CB26002D821E /* soundfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E80D81F4E900B6D1FB /* soundfx.cpp */; }; + DF093ECC0F63CB26002D821E /* mpu401.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477ED0D81F4E900B6D1FB /* mpu401.cpp */; }; + DF093ECD0F63CB26002D821E /* null.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477EF0D81F4E900B6D1FB /* null.cpp */; }; + DF093ECE0F63CB26002D821E /* rate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477F00D81F4E900B6D1FB /* rate.cpp */; }; + DF093ECF0F63CB26002D821E /* adlib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477F70D81F4E900B6D1FB /* adlib.cpp */; }; + DF093ED00F63CB26002D821E /* fluidsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477F90D81F4E900B6D1FB /* fluidsynth.cpp */; }; + DF093ED10F63CB26002D821E /* pcspk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE478210D81F4E900B6D1FB /* pcspk.cpp */; }; + DF093ED20F63CB26002D821E /* ym2612.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE478230D81F4E900B6D1FB /* ym2612.cpp */; }; DF093ED60F63CB26002D821E /* memorypool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD511460DF3383500854012 /* memorypool.cpp */; }; DF093ED70F63CB26002D821E /* seq.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD517E10DF33CAC00854012 /* seq.cpp */; }; DF093ED80F63CB26002D821E /* scaler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD5183B0DF3411800854012 /* scaler.cpp */; }; @@ -870,6 +900,7 @@ DF09417A0F63CB26002D821E /* archive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A400E7BBBB400F5680E /* archive.cpp */; }; DF09417B0F63CB26002D821E /* unarj.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A450E7BBBB400F5680E /* unarj.cpp */; }; DF09417C0F63CB26002D821E /* stdiostream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A6B0E7BBD5700F5680E /* stdiostream.cpp */; }; + DF09417D0F63CB26002D821E /* musicplugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A6F0E7BBDB200F5680E /* musicplugin.cpp */; }; DF09417E0F63CB26002D821E /* saveload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7E8BF00ED5FC77001CB19F /* saveload.cpp */; }; DF09417F0F63CB26002D821E /* ThemeEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7E8BF40ED5FC77001CB19F /* ThemeEngine.cpp */; }; DF0941800F63CB26002D821E /* ThemeEval.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7E8BF60ED5FC77001CB19F /* ThemeEval.cpp */; }; @@ -886,6 +917,7 @@ DF09418B0F63CB26002D821E /* thumbnail_intern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFAAB0010F011392003E9390 /* thumbnail_intern.cpp */; }; DF09418C0F63CB26002D821E /* dither.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFB900F485D890006E566 /* dither.cpp */; }; DF0941920F63CB26002D821E /* debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFBD10F485DFB0006E566 /* debug.cpp */; }; + DF0941930F63CB26002D821E /* gui-manager.hcpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFBD50F485E360006E566 /* gui-manager.hcpp */; }; DF0941940F63CB26002D821E /* posix-saves.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFBF80F4860A60006E566 /* posix-saves.cpp */; }; DF0941950F63CB26002D821E /* bmv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFC1F0F4862520006E566 /* bmv.cpp */; }; DF0941960F63CB26002D821E /* dialogs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFC200F4862520006E566 /* dialogs.cpp */; }; @@ -957,9 +989,12 @@ DF09420D0F63CB26002D821E /* timer_lol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF573CBD0F5A85E100961A72 /* timer_lol.cpp */; }; DF0942100F63CB26002D821E /* sprites_lol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF89C2870F62D55C00D756B6 /* sprites_lol.cpp */; }; DF0942110F63CB26002D821E /* script.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF89C2A30F62D79E00D756B6 /* script.cpp */; }; + DF0942140F63CB26002D821E /* timestamp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF89C2B80F62D91000D756B6 /* timestamp.cpp */; }; DF0942150F63CB26002D821E /* pn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF093E5C0F63CAD4002D821E /* pn.cpp */; }; DF0942160F63CB26002D821E /* script_pn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF093E5D0F63CAD4002D821E /* script_pn.cpp */; }; DF0942170F63CB26002D821E /* vga_pn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF093E5E0F63CAD4002D821E /* vga_pn.cpp */; }; + DF0942430F63CB9A002D821E /* events.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF0942350F63CB9A002D821E /* events.cpp */; }; + DF0942450F63CB9A002D821E /* graphics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF0942370F63CB9A002D821E /* graphics.cpp */; }; DF0942470F63CB9A002D821E /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF0942390F63CB9A002D821E /* main.cpp */; }; DF09424A0F63CB9A002D821E /* sdl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF09423C0F63CB9A002D821E /* sdl.cpp */; }; DF0943730F63D1DA002D821E /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DF842A170E7BB34E00F5680E /* CoreFoundation.framework */; }; @@ -994,255 +1029,9 @@ DF0E303A1252C5BD0082D593 /* cms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF0E30391252C5BD0082D593 /* cms.cpp */; }; DF0E303B1252C5BD0082D593 /* cms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF0E30391252C5BD0082D593 /* cms.cpp */; }; DF0E303C1252C5BD0082D593 /* cms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF0E30391252C5BD0082D593 /* cms.cpp */; }; - DF203F471380C06E0056300A /* gui-manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F461380C06E0056300A /* gui-manager.cpp */; }; - DF203F481380C06E0056300A /* gui-manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F461380C06E0056300A /* gui-manager.cpp */; }; - DF203F491380C06E0056300A /* gui-manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F461380C06E0056300A /* gui-manager.cpp */; }; - DF203F631380C2750056300A /* avi_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F531380C2740056300A /* avi_decoder.cpp */; }; - DF203F641380C2750056300A /* coktel_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F551380C2740056300A /* coktel_decoder.cpp */; }; - DF203F651380C2750056300A /* dxa_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F571380C2740056300A /* dxa_decoder.cpp */; }; - DF203F661380C2750056300A /* flic_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F591380C2740056300A /* flic_decoder.cpp */; }; - DF203F681380C2750056300A /* qt_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F5D1380C2740056300A /* qt_decoder.cpp */; }; - DF203F691380C2750056300A /* smk_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F5F1380C2750056300A /* smk_decoder.cpp */; }; - DF203F6A1380C2750056300A /* video_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F611380C2750056300A /* video_decoder.cpp */; }; - DF203F6B1380C2750056300A /* avi_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F531380C2740056300A /* avi_decoder.cpp */; }; - DF203F6C1380C2750056300A /* coktel_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F551380C2740056300A /* coktel_decoder.cpp */; }; - DF203F6D1380C2750056300A /* dxa_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F571380C2740056300A /* dxa_decoder.cpp */; }; - DF203F6E1380C2750056300A /* flic_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F591380C2740056300A /* flic_decoder.cpp */; }; - DF203F701380C2750056300A /* qt_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F5D1380C2740056300A /* qt_decoder.cpp */; }; - DF203F711380C2750056300A /* smk_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F5F1380C2750056300A /* smk_decoder.cpp */; }; - DF203F721380C2750056300A /* video_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F611380C2750056300A /* video_decoder.cpp */; }; - DF203F731380C2750056300A /* avi_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F531380C2740056300A /* avi_decoder.cpp */; }; - DF203F741380C2750056300A /* coktel_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F551380C2740056300A /* coktel_decoder.cpp */; }; - DF203F751380C2750056300A /* dxa_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F571380C2740056300A /* dxa_decoder.cpp */; }; - DF203F761380C2750056300A /* flic_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F591380C2740056300A /* flic_decoder.cpp */; }; - DF203F781380C2750056300A /* qt_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F5D1380C2740056300A /* qt_decoder.cpp */; }; - DF203F791380C2750056300A /* smk_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F5F1380C2750056300A /* smk_decoder.cpp */; }; - DF203F7A1380C2750056300A /* video_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F611380C2750056300A /* video_decoder.cpp */; }; - DF203F951380C2920056300A /* cdtoons.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F7C1380C2920056300A /* cdtoons.cpp */; }; - DF203F961380C2920056300A /* cinepak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F7E1380C2920056300A /* cinepak.cpp */; }; - DF203F971380C2920056300A /* indeo3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F811380C2920056300A /* indeo3.cpp */; }; - DF203F981380C2920056300A /* mjpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F831380C2920056300A /* mjpeg.cpp */; }; - DF203F991380C2920056300A /* msrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F851380C2920056300A /* msrle.cpp */; }; - DF203F9A1380C2920056300A /* msvideo1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F871380C2920056300A /* msvideo1.cpp */; }; - DF203F9B1380C2920056300A /* qdm2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F891380C2920056300A /* qdm2.cpp */; }; - DF203F9C1380C2920056300A /* qtrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F8C1380C2920056300A /* qtrle.cpp */; }; - DF203F9D1380C2920056300A /* rpza.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F8E1380C2920056300A /* rpza.cpp */; }; - DF203F9E1380C2920056300A /* smc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F901380C2920056300A /* smc.cpp */; }; - DF203F9F1380C2920056300A /* truemotion1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F921380C2920056300A /* truemotion1.cpp */; }; - DF203FA01380C2920056300A /* cdtoons.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F7C1380C2920056300A /* cdtoons.cpp */; }; - DF203FA11380C2920056300A /* cinepak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F7E1380C2920056300A /* cinepak.cpp */; }; - DF203FA21380C2920056300A /* indeo3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F811380C2920056300A /* indeo3.cpp */; }; - DF203FA31380C2920056300A /* mjpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F831380C2920056300A /* mjpeg.cpp */; }; - DF203FA41380C2920056300A /* msrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F851380C2920056300A /* msrle.cpp */; }; - DF203FA51380C2920056300A /* msvideo1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F871380C2920056300A /* msvideo1.cpp */; }; - DF203FA61380C2920056300A /* qdm2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F891380C2920056300A /* qdm2.cpp */; }; - DF203FA71380C2920056300A /* qtrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F8C1380C2920056300A /* qtrle.cpp */; }; - DF203FA81380C2920056300A /* rpza.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F8E1380C2920056300A /* rpza.cpp */; }; - DF203FA91380C2920056300A /* smc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F901380C2920056300A /* smc.cpp */; }; - DF203FAA1380C2920056300A /* truemotion1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F921380C2920056300A /* truemotion1.cpp */; }; - DF203FAB1380C2920056300A /* cdtoons.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F7C1380C2920056300A /* cdtoons.cpp */; }; - DF203FAC1380C2920056300A /* cinepak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F7E1380C2920056300A /* cinepak.cpp */; }; - DF203FAD1380C2920056300A /* indeo3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F811380C2920056300A /* indeo3.cpp */; }; - DF203FAE1380C2920056300A /* mjpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F831380C2920056300A /* mjpeg.cpp */; }; - DF203FAF1380C2920056300A /* msrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F851380C2920056300A /* msrle.cpp */; }; - DF203FB01380C2920056300A /* msvideo1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F871380C2920056300A /* msvideo1.cpp */; }; - DF203FB11380C2920056300A /* qdm2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F891380C2920056300A /* qdm2.cpp */; }; - DF203FB21380C2920056300A /* qtrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F8C1380C2920056300A /* qtrle.cpp */; }; - DF203FB31380C2920056300A /* rpza.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F8E1380C2920056300A /* rpza.cpp */; }; - DF203FB41380C2920056300A /* smc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F901380C2920056300A /* smc.cpp */; }; - DF203FB51380C2920056300A /* truemotion1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F921380C2920056300A /* truemotion1.cpp */; }; - DF203FD51380C3BC0056300A /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC01380C3BC0056300A /* console.cpp */; }; - DF203FD61380C3BC0056300A /* dialogs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC21380C3BC0056300A /* dialogs.cpp */; }; - DF203FD71380C3BC0056300A /* file_v1d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC41380C3BC0056300A /* file_v1d.cpp */; }; - DF203FD81380C3BC0056300A /* file_v1w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC51380C3BC0056300A /* file_v1w.cpp */; }; - DF203FD91380C3BC0056300A /* file_v2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC61380C3BC0056300A /* file_v2d.cpp */; }; - DF203FDA1380C3BC0056300A /* file_v2w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC71380C3BC0056300A /* file_v2w.cpp */; }; - DF203FDB1380C3BC0056300A /* file_v3d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC81380C3BC0056300A /* file_v3d.cpp */; }; - DF203FDC1380C3BC0056300A /* object_v1d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC91380C3BC0056300A /* object_v1d.cpp */; }; - DF203FDD1380C3BC0056300A /* object_v1w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCA1380C3BC0056300A /* object_v1w.cpp */; }; - DF203FDE1380C3BC0056300A /* object_v2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCB1380C3BC0056300A /* object_v2d.cpp */; }; - DF203FDF1380C3BC0056300A /* object_v3d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCC1380C3BC0056300A /* object_v3d.cpp */; }; - DF203FE01380C3BC0056300A /* object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCD1380C3BC0056300A /* object.cpp */; }; - DF203FE11380C3BC0056300A /* parser_v1d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCF1380C3BC0056300A /* parser_v1d.cpp */; }; - DF203FE21380C3BC0056300A /* parser_v1w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD01380C3BC0056300A /* parser_v1w.cpp */; }; - DF203FE31380C3BC0056300A /* parser_v2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD11380C3BC0056300A /* parser_v2d.cpp */; }; - DF203FE41380C3BC0056300A /* parser_v3d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD21380C3BC0056300A /* parser_v3d.cpp */; }; - DF203FE51380C3BC0056300A /* text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD31380C3BC0056300A /* text.cpp */; }; - DF203FE61380C3BC0056300A /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC01380C3BC0056300A /* console.cpp */; }; - DF203FE71380C3BC0056300A /* dialogs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC21380C3BC0056300A /* dialogs.cpp */; }; - DF203FE81380C3BC0056300A /* file_v1d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC41380C3BC0056300A /* file_v1d.cpp */; }; - DF203FE91380C3BC0056300A /* file_v1w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC51380C3BC0056300A /* file_v1w.cpp */; }; - DF203FEA1380C3BC0056300A /* file_v2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC61380C3BC0056300A /* file_v2d.cpp */; }; - DF203FEB1380C3BC0056300A /* file_v2w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC71380C3BC0056300A /* file_v2w.cpp */; }; - DF203FEC1380C3BC0056300A /* file_v3d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC81380C3BC0056300A /* file_v3d.cpp */; }; - DF203FED1380C3BC0056300A /* object_v1d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC91380C3BC0056300A /* object_v1d.cpp */; }; - DF203FEE1380C3BC0056300A /* object_v1w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCA1380C3BC0056300A /* object_v1w.cpp */; }; - DF203FEF1380C3BC0056300A /* object_v2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCB1380C3BC0056300A /* object_v2d.cpp */; }; - DF203FF01380C3BC0056300A /* object_v3d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCC1380C3BC0056300A /* object_v3d.cpp */; }; - DF203FF11380C3BC0056300A /* object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCD1380C3BC0056300A /* object.cpp */; }; - DF203FF21380C3BC0056300A /* parser_v1d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCF1380C3BC0056300A /* parser_v1d.cpp */; }; - DF203FF31380C3BC0056300A /* parser_v1w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD01380C3BC0056300A /* parser_v1w.cpp */; }; - DF203FF41380C3BC0056300A /* parser_v2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD11380C3BC0056300A /* parser_v2d.cpp */; }; - DF203FF51380C3BC0056300A /* parser_v3d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD21380C3BC0056300A /* parser_v3d.cpp */; }; - DF203FF61380C3BC0056300A /* text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD31380C3BC0056300A /* text.cpp */; }; - DF203FF71380C3BC0056300A /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC01380C3BC0056300A /* console.cpp */; }; - DF203FF81380C3BC0056300A /* dialogs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC21380C3BC0056300A /* dialogs.cpp */; }; - DF203FF91380C3BC0056300A /* file_v1d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC41380C3BC0056300A /* file_v1d.cpp */; }; - DF203FFA1380C3BC0056300A /* file_v1w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC51380C3BC0056300A /* file_v1w.cpp */; }; - DF203FFB1380C3BC0056300A /* file_v2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC61380C3BC0056300A /* file_v2d.cpp */; }; - DF203FFC1380C3BC0056300A /* file_v2w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC71380C3BC0056300A /* file_v2w.cpp */; }; - DF203FFD1380C3BC0056300A /* file_v3d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC81380C3BC0056300A /* file_v3d.cpp */; }; - DF203FFE1380C3BC0056300A /* object_v1d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC91380C3BC0056300A /* object_v1d.cpp */; }; - DF203FFF1380C3BC0056300A /* object_v1w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCA1380C3BC0056300A /* object_v1w.cpp */; }; - DF2040001380C3BC0056300A /* object_v2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCB1380C3BC0056300A /* object_v2d.cpp */; }; - DF2040011380C3BC0056300A /* object_v3d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCC1380C3BC0056300A /* object_v3d.cpp */; }; - DF2040021380C3BC0056300A /* object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCD1380C3BC0056300A /* object.cpp */; }; - DF2040031380C3BC0056300A /* parser_v1d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCF1380C3BC0056300A /* parser_v1d.cpp */; }; - DF2040041380C3BC0056300A /* parser_v1w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD01380C3BC0056300A /* parser_v1w.cpp */; }; - DF2040051380C3BC0056300A /* parser_v2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD11380C3BC0056300A /* parser_v2d.cpp */; }; - DF2040061380C3BC0056300A /* parser_v3d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD21380C3BC0056300A /* parser_v3d.cpp */; }; - DF2040071380C3BC0056300A /* text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD31380C3BC0056300A /* text.cpp */; }; - DF20402E1380C8B70056300A /* editable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040221380C8B70056300A /* editable.cpp */; }; - DF20402F1380C8B70056300A /* edittext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040241380C8B70056300A /* edittext.cpp */; }; - DF2040301380C8B70056300A /* list.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040261380C8B70056300A /* list.cpp */; }; - DF2040311380C8B70056300A /* popup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040281380C8B70056300A /* popup.cpp */; }; - DF2040321380C8B70056300A /* scrollbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20402A1380C8B70056300A /* scrollbar.cpp */; }; - DF2040331380C8B70056300A /* tab.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20402C1380C8B70056300A /* tab.cpp */; }; - DF2040341380C8B70056300A /* editable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040221380C8B70056300A /* editable.cpp */; }; - DF2040351380C8B70056300A /* edittext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040241380C8B70056300A /* edittext.cpp */; }; - DF2040361380C8B70056300A /* list.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040261380C8B70056300A /* list.cpp */; }; - DF2040371380C8B70056300A /* popup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040281380C8B70056300A /* popup.cpp */; }; - DF2040381380C8B70056300A /* scrollbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20402A1380C8B70056300A /* scrollbar.cpp */; }; - DF2040391380C8B70056300A /* tab.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20402C1380C8B70056300A /* tab.cpp */; }; - DF20403A1380C8B70056300A /* editable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040221380C8B70056300A /* editable.cpp */; }; - DF20403B1380C8B70056300A /* edittext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040241380C8B70056300A /* edittext.cpp */; }; - DF20403C1380C8B70056300A /* list.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040261380C8B70056300A /* list.cpp */; }; - DF20403D1380C8B70056300A /* popup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040281380C8B70056300A /* popup.cpp */; }; - DF20403E1380C8B70056300A /* scrollbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20402A1380C8B70056300A /* scrollbar.cpp */; }; - DF20403F1380C8B70056300A /* tab.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20402C1380C8B70056300A /* tab.cpp */; }; - DF20405E1380CA230056300A /* audiostream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040471380CA230056300A /* audiostream.cpp */; }; - DF20405F1380CA230056300A /* fmopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040491380CA230056300A /* fmopl.cpp */; }; - DF2040601380CA230056300A /* mididrv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404B1380CA230056300A /* mididrv.cpp */; }; - DF2040611380CA230056300A /* midiparser_smf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404D1380CA230056300A /* midiparser_smf.cpp */; }; - DF2040621380CA230056300A /* midiparser_xmidi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404E1380CA230056300A /* midiparser_xmidi.cpp */; }; - DF2040631380CA230056300A /* midiparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404F1380CA230056300A /* midiparser.cpp */; }; - DF2040641380CA230056300A /* midiplayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040511380CA230056300A /* midiplayer.cpp */; }; - DF2040651380CA230056300A /* mixer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040541380CA230056300A /* mixer.cpp */; }; - DF2040661380CA230056300A /* mpu401.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040561380CA230056300A /* mpu401.cpp */; }; - DF2040671380CA230056300A /* musicplugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040581380CA230056300A /* musicplugin.cpp */; }; - DF2040681380CA230056300A /* rate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20405A1380CA230056300A /* rate.cpp */; }; - DF2040691380CA230056300A /* timestamp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20405C1380CA230056300A /* timestamp.cpp */; }; - DF20406A1380CA230056300A /* audiostream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040471380CA230056300A /* audiostream.cpp */; }; - DF20406B1380CA230056300A /* fmopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040491380CA230056300A /* fmopl.cpp */; }; - DF20406C1380CA230056300A /* mididrv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404B1380CA230056300A /* mididrv.cpp */; }; - DF20406D1380CA230056300A /* midiparser_smf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404D1380CA230056300A /* midiparser_smf.cpp */; }; - DF20406E1380CA230056300A /* midiparser_xmidi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404E1380CA230056300A /* midiparser_xmidi.cpp */; }; - DF20406F1380CA230056300A /* midiparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404F1380CA230056300A /* midiparser.cpp */; }; - DF2040701380CA230056300A /* midiplayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040511380CA230056300A /* midiplayer.cpp */; }; - DF2040711380CA230056300A /* mixer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040541380CA230056300A /* mixer.cpp */; }; - DF2040721380CA230056300A /* mpu401.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040561380CA230056300A /* mpu401.cpp */; }; - DF2040731380CA230056300A /* musicplugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040581380CA230056300A /* musicplugin.cpp */; }; - DF2040741380CA230056300A /* rate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20405A1380CA230056300A /* rate.cpp */; }; - DF2040751380CA230056300A /* timestamp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20405C1380CA230056300A /* timestamp.cpp */; }; - DF2040761380CA230056300A /* audiostream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040471380CA230056300A /* audiostream.cpp */; }; - DF2040771380CA230056300A /* fmopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040491380CA230056300A /* fmopl.cpp */; }; - DF2040781380CA230056300A /* mididrv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404B1380CA230056300A /* mididrv.cpp */; }; - DF2040791380CA230056300A /* midiparser_smf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404D1380CA230056300A /* midiparser_smf.cpp */; }; - DF20407A1380CA230056300A /* midiparser_xmidi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404E1380CA230056300A /* midiparser_xmidi.cpp */; }; - DF20407B1380CA230056300A /* midiparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404F1380CA230056300A /* midiparser.cpp */; }; - DF20407C1380CA230056300A /* midiplayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040511380CA230056300A /* midiplayer.cpp */; }; - DF20407D1380CA230056300A /* mixer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040541380CA230056300A /* mixer.cpp */; }; - DF20407E1380CA230056300A /* mpu401.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040561380CA230056300A /* mpu401.cpp */; }; - DF20407F1380CA230056300A /* musicplugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040581380CA230056300A /* musicplugin.cpp */; }; - DF2040801380CA230056300A /* rate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20405A1380CA230056300A /* rate.cpp */; }; - DF2040811380CA230056300A /* timestamp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20405C1380CA230056300A /* timestamp.cpp */; }; - DF20409A1380CA400056300A /* adpcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040841380CA400056300A /* adpcm.cpp */; }; - DF20409B1380CA400056300A /* aiff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040861380CA400056300A /* aiff.cpp */; }; - DF20409C1380CA400056300A /* flac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040881380CA400056300A /* flac.cpp */; }; - DF20409D1380CA400056300A /* iff_sound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20408A1380CA400056300A /* iff_sound.cpp */; }; - DF20409E1380CA400056300A /* mac_snd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20408C1380CA400056300A /* mac_snd.cpp */; }; - DF20409F1380CA400056300A /* mp3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20408E1380CA400056300A /* mp3.cpp */; }; - DF2040A01380CA400056300A /* raw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040901380CA400056300A /* raw.cpp */; }; - DF2040A11380CA400056300A /* vag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040921380CA400056300A /* vag.cpp */; }; - DF2040A21380CA400056300A /* voc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040941380CA400056300A /* voc.cpp */; }; - DF2040A31380CA400056300A /* vorbis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040961380CA400056300A /* vorbis.cpp */; }; - DF2040A41380CA400056300A /* wave.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040981380CA400056300A /* wave.cpp */; }; - DF2040A51380CA400056300A /* adpcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040841380CA400056300A /* adpcm.cpp */; }; - DF2040A61380CA400056300A /* aiff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040861380CA400056300A /* aiff.cpp */; }; - DF2040A71380CA400056300A /* flac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040881380CA400056300A /* flac.cpp */; }; - DF2040A81380CA400056300A /* iff_sound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20408A1380CA400056300A /* iff_sound.cpp */; }; - DF2040A91380CA400056300A /* mac_snd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20408C1380CA400056300A /* mac_snd.cpp */; }; - DF2040AA1380CA400056300A /* mp3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20408E1380CA400056300A /* mp3.cpp */; }; - DF2040AB1380CA400056300A /* raw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040901380CA400056300A /* raw.cpp */; }; - DF2040AC1380CA400056300A /* vag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040921380CA400056300A /* vag.cpp */; }; - DF2040AD1380CA400056300A /* voc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040941380CA400056300A /* voc.cpp */; }; - DF2040AE1380CA400056300A /* vorbis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040961380CA400056300A /* vorbis.cpp */; }; - DF2040AF1380CA400056300A /* wave.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040981380CA400056300A /* wave.cpp */; }; - DF2040B01380CA400056300A /* adpcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040841380CA400056300A /* adpcm.cpp */; }; - DF2040B11380CA400056300A /* aiff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040861380CA400056300A /* aiff.cpp */; }; - DF2040B21380CA400056300A /* flac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040881380CA400056300A /* flac.cpp */; }; - DF2040B31380CA400056300A /* iff_sound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20408A1380CA400056300A /* iff_sound.cpp */; }; - DF2040B41380CA400056300A /* mac_snd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20408C1380CA400056300A /* mac_snd.cpp */; }; - DF2040B51380CA400056300A /* mp3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20408E1380CA400056300A /* mp3.cpp */; }; - DF2040B61380CA400056300A /* raw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040901380CA400056300A /* raw.cpp */; }; - DF2040B71380CA400056300A /* vag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040921380CA400056300A /* vag.cpp */; }; - DF2040B81380CA400056300A /* voc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040941380CA400056300A /* voc.cpp */; }; - DF2040B91380CA400056300A /* vorbis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040961380CA400056300A /* vorbis.cpp */; }; - DF2040BA1380CA400056300A /* wave.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040981380CA400056300A /* wave.cpp */; }; - DF2040CC1380CA810056300A /* infogrames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040BC1380CA810056300A /* infogrames.cpp */; }; - DF2040CD1380CA810056300A /* maxtrax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040BE1380CA810056300A /* maxtrax.cpp */; }; - DF2040CE1380CA810056300A /* module.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C01380CA810056300A /* module.cpp */; }; - DF2040CF1380CA810056300A /* paula.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C21380CA810056300A /* paula.cpp */; }; - DF2040D01380CA810056300A /* protracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C41380CA810056300A /* protracker.cpp */; }; - DF2040D11380CA810056300A /* rjp1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C61380CA810056300A /* rjp1.cpp */; }; - DF2040D21380CA810056300A /* soundfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C81380CA810056300A /* soundfx.cpp */; }; - DF2040D31380CA810056300A /* tfmx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040CA1380CA810056300A /* tfmx.cpp */; }; - DF2040D41380CA810056300A /* infogrames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040BC1380CA810056300A /* infogrames.cpp */; }; - DF2040D51380CA810056300A /* maxtrax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040BE1380CA810056300A /* maxtrax.cpp */; }; - DF2040D61380CA810056300A /* module.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C01380CA810056300A /* module.cpp */; }; - DF2040D71380CA810056300A /* paula.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C21380CA810056300A /* paula.cpp */; }; - DF2040D81380CA810056300A /* protracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C41380CA810056300A /* protracker.cpp */; }; - DF2040D91380CA810056300A /* rjp1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C61380CA810056300A /* rjp1.cpp */; }; - DF2040DA1380CA810056300A /* soundfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C81380CA810056300A /* soundfx.cpp */; }; - DF2040DB1380CA810056300A /* tfmx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040CA1380CA810056300A /* tfmx.cpp */; }; - DF2040DC1380CA810056300A /* infogrames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040BC1380CA810056300A /* infogrames.cpp */; }; - DF2040DD1380CA810056300A /* maxtrax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040BE1380CA810056300A /* maxtrax.cpp */; }; - DF2040DE1380CA810056300A /* module.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C01380CA810056300A /* module.cpp */; }; - DF2040DF1380CA810056300A /* paula.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C21380CA810056300A /* paula.cpp */; }; - DF2040E01380CA810056300A /* protracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C41380CA810056300A /* protracker.cpp */; }; - DF2040E11380CA810056300A /* rjp1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C61380CA810056300A /* rjp1.cpp */; }; - DF2040E21380CA810056300A /* soundfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C81380CA810056300A /* soundfx.cpp */; }; - DF2040E31380CA810056300A /* tfmx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040CA1380CA810056300A /* tfmx.cpp */; }; - DF2040F41380CAA40056300A /* adlib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E51380CAA40056300A /* adlib.cpp */; }; - DF2040F51380CAA40056300A /* appleiigs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E61380CAA40056300A /* appleiigs.cpp */; }; - DF2040F61380CAA40056300A /* cms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E71380CAA40056300A /* cms.cpp */; }; - DF2040F71380CAA40056300A /* eas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E91380CAA40056300A /* eas.cpp */; }; - DF2040F81380CAA40056300A /* fluidsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040EB1380CAA40056300A /* fluidsynth.cpp */; }; - DF2040F91380CAA40056300A /* mt32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040EC1380CAA40056300A /* mt32.cpp */; }; - DF2040FA1380CAA40056300A /* pcspk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040ED1380CAA40056300A /* pcspk.cpp */; }; - DF2040FB1380CAA40056300A /* sid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040EF1380CAA40056300A /* sid.cpp */; }; - DF2040FC1380CAA40056300A /* wave6581.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040F11380CAA40056300A /* wave6581.cpp */; }; - DF2040FD1380CAA40056300A /* ym2612.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040F21380CAA40056300A /* ym2612.cpp */; }; - DF2040FE1380CAA40056300A /* adlib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E51380CAA40056300A /* adlib.cpp */; }; - DF2040FF1380CAA40056300A /* appleiigs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E61380CAA40056300A /* appleiigs.cpp */; }; - DF2041001380CAA40056300A /* cms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E71380CAA40056300A /* cms.cpp */; }; - DF2041011380CAA40056300A /* eas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E91380CAA40056300A /* eas.cpp */; }; - DF2041021380CAA40056300A /* fluidsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040EB1380CAA40056300A /* fluidsynth.cpp */; }; - DF2041031380CAA40056300A /* mt32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040EC1380CAA40056300A /* mt32.cpp */; }; - DF2041041380CAA40056300A /* pcspk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040ED1380CAA40056300A /* pcspk.cpp */; }; - DF2041051380CAA40056300A /* sid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040EF1380CAA40056300A /* sid.cpp */; }; - DF2041061380CAA40056300A /* wave6581.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040F11380CAA40056300A /* wave6581.cpp */; }; - DF2041071380CAA40056300A /* ym2612.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040F21380CAA40056300A /* ym2612.cpp */; }; - DF2041081380CAA40056300A /* adlib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E51380CAA40056300A /* adlib.cpp */; }; - DF2041091380CAA40056300A /* appleiigs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E61380CAA40056300A /* appleiigs.cpp */; }; - DF20410A1380CAA40056300A /* cms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E71380CAA40056300A /* cms.cpp */; }; - DF20410B1380CAA40056300A /* eas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E91380CAA40056300A /* eas.cpp */; }; - DF20410C1380CAA40056300A /* fluidsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040EB1380CAA40056300A /* fluidsynth.cpp */; }; - DF20410D1380CAA40056300A /* mt32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040EC1380CAA40056300A /* mt32.cpp */; }; - DF20410E1380CAA40056300A /* pcspk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040ED1380CAA40056300A /* pcspk.cpp */; }; - DF20410F1380CAA40056300A /* sid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040EF1380CAA40056300A /* sid.cpp */; }; - DF2041101380CAA40056300A /* wave6581.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040F11380CAA40056300A /* wave6581.cpp */; }; - DF2041111380CAA40056300A /* ym2612.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040F21380CAA40056300A /* ym2612.cpp */; }; + DF0E30411252C6090082D593 /* cms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF0E303F1252C6090082D593 /* cms.cpp */; }; + DF0E30421252C6090082D593 /* cms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF0E303F1252C6090082D593 /* cms.cpp */; }; + DF0E30431252C6090082D593 /* cms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF0E303F1252C6090082D593 /* cms.cpp */; }; DF224E040FB23BC500C8E453 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DF224E020FB23BC500C8E453 /* OpenGLES.framework */; }; DF224E050FB23BC500C8E453 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DF224E020FB23BC500C8E453 /* OpenGLES.framework */; }; DF2EC3E510E6490800765801 /* browser_osx.mm in Sources */ = {isa = PBXBuildFile; fileRef = DF2EC3E410E6490800765801 /* browser_osx.mm */; }; @@ -1264,8 +1053,15 @@ DF2EC50B10E64DB300765801 /* textconsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2EC50910E64DB300765801 /* textconsole.cpp */; }; DF2EC50C10E64DB300765801 /* textconsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2EC50910E64DB300765801 /* textconsole.cpp */; }; DF2EC50D10E64DB300765801 /* textconsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2EC50910E64DB300765801 /* textconsole.cpp */; }; + DF2EC51210E64E3100765801 /* sid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2EC51010E64E3100765801 /* sid.cpp */; }; + DF2EC51310E64E3100765801 /* sid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2EC51010E64E3100765801 /* sid.cpp */; }; + DF2EC51410E64E3100765801 /* sid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2EC51010E64E3100765801 /* sid.cpp */; }; + DF2EC51810E64EE600765801 /* wave6581.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2EC51710E64EE600765801 /* wave6581.cpp */; }; + DF2EC51910E64EE600765801 /* wave6581.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2EC51710E64EE600765801 /* wave6581.cpp */; }; + DF2EC51A10E64EE600765801 /* wave6581.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2EC51710E64EE600765801 /* wave6581.cpp */; }; DF2FFB930F485D890006E566 /* dither.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFB900F485D890006E566 /* dither.cpp */; }; DF2FFBD30F485DFB0006E566 /* debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFBD10F485DFB0006E566 /* debug.cpp */; }; + DF2FFBD90F485E360006E566 /* gui-manager.hcpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFBD50F485E360006E566 /* gui-manager.hcpp */; }; DF2FFBFC0F4860A60006E566 /* posix-saves.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFBF80F4860A60006E566 /* posix-saves.cpp */; }; DF2FFC290F4862520006E566 /* bmv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFC1F0F4862520006E566 /* bmv.cpp */; }; DF2FFC2A0F4862520006E566 /* dialogs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFC200F4862520006E566 /* dialogs.cpp */; }; @@ -1313,6 +1109,36 @@ DF2FFD2B0F48717F0006E566 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = DF2FFD290F48717F0006E566 /* Default.png */; }; DF2FFD2C0F48717F0006E566 /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = DF2FFD2A0F48717F0006E566 /* icon.png */; }; DF2FFD2D0F48719E0006E566 /* scummclassic.zip in Resources */ = {isa = PBXBuildFile; fileRef = DF2FFBDB0F485E480006E566 /* scummclassic.zip */; }; + DF45B11F116627DA009B85CC /* adpcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B0F7116627DA009B85CC /* adpcm.cpp */; }; + DF45B121116627DA009B85CC /* aiff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B0FA116627DA009B85CC /* aiff.cpp */; }; + DF45B123116627DA009B85CC /* flac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B0FD116627DA009B85CC /* flac.cpp */; }; + DF45B125116627DA009B85CC /* iff_sound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B100116627DA009B85CC /* iff_sound.cpp */; }; + DF45B127116627DA009B85CC /* mp3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B103116627DA009B85CC /* mp3.cpp */; }; + DF45B129116627DA009B85CC /* raw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B106116627DA009B85CC /* raw.cpp */; }; + DF45B12B116627DA009B85CC /* vag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B109116627DA009B85CC /* vag.cpp */; }; + DF45B12D116627DA009B85CC /* voc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B10C116627DA009B85CC /* voc.cpp */; }; + DF45B12F116627DA009B85CC /* vorbis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B10F116627DA009B85CC /* vorbis.cpp */; }; + DF45B131116627DA009B85CC /* wave.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B112116627DA009B85CC /* wave.cpp */; }; + DF45B13D116627DA009B85CC /* adpcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B0F7116627DA009B85CC /* adpcm.cpp */; }; + DF45B13F116627DA009B85CC /* aiff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B0FA116627DA009B85CC /* aiff.cpp */; }; + DF45B141116627DA009B85CC /* flac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B0FD116627DA009B85CC /* flac.cpp */; }; + DF45B143116627DA009B85CC /* iff_sound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B100116627DA009B85CC /* iff_sound.cpp */; }; + DF45B145116627DA009B85CC /* mp3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B103116627DA009B85CC /* mp3.cpp */; }; + DF45B147116627DA009B85CC /* raw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B106116627DA009B85CC /* raw.cpp */; }; + DF45B149116627DA009B85CC /* vag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B109116627DA009B85CC /* vag.cpp */; }; + DF45B14B116627DA009B85CC /* voc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B10C116627DA009B85CC /* voc.cpp */; }; + DF45B14D116627DA009B85CC /* vorbis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B10F116627DA009B85CC /* vorbis.cpp */; }; + DF45B14F116627DA009B85CC /* wave.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B112116627DA009B85CC /* wave.cpp */; }; + DF45B15B116627DA009B85CC /* adpcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B0F7116627DA009B85CC /* adpcm.cpp */; }; + DF45B15D116627DA009B85CC /* aiff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B0FA116627DA009B85CC /* aiff.cpp */; }; + DF45B15F116627DA009B85CC /* flac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B0FD116627DA009B85CC /* flac.cpp */; }; + DF45B161116627DA009B85CC /* iff_sound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B100116627DA009B85CC /* iff_sound.cpp */; }; + DF45B163116627DA009B85CC /* mp3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B103116627DA009B85CC /* mp3.cpp */; }; + DF45B165116627DA009B85CC /* raw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B106116627DA009B85CC /* raw.cpp */; }; + DF45B167116627DA009B85CC /* vag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B109116627DA009B85CC /* vag.cpp */; }; + DF45B169116627DA009B85CC /* voc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B10C116627DA009B85CC /* voc.cpp */; }; + DF45B16B116627DA009B85CC /* vorbis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B10F116627DA009B85CC /* vorbis.cpp */; }; + DF45B16D116627DA009B85CC /* wave.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B112116627DA009B85CC /* wave.cpp */; }; DF45B1CA116628A5009B85CC /* animate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B176116628A5009B85CC /* animate.cpp */; }; DF45B1CB116628A5009B85CC /* cache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B178116628A5009B85CC /* cache.cpp */; }; DF45B1CC116628A5009B85CC /* compare.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B17A116628A5009B85CC /* compare.cpp */; }; @@ -1403,137 +1229,6 @@ DF45B244116628A5009B85CC /* music.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B1C1116628A5009B85CC /* music.cpp */; }; DF45B245116628A5009B85CC /* soundcmd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B1C3116628A5009B85CC /* soundcmd.cpp */; }; DF45B246116628A5009B85CC /* seq_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B1C6116628A5009B85CC /* seq_decoder.cpp */; }; - DF46B6F31381E18900D08723 /* coroutine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6F21381E18900D08723 /* coroutine.cpp */; }; - DF46B6F41381E18900D08723 /* coroutine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6F21381E18900D08723 /* coroutine.cpp */; }; - DF46B6F51381E18900D08723 /* coroutine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6F21381E18900D08723 /* coroutine.cpp */; }; - DF46B6FF1381E1FF00D08723 /* towns_audio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6F71381E1FF00D08723 /* towns_audio.cpp */; }; - DF46B7001381E1FF00D08723 /* towns_euphony.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6F91381E1FF00D08723 /* towns_euphony.cpp */; }; - DF46B7011381E1FF00D08723 /* towns_pc98_driver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6FB1381E1FF00D08723 /* towns_pc98_driver.cpp */; }; - DF46B7021381E1FF00D08723 /* towns_pc98_fmsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6FD1381E1FF00D08723 /* towns_pc98_fmsynth.cpp */; }; - DF46B7031381E1FF00D08723 /* towns_audio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6F71381E1FF00D08723 /* towns_audio.cpp */; }; - DF46B7041381E1FF00D08723 /* towns_euphony.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6F91381E1FF00D08723 /* towns_euphony.cpp */; }; - DF46B7051381E1FF00D08723 /* towns_pc98_driver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6FB1381E1FF00D08723 /* towns_pc98_driver.cpp */; }; - DF46B7061381E1FF00D08723 /* towns_pc98_fmsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6FD1381E1FF00D08723 /* towns_pc98_fmsynth.cpp */; }; - DF46B7071381E1FF00D08723 /* towns_audio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6F71381E1FF00D08723 /* towns_audio.cpp */; }; - DF46B7081381E1FF00D08723 /* towns_euphony.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6F91381E1FF00D08723 /* towns_euphony.cpp */; }; - DF46B7091381E1FF00D08723 /* towns_pc98_driver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6FB1381E1FF00D08723 /* towns_pc98_driver.cpp */; }; - DF46B70A1381E1FF00D08723 /* towns_pc98_fmsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6FD1381E1FF00D08723 /* towns_pc98_fmsynth.cpp */; }; - DF46B7191381E27000D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B70F1381E27000D08723 /* console.cpp */; }; - DF46B71A1381E27000D08723 /* databases.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7111381E27000D08723 /* databases.cpp */; }; - DF46B71B1381E27000D08723 /* dbase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7131381E27000D08723 /* dbase.cpp */; }; - DF46B71C1381E27000D08723 /* iniconfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7151381E27000D08723 /* iniconfig.cpp */; }; - DF46B71D1381E27000D08723 /* init_v7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7171381E27000D08723 /* init_v7.cpp */; }; - DF46B71E1381E27000D08723 /* inter_inca2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7181381E27000D08723 /* inter_inca2.cpp */; }; - DF46B71F1381E27000D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B70F1381E27000D08723 /* console.cpp */; }; - DF46B7201381E27000D08723 /* databases.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7111381E27000D08723 /* databases.cpp */; }; - DF46B7211381E27000D08723 /* dbase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7131381E27000D08723 /* dbase.cpp */; }; - DF46B7221381E27000D08723 /* iniconfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7151381E27000D08723 /* iniconfig.cpp */; }; - DF46B7231381E27000D08723 /* init_v7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7171381E27000D08723 /* init_v7.cpp */; }; - DF46B7241381E27000D08723 /* inter_inca2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7181381E27000D08723 /* inter_inca2.cpp */; }; - DF46B7251381E27000D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B70F1381E27000D08723 /* console.cpp */; }; - DF46B7261381E27000D08723 /* databases.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7111381E27000D08723 /* databases.cpp */; }; - DF46B7271381E27000D08723 /* dbase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7131381E27000D08723 /* dbase.cpp */; }; - DF46B7281381E27000D08723 /* iniconfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7151381E27000D08723 /* iniconfig.cpp */; }; - DF46B7291381E27000D08723 /* init_v7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7171381E27000D08723 /* init_v7.cpp */; }; - DF46B72A1381E27000D08723 /* inter_inca2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7181381E27000D08723 /* inter_inca2.cpp */; }; - DF46B7441381E40500D08723 /* log.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7421381E40500D08723 /* log.cpp */; }; - DF46B7451381E40500D08723 /* log.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7421381E40500D08723 /* log.cpp */; }; - DF46B7461381E40500D08723 /* log.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7421381E40500D08723 /* log.cpp */; }; - DF46B7491381E40F00D08723 /* modular-backend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7471381E40F00D08723 /* modular-backend.cpp */; }; - DF46B74A1381E40F00D08723 /* modular-backend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7471381E40F00D08723 /* modular-backend.cpp */; }; - DF46B74B1381E40F00D08723 /* modular-backend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7471381E40F00D08723 /* modular-backend.cpp */; }; - DF46B7541381E46700D08723 /* player_v2base.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7511381E46700D08723 /* player_v2base.cpp */; }; - DF46B7551381E46700D08723 /* player_v2base.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7511381E46700D08723 /* player_v2base.cpp */; }; - DF46B7561381E46700D08723 /* player_v2base.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7511381E46700D08723 /* player_v2base.cpp */; }; - DF46B75E1381E4A400D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B75B1381E4A400D08723 /* console.cpp */; }; - DF46B75F1381E4A400D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B75B1381E4A400D08723 /* console.cpp */; }; - DF46B7601381E4A400D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B75B1381E4A400D08723 /* console.cpp */; }; - DF46B7631381E4D400D08723 /* robot_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7611381E4D400D08723 /* robot_decoder.cpp */; }; - DF46B7641381E4D400D08723 /* robot_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7611381E4D400D08723 /* robot_decoder.cpp */; }; - DF46B7651381E4D400D08723 /* robot_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7611381E4D400D08723 /* robot_decoder.cpp */; }; - DF46B7671381E4E400D08723 /* vm_types.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7661381E4E400D08723 /* vm_types.cpp */; }; - DF46B7681381E4E400D08723 /* vm_types.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7661381E4E400D08723 /* vm_types.cpp */; }; - DF46B7691381E4E400D08723 /* vm_types.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7661381E4E400D08723 /* vm_types.cpp */; }; - DF46B77B1381E54200D08723 /* dcl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B76F1381E54200D08723 /* dcl.cpp */; }; - DF46B77C1381E54200D08723 /* iff_container.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7721381E54200D08723 /* iff_container.cpp */; }; - DF46B77D1381E54200D08723 /* winexe_ne.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7751381E54200D08723 /* winexe_ne.cpp */; }; - DF46B77E1381E54200D08723 /* winexe_pe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7771381E54200D08723 /* winexe_pe.cpp */; }; - DF46B77F1381E54200D08723 /* winexe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7791381E54200D08723 /* winexe.cpp */; }; - DF46B7801381E54200D08723 /* dcl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B76F1381E54200D08723 /* dcl.cpp */; }; - DF46B7811381E54200D08723 /* iff_container.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7721381E54200D08723 /* iff_container.cpp */; }; - DF46B7821381E54200D08723 /* winexe_ne.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7751381E54200D08723 /* winexe_ne.cpp */; }; - DF46B7831381E54200D08723 /* winexe_pe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7771381E54200D08723 /* winexe_pe.cpp */; }; - DF46B7841381E54200D08723 /* winexe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7791381E54200D08723 /* winexe.cpp */; }; - DF46B7851381E54200D08723 /* dcl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B76F1381E54200D08723 /* dcl.cpp */; }; - DF46B7861381E54200D08723 /* iff_container.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7721381E54200D08723 /* iff_container.cpp */; }; - DF46B7871381E54200D08723 /* winexe_ne.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7751381E54200D08723 /* winexe_ne.cpp */; }; - DF46B7881381E54200D08723 /* winexe_pe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7771381E54200D08723 /* winexe_pe.cpp */; }; - DF46B7891381E54200D08723 /* winexe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7791381E54200D08723 /* winexe.cpp */; }; - DF46B7931381E58000D08723 /* png.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B78F1381E58000D08723 /* png.cpp */; }; - DF46B7941381E58000D08723 /* wincursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7911381E58000D08723 /* wincursor.cpp */; }; - DF46B7951381E58000D08723 /* png.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B78F1381E58000D08723 /* png.cpp */; }; - DF46B7961381E58000D08723 /* wincursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7911381E58000D08723 /* wincursor.cpp */; }; - DF46B7971381E58000D08723 /* png.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B78F1381E58000D08723 /* png.cpp */; }; - DF46B7981381E58000D08723 /* wincursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7911381E58000D08723 /* wincursor.cpp */; }; - DF46B79F1381E5B500D08723 /* winfont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B79D1381E5B500D08723 /* winfont.cpp */; }; - DF46B7A01381E5B500D08723 /* winfont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B79D1381E5B500D08723 /* winfont.cpp */; }; - DF46B7A11381E5B500D08723 /* winfont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B79D1381E5B500D08723 /* winfont.cpp */; }; - DF46B7A51381E5D900D08723 /* sdl-timer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7A31381E5D900D08723 /* sdl-timer.cpp */; }; - DF46B7A91381E5F100D08723 /* header.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7A81381E5F100D08723 /* header.cpp */; }; - DF46B7AA1381E5F100D08723 /* header.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7A81381E5F100D08723 /* header.cpp */; }; - DF46B7AB1381E5F100D08723 /* header.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7A81381E5F100D08723 /* header.cpp */; }; - DF46B7B41381E67800D08723 /* sdl-mutex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7B21381E67800D08723 /* sdl-mutex.cpp */; }; - DF46B7B51381E67800D08723 /* sdl-mutex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7B21381E67800D08723 /* sdl-mutex.cpp */; }; - DF46B7B61381E67800D08723 /* sdl-mutex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7B21381E67800D08723 /* sdl-mutex.cpp */; }; - DF46B7BD1381E6C000D08723 /* object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7BB1381E6C000D08723 /* object.cpp */; }; - DF46B7BE1381E6C000D08723 /* object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7BB1381E6C000D08723 /* object.cpp */; }; - DF46B7BF1381E6C000D08723 /* object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7BB1381E6C000D08723 /* object.cpp */; }; - DF46B7C81381E72500D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7C61381E72500D08723 /* console.cpp */; }; - DF46B7C91381E72500D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7C61381E72500D08723 /* console.cpp */; }; - DF46B7CA1381E72500D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7C61381E72500D08723 /* console.cpp */; }; - DF46B7CF1381E76300D08723 /* sdl-events.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7CD1381E76300D08723 /* sdl-events.cpp */; }; - DF46B7D61381E7C600D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7D41381E7C600D08723 /* console.cpp */; }; - DF46B7D71381E7C600D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7D41381E7C600D08723 /* console.cpp */; }; - DF46B7D81381E7C600D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7D41381E7C600D08723 /* console.cpp */; }; - DF46B83C1381F13500D08723 /* saveload_v7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B83B1381F13500D08723 /* saveload_v7.cpp */; }; - DF46B83D1381F13500D08723 /* saveload_v7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B83B1381F13500D08723 /* saveload_v7.cpp */; }; - DF46B83E1381F13500D08723 /* saveload_v7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B83B1381F13500D08723 /* saveload_v7.cpp */; }; - DF46B8441381F35500D08723 /* saveload_inca2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8431381F35500D08723 /* saveload_inca2.cpp */; }; - DF46B8451381F35500D08723 /* saveload_inca2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8431381F35500D08723 /* saveload_inca2.cpp */; }; - DF46B8461381F35500D08723 /* saveload_inca2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8431381F35500D08723 /* saveload_inca2.cpp */; }; - DF46B8481381F38700D08723 /* inter_v7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8471381F38700D08723 /* inter_v7.cpp */; }; - DF46B8491381F38700D08723 /* inter_v7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8471381F38700D08723 /* inter_v7.cpp */; }; - DF46B84A1381F38700D08723 /* inter_v7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8471381F38700D08723 /* inter_v7.cpp */; }; - DF46B84D1381F39E00D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B84B1381F39E00D08723 /* console.cpp */; }; - DF46B84E1381F39E00D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B84B1381F39E00D08723 /* console.cpp */; }; - DF46B84F1381F39E00D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B84B1381F39E00D08723 /* console.cpp */; }; - DF46B8521381F3B400D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8501381F3B400D08723 /* console.cpp */; }; - DF46B8531381F3B400D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8501381F3B400D08723 /* console.cpp */; }; - DF46B8541381F3B400D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8501381F3B400D08723 /* console.cpp */; }; - DF46B8601381F44E00D08723 /* dbopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B85A1381F44E00D08723 /* dbopl.cpp */; }; - DF46B8611381F44E00D08723 /* dosbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B85C1381F44E00D08723 /* dosbox.cpp */; }; - DF46B8621381F44E00D08723 /* mame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B85E1381F44E00D08723 /* mame.cpp */; }; - DF46B8631381F44E00D08723 /* dbopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B85A1381F44E00D08723 /* dbopl.cpp */; }; - DF46B8641381F44E00D08723 /* dosbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B85C1381F44E00D08723 /* dosbox.cpp */; }; - DF46B8651381F44E00D08723 /* mame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B85E1381F44E00D08723 /* mame.cpp */; }; - DF46B8661381F44E00D08723 /* dbopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B85A1381F44E00D08723 /* dbopl.cpp */; }; - DF46B8671381F44E00D08723 /* dosbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B85C1381F44E00D08723 /* dosbox.cpp */; }; - DF46B8681381F44E00D08723 /* mame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B85E1381F44E00D08723 /* mame.cpp */; }; - DF46B8711381F4A200D08723 /* sdl-audiocd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B86F1381F4A200D08723 /* sdl-audiocd.cpp */; }; - DF46B8721381F4A200D08723 /* sdl-audiocd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B86F1381F4A200D08723 /* sdl-audiocd.cpp */; }; - DF46B8731381F4A200D08723 /* sdl-audiocd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B86F1381F4A200D08723 /* sdl-audiocd.cpp */; }; - DF46B87D1381F4F200D08723 /* default-audiocd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B87B1381F4F200D08723 /* default-audiocd.cpp */; }; - DF46B87E1381F4F200D08723 /* default-audiocd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B87B1381F4F200D08723 /* default-audiocd.cpp */; }; - DF46B87F1381F4F200D08723 /* default-audiocd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B87B1381F4F200D08723 /* default-audiocd.cpp */; }; - DF46B8891381F5D800D08723 /* sdl-provider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8871381F5D800D08723 /* sdl-provider.cpp */; }; - DF46B88A1381F5D800D08723 /* sdl-provider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8871381F5D800D08723 /* sdl-provider.cpp */; }; - DF46B88B1381F5D800D08723 /* sdl-provider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8871381F5D800D08723 /* sdl-provider.cpp */; }; - DF46B8921381F62B00D08723 /* adpcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8901381F62B00D08723 /* adpcm.cpp */; }; - DF46B8931381F62B00D08723 /* adpcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8901381F62B00D08723 /* adpcm.cpp */; }; - DF46B8941381F62B00D08723 /* adpcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8901381F62B00D08723 /* adpcm.cpp */; }; - DF46B89B1381F6C400D08723 /* null.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8991381F6C400D08723 /* null.cpp */; }; - DF46B89C1381F6C400D08723 /* null.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8991381F6C400D08723 /* null.cpp */; }; - DF46B89D1381F6C400D08723 /* null.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8991381F6C400D08723 /* null.cpp */; }; DF573C080F5A81EA00961A72 /* state.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF573C010F5A81EA00961A72 /* state.cpp */; }; DF573CBB0F5A85B300961A72 /* exec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF573CBA0F5A85B300961A72 /* exec.cpp */; }; DF573CBE0F5A85E100961A72 /* timer_lol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF573CBD0F5A85E100961A72 /* timer_lol.cpp */; }; @@ -1558,10 +1253,20 @@ DF6118550FE3A8990042AD3F /* disk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118540FE3A8990042AD3F /* disk.cpp */; }; DF6118560FE3A8990042AD3F /* disk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118540FE3A8990042AD3F /* disk.cpp */; }; DF6118570FE3A8990042AD3F /* disk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118540FE3A8990042AD3F /* disk.cpp */; }; + DF6118680FE3A9410042AD3F /* dxa_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118600FE3A9410042AD3F /* dxa_decoder.cpp */; }; + DF6118690FE3A9410042AD3F /* flic_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118620FE3A9410042AD3F /* flic_decoder.cpp */; }; + DF61186A0FE3A9410042AD3F /* smk_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118640FE3A9410042AD3F /* smk_decoder.cpp */; }; + DF61186D0FE3A9410042AD3F /* dxa_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118600FE3A9410042AD3F /* dxa_decoder.cpp */; }; + DF61186E0FE3A9410042AD3F /* flic_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118620FE3A9410042AD3F /* flic_decoder.cpp */; }; + DF61186F0FE3A9410042AD3F /* smk_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118640FE3A9410042AD3F /* smk_decoder.cpp */; }; + DF6118720FE3A9410042AD3F /* dxa_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118600FE3A9410042AD3F /* dxa_decoder.cpp */; }; + DF6118730FE3A9410042AD3F /* flic_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118620FE3A9410042AD3F /* flic_decoder.cpp */; }; + DF6118740FE3A9410042AD3F /* smk_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118640FE3A9410042AD3F /* smk_decoder.cpp */; }; DF6118890FE3A9AA0042AD3F /* saveconverter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118790FE3A9AA0042AD3F /* saveconverter.cpp */; }; DF61188A0FE3A9AA0042AD3F /* saveconverter_v2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187B0FE3A9AA0042AD3F /* saveconverter_v2.cpp */; }; DF61188B0FE3A9AA0042AD3F /* saveconverter_v3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187C0FE3A9AA0042AD3F /* saveconverter_v3.cpp */; }; DF61188C0FE3A9AA0042AD3F /* saveconverter_v4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187D0FE3A9AA0042AD3F /* saveconverter_v4.cpp */; }; + DF61188D0FE3A9AA0042AD3F /* saveconverter_v6.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187E0FE3A9AA0042AD3F /* saveconverter_v6.cpp */; }; DF61188E0FE3A9AA0042AD3F /* savefile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187F0FE3A9AA0042AD3F /* savefile.cpp */; }; DF61188F0FE3A9AA0042AD3F /* savehandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118810FE3A9AA0042AD3F /* savehandler.cpp */; }; DF6118900FE3A9AA0042AD3F /* saveload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118830FE3A9AA0042AD3F /* saveload.cpp */; }; @@ -1573,6 +1278,7 @@ DF6118960FE3A9AA0042AD3F /* saveconverter_v2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187B0FE3A9AA0042AD3F /* saveconverter_v2.cpp */; }; DF6118970FE3A9AA0042AD3F /* saveconverter_v3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187C0FE3A9AA0042AD3F /* saveconverter_v3.cpp */; }; DF6118980FE3A9AA0042AD3F /* saveconverter_v4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187D0FE3A9AA0042AD3F /* saveconverter_v4.cpp */; }; + DF6118990FE3A9AA0042AD3F /* saveconverter_v6.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187E0FE3A9AA0042AD3F /* saveconverter_v6.cpp */; }; DF61189A0FE3A9AA0042AD3F /* savefile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187F0FE3A9AA0042AD3F /* savefile.cpp */; }; DF61189B0FE3A9AA0042AD3F /* savehandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118810FE3A9AA0042AD3F /* savehandler.cpp */; }; DF61189C0FE3A9AA0042AD3F /* saveload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118830FE3A9AA0042AD3F /* saveload.cpp */; }; @@ -1584,6 +1290,7 @@ DF6118A20FE3A9AA0042AD3F /* saveconverter_v2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187B0FE3A9AA0042AD3F /* saveconverter_v2.cpp */; }; DF6118A30FE3A9AA0042AD3F /* saveconverter_v3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187C0FE3A9AA0042AD3F /* saveconverter_v3.cpp */; }; DF6118A40FE3A9AA0042AD3F /* saveconverter_v4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187D0FE3A9AA0042AD3F /* saveconverter_v4.cpp */; }; + DF6118A50FE3A9AA0042AD3F /* saveconverter_v6.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187E0FE3A9AA0042AD3F /* saveconverter_v6.cpp */; }; DF6118A60FE3A9AA0042AD3F /* savefile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187F0FE3A9AA0042AD3F /* savefile.cpp */; }; DF6118A70FE3A9AA0042AD3F /* savehandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118810FE3A9AA0042AD3F /* savehandler.cpp */; }; DF6118A80FE3A9AA0042AD3F /* saveload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118830FE3A9AA0042AD3F /* saveload.cpp */; }; @@ -1610,6 +1317,9 @@ DF6118C80FE3AABD0042AD3F /* player_v2cms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118C60FE3AABD0042AD3F /* player_v2cms.cpp */; }; DF6118C90FE3AABD0042AD3F /* player_v2cms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118C60FE3AABD0042AD3F /* player_v2cms.cpp */; }; DF6118CC0FE3AAFD0042AD3F /* hardwarekeys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118CB0FE3AAFD0042AD3F /* hardwarekeys.cpp */; }; + DF6118D10FE3AB560042AD3F /* mame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118CF0FE3AB560042AD3F /* mame.cpp */; }; + DF6118D20FE3AB560042AD3F /* mame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118CF0FE3AB560042AD3F /* mame.cpp */; }; + DF6118D30FE3AB560042AD3F /* mame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118CF0FE3AB560042AD3F /* mame.cpp */; }; DF6BF4C410529DA50069811F /* conversion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF4C010529DA50069811F /* conversion.cpp */; }; DF6BF4C510529DA50069811F /* jpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF4C210529DA50069811F /* jpeg.cpp */; }; DF6BF4C610529DA50069811F /* conversion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF4C010529DA50069811F /* conversion.cpp */; }; @@ -1643,6 +1353,12 @@ DF6BF4FF10529F140069811F /* EventRecorder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF4F810529F140069811F /* EventRecorder.cpp */; }; DF6BF50010529F140069811F /* EventDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF4F710529F140069811F /* EventDispatcher.cpp */; }; DF6BF50110529F140069811F /* EventRecorder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF4F810529F140069811F /* EventRecorder.cpp */; }; + DF6BF50610529F540069811F /* maxtrax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF50210529F540069811F /* maxtrax.cpp */; }; + DF6BF50710529F540069811F /* tfmx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF50410529F540069811F /* tfmx.cpp */; }; + DF6BF50810529F540069811F /* maxtrax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF50210529F540069811F /* maxtrax.cpp */; }; + DF6BF50910529F540069811F /* tfmx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF50410529F540069811F /* tfmx.cpp */; }; + DF6BF50A10529F540069811F /* maxtrax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF50210529F540069811F /* maxtrax.cpp */; }; + DF6BF50B10529F540069811F /* tfmx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF50410529F540069811F /* tfmx.cpp */; }; DF7585CE100CB66E00CC3324 /* expression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7585C3100CB66E00CC3324 /* expression.cpp */; }; DF7585CF100CB66E00CC3324 /* hotspots.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7585C5100CB66E00CC3324 /* hotspots.cpp */; }; DF7585D0100CB66E00CC3324 /* init_v6.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7585C7100CB66E00CC3324 /* init_v6.cpp */; }; @@ -1719,6 +1435,9 @@ DF7F289311FF247300159131 /* translation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7F289111FF247300159131 /* translation.cpp */; }; DF7F289511FF247300159131 /* translation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7F289111FF247300159131 /* translation.cpp */; }; DF7F289711FF247300159131 /* translation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7F289111FF247300159131 /* translation.cpp */; }; + DF7F28A011FF24B000159131 /* mac_snd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7F289E11FF24B000159131 /* mac_snd.cpp */; }; + DF7F28A111FF24B000159131 /* mac_snd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7F289E11FF24B000159131 /* mac_snd.cpp */; }; + DF7F28A211FF24B000159131 /* mac_snd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7F289E11FF24B000159131 /* mac_snd.cpp */; }; DF7F28A511FF24C400159131 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7F28A311FF24C400159131 /* console.cpp */; }; DF7F28A611FF24C400159131 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7F28A311FF24C400159131 /* console.cpp */; }; DF7F28A711FF24C400159131 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7F28A311FF24C400159131 /* console.cpp */; }; @@ -2348,9 +2067,28 @@ DF842A470E7BBBB400F5680E /* archive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A400E7BBBB400F5680E /* archive.cpp */; }; DF842A490E7BBBB400F5680E /* unarj.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A450E7BBBB400F5680E /* unarj.cpp */; }; DF842A6D0E7BBD5700F5680E /* stdiostream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A6B0E7BBD5700F5680E /* stdiostream.cpp */; }; + DF842A710E7BBDB200F5680E /* musicplugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A6F0E7BBDB200F5680E /* musicplugin.cpp */; }; + DF895BFE124C24350077F6E8 /* coktel_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895BFC124C24350077F6E8 /* coktel_decoder.cpp */; }; + DF895BFF124C24350077F6E8 /* coktel_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895BFC124C24350077F6E8 /* coktel_decoder.cpp */; }; + DF895C00124C24350077F6E8 /* coktel_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895BFC124C24350077F6E8 /* coktel_decoder.cpp */; }; DF895C03124C24680077F6E8 /* player_towns.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C01124C24680077F6E8 /* player_towns.cpp */; }; DF895C04124C24680077F6E8 /* player_towns.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C01124C24680077F6E8 /* player_towns.cpp */; }; DF895C05124C24680077F6E8 /* player_towns.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C01124C24680077F6E8 /* player_towns.cpp */; }; + DF895C09124C24B60077F6E8 /* appleiigs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C08124C24B50077F6E8 /* appleiigs.cpp */; }; + DF895C0A124C24B60077F6E8 /* appleiigs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C08124C24B50077F6E8 /* appleiigs.cpp */; }; + DF895C0B124C24B60077F6E8 /* appleiigs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C08124C24B50077F6E8 /* appleiigs.cpp */; }; + DF895C15124C24C10077F6E8 /* towns_audio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C0D124C24C00077F6E8 /* towns_audio.cpp */; }; + DF895C16124C24C10077F6E8 /* towns_euphony.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C0F124C24C00077F6E8 /* towns_euphony.cpp */; }; + DF895C17124C24C10077F6E8 /* towns_pc98_driver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C11124C24C00077F6E8 /* towns_pc98_driver.cpp */; }; + DF895C18124C24C10077F6E8 /* towns_pc98_fmsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C13124C24C00077F6E8 /* towns_pc98_fmsynth.cpp */; }; + DF895C19124C24C10077F6E8 /* towns_audio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C0D124C24C00077F6E8 /* towns_audio.cpp */; }; + DF895C1A124C24C10077F6E8 /* towns_euphony.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C0F124C24C00077F6E8 /* towns_euphony.cpp */; }; + DF895C1B124C24C10077F6E8 /* towns_pc98_driver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C11124C24C00077F6E8 /* towns_pc98_driver.cpp */; }; + DF895C1C124C24C10077F6E8 /* towns_pc98_fmsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C13124C24C00077F6E8 /* towns_pc98_fmsynth.cpp */; }; + DF895C1D124C24C10077F6E8 /* towns_audio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C0D124C24C00077F6E8 /* towns_audio.cpp */; }; + DF895C1E124C24C10077F6E8 /* towns_euphony.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C0F124C24C00077F6E8 /* towns_euphony.cpp */; }; + DF895C1F124C24C10077F6E8 /* towns_pc98_driver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C11124C24C00077F6E8 /* towns_pc98_driver.cpp */; }; + DF895C20124C24C10077F6E8 /* towns_pc98_fmsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C13124C24C00077F6E8 /* towns_pc98_fmsynth.cpp */; }; DF895C25124C25150077F6E8 /* init_fascin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C24124C25150077F6E8 /* init_fascin.cpp */; }; DF895C26124C25150077F6E8 /* init_fascin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C24124C25150077F6E8 /* init_fascin.cpp */; }; DF895C27124C25150077F6E8 /* init_fascin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C24124C25150077F6E8 /* init_fascin.cpp */; }; @@ -2363,8 +2101,27 @@ DF895C41124C271F0077F6E8 /* icon4.png in Resources */ = {isa = PBXBuildFile; fileRef = DF895C40124C271F0077F6E8 /* icon4.png */; }; DF895C42124C271F0077F6E8 /* icon4.png in Resources */ = {isa = PBXBuildFile; fileRef = DF895C40124C271F0077F6E8 /* icon4.png */; }; DF895C43124C271F0077F6E8 /* icon4.png in Resources */ = {isa = PBXBuildFile; fileRef = DF895C40124C271F0077F6E8 /* icon4.png */; }; + DF895CB8124E58980077F6E8 /* indeo3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CAB124E58980077F6E8 /* indeo3.cpp */; }; + DF895CB9124E58980077F6E8 /* mjpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CAD124E58980077F6E8 /* mjpeg.cpp */; }; + DF895CBA124E58980077F6E8 /* qdm2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CAF124E58980077F6E8 /* qdm2.cpp */; }; + DF895CBB124E58980077F6E8 /* qtrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CB2124E58980077F6E8 /* qtrle.cpp */; }; + DF895CBC124E58980077F6E8 /* rpza.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CB4124E58980077F6E8 /* rpza.cpp */; }; + DF895CBD124E58990077F6E8 /* smc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CB6124E58980077F6E8 /* smc.cpp */; }; + DF895CBE124E58990077F6E8 /* indeo3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CAB124E58980077F6E8 /* indeo3.cpp */; }; + DF895CBF124E58990077F6E8 /* mjpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CAD124E58980077F6E8 /* mjpeg.cpp */; }; + DF895CC0124E58990077F6E8 /* qdm2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CAF124E58980077F6E8 /* qdm2.cpp */; }; + DF895CC1124E58990077F6E8 /* qtrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CB2124E58980077F6E8 /* qtrle.cpp */; }; + DF895CC2124E58990077F6E8 /* rpza.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CB4124E58980077F6E8 /* rpza.cpp */; }; + DF895CC3124E58990077F6E8 /* smc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CB6124E58980077F6E8 /* smc.cpp */; }; + DF895CC4124E58990077F6E8 /* indeo3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CAB124E58980077F6E8 /* indeo3.cpp */; }; + DF895CC5124E58990077F6E8 /* mjpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CAD124E58980077F6E8 /* mjpeg.cpp */; }; + DF895CC6124E58990077F6E8 /* qdm2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CAF124E58980077F6E8 /* qdm2.cpp */; }; + DF895CC7124E58990077F6E8 /* qtrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CB2124E58980077F6E8 /* qtrle.cpp */; }; + DF895CC8124E58990077F6E8 /* rpza.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CB4124E58980077F6E8 /* rpza.cpp */; }; + DF895CC9124E58990077F6E8 /* smc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CB6124E58980077F6E8 /* smc.cpp */; }; DF89C2880F62D55C00D756B6 /* sprites_lol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF89C2870F62D55C00D756B6 /* sprites_lol.cpp */; }; DF89C2A40F62D79E00D756B6 /* script.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF89C2A30F62D79E00D756B6 /* script.cpp */; }; + DF89C2BB0F62D91000D756B6 /* timestamp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF89C2B80F62D91000D756B6 /* timestamp.cpp */; }; DF90E9BF10AEDA9B00C8F93F /* selector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90E9BD10AEDA9B00C8F93F /* selector.cpp */; }; DF90E9C110AEDA9B00C8F93F /* selector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90E9BD10AEDA9B00C8F93F /* selector.cpp */; }; DF90E9C310AEDA9B00C8F93F /* selector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90E9BD10AEDA9B00C8F93F /* selector.cpp */; }; @@ -2374,6 +2131,12 @@ DF90EAAD10B0236F00C8F93F /* staticres.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90EAAB10B0236F00C8F93F /* staticres.cpp */; }; DF90EAAE10B0236F00C8F93F /* staticres.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90EAAB10B0236F00C8F93F /* staticres.cpp */; }; DF90EAAF10B0236F00C8F93F /* staticres.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90EAAB10B0236F00C8F93F /* staticres.cpp */; }; + DF90EAB810B023D100C8F93F /* avi_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90EAB610B023D100C8F93F /* avi_decoder.cpp */; }; + DF90EAB910B023D100C8F93F /* avi_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90EAB610B023D100C8F93F /* avi_decoder.cpp */; }; + DF90EABA10B023D100C8F93F /* avi_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90EAB610B023D100C8F93F /* avi_decoder.cpp */; }; + DF90EAC310B023F400C8F93F /* msvideo1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90EAC110B023F400C8F93F /* msvideo1.cpp */; }; + DF90EAC410B023F400C8F93F /* msvideo1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90EAC110B023F400C8F93F /* msvideo1.cpp */; }; + DF90EAC510B023F400C8F93F /* msvideo1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90EAC110B023F400C8F93F /* msvideo1.cpp */; }; DF9B9248118E46730069C19D /* error.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF9B9246118E46730069C19D /* error.cpp */; }; DF9B9249118E46730069C19D /* error.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF9B9246118E46730069C19D /* error.cpp */; }; DF9B924A118E46730069C19D /* error.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF9B9246118E46730069C19D /* error.cpp */; }; @@ -2388,13 +2151,12 @@ DFAAAFFC0F0112DF003E9390 /* detection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFAAAFFB0F0112DF003E9390 /* detection.cpp */; }; DFAAB0020F011392003E9390 /* thumbnail_intern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFAAB0010F011392003E9390 /* thumbnail_intern.cpp */; }; DFAAD23D0F50120E00C3A4E2 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFAAD2390F50120E00C3A4E2 /* console.cpp */; }; - DFADEBB313820DF500C46364 /* maccursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFADEBB113820DF500C46364 /* maccursor.cpp */; }; - DFADEBB413820DF500C46364 /* maccursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFADEBB113820DF500C46364 /* maccursor.cpp */; }; - DFADEBB513820DF500C46364 /* maccursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFADEBB113820DF500C46364 /* maccursor.cpp */; }; - DFADEBB713820E0C00C46364 /* posix-fs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFADEBB613820E0C00C46364 /* posix-fs.cpp */; }; - DFADEBB813820E0C00C46364 /* posix-fs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFADEBB613820E0C00C46364 /* posix-fs.cpp */; }; - DFADEBB913820E0C00C46364 /* posix-fs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFADEBB613820E0C00C46364 /* posix-fs.cpp */; }; - DFADEC071382140300C46364 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = DFADEC061382140300C46364 /* libz.dylib */; }; + DFB0576911B753AF0015AE65 /* qt_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0576411B753AF0015AE65 /* qt_decoder.cpp */; }; + DFB0576A11B753AF0015AE65 /* video_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0576611B753AF0015AE65 /* video_decoder.cpp */; }; + DFB0576C11B753AF0015AE65 /* qt_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0576411B753AF0015AE65 /* qt_decoder.cpp */; }; + DFB0576D11B753AF0015AE65 /* video_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0576611B753AF0015AE65 /* video_decoder.cpp */; }; + DFB0576F11B753AF0015AE65 /* qt_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0576411B753AF0015AE65 /* qt_decoder.cpp */; }; + DFB0577011B753AF0015AE65 /* video_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0576611B753AF0015AE65 /* video_decoder.cpp */; }; DFB0577611B753DA0015AE65 /* rational.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0577411B753DA0015AE65 /* rational.cpp */; }; DFB0577711B753DA0015AE65 /* rational.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0577411B753DA0015AE65 /* rational.cpp */; }; DFB0577811B753DA0015AE65 /* rational.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0577411B753DA0015AE65 /* rational.cpp */; }; @@ -2410,6 +2172,9 @@ DFB0579111B7547D0015AE65 /* pict.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0578F11B7547D0015AE65 /* pict.cpp */; }; DFB0579211B7547D0015AE65 /* pict.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0578F11B7547D0015AE65 /* pict.cpp */; }; DFB0579311B7547D0015AE65 /* pict.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0578F11B7547D0015AE65 /* pict.cpp */; }; + DFB0579811B7549C0015AE65 /* cinepak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0579611B7549C0015AE65 /* cinepak.cpp */; }; + DFB0579911B7549C0015AE65 /* cinepak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0579611B7549C0015AE65 /* cinepak.cpp */; }; + DFB0579A11B7549C0015AE65 /* cinepak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0579611B7549C0015AE65 /* cinepak.cpp */; }; DFC831210F48AF19005EF03C /* detection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFC8301A0F48AF18005EF03C /* detection.cpp */; }; DFC831240F48AF19005EF03C /* gc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFC8301E0F48AF18005EF03C /* gc.cpp */; }; DFC831270F48AF19005EF03C /* kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFC830230F48AF18005EF03C /* kernel.cpp */; }; @@ -2439,6 +2204,9 @@ DFCDC6F711662AAB00A7D2A0 /* resource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFCDC6F611662AAB00A7D2A0 /* resource.cpp */; }; DFCDC6F811662AAB00A7D2A0 /* resource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFCDC6F611662AAB00A7D2A0 /* resource.cpp */; }; DFCDC6F911662AAB00A7D2A0 /* resource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFCDC6F611662AAB00A7D2A0 /* resource.cpp */; }; + DFCDC6FE11662AD700A7D2A0 /* msrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFCDC6FC11662AD700A7D2A0 /* msrle.cpp */; }; + DFCDC6FF11662AD700A7D2A0 /* msrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFCDC6FC11662AD700A7D2A0 /* msrle.cpp */; }; + DFCDC70011662AD700A7D2A0 /* msrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFCDC6FC11662AD700A7D2A0 /* msrle.cpp */; }; DFCDC70411662B0200A7D2A0 /* saveload_fascin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFCDC70311662B0200A7D2A0 /* saveload_fascin.cpp */; }; DFCDC70511662B0200A7D2A0 /* saveload_fascin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFCDC70311662B0200A7D2A0 /* saveload_fascin.cpp */; }; DFCDC70611662B0200A7D2A0 /* saveload_fascin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFCDC70311662B0200A7D2A0 /* saveload_fascin.cpp */; }; @@ -2497,14 +2265,41 @@ DFE47C200D81F4E900B6D1FB /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477910D81F4E900B6D1FB /* console.cpp */; }; DFE47C210D81F4E900B6D1FB /* debugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477940D81F4E900B6D1FB /* debugger.cpp */; }; DFE47C220D81F4E900B6D1FB /* dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477960D81F4E900B6D1FB /* dialog.cpp */; }; + DFE47C230D81F4E900B6D1FB /* editable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477980D81F4E900B6D1FB /* editable.cpp */; }; + DFE47C240D81F4E900B6D1FB /* EditTextWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4779A0D81F4E900B6D1FB /* EditTextWidget.cpp */; }; DFE47C260D81F4E900B6D1FB /* Key.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4779E0D81F4E900B6D1FB /* Key.cpp */; }; DFE47C280D81F4E900B6D1FB /* launcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A20D81F4E900B6D1FB /* launcher.cpp */; }; + DFE47C290D81F4E900B6D1FB /* ListWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A40D81F4E900B6D1FB /* ListWidget.cpp */; }; DFE47C2A0D81F4E900B6D1FB /* massadd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A60D81F4E900B6D1FB /* massadd.cpp */; }; DFE47C2B0D81F4E900B6D1FB /* message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A80D81F4E900B6D1FB /* message.cpp */; }; DFE47C2E0D81F4E900B6D1FB /* object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477AD0D81F4E900B6D1FB /* object.cpp */; }; DFE47C2F0D81F4E900B6D1FB /* options.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477AF0D81F4E900B6D1FB /* options.cpp */; }; + DFE47C300D81F4E900B6D1FB /* PopUpWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477B10D81F4E900B6D1FB /* PopUpWidget.cpp */; }; + DFE47C310D81F4E900B6D1FB /* ScrollBarWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477B30D81F4E900B6D1FB /* ScrollBarWidget.cpp */; }; + DFE47C320D81F4E900B6D1FB /* TabWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477B50D81F4E900B6D1FB /* TabWidget.cpp */; }; DFE47C350D81F4E900B6D1FB /* themebrowser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477BA0D81F4E900B6D1FB /* themebrowser.cpp */; }; DFE47C3B0D81F4E900B6D1FB /* widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477C40D81F4E900B6D1FB /* widget.cpp */; }; + DFE47C3E0D81F4E900B6D1FB /* audiocd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477CB0D81F4E900B6D1FB /* audiocd.cpp */; }; + DFE47C3F0D81F4E900B6D1FB /* audiostream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477CD0D81F4E900B6D1FB /* audiostream.cpp */; }; + DFE47C410D81F4E900B6D1FB /* fmopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D10D81F4E900B6D1FB /* fmopl.cpp */; }; + DFE47C430D81F4E900B6D1FB /* mididrv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D50D81F4E900B6D1FB /* mididrv.cpp */; }; + DFE47C440D81F4E900B6D1FB /* midiparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D70D81F4E900B6D1FB /* midiparser.cpp */; }; + DFE47C450D81F4E900B6D1FB /* midiparser_smf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D90D81F4E900B6D1FB /* midiparser_smf.cpp */; }; + DFE47C460D81F4E900B6D1FB /* midiparser_xmidi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477DA0D81F4E900B6D1FB /* midiparser_xmidi.cpp */; }; + DFE47C470D81F4E900B6D1FB /* mixer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477DB0D81F4E900B6D1FB /* mixer.cpp */; }; + DFE47C480D81F4E900B6D1FB /* infogrames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477DE0D81F4E900B6D1FB /* infogrames.cpp */; }; + DFE47C490D81F4E900B6D1FB /* module.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E00D81F4E900B6D1FB /* module.cpp */; }; + DFE47C4A0D81F4E900B6D1FB /* paula.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E20D81F4E900B6D1FB /* paula.cpp */; }; + DFE47C4B0D81F4E900B6D1FB /* protracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E40D81F4E900B6D1FB /* protracker.cpp */; }; + DFE47C4C0D81F4E900B6D1FB /* rjp1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E60D81F4E900B6D1FB /* rjp1.cpp */; }; + DFE47C4D0D81F4E900B6D1FB /* soundfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E80D81F4E900B6D1FB /* soundfx.cpp */; }; + DFE47C500D81F4E900B6D1FB /* mpu401.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477ED0D81F4E900B6D1FB /* mpu401.cpp */; }; + DFE47C510D81F4E900B6D1FB /* null.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477EF0D81F4E900B6D1FB /* null.cpp */; }; + DFE47C520D81F4E900B6D1FB /* rate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477F00D81F4E900B6D1FB /* rate.cpp */; }; + DFE47C570D81F4E900B6D1FB /* adlib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477F70D81F4E900B6D1FB /* adlib.cpp */; }; + DFE47C580D81F4E900B6D1FB /* fluidsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477F90D81F4E900B6D1FB /* fluidsynth.cpp */; }; + DFE47C740D81F4E900B6D1FB /* pcspk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE478210D81F4E900B6D1FB /* pcspk.cpp */; }; + DFE47C750D81F4E900B6D1FB /* ym2612.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE478230D81F4E900B6D1FB /* ym2612.cpp */; }; DFE47C870D81F86900B6D1FB /* kyra.dat in Resources */ = {isa = PBXBuildFile; fileRef = DFE47C810D81F86900B6D1FB /* kyra.dat */; }; DFE47C880D81F86900B6D1FB /* lure.dat in Resources */ = {isa = PBXBuildFile; fileRef = DFE47C820D81F86900B6D1FB /* lure.dat */; }; DFE47C890D81F86900B6D1FB /* queen.tbl in Resources */ = {isa = PBXBuildFile; fileRef = DFE47C830D81F86900B6D1FB /* queen.tbl */; }; @@ -2520,6 +2315,11 @@ DFEC5D361166C67300C90552 /* savestate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFEC5D341166C67300C90552 /* savestate.cpp */; }; DFEC5D371166C67300C90552 /* savestate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFEC5D341166C67300C90552 /* savestate.cpp */; }; DFEC5D381166C67300C90552 /* savestate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFEC5D341166C67300C90552 /* savestate.cpp */; }; + DFEC5D3F1166C6B400C90552 /* dbopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFEC5D3D1166C6B400C90552 /* dbopl.cpp */; }; + DFEC5D401166C6B400C90552 /* dbopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFEC5D3D1166C6B400C90552 /* dbopl.cpp */; }; + DFEC5D411166C6B400C90552 /* dbopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFEC5D3D1166C6B400C90552 /* dbopl.cpp */; }; + DFF958AF0FB222F300A3EC78 /* dosbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFF958A90FB222F300A3EC78 /* dosbox.cpp */; }; + DFF958B20FB222F300A3EC78 /* dosbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFF958A90FB222F300A3EC78 /* dosbox.cpp */; }; DFF959050FB22D3000A3EC78 /* libmad.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DFD6476C0F49F7EF008E18EF /* libmad.a */; }; DFF959060FB22D3100A3EC78 /* libFLAC.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DFD6476B0F49F7EF008E18EF /* libFLAC.a */; }; DFF959080FB22D3300A3EC78 /* libvorbisidec.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DFD6476F0F49F7EF008E18EF /* libvorbisidec.a */; }; @@ -2572,14 +2372,41 @@ DFF9593E0FB22D5700A3EC78 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477910D81F4E900B6D1FB /* console.cpp */; }; DFF9593F0FB22D5700A3EC78 /* debugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477940D81F4E900B6D1FB /* debugger.cpp */; }; DFF959400FB22D5700A3EC78 /* dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477960D81F4E900B6D1FB /* dialog.cpp */; }; + DFF959410FB22D5700A3EC78 /* editable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477980D81F4E900B6D1FB /* editable.cpp */; }; + DFF959420FB22D5700A3EC78 /* EditTextWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4779A0D81F4E900B6D1FB /* EditTextWidget.cpp */; }; DFF959430FB22D5700A3EC78 /* Key.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4779E0D81F4E900B6D1FB /* Key.cpp */; }; DFF959440FB22D5700A3EC78 /* launcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A20D81F4E900B6D1FB /* launcher.cpp */; }; + DFF959450FB22D5700A3EC78 /* ListWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A40D81F4E900B6D1FB /* ListWidget.cpp */; }; DFF959460FB22D5700A3EC78 /* massadd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A60D81F4E900B6D1FB /* massadd.cpp */; }; DFF959470FB22D5700A3EC78 /* message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A80D81F4E900B6D1FB /* message.cpp */; }; DFF959480FB22D5700A3EC78 /* object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477AD0D81F4E900B6D1FB /* object.cpp */; }; DFF959490FB22D5700A3EC78 /* options.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477AF0D81F4E900B6D1FB /* options.cpp */; }; + DFF9594A0FB22D5700A3EC78 /* PopUpWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477B10D81F4E900B6D1FB /* PopUpWidget.cpp */; }; + DFF9594B0FB22D5700A3EC78 /* ScrollBarWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477B30D81F4E900B6D1FB /* ScrollBarWidget.cpp */; }; + DFF9594C0FB22D5700A3EC78 /* TabWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477B50D81F4E900B6D1FB /* TabWidget.cpp */; }; DFF9594D0FB22D5700A3EC78 /* themebrowser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477BA0D81F4E900B6D1FB /* themebrowser.cpp */; }; DFF9594E0FB22D5700A3EC78 /* widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477C40D81F4E900B6D1FB /* widget.cpp */; }; + DFF959510FB22D5700A3EC78 /* audiocd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477CB0D81F4E900B6D1FB /* audiocd.cpp */; }; + DFF959520FB22D5700A3EC78 /* audiostream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477CD0D81F4E900B6D1FB /* audiostream.cpp */; }; + DFF959540FB22D5700A3EC78 /* fmopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D10D81F4E900B6D1FB /* fmopl.cpp */; }; + DFF959560FB22D5700A3EC78 /* mididrv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D50D81F4E900B6D1FB /* mididrv.cpp */; }; + DFF959570FB22D5700A3EC78 /* midiparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D70D81F4E900B6D1FB /* midiparser.cpp */; }; + DFF959580FB22D5700A3EC78 /* midiparser_smf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D90D81F4E900B6D1FB /* midiparser_smf.cpp */; }; + DFF959590FB22D5700A3EC78 /* midiparser_xmidi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477DA0D81F4E900B6D1FB /* midiparser_xmidi.cpp */; }; + DFF9595A0FB22D5700A3EC78 /* mixer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477DB0D81F4E900B6D1FB /* mixer.cpp */; }; + DFF9595B0FB22D5700A3EC78 /* infogrames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477DE0D81F4E900B6D1FB /* infogrames.cpp */; }; + DFF9595C0FB22D5700A3EC78 /* module.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E00D81F4E900B6D1FB /* module.cpp */; }; + DFF9595D0FB22D5700A3EC78 /* paula.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E20D81F4E900B6D1FB /* paula.cpp */; }; + DFF9595E0FB22D5700A3EC78 /* protracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E40D81F4E900B6D1FB /* protracker.cpp */; }; + DFF9595F0FB22D5700A3EC78 /* rjp1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E60D81F4E900B6D1FB /* rjp1.cpp */; }; + DFF959600FB22D5700A3EC78 /* soundfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E80D81F4E900B6D1FB /* soundfx.cpp */; }; + DFF959620FB22D5700A3EC78 /* mpu401.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477ED0D81F4E900B6D1FB /* mpu401.cpp */; }; + DFF959630FB22D5700A3EC78 /* null.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477EF0D81F4E900B6D1FB /* null.cpp */; }; + DFF959640FB22D5700A3EC78 /* rate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477F00D81F4E900B6D1FB /* rate.cpp */; }; + DFF959650FB22D5700A3EC78 /* adlib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477F70D81F4E900B6D1FB /* adlib.cpp */; }; + DFF959660FB22D5700A3EC78 /* fluidsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477F90D81F4E900B6D1FB /* fluidsynth.cpp */; }; + DFF959670FB22D5700A3EC78 /* pcspk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE478210D81F4E900B6D1FB /* pcspk.cpp */; }; + DFF959680FB22D5700A3EC78 /* ym2612.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE478230D81F4E900B6D1FB /* ym2612.cpp */; }; DFF9596C0FB22D5700A3EC78 /* memorypool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD511460DF3383500854012 /* memorypool.cpp */; }; DFF9596D0FB22D5700A3EC78 /* seq.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD517E10DF33CAC00854012 /* seq.cpp */; }; DFF9596E0FB22D5700A3EC78 /* scaler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD5183B0DF3411800854012 /* scaler.cpp */; }; @@ -3210,6 +3037,7 @@ DFF95C0F0FB22D5700A3EC78 /* archive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A400E7BBBB400F5680E /* archive.cpp */; }; DFF95C100FB22D5700A3EC78 /* unarj.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A450E7BBBB400F5680E /* unarj.cpp */; }; DFF95C110FB22D5700A3EC78 /* stdiostream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A6B0E7BBD5700F5680E /* stdiostream.cpp */; }; + DFF95C120FB22D5700A3EC78 /* musicplugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A6F0E7BBDB200F5680E /* musicplugin.cpp */; }; DFF95C130FB22D5700A3EC78 /* saveload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7E8BF00ED5FC77001CB19F /* saveload.cpp */; }; DFF95C140FB22D5700A3EC78 /* ThemeEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7E8BF40ED5FC77001CB19F /* ThemeEngine.cpp */; }; DFF95C150FB22D5700A3EC78 /* ThemeEval.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7E8BF60ED5FC77001CB19F /* ThemeEval.cpp */; }; @@ -3226,6 +3054,7 @@ DFF95C200FB22D5700A3EC78 /* thumbnail_intern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFAAB0010F011392003E9390 /* thumbnail_intern.cpp */; }; DFF95C210FB22D5700A3EC78 /* dither.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFB900F485D890006E566 /* dither.cpp */; }; DFF95C270FB22D5700A3EC78 /* debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFBD10F485DFB0006E566 /* debug.cpp */; }; + DFF95C280FB22D5700A3EC78 /* gui-manager.hcpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFBD50F485E360006E566 /* gui-manager.hcpp */; }; DFF95C290FB22D5700A3EC78 /* posix-saves.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFBF80F4860A60006E566 /* posix-saves.cpp */; }; DFF95C2A0FB22D5700A3EC78 /* bmv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFC1F0F4862520006E566 /* bmv.cpp */; }; DFF95C2B0FB22D5700A3EC78 /* dialogs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFC200F4862520006E566 /* dialogs.cpp */; }; @@ -3297,6 +3126,7 @@ DFF95C920FB22D5700A3EC78 /* timer_lol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF573CBD0F5A85E100961A72 /* timer_lol.cpp */; }; DFF95C940FB22D5700A3EC78 /* sprites_lol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF89C2870F62D55C00D756B6 /* sprites_lol.cpp */; }; DFF95C950FB22D5700A3EC78 /* script.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF89C2A30F62D79E00D756B6 /* script.cpp */; }; + DFF95C980FB22D5700A3EC78 /* timestamp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF89C2B80F62D91000D756B6 /* timestamp.cpp */; }; DFF95C990FB22D5700A3EC78 /* pn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF093E5C0F63CAD4002D821E /* pn.cpp */; }; DFF95C9A0FB22D5700A3EC78 /* script_pn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF093E5D0F63CAD4002D821E /* script_pn.cpp */; }; DFF95C9B0FB22D5700A3EC78 /* vga_pn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF093E5E0F63CAD4002D821E /* vga_pn.cpp */; }; @@ -3311,13 +3141,13 @@ DFF95CB30FB22D5700A3EC78 /* inter_fascin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF09CC0F0FAC4E1900A5AFD7 /* inter_fascin.cpp */; }; DFF95CB40FB22D5700A3EC78 /* script_v3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF09CC260FAC4EAB00A5AFD7 /* script_v3.cpp */; }; DFF95CB50FB22D5700A3EC78 /* script_v4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF09CC270FAC4EAB00A5AFD7 /* script_v4.cpp */; }; + DFF95CB70FB22D5700A3EC78 /* dosbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFF958A90FB222F300A3EC78 /* dosbox.cpp */; }; DFF95CBC0FB22D5700A3EC78 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DF842A160E7BB34E00F5680E /* CoreAudio.framework */; }; DFF95CBD0FB22D5700A3EC78 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DF842A170E7BB34E00F5680E /* CoreFoundation.framework */; }; DFF95CBE0FB22D5700A3EC78 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DF842A180E7BB34E00F5680E /* Foundation.framework */; }; DFF95CBF0FB22D5700A3EC78 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DF842A190E7BB34E00F5680E /* UIKit.framework */; }; DFF95CC00FB22D5700A3EC78 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DF842A270E7BB37500F5680E /* AudioToolbox.framework */; }; DFF95CC10FB22D5700A3EC78 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DF842A2E0E7BB39E00F5680E /* QuartzCore.framework */; }; - DFF95CCF0FB22D8500A3EC78 /* libmpeg2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DFD6476D0F49F7EF008E18EF /* libmpeg2.a */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -3369,9 +3199,12 @@ 8CD1ECC6126202AA00FA198C /* detection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = detection.cpp; sourceTree = "<group>"; }; 8CD1ECC7126202AA00FA198C /* display.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = display.cpp; sourceTree = "<group>"; }; 8CD1ECC8126202AA00FA198C /* display.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = display.h; sourceTree = "<group>"; }; + 8CD1ECC9126202AA00FA198C /* engine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = engine.cpp; sourceTree = "<group>"; }; + 8CD1ECCA126202AA00FA198C /* engine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = engine.h; sourceTree = "<group>"; }; 8CD1ECCB126202AA00FA198C /* file.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = file.cpp; sourceTree = "<group>"; }; 8CD1ECCC126202AA00FA198C /* file.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = file.h; sourceTree = "<group>"; }; 8CD1ECCD126202AA00FA198C /* game.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = game.h; sourceTree = "<group>"; }; + 8CD1ECCE126202AA00FA198C /* global.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = global.h; sourceTree = "<group>"; }; 8CD1ECCF126202AA00FA198C /* hugo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hugo.cpp; sourceTree = "<group>"; }; 8CD1ECD0126202AA00FA198C /* hugo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hugo.h; sourceTree = "<group>"; }; 8CD1ECD1126202AA00FA198C /* intro.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = intro.cpp; sourceTree = "<group>"; }; @@ -3468,6 +3301,8 @@ DF093E5D0F63CAD4002D821E /* script_pn.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = script_pn.cpp; sourceTree = "<group>"; }; DF093E5E0F63CAD4002D821E /* vga_pn.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vga_pn.cpp; sourceTree = "<group>"; }; DF09422A0F63CB26002D821E /* ScummVM.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ScummVM.app; sourceTree = BUILT_PRODUCTS_DIR; }; + DF0942350F63CB9A002D821E /* events.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = events.cpp; sourceTree = "<group>"; }; + DF0942370F63CB9A002D821E /* graphics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = graphics.cpp; sourceTree = "<group>"; }; DF0942390F63CB9A002D821E /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; }; DF09423C0F63CB9A002D821E /* sdl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sdl.cpp; sourceTree = "<group>"; }; DF09423D0F63CB9A002D821E /* sdl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sdl.h; sourceTree = "<group>"; }; @@ -3500,156 +3335,8 @@ DF09CC260FAC4EAB00A5AFD7 /* script_v3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = script_v3.cpp; sourceTree = "<group>"; }; DF09CC270FAC4EAB00A5AFD7 /* script_v4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = script_v4.cpp; sourceTree = "<group>"; }; DF0E30391252C5BD0082D593 /* cms.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cms.cpp; sourceTree = "<group>"; }; - DF203F461380C06E0056300A /* gui-manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "gui-manager.cpp"; sourceTree = "<group>"; }; - DF203F531380C2740056300A /* avi_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = avi_decoder.cpp; path = ../../video/avi_decoder.cpp; sourceTree = SOURCE_ROOT; }; - DF203F541380C2740056300A /* avi_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = avi_decoder.h; path = ../../video/avi_decoder.h; sourceTree = SOURCE_ROOT; }; - DF203F551380C2740056300A /* coktel_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = coktel_decoder.cpp; path = ../../video/coktel_decoder.cpp; sourceTree = SOURCE_ROOT; }; - DF203F561380C2740056300A /* coktel_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = coktel_decoder.h; path = ../../video/coktel_decoder.h; sourceTree = SOURCE_ROOT; }; - DF203F571380C2740056300A /* dxa_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dxa_decoder.cpp; path = ../../video/dxa_decoder.cpp; sourceTree = SOURCE_ROOT; }; - DF203F581380C2740056300A /* dxa_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dxa_decoder.h; path = ../../video/dxa_decoder.h; sourceTree = SOURCE_ROOT; }; - DF203F591380C2740056300A /* flic_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = flic_decoder.cpp; path = ../../video/flic_decoder.cpp; sourceTree = SOURCE_ROOT; }; - DF203F5A1380C2740056300A /* flic_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = flic_decoder.h; path = ../../video/flic_decoder.h; sourceTree = SOURCE_ROOT; }; - DF203F5D1380C2740056300A /* qt_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = qt_decoder.cpp; path = ../../video/qt_decoder.cpp; sourceTree = SOURCE_ROOT; }; - DF203F5E1380C2750056300A /* qt_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = qt_decoder.h; path = ../../video/qt_decoder.h; sourceTree = SOURCE_ROOT; }; - DF203F5F1380C2750056300A /* smk_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = smk_decoder.cpp; path = ../../video/smk_decoder.cpp; sourceTree = SOURCE_ROOT; }; - DF203F601380C2750056300A /* smk_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = smk_decoder.h; path = ../../video/smk_decoder.h; sourceTree = SOURCE_ROOT; }; - DF203F611380C2750056300A /* video_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = video_decoder.cpp; path = ../../video/video_decoder.cpp; sourceTree = SOURCE_ROOT; }; - DF203F621380C2750056300A /* video_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = video_decoder.h; path = ../../video/video_decoder.h; sourceTree = SOURCE_ROOT; }; - DF203F7C1380C2920056300A /* cdtoons.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cdtoons.cpp; path = ../../video/codecs/cdtoons.cpp; sourceTree = SOURCE_ROOT; }; - DF203F7D1380C2920056300A /* cdtoons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cdtoons.h; path = ../../video/codecs/cdtoons.h; sourceTree = SOURCE_ROOT; }; - DF203F7E1380C2920056300A /* cinepak.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cinepak.cpp; path = ../../video/codecs/cinepak.cpp; sourceTree = SOURCE_ROOT; }; - DF203F7F1380C2920056300A /* cinepak.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cinepak.h; path = ../../video/codecs/cinepak.h; sourceTree = SOURCE_ROOT; }; - DF203F801380C2920056300A /* codec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = codec.h; path = ../../video/codecs/codec.h; sourceTree = SOURCE_ROOT; }; - DF203F811380C2920056300A /* indeo3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = indeo3.cpp; path = ../../video/codecs/indeo3.cpp; sourceTree = SOURCE_ROOT; }; - DF203F821380C2920056300A /* indeo3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = indeo3.h; path = ../../video/codecs/indeo3.h; sourceTree = SOURCE_ROOT; }; - DF203F831380C2920056300A /* mjpeg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mjpeg.cpp; path = ../../video/codecs/mjpeg.cpp; sourceTree = SOURCE_ROOT; }; - DF203F841380C2920056300A /* mjpeg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mjpeg.h; path = ../../video/codecs/mjpeg.h; sourceTree = SOURCE_ROOT; }; - DF203F851380C2920056300A /* msrle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = msrle.cpp; path = ../../video/codecs/msrle.cpp; sourceTree = SOURCE_ROOT; }; - DF203F861380C2920056300A /* msrle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = msrle.h; path = ../../video/codecs/msrle.h; sourceTree = SOURCE_ROOT; }; - DF203F871380C2920056300A /* msvideo1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = msvideo1.cpp; path = ../../video/codecs/msvideo1.cpp; sourceTree = SOURCE_ROOT; }; - DF203F881380C2920056300A /* msvideo1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = msvideo1.h; path = ../../video/codecs/msvideo1.h; sourceTree = SOURCE_ROOT; }; - DF203F891380C2920056300A /* qdm2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = qdm2.cpp; path = ../../video/codecs/qdm2.cpp; sourceTree = SOURCE_ROOT; }; - DF203F8A1380C2920056300A /* qdm2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = qdm2.h; path = ../../video/codecs/qdm2.h; sourceTree = SOURCE_ROOT; }; - DF203F8B1380C2920056300A /* qdm2data.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = qdm2data.h; path = ../../video/codecs/qdm2data.h; sourceTree = SOURCE_ROOT; }; - DF203F8C1380C2920056300A /* qtrle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = qtrle.cpp; path = ../../video/codecs/qtrle.cpp; sourceTree = SOURCE_ROOT; }; - DF203F8D1380C2920056300A /* qtrle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = qtrle.h; path = ../../video/codecs/qtrle.h; sourceTree = SOURCE_ROOT; }; - DF203F8E1380C2920056300A /* rpza.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = rpza.cpp; path = ../../video/codecs/rpza.cpp; sourceTree = SOURCE_ROOT; }; - DF203F8F1380C2920056300A /* rpza.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = rpza.h; path = ../../video/codecs/rpza.h; sourceTree = SOURCE_ROOT; }; - DF203F901380C2920056300A /* smc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = smc.cpp; path = ../../video/codecs/smc.cpp; sourceTree = SOURCE_ROOT; }; - DF203F911380C2920056300A /* smc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = smc.h; path = ../../video/codecs/smc.h; sourceTree = SOURCE_ROOT; }; - DF203F921380C2920056300A /* truemotion1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = truemotion1.cpp; path = ../../video/codecs/truemotion1.cpp; sourceTree = SOURCE_ROOT; }; - DF203F931380C2920056300A /* truemotion1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = truemotion1.h; path = ../../video/codecs/truemotion1.h; sourceTree = SOURCE_ROOT; }; - DF203F941380C2920056300A /* truemotion1data.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = truemotion1data.h; path = ../../video/codecs/truemotion1data.h; sourceTree = SOURCE_ROOT; }; - DF203FC01380C3BC0056300A /* console.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = console.cpp; sourceTree = "<group>"; }; - DF203FC11380C3BC0056300A /* console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = console.h; sourceTree = "<group>"; }; - DF203FC21380C3BC0056300A /* dialogs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dialogs.cpp; sourceTree = "<group>"; }; - DF203FC31380C3BC0056300A /* dialogs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dialogs.h; sourceTree = "<group>"; }; - DF203FC41380C3BC0056300A /* file_v1d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = file_v1d.cpp; sourceTree = "<group>"; }; - DF203FC51380C3BC0056300A /* file_v1w.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = file_v1w.cpp; sourceTree = "<group>"; }; - DF203FC61380C3BC0056300A /* file_v2d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = file_v2d.cpp; sourceTree = "<group>"; }; - DF203FC71380C3BC0056300A /* file_v2w.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = file_v2w.cpp; sourceTree = "<group>"; }; - DF203FC81380C3BC0056300A /* file_v3d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = file_v3d.cpp; sourceTree = "<group>"; }; - DF203FC91380C3BC0056300A /* object_v1d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = object_v1d.cpp; sourceTree = "<group>"; }; - DF203FCA1380C3BC0056300A /* object_v1w.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = object_v1w.cpp; sourceTree = "<group>"; }; - DF203FCB1380C3BC0056300A /* object_v2d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = object_v2d.cpp; sourceTree = "<group>"; }; - DF203FCC1380C3BC0056300A /* object_v3d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = object_v3d.cpp; sourceTree = "<group>"; }; - DF203FCD1380C3BC0056300A /* object.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = object.cpp; sourceTree = "<group>"; }; - DF203FCE1380C3BC0056300A /* object.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = object.h; sourceTree = "<group>"; }; - DF203FCF1380C3BC0056300A /* parser_v1d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parser_v1d.cpp; sourceTree = "<group>"; }; - DF203FD01380C3BC0056300A /* parser_v1w.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parser_v1w.cpp; sourceTree = "<group>"; }; - DF203FD11380C3BC0056300A /* parser_v2d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parser_v2d.cpp; sourceTree = "<group>"; }; - DF203FD21380C3BC0056300A /* parser_v3d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parser_v3d.cpp; sourceTree = "<group>"; }; - DF203FD31380C3BC0056300A /* text.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = text.cpp; sourceTree = "<group>"; }; - DF203FD41380C3BC0056300A /* text.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = text.h; sourceTree = "<group>"; }; - DF2040221380C8B70056300A /* editable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = editable.cpp; path = widgets/editable.cpp; sourceTree = "<group>"; }; - DF2040231380C8B70056300A /* editable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = editable.h; path = widgets/editable.h; sourceTree = "<group>"; }; - DF2040241380C8B70056300A /* edittext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = edittext.cpp; path = widgets/edittext.cpp; sourceTree = "<group>"; }; - DF2040251380C8B70056300A /* edittext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = edittext.h; path = widgets/edittext.h; sourceTree = "<group>"; }; - DF2040261380C8B70056300A /* list.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = list.cpp; path = widgets/list.cpp; sourceTree = "<group>"; }; - DF2040271380C8B70056300A /* list.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = list.h; path = widgets/list.h; sourceTree = "<group>"; }; - DF2040281380C8B70056300A /* popup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = popup.cpp; path = widgets/popup.cpp; sourceTree = "<group>"; }; - DF2040291380C8B70056300A /* popup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = popup.h; path = widgets/popup.h; sourceTree = "<group>"; }; - DF20402A1380C8B70056300A /* scrollbar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = scrollbar.cpp; path = widgets/scrollbar.cpp; sourceTree = "<group>"; }; - DF20402B1380C8B70056300A /* scrollbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = scrollbar.h; path = widgets/scrollbar.h; sourceTree = "<group>"; }; - DF20402C1380C8B70056300A /* tab.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tab.cpp; path = widgets/tab.cpp; sourceTree = "<group>"; }; - DF20402D1380C8B70056300A /* tab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tab.h; path = widgets/tab.h; sourceTree = "<group>"; }; - DF2040471380CA230056300A /* audiostream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = audiostream.cpp; path = ../../audio/audiostream.cpp; sourceTree = SOURCE_ROOT; }; - DF2040481380CA230056300A /* audiostream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = audiostream.h; path = ../../audio/audiostream.h; sourceTree = SOURCE_ROOT; }; - DF2040491380CA230056300A /* fmopl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = fmopl.cpp; path = ../../audio/fmopl.cpp; sourceTree = SOURCE_ROOT; }; - DF20404A1380CA230056300A /* fmopl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fmopl.h; path = ../../audio/fmopl.h; sourceTree = SOURCE_ROOT; }; - DF20404B1380CA230056300A /* mididrv.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mididrv.cpp; path = ../../audio/mididrv.cpp; sourceTree = SOURCE_ROOT; }; - DF20404C1380CA230056300A /* mididrv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mididrv.h; path = ../../audio/mididrv.h; sourceTree = SOURCE_ROOT; }; - DF20404D1380CA230056300A /* midiparser_smf.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = midiparser_smf.cpp; path = ../../audio/midiparser_smf.cpp; sourceTree = SOURCE_ROOT; }; - DF20404E1380CA230056300A /* midiparser_xmidi.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = midiparser_xmidi.cpp; path = ../../audio/midiparser_xmidi.cpp; sourceTree = SOURCE_ROOT; }; - DF20404F1380CA230056300A /* midiparser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = midiparser.cpp; path = ../../audio/midiparser.cpp; sourceTree = SOURCE_ROOT; }; - DF2040501380CA230056300A /* midiparser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = midiparser.h; path = ../../audio/midiparser.h; sourceTree = SOURCE_ROOT; }; - DF2040511380CA230056300A /* midiplayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = midiplayer.cpp; path = ../../audio/midiplayer.cpp; sourceTree = SOURCE_ROOT; }; - DF2040521380CA230056300A /* midiplayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = midiplayer.h; path = ../../audio/midiplayer.h; sourceTree = SOURCE_ROOT; }; - DF2040531380CA230056300A /* mixer_intern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mixer_intern.h; path = ../../audio/mixer_intern.h; sourceTree = SOURCE_ROOT; }; - DF2040541380CA230056300A /* mixer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mixer.cpp; path = ../../audio/mixer.cpp; sourceTree = SOURCE_ROOT; }; - DF2040551380CA230056300A /* mixer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mixer.h; path = ../../audio/mixer.h; sourceTree = SOURCE_ROOT; }; - DF2040561380CA230056300A /* mpu401.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mpu401.cpp; path = ../../audio/mpu401.cpp; sourceTree = SOURCE_ROOT; }; - DF2040571380CA230056300A /* mpu401.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mpu401.h; path = ../../audio/mpu401.h; sourceTree = SOURCE_ROOT; }; - DF2040581380CA230056300A /* musicplugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = musicplugin.cpp; path = ../../audio/musicplugin.cpp; sourceTree = SOURCE_ROOT; }; - DF2040591380CA230056300A /* musicplugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = musicplugin.h; path = ../../audio/musicplugin.h; sourceTree = SOURCE_ROOT; }; - DF20405A1380CA230056300A /* rate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = rate.cpp; path = ../../audio/rate.cpp; sourceTree = SOURCE_ROOT; }; - DF20405B1380CA230056300A /* rate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = rate.h; path = ../../audio/rate.h; sourceTree = SOURCE_ROOT; }; - DF20405C1380CA230056300A /* timestamp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = timestamp.cpp; path = ../../audio/timestamp.cpp; sourceTree = SOURCE_ROOT; }; - DF20405D1380CA230056300A /* timestamp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = timestamp.h; path = ../../audio/timestamp.h; sourceTree = SOURCE_ROOT; }; - DF2040831380CA400056300A /* adpcm_intern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = adpcm_intern.h; path = ../../audio/decoders/adpcm_intern.h; sourceTree = SOURCE_ROOT; }; - DF2040841380CA400056300A /* adpcm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = adpcm.cpp; path = ../../audio/decoders/adpcm.cpp; sourceTree = SOURCE_ROOT; }; - DF2040851380CA400056300A /* adpcm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = adpcm.h; path = ../../audio/decoders/adpcm.h; sourceTree = SOURCE_ROOT; }; - DF2040861380CA400056300A /* aiff.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = aiff.cpp; path = ../../audio/decoders/aiff.cpp; sourceTree = SOURCE_ROOT; }; - DF2040871380CA400056300A /* aiff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = aiff.h; path = ../../audio/decoders/aiff.h; sourceTree = SOURCE_ROOT; }; - DF2040881380CA400056300A /* flac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = flac.cpp; path = ../../audio/decoders/flac.cpp; sourceTree = SOURCE_ROOT; }; - DF2040891380CA400056300A /* flac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = flac.h; path = ../../audio/decoders/flac.h; sourceTree = SOURCE_ROOT; }; - DF20408A1380CA400056300A /* iff_sound.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = iff_sound.cpp; path = ../../audio/decoders/iff_sound.cpp; sourceTree = SOURCE_ROOT; }; - DF20408B1380CA400056300A /* iff_sound.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = iff_sound.h; path = ../../audio/decoders/iff_sound.h; sourceTree = SOURCE_ROOT; }; - DF20408C1380CA400056300A /* mac_snd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mac_snd.cpp; path = ../../audio/decoders/mac_snd.cpp; sourceTree = SOURCE_ROOT; }; - DF20408D1380CA400056300A /* mac_snd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mac_snd.h; path = ../../audio/decoders/mac_snd.h; sourceTree = SOURCE_ROOT; }; - DF20408E1380CA400056300A /* mp3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mp3.cpp; path = ../../audio/decoders/mp3.cpp; sourceTree = SOURCE_ROOT; }; - DF20408F1380CA400056300A /* mp3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mp3.h; path = ../../audio/decoders/mp3.h; sourceTree = SOURCE_ROOT; }; - DF2040901380CA400056300A /* raw.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = raw.cpp; path = ../../audio/decoders/raw.cpp; sourceTree = SOURCE_ROOT; }; - DF2040911380CA400056300A /* raw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = raw.h; path = ../../audio/decoders/raw.h; sourceTree = SOURCE_ROOT; }; - DF2040921380CA400056300A /* vag.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = vag.cpp; path = ../../audio/decoders/vag.cpp; sourceTree = SOURCE_ROOT; }; - DF2040931380CA400056300A /* vag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = vag.h; path = ../../audio/decoders/vag.h; sourceTree = SOURCE_ROOT; }; - DF2040941380CA400056300A /* voc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = voc.cpp; path = ../../audio/decoders/voc.cpp; sourceTree = SOURCE_ROOT; }; - DF2040951380CA400056300A /* voc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = voc.h; path = ../../audio/decoders/voc.h; sourceTree = SOURCE_ROOT; }; - DF2040961380CA400056300A /* vorbis.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = vorbis.cpp; path = ../../audio/decoders/vorbis.cpp; sourceTree = SOURCE_ROOT; }; - DF2040971380CA400056300A /* vorbis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = vorbis.h; path = ../../audio/decoders/vorbis.h; sourceTree = SOURCE_ROOT; }; - DF2040981380CA400056300A /* wave.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = wave.cpp; path = ../../audio/decoders/wave.cpp; sourceTree = SOURCE_ROOT; }; - DF2040991380CA400056300A /* wave.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wave.h; path = ../../audio/decoders/wave.h; sourceTree = SOURCE_ROOT; }; - DF2040BC1380CA810056300A /* infogrames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = infogrames.cpp; path = ../../audio/mods/infogrames.cpp; sourceTree = SOURCE_ROOT; }; - DF2040BD1380CA810056300A /* infogrames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = infogrames.h; path = ../../audio/mods/infogrames.h; sourceTree = SOURCE_ROOT; }; - DF2040BE1380CA810056300A /* maxtrax.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = maxtrax.cpp; path = ../../audio/mods/maxtrax.cpp; sourceTree = SOURCE_ROOT; }; - DF2040BF1380CA810056300A /* maxtrax.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = maxtrax.h; path = ../../audio/mods/maxtrax.h; sourceTree = SOURCE_ROOT; }; - DF2040C01380CA810056300A /* module.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = module.cpp; path = ../../audio/mods/module.cpp; sourceTree = SOURCE_ROOT; }; - DF2040C11380CA810056300A /* module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = module.h; path = ../../audio/mods/module.h; sourceTree = SOURCE_ROOT; }; - DF2040C21380CA810056300A /* paula.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = paula.cpp; path = ../../audio/mods/paula.cpp; sourceTree = SOURCE_ROOT; }; - DF2040C31380CA810056300A /* paula.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = paula.h; path = ../../audio/mods/paula.h; sourceTree = SOURCE_ROOT; }; - DF2040C41380CA810056300A /* protracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = protracker.cpp; path = ../../audio/mods/protracker.cpp; sourceTree = SOURCE_ROOT; }; - DF2040C51380CA810056300A /* protracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = protracker.h; path = ../../audio/mods/protracker.h; sourceTree = SOURCE_ROOT; }; - DF2040C61380CA810056300A /* rjp1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = rjp1.cpp; path = ../../audio/mods/rjp1.cpp; sourceTree = SOURCE_ROOT; }; - DF2040C71380CA810056300A /* rjp1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = rjp1.h; path = ../../audio/mods/rjp1.h; sourceTree = SOURCE_ROOT; }; - DF2040C81380CA810056300A /* soundfx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = soundfx.cpp; path = ../../audio/mods/soundfx.cpp; sourceTree = SOURCE_ROOT; }; - DF2040C91380CA810056300A /* soundfx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = soundfx.h; path = ../../audio/mods/soundfx.h; sourceTree = SOURCE_ROOT; }; - DF2040CA1380CA810056300A /* tfmx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tfmx.cpp; path = ../../audio/mods/tfmx.cpp; sourceTree = SOURCE_ROOT; }; - DF2040CB1380CA810056300A /* tfmx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tfmx.h; path = ../../audio/mods/tfmx.h; sourceTree = SOURCE_ROOT; }; - DF2040E51380CAA40056300A /* adlib.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = adlib.cpp; path = ../../audio/softsynth/adlib.cpp; sourceTree = SOURCE_ROOT; }; - DF2040E61380CAA40056300A /* appleiigs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = appleiigs.cpp; path = ../../audio/softsynth/appleiigs.cpp; sourceTree = SOURCE_ROOT; }; - DF2040E71380CAA40056300A /* cms.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cms.cpp; path = ../../audio/softsynth/cms.cpp; sourceTree = SOURCE_ROOT; }; - DF2040E81380CAA40056300A /* cms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cms.h; path = ../../audio/softsynth/cms.h; sourceTree = SOURCE_ROOT; }; - DF2040E91380CAA40056300A /* eas.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = eas.cpp; path = ../../audio/softsynth/eas.cpp; sourceTree = SOURCE_ROOT; }; - DF2040EA1380CAA40056300A /* emumidi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = emumidi.h; path = ../../audio/softsynth/emumidi.h; sourceTree = SOURCE_ROOT; }; - DF2040EB1380CAA40056300A /* fluidsynth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = fluidsynth.cpp; path = ../../audio/softsynth/fluidsynth.cpp; sourceTree = SOURCE_ROOT; }; - DF2040EC1380CAA40056300A /* mt32.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mt32.cpp; path = ../../audio/softsynth/mt32.cpp; sourceTree = SOURCE_ROOT; }; - DF2040ED1380CAA40056300A /* pcspk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = pcspk.cpp; path = ../../audio/softsynth/pcspk.cpp; sourceTree = SOURCE_ROOT; }; - DF2040EE1380CAA40056300A /* pcspk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pcspk.h; path = ../../audio/softsynth/pcspk.h; sourceTree = SOURCE_ROOT; }; - DF2040EF1380CAA40056300A /* sid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = sid.cpp; path = ../../audio/softsynth/sid.cpp; sourceTree = SOURCE_ROOT; }; - DF2040F01380CAA40056300A /* sid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sid.h; path = ../../audio/softsynth/sid.h; sourceTree = SOURCE_ROOT; }; - DF2040F11380CAA40056300A /* wave6581.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = wave6581.cpp; path = ../../audio/softsynth/wave6581.cpp; sourceTree = SOURCE_ROOT; }; - DF2040F21380CAA40056300A /* ym2612.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ym2612.cpp; path = ../../audio/softsynth/ym2612.cpp; sourceTree = SOURCE_ROOT; }; - DF2040F31380CAA40056300A /* ym2612.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ym2612.h; path = ../../audio/softsynth/ym2612.h; sourceTree = SOURCE_ROOT; }; + DF0E303F1252C6090082D593 /* cms.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cms.cpp; sourceTree = "<group>"; }; + DF0E30401252C6090082D593 /* cms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cms.h; sourceTree = "<group>"; }; DF224E020FB23BC500C8E453 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; DF2EC3E410E6490800765801 /* browser_osx.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = browser_osx.mm; sourceTree = "<group>"; }; DF2EC3F610E64C0C00765801 /* dialogs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dialogs.cpp; sourceTree = "<group>"; }; @@ -3663,12 +3350,16 @@ DF2EC50010E64D7C00765801 /* player_sid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = player_sid.h; sourceTree = "<group>"; }; DF2EC50910E64DB300765801 /* textconsole.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = textconsole.cpp; sourceTree = "<group>"; }; DF2EC50A10E64DB300765801 /* textconsole.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = textconsole.h; sourceTree = "<group>"; }; + DF2EC51010E64E3100765801 /* sid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sid.cpp; sourceTree = "<group>"; }; + DF2EC51110E64E3100765801 /* sid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sid.h; sourceTree = "<group>"; }; + DF2EC51710E64EE600765801 /* wave6581.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wave6581.cpp; sourceTree = "<group>"; }; DF2FFB900F485D890006E566 /* dither.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dither.cpp; sourceTree = "<group>"; }; DF2FFB910F485D890006E566 /* dither.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dither.h; sourceTree = "<group>"; }; DF2FFB920F485D890006E566 /* pixelformat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pixelformat.h; sourceTree = "<group>"; }; DF2FFBD10F485DFB0006E566 /* debug.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = debug.cpp; sourceTree = "<group>"; }; DF2FFBD20F485DFB0006E566 /* debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = debug.h; sourceTree = "<group>"; }; - DF2FFBD60F485E360006E566 /* gui-manager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gui-manager.h"; sourceTree = "<group>"; }; + DF2FFBD50F485E360006E566 /* gui-manager.hcpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gui-manager.hcpp; sourceTree = "<group>"; }; + DF2FFBD60F485E360006E566 /* gui-manager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gui-manager.h; sourceTree = "<group>"; }; DF2FFBDB0F485E480006E566 /* scummclassic.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = scummclassic.zip; sourceTree = "<group>"; }; DF2FFBF80F4860A60006E566 /* posix-saves.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "posix-saves.cpp"; sourceTree = "<group>"; }; DF2FFBF90F4860A60006E566 /* posix-saves.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "posix-saves.h"; sourceTree = "<group>"; }; @@ -3746,6 +3437,26 @@ DF2FFD0F0F4870E50006E566 /* tucker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tucker.h; sourceTree = "<group>"; }; DF2FFD290F48717F0006E566 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; }; DF2FFD2A0F48717F0006E566 /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = "<group>"; }; + DF45B0F7116627DA009B85CC /* adpcm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = adpcm.cpp; sourceTree = "<group>"; }; + DF45B0F8116627DA009B85CC /* adpcm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = adpcm.h; sourceTree = "<group>"; }; + DF45B0FA116627DA009B85CC /* aiff.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = aiff.cpp; sourceTree = "<group>"; }; + DF45B0FB116627DA009B85CC /* aiff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiff.h; sourceTree = "<group>"; }; + DF45B0FD116627DA009B85CC /* flac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = flac.cpp; sourceTree = "<group>"; }; + DF45B0FE116627DA009B85CC /* flac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = flac.h; sourceTree = "<group>"; }; + DF45B100116627DA009B85CC /* iff_sound.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = iff_sound.cpp; sourceTree = "<group>"; }; + DF45B101116627DA009B85CC /* iff_sound.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iff_sound.h; sourceTree = "<group>"; }; + DF45B103116627DA009B85CC /* mp3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mp3.cpp; sourceTree = "<group>"; }; + DF45B104116627DA009B85CC /* mp3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mp3.h; sourceTree = "<group>"; }; + DF45B106116627DA009B85CC /* raw.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = raw.cpp; sourceTree = "<group>"; }; + DF45B107116627DA009B85CC /* raw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = raw.h; sourceTree = "<group>"; }; + DF45B109116627DA009B85CC /* vag.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vag.cpp; sourceTree = "<group>"; }; + DF45B10A116627DA009B85CC /* vag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vag.h; sourceTree = "<group>"; }; + DF45B10C116627DA009B85CC /* voc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = voc.cpp; sourceTree = "<group>"; }; + DF45B10D116627DA009B85CC /* voc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = voc.h; sourceTree = "<group>"; }; + DF45B10F116627DA009B85CC /* vorbis.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vorbis.cpp; sourceTree = "<group>"; }; + DF45B110116627DA009B85CC /* vorbis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vorbis.h; sourceTree = "<group>"; }; + DF45B112116627DA009B85CC /* wave.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wave.cpp; sourceTree = "<group>"; }; + DF45B113116627DA009B85CC /* wave.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wave.h; sourceTree = "<group>"; }; DF45B176116628A5009B85CC /* animate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = animate.cpp; sourceTree = "<group>"; }; DF45B177116628A5009B85CC /* animate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = animate.h; sourceTree = "<group>"; }; DF45B178116628A5009B85CC /* cache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cache.cpp; sourceTree = "<group>"; }; @@ -3808,97 +3519,6 @@ DF45B1C4116628A5009B85CC /* soundcmd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = soundcmd.h; sourceTree = "<group>"; }; DF45B1C6116628A5009B85CC /* seq_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = seq_decoder.cpp; sourceTree = "<group>"; }; DF45B1C7116628A5009B85CC /* seq_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = seq_decoder.h; sourceTree = "<group>"; }; - DF46B6F21381E18900D08723 /* coroutine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = coroutine.cpp; sourceTree = "<group>"; }; - DF46B6F71381E1FF00D08723 /* towns_audio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = towns_audio.cpp; path = ../../audio/softsynth/fmtowns_pc98/towns_audio.cpp; sourceTree = SOURCE_ROOT; }; - DF46B6F81381E1FF00D08723 /* towns_audio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = towns_audio.h; path = ../../audio/softsynth/fmtowns_pc98/towns_audio.h; sourceTree = SOURCE_ROOT; }; - DF46B6F91381E1FF00D08723 /* towns_euphony.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = towns_euphony.cpp; path = ../../audio/softsynth/fmtowns_pc98/towns_euphony.cpp; sourceTree = SOURCE_ROOT; }; - DF46B6FA1381E1FF00D08723 /* towns_euphony.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = towns_euphony.h; path = ../../audio/softsynth/fmtowns_pc98/towns_euphony.h; sourceTree = SOURCE_ROOT; }; - DF46B6FB1381E1FF00D08723 /* towns_pc98_driver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = towns_pc98_driver.cpp; path = ../../audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp; sourceTree = SOURCE_ROOT; }; - DF46B6FC1381E1FF00D08723 /* towns_pc98_driver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = towns_pc98_driver.h; path = ../../audio/softsynth/fmtowns_pc98/towns_pc98_driver.h; sourceTree = SOURCE_ROOT; }; - DF46B6FD1381E1FF00D08723 /* towns_pc98_fmsynth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = towns_pc98_fmsynth.cpp; path = ../../audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp; sourceTree = SOURCE_ROOT; }; - DF46B6FE1381E1FF00D08723 /* towns_pc98_fmsynth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = towns_pc98_fmsynth.h; path = ../../audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h; sourceTree = SOURCE_ROOT; }; - DF46B70F1381E27000D08723 /* console.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = console.cpp; sourceTree = "<group>"; }; - DF46B7101381E27000D08723 /* console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = console.h; sourceTree = "<group>"; }; - DF46B7111381E27000D08723 /* databases.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = databases.cpp; sourceTree = "<group>"; }; - DF46B7121381E27000D08723 /* databases.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = databases.h; sourceTree = "<group>"; }; - DF46B7131381E27000D08723 /* dbase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dbase.cpp; sourceTree = "<group>"; }; - DF46B7141381E27000D08723 /* dbase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dbase.h; sourceTree = "<group>"; }; - DF46B7151381E27000D08723 /* iniconfig.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = iniconfig.cpp; sourceTree = "<group>"; }; - DF46B7161381E27000D08723 /* iniconfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iniconfig.h; sourceTree = "<group>"; }; - DF46B7171381E27000D08723 /* init_v7.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = init_v7.cpp; sourceTree = "<group>"; }; - DF46B7181381E27000D08723 /* inter_inca2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = inter_inca2.cpp; sourceTree = "<group>"; }; - DF46B7421381E40500D08723 /* log.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = log.cpp; path = log/log.cpp; sourceTree = "<group>"; }; - DF46B7431381E40500D08723 /* log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = log.h; path = log/log.h; sourceTree = "<group>"; }; - DF46B7471381E40F00D08723 /* modular-backend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "modular-backend.cpp"; sourceTree = "<group>"; }; - DF46B7481381E40F00D08723 /* modular-backend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "modular-backend.h"; sourceTree = "<group>"; }; - DF46B7501381E46700D08723 /* actor_he.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = actor_he.h; sourceTree = "<group>"; }; - DF46B7511381E46700D08723 /* player_v2base.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = player_v2base.cpp; sourceTree = "<group>"; }; - DF46B7521381E46700D08723 /* player_v2base.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = player_v2base.h; sourceTree = "<group>"; }; - DF46B7531381E46700D08723 /* player_v2cms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = player_v2cms.h; sourceTree = "<group>"; }; - DF46B75B1381E4A400D08723 /* console.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = console.cpp; sourceTree = "<group>"; }; - DF46B75C1381E4A400D08723 /* console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = console.h; sourceTree = "<group>"; }; - DF46B75D1381E4A400D08723 /* detection_tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = detection_tables.h; sourceTree = "<group>"; }; - DF46B7611381E4D400D08723 /* robot_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = robot_decoder.cpp; sourceTree = "<group>"; }; - DF46B7621381E4D400D08723 /* robot_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = robot_decoder.h; sourceTree = "<group>"; }; - DF46B7661381E4E400D08723 /* vm_types.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vm_types.cpp; sourceTree = "<group>"; }; - DF46B76E1381E54200D08723 /* bufferedstream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bufferedstream.h; sourceTree = "<group>"; }; - DF46B76F1381E54200D08723 /* dcl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dcl.cpp; sourceTree = "<group>"; }; - DF46B7701381E54200D08723 /* dcl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dcl.h; sourceTree = "<group>"; }; - DF46B7711381E54200D08723 /* forbidden.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = forbidden.h; sourceTree = "<group>"; }; - DF46B7721381E54200D08723 /* iff_container.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = iff_container.cpp; sourceTree = "<group>"; }; - DF46B7731381E54200D08723 /* substream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = substream.h; sourceTree = "<group>"; }; - DF46B7741381E54200D08723 /* translation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = translation.h; sourceTree = "<group>"; }; - DF46B7751381E54200D08723 /* winexe_ne.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = winexe_ne.cpp; sourceTree = "<group>"; }; - DF46B7761381E54200D08723 /* winexe_ne.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = winexe_ne.h; sourceTree = "<group>"; }; - DF46B7771381E54200D08723 /* winexe_pe.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = winexe_pe.cpp; sourceTree = "<group>"; }; - DF46B7781381E54200D08723 /* winexe_pe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = winexe_pe.h; sourceTree = "<group>"; }; - DF46B7791381E54200D08723 /* winexe.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = winexe.cpp; sourceTree = "<group>"; }; - DF46B77A1381E54200D08723 /* winexe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = winexe.h; sourceTree = "<group>"; }; - DF46B78E1381E58000D08723 /* palette.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = palette.h; sourceTree = "<group>"; }; - DF46B78F1381E58000D08723 /* png.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = png.cpp; sourceTree = "<group>"; }; - DF46B7901381E58000D08723 /* png.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = png.h; sourceTree = "<group>"; }; - DF46B7911381E58000D08723 /* wincursor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wincursor.cpp; sourceTree = "<group>"; }; - DF46B7921381E58000D08723 /* wincursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wincursor.h; sourceTree = "<group>"; }; - DF46B79D1381E5B500D08723 /* winfont.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = winfont.cpp; sourceTree = "<group>"; }; - DF46B79E1381E5B500D08723 /* winfont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = winfont.h; sourceTree = "<group>"; }; - DF46B7A31381E5D900D08723 /* sdl-timer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "sdl-timer.cpp"; path = "sdl/sdl-timer.cpp"; sourceTree = "<group>"; }; - DF46B7A41381E5D900D08723 /* sdl-timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "sdl-timer.h"; path = "sdl/sdl-timer.h"; sourceTree = "<group>"; }; - DF46B7A81381E5F100D08723 /* header.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = header.cpp; sourceTree = "<group>"; }; - DF46B7B21381E67800D08723 /* sdl-mutex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "sdl-mutex.cpp"; path = "mutex/sdl/sdl-mutex.cpp"; sourceTree = "<group>"; }; - DF46B7B31381E67800D08723 /* sdl-mutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "sdl-mutex.h"; path = "mutex/sdl/sdl-mutex.h"; sourceTree = "<group>"; }; - DF46B7BB1381E6C000D08723 /* object.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = object.cpp; sourceTree = "<group>"; }; - DF46B7BC1381E6C000D08723 /* object.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = object.h; sourceTree = "<group>"; }; - DF46B7C61381E72500D08723 /* console.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = console.cpp; sourceTree = "<group>"; }; - DF46B7C71381E72500D08723 /* console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = console.h; sourceTree = "<group>"; }; - DF46B7CD1381E76300D08723 /* sdl-events.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "sdl-events.cpp"; path = "events/sdl/sdl-events.cpp"; sourceTree = "<group>"; }; - DF46B7CE1381E76300D08723 /* sdl-events.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "sdl-events.h"; path = "events/sdl/sdl-events.h"; sourceTree = "<group>"; }; - DF46B7D41381E7C600D08723 /* console.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = console.cpp; sourceTree = "<group>"; }; - DF46B7D51381E7C600D08723 /* console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = console.h; sourceTree = "<group>"; }; - DF46B83B1381F13500D08723 /* saveload_v7.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = saveload_v7.cpp; sourceTree = "<group>"; }; - DF46B8431381F35500D08723 /* saveload_inca2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = saveload_inca2.cpp; sourceTree = "<group>"; }; - DF46B8471381F38700D08723 /* inter_v7.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = inter_v7.cpp; sourceTree = "<group>"; }; - DF46B84B1381F39E00D08723 /* console.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = console.cpp; sourceTree = "<group>"; }; - DF46B84C1381F39E00D08723 /* console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = console.h; sourceTree = "<group>"; }; - DF46B8501381F3B400D08723 /* console.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = console.cpp; sourceTree = "<group>"; }; - DF46B8511381F3B400D08723 /* console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = console.h; sourceTree = "<group>"; }; - DF46B85A1381F44E00D08723 /* dbopl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dbopl.cpp; path = ../../audio/softsynth/opl/dbopl.cpp; sourceTree = SOURCE_ROOT; }; - DF46B85B1381F44E00D08723 /* dbopl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dbopl.h; path = ../../audio/softsynth/opl/dbopl.h; sourceTree = SOURCE_ROOT; }; - DF46B85C1381F44E00D08723 /* dosbox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dosbox.cpp; path = ../../audio/softsynth/opl/dosbox.cpp; sourceTree = SOURCE_ROOT; }; - DF46B85D1381F44E00D08723 /* dosbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dosbox.h; path = ../../audio/softsynth/opl/dosbox.h; sourceTree = SOURCE_ROOT; }; - DF46B85E1381F44E00D08723 /* mame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mame.cpp; path = ../../audio/softsynth/opl/mame.cpp; sourceTree = SOURCE_ROOT; }; - DF46B85F1381F44E00D08723 /* mame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mame.h; path = ../../audio/softsynth/opl/mame.h; sourceTree = SOURCE_ROOT; }; - DF46B86F1381F4A200D08723 /* sdl-audiocd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "sdl-audiocd.cpp"; path = "audiocd/sdl/sdl-audiocd.cpp"; sourceTree = "<group>"; }; - DF46B8701381F4A200D08723 /* sdl-audiocd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "sdl-audiocd.h"; path = "audiocd/sdl/sdl-audiocd.h"; sourceTree = "<group>"; }; - DF46B87B1381F4F200D08723 /* default-audiocd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "default-audiocd.cpp"; path = "audiocd/default/default-audiocd.cpp"; sourceTree = "<group>"; }; - DF46B87C1381F4F200D08723 /* default-audiocd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "default-audiocd.h"; path = "audiocd/default/default-audiocd.h"; sourceTree = "<group>"; }; - DF46B8801381F4FF00D08723 /* audiocd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = audiocd.h; path = audiocd/audiocd.h; sourceTree = "<group>"; }; - DF46B8851381F56400D08723 /* util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util.h; sourceTree = "<group>"; }; - DF46B8871381F5D800D08723 /* sdl-provider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "sdl-provider.cpp"; path = "sdl/sdl-provider.cpp"; sourceTree = "<group>"; }; - DF46B8881381F5D800D08723 /* sdl-provider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "sdl-provider.h"; path = "sdl/sdl-provider.h"; sourceTree = "<group>"; }; - DF46B8901381F62B00D08723 /* adpcm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = adpcm.cpp; sourceTree = "<group>"; }; - DF46B8911381F62B00D08723 /* adpcm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = adpcm.h; sourceTree = "<group>"; }; - DF46B8991381F6C400D08723 /* null.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = null.cpp; path = ../../audio/null.cpp; sourceTree = SOURCE_ROOT; }; - DF46B89A1381F6C400D08723 /* null.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = null.h; path = ../../audio/null.h; sourceTree = SOURCE_ROOT; }; DF573BFE0F5A81EA00961A72 /* kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kernel.h; sourceTree = "<group>"; }; DF573BFF0F5A81EA00961A72 /* script.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = script.h; sourceTree = "<group>"; }; DF573C000F5A81EA00961A72 /* seg_manager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = seg_manager.h; sourceTree = "<group>"; }; @@ -3922,11 +3542,19 @@ DF6118450FE3A8250042AD3F /* resource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = resource.cpp; sourceTree = "<group>"; }; DF6118460FE3A8250042AD3F /* resource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = resource.h; sourceTree = "<group>"; }; DF6118540FE3A8990042AD3F /* disk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = disk.cpp; sourceTree = "<group>"; }; + DF6118590FE3A9020042AD3F /* helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = helper.h; sourceTree = "<group>"; }; + DF6118600FE3A9410042AD3F /* dxa_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dxa_decoder.cpp; sourceTree = "<group>"; }; + DF6118610FE3A9410042AD3F /* dxa_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dxa_decoder.h; sourceTree = "<group>"; }; + DF6118620FE3A9410042AD3F /* flic_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = flic_decoder.cpp; sourceTree = "<group>"; }; + DF6118630FE3A9410042AD3F /* flic_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = flic_decoder.h; sourceTree = "<group>"; }; + DF6118640FE3A9410042AD3F /* smk_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = smk_decoder.cpp; sourceTree = "<group>"; }; + DF6118650FE3A9410042AD3F /* smk_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = smk_decoder.h; sourceTree = "<group>"; }; DF6118790FE3A9AA0042AD3F /* saveconverter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = saveconverter.cpp; sourceTree = "<group>"; }; DF61187A0FE3A9AA0042AD3F /* saveconverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = saveconverter.h; sourceTree = "<group>"; }; DF61187B0FE3A9AA0042AD3F /* saveconverter_v2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = saveconverter_v2.cpp; sourceTree = "<group>"; }; DF61187C0FE3A9AA0042AD3F /* saveconverter_v3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = saveconverter_v3.cpp; sourceTree = "<group>"; }; DF61187D0FE3A9AA0042AD3F /* saveconverter_v4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = saveconverter_v4.cpp; sourceTree = "<group>"; }; + DF61187E0FE3A9AA0042AD3F /* saveconverter_v6.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = saveconverter_v6.cpp; sourceTree = "<group>"; }; DF61187F0FE3A9AA0042AD3F /* savefile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = savefile.cpp; sourceTree = "<group>"; }; DF6118800FE3A9AA0042AD3F /* savefile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = savefile.h; sourceTree = "<group>"; }; DF6118810FE3A9AA0042AD3F /* savehandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = savehandler.cpp; sourceTree = "<group>"; }; @@ -3945,6 +3573,8 @@ DF6118B70FE3AA280042AD3F /* text_lol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = text_lol.h; sourceTree = "<group>"; }; DF6118C60FE3AABD0042AD3F /* player_v2cms.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = player_v2cms.cpp; sourceTree = "<group>"; }; DF6118CB0FE3AAFD0042AD3F /* hardwarekeys.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hardwarekeys.cpp; sourceTree = "<group>"; }; + DF6118CF0FE3AB560042AD3F /* mame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mame.cpp; sourceTree = "<group>"; }; + DF6118D00FE3AB560042AD3F /* mame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mame.h; sourceTree = "<group>"; }; DF6BF4C010529DA50069811F /* conversion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = conversion.cpp; sourceTree = "<group>"; }; DF6BF4C110529DA50069811F /* conversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = conversion.h; sourceTree = "<group>"; }; DF6BF4C210529DA50069811F /* jpeg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jpeg.cpp; sourceTree = "<group>"; }; @@ -3963,6 +3593,10 @@ DF6BF4F910529F140069811F /* EventRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventRecorder.h; sourceTree = "<group>"; }; DF6BF4FA10529F140069811F /* list_intern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = list_intern.h; sourceTree = "<group>"; }; DF6BF4FB10529F140069811F /* serializer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = serializer.h; sourceTree = "<group>"; }; + DF6BF50210529F540069811F /* maxtrax.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = maxtrax.cpp; sourceTree = "<group>"; }; + DF6BF50310529F540069811F /* maxtrax.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = maxtrax.h; sourceTree = "<group>"; }; + DF6BF50410529F540069811F /* tfmx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tfmx.cpp; sourceTree = "<group>"; }; + DF6BF50510529F540069811F /* tfmx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tfmx.h; sourceTree = "<group>"; }; DF7585C3100CB66E00CC3324 /* expression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = expression.cpp; sourceTree = "<group>"; }; DF7585C4100CB66E00CC3324 /* expression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = expression.h; sourceTree = "<group>"; }; DF7585C5100CB66E00CC3324 /* hotspots.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hotspots.cpp; sourceTree = "<group>"; }; @@ -4023,6 +3657,8 @@ DF7F288911FF244F00159131 /* Tooltip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Tooltip.cpp; sourceTree = "<group>"; }; DF7F288A11FF244F00159131 /* Tooltip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tooltip.h; sourceTree = "<group>"; }; DF7F289111FF247300159131 /* translation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = translation.cpp; sourceTree = "<group>"; }; + DF7F289E11FF24B000159131 /* mac_snd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mac_snd.cpp; sourceTree = "<group>"; }; + DF7F289F11FF24B000159131 /* mac_snd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mac_snd.h; sourceTree = "<group>"; }; DF7F28A311FF24C400159131 /* console.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = console.cpp; sourceTree = "<group>"; }; DF7F28A411FF24C400159131 /* console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = console.h; sourceTree = "<group>"; }; DF841FD90E7BA61800F5680E /* iphone_keyboard.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = iphone_keyboard.m; sourceTree = "<group>"; }; @@ -5065,21 +4701,54 @@ DF842A4C0E7BBBEB00F5680E /* posix-fs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "posix-fs.h"; sourceTree = "<group>"; }; DF842A6B0E7BBD5700F5680E /* stdiostream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stdiostream.cpp; sourceTree = "<group>"; }; DF842A6C0E7BBD5700F5680E /* stdiostream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stdiostream.h; sourceTree = "<group>"; }; + DF842A6F0E7BBDB200F5680E /* musicplugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = musicplugin.cpp; sourceTree = "<group>"; }; + DF842A700E7BBDB200F5680E /* musicplugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = musicplugin.h; sourceTree = "<group>"; }; + DF895BFC124C24350077F6E8 /* coktel_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = coktel_decoder.cpp; sourceTree = "<group>"; }; + DF895BFD124C24350077F6E8 /* coktel_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = coktel_decoder.h; sourceTree = "<group>"; }; DF895C01124C24680077F6E8 /* player_towns.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = player_towns.cpp; sourceTree = "<group>"; }; DF895C02124C24680077F6E8 /* player_towns.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = player_towns.h; sourceTree = "<group>"; }; + DF895C08124C24B50077F6E8 /* appleiigs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = appleiigs.cpp; sourceTree = "<group>"; }; + DF895C0D124C24C00077F6E8 /* towns_audio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = towns_audio.cpp; sourceTree = "<group>"; }; + DF895C0E124C24C00077F6E8 /* towns_audio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = towns_audio.h; sourceTree = "<group>"; }; + DF895C0F124C24C00077F6E8 /* towns_euphony.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = towns_euphony.cpp; sourceTree = "<group>"; }; + DF895C10124C24C00077F6E8 /* towns_euphony.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = towns_euphony.h; sourceTree = "<group>"; }; + DF895C11124C24C00077F6E8 /* towns_pc98_driver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = towns_pc98_driver.cpp; sourceTree = "<group>"; }; + DF895C12124C24C00077F6E8 /* towns_pc98_driver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = towns_pc98_driver.h; sourceTree = "<group>"; }; + DF895C13124C24C00077F6E8 /* towns_pc98_fmsynth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = towns_pc98_fmsynth.cpp; sourceTree = "<group>"; }; + DF895C14124C24C00077F6E8 /* towns_pc98_fmsynth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = towns_pc98_fmsynth.h; sourceTree = "<group>"; }; DF895C23124C25150077F6E8 /* detection_tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = detection_tables.h; sourceTree = "<group>"; }; DF895C24124C25150077F6E8 /* init_fascin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = init_fascin.cpp; sourceTree = "<group>"; }; DF895C28124C25350077F6E8 /* kernel_tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kernel_tables.h; sourceTree = "<group>"; }; DF895C29124C25350077F6E8 /* script_patches.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = script_patches.cpp; sourceTree = "<group>"; }; DF895C33124C26660077F6E8 /* icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-72.png"; sourceTree = "<group>"; }; DF895C40124C271F0077F6E8 /* icon4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon4.png; sourceTree = "<group>"; }; + DF895CAB124E58980077F6E8 /* indeo3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = indeo3.cpp; sourceTree = "<group>"; }; + DF895CAC124E58980077F6E8 /* indeo3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = indeo3.h; sourceTree = "<group>"; }; + DF895CAD124E58980077F6E8 /* mjpeg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mjpeg.cpp; sourceTree = "<group>"; }; + DF895CAE124E58980077F6E8 /* mjpeg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mjpeg.h; sourceTree = "<group>"; }; + DF895CAF124E58980077F6E8 /* qdm2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qdm2.cpp; sourceTree = "<group>"; }; + DF895CB0124E58980077F6E8 /* qdm2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = qdm2.h; sourceTree = "<group>"; }; + DF895CB1124E58980077F6E8 /* qdm2data.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = qdm2data.h; sourceTree = "<group>"; }; + DF895CB2124E58980077F6E8 /* qtrle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qtrle.cpp; sourceTree = "<group>"; }; + DF895CB3124E58980077F6E8 /* qtrle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = qtrle.h; sourceTree = "<group>"; }; + DF895CB4124E58980077F6E8 /* rpza.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rpza.cpp; sourceTree = "<group>"; }; + DF895CB5124E58980077F6E8 /* rpza.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rpza.h; sourceTree = "<group>"; }; + DF895CB6124E58980077F6E8 /* smc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = smc.cpp; sourceTree = "<group>"; }; + DF895CB7124E58980077F6E8 /* smc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = smc.h; sourceTree = "<group>"; }; DF89C2870F62D55C00D756B6 /* sprites_lol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sprites_lol.cpp; sourceTree = "<group>"; }; DF89C2A30F62D79E00D756B6 /* script.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = script.cpp; sourceTree = "<group>"; }; + DF89C2B80F62D91000D756B6 /* timestamp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = timestamp.cpp; sourceTree = "<group>"; }; + DF89C2B90F62D91000D756B6 /* timestamp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = timestamp.h; sourceTree = "<group>"; }; DF90E9B410AEDA5300C8F93F /* detection_tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = detection_tables.h; sourceTree = "<group>"; }; DF90E9BD10AEDA9B00C8F93F /* selector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = selector.cpp; sourceTree = "<group>"; }; DF90EAA310B0234300C8F93F /* draw_playtoons.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = draw_playtoons.cpp; sourceTree = "<group>"; }; DF90EAAB10B0236F00C8F93F /* staticres.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = staticres.cpp; sourceTree = "<group>"; }; DF90EAAC10B0236F00C8F93F /* staticres.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = staticres.h; sourceTree = "<group>"; }; + DF90EAB610B023D100C8F93F /* avi_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = avi_decoder.cpp; sourceTree = "<group>"; }; + DF90EAB710B023D100C8F93F /* avi_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = avi_decoder.h; sourceTree = "<group>"; }; + DF90EAC010B023F400C8F93F /* codec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = codec.h; sourceTree = "<group>"; }; + DF90EAC110B023F400C8F93F /* msvideo1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = msvideo1.cpp; sourceTree = "<group>"; }; + DF90EAC210B023F400C8F93F /* msvideo1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = msvideo1.h; sourceTree = "<group>"; }; DF9B9246118E46730069C19D /* error.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = error.cpp; sourceTree = "<group>"; }; DF9B9247118E46730069C19D /* error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = error.h; sourceTree = "<group>"; }; DF9B924F118E46A00069C19D /* fontsjis.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fontsjis.cpp; sourceTree = "<group>"; }; @@ -5092,10 +4761,10 @@ DFAAB0010F011392003E9390 /* thumbnail_intern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = thumbnail_intern.cpp; sourceTree = "<group>"; }; DFAAD2390F50120E00C3A4E2 /* console.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = console.cpp; sourceTree = "<group>"; }; DFAAD23A0F50120E00C3A4E2 /* console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = console.h; sourceTree = "<group>"; }; - DFADEBB113820DF500C46364 /* maccursor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = maccursor.cpp; sourceTree = "<group>"; }; - DFADEBB213820DF500C46364 /* maccursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = maccursor.h; sourceTree = "<group>"; }; - DFADEBB613820E0C00C46364 /* posix-fs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "posix-fs.cpp"; sourceTree = "<group>"; }; - DFADEC061382140300C46364 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; + DFB0576411B753AF0015AE65 /* qt_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qt_decoder.cpp; sourceTree = "<group>"; }; + DFB0576511B753AF0015AE65 /* qt_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = qt_decoder.h; sourceTree = "<group>"; }; + DFB0576611B753AF0015AE65 /* video_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = video_decoder.cpp; sourceTree = "<group>"; }; + DFB0576711B753AF0015AE65 /* video_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = video_decoder.h; sourceTree = "<group>"; }; DFB0577311B753DA0015AE65 /* debug-channels.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "debug-channels.h"; sourceTree = "<group>"; }; DFB0577411B753DA0015AE65 /* rational.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rational.cpp; sourceTree = "<group>"; }; DFB0577511B753DA0015AE65 /* rational.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rational.h; sourceTree = "<group>"; }; @@ -5106,6 +4775,8 @@ DFB0578911B754570015AE65 /* maciconbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = maciconbar.h; sourceTree = "<group>"; }; DFB0578F11B7547D0015AE65 /* pict.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pict.cpp; sourceTree = "<group>"; }; DFB0579011B7547D0015AE65 /* pict.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pict.h; sourceTree = "<group>"; }; + DFB0579611B7549C0015AE65 /* cinepak.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cinepak.cpp; sourceTree = "<group>"; }; + DFB0579711B7549C0015AE65 /* cinepak.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cinepak.h; sourceTree = "<group>"; }; DFC8301A0F48AF18005EF03C /* detection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = detection.cpp; sourceTree = "<group>"; }; DFC8301E0F48AF18005EF03C /* gc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gc.cpp; sourceTree = "<group>"; }; DFC8301F0F48AF18005EF03C /* gc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gc.h; sourceTree = "<group>"; }; @@ -5134,6 +4805,8 @@ DFCDC6D7116629CE00A7D2A0 /* kparse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = kparse.cpp; sourceTree = "<group>"; }; DFCDC6D8116629CE00A7D2A0 /* selector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = selector.h; sourceTree = "<group>"; }; DFCDC6F611662AAB00A7D2A0 /* resource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = resource.cpp; sourceTree = "<group>"; }; + DFCDC6FC11662AD700A7D2A0 /* msrle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = msrle.cpp; sourceTree = "<group>"; }; + DFCDC6FD11662AD700A7D2A0 /* msrle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = msrle.h; sourceTree = "<group>"; }; DFCDC70311662B0200A7D2A0 /* saveload_fascin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = saveload_fascin.cpp; sourceTree = "<group>"; }; DFCDC70911662B6B00A7D2A0 /* macresman.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = macresman.cpp; sourceTree = "<group>"; }; DFCDC70A11662B6B00A7D2A0 /* macresman.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macresman.h; sourceTree = "<group>"; }; @@ -5155,7 +4828,6 @@ DFD518B90DF34BA600854012 /* scale3x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scale3x.h; sourceTree = "<group>"; }; DFD6476B0F49F7EF008E18EF /* libFLAC.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libFLAC.a; path = lib/libFLAC.a; sourceTree = "<group>"; }; DFD6476C0F49F7EF008E18EF /* libmad.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmad.a; path = lib/libmad.a; sourceTree = "<group>"; }; - DFD6476D0F49F7EF008E18EF /* libmpeg2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmpeg2.a; path = lib/libmpeg2.a; sourceTree = "<group>"; }; DFD6476F0F49F7EF008E18EF /* libvorbisidec.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvorbisidec.a; path = lib/libvorbisidec.a; sourceTree = "<group>"; }; DFE470C10D81F4BA00B6D1FB /* commandLine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = commandLine.cpp; sourceTree = "<group>"; }; DFE470C20D81F4BA00B6D1FB /* commandLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = commandLine.h; sourceTree = "<group>"; }; @@ -5263,10 +4935,16 @@ DFE477950D81F4E900B6D1FB /* debugger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = debugger.h; sourceTree = "<group>"; }; DFE477960D81F4E900B6D1FB /* dialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dialog.cpp; sourceTree = "<group>"; }; DFE477970D81F4E900B6D1FB /* dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dialog.h; sourceTree = "<group>"; }; + DFE477980D81F4E900B6D1FB /* editable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = editable.cpp; sourceTree = "<group>"; }; + DFE477990D81F4E900B6D1FB /* editable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = editable.h; sourceTree = "<group>"; }; + DFE4779A0D81F4E900B6D1FB /* EditTextWidget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditTextWidget.cpp; sourceTree = "<group>"; }; + DFE4779B0D81F4E900B6D1FB /* EditTextWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditTextWidget.h; sourceTree = "<group>"; }; DFE4779E0D81F4E900B6D1FB /* Key.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Key.cpp; sourceTree = "<group>"; }; DFE4779F0D81F4E900B6D1FB /* Key.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Key.h; sourceTree = "<group>"; }; DFE477A20D81F4E900B6D1FB /* launcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = launcher.cpp; sourceTree = "<group>"; }; DFE477A30D81F4E900B6D1FB /* launcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = launcher.h; sourceTree = "<group>"; }; + DFE477A40D81F4E900B6D1FB /* ListWidget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ListWidget.cpp; sourceTree = "<group>"; }; + DFE477A50D81F4E900B6D1FB /* ListWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListWidget.h; sourceTree = "<group>"; }; DFE477A60D81F4E900B6D1FB /* massadd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = massadd.cpp; sourceTree = "<group>"; }; DFE477A70D81F4E900B6D1FB /* massadd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = massadd.h; sourceTree = "<group>"; }; DFE477A80D81F4E900B6D1FB /* message.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = message.cpp; sourceTree = "<group>"; }; @@ -5275,10 +4953,54 @@ DFE477AE0D81F4E900B6D1FB /* object.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = object.h; sourceTree = "<group>"; }; DFE477AF0D81F4E900B6D1FB /* options.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = options.cpp; sourceTree = "<group>"; }; DFE477B00D81F4E900B6D1FB /* options.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = options.h; sourceTree = "<group>"; }; + DFE477B10D81F4E900B6D1FB /* PopUpWidget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PopUpWidget.cpp; sourceTree = "<group>"; }; + DFE477B20D81F4E900B6D1FB /* PopUpWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PopUpWidget.h; sourceTree = "<group>"; }; + DFE477B30D81F4E900B6D1FB /* ScrollBarWidget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollBarWidget.cpp; sourceTree = "<group>"; }; + DFE477B40D81F4E900B6D1FB /* ScrollBarWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollBarWidget.h; sourceTree = "<group>"; }; + DFE477B50D81F4E900B6D1FB /* TabWidget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TabWidget.cpp; sourceTree = "<group>"; }; + DFE477B60D81F4E900B6D1FB /* TabWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TabWidget.h; sourceTree = "<group>"; }; DFE477BA0D81F4E900B6D1FB /* themebrowser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = themebrowser.cpp; sourceTree = "<group>"; }; DFE477BB0D81F4E900B6D1FB /* themebrowser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = themebrowser.h; sourceTree = "<group>"; }; DFE477C40D81F4E900B6D1FB /* widget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = widget.cpp; sourceTree = "<group>"; }; DFE477C50D81F4E900B6D1FB /* widget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = widget.h; sourceTree = "<group>"; }; + DFE477CB0D81F4E900B6D1FB /* audiocd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = audiocd.cpp; sourceTree = "<group>"; }; + DFE477CC0D81F4E900B6D1FB /* audiocd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = audiocd.h; sourceTree = "<group>"; }; + DFE477CD0D81F4E900B6D1FB /* audiostream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = audiostream.cpp; sourceTree = "<group>"; }; + DFE477CE0D81F4E900B6D1FB /* audiostream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = audiostream.h; sourceTree = "<group>"; }; + DFE477D10D81F4E900B6D1FB /* fmopl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fmopl.cpp; sourceTree = "<group>"; }; + DFE477D20D81F4E900B6D1FB /* fmopl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fmopl.h; sourceTree = "<group>"; }; + DFE477D50D81F4E900B6D1FB /* mididrv.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mididrv.cpp; sourceTree = "<group>"; }; + DFE477D60D81F4E900B6D1FB /* mididrv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mididrv.h; sourceTree = "<group>"; }; + DFE477D70D81F4E900B6D1FB /* midiparser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = midiparser.cpp; sourceTree = "<group>"; }; + DFE477D80D81F4E900B6D1FB /* midiparser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = midiparser.h; sourceTree = "<group>"; }; + DFE477D90D81F4E900B6D1FB /* midiparser_smf.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = midiparser_smf.cpp; sourceTree = "<group>"; }; + DFE477DA0D81F4E900B6D1FB /* midiparser_xmidi.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = midiparser_xmidi.cpp; sourceTree = "<group>"; }; + DFE477DB0D81F4E900B6D1FB /* mixer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mixer.cpp; sourceTree = "<group>"; }; + DFE477DC0D81F4E900B6D1FB /* mixer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mixer.h; sourceTree = "<group>"; }; + DFE477DE0D81F4E900B6D1FB /* infogrames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = infogrames.cpp; sourceTree = "<group>"; }; + DFE477DF0D81F4E900B6D1FB /* infogrames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = infogrames.h; sourceTree = "<group>"; }; + DFE477E00D81F4E900B6D1FB /* module.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = module.cpp; sourceTree = "<group>"; }; + DFE477E10D81F4E900B6D1FB /* module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = module.h; sourceTree = "<group>"; }; + DFE477E20D81F4E900B6D1FB /* paula.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = paula.cpp; sourceTree = "<group>"; }; + DFE477E30D81F4E900B6D1FB /* paula.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = paula.h; sourceTree = "<group>"; }; + DFE477E40D81F4E900B6D1FB /* protracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = protracker.cpp; sourceTree = "<group>"; }; + DFE477E50D81F4E900B6D1FB /* protracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = protracker.h; sourceTree = "<group>"; }; + DFE477E60D81F4E900B6D1FB /* rjp1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rjp1.cpp; sourceTree = "<group>"; }; + DFE477E70D81F4E900B6D1FB /* rjp1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rjp1.h; sourceTree = "<group>"; }; + DFE477E80D81F4E900B6D1FB /* soundfx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = soundfx.cpp; sourceTree = "<group>"; }; + DFE477E90D81F4E900B6D1FB /* soundfx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = soundfx.h; sourceTree = "<group>"; }; + DFE477ED0D81F4E900B6D1FB /* mpu401.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mpu401.cpp; sourceTree = "<group>"; }; + DFE477EE0D81F4E900B6D1FB /* mpu401.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mpu401.h; sourceTree = "<group>"; }; + DFE477EF0D81F4E900B6D1FB /* null.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = null.cpp; sourceTree = "<group>"; }; + DFE477F00D81F4E900B6D1FB /* rate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rate.cpp; sourceTree = "<group>"; }; + DFE477F10D81F4E900B6D1FB /* rate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rate.h; sourceTree = "<group>"; }; + DFE477F70D81F4E900B6D1FB /* adlib.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = adlib.cpp; sourceTree = "<group>"; }; + DFE477F80D81F4E900B6D1FB /* emumidi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = emumidi.h; sourceTree = "<group>"; }; + DFE477F90D81F4E900B6D1FB /* fluidsynth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fluidsynth.cpp; sourceTree = "<group>"; }; + DFE478210D81F4E900B6D1FB /* pcspk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pcspk.cpp; sourceTree = "<group>"; }; + DFE478220D81F4E900B6D1FB /* pcspk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pcspk.h; sourceTree = "<group>"; }; + DFE478230D81F4E900B6D1FB /* ym2612.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ym2612.cpp; sourceTree = "<group>"; }; + DFE478240D81F4E900B6D1FB /* ym2612.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ym2612.h; sourceTree = "<group>"; }; DFE47C810D81F86900B6D1FB /* kyra.dat */ = {isa = PBXFileReference; lastKnownFileType = file; path = kyra.dat; sourceTree = "<group>"; }; DFE47C820D81F86900B6D1FB /* lure.dat */ = {isa = PBXFileReference; lastKnownFileType = file; path = lure.dat; sourceTree = "<group>"; }; DFE47C830D81F86900B6D1FB /* queen.tbl */ = {isa = PBXFileReference; lastKnownFileType = file; path = queen.tbl; sourceTree = "<group>"; }; @@ -5293,7 +5015,11 @@ DFEC5D0F1166C5CF00C90552 /* types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = types.h; sourceTree = "<group>"; }; DFEC5D341166C67300C90552 /* savestate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = savestate.cpp; sourceTree = "<group>"; }; DFEC5D351166C67300C90552 /* savestate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = savestate.h; sourceTree = "<group>"; }; + DFEC5D3D1166C6B400C90552 /* dbopl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dbopl.cpp; sourceTree = "<group>"; }; + DFEC5D3E1166C6B400C90552 /* dbopl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dbopl.h; sourceTree = "<group>"; }; DFF4DFFC0F4B449F00C50BC7 /* Info.plist.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Info.plist.in; sourceTree = "<group>"; }; + DFF958A90FB222F300A3EC78 /* dosbox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dosbox.cpp; sourceTree = "<group>"; }; + DFF958AA0FB222F300A3EC78 /* dosbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dosbox.h; sourceTree = "<group>"; }; DFF95CCA0FB22D5700A3EC78 /* ScummVM.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ScummVM.app; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -5311,9 +5037,7 @@ DFF959050FB22D3000A3EC78 /* libmad.a in Frameworks */, DFF959060FB22D3100A3EC78 /* libFLAC.a in Frameworks */, DFF959080FB22D3300A3EC78 /* libvorbisidec.a in Frameworks */, - DFF95CCF0FB22D8500A3EC78 /* libmpeg2.a in Frameworks */, DF224E040FB23BC500C8E453 /* OpenGLES.framework in Frameworks */, - DFADEC071382140300C46364 /* libz.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -5370,7 +5094,6 @@ DF842A170E7BB34E00F5680E /* CoreFoundation.framework */, DF842A180E7BB34E00F5680E /* Foundation.framework */, DF842A190E7BB34E00F5680E /* UIKit.framework */, - DFADEC061382140300C46364 /* libz.dylib */, ); name = "Linked Frameworks"; sourceTree = "<group>"; @@ -5395,8 +5118,6 @@ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { isa = PBXGroup; children = ( - DF2040461380C9ED0056300A /* audio */, - DF203F521380C2470056300A /* video */, DF9B9277118E475D0069C19D /* games */, DFD6476A0F49F7D2008E18EF /* libs */, DF841FF50E7BA6A600F5680E /* engines */, @@ -5405,6 +5126,7 @@ DFE473950D81F4E800B6D1FB /* common */, DFE477520D81F4E900B6D1FB /* graphics */, DFE477880D81F4E900B6D1FB /* gui */, + DFE477C60D81F4E900B6D1FB /* sound */, 29B97317FDCFA39411CA2CEA /* Resources */, DFA2A57A118E433A00344DFD /* Resources-iPad */, 29B97323FDCFA39411CA2CEA /* Frameworks */, @@ -5457,33 +5179,15 @@ 8CD1ECC5126202AA00FA198C /* hugo */ = { isa = PBXGroup; children = ( - DF203FC01380C3BC0056300A /* console.cpp */, - DF203FC11380C3BC0056300A /* console.h */, - DF203FC21380C3BC0056300A /* dialogs.cpp */, - DF203FC31380C3BC0056300A /* dialogs.h */, - DF203FC41380C3BC0056300A /* file_v1d.cpp */, - DF203FC51380C3BC0056300A /* file_v1w.cpp */, - DF203FC61380C3BC0056300A /* file_v2d.cpp */, - DF203FC71380C3BC0056300A /* file_v2w.cpp */, - DF203FC81380C3BC0056300A /* file_v3d.cpp */, - DF203FC91380C3BC0056300A /* object_v1d.cpp */, - DF203FCA1380C3BC0056300A /* object_v1w.cpp */, - DF203FCB1380C3BC0056300A /* object_v2d.cpp */, - DF203FCC1380C3BC0056300A /* object_v3d.cpp */, - DF203FCD1380C3BC0056300A /* object.cpp */, - DF203FCE1380C3BC0056300A /* object.h */, - DF203FCF1380C3BC0056300A /* parser_v1d.cpp */, - DF203FD01380C3BC0056300A /* parser_v1w.cpp */, - DF203FD11380C3BC0056300A /* parser_v2d.cpp */, - DF203FD21380C3BC0056300A /* parser_v3d.cpp */, - DF203FD31380C3BC0056300A /* text.cpp */, - DF203FD41380C3BC0056300A /* text.h */, 8CD1ECC6126202AA00FA198C /* detection.cpp */, 8CD1ECC7126202AA00FA198C /* display.cpp */, 8CD1ECC8126202AA00FA198C /* display.h */, + 8CD1ECC9126202AA00FA198C /* engine.cpp */, + 8CD1ECCA126202AA00FA198C /* engine.h */, 8CD1ECCB126202AA00FA198C /* file.cpp */, 8CD1ECCC126202AA00FA198C /* file.h */, 8CD1ECCD126202AA00FA198C /* game.h */, + 8CD1ECCE126202AA00FA198C /* global.h */, 8CD1ECCF126202AA00FA198C /* hugo.cpp */, 8CD1ECD0126202AA00FA198C /* hugo.h */, 8CD1ECD1126202AA00FA198C /* intro.cpp */, @@ -5593,6 +5297,8 @@ isa = PBXGroup; children = ( DF6118CB0FE3AAFD0042AD3F /* hardwarekeys.cpp */, + DF0942350F63CB9A002D821E /* events.cpp */, + DF0942370F63CB9A002D821E /* graphics.cpp */, DF0942390F63CB9A002D821E /* main.cpp */, DF09423C0F63CB9A002D821E /* sdl.cpp */, DF09423D0F63CB9A002D821E /* sdl.h */, @@ -5613,189 +5319,26 @@ path = demos; sourceTree = "<group>"; }; - DF203F521380C2470056300A /* video */ = { + DF2FFB940F485D950006E566 /* video */ = { isa = PBXGroup; children = ( - DF203F7B1380C27A0056300A /* codecs */, - DF203F531380C2740056300A /* avi_decoder.cpp */, - DF203F541380C2740056300A /* avi_decoder.h */, - DF203F551380C2740056300A /* coktel_decoder.cpp */, - DF203F561380C2740056300A /* coktel_decoder.h */, - DF203F571380C2740056300A /* dxa_decoder.cpp */, - DF203F581380C2740056300A /* dxa_decoder.h */, - DF203F591380C2740056300A /* flic_decoder.cpp */, - DF203F5A1380C2740056300A /* flic_decoder.h */, - DF203F5D1380C2740056300A /* qt_decoder.cpp */, - DF203F5E1380C2750056300A /* qt_decoder.h */, - DF203F5F1380C2750056300A /* smk_decoder.cpp */, - DF203F601380C2750056300A /* smk_decoder.h */, - DF203F611380C2750056300A /* video_decoder.cpp */, - DF203F621380C2750056300A /* video_decoder.h */, + DF90EAB610B023D100C8F93F /* avi_decoder.cpp */, + DF90EAB710B023D100C8F93F /* avi_decoder.h */, + DF90EABF10B023F300C8F93F /* codecs */, + DF895BFC124C24350077F6E8 /* coktel_decoder.cpp */, + DF895BFD124C24350077F6E8 /* coktel_decoder.h */, + DF6118600FE3A9410042AD3F /* dxa_decoder.cpp */, + DF6118610FE3A9410042AD3F /* dxa_decoder.h */, + DF6118620FE3A9410042AD3F /* flic_decoder.cpp */, + DF6118630FE3A9410042AD3F /* flic_decoder.h */, + DFB0576411B753AF0015AE65 /* qt_decoder.cpp */, + DFB0576511B753AF0015AE65 /* qt_decoder.h */, + DF6118640FE3A9410042AD3F /* smk_decoder.cpp */, + DF6118650FE3A9410042AD3F /* smk_decoder.h */, + DFB0576611B753AF0015AE65 /* video_decoder.cpp */, + DFB0576711B753AF0015AE65 /* video_decoder.h */, ); - name = video; - sourceTree = "<group>"; - }; - DF203F7B1380C27A0056300A /* codecs */ = { - isa = PBXGroup; - children = ( - DF203F7C1380C2920056300A /* cdtoons.cpp */, - DF203F7D1380C2920056300A /* cdtoons.h */, - DF203F7E1380C2920056300A /* cinepak.cpp */, - DF203F7F1380C2920056300A /* cinepak.h */, - DF203F801380C2920056300A /* codec.h */, - DF203F811380C2920056300A /* indeo3.cpp */, - DF203F821380C2920056300A /* indeo3.h */, - DF203F831380C2920056300A /* mjpeg.cpp */, - DF203F841380C2920056300A /* mjpeg.h */, - DF203F851380C2920056300A /* msrle.cpp */, - DF203F861380C2920056300A /* msrle.h */, - DF203F871380C2920056300A /* msvideo1.cpp */, - DF203F881380C2920056300A /* msvideo1.h */, - DF203F891380C2920056300A /* qdm2.cpp */, - DF203F8A1380C2920056300A /* qdm2.h */, - DF203F8B1380C2920056300A /* qdm2data.h */, - DF203F8C1380C2920056300A /* qtrle.cpp */, - DF203F8D1380C2920056300A /* qtrle.h */, - DF203F8E1380C2920056300A /* rpza.cpp */, - DF203F8F1380C2920056300A /* rpza.h */, - DF203F901380C2920056300A /* smc.cpp */, - DF203F911380C2920056300A /* smc.h */, - DF203F921380C2920056300A /* truemotion1.cpp */, - DF203F931380C2920056300A /* truemotion1.h */, - DF203F941380C2920056300A /* truemotion1data.h */, - ); - name = codecs; - sourceTree = "<group>"; - }; - DF2040211380C8A60056300A /* widgets */ = { - isa = PBXGroup; - children = ( - DF2040221380C8B70056300A /* editable.cpp */, - DF2040231380C8B70056300A /* editable.h */, - DF2040241380C8B70056300A /* edittext.cpp */, - DF2040251380C8B70056300A /* edittext.h */, - DF2040261380C8B70056300A /* list.cpp */, - DF2040271380C8B70056300A /* list.h */, - DF2040281380C8B70056300A /* popup.cpp */, - DF2040291380C8B70056300A /* popup.h */, - DF20402A1380C8B70056300A /* scrollbar.cpp */, - DF20402B1380C8B70056300A /* scrollbar.h */, - DF20402C1380C8B70056300A /* tab.cpp */, - DF20402D1380C8B70056300A /* tab.h */, - ); - name = widgets; - sourceTree = "<group>"; - }; - DF2040461380C9ED0056300A /* audio */ = { - isa = PBXGroup; - children = ( - DF46B8991381F6C400D08723 /* null.cpp */, - DF46B89A1381F6C400D08723 /* null.h */, - DF2040E41380CA8C0056300A /* softsynth */, - DF2040BB1380CA5C0056300A /* mods */, - DF2040821380CA280056300A /* decoders */, - DF2040471380CA230056300A /* audiostream.cpp */, - DF2040481380CA230056300A /* audiostream.h */, - DF2040491380CA230056300A /* fmopl.cpp */, - DF20404A1380CA230056300A /* fmopl.h */, - DF20404B1380CA230056300A /* mididrv.cpp */, - DF20404C1380CA230056300A /* mididrv.h */, - DF20404D1380CA230056300A /* midiparser_smf.cpp */, - DF20404E1380CA230056300A /* midiparser_xmidi.cpp */, - DF20404F1380CA230056300A /* midiparser.cpp */, - DF2040501380CA230056300A /* midiparser.h */, - DF2040511380CA230056300A /* midiplayer.cpp */, - DF2040521380CA230056300A /* midiplayer.h */, - DF2040531380CA230056300A /* mixer_intern.h */, - DF2040541380CA230056300A /* mixer.cpp */, - DF2040551380CA230056300A /* mixer.h */, - DF2040561380CA230056300A /* mpu401.cpp */, - DF2040571380CA230056300A /* mpu401.h */, - DF2040581380CA230056300A /* musicplugin.cpp */, - DF2040591380CA230056300A /* musicplugin.h */, - DF20405A1380CA230056300A /* rate.cpp */, - DF20405B1380CA230056300A /* rate.h */, - DF20405C1380CA230056300A /* timestamp.cpp */, - DF20405D1380CA230056300A /* timestamp.h */, - ); - name = audio; - sourceTree = "<group>"; - }; - DF2040821380CA280056300A /* decoders */ = { - isa = PBXGroup; - children = ( - DF2040831380CA400056300A /* adpcm_intern.h */, - DF2040841380CA400056300A /* adpcm.cpp */, - DF2040851380CA400056300A /* adpcm.h */, - DF2040861380CA400056300A /* aiff.cpp */, - DF2040871380CA400056300A /* aiff.h */, - DF2040881380CA400056300A /* flac.cpp */, - DF2040891380CA400056300A /* flac.h */, - DF20408A1380CA400056300A /* iff_sound.cpp */, - DF20408B1380CA400056300A /* iff_sound.h */, - DF20408C1380CA400056300A /* mac_snd.cpp */, - DF20408D1380CA400056300A /* mac_snd.h */, - DF20408E1380CA400056300A /* mp3.cpp */, - DF20408F1380CA400056300A /* mp3.h */, - DF2040901380CA400056300A /* raw.cpp */, - DF2040911380CA400056300A /* raw.h */, - DF2040921380CA400056300A /* vag.cpp */, - DF2040931380CA400056300A /* vag.h */, - DF2040941380CA400056300A /* voc.cpp */, - DF2040951380CA400056300A /* voc.h */, - DF2040961380CA400056300A /* vorbis.cpp */, - DF2040971380CA400056300A /* vorbis.h */, - DF2040981380CA400056300A /* wave.cpp */, - DF2040991380CA400056300A /* wave.h */, - ); - name = decoders; - sourceTree = "<group>"; - }; - DF2040BB1380CA5C0056300A /* mods */ = { - isa = PBXGroup; - children = ( - DF2040BC1380CA810056300A /* infogrames.cpp */, - DF2040BD1380CA810056300A /* infogrames.h */, - DF2040BE1380CA810056300A /* maxtrax.cpp */, - DF2040BF1380CA810056300A /* maxtrax.h */, - DF2040C01380CA810056300A /* module.cpp */, - DF2040C11380CA810056300A /* module.h */, - DF2040C21380CA810056300A /* paula.cpp */, - DF2040C31380CA810056300A /* paula.h */, - DF2040C41380CA810056300A /* protracker.cpp */, - DF2040C51380CA810056300A /* protracker.h */, - DF2040C61380CA810056300A /* rjp1.cpp */, - DF2040C71380CA810056300A /* rjp1.h */, - DF2040C81380CA810056300A /* soundfx.cpp */, - DF2040C91380CA810056300A /* soundfx.h */, - DF2040CA1380CA810056300A /* tfmx.cpp */, - DF2040CB1380CA810056300A /* tfmx.h */, - ); - name = mods; - sourceTree = "<group>"; - }; - DF2040E41380CA8C0056300A /* softsynth */ = { - isa = PBXGroup; - children = ( - DF46B8591381F43100D08723 /* opl */, - DF46B6F61381E1D100D08723 /* fmtowns_pc98 */, - DF2040E51380CAA40056300A /* adlib.cpp */, - DF2040E61380CAA40056300A /* appleiigs.cpp */, - DF2040E71380CAA40056300A /* cms.cpp */, - DF2040E81380CAA40056300A /* cms.h */, - DF2040E91380CAA40056300A /* eas.cpp */, - DF2040EA1380CAA40056300A /* emumidi.h */, - DF2040EB1380CAA40056300A /* fluidsynth.cpp */, - DF2040EC1380CAA40056300A /* mt32.cpp */, - DF2040ED1380CAA40056300A /* pcspk.cpp */, - DF2040EE1380CAA40056300A /* pcspk.h */, - DF2040EF1380CAA40056300A /* sid.cpp */, - DF2040F01380CAA40056300A /* sid.h */, - DF2040F11380CAA40056300A /* wave6581.cpp */, - DF2040F21380CAA40056300A /* ym2612.cpp */, - DF2040F31380CAA40056300A /* ym2612.h */, - ); - name = softsynth; + path = video; sourceTree = "<group>"; }; DF2FFBF50F4860A60006E566 /* posix */ = { @@ -5846,8 +5389,6 @@ DF2FFD040F4870E50006E566 /* tucker */ = { isa = PBXGroup; children = ( - DF46B7D41381E7C600D08723 /* console.cpp */, - DF46B7D51381E7C600D08723 /* console.h */, DF2FFD050F4870E50006E566 /* detection.cpp */, DF2FFD060F4870E50006E566 /* graphics.cpp */, DF2FFD070F4870E50006E566 /* graphics.h */, @@ -5862,6 +5403,35 @@ path = tucker; sourceTree = "<group>"; }; + DF45B0EB116627D9009B85CC /* decoders */ = { + isa = PBXGroup; + children = ( + DF45B0F7116627DA009B85CC /* adpcm.cpp */, + DF45B0F8116627DA009B85CC /* adpcm.h */, + DF45B0FA116627DA009B85CC /* aiff.cpp */, + DF45B0FB116627DA009B85CC /* aiff.h */, + DF45B0FD116627DA009B85CC /* flac.cpp */, + DF45B0FE116627DA009B85CC /* flac.h */, + DF45B100116627DA009B85CC /* iff_sound.cpp */, + DF45B101116627DA009B85CC /* iff_sound.h */, + DF7F289E11FF24B000159131 /* mac_snd.cpp */, + DF7F289F11FF24B000159131 /* mac_snd.h */, + DF45B103116627DA009B85CC /* mp3.cpp */, + DF45B104116627DA009B85CC /* mp3.h */, + DF45B106116627DA009B85CC /* raw.cpp */, + DF45B107116627DA009B85CC /* raw.h */, + DF45B109116627DA009B85CC /* vag.cpp */, + DF45B10A116627DA009B85CC /* vag.h */, + DF45B10C116627DA009B85CC /* voc.cpp */, + DF45B10D116627DA009B85CC /* voc.h */, + DF45B10F116627DA009B85CC /* vorbis.cpp */, + DF45B110116627DA009B85CC /* vorbis.h */, + DF45B112116627DA009B85CC /* wave.cpp */, + DF45B113116627DA009B85CC /* wave.h */, + ); + path = decoders; + sourceTree = "<group>"; + }; DF45B175116628A5009B85CC /* graphics */ = { isa = PBXGroup; children = ( @@ -5961,129 +5531,15 @@ DF45B1C5116628A5009B85CC /* video */ = { isa = PBXGroup; children = ( - DF46B7611381E4D400D08723 /* robot_decoder.cpp */, - DF46B7621381E4D400D08723 /* robot_decoder.h */, DF45B1C6116628A5009B85CC /* seq_decoder.cpp */, DF45B1C7116628A5009B85CC /* seq_decoder.h */, ); path = video; sourceTree = "<group>"; }; - DF46B6F61381E1D100D08723 /* fmtowns_pc98 */ = { - isa = PBXGroup; - children = ( - DF46B6F71381E1FF00D08723 /* towns_audio.cpp */, - DF46B6F81381E1FF00D08723 /* towns_audio.h */, - DF46B6F91381E1FF00D08723 /* towns_euphony.cpp */, - DF46B6FA1381E1FF00D08723 /* towns_euphony.h */, - DF46B6FB1381E1FF00D08723 /* towns_pc98_driver.cpp */, - DF46B6FC1381E1FF00D08723 /* towns_pc98_driver.h */, - DF46B6FD1381E1FF00D08723 /* towns_pc98_fmsynth.cpp */, - DF46B6FE1381E1FF00D08723 /* towns_pc98_fmsynth.h */, - ); - name = fmtowns_pc98; - sourceTree = "<group>"; - }; - DF46B7411381E3F200D08723 /* log */ = { - isa = PBXGroup; - children = ( - DF46B7421381E40500D08723 /* log.cpp */, - DF46B7431381E40500D08723 /* log.h */, - ); - name = log; - sourceTree = "<group>"; - }; - DF46B7A21381E5CC00D08723 /* sdl */ = { - isa = PBXGroup; - children = ( - DF46B7A31381E5D900D08723 /* sdl-timer.cpp */, - DF46B7A41381E5D900D08723 /* sdl-timer.h */, - ); - name = sdl; - sourceTree = "<group>"; - }; - DF46B7B01381E64E00D08723 /* mutex */ = { - isa = PBXGroup; - children = ( - DF46B7B11381E66000D08723 /* sdl */, - ); - name = mutex; - sourceTree = "<group>"; - }; - DF46B7B11381E66000D08723 /* sdl */ = { - isa = PBXGroup; - children = ( - DF46B7B21381E67800D08723 /* sdl-mutex.cpp */, - DF46B7B31381E67800D08723 /* sdl-mutex.h */, - ); - name = sdl; - sourceTree = "<group>"; - }; - DF46B7CC1381E74D00D08723 /* sdl */ = { - isa = PBXGroup; - children = ( - DF46B7CD1381E76300D08723 /* sdl-events.cpp */, - DF46B7CE1381E76300D08723 /* sdl-events.h */, - ); - name = sdl; - path = ..; - sourceTree = "<group>"; - }; - DF46B8591381F43100D08723 /* opl */ = { - isa = PBXGroup; - children = ( - DF46B85A1381F44E00D08723 /* dbopl.cpp */, - DF46B85B1381F44E00D08723 /* dbopl.h */, - DF46B85C1381F44E00D08723 /* dosbox.cpp */, - DF46B85D1381F44E00D08723 /* dosbox.h */, - DF46B85E1381F44E00D08723 /* mame.cpp */, - DF46B85F1381F44E00D08723 /* mame.h */, - ); - name = opl; - sourceTree = "<group>"; - }; - DF46B86D1381F47B00D08723 /* audiocd */ = { - isa = PBXGroup; - children = ( - DF46B8801381F4FF00D08723 /* audiocd.h */, - DF46B8781381F4C500D08723 /* default */, - DF46B86E1381F48D00D08723 /* sdl */, - ); - name = audiocd; - sourceTree = "<group>"; - }; - DF46B86E1381F48D00D08723 /* sdl */ = { - isa = PBXGroup; - children = ( - DF46B86F1381F4A200D08723 /* sdl-audiocd.cpp */, - DF46B8701381F4A200D08723 /* sdl-audiocd.h */, - ); - name = sdl; - sourceTree = "<group>"; - }; - DF46B8781381F4C500D08723 /* default */ = { - isa = PBXGroup; - children = ( - DF46B87B1381F4F200D08723 /* default-audiocd.cpp */, - DF46B87C1381F4F200D08723 /* default-audiocd.h */, - ); - name = default; - sourceTree = "<group>"; - }; - DF46B8861381F5C600D08723 /* sdl */ = { - isa = PBXGroup; - children = ( - DF46B8871381F5D800D08723 /* sdl-provider.cpp */, - DF46B8881381F5D800D08723 /* sdl-provider.h */, - ); - name = sdl; - sourceTree = "<group>"; - }; DF6118780FE3A9AA0042AD3F /* save */ = { isa = PBXGroup; children = ( - DF46B8431381F35500D08723 /* saveload_inca2.cpp */, - DF46B83B1381F13500D08723 /* saveload_v7.cpp */, DFCDC70311662B0200A7D2A0 /* saveload_fascin.cpp */, DF7585F0100CB70600CC3324 /* saveload_playtoons.cpp */, DF6118790FE3A9AA0042AD3F /* saveconverter.cpp */, @@ -6091,6 +5547,7 @@ DF61187B0FE3A9AA0042AD3F /* saveconverter_v2.cpp */, DF61187C0FE3A9AA0042AD3F /* saveconverter_v3.cpp */, DF61187D0FE3A9AA0042AD3F /* saveconverter_v4.cpp */, + DF61187E0FE3A9AA0042AD3F /* saveconverter_v6.cpp */, DF61187F0FE3A9AA0042AD3F /* savefile.cpp */, DF6118800FE3A9AA0042AD3F /* savefile.h */, DF6118810FE3A9AA0042AD3F /* savehandler.cpp */, @@ -6108,7 +5565,6 @@ DF841FF50E7BA6A600F5680E /* engines */ = { isa = PBXGroup; children = ( - DF46B8851381F56400D08723 /* util.h */, DF2FFC4C0F4863560006E566 /* advancedDetector.cpp */, DF2FFC4D0F4863560006E566 /* advancedDetector.h */, DF841FF60E7BA6A600F5680E /* agi */, @@ -6291,9 +5747,6 @@ DF8420640E7BA6A600F5680E /* cine */ = { isa = PBXGroup; children = ( - DF46B75B1381E4A400D08723 /* console.cpp */, - DF46B75C1381E4A400D08723 /* console.h */, - DF46B75D1381E4A400D08723 /* detection_tables.h */, DF8420650E7BA6A600F5680E /* anim.cpp */, DF8420660E7BA6A600F5680E /* anim.h */, DF8420670E7BA6A600F5680E /* bg.cpp */, @@ -6429,17 +5882,6 @@ DF8421170E7BA6A700F5680E /* gob */ = { isa = PBXGroup; children = ( - DF46B8471381F38700D08723 /* inter_v7.cpp */, - DF46B70F1381E27000D08723 /* console.cpp */, - DF46B7101381E27000D08723 /* console.h */, - DF46B7111381E27000D08723 /* databases.cpp */, - DF46B7121381E27000D08723 /* databases.h */, - DF46B7131381E27000D08723 /* dbase.cpp */, - DF46B7141381E27000D08723 /* dbase.h */, - DF46B7151381E27000D08723 /* iniconfig.cpp */, - DF46B7161381E27000D08723 /* iniconfig.h */, - DF46B7171381E27000D08723 /* init_v7.cpp */, - DF46B7181381E27000D08723 /* inter_inca2.cpp */, DF84211B0E7BA6A700F5680E /* dataio.cpp */, DF84211C0E7BA6A700F5680E /* dataio.h */, DF09CC060FAC4E1900A5AFD7 /* demos */, @@ -6466,6 +5908,7 @@ DF8421300E7BA6A700F5680E /* goblin_v2.cpp */, DF8421310E7BA6A700F5680E /* goblin_v3.cpp */, DF8421320E7BA6A700F5680E /* goblin_v4.cpp */, + DF6118590FE3A9020042AD3F /* helper.h */, DF7585C5100CB66E00CC3324 /* hotspots.cpp */, DF7585C6100CB66E00CC3324 /* hotspots.h */, DF8421330E7BA6A700F5680E /* init.cpp */, @@ -6812,8 +6255,6 @@ DF8422C90E7BA6A900F5680E /* made */ = { isa = PBXGroup; children = ( - DF46B8501381F3B400D08723 /* console.cpp */, - DF46B8511381F3B400D08723 /* console.h */, DF8422CA0E7BA6A900F5680E /* database.cpp */, DF8422CB0E7BA6A900F5680E /* database.h */, DF8422CC0E7BA6A900F5680E /* detection.cpp */, @@ -7012,10 +6453,6 @@ DF84237B0E7BA6AA00F5680E /* scumm */ = { isa = PBXGroup; children = ( - DF46B7501381E46700D08723 /* actor_he.h */, - DF46B7511381E46700D08723 /* player_v2base.cpp */, - DF46B7521381E46700D08723 /* player_v2base.h */, - DF46B7531381E46700D08723 /* player_v2cms.h */, DF84237C0E7BA6AA00F5680E /* actor.cpp */, DF84237D0E7BA6AA00F5680E /* actor.h */, DF84237E0E7BA6AA00F5680E /* akos.cpp */, @@ -7291,8 +6728,6 @@ DF84244E0E7BA6AB00F5680E /* sword1 */ = { isa = PBXGroup; children = ( - DF46B7C61381E72500D08723 /* console.cpp */, - DF46B7C71381E72500D08723 /* console.h */, DF84244F0E7BA6AB00F5680E /* animation.cpp */, DF8424500E7BA6AB00F5680E /* animation.h */, DF8424510E7BA6AB00F5680E /* collision.h */, @@ -7338,7 +6773,6 @@ DF8424770E7BA6AB00F5680E /* sword2 */ = { isa = PBXGroup; children = ( - DF46B7A81381E5F100D08723 /* header.cpp */, DF8424780E7BA6AB00F5680E /* animation.cpp */, DF8424790E7BA6AB00F5680E /* animation.h */, DF84247A0E7BA6AB00F5680E /* anims.cpp */, @@ -7395,9 +6829,6 @@ DF8424AA0E7BA6AB00F5680E /* tinsel */ = { isa = PBXGroup; children = ( - DF46B8901381F62B00D08723 /* adpcm.cpp */, - DF46B8911381F62B00D08723 /* adpcm.h */, - DF46B6F21381E18900D08723 /* coroutine.cpp */, DF8424AB0E7BA6AB00F5680E /* actors.cpp */, DF8424AC0E7BA6AB00F5680E /* actors.h */, DF8424AD0E7BA6AB00F5680E /* anim.cpp */, @@ -7492,8 +6923,6 @@ DF8424FC0E7BA6AB00F5680E /* touche */ = { isa = PBXGroup; children = ( - DF46B84B1381F39E00D08723 /* console.cpp */, - DF46B84C1381F39E00D08723 /* console.h */, DF8424FD0E7BA6AB00F5680E /* detection.cpp */, DF8424FE0E7BA6AB00F5680E /* graphics.cpp */, DF8424FF0E7BA6AB00F5680E /* graphics.h */, @@ -7510,6 +6939,48 @@ path = touche; sourceTree = "<group>"; }; + DF895C0C124C24C00077F6E8 /* fmtowns_pc98 */ = { + isa = PBXGroup; + children = ( + DF895C0D124C24C00077F6E8 /* towns_audio.cpp */, + DF895C0E124C24C00077F6E8 /* towns_audio.h */, + DF895C0F124C24C00077F6E8 /* towns_euphony.cpp */, + DF895C10124C24C00077F6E8 /* towns_euphony.h */, + DF895C11124C24C00077F6E8 /* towns_pc98_driver.cpp */, + DF895C12124C24C00077F6E8 /* towns_pc98_driver.h */, + DF895C13124C24C00077F6E8 /* towns_pc98_fmsynth.cpp */, + DF895C14124C24C00077F6E8 /* towns_pc98_fmsynth.h */, + ); + path = fmtowns_pc98; + sourceTree = "<group>"; + }; + DF90EABF10B023F300C8F93F /* codecs */ = { + isa = PBXGroup; + children = ( + DFB0579611B7549C0015AE65 /* cinepak.cpp */, + DFB0579711B7549C0015AE65 /* cinepak.h */, + DF90EAC010B023F400C8F93F /* codec.h */, + DF895CAB124E58980077F6E8 /* indeo3.cpp */, + DF895CAC124E58980077F6E8 /* indeo3.h */, + DF895CAD124E58980077F6E8 /* mjpeg.cpp */, + DF895CAE124E58980077F6E8 /* mjpeg.h */, + DFCDC6FC11662AD700A7D2A0 /* msrle.cpp */, + DFCDC6FD11662AD700A7D2A0 /* msrle.h */, + DF90EAC110B023F400C8F93F /* msvideo1.cpp */, + DF90EAC210B023F400C8F93F /* msvideo1.h */, + DF895CAF124E58980077F6E8 /* qdm2.cpp */, + DF895CB0124E58980077F6E8 /* qdm2.h */, + DF895CB1124E58980077F6E8 /* qdm2data.h */, + DF895CB2124E58980077F6E8 /* qtrle.cpp */, + DF895CB3124E58980077F6E8 /* qtrle.h */, + DF895CB4124E58980077F6E8 /* rpza.cpp */, + DF895CB5124E58980077F6E8 /* rpza.h */, + DF895CB6124E58980077F6E8 /* smc.cpp */, + DF895CB7124E58980077F6E8 /* smc.h */, + ); + path = codecs; + sourceTree = "<group>"; + }; DF9B9277118E475D0069C19D /* games */ = { isa = PBXGroup; children = ( @@ -7555,9 +7026,6 @@ DFC8301B0F48AF18005EF03C /* engine */ = { isa = PBXGroup; children = ( - DF46B7BB1381E6C000D08723 /* object.cpp */, - DF46B7BC1381E6C000D08723 /* object.h */, - DF46B7661381E4E400D08723 /* vm_types.cpp */, DFCDC6D5116629CE00A7D2A0 /* features.cpp */, DFCDC6D6116629CE00A7D2A0 /* features.h */, DFC8301E0F48AF18005EF03C /* gc.cpp */, @@ -7629,7 +7097,6 @@ children = ( DFD6476B0F49F7EF008E18EF /* libFLAC.a */, DFD6476C0F49F7EF008E18EF /* libmad.a */, - DFD6476D0F49F7EF008E18EF /* libmpeg2.a */, DFD6476F0F49F7EF008E18EF /* libvorbisidec.a */, ); name = libs; @@ -7654,11 +7121,6 @@ DFE470D50D81F4E700B6D1FB /* backends */ = { isa = PBXGroup; children = ( - DF46B86D1381F47B00D08723 /* audiocd */, - DF46B7B01381E64E00D08723 /* mutex */, - DF46B7471381E40F00D08723 /* modular-backend.cpp */, - DF46B7481381E40F00D08723 /* modular-backend.h */, - DF46B7411381E3F200D08723 /* log */, DF2FFC5B0F4866E70006E566 /* base-backend.cpp */, DF2FFC5C0F4866E70006E566 /* base-backend.h */, DFE470D60D81F4E700B6D1FB /* events */, @@ -7676,7 +7138,6 @@ DFE470D60D81F4E700B6D1FB /* events */ = { isa = PBXGroup; children = ( - DF46B7CC1381E74D00D08723 /* sdl */, DFE470D70D81F4E700B6D1FB /* default */, ); path = events; @@ -7706,7 +7167,6 @@ DFE470F50D81F4E700B6D1FB /* posix */ = { isa = PBXGroup; children = ( - DFADEBB613820E0C00C46364 /* posix-fs.cpp */, DF842A4C0E7BBBEB00F5680E /* posix-fs.h */, DFE470F60D81F4E700B6D1FB /* posix-fs-factory.cpp */, DFE470F70D81F4E700B6D1FB /* posix-fs-factory.h */, @@ -7757,7 +7217,6 @@ DFE4737B0D81F4E800B6D1FB /* plugins */ = { isa = PBXGroup; children = ( - DF46B8861381F5C600D08723 /* sdl */, DFE4737F0D81F4E800B6D1FB /* dynamic-plugin.h */, DFE473800D81F4E800B6D1FB /* posix */, ); @@ -7795,7 +7254,6 @@ DFE473910D81F4E800B6D1FB /* timer */ = { isa = PBXGroup; children = ( - DF46B7A21381E5CC00D08723 /* sdl */, DFE473920D81F4E800B6D1FB /* default */, ); path = timer; @@ -7813,19 +7271,6 @@ DFE473950D81F4E800B6D1FB /* common */ = { isa = PBXGroup; children = ( - DF46B76E1381E54200D08723 /* bufferedstream.h */, - DF46B76F1381E54200D08723 /* dcl.cpp */, - DF46B7701381E54200D08723 /* dcl.h */, - DF46B7711381E54200D08723 /* forbidden.h */, - DF46B7721381E54200D08723 /* iff_container.cpp */, - DF46B7731381E54200D08723 /* substream.h */, - DF46B7741381E54200D08723 /* translation.h */, - DF46B7751381E54200D08723 /* winexe_ne.cpp */, - DF46B7761381E54200D08723 /* winexe_ne.h */, - DF46B7771381E54200D08723 /* winexe_pe.cpp */, - DF46B7781381E54200D08723 /* winexe_pe.h */, - DF46B7791381E54200D08723 /* winexe.cpp */, - DF46B77A1381E54200D08723 /* winexe.h */, DFE473980D81F4E800B6D1FB /* algorithm.h */, DF842A400E7BBBB400F5680E /* archive.cpp */, DF842A410E7BBBB400F5680E /* archive.h */, @@ -7912,13 +7357,6 @@ DFE477520D81F4E900B6D1FB /* graphics */ = { isa = PBXGroup; children = ( - DFADEBB113820DF500C46364 /* maccursor.cpp */, - DFADEBB213820DF500C46364 /* maccursor.h */, - DF46B78E1381E58000D08723 /* palette.h */, - DF46B78F1381E58000D08723 /* png.cpp */, - DF46B7901381E58000D08723 /* png.h */, - DF46B7911381E58000D08723 /* wincursor.cpp */, - DF46B7921381E58000D08723 /* wincursor.h */, DFE477530D81F4E900B6D1FB /* colormasks.h */, DF6BF4C010529DA50069811F /* conversion.cpp */, DF6BF4C110529DA50069811F /* conversion.h */, @@ -7955,6 +7393,7 @@ DF7E8C080ED5FCAF001CB19F /* VectorRenderer.h */, DF7E8C090ED5FCAF001CB19F /* VectorRendererSpec.cpp */, DF7E8C0A0ED5FCAF001CB19F /* VectorRendererSpec.h */, + DF2FFB940F485D950006E566 /* video */, ); name = graphics; path = ../../graphics; @@ -7963,8 +7402,6 @@ DFE4775C0D81F4E900B6D1FB /* fonts */ = { isa = PBXGroup; children = ( - DF46B79D1381E5B500D08723 /* winfont.cpp */, - DF46B79E1381E5B500D08723 /* winfont.h */, DFE4775D0D81F4E900B6D1FB /* consolefont.cpp */, DFE4775E0D81F4E900B6D1FB /* newfont.cpp */, DFE4775F0D81F4E900B6D1FB /* newfont_big.cpp */, @@ -7976,8 +7413,6 @@ DFE477880D81F4E900B6D1FB /* gui */ = { isa = PBXGroup; children = ( - DF2040211380C8A60056300A /* widgets */, - DF203F461380C06E0056300A /* gui-manager.cpp */, DFE477890D81F4E900B6D1FB /* about.cpp */, DFE4778A0D81F4E900B6D1FB /* about.h */, DFE4778B0D81F4E900B6D1FB /* Actions.cpp */, @@ -7994,13 +7429,20 @@ DFE477950D81F4E900B6D1FB /* debugger.h */, DFE477960D81F4E900B6D1FB /* dialog.cpp */, DFE477970D81F4E900B6D1FB /* dialog.h */, + DFE477980D81F4E900B6D1FB /* editable.cpp */, + DFE477990D81F4E900B6D1FB /* editable.h */, + DFE4779A0D81F4E900B6D1FB /* EditTextWidget.cpp */, + DFE4779B0D81F4E900B6D1FB /* EditTextWidget.h */, DF9B9246118E46730069C19D /* error.cpp */, DF9B9247118E46730069C19D /* error.h */, + DF2FFBD50F485E360006E566 /* gui-manager.hcpp */, DF2FFBD60F485E360006E566 /* gui-manager.h */, DFE4779E0D81F4E900B6D1FB /* Key.cpp */, DFE4779F0D81F4E900B6D1FB /* Key.h */, DFE477A20D81F4E900B6D1FB /* launcher.cpp */, DFE477A30D81F4E900B6D1FB /* launcher.h */, + DFE477A40D81F4E900B6D1FB /* ListWidget.cpp */, + DFE477A50D81F4E900B6D1FB /* ListWidget.h */, DFE477A60D81F4E900B6D1FB /* massadd.cpp */, DFE477A70D81F4E900B6D1FB /* massadd.h */, DFE477A80D81F4E900B6D1FB /* message.cpp */, @@ -8009,8 +7451,14 @@ DFE477AE0D81F4E900B6D1FB /* object.h */, DFE477AF0D81F4E900B6D1FB /* options.cpp */, DFE477B00D81F4E900B6D1FB /* options.h */, + DFE477B10D81F4E900B6D1FB /* PopUpWidget.cpp */, + DFE477B20D81F4E900B6D1FB /* PopUpWidget.h */, DF7E8BF00ED5FC77001CB19F /* saveload.cpp */, DF7E8BF10ED5FC77001CB19F /* saveload.h */, + DFE477B30D81F4E900B6D1FB /* ScrollBarWidget.cpp */, + DFE477B40D81F4E900B6D1FB /* ScrollBarWidget.h */, + DFE477B50D81F4E900B6D1FB /* TabWidget.cpp */, + DFE477B60D81F4E900B6D1FB /* TabWidget.h */, DFE477BA0D81F4E900B6D1FB /* themebrowser.cpp */, DFE477BB0D81F4E900B6D1FB /* themebrowser.h */, DF7E8BF40ED5FC77001CB19F /* ThemeEngine.cpp */, @@ -8040,6 +7488,98 @@ path = themes; sourceTree = "<group>"; }; + DFE477C60D81F4E900B6D1FB /* sound */ = { + isa = PBXGroup; + children = ( + DFE477CB0D81F4E900B6D1FB /* audiocd.cpp */, + DFE477CC0D81F4E900B6D1FB /* audiocd.h */, + DFE477CD0D81F4E900B6D1FB /* audiostream.cpp */, + DFE477CE0D81F4E900B6D1FB /* audiostream.h */, + DF45B0EB116627D9009B85CC /* decoders */, + DFE477D10D81F4E900B6D1FB /* fmopl.cpp */, + DFE477D20D81F4E900B6D1FB /* fmopl.h */, + DFE477D50D81F4E900B6D1FB /* mididrv.cpp */, + DFE477D60D81F4E900B6D1FB /* mididrv.h */, + DFE477D70D81F4E900B6D1FB /* midiparser.cpp */, + DFE477D80D81F4E900B6D1FB /* midiparser.h */, + DFE477D90D81F4E900B6D1FB /* midiparser_smf.cpp */, + DFE477DA0D81F4E900B6D1FB /* midiparser_xmidi.cpp */, + DFE477DB0D81F4E900B6D1FB /* mixer.cpp */, + DFE477DC0D81F4E900B6D1FB /* mixer.h */, + DFE477DD0D81F4E900B6D1FB /* mods */, + DFE477ED0D81F4E900B6D1FB /* mpu401.cpp */, + DFE477EE0D81F4E900B6D1FB /* mpu401.h */, + DF842A6F0E7BBDB200F5680E /* musicplugin.cpp */, + DF842A700E7BBDB200F5680E /* musicplugin.h */, + DFE477EF0D81F4E900B6D1FB /* null.cpp */, + DFE477F00D81F4E900B6D1FB /* rate.cpp */, + DFE477F10D81F4E900B6D1FB /* rate.h */, + DFE477F60D81F4E900B6D1FB /* softsynth */, + DF89C2B80F62D91000D756B6 /* timestamp.cpp */, + DF89C2B90F62D91000D756B6 /* timestamp.h */, + ); + name = sound; + path = ../../sound; + sourceTree = SOURCE_ROOT; + }; + DFE477DD0D81F4E900B6D1FB /* mods */ = { + isa = PBXGroup; + children = ( + DFE477DE0D81F4E900B6D1FB /* infogrames.cpp */, + DFE477DF0D81F4E900B6D1FB /* infogrames.h */, + DF6BF50210529F540069811F /* maxtrax.cpp */, + DF6BF50310529F540069811F /* maxtrax.h */, + DFE477E00D81F4E900B6D1FB /* module.cpp */, + DFE477E10D81F4E900B6D1FB /* module.h */, + DFE477E20D81F4E900B6D1FB /* paula.cpp */, + DFE477E30D81F4E900B6D1FB /* paula.h */, + DFE477E40D81F4E900B6D1FB /* protracker.cpp */, + DFE477E50D81F4E900B6D1FB /* protracker.h */, + DFE477E60D81F4E900B6D1FB /* rjp1.cpp */, + DFE477E70D81F4E900B6D1FB /* rjp1.h */, + DFE477E80D81F4E900B6D1FB /* soundfx.cpp */, + DFE477E90D81F4E900B6D1FB /* soundfx.h */, + DF6BF50410529F540069811F /* tfmx.cpp */, + DF6BF50510529F540069811F /* tfmx.h */, + ); + path = mods; + sourceTree = "<group>"; + }; + DFE477F60D81F4E900B6D1FB /* softsynth */ = { + isa = PBXGroup; + children = ( + DFE477F70D81F4E900B6D1FB /* adlib.cpp */, + DF895C08124C24B50077F6E8 /* appleiigs.cpp */, + DF0E303F1252C6090082D593 /* cms.cpp */, + DF0E30401252C6090082D593 /* cms.h */, + DFE477F80D81F4E900B6D1FB /* emumidi.h */, + DFE477F90D81F4E900B6D1FB /* fluidsynth.cpp */, + DF895C0C124C24C00077F6E8 /* fmtowns_pc98 */, + DFF958A80FB222F300A3EC78 /* opl */, + DFE478210D81F4E900B6D1FB /* pcspk.cpp */, + DFE478220D81F4E900B6D1FB /* pcspk.h */, + DF2EC51010E64E3100765801 /* sid.cpp */, + DF2EC51110E64E3100765801 /* sid.h */, + DF2EC51710E64EE600765801 /* wave6581.cpp */, + DFE478230D81F4E900B6D1FB /* ym2612.cpp */, + DFE478240D81F4E900B6D1FB /* ym2612.h */, + ); + path = softsynth; + sourceTree = "<group>"; + }; + DFF958A80FB222F300A3EC78 /* opl */ = { + isa = PBXGroup; + children = ( + DFEC5D3D1166C6B400C90552 /* dbopl.cpp */, + DFEC5D3E1166C6B400C90552 /* dbopl.h */, + DFF958A90FB222F300A3EC78 /* dosbox.cpp */, + DFF958AA0FB222F300A3EC78 /* dosbox.h */, + DF6118CF0FE3AB560042AD3F /* mame.cpp */, + DF6118D00FE3AB560042AD3F /* mame.h */, + ); + path = opl; + sourceTree = "<group>"; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -8237,14 +7777,41 @@ DFE47C200D81F4E900B6D1FB /* console.cpp in Sources */, DFE47C210D81F4E900B6D1FB /* debugger.cpp in Sources */, DFE47C220D81F4E900B6D1FB /* dialog.cpp in Sources */, + DFE47C230D81F4E900B6D1FB /* editable.cpp in Sources */, + DFE47C240D81F4E900B6D1FB /* EditTextWidget.cpp in Sources */, DFE47C260D81F4E900B6D1FB /* Key.cpp in Sources */, DFE47C280D81F4E900B6D1FB /* launcher.cpp in Sources */, + DFE47C290D81F4E900B6D1FB /* ListWidget.cpp in Sources */, DFE47C2A0D81F4E900B6D1FB /* massadd.cpp in Sources */, DFE47C2B0D81F4E900B6D1FB /* message.cpp in Sources */, DFE47C2E0D81F4E900B6D1FB /* object.cpp in Sources */, DFE47C2F0D81F4E900B6D1FB /* options.cpp in Sources */, + DFE47C300D81F4E900B6D1FB /* PopUpWidget.cpp in Sources */, + DFE47C310D81F4E900B6D1FB /* ScrollBarWidget.cpp in Sources */, + DFE47C320D81F4E900B6D1FB /* TabWidget.cpp in Sources */, DFE47C350D81F4E900B6D1FB /* themebrowser.cpp in Sources */, DFE47C3B0D81F4E900B6D1FB /* widget.cpp in Sources */, + DFE47C3E0D81F4E900B6D1FB /* audiocd.cpp in Sources */, + DFE47C3F0D81F4E900B6D1FB /* audiostream.cpp in Sources */, + DFE47C410D81F4E900B6D1FB /* fmopl.cpp in Sources */, + DFE47C430D81F4E900B6D1FB /* mididrv.cpp in Sources */, + DFE47C440D81F4E900B6D1FB /* midiparser.cpp in Sources */, + DFE47C450D81F4E900B6D1FB /* midiparser_smf.cpp in Sources */, + DFE47C460D81F4E900B6D1FB /* midiparser_xmidi.cpp in Sources */, + DFE47C470D81F4E900B6D1FB /* mixer.cpp in Sources */, + DFE47C480D81F4E900B6D1FB /* infogrames.cpp in Sources */, + DFE47C490D81F4E900B6D1FB /* module.cpp in Sources */, + DFE47C4A0D81F4E900B6D1FB /* paula.cpp in Sources */, + DFE47C4B0D81F4E900B6D1FB /* protracker.cpp in Sources */, + DFE47C4C0D81F4E900B6D1FB /* rjp1.cpp in Sources */, + DFE47C4D0D81F4E900B6D1FB /* soundfx.cpp in Sources */, + DFE47C500D81F4E900B6D1FB /* mpu401.cpp in Sources */, + DFE47C510D81F4E900B6D1FB /* null.cpp in Sources */, + DFE47C520D81F4E900B6D1FB /* rate.cpp in Sources */, + DFE47C570D81F4E900B6D1FB /* adlib.cpp in Sources */, + DFE47C580D81F4E900B6D1FB /* fluidsynth.cpp in Sources */, + DFE47C740D81F4E900B6D1FB /* pcspk.cpp in Sources */, + DFE47C750D81F4E900B6D1FB /* ym2612.cpp in Sources */, DFD511480DF3383500854012 /* memorypool.cpp in Sources */, DFD517E20DF33CAC00854012 /* seq.cpp in Sources */, DFD5183D0DF3411800854012 /* scaler.cpp in Sources */, @@ -8875,6 +8442,7 @@ DF842A470E7BBBB400F5680E /* archive.cpp in Sources */, DF842A490E7BBBB400F5680E /* unarj.cpp in Sources */, DF842A6D0E7BBD5700F5680E /* stdiostream.cpp in Sources */, + DF842A710E7BBDB200F5680E /* musicplugin.cpp in Sources */, DF7E8BFD0ED5FC77001CB19F /* saveload.cpp in Sources */, DF7E8BFF0ED5FC77001CB19F /* ThemeEngine.cpp in Sources */, DF7E8C000ED5FC77001CB19F /* ThemeEval.cpp in Sources */, @@ -8891,6 +8459,7 @@ DFAAB0020F011392003E9390 /* thumbnail_intern.cpp in Sources */, DF2FFB930F485D890006E566 /* dither.cpp in Sources */, DF2FFBD30F485DFB0006E566 /* debug.cpp in Sources */, + DF2FFBD90F485E360006E566 /* gui-manager.hcpp in Sources */, DF2FFBFC0F4860A60006E566 /* posix-saves.cpp in Sources */, DF2FFC290F4862520006E566 /* bmv.cpp in Sources */, DF2FFC2A0F4862520006E566 /* dialogs.cpp in Sources */, @@ -8962,6 +8531,7 @@ DF573CBE0F5A85E100961A72 /* timer_lol.cpp in Sources */, DF89C2880F62D55C00D756B6 /* sprites_lol.cpp in Sources */, DF89C2A40F62D79E00D756B6 /* script.cpp in Sources */, + DF89C2BB0F62D91000D756B6 /* timestamp.cpp in Sources */, DF093E5F0F63CAD4002D821E /* pn.cpp in Sources */, DF093E600F63CAD4002D821E /* script_pn.cpp in Sources */, DF093E610F63CAD4002D821E /* vga_pn.cpp in Sources */, @@ -8976,15 +8546,20 @@ DF09CC1B0FAC4E1900A5AFD7 /* inter_fascin.cpp in Sources */, DF09CC2A0FAC4EAB00A5AFD7 /* script_v3.cpp in Sources */, DF09CC2B0FAC4EAB00A5AFD7 /* script_v4.cpp in Sources */, + DFF958B20FB222F300A3EC78 /* dosbox.cpp in Sources */, DF61183E0FE3A8080042AD3F /* kmisc.cpp in Sources */, DF61183F0FE3A8080042AD3F /* segment.cpp in Sources */, DF61184C0FE3A8250042AD3F /* decompressor.cpp in Sources */, DF61184D0FE3A8250042AD3F /* resource.cpp in Sources */, DF6118560FE3A8990042AD3F /* disk.cpp in Sources */, + DF61186D0FE3A9410042AD3F /* dxa_decoder.cpp in Sources */, + DF61186E0FE3A9410042AD3F /* flic_decoder.cpp in Sources */, + DF61186F0FE3A9410042AD3F /* smk_decoder.cpp in Sources */, DF6118950FE3A9AA0042AD3F /* saveconverter.cpp in Sources */, DF6118960FE3A9AA0042AD3F /* saveconverter_v2.cpp in Sources */, DF6118970FE3A9AA0042AD3F /* saveconverter_v3.cpp in Sources */, DF6118980FE3A9AA0042AD3F /* saveconverter_v4.cpp in Sources */, + DF6118990FE3A9AA0042AD3F /* saveconverter_v6.cpp in Sources */, DF61189A0FE3A9AA0042AD3F /* savefile.cpp in Sources */, DF61189B0FE3A9AA0042AD3F /* savehandler.cpp in Sources */, DF61189C0FE3A9AA0042AD3F /* saveload.cpp in Sources */, @@ -8998,6 +8573,7 @@ DF6118BE0FE3AA280042AD3F /* sound_pcspk.cpp in Sources */, DF6118BF0FE3AA280042AD3F /* text_lol.cpp in Sources */, DF6118C80FE3AABD0042AD3F /* player_v2cms.cpp in Sources */, + DF6118D30FE3AB560042AD3F /* mame.cpp in Sources */, DF7585DA100CB66E00CC3324 /* expression.cpp in Sources */, DF7585DB100CB66E00CC3324 /* hotspots.cpp in Sources */, DF7585DC100CB66E00CC3324 /* init_v6.cpp in Sources */, @@ -9022,15 +8598,31 @@ DF6BF4F410529EE40069811F /* player_v4a.cpp in Sources */, DF6BF4FE10529F140069811F /* EventDispatcher.cpp in Sources */, DF6BF4FF10529F140069811F /* EventRecorder.cpp in Sources */, + DF6BF50810529F540069811F /* maxtrax.cpp in Sources */, + DF6BF50910529F540069811F /* tfmx.cpp in Sources */, DF90E9C310AEDA9B00C8F93F /* selector.cpp in Sources */, DF90EAA610B0234300C8F93F /* draw_playtoons.cpp in Sources */, DF90EAAF10B0236F00C8F93F /* staticres.cpp in Sources */, + DF90EABA10B023D100C8F93F /* avi_decoder.cpp in Sources */, + DF90EAC510B023F400C8F93F /* msvideo1.cpp in Sources */, DF2EC3F910E64C0C00765801 /* dialogs.cpp in Sources */, DF2EC3FF10E64C4300765801 /* animator_tim.cpp in Sources */, DF2EC40610E64C8000765801 /* event.cpp in Sources */, DF2EC50310E64D7C00765801 /* player_pce.cpp in Sources */, DF2EC50410E64D7C00765801 /* player_sid.cpp in Sources */, DF2EC50C10E64DB300765801 /* textconsole.cpp in Sources */, + DF2EC51310E64E3100765801 /* sid.cpp in Sources */, + DF2EC51910E64EE600765801 /* wave6581.cpp in Sources */, + DF45B11F116627DA009B85CC /* adpcm.cpp in Sources */, + DF45B121116627DA009B85CC /* aiff.cpp in Sources */, + DF45B123116627DA009B85CC /* flac.cpp in Sources */, + DF45B125116627DA009B85CC /* iff_sound.cpp in Sources */, + DF45B127116627DA009B85CC /* mp3.cpp in Sources */, + DF45B129116627DA009B85CC /* raw.cpp in Sources */, + DF45B12B116627DA009B85CC /* vag.cpp in Sources */, + DF45B12D116627DA009B85CC /* voc.cpp in Sources */, + DF45B12F116627DA009B85CC /* vorbis.cpp in Sources */, + DF45B131116627DA009B85CC /* wave.cpp in Sources */, DF45B1CA116628A5009B85CC /* animate.cpp in Sources */, DF45B1CB116628A5009B85CC /* cache.cpp in Sources */, DF45B1CC116628A5009B85CC /* compare.cpp in Sources */, @@ -9064,19 +8656,24 @@ DFCDC6D9116629CE00A7D2A0 /* features.cpp in Sources */, DFCDC6DA116629CE00A7D2A0 /* kparse.cpp in Sources */, DFCDC6F711662AAB00A7D2A0 /* resource.cpp in Sources */, + DFCDC6FE11662AD700A7D2A0 /* msrle.cpp in Sources */, DFCDC70411662B0200A7D2A0 /* saveload_fascin.cpp in Sources */, DFCDC70B11662B6B00A7D2A0 /* macresman.cpp in Sources */, DFEC5D121166C5CF00C90552 /* random.cpp in Sources */, DFEC5D131166C5CF00C90552 /* tokenizer.cpp in Sources */, DFEC5D371166C67300C90552 /* savestate.cpp in Sources */, + DFEC5D401166C6B400C90552 /* dbopl.cpp in Sources */, DF9B9249118E46730069C19D /* error.cpp in Sources */, DF9B9254118E46A00069C19D /* fontsjis.cpp in Sources */, DF9B9263118E46FE0069C19D /* error.cpp in Sources */, + DFB0576C11B753AF0015AE65 /* qt_decoder.cpp in Sources */, + DFB0576D11B753AF0015AE65 /* video_decoder.cpp in Sources */, DFB0577711B753DA0015AE65 /* rational.cpp in Sources */, DFB0578211B7541F0015AE65 /* resource_audio.cpp in Sources */, DFB0578311B7541F0015AE65 /* util.cpp in Sources */, DFB0578B11B754570015AE65 /* maciconbar.cpp in Sources */, DFB0579211B7547D0015AE65 /* pict.cpp in Sources */, + DFB0579911B7549C0015AE65 /* cinepak.cpp in Sources */, DF7F286211FF23D500159131 /* amigamac.cpp in Sources */, DF7F286911FF23EF00159131 /* kvideo.cpp in Sources */, DF7F286A11FF23EF00159131 /* workarounds.cpp in Sources */, @@ -9087,11 +8684,25 @@ DF7F288311FF243B00159131 /* sound_sarien.cpp in Sources */, DF7F288C11FF244F00159131 /* Tooltip.cpp in Sources */, DF7F289511FF247300159131 /* translation.cpp in Sources */, + DF7F28A111FF24B000159131 /* mac_snd.cpp in Sources */, DF7F28A611FF24C400159131 /* console.cpp in Sources */, + DF895BFE124C24350077F6E8 /* coktel_decoder.cpp in Sources */, DF895C03124C24680077F6E8 /* player_towns.cpp in Sources */, + DF895C09124C24B60077F6E8 /* appleiigs.cpp in Sources */, + DF895C15124C24C10077F6E8 /* towns_audio.cpp in Sources */, + DF895C16124C24C10077F6E8 /* towns_euphony.cpp in Sources */, + DF895C17124C24C10077F6E8 /* towns_pc98_driver.cpp in Sources */, + DF895C18124C24C10077F6E8 /* towns_pc98_fmsynth.cpp in Sources */, DF895C25124C25150077F6E8 /* init_fascin.cpp in Sources */, DF895C2A124C25350077F6E8 /* script_patches.cpp in Sources */, + DF895CB8124E58980077F6E8 /* indeo3.cpp in Sources */, + DF895CB9124E58980077F6E8 /* mjpeg.cpp in Sources */, + DF895CBA124E58980077F6E8 /* qdm2.cpp in Sources */, + DF895CBB124E58980077F6E8 /* qtrle.cpp in Sources */, + DF895CBC124E58980077F6E8 /* rpza.cpp in Sources */, + DF895CBD124E58990077F6E8 /* smc.cpp in Sources */, DF0E303B1252C5BD0082D593 /* cms.cpp in Sources */, + DF0E30421252C6090082D593 /* cms.cpp in Sources */, 8CB5A9CB1253FD6900CB6BC7 /* m4_scene.cpp in Sources */, 8CB5A9CC1253FD6900CB6BC7 /* mads_logic.cpp in Sources */, 8CB5A9CD1253FD6900CB6BC7 /* mads_player.cpp in Sources */, @@ -9099,6 +8710,7 @@ 8CB5A9CF1253FD6900CB6BC7 /* mads_views.cpp in Sources */, 8CD1ED53126202AB00FA198C /* detection.cpp in Sources */, 8CD1ED54126202AB00FA198C /* display.cpp in Sources */, + 8CD1ED55126202AB00FA198C /* engine.cpp in Sources */, 8CD1ED56126202AB00FA198C /* file.cpp in Sources */, 8CD1ED57126202AB00FA198C /* hugo.cpp in Sources */, 8CD1ED58126202AB00FA198C /* intro.cpp in Sources */, @@ -9147,134 +8759,6 @@ 8CD80D13126272A0001C6C87 /* surface.cpp in Sources */, 8CD80D14126272A0001C6C87 /* surface_list.cpp in Sources */, 8CD80D15126272A0001C6C87 /* teenagent.cpp in Sources */, - DF203F481380C06E0056300A /* gui-manager.cpp in Sources */, - DF203F6B1380C2750056300A /* avi_decoder.cpp in Sources */, - DF203F6C1380C2750056300A /* coktel_decoder.cpp in Sources */, - DF203F6D1380C2750056300A /* dxa_decoder.cpp in Sources */, - DF203F6E1380C2750056300A /* flic_decoder.cpp in Sources */, - DF203F701380C2750056300A /* qt_decoder.cpp in Sources */, - DF203F711380C2750056300A /* smk_decoder.cpp in Sources */, - DF203F721380C2750056300A /* video_decoder.cpp in Sources */, - DF203FA01380C2920056300A /* cdtoons.cpp in Sources */, - DF203FA11380C2920056300A /* cinepak.cpp in Sources */, - DF203FA21380C2920056300A /* indeo3.cpp in Sources */, - DF203FA31380C2920056300A /* mjpeg.cpp in Sources */, - DF203FA41380C2920056300A /* msrle.cpp in Sources */, - DF203FA51380C2920056300A /* msvideo1.cpp in Sources */, - DF203FA61380C2920056300A /* qdm2.cpp in Sources */, - DF203FA71380C2920056300A /* qtrle.cpp in Sources */, - DF203FA81380C2920056300A /* rpza.cpp in Sources */, - DF203FA91380C2920056300A /* smc.cpp in Sources */, - DF203FAA1380C2920056300A /* truemotion1.cpp in Sources */, - DF203FE61380C3BC0056300A /* console.cpp in Sources */, - DF203FE71380C3BC0056300A /* dialogs.cpp in Sources */, - DF203FE81380C3BC0056300A /* file_v1d.cpp in Sources */, - DF203FE91380C3BC0056300A /* file_v1w.cpp in Sources */, - DF203FEA1380C3BC0056300A /* file_v2d.cpp in Sources */, - DF203FEB1380C3BC0056300A /* file_v2w.cpp in Sources */, - DF203FEC1380C3BC0056300A /* file_v3d.cpp in Sources */, - DF203FED1380C3BC0056300A /* object_v1d.cpp in Sources */, - DF203FEE1380C3BC0056300A /* object_v1w.cpp in Sources */, - DF203FEF1380C3BC0056300A /* object_v2d.cpp in Sources */, - DF203FF01380C3BC0056300A /* object_v3d.cpp in Sources */, - DF203FF11380C3BC0056300A /* object.cpp in Sources */, - DF203FF21380C3BC0056300A /* parser_v1d.cpp in Sources */, - DF203FF31380C3BC0056300A /* parser_v1w.cpp in Sources */, - DF203FF41380C3BC0056300A /* parser_v2d.cpp in Sources */, - DF203FF51380C3BC0056300A /* parser_v3d.cpp in Sources */, - DF203FF61380C3BC0056300A /* text.cpp in Sources */, - DF2040341380C8B70056300A /* editable.cpp in Sources */, - DF2040351380C8B70056300A /* edittext.cpp in Sources */, - DF2040361380C8B70056300A /* list.cpp in Sources */, - DF2040371380C8B70056300A /* popup.cpp in Sources */, - DF2040381380C8B70056300A /* scrollbar.cpp in Sources */, - DF2040391380C8B70056300A /* tab.cpp in Sources */, - DF20406A1380CA230056300A /* audiostream.cpp in Sources */, - DF20406B1380CA230056300A /* fmopl.cpp in Sources */, - DF20406C1380CA230056300A /* mididrv.cpp in Sources */, - DF20406D1380CA230056300A /* midiparser_smf.cpp in Sources */, - DF20406E1380CA230056300A /* midiparser_xmidi.cpp in Sources */, - DF20406F1380CA230056300A /* midiparser.cpp in Sources */, - DF2040701380CA230056300A /* midiplayer.cpp in Sources */, - DF2040711380CA230056300A /* mixer.cpp in Sources */, - DF2040721380CA230056300A /* mpu401.cpp in Sources */, - DF2040731380CA230056300A /* musicplugin.cpp in Sources */, - DF2040741380CA230056300A /* rate.cpp in Sources */, - DF2040751380CA230056300A /* timestamp.cpp in Sources */, - DF2040A51380CA400056300A /* adpcm.cpp in Sources */, - DF2040A61380CA400056300A /* aiff.cpp in Sources */, - DF2040A71380CA400056300A /* flac.cpp in Sources */, - DF2040A81380CA400056300A /* iff_sound.cpp in Sources */, - DF2040A91380CA400056300A /* mac_snd.cpp in Sources */, - DF2040AA1380CA400056300A /* mp3.cpp in Sources */, - DF2040AB1380CA400056300A /* raw.cpp in Sources */, - DF2040AC1380CA400056300A /* vag.cpp in Sources */, - DF2040AD1380CA400056300A /* voc.cpp in Sources */, - DF2040AE1380CA400056300A /* vorbis.cpp in Sources */, - DF2040AF1380CA400056300A /* wave.cpp in Sources */, - DF2040D41380CA810056300A /* infogrames.cpp in Sources */, - DF2040D51380CA810056300A /* maxtrax.cpp in Sources */, - DF2040D61380CA810056300A /* module.cpp in Sources */, - DF2040D71380CA810056300A /* paula.cpp in Sources */, - DF2040D81380CA810056300A /* protracker.cpp in Sources */, - DF2040D91380CA810056300A /* rjp1.cpp in Sources */, - DF2040DA1380CA810056300A /* soundfx.cpp in Sources */, - DF2040DB1380CA810056300A /* tfmx.cpp in Sources */, - DF2040FE1380CAA40056300A /* adlib.cpp in Sources */, - DF2040FF1380CAA40056300A /* appleiigs.cpp in Sources */, - DF2041001380CAA40056300A /* cms.cpp in Sources */, - DF2041011380CAA40056300A /* eas.cpp in Sources */, - DF2041021380CAA40056300A /* fluidsynth.cpp in Sources */, - DF2041031380CAA40056300A /* mt32.cpp in Sources */, - DF2041041380CAA40056300A /* pcspk.cpp in Sources */, - DF2041051380CAA40056300A /* sid.cpp in Sources */, - DF2041061380CAA40056300A /* wave6581.cpp in Sources */, - DF2041071380CAA40056300A /* ym2612.cpp in Sources */, - DF46B6F41381E18900D08723 /* coroutine.cpp in Sources */, - DF46B7031381E1FF00D08723 /* towns_audio.cpp in Sources */, - DF46B7041381E1FF00D08723 /* towns_euphony.cpp in Sources */, - DF46B7051381E1FF00D08723 /* towns_pc98_driver.cpp in Sources */, - DF46B7061381E1FF00D08723 /* towns_pc98_fmsynth.cpp in Sources */, - DF46B71F1381E27000D08723 /* console.cpp in Sources */, - DF46B7201381E27000D08723 /* databases.cpp in Sources */, - DF46B7211381E27000D08723 /* dbase.cpp in Sources */, - DF46B7221381E27000D08723 /* iniconfig.cpp in Sources */, - DF46B7231381E27000D08723 /* init_v7.cpp in Sources */, - DF46B7241381E27000D08723 /* inter_inca2.cpp in Sources */, - DF46B7451381E40500D08723 /* log.cpp in Sources */, - DF46B74A1381E40F00D08723 /* modular-backend.cpp in Sources */, - DF46B7551381E46700D08723 /* player_v2base.cpp in Sources */, - DF46B75F1381E4A400D08723 /* console.cpp in Sources */, - DF46B7641381E4D400D08723 /* robot_decoder.cpp in Sources */, - DF46B7681381E4E400D08723 /* vm_types.cpp in Sources */, - DF46B7801381E54200D08723 /* dcl.cpp in Sources */, - DF46B7811381E54200D08723 /* iff_container.cpp in Sources */, - DF46B7821381E54200D08723 /* winexe_ne.cpp in Sources */, - DF46B7831381E54200D08723 /* winexe_pe.cpp in Sources */, - DF46B7841381E54200D08723 /* winexe.cpp in Sources */, - DF46B7951381E58000D08723 /* png.cpp in Sources */, - DF46B7961381E58000D08723 /* wincursor.cpp in Sources */, - DF46B7A01381E5B500D08723 /* winfont.cpp in Sources */, - DF46B7AA1381E5F100D08723 /* header.cpp in Sources */, - DF46B7B51381E67800D08723 /* sdl-mutex.cpp in Sources */, - DF46B7BE1381E6C000D08723 /* object.cpp in Sources */, - DF46B7C91381E72500D08723 /* console.cpp in Sources */, - DF46B7D71381E7C600D08723 /* console.cpp in Sources */, - DF46B83D1381F13500D08723 /* saveload_v7.cpp in Sources */, - DF46B8451381F35500D08723 /* saveload_inca2.cpp in Sources */, - DF46B8491381F38700D08723 /* inter_v7.cpp in Sources */, - DF46B84E1381F39E00D08723 /* console.cpp in Sources */, - DF46B8531381F3B400D08723 /* console.cpp in Sources */, - DF46B8631381F44E00D08723 /* dbopl.cpp in Sources */, - DF46B8641381F44E00D08723 /* dosbox.cpp in Sources */, - DF46B8651381F44E00D08723 /* mame.cpp in Sources */, - DF46B8721381F4A200D08723 /* sdl-audiocd.cpp in Sources */, - DF46B87E1381F4F200D08723 /* default-audiocd.cpp in Sources */, - DF46B88A1381F5D800D08723 /* sdl-provider.cpp in Sources */, - DF46B8931381F62B00D08723 /* adpcm.cpp in Sources */, - DF46B89C1381F6C400D08723 /* null.cpp in Sources */, - DFADEBB413820DF500C46364 /* maccursor.cpp in Sources */, - DFADEBB813820E0C00C46364 /* posix-fs.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -9321,14 +8805,41 @@ DF093EA80F63CB26002D821E /* console.cpp in Sources */, DF093EA90F63CB26002D821E /* debugger.cpp in Sources */, DF093EAA0F63CB26002D821E /* dialog.cpp in Sources */, + DF093EAB0F63CB26002D821E /* editable.cpp in Sources */, + DF093EAC0F63CB26002D821E /* EditTextWidget.cpp in Sources */, DF093EAD0F63CB26002D821E /* Key.cpp in Sources */, DF093EAE0F63CB26002D821E /* launcher.cpp in Sources */, + DF093EAF0F63CB26002D821E /* ListWidget.cpp in Sources */, DF093EB00F63CB26002D821E /* massadd.cpp in Sources */, DF093EB10F63CB26002D821E /* message.cpp in Sources */, DF093EB20F63CB26002D821E /* object.cpp in Sources */, DF093EB30F63CB26002D821E /* options.cpp in Sources */, + DF093EB40F63CB26002D821E /* PopUpWidget.cpp in Sources */, + DF093EB50F63CB26002D821E /* ScrollBarWidget.cpp in Sources */, + DF093EB60F63CB26002D821E /* TabWidget.cpp in Sources */, DF093EB70F63CB26002D821E /* themebrowser.cpp in Sources */, DF093EB80F63CB26002D821E /* widget.cpp in Sources */, + DF093EBB0F63CB26002D821E /* audiocd.cpp in Sources */, + DF093EBC0F63CB26002D821E /* audiostream.cpp in Sources */, + DF093EBE0F63CB26002D821E /* fmopl.cpp in Sources */, + DF093EC00F63CB26002D821E /* mididrv.cpp in Sources */, + DF093EC10F63CB26002D821E /* midiparser.cpp in Sources */, + DF093EC20F63CB26002D821E /* midiparser_smf.cpp in Sources */, + DF093EC30F63CB26002D821E /* midiparser_xmidi.cpp in Sources */, + DF093EC40F63CB26002D821E /* mixer.cpp in Sources */, + DF093EC50F63CB26002D821E /* infogrames.cpp in Sources */, + DF093EC60F63CB26002D821E /* module.cpp in Sources */, + DF093EC70F63CB26002D821E /* paula.cpp in Sources */, + DF093EC80F63CB26002D821E /* protracker.cpp in Sources */, + DF093EC90F63CB26002D821E /* rjp1.cpp in Sources */, + DF093ECA0F63CB26002D821E /* soundfx.cpp in Sources */, + DF093ECC0F63CB26002D821E /* mpu401.cpp in Sources */, + DF093ECD0F63CB26002D821E /* null.cpp in Sources */, + DF093ECE0F63CB26002D821E /* rate.cpp in Sources */, + DF093ECF0F63CB26002D821E /* adlib.cpp in Sources */, + DF093ED00F63CB26002D821E /* fluidsynth.cpp in Sources */, + DF093ED10F63CB26002D821E /* pcspk.cpp in Sources */, + DF093ED20F63CB26002D821E /* ym2612.cpp in Sources */, DF093ED60F63CB26002D821E /* memorypool.cpp in Sources */, DF093ED70F63CB26002D821E /* seq.cpp in Sources */, DF093ED80F63CB26002D821E /* scaler.cpp in Sources */, @@ -9956,6 +9467,7 @@ DF09417A0F63CB26002D821E /* archive.cpp in Sources */, DF09417B0F63CB26002D821E /* unarj.cpp in Sources */, DF09417C0F63CB26002D821E /* stdiostream.cpp in Sources */, + DF09417D0F63CB26002D821E /* musicplugin.cpp in Sources */, DF09417E0F63CB26002D821E /* saveload.cpp in Sources */, DF09417F0F63CB26002D821E /* ThemeEngine.cpp in Sources */, DF0941800F63CB26002D821E /* ThemeEval.cpp in Sources */, @@ -9972,6 +9484,7 @@ DF09418B0F63CB26002D821E /* thumbnail_intern.cpp in Sources */, DF09418C0F63CB26002D821E /* dither.cpp in Sources */, DF0941920F63CB26002D821E /* debug.cpp in Sources */, + DF0941930F63CB26002D821E /* gui-manager.hcpp in Sources */, DF0941940F63CB26002D821E /* posix-saves.cpp in Sources */, DF0941950F63CB26002D821E /* bmv.cpp in Sources */, DF0941960F63CB26002D821E /* dialogs.cpp in Sources */, @@ -10043,9 +9556,12 @@ DF09420D0F63CB26002D821E /* timer_lol.cpp in Sources */, DF0942100F63CB26002D821E /* sprites_lol.cpp in Sources */, DF0942110F63CB26002D821E /* script.cpp in Sources */, + DF0942140F63CB26002D821E /* timestamp.cpp in Sources */, DF0942150F63CB26002D821E /* pn.cpp in Sources */, DF0942160F63CB26002D821E /* script_pn.cpp in Sources */, DF0942170F63CB26002D821E /* vga_pn.cpp in Sources */, + DF0942430F63CB9A002D821E /* events.cpp in Sources */, + DF0942450F63CB9A002D821E /* graphics.cpp in Sources */, DF0942470F63CB9A002D821E /* main.cpp in Sources */, DF09424A0F63CB9A002D821E /* sdl.cpp in Sources */, DF0944330F63FBB3002D821E /* coreaudio.cpp in Sources */, @@ -10061,15 +9577,20 @@ DF09CC150FAC4E1900A5AFD7 /* inter_fascin.cpp in Sources */, DF09CC280FAC4EAB00A5AFD7 /* script_v3.cpp in Sources */, DF09CC290FAC4EAB00A5AFD7 /* script_v4.cpp in Sources */, + DFF958AF0FB222F300A3EC78 /* dosbox.cpp in Sources */, DF61183C0FE3A8080042AD3F /* kmisc.cpp in Sources */, DF61183D0FE3A8080042AD3F /* segment.cpp in Sources */, DF6118490FE3A8250042AD3F /* decompressor.cpp in Sources */, DF61184A0FE3A8250042AD3F /* resource.cpp in Sources */, DF6118550FE3A8990042AD3F /* disk.cpp in Sources */, + DF6118680FE3A9410042AD3F /* dxa_decoder.cpp in Sources */, + DF6118690FE3A9410042AD3F /* flic_decoder.cpp in Sources */, + DF61186A0FE3A9410042AD3F /* smk_decoder.cpp in Sources */, DF6118890FE3A9AA0042AD3F /* saveconverter.cpp in Sources */, DF61188A0FE3A9AA0042AD3F /* saveconverter_v2.cpp in Sources */, DF61188B0FE3A9AA0042AD3F /* saveconverter_v3.cpp in Sources */, DF61188C0FE3A9AA0042AD3F /* saveconverter_v4.cpp in Sources */, + DF61188D0FE3A9AA0042AD3F /* saveconverter_v6.cpp in Sources */, DF61188E0FE3A9AA0042AD3F /* savefile.cpp in Sources */, DF61188F0FE3A9AA0042AD3F /* savehandler.cpp in Sources */, DF6118900FE3A9AA0042AD3F /* saveload.cpp in Sources */, @@ -10084,6 +9605,7 @@ DF6118BB0FE3AA280042AD3F /* text_lol.cpp in Sources */, DF6118C70FE3AABD0042AD3F /* player_v2cms.cpp in Sources */, DF6118CC0FE3AAFD0042AD3F /* hardwarekeys.cpp in Sources */, + DF6118D10FE3AB560042AD3F /* mame.cpp in Sources */, DF7585CE100CB66E00CC3324 /* expression.cpp in Sources */, DF7585CF100CB66E00CC3324 /* hotspots.cpp in Sources */, DF7585D0100CB66E00CC3324 /* init_v6.cpp in Sources */, @@ -10104,9 +9626,13 @@ DF6BF4F510529EE40069811F /* player_v4a.cpp in Sources */, DF6BF50010529F140069811F /* EventDispatcher.cpp in Sources */, DF6BF50110529F140069811F /* EventRecorder.cpp in Sources */, + DF6BF50A10529F540069811F /* maxtrax.cpp in Sources */, + DF6BF50B10529F540069811F /* tfmx.cpp in Sources */, DF90E9BF10AEDA9B00C8F93F /* selector.cpp in Sources */, DF90EAA410B0234300C8F93F /* draw_playtoons.cpp in Sources */, DF90EAAD10B0236F00C8F93F /* staticres.cpp in Sources */, + DF90EAB810B023D100C8F93F /* avi_decoder.cpp in Sources */, + DF90EAC310B023F400C8F93F /* msvideo1.cpp in Sources */, DF2EC3E510E6490800765801 /* browser_osx.mm in Sources */, DF2EC3F810E64C0C00765801 /* dialogs.cpp in Sources */, DF2EC3FE10E64C4300765801 /* animator_tim.cpp in Sources */, @@ -10114,6 +9640,18 @@ DF2EC50110E64D7C00765801 /* player_pce.cpp in Sources */, DF2EC50210E64D7C00765801 /* player_sid.cpp in Sources */, DF2EC50B10E64DB300765801 /* textconsole.cpp in Sources */, + DF2EC51210E64E3100765801 /* sid.cpp in Sources */, + DF2EC51810E64EE600765801 /* wave6581.cpp in Sources */, + DF45B13D116627DA009B85CC /* adpcm.cpp in Sources */, + DF45B13F116627DA009B85CC /* aiff.cpp in Sources */, + DF45B141116627DA009B85CC /* flac.cpp in Sources */, + DF45B143116627DA009B85CC /* iff_sound.cpp in Sources */, + DF45B145116627DA009B85CC /* mp3.cpp in Sources */, + DF45B147116627DA009B85CC /* raw.cpp in Sources */, + DF45B149116627DA009B85CC /* vag.cpp in Sources */, + DF45B14B116627DA009B85CC /* voc.cpp in Sources */, + DF45B14D116627DA009B85CC /* vorbis.cpp in Sources */, + DF45B14F116627DA009B85CC /* wave.cpp in Sources */, DF45B1F4116628A5009B85CC /* animate.cpp in Sources */, DF45B1F5116628A5009B85CC /* cache.cpp in Sources */, DF45B1F6116628A5009B85CC /* compare.cpp in Sources */, @@ -10147,19 +9685,24 @@ DFCDC6DB116629CE00A7D2A0 /* features.cpp in Sources */, DFCDC6DC116629CE00A7D2A0 /* kparse.cpp in Sources */, DFCDC6F811662AAB00A7D2A0 /* resource.cpp in Sources */, + DFCDC6FF11662AD700A7D2A0 /* msrle.cpp in Sources */, DFCDC70511662B0200A7D2A0 /* saveload_fascin.cpp in Sources */, DFCDC70C11662B6B00A7D2A0 /* macresman.cpp in Sources */, DFEC5D141166C5CF00C90552 /* random.cpp in Sources */, DFEC5D151166C5CF00C90552 /* tokenizer.cpp in Sources */, DFEC5D381166C67300C90552 /* savestate.cpp in Sources */, + DFEC5D411166C6B400C90552 /* dbopl.cpp in Sources */, DF9B924A118E46730069C19D /* error.cpp in Sources */, DF9B9256118E46A00069C19D /* fontsjis.cpp in Sources */, DF9B9264118E46FE0069C19D /* error.cpp in Sources */, + DFB0576F11B753AF0015AE65 /* qt_decoder.cpp in Sources */, + DFB0577011B753AF0015AE65 /* video_decoder.cpp in Sources */, DFB0577811B753DA0015AE65 /* rational.cpp in Sources */, DFB0578411B7541F0015AE65 /* resource_audio.cpp in Sources */, DFB0578511B7541F0015AE65 /* util.cpp in Sources */, DFB0578C11B754570015AE65 /* maciconbar.cpp in Sources */, DFB0579311B7547D0015AE65 /* pict.cpp in Sources */, + DFB0579A11B7549C0015AE65 /* cinepak.cpp in Sources */, DF7F286311FF23D500159131 /* amigamac.cpp in Sources */, DF7F286B11FF23EF00159131 /* kvideo.cpp in Sources */, DF7F286C11FF23EF00159131 /* workarounds.cpp in Sources */, @@ -10170,11 +9713,25 @@ DF7F288811FF243B00159131 /* sound_sarien.cpp in Sources */, DF7F288D11FF244F00159131 /* Tooltip.cpp in Sources */, DF7F289711FF247300159131 /* translation.cpp in Sources */, + DF7F28A211FF24B000159131 /* mac_snd.cpp in Sources */, DF7F28A711FF24C400159131 /* console.cpp in Sources */, + DF895BFF124C24350077F6E8 /* coktel_decoder.cpp in Sources */, DF895C04124C24680077F6E8 /* player_towns.cpp in Sources */, + DF895C0A124C24B60077F6E8 /* appleiigs.cpp in Sources */, + DF895C19124C24C10077F6E8 /* towns_audio.cpp in Sources */, + DF895C1A124C24C10077F6E8 /* towns_euphony.cpp in Sources */, + DF895C1B124C24C10077F6E8 /* towns_pc98_driver.cpp in Sources */, + DF895C1C124C24C10077F6E8 /* towns_pc98_fmsynth.cpp in Sources */, DF895C26124C25150077F6E8 /* init_fascin.cpp in Sources */, DF895C2B124C25350077F6E8 /* script_patches.cpp in Sources */, + DF895CBE124E58990077F6E8 /* indeo3.cpp in Sources */, + DF895CBF124E58990077F6E8 /* mjpeg.cpp in Sources */, + DF895CC0124E58990077F6E8 /* qdm2.cpp in Sources */, + DF895CC1124E58990077F6E8 /* qtrle.cpp in Sources */, + DF895CC2124E58990077F6E8 /* rpza.cpp in Sources */, + DF895CC3124E58990077F6E8 /* smc.cpp in Sources */, DF0E303C1252C5BD0082D593 /* cms.cpp in Sources */, + DF0E30431252C6090082D593 /* cms.cpp in Sources */, 8CB5A9C61253FD6900CB6BC7 /* m4_scene.cpp in Sources */, 8CB5A9C71253FD6900CB6BC7 /* mads_logic.cpp in Sources */, 8CB5A9C81253FD6900CB6BC7 /* mads_player.cpp in Sources */, @@ -10182,6 +9739,7 @@ 8CB5A9CA1253FD6900CB6BC7 /* mads_views.cpp in Sources */, 8CD1ED2F126202AB00FA198C /* detection.cpp in Sources */, 8CD1ED30126202AB00FA198C /* display.cpp in Sources */, + 8CD1ED31126202AB00FA198C /* engine.cpp in Sources */, 8CD1ED32126202AB00FA198C /* file.cpp in Sources */, 8CD1ED33126202AB00FA198C /* hugo.cpp in Sources */, 8CD1ED34126202AB00FA198C /* intro.cpp in Sources */, @@ -10230,136 +9788,6 @@ 8CD80D01126272A0001C6C87 /* surface.cpp in Sources */, 8CD80D02126272A0001C6C87 /* surface_list.cpp in Sources */, 8CD80D03126272A0001C6C87 /* teenagent.cpp in Sources */, - DF203F471380C06E0056300A /* gui-manager.cpp in Sources */, - DF203F631380C2750056300A /* avi_decoder.cpp in Sources */, - DF203F641380C2750056300A /* coktel_decoder.cpp in Sources */, - DF203F651380C2750056300A /* dxa_decoder.cpp in Sources */, - DF203F661380C2750056300A /* flic_decoder.cpp in Sources */, - DF203F681380C2750056300A /* qt_decoder.cpp in Sources */, - DF203F691380C2750056300A /* smk_decoder.cpp in Sources */, - DF203F6A1380C2750056300A /* video_decoder.cpp in Sources */, - DF203F951380C2920056300A /* cdtoons.cpp in Sources */, - DF203F961380C2920056300A /* cinepak.cpp in Sources */, - DF203F971380C2920056300A /* indeo3.cpp in Sources */, - DF203F981380C2920056300A /* mjpeg.cpp in Sources */, - DF203F991380C2920056300A /* msrle.cpp in Sources */, - DF203F9A1380C2920056300A /* msvideo1.cpp in Sources */, - DF203F9B1380C2920056300A /* qdm2.cpp in Sources */, - DF203F9C1380C2920056300A /* qtrle.cpp in Sources */, - DF203F9D1380C2920056300A /* rpza.cpp in Sources */, - DF203F9E1380C2920056300A /* smc.cpp in Sources */, - DF203F9F1380C2920056300A /* truemotion1.cpp in Sources */, - DF203FD51380C3BC0056300A /* console.cpp in Sources */, - DF203FD61380C3BC0056300A /* dialogs.cpp in Sources */, - DF203FD71380C3BC0056300A /* file_v1d.cpp in Sources */, - DF203FD81380C3BC0056300A /* file_v1w.cpp in Sources */, - DF203FD91380C3BC0056300A /* file_v2d.cpp in Sources */, - DF203FDA1380C3BC0056300A /* file_v2w.cpp in Sources */, - DF203FDB1380C3BC0056300A /* file_v3d.cpp in Sources */, - DF203FDC1380C3BC0056300A /* object_v1d.cpp in Sources */, - DF203FDD1380C3BC0056300A /* object_v1w.cpp in Sources */, - DF203FDE1380C3BC0056300A /* object_v2d.cpp in Sources */, - DF203FDF1380C3BC0056300A /* object_v3d.cpp in Sources */, - DF203FE01380C3BC0056300A /* object.cpp in Sources */, - DF203FE11380C3BC0056300A /* parser_v1d.cpp in Sources */, - DF203FE21380C3BC0056300A /* parser_v1w.cpp in Sources */, - DF203FE31380C3BC0056300A /* parser_v2d.cpp in Sources */, - DF203FE41380C3BC0056300A /* parser_v3d.cpp in Sources */, - DF203FE51380C3BC0056300A /* text.cpp in Sources */, - DF20402E1380C8B70056300A /* editable.cpp in Sources */, - DF20402F1380C8B70056300A /* edittext.cpp in Sources */, - DF2040301380C8B70056300A /* list.cpp in Sources */, - DF2040311380C8B70056300A /* popup.cpp in Sources */, - DF2040321380C8B70056300A /* scrollbar.cpp in Sources */, - DF2040331380C8B70056300A /* tab.cpp in Sources */, - DF20405E1380CA230056300A /* audiostream.cpp in Sources */, - DF20405F1380CA230056300A /* fmopl.cpp in Sources */, - DF2040601380CA230056300A /* mididrv.cpp in Sources */, - DF2040611380CA230056300A /* midiparser_smf.cpp in Sources */, - DF2040621380CA230056300A /* midiparser_xmidi.cpp in Sources */, - DF2040631380CA230056300A /* midiparser.cpp in Sources */, - DF2040641380CA230056300A /* midiplayer.cpp in Sources */, - DF2040651380CA230056300A /* mixer.cpp in Sources */, - DF2040661380CA230056300A /* mpu401.cpp in Sources */, - DF2040671380CA230056300A /* musicplugin.cpp in Sources */, - DF2040681380CA230056300A /* rate.cpp in Sources */, - DF2040691380CA230056300A /* timestamp.cpp in Sources */, - DF20409A1380CA400056300A /* adpcm.cpp in Sources */, - DF20409B1380CA400056300A /* aiff.cpp in Sources */, - DF20409C1380CA400056300A /* flac.cpp in Sources */, - DF20409D1380CA400056300A /* iff_sound.cpp in Sources */, - DF20409E1380CA400056300A /* mac_snd.cpp in Sources */, - DF20409F1380CA400056300A /* mp3.cpp in Sources */, - DF2040A01380CA400056300A /* raw.cpp in Sources */, - DF2040A11380CA400056300A /* vag.cpp in Sources */, - DF2040A21380CA400056300A /* voc.cpp in Sources */, - DF2040A31380CA400056300A /* vorbis.cpp in Sources */, - DF2040A41380CA400056300A /* wave.cpp in Sources */, - DF2040CC1380CA810056300A /* infogrames.cpp in Sources */, - DF2040CD1380CA810056300A /* maxtrax.cpp in Sources */, - DF2040CE1380CA810056300A /* module.cpp in Sources */, - DF2040CF1380CA810056300A /* paula.cpp in Sources */, - DF2040D01380CA810056300A /* protracker.cpp in Sources */, - DF2040D11380CA810056300A /* rjp1.cpp in Sources */, - DF2040D21380CA810056300A /* soundfx.cpp in Sources */, - DF2040D31380CA810056300A /* tfmx.cpp in Sources */, - DF2040F41380CAA40056300A /* adlib.cpp in Sources */, - DF2040F51380CAA40056300A /* appleiigs.cpp in Sources */, - DF2040F61380CAA40056300A /* cms.cpp in Sources */, - DF2040F71380CAA40056300A /* eas.cpp in Sources */, - DF2040F81380CAA40056300A /* fluidsynth.cpp in Sources */, - DF2040F91380CAA40056300A /* mt32.cpp in Sources */, - DF2040FA1380CAA40056300A /* pcspk.cpp in Sources */, - DF2040FB1380CAA40056300A /* sid.cpp in Sources */, - DF2040FC1380CAA40056300A /* wave6581.cpp in Sources */, - DF2040FD1380CAA40056300A /* ym2612.cpp in Sources */, - DF46B6F31381E18900D08723 /* coroutine.cpp in Sources */, - DF46B6FF1381E1FF00D08723 /* towns_audio.cpp in Sources */, - DF46B7001381E1FF00D08723 /* towns_euphony.cpp in Sources */, - DF46B7011381E1FF00D08723 /* towns_pc98_driver.cpp in Sources */, - DF46B7021381E1FF00D08723 /* towns_pc98_fmsynth.cpp in Sources */, - DF46B7191381E27000D08723 /* console.cpp in Sources */, - DF46B71A1381E27000D08723 /* databases.cpp in Sources */, - DF46B71B1381E27000D08723 /* dbase.cpp in Sources */, - DF46B71C1381E27000D08723 /* iniconfig.cpp in Sources */, - DF46B71D1381E27000D08723 /* init_v7.cpp in Sources */, - DF46B71E1381E27000D08723 /* inter_inca2.cpp in Sources */, - DF46B7441381E40500D08723 /* log.cpp in Sources */, - DF46B7491381E40F00D08723 /* modular-backend.cpp in Sources */, - DF46B7541381E46700D08723 /* player_v2base.cpp in Sources */, - DF46B75E1381E4A400D08723 /* console.cpp in Sources */, - DF46B7631381E4D400D08723 /* robot_decoder.cpp in Sources */, - DF46B7671381E4E400D08723 /* vm_types.cpp in Sources */, - DF46B77B1381E54200D08723 /* dcl.cpp in Sources */, - DF46B77C1381E54200D08723 /* iff_container.cpp in Sources */, - DF46B77D1381E54200D08723 /* winexe_ne.cpp in Sources */, - DF46B77E1381E54200D08723 /* winexe_pe.cpp in Sources */, - DF46B77F1381E54200D08723 /* winexe.cpp in Sources */, - DF46B7931381E58000D08723 /* png.cpp in Sources */, - DF46B7941381E58000D08723 /* wincursor.cpp in Sources */, - DF46B79F1381E5B500D08723 /* winfont.cpp in Sources */, - DF46B7A51381E5D900D08723 /* sdl-timer.cpp in Sources */, - DF46B7A91381E5F100D08723 /* header.cpp in Sources */, - DF46B7B41381E67800D08723 /* sdl-mutex.cpp in Sources */, - DF46B7BD1381E6C000D08723 /* object.cpp in Sources */, - DF46B7C81381E72500D08723 /* console.cpp in Sources */, - DF46B7CF1381E76300D08723 /* sdl-events.cpp in Sources */, - DF46B7D61381E7C600D08723 /* console.cpp in Sources */, - DF46B83C1381F13500D08723 /* saveload_v7.cpp in Sources */, - DF46B8441381F35500D08723 /* saveload_inca2.cpp in Sources */, - DF46B8481381F38700D08723 /* inter_v7.cpp in Sources */, - DF46B84D1381F39E00D08723 /* console.cpp in Sources */, - DF46B8521381F3B400D08723 /* console.cpp in Sources */, - DF46B8601381F44E00D08723 /* dbopl.cpp in Sources */, - DF46B8611381F44E00D08723 /* dosbox.cpp in Sources */, - DF46B8621381F44E00D08723 /* mame.cpp in Sources */, - DF46B8711381F4A200D08723 /* sdl-audiocd.cpp in Sources */, - DF46B87D1381F4F200D08723 /* default-audiocd.cpp in Sources */, - DF46B8891381F5D800D08723 /* sdl-provider.cpp in Sources */, - DF46B8921381F62B00D08723 /* adpcm.cpp in Sources */, - DF46B89B1381F6C400D08723 /* null.cpp in Sources */, - DFADEBB313820DF500C46364 /* maccursor.cpp in Sources */, - DFADEBB713820E0C00C46364 /* posix-fs.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -10408,14 +9836,41 @@ DFF9593E0FB22D5700A3EC78 /* console.cpp in Sources */, DFF9593F0FB22D5700A3EC78 /* debugger.cpp in Sources */, DFF959400FB22D5700A3EC78 /* dialog.cpp in Sources */, + DFF959410FB22D5700A3EC78 /* editable.cpp in Sources */, + DFF959420FB22D5700A3EC78 /* EditTextWidget.cpp in Sources */, DFF959430FB22D5700A3EC78 /* Key.cpp in Sources */, DFF959440FB22D5700A3EC78 /* launcher.cpp in Sources */, + DFF959450FB22D5700A3EC78 /* ListWidget.cpp in Sources */, DFF959460FB22D5700A3EC78 /* massadd.cpp in Sources */, DFF959470FB22D5700A3EC78 /* message.cpp in Sources */, DFF959480FB22D5700A3EC78 /* object.cpp in Sources */, DFF959490FB22D5700A3EC78 /* options.cpp in Sources */, + DFF9594A0FB22D5700A3EC78 /* PopUpWidget.cpp in Sources */, + DFF9594B0FB22D5700A3EC78 /* ScrollBarWidget.cpp in Sources */, + DFF9594C0FB22D5700A3EC78 /* TabWidget.cpp in Sources */, DFF9594D0FB22D5700A3EC78 /* themebrowser.cpp in Sources */, DFF9594E0FB22D5700A3EC78 /* widget.cpp in Sources */, + DFF959510FB22D5700A3EC78 /* audiocd.cpp in Sources */, + DFF959520FB22D5700A3EC78 /* audiostream.cpp in Sources */, + DFF959540FB22D5700A3EC78 /* fmopl.cpp in Sources */, + DFF959560FB22D5700A3EC78 /* mididrv.cpp in Sources */, + DFF959570FB22D5700A3EC78 /* midiparser.cpp in Sources */, + DFF959580FB22D5700A3EC78 /* midiparser_smf.cpp in Sources */, + DFF959590FB22D5700A3EC78 /* midiparser_xmidi.cpp in Sources */, + DFF9595A0FB22D5700A3EC78 /* mixer.cpp in Sources */, + DFF9595B0FB22D5700A3EC78 /* infogrames.cpp in Sources */, + DFF9595C0FB22D5700A3EC78 /* module.cpp in Sources */, + DFF9595D0FB22D5700A3EC78 /* paula.cpp in Sources */, + DFF9595E0FB22D5700A3EC78 /* protracker.cpp in Sources */, + DFF9595F0FB22D5700A3EC78 /* rjp1.cpp in Sources */, + DFF959600FB22D5700A3EC78 /* soundfx.cpp in Sources */, + DFF959620FB22D5700A3EC78 /* mpu401.cpp in Sources */, + DFF959630FB22D5700A3EC78 /* null.cpp in Sources */, + DFF959640FB22D5700A3EC78 /* rate.cpp in Sources */, + DFF959650FB22D5700A3EC78 /* adlib.cpp in Sources */, + DFF959660FB22D5700A3EC78 /* fluidsynth.cpp in Sources */, + DFF959670FB22D5700A3EC78 /* pcspk.cpp in Sources */, + DFF959680FB22D5700A3EC78 /* ym2612.cpp in Sources */, DFF9596C0FB22D5700A3EC78 /* memorypool.cpp in Sources */, DFF9596D0FB22D5700A3EC78 /* seq.cpp in Sources */, DFF9596E0FB22D5700A3EC78 /* scaler.cpp in Sources */, @@ -11046,6 +10501,7 @@ DFF95C0F0FB22D5700A3EC78 /* archive.cpp in Sources */, DFF95C100FB22D5700A3EC78 /* unarj.cpp in Sources */, DFF95C110FB22D5700A3EC78 /* stdiostream.cpp in Sources */, + DFF95C120FB22D5700A3EC78 /* musicplugin.cpp in Sources */, DFF95C130FB22D5700A3EC78 /* saveload.cpp in Sources */, DFF95C140FB22D5700A3EC78 /* ThemeEngine.cpp in Sources */, DFF95C150FB22D5700A3EC78 /* ThemeEval.cpp in Sources */, @@ -11062,6 +10518,7 @@ DFF95C200FB22D5700A3EC78 /* thumbnail_intern.cpp in Sources */, DFF95C210FB22D5700A3EC78 /* dither.cpp in Sources */, DFF95C270FB22D5700A3EC78 /* debug.cpp in Sources */, + DFF95C280FB22D5700A3EC78 /* gui-manager.hcpp in Sources */, DFF95C290FB22D5700A3EC78 /* posix-saves.cpp in Sources */, DFF95C2A0FB22D5700A3EC78 /* bmv.cpp in Sources */, DFF95C2B0FB22D5700A3EC78 /* dialogs.cpp in Sources */, @@ -11133,6 +10590,7 @@ DFF95C920FB22D5700A3EC78 /* timer_lol.cpp in Sources */, DFF95C940FB22D5700A3EC78 /* sprites_lol.cpp in Sources */, DFF95C950FB22D5700A3EC78 /* script.cpp in Sources */, + DFF95C980FB22D5700A3EC78 /* timestamp.cpp in Sources */, DFF95C990FB22D5700A3EC78 /* pn.cpp in Sources */, DFF95C9A0FB22D5700A3EC78 /* script_pn.cpp in Sources */, DFF95C9B0FB22D5700A3EC78 /* vga_pn.cpp in Sources */, @@ -11147,15 +10605,20 @@ DFF95CB30FB22D5700A3EC78 /* inter_fascin.cpp in Sources */, DFF95CB40FB22D5700A3EC78 /* script_v3.cpp in Sources */, DFF95CB50FB22D5700A3EC78 /* script_v4.cpp in Sources */, + DFF95CB70FB22D5700A3EC78 /* dosbox.cpp in Sources */, DF6118400FE3A8080042AD3F /* kmisc.cpp in Sources */, DF6118410FE3A8080042AD3F /* segment.cpp in Sources */, DF61184F0FE3A8250042AD3F /* decompressor.cpp in Sources */, DF6118500FE3A8250042AD3F /* resource.cpp in Sources */, DF6118570FE3A8990042AD3F /* disk.cpp in Sources */, + DF6118720FE3A9410042AD3F /* dxa_decoder.cpp in Sources */, + DF6118730FE3A9410042AD3F /* flic_decoder.cpp in Sources */, + DF6118740FE3A9410042AD3F /* smk_decoder.cpp in Sources */, DF6118A10FE3A9AA0042AD3F /* saveconverter.cpp in Sources */, DF6118A20FE3A9AA0042AD3F /* saveconverter_v2.cpp in Sources */, DF6118A30FE3A9AA0042AD3F /* saveconverter_v3.cpp in Sources */, DF6118A40FE3A9AA0042AD3F /* saveconverter_v4.cpp in Sources */, + DF6118A50FE3A9AA0042AD3F /* saveconverter_v6.cpp in Sources */, DF6118A60FE3A9AA0042AD3F /* savefile.cpp in Sources */, DF6118A70FE3A9AA0042AD3F /* savehandler.cpp in Sources */, DF6118A80FE3A9AA0042AD3F /* saveload.cpp in Sources */, @@ -11169,6 +10632,7 @@ DF6118C20FE3AA280042AD3F /* sound_pcspk.cpp in Sources */, DF6118C30FE3AA280042AD3F /* text_lol.cpp in Sources */, DF6118C90FE3AABD0042AD3F /* player_v2cms.cpp in Sources */, + DF6118D20FE3AB560042AD3F /* mame.cpp in Sources */, DF7585D4100CB66E00CC3324 /* expression.cpp in Sources */, DF7585D5100CB66E00CC3324 /* hotspots.cpp in Sources */, DF7585D6100CB66E00CC3324 /* init_v6.cpp in Sources */, @@ -11193,15 +10657,31 @@ DF6BF4F310529EE40069811F /* player_v4a.cpp in Sources */, DF6BF4FC10529F140069811F /* EventDispatcher.cpp in Sources */, DF6BF4FD10529F140069811F /* EventRecorder.cpp in Sources */, + DF6BF50610529F540069811F /* maxtrax.cpp in Sources */, + DF6BF50710529F540069811F /* tfmx.cpp in Sources */, DF90E9C110AEDA9B00C8F93F /* selector.cpp in Sources */, DF90EAA510B0234300C8F93F /* draw_playtoons.cpp in Sources */, DF90EAAE10B0236F00C8F93F /* staticres.cpp in Sources */, + DF90EAB910B023D100C8F93F /* avi_decoder.cpp in Sources */, + DF90EAC410B023F400C8F93F /* msvideo1.cpp in Sources */, DF2EC3FA10E64C0C00765801 /* dialogs.cpp in Sources */, DF2EC40010E64C4300765801 /* animator_tim.cpp in Sources */, DF2EC40710E64C8000765801 /* event.cpp in Sources */, DF2EC50510E64D7C00765801 /* player_pce.cpp in Sources */, DF2EC50610E64D7C00765801 /* player_sid.cpp in Sources */, DF2EC50D10E64DB300765801 /* textconsole.cpp in Sources */, + DF2EC51410E64E3100765801 /* sid.cpp in Sources */, + DF2EC51A10E64EE600765801 /* wave6581.cpp in Sources */, + DF45B15B116627DA009B85CC /* adpcm.cpp in Sources */, + DF45B15D116627DA009B85CC /* aiff.cpp in Sources */, + DF45B15F116627DA009B85CC /* flac.cpp in Sources */, + DF45B161116627DA009B85CC /* iff_sound.cpp in Sources */, + DF45B163116627DA009B85CC /* mp3.cpp in Sources */, + DF45B165116627DA009B85CC /* raw.cpp in Sources */, + DF45B167116627DA009B85CC /* vag.cpp in Sources */, + DF45B169116627DA009B85CC /* voc.cpp in Sources */, + DF45B16B116627DA009B85CC /* vorbis.cpp in Sources */, + DF45B16D116627DA009B85CC /* wave.cpp in Sources */, DF45B21E116628A5009B85CC /* animate.cpp in Sources */, DF45B21F116628A5009B85CC /* cache.cpp in Sources */, DF45B220116628A5009B85CC /* compare.cpp in Sources */, @@ -11235,19 +10715,24 @@ DFCDC6DD116629CE00A7D2A0 /* features.cpp in Sources */, DFCDC6DE116629CE00A7D2A0 /* kparse.cpp in Sources */, DFCDC6F911662AAB00A7D2A0 /* resource.cpp in Sources */, + DFCDC70011662AD700A7D2A0 /* msrle.cpp in Sources */, DFCDC70611662B0200A7D2A0 /* saveload_fascin.cpp in Sources */, DFCDC70D11662B6B00A7D2A0 /* macresman.cpp in Sources */, DFEC5D101166C5CF00C90552 /* random.cpp in Sources */, DFEC5D111166C5CF00C90552 /* tokenizer.cpp in Sources */, DFEC5D361166C67300C90552 /* savestate.cpp in Sources */, + DFEC5D3F1166C6B400C90552 /* dbopl.cpp in Sources */, DF9B9248118E46730069C19D /* error.cpp in Sources */, DF9B9252118E46A00069C19D /* fontsjis.cpp in Sources */, DF9B9262118E46FE0069C19D /* error.cpp in Sources */, + DFB0576911B753AF0015AE65 /* qt_decoder.cpp in Sources */, + DFB0576A11B753AF0015AE65 /* video_decoder.cpp in Sources */, DFB0577611B753DA0015AE65 /* rational.cpp in Sources */, DFB0578011B7541F0015AE65 /* resource_audio.cpp in Sources */, DFB0578111B7541F0015AE65 /* util.cpp in Sources */, DFB0578A11B754570015AE65 /* maciconbar.cpp in Sources */, DFB0579111B7547D0015AE65 /* pict.cpp in Sources */, + DFB0579811B7549C0015AE65 /* cinepak.cpp in Sources */, DF7F286111FF23D500159131 /* amigamac.cpp in Sources */, DF7F286711FF23EF00159131 /* kvideo.cpp in Sources */, DF7F286811FF23EF00159131 /* workarounds.cpp in Sources */, @@ -11258,11 +10743,25 @@ DF7F287E11FF243B00159131 /* sound_sarien.cpp in Sources */, DF7F288B11FF244F00159131 /* Tooltip.cpp in Sources */, DF7F289311FF247300159131 /* translation.cpp in Sources */, + DF7F28A011FF24B000159131 /* mac_snd.cpp in Sources */, DF7F28A511FF24C400159131 /* console.cpp in Sources */, + DF895C00124C24350077F6E8 /* coktel_decoder.cpp in Sources */, DF895C05124C24680077F6E8 /* player_towns.cpp in Sources */, + DF895C0B124C24B60077F6E8 /* appleiigs.cpp in Sources */, + DF895C1D124C24C10077F6E8 /* towns_audio.cpp in Sources */, + DF895C1E124C24C10077F6E8 /* towns_euphony.cpp in Sources */, + DF895C1F124C24C10077F6E8 /* towns_pc98_driver.cpp in Sources */, + DF895C20124C24C10077F6E8 /* towns_pc98_fmsynth.cpp in Sources */, DF895C27124C25150077F6E8 /* init_fascin.cpp in Sources */, DF895C2C124C25350077F6E8 /* script_patches.cpp in Sources */, + DF895CC4124E58990077F6E8 /* indeo3.cpp in Sources */, + DF895CC5124E58990077F6E8 /* mjpeg.cpp in Sources */, + DF895CC6124E58990077F6E8 /* qdm2.cpp in Sources */, + DF895CC7124E58990077F6E8 /* qtrle.cpp in Sources */, + DF895CC8124E58990077F6E8 /* rpza.cpp in Sources */, + DF895CC9124E58990077F6E8 /* smc.cpp in Sources */, DF0E303A1252C5BD0082D593 /* cms.cpp in Sources */, + DF0E30411252C6090082D593 /* cms.cpp in Sources */, 8CB5A9C11253FD6900CB6BC7 /* m4_scene.cpp in Sources */, 8CB5A9C21253FD6900CB6BC7 /* mads_logic.cpp in Sources */, 8CB5A9C31253FD6900CB6BC7 /* mads_player.cpp in Sources */, @@ -11270,6 +10769,7 @@ 8CB5A9C51253FD6900CB6BC7 /* mads_views.cpp in Sources */, 8CD1ED0B126202AB00FA198C /* detection.cpp in Sources */, 8CD1ED0C126202AB00FA198C /* display.cpp in Sources */, + 8CD1ED0D126202AB00FA198C /* engine.cpp in Sources */, 8CD1ED0E126202AB00FA198C /* file.cpp in Sources */, 8CD1ED0F126202AB00FA198C /* hugo.cpp in Sources */, 8CD1ED10126202AB00FA198C /* intro.cpp in Sources */, @@ -11318,134 +10818,6 @@ 8CD80CEF126272A0001C6C87 /* surface.cpp in Sources */, 8CD80CF0126272A0001C6C87 /* surface_list.cpp in Sources */, 8CD80CF1126272A0001C6C87 /* teenagent.cpp in Sources */, - DF203F491380C06E0056300A /* gui-manager.cpp in Sources */, - DF203F731380C2750056300A /* avi_decoder.cpp in Sources */, - DF203F741380C2750056300A /* coktel_decoder.cpp in Sources */, - DF203F751380C2750056300A /* dxa_decoder.cpp in Sources */, - DF203F761380C2750056300A /* flic_decoder.cpp in Sources */, - DF203F781380C2750056300A /* qt_decoder.cpp in Sources */, - DF203F791380C2750056300A /* smk_decoder.cpp in Sources */, - DF203F7A1380C2750056300A /* video_decoder.cpp in Sources */, - DF203FAB1380C2920056300A /* cdtoons.cpp in Sources */, - DF203FAC1380C2920056300A /* cinepak.cpp in Sources */, - DF203FAD1380C2920056300A /* indeo3.cpp in Sources */, - DF203FAE1380C2920056300A /* mjpeg.cpp in Sources */, - DF203FAF1380C2920056300A /* msrle.cpp in Sources */, - DF203FB01380C2920056300A /* msvideo1.cpp in Sources */, - DF203FB11380C2920056300A /* qdm2.cpp in Sources */, - DF203FB21380C2920056300A /* qtrle.cpp in Sources */, - DF203FB31380C2920056300A /* rpza.cpp in Sources */, - DF203FB41380C2920056300A /* smc.cpp in Sources */, - DF203FB51380C2920056300A /* truemotion1.cpp in Sources */, - DF203FF71380C3BC0056300A /* console.cpp in Sources */, - DF203FF81380C3BC0056300A /* dialogs.cpp in Sources */, - DF203FF91380C3BC0056300A /* file_v1d.cpp in Sources */, - DF203FFA1380C3BC0056300A /* file_v1w.cpp in Sources */, - DF203FFB1380C3BC0056300A /* file_v2d.cpp in Sources */, - DF203FFC1380C3BC0056300A /* file_v2w.cpp in Sources */, - DF203FFD1380C3BC0056300A /* file_v3d.cpp in Sources */, - DF203FFE1380C3BC0056300A /* object_v1d.cpp in Sources */, - DF203FFF1380C3BC0056300A /* object_v1w.cpp in Sources */, - DF2040001380C3BC0056300A /* object_v2d.cpp in Sources */, - DF2040011380C3BC0056300A /* object_v3d.cpp in Sources */, - DF2040021380C3BC0056300A /* object.cpp in Sources */, - DF2040031380C3BC0056300A /* parser_v1d.cpp in Sources */, - DF2040041380C3BC0056300A /* parser_v1w.cpp in Sources */, - DF2040051380C3BC0056300A /* parser_v2d.cpp in Sources */, - DF2040061380C3BC0056300A /* parser_v3d.cpp in Sources */, - DF2040071380C3BC0056300A /* text.cpp in Sources */, - DF20403A1380C8B70056300A /* editable.cpp in Sources */, - DF20403B1380C8B70056300A /* edittext.cpp in Sources */, - DF20403C1380C8B70056300A /* list.cpp in Sources */, - DF20403D1380C8B70056300A /* popup.cpp in Sources */, - DF20403E1380C8B70056300A /* scrollbar.cpp in Sources */, - DF20403F1380C8B70056300A /* tab.cpp in Sources */, - DF2040761380CA230056300A /* audiostream.cpp in Sources */, - DF2040771380CA230056300A /* fmopl.cpp in Sources */, - DF2040781380CA230056300A /* mididrv.cpp in Sources */, - DF2040791380CA230056300A /* midiparser_smf.cpp in Sources */, - DF20407A1380CA230056300A /* midiparser_xmidi.cpp in Sources */, - DF20407B1380CA230056300A /* midiparser.cpp in Sources */, - DF20407C1380CA230056300A /* midiplayer.cpp in Sources */, - DF20407D1380CA230056300A /* mixer.cpp in Sources */, - DF20407E1380CA230056300A /* mpu401.cpp in Sources */, - DF20407F1380CA230056300A /* musicplugin.cpp in Sources */, - DF2040801380CA230056300A /* rate.cpp in Sources */, - DF2040811380CA230056300A /* timestamp.cpp in Sources */, - DF2040B01380CA400056300A /* adpcm.cpp in Sources */, - DF2040B11380CA400056300A /* aiff.cpp in Sources */, - DF2040B21380CA400056300A /* flac.cpp in Sources */, - DF2040B31380CA400056300A /* iff_sound.cpp in Sources */, - DF2040B41380CA400056300A /* mac_snd.cpp in Sources */, - DF2040B51380CA400056300A /* mp3.cpp in Sources */, - DF2040B61380CA400056300A /* raw.cpp in Sources */, - DF2040B71380CA400056300A /* vag.cpp in Sources */, - DF2040B81380CA400056300A /* voc.cpp in Sources */, - DF2040B91380CA400056300A /* vorbis.cpp in Sources */, - DF2040BA1380CA400056300A /* wave.cpp in Sources */, - DF2040DC1380CA810056300A /* infogrames.cpp in Sources */, - DF2040DD1380CA810056300A /* maxtrax.cpp in Sources */, - DF2040DE1380CA810056300A /* module.cpp in Sources */, - DF2040DF1380CA810056300A /* paula.cpp in Sources */, - DF2040E01380CA810056300A /* protracker.cpp in Sources */, - DF2040E11380CA810056300A /* rjp1.cpp in Sources */, - DF2040E21380CA810056300A /* soundfx.cpp in Sources */, - DF2040E31380CA810056300A /* tfmx.cpp in Sources */, - DF2041081380CAA40056300A /* adlib.cpp in Sources */, - DF2041091380CAA40056300A /* appleiigs.cpp in Sources */, - DF20410A1380CAA40056300A /* cms.cpp in Sources */, - DF20410B1380CAA40056300A /* eas.cpp in Sources */, - DF20410C1380CAA40056300A /* fluidsynth.cpp in Sources */, - DF20410D1380CAA40056300A /* mt32.cpp in Sources */, - DF20410E1380CAA40056300A /* pcspk.cpp in Sources */, - DF20410F1380CAA40056300A /* sid.cpp in Sources */, - DF2041101380CAA40056300A /* wave6581.cpp in Sources */, - DF2041111380CAA40056300A /* ym2612.cpp in Sources */, - DF46B6F51381E18900D08723 /* coroutine.cpp in Sources */, - DF46B7071381E1FF00D08723 /* towns_audio.cpp in Sources */, - DF46B7081381E1FF00D08723 /* towns_euphony.cpp in Sources */, - DF46B7091381E1FF00D08723 /* towns_pc98_driver.cpp in Sources */, - DF46B70A1381E1FF00D08723 /* towns_pc98_fmsynth.cpp in Sources */, - DF46B7251381E27000D08723 /* console.cpp in Sources */, - DF46B7261381E27000D08723 /* databases.cpp in Sources */, - DF46B7271381E27000D08723 /* dbase.cpp in Sources */, - DF46B7281381E27000D08723 /* iniconfig.cpp in Sources */, - DF46B7291381E27000D08723 /* init_v7.cpp in Sources */, - DF46B72A1381E27000D08723 /* inter_inca2.cpp in Sources */, - DF46B7461381E40500D08723 /* log.cpp in Sources */, - DF46B74B1381E40F00D08723 /* modular-backend.cpp in Sources */, - DF46B7561381E46700D08723 /* player_v2base.cpp in Sources */, - DF46B7601381E4A400D08723 /* console.cpp in Sources */, - DF46B7651381E4D400D08723 /* robot_decoder.cpp in Sources */, - DF46B7691381E4E400D08723 /* vm_types.cpp in Sources */, - DF46B7851381E54200D08723 /* dcl.cpp in Sources */, - DF46B7861381E54200D08723 /* iff_container.cpp in Sources */, - DF46B7871381E54200D08723 /* winexe_ne.cpp in Sources */, - DF46B7881381E54200D08723 /* winexe_pe.cpp in Sources */, - DF46B7891381E54200D08723 /* winexe.cpp in Sources */, - DF46B7971381E58000D08723 /* png.cpp in Sources */, - DF46B7981381E58000D08723 /* wincursor.cpp in Sources */, - DF46B7A11381E5B500D08723 /* winfont.cpp in Sources */, - DF46B7AB1381E5F100D08723 /* header.cpp in Sources */, - DF46B7B61381E67800D08723 /* sdl-mutex.cpp in Sources */, - DF46B7BF1381E6C000D08723 /* object.cpp in Sources */, - DF46B7CA1381E72500D08723 /* console.cpp in Sources */, - DF46B7D81381E7C600D08723 /* console.cpp in Sources */, - DF46B83E1381F13500D08723 /* saveload_v7.cpp in Sources */, - DF46B8461381F35500D08723 /* saveload_inca2.cpp in Sources */, - DF46B84A1381F38700D08723 /* inter_v7.cpp in Sources */, - DF46B84F1381F39E00D08723 /* console.cpp in Sources */, - DF46B8541381F3B400D08723 /* console.cpp in Sources */, - DF46B8661381F44E00D08723 /* dbopl.cpp in Sources */, - DF46B8671381F44E00D08723 /* dosbox.cpp in Sources */, - DF46B8681381F44E00D08723 /* mame.cpp in Sources */, - DF46B8731381F4A200D08723 /* sdl-audiocd.cpp in Sources */, - DF46B87F1381F4F200D08723 /* default-audiocd.cpp in Sources */, - DF46B88B1381F5D800D08723 /* sdl-provider.cpp in Sources */, - DF46B8941381F62B00D08723 /* adpcm.cpp in Sources */, - DF46B89D1381F6C400D08723 /* null.cpp in Sources */, - DFADEBB513820DF500C46364 /* maccursor.cpp in Sources */, - DFADEBB913820E0C00C46364 /* posix-fs.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -11471,43 +10843,6 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = ( - IPHONE_OFFICIAL, - IPHONE, - UNIX, - ENABLE_SCUMM, - ENABLE_SCUMM_7_8, - ENABLE_HE, - ENABLE_AGI, - ENABLE_AGOS, - ENABLE_CINE, - ENABLE_CRUISE, - ENABLE_DRASCULA, - ENABLE_GOB, - ENABLE_GROOVIE, - ENABLE_IGOR, - ENABLE_KYRA, - ENABLE_LURE, - ENABLE_MADE, - ENABLE_PARALLACTION, - ENABLE_QUEEN, - ENABLE_SAGA, - ENABLE_IHNM, - ENABLE_SCI, - ENABLE_SKY, - ENABLE_SWORD1, - ENABLE_SWORD2, - ENABLE_TEENAGENT, - ENABLE_TINSEL, - ENABLE_TOUCHE, - ENABLE_TUCKER, - USE_FLAC, - USE_MAD, - USE_TREMOR, - USE_VORBIS, - USE_ZLIB, - USE_TREMOR, - ); GCC_THUMB_SUPPORT = NO; GCC_UNROLL_LOOPS = YES; HEADER_SEARCH_PATHS = ( @@ -11516,7 +10851,6 @@ include/, ); INFOPLIST_FILE = Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 3.0; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/lib\"", @@ -11524,11 +10858,10 @@ ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; PRODUCT_NAME = ScummVM; - PROVISIONING_PROFILE = ""; + PROVISIONING_PROFILE = "EF590570-5FAC-4346-9071-D609DE2B28D8"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; - SDKROOT = iphoneos4.2; + SDKROOT = iphoneos4.0; TARGETED_DEVICE_FAMILY = "1,2"; - VALID_ARCHS = "armv6 armv7"; }; name = Debug; }; @@ -11550,10 +10883,49 @@ GCC_OPTIMIZATION_LEVEL = 3; GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; + GCC_THUMB_SUPPORT = NO; + GCC_UNROLL_LOOPS = YES; + HEADER_SEARCH_PATHS = ( + ../../engines/, + ../../, + include/, + ); + INFOPLIST_FILE = Info.plist; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/lib\"", + ); + ONLY_ACTIVE_ARCH = YES; + PREBINDING = NO; + PRODUCT_NAME = ScummVM; + PROVISIONING_PROFILE = "EF590570-5FAC-4346-9071-D609DE2B28D8"; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; + SDKROOT = iphoneos3.2; + TARGETED_DEVICE_FAMILY = "1,2"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_ENABLE_CPP_EXCEPTIONS = NO; + GCC_ENABLE_CPP_RTTI = NO; + GCC_INPUT_FILETYPE = automatic; + GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( + CONFIG_H, IPHONE_OFFICIAL, IPHONE, - UNIX, + POSIX, + SCUMM_LITTLE_ENDIAN, + SCUMM_NEED_ALIGNMENT, ENABLE_SCUMM, ENABLE_SCUMM_7_8, ENABLE_HE, @@ -11585,48 +10957,8 @@ USE_TREMOR, USE_VORBIS, USE_ZLIB, - USE_TREMOR, ); GCC_THUMB_SUPPORT = NO; - GCC_UNROLL_LOOPS = YES; - HEADER_SEARCH_PATHS = ( - ../../engines/, - ../../, - include/, - ); - INFOPLIST_FILE = Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 3.0; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/lib\"", - ); - ONLY_ACTIVE_ARCH = YES; - PREBINDING = NO; - PRODUCT_NAME = ScummVM; - PROVISIONING_PROFILE = ""; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; - SDKROOT = iphoneos4.2; - TARGETED_DEVICE_FAMILY = "1,2"; - VALID_ARCHS = "armv6 armv7"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(NATIVE_ARCH_ACTUAL)"; - CODE_SIGN_IDENTITY = "Don't Code Sign"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Don't Code Sign"; - FRAMEWORK_SEARCH_PATHS = ""; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_CPP_RTTI = NO; - GCC_INPUT_FILETYPE = automatic; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_THUMB_SUPPORT = NO; GCC_USE_GCC3_PFE_SUPPORT = NO; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; @@ -11634,15 +10966,16 @@ ../../engines/, ../../, ); - IPHONEOS_DEPLOYMENT_TARGET = 3.0; LIBRARY_SEARCH_PATHS = ""; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ""; OTHER_LDFLAGS = "-lz"; PREBINDING = NO; - SDKROOT = ""; + PROVISIONING_PROFILE = ""; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; + SDKROOT = iphoneos4.0; TARGETED_DEVICE_FAMILY = "1,2"; - VALID_ARCHS = "i386 ppc ppc64 x86_64 armv6 armv7"; + VALID_ARCHS = "i386 ppc ppc64 ppc7400 ppc970 x86_64 armv6 armv7"; }; name = Debug; }; @@ -11650,39 +10983,91 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(NATIVE_ARCH_ACTUAL)"; - CODE_SIGN_IDENTITY = "Don't Code Sign"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Don't Code Sign"; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; FRAMEWORK_SEARCH_PATHS = ""; GCC_C_LANGUAGE_STANDARD = c99; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_ENABLE_EXCEPTIONS = NO; GCC_INPUT_FILETYPE = automatic; - GCC_PREPROCESSOR_DEFINITIONS = ""; + GCC_PREPROCESSOR_DEFINITIONS = ( + CONFIG_H, + IPHONE_OFFICIAL, + IPHONE, + POSIX, + SCUMM_LITTLE_ENDIAN, + SCUMM_NEED_ALIGNMENT, + ENABLE_SCUMM, + ENABLE_SCUMM_7_8, + ENABLE_HE, + ENABLE_AGI, + ENABLE_AGOS, + ENABLE_CINE, + ENABLE_CRUISE, + ENABLE_DRASCULA, + ENABLE_GOB, + ENABLE_GROOVIE, + ENABLE_IGOR, + ENABLE_KYRA, + ENABLE_LURE, + ENABLE_MADE, + ENABLE_PARALLACTION, + ENABLE_QUEEN, + ENABLE_SAGA, + ENABLE_IHNM, + ENABLE_SCI, + ENABLE_SKY, + ENABLE_SWORD1, + ENABLE_SWORD2, + ENABLE_TEENAGENT, + ENABLE_TINSEL, + ENABLE_TOUCHE, + ENABLE_TUCKER, + USE_FLAC, + USE_MAD, + USE_TREMOR, + USE_VORBIS, + USE_ZLIB, + ); GCC_THUMB_SUPPORT = NO; GCC_USE_GCC3_PFE_SUPPORT = NO; GCC_WARN_ABOUT_RETURN_TYPE = YES; HEADER_SEARCH_PATHS = ( + /opt/local/include/SDL, + /opt/local/include, + /sw/include/SDL, + /sw/include, ../../engines/, ../../, ); - IPHONEOS_DEPLOYMENT_TARGET = 3.0; LIBRARY_SEARCH_PATHS = ""; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; + OTHER_LDFLAGS = ( + "-lSDLmain", + "-logg", + "-lvorbisfile", + "-lvorbis", + "-lmad", + "-lFLAC", + "-lSDL", + "-lz", + ); PREBINDING = NO; - SDKROOT = ""; + PROVISIONING_PROFILE = ""; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; + SDKROOT = iphonesimulator3.2; TARGETED_DEVICE_FAMILY = "1,2"; - VALID_ARCHS = "i386 ppc ppc64 x86_64 armv6 armv7"; + VALID_ARCHS = "i386 ppc ppc64 ppc7400 ppc970 x86_64 armv6 armv7"; }; name = Release; }; DF0942280F63CB26002D821E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; COMPRESS_PNG_FILES = NO; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -11693,9 +11078,12 @@ GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; GCC_PREPROCESSOR_DEFINITIONS = ( + CONFIG_H, MACOSX, SDL_BACKEND, - UNIX, + POSIX, + SCUMM_LITTLE_ENDIAN, + SCUMM_NEED_ALIGNMENT, ENABLE_SCUMM, ENABLE_SCUMM_7_8, ENABLE_HE, @@ -11724,7 +11112,7 @@ ENABLE_TUCKER, USE_FLAC, USE_MAD, - USE_MPEG2, + USE_TREMOR, USE_VORBIS, USE_ZLIB, ); @@ -11734,6 +11122,7 @@ /opt/local/include, /sw/include/SDL, /sw/include, + include/, ../../engines/, ../../, ); @@ -11743,8 +11132,7 @@ /opt/local/lib, "$(inherited)", ); - MACOSX_DEPLOYMENT_TARGET = 10.4; - ONLY_ACTIVE_ARCH = YES; + ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ""; OTHER_LDFLAGS = ( "-lSDLmain", @@ -11758,15 +11146,15 @@ ); PREBINDING = NO; PRODUCT_NAME = ScummVM; - SDKROOT = macosx10.5; - VALID_ARCHS = "i386 ppc ppc64 x86_64"; + SDKROOT = macosx10.6; + VALID_ARCHS = "i386 ppc ppc64 ppc7400 ppc970 x86_64"; }; name = Debug; }; DF0942290F63CB26002D821E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; COMPRESS_PNG_FILES = NO; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -11775,9 +11163,12 @@ GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; GCC_PREPROCESSOR_DEFINITIONS = ( + CONFIG_H, MACOSX, SDL_BACKEND, - UNIX, + POSIX, + SCUMM_LITTLE_ENDIAN, + SCUMM_NEED_ALIGNMENT, ENABLE_SCUMM, ENABLE_SCUMM_7_8, ENABLE_HE, @@ -11806,7 +11197,7 @@ ENABLE_TUCKER, USE_FLAC, USE_MAD, - USE_MPEG2, + USE_TREMOR, USE_VORBIS, USE_ZLIB, ); @@ -11825,8 +11216,7 @@ /opt/local/lib, "$(inherited)", ); - MACOSX_DEPLOYMENT_TARGET = 10.4; - ONLY_ACTIVE_ARCH = YES; + ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ""; OTHER_LDFLAGS = ( "-lSDLmain", @@ -11840,8 +11230,8 @@ ); PREBINDING = NO; PRODUCT_NAME = ScummVM; - SDKROOT = macosx10.5; - VALID_ARCHS = "i386 ppc ppc64 x86_64"; + SDKROOT = macosx10.6; + VALID_ARCHS = "i386 ppc ppc64 ppc7400 ppc970 x86_64"; WRAPPER_EXTENSION = app; }; name = Release; @@ -11849,7 +11239,6 @@ DFF95CC80FB22D5700A3EC78 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COMPRESS_PNG_FILES = NO; @@ -11878,7 +11267,6 @@ /opt/local/lib, "$(inherited)", ); - ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "-lSDLmain", "-logg", @@ -11893,15 +11281,13 @@ PRODUCT_NAME = ScummVM; PROVISIONING_PROFILE = "EF590570-5FAC-4346-9071-D609DE2B28D8"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; - SDKROOT = iphoneos; - VALID_ARCHS = "i386 x86_64"; + SDKROOT = iphonesimulator3.2; }; name = Debug; }; DFF95CC90FB22D5700A3EC78 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COMPRESS_PNG_FILES = NO; @@ -11929,7 +11315,6 @@ /opt/local/lib, "$(inherited)", ); - ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "-lSDLmain", "-logg", @@ -11944,8 +11329,7 @@ PRODUCT_NAME = ScummVM; PROVISIONING_PROFILE = "EF590570-5FAC-4346-9071-D609DE2B28D8"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; - SDKROOT = iphoneos; - VALID_ARCHS = "i386 x86_64"; + SDKROOT = iphonesimulator3.2; WRAPPER_EXTENSION = app; }; name = Release; diff --git a/dists/redhat/README b/dists/redhat/README index 9c1cccf6df..d1cef06632 100644 --- a/dists/redhat/README +++ b/dists/redhat/README @@ -8,9 +8,9 @@ adapt the below instructions where necessary. 1) Collect sources: -Place scummvm-%{version}.tar.bz2, libmad-0.15.1b.tar.bz2 and -mpeg2dec-0.4.0b.tar.bz2 in /usr/src/redhat/SOURCES . -If you have different versions of mpeg2dec or libmad, put the correct version +Place scummvm-%{version}.tar.bz2 and libmad-0.15.1b.tar.bz2 +in /usr/src/redhat/SOURCES . +If you have a different version of libmad, put the correct version numbers in the .spec file. Place scummvm.spec in /usr/src/redhat/SPECS . @@ -28,8 +28,7 @@ the source RPM in /usr/src/redhat/SRPMS -Note: libmad and mpeg2dec are statically linked into the scummvm binary -because Fedora does not carry libmad and mpeg2dec packages, so I did not +Note: libmad is statically linked into the scummvm binary +because Fedora does not carry a libmad package, so I did not want to make the scummvm package depend on them. -You can get libmad from http://www.underbit.com/products/mad/ -and mpeg2dec from http://libmpeg2.sourceforge.net/ . +You can get libmad from http://www.underbit.com/products/mad/ . diff --git a/dists/samsungtv/README-SamsungTV b/dists/samsungtv/README-SamsungTV new file mode 100644 index 0000000000..26ded6c7e6 --- /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/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index 6874806bc7..d093c958e7 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -196,12 +196,10 @@ static void updateGameDescriptor(GameDescriptor &desc, const ADGameDescription * desc["gameid"] = params.singleid; } - if (!(params.flags & kADFlagDontAugmentPreferredTarget)) { - if (!desc.contains("preferredtarget")) - desc["preferredtarget"] = desc["gameid"]; + if (!desc.contains("preferredtarget")) + desc["preferredtarget"] = desc["gameid"]; - desc["preferredtarget"] = generatePreferredTarget(desc["preferredtarget"], realDesc); - } + desc["preferredtarget"] = generatePreferredTarget(desc["preferredtarget"], realDesc); if (params.flags & kADFlagUseExtraAsHint) desc["extra"] = realDesc->extra; @@ -226,7 +224,7 @@ bool cleanupPirated(ADGameDescList &matched) { // We ruled out all variants and now have nothing if (matched.empty()) { - warning("Illegitimate copy of the game detected. We give no support in such cases %d", matched.size()); + warning("Illegitimate game copy detected. We give no support in such cases %d", matched.size()); return true; } diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index 6ee0822f47..408c46556d 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -101,11 +101,6 @@ struct ADFileBasedFallback { enum ADFlags { /** - * Generate/augment preferred target with information on the language (if - * not equal to english) and platform (if not equal to PC). - */ - kADFlagDontAugmentPreferredTarget = (1 << 0), - /** * Warn user about new variant if his version was detected with fallback */ kADFlagPrintWarningOnFileBasedFallback = (1 << 1), diff --git a/engines/agi/agi.h b/engines/agi/agi.h index a42148b1ef..0155caf11d 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -807,7 +807,7 @@ public: virtual ~AgiEngine(); Common::Error loadGameState(int slot); - Common::Error saveGameState(int slot, const char *desc); + Common::Error saveGameState(int slot, const Common::String &desc); private: uint32 _lastTick; diff --git a/engines/agi/checks.cpp b/engines/agi/checks.cpp index 8d03ae67b9..20276657ff 100644 --- a/engines/agi/checks.cpp +++ b/engines/agi/checks.cpp @@ -265,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/graphics.cpp b/engines/agi/graphics.cpp index 5ceccd9e27..eb162e4ab0 100644 --- a/engines/agi/graphics.cpp +++ b/engines/agi/graphics.cpp @@ -841,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/loader_v2.cpp b/engines/agi/loader_v2.cpp index f5f8830b43..a2ac6f0111 100644 --- a/engines/agi/loader_v2.cpp +++ b/engines/agi/loader_v2.cpp @@ -149,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/op_cmd.cpp b/engines/agi/op_cmd.cpp index fb4c079a4a..bde62fe2d9 100644 --- a/engines/agi/op_cmd.cpp +++ b/engines/agi/op_cmd.cpp @@ -672,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_test.cpp b/engines/agi/op_test.cpp index 13b2d25023..0660a614b6 100644 --- a/engines/agi/op_test.cpp +++ b/engines/agi/op_test.cpp @@ -167,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--) { @@ -316,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/saveload.cpp b/engines/agi/saveload.cpp index deda186439..dae3dd42c1 100644 --- a/engines/agi/saveload.cpp +++ b/engines/agi/saveload.cpp @@ -551,11 +551,8 @@ int AgiEngine::loadGame(const char *fileName, bool checkId) { #define NUM_VISIBLE_SLOTS 12 const char *AgiEngine::getSavegameFilename(int num) { - static Common::String saveLoadSlot; - char extension[5]; - snprintf(extension, sizeof(extension), ".%.3d", num); - - saveLoadSlot = _targetName + extension; + Common::String saveLoadSlot = _targetName; + saveLoadSlot += Common::String::format(".%.3d", num); return saveLoadSlot.c_str(); } @@ -987,14 +984,12 @@ void AgiEngine::releaseImageStack() { void AgiEngine::checkQuickLoad() { if (ConfMan.hasKey("save_slot")) { - char saveNameBuffer[256]; - - snprintf(saveNameBuffer, 256, "%s.%03d", _targetName.c_str(), ConfMan.getInt("save_slot")); + Common::String saveNameBuffer = Common::String::format("%s.%03d", _targetName.c_str(), ConfMan.getInt("save_slot")); _sprites->eraseBoth(); _sound->stopSound(); - if (loadGame(saveNameBuffer, false) == errOK) { // Do not check game id + if (loadGame(saveNameBuffer.c_str(), false) == errOK) { // Do not check game id _game.exitAllLogics = 1; _menu->enableAll(); } @@ -1017,10 +1012,10 @@ Common::Error AgiEngine::loadGameState(int slot) { } } -Common::Error AgiEngine::saveGameState(int slot, const char *desc) { +Common::Error AgiEngine::saveGameState(int slot, const Common::String &desc) { char saveLoadSlot[12]; sprintf(saveLoadSlot, "%s.%.3d", _targetName.c_str(), slot); - if (saveGame(saveLoadSlot, desc) == errOK) + if (saveGame(saveLoadSlot, desc.c_str()) == errOK) return Common::kNoError; else return Common::kUnknownError; diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp index 746d4e9070..aa338db0f2 100644 --- a/engines/agi/sound.cpp +++ b/engines/agi/sound.cpp @@ -99,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_2gs.cpp b/engines/agi/sound_2gs.cpp index 88feadd084..6d64c29de9 100644 --- a/engines/agi/sound_2gs.cpp +++ b/engines/agi/sound_2gs.cpp @@ -22,6 +22,7 @@ #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" @@ -33,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; @@ -81,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() { - 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"); - } else if (_vm->_game.sounds[_playingSound]->type() == AGI_SOUND_SAMPLE) { - //debugC(3, kDebugLevelSound, "playSound: Trying to play an Apple IIGS sample"); - playSampleSound(); - } - - if (!_playing) { - _vm->_sound->soundIsFinished(); - - _playingSound = -1; - } -} - -uint32 SoundGen2GS::mixSound() { - int i, b; - - memset(_sndBuffer, 0, BUFFER_SIZE << 1); +/** + * 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 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; - } + 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 (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; - } + } + 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; } - } - - 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; + if (outl > 32768) + outl = 32768; + if (outl < -32767) + outl = -32767; + if (outr > 32768) + outr = 32768; + if (outr < -32767) + outr = -32767; + + *p++ = outl; + *p++ = outr; } - memcpy((uint8 *)stream + p, (uint8*)_sndBuffer + data_offset, len); - data_offset += len; - data_available -= len; + return _outSize * 2; } -void SoundGen2GS::playSampleSound() { - if (_vm->_soundemu != SOUND_EMU_APPLE2GS) { - warning("Trying to play a sample but not using Apple IIGS sound emulation mode"); +void SoundGen2GS::advancePlayer() { + if (_playingSound == -1) 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) + if (_vm->_game.sounds[_playingSound]->type() == AGI_SOUND_MIDI) { + advanceMidiPlayer(); + } else if (_vm->_game.sounds[_playingSound]->type() == AGI_SOUND_SAMPLE) { + _playing = activeGenerators() > 0; + } - return true; + if (!_playing) { + _vm->_sound->soundIsFinished(); + _playingSound = -1; + } } -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; } @@ -295,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; } } @@ -332,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::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); } -const IIgsInstrumentHeader* SoundGen2GS::getInstrument(uint8 program) const { - return &_instruments[_midiProgToInst->map(program)]; -} +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; + } -void SoundGen2GS::setProgramChangeMapping(const MidiProgramChangeMapping *mapping) { - _midiProgToInst = mapping; + // 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..."); +} + +double SoundGen2GS::midiKeyToFreq(int key, double finetune) { + return 440.0 * pow(2.0, (15.0 + (double)key + finetune) / 12.0); +} + +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::removeStoppedSounds() { - for (Common::Array<IIgsMidiChannel>::iterator iter = _midiChannels.begin(); iter != _midiChannels.end(); ++iter) - iter->removeStoppedSounds(); +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; } -uint SoundGen2GS::activeSounds() const { - uint result = 0; - - for (Common::Array<IIgsMidiChannel>::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 @@ -419,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()); } @@ -446,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(); +bool IIgsInstrumentHeader::read(Common::SeekableReadStream &stream, bool ignoreAddr) { + 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; + } - // Zero the wave address if we want to ignore the wave address info - if (ignoreAddr) - addr = 0; + // 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 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; - } +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; } - 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 -} - -bool IIgsInstrumentHeader::finalize(Common::SeekableReadStream &uint8Wave) { - return oscList.finalize(uint8Wave); -} - 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); -} - -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; +bool IIgsSampleHeader::finalize(int8 *sample) { + return instrument.finalize(sample); } -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<const Common::FSNode&, bool> { -// 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()); - 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"); + // 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"); - // 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()); + if (exeNames.empty()) { + warning("Couldn't find Apple IIGS game executable (*.SYS16 or *.SYS), not loading instruments"); 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()); + if (waveNames.empty()) { + warning("Couldn't find Apple IIGS wave file (SIERRASTANDARD or SIERRAST), not loading instruments"); 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, @@ -778,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, @@ -788,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 }; @@ -826,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 @@ -842,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 md5sum - data->seek(exeInfo.instSetStart); + // 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()); + } - 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()); - } + // 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); + // Read in the instrument set one instrument at a time + data->seek(exeInfo.instSetStart); - // Load the instruments - _instruments.clear(); - _instruments.reserve(exeInfo.instSet->instCount); + _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 + 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); + } - // 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 @@ -894,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" \ + 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); - } - - 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()); - return false; } + + // 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 d9c7b8d2f1..1a225300ae 100644 --- a/engines/agi/sound_2gs.h +++ b/engines/agi/sound_2gs.h @@ -28,45 +28,30 @@ namespace Agi { -#define BUFFER_SIZE 410 - -// 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 - -// 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 - -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 +// 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 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 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 + +#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 @@ -75,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) - - /** 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]; } +// 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 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. @@ -140,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 { @@ -159,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? - - 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? +class IIgsGenerator { +public: + IIgsGenerator() : ins(NULL), key(-1), chn(-1) {} + + 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 { @@ -195,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 { @@ -214,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 @@ -230,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<IIgsChannelInfo>::const_iterator const_iterator; - typedef Common::Array<IIgsChannelInfo>::iterator iterator; - Common::Array<IIgsChannelInfo> _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 { @@ -276,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<IIgsMidiChannel>::const_iterator const_iterator; - typedef Common::Array<IIgsMidiChannel>::iterator iterator; - static const uint kSfxMidiChannel = 0; ///< The MIDI channel used for playing sound effects - + // Loader methods bool loadInstruments(); - const IIgsExeInfo *getIIgsExeInfo(enum AgiGameID gameid) const; + bool loadInstrumentHeaders(Common::String &exePath, const IIgsExeInfo &exeInfo); + bool loadWaveFile(Common::String &wavePath, const IIgsExeInfo &exeInfo); - void setProgramChangeMapping(const MidiProgramChangeMapping *mapping); - bool loadInstrumentHeaders(const Common::FSNode &exePath, const IIgsExeInfo &exeInfo); - bool loadWaveFile(const Common::FSNode &wavePath, const IIgsExeInfo &exeInfo); - - // 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 - - // For playing Apple IIGS AGI samples (Sound effects etc) - bool playSampleSound(const IIgsSampleHeader &sampleHeader, const int8 *sample); - void playMidiSound(); - void playSampleSound(); - - // 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<IIgsMidiChannel> _midiChannels; ///< Information about each MIDI channel - //protected: - Common::Array<int8> _wave; ///< Sample data used by the Apple IIGS MIDI instruments - const MidiProgramChangeMapping *_midiProgToInst; ///< MIDI program change to instrument number mapping - Common::Array<IIgsInstrumentHeader> _instruments; ///< Instruments used by the Apple IIGS AGI + const IIgsExeInfo *getIIgsExeInfo(enum AgiGameID gameid) const; + void setProgramChangeMapping(const IIgsMidiProgramMapping *mapping); + + // Player methods + void advancePlayer(); ///< Advance the player + void advanceMidiPlayer(); ///< Advance MIDI player + uint generateOutput(); ///< Fill the output buffer + + void haltGenerators(); ///< Halt all generators + uint activeGenerators(); ///< How many generators are active? + + 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; } + + 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<IIgsInstrumentHeader> _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/agos/midi.cpp b/engines/agos/midi.cpp index 4459701d65..88f6dd80d1 100644 --- a/engines/agos/midi.cpp +++ b/engines/agos/midi.cpp @@ -150,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/saveload.cpp b/engines/agos/saveload.cpp index deab57d0e6..e6cce36b22 100644 --- a/engines/agos/saveload.cpp +++ b/engines/agos/saveload.cpp @@ -35,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/string_pn.cpp b/engines/agos/string_pn.cpp index 9656eb469e..570fbc6200 100644 --- a/engines/agos/string_pn.cpp +++ b/engines/agos/string_pn.cpp @@ -131,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/cine/cine.h b/engines/cine/cine.h index 371ea0dd1f..55376dce29 100644 --- a/engines/cine/cine.h +++ b/engines/cine/cine.h @@ -126,7 +126,7 @@ public: int modifyGameSpeed(int speedChange); int getTimerDelay() const; Common::Error loadGameState(int slot); - Common::Error saveGameState(int slot, const char *desc); + Common::Error saveGameState(int slot, const Common::String &desc); bool canLoadGameStateCurrently(); bool canSaveGameStateCurrently(); @@ -148,7 +148,7 @@ private: void resetEngine(); bool loadPlainSaveFW(Common::SeekableReadStream &in, CineSaveGameFormat saveGameFormat); bool loadTempSaveOS(Common::SeekableReadStream &in); - bool makeLoad(char *saveName); + bool makeLoad(const Common::String &saveName); void makeSaveFW(Common::OutSaveFile &out); void makeSaveOS(Common::OutSaveFile &out); void makeSave(char *saveFileName); diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp index 262798a34e..738366124c 100644 --- a/engines/cine/detection.cpp +++ b/engines/cine/detection.cpp @@ -90,7 +90,7 @@ public: CineMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Cinematique evo 1"; + return "Cine"; } virtual const char *getOriginalCopyright() const { @@ -185,10 +185,7 @@ void CineMetaEngine::removeSaveState(const char *target, int slot) const { memset(saveNames, 0, sizeof(saveNames)); Common::InSaveFile *in; - char tmp[80]; - - snprintf(tmp, 80, "%s.dir", target); - in = g_system->getSavefileManager()->openForLoading(tmp); + in = g_system->getSavefileManager()->openForLoading(Common::String::format("%s.dir", target)); if (!in) return; @@ -202,12 +199,10 @@ void CineMetaEngine::removeSaveState(const char *target, int slot) const { strncpy(saveNames[slot], slotName, 20); // Update savegame descriptions - char indexFile[80]; - snprintf(indexFile, 80, "%s.dir", target); - + Common::String indexFile = Common::String::format("%s.dir", target); Common::OutSaveFile *out = g_system->getSavefileManager()->openForSaving(indexFile); if (!out) { - warning("Unable to open file %s for saving", indexFile); + warning("Unable to open file %s for saving", indexFile.c_str()); return; } @@ -237,21 +232,20 @@ Common::Error CineEngine::loadGameState(int slot) { return gameLoaded ? Common::kNoError : Common::kUnknownError; } -Common::Error CineEngine::saveGameState(int slot, const char *desc) { +Common::Error CineEngine::saveGameState(int slot, const Common::String &desc) { // Load savegame descriptions from index file loadSaveDirectory(); // Set description for selected slot making sure it ends with a trailing zero - strncpy(currentSaveName[slot], desc, 20); + strncpy(currentSaveName[slot], desc.c_str(), 20); currentSaveName[slot][sizeof(CommandeType) - 1] = 0; // Update savegame descriptions - char indexFile[80]; - snprintf(indexFile, 80, "%s.dir", _targetName.c_str()); + Common::String indexFile = _targetName + ".dir"; Common::OutSaveFile *fHandle = _saveFileMan->openForSaving(indexFile); if (!fHandle) { - warning("Unable to open file %s for saving", indexFile); + warning("Unable to open file %s for saving", indexFile.c_str()); return Common::kUnknownError; } diff --git a/engines/cine/saveload.cpp b/engines/cine/saveload.cpp index 700875e302..0ea1a23e8f 100644 --- a/engines/cine/saveload.cpp +++ b/engines/cine/saveload.cpp @@ -460,10 +460,7 @@ void saveSeqList(Common::OutSaveFile &out) { bool CineEngine::loadSaveDirectory() { Common::InSaveFile *fHandle; - char tmp[80]; - - snprintf(tmp, 80, "%s.dir", _targetName.c_str()); - fHandle = _saveFileMan->openForLoading(tmp); + fHandle = _saveFileMan->openForLoading(Common::String::format("%s.dir", _targetName.c_str())); if (!fHandle) { return false; @@ -768,7 +765,7 @@ bool CineEngine::loadPlainSaveFW(Common::SeekableReadStream &in, CineSaveGameFor return !(in.eos() || in.err()); } -bool CineEngine::makeLoad(char *saveName) { +bool CineEngine::makeLoad(const Common::String &saveName) { Common::SharedPtr<Common::InSaveFile> saveFile(_saveFileMan->openForLoading(saveName)); if (!saveFile) { diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp index 1892a78cca..81e72d6905 100644 --- a/engines/cine/various.cpp +++ b/engines/cine/various.cpp @@ -440,13 +440,12 @@ void CineEngine::makeSystemMenu() { getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY); if (!makeMenuChoice(confirmMenu, 2, mouseX, mouseY + 8, 100)) { - char saveString[256], tmp[80]; - - snprintf(tmp, 80, "%s.dir", _targetName.c_str()); + char saveString[256]; + Common::String tmp = Common::String::format("%s.dir", _targetName.c_str()); Common::OutSaveFile *fHandle = _saveFileMan->openForSaving(tmp); if (!fHandle) { - warning("Unable to open file %s for saving", tmp); + warning("Unable to open file %s for saving", tmp.c_str()); break; } diff --git a/engines/cruise/cruise.cpp b/engines/cruise/cruise.cpp index 1e0b7b1d7a..cf01d9bdbc 100644 --- a/engines/cruise/cruise.cpp +++ b/engines/cruise/cruise.cpp @@ -92,7 +92,7 @@ Common::Error CruiseEngine::run() { mainLoop(); - deinitialise(); + deinitialize(); return Common::kNoError; } @@ -118,7 +118,7 @@ void CruiseEngine::initialize() { _vm->_polyStruct = NULL; } -void CruiseEngine::deinitialise() { +void CruiseEngine::deinitialize() { _vm->_polyStructNorm.clear(); _vm->_polyStructExp.clear(); @@ -209,7 +209,7 @@ bool CruiseEngine::canLoadGameStateCurrently() { return playerMenuEnabled != 0; } -Common::Error CruiseEngine::saveGameState(int slot, const char *desc) { +Common::Error CruiseEngine::saveGameState(int slot, const Common::String &desc) { return saveSavegameData(slot, desc); } diff --git a/engines/cruise/cruise.h b/engines/cruise/cruise.h index a9eb39c3f2..900f677975 100644 --- a/engines/cruise/cruise.h +++ b/engines/cruise/cruise.h @@ -69,9 +69,8 @@ private: bool _speedFlag; void initialize(); - void deinitialise(); + void deinitialize(); bool loadLanguageStrings(); - bool makeLoad(char *saveName); void mainLoop(); int processInput(); protected: @@ -100,7 +99,7 @@ public: static const char *getSavegameFile(int saveGameIdx); virtual Common::Error loadGameState(int slot); virtual bool canLoadGameStateCurrently(); - virtual Common::Error saveGameState(int slot, const char *desc); + virtual Common::Error saveGameState(int slot, const Common::String &desc); virtual bool canSaveGameStateCurrently(); virtual void syncSoundSettings(); diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp index 4aaaf03e29..3bd0c1f76f 100644 --- a/engines/cruise/detection.cpp +++ b/engines/cruise/detection.cpp @@ -247,7 +247,7 @@ public: CruiseMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Cinematique evo 2"; + return "CruisE"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/cruise/mainDraw.cpp b/engines/cruise/mainDraw.cpp index 336471b6ff..814d0aa9e9 100644 --- a/engines/cruise/mainDraw.cpp +++ b/engines/cruise/mainDraw.cpp @@ -211,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/menu.cpp b/engines/cruise/menu.cpp index 407858574c..e763e2b8a1 100644 --- a/engines/cruise/menu.cpp +++ b/engines/cruise/menu.cpp @@ -225,13 +225,10 @@ static void handleSaveLoad(bool saveFlag) { Common::String result(dialog->getResultString()); if (result.empty()) { // If the user was lazy and entered no save name, come up with a default name. - char buf[20]; - snprintf(buf, 20, "Save %d", slot + 1); - - _vm->saveGameState(slot, buf); - } else { - _vm->saveGameState(slot, result.c_str()); + result = Common::String::format("Save %d", slot + 1); } + + _vm->saveGameState(slot, result); } } diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp index 75b2ca9296..3fd8671e55 100644 --- a/engines/dialogs.cpp +++ b/engines/dialogs.cpp @@ -227,11 +227,11 @@ void MainMenuDialog::save() { Common::String result(_saveDialog->getResultString()); if (result.empty()) { // If the user was lazy and entered no save name, come up with a default name. - char buf[20]; - snprintf(buf, 20, "Save %d", slot + 1); + Common::String buf; + buf = Common::String::format("Save %d", slot + 1); _engine->saveGameState(slot, buf); } else { - _engine->saveGameState(slot, result.c_str()); + _engine->saveGameState(slot, result); } close(); diff --git a/engines/draci/detection.cpp b/engines/draci/detection.cpp index 572ecce77b..d3483eb5a4 100644 --- a/engines/draci/detection.cpp +++ b/engines/draci/detection.cpp @@ -113,7 +113,7 @@ public: DraciMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Draci Historie"; + return "Draci"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp index cdc91e8d9f..67e043632e 100644 --- a/engines/draci/draci.cpp +++ b/engines/draci/draci.cpp @@ -439,10 +439,8 @@ void DraciEngine::syncSoundSettings() { _music->syncVolume(); } -const char *DraciEngine::getSavegameFile(int saveGameIdx) { - static char buffer[20]; - sprintf(buffer, "draci.s%02d", saveGameIdx); - return buffer; +Common::String DraciEngine::getSavegameFile(int saveGameIdx) { + return Common::String::format("draci.s%02d", saveGameIdx); } Common::Error DraciEngine::loadGameState(int slot) { @@ -463,7 +461,7 @@ bool DraciEngine::canLoadGameStateCurrently() { (_game->getLoopSubstatus() == kOuterLoop); } -Common::Error DraciEngine::saveGameState(int slot, const char *desc) { +Common::Error DraciEngine::saveGameState(int slot, const Common::String &desc) { return saveSavegameData(slot, desc, *this); } diff --git a/engines/draci/draci.h b/engines/draci/draci.h index 83e69ca332..55ebff083e 100644 --- a/engines/draci/draci.h +++ b/engines/draci/draci.h @@ -67,10 +67,10 @@ public: void handleEvents(); - static const char *getSavegameFile(int saveGameIdx); + static Common::String getSavegameFile(int saveGameIdx); virtual Common::Error loadGameState(int slot); virtual bool canLoadGameStateCurrently(); - virtual Common::Error saveGameState(int slot, const char *desc); + virtual Common::Error saveGameState(int slot, const Common::String &desc); virtual bool canSaveGameStateCurrently(); GUI::Debugger *getDebugger() { return _console; } diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp index 657e381986..893e321b79 100644 --- a/engines/draci/game.cpp +++ b/engines/draci/game.cpp @@ -934,13 +934,12 @@ void Game::inventorySwitch(int keycode) { void Game::dialogueMenu(int dialogueID) { int oldLines, hit; - char tmp[5]; - sprintf(tmp, "%d", dialogueID+1); - Common::String ext(tmp); - _dialogueArchive = new BArchive(dialoguePath + ext + ".dfw"); + Common::String name; + name = dialoguePath + Common::String::format("%d.dfw", dialogueID + 1); + _dialogueArchive = new BArchive(name); debugC(4, kDraciLogicDebugLevel, "Starting dialogue (ID: %d, Archive: %s)", - dialogueID, (dialoguePath + ext + ".dfw").c_str()); + dialogueID, name.c_str()); _currentDialogue = dialogueID; oldLines = 255; diff --git a/engines/draci/music.cpp b/engines/draci/music.cpp index 6f3e3c8384..3179c79ca4 100644 --- a/engines/draci/music.cpp +++ b/engines/draci/music.cpp @@ -80,9 +80,8 @@ void MusicPlayer::playSMF(int track, bool loop) { // Load MIDI resource data Common::File musicFile; - char musicFileName[40]; - snprintf(musicFileName, sizeof(musicFileName), _pathMask.c_str(), track); - musicFile.open(musicFileName); + Common::String musicFileName = Common::String::format(_pathMask.c_str(), track); + musicFile.open(musicFileName.c_str()); if (!musicFile.isOpen()) { debugC(2, kDraciSoundDebugLevel, "Cannot open track %d", track); return; diff --git a/engines/draci/saveload.cpp b/engines/draci/saveload.cpp index ffb1ed7ff4..1479dd3c77 100644 --- a/engines/draci/saveload.cpp +++ b/engines/draci/saveload.cpp @@ -86,7 +86,7 @@ void writeSavegameHeader(Common::OutSaveFile *out, const DraciSavegameHeader &he } Common::Error saveSavegameData(int saveGameIdx, const Common::String &saveName, DraciEngine &vm) { - const char *filename = vm.getSavegameFile(saveGameIdx); + Common::String filename = vm.getSavegameFile(saveGameIdx); Common::SaveFileManager *saveMan = g_system->getSavefileManager(); Common::OutSaveFile *f = saveMan->openForSaving(filename); if (f == NULL) diff --git a/engines/draci/script.h b/engines/draci/script.h index d788dfb66f..72d6f6c344 100644 --- a/engines/draci/script.h +++ b/engines/draci/script.h @@ -106,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 bbba9d9cc0..106167ef8a 100644 --- a/engines/draci/sound.cpp +++ b/engines/draci/sound.cpp @@ -240,9 +240,8 @@ SoundSample *ZipSoundArchive::getSample(int i, uint freq) { sample._frequency = freq ? freq : _defaultFreq; sample._format = _format; // Read in the file (without the file header) - char file_name[20]; - sprintf(file_name, "%d.%s", i+1, _extension); - sample._stream = _archive->createReadStreamForMember(file_name); + Common::String filename = Common::String::format("%d.%s", i+1, _extension); + sample._stream = _archive->createReadStreamForMember(filename); if (!sample._stream) { debugC(2, kDraciArchiverDebugLevel, "Doesn't exist"); return NULL; diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index cac7f93f12..b4f009eb44 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -893,9 +893,9 @@ bool DrasculaEngine::loadDrasculaDat() { ver = in.readByte(); if (ver != DRASCULA_DAT_VER) { - snprintf(buf, 256, "File 'drascula.dat' is wrong version. Expected %d but got %d. Get it from the ScummVM website", DRASCULA_DAT_VER, ver); - GUIErrorMessage(buf); - warning("%s", buf); + Common::String errorMessage = Common::String::format("File 'drascula.dat' is wrong version. Expected %d but got %d. Get it from the ScummVM website", DRASCULA_DAT_VER, ver); + GUIErrorMessage(errorMessage); + warning("%s", errorMessage.c_str()); return false; } diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h index f9dcbe2810..2b6aa0f291 100644 --- a/engines/drascula/drascula.h +++ b/engines/drascula/drascula.h @@ -588,7 +588,7 @@ public: void quadrant_2(); void quadrant_3(); void quadrant_4(); - void saveGame(char[]); + void saveGame(const char *gameName); void increaseFrameNum(); int whichObject(); bool checkMenuFlags(); diff --git a/engines/drascula/saveload.cpp b/engines/drascula/saveload.cpp index 15f5855bdc..664a082eb4 100644 --- a/engines/drascula/saveload.cpp +++ b/engines/drascula/saveload.cpp @@ -28,24 +28,23 @@ namespace Drascula { bool DrasculaEngine::saveLoadScreen() { char names[10][23]; - char file[50]; - char fileEpa[50]; + Common::String file; int n, n2, num_sav = 0, y = 27; Common::InSaveFile *sav; clearRoom(); - snprintf(fileEpa, 50, "%s.epa", _targetName.c_str()); + Common::String fileEpa = Common::String::format("%s.epa", _targetName.c_str()); if (!(sav = _saveFileMan->openForLoading(fileEpa))) { Common::OutSaveFile *epa; if (!(epa = _saveFileMan->openForSaving(fileEpa))) - error("Can't open %s file", fileEpa); + error("Can't open %s file", fileEpa.c_str()); for (n = 0; n < NUM_SAVES; n++) epa->writeString("*\n"); epa->finalize(); delete epa; if (!(sav = _saveFileMan->openForLoading(fileEpa))) { - error("Can't open %s file", fileEpa); + error("Can't open %s file", fileEpa.c_str()); } } for (n = 0; n < NUM_SAVES; n++) { @@ -88,11 +87,11 @@ bool DrasculaEngine::saveLoadScreen() { enterName(); strcpy(names[n], select); if (selectionMade == 1) { - snprintf(file, 50, "%s%02d", _targetName.c_str(), n + 1); - saveGame(file); + file = Common::String::format("%s%02d", _targetName.c_str(), n + 1); + saveGame(file.c_str()); Common::OutSaveFile *tsav; if (!(tsav = _saveFileMan->openForSaving(fileEpa))) { - error("Can't open %s file", fileEpa); + error("Can't open %s file", fileEpa.c_str()); } for (n = 0; n < NUM_SAVES; n++) { tsav->writeString(names[n]); @@ -110,7 +109,7 @@ bool DrasculaEngine::saveLoadScreen() { y = y + 9; } if (selectionMade == 1) { - snprintf(file, 50, "%s%02d", _targetName.c_str(), n + 1); + file = Common::String::format("%s%02d", _targetName.c_str(), n + 1); } num_sav = n; } @@ -127,11 +126,11 @@ bool DrasculaEngine::saveLoadScreen() { } if (selectionMade == 1) { - snprintf(file, 50, "%s%02d", _targetName.c_str(), n + 1); - saveGame(file); + file = Common::String::format("%s%02d", _targetName.c_str(), n + 1); + saveGame(file.c_str()); Common::OutSaveFile *tsav; if (!(tsav = _saveFileMan->openForSaving(fileEpa))) { - error("Can't open %s file", fileEpa); + error("Can't open %s file", fileEpa.c_str()); } for (n = 0; n < NUM_SAVES; n++) { tsav->writeString(names[n]); @@ -143,16 +142,16 @@ bool DrasculaEngine::saveLoadScreen() { } if (mouseX > 125 && mouseY > 123 && mouseX < 199 && mouseY < 149 && selectionMade == 1) { - if (!loadGame(file)) { + if (!loadGame(file.c_str())) { _system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false); return false; } break; } else if (mouseX > 208 && mouseY > 123 && mouseX < 282 && mouseY < 149 && selectionMade == 1) { - saveGame(file); + saveGame(file.c_str()); Common::OutSaveFile *tsav; if (!(tsav = _saveFileMan->openForSaving(fileEpa))) { - error("Can't open %s file", fileEpa); + error("Can't open %s file", fileEpa.c_str()); } for (n = 0; n < NUM_SAVES; n++) { tsav->writeString(names[n]); @@ -229,7 +228,7 @@ bool DrasculaEngine::loadGame(const char *gameName) { return true; } -void DrasculaEngine::saveGame(char gameName[]) { +void DrasculaEngine::saveGame(const char *gameName) { Common::OutSaveFile *out; int l; diff --git a/engines/engine.cpp b/engines/engine.cpp index b3cb8bea06..210b0b46a3 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -206,12 +206,8 @@ void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics: // Error out on size switch failure if (gfxError & OSystem::kTransactionSizeChangeFailed) { - char buffer[16]; - snprintf(buffer, 16, "%dx%d", width, height); - - Common::String message = "Could not switch to resolution: '"; - message += buffer; - message += "'."; + Common::String message; + message = Common::String::format("Could not switch to resolution: '%dx%d'.", width, height); GUIErrorMessage(message); error("%s", message.c_str()); @@ -474,7 +470,7 @@ bool Engine::canLoadGameStateCurrently() { return false; } -Common::Error Engine::saveGameState(int slot, const char *desc) { +Common::Error Engine::saveGameState(int slot, const Common::String &desc) { // Do nothing by default return Common::kNoError; } diff --git a/engines/engine.h b/engines/engine.h index 375df2b0a3..d7d971ad97 100644 --- a/engines/engine.h +++ b/engines/engine.h @@ -196,7 +196,7 @@ public: * @param desc a description for the savestate, entered by the user * @return returns kNoError on success, else an error code. */ - virtual Common::Error saveGameState(int slot, const char *desc); + virtual Common::Error saveGameState(int slot, const Common::String &desc); /** * Indicates whether a game state can be saved. diff --git a/engines/gob/resources.cpp b/engines/gob/resources.cpp index 92eec0ee25..d5497c25be 100644 --- a/engines/gob/resources.cpp +++ b/engines/gob/resources.cpp @@ -603,10 +603,7 @@ bool Resources::dumpResource(const Resource &resource, uint16 id, Common::String fileName = _fileBase; - char idStr[7]; - - snprintf(idStr, 7, "_%05d", id); - fileName += idStr; + fileName += Common::String::format("_%05d", id); fileName += "."; fileName += ext; diff --git a/engines/gob/save/saveconverter.cpp b/engines/gob/save/saveconverter.cpp index f24cb60005..ec8bcbcfea 100644 --- a/engines/gob/save/saveconverter.cpp +++ b/engines/gob/save/saveconverter.cpp @@ -301,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/savehandler.cpp b/engines/gob/save/savehandler.cpp index 9e46f1db6f..71de629f93 100644 --- a/engines/gob/save/savehandler.cpp +++ b/engines/gob/save/savehandler.cpp @@ -154,8 +154,7 @@ Common::String SlotFileIndexed::build(int slot) const { if ((slot < 0) || (((uint32) slot) >= _slotCount)) return Common::String(); - char buf[4]; - snprintf(buf, sizeof(buf), "%02d", slot); + Common::String buf = Common::String::format("%02d", slot); return _base + "." + _ext + buf; } diff --git a/engines/gob/sound/sound.cpp b/engines/gob/sound/sound.cpp index 0ad17c1e33..212116f689 100644 --- a/engines/gob/sound/sound.cpp +++ b/engines/gob/sound/sound.cpp @@ -667,15 +667,13 @@ void Sound::bgPlay(const char *base, const char *ext, SoundType type, int count) _bgatmos->stopBA(); _bgatmos->queueClear(); - int length = strlen(base) + 7; - char *fileName = new char[length]; SoundDesc *sndDesc; for (int i = 1; i <= count; i++) { - snprintf(fileName, length, "%s%02d.%s", base, i, ext); + Common::String fileName = Common::String::format("%s%02d.%s", base, i, ext); sndDesc = new SoundDesc; - if (sampleLoad(sndDesc, type, fileName)) + if (sampleLoad(sndDesc, type, fileName.c_str())) _bgatmos->queueSample(*sndDesc); else delete sndDesc; diff --git a/engines/groovie/detection.cpp b/engines/groovie/detection.cpp index 78ecac8dbb..0dd510abca 100644 --- a/engines/groovie/detection.cpp +++ b/engines/groovie/detection.cpp @@ -111,6 +111,20 @@ static const GroovieGameDescription gameDescriptions[] = { kGroovieT7G, 0 }, + { + { + "t7g", "", + { + { "script.grv", 0, "d1b8033b40aa67c076039881eccce90d", 16659}, + { "SeventhGuest", 0, NULL, -1}, + { NULL, 0, NULL, 0} + }, + Common::EN_ANY, Common::kPlatformIOS, ADGF_NO_FLAGS, + Common::GUIO_NOMIDI + }, + kGroovieT7G, 0 + }, + #ifdef ENABLE_GROOVIE2 // The 11th Hour DOS English { diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp index 508049e1a0..8b6ee2ca42 100644 --- a/engines/groovie/groovie.cpp +++ b/engines/groovie/groovie.cpp @@ -54,6 +54,15 @@ GroovieEngine::GroovieEngine(OSystem *syst, const GroovieGameDescription *gd) : SearchMan.addSubDirectoryMatching(gameDataDir, "media"); SearchMan.addSubDirectoryMatching(gameDataDir, "system"); + _modeSpeed = kGroovieSpeedNormal; + if (ConfMan.hasKey("t7g_speed")) { + Common::String speed = ConfMan.get("t7g_speed"); + if (speed.equals("im_an_ios")) + _modeSpeed = kGroovieSpeediOS; + else if (speed.equals("tweaked")) + _modeSpeed = kGroovieSpeedTweaked; + } + // Initialize the custom debug levels DebugMan.addDebugChannel(kGroovieDebugAll, "All", "Debug everything"); DebugMan.addDebugChannel(kGroovieDebugVideo, "Video", "Debug video and audio playback"); @@ -141,10 +150,20 @@ Common::Error GroovieEngine::run() { } // Create the music player - if (getPlatform() == Common::kPlatformMacintosh) + switch (getPlatform()) { + case Common::kPlatformMacintosh: + // TODO: The 11th Hour Mac uses QuickTime MIDI files + // Right now, since the XMIDI are present and it is still detected as + // the DOS version, we don't have to do anything here. _musicPlayer = new MusicPlayerMac(this); - else + break; + case Common::kPlatformIOS: + _musicPlayer = new MusicPlayerIOS(this); + break; + default: _musicPlayer = new MusicPlayerXMI(this, _gameDescription->version == kGroovieT7G ? "fat" : "sample"); + break; + } // Load volume levels syncSoundSettings(); @@ -207,17 +226,19 @@ Common::Error GroovieEngine::run() { _script->directGameLoad(slot); } - // Check that the game files and the audio tracks aren't together run from - // the same cd - checkCD(); - // Game timer counter uint16 tmr = 0; - // Initialize the CD - int cd_num = ConfMan.getInt("cdrom"); - if (cd_num >= 0) - _system->getAudioCDManager()->openCD(cd_num); + // Check that the game files and the audio tracks aren't together run from + // the same cd + if (getPlatform() != Common::kPlatformIOS) { + checkCD(); + + // Initialize the CD + int cd_num = ConfMan.getInt("cdrom"); + if (cd_num >= 0) + _system->getAudioCDManager()->openCD(cd_num); + } while (!shouldQuit()) { // Give the debugger a chance to act diff --git a/engines/groovie/groovie.h b/engines/groovie/groovie.h index 0ac9c4b956..eb64cfc60a 100644 --- a/engines/groovie/groovie.h +++ b/engines/groovie/groovie.h @@ -72,6 +72,12 @@ enum DebugLevels { // the current limitation is 32 debug levels (1 << 31 is the last one) }; +enum GameSpeed { + kGroovieSpeedNormal, + kGroovieSpeediOS, + kGroovieSpeedTweaked +}; + struct GroovieGameDescription; class GroovieEngine : public Engine { @@ -110,6 +116,8 @@ public: Common::MacResManager *_macResFork; + GameSpeed _modeSpeed; + private: const GroovieGameDescription *_gameDescription; Debugger *_debugger; diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp index b8a78d9f56..9a3903e9dc 100644 --- a/engines/groovie/music.cpp +++ b/engines/groovie/music.cpp @@ -31,6 +31,7 @@ #include "common/macresman.h" #include "common/memstream.h" #include "common/textconsole.h" +#include "audio/audiostream.h" #include "audio/midiparser.h" namespace Groovie { @@ -92,6 +93,7 @@ void MusicPlayer::playCD(uint8 track) { } else if ((track == 98) && (_prevCDtrack == 3)) { // Track 98 is used as a hack to stop the credits song g_system->getAudioCDManager()->stop(); + stopCreditsIOS(); return; } @@ -124,6 +126,8 @@ void MusicPlayer::playCD(uint8 track) { playSong((19 << 10) | 36); // XMI.GJD, file 36 } else if (track == 3) { // TODO: Credits MIDI fallback + if (_vm->getPlatform() == Common::kPlatformIOS) + playCreditsIOS(); } } } @@ -224,6 +228,20 @@ void MusicPlayer::unload() { _isPlaying = false; } +void MusicPlayer::playCreditsIOS() { + Audio::AudioStream *stream = Audio::SeekableAudioStream::openStreamFile("7th_Guest_Dolls_from_Hell_OC_ReMix"); + + if (!stream) { + warning("Could not find '7th_Guest_Dolls_from_Hell_OC_ReMix' audio file"); + return; + } + + _vm->_system->getMixer()->playStream(Audio::Mixer::kMusicSoundType, &_handleCreditsIOS, stream); +} + +void MusicPlayer::stopCreditsIOS() { + _vm->_system->getMixer()->stopHandle(_handleCreditsIOS); +} // MusicPlayerMidi @@ -747,4 +765,89 @@ Common::SeekableReadStream *MusicPlayerMac::decompressMidi(Common::SeekableReadS return new Common::MemoryReadStream(output, size, DisposeAfterUse::YES); } +MusicPlayerIOS::MusicPlayerIOS(GroovieEngine *vm) : MusicPlayer(vm) { + vm->getTimerManager()->installTimerProc(&onTimer, 50 * 1000, this); +} + +MusicPlayerIOS::~MusicPlayerIOS() { + _vm->getTimerManager()->removeTimerProc(&onTimer); +} + +void MusicPlayerIOS::updateVolume() { + // Just set the mixer volume for the music sound type + _vm->_system->getMixer()->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, _userVolume * _gameVolume / 100); +} + +void MusicPlayerIOS::unload() { + MusicPlayer::unload(); + + _vm->_system->getMixer()->stopHandle(_handle); +} + +bool MusicPlayerIOS::load(uint32 fileref, bool loop) { + // Find correct filename + ResInfo info; + _vm->_resMan->getResInfo(fileref, info); + uint len = info.filename.size(); + if (len < 4) + return false; // This shouldn't actually occur + /* + 19462 door + 19463 ?? + 19464 ?? + 19465 puzzle? + 19466 cake + 19467 maze + 19468 ambient (but not 69, amb b. odd) + 19470 puzzle + 19471 + 19473 + 19475 coffins or blood pump + 19476 blood pump or coffins + 19493 + 19499 chapel + 19509 downstair ambient + 19510 bedroom 'skip 3 and 5' puzzle (should loop from partway?) + 19514 + 19515 bathroom drain teeth + */ + if ((fileref >= 19462 && fileref <= 19468) || + fileref == 19470 || fileref == 19471 || + fileref == 19473 || fileref == 19475 || + fileref == 19476 || fileref == 19493 || + fileref == 19499 || fileref == 19509 || + fileref == 19510 || fileref == 19514 || + fileref == 19515) + loop = true; // XMIs for these refs self-loop + + // iOS port provides alternative intro sequence music + if (info.filename == "gu39.xmi") { + info.filename = "intro"; + } else if (info.filename == "gu32.xmi") { + info.filename = "foyer"; + } else { + // Remove the extension + info.filename.deleteLastChar(); + info.filename.deleteLastChar(); + info.filename.deleteLastChar(); + info.filename.deleteLastChar(); + } + + // Create the audio stream + Audio::AudioStream *audStream = Audio::SeekableAudioStream::openStreamFile(info.filename); + + if (!audStream) { + warning("Could not play audio file '%s'", info.filename.c_str()); + return false; + } + + // Loop if requested + if (loop) + audStream = Audio::makeLoopingAudioStream((Audio::RewindableAudioStream *)audStream, 0); + + // Play! + _vm->_system->getMixer()->playStream(Audio::Mixer::kMusicSoundType, &_handle, audStream); + return true; +} + } // End of Groovie namespace diff --git a/engines/groovie/music.h b/engines/groovie/music.h index fa4150a83b..7af482e45d 100644 --- a/engines/groovie/music.h +++ b/engines/groovie/music.h @@ -26,6 +26,7 @@ #include "common/array.h" #include "common/mutex.h" #include "audio/mididrv.h" +#include "audio/mixer.h" class MidiParser; @@ -59,6 +60,11 @@ private: uint16 _backgroundDelay; + // T7G iOS credits mp3 stream + void playCreditsIOS(); + void stopCreditsIOS(); + Audio::SoundHandle _handleCreditsIOS; + // Volume fading uint32 _fadingStartTime; uint16 _fadingStartVolume; @@ -157,6 +163,20 @@ private: Common::SeekableReadStream *decompressMidi(Common::SeekableReadStream *stream); }; +class MusicPlayerIOS : public MusicPlayer { +public: + MusicPlayerIOS(GroovieEngine *vm); + ~MusicPlayerIOS(); + +protected: + void updateVolume(); + bool load(uint32 fileref, bool loop); + void unload(); + +private: + Audio::SoundHandle _handle; +}; + } // End of Groovie namespace #endif // GROOVIE_MUSIC_H diff --git a/engines/groovie/player.cpp b/engines/groovie/player.cpp index 11318d2e94..e2a1ff3d56 100644 --- a/engines/groovie/player.cpp +++ b/engines/groovie/player.cpp @@ -28,18 +28,19 @@ namespace Groovie { VideoPlayer::VideoPlayer(GroovieEngine *vm) : - _vm(vm), _syst(vm->_system), _file(NULL), _audioStream(NULL) { + _vm(vm), _syst(vm->_system), _file(NULL), _audioStream(NULL), _fps(0), _overrideSpeed(false) { } bool VideoPlayer::load(Common::SeekableReadStream *file, uint16 flags) { _file = file; _flags = flags; + _overrideSpeed = false; _audioStream = NULL; - uint16 fps = loadInternal(); + _fps = loadInternal(); - if (fps != 0) { - _millisBetweenFrames = 1000 / fps; + if (_fps != 0) { + setOverrideSpeed(_overrideSpeed); _begunPlaying = false; return true; } else { @@ -48,6 +49,16 @@ bool VideoPlayer::load(Common::SeekableReadStream *file, uint16 flags) { } } +void VideoPlayer::setOverrideSpeed(bool isOverride) { + _overrideSpeed = isOverride; + if (_fps != 0) { + if (isOverride) + _millisBetweenFrames = 1000 / 26; + else + _millisBetweenFrames = 1000 / _fps; + } +} + bool VideoPlayer::playFrame() { bool end = true; diff --git a/engines/groovie/player.h b/engines/groovie/player.h index c6d927f2c0..d8135a99b2 100644 --- a/engines/groovie/player.h +++ b/engines/groovie/player.h @@ -45,15 +45,21 @@ protected: virtual uint16 loadInternal() = 0; virtual bool playFrameInternal() = 0; + void setOverrideSpeed(bool isOverride); + bool getOverrideSpeed() const { return _overrideSpeed; } + GroovieEngine *_vm; OSystem *_syst; Common::SeekableReadStream *_file; uint16 _flags; Audio::QueuingAudioStream *_audioStream; - + + private: // Synchronization stuff bool _begunPlaying; + bool _overrideSpeed; + uint16 _fps; uint16 _millisBetweenFrames; uint32 _lastFrameTime; diff --git a/engines/groovie/resource.cpp b/engines/groovie/resource.cpp index 05359342f8..05b43b7d3c 100644 --- a/engines/groovie/resource.cpp +++ b/engines/groovie/resource.cpp @@ -170,9 +170,11 @@ bool ResMan_t7g::getResInfo(uint32 fileRef, ResInfo &resInfo) { } // Read the resource name (just for debugging purposes) - char resname[12]; + char resname[13]; rlFile->read(resname, 12); + resname[12] = 0; debugC(2, kGroovieDebugResource | kGroovieDebugAll, "Groovie::Resource: Resource name: %12s", resname); + resInfo.filename = resname; // Read the resource information resInfo.offset = rlFile->readUint32LE(); @@ -281,6 +283,7 @@ bool ResMan_v2::getResInfo(uint32 fileRef, ResInfo &resInfo) { char resname[12]; rlFile.read(resname, 12); debugC(2, kGroovieDebugResource | kGroovieDebugAll, "Groovie::Resource: Resource name: %12s", resname); + resInfo.filename = resname; // 6 padding bytes? (it looks like they're always 0) diff --git a/engines/groovie/resource.h b/engines/groovie/resource.h index 2c215917cc..33e15e6b98 100644 --- a/engines/groovie/resource.h +++ b/engines/groovie/resource.h @@ -33,6 +33,7 @@ struct ResInfo { uint16 gjd; uint32 offset; uint32 size; + Common::String filename; }; class ResMan { @@ -40,11 +41,12 @@ public: virtual ~ResMan() {} Common::SeekableReadStream *open(uint32 fileRef); + virtual uint32 getRef(Common::String name, Common::String scriptname = "") = 0; + virtual bool getResInfo(uint32 fileRef, ResInfo &resInfo) = 0; protected: Common::Array<Common::String> _gjds; - virtual bool getResInfo(uint32 fileRef, ResInfo &resInfo) = 0; uint16 _lastGjd; }; diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp index 3bd90a042e..b52a8723fc 100644 --- a/engines/groovie/script.cpp +++ b/engines/groovie/script.cpp @@ -65,8 +65,9 @@ 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), - _random("GroovieScripts") { + _videoFile(NULL), _videoRef(0), _staufsMove(NULL), _lastCursor(0xff), + _version(version), _random("GroovieScripts") { + // Initialize the opcode set depending on the engine version switch (version) { case kGroovieT7G: @@ -385,6 +386,7 @@ bool Script::hotspot(Common::Rect rect, uint16 address, uint8 cursor) { // If clicked with the mouse, jump to the specified address if (_mouseClicked) { + _lastCursor = cursor; _inputAction = address; } } @@ -584,6 +586,10 @@ bool Script::playvideofromref(uint32 fileref) { if (_videoFile) { _videoRef = fileref; + // If teeth cursor, and in main script, mark video prefer low-speed + // filename check as sometimes teeth used for puzzle movements (bishops) + if (_version == kGroovieT7G && _lastCursor == 7 && _scriptFile == "script.grv") + _bitflags |= (1 << 15); _vm->_videoPlayer->load(_videoFile, _bitflags); } else { error("Couldn't open file"); diff --git a/engines/groovie/script.h b/engines/groovie/script.h index 95da96487e..8cd790af5e 100644 --- a/engines/groovie/script.h +++ b/engines/groovie/script.h @@ -72,6 +72,9 @@ private: Common::RandomSource _random; bool _firstbit; + uint8 _lastCursor; + + EngineVersion _version; // Script filename (for debugging purposes) Common::String _scriptFile; diff --git a/engines/groovie/vdx.cpp b/engines/groovie/vdx.cpp index ae1e9eebb3..b3fcf462b2 100644 --- a/engines/groovie/vdx.cpp +++ b/engines/groovie/vdx.cpp @@ -86,6 +86,11 @@ uint16 VDXPlayer::loadInternal() { _flagEight = ((_flags & (1 << 8)) != 0); _flagNine = ((_flags & (1 << 9)) != 0); + // Enable highspeed if we're not obeying fps, and not marked as special + // This will be disabled in chunk audio if we're actually an audio vdx + if ( _vm->_modeSpeed == kGroovieSpeediOS || (_vm->_modeSpeed == kGroovieSpeedTweaked && ((_flags & (1 << 15)) == 0))) + setOverrideSpeed(true); + if (_flagOnePrev && !_flagOne && !_flagEight) { _flagSeven = true; } @@ -522,6 +527,9 @@ void VDXPlayer::decodeBlockDelta(uint32 offset, byte *colors, uint16 imageWidth) } void VDXPlayer::chunkSound(Common::ReadStream *in) { + if (getOverrideSpeed()) + setOverrideSpeed(false); + if (!_audioStream) { _audioStream = Audio::makeQueuingAudioStream(22050, false); Audio::SoundHandle sound_handle; diff --git a/engines/hugo/console.cpp b/engines/hugo/console.cpp index 3d7449e51f..0a67b5cd0a 100644 --- a/engines/hugo/console.cpp +++ b/engines/hugo/console.cpp @@ -22,13 +22,131 @@ #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 <screen number>\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 <object number>\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 4743b791f3..16317e83d5 100644 --- a/engines/hugo/console.h +++ b/engines/hugo/console.h @@ -36,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/display.cpp b/engines/hugo/display.cpp index c731b23e59..c716e80d87 100644 --- a/engines/hugo/display.cpp +++ b/engines/hugo/display.cpp @@ -644,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/hugo.cpp b/engines/hugo/hugo.cpp index 7d35aec972..10d61f25a2 100644 --- a/engines/hugo/hugo.cpp +++ b/engines/hugo/hugo.cpp @@ -130,7 +130,7 @@ void HugoEngine::setMaxScore(const int newScore) { _maxscore = newScore; } -Common::Error HugoEngine::saveGameState(int slot, const char *desc) { +Common::Error HugoEngine::saveGameState(int slot, const Common::String &desc) { return (_file->saveGame(slot, desc) ? Common::kWritingFailed : Common::kNoError); } @@ -527,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 @@ -593,7 +594,7 @@ 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("hugo"); _rnd->setSeed(42); // Kick random number generator diff --git a/engines/hugo/hugo.h b/engines/hugo/hugo.h index 61b002a2ee..81d194f1d6 100644 --- a/engines/hugo/hugo.h +++ b/engines/hugo/hugo.h @@ -177,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; @@ -299,7 +301,7 @@ public: void adjustScore(const int adjustment); int getMaxScore() const; void setMaxScore(const int newScore); - Common::Error saveGameState(int slot, const char *desc); + Common::Error saveGameState(int slot, const Common::String &desc); Common::Error loadGameState(int slot); bool hasFeature(EngineFeature f) const; const char *getCopyrightString() const; diff --git a/engines/hugo/object_v1d.cpp b/engines/hugo/object_v1d.cpp index 297a856203..ecdbb3b4c6 100644 --- a/engines/hugo/object_v1d.cpp +++ b/engines/hugo/object_v1d.cpp @@ -58,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 098acdf367..11c09176e5 100644 --- a/engines/hugo/object_v1w.cpp +++ b/engines/hugo/object_v1w.cpp @@ -58,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 3a98885ebe..c9e5104972 100644 --- a/engines/hugo/object_v2d.cpp +++ b/engines/hugo/object_v2d.cpp @@ -58,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/parser.h b/engines/hugo/parser.h index 6ad2b38234..faa6dc2303 100644 --- a/engines/hugo/parser.h +++ b/engines/hugo/parser.h @@ -97,6 +97,7 @@ public: virtual void lineHandler() = 0; virtual void showInventory() const = 0; + virtual void takeObject(object_t *obj) = 0; protected: HugoEngine *_vm; @@ -135,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/schedule.cpp b/engines/hugo/schedule.cpp index 7e66f34af2..a099bec21c 100644 --- a/engines/hugo/schedule.cpp +++ b/engines/hugo/schedule.cpp @@ -61,7 +61,7 @@ void Scheduler::initCypher() { } /** - * Initialise the timer event queue + * Initialize the timer event queue */ void Scheduler::initEventQueue() { debugC(1, kDebugSchedule, "initEventQueue"); @@ -159,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); @@ -193,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(); } @@ -201,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); @@ -212,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(); } @@ -1135,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 @@ -1208,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; @@ -1218,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! @@ -1232,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 @@ -1284,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 003974f2fa..e3107809cf 100644 --- a/engines/hugo/schedule.h +++ b/engines/hugo/schedule.h @@ -73,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 @@ -106,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 @@ -129,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 @@ -155,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 @@ -251,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/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index 7f4f1ec2c7..f108082e13 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -84,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); } @@ -350,23 +350,43 @@ int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop, int eventFlag) } void KyraEngine_v1::setupKeyMap() { - static const Common::KeyCode keyboardEvents[] = { - Common::KEYCODE_SPACE, Common::KEYCODE_RETURN, Common::KEYCODE_UP, Common::KEYCODE_KP8, - Common::KEYCODE_RIGHT, Common::KEYCODE_KP6, Common::KEYCODE_DOWN, Common::KEYCODE_KP2, - Common::KEYCODE_KP5, Common::KEYCODE_LEFT, Common::KEYCODE_KP4, Common::KEYCODE_HOME, - Common::KEYCODE_KP7, Common::KEYCODE_PAGEUP, Common::KEYCODE_KP9, Common::KEYCODE_F1, - Common::KEYCODE_F2, Common::KEYCODE_F3, Common::KEYCODE_o, Common::KEYCODE_r, - Common::KEYCODE_SLASH, Common::KEYCODE_ESCAPE + struct KeyMapEntry { + Common::KeyCode kcScummVM; + int16 kcDOS; + int16 kcPC98; }; - static const int16 keyCodesDOS[] = { 61, 43, 96, 96, 102, 102, 98, 98, 97, 92, 92, 91, 91, 101, 101, 112, 113, 114, 25, 20, 55, 110}; - static const int16 keyCodesPC98[] = { 53, 29, 68, 68, 73, 73, 76, 76, 72, 71, 71, 67, 67, 69, 69, 99, 100, 101, 25, 20, 55, 1 }; +#define KC(x) Common::KEYCODE_##x + static const KeyMapEntry keys[] = { + { KC(SPACE), 61, 53 }, + { KC(RETURN), 43, 29 }, + { KC(UP), 96, 68 }, + { KC(KP8), 96, 68 }, + { KC(RIGHT), 102, 73 }, + { KC(KP6), 102, 73 }, + { KC(DOWN), 98, 76 }, + { KC(KP2), 98, 76 }, + { KC(KP5), 97, 72 }, + { KC(LEFT), 92, 71 }, + { KC(KP4), 92, 71 }, + { KC(HOME), 91, 67 }, + { KC(KP7), 91, 67 }, + { KC(PAGEUP), 101, 69 }, + { KC(KP9), 101, 69 }, + { KC(F1), 112, 99 }, + { KC(F2), 113, 100 }, + { KC(F3), 114, 101 }, + { KC(o), 25, 25 }, + { KC(r), 20, 20 }, + { KC(SLASH), 55, 55 }, + { KC(ESCAPE), 110, 1 }, + }; +#undef KC - const int16 *keyCodes = _flags.platform == Common::kPlatformPC98 ? keyCodesPC98 : keyCodesDOS; _keyMap.clear(); - for (int i = 0; i < ARRAYSIZE(keyboardEvents); i++) - _keyMap[keyboardEvents[i]] = keyCodes[i]; + for (int i = 0; i < ARRAYSIZE(keys); i++) + _keyMap[keys[i].kcScummVM] = (_flags.platform == Common::kPlatformPC98) ? keys[i].kcPC98 : keys[i].kcDOS; } void KyraEngine_v1::updateInput() { diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp index 4da35cc28b..3713537afd 100644 --- a/engines/kyra/sound.cpp +++ b/engines/kyra/sound.cpp @@ -43,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 4f8e54212f..566b37ff43 100644 --- a/engines/kyra/sound.h +++ b/engines/kyra/sound.h @@ -101,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; @@ -153,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; } @@ -275,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 6ca01c65f3..75041b8161 100644 --- a/engines/kyra/sound_adlib.cpp +++ b/engines/kyra/sound_adlib.cpp @@ -1558,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_intern.h b/engines/kyra/sound_intern.h index 488dbc3742..2ba0890789 100644 --- a/engines/kyra/sound_intern.h +++ b/engines/kyra/sound_intern.h @@ -71,6 +71,8 @@ public: void stopAllSoundEffects(); void beginFadeOut(); + + void pause(bool paused); private: static void onTimer(void *data); @@ -139,8 +141,6 @@ private: TownsEuphonyDriver *_driver; - Common::Mutex _mutex; - bool _cdaPlaying; const uint8 *_musicFadeTable; diff --git a/engines/kyra/sound_midi.cpp b/engines/kyra/sound_midi.cpp index 00f6c9329e..6c003d0a11 100644 --- a/engines/kyra/sound_midi.cpp +++ b/engines/kyra/sound_midi.cpp @@ -714,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_towns.cpp b/engines/kyra/sound_towns.cpp index 9a9892c9a4..73d435f3e5 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -297,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]); @@ -322,8 +320,6 @@ 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; diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp index bfcb415da1..7c7c6b0a36 100644 --- a/engines/lastexpress/detection.cpp +++ b/engines/lastexpress/detection.cpp @@ -207,7 +207,7 @@ public: LastExpressMetaEngine() : AdvancedMetaEngine(detectionParams) {} const char *getName() const { - return "Last Express"; + return "Lastexpress"; } const char *getOriginalCopyright() const { diff --git a/engines/lastexpress/game/sound.cpp b/engines/lastexpress/game/sound.cpp index d5e1118105..63efd182a8 100644 --- a/engines/lastexpress/game/sound.cpp +++ b/engines/lastexpress/game/sound.cpp @@ -120,9 +120,12 @@ SoundManager::SoundManager(LastExpressEngine *engine) : _engine(engine), _state( } SoundManager::~SoundManager() { - for (Common::List<SoundEntry *>::iterator i = _cache.begin(); i != _cache.end(); ++i) + for (Common::List<SoundEntry *>::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<SubtitleEntry *>::iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) SAFE_DELETE(*i); @@ -142,11 +145,11 @@ SoundManager::~SoundManager() { void SoundManager::handleTimer() { Common::StackLock locker(_mutex); - for (Common::List<SoundEntry *>::iterator i = _cache.begin(); i != _cache.end(); ++i) { + for (Common::List<SoundEntry *>::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(); @@ -171,7 +174,7 @@ void SoundManager::resetQueue(SoundType type1, SoundType type2) { Common::StackLock locker(_mutex); - for (Common::List<SoundEntry *>::iterator i = _cache.begin(); i != _cache.end(); ++i) { + for (Common::List<SoundEntry *>::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { if ((*i)->type != type1 && (*i)->type != type2) resetEntry(*i); } @@ -205,14 +208,14 @@ void SoundManager::clearQueue() { Common::StackLock locker(_mutex); - for (Common::List<SoundEntry *>::iterator i = _cache.begin(); i != _cache.end(); ++i) { + for (Common::List<SoundEntry *>::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(); @@ -246,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); } @@ -344,12 +348,12 @@ bool SoundManager::setupCache(SoundEntry *entry) { if (entry->soundData) return true; - if (_cache.size() >= SOUNDCACHE_MAX_SIZE) { + if (_soundCache.size() >= SOUNDCACHE_MAX_SIZE) { SoundEntry *cacheEntry = NULL; uint32 size = 1000; - for (Common::List<SoundEntry *>::iterator i = _cache.begin(); i != _cache.end(); ++i) { + for (Common::List<SoundEntry *>::iterator i = _soundCache.begin(); i != _soundCache.end(); ++i) { if (!((*i)->status.status & kSoundStatus_180)) { uint32 newSize = (*i)->field_4C + ((*i)->status.status & kSoundStatusClear1); @@ -373,24 +377,24 @@ bool SoundManager::setupCache(SoundEntry *entry) { if (cacheEntry->soundData) removeFromCache(cacheEntry); - _cache.push_back(entry); - entry->soundData = (char *)_soundCacheData + SOUNDCACHE_ENTRY_SIZE * (_cache.size() - 1); + _soundCache.push_back(entry); + entry->soundData = (char *)_soundCacheData + SOUNDCACHE_ENTRY_SIZE * (_soundCache.size() - 1); } else { - _cache.push_back(entry); - entry->soundData = (char *)_soundCacheData + SOUNDCACHE_ENTRY_SIZE * (_cache.size() - 1); + _soundCache.push_back(entry); + entry->soundData = (char *)_soundCacheData + SOUNDCACHE_ENTRY_SIZE * (_soundCache.size() - 1); } return true; } void SoundManager::removeFromCache(SoundEntry *entry) { - for (Common::List<SoundEntry *>::iterator i = _cache.begin(); i != _cache.end(); ++i) { + for (Common::List<SoundEntry *>::iterator i = _soundCache.begin(); i != _soundCache.end(); ++i) { if ((*i) == entry) { // Remove sound buffer entry->soundData = NULL; // Remove entry from sound cache - i = _cache.reverse_erase(i); + i = _soundCache.reverse_erase(i); } } } @@ -398,7 +402,7 @@ void SoundManager::removeFromCache(SoundEntry *entry) { void SoundManager::clearStatus() { Common::StackLock locker(_mutex); - for (Common::List<SoundEntry *>::iterator i = _cache.begin(); i != _cache.end(); ++i) + for (Common::List<SoundEntry *>::iterator i = _soundList.begin(); i != _soundList.end(); ++i) (*i)->status.status |= kSoundStatusClear3; } @@ -561,7 +565,7 @@ void SoundManager::unknownFunction4() { // Entry search ////////////////////////////////////////////////////////////////////////// SoundManager::SoundEntry *SoundManager::getEntry(EntityIndex index) { - for (Common::List<SoundEntry *>::iterator i = _cache.begin(); i != _cache.end(); ++i) { + for (Common::List<SoundEntry *>::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { if ((*i)->entity == index) return *i; } @@ -573,7 +577,7 @@ SoundManager::SoundEntry *SoundManager::getEntry(Common::String name) { if (!name.contains('.')) name += ".SND"; - for (Common::List<SoundEntry *>::iterator i = _cache.begin(); i != _cache.end(); ++i) { + for (Common::List<SoundEntry *>::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { if ((*i)->name2 == name) return *i; } @@ -582,7 +586,7 @@ SoundManager::SoundEntry *SoundManager::getEntry(Common::String name) { } SoundManager::SoundEntry *SoundManager::getEntry(SoundType type) { - for (Common::List<SoundEntry *>::iterator i = _cache.begin(); i != _cache.end(); ++i) { + for (Common::List<SoundEntry *>::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { if ((*i)->type == type) return *i; } @@ -605,7 +609,7 @@ void SoundManager::saveLoadWithSerializer(Common::Serializer &s) { // Save or load each entry data if (s.isSaving()) { - for (Common::List<SoundEntry *>::iterator i = _cache.begin(); i != _cache.end(); ++i) { + for (Common::List<SoundEntry *>::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; @@ -646,7 +650,7 @@ uint32 SoundManager::count() { Common::StackLock locker(_mutex); uint32 numEntries = 0; - for (Common::List<SoundEntry *>::iterator i = _cache.begin(); i != _cache.end(); ++i) + for (Common::List<SoundEntry *>::iterator i = _soundList.begin(); i != _soundList.end(); ++i) if ((*i)->name2.matchString("NISSND?")) ++numEntries; @@ -817,12 +821,8 @@ void SoundManager::playSoundEvent(EntityIndex entity, byte action, byte a3) { break; } - if (_action) { - sprintf((char *)&filename, "LIB%03d.SND", _action); - - if (flag) - playSoundWithSubtitles((char*)&filename, flag, kEntityPlayer, a3); - } + if (_action && flag) + playSoundWithSubtitles(Common::String::format("LIB%03d.SND", _action), flag, kEntityPlayer, a3); } void SoundManager::playSteam(CityIndex index) { @@ -881,10 +881,8 @@ void SoundManager::playFightSound(byte action, byte a4) { break; } - if (_action) { - sprintf((char *)&filename, "LIB%03d.SND", _action); - playSound(kEntityTrain, (char*)&filename, kFlagDefault, a4); - } + if (_action) + playSound(kEntityTrain, Common::String::format("LIB%03d.SND", _action), kFlagDefault, a4); } void SoundManager::playDialog(EntityIndex entity, EntityIndex entityDialog, FlagType flag, byte a4) { @@ -1948,7 +1946,7 @@ void SoundManager::playLoopingSound() { void SoundManager::stopAllSound() { Common::StackLock locker(_mutex); - for (Common::List<SoundEntry *>::iterator i = _cache.begin(); i != _cache.end(); ++i) + for (Common::List<SoundEntry *>::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 08ec767022..ddafc21829 100644 --- a/engines/lastexpress/game/sound.h +++ b/engines/lastexpress/game/sound.h @@ -347,8 +347,9 @@ private: // Looping sound void playLoopingSound(); - // Sound cache - Common::List<SoundEntry *> _cache; + // Sound entries + Common::List<SoundEntry *> _soundList; ///< List of all sound entries + Common::List<SoundEntry *> _soundCache; ///< List of entries with a data buffer void *_soundCacheData; SoundEntry *getEntry(EntityIndex index); diff --git a/engines/lastexpress/lastexpress.cpp b/engines/lastexpress/lastexpress.cpp index d195fcfad3..6fdd18413b 100644 --- a/engines/lastexpress/lastexpress.cpp +++ b/engines/lastexpress/lastexpress.cpp @@ -314,8 +314,4 @@ bool LastExpressEngine::hasFeature(EngineFeature f) const { return (f == kSupportsRTL); } -void LastExpressEngine::errorString(const char *buf_input, char *buf_output, int buf_output_size) { - snprintf(buf_output, (uint)buf_output_size, "%s", buf_input); -} - } // End of namespace LastExpress diff --git a/engines/lastexpress/lastexpress.h b/engines/lastexpress/lastexpress.h index 270ab655a1..d78bba36f0 100644 --- a/engines/lastexpress/lastexpress.h +++ b/engines/lastexpress/lastexpress.h @@ -71,7 +71,6 @@ class LastExpressEngine : public Engine { protected: // Engine APIs Common::Error run(); - virtual void errorString(const char *buf_input, char *buf_output, int buf_output_size); virtual bool hasFeature(EngineFeature f) const; virtual Debugger *getDebugger() { return _debugger; } diff --git a/engines/lure/debugger.cpp b/engines/lure/debugger.cpp index 9d54bccb49..68410875f7 100644 --- a/engines/lure/debugger.cpp +++ b/engines/lure/debugger.cpp @@ -534,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/decode.cpp b/engines/lure/decode.cpp index 3e139a10d6..59390e6e91 100644 --- a/engines/lure/decode.cpp +++ b/engines/lure/decode.cpp @@ -131,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 { @@ -143,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); @@ -184,7 +184,7 @@ MemoryBlock *PictureDecoder::egaDecode(MemoryBlock *src, uint32 maxOutputSize) { } } else { - // Fourth favourite + // Fourth favorite v = popTable[tableOffset + 96]; } @@ -193,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/detection.cpp b/engines/lure/detection.cpp index a69300ee2f..ced0be0cfb 100644 --- a/engines/lure/detection.cpp +++ b/engines/lure/detection.cpp @@ -205,7 +205,7 @@ public: LureMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Lure of the Temptress"; + return "Lure"; } virtual const char *getOriginalCopyright() const { @@ -271,11 +271,8 @@ SaveStateList LureMetaEngine::listSaves(const char *target) const { int LureMetaEngine::getMaximumSaveSlot() const { return 999; } void LureMetaEngine::removeSaveState(const char *target, int slot) const { - char extension[6]; - snprintf(extension, sizeof(extension), ".%03d", slot); - Common::String filename = target; - filename += extension; + filename += Common::String::format(".%03d", slot); g_system->getSavefileManager()->removeSavefile(filename); } diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp index c6be5c48fe..3217cf039d 100644 --- a/engines/lure/lure.cpp +++ b/engines/lure/lure.cpp @@ -51,7 +51,7 @@ LureEngine::LureEngine(OSystem *system, const LureGameDescription *gameDesc) Common::Error LureEngine::init() { int_engine = this; - _initialised = false; + _initialized = false; _saveLoadAllowed = false; initGraphics(FULL_SCREEN_WIDTH, FULL_SCREEN_HEIGHT, false); @@ -85,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(); @@ -102,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 53fdb8c713..34bb9f1639 100644 --- a/engines/lure/lure.h +++ b/engines/lure/lure.h @@ -65,7 +65,7 @@ struct LureGameDescription; class LureEngine : public Engine { private: - bool _initialised; + bool _initialized; int _gameToLoad; uint8 _saveVersion; Disk *_disk; @@ -123,7 +123,7 @@ public: virtual Common::Error loadGameState(int slot) { return loadGame(slot) ? Common::kReadingFailed : Common::kNoError; } - virtual Common::Error saveGameState(int slot, const char *desc) { + virtual Common::Error saveGameState(int slot, const Common::String &desc) { Common::String s(desc); return saveGame(slot, s) ? Common::kReadingFailed : Common::kNoError; } diff --git a/engines/lure/res.cpp b/engines/lure/res.cpp index 31c4efa2aa..fbf9f33b87 100644 --- a/engines/lure/res.cpp +++ b/engines/lure/res.cpp @@ -345,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_struct.cpp b/engines/lure/res_struct.cpp index 0d9d75b00b..222f55b5dc 100644 --- a/engines/lure/res_struct.cpp +++ b/engines/lure/res_struct.cpp @@ -415,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/sound.h b/engines/lure/sound.h index 58b4a68966..9fa9a91260 100644 --- a/engines/lure/sound.h +++ b/engines/lure/sound.h @@ -153,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/surface.cpp b/engines/lure/surface.cpp index 106b62b7a4..bfada8fde6 100644 --- a/engines/lure/surface.cpp +++ b/engines/lure/surface.cpp @@ -33,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; @@ -45,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); @@ -80,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 56af37c049..d56e37632b 100644 --- a/engines/lure/surface.h +++ b/engines/lure/surface.h @@ -49,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/animation.cpp b/engines/m4/animation.cpp index c89f74bd0a..39a3f175cd 100644 --- a/engines/m4/animation.cpp +++ b/engines/m4/animation.cpp @@ -61,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]; @@ -131,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); @@ -266,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; @@ -279,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; @@ -289,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 ed6f49786d..68a2883241 100644 --- a/engines/m4/animation.h +++ b/engines/m4/animation.h @@ -111,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/compression.cpp b/engines/m4/compression.cpp index 4ec9fae32f..65a25c14e3 100644 --- a/engines/m4/compression.cpp +++ b/engines/m4/compression.cpp @@ -44,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"); @@ -121,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 a24a41da3c..cb0ef74eb7 100644 --- a/engines/m4/compression.h +++ b/engines/m4/compression.h @@ -45,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 6f45f11f5a..fa4ca6d121 100644 --- a/engines/m4/console.cpp +++ b/engines/m4/console.cpp @@ -267,7 +267,7 @@ bool MadsConsole::cmdObject(int argc, const char **argv) { DebugPrintf("%2d - ", objStart); for (uint objId = objStart; objId < MIN<uint>(_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)); } @@ -297,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/globals.cpp b/engines/m4/globals.cpp index 58cadb3c9f..bf2c3abe1c 100644 --- a/engines/m4/globals.cpp +++ b/engines/m4/globals.cpp @@ -154,24 +154,24 @@ void Kernel::loadGlobalScriptFunctions() { } void Kernel::loadSectionScriptFunctions() { - char tempFnName[128]; - snprintf(tempFnName, 128, "section_init_%d", currentSection); + Common::String tempFnName; + tempFnName = Common::String::format("section_init_%d", currentSection); _sectionInitFn = _vm->_script->loadFunction(tempFnName); - snprintf(tempFnName, 128, "section_daemon_%d", currentSection); + tempFnName = Common::String::format("section_daemon_%d", currentSection); _sectionDaemonFn = _vm->_script->loadFunction(tempFnName); - snprintf(tempFnName, 128, "section_parser_%d", currentSection); + tempFnName = Common::String::format("section_parser_%d", currentSection); _sectionParserFn = _vm->_script->loadFunction(tempFnName); } void Kernel::loadRoomScriptFunctions() { - char tempFnName[128]; - snprintf(tempFnName, 128, "room_init_%d", currentRoom); + Common::String tempFnName; + tempFnName = Common::String::format("room_init_%d", currentRoom); _roomInitFn = _vm->_script->loadFunction(tempFnName); - snprintf(tempFnName, 128, "room_daemon_%d", currentRoom); + tempFnName = Common::String::format("room_daemon_%d", currentRoom); _roomDaemonFn = _vm->_script->loadFunction(tempFnName); - snprintf(tempFnName, 128, "room_pre_parser_%d", currentRoom); + tempFnName = Common::String::format("room_pre_parser_%d", currentRoom); _roomPreParserFn = _vm->_script->loadFunction(tempFnName); - snprintf(tempFnName, 128, "room_parser_%d", currentRoom); + tempFnName = Common::String::format("room_parser_%d", currentRoom); _roomParserFn = _vm->_script->loadFunction(tempFnName); } @@ -523,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 a95e5169be..ae2941c169 100644 --- a/engines/m4/globals.h +++ b/engines/m4/globals.h @@ -177,13 +177,14 @@ public: MadsObject() {} MadsObject(Common::SeekableReadStream *stream); void load(Common::SeekableReadStream *stream); - bool isInInventory() const { return roomNumber == PLAYER_INVENTORY; } - - uint16 descId; - uint16 roomNumber; - MADSArticles article; - uint8 vocabCount; - VocabEntry vocabList[3]; + bool isInInventory() const { return _roomNumber == PLAYER_INVENTORY; } + void setRoom(int roomNumber); + + uint16 _descId; + uint16 _roomNumber; + MADSArticles _article; + uint8 _vocabCount; + VocabEntry _vocabList[3]; }; typedef Common::Array<Common::SharedPtr<MadsObject> > MadsObjectArray; diff --git a/engines/m4/gui.h b/engines/m4/gui.h index 99b44a3af7..2b673d624c 100644 --- a/engines/m4/gui.h +++ b/engines/m4/gui.h @@ -443,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/m4.cpp b/engines/m4/m4.cpp index d456accca1..93f5ab4cba 100644 --- a/engines/m4/m4.cpp +++ b/engines/m4/m4.cpp @@ -530,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 4c9b100117..18c3936db8 100644 --- a/engines/m4/m4.h +++ b/engines/m4/m4.h @@ -223,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/mads_anim.cpp b/engines/m4/mads_anim.cpp index dc2758bedc..d35b31943a 100644 --- a/engines/m4/mads_anim.cpp +++ b/engines/m4/mads_anim.cpp @@ -603,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_logic.cpp b/engines/m4/mads_logic.cpp index a28d38080b..b1e57bd7f3 100644 --- a/engines/m4/mads_logic.cpp +++ b/engines/m4/mads_logic.cpp @@ -31,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); @@ -170,7 +170,7 @@ const char *MadsSceneLogic::_opcodeStrings[] = { * 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() { +void MadsSceneLogic::initializeDataMap() { // The unique order of these items must be maintained } */ @@ -382,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"); @@ -951,7 +951,7 @@ void MadsSceneLogic::callSubroutine(int subIndex, Common::Stack<ScriptVar> &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; } @@ -978,6 +978,14 @@ void MadsSceneLogic::callSubroutine(int subIndex, Common::Stack<ScriptVar> &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 016adb2ebf..3132094252 100644 --- a/engines/m4/mads_logic.h +++ b/engines/m4/mads_logic.h @@ -92,7 +92,7 @@ public: MadsSceneLogic() { _scriptsData = NULL; } ~MadsSceneLogic() { delete _scriptsData; } - void initialiseScripts(); + void initializeScripts(); void selectScene(int sceneNum); void setupScene(); @@ -109,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 a6e2b77253..fa65329d76 100644 --- a/engines/m4/mads_menus.cpp +++ b/engines/m4/mads_menus.cpp @@ -596,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; @@ -622,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 766767dc84..4d3ea5da39 100644 --- a/engines/m4/mads_menus.h +++ b/engines/m4/mads_menus.h @@ -117,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_scene.cpp b/engines/m4/mads_scene.cpp index b305242bbb..a0acbdd69d 100644 --- a/engines/m4/mads_scene.cpp +++ b/engines/m4/mads_scene.cpp @@ -94,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); } /** @@ -113,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); @@ -428,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 + } + } + } @@ -596,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"); @@ -668,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); @@ -864,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); } @@ -919,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); } @@ -972,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'; @@ -1002,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'; @@ -1060,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 12d7088a2f..9835de4daf 100644 --- a/engines/m4/mads_scene.h +++ b/engines/m4/mads_scene.h @@ -108,8 +108,8 @@ public: public: MadsScene(MadsEngine *vm); virtual ~MadsScene(); - void initialise() { - _sceneLogic.initialiseScripts(); + void initialize() { + _sceneLogic.initializeScripts(); } // Methods that differ between engines @@ -177,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 7628c0d650..b66591a207 100644 --- a/engines/m4/mads_views.cpp +++ b/engines/m4/mads_views.cpp @@ -100,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); @@ -119,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); @@ -165,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(); @@ -184,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 { @@ -256,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; @@ -271,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 72a70cfbc0..6be2283a32 100644 --- a/engines/m4/mads_views.h +++ b/engines/m4/mads_views.h @@ -34,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; @@ -62,7 +63,7 @@ public: int _currentAction; int8 _flags1, _flags2; MadsActionMode _actionMode; - MAdsActionMode2 _actionMode2; + MadsActionMode2 _actionMode2; int _articleNumber; bool _lookFlag; int _selectedRow; @@ -82,7 +83,7 @@ public: int16 _v86F4C; int _v83338; bool _inProgress; - bool _v8453A; + AbortTimerMode _v8453A; public: MadsAction(MadsView &owner); @@ -96,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; @@ -447,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/rails.cpp b/engines/m4/rails.cpp index d706af8ef1..f51d81c8f4 100644 --- a/engines/m4/rails.cpp +++ b/engines/m4/rails.cpp @@ -61,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); @@ -246,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); @@ -312,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 ccc9e00536..80bb55e9de 100644 --- a/engines/m4/rails.h +++ b/engines/m4/rails.h @@ -73,7 +73,7 @@ public: private: Common::Array<RailNode *> _nodes; - Common::Array<int16 *> _edges; + Common::Array<int16> _edges; Common::List<NoWalkRect *> _noWalkRects; M4Surface *_walkCodes; diff --git a/engines/made/database.cpp b/engines/made/database.cpp index 6e5a3228f3..1151339d49 100644 --- a/engines/made/database.cpp +++ b/engines/made/database.cpp @@ -106,7 +106,7 @@ void Object::setVectorItem(int16 index, int16 value) { } } -void Object::dump(const char *filename) { +void Object::dump(const Common::String &filename) { /* FILE *o = fopen(filename, "wb"); fwrite(_objData, _objSize, 1, o); @@ -373,9 +373,7 @@ int16 GameDatabase::setObjectProperty(int16 objectIndex, int16 propertyId, int16 void GameDatabase::dumpObject(int16 index) { Object *obj = getObject(index); - char fn[512]; - sprintf(fn, "obj%04X.0", index); - obj->dump(fn); + obj->dump(Common::String::format("obj%04X.0", index)); } diff --git a/engines/made/database.h b/engines/made/database.h index 94acef98cd..3bf69ca116 100644 --- a/engines/made/database.h +++ b/engines/made/database.h @@ -62,7 +62,7 @@ public: int16 getVectorItem(int16 index); void setVectorItem(int16 index, int16 value); - void dump(const char *filename); + void dump(const Common::String &filename); protected: bool _freeData; diff --git a/engines/made/made.cpp b/engines/made/made.cpp index a9c4587b4c..75d39fa205 100644 --- a/engines/made/made.cpp +++ b/engines/made/made.cpp @@ -181,9 +181,7 @@ void MadeEngine::resetAllTimers() { } Common::String MadeEngine::getSavegameFilename(int16 saveNum) { - char filename[256]; - snprintf(filename, 256, "%s.%03d", getTargetName().c_str(), saveNum); - return filename; + return Common::String::format("%s.%03d", getTargetName().c_str(), saveNum); } void MadeEngine::handleEvents() { diff --git a/engines/made/script.cpp b/engines/made/script.cpp index 85e1a6ec6b..2776008828 100644 --- a/engines/made/script.cpp +++ b/engines/made/script.cpp @@ -639,10 +639,9 @@ void ScriptInterpreter::dumpScript(int16 objectIndex, int *opcodeStats, int *ext const char *sig = _commands[opcode - 1].sig; int valueType; /* 0: dec; 1: hex; 2: extended function */ int16 value; - char tempStr[32]; opcodeStats[opcode - 1]++; - snprintf(tempStr, 32, "[%04X] ", (uint16)(code - codeStart - 1)); - codeLine += tempStr; + + codeLine += Common::String::format("[%04X] ", (uint16)(code - codeStart - 1)); codeLine += desc; for (; *sig != '\0'; sig++) { codeLine += " "; @@ -670,19 +669,21 @@ void ScriptInterpreter::dumpScript(int16 objectIndex, int *opcodeStats, int *ext value = *code++; break; } + + Common::String tempStr; switch (valueType) { case 0: - snprintf(tempStr, 32, "%d", value); + tempStr = Common::String::format("%d", value); break; case 1: - snprintf(tempStr, 32, "0x%X", value); + tempStr = Common::String::format("0x%X", value); break; case 2: if (value < _functions->getCount()) { - snprintf(tempStr, 32, "%s", _functions->getFuncName(value)); + tempStr = Common::String::format("%s", _functions->getFuncName(value)); externStats[value]++; } else { - snprintf(tempStr, 32, "invalid: %d", value); + tempStr = Common::String::format("invalid: %d", value); } break; } diff --git a/engines/made/scriptfuncs.cpp b/engines/made/scriptfuncs.cpp index 98cfb647ac..aa172bbe74 100644 --- a/engines/made/scriptfuncs.cpp +++ b/engines/made/scriptfuncs.cpp @@ -502,28 +502,28 @@ int16 ScriptFunctions::sfDrawText(int16 argc, int16 *argv) { } if (text) { - char finalText[1024]; + Common::String finalText; switch (argc) { case 1: - snprintf(finalText, 1024, "%s", text); + finalText = text; break; case 2: - snprintf(finalText, 1024, text, argv[0]); + finalText = Common::String::format(text, argv[0]); break; case 3: - snprintf(finalText, 1024, text, argv[1], argv[0]); + finalText = Common::String::format(text, argv[1], argv[0]); break; case 4: - snprintf(finalText, 1024, text, argv[2], argv[1], argv[0]); + finalText = Common::String::format(text, argv[2], argv[1], argv[0]); break; case 5: - snprintf(finalText, 1024, text, argv[3], argv[2], argv[1], argv[0]); + finalText = Common::String::format(text, argv[3], argv[2], argv[1], argv[0]); break; default: - finalText[0] = '\0'; + // Leave it empty break; } - _vm->_screen->printText(finalText); + _vm->_screen->printText(finalText.c_str()); } return 0; diff --git a/engines/mohawk/cstime_ui.cpp b/engines/mohawk/cstime_ui.cpp index ee08384590..de7d5bde80 100644 --- a/engines/mohawk/cstime_ui.cpp +++ b/engines/mohawk/cstime_ui.cpp @@ -643,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 @@ -810,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/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index a4e7f0349c..375806cda4 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -3781,7 +3781,7 @@ void LBProxyItem::init() { 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; + uint16 baseId = 0; for (uint i = 0; i < filename.size(); i++) { if (filename[i] == ';') { baseId = atoi(filename.c_str() + i + 1); diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index 4f9c3a893e..b60f8bd1ee 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -1168,7 +1168,7 @@ Common::Error MohawkEngine_Myst::loadGameState(int slot) { return Common::kUnknownError; } -Common::Error MohawkEngine_Myst::saveGameState(int slot, const char *desc) { +Common::Error MohawkEngine_Myst::saveGameState(int slot, const Common::String &desc) { Common::StringArray saveList = _gameState->generateSaveGameList(); if ((uint)slot < saveList.size()) diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h index 5edf774ed0..ebcc3b445c 100644 --- a/engines/mohawk/myst.h +++ b/engines/mohawk/myst.h @@ -193,7 +193,7 @@ public: bool canLoadGameStateCurrently(); bool canSaveGameStateCurrently(); Common::Error loadGameState(int slot); - Common::Error saveGameState(int slot, const char *desc); + Common::Error saveGameState(int slot, const Common::String &desc); bool hasFeature(EngineFeature f) const; private: diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp index f77ae753d9..70abf0ccd3 100644 --- a/engines/mohawk/myst_stacks/myst.cpp +++ b/engines/mohawk/myst_stacks/myst.cpp @@ -2839,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/riven.cpp b/engines/mohawk/riven.cpp index f407e650f6..57a0ac717d 100644 --- a/engines/mohawk/riven.cpp +++ b/engines/mohawk/riven.cpp @@ -727,7 +727,7 @@ Common::Error MohawkEngine_Riven::loadGameState(int slot) { return _saveLoad->loadGame(_saveLoad->generateSaveGameList()[slot]) ? Common::kNoError : Common::kUnknownError; } -Common::Error MohawkEngine_Riven::saveGameState(int slot, const char *desc) { +Common::Error MohawkEngine_Riven::saveGameState(int slot, const Common::String &desc) { Common::StringArray saveList = _saveLoad->generateSaveGameList(); if ((uint)slot < saveList.size()) diff --git a/engines/mohawk/riven.h b/engines/mohawk/riven.h index e01e03895c..c80f497e37 100644 --- a/engines/mohawk/riven.h +++ b/engines/mohawk/riven.h @@ -126,7 +126,7 @@ public: bool canLoadGameStateCurrently() { return true; } bool canSaveGameStateCurrently() { return true; } Common::Error loadGameState(int slot); - Common::Error saveGameState(int slot, const char *desc); + Common::Error saveGameState(int slot, const Common::String &desc); bool hasFeature(EngineFeature f) const; typedef void (*TimerProc)(MohawkEngine_Riven *vm); diff --git a/engines/queen/command.cpp b/engines/queen/command.cpp index 4f86d1f7ec..7876dbfae9 100644 --- a/engines/queen/command.cpp +++ b/engines/queen/command.cpp @@ -1081,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 772d6cb0f1..aa72537a9f 100644 --- a/engines/queen/command.h +++ b/engines/queen/command.h @@ -97,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/cutaway.cpp b/engines/queen/cutaway.cpp index 70d8252299..de54b7e33c 100644 --- a/engines/queen/cutaway.cpp +++ b/engines/queen/cutaway.cpp @@ -1152,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/display.h b/engines/queen/display.h index ffb4479426..4256b19d72 100644 --- a/engines/queen/display.h +++ b/engines/queen/display.h @@ -44,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 @@ -138,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/logic.cpp b/engines/queen/logic.cpp index db496bee39..f60ac59ff1 100644 --- a/engines/queen/logic.cpp +++ b/engines/queen/logic.cpp @@ -1626,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/musicdata.cpp b/engines/queen/musicdata.cpp index afcc54d2e6..d3974dcdbf 100644 --- a/engines/queen/musicdata.cpp +++ b/engines/queen/musicdata.cpp @@ -493,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 */ @@ -1238,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 */ @@ -1697,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 97f757c418..a10e74bfd8 100644 --- a/engines/queen/queen.cpp +++ b/engines/queen/queen.cpp @@ -69,7 +69,7 @@ public: }; const char *QueenMetaEngine::getName() const { - return "Flight of the Amazon Queen"; + return "Queen"; } const char *QueenMetaEngine::getOriginalCopyright() const { @@ -168,11 +168,8 @@ SaveStateList QueenMetaEngine::listSaves(const char *target) const { } void QueenMetaEngine::removeSaveState(const char *target, int slot) const { - char extension[6]; - snprintf(extension, sizeof(extension), ".s%02d", slot); - Common::String filename = target; - filename += extension; + filename += Common::String::format(".s%02d", slot); g_system->getSavefileManager()->removeSavefile(filename); } @@ -318,7 +315,7 @@ bool QueenEngine::canLoadOrSave() const { return !_input->cutawayRunning() && !(_resource->isDemo() || _resource->isInterview()); } -Common::Error QueenEngine::saveGameState(int slot, const char *desc) { +Common::Error QueenEngine::saveGameState(int slot, const Common::String &desc) { debug(3, "Saving game to slot %d", slot); char name[20]; Common::Error err = Common::kNoError; @@ -341,7 +338,7 @@ Common::Error QueenEngine::saveGameState(int slot, const char *desc) { file->writeUint32BE(0); file->writeUint32BE(dataSize); char description[32]; - Common::strlcpy(description, desc, sizeof(description)); + Common::strlcpy(description, desc.c_str(), sizeof(description)); file->write(description, sizeof(description)); // write save data diff --git a/engines/queen/queen.h b/engines/queen/queen.h index 5affe8e01a..bb299e2a80 100644 --- a/engines/queen/queen.h +++ b/engines/queen/queen.h @@ -112,7 +112,7 @@ public: void update(bool checkPlayerInput = false); bool canLoadOrSave() const; - Common::Error saveGameState(int slot, const char *desc); + Common::Error saveGameState(int slot, const Common::String &desc); Common::Error loadGameState(int slot); void makeGameStateName(int slot, char *buf) const; int getGameStateSlot(const char *filename) const; diff --git a/engines/queen/structs.h b/engines/queen/structs.h index b0a26ed4ba..6dd98fa1f5 100644 --- a/engines/queen/structs.h +++ b/engines/queen/structs.h @@ -77,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 @@ -86,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; @@ -94,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/walk.cpp b/engines/queen/walk.cpp index c5cfbb7d5f..b5c9b97ce0 100644 --- a/engines/queen/walk.cpp +++ b/engines/queen/walk.cpp @@ -111,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; @@ -482,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/saga/detection.cpp b/engines/saga/detection.cpp index b23baf4cc3..23bdc73666 100644 --- a/engines/saga/detection.cpp +++ b/engines/saga/detection.cpp @@ -223,11 +223,8 @@ SaveStateList SagaMetaEngine::listSaves(const char *target) const { int SagaMetaEngine::getMaximumSaveSlot() const { return MAX_SAVES - 1; } void SagaMetaEngine::removeSaveState(const char *target, int slot) const { - char extension[6]; - snprintf(extension, sizeof(extension), ".s%02d", slot); - Common::String filename = target; - filename += extension; + filename += Common::String::format(".s%02d", slot);; g_system->getSavefileManager()->removeSavefile(filename); } @@ -363,8 +360,8 @@ Common::Error SagaEngine::loadGameState(int slot) { return Common::kNoError; // TODO: return success/failure } -Common::Error SagaEngine::saveGameState(int slot, const char *desc) { - save(calcSaveFileName((uint)slot), desc); +Common::Error SagaEngine::saveGameState(int slot, const Common::String &desc) { + save(calcSaveFileName((uint)slot), desc.c_str()); return Common::kNoError; // TODO: return success/failure } diff --git a/engines/saga/font.cpp b/engines/saga/font.cpp index a5363909ff..8c3f4d7c42 100644 --- a/engines/saga/font.cpp +++ b/engines/saga/font.cpp @@ -40,6 +40,10 @@ Font::Font(SagaEngine *vm) : _vm(vm) { _fonts.resize(_vm->getFontsCount()); for (i = 0; i < _vm->getFontsCount(); i++) { +#ifdef __DS__ + _fonts[i].outline.font = NULL; + _fonts[i].normal.font = NULL; +#endif loadFont(&_fonts[i], _vm->getFontDescription(i)->fontResourceId); } @@ -48,6 +52,18 @@ Font::Font(SagaEngine *vm) : _vm(vm) { Font::~Font() { debug(8, "Font::~Font(): Freeing fonts."); + +#ifdef __DS__ + for (int i = 0; i < _vm->getFontsCount(); i++) { + if (_fonts[i].outline.font) { + free(_fonts[i].outline.font); + } + + if (_fonts[i].normal.font) { + free(_fonts[i].normal.font); + } + } +#endif } @@ -104,9 +120,17 @@ void Font::loadFont(FontData *font, uint32 fontResourceId) { error("Invalid font resource size"); } +#ifndef __DS__ font->normal.font.resize(fontResourceData.size() - FONT_DESCSIZE); memcpy(font->normal.font.getBuffer(), fontResourceData.getBuffer() + FONT_DESCSIZE, fontResourceData.size() - FONT_DESCSIZE); +#else + if (font->normal.font) { + free(font->normal.font); + } + font->normal.font = (byte *) malloc(fontResourceData.size() - FONT_DESCSIZE); + memcpy(font->normal.font, fontResourceData.getBuffer() + FONT_DESCSIZE, fontResourceData.size() - FONT_DESCSIZE); +#endif // Create outline font style createOutline(font); @@ -150,7 +174,15 @@ void Font::createOutline(FontData *font) { font->outline.header.rowLength = newRowLength; // Allocate new font representation storage +#ifdef __DS__ + if (font->outline.font) { + free(font->outline.font); + } + + font->outline.font = (byte *) calloc(newRowLength * font->outline.header.charHeight, 1); +#else font->outline.font.resize(newRowLength * font->outline.header.charHeight); +#endif // Generate outline font representation diff --git a/engines/saga/font.h b/engines/saga/font.h index 75d5fa95b9..a45299ad48 100644 --- a/engines/saga/font.h +++ b/engines/saga/font.h @@ -117,7 +117,11 @@ struct FontCharEntry { struct FontStyle { FontHeader header; FontCharEntry fontCharEntry[256]; +#ifndef __DS__ ByteArray font; +#else + byte* font; +#endif }; struct FontData { diff --git a/engines/saga/objectmap.cpp b/engines/saga/objectmap.cpp index b9594625e1..b300a247e9 100644 --- a/engines/saga/objectmap.cpp +++ b/engines/saga/objectmap.cpp @@ -191,7 +191,7 @@ void ObjectMap::clear() { #ifdef SAGA_DEBUG void ObjectMap::draw(const Point& testPoint, int color, int color2) { int hitZoneIndex; - char txtBuf[32]; + Common::String txtBuf; Point pickPoint; Point textPoint; Location pickLocation; @@ -210,10 +210,10 @@ void ObjectMap::draw(const Point& testPoint, int color, int color2) { } if (hitZoneIndex != -1) { - snprintf(txtBuf, sizeof(txtBuf), "hitZone %d", hitZoneIndex); + txtBuf = Common::String::format("hitZone %d", hitZoneIndex); textPoint.x = 2; textPoint.y = 2; - _vm->_font->textDraw(kKnownFontSmall, txtBuf, textPoint, kITEColorBrightWhite, kITEColorBlack, kFontOutline); + _vm->_font->textDraw(kKnownFontSmall, txtBuf.c_str(), textPoint, kITEColorBrightWhite, kITEColorBlack, kFontOutline); } } #endif diff --git a/engines/saga/saga.h b/engines/saga/saga.h index 6d33979028..23258e1277 100644 --- a/engines/saga/saga.h +++ b/engines/saga/saga.h @@ -654,7 +654,7 @@ public: const Common::Rect &getDisplayClip() const { return _displayClip;} Common::Error loadGameState(int slot); - Common::Error saveGameState(int slot, const char *desc); + Common::Error saveGameState(int slot, const Common::String &desc); bool canLoadGameStateCurrently(); bool canSaveGameStateCurrently(); const GameDisplayInfo &getDisplayInfo(); diff --git a/engines/saga/script.cpp b/engines/saga/script.cpp index 9502631f37..f4902b6c11 100644 --- a/engines/saga/script.cpp +++ b/engines/saga/script.cpp @@ -1154,7 +1154,7 @@ void Script::showVerb(int statusColor) { const char *verbName; const char *object1Name; const char *object2Name; - char statusString[STATUS_TEXT_LEN]; + Common::String statusString; if (_leftButtonVerb == getVerbType(kVerbNone)) { _vm->_interface->setStatusText(""); @@ -1174,8 +1174,8 @@ void Script::showVerb(int statusColor) { object1Name = _vm->getObjectName(_currentObject[0]); if (!_secondObjectNeeded) { - snprintf(statusString, STATUS_TEXT_LEN, "%s %s", verbName, object1Name); - _vm->_interface->setStatusText(statusString, statusColor); + statusString = Common::String::format("%s %s", verbName, object1Name); + _vm->_interface->setStatusText(statusString.c_str(), statusColor); return; } @@ -1187,15 +1187,15 @@ void Script::showVerb(int statusColor) { } if (_leftButtonVerb == getVerbType(kVerbGive)) { - snprintf(statusString, STATUS_TEXT_LEN, _vm->getTextString(kTextGiveTo), object1Name, object2Name); - _vm->_interface->setStatusText(statusString, statusColor); + statusString = Common::String::format(_vm->getTextString(kTextGiveTo), object1Name, object2Name); + _vm->_interface->setStatusText(statusString.c_str(), statusColor); } else { if (_leftButtonVerb == getVerbType(kVerbUse)) { - snprintf(statusString, STATUS_TEXT_LEN, _vm->getTextString(kTextUseWidth), object1Name, object2Name); - _vm->_interface->setStatusText(statusString, statusColor); + statusString = Common::String::format(_vm->getTextString(kTextUseWidth), object1Name, object2Name); + _vm->_interface->setStatusText(statusString.c_str(), statusColor); } else { - snprintf(statusString, STATUS_TEXT_LEN, "%s %s", verbName, object1Name); - _vm->_interface->setStatusText(statusString, statusColor); + statusString = Common::String::format("%s %s", verbName, object1Name); + _vm->_interface->setStatusText(statusString.c_str(), statusColor); } } } diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp index 70f987a129..c623349b7a 100644 --- a/engines/saga/sfuncs.cpp +++ b/engines/saga/sfuncs.cpp @@ -1553,18 +1553,15 @@ void Script::sfNull(SCRIPTFUNC_PARAMS) { } void Script::sfStub(const char *name, ScriptThread *thread, int nArgs) { - char buf[256], buf1[100]; - - snprintf(buf, 256, "STUB: %s(", name); + debugN(0, "STUB: %s(", name); for (int i = 0; i < nArgs; i++) { - snprintf(buf1, 100, "%d", thread->pop()); - strncat(buf, buf1, sizeof(buf) - strlen(buf) - 1); + debugN(0, "%d", thread->pop()); if (i + 1 < nArgs) - strncat(buf, ", ", sizeof(buf) - strlen(buf) - 1); + debugN(0, ", "); } - debug(0, "%s)", buf); + debug(0, ")"); } } // End of namespace Saga diff --git a/engines/saga/sfuncs_ihnm.cpp b/engines/saga/sfuncs_ihnm.cpp index 1a73677846..3fbf3b6e67 100644 --- a/engines/saga/sfuncs_ihnm.cpp +++ b/engines/saga/sfuncs_ihnm.cpp @@ -389,11 +389,10 @@ void Script::sfSetSpeechBox(SCRIPTFUNC_PARAMS) { void Script::sfDebugShowData(SCRIPTFUNC_PARAMS) { int16 param = thread->pop(); - char buf[50]; - snprintf(buf, 50, "Reached breakpoint %d", param); + Common::String buf = Common::String::format("Reached breakpoint %d", param); - _vm->_interface->setStatusText(buf); + _vm->_interface->setStatusText(buf.c_str()); } void Script::sfWaitFramesEsc(SCRIPTFUNC_PARAMS) { diff --git a/engines/savestate.cpp b/engines/savestate.cpp index 9ed8356d3b..551c39b880 100644 --- a/engines/savestate.cpp +++ b/engines/savestate.cpp @@ -52,20 +52,20 @@ void SaveStateDescriptor::setWriteProtectedFlag(bool state) { } void SaveStateDescriptor::setSaveDate(int year, int month, int day) { - char buffer[32]; - snprintf(buffer, 32, "%.2d.%.2d.%.4d", day, month, year); + Common::String buffer; + buffer = Common::String::format("%.2d.%.2d.%.4d", day, month, year); setVal("save_date", buffer); } void SaveStateDescriptor::setSaveTime(int hour, int min) { - char buffer[32]; - snprintf(buffer, 32, "%.2d:%.2d", hour, min); + Common::String buffer; + buffer = Common::String::format("%.2d:%.2d", hour, min); setVal("save_time", buffer); } void SaveStateDescriptor::setPlayTime(int hours, int minutes) { - char buffer[32]; - snprintf(buffer, 32, "%.2d:%.2d", hours, minutes); + Common::String buffer; + buffer = Common::String::format("%.2d:%.2d", hours, minutes); setVal("play_time", buffer); } diff --git a/engines/savestate.h b/engines/savestate.h index ce78bc4ba3..df01732058 100644 --- a/engines/savestate.h +++ b/engines/savestate.h @@ -49,9 +49,7 @@ public: } SaveStateDescriptor(int s, const Common::String &d) : _thumbnail() { - char buf[16]; - sprintf(buf, "%d", s); - setVal("save_slot", buf); + setVal("save_slot", Common::String::format("%d", s)); setVal("description", d); } diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 5f5af195b5..af945247ba 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -74,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); @@ -3359,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); diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index 61e6cc9d09..100b71efa7 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -748,7 +748,7 @@ Common::Error SciEngine::loadGameState(int slot) { } } -Common::Error SciEngine::saveGameState(int slot, const char *desc) { +Common::Error SciEngine::saveGameState(int slot, const Common::String &desc) { Common::String fileName = Common::String::format("%s.%03d", _targetName.c_str(), slot); Common::SaveFileManager *saveFileMan = g_engine->getSaveFileManager(); Common::OutSaveFile *out = saveFileMan->openForSaving(fileName); diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index 39e15aa84e..ee88d8af15 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -463,7 +463,7 @@ static int findSavegame(Common::Array<SavegameDesc> &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 75f8c25ed2..6c96266922 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -360,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/kpathing.cpp b/engines/sci/engine/kpathing.cpp index 0a4e2380a8..8904a48978 100644 --- a/engines/sci/engine/kpathing.cpp +++ b/engines/sci/engine/kpathing.cpp @@ -34,6 +34,8 @@ namespace Sci { +// TODO: Code cleanup + #define AVOIDPATH_DYNMEM_STRING "AvoidPath polyline" #define POLY_LAST_POINT 0x7777 @@ -1174,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); @@ -1197,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); - - if (err == PF_FATAL) { - warning("AvoidPath: fatal error finding nearest intersection"); - 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); - } - // 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); + 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 (!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 new_start; + delete pf_s; + return NULL; + } - Common::Point *new_end = fixup_end_point(pf_s, end); + 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 (!new_end) { - warning("AvoidPath: Couldn't fixup end position for pathfinding"); - delete pf_s; - return NULL; + if (err == PF_OK) + pf_s->_prependPoint = new Common::Point(start); } - + } else { // 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)) { @@ -1248,14 +1252,14 @@ 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); + // 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; - } + 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 b48de1c7ea..d83254b2c4 100644 --- a/engines/sci/engine/kscripts.cpp +++ b/engines/sci/engine/kscripts.cpp @@ -46,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) { @@ -192,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; diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index c3f2b4dee2..c3c10bd2a2 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -66,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/object.cpp b/engines/sci/engine/object.cpp index aee93ffaa7..f09f18298a 100644 --- a/engines/sci/engine/object.cpp +++ b/engines/sci/engine/object.cpp @@ -58,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 7e07fb2f6d..80c8e9e83d 100644 --- a/engines/sci/engine/object.h +++ b/engines/sci/engine/object.h @@ -236,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<uint16> _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 65b5e602ff..e43c7097ed 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -805,7 +805,7 @@ void SegManager::reconstructClones() { #pragma mark - -bool gamestate_save(EngineState *s, Common::WriteStream *fh, const char* savename, const char *version) { +bool gamestate_save(EngineState *s, Common::WriteStream *fh, const Common::String &savename, const Common::String &version) { TimeDate curTime; g_system->getTimeAndDate(curTime); diff --git a/engines/sci/engine/savegame.h b/engines/sci/engine/savegame.h index ff5bc5204b..fbd77eb076 100644 --- a/engines/sci/engine/savegame.h +++ b/engines/sci/engine/savegame.h @@ -79,7 +79,7 @@ struct SavegameMetadata { * @param savename The description of the savegame * @return 0 on success, 1 otherwise */ -bool gamestate_save(EngineState *s, Common::WriteStream *save, const char *savename, const char *version); +bool gamestate_save(EngineState *s, Common::WriteStream *save, const Common::String &savename, const Common::String &version); /** * Restores a game state from a directory. diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp index eae2dd674c..a38aa06bc4 100644 --- a/engines/sci/engine/script.cpp +++ b/engines/sci/engine/script.cpp @@ -492,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) { @@ -508,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; @@ -580,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 @@ -632,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) { @@ -667,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) { @@ -681,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 13744b6f93..ff061e0e36 100644 --- a/engines/sci/engine/script.h +++ b/engines/sci/engine/script.h @@ -137,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 @@ -280,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/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp index b28e8cd450..ab67da32db 100644 --- a/engines/sci/engine/seg_manager.cpp +++ b/engines/sci/engine/seg_manager.cpp @@ -1007,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; } @@ -1020,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 a579ba10e1..ab5aeacabf 100644 --- a/engines/sci/engine/seg_manager.h +++ b/engines/sci/engine/seg_manager.h @@ -71,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.h b/engines/sci/engine/segment.h index f5c5e2289d..009a2558ce 100644 --- a/engines/sci/engine/segment.h +++ b/engines/sci/engine/segment.h @@ -131,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.h b/engines/sci/engine/selector.h index dae1ea9266..f13c13e00c 100644 --- a/engines/sci/engine/selector.h +++ b/engines/sci/engine/selector.h @@ -44,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/workarounds.cpp b/engines/sci/engine/workarounds.cpp index aba2e66eff..fa25b02a8f 100644 --- a/engines/sci/engine/workarounds.cpp +++ b/engines/sci/engine/workarounds.cpp @@ -213,6 +213,7 @@ const SciWorkaroundEntry kDisplay_workarounds[] = { { 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 diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp index b015a6df7f..74879f6c63 100644 --- a/engines/sci/event.cpp +++ b/engines/sci/event.cpp @@ -250,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/graphics/animate.cpp b/engines/sci/graphics/animate.cpp index f72f9a78cc..c36ecd112a 100644 --- a/engines/sci/graphics/animate.cpp +++ b/engines/sci/graphics/animate.cpp @@ -230,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/cursor.cpp b/engines/sci/graphics/cursor.cpp index 6ad2cb3cb3..ec49a38814 100644 --- a/engines/sci/graphics/cursor.cpp +++ b/engines/sci/graphics/cursor.cpp @@ -252,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/text16.cpp b/engines/sci/graphics/text16.cpp index 459be7fcf7..c2f71a0e54 100644 --- a/engines/sci/graphics/text16.cpp +++ b/engines/sci/graphics/text16.cpp @@ -466,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/sci.cpp b/engines/sci/sci.cpp index cf46d41382..cc9042ceb7 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -213,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); @@ -227,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 a340447354..77718e4b37 100644 --- a/engines/sci/sci.h +++ b/engines/sci/sci.h @@ -221,7 +221,7 @@ public: virtual GUI::Debugger *getDebugger(); Console *getSciDebugger(); Common::Error loadGameState(int slot); - Common::Error saveGameState(int slot, const char *desc); + Common::Error saveGameState(int slot, const Common::String &desc); bool canLoadGameStateCurrently(); bool canSaveGameStateCurrently(); void syncSoundSettings(); diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp index 25a26f6cf2..e4057d1f13 100644 --- a/engines/scumm/actor.cpp +++ b/engines/scumm/actor.cpp @@ -2747,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/boxes.cpp b/engines/scumm/boxes.cpp index ba4dedfbd3..64d4d7422c 100644 --- a/engines/scumm/boxes.cpp +++ b/engines/scumm/boxes.cpp @@ -726,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; @@ -962,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++) { @@ -970,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 { @@ -1060,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; @@ -1158,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/detection.cpp b/engines/scumm/detection.cpp index bba26961c7..aecd13db5a 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -69,26 +69,26 @@ static const MD5Table *findInMD5Table(const char *md5) { Common::String ScummEngine::generateFilename(const int room) const { const int diskNumber = (room > 0) ? _res->_types[rtRoom][room]._roomno : 0; - char buf[128]; + 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: @@ -96,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) { @@ -115,16 +115,16 @@ Common::String ScummEngine_v60he::generateFilename(const int room) const { } 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); } } @@ -135,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) { @@ -156,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; @@ -179,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); } } @@ -199,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 { diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index 08ae9fdd96..1b913e16b4 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -583,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; diff --git a/engines/scumm/help.cpp b/engines/scumm/help.cpp index 59bf79658e..ae7a1ad3bc 100644 --- a/engines/scumm/help.cpp +++ b/engines/scumm/help.cpp @@ -107,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/imuse/imuse.cpp b/engines/scumm/imuse/imuse.cpp index fe23b88e52..7d971f5ca4 100644 --- a/engines/scumm/imuse/imuse.cpp +++ b/engines/scumm/imuse/imuse.cpp @@ -99,8 +99,9 @@ IMuseInternal::~IMuseInternal() { } } -byte *IMuseInternal::findStartOfSound(int sound) { +byte *IMuseInternal::findStartOfSound(int sound, int ct) { int32 size, pos; + static uint32 id[] = { 'MThd', 'FORM', 'MDhd', 'MDpg' }; byte *ptr = g_scumm->_res->_types[rtSound][sound]._address; @@ -110,10 +111,11 @@ byte *IMuseInternal::findStartOfSound(int sound) { } // Check for old-style headers first, like 'RO' + int trFlag = (kMThd | kFORM); if (ptr[0] == 'R' && ptr[1] == 'O'&& ptr[2] != 'L') - return ptr; + return ct == trFlag ? ptr : 0; if (ptr[4] == 'S' && ptr[5] == 'O') - return ptr + 4; + return ct == trFlag ? ptr + 4 : 0; ptr += 4; size = READ_BE_UINT32(ptr); @@ -124,12 +126,16 @@ 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; } @@ -556,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; @@ -576,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; diff --git a/engines/scumm/imuse/imuse_internal.h b/engines/scumm/imuse/imuse_internal.h index ec60b22509..8808a3655a 100644 --- a/engines/scumm/imuse/imuse_internal.h +++ b/engines/scumm/imuse/imuse_internal.h @@ -229,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: @@ -445,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; diff --git a/engines/scumm/imuse/imuse_part.cpp b/engines/scumm/imuse/imuse_part.cpp index 808af23dde..5df8407a96 100644 --- a/engines/scumm/imuse/imuse_part.cpp +++ b/engines/scumm/imuse/imuse_part.cpp @@ -137,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 e7ee935130..0b084f3116 100644 --- a/engines/scumm/imuse/imuse_player.cpp +++ b/engines/scumm/imuse/imuse_player.cpp @@ -90,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, @@ -108,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(); @@ -125,7 +120,7 @@ bool Player::startSound(int sound, MidiDriver *midi) { _midi = NULL; return false; } - + debugC(DEBUG_IMUSE, "Starting music %d", sound); return true; } @@ -199,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/sysex_scumm.cpp b/engines/scumm/imuse/sysex_scumm.cpp index 6ab71c2fa5..4eb3bee93c 100644 --- a/engines/scumm/imuse/sysex_scumm.cpp +++ b/engines/scumm/imuse/sysex_scumm.cpp @@ -64,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); @@ -71,7 +76,8 @@ 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) { diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp index 1a4ed91f1c..07c52578c3 100644 --- a/engines/scumm/input.cpp +++ b/engines/scumm/input.cpp @@ -117,7 +117,7 @@ void ScummEngine::parseEvent(Common::Event event) { if (_saveLoadSlot == 0) _saveLoadSlot = 10; - sprintf(_saveLoadName, "Quicksave %d", _saveLoadSlot); + _saveLoadDescription = Common::String::format("Quicksave %d", _saveLoadSlot); _saveLoadFlag = (event.kbd.hasFlags(Common::KBD_ALT)) ? 1 : 2; _saveTemporaryState = false; } else if (event.kbd.hasFlags(Common::KBD_CTRL) && event.kbd.keycode == Common::KEYCODE_f) { @@ -303,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/object.cpp b/engines/scumm/object.cpp index fb99d6ce7d..ae4bbc45a6 100644 --- a/engines/scumm/object.cpp +++ b/engines/scumm/object.cpp @@ -101,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; diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp index b85771e897..ba13ff46d9 100644 --- a/engines/scumm/palette.cpp +++ b/engines/scumm/palette.cpp @@ -214,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 diff --git a/engines/scumm/player_towns.cpp b/engines/scumm/player_towns.cpp index 5d49478cb0..e71a8d0587 100644 --- a/engines/scumm/player_towns.cpp +++ b/engines/scumm/player_towns.cpp @@ -585,7 +585,7 @@ Player_Towns_v2::~Player_Towns_v2() { _intf = 0; if (_imuseDispose) - delete _imuse; + delete _imuse; delete[] _sblData; delete[] _soundOverride; diff --git a/engines/scumm/player_v4a.h b/engines/scumm/player_v4a.h index b51ca2f993..d01c70f295 100644 --- a/engines/scumm/player_v4a.h +++ b/engines/scumm/player_v4a.h @@ -67,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/saveload.cpp b/engines/scumm/saveload.cpp index f5d219c721..19834cb35d 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -103,7 +103,7 @@ bool ScummEngine::canLoadGameStateCurrently() { return (VAR_MAINMENU_KEY == 0xFF || VAR(VAR_MAINMENU_KEY) != 0); } -Common::Error ScummEngine::saveGameState(int slot, const char *desc) { +Common::Error ScummEngine::saveGameState(int slot, const Common::String &desc) { requestSave(slot, desc); return Common::kNoError; } @@ -135,13 +135,11 @@ bool ScummEngine::canSaveGameStateCurrently() { } -void ScummEngine::requestSave(int slot, const char *name) { +void ScummEngine::requestSave(int slot, const Common::String &name) { _saveLoadSlot = slot; _saveTemporaryState = false; _saveLoadFlag = 1; // 1 for save - assert(name); - strncpy(_saveLoadName, name, sizeof(_saveLoadName)); - _saveLoadName[sizeof(_saveLoadName) - 1] = 0; + _saveLoadDescription = name; } void ScummEngine::requestLoad(int slot) { @@ -166,7 +164,7 @@ bool ScummEngine::saveState(Common::OutSaveFile *out, bool writeHeader) { SaveGameHeader hdr; if (writeHeader) { - memcpy(hdr.name, _saveLoadName, sizeof(hdr.name)); + Common::strlcpy(hdr.name, _saveLoadDescription.c_str(), sizeof(hdr.name)); saveSaveGameHeader(out, hdr); } #if !defined(__DS__) && !defined(__N64__) /* && !defined(__PLAYSTATION2__) */ @@ -387,7 +385,8 @@ bool ScummEngine::loadState(int slot, bool compat) { if (hdr.ver == VER(7)) hdr.ver = VER(8); - memcpy(_saveLoadName, hdr.name, sizeof(hdr.name)); + hdr.name[sizeof(hdr.name)-1] = 0; + _saveLoadDescription = hdr.name; // Unless specifically requested with _saveSound, we do not save the iMUSE // state for temporary state saves - such as certain cutscenes in DOTT, @@ -589,9 +588,9 @@ bool ScummEngine::loadState(int slot, bool compat) { } Common::String ScummEngine::makeSavegameName(const Common::String &target, int slot, bool temporary) { - char extension[6]; - snprintf(extension, sizeof(extension), ".%c%02d", temporary ? 'c' : 's', slot); - return (target + extension); + Common::String extension; + extension = Common::String::format(".%c%02d", temporary ? 'c' : 's', slot); + return target + extension; } void ScummEngine::listSavegames(bool *marks, int num) { diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp index b8f3b4b3b3..2c8f65496f 100644 --- a/engines/scumm/script_v5.cpp +++ b/engines/scumm/script_v5.cpp @@ -2646,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/scumm.cpp b/engines/scumm/scumm.cpp index e8dd6cb548..c0c477a597 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -213,7 +213,6 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) _saveLoadSlot = 0; _lastSaveTime = 0; _saveTemporaryState = false; - memset(_saveLoadName, 0, sizeof(_saveLoadName)); memset(_localScriptOffsets, 0, sizeof(_localScriptOffsets)); _scriptPointer = NULL; _scriptOrgPointer = NULL; @@ -2056,7 +2055,7 @@ void ScummEngine::scummLoop(int delta) { // Trigger autosave if necessary. if (!_saveLoadFlag && shouldPerformAutoSave(_lastSaveTime) && canSaveGameStateCurrently()) { _saveLoadSlot = 0; - sprintf(_saveLoadName, "Autosave %d", _saveLoadSlot); + _saveLoadDescription = Common::String::format("Autosave %d", _saveLoadSlot); _saveLoadFlag = 1; _saveTemporaryState = false; } diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index 636c909911..6e75f47d77 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -44,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 @@ -228,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, @@ -401,7 +401,7 @@ public: virtual Common::Error loadGameState(int slot); virtual bool canLoadGameStateCurrently(); - virtual Common::Error saveGameState(int slot, const char *desc); + virtual Common::Error saveGameState(int slot, const Common::String &desc); virtual bool canSaveGameStateCurrently(); virtual void pauseEngineIntern(bool pause); @@ -572,7 +572,7 @@ protected: uint32 _lastSaveTime; bool _saveTemporaryState; Common::String _saveLoadFileName; - char _saveLoadName[32]; + Common::String _saveLoadDescription; bool saveState(Common::OutSaveFile *out, bool writeHeader = true); bool saveState(int slot, bool compat); @@ -594,7 +594,7 @@ public: bool getSavegameName(int slot, Common::String &desc); void listSavegames(bool *marks, int num); - void requestSave(int slot, const char *name); + void requestSave(int slot, const Common::String &name); void requestLoad(int slot); // thumbnail + info stuff @@ -1120,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 9c492663dc..af481df0e0 100644 --- a/engines/scumm/scumm_v0.h +++ b/engines/scumm/scumm_v0.h @@ -94,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/string.cpp b/engines/scumm/string.cpp index c27b6d5e1c..4b3207c6bf 100644 --- a/engines/scumm/string.cpp +++ b/engines/scumm/string.cpp @@ -1210,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/sky/detection.cpp b/engines/sky/detection.cpp index 21921f2154..f3cce06ad6 100644 --- a/engines/sky/detection.cpp +++ b/engines/sky/detection.cpp @@ -79,7 +79,7 @@ public: }; const char *SkyMetaEngine::getName() const { - return "Beneath a Steel Sky"; + return "Sky"; } const char *SkyMetaEngine::getOriginalCopyright() const { @@ -151,9 +151,7 @@ GameList SkyMetaEngine::detectGames(const Common::FSList &fslist) const { while (sv->dinnerTableEntries) { if (dinnerTableEntries == sv->dinnerTableEntries && (sv->dataDiskSize == dataDiskSize || sv->dataDiskSize == -1)) { - char buf[32]; - snprintf(buf, sizeof(buf), "v0.0%d %s", sv->version, sv->extraDesc); - dg.updateDesc(buf); + dg.updateDesc(Common::String::format("v0.0%d %s", sv->version, sv->extraDesc).c_str()); dg.setGUIOptions(sv->guioptions); break; } @@ -282,7 +280,7 @@ Common::Error SkyEngine::loadGameState(int slot) { return (result == GAME_RESTORED) ? Common::kNoError : Common::kUnknownError; } -Common::Error SkyEngine::saveGameState(int slot, const char *desc) { +Common::Error SkyEngine::saveGameState(int slot, const Common::String &desc) { if (slot == 0) return Common::kWritePermissionDenied; // we can't overwrite the auto save diff --git a/engines/sky/logic.cpp b/engines/sky/logic.cpp index de081bb631..616670b0fd 100644 --- a/engines/sky/logic.cpp +++ b/engines/sky/logic.cpp @@ -1890,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; @@ -1939,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/sky.h b/engines/sky/sky.h index 0b5f4c5c1c..cd8a650d60 100644 --- a/engines/sky/sky.h +++ b/engines/sky/sky.h @@ -87,7 +87,7 @@ public: static bool isCDVersion(); Common::Error loadGameState(int slot); - Common::Error saveGameState(int slot, const char *desc); + Common::Error saveGameState(int slot, const Common::String &desc); bool canLoadGameStateCurrently(); bool canSaveGameStateCurrently(); diff --git a/engines/sky/sound.cpp b/engines/sky/sound.cpp index c6bcb2a4c4..e94a2a61d9 100644 --- a/engines/sky/sound.cpp +++ b/engines/sky/sound.cpp @@ -313,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, { @@ -985,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/sword1/animation.cpp b/engines/sword1/animation.cpp index b66cc6b5a7..7e9d1142be 100644 --- a/engines/sword1/animation.cpp +++ b/engines/sword1/animation.cpp @@ -85,7 +85,7 @@ MoviePlayer::~MoviePlayer() { */ bool MoviePlayer::load(uint32 id) { Common::File f; - char filename[20]; + Common::String filename; if (_decoderType == kVideoDecoderDXA) _bgSoundStream = Audio::SeekableAudioStream::openStreamFile(sequenceList[id]); @@ -93,7 +93,7 @@ bool MoviePlayer::load(uint32 id) { _bgSoundStream = NULL; if (SwordEngine::_systemVars.showText) { - sprintf(filename, "%s.txt", sequenceList[id]); + filename = Common::String::format("%s.txt", sequenceList[id]); if (f.open(filename)) { Common::String line; int lineNo = 0; @@ -117,12 +117,12 @@ bool MoviePlayer::load(uint32 id) { ptr++; if (startFrame > endFrame) { - warning("%s:%d: startFrame (%d) > endFrame (%d)", filename, lineNo, startFrame, endFrame); + warning("%s:%d: startFrame (%d) > endFrame (%d)", filename.c_str(), lineNo, startFrame, endFrame); continue; } if (startFrame <= lastEnd) { - warning("%s:%d startFrame (%d) <= lastEnd (%d)", filename, lineNo, startFrame, lastEnd); + warning("%s:%d startFrame (%d) <= lastEnd (%d)", filename.c_str(), lineNo, startFrame, lastEnd); continue; } @@ -135,14 +135,14 @@ bool MoviePlayer::load(uint32 id) { switch (_decoderType) { case kVideoDecoderDXA: - snprintf(filename, sizeof(filename), "%s.dxa", sequenceList[id]); + filename = Common::String::format("%s.dxa", sequenceList[id]); break; case kVideoDecoderSMK: - snprintf(filename, sizeof(filename), "%s.smk", sequenceList[id]); + filename = Common::String::format("%s.smk", sequenceList[id]); break; } - return _decoder->loadFile(filename); + return _decoder->loadFile(filename.c_str()); } void MoviePlayer::play() { @@ -323,18 +323,18 @@ uint32 DXADecoderWithSound::getElapsedTime() const { /////////////////////////////////////////////////////////////////////////////// MoviePlayer *makeMoviePlayer(uint32 id, SwordEngine *vm, Text *textMan, Audio::Mixer *snd, OSystem *system) { - char filename[20]; + Common::String filename; char buf[60]; Audio::SoundHandle *bgSoundHandle = new Audio::SoundHandle; - snprintf(filename, sizeof(filename), "%s.smk", sequenceList[id]); + filename = Common::String::format("%s.smk", sequenceList[id]); if (Common::File::exists(filename)) { Video::SmackerDecoder *smkDecoder = new Video::SmackerDecoder(snd); return new MoviePlayer(vm, textMan, snd, system, bgSoundHandle, smkDecoder, kVideoDecoderSMK); } - snprintf(filename, sizeof(filename), "%s.dxa", sequenceList[id]); + filename = Common::String::format("%s.dxa", sequenceList[id]); if (Common::File::exists(filename)) { #ifdef USE_ZLIB @@ -348,7 +348,7 @@ MoviePlayer *makeMoviePlayer(uint32 id, SwordEngine *vm, Text *textMan, Audio::M } // Old MPEG2 cutscenes - snprintf(filename, sizeof(filename), "%s.mp2", sequenceList[id]); + filename = Common::String::format("%s.mp2", sequenceList[id]); if (Common::File::exists(filename)) { GUI::MessageDialog dialog("MPEG2 cutscenes are no longer supported", "OK"); diff --git a/engines/sword1/detection.cpp b/engines/sword1/detection.cpp index 9fb6cbb76e..48c3a0d14d 100644 --- a/engines/sword1/detection.cpp +++ b/engines/sword1/detection.cpp @@ -79,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"; @@ -249,15 +249,11 @@ SaveStateList SwordMetaEngine::listSaves(const char *target) const { int SwordMetaEngine::getMaximumSaveSlot() const { return 999; } void SwordMetaEngine::removeSaveState(const char *target, int slot) const { - char fileName[12]; - snprintf(fileName, 12, "sword1.%03d", slot); - - g_system->getSavefileManager()->removeSavefile(fileName); + g_system->getSavefileManager()->removeSavefile(Common::String::format("sword1.%03d", slot)); } SaveStateDescriptor SwordMetaEngine::querySaveMetaInfos(const char *target, int slot) const { - char fileName[12]; - snprintf(fileName, 12, "sword1.%03d", slot); + Common::String fileName = Common::String::format("sword1.%03d", slot); char name[40]; uint32 playTime = 0; byte versionSave; @@ -340,8 +336,8 @@ bool SwordEngine::canLoadGameStateCurrently() { return (mouseIsActive() && !_control->isPanelShown()); // Disable GMM loading when game panel is shown } -Common::Error SwordEngine::saveGameState(int slot, const char *desc) { - _control->setSaveDescription(slot, desc); +Common::Error SwordEngine::saveGameState(int slot, const Common::String &desc) { + _control->setSaveDescription(slot, desc.c_str()); _control->saveGameToFile(slot); return Common::kNoError; // TODO: return success/failure } diff --git a/engines/sword1/router.cpp b/engines/sword1/router.cpp index e3b6ab3343..aaf475912d 100644 --- a/engines/sword1/router.cpp +++ b/engines/sword1/router.cpp @@ -261,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/sword1.h b/engines/sword1/sword1.h index c83cb76461..2d6db21d19 100644 --- a/engines/sword1/sword1.h +++ b/engines/sword1/sword1.h @@ -110,7 +110,7 @@ protected: Common::Error loadGameState(int slot); bool canLoadGameStateCurrently(); - Common::Error saveGameState(int slot, const char *desc); + Common::Error saveGameState(int slot, const Common::String &desc); bool canSaveGameStateCurrently(); private: diff --git a/engines/sword1/sworddefs.h b/engines/sword1/sworddefs.h index 460b4dd2d1..15736dcae0 100644 --- a/engines/sword1/sworddefs.h +++ b/engines/sword1/sworddefs.h @@ -499,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, @@ -1405,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/sword2/animation.cpp b/engines/sword2/animation.cpp index 5c5ff6c7ee..11ee4a98fd 100644 --- a/engines/sword2/animation.cpp +++ b/engines/sword2/animation.cpp @@ -72,17 +72,17 @@ bool MoviePlayer::load(const char *name) { _textSurface = NULL; - char filename[20]; + Common::String filename; switch (_decoderType) { case kVideoDecoderDXA: - snprintf(filename, sizeof(filename), "%s.dxa", name); + filename = Common::String::format("%s.dxa", name); break; case kVideoDecoderSMK: - snprintf(filename, sizeof(filename), "%s.smk", name); + filename = Common::String::format("%s.smk", name); break; } - return _decoder->loadFile(filename); + return _decoder->loadFile(filename.c_str()); } void MoviePlayer::play(MovieText *movieTexts, uint32 numMovieTexts, uint32 leadIn, uint32 leadOut) { @@ -358,18 +358,18 @@ uint32 DXADecoderWithSound::getElapsedTime() const { /////////////////////////////////////////////////////////////////////////////// MoviePlayer *makeMoviePlayer(const char *name, Sword2Engine *vm, Audio::Mixer *snd, OSystem *system) { - char filename[20]; + Common::String filename; char buf[60]; Audio::SoundHandle *bgSoundHandle = new Audio::SoundHandle; - snprintf(filename, sizeof(filename), "%s.smk", name); + filename = Common::String::format("%s.smk", name); if (Common::File::exists(filename)) { Video::SmackerDecoder *smkDecoder = new Video::SmackerDecoder(snd); return new MoviePlayer(vm, snd, system, bgSoundHandle, smkDecoder, kVideoDecoderSMK); } - snprintf(filename, sizeof(filename), "%s.dxa", name); + filename = Common::String::format("%s.dxa", name); if (Common::File::exists(filename)) { #ifdef USE_ZLIB @@ -383,7 +383,7 @@ MoviePlayer *makeMoviePlayer(const char *name, Sword2Engine *vm, Audio::Mixer *s } // Old MPEG2 cutscenes - snprintf(filename, sizeof(filename), "%s.mp2", name); + filename = Common::String::format("%s.mp2", name); if (Common::File::exists(filename)) { GUI::MessageDialog dialog("MPEG2 cutscenes are no longer supported", "OK"); diff --git a/engines/sword2/console.cpp b/engines/sword2/console.cpp index 8d95670308..957b2431e0 100644 --- a/engines/sword2/console.cpp +++ b/engines/sword2/console.cpp @@ -779,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/controls.cpp b/engines/sword2/controls.cpp index d37edf3082..6ce447a4cc 100644 --- a/engines/sword2/controls.cpp +++ b/engines/sword2/controls.cpp @@ -618,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/icons.cpp b/engines/sword2/icons.cpp index f179f3c899..a555e63449 100644 --- a/engines/sword2/icons.cpp +++ b/engines/sword2/icons.cpp @@ -147,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 7f340df171..e7fb979d69 100644 --- a/engines/sword2/interpreter.cpp +++ b/engines/sword2/interpreter.cpp @@ -264,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; @@ -374,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. // @@ -614,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/layers.cpp b/engines/sword2/layers.cpp index ad65336c0f..b13006cd70 100644 --- a/engines/sword2/layers.cpp +++ b/engines/sword2/layers.cpp @@ -22,7 +22,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -// high level layer initialising +// high level layer initializing // the system supports: // 1 optional background parallax layer @@ -97,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++) { @@ -180,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); @@ -243,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++) { @@ -279,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/maketext.cpp b/engines/sword2/maketext.cpp index dc88f6e68e..e279284d76 100644 --- a/engines/sword2/maketext.cpp +++ b/engines/sword2/maketext.cpp @@ -112,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 @@ -123,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 @@ -199,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. @@ -636,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. @@ -649,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 @@ -677,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 db5833ac55..726c23a5f9 100644 --- a/engines/sword2/maketext.h +++ b/engines/sword2/maketext.h @@ -91,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/render.cpp b/engines/sword2/render.cpp index e3bce7d27f..1e068d6061 100644 --- a/engines/sword2/render.cpp +++ b/engines/sword2/render.cpp @@ -342,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()); } @@ -399,7 +399,7 @@ bool Screen::endRenderCycle() { renderCountIndex = 0; if (_renderTooSlow) { - initialiseRenderCycle(); + initializeRenderCycle(); return true; } @@ -461,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); @@ -588,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); @@ -698,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/router.cpp b/engines/sword2/router.cpp index fa5a677b86..d3f274dd2c 100644 --- a/engines/sword2/router.cpp +++ b/engines/sword2/router.cpp @@ -320,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 ec711bcc40..7196ea8df4 100644 --- a/engines/sword2/router.h +++ b/engines/sword2/router.h @@ -26,7 +26,7 @@ #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 870170e378..34f99923f7 100644 --- a/engines/sword2/saveload.cpp +++ b/engines/sword2/saveload.cpp @@ -49,11 +49,8 @@ namespace Sword2 { -char *Sword2Engine::getSaveFileName(uint16 slotNo) { - static char buf[128]; - - snprintf(buf, sizeof(buf), "%s.%.3d", _targetName.c_str(), slotNo); - return buf; +Common::String Sword2Engine::getSaveFileName(uint16 slotNo) { + return Common::String::format("%s.%.3d", _targetName.c_str(), slotNo); } /** @@ -128,7 +125,7 @@ uint32 Sword2Engine::saveGame(uint16 slotNo, const byte *desc) { } uint32 Sword2Engine::saveData(uint16 slotNo, byte *buffer, uint32 bufferSize) { - char *saveFileName = getSaveFileName(slotNo); + Common::String saveFileName = getSaveFileName(slotNo); Common::OutSaveFile *out; @@ -206,7 +203,7 @@ uint32 Sword2Engine::restoreGame(uint16 slotNo) { } uint32 Sword2Engine::restoreData(uint16 slotNo, byte *buffer, uint32 bufferSize) { - char *saveFileName = getSaveFileName(slotNo); + Common::String saveFileName = getSaveFileName(slotNo); Common::InSaveFile *in; @@ -371,7 +368,7 @@ uint32 Sword2Engine::restoreFromBuffer(byte *buffer, uint32 size) { */ uint32 Sword2Engine::getSaveDescription(uint16 slotNo, byte *description) { - char *saveFileName = getSaveFileName(slotNo); + Common::String saveFileName = getSaveFileName(slotNo); Common::InSaveFile *in; @@ -394,7 +391,7 @@ bool Sword2Engine::saveExists() { } bool Sword2Engine::saveExists(uint16 slotNo) { - char *saveFileName = getSaveFileName(slotNo); + Common::String saveFileName = getSaveFileName(slotNo); Common::InSaveFile *in; if (!(in = _saveFileMan->openForLoading(saveFileName))) { diff --git a/engines/sword2/screen.cpp b/engines/sword2/screen.cpp index cae719c1d4..0cb951fdfc 100644 --- a/engines/sword2/screen.cpp +++ b/engines/sword2/screen.cpp @@ -61,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; @@ -1225,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 2d15692299..11e323d0a7 100644 --- a/engines/sword2/screen.h +++ b/engines/sword2/screen.h @@ -390,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/sword2.cpp b/engines/sword2/sword2.cpp index 47c9b1616e..87c7c12ad6 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -76,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"; @@ -210,11 +210,8 @@ SaveStateList Sword2MetaEngine::listSaves(const char *target) const { int Sword2MetaEngine::getMaximumSaveSlot() const { return 999; } void Sword2MetaEngine::removeSaveState(const char *target, int slot) const { - char extension[6]; - snprintf(extension, sizeof(extension), ".%03d", slot); - Common::String filename = target; - filename += extension; + filename += Common::String::format(".%03d", slot); g_system->getSavefileManager()->removeSavefile(filename); } @@ -425,7 +422,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); @@ -463,7 +460,7 @@ Common::Error Sword2Engine::run() { } else startGame(); - _screen->initialiseRenderCycle(); + _screen->initializeRenderCycle(); while (1) { _debugger->onFrame(); @@ -776,8 +773,8 @@ uint32 Sword2Engine::getMillis() { return _system->getMillis(); } -Common::Error Sword2Engine::saveGameState(int slot, const char *desc) { - uint32 saveVal = saveGame(slot, (const byte *)desc); +Common::Error Sword2Engine::saveGameState(int slot, const Common::String &desc) { + uint32 saveVal = saveGame(slot, (const byte *)desc.c_str()); if (saveVal == SR_OK) return Common::kNoError; diff --git a/engines/sword2/sword2.h b/engines/sword2/sword2.h index 27cbd9e49d..ef5c2b215e 100644 --- a/engines/sword2/sword2.h +++ b/engines/sword2/sword2.h @@ -164,7 +164,7 @@ public: void setSubtitles(bool b) { _useSubtitles = b; } // GMM Loading/Saving - Common::Error saveGameState(int slot, const char *desc); + Common::Error saveGameState(int slot, const Common::String &desc); bool canSaveGameStateCurrently(); Common::Error loadGameState(int slot); bool canLoadGameStateCurrently(); @@ -224,7 +224,7 @@ public: bool saveExists(); bool saveExists(uint16 slotNo); uint32 restoreFromBuffer(byte *buffer, uint32 size); - char *getSaveFileName(uint16 slotNo); + Common::String getSaveFileName(uint16 slotNo); uint32 findBufferSize(); void startGame(); @@ -233,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/sword25/detection.cpp b/engines/sword25/detection.cpp index caa1cf51ac..edb8c30545 100644 --- a/engines/sword25/detection.cpp +++ b/engines/sword25/detection.cpp @@ -24,6 +24,7 @@ #include "engines/advancedDetector.h" #include "sword25/sword25.h" +#include "sword25/detection_tables.h" #include "sword25/kernel/persistenceservice.h" namespace Sword25 { @@ -35,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 @@ -102,7 +71,7 @@ public: Sword25MetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Broken Sword 2.5"; + 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 0000000000..ca586b4f01 --- /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 d267506ae2..d0ad41de22 100644 --- a/engines/sword25/fmv/movieplayer.cpp +++ b/engines/sword25/fmv/movieplayer.cpp @@ -145,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/theora_decoder.cpp b/engines/sword25/fmv/theora_decoder.cpp index 07cb56356d..be6d940d23 100644 --- a/engines/sword25/fmv/theora_decoder.cpp +++ b/engines/sword25/fmv/theora_decoder.cpp @@ -54,7 +54,6 @@ static double rint(double v) { TheoraDecoder::TheoraDecoder(Audio::Mixer::SoundType soundType) { _fileStream = 0; - _surface = 0; _theoraPacket = 0; _vorbisPacket = 0; @@ -298,8 +297,14 @@ bool TheoraDecoder::loadStream(Common::SeekableReadStream *stream) { _endOfAudio = true; } - _surface = new Graphics::Surface(); - _surface->create(_theoraInfo.frame_width, _theoraInfo.frame_height, g_system->getScreenFormat()); + _surface.create(_theoraInfo.frame_width, _theoraInfo.frame_height, g_system->getScreenFormat()); + + // 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; // Set the frame rate _frameRate = Common::Rational(_theoraInfo.fps_numerator, _theoraInfo.fps_denominator); @@ -337,9 +342,9 @@ void TheoraDecoder::close() { delete _fileStream; _fileStream = 0; - _surface->free(); - delete _surface; - _surface = 0; + _surface.free(); + _displaySurface.pixels = 0; + _displaySurface.free(); reset(); } @@ -412,7 +417,7 @@ const Graphics::Surface *TheoraDecoder::decodeNextFrame() { } } - return _surface; + return &_displaySurface; } bool TheoraDecoder::queueAudio() { @@ -440,7 +445,11 @@ bool TheoraDecoder::queueAudio() { _audiobufFill += (i * _vorbisInfo.channels) << 1; if (_audiobufFill == AUDIOFD_FRAGSIZE) { - _audStream->queueBuffer((byte *)_audiobuf, AUDIOFD_FRAGSIZE, DisposeAfterUse::NO, Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN | Audio::FLAG_STEREO); + 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. @@ -533,7 +542,7 @@ void TheoraDecoder::translateYUVtoRGBA(th_ycbcr_buffer &YUVBuffer) { assert(YUVBuffer[kBufferU].height == YUVBuffer[kBufferY].height >> 1); assert(YUVBuffer[kBufferV].height == YUVBuffer[kBufferY].height >> 1); - Graphics::convertYUV420ToRGB(_surface, YUVBuffer[kBufferY].data, YUVBuffer[kBufferU].data, YUVBuffer[kBufferV].data, YUVBuffer[kBufferY].width, YUVBuffer[kBufferY].height, YUVBuffer[kBufferY].stride, YUVBuffer[kBufferU].stride); + 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 10a05647c3..e8cc5ab8b9 100644 --- a/engines/sword25/fmv/theora_decoder.h +++ b/engines/sword25/fmv/theora_decoder.h @@ -70,8 +70,8 @@ public: const Graphics::Surface *decodeNextFrame(); bool isVideoLoaded() const { return _fileStream != 0; } - uint16 getWidth() const { return _surface->w; } - uint16 getHeight() const { return _surface->h; } + uint16 getWidth() const { return _displaySurface.w; } + uint16 getHeight() const { return _displaySurface.h; } uint32 getFrameCount() const { // It is not possible to get frame count easily @@ -80,7 +80,7 @@ public: return 0; } - Graphics::PixelFormat getPixelFormat() const { return _surface->format; } + Graphics::PixelFormat getPixelFormat() const { return _displaySurface.format; } uint32 getElapsedTime() const; uint32 getTimeToNextFrame() const; @@ -96,7 +96,8 @@ private: void translateYUVtoRGBA(th_ycbcr_buffer &YUVBuffer); Common::SeekableReadStream *_fileStream; - Graphics::Surface *_surface; + Graphics::Surface _surface; + Graphics::Surface _displaySurface; Common::Rational _frameRate; double _nextFrameStartTime; bool _endOfVideo; diff --git a/engines/sword25/gfx/graphicengine.h b/engines/sword25/gfx/graphicengine.h index 04826c2e5a..3309763966 100644 --- a/engines/sword25/gfx/graphicengine.h +++ b/engines/sword25/gfx/graphicengine.h @@ -106,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/image/imgloader.cpp b/engines/sword25/gfx/image/imgloader.cpp new file mode 100644 index 0000000000..1df0fba70c --- /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 index 6b5f65ff57..735ab9203c 100644 --- a/engines/sword25/gfx/image/pngloader.h +++ b/engines/sword25/gfx/image/imgloader.h @@ -29,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: @@ -70,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 6f370d8861..0000000000 --- a/engines/sword25/gfx/image/pngloader.cpp +++ /dev/null @@ -1,245 +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. - * - */ - -/* - * 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 <png.h> -#else -#include "graphics/pixelformat.h" -#include "graphics/png.h" -#endif - -namespace Sword25 { - -#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<byte *>(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) { - return doDecodeImage(fileDataPtr, fileSize, 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) { - return doImageProperties(fileDataPtr, fileSize, 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 23bf2623ad..a9c9de4f0c 100644 --- a/engines/sword25/gfx/image/renderedimage.cpp +++ b/engines/sword25/gfx/image/renderedimage.cpp @@ -35,21 +35,13 @@ #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 // ----------------------------------------------------------------------------- @@ -74,8 +66,9 @@ static Common::String loadString(Common::SeekableReadStream &in, uint maxSize = static byte *readSavegameThumbnail(const Common::String &filename, uint &fileSize, bool &isPNG) { byte *pFileData; Common::SaveFileManager *sfm = g_system->getSavefileManager(); - int slotNum = atoi(filename.c_str() + filename.size() - 3); - Common::InSaveFile *file = sfm->openForLoading(generateSavegameFilename(slotNum)); + 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) @@ -100,30 +93,6 @@ static byte *readSavegameThumbnail(const Common::String &filename, uint &fileSiz return pFileData; } -// TODO: Move this method into a more generic image loading class, together with the PNG reading code -static bool decodeThumbnail(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; -} - RenderedImage::RenderedImage(const Common::String &filename, bool &result) : _data(0), _width(0), @@ -152,21 +121,12 @@ 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 (isPNG) - result = PNGLoader::decodeImage(pFileData, fileSize, _data, _width, _height, pitch); + result = ImgLoader::decodePNGImage(pFileData, fileSize, _data, _width, _height, pitch); else - result = decodeThumbnail(pFileData, fileSize, _data, _width, _height, pitch); + result = ImgLoader::decodeThumbnailImage(pFileData, fileSize, _data, _width, _height, pitch); if (!result) { error("Could not decode image."); diff --git a/engines/sword25/gfx/image/swimage.cpp b/engines/sword25/gfx/image/swimage.cpp index 92d47368b2..0b9cc11df2 100644 --- a/engines/sword25/gfx/image/swimage.cpp +++ b/engines/sword25/gfx/image/swimage.cpp @@ -30,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 { @@ -53,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/panel.cpp b/engines/sword25/gfx/panel.cpp index 34ab4876ea..6d5b2a623d 100644 --- a/engines/sword25/gfx/panel.cpp +++ b/engines/sword25/gfx/panel.cpp @@ -47,12 +47,12 @@ Panel::Panel(RenderObjectPtr<RenderObject> 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/screenshot.cpp b/engines/sword25/gfx/screenshot.cpp index 8306d9ce6f..4f9ba1d3c5 100644 --- a/engines/sword25/gfx/screenshot.cpp +++ b/engines/sword25/gfx/screenshot.cpp @@ -29,9 +29,6 @@ * */ -// 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" @@ -53,6 +50,8 @@ bool Screenshot::saveToFile(Graphics::Surface *data, Common::WriteStream *stream 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); stream->writeByte((srcPixel >> 16) & 0xff); // R @@ -93,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/input/inputengine.h b/engines/sword25/input/inputengine.h index a84c215076..f79890a9fd 100644 --- a/engines/sword25/input/inputengine.h +++ b/engines/sword25/input/inputengine.h @@ -172,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/kernel/kernel.cpp b/engines/sword25/kernel/kernel.cpp index f45137ce02..d6388eee2b 100644 --- a/engines/sword25/kernel/kernel.cpp +++ b/engines/sword25/kernel/kernel.cpp @@ -63,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 a0c2927fdc..adf69f92d6 100644 --- a/engines/sword25/kernel/kernel.h +++ b/engines/sword25/kernel/kernel.h @@ -79,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/persistenceservice.cpp b/engines/sword25/kernel/persistenceservice.cpp index a6c71433a7..17e9199b5c 100644 --- a/engines/sword25/kernel/persistenceservice.cpp +++ b/engines/sword25/kernel/persistenceservice.cpp @@ -29,9 +29,6 @@ * */ -// 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" @@ -304,6 +301,7 @@ bool PersistenceService::saveGame(uint slotID, const Common::String &screenshotF if (thumbnail) { 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); diff --git a/engines/sword25/math/polygon.cpp b/engines/sword25/math/polygon.cpp index fe2fc84cad..2e7836ff77 100644 --- a/engines/sword25/math/polygon.cpp +++ b/engines/sword25/math/polygon.cpp @@ -59,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 eac19d7900..ffdbf14f6b 100644 --- a/engines/sword25/math/polygon.h +++ b/engines/sword25/math/polygon.h @@ -78,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 8790860a55..7681ef6d9f 100644 --- a/engines/sword25/math/region.cpp +++ b/engines/sword25/math/region.cpp @@ -115,7 +115,7 @@ bool Region::init(const Polygon &contour, const Common::Array<Polygon> *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 f9a3f50b3f..0fd7223631 100644 --- a/engines/sword25/math/region.h +++ b/engines/sword25/math/region.h @@ -73,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<Polygon> *pHoles = NULL); diff --git a/engines/sword25/math/vertex.h b/engines/sword25/math/vertex.h index 817f48e760..4cb0eaca30 100644 --- a/engines/sword25/math/vertex.h +++ b/engines/sword25/math/vertex.h @@ -43,7 +43,8 @@ #include <math.h> #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 3eea689877..bace4d54bc 100644 --- a/engines/sword25/math/walkregion.cpp +++ b/engines/sword25/math/walkregion.cpp @@ -101,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<Vertex>::const_iterator nodesIter = nodes.begin(); nodesIter != nodes.end(); nodesIter++, dijkstraIter++) { @@ -173,7 +173,7 @@ void reverseArray(Common::Array<T> &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); @@ -247,7 +247,7 @@ void WalkRegion::initNodeVector() { } void WalkRegion::computeVisibilityMatrix() { - // Initialise visibility matrix + // Initialize visibility matrix _visibilityMatrix = Common::Array< Common::Array <int> >(); for (uint idx = 0; idx < _nodes.size(); ++idx) { Common::Array<int> arr; diff --git a/engines/sword25/module.mk b/engines/sword25/module.mk index da91c848b5..302120c500 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/script/luascript.cpp b/engines/sword25/script/luascript.cpp index 7fd3d1b658..9d394309e6 100644 --- a/engines/sword25/script/luascript.cpp +++ b/engines/sword25/script/luascript.cpp @@ -112,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); @@ -177,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 f3530d68ed..1a4a38c3be 100644 --- a/engines/sword25/script/luascript.h +++ b/engines/sword25/script/luascript.h @@ -36,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 { @@ -48,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 e4ce846b66..04f248fe7e 100644 --- a/engines/sword25/script/script.h +++ b/engines/sword25/script/script.h @@ -54,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.h b/engines/sword25/sfx/soundengine.h index c087392570..4dbd475846 100644 --- a/engines/sword25/sfx/soundengine.h +++ b/engines/sword25/sfx/soundengine.h @@ -88,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/sword25.cpp b/engines/sword25/sword25.cpp index 93666fed39..b111746c32 100644 --- a/engines/sword25/sword25.cpp +++ b/engines/sword25/sword25.cpp @@ -94,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()) @@ -142,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 5d11aa69e5..1254ea177b 100644 --- a/engines/sword25/sword25.h +++ b/engines/sword25/sword25.h @@ -82,7 +82,7 @@ protected: // void pauseEngineIntern(bool pause); // TODO: Implement this!!! // void syncSoundSettings(); // TODO: Implement this!!! // Common::Error loadGameState(int slot); // TODO: Implement this? -// Common::Error saveGameState(int slot, const char *desc); // TODO: Implement this? +// Common::Error saveGameState(int slot, const Common::String &desc); // TODO: Implement this? // bool canLoadGameStateCurrently(); // TODO: Implement this? // bool canSaveGameStateCurrently(); // TODO: Implement this? diff --git a/engines/sword25/util/lua/lapi.cpp b/engines/sword25/util/lua/lapi.cpp index b1118db368..16f8460e39 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 526b1c84ab..8978cd5613 100644 --- a/engines/sword25/util/lua/lauxlib.cpp +++ b/engines/sword25/util/lua/lauxlib.cpp @@ -22,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 */ @@ -520,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; @@ -533,23 +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) { - return luaL_error(L, "LUA function errfile has been removed in ScummVM"); + 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; @@ -559,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); @@ -633,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 07508fbb14..bbcdf98b3d 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 <setjmp.h> #include <stdlib.h> #include <string.h> @@ -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 3ce16542d6..0000000000 --- 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 <stddef.h> - -#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; i<n; i++) - { - const TValue* o=&f->k[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; i<n; i++) DumpFunction(f->p[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; i<n; i++) - { - DumpString(f->locvars[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; i<n; i++) DumpString(f->upvalues[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 f9bad30aed..b505d1e4df 100644 --- a/engines/sword25/util/lua/liolib.cpp +++ b/engines/sword25/util/lua/liolib.cpp @@ -16,7 +16,8 @@ #include "lauxlib.h" #include "lualib.h" - +#include "common/textconsole.h" +#include "scummvm_file.h" #define IO_INPUT 1 @@ -27,50 +28,64 @@ static const char *const fnames[] = {"input", "output"}; static int pushresult (lua_State *L, int i, const char *filename) { - return luaL_error(L, "LUA file I/O functions have been removed in ScummVM"); + int en = 0; /*errno;*/ // Currently hardcoded for ScumMVM, this may need to be changed + if (i) { + lua_pushboolean(L, 1); + return 1; + } + else { + lua_pushnil(L); + if (filename) + lua_pushfstring(L, "%s: %s", filename, "General error" /*strerror(en)*/); + else + 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, "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); @@ -92,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); + */ } @@ -103,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; } @@ -158,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); @@ -181,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); @@ -193,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"); } @@ -232,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); } @@ -246,6 +280,7 @@ static int io_lines (lua_State *L) { aux_lines(L, lua_gettop(L), 1); return 1; } + */ } @@ -255,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); @@ -274,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++) { @@ -335,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"); @@ -354,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", "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); @@ -413,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); } @@ -423,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); @@ -430,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); @@ -446,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); } @@ -497,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); @@ -526,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 87eafea45a..4d73a6a600 100644 --- a/engines/sword25/util/lua/llex.cpp +++ b/engines/sword25/util/lua/llex.cpp @@ -6,6 +6,7 @@ #include <ctype.h> +#include <stdio.h> #include <string.h> #define llex_c @@ -175,11 +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 */ - // Non-portable call to update the decimal point separator. - // It has been simplified in ScummVM to not use any system locale - // information, as it's not used in sword25. + // 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; + 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 7e64d75789..6c36bbcf4e 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 <stdlib.h> // 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 2549e2bdb1..9795a575f5 100644 --- a/engines/sword25/util/lua/loadlib.cpp +++ b/engines/sword25/util/lua/loadlib.cpp @@ -9,10 +9,6 @@ */ -#include <stdlib.h> -#include <string.h> - - #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 578a7cb09a..b61f8c65e1 100644 --- a/engines/sword25/util/lua/loslib.cpp +++ b/engines/sword25/util/lua/loslib.cpp @@ -4,9 +4,9 @@ ** See Copyright Notice in lua.h */ +// FIXME: Get rid of all time.h stuff +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h -#include <stdlib.h> -#include <string.h> #include <time.h> #define loslib_c @@ -17,9 +17,14 @@ #include "lauxlib.h" #include "lualib.h" +#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; } @@ -35,24 +40,30 @@ static int os_remove (lua_State *L) { static int os_rename (lua_State *L) { - // Removed in ScummVM, does nothing. + // 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; } @@ -103,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? */ @@ -148,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 */ @@ -173,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; @@ -189,7 +211,13 @@ static int os_setlocale (lua_State *L) { 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 088a511cf9..417cdadf8b 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 <stdarg.h> #include <stddef.h> diff --git a/engines/sword25/util/lua/luaconf.h b/engines/sword25/util/lua/luaconf.h index 29411d5af1..f3509e969b 100644 --- a/engines/sword25/util/lua/luaconf.h +++ b/engines/sword25/util/lua/luaconf.h @@ -18,14 +18,6 @@ ** =================================================================== */ -#if defined(__ANDROID__) -/* Android is missing strcoll(). -** For more information, refer to: -** http://www.damonkohler.com/2008/12/lua-on-android.html -*/ -#define strcoll strcmp -#endif - /* @@ LUA_ANSI controls the use of non-ansi features. @@ -357,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 diff --git a/engines/sword25/util/lua/lundump.cpp b/engines/sword25/util/lua/lundump.cpp deleted file mode 100644 index 4ffc623575..0000000000 --- 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 <string.h> - -#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; i<n; i++) setnilvalue(&f->k[i]); - for (i=0; i<n; i++) - { - TValue* o=&f->k[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; i<n; i++) f->p[i]=NULL; - for (i=0; i<n; i++) f->p[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; i<n; i++) f->locvars[i].varname=NULL; - for (i=0; i<n; i++) - { - f->locvars[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; i<n; i++) f->upvalues[i]=NULL; - for (i=0; i<n; i++) f->upvalues[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 f791a4f173..0000000000 --- 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 ae70fe2645..fb700c20a2 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 22039c9861..0000000000 --- a/engines/sword25/util/lua/print.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/* -** $Id$ -** print bytecodes -** See Copyright Notice in lua.h -*/ - -#include <ctype.h> -#include <stdio.h> - -#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; i<n; i++) - { - int c=s[i]; - switch (c) - { - case '"': printf("\\\""); break; - case '\\': printf("\\\\"); break; - case '\a': printf("\\a"); break; - case '\b': printf("\\b"); break; - case '\f': printf("\\f"); break; - case '\n': printf("\\n"); break; - case '\r': printf("\\r"); break; - case '\t': printf("\\t"); break; - case '\v': printf("\\v"); break; - default: if (isprint((unsigned char)c)) - putchar(c); - else - printf("\\%03u",(unsigned char)c); - } - } - putchar('"'); -} - -static void PrintConstant(const Proto* f, int i) -{ - const TValue* o=&f->k[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; pc<n; pc++) - { - Instruction i=code[pc]; - OpCode o=GET_OPCODE(i); - int a=GETARG_A(i); - int b=GETARG_B(i); - int c=GETARG_C(i); - int bx=GETARG_Bx(i); - int sbx=GETARG_sBx(i); - int line=getline(f,pc); - printf("\t%d\t",pc+1); - if (line>0) 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; i<n; i++) - { - printf("\t%d\t",i+1); - PrintConstant(f,i); - printf("\n"); - } -} - -static void PrintLocals(const Proto* f) -{ - int i,n=f->sizelocvars; - printf("locals (%d) for %p:\n",n,VOID(f)); - for (i=0; i<n; i++) - { - printf("\t%d\t%s\t%d\t%d\n", - i,getstr(f->locvars[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; i<n; i++) - { - printf("\t%d\t%s\n",i,getstr(f->upvalues[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; i<n; i++) PrintFunction(f->p[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 0000000000..3c0377d0ee --- /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<size_t>(_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 0000000000..a4cbd2a6cf --- /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/detection.cpp b/engines/teenagent/detection.cpp index 4784e2fb7e..5012e6af65 100644 --- a/engines/teenagent/detection.cpp +++ b/engines/teenagent/detection.cpp @@ -113,7 +113,7 @@ public: } virtual const char *getName() const { - return "Teen Agent"; + return "TeenAgent"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp index 0f9766d2ca..8430f42c61 100644 --- a/engines/teenagent/inventory.cpp +++ b/engines/teenagent/inventory.cpp @@ -43,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) { @@ -66,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; @@ -100,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); } } @@ -134,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; } } @@ -165,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; @@ -194,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; @@ -246,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: @@ -279,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) { @@ -295,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); } @@ -352,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 23a2e8daaa..55c58a1c22 100644 --- a/engines/teenagent/inventory.h +++ b/engines/teenagent/inventory.h @@ -51,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<InventoryObject> _objects; + byte *_inventory; - Common::Array<InventoryObject> 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/teenagent.cpp b/engines/teenagent/teenagent.cpp index f076dbc0a1..ce8862ffd0 100644 --- a/engines/teenagent/teenagent.cpp +++ b/engines/teenagent/teenagent.cpp @@ -240,7 +240,7 @@ Common::Error TeenAgentEngine::loadGameState(int slot) { return Common::kNoError; } -Common::Error TeenAgentEngine::saveGameState(int slot, const char *desc) { +Common::Error TeenAgentEngine::saveGameState(int slot, const Common::String &desc) { debug(0, "saving to slot %d", slot); Common::ScopedPtr<Common::OutSaveFile> out(_saveFileMan->openForSaving(Common::String::format("teenagent.%02d", slot))); if (!out) @@ -253,7 +253,7 @@ Common::Error TeenAgentEngine::saveGameState(int slot, const char *desc) { res->dseg.set_word(0x64B1, pos.y); assert(res->dseg.size() >= 0x6478 + 0x777a); - strncpy((char *)res->dseg.ptr(0x6478), desc, 0x16); + strncpy((char *)res->dseg.ptr(0x6478), desc.c_str(), 0x16); out->write(res->dseg.ptr(0x6478), 0x777a); if (!Graphics::saveThumbnail(*out)) warning("saveThumbnail failed"); diff --git a/engines/teenagent/teenagent.h b/engines/teenagent/teenagent.h index bc802da8bc..a054f72d25 100644 --- a/engines/teenagent/teenagent.h +++ b/engines/teenagent/teenagent.h @@ -56,7 +56,7 @@ public: virtual Common::Error run(); virtual Common::Error loadGameState(int slot); - virtual Common::Error saveGameState(int slot, const char *desc); + virtual Common::Error saveGameState(int slot, const Common::String &desc); virtual bool canLoadGameStateCurrently() { return true; } virtual bool canSaveGameStateCurrently() { return !scene_busy; } virtual bool hasFeature(EngineFeature f) const; diff --git a/engines/tinsel/actors.cpp b/engines/tinsel/actors.cpp index 9caa12d320..4e9847f8b4 100644 --- a/engines/tinsel/actors.cpp +++ b/engines/tinsel/actors.cpp @@ -434,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/background.cpp b/engines/tinsel/background.cpp index 5e2ebaafdc..72397db97f 100644 --- a/engines/tinsel/background.cpp +++ b/engines/tinsel/background.cpp @@ -37,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 */ diff --git a/engines/tinsel/background.h b/engines/tinsel/background.h index 37ab4d4d5c..34f1bd6dd2 100644 --- a/engines/tinsel/background.h +++ b/engines/tinsel/background.h @@ -73,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); diff --git a/engines/tinsel/bg.cpp b/engines/tinsel/bg.cpp index e5618afc5c..cf692e16ea 100644 --- a/engines/tinsel/bg.cpp +++ b/engines/tinsel/bg.cpp @@ -126,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); @@ -141,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); @@ -176,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]); @@ -202,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 db56c5bbba..24d47b920f 100644 --- a/engines/tinsel/bmv.cpp +++ b/engines/tinsel/bmv.cpp @@ -385,7 +385,7 @@ void BMVPlayer::MoviePalette(int paletteOffset) { SetTextPal(talkColor); } -void BMVPlayer::InitialiseMovieSound() { +void BMVPlayer::InitializeMovieSound() { _audioStream = Audio::makeQueuingAudioStream(22050, true); audioStarted = false; } @@ -663,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); @@ -680,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; @@ -705,8 +705,8 @@ void BMVPlayer::InitialiseBMV() { while (numAdvancePackets < ADVANCE_SOUND) LoadSlots(1); - // Initialise the sound channel - InitialiseMovieSound(); + // Initialize the sound channel + InitializeMovieSound(); } /** @@ -1066,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 02ba6d100f..eadf65c3aa 100644 --- a/engines/tinsel/bmv.h +++ b/engines/tinsel/bmv.h @@ -134,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); @@ -144,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 f8d8011b12..76feede83f 100644 --- a/engines/tinsel/cliprect.cpp +++ b/engines/tinsel/cliprect.cpp @@ -209,7 +209,7 @@ void UpdateClipRect(OBJECT **pObjList, Common::Point *pWin, Common::Rect *pClip) 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; pObj != NULL; pObj = pObj->pNext) { diff --git a/engines/tinsel/cursor.cpp b/engines/tinsel/cursor.cpp index 6e04feff57..8248609a81 100644 --- a/engines/tinsel/cursor.cpp +++ b/engines/tinsel/cursor.cpp @@ -77,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. @@ -106,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 @@ -127,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); } @@ -227,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. */ @@ -385,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); @@ -470,7 +470,7 @@ static void DoCursorMove() { } /** - * Initialise cursor object. + * Initialize cursor object. */ static void InitCurObj() { const FILM *pFilm; @@ -500,7 +500,7 @@ static void InitCurObj() { } /** - * Initialise the cursor position. + * Initialize the cursor position. */ static void InitCurPos() { Common::Point ptMouse = _vm->getMousePosition(); @@ -530,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 @@ -656,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/detection.cpp b/engines/tinsel/detection.cpp index 27b16c5b93..0f0e3cd1ef 100644 --- a/engines/tinsel/detection.cpp +++ b/engines/tinsel/detection.cpp @@ -410,7 +410,7 @@ Common::Error TinselEngine::loadGameState(int slot) { } #if 0 -Common::Error TinselEngine::saveGameState(int slot, const char *desc) { +Common::Error TinselEngine::saveGameState(int slot, const Common::String &desc) { Common::String saveName = _vm->getSavegameFilename((int16)(slot + 1)); char saveDesc[SG_DESC_LEN]; Common::strlcpy(saveDesc, desc, SG_DESC_LEN); diff --git a/engines/tinsel/dialogs.cpp b/engines/tinsel/dialogs.cpp index 6deeab27cd..6ca070b67a 100644 --- a/engines/tinsel/dialogs.cpp +++ b/engines/tinsel/dialogs.cpp @@ -1319,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/handle.cpp b/engines/tinsel/handle.cpp index 092d282b01..eeb83b1f98 100644 --- a/engines/tinsel/handle.cpp +++ b/engines/tinsel/handle.cpp @@ -243,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/heapmem.cpp b/engines/tinsel/heapmem.cpp index 2376583222..026dc9457e 100644 --- a/engines/tinsel/heapmem.cpp +++ b/engines/tinsel/heapmem.cpp @@ -100,7 +100,7 @@ static void MemoryStats() { #endif /** - * Initialises the memory manager. + * Initializes the memory manager. */ void MemoryInit() { // place first node on free list @@ -133,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 277463e4ef..7b29a3ecce 100644 --- a/engines/tinsel/heapmem.h +++ b/engines/tinsel/heapmem.h @@ -35,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/move.cpp b/engines/tinsel/move.cpp index d6b96fee7b..e20f28d528 100644 --- a/engines/tinsel/move.cpp +++ b/engines/tinsel/move.cpp @@ -578,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/multiobj.cpp b/engines/tinsel/multiobj.cpp index 4a9d4b65d4..c48fefdd22 100644 --- a/engines/tinsel/multiobj.cpp +++ b/engines/tinsel/multiobj.cpp @@ -29,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. diff --git a/engines/tinsel/multiobj.h b/engines/tinsel/multiobj.h index a467fac425..a0f977553a 100644 --- a/engines/tinsel/multiobj.h +++ b/engines/tinsel/multiobj.h @@ -53,7 +53,7 @@ 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 diff --git a/engines/tinsel/object.cpp b/engines/tinsel/object.cpp index b1090058d1..cbe5b0a88f 100644 --- a/engines/tinsel/object.cpp +++ b/engines/tinsel/object.cpp @@ -345,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) { @@ -486,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 @@ -522,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/pcode.cpp b/engines/tinsel/pcode.cpp index 39423813bf..0834e7df24 100644 --- a/engines/tinsel/pcode.cpp +++ b/engines/tinsel/pcode.cpp @@ -348,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 @@ -385,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 eedf9fb827..971a42d7bd 100644 --- a/engines/tinsel/pcode.h +++ b/engines/tinsel/pcode.h @@ -74,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/polygons.cpp b/engines/tinsel/polygons.cpp index 26a861f692..6fc1c65ec5 100644 --- a/engines/tinsel/polygons.cpp +++ b/engines/tinsel/polygons.cpp @@ -1275,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; @@ -1593,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; @@ -1657,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); @@ -1676,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. @@ -1718,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); @@ -1726,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); @@ -1736,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); @@ -1781,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/savescn.cpp b/engines/tinsel/savescn.cpp index 7be24cc964..89d68a611e 100644 --- a/engines/tinsel/savescn.cpp +++ b/engines/tinsel/savescn.cpp @@ -150,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 27840876f2..894af0d6b8 100644 --- a/engines/tinsel/savescn.h +++ b/engines/tinsel/savescn.h @@ -96,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 f2c3bff1d5..89b0da7d65 100644 --- a/engines/tinsel/scene.cpp +++ b/engines/tinsel/scene.cpp @@ -201,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 */ @@ -244,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) @@ -257,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/scroll.cpp b/engines/tinsel/scroll.cpp index 7637664163..d75e649be3 100644 --- a/engines/tinsel/scroll.cpp +++ b/engines/tinsel/scroll.cpp @@ -416,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/sysvar.cpp b/engines/tinsel/sysvar.cpp index aa3fdeead8..88053f15c6 100644 --- a/engines/tinsel/sysvar.cpp +++ b/engines/tinsel/sysvar.cpp @@ -112,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/tinlib.cpp b/engines/tinsel/tinlib.cpp index a5a0c73395..7613c1a897 100644 --- a/engines/tinsel/tinlib.cpp +++ b/engines/tinsel/tinlib.cpp @@ -2749,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); @@ -2999,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/tinsel.cpp b/engines/tinsel/tinsel.cpp index 84a8ea8eb3..80f02ff8d1 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -705,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 @@ -886,9 +886,7 @@ TinselEngine::~TinselEngine() { } Common::String TinselEngine::getSavegameFilename(int16 saveNum) const { - char filename[256]; - snprintf(filename, 256, "%s.%03d", getTargetName().c_str(), saveNum); - return filename; + return Common::String::format("%s.%03d", getTargetName().c_str(), saveNum); } Common::Error TinselEngine::run() { diff --git a/engines/tinsel/tinsel.h b/engines/tinsel/tinsel.h index d0875f9fdf..30b060766e 100644 --- a/engines/tinsel/tinsel.h +++ b/engines/tinsel/tinsel.h @@ -169,7 +169,7 @@ protected: virtual bool hasFeature(EngineFeature f) const; Common::Error loadGameState(int slot); #if 0 - Common::Error saveGameState(int slot, const char *desc); + Common::Error saveGameState(int slot, const Common::String &desc); #endif bool canLoadGameStateCurrently(); #if 0 diff --git a/engines/toon/audio.cpp b/engines/toon/audio.cpp index 46b96286b3..ae67d1900e 100644 --- a/engines/toon/audio.cpp +++ b/engines/toon/audio.cpp @@ -393,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/script_func.cpp b/engines/toon/script_func.cpp index 693f308707..005a299502 100644 --- a/engines/toon/script_func.cpp +++ b/engines/toon/script_func.cpp @@ -312,13 +312,13 @@ int32 ScriptFunc::sys_Cmd_Flip_Screens(EMCState *state) { int32 ScriptFunc::sys_Cmd_Play_Flic(EMCState *state) { - char name[256]; + Common::String name; // workaround for the video of the beginning if (strstr(GetText(0, state), "209")) - sprintf(name, "%s", GetText(0, state)); + name = GetText(0, state); else - strcpy(name, _vm->createRoomFilename(GetText(0, state)).c_str()); + name = _vm->createRoomFilename(GetText(0, state)); int32 stopMusic = stackPos(2); _vm->getMoviePlayer()->play(name, stopMusic); diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp index 44c747c4c4..93da20fb47 100644 --- a/engines/toon/toon.cpp +++ b/engines/toon/toon.cpp @@ -215,15 +215,13 @@ void ToonEngine::parseInput() { if (slotNum >= 0 && slotNum <= 9 && canSaveGameStateCurrently()) { if (saveGame(slotNum, Common::String())) { // ok - char buf[256]; - snprintf(buf, 256, "Saved game in slot #%d ", slotNum); + Common::String buf = Common::String::format("Saved game in slot #%d ", slotNum); GUI::TimedMessageDialog dialog(buf, 1000); dialog.runModal(); } else { - char buf[256]; - snprintf(buf, 256, "Could not quick save into slot #%d", slotNum); - GUI::MessageDialog dialog2(buf, "OK", 0); - dialog2.runModal(); + Common::String buf = Common::String::format("Could not quick save into slot #%d", slotNum); + GUI::MessageDialog dialog(buf, "OK", 0); + dialog.runModal(); } } @@ -234,15 +232,13 @@ void ToonEngine::parseInput() { if (slotNum >= 0 && slotNum <= 9 && canLoadGameStateCurrently()) { if (loadGame(slotNum)) { // ok - char buf[256]; - snprintf(buf, 256, "Savegame #%d quick loaded", slotNum); + Common::String buf = Common::String::format("Savegame #%d quick loaded", slotNum); GUI::TimedMessageDialog dialog(buf, 1000); dialog.runModal(); } else { - char buf[256]; - snprintf(buf, 256, "Could not quick load the savegame #%d", slotNum); + Common::String buf = Common::String::format("Could not quick load the savegame #%d", slotNum); GUI::MessageDialog dialog(buf, "OK", 0); - warning("%s", buf); + warning("%s", buf.c_str()); dialog.runModal(); } } @@ -404,15 +400,15 @@ void ToonEngine::render() { //_drew->plotPath(*_mainSurface); // used to debug path finding #if 0 - char test[256]; if (_mouseX > 0 && _mouseX < 640 && _mouseY > 0 && _mouseY < 400) { - sprintf(test, "%d %d / mask %d layer %d z %d", _mouseX, _mouseY, getMask()->getData(_mouseX, _mouseY), getLayerAtPoint(_mouseX, _mouseY), getZAtPoint(_mouseX, _mouseY)); + Common::String test; + test = Common::String::format("%d %d / mask %d layer %d z %d", _mouseX, _mouseY, getMask()->getData(_mouseX, _mouseY), getLayerAtPoint(_mouseX, _mouseY), getZAtPoint(_mouseX, _mouseY)); int32 c = *(uint8 *)_mainSurface->getBasePtr(_mouseX, _mouseY); - sprintf(test, "%d %d / color id %d %d,%d,%d", _mouseX, _mouseY, c, _finalPalette[c * 3 + 0], _finalPalette[c * 3 + 1], _finalPalette[c * 3 + 2]); + test = Common::String::format("%d %d / color id %d %d,%d,%d", _mouseX, _mouseY, c, _finalPalette[c * 3 + 0], _finalPalette[c * 3 + 1], _finalPalette[c * 3 + 2]); _fontRenderer->setFont(_fontToon); - _fontRenderer->renderText(40, 150, Common::String(test), 0); + _fontRenderer->renderText(40, 150, test, 0); } #endif @@ -466,20 +462,24 @@ void ToonEngine::doMagnifierEffect() { byte tempBuffer[25 * 25]; for (int32 y = -12; y <= 12; y++) { + int32 cy = CLIP<int32>(posY + y, 0, TOON_BACKBUFFER_HEIGHT-1); for (int32 x = -12; x <= 12; x++) { + int32 cx = CLIP<int32>(posX + x, 0, TOON_BACKBUFFER_WIDTH-1); int32 destPitch = surface.pitch; - uint8 *curRow = (uint8 *)surface.pixels + (posY + y) * destPitch + (posX + x); + uint8 *curRow = (uint8 *)surface.pixels + cy * destPitch + cx; tempBuffer[(y + 12) * 25 + x + 12] = *curRow; } } for (int32 y = -12; y <= 12; y++) { + int32 cy = CLIP<int32>(posY + y, 0, TOON_BACKBUFFER_HEIGHT-1); for (int32 x = -12; x <= 12; x++) { int32 dist = y * y + x * x; if (dist > 144) continue; + int32 cx = CLIP<int32>(posX + x, 0, TOON_BACKBUFFER_WIDTH-1); int32 destPitch = surface.pitch; - uint8 *curRow = (uint8 *)surface.pixels + (posY + y) * destPitch + (posX + x); + uint8 *curRow = (uint8 *)surface.pixels + cy * destPitch + cx; int32 lerp = (512 + intSqrt[dist] * 256 / 12); *curRow = tempBuffer[(y * lerp / 1024 + 12) * 25 + x * lerp / 1024 + 12]; } @@ -4566,26 +4566,27 @@ void ToonEngine::createShadowLUT() { bool ToonEngine::loadToonDat() { Common::File in; - char buf[256]; + Common::String msg; int majVer, minVer; in.open("toon.dat"); if (!in.isOpen()) { - Common::String errorMessage = "You're missing the 'toon.dat' file. Get it from the ScummVM website"; - GUIErrorMessage(errorMessage); - warning("%s", errorMessage.c_str()); + msg = "You're missing the 'toon.dat' file. Get it from the ScummVM website"; + GUIErrorMessage(msg); + warning("%s", msg.c_str()); return false; } // Read header + char buf[4+1]; in.read(buf, 4); buf[4] = '\0'; if (strcmp(buf, "TOON")) { - Common::String errorMessage = "File 'toon.dat' is corrupt. Get it from the ScummVM website"; - GUIErrorMessage(errorMessage); - warning("%s", errorMessage.c_str()); + msg = "File 'toon.dat' is corrupt. Get it from the ScummVM website"; + GUIErrorMessage(msg); + warning("%s", msg.c_str()); return false; } @@ -4593,9 +4594,9 @@ bool ToonEngine::loadToonDat() { minVer = in.readByte(); if ((majVer != TOON_DAT_VER_MAJ) || (minVer != TOON_DAT_VER_MIN)) { - snprintf(buf, 256, "File 'toon.dat' is wrong version. Expected %d.%d but got %d.%d. Get it from the ScummVM website", TOON_DAT_VER_MAJ, TOON_DAT_VER_MIN, majVer, minVer); - GUIErrorMessage(buf); - warning("%s", buf); + msg = Common::String::format("File 'toon.dat' is wrong version. Expected %d.%d but got %d.%d. Get it from the ScummVM website", TOON_DAT_VER_MAJ, TOON_DAT_VER_MIN, majVer, minVer); + GUIErrorMessage(msg); + warning("%s", msg.c_str()); return false; } diff --git a/engines/toon/toon.h b/engines/toon/toon.h index 1eaa5022a9..02828f26d1 100644 --- a/engines/toon/toon.h +++ b/engines/toon/toon.h @@ -318,7 +318,7 @@ public: return _shouldQuit; } - Common::Error saveGameState(int slot, const char *desc) { + Common::Error saveGameState(int slot, const Common::String &desc) { return (saveGame(slot, desc) ? Common::kWritingFailed : Common::kNoError); } diff --git a/engines/touche/saveload.cpp b/engines/touche/saveload.cpp index 82ed03ad45..7732c6deb9 100644 --- a/engines/touche/saveload.cpp +++ b/engines/touche/saveload.cpp @@ -319,7 +319,7 @@ void ToucheEngine::loadGameStateData(Common::ReadStream *stream) { debug(0, "Loaded state, current episode %d", _currentEpisodeNum); } -Common::Error ToucheEngine::saveGameState(int num, const char *description) { +Common::Error ToucheEngine::saveGameState(int num, const Common::String &description) { bool saveOk = false; Common::String gameStateFileName = generateGameStateFileName(_targetName.c_str(), num); Common::OutSaveFile *f = _saveFileMan->openForSaving(gameStateFileName); @@ -328,7 +328,7 @@ Common::Error ToucheEngine::saveGameState(int num, const char *description) { f->writeUint16LE(0); char headerDescription[kGameStateDescriptionLen]; memset(headerDescription, 0, kGameStateDescriptionLen); - strncpy(headerDescription, description, kGameStateDescriptionLen - 1); + strncpy(headerDescription, description.c_str(), kGameStateDescriptionLen - 1); f->write(headerDescription, kGameStateDescriptionLen); saveGameStateData(f); f->finalize(); @@ -380,9 +380,7 @@ Common::String generateGameStateFileName(const char *target, int slot, bool pref if (prefixOnly) { name += ".*"; } else { - char slotStr[16]; - snprintf(slotStr, sizeof(slotStr), ".%d", slot); - name += slotStr; + name += Common::String::format(".%d", slot); } return name; } diff --git a/engines/touche/touche.h b/engines/touche/touche.h index c8d7504754..7e1aa3ac44 100644 --- a/engines/touche/touche.h +++ b/engines/touche/touche.h @@ -513,7 +513,7 @@ protected: void saveGameStateData(Common::WriteStream *stream); void loadGameStateData(Common::ReadStream *stream); - virtual Common::Error saveGameState(int num, const char *description); + virtual Common::Error saveGameState(int num, const Common::String &description); virtual Common::Error loadGameState(int num); virtual bool canLoadGameStateCurrently(); virtual bool canSaveGameStateCurrently(); diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 7534abdec7..ae337765a2 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -21,6 +21,7 @@ */ #include "common/system.h" +#include "common/config-manager.h" #include "engines/engine.h" #include "graphics/palette.h" #include "tsage/tsage.h" @@ -1687,6 +1688,7 @@ SceneObject::SceneObject() : SceneHotspot() { _flags |= OBJFLAG_PANES; _frameChange = 0; + _visage = 0; } SceneObject::SceneObject(const SceneObject &so) : SceneHotspot() { diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp index 42ae366ced..5288c98b72 100644 --- a/engines/tsage/debugger.cpp +++ b/engines/tsage/debugger.cpp @@ -63,13 +63,13 @@ bool Debugger::Cmd_Scene(int argc, const char **argv) { if (argc < 2) { DebugPrintf("Usage: %s <scene number> [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; } /** @@ -377,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/globals.cpp b/engines/tsage/globals.cpp index e38fb21237..e629396501 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -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; diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index bec05a3c9a..6b3df587b6 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -73,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 a212c5dd77..cc11343c9c 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -874,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 @@ -1209,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) { @@ -1255,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 c90833a95f..b269520039 100644 --- a/engines/tsage/graphics.h +++ b/engines/tsage/graphics.h @@ -40,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); @@ -60,7 +60,7 @@ public: uint8 foreground; uint8 background; - GfxColors() : foreground(0), background(0) {}; + GfxColors() : foreground(0), background(0) {} }; class LineSlice { @@ -92,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) { @@ -187,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); }; @@ -229,7 +229,7 @@ private: public: Common::String _message; public: - GfxButton() : GfxElement() {}; + GfxButton() : GfxElement() {} virtual ~GfxButton() {} void setText(const Common::String &s) { @@ -271,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/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp index 2141fcce5a..95c9da9fe7 100644 --- a/engines/tsage/ringworld_logic.cpp +++ b/engines/tsage/ringworld_logic.cpp @@ -1334,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(); } @@ -1409,7 +1413,10 @@ 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 || _vm->shouldQuit()) { + 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); diff --git a/engines/tsage/ringworld_scenes1.cpp b/engines/tsage/ringworld_scenes1.cpp index b6daadbef7..82f0153d8f 100644 --- a/engines/tsage/ringworld_scenes1.cpp +++ b/engines/tsage/ringworld_scenes1.cpp @@ -2999,6 +2999,13 @@ void Scene6100::Action5::dispatch() { if ((idx != 3) && (scene->_fadePercent == 100) && (tempSet.sqrt(zeroSet) < 150.0)) { switch (scene->_hitCount++) { + case 0: + scene->_soundHandler.startSound(233); + scene->showMessage(NULL, 0, NULL); + + if (!_globals->getFlag(76)) + scene->_probe.setAction(&scene->_action1); + break; case 1: scene->_soundHandler.startSound(233); scene->showMessage(NULL, 0, NULL); @@ -3006,7 +3013,6 @@ void Scene6100::Action5::dispatch() { if (!_globals->getFlag(76)) scene->_probe.setAction(&scene->_action2); break; - case 2: scene->_soundHandler.startSound(234); scene->showMessage(NULL, 0, NULL); @@ -3015,14 +3021,6 @@ void Scene6100::Action5::dispatch() { scene->_probe.setAction(NULL); scene->setAction(&scene->_action3); break; - - default: - scene->_soundHandler.startSound(233); - scene->showMessage(NULL, 0, NULL); - - if (!_globals->getFlag(76)) - scene->_probe.setAction(&scene->_action1); - break; } _globals->_scenePalette.clearListeners(); diff --git a/engines/tsage/ringworld_scenes10.cpp b/engines/tsage/ringworld_scenes10.cpp index f8844ec486..0b4186531d 100644 --- a/engines/tsage/ringworld_scenes10.cpp +++ b/engines/tsage/ringworld_scenes10.cpp @@ -49,7 +49,7 @@ void Object9350::draw() { } /*-------------------------------------------------------------------------- - * Scene 9100 + * Scene 9100 - Near beach: Slave washing clothes * *--------------------------------------------------------------------------*/ void Scene9100::SceneHotspot1::doAction(int action) { @@ -174,7 +174,7 @@ void Scene9100::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 9150 + * Scene 9150 - Castle: Outside the bulwarks * *--------------------------------------------------------------------------*/ void Scene9150::Object3::signal() { @@ -294,7 +294,7 @@ void Scene9150::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 9200 + * Scene 9200 - Castle: Near the fountain * *--------------------------------------------------------------------------*/ void Scene9200::SceneHotspot1::doAction(int action) { @@ -470,7 +470,7 @@ void Scene9200::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 9300 + * Scene 9300 - Castle: In front of a large guarded door * *--------------------------------------------------------------------------*/ void Scene9300::signal() { @@ -537,7 +537,7 @@ void Scene9300::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 9350 + * Scene 9350 - Castle: In a hallway * *--------------------------------------------------------------------------*/ @@ -623,7 +623,7 @@ void Scene9350::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 9360 + * Scene 9360 - Castle: In a hallway * *--------------------------------------------------------------------------*/ @@ -701,7 +701,7 @@ void Scene9360::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 9400 + * Scene 9400 - Castle: Black-Smith room * *--------------------------------------------------------------------------*/ Scene9400::Scene9400() { @@ -826,7 +826,7 @@ void Scene9400::synchronize(Serializer &s) { } /*-------------------------------------------------------------------------- - * Scene 9450 + * Scene 9450 - Castle: Dining room * *--------------------------------------------------------------------------*/ void Scene9450::Object2::signal() { @@ -1009,7 +1009,7 @@ void Scene9450::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 9500 + * Scene 9500 - Castle: Bedroom * *--------------------------------------------------------------------------*/ void Scene9500::Hotspot1::doAction(int action) { @@ -1230,7 +1230,7 @@ void Scene9500::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 9700 + * Scene 9700 - Castle: Balcony * *--------------------------------------------------------------------------*/ void Scene9700::signal() { @@ -1302,7 +1302,7 @@ void Scene9700::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 9750 + * Scene 9750 - Castle: In the garden * *--------------------------------------------------------------------------*/ void Scene9750::signal() { @@ -1338,7 +1338,7 @@ void Scene9750::postInit(SceneObjectList *OwnerList) { /*-------------------------------------------------------------------------- - * Scene 9850 + * Scene 9850 - Castle: Dressing room * *--------------------------------------------------------------------------*/ void Scene9850::Object6::doAction(int action) { @@ -1642,7 +1642,7 @@ void Scene9850::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 9900 + * Scene 9900 - Ending * *--------------------------------------------------------------------------*/ void Scene9900::strAction1::signal() { @@ -1997,7 +1997,7 @@ void Scene9900::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 9999 + * Scene 9999 - Space travel * *--------------------------------------------------------------------------*/ diff --git a/engines/tsage/ringworld_scenes3.cpp b/engines/tsage/ringworld_scenes3.cpp index 9931d89ad4..a19f15eca6 100644 --- a/engines/tsage/ringworld_scenes3.cpp +++ b/engines/tsage/ringworld_scenes3.cpp @@ -488,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: { @@ -631,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); @@ -655,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++) { @@ -1401,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) { @@ -1408,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; @@ -1471,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); @@ -1497,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); @@ -1534,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) { @@ -1660,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); @@ -1683,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: @@ -1748,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; @@ -1818,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); @@ -1852,7 +1856,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _globals->_player.fixPriority(152); _globals->_player.setStrip(2); - _field1800 = 1; + _sitFl = 1; setAction(&_action16); } break; @@ -1926,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: @@ -1958,7 +1962,7 @@ void Scene2100::signal() { void Scene2100::synchronize(Serializer &s) { Scene::synchronize(s); if (s.getVersion() >= 3) - s.syncAsSint16LE(_field1800); + s.syncAsSint16LE(_sitFl); } /*-------------------------------------------------------------------------- @@ -2479,6 +2483,15 @@ Scene2150::Scene2150() : _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) { @@ -2492,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); @@ -2544,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); @@ -4371,6 +4375,7 @@ void Scene2280::synchronize(Serializer &s) { *--------------------------------------------------------------------------*/ void Scene2300::Action1::signal() { + // Quinn and Seeker Scene2300 *scene = (Scene2300 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -4441,6 +4446,7 @@ void Scene2300::Action1::signal() { break; case 8: _globals->_game->endGame(2300, 0); + remove(); break; case 9: if (scene->_hotspot5._mover) @@ -4513,6 +4519,7 @@ void Scene2300::Action1::signal() { } void Scene2300::Action2::signal() { + // Miranda tearing cables Scene2300 *scene = (Scene2300 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -4579,6 +4586,7 @@ void Scene2300::Action2::signal() { } void Scene2300::Action3::signal() { + // Stunned Miranda Scene2300 *scene = (Scene2300 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -4631,6 +4639,7 @@ void Scene2300::Action3::signal() { } void Scene2300::Action4::signal() { + // Ennemies coming Scene2300 *scene = (Scene2300 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -4669,6 +4678,7 @@ void Scene2300::Action4::signal() { /*--------------------------------------------------------------------------*/ void Scene2300::Hotspot5::doAction(int action) { + // Ennemies Scene2300 *scene = (Scene2300 *)_globals->_sceneManager._scene; switch (action) { @@ -4691,6 +4701,7 @@ void Scene2300::Hotspot5::doAction(int action) { } void Scene2300::Hotspot7::doAction(int action) { + // Miranda Scene2300 *scene = (Scene2300 *)_globals->_sceneManager._scene; switch (action) { @@ -5162,6 +5173,7 @@ void Scene2320::Action3::signal() { } void Scene2320::Action4::signal() { + // Fly Cycle actions Scene2320 *scene = (Scene2320 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -5228,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)) { @@ -5289,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); @@ -5588,6 +5603,7 @@ void Scene2320::Hotspot8::doAction(int action) { } void Scene2320::Hotspot10::doAction(int action) { + // Seeker Scene2320 *scene = (Scene2320 *)_globals->_sceneManager._scene; switch (action) { @@ -5681,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) { @@ -5733,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) { @@ -5761,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) { @@ -5813,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); @@ -5897,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 3c3b90db56..cc237a1f91 100644 --- a/engines/tsage/ringworld_scenes3.h +++ b/engines/tsage/ringworld_scenes3.h @@ -278,7 +278,7 @@ public: Action15 _action15; Action16 _action16; Action17 _action17; - int _field1800; + int _sitFl; SceneArea _area1, _area2, _area3, _area4; Scene2100(); diff --git a/engines/tsage/ringworld_scenes5.cpp b/engines/tsage/ringworld_scenes5.cpp index cda69b859f..8b95e40abe 100644 --- a/engines/tsage/ringworld_scenes5.cpp +++ b/engines/tsage/ringworld_scenes5.cpp @@ -34,6 +34,7 @@ namespace tSage { *--------------------------------------------------------------------------*/ void Scene4000::Action1::signal() { + // Quinn has the peg. Everybody enter the screen. Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -124,6 +125,8 @@ void Scene4000::Action1::signal() { } void Scene4000::Action2::signal() { + // Quinn, Seeker and Miranda walks down to the village + // Then, they talk to Rock, and enter the priest hut Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -179,6 +182,7 @@ void Scene4000::Action2::signal() { } void Scene4000::Action3::signal() { + // The guard walks to the left and exits the screen Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -197,6 +201,7 @@ void Scene4000::Action3::signal() { } void Scene4000::Action4::signal() { + // Quinn ties the rope to the rock Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -235,6 +240,7 @@ void Scene4000::Action4::signal() { } void Scene4000::Action5::signal() { + // Chat with Miranda Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -261,6 +267,8 @@ void Scene4000::Action5::signal() { } void Scene4000::Action6::signal() { + // Quinn and Miranda enter the screen and walk to the village. + // Rock comes and notices the alcohol. They all enter his hut. Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -322,6 +330,7 @@ void Scene4000::Action7::signal() { } void Scene4000::Action8::signal() { + // Climb down right Chimney using a rope Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -335,7 +344,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); @@ -362,6 +371,7 @@ void Scene4000::Action8::signal() { } void Scene4000::Action9::signal() { + // Villager animations switch (_actionIndex++) { case 0: setDelay(_globals->_randomSource.getRandomNumber(119) + 240); @@ -374,6 +384,7 @@ void Scene4000::Action9::signal() { } void Scene4000::Action10::signal() { + // Villager animations switch (_actionIndex++) { case 0: setDelay(_globals->_randomSource.getRandomNumber(119) + 240); @@ -432,6 +443,7 @@ void Scene4000::Action11::signal() { } void Scene4000::Action12::signal() { + // Quinn enter Rock's hut Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -473,6 +485,7 @@ void Scene4000::Action12::signal() { } void Scene4000::Action13::signal() { + // Lander is landing Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -538,6 +551,7 @@ void Scene4000::Miranda::doAction(int action) { } void Scene4000::Hotspot8::doAction(int action) { + // Guard Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; switch (action) { @@ -652,7 +666,7 @@ void Scene4000::TheTech::doAction(int action) { } void Scene4000::Hotspot13::doAction(int action) { - // Rock + // Rock between the two chimneys Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; switch (action) { @@ -672,6 +686,7 @@ void Scene4000::Hotspot13::doAction(int action) { } void Scene4000::Hotspot::doAction(int action) { + // Wall between the two doors Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; switch (action) { @@ -752,6 +767,7 @@ void Scene4000::Hotspot18::doAction(int action) { } void Scene4000::Hotspot23::doAction(int action) { + // Door of the temple switch (action) { case CURSOR_LOOK: SceneItem::display2(4000, _globals->getFlag(31) ? 10 : 9); @@ -996,6 +1012,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _miranda.setPosition(Common::Point(246, 146)); if (_globals->getFlag(39)) { + // Ollo follows Quinn and gives explanations on the Tech. _globals->clearFlag(39); _olo.postInit(); @@ -1006,6 +1023,8 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _sceneMode = 4010; _globals->_player.disableControl(); + // This is the buggy animation where Miranda comments the Tech even + // if she's not in the room but in the lander. setAction(&_sequenceManager1, this, 4010, &_globals->_player, &_olo, NULL); } @@ -1458,7 +1477,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) { @@ -2712,6 +2731,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)); @@ -2978,7 +3001,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), @@ -3088,6 +3111,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_scenes6.cpp b/engines/tsage/ringworld_scenes6.cpp index 958c0ef9e2..9e5766d656 100644 --- a/engines/tsage/ringworld_scenes6.cpp +++ b/engines/tsage/ringworld_scenes6.cpp @@ -614,6 +614,7 @@ void Scene5000::dispatch() { *--------------------------------------------------------------------------*/ void Scene5100::Action1::signal() { + // Quinn enters the cave for the first time Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -663,6 +664,7 @@ void Scene5100::Action1::signal() { } void Scene5100::Action2::signal() { + // Quinn and Seeker exit the cave Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -712,6 +714,7 @@ void Scene5100::Action2::signal() { } void Scene5100::Action3::signal() { + // Quinns shots flesheater Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -746,7 +749,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; @@ -807,6 +810,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++) { @@ -822,7 +826,7 @@ void Scene5100::Action5::signal() { break; case 3: scene->_sceneMode = 5106; - scene->setAction(&scene->_sequenceManager, scene, 5106, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager, scene, 5106, &_globals->_player, &scene->_hotspot14, NULL); break; } } @@ -943,6 +947,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) { @@ -1083,7 +1088,7 @@ void Scene5100::postInit(SceneObjectList *OwnerList) { _globals->_player.animate(ANIM_MODE_1, NULL); _globals->_player.disableControl(); - if (!_globals->getFlag(66)) { + if ((!_globals->getFlag(66)) || (RING_INVENTORY._stasisBox._sceneNumber != 1)) { _hotspot14.postInit(); _hotspot14.setVisage(5101); _hotspot14.setPosition(Common::Point(498, 147)); @@ -1744,6 +1749,7 @@ void Scene5200::dispatch() { *--------------------------------------------------------------------------*/ void Scene5300::Action1::signal() { + // Seeker waking up Scene5300 *scene = (Scene5300 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -1777,7 +1783,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; @@ -1855,8 +1862,8 @@ void Scene5300::Hotspot1::doAction(int action) { break; } } - void Scene5300::Hotspot2::doAction(int action) { + // Seeker Scene5300 *scene = (Scene5300 *)_globals->_sceneManager._scene; switch (action) { @@ -1883,11 +1890,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; @@ -1924,6 +1937,7 @@ void Scene5300::Hotspot2::doAction(int action) { } void Scene5300::Hotspot5::doAction(int action) { + // Sharp bone Scene5300 *scene = (Scene5300 *)_globals->_sceneManager._scene; switch (action) { @@ -2068,6 +2082,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); @@ -2175,7 +2190,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_scenes8.cpp b/engines/tsage/ringworld_scenes8.cpp index 05306fb450..934c7494fa 100644 --- a/engines/tsage/ringworld_scenes8.cpp +++ b/engines/tsage/ringworld_scenes8.cpp @@ -43,11 +43,12 @@ void SceneObject7700::synchronize(Serializer &s) { } /*-------------------------------------------------------------------------- - * 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++) { @@ -125,6 +126,7 @@ void Scene7000::Action3::dispatch() { /*--------------------------------------------------------------------------*/ void Scene7000::Action3::signal() { + // Lander is landing Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -260,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(); @@ -361,6 +364,7 @@ void Scene7000::Hotspot1::doAction(int action) { /*--------------------------------------------------------------------------*/ void Scene7000::Object1::doAction(int action) { + // Skeenar Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; switch (action) { @@ -439,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; @@ -652,7 +656,7 @@ void Scene7000::signal() { /*-------------------------------------------------------------------------- - * Scene 7100 + * Scene 7100 - Underwater: swimming * *--------------------------------------------------------------------------*/ @@ -1136,7 +1140,7 @@ void Scene7100::postInit(SceneObjectList *OwnerList) { _globals->_soundHandler.startSound(270); } /*-------------------------------------------------------------------------- - * Scene 7200 + * Scene 7200 - Underwater: Entering the cave * *--------------------------------------------------------------------------*/ @@ -1302,7 +1306,7 @@ void Scene7200::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 7300 + * Scene 7300 - Underwater: Lord Poria * *--------------------------------------------------------------------------*/ @@ -1497,7 +1501,7 @@ void Scene7300::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 7600 + * Scene 7600 - Floating Buildings: Outside * *--------------------------------------------------------------------------*/ @@ -1602,7 +1606,7 @@ void Scene7600::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- - * Scene 7700 + * Scene 7700 - Floating Buildings: In the lab * *--------------------------------------------------------------------------*/ diff --git a/engines/tsage/saveload.cpp b/engines/tsage/saveload.cpp index 6ae62568a3..56df32146a 100644 --- a/engines/tsage/saveload.cpp +++ b/engines/tsage/saveload.cpp @@ -64,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); } diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp index 3741bdafd7..4625661b62 100644 --- a/engines/tsage/scenes.cpp +++ b/engines/tsage/scenes.cpp @@ -227,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); @@ -319,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; @@ -458,32 +463,32 @@ 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); - - 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; - } - } + int remainingDiff = MAX(diff1, diff2); + + 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) diff --git a/engines/tsage/tsage.cpp b/engines/tsage/tsage.cpp index 4f55ecfb83..50ce0ce4be 100644 --- a/engines/tsage/tsage.cpp +++ b/engines/tsage/tsage.cpp @@ -60,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 @@ -83,7 +83,7 @@ void TSageEngine::initialise() { _globals->gfxManager().setDefaults(); } -void TSageEngine::deinitialise() { +void TSageEngine::deinitialize() { delete _globals; delete _resourceManager; delete _saver; @@ -91,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; } @@ -124,7 +124,7 @@ Common::Error TSageEngine::loadGameState(int slot) { /** * Save the game to the given slot index, and with the given name */ -Common::Error TSageEngine::saveGameState(int slot, const char *desc) { +Common::Error TSageEngine::saveGameState(int slot, const Common::String &desc) { return _saver->save(slot, desc); } diff --git a/engines/tsage/tsage.h b/engines/tsage/tsage.h index 2228212510..563fdfcc21 100644 --- a/engines/tsage/tsage.h +++ b/engines/tsage/tsage.h @@ -83,11 +83,11 @@ public: virtual bool canLoadGameStateCurrently(); virtual bool canSaveGameStateCurrently(); virtual Common::Error loadGameState(int slot); - virtual Common::Error saveGameState(int slot, const char *desc); + virtual Common::Error saveGameState(int slot, const Common::String &desc); Common::String generateSaveName(int slot); - void initialise(); - void deinitialise(); + void initialize(); + void deinitialize(); }; extern TSageEngine *_vm; diff --git a/engines/tucker/detection.cpp b/engines/tucker/detection.cpp index 9b466d682d..31d9caef73 100644 --- a/engines/tucker/detection.cpp +++ b/engines/tucker/detection.cpp @@ -201,8 +201,7 @@ public: } for (int slot = 0; slot <= Tucker::kLastSaveSlot; ++slot) { if (slotsTable[slot]) { - char description[64]; - snprintf(description, sizeof(description), "savegm.%02d", slot); + Common::String description = Common::String::format("savegm.%02d", slot); saveList.push_back(SaveStateDescriptor(slot, description)); } } diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp index 467500b121..bee09f7391 100644 --- a/engines/tucker/resource.cpp +++ b/engines/tucker/resource.cpp @@ -160,39 +160,37 @@ public: }; uint8 *TuckerEngine::loadFile(const char *fname, uint8 *p) { - char filename[80]; - strcpy(filename, fname); + Common::String filename; + filename = fname; if (_gameLang == Common::DE_DEU) { - if (strcmp(filename, "bgtext.c") == 0) { - strcpy(filename, "bgtextgr.c"); - } else if (strcmp(filename, "charname.c") == 0) { - strcpy(filename, "charnmgr.c"); - } else if (strcmp(filename, "data5.c") == 0) { - strcpy(filename, "data5gr.c"); - } else if (strcmp(filename, "infobar.txt") == 0) { - strcpy(filename, "infobrgr.txt"); - } else if (strcmp(filename, "charsize.dta") == 0) { - strcpy(filename, "charszgr.dta"); - } else if (strncmp(filename, "objtxt", 6) == 0) { - const char num = filename[6]; - snprintf(filename, sizeof(filename), "objtx%cgr.c", num); - } else if (strncmp(filename, "pt", 2) == 0) { - const char num = filename[2]; - snprintf(filename, sizeof(filename), "pt%ctxtgr.c", num); + if (filename == "bgtext.c") { + filename = "bgtextgr.c"; + } else if (filename == "charname.c") { + filename = "charnmgr.c"; + } else if (filename == "data5.c") { + filename = "data5gr.c"; + } else if (filename == "infobar.txt") { + filename = "infobrgr.txt"; + } else if (filename == "charsize.dta") { + filename = "charszgr.dta"; + } else if (filename.hasPrefix("objtxt")) { + filename = Common::String::format("objtx%cgr.c", filename[6]); + } else if (filename.hasPrefix("pt")) { + filename = Common::String::format("pt%ctxtgr.c", filename[2]); } } _fileLoadSize = 0; bool decode = false; if (_gameFlags & kGameFlagEncodedData) { - char *ext = strrchr(filename, '.'); - if (ext && strcmp(ext + 1, "c") == 0) { - strcpy(ext + 1, "enc"); + if (filename.hasSuffix(".c")) { + filename.deleteLastChar(); + filename += "enc"; decode = true; } } Common::File f; if (!f.open(filename)) { - warning("Unable to open '%s'", filename); + warning("Unable to open '%s'", filename.c_str()); return 0; } const int sz = f.size(); @@ -389,23 +387,23 @@ void TuckerEngine::loadBudSpr(int startOffset) { int spriteOffset = 0; for (int i = startOffset; i < endOffset; ++i) { if (framesCount[frame] == i) { - char filename[40]; + Common::String filename; switch (_flagsTable[137]) { case 0: if ((_gameFlags & kGameFlagDemo) != 0) { - snprintf(filename, sizeof(filename), "budl00_%d.pcx", frame + 1); + filename = Common::String::format("budl00_%d.pcx", frame + 1); } else { - snprintf(filename, sizeof(filename), "bud_%d.pcx", frame + 1); + filename = Common::String::format("bud_%d.pcx", frame + 1); } break; case 1: - snprintf(filename, sizeof(filename), "peg_%d.pcx", frame + 1); + filename = Common::String::format("peg_%d.pcx", frame + 1); break; default: - snprintf(filename, sizeof(filename), "mac_%d.pcx", frame + 1); + filename = Common::String::format("mac_%d.pcx", frame + 1); break; } - loadImage(filename, _loadTempBuf, 0); + loadImage(filename.c_str(), _loadTempBuf, 0); ++frame; } int sz = Graphics::encodeRLE(_loadTempBuf + _spriteFramesTable[i].sourceOffset, _spritesGfxBuf + spriteOffset, _spriteFramesTable[i].xSize, _spriteFramesTable[i].ySize); @@ -479,30 +477,30 @@ void TuckerEngine::loadCTable02(int fl) { } void TuckerEngine::loadLoc() { - char filename[40]; + Common::String filename; int i = _locationWidthTable[_locationNum]; _locationHeight = (_locationNum < 73) ? 140 : 200; - snprintf(filename, sizeof(filename), (i == 1) ? "loc%02d.pcx" : "loc%02da.pcx", _locationNum); - copyLocBitmap(filename, 0, false); + filename = Common::String::format((i == 1) ? "loc%02d.pcx" : "loc%02da.pcx", _locationNum); + copyLocBitmap(filename.c_str(), 0, false); Graphics::copyRect(_quadBackgroundGfxBuf, 320, _locationBackgroundGfxBuf, 640, 320, _locationHeight); if (_locationHeight == 200) { return; } - snprintf(filename, sizeof(filename), (i != 2) ? "path%02d.pcx" : "path%02da.pcx", _locationNum); - copyLocBitmap(filename, 0, true); + filename = Common::String::format((i != 2) ? "path%02d.pcx" : "path%02da.pcx", _locationNum); + copyLocBitmap(filename.c_str(), 0, true); if (i > 1) { - snprintf(filename, sizeof(filename), "loc%02db.pcx", _locationNum); - copyLocBitmap(filename, 320, false); + filename = Common::String::format("loc%02db.pcx", _locationNum); + copyLocBitmap(filename.c_str(), 320, false); Graphics::copyRect(_quadBackgroundGfxBuf + 44800, 320, _locationBackgroundGfxBuf + 320, 640, 320, _locationHeight); if (i == 2) { - snprintf(filename, sizeof(filename), "path%02db.pcx", _locationNum); - copyLocBitmap(filename, 320, true); + filename = Common::String::format("path%02db.pcx", _locationNum); + copyLocBitmap(filename.c_str(), 320, true); } } if (i > 2) { - snprintf(filename, sizeof(filename), "loc%02dc.pcx", _locationNum); - copyLocBitmap(filename, 0, false); + filename = Common::String::format("loc%02dc.pcx", _locationNum); + copyLocBitmap(filename.c_str(), 0, false); Graphics::copyRect(_quadBackgroundGfxBuf + 89600, 320, _locationBackgroundGfxBuf, 640, 320, 140); } if (_locationNum == 1) { @@ -510,8 +508,8 @@ void TuckerEngine::loadLoc() { loadImage("rochpath.pcx", _loadLocBufPtr, 0); } if (i > 3) { - snprintf(filename, sizeof(filename), "loc%02dd.pcx", _locationNum); - copyLocBitmap(filename, 0, false); + filename = Common::String::format("loc%02dd.pcx", _locationNum); + copyLocBitmap(filename.c_str(), 0, false); Graphics::copyRect(_quadBackgroundGfxBuf + 134400, 320, _locationBackgroundGfxBuf + 320, 640, 320, 140); } _fullRedraw = true; @@ -540,13 +538,13 @@ void TuckerEngine::loadObj() { } _currentPartNum = _partNum; - char filename[40]; - snprintf(filename, sizeof(filename), "objtxt%d.c", _partNum); + Common::String filename; + filename = Common::String::format("objtxt%d.c", _partNum); free(_objTxtBuf); - _objTxtBuf = loadFile(filename, 0); - snprintf(filename, sizeof(filename), "pt%dtext.c", _partNum); + _objTxtBuf = loadFile(filename.c_str(), 0); + filename = Common::String::format("pt%dtext.c", _partNum); free(_ptTextBuf); - _ptTextBuf = loadFile(filename, 0); + _ptTextBuf = loadFile(filename.c_str(), 0); _characterSpeechDataPtr = _ptTextBuf; loadData(); loadPanObj(); @@ -584,9 +582,8 @@ void TuckerEngine::loadData() { _dataCount = maxCount; int offset = 0; for (int i = 0; i < count; ++i) { - char filename[40]; - snprintf(filename, sizeof(filename), "scrobj%d%d.pcx", _partNum, i); - loadImage(filename, _loadTempBuf, 0); + Common::String filename = Common::String::format("scrobj%d%d.pcx", _partNum, i); + loadImage(filename.c_str(), _loadTempBuf, 0); offset = loadDataHelper(offset, i); } } @@ -603,9 +600,8 @@ int TuckerEngine::loadDataHelper(int offset, int index) { } void TuckerEngine::loadPanObj() { - char filename[40]; - snprintf(filename, sizeof(filename), "panobjs%d.pcx", _partNum); - loadImage(filename, _loadTempBuf, 0); + Common::String filename = Common::String::format("panobjs%d.pcx", _partNum); + loadImage(filename.c_str(), _loadTempBuf, 0); int offset = 0; for (int y = 0; y < 5; ++y) { for (int x = 0; x < 10; ++x) { @@ -812,9 +808,8 @@ void TuckerEngine::loadSprA02_01() { unloadSprA02_01(); const int count = _sprA02LookupTable[_locationNum]; for (int i = 1; i < count + 1; ++i) { - char filename[40]; - snprintf(filename, sizeof(filename), "sprites/a%02d_%02d.spr", _locationNum, i); - _sprA02Table[i] = loadFile(filename, 0); + Common::String filename = Common::String::format("sprites/a%02d_%02d.spr", _locationNum, i); + _sprA02Table[i] = loadFile(filename.c_str(), 0); } _sprA02Table[0] = _sprA02Table[1]; } @@ -831,9 +826,8 @@ void TuckerEngine::loadSprC02_01() { unloadSprC02_01(); const int count = _sprC02LookupTable[_locationNum]; for (int i = 1; i < count + 1; ++i) { - char filename[40]; - snprintf(filename, sizeof(filename), "sprites/c%02d_%02d.spr", _locationNum, i); - _sprC02Table[i] = loadFile(filename, 0); + Common::String filename = Common::String::format("sprites/c%02d_%02d.spr", _locationNum, i); + _sprC02Table[i] = loadFile(filename.c_str(), 0); } _sprC02Table[0] = _sprC02Table[1]; _spritesCount = _sprC02LookupTable2[_locationNum]; @@ -942,8 +936,7 @@ void TuckerEngine::loadSound(Audio::Mixer::SoundType type, int num, int volume, default: return; } - char fileName[64]; - snprintf(fileName, sizeof(fileName), fmt, num); + Common::String fileName = Common::String::format(fmt, num); Common::File *f = new Common::File; if (f->open(fileName)) { stream = Audio::makeWAVStream(f, DisposeAfterUse::YES); diff --git a/engines/tucker/saveload.cpp b/engines/tucker/saveload.cpp index 754e8deae9..5bc51acf84 100644 --- a/engines/tucker/saveload.cpp +++ b/engines/tucker/saveload.cpp @@ -36,9 +36,7 @@ Common::String generateGameStateFileName(const char *target, int slot, bool pref if (prefixOnly) { name += ".*"; } else { - char slotStr[16]; - snprintf(slotStr, sizeof(slotStr), ".%d", slot); - name += slotStr; + name += Common::String::format(".%d", slot); } return name; } @@ -101,7 +99,7 @@ Common::Error TuckerEngine::loadGameState(int num) { return ret; } -Common::Error TuckerEngine::saveGameState(int num, const char *description) { +Common::Error TuckerEngine::saveGameState(int num, const Common::String &description) { Common::Error ret = Common::kNoError; Common::String gameStateFileName = generateGameStateFileName(_targetName.c_str(), num); Common::OutSaveFile *f = _saveFileMan->openForSaving(gameStateFileName); diff --git a/engines/tucker/sequences.cpp b/engines/tucker/sequences.cpp index 23ae3380cd..775fd6f1a0 100644 --- a/engines/tucker/sequences.cpp +++ b/engines/tucker/sequences.cpp @@ -115,31 +115,31 @@ void TuckerEngine::handleCreditsSequence() { _fadePaletteCounter = 0; clearSprites(); ++num; - char filename[40]; + Common::String filename; if (num == 6) { for (int i = 0; i < 16; ++i) { - snprintf(filename, sizeof(filename), "cogs%04d.pcx", i + 1); - loadImage(filename, imgBuf + i * 64000, 2); + filename = Common::String::format("cogs%04d.pcx", i + 1); + loadImage(filename.c_str(), imgBuf + i * 64000, 2); } } else { switch (num) { case 1: - strcpy(filename, "loc75.pcx"); + filename = "loc75.pcx"; break; case 2: - strcpy(filename, "loc76.pcx"); + filename = "loc76.pcx"; break; case 3: - strcpy(filename, "paper-3.pcx"); + filename = "paper-3.pcx"; break; case 4: - strcpy(filename, "loc77.pcx"); + filename = "loc77.pcx"; break; case 5: - strcpy(filename, "loc78.pcx"); + filename = "loc78.pcx"; break; } - loadImage(filename, _quadBackgroundGfxBuf, 2); + loadImage(filename.c_str(), _quadBackgroundGfxBuf, 2); } _spritesCount = _creditsSequenceSpriteCounts[num]; ++_flagsTable[236]; @@ -584,8 +584,7 @@ Audio::RewindableAudioStream *AnimationSequencePlayer::loadSound(int index, Anim if (stream) return stream; - char fileName[64]; - snprintf(fileName, sizeof(fileName), "audio/%s", _audioFileNamesTable[index]); + Common::String fileName = Common::String::format("audio/%s", _audioFileNamesTable[index]); Common::File f; if (f.open(fileName)) { int size = 0, rate = 0; diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h index b011d65cbb..e676369427 100644 --- a/engines/tucker/tucker.h +++ b/engines/tucker/tucker.h @@ -565,7 +565,7 @@ protected: template <class S> void saveOrLoadGameStateData(S &s); virtual Common::Error loadGameState(int num); - virtual Common::Error saveGameState(int num, const char *description); + virtual Common::Error saveGameState(int num, const Common::String &description); virtual bool canLoadGameStateCurrently(); virtual bool canSaveGameStateCurrently(); diff --git a/graphics/font.cpp b/graphics/font.cpp index 5f5a9b2fca..cdf9090625 100644 --- a/graphics/font.cpp +++ b/graphics/font.cpp @@ -30,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]; } @@ -74,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<byte>(ptr, dst->pitch, tmp, y, MAX(0, -(tx + bbx)), MIN(bbw, dst->w - tx - bbx), color); @@ -615,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 f68f49175f..7a992674d2 100644 --- a/graphics/font.h +++ b/graphics/font.h @@ -157,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/iff.h b/graphics/iff.h index 761c57c932..4d88148372 100644 --- a/graphics/iff.h +++ b/graphics/iff.h @@ -111,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/palette.h b/graphics/palette.h index 7eedb0f78d..77891c3fdc 100644 --- a/graphics/palette.h +++ b/graphics/palette.h @@ -55,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 9779d3231c..80bcb7a71e 100644 --- a/graphics/pict.cpp +++ b/graphics/pict.cpp @@ -324,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/scaler.cpp b/graphics/scaler.cpp index 8038e2089e..a35fb9046e 100644 --- a/graphics/scaler.cpp +++ b/graphics/scaler.cpp @@ -196,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) { @@ -221,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) { @@ -254,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<ColorMask> /** - * Trivial nearest-neighbour 1.5x scaler. + * Trivial nearest-neighbor 1.5x scaler. */ template<typename ColorMask> void Normal1o5xTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, diff --git a/graphics/surface.cpp b/graphics/surface.cpp index 3f53ce56f4..cee8e61438 100644 --- a/graphics/surface.cpp +++ b/graphics/surface.cpp @@ -42,8 +42,10 @@ void Surface::drawLine(int x0, int y0, int x1, int y1, uint32 color) { Graphics::drawLine(x0, y0, x1, y1, color, plotPoint<byte>, this); else if (format.bytesPerPixel == 2) Graphics::drawLine(x0, y0, x1, y1, color, plotPoint<uint16>, this); + else if (format.bytesPerPixel == 4) + Graphics::drawLine(x0, y0, x1, y1, color, plotPoint<uint32>, 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) { @@ -88,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"); } } @@ -120,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"); } } @@ -145,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) { @@ -159,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); @@ -172,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) { @@ -183,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; @@ -223,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); @@ -240,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/yuv_to_rgb.cpp b/graphics/yuv_to_rgb.cpp index 831736cd75..037ea9a007 100644 --- a/graphics/yuv_to_rgb.cpp +++ b/graphics/yuv_to_rgb.cpp @@ -196,52 +196,63 @@ DECLARE_SINGLETON(Graphics::YUVToRGBManager); namespace Graphics { #define PUT_PIXEL(s, d) \ - L = &lookup->_rgbToPix[(s)]; \ - if (dst->format.bytesPerPixel == 2) \ - *((uint16 *)(d)) = (L[cr_r] | L[crb_g] | L[cb_b]); \ - else \ - *((uint32 *)(d)) = (L[cr_r] | L[crb_g] | L[cb_b]) - -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); - - byte *dstPtr = (byte *)dst->pixels; + L = &rgbToPix[(s)]; \ + *((PixelInt *)(d)) = (L[cr_r] | L[crb_g] | L[cb_b]) +template<typename PixelInt> +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 uint32 *L; + register const uint32 *L; - int16 cr_r = lookup->_colorTab[*vSrc + 0 * 256]; - int16 crb_g = lookup->_colorTab[*vSrc + 1 * 256] + lookup->_colorTab[*uSrc + 2 * 256]; - int16 cb_b = lookup->_colorTab[*uSrc + 3 * 256]; + 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 + dst->pitch); + PUT_PIXEL(*(ySrc + yPitch), dstPtr + dstPitch); ySrc++; - dstPtr += dst->format.bytesPerPixel; + dstPtr += sizeof(PixelInt); PUT_PIXEL(*ySrc, dstPtr); - PUT_PIXEL(*(ySrc + yPitch), dstPtr + dst->pitch); + PUT_PIXEL(*(ySrc + yPitch), dstPtr + dstPitch); ySrc++; - dstPtr += dst->format.bytesPerPixel; + dstPtr += sizeof(PixelInt); } - dstPtr += dst->pitch; + 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<uint16>((byte *)dst->pixels, dst->pitch, lookup, ySrc, uSrc, vSrc, yWidth, yHeight, yPitch, uvPitch); + else + convertYUV420ToRGB<uint32>((byte *)dst->pixels, dst->pitch, lookup, ySrc, uSrc, vSrc, yWidth, yHeight, yPitch, uvPitch); +} + } // End of namespace Graphics diff --git a/gui/credits.h b/gui/credits.h index a22c0b0941..1b13b31829 100644 --- a/gui/credits.h +++ b/gui/credits.h @@ -62,36 +62,7 @@ static const char *credits[] = { "C0""Ludvig Strigeus", "C2""(retired)", "", -"C1""Beneath a Steel Sky", -"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", @@ -99,12 +70,12 @@ static const char *credits[] = { "C0""Kari Salminen", "C0""Eugene Sandulenko", "", -"C1""Cinematique evo 2", +"C1""CruisE", "C0""Paul Gilbert", "C0""Vincent Hamm", "C2""(retired)", "", -"C1""Draci Historie", +"C1""Draci", "C0""Denis Kasak", "C0""Robert Spalek", "", @@ -112,12 +83,6 @@ static const char *credits[] = { "C0""Filippos Karapetis", "C0""Pawel Kolodziejski", "", -"C1""Flight of the Amazon Queen", -"C0""David Eriksson", -"C2""(retired)", -"C0""Gregory Montoir", -"C0""Joost Peters", -"", "C1""Gob", "C0""Torbj\366rn Andersson", "C0""Arnaud Boutonn\351", @@ -142,12 +107,12 @@ 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", "", -"C1""Lure of the Temptress", +"C1""Lure", "C0""Paul Gilbert", "", "C1""M4", @@ -171,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", @@ -188,7 +159,36 @@ static const char *credits[] = { "C0""Jordi Vilalta Prat", "C0""Lars Skovlund", "", -"C1""Teen Agent", +"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", "C0""Vladimir Menshakov", @@ -249,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", diff --git a/gui/debugger.cpp b/gui/debugger.cpp index ab3fcef6b2..2f49cb2bbe 100644 --- a/gui/debugger.cpp +++ b/gui/debugger.cpp @@ -29,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 <readline/readline.h> @@ -44,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); @@ -66,7 +66,7 @@ Debugger::Debugger() { } Debugger::~Debugger() { -#ifndef USE_TEXT_CONSOLE +#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER delete _debuggerDialog; #endif } @@ -78,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); @@ -125,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; @@ -140,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"); @@ -363,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; @@ -417,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; @@ -520,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 c6fce87107..6da569e0f8 100644 --- a/gui/debugger.h +++ b/gui/debugger.h @@ -29,7 +29,7 @@ namespace GUI { -#ifndef USE_TEXT_CONSOLE +#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER class ConsoleDialog; #endif @@ -144,7 +144,7 @@ private: */ bool _firstTime; -#ifndef USE_TEXT_CONSOLE +#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER GUI::ConsoleDialog *_debuggerDialog; #endif @@ -194,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/gui-manager.cpp b/gui/gui-manager.cpp index ef2f89df9c..af1852d56d 100644 --- a/gui/gui-manager.cpp +++ b/gui/gui-manager.cpp @@ -74,6 +74,14 @@ GuiManager::GuiManager() : _redrawStatus(kRedrawDisabled), _stateIsSaved(false), ConfMan.registerDefault("gui_renderer", ThemeEngine::findModeConfigName(ThemeEngine::_defaultRendererMode)); ThemeEngine::GraphicsMode gfxMode = (ThemeEngine::GraphicsMode)ThemeEngine::findMode(ConfMan.get("gui_renderer")); +#ifdef __DS__ + // Searching for the theme file takes ~10 seconds on the DS. + // Disable this search here because external themes are not supported. + if (!loadNewTheme("builtin", gfxMode)) { + // Loading the built-in theme failed as well. Bail out + error("Failed to load any GUI theme, aborting"); + } +#else // Try to load the theme if (!loadNewTheme(themefile, gfxMode)) { // Loading the theme failed, try to load the built-in theme @@ -82,6 +90,7 @@ GuiManager::GuiManager() : _redrawStatus(kRedrawDisabled), _stateIsSaved(false), error("Failed to load any GUI theme, aborting"); } } +#endif } GuiManager::~GuiManager() { @@ -297,7 +306,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/launcher.cpp b/gui/launcher.cpp index 792b5bbfbe..6920e0ccd2 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -685,10 +685,7 @@ void LauncherDialog::updateListing() { } if (description.empty()) { - char tmp[200]; - - snprintf(tmp, 200, "Unknown (target %s, gameid %s)", iter->_key.c_str(), gameid.c_str()); - description = tmp; + description = Common::String::format("Unknown (target %s, gameid %s)", iter->_key.c_str(), gameid.c_str()); } if (!gameid.empty() && !description.empty()) { @@ -718,6 +715,8 @@ void LauncherDialog::updateListing() { void LauncherDialog::addGame() { int modifiers = g_system->getEventManager()->getModifierState(); + +#ifndef DISABLE_MASS_ADD const bool massAdd = (modifiers & Common::KBD_SHIFT) != 0; if (massAdd) { @@ -746,6 +745,7 @@ void LauncherDialog::addGame() { updateButtons(); return; } +#endif // Allow user to add a new game to the list. // 1) show a dir selection dialog which lets the user pick the directory @@ -838,12 +838,10 @@ Common::String addGameToConf(const GameDescriptor &result) { assert(!domain.empty()); if (ConfMan.hasGameDomain(domain)) { int suffixN = 1; - char suffix[16]; Common::String gameid(domain); while (ConfMan.hasGameDomain(domain)) { - snprintf(suffix, 16, "-%d", suffixN); - domain = gameid + suffix; + domain = gameid + Common::String::format("-%d", suffixN); suffixN++; } } @@ -918,7 +916,7 @@ void LauncherDialog::loadGame(int item) { gameId = _domains[item]; const EnginePlugin *plugin = 0; - + EngineMan.findGame(gameId, &plugin); String target = _domains[item]; diff --git a/gui/massadd.cpp b/gui/massadd.cpp index 7b641d71e5..b0adce3f47 100644 --- a/gui/massadd.cpp +++ b/gui/massadd.cpp @@ -31,7 +31,7 @@ #include "gui/widget.h" #include "gui/widgets/list.h" - +#ifndef DISABLE_MASS_ADD namespace GUI { /* @@ -234,23 +234,23 @@ void MassAddDialog::handleTickle() { // Update the dialog - char buf[256]; + Common::String buf; if (_scanStack.empty()) { // Enable the OK button _okButton->setEnabled(true); - snprintf(buf, sizeof(buf), "%s", _("Scan complete!")); + buf = _("Scan complete!"); _dirProgressText->setLabel(buf); - snprintf(buf, sizeof(buf), _("Discovered %d new games, ignored %d previously added games."), _games.size(), _oldGamesCount); + buf = Common::String::format(_("Discovered %d new games, ignored %d previously added games."), _games.size(), _oldGamesCount); _gameProgressText->setLabel(buf); } else { - snprintf(buf, sizeof(buf), _("Scanned %d directories ..."), _dirsScanned); + buf = Common::String::format(_("Scanned %d directories ..."), _dirsScanned); _dirProgressText->setLabel(buf); - snprintf(buf, sizeof(buf), _("Discovered %d new games, ignored %d previously added games ..."), _games.size(), _oldGamesCount); + buf = Common::String::format(_("Discovered %d new games, ignored %d previously added games ..."), _games.size(), _oldGamesCount); _gameProgressText->setLabel(buf); } @@ -264,3 +264,4 @@ void MassAddDialog::handleTickle() { } // End of namespace GUI +#endif // DISABLE_MASS_ADD diff --git a/gui/options.cpp b/gui/options.cpp index 5cb70bc5e4..5022b808c4 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -138,7 +138,7 @@ void OptionsDialog::init() { _subSpeedDesc = 0; _subSpeedSlider = 0; _subSpeedLabel = 0; - _oldTheme = ConfMan.get("gui_theme"); + _oldTheme = g_gui.theme()->getThemeId(); // Retrieve game GUI options _guioptions = 0; @@ -241,11 +241,8 @@ void OptionsDialog::open() { } // MIDI gain setting - char buf[10]; - _midiGainSlider->setValue(ConfMan.getInt("midi_gain", _domain)); - sprintf(buf, "%.2f", (double)_midiGainSlider->getValue() / 100.0); - _midiGainLabel->setLabel(buf); + _midiGainLabel->setLabel(Common::String::format("%.2f", (double)_midiGainSlider->getValue() / 100.0)); } // MT-32 options @@ -530,12 +527,9 @@ void OptionsDialog::close() { } void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { - char buf[10]; - switch (cmd) { case kMidiGainChanged: - sprintf(buf, "%.2f", (double)_midiGainSlider->getValue() / 100.0); - _midiGainLabel->setLabel(buf); + _midiGainLabel->setLabel(Common::String::format("%.2f", (double)_midiGainSlider->getValue() / 100.0)); _midiGainLabel->draw(); break; case kMusicVolumeChanged: diff --git a/gui/saveload.cpp b/gui/saveload.cpp index 7c7394a71d..460246e5fc 100644 --- a/gui/saveload.cpp +++ b/gui/saveload.cpp @@ -359,8 +359,19 @@ void SaveLoadChooser::updateSaveList() { } // Fill the rest of the save slots with empty saves + + int maximumSaveSlots = (*_plugin)->getMaximumSaveSlot(); + +#ifdef __DS__ + // Low memory on the DS means too many save slots are impractical, so limit + // the maximum here. + if (maximumSaveSlots > 99) { + maximumSaveSlots = 99; + } +#endif + Common::String emptyDesc; - for (int i = curSlot; i <= (*_plugin)->getMaximumSaveSlot(); i++) { + for (int i = curSlot; i <= maximumSaveSlots; i++) { saveNames.push_back(emptyDesc); SaveStateDescriptor dummySave(i, ""); _saveList.push_back(dummySave); diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat Binary files differindex f025a05337..d696cc0d75 100644 --- a/gui/themes/translations.dat +++ b/gui/themes/translations.dat diff --git a/gui/widget.cpp b/gui/widget.cpp index 29838961df..8420391a3f 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -240,9 +240,7 @@ StaticTextWidget::StaticTextWidget(GuiObject *boss, const Common::String &name, } void StaticTextWidget::setValue(int value) { - char buf[256]; - sprintf(buf, "%d", value); - _label = buf; + _label = Common::String::format("%d", value); } void StaticTextWidget::setLabel(const Common::String &label) { diff --git a/gui/widgets/list.cpp b/gui/widgets/list.cpp index 065b240471..2a0d4afff0 100644 --- a/gui/widgets/list.cpp +++ b/gui/widgets/list.cpp @@ -38,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); @@ -70,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); @@ -499,9 +499,7 @@ void ListWidget::drawWidget() { // If in numbering mode, we first print a number prefix if (_numberingMode != kListNumberingOff) { - char temp[10]; - sprintf(temp, "%2d. ", (pos + _numberingMode)); - buffer = temp; + buffer = Common::String::format("%2d. ", (pos + _numberingMode)); g_gui.theme()->drawText(Common::Rect(_x, y, _x + r.left + _leftPadding, y + fontHeight - 2), buffer, _state, Graphics::kTextAlignLeft, inverted, _leftPadding, true); pad = 0; @@ -543,9 +541,8 @@ Common::Rect ListWidget::getEditRect() const { r.bottom += offset; if (_numberingMode != kListNumberingOff) { - char temp[10]; // FIXME: Assumes that all digits have the same width. - sprintf(temp, "%2d. ", (_list.size() - 1 + _numberingMode)); + Common::String temp = Common::String::format("%2d. ", (_list.size() - 1 + _numberingMode)); r.left += g_gui.getStringWidth(temp) + _leftPadding; } @@ -4,7 +4,7 @@ # -# UNIX specific +# POSIX specific # install: $(INSTALL) -d "$(DESTDIR)$(bindir)" @@ -92,10 +92,6 @@ ifdef USE_MAD OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libmad.a endif -ifdef USE_MPEG2 -OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libmpeg2.a -endif - ifdef USE_PNG OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libpng.a endif @@ -104,6 +100,10 @@ ifdef USE_THEORADEC OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libtheoradec.a endif +ifdef USE_FAAD +OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libfaad.a +endif + ifdef USE_ZLIB OSX_ZLIB ?= -lz endif @@ -20,11 +20,12 @@ ifdef TOOL_EXECUTABLE # TODO: Refactor this, so that even our master executable can use this rule? ################################################ TOOL-$(MODULE) := $(MODULE)/$(TOOL_EXECUTABLE)$(EXEEXT) -$(TOOL-$(MODULE)): $(MODULE_OBJS-$(MODULE)) +$(TOOL-$(MODULE)): $(MODULE_OBJS-$(MODULE)) $(TOOL_DEPS) $(QUIET_CXX)$(CXX) $(LDFLAGS) $+ -o $@ -# Reset TOOL_EXECUTABLE var +# Reset TOOL_* vars TOOL_EXECUTABLE:= +TOOL_DEPS:= # Add to "devtools" target devtools: $(TOOL-$(MODULE)) diff --git a/test/common/str.h b/test/common/str.h index 5d9fe29af9..0dee16a493 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/video/avi_decoder.cpp b/video/avi_decoder.cpp index e3fb2d09ac..9685952304 100644 --- a/video/avi_decoder.cpp +++ b/video/avi_decoder.cpp @@ -399,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/codecs/indeo3.cpp b/video/codecs/indeo3.cpp index 529f0b5bda..7bf7fc8235 100644 --- a/video/codecs/indeo3.cpp +++ b/video/codecs/indeo3.cpp @@ -22,8 +22,6 @@ #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 @@ -3516,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 c0a88fec5e..a07d779dec 100644 --- a/video/codecs/indeo3.h +++ b/video/codecs/indeo3.h @@ -22,8 +22,6 @@ #include "common/scummsys.h" -#ifdef USE_INDEO3 - /* Intel Indeo 3 decompressor, derived from ffmpeg. * * Original copyright note: @@ -87,5 +85,3 @@ private: } // End of namespace Video #endif // VIDEO_CODECS_INDEO3_H - -#endif // USE_INDEO3 diff --git a/video/coktel_decoder.cpp b/video/coktel_decoder.cpp index ee4b22e6b9..8ea2d08acb 100644 --- a/video/coktel_decoder.cpp +++ b/video/coktel_decoder.cpp @@ -1624,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/module.mk b/video/module.mk index 0172482dfa..d813218785 100644 --- a/video/module.mk +++ b/video/module.mk @@ -5,7 +5,6 @@ MODULE_OBJS := \ coktel_decoder.o \ dxa_decoder.o \ flic_decoder.o \ - mpeg_player.o \ qt_decoder.o \ smk_decoder.o \ video_decoder.o \ @@ -15,7 +14,6 @@ MODULE_OBJS := \ codecs/mjpeg.o \ codecs/msrle.o \ codecs/msvideo1.o \ - codecs/qdm2.o \ codecs/qtrle.o \ codecs/rpza.o \ codecs/smc.o \ diff --git a/video/mpeg_player.cpp b/video/mpeg_player.cpp deleted file mode 100644 index fa98860a38..0000000000 --- a/video/mpeg_player.cpp +++ /dev/null @@ -1,622 +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. - * - */ - -// 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 "video/mpeg_player.h" -#include "common/file.h" -#include "common/system.h" -#include "common/util.h" - -namespace Video { - -BaseAnimationState::BaseAnimationState(OSystem *sys, int width, int height) - : _movieWidth(width), _movieHeight(height), _frameWidth(width), _frameHeight(height), _sys(sys) { -#ifndef BACKEND_8BIT - const int screenW = _sys->getOverlayWidth(); - const int screenH = _sys->getOverlayHeight(); - - _movieScale = MIN(screenW / _movieWidth, screenH / _movieHeight); - - assert(_movieScale >= 1); - if (_movieScale > 3) - _movieScale = 3; - - _colorTab = NULL; - _rgbToPix = NULL; - memset(&_overlayFormat, 0, sizeof(_overlayFormat)); -#endif -} - -BaseAnimationState::~BaseAnimationState() { -#ifdef USE_MPEG2 - if (_mpegDecoder) - mpeg2_close(_mpegDecoder); - delete _mpegFile; -#ifndef BACKEND_8BIT - _sys->hideOverlay(); - free(_overlay); - free(_colorTab); - free(_rgbToPix); -#endif -#endif -} - - -bool BaseAnimationState::init(const char *name) { -#ifdef USE_MPEG2 - char tempFile[512]; - - _mpegDecoder = NULL; - _mpegFile = NULL; - -#ifdef BACKEND_8BIT - - uint i, p; - - // Load lookup palettes - sprintf(tempFile, "%s.pal", name); - - Common::File f; - - if (!f.open(tempFile)) { - warning("Cutscene: %s palette missing", tempFile); - return false; - } - - p = 0; - while (!f.eos()) { - _palettes[p].end = f.readUint16LE(); - _palettes[p].cnt = f.readUint16LE(); - - for (i = 0; i < _palettes[p].cnt; i++) { - _palettes[p].pal[4 * i] = f.readByte(); - _palettes[p].pal[4 * i + 1] = f.readByte(); - _palettes[p].pal[4 * i + 2] = f.readByte(); - _palettes[p].pal[4 * i + 3] = 0; - } - for (; i < 256; i++) { - _palettes[p].pal[4 * i] = 0; - _palettes[p].pal[4 * i + 1] = 0; - _palettes[p].pal[4 * i + 2] = 0; - _palettes[p].pal[4 * i + 3] = 0; - } - - p++; - } - - f.close(); - - _palNum = 0; - _maxPalNum = p; - setPalette(_palettes[_palNum].pal); - _lut = _lut2 = _yuvLookup[0]; - _curPal = -1; - _cr = 0; - buildLookup(_palNum, 256); - _lut2 = _yuvLookup[1]; - _lutCalcNum = (BITDEPTH + _palettes[_palNum].end + 2) / (_palettes[_palNum].end + 2); -#else - buildLookup(); - _overlay = (OverlayColor *)calloc(_movieScale * _movieWidth * _movieScale * _movieHeight, sizeof(OverlayColor)); - _sys->showOverlay(); -#endif - - // Open MPEG2 stream - _mpegFile = new Common::File(); - sprintf(tempFile, "%s.mp2", name); - if (!_mpegFile->open(tempFile)) { - warning("Cutscene: Could not open %s", tempFile); - return false; - } - - // Load and configure decoder - _mpegDecoder = mpeg2_init(); - if (_mpegDecoder == NULL) { - warning("Cutscene: Could not allocate an MPEG2 decoder"); - return false; - } - - _mpegInfo = mpeg2_info(_mpegDecoder); - _frameNum = 0; - - return true; -#else /* USE_MPEG2 */ - return false; -#endif -} - -bool BaseAnimationState::decodeFrame() { -#ifdef USE_MPEG2 - mpeg2_state_t state; - const mpeg2_sequence_t *sequence_i; - size_t size = (size_t) -1; - static byte buf[BUFFER_SIZE]; - - do { - state = mpeg2_parse(_mpegDecoder); - sequence_i = _mpegInfo->sequence; - - switch (state) { - case STATE_BUFFER: - size = _mpegFile->read(buf, BUFFER_SIZE); - mpeg2_buffer(_mpegDecoder, buf, buf + size); - break; - - case STATE_SLICE: - case STATE_END: - if (_mpegInfo->display_fbuf) { - checkPaletteSwitch(); - drawYUV(sequence_i->width, sequence_i->height, _mpegInfo->display_fbuf->buf); -#ifdef BACKEND_8BIT - buildLookup(_palNum + 1, _lutCalcNum); -#endif - - _frameNum++; - return true; - } - break; - - default: - break; - } - } while (size); -#endif - return false; -} - -bool BaseAnimationState::checkPaletteSwitch() { -#ifdef BACKEND_8BIT - // if we have reached the last image with this palette, switch to new one - if (_frameNum == _palettes[_palNum].end) { - unsigned char *l = _lut2; - _palNum++; - setPalette(_palettes[_palNum].pal); - _lutCalcNum = (BITDEPTH + _palettes[_palNum].end - (_frameNum + 1) + 2) / (_palettes[_palNum].end - (_frameNum + 1) + 2); - _lut2 = _lut; - _lut = l; - return true; - } -#endif - - return false; -} - -void BaseAnimationState::handleScreenChanged() { -#ifndef BACKEND_8BIT - const int screenW = _sys->getOverlayWidth(); - const int screenH = _sys->getOverlayHeight(); - - int newScale = MIN(screenW / _movieWidth, screenH / _movieHeight); - - assert(newScale >= 1); - if (newScale > 3) - newScale = 3; - - if (newScale != _movieScale) { - // HACK: Since frames generally do not cover the entire screen, - // We need to undraw the old frame. This is a very hacky - // way of doing that. - OverlayColor *buf = (OverlayColor *)calloc(screenW * screenH, sizeof(OverlayColor)); - _sys->copyRectToOverlay(buf, screenW, 0, 0, screenW, screenH); - free(buf); - - free(_overlay); - _movieScale = newScale; - _overlay = (OverlayColor *)calloc(_movieScale * _movieWidth * _movieScale * _movieHeight, sizeof(OverlayColor)); - } - - buildLookup(); -#endif -} - -#ifdef BACKEND_8BIT - -/** - * Build 'Best-Match' RGB lookup table - */ -void BaseAnimationState::buildLookup(int p, int lines) { - int y, cb; - int r, g, b, ii; - - if (p >= _maxPalNum) - return; - - if (p != _curPal) { - _curPal = p; - _cr = 0; - _pos = 0; - } - - if (_cr > BITDEPTH) - return; - - for (ii = 0; ii < lines; ii++) { - r = (-16 * 256 + (int) (256 * 1.596) * ((_cr << SHIFT) - 128)) / 256; - for (cb = 0; cb <= BITDEPTH; cb++) { - g = (-16 * 256 - (int) (0.813 * 256) * ((_cr << SHIFT) - 128) - (int) (0.391 * 256) * ((cb << SHIFT) - 128)) / 256; - b = (-16 * 256 + (int) (2.018 * 256) * ((cb << SHIFT) - 128)) / 256; - - for (y = 0; y <= BITDEPTH; y++) { - int idx, bst = 0; - int dis = 2 * SQR(r - _palettes[p].pal[0]) + 4 * SQR(g - _palettes[p].pal[1]) + SQR(b - _palettes[p].pal[2]); - - for (idx = 1; idx < 256; idx++) { - long d2 = 2 * SQR(r - _palettes[p].pal[4 * idx]) + 4 * SQR(g - _palettes[p].pal[4 * idx + 1]) + SQR(b - _palettes[p].pal[4 * idx + 2]); - if (d2 < dis) { - bst = idx; - dis = d2; - } - } - _lut2[_pos++] = bst; - - r += (1 << SHIFT); - g += (1 << SHIFT); - b += (1 << SHIFT); - } - r -= (BITDEPTH + 1) * (1 << SHIFT); - } - _cr++; - if (_cr > BITDEPTH) - return; - } -} - -#else - -void BaseAnimationState::buildLookup() { - // Do we already have lookup tables for this bit format? - Graphics::PixelFormat format = _sys->getOverlayFormat(); - if (format == _overlayFormat && _colorTab && _rgbToPix) - return; - - free(_colorTab); - free(_rgbToPix); - - _colorTab = (int16 *)malloc(4 * 256 * sizeof(int16)); - - 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 = (OverlayColor *)malloc(3 * 768 * sizeof(OverlayColor)); - - OverlayColor *r_2_pix_alloc = &_rgbToPix[0 * 768]; - OverlayColor *g_2_pix_alloc = &_rgbToPix[1 * 768]; - OverlayColor *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]; - } - - _overlayFormat = format; -} - -void BaseAnimationState::plotYUV(int width, int height, byte *const *dat) { - switch (_movieScale) { - case 1: - plotYUV1x(width, height, dat); - break; - case 2: - plotYUV2x(width, height, dat); - break; - case 3: - plotYUV3x(width, height, dat); - break; - } -} - -void BaseAnimationState::plotYUV1x(int width, int height, byte *const *dat) { - byte *lum = dat[0]; - byte *cr = dat[2]; - byte *cb = dat[1]; - - byte *lum2 = lum + width; - - int16 cr_r; - int16 crb_g; - int16 cb_b; - - OverlayColor *row1 = _overlay; - OverlayColor *row2 = row1 + _movieWidth; - - int x; - - for (; height > 0; height -= 2) { - OverlayColor *r1 = row1; - OverlayColor *r2 = row2; - - for (x = width; x > 0; x -= 2) { - register OverlayColor *L; - - cr_r = _colorTab[*cr + 0 * 256]; - crb_g = _colorTab[*cr + 1 * 256] + _colorTab[*cb + 2 * 256]; - cb_b = _colorTab[*cb + 3 * 256]; - ++cr; - ++cb; - - L = &_rgbToPix[*lum++]; - *r1++ = L[cr_r] | L[crb_g] | L[cb_b]; - - L = &_rgbToPix[*lum++]; - *r1++ = L[cr_r] | L[crb_g] | L[cb_b]; - - // Now, do second row. - - L = &_rgbToPix[*lum2++]; - *r2++ = L[cr_r] | L[crb_g] | L[cb_b]; - - L = &_rgbToPix[*lum2++]; - *r2++ = L[cr_r] | L[crb_g] | L[cb_b]; - } - - lum += width; - lum2 += width; - row1 += 2 * _movieWidth; - row2 += 2 * _movieWidth; - } -} - -void BaseAnimationState::plotYUV2x(int width, int height, byte *const *dat) { - byte *lum = dat[0]; - byte *cr = dat[2]; - byte *cb = dat[1]; - - byte *lum2 = lum + width; - - int16 cr_r; - int16 crb_g; - int16 cb_b; - - OverlayColor *row1 = _overlay; - OverlayColor *row2 = row1 + 2 * 2 * _movieWidth; - - int x; - - for (; height > 0; height -= 2) { - OverlayColor *r1 = row1; - OverlayColor *r2 = row2; - - for (x = width; x > 0; x -= 2) { - register OverlayColor *L; - register OverlayColor C; - - cr_r = _colorTab[*cr + 0 * 256]; - crb_g = _colorTab[*cr + 1 * 256] + _colorTab[*cb + 2 * 256]; - cb_b = _colorTab[*cb + 3 * 256]; - ++cr; - ++cb; - - L = &_rgbToPix[*lum++]; - C = L[cr_r] | L[crb_g] | L[cb_b]; - *r1++ = C; - *r1++ = C; - - L = &_rgbToPix[*lum++]; - C = L[cr_r] | L[crb_g] | L[cb_b]; - *r1++ = C; - *r1++ = C; - - // Now, do second row. - - L = &_rgbToPix[*lum2++]; - C = L[cr_r] | L[crb_g] | L[cb_b]; - *r2++ = C; - *r2++ = C; - - L = &_rgbToPix[*lum2++]; - C = L[cr_r] | L[crb_g] | L[cb_b]; - *r2++ = C; - *r2++ = C; - } - - memcpy(row1 + 2 * _movieWidth, row1, 2 * _movieWidth * sizeof(OverlayColor)); - memcpy(row2 + 2 * _movieWidth, row2, 2 * _movieWidth * sizeof(OverlayColor)); - - lum += width; - lum2 += width; - row1 += 4 * 2 * _movieWidth; - row2 += 4 * 2 * _movieWidth; - } -} - -void BaseAnimationState::plotYUV3x(int width, int height, byte *const *dat) { - byte *lum = dat[0]; - byte *cr = dat[2]; - byte *cb = dat[1]; - - byte *lum2 = lum + width; - - int16 cr_r; - int16 crb_g; - int16 cb_b; - - OverlayColor *row1 = _overlay; - OverlayColor *row2 = row1 + 3 * 3 * _movieWidth; - - int x; - - for (; height > 0; height -= 2) { - OverlayColor *r1 = row1; - OverlayColor *r2 = row2; - - for (x = width; x > 0; x -= 2) { - register OverlayColor *L; - register OverlayColor C; - - cr_r = _colorTab[*cr + 0 * 256]; - crb_g = _colorTab[*cr + 1 * 256] + _colorTab[*cb + 2 * 256]; - cb_b = _colorTab[*cb + 3 * 256]; - ++cr; - ++cb; - - L = &_rgbToPix[*lum++]; - C = L[cr_r] | L[crb_g] | L[cb_b]; - *r1++ = C; - *r1++ = C; - *r1++ = C; - - L = &_rgbToPix[*lum++]; - C = L[cr_r] | L[crb_g] | L[cb_b]; - *r1++ = C; - *r1++ = C; - *r1++ = C; - - // Now, do second row. - - L = &_rgbToPix[*lum2++]; - C = L[cr_r] | L[crb_g] | L[cb_b]; - *r2++ = C; - *r2++ = C; - *r2++ = C; - - L = &_rgbToPix[*lum2++]; - C = L[cr_r] | L[crb_g] | L[cb_b]; - *r2++ = C; - *r2++ = C; - *r2++ = C; - } - - memcpy(row1 + 3 * _movieWidth, row1, 3 * _movieWidth * sizeof(OverlayColor)); - memcpy(row1 + 2 * 3 * _movieWidth, row1, 3 * _movieWidth * sizeof(OverlayColor)); - memcpy(row2 + 3 * _movieWidth, row2, 3 * _movieWidth * sizeof(OverlayColor)); - memcpy(row2 + 2 * 3 * _movieWidth, row2, 3 * _movieWidth * sizeof(OverlayColor)); - - lum += width; - lum2 += width; - row1 += 6 * 3 * _movieWidth; - row2 += 6 * 3 * _movieWidth; - } -} - -#endif - -void BaseAnimationState::updateScreen() { -#ifndef BACKEND_8BIT - int width = _movieScale * _frameWidth; - int height = _movieScale * _frameHeight; - int pitch = _movieScale * _movieWidth; - - const int screenW = _sys->getOverlayWidth(); - const int screenH = _sys->getOverlayHeight(); - - int x = (screenW - _movieScale * _frameWidth) / 2; - int y = (screenH - _movieScale * _frameHeight) / 2; - - _sys->copyRectToOverlay(_overlay, pitch, x, y, width, height); -#endif - _sys->updateScreen(); -} - -} // End of namespace Video diff --git a/video/mpeg_player.h b/video/mpeg_player.h deleted file mode 100644 index dca0a98a2f..0000000000 --- a/video/mpeg_player.h +++ /dev/null @@ -1,169 +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. - * - */ - -#ifndef VIDEO_MPEG_PLAYER_H -#define VIDEO_MPEG_PLAYER_H - -#include "common/scummsys.h" -#include "graphics/pixelformat.h" - -// Uncomment this if you are using libmpeg2 0.3.1. -// #define USE_MPEG2_0_3_1 - -#ifdef USE_MPEG2 - -#if defined(__PLAYSTATION2__) - typedef uint8 uint8_t; - typedef uint16 uint16_t; - typedef uint32 uint32_t; -#elif defined(_WIN32_WCE) - typedef signed char int8_t; - typedef signed short int16_t; - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; -#elif defined(_MSC_VER) - typedef signed char int8_t; - typedef signed short int16_t; - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - #if !defined(SDL_COMPILEDVERSION) || (SDL_COMPILEDVERSION < 1210) - typedef signed long int32_t; - typedef unsigned long uint32_t; - #endif -#else -# include <inttypes.h> -#endif - -extern "C" { - #include <mpeg2dec/mpeg2.h> -} - -#ifdef USE_MPEG2_0_3_1 -typedef int mpeg2_state_t; -typedef sequence_t mpeg2_sequence_t; -#define STATE_BUFFER -1 -#endif - -#endif - -#ifdef BACKEND_8BIT -#define SQR(x) ((x) * (x)) -#define SHIFT 3 -#else -#define SHIFT 1 -#endif - -#define BITDEPTH (1 << (8 - SHIFT)) -#define ROUNDADD (1 << (SHIFT - 1)) - -#define BUFFER_SIZE 4096 - -namespace Common { -class File; -} - -class OSystem; - -namespace Video { - -class BaseAnimationState { -protected: - const int _movieWidth; - const int _movieHeight; - - int _frameWidth; - int _frameHeight; - -#ifndef BACKEND_8BIT - int _movieScale; -#endif - - OSystem *_sys; - - uint _frameNum; - -#ifdef USE_MPEG2 - mpeg2dec_t *_mpegDecoder; - const mpeg2_info_t *_mpegInfo; -#endif - - Common::File *_mpegFile; - -#ifdef BACKEND_8BIT - int _palNum; - int _maxPalNum; - - byte _yuvLookup[2][(BITDEPTH+1) * (BITDEPTH+1) * (BITDEPTH+1)]; - byte *_lut; - byte *_lut2; - int _lutCalcNum; - - int _curPal; - int _cr; - int _pos; - - struct { - uint cnt; - uint end; - byte pal[4 * 256]; - } _palettes[50]; -#else - OverlayColor *_overlay; - Graphics::PixelFormat _overlayFormat; - int16 *_colorTab; - OverlayColor *_rgbToPix; -#endif - -public: - BaseAnimationState(OSystem *sys, int width, int height); - virtual ~BaseAnimationState(); - - bool init(const char *name); - bool decodeFrame(); - void handleScreenChanged(); - void updateScreen(); - -#ifndef BACKEND_8BIT - void buildLookup(); -#endif - - int getFrameWidth() { return _frameWidth; } - int getFrameHeight() { return _frameHeight; } - -protected: - bool checkPaletteSwitch(); - virtual void drawYUV(int width, int height, byte *const *dat) = 0; - -#ifdef BACKEND_8BIT - void buildLookup(int p, int lines); - virtual void setPalette(byte *pal) = 0; -#else - void plotYUV(int width, int height, byte *const *dat); - void plotYUV1x(int width, int height, byte *const *dat); - void plotYUV2x(int width, int height, byte *const *dat); - void plotYUV3x(int width, int height, byte *const *dat); -#endif -}; - -} // End of namespace Video - -#endif diff --git a/video/qt_decoder.cpp b/video/qt_decoder.cpp index 2d29bcf97b..9575845cd3 100644 --- a/video/qt_decoder.cpp +++ b/video/qt_decoder.cpp @@ -21,7 +21,7 @@ */ // -// Heavily based on ffmpeg code. +// Partially based on ffmpeg code. // // Copyright (c) 2001 Fabrice Bellard. // First version by Francois Revol revol@free.fr @@ -30,32 +30,19 @@ #include "video/qt_decoder.h" +#include "audio/audiostream.h" + #include "common/debug.h" #include "common/endian.h" -#include "common/macresman.h" #include "common/memstream.h" -#include "common/util.h" -#include "common/zlib.h" -#include "common/stream.h" #include "common/system.h" #include "common/textconsole.h" -#include "common/types.h" - -#include "graphics/pixelformat.h" -#include "graphics/surface.h" - - -#include "audio/audiostream.h" - -// Audio codecs -#include "audio/decoders/adpcm.h" -#include "audio/decoders/raw.h" +#include "common/util.h" // Video codecs #include "video/codecs/codec.h" #include "video/codecs/cinepak.h" #include "video/codecs/mjpeg.h" -#include "video/codecs/qdm2.h" #include "video/codecs/qtrle.h" #include "video/codecs/rpza.h" #include "video/codecs/smc.h" @@ -69,73 +56,63 @@ namespace Video { //////////////////////////////////////////// QuickTimeDecoder::QuickTimeDecoder() { - _audStream = NULL; - _beginOffset = 0; _curFrame = -1; _startTime = _nextFrameStartTime = 0; _audHandle = Audio::SoundHandle(); - _numStreams = 0; - _fd = 0; _scaledSurface = 0; - _scaleFactorX = 1; - _scaleFactorY = 1; _dirtyPalette = false; - _resFork = new Common::MacResManager(); _palette = 0; - - initParseTable(); } QuickTimeDecoder::~QuickTimeDecoder() { close(); - delete _resFork; } uint16 QuickTimeDecoder::getWidth() const { - if (_videoStreamIndex < 0) + if (_videoTrackIndex < 0) return 0; - return (Common::Rational(_streams[_videoStreamIndex]->width) / getScaleFactorX()).toInt(); + return (Common::Rational(_tracks[_videoTrackIndex]->width) / getScaleFactorX()).toInt(); } uint16 QuickTimeDecoder::getHeight() const { - if (_videoStreamIndex < 0) + if (_videoTrackIndex < 0) return 0; - return (Common::Rational(_streams[_videoStreamIndex]->height) / getScaleFactorY()).toInt(); + return (Common::Rational(_tracks[_videoTrackIndex]->height) / getScaleFactorY()).toInt(); } uint32 QuickTimeDecoder::getFrameCount() const { - if (_videoStreamIndex < 0) + if (_videoTrackIndex < 0) return 0; - return _streams[_videoStreamIndex]->nb_frames; + return _tracks[_videoTrackIndex]->frameCount; } Common::Rational QuickTimeDecoder::getScaleFactorX() const { - if (_videoStreamIndex < 0) + if (_videoTrackIndex < 0) return 1; - return (_scaleFactorX * _streams[_videoStreamIndex]->scaleFactorX); + return (_scaleFactorX * _tracks[_videoTrackIndex]->scaleFactorX); } Common::Rational QuickTimeDecoder::getScaleFactorY() const { - if (_videoStreamIndex < 0) + if (_videoTrackIndex < 0) return 1; - return (_scaleFactorY * _streams[_videoStreamIndex]->scaleFactorY); + return (_scaleFactorY * _tracks[_videoTrackIndex]->scaleFactorY); } uint32 QuickTimeDecoder::getFrameDuration() { - if (_videoStreamIndex < 0) + if (_videoTrackIndex < 0) return 0; uint32 curFrameIndex = 0; - for (int32 i = 0; i < _streams[_videoStreamIndex]->stts_count; i++) { - curFrameIndex += _streams[_videoStreamIndex]->stts_data[i].count; + for (int32 i = 0; i < _tracks[_videoTrackIndex]->timeToSampleCount; i++) { + curFrameIndex += _tracks[_videoTrackIndex]->timeToSample[i].count; if ((uint32)_curFrame < curFrameIndex) { // Ok, now we have what duration this frame has. - return _streams[_videoStreamIndex]->stts_data[i].duration; + return _tracks[_videoTrackIndex]->timeToSample[i].duration; } } @@ -154,17 +131,17 @@ Graphics::PixelFormat QuickTimeDecoder::getPixelFormat() const { } uint32 QuickTimeDecoder::findKeyFrame(uint32 frame) const { - for (int i = _streams[_videoStreamIndex]->keyframe_count - 1; i >= 0; i--) - if (_streams[_videoStreamIndex]->keyframes[i] <= frame) - return _streams[_videoStreamIndex]->keyframes[i]; + for (int i = _tracks[_videoTrackIndex]->keyframeCount - 1; i >= 0; i--) + if (_tracks[_videoTrackIndex]->keyframes[i] <= frame) + return _tracks[_videoTrackIndex]->keyframes[i]; // If none found, we'll assume the requested frame is a key frame return frame; } void QuickTimeDecoder::seekToFrame(uint32 frame) { - assert(_videoStreamIndex >= 0); - assert(frame < _streams[_videoStreamIndex]->nb_frames); + assert(_videoTrackIndex >= 0); + assert(frame < _tracks[_videoTrackIndex]->frameCount); // Stop all audio (for now) stopAudio(); @@ -178,92 +155,43 @@ void QuickTimeDecoder::seekToFrame(uint32 frame) { _nextFrameStartTime = 0; uint32 curFrame = 0; - for (int32 i = 0; i < _streams[_videoStreamIndex]->stts_count && curFrame < frame; i++) { - for (int32 j = 0; j < _streams[_videoStreamIndex]->stts_data[i].count && curFrame < frame; j++) { + for (int32 i = 0; i < _tracks[_videoTrackIndex]->timeToSampleCount && curFrame < frame; i++) { + for (int32 j = 0; j < _tracks[_videoTrackIndex]->timeToSample[i].count && curFrame < frame; j++) { curFrame++; - _nextFrameStartTime += _streams[_videoStreamIndex]->stts_data[i].duration; + _nextFrameStartTime += _tracks[_videoTrackIndex]->timeToSample[i].duration; } } // Adjust the video starting point - const Audio::Timestamp curVideoTime(0, _nextFrameStartTime, _streams[_videoStreamIndex]->time_scale); + const Audio::Timestamp curVideoTime(0, _nextFrameStartTime, _tracks[_videoTrackIndex]->timeScale); _startTime = g_system->getMillis() - curVideoTime.msecs(); resetPauseStartTime(); // Adjust the audio starting point - if (_audioStreamIndex >= 0) { + if (_audioTrackIndex >= 0) { _audioStartOffset = curVideoTime; - // Re-create the audio stream - STSDEntry *entry = &_streams[_audioStreamIndex]->stsdEntries[0]; - _audStream = Audio::makeQueuingAudioStream(entry->sampleRate, entry->channels == 2); - - // First, we need to track down what audio sample we need - Audio::Timestamp curAudioTime(0, _streams[_audioStreamIndex]->time_scale); - uint sample = 0; - bool done = false; - for (int32 i = 0; i < _streams[_audioStreamIndex]->stts_count && !done; i++) { - for (int32 j = 0; j < _streams[_audioStreamIndex]->stts_data[i].count; j++) { - curAudioTime = curAudioTime.addFrames(_streams[_audioStreamIndex]->stts_data[i].duration); - - if (curAudioTime > curVideoTime) { - done = true; - break; - } - - sample++; - } - } - - // Now to track down what chunk it's in - _curAudioChunk = 0; - uint32 totalSamples = 0; - for (uint32 i = 0; i < _streams[_audioStreamIndex]->chunk_count; i++, _curAudioChunk++) { - int sampleToChunkIndex = -1; + // Seek to the new audio location + setAudioStreamPos(_audioStartOffset); - for (uint32 j = 0; j < _streams[_audioStreamIndex]->sample_to_chunk_sz; j++) - if (i >= _streams[_audioStreamIndex]->sample_to_chunk[j].first) - sampleToChunkIndex = j; - - assert(sampleToChunkIndex >= 0); - - totalSamples += _streams[_audioStreamIndex]->sample_to_chunk[sampleToChunkIndex].count; - - if (sample < totalSamples) { - totalSamples -= _streams[_audioStreamIndex]->sample_to_chunk[sampleToChunkIndex].count; - break; - } - } - - // Reposition the audio stream - readNextAudioChunk(); - if (sample != totalSamples) { - // HACK: Skip a certain amount of samples from the stream - // (There's got to be a better way to do this!) - int16 *tempBuffer = new int16[sample - totalSamples]; - _audStream->readBuffer(tempBuffer, sample - totalSamples); - delete[] tempBuffer; - debug(3, "Skipping %d audio samples", sample - totalSamples); - } - // Restart the audio startAudio(); } } void QuickTimeDecoder::seekToTime(Audio::Timestamp time) { - // TODO: Audio-only seeking (or really, have QuickTime sounds) - if (_videoStreamIndex < 0) + // Use makeQuickTimeStream() instead + if (_videoTrackIndex < 0) error("Audio-only seeking not supported"); // Try to find the last frame that should have been decoded uint32 frame = 0; - Audio::Timestamp totalDuration(0, _streams[_videoStreamIndex]->time_scale); + Audio::Timestamp totalDuration(0, _tracks[_videoTrackIndex]->timeScale); bool done = false; - for (int32 i = 0; i < _streams[_videoStreamIndex]->stts_count && !done; i++) { - for (int32 j = 0; j < _streams[_videoStreamIndex]->stts_data[i].count; j++) { - totalDuration = totalDuration.addFrames(_streams[_videoStreamIndex]->stts_data[i].duration); + for (int32 i = 0; i < _tracks[_videoTrackIndex]->timeToSampleCount && !done; i++) { + for (int32 j = 0; j < _tracks[_videoTrackIndex]->timeToSample[i].count; j++) { + totalDuration = totalDuration.addFrames(_tracks[_videoTrackIndex]->timeToSample[i].duration); if (totalDuration > time) { done = true; break; @@ -275,50 +203,16 @@ void QuickTimeDecoder::seekToTime(Audio::Timestamp time) { seekToFrame(frame); } -Codec *QuickTimeDecoder::createCodec(uint32 codecTag, byte bitsPerPixel) { - if (codecTag == MKTAG('c','v','i','d')) { - // Cinepak: As used by most Myst and all Riven videos as well as some Myst ME videos. "The Chief" videos also use this. - return new CinepakDecoder(bitsPerPixel); - } else if (codecTag == MKTAG('r','p','z','a')) { - // Apple Video ("Road Pizza"): Used by some Myst videos. - return new RPZADecoder(getWidth(), getHeight()); - } else if (codecTag == MKTAG('r','l','e',' ')) { - // QuickTime RLE: Used by some Myst ME videos. - return new QTRLEDecoder(getWidth(), getHeight(), bitsPerPixel); - } else if (codecTag == MKTAG('s','m','c',' ')) { - // Apple SMC: Used by some Myst videos. - return new SMCDecoder(getWidth(), getHeight()); - } else if (codecTag == MKTAG('S','V','Q','1')) { - // Sorenson Video 1: Used by some Myst ME videos. - warning("Sorenson Video 1 not yet supported"); - } else if (codecTag == MKTAG('S','V','Q','3')) { - // Sorenson Video 3: Used by some Myst ME videos. - warning("Sorenson Video 3 not yet supported"); - } else if (codecTag == MKTAG('j','p','e','g')) { - // Motion JPEG: Used by some Myst ME 10th Anniversary videos. - return new JPEGDecoder(); - } else if (codecTag == MKTAG('Q','k','B','k')) { - // CDToons: Used by most of the Broderbund games. - return new CDToonsDecoder(getWidth(), getHeight()); - } else { - warning("Unsupported codec \'%s\'", tag2str(codecTag)); - } - - return NULL; -} - void QuickTimeDecoder::startAudio() { - if (_audStream) { // No audio/audio not supported + if (_audStream) { updateAudioBuffer(); - g_system->getMixer()->playStream(Audio::Mixer::kPlainSoundType, &_audHandle, _audStream); - } + g_system->getMixer()->playStream(Audio::Mixer::kPlainSoundType, &_audHandle, _audStream, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO); + } // else no audio or the audio compression is not supported } void QuickTimeDecoder::stopAudio() { - if (_audStream) { + if (_audStream) g_system->getMixer()->stopHandle(_audHandle); - _audStream = NULL; // the mixer automatically frees the stream - } } void QuickTimeDecoder::pauseVideoIntern(bool pause) { @@ -327,14 +221,14 @@ void QuickTimeDecoder::pauseVideoIntern(bool pause) { } Codec *QuickTimeDecoder::findDefaultVideoCodec() const { - if (_videoStreamIndex < 0 || !_streams[_videoStreamIndex]->stsdEntryCount) + if (_videoTrackIndex < 0 || _tracks[_videoTrackIndex]->sampleDescs.empty()) return 0; - return _streams[_videoStreamIndex]->stsdEntries[0].videoCodec; + return ((VideoSampleDesc *)_tracks[_videoTrackIndex]->sampleDescs[0])->_videoCodec; } const Graphics::Surface *QuickTimeDecoder::decodeNextFrame() { - if (_videoStreamIndex < 0 || _curFrame >= (int32)getFrameCount() - 1) + if (_videoTrackIndex < 0 || _curFrame >= (int32)getFrameCount() - 1) return 0; if (_startTime == 0) @@ -350,28 +244,28 @@ const Graphics::Surface *QuickTimeDecoder::decodeNextFrame() { uint32 descId; Common::SeekableReadStream *frameData = getNextFramePacket(descId); - if (!frameData || !descId || descId > _streams[_videoStreamIndex]->stsdEntryCount) + if (!frameData || !descId || descId > _tracks[_videoTrackIndex]->sampleDescs.size()) return 0; // Find which video description entry we want - STSDEntry *entry = &_streams[_videoStreamIndex]->stsdEntries[descId - 1]; + VideoSampleDesc *entry = (VideoSampleDesc *)_tracks[_videoTrackIndex]->sampleDescs[descId - 1]; - if (!entry->videoCodec) + if (!entry->_videoCodec) return 0; - const Graphics::Surface *frame = entry->videoCodec->decodeImage(frameData); + const Graphics::Surface *frame = entry->_videoCodec->decodeImage(frameData); delete frameData; // Update the palette - if (entry->videoCodec->containsPalette()) { + if (entry->_videoCodec->containsPalette()) { // The codec itself contains a palette - if (entry->videoCodec->hasDirtyPalette()) { - _palette = entry->videoCodec->getPalette(); + if (entry->_videoCodec->hasDirtyPalette()) { + _palette = entry->_videoCodec->getPalette(); _dirtyPalette = true; } } else { // Check if the video description has been updated - byte *palette = entry->palette; + byte *palette = entry->_palette; if (palette != _palette) { _palette = palette; @@ -411,7 +305,7 @@ uint32 QuickTimeDecoder::getTimeToNextFrame() const { return 0; // Convert from the QuickTime rate base to 1000 - uint32 nextFrameStartTime = _nextFrameStartTime * 1000 / _streams[_videoStreamIndex]->time_scale; + uint32 nextFrameStartTime = _nextFrameStartTime * 1000 / _tracks[_videoTrackIndex]->timeScale; uint32 elapsedTime = getElapsedTime(); if (nextFrameStartTime <= elapsedTime) @@ -421,38 +315,7 @@ uint32 QuickTimeDecoder::getTimeToNextFrame() const { } bool QuickTimeDecoder::loadFile(const Common::String &filename) { - if (!_resFork->open(filename) || !_resFork->hasDataFork()) - return false; - - _foundMOOV = false; - _numStreams = 0; - _videoStreamIndex = _audioStreamIndex = -1; - _startTime = 0; - - MOVatom atom = { 0, 0, 0xffffffff }; - - if (_resFork->hasResFork()) { - // Search for a 'moov' resource - Common::MacResIDArray idArray = _resFork->getResIDArray(MKTAG('m','o','o','v')); - - if (!idArray.empty()) - _fd = _resFork->getResource(MKTAG('m','o','o','v'), idArray[0]); - - if (_fd) { - atom.size = _fd->size(); - if (readDefault(atom) < 0 || !_foundMOOV) - return false; - } - delete _fd; - - atom.type = 0; - atom.offset = 0; - atom.size = 0xffffffff; - } - - _fd = _resFork->getDataFork(); - - if (readDefault(atom) < 0 || !_foundMOOV) + if (!Common::QuickTimeParser::parseFile(filename)) return false; init(); @@ -460,77 +323,34 @@ bool QuickTimeDecoder::loadFile(const Common::String &filename) { } bool QuickTimeDecoder::loadStream(Common::SeekableReadStream *stream) { - _fd = stream; - _foundMOOV = false; - _numStreams = 0; - _videoStreamIndex = _audioStreamIndex = -1; - _startTime = 0; - - MOVatom atom = { 0, 0, 0xffffffff }; - - if (readDefault(atom) < 0 || !_foundMOOV) { - _fd = 0; + if (!Common::QuickTimeParser::parseStream(stream)) return false; - } init(); return true; } void QuickTimeDecoder::init() { - // Remove non-Video/Audio streams - for (uint32 i = 0; i < _numStreams;) { - if (_streams[i]->codec_type == CODEC_TYPE_MOV_OTHER) { - delete _streams[i]; - for (uint32 j = i + 1; j < _numStreams; j++) - _streams[j - 1] = _streams[j]; - _numStreams--; - } else - i++; - } + Audio::QuickTimeAudioDecoder::init(); - // Adjust time/duration - for (uint32 i = 0; i < _numStreams; i++) { - MOVStreamContext *sc = _streams[i]; - - if (!sc->time_rate) - sc->time_rate = 1; - - if (!sc->time_scale) - sc->time_scale = _timeScale; - - sc->duration /= sc->time_rate; - - if (sc->codec_type == CODEC_TYPE_VIDEO && _videoStreamIndex < 0) - _videoStreamIndex = i; - else if (sc->codec_type == CODEC_TYPE_AUDIO && _audioStreamIndex < 0) - _audioStreamIndex = i; - } - - // Initialize audio, if present - if (_audioStreamIndex >= 0) { - STSDEntry *entry = &_streams[_audioStreamIndex]->stsdEntries[0]; - - if (checkAudioCodecSupport(entry->codecTag)) { - _audStream = Audio::makeQueuingAudioStream(entry->sampleRate, entry->channels == 2); - _curAudioChunk = 0; - - // Make sure the bits per sample transfers to the sample size - if (entry->codecTag == MKTAG('r','a','w',' ') || entry->codecTag == MKTAG('t','w','o','s')) - _streams[_audioStreamIndex]->sample_size = (entry->bitsPerSample / 8) * entry->channels; + _videoTrackIndex = -1; + _startTime = 0; - startAudio(); - } + // Find video streams + for (uint32 i = 0; i < _tracks.size(); i++) + if (_tracks[i]->codecType == CODEC_TYPE_VIDEO && _videoTrackIndex < 0) + _videoTrackIndex = i; + // Start the audio codec if we've got one that we can handle + if (_audStream) { + startAudio(); _audioStartOffset = Audio::Timestamp(0); } // Initialize video, if present - if (_videoStreamIndex >= 0) { - for (uint32 i = 0; i < _streams[_videoStreamIndex]->stsdEntryCount; i++) { - STSDEntry *entry = &_streams[_videoStreamIndex]->stsdEntries[i]; - entry->videoCodec = createCodec(entry->codecTag, entry->bitsPerSample & 0x1F); - } + if (_videoTrackIndex >= 0) { + for (uint32 i = 0; i < _tracks[_videoTrackIndex]->sampleDescs.size(); i++) + ((VideoSampleDesc *)_tracks[_videoTrackIndex]->sampleDescs[i])->initCodec(); if (getScaleFactorX() != 1 || getScaleFactorY() != 1) { // We have to initialize the scaled surface @@ -540,739 +360,119 @@ void QuickTimeDecoder::init() { } } -void QuickTimeDecoder::initParseTable() { - static const ParseTable p[] = { - { &QuickTimeDecoder::readDefault, MKTAG('d','i','n','f') }, - { &QuickTimeDecoder::readLeaf, MKTAG('d','r','e','f') }, - { &QuickTimeDecoder::readDefault, MKTAG('e','d','t','s') }, - { &QuickTimeDecoder::readELST, MKTAG('e','l','s','t') }, - { &QuickTimeDecoder::readHDLR, MKTAG('h','d','l','r') }, - { &QuickTimeDecoder::readDefault, MKTAG('m','d','a','t') }, - { &QuickTimeDecoder::readMDHD, MKTAG('m','d','h','d') }, - { &QuickTimeDecoder::readDefault, MKTAG('m','d','i','a') }, - { &QuickTimeDecoder::readDefault, MKTAG('m','i','n','f') }, - { &QuickTimeDecoder::readMOOV, MKTAG('m','o','o','v') }, - { &QuickTimeDecoder::readMVHD, MKTAG('m','v','h','d') }, - { &QuickTimeDecoder::readLeaf, MKTAG('s','m','h','d') }, - { &QuickTimeDecoder::readDefault, MKTAG('s','t','b','l') }, - { &QuickTimeDecoder::readSTCO, MKTAG('s','t','c','o') }, - { &QuickTimeDecoder::readSTSC, MKTAG('s','t','s','c') }, - { &QuickTimeDecoder::readSTSD, MKTAG('s','t','s','d') }, - { &QuickTimeDecoder::readSTSS, MKTAG('s','t','s','s') }, - { &QuickTimeDecoder::readSTSZ, MKTAG('s','t','s','z') }, - { &QuickTimeDecoder::readSTTS, MKTAG('s','t','t','s') }, - { &QuickTimeDecoder::readTKHD, MKTAG('t','k','h','d') }, - { &QuickTimeDecoder::readTRAK, MKTAG('t','r','a','k') }, - { &QuickTimeDecoder::readLeaf, MKTAG('u','d','t','a') }, - { &QuickTimeDecoder::readLeaf, MKTAG('v','m','h','d') }, - { &QuickTimeDecoder::readCMOV, MKTAG('c','m','o','v') }, - { &QuickTimeDecoder::readWAVE, MKTAG('w','a','v','e') }, - { 0, 0 } - }; - - _parseTable = p; -} +Common::QuickTimeParser::SampleDesc *QuickTimeDecoder::readSampleDesc(Track *track, uint32 format) { + if (track->codecType == CODEC_TYPE_VIDEO) { + debug(0, "Video Codec FourCC: \'%s\'", tag2str(format)); -int QuickTimeDecoder::readDefault(MOVatom atom) { - uint32 total_size = 0; - MOVatom a; - int err = 0; + VideoSampleDesc *entry = new VideoSampleDesc(track, format); - a.offset = atom.offset; + _fd->readUint16BE(); // version + _fd->readUint16BE(); // revision level + _fd->readUint32BE(); // vendor + _fd->readUint32BE(); // temporal quality + _fd->readUint32BE(); // spacial quality - while(((total_size + 8) < atom.size) && !_fd->eos() && _fd->pos() < _fd->size() && !err) { - a.size = atom.size; - a.type = 0; + uint16 width = _fd->readUint16BE(); // width + uint16 height = _fd->readUint16BE(); // height - if (atom.size >= 8) { - a.size = _fd->readUint32BE(); - a.type = _fd->readUint32BE(); + // The width is most likely invalid for entries after the first one + // so only set the overall width if it is not zero here. + if (width) + track->width = width; - // Some QuickTime videos with resource forks have mdat chunks - // that are of size 0. Adjust it so it's the correct size. - if (a.type == MKTAG('m','d','a','t') && a.size == 0) - a.size = _fd->size(); - } + if (height) + track->height = height; - total_size += 8; - a.offset += 8; - debug(4, "type: %08x %.4s sz: %x %x %x", a.type, tag2str(a.type), a.size, atom.size, total_size); + _fd->readUint32BE(); // horiz resolution + _fd->readUint32BE(); // vert resolution + _fd->readUint32BE(); // data size, always 0 + _fd->readUint16BE(); // frames per samples - if (a.size == 1) { // 64 bit extended size - warning("64 bit extended size is not supported in QuickTime"); - return -1; + byte codecName[32]; + _fd->read(codecName, 32); // codec name, pascal string (FIXME: true for mp4?) + if (codecName[0] <= 31) { + memcpy(entry->_codecName, &codecName[1], codecName[0]); + entry->_codecName[codecName[0]] = 0; } - if (a.size == 0) { - a.size = atom.size - total_size; - if (a.size <= 8) - break; - } - - uint32 i = 0; - - for (; _parseTable[i].type != 0 && _parseTable[i].type != a.type; i++) - // empty; - - if (a.size < 8) - break; - - a.size -= 8; - - if (_parseTable[i].type == 0) { // skip leaf atoms data - debug(0, ">>> Skipped [%s]", tag2str(a.type)); - - _fd->seek(a.size, SEEK_CUR); - } else { - uint32 start_pos = _fd->pos(); - err = (this->*_parseTable[i].func)(a); - - uint32 left = a.size - _fd->pos() + start_pos; - - if (left > 0) // skip garbage at atom end - _fd->seek(left, SEEK_CUR); - } - - a.offset += a.size; - total_size += a.size; - } - - if (!err && total_size < atom.size) - _fd->seek(atom.size - total_size, SEEK_SET); - - return err; -} - -int QuickTimeDecoder::readLeaf(MOVatom atom) { - if (atom.size > 1) - _fd->seek(atom.size, SEEK_SET); - - return 0; -} - -int QuickTimeDecoder::readMOOV(MOVatom atom) { - if (readDefault(atom) < 0) - return -1; - - // We parsed the 'moov' atom, so we don't need anything else - _foundMOOV = true; - return 1; -} - -int QuickTimeDecoder::readCMOV(MOVatom atom) { -#ifdef USE_ZLIB - // Read in the dcom atom - _fd->readUint32BE(); - if (_fd->readUint32BE() != MKTAG('d','c','o','m')) - return -1; - if (_fd->readUint32BE() != MKTAG('z','l','i','b')) { - warning("Unknown cmov compression type"); - return -1; - } - - // Read in the cmvd atom - uint32 compressedSize = _fd->readUint32BE() - 12; - if (_fd->readUint32BE() != MKTAG('c','m','v','d')) - return -1; - uint32 uncompressedSize = _fd->readUint32BE(); - - // Read in data - byte *compressedData = (byte *)malloc(compressedSize); - _fd->read(compressedData, compressedSize); - - // Create uncompressed stream - byte *uncompressedData = (byte *)malloc(uncompressedSize); - - // Uncompress the data - unsigned long dstLen = uncompressedSize; - if (!Common::uncompress(uncompressedData, &dstLen, compressedData, compressedSize)) { - warning ("Could not uncompress cmov chunk"); - free(compressedData); - free(uncompressedData); - return -1; - } - - // Load data into a new MemoryReadStream and assign _fd to be that - Common::SeekableReadStream *oldStream = _fd; - _fd = new Common::MemoryReadStream(uncompressedData, uncompressedSize, DisposeAfterUse::YES); - - // Read the contents of the uncompressed data - MOVatom a = { MKTAG('m','o','o','v'), 0, uncompressedSize }; - int err = readDefault(a); - - // Assign the file handle back to the original handle - free(compressedData); - delete _fd; - _fd = oldStream; - - return err; -#else - warning ("zlib not found, cannot read QuickTime cmov atom"); - return -1; -#endif -} - -int QuickTimeDecoder::readMVHD(MOVatom atom) { - byte version = _fd->readByte(); // version - _fd->readByte(); _fd->readByte(); _fd->readByte(); // flags - - if (version == 1) { - warning("QuickTime version 1"); - _fd->readUint32BE(); _fd->readUint32BE(); - _fd->readUint32BE(); _fd->readUint32BE(); - } else { - _fd->readUint32BE(); // creation time - _fd->readUint32BE(); // modification time - } - - _timeScale = _fd->readUint32BE(); // time scale - debug(0, "time scale = %i\n", _timeScale); - - // duration - _duration = (version == 1) ? (_fd->readUint32BE(), _fd->readUint32BE()) : _fd->readUint32BE(); - _fd->readUint32BE(); // preferred scale - - _fd->readUint16BE(); // preferred volume - - _fd->seek(10, SEEK_CUR); // reserved - - // We only need two values from the movie display matrix. Most of the values are just - // skipped. xMod and yMod are 16:16 fixed point numbers, the last part of the 3x3 matrix - // is 2:30. - uint32 xMod = _fd->readUint32BE(); - _fd->skip(12); - uint32 yMod = _fd->readUint32BE(); - _fd->skip(16); - - _scaleFactorX = Common::Rational(0x10000, xMod); - _scaleFactorY = Common::Rational(0x10000, yMod); - - _scaleFactorX.debugPrint(1, "readMVHD(): scaleFactorX ="); - _scaleFactorY.debugPrint(1, "readMVHD(): scaleFactorY ="); - - _fd->readUint32BE(); // preview time - _fd->readUint32BE(); // preview duration - _fd->readUint32BE(); // poster time - _fd->readUint32BE(); // selection time - _fd->readUint32BE(); // selection duration - _fd->readUint32BE(); // current time - _fd->readUint32BE(); // next track ID - - return 0; -} - -int QuickTimeDecoder::readTRAK(MOVatom atom) { - MOVStreamContext *sc = new MOVStreamContext(); - - if (!sc) - return -1; - - sc->codec_type = CODEC_TYPE_MOV_OTHER; - sc->start_time = 0; // XXX: check - _streams[_numStreams++] = sc; - - return readDefault(atom); -} - -int QuickTimeDecoder::readTKHD(MOVatom atom) { - MOVStreamContext *st = _streams[_numStreams - 1]; - byte version = _fd->readByte(); - - _fd->readByte(); _fd->readByte(); - _fd->readByte(); // flags - // - //MOV_TRACK_ENABLED 0x0001 - //MOV_TRACK_IN_MOVIE 0x0002 - //MOV_TRACK_IN_PREVIEW 0x0004 - //MOV_TRACK_IN_POSTER 0x0008 - // - - if (version == 1) { - _fd->readUint32BE(); _fd->readUint32BE(); - _fd->readUint32BE(); _fd->readUint32BE(); - } else { - _fd->readUint32BE(); // creation time - _fd->readUint32BE(); // modification time - } - - /* st->id = */_fd->readUint32BE(); // track id (NOT 0 !) - _fd->readUint32BE(); // reserved - //st->start_time = 0; // check - (version == 1) ? (_fd->readUint32BE(), _fd->readUint32BE()) : _fd->readUint32BE(); // highlevel (considering edits) duration in movie timebase - _fd->readUint32BE(); // reserved - _fd->readUint32BE(); // reserved - - _fd->readUint16BE(); // layer - _fd->readUint16BE(); // alternate group - _fd->readUint16BE(); // volume - _fd->readUint16BE(); // reserved - - // We only need the two values from the displacement matrix for a track. - // See readMVHD() for more information. - uint32 xMod = _fd->readUint32BE(); - _fd->skip(12); - uint32 yMod = _fd->readUint32BE(); - _fd->skip(16); - - st->scaleFactorX = Common::Rational(0x10000, xMod); - st->scaleFactorY = Common::Rational(0x10000, yMod); - - st->scaleFactorX.debugPrint(1, "readTKHD(): scaleFactorX ="); - st->scaleFactorY.debugPrint(1, "readTKHD(): scaleFactorY ="); - - // these are fixed-point, 16:16 - // uint32 tkWidth = _fd->readUint32BE() >> 16; // track width - // uint32 tkHeight = _fd->readUint32BE() >> 16; // track height - - return 0; -} - -// edit list atom -int QuickTimeDecoder::readELST(MOVatom atom) { - MOVStreamContext *st = _streams[_numStreams - 1]; - - _fd->readByte(); // version - _fd->readByte(); _fd->readByte(); _fd->readByte(); // flags - - st->editCount = _fd->readUint32BE(); - st->editList = new EditListEntry[st->editCount]; - - debug(2, "Track %d edit list count: %d", _numStreams - 1, st->editCount); - - for (uint32 i = 0; i < st->editCount; i++){ - st->editList[i].trackDuration = _fd->readUint32BE(); - st->editList[i].mediaTime = _fd->readSint32BE(); - st->editList[i].mediaRate = Common::Rational(_fd->readUint32BE(), 0x10000); - debugN(3, "\tDuration = %d, Media Time = %d, ", st->editList[i].trackDuration, st->editList[i].mediaTime); - st->editList[i].mediaRate.debugPrint(3, "Media Rate ="); - } - - if (st->editCount != 1) - warning("Multiple edit list entries. Things may go awry"); - - return 0; -} - -int QuickTimeDecoder::readHDLR(MOVatom atom) { - MOVStreamContext *st = _streams[_numStreams - 1]; - - _fd->readByte(); // version - _fd->readByte(); _fd->readByte(); _fd->readByte(); // flags - - // component type - uint32 ctype = _fd->readUint32LE(); - uint32 type = _fd->readUint32BE(); // component subtype - - debug(0, "ctype= %s (0x%08lx)", tag2str(ctype), (long)ctype); - debug(0, "stype= %s", tag2str(type)); - - if(ctype == MKTAG('m','h','l','r')) // MOV - debug(0, "MOV detected"); - else if(ctype == 0) { - warning("MP4 streams are not supported"); - return -1; - } - - if (type == MKTAG('v','i','d','e')) - st->codec_type = CODEC_TYPE_VIDEO; - else if (type == MKTAG('s','o','u','n')) - st->codec_type = CODEC_TYPE_AUDIO; - - _fd->readUint32BE(); // component manufacture - _fd->readUint32BE(); // component flags - _fd->readUint32BE(); // component flags mask - - if (atom.size <= 24) - return 0; // nothing left to read - - // .mov: PASCAL string - byte len = _fd->readByte(); - _fd->seek(len, SEEK_CUR); - - _fd->seek(atom.size - (_fd->pos() - atom.offset), SEEK_CUR); - - return 0; -} - -int QuickTimeDecoder::readMDHD(MOVatom atom) { - MOVStreamContext *st = _streams[_numStreams - 1]; - byte version = _fd->readByte(); - - if (version > 1) - return 1; // unsupported - - _fd->readByte(); _fd->readByte(); - _fd->readByte(); // flags - - if (version == 1) { - _fd->readUint32BE(); _fd->readUint32BE(); - _fd->readUint32BE(); _fd->readUint32BE(); - } else { - _fd->readUint32BE(); // creation time - _fd->readUint32BE(); // modification time - } - - st->time_scale = _fd->readUint32BE(); - st->duration = (version == 1) ? (_fd->readUint32BE(), _fd->readUint32BE()) : _fd->readUint32BE(); // duration - - _fd->readUint16BE(); // language - _fd->readUint16BE(); // quality - - return 0; -} - -int QuickTimeDecoder::readSTSD(MOVatom atom) { - MOVStreamContext *st = _streams[_numStreams - 1]; - - _fd->readByte(); // version - _fd->readByte(); _fd->readByte(); _fd->readByte(); // flags - - st->stsdEntryCount = _fd->readUint32BE(); - st->stsdEntries = new STSDEntry[st->stsdEntryCount]; - - for (uint32 i = 0; i < st->stsdEntryCount; i++) { // Parsing Sample description table - STSDEntry *entry = &st->stsdEntries[i]; - - MOVatom a = { 0, 0, 0 }; - uint32 start_pos = _fd->pos(); - int size = _fd->readUint32BE(); // size - uint32 format = _fd->readUint32BE(); // data format - - _fd->readUint32BE(); // reserved - _fd->readUint16BE(); // reserved - _fd->readUint16BE(); // index - - debug(0, "size=%d 4CC= %s codec_type=%d", size, tag2str(format), st->codec_type); - - entry->codecTag = format; - - if (st->codec_type == CODEC_TYPE_VIDEO) { - debug(0, "Video Codec FourCC: \'%s\'", tag2str(format)); - - _fd->readUint16BE(); // version - _fd->readUint16BE(); // revision level - _fd->readUint32BE(); // vendor - _fd->readUint32BE(); // temporal quality - _fd->readUint32BE(); // spacial quality - - uint16 width = _fd->readUint16BE(); // width - uint16 height = _fd->readUint16BE(); // height - - // The width is most likely invalid for entries after the first one - // so only set the overall width if it is not zero here. - if (width) - st->width = width; - - if (height) - st->height = height; - - _fd->readUint32BE(); // horiz resolution - _fd->readUint32BE(); // vert resolution - _fd->readUint32BE(); // data size, always 0 - _fd->readUint16BE(); // frames per samples - - byte codec_name[32]; - _fd->read(codec_name, 32); // codec name, pascal string (FIXME: true for mp4?) - if (codec_name[0] <= 31) { - memcpy(entry->codecName, &codec_name[1], codec_name[0]); - entry->codecName[codec_name[0]] = 0; - } - - entry->bitsPerSample = _fd->readUint16BE(); // depth - entry->colorTableId = _fd->readUint16BE(); // colortable id - - // figure out the palette situation - byte colorDepth = entry->bitsPerSample & 0x1F; - bool colorGreyscale = (entry->bitsPerSample & 0x20) != 0; - - debug(0, "color depth: %d", colorDepth); - - // if the depth is 2, 4, or 8 bpp, file is palettized - if (colorDepth == 2 || colorDepth == 4 || colorDepth == 8) { - // Initialize the palette - entry->palette = new byte[256 * 3]; - memset(entry->palette, 0, 256 * 3); - - if (colorGreyscale) { - debug(0, "Greyscale palette"); - - // compute the greyscale palette - uint16 colorCount = 1 << colorDepth; - int16 colorIndex = 255; - byte colorDec = 256 / (colorCount - 1); - for (byte j = 0; j < colorCount; j++) { - entry->palette[j * 3] = entry->palette[j * 3 + 1] = entry->palette[j * 3 + 2] = colorIndex; - colorIndex -= colorDec; - if (colorIndex < 0) - colorIndex = 0; - } - } else if (entry->colorTableId & 0x08) { - // if flag bit 3 is set, use the default palette - //uint16 colorCount = 1 << colorDepth; - - warning("Predefined palette! %dbpp", colorDepth); - } else { - debug(0, "Palette from file"); - - // load the palette from the file - uint32 colorStart = _fd->readUint32BE(); - /* uint16 colorCount = */ _fd->readUint16BE(); - uint16 colorEnd = _fd->readUint16BE(); - for (uint32 j = colorStart; j <= colorEnd; j++) { - // each R, G, or B component is 16 bits; - // only use the top 8 bits; skip alpha bytes - // up front - _fd->readByte(); - _fd->readByte(); - entry->palette[j * 3] = _fd->readByte(); - _fd->readByte(); - entry->palette[j * 3 + 1] = _fd->readByte(); - _fd->readByte(); - entry->palette[j * 3 + 2] = _fd->readByte(); - _fd->readByte(); - } + entry->_bitsPerSample = _fd->readUint16BE(); // depth + entry->_colorTableId = _fd->readUint16BE(); // colortable id + + // figure out the palette situation + byte colorDepth = entry->_bitsPerSample & 0x1F; + bool colorGreyscale = (entry->_bitsPerSample & 0x20) != 0; + + debug(0, "color depth: %d", colorDepth); + + // if the depth is 2, 4, or 8 bpp, file is palettized + if (colorDepth == 2 || colorDepth == 4 || colorDepth == 8) { + // Initialize the palette + entry->_palette = new byte[256 * 3]; + memset(entry->_palette, 0, 256 * 3); + + if (colorGreyscale) { + debug(0, "Greyscale palette"); + + // compute the greyscale palette + uint16 colorCount = 1 << colorDepth; + int16 colorIndex = 255; + byte colorDec = 256 / (colorCount - 1); + for (byte j = 0; j < colorCount; j++) { + entry->_palette[j * 3] = entry->_palette[j * 3 + 1] = entry->_palette[j * 3 + 2] = colorIndex; + colorIndex -= colorDec; + if (colorIndex < 0) + colorIndex = 0; } - } - } else if (st->codec_type == CODEC_TYPE_AUDIO) { - debug(0, "Audio Codec FourCC: \'%s\'", tag2str(format)); - - uint16 stsdVersion = _fd->readUint16BE(); - _fd->readUint16BE(); // revision level - _fd->readUint32BE(); // vendor - - entry->channels = _fd->readUint16BE(); // channel count - entry->bitsPerSample = _fd->readUint16BE(); // sample size - - _fd->readUint16BE(); // compression id = 0 - _fd->readUint16BE(); // packet size = 0 - - entry->sampleRate = (_fd->readUint32BE() >> 16); - - debug(0, "stsd version =%d", stsdVersion); - if (stsdVersion == 0) { - // Not used, except in special cases. See below. - entry->samplesPerFrame = entry->bytesPerFrame = 0; - } else if (stsdVersion == 1) { - // Read QT version 1 fields. In version 0 these dont exist. - entry->samplesPerFrame = _fd->readUint32BE(); - debug(0, "stsd samples_per_frame =%d",entry->samplesPerFrame); - _fd->readUint32BE(); // bytes per packet - entry->bytesPerFrame = _fd->readUint32BE(); - debug(0, "stsd bytes_per_frame =%d", entry->bytesPerFrame); - _fd->readUint32BE(); // bytes per sample - } else { - warning("Unsupported QuickTime STSD audio version %d", stsdVersion); - return 1; - } + } else if (entry->_colorTableId & 0x08) { + // if flag bit 3 is set, use the default palette + //uint16 colorCount = 1 << colorDepth; - // Version 0 videos (such as the Riven ones) don't have this set, - // but we need it later on. Add it in here. - if (format == MKTAG('i','m','a','4')) { - entry->samplesPerFrame = 64; - entry->bytesPerFrame = 34 * entry->channels; + warning("Predefined palette! %dbpp", colorDepth); + } else { + debug(0, "Palette from file"); + + // load the palette from the file + uint32 colorStart = _fd->readUint32BE(); + /* uint16 colorCount = */ _fd->readUint16BE(); + uint16 colorEnd = _fd->readUint16BE(); + for (uint32 j = colorStart; j <= colorEnd; j++) { + // each R, G, or B component is 16 bits; + // only use the top 8 bits; skip alpha bytes + // up front + _fd->readByte(); + _fd->readByte(); + entry->_palette[j * 3] = _fd->readByte(); + _fd->readByte(); + entry->_palette[j * 3 + 1] = _fd->readByte(); + _fd->readByte(); + entry->_palette[j * 3 + 2] = _fd->readByte(); + _fd->readByte(); + } } - - if (entry->sampleRate == 0 && st->time_scale > 1) - entry->sampleRate = st->time_scale; - } else { - // other codec type, just skip (rtp, mp4s, tmcd ...) - _fd->seek(size - (_fd->pos() - start_pos), SEEK_CUR); } - // this will read extra atoms at the end (wave, alac, damr, avcC, SMI ...) - a.size = size - (_fd->pos() - start_pos); - if (a.size > 8) - readDefault(a); - else if (a.size > 0) - _fd->seek(a.size, SEEK_CUR); - } - - return 0; -} - -int QuickTimeDecoder::readSTSC(MOVatom atom) { - MOVStreamContext *st = _streams[_numStreams - 1]; - - _fd->readByte(); // version - _fd->readByte(); _fd->readByte(); _fd->readByte(); // flags - - st->sample_to_chunk_sz = _fd->readUint32BE(); - - debug(0, "track[%i].stsc.entries = %i", _numStreams - 1, st->sample_to_chunk_sz); - - st->sample_to_chunk = new MOVstsc[st->sample_to_chunk_sz]; - - if (!st->sample_to_chunk) - return -1; - - for (uint32 i = 0; i < st->sample_to_chunk_sz; i++) { - st->sample_to_chunk[i].first = _fd->readUint32BE() - 1; - st->sample_to_chunk[i].count = _fd->readUint32BE(); - st->sample_to_chunk[i].id = _fd->readUint32BE(); - //warning("Sample to Chunk[%d]: First = %d, Count = %d", i, st->sample_to_chunk[i].first, st->sample_to_chunk[i].count); + return entry; } - return 0; -} - -int QuickTimeDecoder::readSTSS(MOVatom atom) { - MOVStreamContext *st = _streams[_numStreams - 1]; - - _fd->readByte(); // version - _fd->readByte(); _fd->readByte(); _fd->readByte(); // flags - - st->keyframe_count = _fd->readUint32BE(); - - debug(0, "keyframe_count = %d", st->keyframe_count); - - st->keyframes = new uint32[st->keyframe_count]; - - if (!st->keyframes) - return -1; - - for (uint32 i = 0; i < st->keyframe_count; i++) { - st->keyframes[i] = _fd->readUint32BE() - 1; // Adjust here, the frames are based on 1 - debug(6, "keyframes[%d] = %d", i, st->keyframes[i]); - - } - return 0; -} - -int QuickTimeDecoder::readSTSZ(MOVatom atom) { - MOVStreamContext *st = _streams[_numStreams - 1]; - - _fd->readByte(); // version - _fd->readByte(); _fd->readByte(); _fd->readByte(); // flags - - st->sample_size = _fd->readUint32BE(); - st->sample_count = _fd->readUint32BE(); - - debug(5, "sample_size = %d sample_count = %d", st->sample_size, st->sample_count); - - if (st->sample_size) - return 0; // there isn't any table following - - st->sample_sizes = new uint32[st->sample_count]; - - if (!st->sample_sizes) - return -1; - - for(uint32 i = 0; i < st->sample_count; i++) { - st->sample_sizes[i] = _fd->readUint32BE(); - debug(6, "sample_sizes[%d] = %d", i, st->sample_sizes[i]); - } - - return 0; -} - -static uint32 ff_gcd(uint32 a, uint32 b) { - return b ? ff_gcd(b, a % b) : a; -} - -int QuickTimeDecoder::readSTTS(MOVatom atom) { - MOVStreamContext *st = _streams[_numStreams - 1]; - uint32 duration = 0; - uint32 total_sample_count = 0; - - _fd->readByte(); // version - _fd->readByte(); _fd->readByte(); _fd->readByte(); // flags - - st->stts_count = _fd->readUint32BE(); - st->stts_data = new MOVstts[st->stts_count]; - - debug(0, "track[%i].stts.entries = %i", _numStreams - 1, st->stts_count); - - st->time_rate = 0; - - for (int32 i = 0; i < st->stts_count; i++) { - int sample_duration; - int sample_count; - - sample_count = _fd->readUint32BE(); - sample_duration = _fd->readUint32BE(); - st->stts_data[i].count = sample_count; - st->stts_data[i].duration = sample_duration; - - st->time_rate = ff_gcd(st->time_rate, sample_duration); - - debug(0, "sample_count=%d, sample_duration=%d", sample_count, sample_duration); - - duration += sample_duration * sample_count; - total_sample_count += sample_count; - } - - st->nb_frames = total_sample_count; - - if (duration) - st->duration = duration; - - return 0; -} - -int QuickTimeDecoder::readSTCO(MOVatom atom) { - MOVStreamContext *st = _streams[_numStreams - 1]; - - _fd->readByte(); // version - _fd->readByte(); _fd->readByte(); _fd->readByte(); // flags - - st->chunk_count = _fd->readUint32BE(); - st->chunk_offsets = new uint32[st->chunk_count]; - - if (!st->chunk_offsets) - return -1; - - for (uint32 i = 0; i < st->chunk_count; i++) { - // WORKAROUND/HACK: The offsets in Riven videos (ones inside the Mohawk archives themselves) - // have offsets relative to the archive and not the video. This is quite nasty. We subtract - // the initial offset of the stream to get the correct value inside of the stream. - st->chunk_offsets[i] = _fd->readUint32BE() - _beginOffset; - } - - return 0; -} - -int QuickTimeDecoder::readWAVE(MOVatom atom) { - if (_numStreams < 1) - return 0; - - MOVStreamContext *st = _streams[_numStreams - 1]; - - if (atom.size > (1 << 30)) - return -1; - - if (st->stsdEntries[0].codecTag == MKTAG('Q','D','M','2')) // Read extradata for QDM2 - st->extradata = _fd->readStream(atom.size - 8); - else if (atom.size > 8) - return readDefault(atom); - else - _fd->skip(atom.size); - - return 0; + // Pass it on up + return Audio::QuickTimeAudioDecoder::readSampleDesc(track, format); } void QuickTimeDecoder::close() { stopAudio(); - for (uint32 i = 0; i < _numStreams; i++) - delete _streams[i]; - - delete _fd; - _fd = 0; - if (_scaledSurface) { _scaledSurface->free(); delete _scaledSurface; _scaledSurface = 0; } - // The audio stream is deleted automatically - _audStream = NULL; - + Common::QuickTimeParser::close(); SeekableVideoDecoder::reset(); } Common::SeekableReadStream *QuickTimeDecoder::getNextFramePacket(uint32 &descId) { - if (_videoStreamIndex < 0) + if (_videoTrackIndex < 0) return NULL; // First, we have to track down which chunk holds the sample and which sample in the chunk contains the frame we are looking for. @@ -1280,22 +480,22 @@ Common::SeekableReadStream *QuickTimeDecoder::getNextFramePacket(uint32 &descId) int32 sampleInChunk = 0; int32 actualChunk = -1; - for (uint32 i = 0; i < _streams[_videoStreamIndex]->chunk_count; i++) { + for (uint32 i = 0; i < _tracks[_videoTrackIndex]->chunkCount; i++) { int32 sampleToChunkIndex = -1; - for (uint32 j = 0; j < _streams[_videoStreamIndex]->sample_to_chunk_sz; j++) - if (i >= _streams[_videoStreamIndex]->sample_to_chunk[j].first) + for (uint32 j = 0; j < _tracks[_videoTrackIndex]->sampleToChunkCount; j++) + if (i >= _tracks[_videoTrackIndex]->sampleToChunk[j].first) sampleToChunkIndex = j; if (sampleToChunkIndex < 0) error("This chunk (%d) is imaginary", sampleToChunkIndex); - totalSampleCount += _streams[_videoStreamIndex]->sample_to_chunk[sampleToChunkIndex].count; + totalSampleCount += _tracks[_videoTrackIndex]->sampleToChunk[sampleToChunkIndex].count; if (totalSampleCount > getCurFrame()) { actualChunk = i; - descId = _streams[_videoStreamIndex]->sample_to_chunk[sampleToChunkIndex].id; - sampleInChunk = _streams[_videoStreamIndex]->sample_to_chunk[sampleToChunkIndex].count - totalSampleCount + getCurFrame(); + descId = _tracks[_videoTrackIndex]->sampleToChunk[sampleToChunkIndex].id; + sampleInChunk = _tracks[_videoTrackIndex]->sampleToChunk[sampleToChunkIndex].count - totalSampleCount + getCurFrame(); break; } } @@ -1306,126 +506,23 @@ Common::SeekableReadStream *QuickTimeDecoder::getNextFramePacket(uint32 &descId) } // Next seek to that frame - _fd->seek(_streams[_videoStreamIndex]->chunk_offsets[actualChunk]); + _fd->seek(_tracks[_videoTrackIndex]->chunkOffsets[actualChunk]); // Then, if the chunk holds more than one frame, seek to where the frame we want is located for (int32 i = getCurFrame() - sampleInChunk; i < getCurFrame(); i++) { - if (_streams[_videoStreamIndex]->sample_size != 0) - _fd->skip(_streams[_videoStreamIndex]->sample_size); + if (_tracks[_videoTrackIndex]->sampleSize != 0) + _fd->skip(_tracks[_videoTrackIndex]->sampleSize); else - _fd->skip(_streams[_videoStreamIndex]->sample_sizes[i]); + _fd->skip(_tracks[_videoTrackIndex]->sampleSizes[i]); } // Finally, read in the raw data for the frame - //printf ("Frame Data[%d]: Offset = %d, Size = %d\n", getCurFrame(), _fd->pos(), _streams[_videoStreamIndex]->sample_sizes[getCurFrame()]); + //printf ("Frame Data[%d]: Offset = %d, Size = %d\n", getCurFrame(), _fd->pos(), _tracks[_videoTrackIndex]->sampleSizes[getCurFrame()]); - if (_streams[_videoStreamIndex]->sample_size != 0) - return _fd->readStream(_streams[_videoStreamIndex]->sample_size); + if (_tracks[_videoTrackIndex]->sampleSize != 0) + return _fd->readStream(_tracks[_videoTrackIndex]->sampleSize); - return _fd->readStream(_streams[_videoStreamIndex]->sample_sizes[getCurFrame()]); -} - -bool QuickTimeDecoder::checkAudioCodecSupport(uint32 tag) { - // Check if the codec is a supported codec - if (tag == MKTAG('t','w','o','s') || tag == MKTAG('r','a','w',' ') || tag == MKTAG('i','m','a','4')) - return true; - -#ifdef VIDEO_CODECS_QDM2_H - if (tag == MKTAG('Q','D','M','2')) - return true; -#endif - - warning("Audio Codec Not Supported: \'%s\'", tag2str(tag)); - - return false; -} - -Audio::AudioStream *QuickTimeDecoder::createAudioStream(Common::SeekableReadStream *stream) { - if (!stream || _audioStreamIndex < 0) - return NULL; - - STSDEntry *entry = &_streams[_audioStreamIndex]->stsdEntries[0]; - - if (entry->codecTag == MKTAG('t','w','o','s') || entry->codecTag == MKTAG('r','a','w',' ')) { - // Fortunately, most of the audio used in Myst videos is raw... - uint16 flags = 0; - if (entry->codecTag == MKTAG('r','a','w',' ')) - flags |= Audio::FLAG_UNSIGNED; - if (entry->channels == 2) - flags |= Audio::FLAG_STEREO; - if (entry->bitsPerSample == 16) - flags |= Audio::FLAG_16BITS; - uint32 dataSize = stream->size(); - byte *data = (byte *)malloc(dataSize); - stream->read(data, dataSize); - delete stream; - return Audio::makeRawStream(data, dataSize, entry->sampleRate, flags); - } else if (entry->codecTag == MKTAG('i','m','a','4')) { - // Riven uses this codec (as do some Myst ME videos) - return Audio::makeADPCMStream(stream, DisposeAfterUse::YES, stream->size(), Audio::kADPCMApple, entry->sampleRate, entry->channels, 34); -#ifdef VIDEO_CODECS_QDM2_H - } else if (entry->codecTag == MKTAG('Q','D','M','2')) { - // Several Myst ME videos use this codec - return makeQDM2Stream(stream, _streams[_audioStreamIndex]->extradata); -#endif - } - - error("Unsupported audio codec"); - - return NULL; -} - -uint32 QuickTimeDecoder::getAudioChunkSampleCount(uint chunk) { - if (_audioStreamIndex < 0) - return 0; - - uint32 sampleCount = 0; - - for (uint32 j = 0; j < _streams[_audioStreamIndex]->sample_to_chunk_sz; j++) - if (chunk >= _streams[_audioStreamIndex]->sample_to_chunk[j].first) - sampleCount = _streams[_audioStreamIndex]->sample_to_chunk[j].count; - - return sampleCount; -} - -void QuickTimeDecoder::readNextAudioChunk() { - STSDEntry *entry = &_streams[_audioStreamIndex]->stsdEntries[0]; - Common::MemoryWriteStreamDynamic *wStream = new Common::MemoryWriteStreamDynamic(); - - _fd->seek(_streams[_audioStreamIndex]->chunk_offsets[_curAudioChunk]); - - // First, we have to get the sample count - uint32 sampleCount = getAudioChunkSampleCount(_curAudioChunk); - assert(sampleCount); - - // Then calculate the right sizes - while (sampleCount > 0) { - uint32 samples = 0, size = 0; - - if (entry->samplesPerFrame >= 160) { - samples = entry->samplesPerFrame; - size = entry->bytesPerFrame; - } else if (entry->samplesPerFrame > 1) { - samples = MIN<uint32>((1024 / entry->samplesPerFrame) * entry->samplesPerFrame, sampleCount); - size = (samples / entry->samplesPerFrame) * entry->bytesPerFrame; - } else { - samples = MIN<uint32>(1024, sampleCount); - size = samples * _streams[_audioStreamIndex]->sample_size; - } - - // Now, we read in the data for this data and output it - byte *data = (byte *)malloc(size); - _fd->read(data, size); - wStream->write(data, size); - free(data); - sampleCount -= samples; - } - - // Now queue the buffer - _audStream->queueAudioStream(createAudioStream(new Common::MemoryReadStream(wStream->getData(), wStream->size(), DisposeAfterUse::YES))); - delete wStream; - - _curAudioChunk++; + return _fd->readStream(_tracks[_videoTrackIndex]->sampleSizes[getCurFrame()]); } void QuickTimeDecoder::updateAudioBuffer() { @@ -1434,22 +531,25 @@ void QuickTimeDecoder::updateAudioBuffer() { uint32 numberOfChunksNeeded = 0; - if (_curFrame == (int32)_streams[_videoStreamIndex]->nb_frames - 1) { + if (_videoTrackIndex < 0 || _curFrame == (int32)_tracks[_videoTrackIndex]->frameCount - 1) { + // If we have no video, there's nothing to base our buffer against + // However, one must ask why a QuickTimeDecoder is being used instead of the nice makeQuickTimeStream() function + // If we're on the last frame, make sure all audio remaining is buffered - numberOfChunksNeeded = _streams[_audioStreamIndex]->chunk_count; + numberOfChunksNeeded = _tracks[_audioTrackIndex]->chunkCount; } else { - STSDEntry *entry = &_streams[_audioStreamIndex]->stsdEntries[0]; + Audio::QuickTimeAudioDecoder::AudioSampleDesc *entry = (Audio::QuickTimeAudioDecoder::AudioSampleDesc *)_tracks[_audioTrackIndex]->sampleDescs[0]; // Calculate the amount of chunks we need in memory until the next frame uint32 timeToNextFrame = getTimeToNextFrame(); uint32 timeFilled = 0; uint32 curAudioChunk = _curAudioChunk - _audStream->numQueuedStreams(); - for (; timeFilled < timeToNextFrame && curAudioChunk < _streams[_audioStreamIndex]->chunk_count; numberOfChunksNeeded++, curAudioChunk++) { - uint32 sampleCount = getAudioChunkSampleCount(curAudioChunk); + for (; timeFilled < timeToNextFrame && curAudioChunk < _tracks[_audioTrackIndex]->chunkCount; numberOfChunksNeeded++, curAudioChunk++) { + uint32 sampleCount = entry->getAudioChunkSampleCount(curAudioChunk); assert(sampleCount); - timeFilled += sampleCount * 1000 / entry->sampleRate; + timeFilled += sampleCount * 1000 / entry->_sampleRate; } // Add a couple extra to ensure we don't underrun @@ -1457,64 +557,60 @@ void QuickTimeDecoder::updateAudioBuffer() { } // Keep three streams in buffer so that if/when the first two end, it goes right into the next - while (_audStream->numQueuedStreams() < numberOfChunksNeeded && _curAudioChunk < _streams[_audioStreamIndex]->chunk_count) - readNextAudioChunk(); + while (_audStream->numQueuedStreams() < numberOfChunksNeeded && _curAudioChunk < _tracks[_audioTrackIndex]->chunkCount) + queueNextAudioChunk(); } -QuickTimeDecoder::STSDEntry::STSDEntry() { - codecTag = 0; - bitsPerSample = 0; - memset(codecName, 0, 32); - colorTableId = 0; - palette = 0; - videoCodec = 0; - channels = 0; - sampleRate = 0; - samplesPerFrame = 0; - bytesPerFrame = 0; -} - -QuickTimeDecoder::STSDEntry::~STSDEntry() { - delete[] palette; - delete videoCodec; +QuickTimeDecoder::VideoSampleDesc::VideoSampleDesc(Common::QuickTimeParser::Track *parentTrack, uint32 codecTag) : Common::QuickTimeParser::SampleDesc(parentTrack, codecTag) { + memset(_codecName, 0, 32); + _colorTableId = 0; + _palette = 0; + _videoCodec = 0; + _bitsPerSample = 0; } -QuickTimeDecoder::MOVStreamContext::MOVStreamContext() { - chunk_count = 0; - chunk_offsets = 0; - stts_count = 0; - stts_data = 0; - sample_to_chunk_sz = 0; - sample_to_chunk = 0; - sample_size = 0; - sample_count = 0; - sample_sizes = 0; - keyframe_count = 0; - keyframes = 0; - time_scale = 0; - time_rate = 0; - width = 0; - height = 0; - codec_type = CODEC_TYPE_MOV_OTHER; - stsdEntryCount = 0; - stsdEntries = 0; - editCount = 0; - editList = 0; - extradata = 0; - nb_frames = 0; - duration = 0; - start_time = 0; +QuickTimeDecoder::VideoSampleDesc::~VideoSampleDesc() { + delete[] _palette; + delete _videoCodec; } -QuickTimeDecoder::MOVStreamContext::~MOVStreamContext() { - delete[] chunk_offsets; - delete[] stts_data; - delete[] sample_to_chunk; - delete[] sample_sizes; - delete[] keyframes; - delete[] stsdEntries; - delete[] editList; - delete extradata; +void QuickTimeDecoder::VideoSampleDesc::initCodec() { + switch (_codecTag) { + case MKTAG('c','v','i','d'): + // Cinepak: As used by most Myst and all Riven videos as well as some Myst ME videos. "The Chief" videos also use this. + _videoCodec = new CinepakDecoder(_bitsPerSample & 0x1f); + break; + case MKTAG('r','p','z','a'): + // Apple Video ("Road Pizza"): Used by some Myst videos. + _videoCodec = new RPZADecoder(_parentTrack->width, _parentTrack->height); + break; + case MKTAG('r','l','e',' '): + // QuickTime RLE: Used by some Myst ME videos. + _videoCodec = new QTRLEDecoder(_parentTrack->width, _parentTrack->height, _bitsPerSample & 0x1f); + break; + case MKTAG('s','m','c',' '): + // Apple SMC: Used by some Myst videos. + _videoCodec = new SMCDecoder(_parentTrack->width, _parentTrack->height); + break; + case MKTAG('S','V','Q','1'): + // Sorenson Video 1: Used by some Myst ME videos. + warning("Sorenson Video 1 not yet supported"); + break; + case MKTAG('S','V','Q','3'): + // Sorenson Video 3: Used by some Myst ME videos. + warning("Sorenson Video 3 not yet supported"); + break; + case MKTAG('j','p','e','g'): + // Motion JPEG: Used by some Myst ME 10th Anniversary videos. + _videoCodec = new JPEGDecoder(); + break; + case MKTAG('Q','k','B','k'): + // CDToons: Used by most of the Broderbund games. + _videoCodec = new CDToonsDecoder(_parentTrack->width, _parentTrack->height); + break; + default: + warning("Unsupported codec \'%s\'", tag2str(_codecTag)); + } } } // End of namespace Video diff --git a/video/qt_decoder.h b/video/qt_decoder.h index cf08349d91..b51fd043e7 100644 --- a/video/qt_decoder.h +++ b/video/qt_decoder.h @@ -21,7 +21,7 @@ */ // -// Heavily based on ffmpeg code. +// Partially based on ffmpeg code. // // Copyright (c) 2001 Fabrice Bellard. // First version by Francois Revol revol@free.fr @@ -37,21 +37,10 @@ #include "video/video_decoder.h" #include "audio/mixer.h" -#include "audio/timestamp.h" +#include "audio/decoders/quicktime_intern.h" namespace Common { -class MacResManager; -class SeekableReadStream; -} - -namespace Audio { -class AudioStream; -class QueuingAudioStream; -} - -namespace Graphics { -struct PixelFormat; -struct Surface; + class Rational; } namespace Video { @@ -65,7 +54,7 @@ class Codec; * - mohawk * - sci */ -class QuickTimeDecoder : public SeekableVideoDecoder { +class QuickTimeDecoder : public SeekableVideoDecoder, public Audio::QuickTimeAudioDecoder { public: QuickTimeDecoder(); virtual ~QuickTimeDecoder(); @@ -112,14 +101,7 @@ public: const byte *getPalette() { _dirtyPalette = false; return _palette; } bool hasDirtyPalette() const { return _dirtyPalette; } - /** - * Set the beginning offset of the video so we can modify the offsets in the stco - * atom of videos inside the Mohawk archives - * @param the beginning offset of the video - */ - void setChunkBeginOffset(uint32 offset) { _beginOffset = offset; } - - bool isVideoLoaded() const { return _fd != 0; } + bool isVideoLoaded() const { return isOpen(); } const Graphics::Surface *decodeNextFrame(); bool endOfVideo() const; uint32 getElapsedTime() const; @@ -131,162 +113,51 @@ public: void seekToTime(Audio::Timestamp time); uint32 getDuration() const { return _duration * 1000 / _timeScale; } -private: - // This is the file handle from which data is read from. It can be the actual file handle or a decompressed stream. - Common::SeekableReadStream *_fd; - - struct MOVatom { - uint32 type; - uint32 offset; - uint32 size; - }; - - struct ParseTable { - int (QuickTimeDecoder::*func)(MOVatom atom); - uint32 type; - }; - - struct MOVstts { - int count; - int duration; - }; +protected: + class VideoSampleDesc : public Common::QuickTimeParser::SampleDesc { + public: + VideoSampleDesc(Common::QuickTimeParser::Track *parentTrack, uint32 codecTag); + ~VideoSampleDesc(); - struct MOVstsc { - uint32 first; - uint32 count; - uint32 id; - }; + void initCodec(); - struct EditListEntry { - uint32 trackDuration; - int32 mediaTime; - Common::Rational mediaRate; + // TODO: Make private in the long run + uint16 _bitsPerSample; + char _codecName[32]; + uint16 _colorTableId; + byte *_palette; + Codec *_videoCodec; }; - struct STSDEntry { - STSDEntry(); - ~STSDEntry(); - - uint32 codecTag; - uint16 bitsPerSample; + Common::QuickTimeParser::SampleDesc *readSampleDesc(Track *track, uint32 format); - // Video - char codecName[32]; - uint16 colorTableId; - byte *palette; - Codec *videoCodec; - - // Audio - uint16 channels; - uint32 sampleRate; - uint32 samplesPerFrame; - uint32 bytesPerFrame; - }; - - enum CodecType { - CODEC_TYPE_MOV_OTHER, - CODEC_TYPE_VIDEO, - CODEC_TYPE_AUDIO - }; - - struct MOVStreamContext { - MOVStreamContext(); - ~MOVStreamContext(); - - uint32 chunk_count; - uint32 *chunk_offsets; - int stts_count; - MOVstts *stts_data; - uint32 sample_to_chunk_sz; - MOVstsc *sample_to_chunk; - uint32 sample_size; - uint32 sample_count; - uint32 *sample_sizes; - uint32 keyframe_count; - uint32 *keyframes; - int32 time_scale; - int time_rate; - - uint16 width; - uint16 height; - CodecType codec_type; - - uint32 stsdEntryCount; - STSDEntry *stsdEntries; - - uint32 editCount; - EditListEntry *editList; - - Common::SeekableReadStream *extradata; - - uint32 nb_frames; - uint32 duration; - uint32 start_time; - Common::Rational scaleFactorX; - Common::Rational scaleFactorY; - }; - - const ParseTable *_parseTable; - bool _foundMOOV; - uint32 _timeScale; - uint32 _duration; - uint32 _numStreams; - Common::Rational _scaleFactorX; - Common::Rational _scaleFactorY; - MOVStreamContext *_streams[20]; - const byte *_palette; - bool _dirtyPalette; - uint32 _beginOffset; - Common::MacResManager *_resFork; - - void initParseTable(); - Audio::AudioStream *createAudioStream(Common::SeekableReadStream *stream); - bool checkAudioCodecSupport(uint32 tag); +private: Common::SeekableReadStream *getNextFramePacket(uint32 &descId); uint32 getFrameDuration(); void init(); - Audio::QueuingAudioStream *_audStream; void startAudio(); void stopAudio(); void updateAudioBuffer(); void readNextAudioChunk(); - uint32 getAudioChunkSampleCount(uint chunk); - int8 _audioStreamIndex; - uint _curAudioChunk; Audio::SoundHandle _audHandle; Audio::Timestamp _audioStartOffset; Codec *createCodec(uint32 codecTag, byte bitsPerPixel); Codec *findDefaultVideoCodec() const; uint32 _nextFrameStartTime; - int8 _videoStreamIndex; + int _videoTrackIndex; uint32 findKeyFrame(uint32 frame) const; + bool _dirtyPalette; + const byte *_palette; + Graphics::Surface *_scaledSurface; const Graphics::Surface *scaleSurface(const Graphics::Surface *frame); Common::Rational getScaleFactorX() const; Common::Rational getScaleFactorY() const; void pauseVideoIntern(bool pause); - - int readDefault(MOVatom atom); - int readLeaf(MOVatom atom); - int readELST(MOVatom atom); - int readHDLR(MOVatom atom); - int readMDHD(MOVatom atom); - int readMOOV(MOVatom atom); - int readMVHD(MOVatom atom); - int readTKHD(MOVatom atom); - int readTRAK(MOVatom atom); - int readSTCO(MOVatom atom); - int readSTSC(MOVatom atom); - int readSTSD(MOVatom atom); - int readSTSS(MOVatom atom); - int readSTSZ(MOVatom atom); - int readSTTS(MOVatom atom); - int readCMOV(MOVatom atom); - int readWAVE(MOVatom atom); }; } // End of namespace Video |