Пример #1
0
//-----------------------------------------------------------------------------
// Updates all currently launched projectiles
void ARX_MISSILES_Update()
{
	TextureContainer * tc = TC_fire; 

	unsigned long tim = (unsigned long)(arxtime);

	for(unsigned long i(0); i < MAX_MISSILES; i++) {
		if(missiles[i].type == MISSILE_NONE)
			continue;

		long framediff = missiles[i].timecreation + missiles[i].tolive - tim;

		if(framediff < 0) {
			ARX_MISSILES_Kill(i);
			continue;
		}

		long framediff3 = tim - missiles[i].timecreation;

		switch(missiles[i].type) {
			case MISSILE_NONE:
			break;
			case MISSILE_FIREBALL: {
				Vec3f pos;

				pos = missiles[i].startpos + missiles[i].velocity * Vec3f(framediff3);

				if(missiles[i].longinfo != -1) {
					DynLight[missiles[i].longinfo].pos = pos;
				}

				Vec3f orgn = missiles[i].lastpos;
				Vec3f dest = pos;
				
				Vec3f tro = Vec3f(70.f);
				
				EERIEPOLY *ep = GetMinPoly(dest.x, dest.y, dest.z);
				EERIEPOLY *epp = GetMaxPoly(dest.x, dest.y, dest.z);

				if(closerThan(player.pos, pos, 200.f)) {
					ARX_MISSILES_Kill(i);
					ARX_BOOMS_Add(&pos);
					Add3DBoom(&pos);
					DoSphericDamage(&dest, 180.0F, 200.0F, DAMAGE_AREAHALF, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_MAGICAL);
					break;
				}

				if(ep && ep->center.y < dest.y) {
					ARX_MISSILES_Kill(i);
					ARX_BOOMS_Add(&dest);
					Add3DBoom(&dest);
					DoSphericDamage(&dest, 180.0F, 200.0F, DAMAGE_AREAHALF, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_MAGICAL);
					break;
				}

				if(epp && epp->center.y > dest.y) {
					ARX_MISSILES_Kill(i);
					ARX_BOOMS_Add(&dest);
					Add3DBoom(&dest);
					DoSphericDamage(&dest, 180.0F, 200.0F, DAMAGE_AREAHALF, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_MAGICAL);
					break;
				}

				Vec3f hit;
				EERIEPOLY *tp = NULL;
				if(EERIELaunchRay3(&orgn, &dest, &hit, tp, 1)) {
					ARX_MISSILES_Kill(i);
					ARX_BOOMS_Add(&hit);
					Add3DBoom(&hit);
					DoSphericDamage(&dest, 180.0F, 200.0F, DAMAGE_AREAHALF, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_MAGICAL);
					break;
				}

				if(!EECheckInPoly(&dest) || EEIsUnderWater(&dest)) {
					ARX_MISSILES_Kill(i);
					ARX_BOOMS_Add(&dest);
					Add3DBoom(&dest);
					DoSphericDamage(&dest, 180.0F, 200.0F, DAMAGE_AREAHALF, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_MAGICAL);
					break;
				}

				long ici = IsCollidingAnyInter(dest.x, dest.y, dest.z, &tro);

				if(ici != -1 && ici != missiles[i].owner) {
					ARX_MISSILES_Kill(i);
					ARX_BOOMS_Add(&dest);
					Add3DBoom(&dest);
					DoSphericDamage(&dest, 180.0F, 200.0F, DAMAGE_AREAHALF, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_MAGICAL);
					break;
				}
				
				PARTICLE_DEF * pd = createParticle();
				if(pd) {
					pd->ov = pos;
					pd->move = missiles[i].velocity;
					pd->move += Vec3f(3.f - 6.f * rnd(), 4.f - 12.f * rnd(), 3.f - 6.f * rnd());
					pd->tolive = Random::get(500, 1000);
					pd->tc = tc;
					pd->siz = 12.f * float(missiles[i].tolive - framediff3) * (1.f / 4000);
					pd->scale = randomVec(15.f, 20.f);
					pd->special = FIRE_TO_SMOKE;
				}
				
				missiles[i].lastpos = pos;
				
				break;
			}
		}

		missiles[i].lastupdate = tim;
	}
}
Пример #2
0
//-----------------------------------------------------------------------------
// Updates all currently launched projectiles
void ARX_MISSILES_Update()
{
	long framediff, framediff2, framediff3;
	EERIE_3D orgn, dest, hit;
	TextureContainer * tc = TC_fire; 
	EERIEPOLY *tp = NULL;
	unsigned long tim = ARXTimeUL();

	for (unsigned long i(0); i < MAX_MISSILES; i++) 
	{
		if (missiles[i].type == MISSILE_NONE) continue;

		framediff = missiles[i].timecreation + missiles[i].tolive - tim;

		if (framediff < 0)
		{
			ARX_MISSILES_Kill(i);
			continue;
		}

		framediff2 = missiles[i].timecreation + missiles[i].tolive - missiles[i].lastupdate;
		framediff3 = tim - missiles[i].timecreation;

		switch (missiles[i].type)
		{
			case MISSILE_FIREBALL :
			{
				EERIE_3D pos;

				pos.x = missiles[i].startpos.x + missiles[i].velocity.x * framediff3;
				pos.y = missiles[i].startpos.y + missiles[i].velocity.y * framediff3;
				pos.z = missiles[i].startpos.z + missiles[i].velocity.z * framediff3;

				if (missiles[i].longinfo != -1)
				{
					DynLight[missiles[i].longinfo].pos.x = pos.x;
					DynLight[missiles[i].longinfo].pos.y = pos.y;
					DynLight[missiles[i].longinfo].pos.z = pos.z;
				}

				if (USE_COLLISIONS) 
				{
					orgn.x = missiles[i].lastpos.x;
					orgn.y = missiles[i].lastpos.y;
					orgn.z = missiles[i].lastpos.z;					
					dest.x = pos.x;
					dest.y = pos.y;
					dest.z = pos.z;					
					
					EERIEPOLY *ep;
					EERIEPOLY *epp;
					EERIE_3D tro;
					tro.x = 70.0F;
					tro.y = 70.0F;
					tro.z = 70.0F;

					CURRENTINTER = NULL;
					ep = GetMinPoly(dest.x, dest.y, dest.z);
					epp = GetMaxPoly(dest.x, dest.y, dest.z);

					if (Distance3D(player.pos.x, player.pos.y, player.pos.z, pos.x, pos.y, pos.z) < 200.0F)
					{
						ARX_MISSILES_Kill(i);
						ARX_BOOMS_Add(&pos);
						Add3DBoom(&pos, NULL);
						DoSphericDamage(&dest, 180.0F, 200.0F, DAMAGE_AREAHALF, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_MAGICAL);
						break;
					}

					if (ep  && ep->center.y < dest.y)
					{
						ARX_MISSILES_Kill(i);
						ARX_BOOMS_Add(&dest);
						Add3DBoom(&dest, NULL);
						DoSphericDamage(&dest, 180.0F, 200.0F, DAMAGE_AREAHALF, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_MAGICAL);
						break;
					}

					if (epp && epp->center.y > dest.y)
					{
						ARX_MISSILES_Kill(i);
						ARX_BOOMS_Add(&dest);
						Add3DBoom(&dest, NULL);
						DoSphericDamage(&dest, 180.0F, 200.0F, DAMAGE_AREAHALF, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_MAGICAL);
						break;
					}

					if (EERIELaunchRay3(&orgn, &dest, &hit, tp, 1))
					{
						ARX_MISSILES_Kill(i);
						ARX_BOOMS_Add(&hit);
						Add3DBoom(&hit, NULL);
						DoSphericDamage(&dest, 180.0F, 200.0F, DAMAGE_AREAHALF, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_MAGICAL);
						break;
					}

					if ( !EECheckInPoly(&dest) || EEIsUnderWaterFast(&dest) ) //ARX: jycorbel (2010-08-20) - rendering issues with bGATI8500: optimize time to render;
					{
						ARX_MISSILES_Kill(i);
						ARX_BOOMS_Add(&dest);
						Add3DBoom(&dest, NULL);
						DoSphericDamage(&dest, 180.0F, 200.0F, DAMAGE_AREAHALF, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_MAGICAL);
						break;
					}

					long ici = IsCollidingAnyInter(dest.x, dest.y, dest.z, &tro);

					if (ici != -1 && ici != missiles[i].owner)
					{
						ARX_MISSILES_Kill(i);
						ARX_BOOMS_Add(&dest);
						Add3DBoom(&dest, NULL);
						DoSphericDamage(&dest, 180.0F, 200.0F, DAMAGE_AREAHALF, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_MAGICAL);
						break;
					}
				}

				long j = ARX_PARTICLES_GetFree();

				if (j != -1 && !ARXPausedTimer)
				{
					ParticleCount++;
					particle[j].exist = TRUE;
					particle[j].zdec = 0;
					particle[j].ov.x = pos.x;
					particle[j].ov.y = pos.y;
					particle[j].ov.z = pos.z;
					particle[j].move.x = missiles[i].velocity.x + 3.0f - 6.0F * rnd();
					particle[j].move.y = missiles[i].velocity.y + 4.0F - 12.0F * rnd();
					particle[j].move.z = missiles[i].velocity.z + 3.0F - 6.0F * rnd();
					particle[j].timcreation = tim;
					particle[j].tolive = 500 + (unsigned long)(rnd() * 500.f);
					particle[j].tc = tc;
					particle[j].siz = 12.0F * (float)(missiles[i].tolive - framediff3) * DIV4000;
					particle[j].scale.x = 15.0F + rnd() * 5.0F;
					particle[j].scale.y = 15.0F + rnd() * 5.0F;
					particle[j].scale.z = 15.0F + rnd() * 5.0F;
					particle[j].special = FIRE_TO_SMOKE;
				}

				missiles[i].lastpos.x = pos.x;
				missiles[i].lastpos.y = pos.y;
				missiles[i].lastpos.z = pos.z;

				break;
			}
		}

		missiles[i].lastupdate = tim;
	}
}
Пример #3
0
//-----------------------------------------------------------------------------
// Updates all currently launched projectiles
void ARX_MISSILES_Update()
{
	long framediff, framediff3;
	Vec3f orgn, dest, hit;
	TextureContainer * tc = TC_fire; 
	EERIEPOLY *tp = NULL;
	unsigned long tim = ARXTimeUL();

	for (unsigned long i(0); i < MAX_MISSILES; i++) 
	{
		if (missiles[i].type == MISSILE_NONE) continue;

		framediff = missiles[i].timecreation + missiles[i].tolive - tim;

		if (framediff < 0)
		{
			ARX_MISSILES_Kill(i);
			continue;
		}

		framediff3 = tim - missiles[i].timecreation;

		switch (missiles[i].type)
		{
			case MISSILE_NONE: break;
			case MISSILE_FIREBALL: {
				Vec3f pos;

				pos = missiles[i].startpos + missiles[i].velocity * framediff3;

				if (missiles[i].longinfo != -1)
				{
					DynLight[missiles[i].longinfo].pos = pos;
				}

#ifdef BUILD_EDITOR
				if (USE_COLLISIONS)
#endif
				{
					orgn = missiles[i].lastpos;
					dest = pos;
					
					EERIEPOLY *ep;
					EERIEPOLY *epp;
					Vec3f tro;
					tro.x = 70.0F;
					tro.y = 70.0F;
					tro.z = 70.0F;

					CURRENTINTER = NULL;
					ep = GetMinPoly(dest.x, dest.y, dest.z);
					epp = GetMaxPoly(dest.x, dest.y, dest.z);

					if(closerThan(player.pos, pos, 200.f)) {
						ARX_MISSILES_Kill(i);
						ARX_BOOMS_Add(&pos);
						Add3DBoom(&pos);
						DoSphericDamage(&dest, 180.0F, 200.0F, DAMAGE_AREAHALF, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_MAGICAL);
						break;
					}

					if (ep  && ep->center.y < dest.y)
					{
						ARX_MISSILES_Kill(i);
						ARX_BOOMS_Add(&dest);
						Add3DBoom(&dest);
						DoSphericDamage(&dest, 180.0F, 200.0F, DAMAGE_AREAHALF, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_MAGICAL);
						break;
					}

					if (epp && epp->center.y > dest.y)
					{
						ARX_MISSILES_Kill(i);
						ARX_BOOMS_Add(&dest);
						Add3DBoom(&dest);
						DoSphericDamage(&dest, 180.0F, 200.0F, DAMAGE_AREAHALF, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_MAGICAL);
						break;
					}

					if (EERIELaunchRay3(&orgn, &dest, &hit, tp, 1))
					{
						ARX_MISSILES_Kill(i);
						ARX_BOOMS_Add(&hit);
						Add3DBoom(&hit);
						DoSphericDamage(&dest, 180.0F, 200.0F, DAMAGE_AREAHALF, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_MAGICAL);
						break;
					}

					if ( !EECheckInPoly(&dest) || EEIsUnderWater(&dest) )
					{
						ARX_MISSILES_Kill(i);
						ARX_BOOMS_Add(&dest);
						Add3DBoom(&dest);
						DoSphericDamage(&dest, 180.0F, 200.0F, DAMAGE_AREAHALF, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_MAGICAL);
						break;
					}

					long ici = IsCollidingAnyInter(dest.x, dest.y, dest.z, &tro);

					if (ici != -1 && ici != missiles[i].owner)
					{
						ARX_MISSILES_Kill(i);
						ARX_BOOMS_Add(&dest);
						Add3DBoom(&dest);
						DoSphericDamage(&dest, 180.0F, 200.0F, DAMAGE_AREAHALF, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_MAGICAL);
						break;
					}
				}

				long j = ARX_PARTICLES_GetFree();

				if (j != -1 && !ARXPausedTimer)
				{
					ParticleCount++;
					particle[j].exist = true;
					particle[j].zdec = 0;
					particle[j].ov.x = pos.x;
					particle[j].ov.y = pos.y;
					particle[j].ov.z = pos.z;
					particle[j].move.x = missiles[i].velocity.x + 3.0f - 6.0F * rnd();
					particle[j].move.y = missiles[i].velocity.y + 4.0F - 12.0F * rnd();
					particle[j].move.z = missiles[i].velocity.z + 3.0F - 6.0F * rnd();
					particle[j].timcreation = tim;
					particle[j].tolive = 500 + (unsigned long)(rnd() * 500.f);
					particle[j].tc = tc;
					particle[j].siz = 12.0F * (float)(missiles[i].tolive - framediff3) * ( 1.0f / 4000 );
					particle[j].scale.x = 15.0F + rnd() * 5.0F;
					particle[j].scale.y = 15.0F + rnd() * 5.0F;
					particle[j].scale.z = 15.0F + rnd() * 5.0F;
					particle[j].special = FIRE_TO_SMOKE;
				}

				missiles[i].lastpos.x = pos.x;
				missiles[i].lastpos.y = pos.y;
				missiles[i].lastpos.z = pos.z;

				break;
			}
		}

		missiles[i].lastupdate = tim;
	}
}
Пример #4
0
//***********************************************************************************************
// hum... to be checked again for performance and result quality.
//-----------------------------------------------------------------------------------------------
// VERIFIED (Cyril 2001/10/15)
//***********************************************************************************************
void ARXDRAW_DrawInterShadows(LPDIRECT3DDEVICE7 pd3dDevice)
{	
	bool bNoVB						=	false;
	if( bSoftRender )
	{
		bNoVB						=	GET_FORCE_NO_VB();
		SET_FORCE_NO_VB( true );
	}

	GDevice->SetRenderState(D3DRENDERSTATE_FOGCOLOR,0);
	SetZBias(pd3dDevice,1);

	long k;
	long first=1;
	
	for (long i=0;i<TREATZONE_CUR;i++) 
	{
		if ((treatio[i].show!=1) || (treatio[i].io==NULL)) continue;

		INTERACTIVE_OBJ * io=treatio[i].io;

		if (	(!io->obj) 
			||	(io->ioflags & IO_JUST_COLLIDE)	)
		{
			continue;
		}

			if ((Project.hide & HIDE_NPC) &&  (io->ioflags & IO_NPC)) continue;

			if ((Project.hide & HIDE_ITEMS) &&  (io->ioflags & IO_ITEM)) continue;

			if ((Project.hide & HIDE_FIXINTER) && (io->ioflags & IO_FIX)) continue;

			long xx,yy;
			F2L((io->pos.x)*ACTIVEBKG->Xmul,&xx);
			F2L((io->pos.z)*ACTIVEBKG->Zmul,&yy);

			if ( (xx>=1) && (yy>=1) && (xx<ACTIVEBKG->Xsize-1) && (yy<ACTIVEBKG->Zsize-1) )
			{
				FAST_BKG_DATA * feg=(FAST_BKG_DATA *)&ACTIVEBKG->fastdata[xx][yy];

				if(!feg->treat) continue;
			}

			if (!( io->ioflags & IO_NOSHADOW ) )
			if ( io->show==SHOW_FLAG_IN_SCENE ) 
			if ( !(io->ioflags & IO_GOLD) ) 
			{
				register EERIEPOLY * ep;
				D3DTLVERTEX in;			
				
				D3DTLVERTEX ltv[4];
				ltv[0]=	D3DTLVERTEX( D3DVECTOR( 0, 0, 0.001f ), 1.f, 0, 1, 0.3f, 0.3f) ;
				ltv[1]=	D3DTLVERTEX( D3DVECTOR( 0, 0, 0.001f ), 1.f, 0, 1, 0.7f, 0.3f) ;
				ltv[2]=	D3DTLVERTEX( D3DVECTOR( 0, 0, 0.001f ), 1.f, 0, 1, 0.7f, 0.7f) ;		
				ltv[3]=	D3DTLVERTEX( D3DVECTOR( 0, 0, 0.001f ), 1.f, 0, 1, 0.3f, 0.7f) ;
				
				float s1=16.f*io->scale;
				float s2=s1 * DIV2;	

				if (io->obj->nbgroups<=1)
				{
					for (k=0;k<io->obj->nbvertex;k+=9)
					{
						ep=EECheckInPoly(&io->obj->vertexlist3[k].v);

						if (ep!=NULL)
						{
							in.sy=ep->min.y-3.f;
							float r=0.5f-((float)EEfabs(io->obj->vertexlist3[k].v.y-in.sy))*DIV500;
							r-=io->invisibility;
							r*=io->scale;

							if (r<=0.f) continue;
							
							in.sx=io->obj->vertexlist3[k].v.x-s2;						
							in.sz=io->obj->vertexlist3[k].v.z-s2;

							long lv;
							r*=255.f;
							F2L(r,&lv);
							ltv[0].color=ltv[1].color=ltv[2].color=ltv[3].color=0xFF000000 | lv<<16 | lv<<8 | lv;
							
							if (first)
							{
								first=0;
								SETZWRITE(pd3dDevice, FALSE );
								SETBLENDMODE(pd3dDevice,D3DBLEND_ZERO,D3DBLEND_INVSRCCOLOR);
								SETALPHABLEND(pd3dDevice,TRUE);
								SETTC(pd3dDevice,Boom);
							}

							EE_RT2(&in,&ltv[0]);
							in.sx+=s1;
							EE_RT2(&in,&ltv[1]);
							in.sz+=s1;
							EE_RT2(&in,&ltv[2]);
							in.sx-=s1;
							EE_RT2(&in,&ltv[3]);

							if ((ltv[0].sz>0.f) && (ltv[1].sz>0.f) && (ltv[2].sz>0.f))
							{
								ARX_DrawPrimitive_SoftClippZ(	&ltv[0],
															&ltv[1],
															&ltv[2],
															50.f);
								ARX_DrawPrimitive_SoftClippZ(	&ltv[0],
															&ltv[2],
															&ltv[3],
															50.f);
							}
						}
					}	
				}
				else 
				{
					for (k=0;k<io->obj->nbgroups;k++)
					{
						long origin=io->obj->grouplist[k].origin;
						ep=EECheckInPoly(	&io->obj->vertexlist3[origin].v );

						if (ep!=NULL)
						{
							in.sy=ep->min.y-3.f;
							float r=0.8f-((float)EEfabs(io->obj->vertexlist3[origin].v.y-in.sy))*DIV500;
							r*=io->obj->grouplist[k].siz;
							r-=io->invisibility;

							if (r<=0.f) continue;

							float s1=io->obj->grouplist[k].siz*44.f;
							float s2=s1*DIV2;
							in.sx=io->obj->vertexlist3[origin].v.x-s2;						
							in.sz=io->obj->vertexlist3[origin].v.z-s2;

							long lv;
							r*=255.f;
							F2L(r,&lv);						
							ltv[0].color=	ltv[1].color	=	ltv[2].color	=	ltv[3].color	=	0xFF000000 | lv<<16 | lv<<8 | lv;

							if (first)
							{
								first=0;
								SETZWRITE(pd3dDevice, FALSE );
								SETBLENDMODE(pd3dDevice,D3DBLEND_ZERO,D3DBLEND_INVSRCCOLOR);
								SETALPHABLEND(pd3dDevice,TRUE);
								SETTC(pd3dDevice,Boom);
							}

							EE_RT2(&in,&ltv[0]);
							in.sx+=s1;
							EE_RT2(&in,&ltv[1]);
							in.sz+=s1;
							EE_RT2(&in,&ltv[2]);
							in.sx-=s1;
							EE_RT2(&in,&ltv[3]);
							ARX_DrawPrimitive_SoftClippZ(	&ltv[0],
															&ltv[1],
															&ltv[2],
															50.f);
							ARX_DrawPrimitive_SoftClippZ(	&ltv[0],
															&ltv[2],
															&ltv[3],
															50.f);
						}
					}
				}
			}
		
		}

	SETALPHABLEND(pd3dDevice,FALSE);
	SETZWRITE(pd3dDevice, TRUE );
	SetZBias(pd3dDevice,0);
	GDevice->SetRenderState(D3DRENDERSTATE_FOGCOLOR,ulBKGColor);
	
	if( bSoftRender ) SET_FORCE_NO_VB( bNoVB );
}
Пример #5
0
void ARXDRAW_DrawInterShadows()
{	
	GRenderer->SetFogColor(Color::none);
	SetZBias(1);

	long first=1;
	
	for(long i=0; i<TREATZONE_CUR; i++) {
		if(treatio[i].show != 1 || !treatio[i].io)
			continue;

		Entity *io = treatio[i].io;

		if(!io->obj || (io->ioflags & IO_JUST_COLLIDE))
			continue;


		FAST_BKG_DATA * bkgData = getFastBackgroundData(io->pos.x, io->pos.z);
		if(bkgData && !bkgData->treat) { //TODO is that correct ?
			continue;
		}

		if(!(io->ioflags & IO_NOSHADOW) && io->show==SHOW_FLAG_IN_SCENE && !(io->ioflags & IO_GOLD)) {
			TexturedVertex in;

			TexturedVertex ltv[4];
			ltv[0] = TexturedVertex(Vec3f(0, 0, 0.001f), 1.f, 0, 1, Vec2f(0.3f, 0.3f));
			ltv[1] = TexturedVertex(Vec3f(0, 0, 0.001f), 1.f, 0, 1, Vec2f(0.7f, 0.3f));
			ltv[2] = TexturedVertex(Vec3f(0, 0, 0.001f), 1.f, 0, 1, Vec2f(0.7f, 0.7f));
			ltv[3] = TexturedVertex(Vec3f(0, 0, 0.001f), 1.f, 0, 1, Vec2f(0.3f, 0.7f));

			if(io->obj->nbgroups <= 1) {
				for(size_t k=0; k < io->obj->vertexlist.size(); k += 9) {
					EERIEPOLY *ep = EECheckInPoly(&io->obj->vertexlist3[k].v);

					if(ep) {
						in.p.y=ep->min.y-3.f;
						float r=0.5f-((float)EEfabs(io->obj->vertexlist3[k].v.y-in.p.y))*( 1.0f / 500 );
						r-=io->invisibility;
						r*=io->scale;

						if(r<=0.f)
							continue;

						float s1=16.f*io->scale;
						float s2=s1*( 1.0f / 2 );
						in.p.x=io->obj->vertexlist3[k].v.x-s2;
						in.p.z=io->obj->vertexlist3[k].v.z-s2;

						r*=255.f;
						long lv = r;
						ltv[0].color=ltv[1].color=ltv[2].color=ltv[3].color=0xFF000000 | lv<<16 | lv<<8 | lv;

						if(first) {
							first=0;
							GRenderer->SetRenderState(Renderer::DepthWrite, false);
							GRenderer->SetBlendFunc(Renderer::BlendZero, Renderer::BlendInvSrcColor);
							GRenderer->SetRenderState(Renderer::AlphaBlending, true);
							GRenderer->SetTexture(0, Boom);
						}

						EE_RT2(&in,&ltv[0]);
						in.p.x+=s1;
						EE_RT2(&in,&ltv[1]);
						in.p.z+=s1;
						EE_RT2(&in,&ltv[2]);
						in.p.x-=s1;
						EE_RT2(&in,&ltv[3]);

						if(ltv[0].p.z > 0.f && ltv[1].p.z > 0.f && ltv[2].p.z > 0.f) {
							ARX_DrawPrimitive(&ltv[0], &ltv[1], &ltv[2], 50.0f);
							ARX_DrawPrimitive(&ltv[0], &ltv[2], &ltv[3], 50.0f);
						}
					}
				}
			} else {
				for(long k = 0; k < io->obj->nbgroups; k++) {
					long origin=io->obj->grouplist[k].origin;
					EERIEPOLY *ep = EECheckInPoly(&io->obj->vertexlist3[origin].v);

					if(ep) {
						in.p.y=ep->min.y-3.f;
						float r=0.8f-((float)EEfabs(io->obj->vertexlist3[origin].v.y-in.p.y))*( 1.0f / 500 );
						r*=io->obj->grouplist[k].siz;
						r-=io->invisibility;

						if(r<=0.f)
							continue;

						float s1=io->obj->grouplist[k].siz*44.f;
						float s2=s1*( 1.0f / 2 );
						in.p.x=io->obj->vertexlist3[origin].v.x-s2;
						in.p.z=io->obj->vertexlist3[origin].v.z-s2;

						r*=255.f;
						long lv = r;
						ltv[0].color=ltv[1].color=ltv[2].color=ltv[3].color=0xFF000000 | lv<<16 | lv<<8 | lv;

						if(first) {
							first=0;
							GRenderer->SetRenderState(Renderer::DepthWrite, false);
							GRenderer->SetBlendFunc(Renderer::BlendZero, Renderer::BlendInvSrcColor);
							GRenderer->SetRenderState(Renderer::AlphaBlending, true);
							GRenderer->SetTexture(0, Boom);
						}

						EE_RT2(&in,&ltv[0]);
						in.p.x+=s1;
						EE_RT2(&in,&ltv[1]);
						in.p.z+=s1;
						EE_RT2(&in,&ltv[2]);
						in.p.x-=s1;
						EE_RT2(&in,&ltv[3]);

						ARX_DrawPrimitive(&ltv[0], &ltv[1], &ltv[2]);
						ARX_DrawPrimitive(&ltv[0], &ltv[2], &ltv[3]);
					}
				}
			}
		}

	}

	GRenderer->SetRenderState(Renderer::AlphaBlending, false);
	GRenderer->SetRenderState(Renderer::DepthWrite, true);
	SetZBias(0);
	GRenderer->SetFogColor(ulBKGColor);
}