コード例 #1
0
ファイル: ADSREnvOld.cpp プロジェクト: dreieier/Nexus
void ADSREnvOld::setAllTimes( FLOAT aTime, FLOAT dTime, FLOAT sLevel, FLOAT rTime )
{
	setAttackTime( aTime );
	setDecayTime( dTime );
	setSustainLevel( sLevel );
	setReleaseTime( rTime );
}
コード例 #2
0
ファイル: ADSREnvOld.cpp プロジェクト: dreieier/Nexus
void ADSREnvOld::setParameter( UINT16 paramId, FLOAT value ) 
{
	switch( paramId ) {
	case PARAM_ATTACK:  setAttackTime( value ); break;
	case PARAM_DECAY:   setDecayTime( value ); break;
	case PARAM_SUSTAIN: setSustainLevel( value ); break;
	case PARAM_RELEASE: setReleaseTime( value ); break;
	}
}
コード例 #3
0
ファイル: citem.cpp プロジェクト: BackupTheBerlios/hypnos-svn
/*!
\brief set the serial of the item's container
\author Anthalir
\since 0.82a
\param serial new serial
\param old set the saved cont serial or the actual one ?
\param update update the container map ?
*/
void cItem::setContSerial(SI32 serial, LOGICAL old, LOGICAL update )
{
	if( old ) {
		oldcontserial.serial32= serial;
	} else { //Luxor bug fix
		oldcontserial.serial32= contserial.serial32;
		contserial.serial32= serial;
		if (serial == INVALID)
			setDecayTime();
	}

	if( update )
		pointers::updContMap(this);
}
コード例 #4
0
void LaserScanVisualizer::propertyChanged( wxPropertyGridEvent& event )
{
  wxPGProperty* property = event.GetProperty();

  const wxString& name = property->GetName();
  wxVariant value = property->GetValue();

  if ( name == property_prefix_ + SCAN_TOPIC_PROPERTY )
  {
    wxString topic = value.GetString();
    setScanTopic( std::string(topic.fn_str()) );
  }
  else if ( name == property_prefix_ + CLOUD_TOPIC_PROPERTY )
  {
    wxString topic = value.GetString();
    setCloudTopic( std::string(topic.fn_str()) );
  }
  else if ( name == property_prefix_ + COLOR_PROPERTY )
  {
    wxColour color;
    color << value;

    setColor( color.Red() / 255.0f, color.Green() / 255.0f, color.Blue() / 255.0f );
  }
  else if ( name == property_prefix_ + DECAY_TIME_PROPERTY )
  {
    float val = value.GetDouble();
    setDecayTime( val );
  }
  else if ( name == property_prefix_ + STYLE_PROPERTY )
  {
    int val = value.GetLong();
    setStyle( (Style)val );
  }
  else if ( name == property_prefix_ + BILLBOARD_SIZE_PROPERTY )
  {
    float val = value.GetDouble();
    setBillboardSize( val );
  }
}
コード例 #5
0
 SoundEnvironnement::SoundEnvironnement(const float& p_density, const float& p_diffusion,
       const float& p_gain, const float& p_gainHF, const float& p_decayTime,
       const float& p_decayHFRatio, const float& p_reflexionsGain,
       const float& p_reflexionsDelay, const float& p_lateReverbGain,
       const float& p_lateReverbDelay, const float& p_roomRollofFactor,
       const float& p_airAbsorptionGainHF, const bool& p_decayHFLimit)
 : m_density(1.0), m_diffusion(1.0), m_gain(0.32), m_gainHF(0.89), m_decayTime(1.49),
   m_decayHFRatio(0.83), m_reflexionsGain(0.05), m_reflexionsDelay(0.007), m_lateReverbGain(1.26),
   m_lateReverbDelay(0.011), m_roomRollofFactor(0.0), m_airAbsorptionGainHF(0.994), m_decayHFLimit(true)
 {
   setDensity(p_density) ;
   setDiffusion(p_diffusion) ;
   setGain(p_gain) ;
   setGainHF(p_gainHF) ;
   setDecayTime(p_decayTime) ;
   setDecayHFRatio(p_decayHFRatio) ;
   setReflexionsGain(p_reflexionsGain) ;
   setReflexionsDelay(p_reflexionsDelay) ;
   setLateReverbGain(p_lateReverbGain) ;
   setLateReverbDelay(p_lateReverbDelay) ;
   setRoomRollofFactor(p_roomRollofFactor) ;
   setAirAbsorptionGainHF(p_airAbsorptionGainHF) ;
   setDecayHFLimit(p_decayHFLimit) ;
 }
