当前位置: 首页>>代码示例>>C++>>正文


C++ GetEffect函数代码示例

本文整理汇总了C++中GetEffect函数的典型用法代码示例。如果您正苦于以下问题:C++ GetEffect函数的具体用法?C++ GetEffect怎么用?C++ GetEffect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GetEffect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: int

void GaussianBlurShader::DoApplyTech(Engine& engine)
{
	if (!engine.GetTexture(0) || engine.GetTexture(0)->GetType() != D3DRTYPE_TEXTURE)
		throw int();
	D3DSURFACE_DESC texDesc;
	static_cast<IDirect3DTexture9*>(engine.GetTexture(0))->GetLevelDesc(0, &texDesc);

	float fWidth = 0;
	float fHeight = 0;
	switch (curTechnique)
	{
	case ttHorizontal:
		fWidth = 1.0f / texDesc.Width;
		break;

	case ttVertical:
		fHeight = 1.0f / texDesc.Height;
		break;

	default:
		throw int();
	}

	GetEffect()->SetTexture(_colorTex, engine.GetTexture(0));
	GetEffect()->SetFloatArray(_colorTexSizes, D3DXVECTOR2(fWidth, fHeight), 2);
	GetEffect()->SetTechnique(_techGaussianBlur);
	GetEffect()->Begin(&_cntPass, 0);
}
开发者ID:DimaKirk,项目名称:rrr3d,代码行数:28,代码来源:GaussianBlur.cpp

示例2: IsReflectable

func IsReflectable(object clonk)
{
	if(clonk == master || GetEffect("Blocked", this) || GetEffect("FollowMaster", this) || GetEffect("Discharge", this))
		return 0;
		
	return 1;
}
开发者ID:TheThow,项目名称:OpenClonk-Stuff,代码行数:7,代码来源:Script.c

示例3: GetEffect

void GaussianBlurShader::DoInit()
{
	D3DXEffect::DoInit();

	_colorTex = GetEffect()->GetParameterByName(0, "colorTex");
	_colorTexSizes = GetEffect()->GetParameterByName(0, "colorTexSizes");
	_techGaussianBlur = GetEffect()->GetTechniqueByName("techGaussianBlur");	
}
开发者ID:DimaKirk,项目名称:rrr3d,代码行数:8,代码来源:GaussianBlur.cpp

示例4: ControlStop

func ControlStop(object clonk, int control)
{
	if (GetEffect("ElevatorControl", this))
		if (control == CON_Up || control == CON_Down)
		{
			var effect = GetEffect("ElevatorControl", this);
			effect.controlled = nil;
			return effect.case->ControlStop(clonk, control);
		}
开发者ID:772,项目名称:openclonk,代码行数:9,代码来源:Script.c

示例5: ASSERT

BOOL CEffectManager::ForcedEndEffect(HEFFPROC handle)
{
	if(m_bInited == FALSE)
		return TRUE;
	
	ASSERT(handle);
	
	CEffect* pEffect = GetEffect(handle);
	if(pEffect == NULL)
		return TRUE;
	
	EFFECTPARAM param;
	param.Copy(pEffect->GetEffectParam());
	DWORD Key = (DWORD)pEffect->GetEffectID();
	DWORD NextEffect = pEffect->GetNextEffect();
	DWORD RefCount = pEffect->GetRefCount();
	int EffectKind = pEffect->GetEffectKind();
	pEffect->DecRefCount();
	if(pEffect->GetRefCount() > 0)
		return FALSE;

	EndProcess(pEffect);
	
//	if(NextEffect)
//	{
//		HEFFPROC proc = StartEffectProcess(EffectKind,NextEffect,&param,Key,RefCount);
//		CEffect* pNextEffect = GetEffect(proc);
////		ASSERT(pNextEffect);
//		if(pNextEffect)
//			pNextEffect->SetEndFlag();
//	}

	// 080425 NYJ --- NextEffect가 여러개인 경우 루프를 돌면서 모두 중단시킴
	int nCnt = 0;
	while(NextEffect)
	{
		if( 99 < nCnt)
			break;

		HEFFPROC proc = StartEffectProcess(EffectKind,NextEffect,&param,Key,RefCount);
		
		NextEffect = 0;
		CEffect* pNextEffect = GetEffect(proc);
		if(pNextEffect)
		{
			EndProcess(pNextEffect);
			NextEffect = pNextEffect->GetNextEffect();
		}
		nCnt++;
	}
	
	return TRUE;
}
开发者ID:xianyinchen,项目名称:LUNAPlus,代码行数:53,代码来源:EffectManager.cpp

示例6: HandleApplyEffect

		void HandleApplyEffect(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
		{
			if (Unit* caster = GetCaster())
			{
				// Divine touch
				if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 3021, EFFECT_0))
				{
					uint32 heal = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), GetEffect(EFFECT_0)->GetAmount(), DOT);
					heal = GetTarget()->SpellHealingBonusTaken(GetSpellInfo(), heal, DOT, 1, caster->GetGUID());

					int32 basepoints0 = aurEff->GetAmount() * GetEffect(EFFECT_0)->GetTotalTicks() * int32(heal) / 100;
					caster->CastCustomSpell(GetTarget(), 63544, &basepoints0, NULL, NULL, true, NULL, aurEff);
				}
			}
		}
