}
// time
- minutes = cl.time / 60;
- seconds = cl.time - 60*minutes;
+ minutes = (int)(cl.time / 60);
+ seconds = (int)(cl.time - 60*minutes);
tens = seconds / 10;
units = seconds - 10*tens;
sprintf (str,"Time :%3i:%i%i", minutes, tens, units);
if (showfps.integer)
{
float calc;
- if (showfps.integer > 1)
+ static double nexttime = 0, lasttime = 0;
+ static double framerate = 0;
+ static int framecount = 0;
+ double newtime;
+ newtime = Sys_DoubleTime();
+ if (newtime >= nexttime)
{
- static double currtime, frametimes[32];
- double newtime, total;
- int count, i;
- static int framecycle = 0;
-
- newtime = Sys_DoubleTime();
- frametimes[framecycle] = newtime - currtime;
- total = 0;
- count = 0;
- while(total < 0.2 && count < 32 && frametimes[i = (framecycle - count) & 31])
- {
- total += frametimes[i];
- count++;
- }
- framecycle++;
- framecycle &= 31;
- if (showfps.integer == 2)
- calc = (((double)count / total) + 0.5);
- else // showfps 3, rapid update
- calc = ((1.0 / (newtime - currtime)) + 0.5);
- currtime = newtime;
- }
- else
- {
- static double nexttime = 0, lasttime = 0;
- static float framerate = 0;
- static int framecount = 0;
- double newtime;
- newtime = Sys_DoubleTime();
- if (newtime >= nexttime)
- {
- framerate = ((float)framecount / (newtime - lasttime) + 0.5);
- lasttime = newtime;
- nexttime = max(nexttime + 1, lasttime - 1);
- framecount = 0;
- }
- framecount++;
- calc = framerate;
+ framerate = framecount / (newtime - lasttime);
+ lasttime = newtime;
+ nexttime = max(nexttime + 0.1, lasttime - 0.1);
+ framecount = 0;
}
+ framecount++;
+ calc = framerate;
if ((red = (calc < 1.0f)))
dpsnprintf(fpsstring, sizeof(fpsstring), "%4i spf", (int)(1.0f / calc + 0.5));
kickoffset[0] = (v_dmg_time/v_kicktime.value*v_dmg_roll) * 10 * scale;
kickoffset[1] = (v_dmg_time/v_kicktime.value*v_dmg_pitch) * 10 * scale;
}
- sbar_x = (vid_conwidth.integer - 256 * scale)/2 + kickoffset[0];
- sbar_y = (vid_conheight.integer - 256 * scale)/2 + kickoffset[1];
+ sbar_x = (int)((vid_conwidth.integer - 256 * scale)/2 + kickoffset[0]);
+ sbar_y = (int)((vid_conheight.integer - 256 * scale)/2 + kickoffset[1]);
// left1 16, 48 : 126 -66
// left2 16, 128 : 196 -66
// right 176, 48 : 196 -136
{
// show team scores first
for (i = 0;i < teamlines && y < vid_conheight.integer;i++)
- y += Sbar_PrintScoreboardItem((teams + teamsort[i]), x, y);
+ y += (int)Sbar_PrintScoreboardItem((teams + teamsort[i]), x, y);
y += 5;
}
for (i = 0;i < scoreboardlines && y < vid_conheight.integer;i++)
- y += Sbar_PrintScoreboardItem(cl.scores + fragsort[i], x, y);
+ y += (int)Sbar_PrintScoreboardItem(cl.scores + fragsort[i], x, y);
}
/*
if (gamemode == GAME_TRANSFUSION)
{
for (;i < scoreboardlines && x < vid_conwidth.integer;i++)
- x += 128 + Sbar_PrintScoreboardItem(cl.scores + fragsort[i], x, y);
+ x += 128 + (int)Sbar_PrintScoreboardItem(cl.scores + fragsort[i], x, y);
}
else
{
for (;i < scoreboardlines && y < vid_conheight.integer;i++)
- y += Sbar_PrintScoreboardItem(cl.scores + fragsort[i], x, y);
+ y += (int)Sbar_PrintScoreboardItem(cl.scores + fragsort[i], x, y);
}
}
DrawQ_Pic (sbar_x + 0, sbar_y + 56, Draw_CachePic("gfx/inter", true), 0, 0, 1, 1, 1, 1 * sbar_alpha_fg.value, 0);
// time
- dig = cl.completed_time/60;
+ dig = (int)cl.completed_time / 60;
Sbar_DrawNum (160, 64, dig, 3, 0);
- num = cl.completed_time - dig*60;
+ num = (int)cl.completed_time - dig*60;
if (gamemode != GAME_NEXUIZ)
Sbar_DrawPic (234,64,sb_colon);
Sbar_DrawPic (246,64,sb_nums[0][num/10]);