]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Spawn FOV effect
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 13 Jul 2011 16:41:34 +0000 (19:41 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 13 Jul 2011 16:41:34 +0000 (19:41 +0300)
data/defaultVT.cfg
data/qcsrc/client/View.qc

index 08db8645ec3dabe94ea6ca6be6d7640a5aafedc1..7d926714ef10493265156008b6f16ca38e1855ab 100644 (file)
@@ -144,6 +144,8 @@ seta cl_flash_vore_color_prey "1 0 0" "color of the vore flash for prey"
 seta cl_flash_vore_color_pred "0 1 0" "color of the vore flash for predators"\r
 seta cl_flash_respawn 0.25 "if enabled, the screen flashes by this amount when picking up an item"\r
 seta cl_flash_respawn_color "1 1 1" "color of the pickup flash"\r
+seta cl_spawnfov 0.5 "the field of view starts zoomed out by this amount when you spawn"\r
+seta cl_spawnfov_speed 1 "the fov fades back to normal at this speed"\r
 fov 90\r
 seta cl_velocityzoom -0.2      "velocity based zooming of fov, negative values zoom out"\r
 seta cl_velocityzoomtime 0.3   "time value for averaging speed values"\r
index 164fc9516b53c2ccc2027a76a132b731e2afb4c3..1ab5b7ea3b1ff0b4d4ff7ba0203c8455c7b60f09 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