diff --git a/desktop_version/src/Music.cpp b/desktop_version/src/Music.cpp index 36a30732..1325485b 100644 --- a/desktop_version/src/Music.cpp +++ b/desktop_version/src/Music.cpp @@ -233,15 +233,6 @@ void musicclass::play(int t) Mix_VolumeMusic(128); if (currentsong !=t) { - if (currentsong != -1) - { - // Stop the old song first - // musicchannel.stop(); - if (currentsong != 0) - { - // musicchannel.removeEventListener(Event.SOUND_COMPLETE, loopmusic); - } - } if (t != -1) { // musicfade = 0; @@ -249,8 +240,6 @@ void musicclass::play(int t) if (currentsong == 0 || currentsong == 7 || currentsong == 16 || currentsong == 23) { // Level Complete theme, no fade in or repeat - // musicchannel = musicchan[currentsong].play(0); - // musicchannel.soundTransform = new SoundTransform(1.0); if(Mix_FadeInMusic(musicTracks[t].m_music, 0, 0)==-1) { printf("Mix_PlayMusic: %s\n", Mix_GetError()); @@ -258,10 +247,6 @@ void musicclass::play(int t) } else { - // musicfadein = 90; - // musicchannel = musicchan[currentsong].play(0); - // musicchannel.soundTransform = new SoundTransform(0); - // musicchannel.addEventListener(Event.SOUND_COMPLETE, loopmusic); if (Mix_FadingMusic() == MIX_FADING_OUT) { // We're already fading out fadeoutqueuesong = t; @@ -295,26 +280,18 @@ void musicclass::loopmusic() void musicclass::stopmusic() { - // musicchannel.removeEventListener(Event.SOUND_COMPLETE, stopmusic); - // musicchannel.stop(); Mix_HaltMusic(); currentsong = -1; } void musicclass::haltdasmusik() { - // musicchannel.removeEventListener(Event.SOUND_COMPLETE, stopmusic); - // musicchannel.stop(); - // resumesong = currentsong; Mix_HaltMusic(); currentsong = -1; } void musicclass::silencedasmusik() { - //if(currentsong>-1){ - // musicchannel.soundTransform = new SoundTransform(0); - //} Mix_VolumeMusic(0) ; musicVolume = 0; } @@ -327,13 +304,6 @@ void musicclass::fadeMusicVolumeIn(int ms) void musicclass::fadeout() { - //if(currentsong>-1){ - // if (musicfade == 0) { - // musicchannel.removeEventListener(Event.SOUND_COMPLETE, stopmusic); - // musicfade = 61; - // } - //} - Mix_FadeOutMusic(2000); currentsong = -1; } @@ -366,9 +336,6 @@ void musicclass::processmusic() return; } - //if (musicfade > 0) processmusicfade(); - //if (musicfadein > 0) processmusicfadein(); - if (fadeoutqueuesong != -1 && Mix_PlayingMusic() == 0) { play(fadeoutqueuesong); fadeoutqueuesong = -1; @@ -384,28 +351,6 @@ void musicclass::processmusic() { processmusicfadein(); } - - //musicstopother--; - //if (musicstopother == 1) { - // musicstopother = 0; - // if (currentmusicchan == 0) musicchannel2.stop(); - // if (currentmusicchan == 1) musicchannel.stop(); - //} - //if (musicstopother < 0) musicstopother = 0; - - //musicchancur--; - //if (musicchancur <= 0 && currentsong > -1 && musicchanlen > 0) { - // musicchancur = musicchanlen; - // if (currentmusicchan == 0) { - // musicchannel2 = musicchan[currentsong].play(); - // musicstopother = 3; - // currentmusicchan = 1; - // }else { - // musicchannel = musicchan[currentsong].play(); - // musicstopother = 3; - // currentmusicchan = 0; - // } - //} } @@ -462,9 +407,6 @@ void musicclass::changemusicarea(int x, int y) void musicclass::playef(int t) { - // efchannel[currentefchan] = efchan[t].play(offset); - // currentefchan++; - // if (currentefchan > 15) currentefchan -= 16; int channel; channel = Mix_PlayChannel(-1, soundTracks[t].sound, 0); diff --git a/desktop_version/src/Music.h b/desktop_version/src/Music.h index 4e74a389..b5f0d063 100644 --- a/desktop_version/src/Music.h +++ b/desktop_version/src/Music.h @@ -26,15 +26,9 @@ public: void changemusicarea(int x, int y); - // public var musicchan:Array = new Array(); - // public var musicchannel:SoundChannel, musicchannel2:SoundChannel; - // public var currentmusicchan:int, musicchanlen:int, musicchancur:int, musicstopother:int, resumesong:int; - // public var currentsong:int, musicfade:int, musicfadein:int; int currentsong, musicfade, musicfadein; int resumesong; - //public var nicefade:int, nicechange:int; - void playef(int t); std::vector soundTracks;