Fixed two bugs in music controller: attempting to play a music file that does not exist caused controller to lose track of current music, and a failure to release music when swapping.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1622 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
parent
d7badeebd4
commit
8ab40bdf11
@ -91,9 +91,17 @@ enum
|
||||
|
||||
if (_mode == kOOMusicOn)
|
||||
{
|
||||
_current = [[ResourceManager ooMusicNamed:name inFolder:@"Music"] retain];
|
||||
if (loop) [_current playLooped];
|
||||
else [_current play];
|
||||
OOMusic *music = [ResourceManager ooMusicNamed:name inFolder:@"Music"];
|
||||
if (music != nil)
|
||||
{
|
||||
[_current stop];
|
||||
|
||||
if (loop) [music playLooped];
|
||||
else [music play];
|
||||
|
||||
[_current release];
|
||||
_current = [music retain];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user