diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-22 10:59:36 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-22 10:59:36 +0000 |
| commit | 2d26c93f052d6fc550c36239753e9e040601314f (patch) | |
| tree | a7ac7a548bffbeef083497b4eb135d8d6c3e84d6 /src/game/client | |
| parent | 918a090329f5632afb6666e913aabed2ef281466 (diff) | |
| download | zcatch-2d26c93f052d6fc550c36239753e9e040601314f.tar.gz zcatch-2d26c93f052d6fc550c36239753e9e040601314f.zip | |
fixed invisible tees problem. increased mouse deadzone from 200 to 300. decreased max camera distance to 200.
Diffstat (limited to 'src/game/client')
| -rw-r--r-- | src/game/client/gc_client.cpp | 2 | ||||
| -rw-r--r-- | src/game/client/gc_hooks.cpp | 8 | ||||
| -rw-r--r-- | src/game/client/gc_render.cpp | 74 | ||||
| -rw-r--r-- | src/game/client/gc_render_obj.cpp | 15 |
4 files changed, 95 insertions, 4 deletions
diff --git a/src/game/client/gc_client.cpp b/src/game/client/gc_client.cpp index 1e1cbd1d..6d97cbb7 100644 --- a/src/game/client/gc_client.cpp +++ b/src/game/client/gc_client.cpp @@ -913,7 +913,7 @@ void render_game() } // - float camera_max_distance = 250.0f; + float camera_max_distance = 200.0f; float deadzone = config.cl_mouse_deadzone; float follow_factor = config.cl_mouse_followfactor/100.0f; float mouse_max = min(camera_max_distance/follow_factor + deadzone, (float)config.cl_mouse_max_distance); diff --git a/src/game/client/gc_hooks.cpp b/src/game/client/gc_hooks.cpp index 2d9a1ba3..5477edd5 100644 --- a/src/game/client/gc_hooks.cpp +++ b/src/game/client/gc_hooks.cpp @@ -573,7 +573,7 @@ extern "C" void modc_message(int msgtype) client_datas[msg->cid].skin_info.color_body = vec4(1,1,1,1); client_datas[msg->cid].skin_info.color_feet = vec4(1,1,1,1); } - + client_datas[msg->cid].update_render_info(); } else if(msgtype == NETMSGTYPE_SV_WEAPON_PICKUP) @@ -637,14 +637,18 @@ extern "C" void modc_connected() for(int i = 0; i < MAX_CLIENTS; i++) { client_datas[i].name[0] = 0; + client_datas[i].skin_id = 0; client_datas[i].team = 0; client_datas[i].emoticon = 0; client_datas[i].emoticon_start = -1; + client_datas[i].skin_info.texture = skin_get(0)->color_texture; + client_datas[i].skin_info.color_body = vec4(1,1,1,1); + client_datas[i].skin_info.color_feet = vec4(1,1,1,1); + client_datas[i].update_render_info(); } for(int i = 0; i < killmsg_max; i++) killmsgs[i].tick = -100000; - send_info(true); } diff --git a/src/game/client/gc_render.cpp b/src/game/client/gc_render.cpp index ccb60810..6541167c 100644 --- a/src/game/client/gc_render.cpp +++ b/src/game/client/gc_render.cpp @@ -478,4 +478,78 @@ void render_world(float center_x, float center_y, float zoom) // render damage indications render_damage_indicators(); + + + + // render screen sizes + if(false) + { + gfx_texture_set(-1); + gfx_lines_begin(); + + float last_points[4]; + float start = 1.0f; //9.0f/16.0f; + float end = 16.0f/9.0f; + const int num_steps = 20; + for(int i = 0; i <= num_steps; i++) + { + float points[4]; + float aspect = start + (end-start)*(i/(float)num_steps); + + mapscreen_to_world( + center_x, center_y, + 1.0f, 1.0f, 0.0f, 0.0f, aspect, 1.0f, points); + + if(i == 0) + { + gfx_lines_draw(points[0], points[1], points[2], points[1]); + gfx_lines_draw(points[0], points[3], points[2], points[3]); + } + + if(i != 0) + { + gfx_lines_draw(points[0], points[1], last_points[0], last_points[1]); + gfx_lines_draw(points[2], points[1], last_points[2], last_points[1]); + gfx_lines_draw(points[0], points[3], last_points[0], last_points[3]); + gfx_lines_draw(points[2], points[3], last_points[2], last_points[3]); + } + + if(i == num_steps) + { + gfx_lines_draw(points[0], points[1], points[0], points[3]); + gfx_lines_draw(points[2], points[1], points[2], points[3]); + } + + mem_copy(last_points, points, sizeof(points)); + } + + if(1) + { + gfx_setcolor(1,0,0,1); + for(int i = 0; i < 2; i++) + { + float points[4]; + float aspects[] = {4.0f/3.0f, 16.0f/10.0f, 5.0f/4.0f, 16.0f/9.0f}; + float aspect = aspects[i]; + + mapscreen_to_world( + center_x, center_y, + 1.0f, 1.0f, 0.0f, 0.0f, aspect, 1.0f, points); + + RECT r; + r.x = points[0]; + r.y = points[1]; + r.w = points[2]-points[0]; + r.h = points[3]-points[1]; + + gfx_lines_draw(r.x, r.y, r.x+r.w, r.y); + gfx_lines_draw(r.x+r.w, r.y, r.x+r.w, r.y+r.h); + gfx_lines_draw(r.x+r.w, r.y+r.h, r.x, r.y+r.h); + gfx_lines_draw(r.x, r.y+r.h, r.x, r.y); + gfx_setcolor(0,1,0,1); + } + } + + gfx_lines_end(); + } } diff --git a/src/game/client/gc_render_obj.cpp b/src/game/client/gc_render_obj.cpp index 450d07d9..b7a8fb84 100644 --- a/src/game/client/gc_render_obj.cpp +++ b/src/game/client/gc_render_obj.cpp @@ -279,6 +279,9 @@ void render_player( NETOBJ_PLAYER_INFO info = *player_info; tee_render_info render_info = client_datas[info.cid].render_info; + + // set size + render_info.size = 64.0f; float intratick = client_intratick(); float ticktime = client_ticktime(); @@ -554,7 +557,9 @@ void render_player( render_tee(&state, &ghost, player.emote, direction, ghost_position); // render ghost } - // render the tee + render_info.size = 64.0f; // force some settings + render_info.color_body.a = 1.0f; + render_info.color_feet.a = 1.0f; render_tee(&state, &render_info, player.emote, direction, position); if(player.player_state == PLAYERSTATE_CHATTING) @@ -610,6 +615,14 @@ void render_player( float tw = gfx_text_width(0, 28.0f, name, -1); gfx_text_color(1,1,1,a); gfx_text(0, position.x-tw/2.0f, position.y-60, 28.0f, name, -1); + + if(config.debug) // render client id when in debug aswell + { + char buf[128]; + str_format(buf, sizeof(buf),"%d", info.cid); + gfx_text(0, position.x, position.y-90, 28.0f, buf, -1); + } + gfx_text_color(1,1,1,1); } } |