Skip to content

Commit

Permalink
Merge remote branch 'upstream/master' into pegasus
Browse files Browse the repository at this point in the history
Conflicts:
	AUTHORS
	devtools/credits.pl
	gui/credits.h
  • Loading branch information
Matthew Hoops committed Aug 26, 2012
2 parents 7a49b36 + 857b92f commit bb1e60e
Show file tree
Hide file tree
Showing 555 changed files with 24,085 additions and 11,695 deletions.
13 changes: 11 additions & 2 deletions AUTHORS
Expand Up @@ -89,7 +89,9 @@ ScummVM Team
DreamWeb:
Torbjorn Andersson
Bertrand Augereau
Filippos Karapetis
Vladimir Menshakov - (retired)
Willem Jan Palenstijn

Gob:
Torbjorn Andersson
Expand Down Expand Up @@ -421,10 +423,10 @@ Other contributions
Matteo Angelino

Norwegian (Bokmaal):
Einar Johan T. Somaae
Einar Johan Somaaen

Norwegian (Nynorsk):
Einar Johan T. Somaae
Einar Johan Somaaen

Polish:
GrajPoPolsku.pl Team
Expand Down Expand Up @@ -600,6 +602,13 @@ Special thanks to
Broken Sword 2.5 team for providing sources of their engine and their
great support.

Neil Dodwell and David Dew from Creative Reality for providing the source
of Dreamweb and for their tremendous support.

Janusz Wisniewski and Miroslaw Liminowicz from Laboratorium Komputerowe
Avalon for providing full source code for Soltys and letting us to
redistribute the game.

Bob Bell, Michel Kripalani, Tommy Yune, from Presto Studios for providing
the source code of The Journeyman Project: Pegasus Prime.

25 changes: 18 additions & 7 deletions NEWS
@@ -1,18 +1,23 @@
For a more comprehensive changelog of the latest experimental code, see:
https://github.com/scummvm/scummvm/commits/

1.5.0 (????-??-??)
1.6.0 (????-??-??)
General:
- Added a new save/load chooser based on a grid of thumbnails. This is only
supported for resolutions bigger than 640x400. The old chooser is still
available and used for games without thumbnail support. It is possible to
select the old one as default too.
- Rewrote VideoDecoder subsystem.

1.5.0 (2012-07-27)
New Games:
- Added support for Backyard Baseball 2003.
- Added support for Blue Force.
- Added support for Darby the Dragon.
- Added support for Dreamweb.
- Added support for Geisha.
- Added support for Gregory and the Hot Air Balloon.
- Added support for Magic Tales: Baba Yaga and the Magic Geese.
- Added support for Magic Tales: Imo and the King.
- Added support for Magic Tales: Liam Finds a Story.
- Added support for Magic Tales: The Little Samurai.
- Added support for Once Upon A Time: Little Red Riding Hood
- Added support for Sleeping Cub's Test of Courage.
- Added support for Soltys.
Expand All @@ -33,19 +38,21 @@ For a more comprehensive changelog of the latest experimental code, see:
- Improved predictive dialog look.
- Various GUI improvements.

SDL ports:
- Added support for OpenGL (GSoC Task).

Broken Sword 1:
- Fixed incorrect sound effects in the DOS/Windows demo.
- Added support for PlayStation videos.
- Fixed missing subtitles in the demo.

Broken Sword 2:
- Added support for PlayStation videos.

Cine:
- Implemented Roland MT-32 output driver.

Drascula:
- Added Spanish subtitles in the Von Braun cutscene (#3069981: no subtitles
in scene with "von Braun").

Gob:
- Fixed a crash in Lost in Time
- Rewrote the AdLib player. Enabled the now working MDY player in
Expand All @@ -63,6 +70,10 @@ For a more comprehensive changelog of the latest experimental code, see:
- Added aspect ratio correction feature.
- Implemented 16 bits per pixel support for games.

Maemo port:
- Added support for Nokia 770 running OS2008 HE.
- Added configurable keymap.

