示例#1
0
//---------------------------------------------------------------------------
//
//---------------------------------------------------------------------------
int SOUND_create_sample(int sample_id)
{
	sample* s = &sample_generator[sample_id];
	sample_buffers[nbuffers] =  CreateSoundEffect(&s->c, s->samples,s->note);
	return nbuffers++;

}
示例#2
0
void RPG_Effect::Create(RPG_EffectDefinition const& effectDefinition, hkvVec3 const& position /*= hkvVec3(0.f, 0.f, 0.f)*/, hkvVec3 const& orientation /*= hkvVec3(0.f, 0.f, 0.f)*/)
{
  m_debugDisplay = effectDefinition.m_displayDebugInfo;

  // if a visual effect for this type has been specified, play it
  if (!effectDefinition.m_vfxFilename.IsEmpty())
  {
    // see whether this effect has already been created for this character
    if (m_persistentParticleEffect && !m_persistentParticleEffect->IsDead())
    {
      m_persistentParticleEffect->Restart();
    }
    else
    {
      // if we weren't able to restart an existing effect, create a new one.
      VVERIFY_MSG(CreateVisualEffect(effectDefinition, position, orientation), "Tried to create an undefined visual effect.");
    }
  }

  // if an FMOD event exists for this effect, play it
  if (!effectDefinition.m_fmodEventGroupName.IsEmpty() && !effectDefinition.m_fmodEventName.IsEmpty())
  {
    CreateSoundEffect(effectDefinition, position);
  }
  // otherwise, if a sound effect for this type has been specified, play it
  else if (!effectDefinition.m_sfxFilename.IsEmpty())
  {
    RPG_VisionEffectHelper::PlaySoundFile(effectDefinition.m_sfxFilename, position);
  }

  // if wallmark information exists for this effect, create the wallmark.
  if (!effectDefinition.m_wallmarkTextureFilename.IsEmpty())
  {
    CreateWallmark(effectDefinition);
  }

  if (effectDefinition.m_cameraShakeDuration > 0.f)
  {
    StartCameraShake(effectDefinition);
  }

  if (m_parentEntity && effectDefinition.m_shaderFlashDuration > 0.f) // shader flash requires a parent entity (obviously)
  {
    FlashShader(effectDefinition);
  }

  DebugDrawEffectPosition();
}