Frame
(int msec)
| 1420 | * Frame |
| 1421 | */ |
| 1422 | public static void Frame(int msec) { |
| 1423 | extratime += msec; |
| 1424 | |
| 1425 | if (ClientGlobals.cl_timedemo.value == 0.0f) { |
| 1426 | if (ClientGlobals.cls.state == Defines.ca_connected && extratime < 100) { |
| 1427 | return; // don't flood packets out while connecting |
| 1428 | } |
| 1429 | if (extratime < 1000 / ClientGlobals.cl_maxfps.value) { |
| 1430 | return; // framerate is too high |
| 1431 | } |
| 1432 | } |
| 1433 | |
| 1434 | // let the mouse activate or deactivate |
| 1435 | IN.Frame(); |
| 1436 | |
| 1437 | // decide the simulation time |
| 1438 | ClientGlobals.cls.frametime = extratime / 1000.0f; |
| 1439 | ClientGlobals.cl.time += extratime; |
| 1440 | ClientGlobals.cls.realtime = Globals.curtime; |
| 1441 | |
| 1442 | extratime = 0; |
| 1443 | |
| 1444 | if (ClientGlobals.cls.frametime > (1.0f / 5)) |
| 1445 | ClientGlobals.cls.frametime = (1.0f / 5); |
| 1446 | |
| 1447 | // if in the debugger last frame, don't timeout |
| 1448 | if (msec > 5000) |
| 1449 | ClientGlobals.cls.netchan.last_received = Timer.Milliseconds(); |
| 1450 | |
| 1451 | // fetch results from server |
| 1452 | CL_ReadPackets(); |
| 1453 | |
| 1454 | // send a new command message to the server |
| 1455 | SendCommand(); |
| 1456 | |
| 1457 | // predict all unacknowledged movements |
| 1458 | CL_pred.PredictMovement(); |
| 1459 | |
| 1460 | // allow rendering DLL change |
| 1461 | VID.CheckChanges(); |
| 1462 | if (!ClientGlobals.cl.refresh_prepped |
| 1463 | && ClientGlobals.cls.state == Defines.ca_active) { |
| 1464 | CL_view.PrepRefresh(); |
| 1465 | // force GC after level loading |
| 1466 | // but not on playing a cinematic |
| 1467 | if (ClientGlobals.cl.cinematictime == 0) System.gc(); |
| 1468 | } |
| 1469 | |
| 1470 | boolean changed = false; |
| 1471 | |
| 1472 | if (Main.r_worldmodel != null) |
| 1473 | { |
| 1474 | if (numleafs != Main.r_worldmodel.numleafs) |
| 1475 | { |
| 1476 | numleafs = Main.r_worldmodel.numleafs; |
| 1477 | changed = true; |
| 1478 | } |
| 1479 | } |
no test coverage detected