From 97087e8cd1aee602217c36f1c71d4ca3f74e0e40 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 18 Feb 2014 23:56:41 -0500 Subject: MADS: Fix warnings identified by gcc --- engines/mads/module.mk | 1 - engines/mads/msurface.h | 14 ++++---------- engines/mads/sound_nebular.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/engines/mads/module.mk b/engines/mads/module.mk index d2ae9ea4cf..401b909ac8 100644 --- a/engines/mads/module.mk +++ b/engines/mads/module.mk @@ -14,7 +14,6 @@ MODULE_OBJS := \ resources.o \ sound.o \ sound_nebular.o \ - sprite.o \ user_interface.o # This module can be built as a plugin diff --git a/engines/mads/msurface.h b/engines/mads/msurface.h index 9bb651b02b..21b0cbcd2f 100644 --- a/engines/mads/msurface.h +++ b/engines/mads/msurface.h @@ -69,6 +69,8 @@ protected: MSurface(bool isScreen = false); MSurface(int w, int h); public: + virtual ~MSurface() {} + void create(int w, int h) { Graphics::Surface::create(w, h, Graphics::PixelFormat::createFormatCLUT8()); } @@ -155,7 +157,7 @@ class MSurfaceM4: public MSurface { friend class MSurface; protected: MSurfaceM4(bool isScreen = false): MSurface(isScreen) {} - MSurfaceM4(int w, int h): MSurface(w, h) {} + MSurfaceM4(int widthVal, int heightVal): MSurface(widthVal, heightVal) {} void loadBackgroundStream(Common::SeekableReadStream *source); public: @@ -167,18 +169,10 @@ class MSurfaceRiddle: public MSurfaceM4 { friend class MSurface; protected: MSurfaceRiddle(bool isScreen = false): MSurfaceM4(isScreen) {} - MSurfaceRiddle(int w, int h): MSurfaceM4(w, h) {} + MSurfaceRiddle(int widthVal, int heightVal): MSurfaceM4(widthVal, heightVal) {} public: virtual void loadBackground(const Common::String &sceneName); }; -/* - void rexLoadBackground(Common::SeekableReadStream *source, RGBList **palData = NULL); - void madsLoadBackground(int roomNumber, RGBList **palData = NULL); - void m4LoadBackground(Common::SeekableReadStream *source); - - void madsloadInterface(int index, RGBList **palData); - - */ } // End of namespace MADS diff --git a/engines/mads/sound_nebular.cpp b/engines/mads/sound_nebular.cpp index 146a620261..7c1410c24c 100644 --- a/engines/mads/sound_nebular.cpp +++ b/engines/mads/sound_nebular.cpp @@ -234,11 +234,11 @@ void ASound::noise() { int randomVal = getRandomNumber(); if (_v1) { - setFrequency(_channelNum1, (randomVal ^ 0xFFFF) & _freqMask1 + _freqBase1); + setFrequency(_channelNum1, ((randomVal ^ 0xFFFF) & _freqMask1) + _freqBase1); } if (_v2) { - setFrequency(_channelNum2, randomVal & _freqMask2 + _freqBase2); + setFrequency(_channelNum2, (randomVal & _freqMask2) + _freqBase2); } } @@ -731,7 +731,7 @@ void ASound::loadSample(int sampleIndex) { void ASound::processSample() { // Write out vib flags and split point write2(8, 0x40 + _v11, 0x3F); - int depthRhythm = _ports[0xBD] & 0x3F | (_amDep ? 0x80 : 0) | + int depthRhythm = (_ports[0xBD] & 0x3F) | (_amDep ? 0x80 : 0) | (_vibDep ? 0x40 : 0); write2(8, 0xBD, depthRhythm); write2(8, 8, _splitPoint ? 0x40 : 0); @@ -758,7 +758,7 @@ void ASound::processSample() { write2(8, 0xE0 + _v11, _samplePtr->_waveformSelect & 3); // Write out total level & scaling level - val = -(_samplePtr->_totalLevel & 0x3F - 0x3F) | (_samplePtr->_scalingLevel << 6); + val = -((_samplePtr->_totalLevel & 0x3F) - 0x3F) | (_samplePtr->_scalingLevel << 6); write2(8, 0x40 + _v11, val); } -- cgit v1.2.3