]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Artwork fading effect
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 26 Sep 2010 14:19:31 +0000 (17:19 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 26 Sep 2010 14:19:31 +0000 (17:19 +0300)
data/defaultVoretournament.cfg
data/qcsrc/client/View.qc

index 454f0ffcda3c867539fe0478b40a5a4e5186466d..aed8ddca99abca5b548f5ea8e261ebdfa7745d93 100644 (file)
@@ -116,6 +116,9 @@ seta crosshair_hittest_showimpact 0 "move the crosshair to the actual impact loc
 seta cl_artwork_won 2 "number of artwork_won_ images available in the gfx folder, 0 disables winning artwork"\r
 seta cl_artwork_lost 2 "number of artwork_lost_ images available in the gfx folder, 0 disables loosing artwork"\r
 seta cl_artwork_stretch 0 "stretch artwork to fit the screen, even if it brakes image proportions"\r
+seta cl_artwork_fadespeed 0.5 "artwork fade-in speed"\r
+\r
+\r
 fov 90\r
 seta cl_velocityzoom 0 "velocity based zooming of fov, negative values zoom out"\r
 seta cl_velocityzoomtime 0.3   "time value for averaging speed values"\r
index dea5d17679a0d1332d42b15dc6251617b9ca6550..70b61f4daa05f1ac546029c7b9c63b24832fffd1 100644 (file)
@@ -251,6 +251,7 @@ float Sbar_WouldDrawScoreboard ();
 float view_set;\r
 float camera_mode;\r
 float chase_active_old;\r
+float artwork_fade;\r
 string artwork_image;\r
 string NextFrameCommand;\r
 void CSQC_UpdateView(float w, float h)\r
@@ -524,7 +525,12 @@ void CSQC_UpdateView(float w, float h)
                        artwork_pos_y = (vid_conheight - artwork_size_y) / 2;\r
                }\r
 \r
-               drawpic(artwork_pos, artwork_image, artwork_size, '1 1 1', 1, DRAWFLAG_NORMAL);\r
+               if(artwork_fade < 1)\r
+                       artwork_fade += frametime * cvar("cl_artwork_fadespeed");\r
+               else\r
+                       artwork_fade = 1;\r
+\r
+               drawpic(artwork_pos, artwork_image, artwork_size, '1 1 1', artwork_fade, DRAWFLAG_NORMAL);\r
        }\r
        else\r
        {\r
@@ -533,6 +539,7 @@ void CSQC_UpdateView(float w, float h)
                        strunzone(artwork_image);\r
                        artwork_image = "";\r
                }\r
+               artwork_fade = 0;\r
        }\r
 \r
        // draw sbar\r