fixed invisible tees problem. increased mouse deadzone from 200 to 300. decreased max camera distance to 200.

This commit is contained in:
Magnus Auvinen 2008-03-22 10:59:36 +00:00
parent 918a090329
commit 2d26c93f05
5 changed files with 96 additions and 5 deletions

View file

@ -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);

View file

@ -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);
}

View file

@ -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();
}
}

View file

@ -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);
}
}

View file

@ -10,7 +10,7 @@ MACRO_CONFIG_INT(cl_showfps, 0, 0, 1)
MACRO_CONFIG_INT(cl_warning_tuning, 1, 0, 1)
MACRO_CONFIG_INT(cl_mouse_deadzone, 200, 0, 0)
MACRO_CONFIG_INT(cl_mouse_deadzone, 300, 0, 0)
MACRO_CONFIG_INT(cl_mouse_followfactor, 60, 0, 200)
MACRO_CONFIG_INT(cl_mouse_max_distance, 800, 0, 0)