Skip to content

Commit

Permalink
TONY: Remove useless/commented music code.
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzie committed Aug 29, 2012
1 parent a29f1fb commit a6673aa
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 22 deletions.
1 change: 0 additions & 1 deletion engines/tony/globals.h
Expand Up @@ -180,7 +180,6 @@ class Globals {
int _nextSync;
int _curChannel;
int _flipflop;
// OSystem::MutexRef csMusic;
CharacterStruct _character[16];
MCharacterStruct _mCharacter[10];
ChangedHotspotStruct _changedHotspot[256];
Expand Down
12 changes: 3 additions & 9 deletions engines/tony/sound.cpp
Expand Up @@ -583,7 +583,7 @@ bool FPStream::play() {
*
*/

bool FPStream::stop(bool bSync) {
bool FPStream::stop() {
if (!_bSoundSupported)
return true;

Expand All @@ -593,15 +593,9 @@ bool FPStream::stop(bool bSync) {
if (!g_system->getMixer()->isSoundHandleActive(_handle))
return false;

if (bSync) {
// The caller intends to call waitForSync.
// FIXME: Why call this in that case?! Looks like old code. Remove that parameter.
return true;
} else {
g_system->getMixer()->stopHandle(_handle);
g_system->getMixer()->stopHandle(_handle);

_bPaused = false;
}
_bPaused = false;

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion engines/tony/sound.h
Expand Up @@ -333,7 +333,7 @@ class FPStream {
* @returns True is everything is OK, False otherwise
*/

bool stop(bool bSync = false);
bool stop();
void waitForSync(FPStream *toplay);

/**
Expand Down
12 changes: 1 addition & 11 deletions engines/tony/tony.cpp
Expand Up @@ -364,7 +364,6 @@ void TonyEngine::doNextMusic(CORO_PARAM, const void *param) {
streams[GLOBALS._nextChannel]->setLoop(GLOBALS._nextLoop);
//streams[GLOBALS._nextChannel]->prefetch();

streams[GLOBALS._curChannel]->stop(true);
streams[GLOBALS._curChannel]->waitForSync(streams[GLOBALS._nextChannel]);

streams[GLOBALS._curChannel]->unloadFile();
Expand Down Expand Up @@ -392,14 +391,10 @@ void TonyEngine::playSFX(int nChannel, int nFX) {
}

void TonyEngine::stopMusic(int nChannel) {
// g_system->lockMutex(csMusic);

if (nChannel < 4)
_stream[nChannel + GLOBALS._flipflop]->stop();
else
_stream[nChannel]->stop();

// g_system->unlockMutex(csMusic);
}

void TonyEngine::stopSFX(int nChannel) {
Expand Down Expand Up @@ -484,7 +479,7 @@ void TonyEngine::unloadAllUtilSFX() {
void TonyEngine::initMusic() {
int i;

_theSound.init(/*_window*/);
_theSound.init();
_theSound.setMasterVolume(63);

for (i = 0; i < 6; i++)
Expand All @@ -494,9 +489,6 @@ void TonyEngine::initMusic() {
_sfx[i] = _utilSfx[i] = NULL;
}

// Create the mutex for controlling music access
// csMusic = g_system->createMutex();

// Preload sound effects
preloadUtilSFX(0, "U01.ADP"); // Reversed!!
preloadUtilSFX(1, "U02.ADP");
Expand All @@ -512,8 +504,6 @@ void TonyEngine::closeMusic() {
_stream[i]->release();
}

// g_system->deleteMutex(csMusic);

unloadAllSFX();
unloadAllUtilSFX();
}
Expand Down

0 comments on commit a6673aa

Please sign in to comment.