aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/midi/coreaudio.cpp29
-rwxr-xr-xconfigure2
-rw-r--r--engines/dreamweb/dreamweb.h2
-rw-r--r--engines/dreamweb/monitor.cpp4
-rw-r--r--engines/toltecs/movie.cpp8
-rw-r--r--engines/tsage/blue_force/blueforce_scenes3.cpp8
-rw-r--r--engines/wintermute/base/gfx/osystem/base_render_osystem.cpp5
-rw-r--r--graphics/decoders/tga.cpp5
-rw-r--r--video/smk_decoder.cpp2
9 files changed, 51 insertions, 14 deletions
diff --git a/backends/midi/coreaudio.cpp b/backends/midi/coreaudio.cpp
index 43c801287d..ffa2580acf 100644
--- a/backends/midi/coreaudio.cpp
+++ b/backends/midi/coreaudio.cpp
@@ -172,10 +172,15 @@ int MidiDriver_CORE::open() {
// Load custom soundfont, if specified
if (ConfMan.hasKey("soundfont")) {
- FSRef fsref;
- FSSpec fsSpec;
const char *soundfont = ConfMan.get("soundfont").c_str();
+ // TODO: We should really check whether the file contains an
+ // actual soundfont...
+
+#if USE_DEPRECATED_COREAUDIO_API
+ // Before 10.5, we need to use kMusicDeviceProperty_SoundBankFSSpec
+ FSRef fsref;
+ FSSpec fsSpec;
err = FSPathMakeRef ((const byte *)soundfont, &fsref, NULL);
if (err == noErr) {
@@ -183,8 +188,6 @@ int MidiDriver_CORE::open() {
}
if (err == noErr) {
- // TODO: We should really check here whether the file contains an
- // actual soundfont...
err = AudioUnitSetProperty (
_synth,
kMusicDeviceProperty_SoundBankFSSpec, kAudioUnitScope_Global,
@@ -192,6 +195,24 @@ int MidiDriver_CORE::open() {
&fsSpec, sizeof(fsSpec)
);
}
+#else
+ // kMusicDeviceProperty_SoundBankFSSpec is present on 10.6+, but broken
+ // kMusicDeviceProperty_SoundBankURL was added in 10.5 as a replacement
+ CFURLRef url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, (const UInt8 *)soundfont, strlen(soundfont), false);
+
+ if (url) {
+ err = AudioUnitSetProperty (
+ _synth,
+ kMusicDeviceProperty_SoundBankURL, kAudioUnitScope_Global,
+ 0,
+ &url, sizeof(url)
+ );
+
+ CFRelease(url);
+ } else {
+ warning("Failed to allocate CFURLRef from '%s'", soundfont);
+ }
+#endif
if (err != noErr)
warning("Failed loading custom sound font '%s' (error %ld)\n", soundfont, (long)err);
diff --git a/configure b/configure
index 008593927f..27b6645efe 100755
--- a/configure
+++ b/configure
@@ -62,7 +62,7 @@ get_var() {
eval echo \$${1}
}
-# Add an engine: id name build subengines dependencies
+# Add an engine: id name build subengines base-games dependencies
add_engine() {
_engines="${_engines} ${1}"
if test "${3}" = "no" ; then
diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h
index 1f6deb8566..a4597b1867 100644
--- a/engines/dreamweb/dreamweb.h
+++ b/engines/dreamweb/dreamweb.h
@@ -196,7 +196,7 @@ protected:
// from monitor.cpp
char _inputLine[64];
- char _operand1[14];
+ char _operand1[64];
char _currentFile[14];
// from newplace.cpp
diff --git a/engines/dreamweb/monitor.cpp b/engines/dreamweb/monitor.cpp
index 4e9d8eecc1..1886a80b6a 100644
--- a/engines/dreamweb/monitor.cpp
+++ b/engines/dreamweb/monitor.cpp
@@ -194,7 +194,7 @@ void DreamWebEngine::printLogo() {
}
void DreamWebEngine::input() {
- memset(_inputLine, 0, 64);
+ memset(_inputLine, 0, sizeof(_inputLine));
_curPos = 0;
printChar(_monitorCharset, _monAdX, _monAdY, '>', 0, NULL, NULL);
multiDump(_monAdX, _monAdY, 6, 8);
@@ -665,7 +665,7 @@ void DreamWebEngine::searchForFiles(const char *filesString) {
const char *DreamWebEngine::parser() {
char *output = _operand1;
- memset(output, 0, 14);
+ memset(output, 0, sizeof(_operand1));
*output++ = '=';
diff --git a/engines/toltecs/movie.cpp b/engines/toltecs/movie.cpp
index 33fe249514..74364630f5 100644
--- a/engines/toltecs/movie.cpp
+++ b/engines/toltecs/movie.cpp
@@ -98,7 +98,7 @@ void MoviePlayer::playMovie(uint resIndex) {
uint32 lastTime = _vm->_mixer->getSoundElapsedTime(_audioStreamHandle);
byte *chunkBuffer = NULL;
- uint32 prevChunkSize = 0;
+ uint32 chunkBufferSize = 0;
while (_chunkCount--) {
byte chunkType = _vm->_arc->readByte();
@@ -111,13 +111,13 @@ void MoviePlayer::playMovie(uint resIndex) {
if (chunkType == kChunkAudio) {
_vm->_arc->skip(chunkSize);
} else {
- // Only reallocate the chunk buffer if it's smaller than the previous frame
- if (chunkSize > prevChunkSize) {
+ // Only reallocate the chunk buffer if the new chunk is bigger
+ if (chunkSize > chunkBufferSize) {
delete[] chunkBuffer;
chunkBuffer = new byte[chunkSize];
+ chunkBufferSize = chunkSize;
}
- prevChunkSize = chunkSize;
_vm->_arc->read(chunkBuffer, chunkSize);
}
diff --git a/engines/tsage/blue_force/blueforce_scenes3.cpp b/engines/tsage/blue_force/blueforce_scenes3.cpp
index 22c831f531..81e4af6e97 100644
--- a/engines/tsage/blue_force/blueforce_scenes3.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes3.cpp
@@ -346,6 +346,14 @@ void Scene300::postInit(SceneObjectList *OwnerList) {
break;
}
+ if (BF_GLOBALS.getFlag(onBike) && !BF_GLOBALS.getFlag(onDuty)) {
+ BF_GLOBALS._sound1.play(30);
+ } else if ((BF_GLOBALS._dayNumber == 2) && (BF_GLOBALS._bookmark < bEndDayOne)) {
+ BF_GLOBALS._sound1.changeSound(49);
+ } else if (BF_GLOBALS._sceneManager._previousScene != 190) {
+ BF_GLOBALS._sound1.changeSound(33);
+ }
+
_item10.setDetails(4, 300, 7, 13, 16, 1);
_item11.setDetails(2, 300, 9, 13, 18, 1);
_item12.setDetails(5, 300, 10, 13, 19, 1);
diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
index 6d67253038..03ec827668 100644
--- a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
+++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
@@ -573,6 +573,11 @@ Rect32 BaseRenderOSystem::getViewPort() {
//////////////////////////////////////////////////////////////////////////
void BaseRenderOSystem::modTargetRect(Common::Rect *rect) {
+ // FIXME: This is wrong in quite a few ways right now, and ends up
+ // breaking the notebook in Dirty Split, so we disable the correction
+ // for now, this will need fixing when a game with odd aspect-ratios
+ // show up.
+ return;
rect->left = (int16)MathUtil::round(rect->left * _ratioX + _borderLeft - _renderRect.left);
rect->top = (int16)MathUtil::round(rect->top * _ratioY + _borderTop - _renderRect.top);
rect->setWidth((int16)MathUtil::roundUp(rect->width() * _ratioX));
diff --git a/graphics/decoders/tga.cpp b/graphics/decoders/tga.cpp
index 0b2318e127..c3b9d84055 100644
--- a/graphics/decoders/tga.cpp
+++ b/graphics/decoders/tga.cpp
@@ -145,7 +145,10 @@ bool TGADecoder::readHeader(Common::SeekableReadStream &tga, byte &imageType, by
if (pixelDepth == 24) {
_format = PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0);
} else if (pixelDepth == 32) {
- _format = PixelFormat(4, 8, 8, 8, attributeBits, 16, 8, 0, 24);
+ // HACK: According to the spec, attributeBits should determine the amount
+ // of alpha-bits, however, as the game files that use this decoder seems
+ // to ignore that fact, we force the amount to 8 for 32bpp files for now.
+ _format = PixelFormat(4, 8, 8, 8, /* attributeBits */ 8, 16, 8, 0, 24);
} else if (pixelDepth == 16 && imageType == TYPE_TRUECOLOR) {
// 16bpp TGA is ARGB1555
_format = PixelFormat(2, 5, 5, 5, attributeBits, 10, 5, 0, 15);
diff --git a/video/smk_decoder.cpp b/video/smk_decoder.cpp
index bea65142a1..c49791100d 100644
--- a/video/smk_decoder.cpp
+++ b/video/smk_decoder.cpp
@@ -318,7 +318,7 @@ bool SmackerDecoder::loadStream(Common::SeekableReadStream *stream) {
// 1 - set to 1 if file is Y-interlaced
// 2 - set to 1 if file is Y-doubled
// If bits 1 or 2 are set, the frame should be scaled to twice its height
- // before it is displayed.
+ // before it is displayed.
_header.flags = _fileStream->readUint32LE();
SmackerVideoTrack *videoTrack = createVideoTrack(width, height, frameCount, frameRate, _header.flags, _header.signature);