MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / DoFOVEvent

Function DoFOVEvent

Descent3/Player.cpp:2421–2437  ·  view source on GitHub ↗

Alters the field of view over a period of time

Source from the content-addressed store, hash-verified

2419
2420// Alters the field of view over a period of time
2421void 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
2440void EndPlayerDeath(int slot) {

Callers 1

EndPlayerDeathFunction · 0.85

Calls 1

CreateNewEventFunction · 0.85

Tested by

no test coverage detected