mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 06:53:43 +00:00
Refactoring
This commit is contained in:
@@ -228,13 +228,13 @@ PLError_t LoadTriggerSound (short soundID)
|
||||
theSoundData[kMaxSounds - 1] = NewPtr(soundDataSize);
|
||||
if (theSoundData[kMaxSounds - 1] == nil)
|
||||
{
|
||||
ReleaseResource(theSound);
|
||||
DisposeHandle(theSound);
|
||||
theErr = PLErrors::kOutOfMemory;
|
||||
}
|
||||
else
|
||||
{
|
||||
BlockMove((Ptr)((Byte*)(*theSound) + 20L), theSoundData[kMaxSounds - 1], soundDataSize);
|
||||
ReleaseResource(theSound);
|
||||
DisposeHandle(theSound);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -275,7 +275,7 @@ PLError_t LoadBufferSounds (void)
|
||||
return (PLErrors::kOutOfMemory);
|
||||
|
||||
BlockMove((Ptr)((Byte*)(*theSound) + 20L), theSoundData[i], soundDataSize);
|
||||
ReleaseResource(theSound);
|
||||
DisposeHandle(theSound);
|
||||
}
|
||||
|
||||
theSoundData[kMaxSounds - 1] = nil;
|
||||
@@ -436,7 +436,7 @@ long SoundBytesNeeded (void)
|
||||
if (theSound == nil)
|
||||
{
|
||||
SetResLoad(true);
|
||||
return ((long)ResError());
|
||||
return -1;
|
||||
}
|
||||
totalBytes += GetMaxResourceSize(theSound);
|
||||
// ReleaseResource(theSound);
|
||||
|
Reference in New Issue
Block a user