| 1265 | |
| 1266 | |
| 1267 | int Com_ModifyMsec( int msec, float &fraction ) |
| 1268 | { |
| 1269 | int clampTime; |
| 1270 | |
| 1271 | fraction=0.0f; |
| 1272 | |
| 1273 | // |
| 1274 | // modify time for debugging values |
| 1275 | // |
| 1276 | if ( com_fixedtime->integer ) |
| 1277 | { |
| 1278 | msec = com_fixedtime->integer; |
| 1279 | } |
| 1280 | else if ( com_timescale->value ) |
| 1281 | { |
| 1282 | fraction=(float)msec; |
| 1283 | fraction*=com_timescale->value; |
| 1284 | msec=(int)floor(fraction); |
| 1285 | fraction-=(float)msec; |
| 1286 | } |
| 1287 | |
| 1288 | // don't let it scale below 1 msec |
| 1289 | if ( msec < 1 ) |
| 1290 | { |
| 1291 | msec = 1; |
| 1292 | fraction=0.0f; |
| 1293 | } |
| 1294 | |
| 1295 | if ( com_skippingcin->integer ) { |
| 1296 | // we're skipping ahead so let it go a bit faster |
| 1297 | clampTime = 500; |
| 1298 | } else { |
| 1299 | // for local single player gaming |
| 1300 | // we may want to clamp the time to prevent players from |
| 1301 | // flying off edges when something hitches. |
| 1302 | clampTime = 200; |
| 1303 | } |
| 1304 | |
| 1305 | if ( msec > clampTime ) { |
| 1306 | msec = clampTime; |
| 1307 | fraction=0.0f; |
| 1308 | } |
| 1309 | |
| 1310 | return msec; |
| 1311 | } |
| 1312 | |
| 1313 | /* |
| 1314 | ================= |