Client/Server: Add server controllable fogparms using serverinfo

This commit is contained in:
Marco Cawthorne 2021-02-22 17:49:55 +01:00
parent 20a67bf418
commit c26d4d0c45
3 changed files with 28 additions and 0 deletions

View File

@ -162,6 +162,7 @@ CSQC_UpdateView(float w, float h, float focus)
video_res[0] = w;
video_res[1] = h;
Fog_Update();
Sky_Update();
cvar_set("_background", serverkey("background"));

26
src/client/fog.qc Normal file
View File

@ -0,0 +1,26 @@
/*
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
var string g_strFogParms;
void
Fog_Update(void)
{
if (g_strFogParms != serverkey("fogparms")) {
g_strFogParms = serverkey("fogparms");
localcmd(sprintf("fog %s\n", g_strFogParms));
}
}

View File

@ -1,4 +1,5 @@
#includelist
fog.qc
sky.qc
music.qc
sound.qc