From 4f062725e3d2d104a40432b341ae2345ade5cfca Mon Sep 17 00:00:00 2001 From: "chirs241097@gmail.com" Date: Mon, 3 Mar 2014 23:28:31 +0000 Subject: Remove useless statements, and some interface-compatible changes. --- effects.h | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'effects.h') diff --git a/effects.h b/effects.h index 27054b0..ab63cbf 100644 --- a/effects.h +++ b/effects.h @@ -1,7 +1,6 @@ //Chrisoft Bullet Lab Remix HGE //Effects Implementations //Copyright Chrisoft 2014 -#define NO_FREE 1 //static const char* EFFECTS_H_FN="effects.h"; void SCEffect_Attatch() @@ -20,43 +19,37 @@ void SCEffect_Attatch() } bullet[i].exist=true; bullet[i].bullettype=254; - bullet[i].bulletpos.x=playerpos.x; - bullet[i].bulletpos.y=playerpos.y; + bullet[i].bulletpos.x=playerpos.x+3; + bullet[i].bulletpos.y=playerpos.y+3; bullet[i].bulletdir.x=rand()%100-50; bullet[i].bulletdir.y=rand()%100-50; bullet[i].dist=bullet[i].bulletdir.x*bullet[i].bulletdir.x+bullet[i].bulletdir.y*bullet[i].bulletdir.y; bullet[i].dist=sqrt(bullet[i].dist); bullet[i].bulletspeed=rand()%4+2; - //bullet[i].bulletspr=new hgeSprite(SprSheet,96,0,24,24); - //bullet[i].bulletspr->SetColor(0x80FFFFFF); bullet[i].sccolor=0x80FFFFFF; } } void SCEffect_Process(int i) { - //for (int i=1;i<=bulcnt;++i) - //{ - if (!bullet[i].exist||bullet[i].bullettype!=254)return;//If this bullet doesn't exist or is not of this type, do not render it. + if (!bullet[i].exist||bullet[i].bullettype!=254)return; if (!DisablePlayer) { if (LOWFPS) { - bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17;//Process bullet's x coor. - bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17;//Process bullet's y coor. + bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17; + bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17; ++effskp; if (effskp==7) bullet[i].sccolor=bullet[i].sccolor-0x1F000000,effskp=0; } else { - bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;//Process bullet's x coor. - bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;//Process bullet's y coor. + bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20; + bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20; ++effskp; if (effskp==7) bullet[i].sccolor=bullet[i].sccolor-0x1000000,effskp=0; } - //bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;//Process bullet's x coor. - //bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;//Process bullet's y coor. } if (GETA(bullet[i].sccolor)<=0x0A||bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800||bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600) { @@ -65,17 +58,12 @@ void SCEffect_Process(int i) bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; bullet[i].dist=0; bullet[i].bullettype=0; -#ifndef NO_FREE - if (bullet[i].bulletspr)free(bullet[i].bulletspr); -#endif } else { - //bullet[i].bulletspr->RenderEx(bullet[i].bulletpos.x+2.4,bullet[i].bulletpos.y+2.4,0,0.2,0); bulletspr[grey]->SetColor(bullet[i].sccolor); bulletspr[grey]->RenderEx(bullet[i].bulletpos.x+2.4,bullet[i].bulletpos.y+2.4,0,0.2,0); } - //} } void BulletEffect_Attatch(int n) { -- cgit v1.2.3