Spawn FOV effect
[voretournament/voretournament.git] / data / qcsrc / client / View.qc
index 164fc95..1ab5b7e 100644 (file)
@@ -255,6 +255,7 @@ float reticle_type;
 float chase_active_old;\r
 float artwork_fade;\r
 float pickup_crosshair_time, pickup_crosshair_size, pickup_flash_time, vore_flash_laststate;\r
+float spawnfov_current;\r
 float myhealth, myhealth_prev, myhealth_flash;\r
 float contentavgalpha, liquidalpha_prev;\r
 float old_blurradius, old_bluralpha, old_sharpen_intensity;\r
@@ -446,6 +447,19 @@ void CSQC_UpdateView(float w, float h)
        vid_conheight = cvar("vid_conheight");\r
        vid_pixelheight = cvar("vid_pixelheight");\r
 \r
+       // spawn fov effect\r
+       if(cvar("cl_spawnfov"))\r
+       {\r
+               if(respawned)\r
+                       spawnfov_current = 1 + cvar("cl_spawnfov");\r
+\r
+               if(spawnfov_current > 1)\r
+                       spawnfov_current -= cvar("cl_spawnfov_speed") * frametime;\r
+               else\r
+                       spawnfov_current = 1;\r
+               fov *= spawnfov_current;\r
+       }\r
+\r
        R_SetView(VF_FOV, GetCurrentFov(fov));\r
 \r
        // Camera for demo playback\r