mirror of
https://github.com/zeldaret/ss
synced 2026-07-29 07:32:47 -04:00
snd_StrmSoundHandle OK
This commit is contained in:
@@ -11,7 +11,9 @@
|
||||
|
||||
#include "common.h" // nullptr
|
||||
|
||||
#include "nw4r/snd/snd_SoundHandle.h"
|
||||
#include "nw4r/snd/snd_StrmSound.h"
|
||||
#include "nw4r/ut/ut_RuntimeTypeInfo.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* functions
|
||||
@@ -19,6 +21,29 @@
|
||||
|
||||
namespace nw4r { namespace snd {
|
||||
|
||||
StrmSoundHandle::StrmSoundHandle(SoundHandle* handle)
|
||||
: mSound(nullptr)
|
||||
{
|
||||
if (!handle)
|
||||
return;
|
||||
|
||||
detail::BasicSound *basicSound = handle->detail_GetAttachedSound();
|
||||
if (!basicSound)
|
||||
return;
|
||||
|
||||
if (detail::StrmSound *sound =
|
||||
ut::DynamicCast<detail::StrmSound *>(basicSound))
|
||||
{
|
||||
|
||||
mSound = sound;
|
||||
|
||||
if (mSound->IsAttachedTempSpecialHandle())
|
||||
mSound->DetachTempSpecialHandle();
|
||||
|
||||
mSound->mTempSpecialHandle = this;
|
||||
}
|
||||
}
|
||||
|
||||
void StrmSoundHandle::DetachSound()
|
||||
{
|
||||
if (IsAttachedSound())
|
||||
|
||||
Reference in New Issue
Block a user