diff --git a/include/cl_cam.h b/include/cl_cam.h new file mode 100644 index 0000000..6bb48a6 --- /dev/null +++ b/include/cl_cam.h @@ -0,0 +1,60 @@ +/* + client.h + + Client definitions + + Copyright (C) 1996-1997 Id Software, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + + $Id$ +*/ + +#ifndef _CL_CAM_H +#define _CL_CAM_H + +// since all headers are circular-protected with #ifdef _xxx_H +// try to get them self-sufficient by including whatever other +// headers they might need + +#include + +#include "qtypes.h" +#include "protocol.h" + +// +// cl_cam.c +// +#define CAM_NONE 0 +#define CAM_TRACK 1 + +extern int autocam; +extern int spec_track; // player# of who we are tracking + +qboolean Cam_DrawViewModel(void); +qboolean Cam_DrawPlayer(int playernum); +void Cam_Track(usercmd_t *cmd); +void Cam_FinishMove(usercmd_t *cmd); +void Cam_Reset(void); +void CL_Cam_Init(void); +void CL_Cam_Init_Cvars(void); + +void CL_ParseEntityLump(char *entdata); + +#endif // _CL_CAM_H diff --git a/include/cl_demo.h b/include/cl_demo.h new file mode 100644 index 0000000..71f37a5 --- /dev/null +++ b/include/cl_demo.h @@ -0,0 +1,45 @@ +/* + client.h + + Client definitions + + Copyright (C) 1996-1997 Id Software, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + + $Id$ +*/ + +#ifndef _CL_DEMO_H +#define _CL_DEMO_H + +#include "qtypes.h" +#include "protocol.h" + +void CL_StopPlayback (void); +qboolean CL_GetMessage (void); +void CL_WriteDemoCmd (usercmd_t *pcmd); + +void CL_Stop_f (void); +void CL_Record_f (void); +void CL_ReRecord_f (void); +void CL_PlayDemo_f (void); +void CL_TimeDemo_f (void); + +#endif diff --git a/include/cl_ents.h b/include/cl_ents.h new file mode 100644 index 0000000..4dfcf92 --- /dev/null +++ b/include/cl_ents.h @@ -0,0 +1,43 @@ +/* + client.h + + Client definitions + + Copyright (C) 1996-1997 Id Software, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + + $Id$ +*/ + +#ifndef _CL_ENTS_H +#define _CL_ENTS_H + +#include "qtypes.h" + +void CL_SetSolidPlayers (int playernum); +void CL_SetUpPlayerPrediction(qboolean dopred); +void CL_EmitEntities (void); +void CL_ClearProjectiles (void); +void CL_ParseProjectiles (void); +void CL_ParsePacketEntities (qboolean delta); +void CL_SetSolidEntities (void); +void CL_ParsePlayerinfo (void); + +#endif diff --git a/include/cl_input.h b/include/cl_input.h new file mode 100644 index 0000000..34f362a --- /dev/null +++ b/include/cl_input.h @@ -0,0 +1,66 @@ +/* + client.h + + Client definitions + + Copyright (C) 1996-1997 Id Software, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + + $Id$ +*/ + +#ifndef _CL_INPUT_H +#define _CL_INPUT_H + +#include "protocol.h" + +typedef struct +{ + int down[2]; // key nums holding it down + int state; // low bit is down state +} kbutton_t; + +extern kbutton_t in_mlook, in_klook; +extern kbutton_t in_strafe; +extern kbutton_t in_speed; + +void CL_Input_Init (void); +void CL_Input_Init_Cvars (void); +void CL_ClearStates (void); +void CL_SendCmd (void); +void CL_SendMove (usercmd_t *cmd); + +void CL_ParseTEnt (void); +void CL_UpdateTEnts (void); + +void CL_ClearState (void); + +void CL_ReadPackets (void); + +int CL_ReadFromServer (void); +void CL_WriteToServer (usercmd_t *cmd); +void CL_BaseMove (usercmd_t *cmd); + + +float CL_KeyState (kbutton_t *key); +char *Key_KeynumToString (int keynum); + + +#endif diff --git a/include/cl_main.h b/include/cl_main.h new file mode 100644 index 0000000..e31c656 --- /dev/null +++ b/include/cl_main.h @@ -0,0 +1,58 @@ +/* + client.h + + Client definitions + + Copyright (C) 1996-1997 Id Software, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + + $Id$ +*/ + +#ifndef _CL_MAIN_H +#define _CL_MAIN_H + +#include "client.h" +#include "qtypes.h" +#include "render.h" + +dlight_t *CL_AllocDlight (int key); +void CL_DecayLights (void); + +void CL_Init (void); +void Host_WriteConfiguration (void); + +void CL_EstablishConnection (char *host); + +void CL_Disconnect (void); +void CL_Disconnect_f (void); +void CL_NextDemo (void); +qboolean CL_DemoBehind(void); + +void CL_BeginServerConnect(void); + +#define MAX_VISEDICTS 256 +extern int cl_numvisedicts, cl_oldnumvisedicts; +extern entity_t *cl_visedicts, *cl_oldvisedicts; +extern entity_t cl_visedicts_list[2][MAX_VISEDICTS]; + +extern char emodel_name[], pmodel_name[], prespawn_name[], modellist_name[], soundlist_name[]; + +#endif // _CL_MAIN_H diff --git a/include/cl_parse.h b/include/cl_parse.h new file mode 100644 index 0000000..8f36fc6 --- /dev/null +++ b/include/cl_parse.h @@ -0,0 +1,46 @@ +/* + client.h + + Client definitions + + Copyright (C) 1996-1997 Id Software, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + + $Id$ +*/ + +#ifndef _CL_PARSE_H +#define _CL_PARSE_H + +#include "qtypes.h" + +#define NET_TIMINGS 256 +#define NET_TIMINGSMASK 255 +extern int packet_latency[NET_TIMINGS]; +int CL_CalcNet (void); +void CL_ParseServerMessage (void); +void CL_NewTranslation (int slot); +qboolean CL_CheckOrDownloadFile (char *filename); +qboolean CL_IsUploading(void); +void CL_NextUpload(void); +void CL_StartUpload (byte *data, int size); +void CL_StopUpload(void); + +#endif diff --git a/include/cl_pred.h b/include/cl_pred.h new file mode 100644 index 0000000..ac0fc1f --- /dev/null +++ b/include/cl_pred.h @@ -0,0 +1,40 @@ +/* + client.h + + Client definitions + + Copyright (C) 1996-1997 Id Software, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + + $Id$ +*/ + +#ifndef _CL_PRED_H +#define _CL_PRED_H + +#include "qtypes.h" +#include "client.h" + +void CL_Prediction_Init_Cvars (void); +void CL_PredictMove (void); +void CL_PredictUsercmd (player_state_t *from, player_state_t *to, usercmd_t *u, qboolean spectator); + + +#endif diff --git a/include/cl_tent.h b/include/cl_tent.h new file mode 100644 index 0000000..9e6a286 --- /dev/null +++ b/include/cl_tent.h @@ -0,0 +1,35 @@ +/* + client.h + + Client definitions + + Copyright (C) 1996-1997 Id Software, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + + $Id$ +*/ + +#ifndef _CL_TENT_H +#define _CL_TENT_H + +void CL_TEnts_Init (void); +void CL_ClearTEnts (void); + +#endif diff --git a/include/client.h b/include/client.h index cf5ca97..3e16c05 100644 --- a/include/client.h +++ b/include/client.h @@ -371,160 +371,6 @@ extern qboolean allowskybox; //============================================================================= -// -// cl_main -// -dlight_t *CL_AllocDlight (int key); -void CL_DecayLights (void); -void CL_Init (void); -void Host_WriteConfiguration (void); - -void CL_EstablishConnection (char *host); - -void CL_Disconnect (void); -void CL_Disconnect_f (void); -void CL_NextDemo (void); -qboolean CL_DemoBehind(void); - -void CL_BeginServerConnect(void); - -#define MAX_VISEDICTS 256 -extern int cl_numvisedicts, cl_oldnumvisedicts; -extern entity_t *cl_visedicts, *cl_oldvisedicts; -extern entity_t cl_visedicts_list[2][MAX_VISEDICTS]; - -extern char emodel_name[], pmodel_name[], prespawn_name[], modellist_name[], soundlist_name[]; - -// -// cl_input -// -typedef struct -{ - int down[2]; // key nums holding it down - int state; // low bit is down state -} kbutton_t; - -extern kbutton_t in_mlook, in_klook; -extern kbutton_t in_strafe; -extern kbutton_t in_speed; - -void CL_InitInput (void); -void CL_ClearStates (void); -void CL_SendCmd (void); -void CL_SendMove (usercmd_t *cmd); - -void CL_ParseTEnt (void); -void CL_UpdateTEnts (void); - -void CL_ClearState (void); - -void CL_ReadPackets (void); - -int CL_ReadFromServer (void); -void CL_WriteToServer (usercmd_t *cmd); -void CL_BaseMove (usercmd_t *cmd); - - -float CL_KeyState (kbutton_t *key); -char *Key_KeynumToString (int keynum); - -// -// cl_demo.c -// -void CL_StopPlayback (void); -qboolean CL_GetMessage (void); -void CL_WriteDemoCmd (usercmd_t *pcmd); - -void CL_Stop_f (void); -void CL_Record_f (void); -void CL_ReRecord_f (void); -void CL_PlayDemo_f (void); -void CL_TimeDemo_f (void); - -// -// cl_parse.c -// -#define NET_TIMINGS 256 -#define NET_TIMINGSMASK 255 -extern int packet_latency[NET_TIMINGS]; -int CL_CalcNet (void); -void CL_ParseServerMessage (void); -void CL_NewTranslation (int slot); -qboolean CL_CheckOrDownloadFile (char *filename); -qboolean CL_IsUploading(void); -void CL_NextUpload(void); -void CL_StartUpload (byte *data, int size); -void CL_StopUpload(void); - -// -// view.c -// -void V_StartPitchDrift (void); -void V_StopPitchDrift (void); - -void V_RenderView (void); -void V_UpdatePalette (void); -void V_Register (void); -void V_ParseDamage (void); -void V_SetContentsColor (int contents); -void V_CalcBlend (void); - - -// -// cl_tent -// -void CL_InitTEnts (void); -void CL_ClearTEnts (void); - -// -// cl_ents.c -// -void CL_SetSolidPlayers (int playernum); -void CL_SetUpPlayerPrediction(qboolean dopred); -void CL_EmitEntities (void); -void CL_ClearProjectiles (void); -void CL_ParseProjectiles (void); -void CL_ParsePacketEntities (qboolean delta); -void CL_SetSolidEntities (void); -void CL_ParsePlayerinfo (void); - -// -// cl_pred.c -// -void CL_InitPrediction (void); -void CL_PredictMove (void); -void CL_PredictUsercmd (player_state_t *from, player_state_t *to, usercmd_t *u, qboolean spectator); - -// -// cl_cam.c -// -#define CAM_NONE 0 -#define CAM_TRACK 1 - -extern int autocam; -extern int spec_track; // player# of who we are tracking - -qboolean Cam_DrawViewModel(void); -qboolean Cam_DrawPlayer(int playernum); -void Cam_Track(usercmd_t *cmd); -void Cam_FinishMove(usercmd_t *cmd); -void Cam_Reset(void); -void CL_InitCam(void); - -void CL_ParseEntityLump(char *entdata); - -// -// skin.c -// - -void Skin_Find (player_info_t *sc); -byte *Skin_Cache (skin_t *skin); -void Skin_Skins_f (void); -void Skin_AllSkins_f (void); -void Skin_NextDownload (void); - -#define RSSHOT_WIDTH 320 -#define RSSHOT_HEIGHT 200 #endif // _CLIENT_H diff --git a/include/console.h b/include/console.h index f05b676..ec5ef59 100644 --- a/include/console.h +++ b/include/console.h @@ -60,6 +60,7 @@ void Con_DrawCharacter (int cx, int line, int num); void Con_CheckResize (void); void Con_Init (void); +void Con_Init_Cvars (void); void Con_DrawConsole (int lines); void Con_Print (char *txt); void Con_Printf (char *fmt, ...) __attribute__((format(printf,1,2))); diff --git a/include/context_x11.h b/include/context_x11.h index 408d8ac..ecc3b1f 100644 --- a/include/context_x11.h +++ b/include/context_x11.h @@ -46,6 +46,7 @@ extern Window x_win; extern qboolean doShm; extern int x_shmeventtype; extern qboolean oktodraw; +extern cvar_t *vid_fullscreen; qboolean x11_add_event (int event, void (*event_handler)(XEvent *)); qboolean x11_del_event (int event, void (*event_handler)(XEvent *)); @@ -60,5 +61,6 @@ void x11_create_window (int, int); void x11_grab_keyboard (void); void x11_set_caption (char *); void x11_force_view_port (void); +void x11_Init_Cvars (void); #endif // __CONTEXT_X11_H__ diff --git a/include/d_iface.h b/include/d_iface.h index b32678b..90fdda9 100644 --- a/include/d_iface.h +++ b/include/d_iface.h @@ -170,6 +170,7 @@ void D_DrawZPoint (void); void D_EnableBackBufferAccess (void); void D_EndParticles (void); void D_Init (void); +void D_Init_Cvars (void); void D_ViewChanged (void); void D_SetupFrame (void); void D_StartParticles (void); diff --git a/include/draw.h b/include/draw.h index 19f295f..a8ec7fa 100644 --- a/include/draw.h +++ b/include/draw.h @@ -34,6 +34,7 @@ extern qpic_t *draw_disc; // also used on sbar void Draw_Init (void); +void Draw_Init_Cvars (void); void Draw_Character8 (int x, int y, int num); void Draw_SubPic(int x, int y, qpic_t *pic, int srcx, int srcy, int width, int height); void Draw_Pic (int x, int y, qpic_t *pic); diff --git a/include/input.h b/include/input.h index 4a30744..355226f 100644 --- a/include/input.h +++ b/include/input.h @@ -35,6 +35,7 @@ #define freelook (in_mlook.state&1 || cl_freelook->int_val) void IN_Init (void); +void IN_Init_Cvars (void); void IN_Shutdown (void); diff --git a/include/joystick.h b/include/joystick.h index cedcd81..ea9dfad 100644 --- a/include/joystick.h +++ b/include/joystick.h @@ -71,6 +71,7 @@ void JOY_Move (usercmd_t *); you have successfully enabled it. */ void JOY_Init (void); +void JOY_Init_Cvars (void); /* JOY_Shutdown () diff --git a/include/keys.h b/include/keys.h index aa841be..2661908 100644 --- a/include/keys.h +++ b/include/keys.h @@ -174,6 +174,7 @@ extern qboolean chat_team; void Key_Event (int key, qboolean down); void Key_Init (void); +void Key_Init_Cvars (void); void Key_WriteBindings (QFile *f); void Key_SetBinding (int keynum, char *binding); void Key_ClearStates (void); diff --git a/include/model.h b/include/model.h index 4fcf532..99c6587 100644 --- a/include/model.h +++ b/include/model.h @@ -447,6 +447,7 @@ typedef struct model_s //============================================================================ void Mod_Init (void); +void Mod_Init_Cvars (void); void Mod_ClearAll (void); model_t *Mod_ForName (char *name, qboolean crash); void *Mod_Extradata (model_t *mod); // handles caching diff --git a/include/net.h b/include/net.h index dfd2c1e..4887550 100644 --- a/include/net.h +++ b/include/net.h @@ -50,6 +50,7 @@ extern cvar_t *hostname; extern int net_socket; +void NET_Init (int port); void NET_Init (int port); void NET_Shutdown (void); qboolean NET_GetPacket (void); @@ -115,6 +116,7 @@ typedef struct extern int net_drop; // packets dropped before this one void Netchan_Init (void); +void Netchan_Init_Cvars (void); void Netchan_Transmit (netchan_t *chan, int length, byte *data); void Netchan_OutOfBand (netadr_t adr, int length, byte *data); void Netchan_OutOfBandPrint (netadr_t adr, char *format, ...) __attribute__((format(printf,2,3))); diff --git a/include/pmove.h b/include/pmove.h index 9267830..5ba1f89 100644 --- a/include/pmove.h +++ b/include/pmove.h @@ -109,6 +109,7 @@ extern int watertype; void PlayerMove (void); void Pmove_Init (void); +void Pmove_Init_Cvars (void); int PM_HullPointContents (hull_t *hull, int num, vec3_t p); diff --git a/include/qargs.h b/include/qargs.h index 498174a..a916a01 100644 --- a/include/qargs.h +++ b/include/qargs.h @@ -41,6 +41,7 @@ int COM_CheckParm (char *parm); void COM_AddParm (char *parm); void COM_Init (void); +void COM_Init_Cvars (void); void COM_InitArgv (int argc, char **argv); #endif // _QARGS_H diff --git a/include/quakefs.h b/include/quakefs.h index 5573510..2f2eb3b 100644 --- a/include/quakefs.h +++ b/include/quakefs.h @@ -64,7 +64,8 @@ byte *COM_LoadHunkFile (char *path); void COM_LoadCacheFile (char *path, struct cache_user_s *cu); void COM_CreatePath (char *path); void COM_Gamedir (char *dir); -void COM_InitFilesystem (void); +void COM_Filesystem_Init (void); +void COM_Filesystem_Init_Cvars (void); void COM_Path_f (void); void COM_Maplist_f (void); diff --git a/include/r_dynamic.h b/include/r_dynamic.h index 55f2982..a492498 100644 --- a/include/r_dynamic.h +++ b/include/r_dynamic.h @@ -33,7 +33,7 @@ void R_RocketTrail (vec3_t start, vec3_t end, int type, entity_t *ent); void R_RunParticleEffect (vec3_t org, int color, int count); -void R_RunPuffEffect (vec3_t org, int type, int count); +void R_RunPuffEffect (vec3_t org, byte type, byte count); void R_RunSpikeEffect (vec3_t org, byte type); void R_BlobExplosion (vec3_t org); diff --git a/include/render.h b/include/render.h index a51da0b..4d1e369 100644 --- a/include/render.h +++ b/include/render.h @@ -125,7 +125,8 @@ extern struct texture_s *r_notexture_mip; extern entity_t r_worldentity; void R_Init (void); -void R_InitTextures (void); +void R_Init_Cvars (void); +void R_Textures_Init (void); void R_InitEfrags (void); void R_RenderView (void); // must set r_refdef first void R_ViewChanged (vrect_t *pvrect, int lineadj, float aspect); diff --git a/include/screen.h b/include/screen.h index ecd8927..91a9d5c 100644 --- a/include/screen.h +++ b/include/screen.h @@ -32,7 +32,7 @@ #include "cvar.h" -void SCR_InitCvars (void); +void SCR_Init_Cvars (void); void SCR_Init (void); void SCR_UpdateScreen (void); diff --git a/include/skin.h b/include/skin.h new file mode 100644 index 0000000..8f66128 --- /dev/null +++ b/include/skin.h @@ -0,0 +1,43 @@ +/* + client.h + + Client definitions + + Copyright (C) 1996-1997 Id Software, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + + $Id$ +*/ + +#ifndef _SKIN_H +#define _SKIN_H + +#include "client.h" + +void Skin_Find (player_info_t *sc); +byte *Skin_Cache (skin_t *skin); +void Skin_Skins_f (void); +void Skin_AllSkins_f (void); +void Skin_NextDownload (void); + +#define RSSHOT_WIDTH 320 +#define RSSHOT_HEIGHT 200 + +#endif diff --git a/include/sound.h b/include/sound.h index efddba0..c30d84f 100644 --- a/include/sound.h +++ b/include/sound.h @@ -99,6 +99,7 @@ typedef struct } wavinfo_t; void S_Init (void); +void S_Init_Cvars (void); void S_Startup (void); void S_Shutdown (void); void S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation); diff --git a/include/teamplay.h b/include/teamplay.h index 3b203c6..86722f0 100644 --- a/include/teamplay.h +++ b/include/teamplay.h @@ -33,8 +33,7 @@ extern cvar_t *cl_gibfilter; extern cvar_t *cl_parsesay; extern cvar_t *cl_nofake; -// FIXME: prefix these with TP_ or Team_ ? -void Team_InitTeamplay (void); +void Team_Init_Cvars (void); void Team_BestWeaponImpulse (void); void Team_Dead (void); void Team_NewMap (void); diff --git a/include/vid.h b/include/vid.h index b821ea2..53d000b 100644 --- a/include/vid.h +++ b/include/vid.h @@ -71,7 +71,7 @@ void VID_SetPalette (unsigned char *palette); // called for bonus and pain flashes, and for underwater color changes void VID_ShiftPalette (unsigned char *palette); -void VID_InitCvars (void); +void VID_Init_Cvars (void); // Called at startup to set up translation tables, takes 256 8 bit RGB values // the palette data will go away after the call, so it must be copied off if diff --git a/include/view.h b/include/view.h index 9789c06..bdd52bf 100644 --- a/include/view.h +++ b/include/view.h @@ -37,8 +37,18 @@ extern cvar_t *brightness; extern cvar_t *contrast; void V_Init (void); +void V_Init_Cvars (void); void V_RenderView (void); float V_CalcRoll (vec3_t angles, vec3_t velocity); void V_UpdatePalette (void); +void V_StartPitchDrift (void); +void V_StopPitchDrift (void); + +void V_RenderView (void); +void V_UpdatePalette (void); +void V_Register (void); +void V_ParseDamage (void); +void V_SetContentsColor (int contents); +void V_CalcBlend (void); #endif // _VIEW_H diff --git a/source/cl_cam.c b/source/cl_cam.c index 33c17c6..a977287 100644 --- a/source/cl_cam.c +++ b/source/cl_cam.c @@ -50,6 +50,7 @@ #include "sbar.h" #include "console.h" #include "commdef.h" +#include "cl_cam.h" #define PM_SPECTATORMAXSPEED 500 #define PM_STOPSPEED 100 @@ -586,7 +587,7 @@ void Cam_Reset(void) spec_track = 0; } -void CL_InitCam(void) +void CL_Cam_Init_Cvars(void) { cl_hightrack = Cvar_Get("cl_hightrack", "0", CVAR_NONE, "None"); cl_chasecam = Cvar_Get("cl_chasecam", "0", CVAR_NONE, "None"); diff --git a/source/cl_demo.c b/source/cl_demo.c index 78a3185..5ca706b 100644 --- a/source/cl_demo.c +++ b/source/cl_demo.c @@ -42,6 +42,7 @@ #include "quakefs.h" #include "quakedef.h" #include "pmove.h" +#include "cl_main.h" void CL_FinishTimeDemo (void); diff --git a/source/cl_ents.c b/source/cl_ents.c index 1266bf1..aa590ee 100644 --- a/source/cl_ents.c +++ b/source/cl_ents.c @@ -45,6 +45,11 @@ #include "view.h" #include "teamplay.h" #include "r_dynamic.h" +#include "cl_cam.h" +#include "cl_pred.h" +#include "cl_main.h" +#include "cl_ents.h" +#include "cl_input.h" extern cvar_t *cl_predict_players; extern cvar_t *cl_predict_players2; diff --git a/source/cl_input.c b/source/cl_input.c index e05a623..50513d4 100644 --- a/source/cl_input.c +++ b/source/cl_input.c @@ -47,6 +47,10 @@ #include "checksum.h" #include "keys.h" #include "teamplay.h" +#include "cl_cam.h" +#include "cl_demo.h" +#include "cl_parse.h" +#include "cl_input.h" cvar_t *cl_nodelta; @@ -525,7 +529,7 @@ void CL_SendCmd (void) CL_InitInput ============ */ -void CL_InitInput (void) +void CL_Input_Init (void) { Cmd_AddCommand ("+moveup",IN_UpDown); Cmd_AddCommand ("-moveup",IN_UpUp); @@ -562,7 +566,10 @@ void CL_InitInput (void) Cmd_AddCommand ("-klook", IN_KLookUp); Cmd_AddCommand ("+mlook", IN_MLookDown); Cmd_AddCommand ("-mlook", IN_MLookUp); +} +void CL_Input_Init_Cvars (void) +{ cl_nodelta = Cvar_Get("cl_nodelta", "0", CVAR_NONE, "None"); } diff --git a/source/cl_main.c b/source/cl_main.c index 6afa81c..4ec9aa6 100644 --- a/source/cl_main.c +++ b/source/cl_main.c @@ -60,6 +60,15 @@ #include "qargs.h" #include "cdaudio.h" #include "teamplay.h" +#include "cl_cam.h" +#include "cl_main.h" +#include "cl_demo.h" +#include "cl_input.h" +#include "cl_ents.h" +#include "skin.h" +#include "cl_parse.h" +#include "cl_tent.h" +#include "cl_pred.h" #ifdef __sun /* Sun's model_t in sys/model.h conflicts w/ Quake's model_t */ @@ -1173,10 +1182,7 @@ void CL_Init (void) Info_SetValueForStarKey (cls.userinfo, "*ver", st, MAX_INFO_STRING); Info_SetValueForStarKey (cls.userinfo, "stdver", QSG_VERSION, MAX_INFO_STRING); - CL_InitInput (); - CL_InitTEnts (); - CL_InitPrediction (); - CL_InitCam (); + CL_Input_Init (); Pmove_Init (); Qexpand_squiggle(fs_userpath->string, e_path); @@ -1243,7 +1249,7 @@ void CL_Init (void) } -void CL_InitCvars (void) +void CL_Init_Cvars (void) { extern cvar_t *baseskin; extern cvar_t *noskins; @@ -1575,8 +1581,6 @@ Host_Init */ void Host_Init (quakeparms_t *parms) { - COM_InitArgv (parms->argc, parms->argv); - if (COM_CheckParm ("-minmemory")) parms->memsize = MINIMUM_MEMORY; @@ -1589,11 +1593,9 @@ void Host_Init (quakeparms_t *parms) Memory_Init (parms->membase, parms->memsize); Cvar_Init (); Sys_Init(); - CL_InitCvars (); Cbuf_Init (); Cmd_Init (); - cl_Cmd_Init (); // execute +set as early as possible Cmd_StuffCmds_f (); @@ -1608,19 +1610,34 @@ void Host_Init (quakeparms_t *parms) Cmd_Exec_File (fs_globalcfg->string); Cbuf_Execute_Sets (); - //Cmd_StuffCmds_f (); - //Cbuf_Execute_Sets (); + CL_Cam_Init_Cvars (); + CL_Input_Init_Cvars (); + CL_Init_Cvars (); + CL_Prediction_Init_Cvars (); + COM_Init_Cvars (); + Con_Init_Cvars (); + Draw_Init_Cvars (); + COM_Filesystem_Init_Cvars (); + IN_Init_Cvars (); + Key_Init_Cvars (); + Mod_Init_Cvars (); + Netchan_Init_Cvars (); + Pmove_Init_Cvars (); + R_Init_Cvars (); + S_Init_Cvars (); + SCR_Init_Cvars (); + Team_Init_Cvars (); + V_Init_Cvars (); + VID_Init_Cvars (); + // Reparse the command line for + commands. + // (Note, no non-base commands exist yet) + Cmd_StuffCmds_f (); + Cbuf_Execute (); + + cl_Cmd_Init (); V_Init (); - SCR_InitCvars (); - VID_InitCvars (); COM_Init (); - Team_InitTeamplay (); - - // reparse the command line for + commands other than set - // (sets still done, but it doesn't matter) - //Cmd_StuffCmds_f (); - //Cbuf_Execute (); NET_Init (PORT_CLIENT); Netchan_Init (); @@ -1634,7 +1651,7 @@ void Host_Init (quakeparms_t *parms) // Con_Printf ("Exe: "__TIME__" "__DATE__"\n"); Con_Printf ("%4.1f megs RAM used.\n",parms->memsize/ (1024*1024.0)); - R_InitTextures (); + R_Textures_Init (); host_basepal = (byte *)COM_LoadHunkFile ("gfx/palette.lmp"); if (!host_basepal) diff --git a/source/cl_parse.c b/source/cl_parse.c index 6fe96ca..7f1bcc2 100644 --- a/source/cl_parse.c +++ b/source/cl_parse.c @@ -42,6 +42,13 @@ #include "pmove.h" #include "sbar.h" #include "teamplay.h" +#include "cl_parse.h" +#include "cl_main.h" +#include "skin.h" +#include "cl_ents.h" +#include "cl_input.h" +#include "view.h" + #ifdef HAVE_STRINGS_H #include #endif diff --git a/source/cl_pred.c b/source/cl_pred.c index 9c99b3a..6ee8ec8 100644 --- a/source/cl_pred.c +++ b/source/cl_pred.c @@ -35,6 +35,7 @@ #include "bothdefs.h" #include "console.h" #include "commdef.h" +#include "cl_ents.h" #ifdef _WIN32 #include "winquake.h" @@ -233,10 +234,10 @@ void CL_PredictMove (void) /* ============== -CL_InitPrediction +CL_Prediction_Init_Cvars ============== */ -void CL_InitPrediction (void) +void CL_Prediction_Init_Cvars (void) { cl_pushlatency = Cvar_Get("pushlatency", "-999", CVAR_NONE, "None"); cl_nopred = Cvar_Get("cl_nopred", "0", CVAR_NONE, "None"); diff --git a/source/cl_tent.c b/source/cl_tent.c index e98d1c2..aec3826 100644 --- a/source/cl_tent.c +++ b/source/cl_tent.c @@ -38,6 +38,7 @@ #include "msg.h" #include "console.h" #include "r_dynamic.h" +#include "cl_main.h" #include #include @@ -80,7 +81,7 @@ sfx_t *cl_sfx_r_exp3; CL_ParseTEnts ================= */ -void CL_InitTEnts (void) +void CL_TEnts_Init (void) { cl_sfx_wizhit = S_PrecacheSound ("wizard/hit.wav"); cl_sfx_knighthit = S_PrecacheSound ("hknight/hit.wav"); diff --git a/source/cmd.c b/source/cmd.c index 9204bf5..500d97b 100644 --- a/source/cmd.c +++ b/source/cmd.c @@ -402,7 +402,8 @@ void Cmd_Exec_f (void) Con_Printf ("couldn't exec %s\n",Cmd_Argv(1)); return; } - if (!Cvar_Command () && (cl_warncmd->int_val || developer->int_val)) + if (!Cvar_Command () && ((cl_warncmd && cl_warncmd->int_val) + || (developer && developer->int_val))) Con_Printf ("execing %s\n",Cmd_Argv(1)); Cbuf_InsertText (f); diff --git a/source/com.c b/source/com.c index da7932c..7a0e868 100644 --- a/source/com.c +++ b/source/com.c @@ -46,7 +46,6 @@ int static_registered = 1; // only for startup check, then set qboolean msg_suppress_1 = 0; -void COM_InitFilesystem (void); void COM_Path_f (void); @@ -106,9 +105,13 @@ void COM_Init (void) LittleFloat = FloatSwap; #endif - registered = Cvar_Get("registered", "0", CVAR_NONE, "None"); Cmd_AddCommand ("path", COM_Path_f); - COM_InitFilesystem (); + COM_Filesystem_Init (); COM_CheckRegistered (); } + +void COM_Init_Cvars (void) +{ + registered = Cvar_Get("registered", "0", CVAR_NONE, "None"); +} diff --git a/source/console.c b/source/console.c index 86a11eb..39a63a9 100644 --- a/source/console.c +++ b/source/console.c @@ -269,8 +269,6 @@ void Con_Init (void) // // register our commands // - con_notifytime = Cvar_Get("con_notifytime", "3", CVAR_NONE, "None"); - Cmd_AddCommand ("toggleconsole", Con_ToggleConsole_f); Cmd_AddCommand ("togglechat", Con_ToggleChat_f); Cmd_AddCommand ("messagemode", Con_MessageMode_f); @@ -279,6 +277,11 @@ void Con_Init (void) con_initialized = true; } +void Con_Init_Cvars (void) +{ + con_notifytime = Cvar_Get("con_notifytime", "3", CVAR_NONE, "None"); +} + /* =============== diff --git a/source/context_x11.c b/source/context_x11.c index b12c0b8..76428e8 100644 --- a/source/context_x11.c +++ b/source/context_x11.c @@ -245,8 +245,6 @@ x11_set_vidmode(int width, int height) int i; int best_mode = 0, best_x = INT_MAX, best_y = INT_MAX; - vid_fullscreen = Cvar_Get ("vid_fullscreen","0",0,"Toggles fullscreen game mode"); - XGetScreenSaver (x_disp, &xss_timeout, &xss_interval, &xss_blanking, &xss_exposures); XSetScreenSaver (x_disp, 0, xss_interval, xss_blanking, @@ -269,12 +267,6 @@ x11_set_vidmode(int width, int height) return; } - - if (vid_fullscreen->int_val) - _windowed_mouse = Cvar_Get ("_windowed_mouse","1",CVAR_ARCHIVE|CVAR_ROM,"None"); - else - _windowed_mouse = Cvar_Get ("_windowed_mouse","0",CVAR_ARCHIVE,"None"); - XF86VidModeGetAllModeLines(x_disp, x_screen, &nummodes, &vidmodes); if (vid_fullscreen->int_val) { @@ -296,6 +288,13 @@ x11_set_vidmode(int width, int height) #endif } +void +x11_Init_Cvars () +{ + vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ARCHIVE, + "Toggles fullscreen game mode"); +} + void x11_create_window (int width, int height) { diff --git a/source/cvar.c b/source/cvar.c index 36515a6..61a83fe 100644 --- a/source/cvar.c +++ b/source/cvar.c @@ -408,7 +408,7 @@ void Cvar_CvarList_f (void) void Cvar_Init() { - developer = Cvar_Get ("developer","0",0,"None"); + developer = Cvar_Get ("developer", "0", 0, "None"); Cmd_AddCommand ("set", Cvar_Set_f); Cmd_AddCommand ("setrom", Cvar_Setrom_f); diff --git a/source/d_init.c b/source/d_init.c index cba5b07..dca89c8 100644 --- a/source/d_init.c +++ b/source/d_init.c @@ -57,13 +57,8 @@ D_Init */ void D_Init (void) { - r_skydirect = 1; - d_subdiv16 = Cvar_Get("d_subdiv16", "1", CVAR_NONE, "None"); - d_mipcap = Cvar_Get("d_mipcap", "0", CVAR_NONE, "None"); - d_mipscale = Cvar_Get("d_mipscale", "1", CVAR_NONE, "None"); - r_drawpolys = false; r_worldpolysbacktofront = false; r_recursiveaffinetriangles = true; @@ -71,6 +66,12 @@ void D_Init (void) r_aliasuvscale = 1.0; } +void D_Init_Cvars (void) +{ + d_subdiv16 = Cvar_Get("d_subdiv16", "1", CVAR_NONE, "None"); + d_mipcap = Cvar_Get("d_mipcap", "0", CVAR_NONE, "None"); + d_mipscale = Cvar_Get("d_mipscale", "1", CVAR_NONE, "None"); +} /* =============== diff --git a/source/draw.c b/source/draw.c index 8ef62c0..922b83c 100644 --- a/source/draw.c +++ b/source/draw.c @@ -150,6 +150,9 @@ void Draw_Init (void) cl_verstring = Cvar_Get("cl_verstring", PROGRAM " " VERSION, CVAR_NONE, "None"); } +void Draw_Init_Cvars (void) +{ +} /* diff --git a/source/gl_draw.c b/source/gl_draw.c index a9ed9b3..83d02ed 100644 --- a/source/gl_draw.c +++ b/source/gl_draw.c @@ -61,7 +61,7 @@ static int GL_LoadPicTexture (qpic_t *pic); extern byte *host_basepal; extern unsigned char d_15to8table[65536]; -extern cvar_t *crosshair, *cl_crossx, *cl_crossy, *crosshaircolor; +extern cvar_t *crosshair, *cl_crossx, *cl_crossy, *crosshaircolor, *gl_colorlights; cvar_t *gl_max_size; cvar_t *gl_picmip; @@ -399,25 +399,6 @@ void Draw_Init (void) { int i; - // LordHavoc: lighting mode - gl_lightmode = Cvar_Get("gl_lightmode", "1", CVAR_ARCHIVE, - "Lighting mode (0 = GLQuake style, 1 = new style)"); - gl_max_size = Cvar_Get("gl_max_size", "1024", CVAR_NONE, - "None"); // CVAR_FIXME - set a description - gl_picmip = Cvar_Get("gl_picmip", "0", CVAR_NONE, - "None"); // CVAR_FIXME - set a description - - // Console effects --KB - gl_constretch = Cvar_Get ("gl_constretch", "0", CVAR_ARCHIVE, - "whether slide the console or stretch it"); - gl_conalpha = Cvar_Get ("gl_conalpha", "0.6", CVAR_ARCHIVE, - "alpha value for the console background"); - gl_conspin = Cvar_Get ("gl_conspin", "0", CVAR_ARCHIVE, - "speed at which the console spins"); - - cl_verstring = Cvar_Get("cl_verstring", PROGRAM " " VERSION, CVAR_NONE, - "client version string"); - // 3dfx can only handle 256 wide textures if (!strncasecmp ((char *)gl_renderer, "3dfx",4) || !strncasecmp ((char *)gl_renderer, "Mesa",4)) @@ -472,6 +453,30 @@ void Draw_Init (void) glrsurf_init(); } +void Draw_Init_Cvars (void) +{ + // LordHavoc: lighting mode + gl_lightmode = Cvar_Get("gl_lightmode", "1", CVAR_ARCHIVE, + "Lighting mode (0 = GLQuake style, 1 = new style)"); + gl_max_size = Cvar_Get("gl_max_size", "1024", CVAR_NONE, + "None"); // CVAR_FIXME - set a description + gl_picmip = Cvar_Get("gl_picmip", "0", CVAR_NONE, + "None"); // CVAR_FIXME - set a description + gl_colorlights = Cvar_Get ("gl_colorlights", "1", CVAR_ROM, + "Whether to use RGB lightmaps or not"); + + // Console effects --KB + gl_constretch = Cvar_Get ("gl_constretch", "0", CVAR_ARCHIVE, + "whether slide the console or stretch it"); + gl_conalpha = Cvar_Get ("gl_conalpha", "0.6", CVAR_ARCHIVE, + "alpha value for the console background"); + gl_conspin = Cvar_Get ("gl_conspin", "0", CVAR_ARCHIVE, + "speed at which the console spins"); + + cl_verstring = Cvar_Get("cl_verstring", PROGRAM " " VERSION, CVAR_NONE, + "client version string"); +} + /* diff --git a/source/gl_dyn_fires.c b/source/gl_dyn_fires.c index 9d50ff8..56cf14b 100644 --- a/source/gl_dyn_fires.c +++ b/source/gl_dyn_fires.c @@ -32,6 +32,7 @@ #include "cmd.h" #include "console.h" #include "glquake.h" +#include "cl_main.h" #include diff --git a/source/gl_dyn_part.c b/source/gl_dyn_part.c index 8ddc27d..13f6592 100644 --- a/source/gl_dyn_part.c +++ b/source/gl_dyn_part.c @@ -283,7 +283,7 @@ R_RunPuffEffect =============== */ -void R_RunPuffEffect (vec3_t org, int type, int count) +void R_RunPuffEffect (vec3_t org, byte type, byte count) { if (!gl_particles->int_val) return; diff --git a/source/gl_ngraph.c b/source/gl_ngraph.c index 4e47674..520ce06 100644 --- a/source/gl_ngraph.c +++ b/source/gl_ngraph.c @@ -52,6 +52,7 @@ #include "model.h" // needed by: glquake.h #include "console.h" #include "glquake.h" +#include "cl_parse.h" extern byte *draw_chars; // 8*8 graphic characters diff --git a/source/gl_refrag.c b/source/gl_refrag.c index adad505..1ddfede 100644 --- a/source/gl_refrag.c +++ b/source/gl_refrag.c @@ -54,6 +54,7 @@ #include "glquake.h" #include "quakefs.h" #include "quakedef.h" +#include "cl_main.h" mnode_t *r_pefragtopnode; diff --git a/source/gl_rmain.c b/source/gl_rmain.c index b0a3d84..ecc135e 100644 --- a/source/gl_rmain.c +++ b/source/gl_rmain.c @@ -44,7 +44,11 @@ #include "render.h" #include "sys.h" #include "r_dynamic.h" -#include "va.h" +#include "skin.h" +#include "cl_main.h" +#include "cl_cam.h" +#include "view.h" + entity_t r_worldentity; @@ -114,13 +118,10 @@ cvar_t *gl_particles; cvar_t *r_skyname; cvar_t *gl_skymultipass; -cvar_t *gl_sky_clip; cvar_t *gl_fb_models; cvar_t *gl_fb_bmodels; -cvar_t *brighten; - extern cvar_t *scr_fov; extern byte gammatable[256]; @@ -143,15 +144,12 @@ GL_CheckBrightness (unsigned char *pal) int i, inf; float brightness; - brighten = Cvar_Get ("brighten", "1", CVAR_ROM, - "Palette hack equivalent to brightness"); if ((i = COM_CheckParm ("-brighten"))) { brightness = atof (com_argv[i + 1]); + brightness = bound (1, brightness, 5); } else { - brightness = brighten->value; + brightness = 1.0; } - brightness = bound (1, brightness, 5); - Cvar_SetROM (brighten, va("%f", brightness)); // Build gamma table if (brightness == 1.0) { // screw the math @@ -954,7 +952,7 @@ void R_RenderView (void) R_Clear (); // render normal view - R_SetupFrame (); + R_SetupFrame (); // Setup stuff for frame. R_SetFrustum (); diff --git a/source/gl_rmisc.c b/source/gl_rmisc.c index 5c5b604..4dd52d7 100644 --- a/source/gl_rmisc.c +++ b/source/gl_rmisc.c @@ -55,6 +55,7 @@ #include "console.h" #include "glquake.h" #include "r_dynamic.h" +#include "skin.h" qboolean VID_Is8bit(void); void R_InitBubble(); @@ -65,10 +66,10 @@ qboolean allowskybox; // allow skyboxes? --KB /* ================== -R_InitTextures +R_Textures_Init ================== */ -void R_InitTextures (void) +void R_Textures_Init (void) { int x,y, m; byte *dest; @@ -194,6 +195,19 @@ void R_Init (void) Cmd_AddCommand ("r_firecolor", R_FireColor_f); + R_InitBubble(); + + R_InitParticles (); + + netgraphtexture = texture_extension_number; + texture_extension_number++; + + playertextures = texture_extension_number; + texture_extension_number += MAX_CLIENTS; +} + +void R_Init_Cvars (void) +{ r_norefresh = Cvar_Get("r_norefresh", "0", CVAR_NONE, "None"); r_drawentities = Cvar_Get("r_drawentities", "1", CVAR_NONE, "None"); r_drawviewmodel = Cvar_Get("r_drawviewmodel", "1", CVAR_NONE, "None"); @@ -208,9 +222,6 @@ void R_Init (void) gl_clear = Cvar_Get("gl_clear", "0", CVAR_NONE, "None"); gl_texsort = Cvar_Get("gl_texsort", "1", CVAR_NONE, "None"); -// if (gl_mtexable) -// Cvar_SetValue(gl_texsort, 0); - gl_cull = Cvar_Get("gl_cull", "1", CVAR_NONE, "None"); gl_smooth = Cvar_Get("gl_smooth", "1", CVAR_NONE, "None"); gl_smoothdlights = Cvar_Get("gl_smoothdlights", "1", CVAR_NONE, "None"); @@ -238,15 +249,6 @@ void R_Init (void) gl_skymultipass = Cvar_Get("gl_skymultipass", "1", CVAR_NONE, "controls wether the skydome is single or double pass"); - R_InitBubble(); - - R_InitParticles (); - - netgraphtexture = texture_extension_number; - texture_extension_number++; - - playertextures = texture_extension_number; - texture_extension_number += MAX_CLIENTS; } /* diff --git a/source/gl_rsurf.c b/source/gl_rsurf.c index 1180706..7018590 100644 --- a/source/gl_rsurf.c +++ b/source/gl_rsurf.c @@ -1255,9 +1255,6 @@ void GL_BuildLightmaps (void) texture_extension_number += MAX_LIGHTMAPS; } - gl_colorlights = Cvar_Get ("gl_colorlights", "1", CVAR_ROM, - "Whether to use RGB lightmaps or not"); - if (gl_colorlights->int_val) { gl_lightmap_format = GL_RGB; diff --git a/source/gl_screen.c b/source/gl_screen.c index 4e17f40..2255000 100644 --- a/source/gl_screen.c +++ b/source/gl_screen.c @@ -43,6 +43,9 @@ #include "qendian.h" #include "sbar.h" #include "sys.h" +#include "cl_parse.h" +#include "skin.h" +#include "view.h" /* @@ -384,7 +387,7 @@ void SCR_SizeDown_f (void) SCR_Init ================== */ -void SCR_InitCvars (void) +void SCR_Init_Cvars (void) { scr_fov = Cvar_Get("fov", "90", CVAR_NONE, "None"); scr_viewsize = Cvar_Get("viewsize", "100", CVAR_ARCHIVE, "None"); diff --git a/source/in_null.c b/source/in_null.c index 1129e4f..e44e5b4 100644 --- a/source/in_null.c +++ b/source/in_null.c @@ -35,6 +35,10 @@ void IN_Init (void) { } +void IN_Init_Cvars (void) +{ +} + void IN_Shutdown (void) { } diff --git a/source/in_sdl.c b/source/in_sdl.c index a18870c..98c13e1 100644 --- a/source/in_sdl.c +++ b/source/in_sdl.c @@ -248,9 +248,6 @@ IN_Init (void) { JOY_Init (); - _windowed_mouse = Cvar_Get ("_windowed_mouse","0",CVAR_ARCHIVE,"None"); - // m_filter = Cvar_Get ("m_filter", "0", CVAR_ARCHIVE, "None"); - if ( COM_CheckParm("-nomouse") && !_windowed_mouse->value) return; @@ -261,6 +258,15 @@ IN_Init (void) // FIXME: disable DGA if in_dgamouse says to. } +void +IN_Init_Cvars (void) +{ + JOY_Init_Cvars (); + + _windowed_mouse = Cvar_Get ("_windowed_mouse","0",CVAR_ARCHIVE,"None"); + // m_filter = Cvar_Get ("m_filter", "0", CVAR_ARCHIVE, "None"); +} + void IN_Shutdown (void) { diff --git a/source/in_svgalib.c b/source/in_svgalib.c index 07facd6..ea23a46 100644 --- a/source/in_svgalib.c +++ b/source/in_svgalib.c @@ -120,6 +120,13 @@ IN_Init (void) return; } +void +IN_Init_Cvars (void) +{ + JOY_Init_Cvars(); + m_filter = Cvar_Get ("m_filter","0",0,"None"); +} + static void IN_init_kb (void) { @@ -248,7 +255,6 @@ IN_init_mouse() char *mousedev; int mouserate = MOUSE_DEFAULTSAMPLERATE; - m_filter = Cvar_Get ("m_filter","0",0,"None"); Cmd_AddCommand("force_centerview", Force_CenterView_f); mouse_buttons = 3; diff --git a/source/in_win.c b/source/in_win.c index dbc6213..0893774 100644 --- a/source/in_win.c +++ b/source/in_win.c @@ -504,6 +504,17 @@ IN_Init =========== */ void IN_Init (void) +{ + Cmd_AddCommand ("force_centerview", Force_CenterView_f); + Cmd_AddCommand ("joyadvancedupdate", Joy_AdvancedUpdate_f); + + uiWheelMessage = RegisterWindowMessage ( "MSWHEEL_ROLLMSG" ); + + IN_StartupMouse (); + IN_StartupJoystick (); +} + +void IN_Init_Cvars (void) { // mouse variables m_filter = Cvar_Get("m_filter", "0", CVAR_NONE, "None"); @@ -528,14 +539,6 @@ void IN_Init (void) joy_yawsensitivity = Cvar_Get("joyyawsensitivity", "-1.0", CVAR_NONE, "None"); joy_wwhack1 = Cvar_Get("joywwhack1", "0.0", CVAR_NONE, "None"); joy_wwhack2 = Cvar_Get("joywwhack2", "0.0", CVAR_NONE, "None"); - - Cmd_AddCommand ("force_centerview", Force_CenterView_f); - Cmd_AddCommand ("joyadvancedupdate", Joy_AdvancedUpdate_f); - - uiWheelMessage = RegisterWindowMessage ( "MSWHEEL_ROLLMSG" ); - - IN_StartupMouse (); - IN_StartupJoystick (); } /* diff --git a/source/in_x11.c b/source/in_x11.c index fa72346..63fb353 100644 --- a/source/in_x11.c +++ b/source/in_x11.c @@ -70,6 +70,9 @@ #include "input.h" #include "joystick.h" #include "qargs.h" +#include "cl_input.h" +#include "view.h" + cvar_t *_windowed_mouse; cvar_t *m_filter; @@ -276,9 +279,7 @@ event_motion (XEvent *event) Con_Printf("event->xmotion.x: %d\n", event->xmotion.x); Con_Printf("event->xmotion.y: %d\n", event->xmotion.y); } - //printf("_windowed_mouse: %f\n", _windowed_mouse->int_val); - //printf("CurrentTime: %ld\n", CurrentTime); - if (_windowed_mouse->int_val) { + if (vid_fullscreen->int_val || _windowed_mouse->int_val) { if (!event->xmotion.send_event) { mouse_x += (event->xmotion.x - p_mouse_x); mouse_y += (event->xmotion.y - p_mouse_y); @@ -300,21 +301,18 @@ event_motion (XEvent *event) void IN_Commands (void) { - static int old_windowed_mouse; - static int old_in_dga; + static int old_windowed, windowed; JOY_Command (); - if ((old_windowed_mouse != _windowed_mouse->int_val) - || (old_in_dga != in_dga->int_val)) { - old_windowed_mouse = _windowed_mouse->int_val; + windowed = _windowed_mouse->int_val || vid_fullscreen->int_val || in_dga->int_val; - if (_windowed_mouse->int_val) { // grab the pointer + if (old_windowed != windowed) { + old_windowed = windowed; + + if (windowed) { // grab the pointer XGrabPointer (x_disp, x_win, True, MOUSE_MASK, GrabModeAsync, GrabModeAsync, x_win, None, CurrentTime); -/* forcing viewport every frame is a hideous slowdown. - x11_force_view_port(); - */ #ifdef HAVE_DGA if (dga_avail && in_dga->int_val && !dga_active) { XF86DGADirectVideo (x_disp, DefaultScreen (x_disp), @@ -427,12 +425,6 @@ IN_Init (void) JOY_Init (); - _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, "None"); - m_filter = Cvar_Get ("m_filter", "0", CVAR_ARCHIVE, "None"); - in_dga = Cvar_Get ("in_dga", "1", CVAR_ARCHIVE, "DGA Input support"); - in_dga_mouseaccel = Cvar_Get ("in_dga_mouseaccel", "1", CVAR_ARCHIVE, - "None"); - XAutoRepeatOff (x_disp); if (COM_CheckParm("-nomouse")) @@ -451,3 +443,14 @@ IN_Init (void) return; } + +void +IN_Init_Cvars (void) +{ + JOY_Init_Cvars (); + _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, "None"); + m_filter = Cvar_Get ("m_filter", "0", CVAR_ARCHIVE, "None"); + in_dga = Cvar_Get ("in_dga", "1", CVAR_ARCHIVE, "DGA Input support"); + in_dga_mouseaccel = Cvar_Get ("in_dga_mouseaccel", "1", CVAR_ARCHIVE, + "None"); +} diff --git a/source/joy_linux.c b/source/joy_linux.c index 52ebd21..95bb91c 100644 --- a/source/joy_linux.c +++ b/source/joy_linux.c @@ -40,6 +40,7 @@ #include "cvar.h" #include "keys.h" #include "protocol.h" +#include "view.h" #define JOY_MAX_AXES 6 #define JOY_MAX_BUTTONS 10 @@ -148,10 +149,6 @@ JOY_Move (usercmd_t *cmd) void JOY_Init (void) { - joy_device = Cvar_Get ("joy_device", "/dev/js0", CVAR_NONE|CVAR_ROM, "Joystick device"); - joy_enable = Cvar_Get ("joy_enable", "1", CVAR_NONE|CVAR_ARCHIVE, "Joystick enable flag"); - joy_sensitivity = Cvar_Get ("joy_sensitivity", "1", CVAR_NONE|CVAR_ARCHIVE, "Joystick sensitivity"); - // Open joystick device joy_handle = open (joy_device->string, O_RDONLY|O_NONBLOCK); if (joy_handle < 0) { @@ -168,11 +165,6 @@ JOY_Init (void) } } else { // Initialize joystick if found and enabled - for (i = 0; i < JOY_MAX_AXES; i++) { - joy_axes[i].axis = Cvar_Get (joy_axes[i].var.name, - joy_axes[i].var.string, - CVAR_ARCHIVE, "None"); - } for (i = 0; i < JOY_MAX_BUTTONS; i++) { joy_buttons[i].old = 0; joy_buttons[i].current = 0; @@ -183,6 +175,22 @@ JOY_Init (void) } } +void +JOY_Init_Cvars (void) +{ + int i; + + joy_device = Cvar_Get ("joy_device", "/dev/js0", CVAR_NONE|CVAR_ROM, "Joystick device"); + joy_enable = Cvar_Get ("joy_enable", "1", CVAR_NONE|CVAR_ARCHIVE, "Joystick enable flag"); + joy_sensitivity = Cvar_Get ("joy_sensitivity", "1", CVAR_NONE|CVAR_ARCHIVE, "Joystick sensitivity"); + + for (i = 0; i < JOY_MAX_AXES; i++) { + joy_axes[i].axis = Cvar_Get (joy_axes[i].var.name, + joy_axes[i].var.string, + CVAR_ARCHIVE, "None"); + } +} + void JOY_Shutdown (void) { diff --git a/source/joy_null.c b/source/joy_null.c index 579425b..5e84c73 100644 --- a/source/joy_null.c +++ b/source/joy_null.c @@ -55,12 +55,16 @@ JOY_Move (usercmd_t *cmd) void JOY_Init (void) +{ + Con_DPrintf ("This system does not have joystick support.\n"); +} + +void +JOY_Init_Cvars (void) { joy_device = Cvar_Get ("joy_device", "none", CVAR_NONE|CVAR_ROM, "Joystick device"); joy_enable = Cvar_Get ("joy_enable", "1", CVAR_NONE|CVAR_ARCHIVE, "Joystick enable flag"); joy_sensitivity = Cvar_Get ("joy_sensitivity", "1", CVAR_NONE|CVAR_ARCHIVE, "Joystick sensitivity"); - - Con_DPrintf ("This system does not have joystick support.\n"); } void diff --git a/source/keys.c b/source/keys.c index c7cd2c3..57fb77b 100644 --- a/source/keys.c +++ b/source/keys.c @@ -760,7 +760,11 @@ Key_Init ( void ) Cmd_AddCommand ("bind", Key_Bind_f); Cmd_AddCommand ("unbind", Key_Unbind_f); Cmd_AddCommand ("unbindall", Key_Unbindall_f); +} +void +Key_Init_Cvars ( void ) +{ cl_chatmode = Cvar_Get ("cl_chatmode", "2", 0, "Controls when console text will be treated as a chat message\n" "0 - never, 1 - always, 2 - smart"); diff --git a/source/menu.c b/source/menu.c index 20c48e8..0361b3c 100644 --- a/source/menu.c +++ b/source/menu.c @@ -46,6 +46,8 @@ #include "console.h" #include "input.h" #include "view.h" +#include "cl_main.h" +#include "cl_input.h" void (*vid_menudrawfn)(void); void (*vid_menukeyfn)(int key); diff --git a/source/model.c b/source/model.c index e6e25d6..9ac06ca 100644 --- a/source/model.c +++ b/source/model.c @@ -70,10 +70,14 @@ Mod_Init */ void Mod_Init (void) { - gl_subdivide_size = Cvar_Get("gl_subdivide_size", "128", CVAR_ARCHIVE, "None"); memset (mod_novis, 0xff, sizeof(mod_novis)); } +void Mod_Init_Cvars (void) +{ + gl_subdivide_size = Cvar_Get("gl_subdivide_size", "128", CVAR_ARCHIVE, "None"); +} + /* =================== Mod_ClearAll diff --git a/source/model_alias.c b/source/model_alias.c index b57a645..f9f2c93 100644 --- a/source/model_alias.c +++ b/source/model_alias.c @@ -48,6 +48,7 @@ #include "crc.h" #include "server.h" #include "msg.h" +#include "cl_main.h" extern char loadname[]; extern model_t *loadmodel; diff --git a/source/net_chan.c b/source/net_chan.c index e6ed8b9..a68204e 100644 --- a/source/net_chan.c +++ b/source/net_chan.c @@ -124,10 +124,14 @@ void Netchan_Init (void) port = ((int)(getpid()+getuid()*1000) * time(NULL)) & 0xffff; #endif + Cvar_SetValue (qport, port); +} + +void Netchan_Init_Cvars (void) +{ showpackets = Cvar_Get("showpackets", "0", CVAR_NONE, "None"); showdrop = Cvar_Get("showdrop", "0", CVAR_NONE, "None"); qport = Cvar_Get("qport", "0", CVAR_NONE, "None"); - Cvar_SetValue (qport, port); } /* diff --git a/source/pmove.c b/source/pmove.c index e54581a..cf265d9 100644 --- a/source/pmove.c +++ b/source/pmove.c @@ -69,6 +69,10 @@ void PM_CategorizePosition (void); void Pmove_Init (void) { PM_InitBoxHull (); +} + +void Pmove_Init_Cvars (void) +{ no_pogo_stick = Cvar_Get ("no_pogo_stick", "0", CVAR_SERVERINFO, "disable the ability to pogo stick"); } diff --git a/source/pr_edict.c b/source/pr_edict.c index 12d29a9..55189c8 100644 --- a/source/pr_edict.c +++ b/source/pr_edict.c @@ -882,12 +882,11 @@ char *ED_ParseEdict (char *data, edict_t *ent) // at least one other map uses it already. --KB if (stricmp (keyname, "sky") == 0 || // LordHavoc: added "sky" key (Quake2 and DarkPlaces use this) stricmp (keyname, "skyname") == 0 || - stricmp (keyname, "qlsky") == 0) + stricmp (keyname, "qlsky") == 0) { Info_SetValueForKey (svs.info, "skybox", "1", MAX_SERVERINFO_STRING); - r_skyname = Cvar_Get ("r_skyname", com_token, - CVAR_NONE, "name of skybox"); + Cvar_Set(r_skyname, com_token); continue; } @@ -1117,6 +1116,11 @@ void PR_Init (void) Cmd_AddCommand ("profile", PR_Profile_f); } +void PR_Init_Cvars (void) +{ + r_skyname = Cvar_Get ("r_skyname", com_token, CVAR_NONE, "name of skybox"); +} + edict_t *EDICT_NUM(int n) diff --git a/source/quakefs.c b/source/quakefs.c index a2d0968..5f1973f 100644 --- a/source/quakefs.c +++ b/source/quakefs.c @@ -1017,16 +1017,10 @@ COM_CreateGameDirectory (char *gamename) COM_InitFilesystem */ void -COM_InitFilesystem ( void ) +COM_Filesystem_Init ( void ) { int i; - fs_sharepath = Cvar_Get ("fs_sharepath", FS_SHAREPATH, CVAR_ROM, - "location of shared (read only) game directories"); - fs_userpath = Cvar_Get ("fs_userpath", FS_USERPATH, CVAR_ROM, - "location of your game directories"); - fs_basegame = Cvar_Get ("fs_basegame", BASEGAME, CVAR_ROM, - "game to use by default"); Cmd_AddCommand ("gamedir", COM_Gamedir_f); /* @@ -1056,6 +1050,17 @@ COM_InitFilesystem ( void ) com_base_searchpaths = com_searchpaths; } +void +COM_Filesystem_Init_Cvars ( void ) +{ + fs_sharepath = Cvar_Get ("fs_sharepath", FS_SHAREPATH, CVAR_ROM, + "location of shared (read only) game directories"); + fs_userpath = Cvar_Get ("fs_userpath", FS_USERPATH, CVAR_ROM, + "location of your game directories"); + fs_basegame = Cvar_Get ("fs_basegame", BASEGAME, CVAR_ROM, + "game to use by default"); +} + /* ============ COM_SkipPath diff --git a/source/r_alias.c b/source/r_alias.c index 31e87f5..1a2fd4f 100644 --- a/source/r_alias.c +++ b/source/r_alias.c @@ -33,8 +33,7 @@ #include "console.h" #include "d_ifacea.h" #include "r_local.h" -#include "d_local.h" // FIXME: shouldn't be needed (is needed for patch - // right now, but that should move) +#include "skin.h" #define LIGHT_MIN 5 // lowest light value we'll allow, to avoid the // need for inner-loop light clamping diff --git a/source/r_efrag.c b/source/r_efrag.c index aaa6aff..98297c8 100644 --- a/source/r_efrag.c +++ b/source/r_efrag.c @@ -33,6 +33,7 @@ #include "console.h" #include "bothdefs.h" #include "r_local.h" +#include "cl_main.h" mnode_t *r_pefragtopnode; diff --git a/source/r_main.c b/source/r_main.c index 24ac156..8c49ee2 100644 --- a/source/r_main.c +++ b/source/r_main.c @@ -38,6 +38,9 @@ #include "screen.h" #include "console.h" #include "r_local.h" +#include "cl_cam.h" +#include "cl_main.h" +#include "view.h" #include @@ -167,10 +170,10 @@ void R_ZGraph (void); /* ================== -R_InitTextures +R_Textures_Init ================== */ -void R_InitTextures (void) +void R_Textures_Init (void) { int x,y, m; byte *dest; @@ -220,6 +223,34 @@ void R_Init (void) Cmd_AddCommand ("pointfile", R_ReadPointFile_f); Cmd_AddCommand ("loadsky", R_LoadSky_f); + Cvar_SetValue (r_maxedges, (float)NUMSTACKEDGES); + Cvar_SetValue (r_maxsurfs, (float)NUMSTACKSURFACES); + + view_clipplanes[0].leftedge = true; + view_clipplanes[1].rightedge = true; + view_clipplanes[1].leftedge = view_clipplanes[2].leftedge = + view_clipplanes[3].leftedge = false; + view_clipplanes[0].rightedge = view_clipplanes[2].rightedge = + view_clipplanes[3].rightedge = false; + + r_refdef.xOrigin = XCENTERING; + r_refdef.yOrigin = YCENTERING; + + R_InitParticles (); + +// TODO: collect 386-specific code in one place +#ifdef USE_INTEL_ASM + Sys_MakeCodeWriteable ((long)R_EdgeCodeStart, + (long)R_EdgeCodeEnd - (long)R_EdgeCodeStart); +#endif // USE_INTEL_ASM + + D_Init (); +} + +void R_Init_Cvars (void) +{ + D_Init_Cvars (); + r_draworder = Cvar_Get("r_draworder", "0", CVAR_NONE, "None"); r_speeds = Cvar_Get("r_speeds", "0", CVAR_NONE, "None"); r_timegraph = Cvar_Get("r_timegraph", "0", CVAR_NONE, "None"); @@ -244,28 +275,6 @@ void R_Init (void) r_aliastransadj = Cvar_Get("r_aliastransadj", "100", CVAR_NONE, "None"); gl_flashblend = Cvar_Get("gl_flashblend", "0", CVAR_NONE, "None"); // FIXME: remove this! --KB - Cvar_SetValue (r_maxedges, (float)NUMSTACKEDGES); - Cvar_SetValue (r_maxsurfs, (float)NUMSTACKSURFACES); - - view_clipplanes[0].leftedge = true; - view_clipplanes[1].rightedge = true; - view_clipplanes[1].leftedge = view_clipplanes[2].leftedge = - view_clipplanes[3].leftedge = false; - view_clipplanes[0].rightedge = view_clipplanes[2].rightedge = - view_clipplanes[3].rightedge = false; - - r_refdef.xOrigin = XCENTERING; - r_refdef.yOrigin = YCENTERING; - - R_InitParticles (); - -// TODO: collect 386-specific code in one place -#ifdef USE_INTEL_ASM - Sys_MakeCodeWriteable ((long)R_EdgeCodeStart, - (long)R_EdgeCodeEnd - (long)R_EdgeCodeStart); -#endif // USE_INTEL_ASM - - D_Init (); } /* diff --git a/source/r_misc.c b/source/r_misc.c index 177f646..471c9cd 100644 --- a/source/r_misc.c +++ b/source/r_misc.c @@ -37,6 +37,7 @@ #include "draw.h" #include "menu.h" #include "quakedef.h" +#include "cl_parse.h" qboolean allowskybox; // whether or not to allow skyboxes --KB diff --git a/source/r_part.c b/source/r_part.c index 371f077..c3e640f 100644 --- a/source/r_part.c +++ b/source/r_part.c @@ -34,6 +34,7 @@ #include "console.h" #include "quakefs.h" #include "quakedef.h" +#include "r_dynamic.h" #include @@ -149,6 +150,40 @@ void R_ReadPointFile_f (void) Con_Printf ("%i points read\n", c); } +void R_RunSpikeEffect (vec3_t pos, byte type) +{ + switch (type) { + case TE_WIZSPIKE: + R_RunParticleEffect (pos, 20, 30); + break; + case TE_KNIGHTSPIKE: + R_RunParticleEffect (pos, 226, 20); + break; + case TE_SPIKE: + R_RunParticleEffect (pos, 0, 10); + break; + case TE_SUPERSPIKE: + R_RunParticleEffect (pos, 0, 20); + break; + } +} + +void R_RunPuffEffect (vec3_t pos, byte type, byte cnt) +{ + switch (type) + { + case TE_GUNSHOT: + R_RunParticleEffect (pos, 0, 20*cnt); + break; + case TE_BLOOD: + R_RunParticleEffect (pos, 73, 20*cnt); + break; + case TE_LIGHTNINGBLOOD: + R_RunParticleEffect (pos, 225, 50); + break; + } +} + /* =============== R_ParticleExplosion @@ -244,7 +279,7 @@ R_RunParticleEffect =============== */ -void R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count) +void R_RunParticleEffect (vec3_t org, int color, int count) { int i, j; particle_t *p; @@ -272,7 +307,7 @@ void R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count) for (j=0 ; j<3 ; j++) { p->org[j] = org[j] + scale*((rand()&15)-8); - p->vel[j] = dir[j]*15;// + (rand()%300)-150; + p->vel[j] = vec3_origin[j];// + (rand()%300)-150; } } } diff --git a/source/r_view.c b/source/r_view.c index 9bf6ed7..3c7def8 100644 --- a/source/r_view.c +++ b/source/r_view.c @@ -789,6 +789,11 @@ void V_Init (void) Cmd_AddCommand ("bf", V_BonusFlash_f); Cmd_AddCommand ("centerview", V_StartPitchDrift); + BuildGammaTable (1.0, 1.0); // no gamma yet +} + +void V_Init_Cvars (void) +{ v_centermove = Cvar_Get("v_centermove", "0.15", CVAR_NONE, "None"); v_centerspeed = Cvar_Get("v_centerspeed", "500", CVAR_NONE, "None"); @@ -821,7 +826,6 @@ void V_Init (void) gl_cshiftpercent = Cvar_Get("gl_cshiftpercent", "100", CVAR_NONE, "None"); - BuildGammaTable (1.0, 1.0); // no gamma yet brightness = Cvar_Get("brightness", "1", CVAR_ARCHIVE, "None"); contrast = Cvar_Get("contrast", "1", CVAR_ARCHIVE, "None"); } diff --git a/source/sbar.c b/source/sbar.c index b0b70e7..d0e0eaf 100644 --- a/source/sbar.c +++ b/source/sbar.c @@ -40,6 +40,7 @@ #include "bothdefs.h" #include "va.h" #include "msg.h" +#include "cl_cam.h" #include #include diff --git a/source/screen.c b/source/screen.c index fe2fdad..12e5705 100644 --- a/source/screen.c +++ b/source/screen.c @@ -48,6 +48,9 @@ #include "sbar.h" #include "sys.h" #include "vid.h" +#include "skin.h" +#include "view.h" +#include "cl_parse.h" /* @@ -393,7 +396,7 @@ void SCR_SizeDown_f (void) SCR_Init ================== */ -void SCR_InitCvars (void) +void SCR_Init_Cvars (void) { scr_fov = Cvar_Get("fov", "90", CVAR_NONE, "None"); scr_viewsize = Cvar_Get("viewsize", "100", CVAR_ARCHIVE, "None"); diff --git a/source/skin.c b/source/skin.c index 8a5ea50..4825fea 100644 --- a/source/skin.c +++ b/source/skin.c @@ -39,6 +39,8 @@ #include "pcx.h" #include "sys.h" #include "va.h" +#include "skin.h" +#include "cl_parse.h" cvar_t *baseskin; cvar_t *noskins; diff --git a/source/snd_dma.c b/source/snd_dma.c index fe0d119..3fa52a1 100644 --- a/source/snd_dma.c +++ b/source/snd_dma.c @@ -198,17 +198,6 @@ void S_Init (void) Cmd_AddCommand("soundlist", S_SoundList); Cmd_AddCommand("soundinfo", S_SoundInfo_f); - nosound = Cvar_Get("nosound", "0", CVAR_NONE, "None"); - volume = Cvar_Get("volume", "0.7", CVAR_ARCHIVE, "None"); - precache = Cvar_Get("precache", "1", CVAR_NONE, "None"); - loadas8bit = Cvar_Get("loadas8bit", "0", CVAR_NONE, "None"); - bgmvolume = Cvar_Get("bgmvolume", "1", CVAR_ARCHIVE, "None"); - ambient_level = Cvar_Get("ambient_level", "0.3", CVAR_NONE, "None"); - ambient_fade = Cvar_Get("ambient_fade", "100", CVAR_NONE, "None"); - snd_noextraupdate = Cvar_Get("snd_noextraupdate", "0", CVAR_NONE, "None"); - snd_show = Cvar_Get("snd_show", "0", CVAR_NONE, "None"); - snd_interp = Cvar_Get("snd_interp", "1", CVAR_ARCHIVE, "control sample interpolation"); - _snd_mixahead = Cvar_Get("_snd_mixahead", "0.1", CVAR_ARCHIVE, "None"); if (COM_CheckParm("-nosound")) return; @@ -266,6 +255,21 @@ void S_Init (void) S_StopAllSounds (true); } +void S_Init_Cvars (void) +{ + nosound = Cvar_Get("nosound", "0", CVAR_NONE, "None"); + volume = Cvar_Get("volume", "0.7", CVAR_ARCHIVE, "None"); + precache = Cvar_Get("precache", "1", CVAR_NONE, "None"); + loadas8bit = Cvar_Get("loadas8bit", "0", CVAR_NONE, "None"); + bgmvolume = Cvar_Get("bgmvolume", "1", CVAR_ARCHIVE, "None"); + ambient_level = Cvar_Get("ambient_level", "0.3", CVAR_NONE, "None"); + ambient_fade = Cvar_Get("ambient_fade", "100", CVAR_NONE, "None"); + snd_noextraupdate = Cvar_Get("snd_noextraupdate", "0", CVAR_NONE, "None"); + snd_show = Cvar_Get("snd_show", "0", CVAR_NONE, "None"); + snd_interp = Cvar_Get("snd_interp", "1", CVAR_ARCHIVE, "control sample interpolation"); + _snd_mixahead = Cvar_Get("_snd_mixahead", "0.1", CVAR_ARCHIVE, "None"); +} + // ======================================================================= // Shutdown sound engine diff --git a/source/sv_main.c b/source/sv_main.c index dcc56d8..2319833 100644 --- a/source/sv_main.c +++ b/source/sv_main.c @@ -1892,6 +1892,7 @@ void SV_Init (quakeparms_t *parms) COM_Init (); + PR_Init_Cvars (); PR_Init (); Mod_Init (); diff --git a/source/sys_unix.c b/source/sys_unix.c index 1aa97de..e7e2990 100644 --- a/source/sys_unix.c +++ b/source/sys_unix.c @@ -101,7 +101,7 @@ void Sys_Printf (char *fmt, ...) unsigned char *p; - if (sys_nostdout->int_val) + if (sys_nostdout && sys_nostdout->int_val) return; va_start (argptr, fmt); diff --git a/source/teamplay.c b/source/teamplay.c index 2b296fe..29b8a10 100644 --- a/source/teamplay.c +++ b/source/teamplay.c @@ -299,7 +299,7 @@ void Team_NewMap () free(mapname); } -void Team_InitTeamplay (void) +void Team_Init_Cvars (void) { cl_deadbodyfilter = Cvar_Get("cl_deadbodyfilter", "0", CVAR_NONE, "Hide dead player models"); cl_gibfilter = Cvar_Get("cl_gibfilter", "0", CVAR_NONE, "Hide gibs"); diff --git a/source/vid_3dfxsvga.c b/source/vid_3dfxsvga.c index cc3ea39..3ca7b88 100644 --- a/source/vid_3dfxsvga.c +++ b/source/vid_3dfxsvga.c @@ -305,6 +305,11 @@ VID_Init(unsigned char *palette) vid.recalc_refdef = 1; // force a surface cache flush } +void +VID_Init_Cvars() +{ +} + void VID_ExtraOptionDraw(unsigned int options_draw_cursor) { diff --git a/source/vid_common_gl.c b/source/vid_common_gl.c index ee86cf0..1da4b47 100644 --- a/source/vid_common_gl.c +++ b/source/vid_common_gl.c @@ -381,11 +381,6 @@ VID_Init8bitPalette(void) } } -void -VID_InitCvars() -{ -} - void VID_LockBuffer ( void ) { diff --git a/source/vid_ggi.c b/source/vid_ggi.c index 5610376..666e71e 100644 --- a/source/vid_ggi.c +++ b/source/vid_ggi.c @@ -922,15 +922,22 @@ IN_Init(void) { JOY_Init (); - _windowed_mouse = Cvar_Get("_windowed_mouse", "0", CVAR_ARCHIVE, "None"); old_windowed_mouse = -1; /* Force update */ - m_filter = Cvar_Get("m_filter", "0", CVAR_ARCHIVE, "None"); if (COM_CheckParm ("-nomouse")) return; mouse_x = mouse_y = 0.0; mouse_avail = 1; } +void +IN_Init_Cvars(void) +{ + JOY_Init_Cvars (); + + _windowed_mouse = Cvar_Get("_windowed_mouse", "0", CVAR_ARCHIVE, "None"); + m_filter = Cvar_Get("m_filter", "0", CVAR_ARCHIVE, "None"); +} + void IN_Shutdown(void) @@ -1005,7 +1012,7 @@ IN_Move(usercmd_t *cmd) } -void VID_InitCvars(void) {} +void VID_Init_Cvars(void) {} void VID_LockBuffer(void) {} void VID_UnlockBuffer(void) {} diff --git a/source/vid_glx.c b/source/vid_glx.c index b5b37f7..14877ce 100644 --- a/source/vid_glx.c +++ b/source/vid_glx.c @@ -210,6 +210,12 @@ VID_Init (unsigned char *palette) vid.recalc_refdef = 1; // force a surface cache flush } +void +VID_Init_Cvars () +{ + x11_Init_Cvars(); +} + void VID_SetCaption (char *text) { diff --git a/source/vid_mgl.c b/source/vid_mgl.c index 2da339b..f2fa387 100644 --- a/source/vid_mgl.c +++ b/source/vid_mgl.c @@ -175,17 +175,6 @@ void VID_MenuKey (int key); LONG WINAPI MainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); void AppActivate(BOOL fActive, BOOL minimize); -/* -================ -VID_InitCvars -================ -*/ -void -VID_InitCvars () -{ - // It may not look like it, but this is important -} - /* ================ VID_RememberWindowPos @@ -2106,19 +2095,6 @@ void VID_Init (unsigned char *palette) int basenummodes; byte *ptmp; - vid_mode = Cvar_Get("vid_mode", "0", CVAR_NONE, "None"); - vid_nopageflip = Cvar_Get("vid_nopageflip", "0", CVAR_ARCHIVE, "None"); - _vid_default_mode_win = Cvar_Get("_vid_default_mode_win", "3", CVAR_ARCHIVE, "None"); - vid_config_x = Cvar_Get("vid_config_x", "800", CVAR_ARCHIVE, "None"); - vid_config_y = Cvar_Get("vid_config_y", "600", CVAR_ARCHIVE, "None"); - vid_stretch_by_2 = Cvar_Get("vid_stretch_by_2", "1", CVAR_ARCHIVE, "None"); - _windowed_mouse = Cvar_Get("_windowed_mouse", "0", CVAR_ARCHIVE, "None"); - vid_fullscreen_mode = Cvar_Get("vid_fullscreen_mode", "3", CVAR_ARCHIVE, "None"); - vid_windowed_mode = Cvar_Get("vid_windowed_mode", "0", CVAR_ARCHIVE, "None"); - block_switch = Cvar_Get("block_switch", "0", CVAR_ARCHIVE, "None"); - vid_window_x = Cvar_Get("vid_window_x", "0", CVAR_ARCHIVE, "None"); - vid_window_y = Cvar_Get("vid_window_y", "0", CVAR_ARCHIVE, "None"); - Cmd_AddCommand ("vid_testmode", VID_TestMode_f); Cmd_AddCommand ("vid_nummodes", VID_NumModes_f); Cmd_AddCommand ("vid_describecurrentmode", VID_DescribeCurrentMode_f); @@ -2219,6 +2195,22 @@ void VID_Init (unsigned char *palette) strcpy (badmode.modedesc, "Bad mode"); } +void VID_Init_Cvars () +{ + vid_mode = Cvar_Get("vid_mode", "0", CVAR_NONE, "None"); + vid_nopageflip = Cvar_Get("vid_nopageflip", "0", CVAR_ARCHIVE, "None"); + _vid_default_mode_win = Cvar_Get("_vid_default_mode_win", "3", CVAR_ARCHIVE, "None"); + vid_config_x = Cvar_Get("vid_config_x", "800", CVAR_ARCHIVE, "None"); + vid_config_y = Cvar_Get("vid_config_y", "600", CVAR_ARCHIVE, "None"); + vid_stretch_by_2 = Cvar_Get("vid_stretch_by_2", "1", CVAR_ARCHIVE, "None"); + _windowed_mouse = Cvar_Get("_windowed_mouse", "0", CVAR_ARCHIVE, "None"); + vid_fullscreen_mode = Cvar_Get("vid_fullscreen_mode", "3", CVAR_ARCHIVE, "None"); + vid_windowed_mode = Cvar_Get("vid_windowed_mode", "0", CVAR_ARCHIVE, "None"); + block_switch = Cvar_Get("block_switch", "0", CVAR_ARCHIVE, "None"); + vid_window_x = Cvar_Get("vid_window_x", "0", CVAR_ARCHIVE, "None"); + vid_window_y = Cvar_Get("vid_window_y", "0", CVAR_ARCHIVE, "None"); +} + void VID_Shutdown (void) { diff --git a/source/vid_null.c b/source/vid_null.c index 0244684..1e5ea1a 100644 --- a/source/vid_null.c +++ b/source/vid_null.c @@ -67,6 +67,10 @@ void VID_Init (unsigned char *palette) D_InitCaches (surfcache, sizeof(surfcache)); } +void VID_Init_Cvars () +{ +} + void VID_Shutdown (void) { } diff --git a/source/vid_sdl.c b/source/vid_sdl.c index f3bcb28..fa2ad68 100644 --- a/source/vid_sdl.c +++ b/source/vid_sdl.c @@ -134,8 +134,6 @@ VID_Init (unsigned char *palette) //Uint16 video_w, video_h; Uint32 flags; - vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ROM, "Toggles fullscreen game mode"); - // Load the SDL library if (SDL_Init(SDL_INIT_VIDEO)<0) //|SDL_INIT_AUDIO|SDL_INIT_CDROM) < 0) Sys_Error("VID: Couldn't load SDL: %s", SDL_GetError()); @@ -183,6 +181,12 @@ VID_Init (unsigned char *palette) #endif } +void +VID_Init_Cvars () +{ + vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ROM, "Toggles fullscreen game mode"); +} + void VID_Shutdown (void) { @@ -251,12 +255,6 @@ D_EndDirectRect (int x, int y, int width, int height) SDL_UpdateRect(screen, x, y, width, height); } -void -VID_InitCvars () -{ - // It may not look like it, but this is important -} - void VID_LockBuffer ( void ) { diff --git a/source/vid_sgl.c b/source/vid_sgl.c index 31d67ad..1c03649 100644 --- a/source/vid_sgl.c +++ b/source/vid_sgl.c @@ -122,8 +122,6 @@ VID_Init (unsigned char *palette) VID_GetWindowSize (640, 480); - vid_fullscreen = Cvar_Get ("vid_fullscreen","0",0,"None"); - vid.maxwarpwidth = WARP_WIDTH; vid.maxwarpheight = WARP_HEIGHT; vid.colormap = host_colormap; @@ -211,6 +209,12 @@ VID_Init (unsigned char *palette) vid.recalc_refdef = 1; // force a surface cache flush } +void +VID_Init_Cvars () +{ + vid_fullscreen = Cvar_Get ("vid_fullscreen","0",0,"None"); +} + void VID_SetCaption (char *text) { diff --git a/source/vid_svgalib.c b/source/vid_svgalib.c index 45bf5f0..34f7929 100644 --- a/source/vid_svgalib.c +++ b/source/vid_svgalib.c @@ -554,11 +554,6 @@ VID_Init(unsigned char *palette) VID_InitModes(); - vid_mode = Cvar_Get ("vid_mode","5",0,"None"); - vid_redrawfull = Cvar_Get ("vid_redrawfull","0",0,"None"); - vid_waitforrefresh = Cvar_Get ("vid_waitforrefresh","0", - CVAR_ARCHIVE,"None"); - Cmd_AddCommand("vid_nummodes", VID_NumModes_f); Cmd_AddCommand("vid_describemode", VID_DescribeMode_f); Cmd_AddCommand("vid_describemodes", VID_DescribeModes_f); @@ -599,6 +594,15 @@ VID_Init(unsigned char *palette) /* IN_Init(); */ } +void +VID_Init_Cvars () +{ + vid_mode = Cvar_Get ("vid_mode","5",0,"None"); + vid_redrawfull = Cvar_Get ("vid_redrawfull","0",0,"None"); + vid_waitforrefresh = Cvar_Get ("vid_waitforrefresh","0", + CVAR_ARCHIVE,"None"); +} + void VID_Update(vrect_t *rects) @@ -733,11 +737,6 @@ VID_ExtraOptionCmd(int option_cursor) #endif } -void VID_InitCvars () -{ - // It may not look like it, but this is important -} - void VID_LockBuffer ( void ) { diff --git a/source/vid_wgl.c b/source/vid_wgl.c index 39c1fdb..ba32809 100644 --- a/source/vid_wgl.c +++ b/source/vid_wgl.c @@ -168,17 +168,6 @@ cvar_t *_windowed_mouse; int window_center_x, window_center_y, window_x, window_y, window_width, window_height; RECT window_rect; -/* -================ -VID_InitCvars -================ -*/ -void -VID_InitCvars () -{ - // It may not look like it, but this is important -} - // direct draw software compatability stuff void VID_HandlePause (qboolean pause) @@ -1586,8 +1575,6 @@ void VID_Init (unsigned char *palette) memset(&devmode, 0, sizeof(devmode)); - _windowed_mouse = Cvar_Get("_windowed_mouse", "0", CVAR_ARCHIVE, "None"); - Cmd_AddCommand ("vid_nummodes", VID_NumModes_f); Cmd_AddCommand ("vid_describecurrentmode", VID_DescribeCurrentMode_f); Cmd_AddCommand ("vid_describemode", VID_DescribeMode_f); @@ -1825,6 +1812,12 @@ void VID_Init (unsigned char *palette) fullsbardraw = false; } +void +VID_Init_Cvars () +{ + _windowed_mouse = Cvar_Get("_windowed_mouse", "0", CVAR_ARCHIVE, "None"); +} + //======================================================== // Video menu stuff diff --git a/source/vid_x11.c b/source/vid_x11.c index 7443a4e..e778ac7 100644 --- a/source/vid_x11.c +++ b/source/vid_x11.c @@ -619,6 +619,12 @@ void VID_Init (unsigned char *palette) x11_add_event(x_shmeventtype, event_shm); } +void +VID_Init_Cvars () +{ + x11_Init_Cvars(); +} + void VID_ShiftPalette(unsigned char *p) @@ -768,12 +774,6 @@ VID_DitherOff (void) } } -void -VID_InitCvars (void) -{ - // It may not look like it, but this is important -} - void VID_LockBuffer ( void ) {