开发者ID:Tithand,项目名称:TER-Server,代码行数:15,代码来源:spell_priest.cpp

示例7: GetEffect

void EmitterAttributeEditor::HandleEmissionRateChanged(float value)
{
	if(updatingWidget_)
		return;

	FloatEditor* editor = (FloatEditor*)sender();
	if(editor == emissionRateMinEditor_)
	{
		GetEffect()->SetMinEmissionRate(value);
	}
	else if(editor == emissionRateMaxEditor_)
	{
		GetEffect()->SetMaxEmissionRate(value);
	}
}
开发者ID:xujingsy,项目名称:Urho3D_xujing,代码行数:15,代码来源:EmitterAttributeEditor.cpp

示例8: FxCheckEnemiesTimer

func FxCheckEnemiesTimer(object target, proplist effect, int time)
{
	for(var o in FindObjects(Find_Distance(Size), Find_Not(Find_ID(Hook)), Find_Or(Find_Func("IsReflectable"), Find_Func("CanBeHit", this))))
	{
		if(GetEffect("SawBladeCD", o) || (o->GetOwner() == GetOwner() && time < 15))
		{
			continue;
		}
		
		var angle = Angle(GetX(), GetY(), o->GetX(), o->GetY());
		AddEffect("SawBladeCD", o, 1, 25);
		
		
		if(!o->GetAlive())
		{
			if(o->~IsWallElement())
				continue;
			
			var speed = Distance(0, 0, o->GetXDir(), o->GetYDir());
			o->SetVelocity(angle, speed);
			o->~Blocked(this);
			WeaponDamage(o, SpellDamage);
			
			Sound("Hits::GeneralHit*", false, 50);
			continue;
		}
		
		Sound("Objects::Weapons::WeaponHit*", false, 50);
		o->Fling(Sin(angle, 8), -Cos(angle, 8));
		WeaponDamage(o, SpellDamage);
	}
}
开发者ID:TheThow,项目名称:OpenClonk-Stuff,代码行数:32,代码来源:Script.c

示例9: GetEffect