Windows port:
- Changed default savegames location for Windows NT4/2000/XP/Vista/7.
(The migration batch file can be used to copy savegames from the old
Expand Down
4 changes: 2 additions & 2 deletions README
Expand Up @@ -2084,7 +2084,7 @@ Sierra games using the SCI engine add the following non-standard keywords:
originalsaveload bool If true, the original save/load screens are
used instead of the enhanced ScummVM ones
native_fb01 bool If true, the music driver for an IBM Music
Feature card or a Yahama FB-01 FM synth module
Feature card or a Yamaha FB-01 FM synth module
is used for MIDI output

Broken Sword II adds the following non-standard keywords:
Expand Down Expand Up @@ -2125,7 +2125,7 @@ Lands of Lore: The Throne of Chaos adds the following non-standard keywords:
Space Quest IV CD adds the following non-standard keyword:

silver_cursors bool If true, an alternate set of silver mouse cursors
is used instead of the original golden ones
is used instead of the original golden ones

Simon the Sorcerer 1 and 2 add the following non-standard keywords:

Expand Down
38 changes: 38 additions & 0 deletions audio/audiostream.cpp
Expand Up @@ -386,4 +386,42 @@ Timestamp convertTimeToStreamPos(const Timestamp &where, int rate, bool isStereo
return Timestamp(result.secs(), result.numberOfFrames(), result.framerate());
}

/**
* An AudioStream wrapper that cuts off the amount of samples read after a
* given time length is reached.
*/
class LimitingAudioStream : public AudioStream {
public:
LimitingAudioStream(AudioStream *parentStream, const Audio::Timestamp &length, DisposeAfterUse::Flag disposeAfterUse) :
_parentStream(parentStream), _samplesRead(0), _disposeAfterUse(disposeAfterUse),
_totalSamples(length.convertToFramerate(getRate()).totalNumberOfFrames() * getChannels()) {}

~LimitingAudioStream() {
if (_disposeAfterUse == DisposeAfterUse::YES)
delete _parentStream;
}

int readBuffer(int16 *buffer, const int numSamples) {
// Cap us off so we don't read past _totalSamples
int samplesRead = _parentStream->readBuffer(buffer, MIN<int>(numSamples, _totalSamples - _samplesRead));
_samplesRead += samplesRead;
return samplesRead;
}

bool endOfData() const { return _parentStream->endOfData() || _samplesRead >= _totalSamples; }
bool isStereo() const { return _parentStream->isStereo(); }
int getRate() const { return _parentStream->getRate(); }

private:
int getChannels() const { return isStereo() ? 2 : 1; }

AudioStream *_parentStream;
DisposeAfterUse::Flag _disposeAfterUse;
uint32 _totalSamples, _samplesRead;
};

AudioStream *makeLimitingAudioStream(AudioStream *parentStream, const Timestamp &length, DisposeAfterUse::Flag disposeAfterUse) {
return new LimitingAudioStream(parentStream, length, disposeAfterUse);
}

} // End of namespace Audio
10 changes: 10 additions & 0 deletions audio/audiostream.h
Expand Up @@ -356,6 +356,16 @@ QueuingAudioStream *makeQueuingAudioStream(int rate, bool stereo);
*/
Timestamp convertTimeToStreamPos(const Timestamp &where, int rate, bool isStereo);

/**
* Factory function for an AudioStream wrapper that cuts off the amount of samples read after a
* given time length is reached.
*
* @param parentStream The stream to limit
* @param length The time length to limit the stream to
* @param disposeAfterUse Whether the parent stream object should be destroyed on destruction of the returned stream
*/
AudioStream *makeLimitingAudioStream(AudioStream *parentStream, const Timestamp &length, DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::YES);

} // End of namespace Audio

