about summary refs log tree commit diff
path: root/src/game
diff options
context:
space:
mode:
authorJakob Fries <jakob.fries@gmail.com>2007-08-15 15:29:28 +0000
committerJakob Fries <jakob.fries@gmail.com>2007-08-15 15:29:28 +0000
commit1eecd590d0f9789c9932f6c3460415300bf5fa17 (patch)
tree6ce5d95205b2a8eced369f9c17d5bf4ed2e58a2a /src/game
parentabf072901507d0f6565714f2cf9255460d59056c (diff)
downloadzcatch-1eecd590d0f9789c9932f6c3460415300bf5fa17.tar.gz
zcatch-1eecd590d0f9789c9932f6c3460415300bf5fa17.zip
further improved emoticon selector
Diffstat (limited to 'src/game')
-rw-r--r--src/game/client/game_client.cpp35
1 files changed, 33 insertions, 2 deletions
diff --git a/src/game/client/game_client.cpp b/src/game/client/game_client.cpp
index 8479f4a7..0e2e439d 100644
--- a/src/game/client/game_client.cpp
+++ b/src/game/client/game_client.cpp
@@ -998,6 +998,29 @@ static void render_tee(animstate *anim, int skin, int emote, vec2 dir, vec2 pos)
 	gfx_quads_end();	
 }
 
+void draw_circle(float x, float y, float r, int segments)
+{
+	float f_segments = (float)segments;
+	for(int i = 0; i < segments; i+=2)
+	{
+		float a1 = i/f_segments * 2*pi;
+		float a2 = (i+1)/f_segments * 2*pi;
+		float a3 = (i+2)/f_segments * 2*pi;
+		float ca1 = cosf(a1);
+		float ca2 = cosf(a2);
+		float ca3 = cosf(a3);
+		float sa1 = sinf(a1);
+		float sa2 = sinf(a2);
+		float sa3 = sinf(a3);
+		
+		gfx_quads_draw_freeform(
+			x, y,
+			x+ca1*r, y+sa1*r,
+			x+ca3*r, y+sa3*r,
+			x+ca2*r, y+sa2*r);
+	}
+}
+
 void draw_round_rect(float x, float y, float w, float h, float r)
 {
 	int num = 8;
@@ -1340,8 +1363,8 @@ int emoticon_selector_render()
 	emoticon_selector_mouse.x += x;
 	emoticon_selector_mouse.y += y;
 
-	if (length(emoticon_selector_mouse) > 60)
-		emoticon_selector_mouse = normalize(emoticon_selector_mouse) * 60;
+	if (length(emoticon_selector_mouse) > 70)
+		emoticon_selector_mouse = normalize(emoticon_selector_mouse) * 70;
 
 	float selected_angle = get_angle(emoticon_selector_mouse);
 	if (selected_angle > pi)
@@ -1365,6 +1388,14 @@ int emoticon_selector_render()
 
 	gfx_mapscreen(0,0,400,300);
 
+	gfx_blend_normal();
+	
+	gfx_texture_set(-1);
+	gfx_quads_begin();
+	gfx_quads_setcolor(0,0,0,0.3f);
+	draw_circle(200, 150, 80, 64);
+	gfx_quads_end();
+
 	gfx_texture_set(data->images[IMAGE_EMOTICONS].id);
 	gfx_quads_begin();