//----------------------------------------------------------------------------------
//
//----------------------------------------------------------------------------------
void EffectNodeRing::EndRendering(Manager* manager)
{
	RingRenderer* renderer = manager->GetRingRenderer();
	if( renderer != NULL )
	{
		RingRenderer::NodeParameter nodeParameter;
		nodeParameter.AlphaBlend = AlphaBlend;
		nodeParameter.TextureFilter = RendererCommon.FilterType;
		nodeParameter.TextureWrap = RendererCommon.WrapType;
		nodeParameter.ZTest = RendererCommon.ZTest;
		nodeParameter.ZWrite = RendererCommon.ZWrite;
		nodeParameter.Billboard = Billboard;
		nodeParameter.ColorTextureIndex = RingTexture;
		nodeParameter.EffectPointer = GetEffect();
		nodeParameter.IsRightHand = manager->GetCoordinateSystem() ==
			CoordinateSystem::RH;

		nodeParameter.Distortion = RendererCommon.Distortion;
		nodeParameter.DistortionIntensity = RendererCommon.DistortionIntensity;

		nodeParameter.DepthOffset = DepthValues.DepthOffset;
		nodeParameter.IsDepthOffsetScaledWithCamera = DepthValues.IsDepthOffsetScaledWithCamera;
		nodeParameter.IsDepthOffsetScaledWithParticleScale = DepthValues.IsDepthOffsetScaledWithParticleScale;

		renderer->EndRendering( nodeParameter, m_userData );
	}
}
开发者ID:kkllPreciel,项目名称:Effekseer,代码行数:30,代码来源:Effekseer.EffectNodeRing.cpp

示例10: HandleDispel

            void HandleDispel(DispelInfo* dispelInfo)
            {
                if (Unit* target = GetUnitOwner())
                {
                    if (AuraEffect const* aurEff = GetEffect(EFFECT_1))
                    {
                        // final heal
                        int32 healAmount = aurEff->GetAmount();
                        if (Unit* caster = GetCaster())
                        {
                            healAmount = caster->SpellHealingBonusDone(target, GetSpellInfo(), healAmount, HEAL, aurEff->GetSpellEffectInfo(), dispelInfo->GetRemovedCharges());
                            healAmount = target->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, aurEff->GetSpellEffectInfo(), dispelInfo->GetRemovedCharges());
                            target->CastCustomSpell(target, SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());

                            // restore mana
                            std::vector<SpellInfo::CostData> costs = GetSpellInfo()->CalcPowerCost(caster, GetSpellInfo()->GetSchoolMask());
                            auto m = std::find_if(costs.begin(), costs.end(), [](SpellInfo::CostData const& cost) { return cost.Power == POWER_MANA; });
                            if (m != costs.end())
                            {
                                int32 returnMana = m->Amount * dispelInfo->GetRemovedCharges() / 2;
                                caster->CastCustomSpell(caster, SPELL_DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, NULL, GetCasterGUID());
                            }
                            return;
                        }

                        target->CastCustomSpell(target, SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());
                    }
                }
            }
开发者ID:beyourself,项目名称:DeathCore_6.x,代码行数:29,代码来源:spell_druid.cpp

示例11: HitByHook

func HitByHook(hook)
{
	if(!snapped)
		return;
		
	Unstuck();
	snapped = 0;
	var fx = GetEffect("Travel", this);
	RemoveEffect("Travel", this);
	SetAction("Idle");
	
	/*
	var dir;
	if(GetX() > hook->GetX())
		dir = 1;
	else
		dir = -1;*/
		
	var angle = Angle(hook->GetX(), hook->GetY(), GetX(), GetY());
	
	//var angle = fx.angle - 45 * -fx.dir;
	var xdir = Sin(angle, Speed);
	var ydir = -Cos(angle, Speed);
	//var xdir = Cos(angle, Speed);
	//var ydir = Sin(angle, Speed);
	Bounce(xdir, ydir);
}
开发者ID:TheThow,项目名称:OpenClonk-Stuff,代码行数:27,代码来源:Script.c

示例12: CheckForEnemies

func CheckForEnemies(Size)
{
	for(var o in FindObjects(Find_Distance(Size), Find_Func("CanBeHit", this)))
	{
		if(o->GetOwner() == GetOwner() || GetEffect("BallHitCD", o))
			continue;
		
		o->AddBallHitEffect();
		o->Fling(0, -2);
		AddEffect("BallHitCD", o, 1, 15);
		
		var trailparticles =
		{
			Prototype = Particles_ElectroSpark2(),
			Size = PV_Linear(PV_Random(5,15),0),
			BlitMode = GFX_BLIT_Additive,
			Rotation = PV_Random(0,360),
			R = pR,
			G = pG,
			B = pB,
		};
		
		CreateParticle("Lightning", o->GetX() - GetX(), o->GetY() - GetY(), 0, 0, 10, trailparticles, 5);
		
		WeaponDamage(o, SpellDamage);
		Sound("Ball::ball_hit", false, 50);
	}
}
开发者ID:TheThow,项目名称:OpenClonk-Stuff,代码行数:28,代码来源:Script.c