#endif
32 changes: 22 additions & 10 deletions audio/decoders/adpcm.cpp
Expand Up @@ -71,13 +71,19 @@ int Oki_ADPCMStream::readBuffer(int16 *buffer, const int numSamples) {
int samples;
byte data;

assert(numSamples % 2 == 0);
for (samples = 0; samples < numSamples && !endOfData(); samples++) {
if (_decodedSampleCount == 0) {
data = _stream->readByte();
_decodedSamples[0] = decodeOKI((data >> 4) & 0x0f);
_decodedSamples[1] = decodeOKI((data >> 0) & 0x0f);
_decodedSampleCount = 2;
}

for (samples = 0; samples < numSamples && !_stream->eos() && _stream->pos() < _endpos; samples += 2) {
data = _stream->readByte();
buffer[samples] = decodeOKI((data >> 4) & 0x0f);
buffer[samples + 1] = decodeOKI(data & 0x0f);
// (1 - (count - 1)) ensures that _decodedSamples acts as a FIFO of depth 2
buffer[samples] = _decodedSamples[1 - (_decodedSampleCount - 1)];
_decodedSampleCount--;
}

return samples;
}

Expand Down Expand Up @@ -117,13 +123,19 @@ int DVI_ADPCMStream::readBuffer(int16 *buffer, const int numSamples) {
int samples;
byte data;

assert(numSamples % 2 == 0);
for (samples = 0; samples < numSamples && !endOfData(); samples++) {
if (_decodedSampleCount == 0) {
data = _stream->readByte();
_decodedSamples[0] = decodeIMA((data >> 4) & 0x0f, 0);
_decodedSamples[1] = decodeIMA((data >> 0) & 0x0f, _channels == 2 ? 1 : 0);
_decodedSampleCount = 2;
}

for (samples = 0; samples < numSamples && !_stream->eos() && _stream->pos() < _endpos; samples += 2) {
data = _stream->readByte();
buffer[samples] = decodeIMA((data >> 4) & 0x0f);
buffer[samples + 1] = decodeIMA(data & 0x0f, _channels == 2 ? 1 : 0);
// (1 - (count - 1)) ensures that _decodedSamples acts as a FIFO of depth 2
buffer[samples] = _decodedSamples[1 - (_decodedSampleCount - 1)];
_decodedSampleCount--;
}

return samples;
}

Expand Down
22 changes: 16 additions & 6 deletions audio/decoders/adpcm_intern.h
Expand Up @@ -37,7 +37,6 @@
#include "common/stream.h"
#include "common/textconsole.h"


namespace Audio {

class ADPCMStream : public RewindableAudioStream {
Expand All @@ -64,12 +63,11 @@ class ADPCMStream : public RewindableAudioStream {
ADPCMStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse, uint32 size, int rate, int channels, uint32 blockAlign);

virtual bool endOfData() const { return (_stream->eos() || _stream->pos() >= _endpos); }
virtual bool isStereo() const { return _channels == 2; }
virtual int getRate() const { return _rate; }
virtual bool isStereo() const { return _channels == 2; }
virtual int getRate() const { return _rate; }

virtual bool rewind();


/**
* This table is used by some ADPCM variants (IMA and OKI) to adjust the
* step for use on the next sample.
Expand All @@ -83,12 +81,18 @@ class ADPCMStream : public RewindableAudioStream {
class Oki_ADPCMStream : public ADPCMStream {
public:
Oki_ADPCMStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse, uint32 size, int rate, int channels, uint32 blockAlign)
: ADPCMStream(stream, disposeAfterUse, size, rate, channels, blockAlign) {}
: ADPCMStream(stream, disposeAfterUse, size, rate, channels, blockAlign) { _decodedSampleCount = 0; }

virtual bool endOfData() const { return (_stream->eos() || _stream->pos() >= _endpos) && (_decodedSampleCount == 0); }

virtual int readBuffer(int16 *buffer, const int numSamples);

protected:
int16 decodeOKI(byte);

private:
uint8 _decodedSampleCount;
int16 _decodedSamples[2];
};

class Ima_ADPCMStream : public ADPCMStream {
Expand All @@ -108,9 +112,15 @@ class Ima_ADPCMStream : public ADPCMStream {
class DVI_ADPCMStream : public Ima_ADPCMStream {
public:
DVI_ADPCMStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse, uint32 size, int rate, int channels, uint32 blockAlign)
: Ima_ADPCMStream(stream, disposeAfterUse, size, rate, channels, blockAlign) {}
: Ima_ADPCMStream(stream, disposeAfterUse, size, rate, channels, blockAlign) { _decodedSampleCount = 0; }

virtual bool endOfData() const { return (_stream->eos() || _stream->pos() >= _endpos) && (_decodedSampleCount == 0); }

virtual int readBuffer(int16 *buffer, const int numSamples);

private:
uint8 _decodedSampleCount;
int16 _decodedSamples[2];
};

class Apple_ADPCMStream : public Ima_ADPCMStream {
Expand Down
8 changes: 4 additions & 4 deletions audio/decoders/qdm2.cpp
Expand Up @@ -689,7 +689,7 @@ static int getVlc2(Common::BitStream *s, int16 (*table)[2], int bits, int maxDep
code = table[index][0];
n = table[index][1];

if(maxDepth > 2 && n < 0) {
if (maxDepth > 2 && n < 0) {
s->skip(nbBits);
index = s->getBits(-n) + code;
code = table[index][0];
Expand Down Expand Up @@ -861,9 +861,9 @@ void initVlcSparse(VLC *vlc, int nb_bits, int nb_codes,
const void *symbols, int symbols_wrap, int symbols_size) {
vlc->bits = nb_bits;

if(vlc->table_size && vlc->table_size == vlc->table_allocated) {
if (vlc->table_size && vlc->table_size == vlc->table_allocated) {
return;
} else if(vlc->table_size) {
} else if (vlc->table_size) {
error("called on a partially initialized table");
}

Expand Down Expand Up @@ -1353,7 +1353,7 @@ void QDM2Stream::fix_coding_method_array(int sb, int channels, sb_int8_array cod

for (ch = 0; ch < channels; ch++) {
for (j = 0; j < 64; ) {
if((coding_method[ch][sb][j] - 8) > 22) {
if ((coding_method[ch][sb][j] - 8) > 22) {
run = 1;
case_val = 8;
} else {
Expand Down
39 changes: 2 additions & 37 deletions audio/decoders/quicktime.cpp
Expand Up @@ -61,41 +61,6 @@ class SilentAudioStream : public AudioStream {
bool _isStereo;
};

/**
* An AudioStream wrapper that cuts off the amount of samples read after a
* given time length is reached.
*/
class LimitingAudioStream : public AudioStream {
public:
LimitingAudioStream(AudioStream *parentStream, const Audio::Timestamp &length,
DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::YES) :
_parentStream(parentStream), _samplesRead(0), _disposeAfterUse(disposeAfterUse),
_totalSamples(length.convertToFramerate(getRate()).totalNumberOfFrames() * getChannels()) {}

~LimitingAudioStream() {
if (_disposeAfterUse == DisposeAfterUse::YES)
delete _parentStream;
}

int readBuffer(int16 *buffer, const int numSamples) {
// Cap us off so we don't read past _totalSamples
int samplesRead = _parentStream->readBuffer(buffer, MIN<int>(numSamples, _totalSamples - _samplesRead));
_samplesRead += samplesRead;
return samplesRead;
}

bool endOfData() const { return _parentStream->endOfData() || _samplesRead >= _totalSamples; }
bool isStereo() const { return _parentStream->isStereo(); }
int getRate() const { return _parentStream->getRate(); }

private:
int getChannels() const { return isStereo() ? 2 : 1; }

AudioStream *_parentStream;
DisposeAfterUse::Flag _disposeAfterUse;
uint32 _totalSamples, _samplesRead;
};

/**
* An AudioStream wrapper that forces audio to be played in mono.
* It currently just ignores the right channel if stereo.
Expand Down Expand Up @@ -263,7 +228,7 @@ void QuickTimeAudioDecoder::QuickTimeAudioTrack::queueAudio(const Timestamp &len
_skipSamples = Timestamp();
}

queueStream(new LimitingAudioStream(new SilentAudioStream(getRate(), isStereo()), editLength), editLength);
queueStream(makeLimitingAudioStream(new SilentAudioStream(getRate(), isStereo()), editLength), editLength);
_curEdit++;
enterNewEdit(nextEditTime);
} else {
Expand All @@ -289,7 +254,7 @@ void QuickTimeAudioDecoder::QuickTimeAudioTrack::queueAudio(const Timestamp &len
// we move on to the next edit
if (trackPosition >= nextEditTime || _curChunk >= _parentTrack->chunkCount) {
chunkLength = nextEditTime.convertToFramerate(getRate()) - getCurrentTrackTime();
stream = new LimitingAudioStream(stream, chunkLength);
stream = makeLimitingAudioStream(stream, chunkLength);
_curEdit++;
enterNewEdit(nextEditTime);

Expand Down
2 changes: 1 addition & 1 deletion audio/mixer.h
Expand Up @@ -97,7 +97,7 @@ class Mixer : Common::NonCopyable {
* @param stream the actual AudioStream to be played
* @param id a unique id assigned to this stream
* @param volume the volume with which to play the sound, ranging from 0 to 255
* @param balance the balance with which to play the sound, ranging from -128 to 127
* @param balance the balance with which to play the sound, ranging from -127 to 127 (full left to full right), 0 is balanced, -128 is invalid
* @param autofreeStream a flag indicating whether the stream should be
* freed after playback finished
* @param permanent a flag indicating whether a plain stopAll call should
Expand Down

0 comments on commit bb1e60e

Please sign in to comment.