[Scummvm-git-logs] scummvm master -> 15ebf3a12aae014f5b6e3cd0125eab4e421aa46b

dreammaster dreammaster at scummvm.org
Thu Sep 1 01:47:07 CEST 2016


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
1fe8b63825 TITANIC: Fix crash when loading second sound
15ebf3a12a TITANIC: Fixes to warnings, and removal of some unneeded fields


Commit: 1fe8b6382519456ea26f1023576193c3c4e41b88
    https://github.com/scummvm/scummvm/commit/1fe8b6382519456ea26f1023576193c3c4e41b88
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-08-31T19:37:51-04:00

Commit Message:
TITANIC: Fix crash when loading second sound

Changed paths:
    engines/titanic/sound/sound.cpp



diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp
index 7e791c2..045f5aa 100644
--- a/engines/titanic/sound/sound.cpp
+++ b/engines/titanic/sound/sound.cpp
@@ -87,13 +87,16 @@ void CSound::stopChannel(int channel) {
 }
 
 void CSound::checkSounds() {
-	for (CSoundItemList::iterator i = _sounds.begin(); i != _sounds.end(); ++i) {
+	for (CSoundItemList::iterator i = _sounds.begin(); i != _sounds.end(); ) {
 		CSoundItem *soundItem = *i;
+
 		if (soundItem->_active && soundItem->_freeFlag) {
 			if (_soundManager.isActive(soundItem->_waveFile)) {
-				_sounds.remove(soundItem);
+				i = _sounds.erase(i);
 				delete soundItem;
 			}
+		} else {
+			++i;
 		}
 	}
 }


Commit: 15ebf3a12aae014f5b6e3cd0125eab4e421aa46b
    https://github.com/scummvm/scummvm/commit/15ebf3a12aae014f5b6e3cd0125eab4e421aa46b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-08-31T19:46:57-04:00

Commit Message:
TITANIC: Fixes to warnings, and removal of some unneeded fields

Changed paths:
    engines/titanic/sound/sound_manager.cpp
    engines/titanic/support/direct_draw.cpp
    engines/titanic/support/direct_draw.h



diff --git a/engines/titanic/sound/sound_manager.cpp b/engines/titanic/sound/sound_manager.cpp
index ae806fe..e23fb1d 100644
--- a/engines/titanic/sound/sound_manager.cpp
+++ b/engines/titanic/sound/sound_manager.cpp
@@ -426,7 +426,7 @@ void QSoundManager::soundFreed(Audio::SoundHandle &handle) {
 }
 
 void QSoundManager::updateVolume(int channel, uint panRate) {
-	uint volume = _channelsVolume[channel] * 327;
+	double volume = _channelsVolume[channel] * 327;
 
 	switch (_channelsMode[channel]) {
 	case 0:
@@ -451,7 +451,7 @@ void QSoundManager::updateVolume(int channel, uint panRate) {
 	
 	volume = (_musicPercent * volume) / 100;
 	qsWaveMixSetPanRate(channel, 0, panRate);
-	qsWaveMixSetVolume(channel, 0, volume);
+	qsWaveMixSetVolume(channel, 0, (uint)volume);
 }
 
 void QSoundManager::updateVolumes() {
diff --git a/engines/titanic/support/direct_draw.cpp b/engines/titanic/support/direct_draw.cpp
index 3cec937..8e51086 100644
--- a/engines/titanic/support/direct_draw.cpp
+++ b/engines/titanic/support/direct_draw.cpp
@@ -28,9 +28,8 @@
 
 namespace Titanic {
 
-DirectDraw::DirectDraw(TitanicEngine *vm) : _vm(vm),
-		_windowed(false), _fieldC(0), _width(0), _height(0),
-		_bpp(0), _numBackSurfaces(0), _field24(0) {
+DirectDraw::DirectDraw() : _windowed(false), _width(0), _height(0),
+		_bpp(0), _numBackSurfaces(0) {
 }
 
 void DirectDraw::setDisplayMode(int width, int height, int bpp, int refreshRate) {
@@ -55,7 +54,7 @@ DirectDrawSurface *DirectDraw::createSurfaceFromDesc(const DDSurfaceDesc &desc)
 
 /*------------------------------------------------------------------------*/
 
-DirectDrawManager::DirectDrawManager(TitanicEngine *vm, bool windowed) : _directDraw(vm) {
+DirectDrawManager::DirectDrawManager(TitanicEngine *vm, bool windowed) {
 	_mainSurface = nullptr;
 	_backSurfaces[0] = _backSurfaces[1] = nullptr;
 	_directDraw._windowed = windowed;
diff --git a/engines/titanic/support/direct_draw.h b/engines/titanic/support/direct_draw.h
index 4b55968..a7e9cc8 100644
--- a/engines/titanic/support/direct_draw.h
+++ b/engines/titanic/support/direct_draw.h
@@ -32,18 +32,14 @@ namespace Titanic {
 class TitanicEngine;
 
 class DirectDraw {
-private:
-	TitanicEngine *_vm;
 public:
 	bool _windowed;
-	int _fieldC;
 	int _width;
 	int _height;
 	int _bpp;
 	int _numBackSurfaces;
-	int _field24;
 public:
-	DirectDraw(TitanicEngine *vm);
+	DirectDraw();
 
 	/**
 	 * Sets a new display mode





More information about the Scummvm-git-logs mailing list