about summary refs log tree commit diff
path: root/src/game/client/gc_effects.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/client/gc_effects.cpp')
-rw-r--r--src/game/client/gc_effects.cpp39
1 files changed, 24 insertions, 15 deletions
diff --git a/src/game/client/gc_effects.cpp b/src/game/client/gc_effects.cpp
index 387e1471..f8c4e2c8 100644
--- a/src/game/client/gc_effects.cpp
+++ b/src/game/client/gc_effects.cpp
@@ -1,8 +1,13 @@
 #include <engine/e_client_interface.h>
 #include "gc_client.hpp"
-#include "gc_skin.hpp"
 #include "../generated/gc_data.hpp"
 
+#include "components/particles.hpp"
+#include "components/skins.hpp"
+#include "components/flow.hpp"
+#include "components/damageind.hpp"
+#include "gameclient.hpp"
+
 static bool add_50hz = false;
 static bool add_100hz = false;
 
@@ -21,10 +26,15 @@ void effect_air_jump(vec2 pos)
 	p.gravity = 500;
 	p.friction = 0.7f;
 	p.flow_affected = 0.0f;
-	particle_add(PARTGROUP_GENERAL, &p);
+	gameclient.particles->add(PARTICLES::GROUP_GENERAL, &p);
 
 	p.pos = pos + vec2(6.0f, 16.0f);
-	particle_add(PARTGROUP_GENERAL, &p);
+	gameclient.particles->add(PARTICLES::GROUP_GENERAL, &p);
+}
+
+void effect_damage_indicator(vec2 pos, vec2 dir)
+{
+	gameclient.damageind->create(pos, dir);
 }
 
 void effect_powerupshine(vec2 pos, vec2 size)
@@ -45,7 +55,7 @@ void effect_powerupshine(vec2 pos, vec2 size)
 	p.gravity = 500;
 	p.friction = 0.9f;
 	p.flow_affected = 0.0f;
-	particle_add(PARTGROUP_GENERAL, &p);
+	gameclient.particles->add(PARTICLES::GROUP_GENERAL, &p);
 }
 
 void effect_smoketrail(vec2 pos, vec2 vel)
@@ -63,7 +73,7 @@ void effect_smoketrail(vec2 pos, vec2 vel)
 	p.end_size = 0;
 	p.friction = 0.7;
 	p.gravity = frandom()*-500.0f;
-	particle_add(PARTGROUP_PROJECTILE_TRAIL, &p);
+	gameclient.particles->add(PARTICLES::GROUP_PROJECTILE_TRAIL, &p);
 }
 
 
@@ -83,7 +93,7 @@ void effect_skidtrail(vec2 pos, vec2 vel)
 	p.friction = 0.7f;
 	p.gravity = frandom()*-500.0f;
 	p.color = vec4(0.75f,0.75f,0.75f,1.0f);
-	particle_add(PARTGROUP_GENERAL, &p);	
+	gameclient.particles->add(PARTICLES::GROUP_GENERAL, &p);	
 }
 
 void effect_bullettrail(vec2 pos)
@@ -99,7 +109,7 @@ void effect_bullettrail(vec2 pos)
 	p.start_size = 8.0f;
 	p.end_size = 0;
 	p.friction = 0.7f;
-	particle_add(PARTGROUP_PROJECTILE_TRAIL, &p);
+	gameclient.particles->add(PARTICLES::GROUP_PROJECTILE_TRAIL, &p);
 }
 
 void effect_playerspawn(vec2 pos)
@@ -119,7 +129,7 @@ void effect_playerspawn(vec2 pos)
 		p.gravity = frandom()*-400.0f;
 		p.friction = 0.7f;
 		p.color = vec4(0xb5/255.0f, 0x50/255.0f, 0xcb/255.0f, 1.0f);
-		particle_add(PARTGROUP_GENERAL, &p);
+		gameclient.particles->add(PARTICLES::GROUP_GENERAL, &p);
 		
 	}
 }
@@ -130,7 +140,7 @@ void effect_playerdeath(vec2 pos, int cid)
 
 	if(cid >= 0)	
 	{
-		const skin *s = skin_get(client_datas[cid].skin_id);
+		const SKINS::SKIN *s = gameclient.skins->get(gameclient.clients[cid].skin_id);
 		if(s)
 			blood_color = s->blood_color;
 	}
@@ -151,7 +161,7 @@ void effect_playerdeath(vec2 pos, int cid)
 		p.friction = 0.8f;
 		vec3 c = blood_color * (0.75f + frandom()*0.25f);
 		p.color = vec4(c.r, c.g, c.b, 0.75f);
-		particle_add(PARTGROUP_GENERAL, &p);
+		gameclient.particles->add(PARTICLES::GROUP_GENERAL, &p);
 	}
 }
 
@@ -166,7 +176,7 @@ void effect_explosion(vec2 pos)
 				continue;
 			
 			float a = 1 - (length(vec2(x,y)) / length(vec2(8,8)));
-			flow_add(pos+vec2(x,y)*16, normalize(vec2(x,y))*5000.0f*a, 10.0f);
+			gameclient.flow->add(pos+vec2(x,y)*16, normalize(vec2(x,y))*5000.0f*a, 10.0f);
 		}
 		
 	// add the explosion
@@ -178,7 +188,7 @@ void effect_explosion(vec2 pos)
 	p.start_size = 150.0f;
 	p.end_size = 0;
 	p.rot = frandom()*pi*2;
-	particle_add(PARTGROUP_EXPLOSIONS, &p);
+	gameclient.particles->add(PARTICLES::GROUP_EXPLOSIONS, &p);
 	
 	// add the smoke
 	for(int i = 0; i < 24; i++)
@@ -194,7 +204,7 @@ void effect_explosion(vec2 pos)
 		p.gravity = frandom()*-800.0f;
 		p.friction = 0.4f;
 		p.color = mix(vec4(0.75f,0.75f,0.75f,1.0f), vec4(0.5f,0.5f,0.5f,1.0f), frandom());
-		particle_add(PARTGROUP_GENERAL, &p);
+		gameclient.particles->add(PARTICLES::GROUP_GENERAL, &p);
 	}
 }
 
@@ -220,6 +230,5 @@ void effects_update()
 		add_50hz = false;
 		
 	if(add_50hz)
-		flow_update();
-		
+		gameclient.flow->update();
 }