示例13: GetEffect

bool EffectManager::DoEffect(const PluginID & ID,
                             wxWindow *parent,
                             double projectRate,
                             TrackList *list,
                             TrackFactory *factory,
                             SelectedRegion *selectedRegion,
                             bool shouldPrompt /* = true */)

{
   this->SetSkipStateFlag(false);
   Effect *effect = GetEffect(ID);
   
   if (!effect)
   {
      return false;
   }

#if defined(EXPERIMENTAL_EFFECTS_RACK)
   if (effect->SupportsRealtime())
   {
      GetRack()->Add(effect);
   }
#endif

   bool res = effect->DoEffect(parent,
                               projectRate,
                               list,
                               factory,
                               selectedRegion,
                               shouldPrompt);

   return res;
}
开发者ID:Avi2011class,项目名称:audacity,代码行数:33,代码来源:EffectManager.cpp

示例14: GetEffect

void ParticleAttributeEditor::HanldeValueVarianceEditorValueChanged(float average, float variance)
{
    if (updatingWidget_)
        return;

    ParticleEffect2D* effect = GetEffect();
    QObject* s = sender();
    if (s == particleLifeSpanEditor_)
    {
        effect->SetParticleLifeSpan(average);
        effect->SetParticleLifespanVariance(variance);
    }
    else if (s == startSizeEditor_)
    {
        effect->SetStartParticleSize(average);
        effect->SetStartParticleSizeVariance(variance);
    }
    else if (s == finishSizeEditor_)
    {
        effect->SetFinishParticleSize(average);
        effect->SetFinishParticleSizeVariance(variance);
    }
    else if (s == startRotationEditor_)
    {
        effect->SetRotationStart(average);
        effect->SetRotationStartVariance(variance);
    }
    else if (s == finishRotationEditor_)
    {
        effect->SetRotationEnd(average);
        effect->SetRotationEndVariance(variance);
    }
}
开发者ID:Ebiroll,项目名称:ParticleEditor2D,代码行数:33,代码来源:ParticleAttributeEditor.cpp

示例15: GetName

void Layer::SerializeTo(SerializerElement& element) const {
  element.SetAttribute("name", GetName());
  element.SetAttribute("visibility", GetVisibility());

  SerializerElement& camerasElement = element.AddChild("cameras");
  camerasElement.ConsiderAsArrayOf("camera");
  for (std::size_t c = 0; c < GetCameraCount(); ++c) {
    SerializerElement& cameraElement = camerasElement.AddChild("camera");
    cameraElement.SetAttribute("defaultSize", GetCamera(c).UseDefaultSize());
    cameraElement.SetAttribute("width", GetCamera(c).GetWidth());
    cameraElement.SetAttribute("height", GetCamera(c).GetHeight());

    cameraElement.SetAttribute("defaultViewport",
                               GetCamera(c).UseDefaultViewport());
    cameraElement.SetAttribute("viewportLeft", GetCamera(c).GetViewportX1());
    cameraElement.SetAttribute("viewportTop", GetCamera(c).GetViewportY1());
    cameraElement.SetAttribute("viewportRight", GetCamera(c).GetViewportX2());
    cameraElement.SetAttribute("viewportBottom", GetCamera(c).GetViewportY2());
  }

  SerializerElement& effectsElement = element.AddChild("effects");
  effectsElement.ConsiderAsArrayOf("effect");
  for (std::size_t i = 0; i < GetEffectsCount(); ++i) {
    SerializerElement& effectElement = effectsElement.AddChild("effect");
    GetEffect(i).SerializeTo(effectElement);
  }
}
开发者ID:4ian,项目名称:GD,代码行数:27,代码来源:Layer.cpp


注:本文中的GetEffect函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。