• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetEffect函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Attach2

global func Attach2(object pObj, object pTarget) {
	// Kein Objekt vorhanden oder schon irgendwo attached?
	if (!pObj || !pTarget && !(pTarget = this) || GetEffect("Attach", pTarget))
		return;
	
	return AddEffect("Attach", pTarget, 1, 1, 0, 0, pObj);
}
开发者ID:lluchs,项目名称:Luftherrschaft,代码行数:7,代码来源:Attach.c


示例17: FxIntCyclopsAITimer

global func FxIntCyclopsAITimer(object cyclops, proplist fx, int time)
{
	if (!fx.cyclops)
	{
		fx.cyclops = cyclops;
		fx.weapon = cyclops->FindContents(Club);
	}
	if (!fx.eye) fx.eye = FindObject(Find_ID(CyclopsEye));

	fx.time = time;
	
	// do not idle
	var effect = GetEffect("IntWalk", fx.cyclops);
	if (effect) effect.idle_time = 0;
	
	fx.eye->SetPosition(fx.cyclops->GetX() -4 + fx.cyclops->GetDir() * 8, fx.cyclops->GetY() - 19);

	// Find an enemy
	if (fx.target) if (!fx.target->GetAlive() || (!fx.ranged && ObjectDistance(fx.target) >= fx.max_aggro_distance)) fx.target = nil;
	if (!fx.target)
	{
		if (!(fx.target = CyclopsFindTarget(fx))) return CyclopsExecuteIdle(fx);
	}

	// Attack it!
	return CyclopsExecuteMelee(fx, time);
}
开发者ID:gitMarky,项目名称:Shire.ocs,代码行数:27,代码来源:Cyclops.c


示例18: AddCyclopsAI

global func AddCyclopsAI(object clonk) // somewhat hacky, but it works
{
	var effect_name = "IntCyclopsAI";
	var fx = GetEffect(effect_name, clonk);
	if (!fx) fx = AddEffect(effect_name, clonk, 1, 2);
	if (!fx || !clonk) return nil;
	
	clonk.ai = fx;

	// bin inventory
	var cnt = clonk->ContentsCount();
	fx.bound_weapons = CreateArray(cnt);
	for (var i=0; i<cnt; ++i) fx.bound_weapons[i] = clonk->Contents(i);

	// set home
	fx.home_x = clonk->GetX();
	fx.home_y = clonk->GetY();
	fx.home_dir = DIR_Left;

	// set guard range
	fx.guard_range = {
                      x = fx.home_x-AI_DefGuardRangeX,
                      y = fx.home_y-AI_DefGuardRangeY,
                      wdt = AI_DefGuardRangeX*2,
                      hgt =  AI_DefGuardRangeY*2};
                      

	fx.spray_old = {time = 0, v0 = 0, v1 = 0, reach = 0};
	fx.spray_cur = {time = 0, v0 = 0, v1 = 0, reach = 0};

	AI->SetMaxAggroDistance(clonk, AI_DefMaxAggroDistance);
	return fx;
}
开发者ID:gitMarky,项目名称:Shire.ocs,代码行数:33,代码来源:Cyclops.c


示例19: FxLifeStop

func FxLifeStop()
{
	if(!GetEffect("Pull", this))
	{
		AddEffect("Comeback", this, 1, 1, this);
	}
}
开发者ID:MDT-Maikel,项目名称:Knueppeln-Mod,代码行数:7,代码来源:Script.c


示例20: SetMaxAggroDistance

// Set the maximum distance the enemy will follow an attacking Clonk
func SetMaxAggroDistance(object clonk, int max_dist)
{
	var fx = GetEffect("S2AI", clonk);
	if (!fx || !clonk) return false;
	fx.max_aggro_distance = max_dist;
	return true;
}
开发者ID:Meowtimer,项目名称:openclonk,代码行数:8,代码来源:Script.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetEffectValue函数代码示例发布时间:2022-05-30
下一篇:
C++ GetEditorMode函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap