Alters the field of view over a period of time
| 2419 | |
| 2420 | // Alters the field of view over a period of time |
| 2421 | void DoFOVEvent(int eventnum, void *data) { |
| 2422 | float *val = (float *)data; |
| 2423 | float new_time = *val; |
| 2424 | float norm = new_time / FOV_CHANGE_TIME; |
| 2425 | |
| 2426 | new_time -= Frametime; |
| 2427 | |
| 2428 | if (new_time < 0) { |
| 2429 | Render_zoom = D3_DEFAULT_ZOOM; |
| 2430 | } else { |
| 2431 | |
| 2432 | float num = (Render_FOV / 2) + (norm * (TARGET_DEGREE - (Render_FOV / 2))); |
| 2433 | num = (3.14 * (float)num / 180.0); |
| 2434 | Render_zoom = tan(num); |
| 2435 | CreateNewEvent(OBJECT_EVENT, FOV_CHANGE_EVENT, 0, &new_time, sizeof(float), DoFOVEvent); |
| 2436 | } |
| 2437 | } |
| 2438 | |
| 2439 | // forces an end to the player death sequence |
| 2440 | void EndPlayerDeath(int slot) { |
no test coverage detected