コード例 #6
0
ファイル: soundeffect.cpp プロジェクト: fifengine/fifengine
	void EaxReverb::loadPreset(const EFXEAXREVERBPROPERTIES& prop) {
		// reflections and reverb pans are always 0 vectors, skip it
		setDensity(prop.flDensity);
		setDiffusion(prop.flDiffusion);
		setGain(prop.flGain);
		setGainHf(prop.flGainHF);
		setGainLf(prop.flGainLF);
		setDecayTime(prop.flDecayTime);
		setDecayHfRatio(prop.flDecayHFRatio);
		setDecayLfRatio(prop.flDecayLFRatio);
		setReflectionsGain(prop.flReflectionsGain);
		setReflectionsDelay(prop.flReflectionsDelay);
		setLateReverbGain(prop.flLateReverbGain);
		setLateReverbDelay(prop.flLateReverbDelay);
		setEchoTime(prop.flEchoTime);
		setEchoDepth(prop.flEchoDepth);
		setModulationTime(prop.flModulationTime);
		setModulationDepth(prop.flModulationDepth);
		setAirAbsorptionGainHf(prop.flAirAbsorptionGainHF);
		setHfReference(prop.flHFReference);
		setLfReference(prop.flLFReference);
		setRoomRolloffFactor(prop.flRoomRolloffFactor);
		setDecayHfLimit(prop.iDecayHFLimit ? true : false);
	}
コード例 #7
0
ファイル: citem.cpp プロジェクト: BackupTheBerlios/hypnos-svn
/*!
\author Luxor
\brief execute decay on the item
\return true if decayed (so deleted), false else
*/
LOGICAL cItem::doDecay()
{
	if ( !canDecay() )
		return false;

	if ( magic == 4/* || magic == 2*/ )
		return false;

	if ( !isInWorld() )
		return false;

	if ( TIMEOUT( decaytime ) )
	{


		if ( amxevents[EVENT_IONDECAY] !=NULL )
		{
			g_bByPass = false;
			amxevents[EVENT_IONDECAY]->Call(getSerial32(), DELTYPE_DECAY);
			if ( g_bByPass == true )
				return false;
		}
		/*
		g_bByPass = false;
		runAmxEvent( EVENT_IONDECAY, getSerial32(), DELTYPE_DECAY );
		if ( g_bByPass == true )
			return false;
		*/

		//Multis
		if ( !isFieldSpellItem() && !corpse )
		{
			if ( getMultiSerial32() == INVALID )
			{
				P_ITEM pi_multi = findmulti(getPosition());
				if ( ISVALIDPI(pi_multi) )
				{
					if ( pi_multi->more4 == 0 )
					{
						setDecayTime();
						SetMultiSerial(pi_multi->getSerial32());
						return false;
					}
				}
			}
			else
			{
				setDecayTime();
				return false;
			}
		}
		//End Multis

		if( type == ITYPE_CONTAINER || ( !SrvParms->lootdecayswithcorpse && corpse ) )
		{
			NxwItemWrapper si;
			si.fillItemsInContainer( this, false );
			for( si.rewind(); !si.isEmpty(); si++ )
			{
				P_ITEM pj = si.getItem();
				if( ISVALIDPI(pj) )
				{
					pj->setContSerial(INVALID);
					pj->MoveTo( getPosition() );
					pj->setDecayTime();
					pj->Refresh();
				}
			}
		}
		Delete();
		return true;
	}
	else
		return false;
}