Cvar_RegisterVariable(&music_playlist_sampleposition[i]);
}
- Cmd_AddCommand(CMD_CLIENT | CMD_CLIENT_FROM_SERVER, "cd", CD_f, "execute a CD drive command (cd on/off/reset/remap/close/play/loop/stop/pause/resume/eject/info) - use cd by itself for usage");
+ Cmd_AddCommand(CF_CLIENT | CF_CLIENT_FROM_SERVER, "cd", CD_f, "execute a CD drive command (cd on/off/reset/remap/close/play/loop/stop/pause/resume/eject/info) - use cd by itself for usage");
-
- return 0;
}
int CDAudio_Startup (void)
extern cvar_t cdaudioinitialized;
int CDAudio_Init(void);
- void CDAudio_Play(int track, qboolean looping);
+void CDAudio_Init_Commands(void);
+ void CDAudio_Play(int track, qbool looping);
void CDAudio_Stop(void);
void CDAudio_Pause(void);
void CDAudio_Resume(void);
{
Con_Printf("Initializing client\n");
- R_Modules_Init();
+ Cvar_SetValueQuick(&host_isclient, 1);
+
Palette_Init();
-#ifdef CONFIG_MENU
- MR_Init_Commands();
-#endif
+
VID_Shared_Init();
VID_Init();
Render_Init();
r_refdef.scene.maxtempentities = MAX_TEMPENTITIES;
r_refdef.scene.tempentities = (entity_render_t *)Mem_Alloc(cls.permanentmempool, sizeof(entity_render_t) * r_refdef.scene.maxtempentities);
- CL_InitInput ();
+ Cvar_SetValueQuick(&qport, (rand() * RAND_MAX + rand()) & 0xffff);
+
+ CL_Screen_Init();
+ CL_MeshEntities_Init();
+
+ CL_Video_Init();
+
+ host.hook.ConnectLocal = CL_EstablishConnection_Local;
-
- #ifdef CONFIG_MENU
- Cbuf_InsertText(&cmd_client,"menu_start\n");
- #endif
++ host.hook.ConnectLocal = CL_EstablishConnection_Local;
++ host.hook.Disconnect = CL_Disconnect;
++ host.hook.CL_Intermission = CL_Intermission;
++ host.hook.ToggleMenu = CL_ToggleMenu_Hook;
+ }
+}
+
+void CL_Init_Commands(void)
+{
+ if (cls.state == ca_dedicated)
+ {
- Cmd_AddCommand(CMD_SERVER, "disconnect", CL_Disconnect_f, "disconnect from server (or disconnect all clients if running a server)");
++ Cmd_AddCommand(CF_SERVER, "disconnect", CL_Disconnect_f, "disconnect from server (or disconnect all clients if running a server)");
+ }
+ else
+ {
+ //
+ // register our commands
+ //
+ R_Modules_Init();
+ Palette_Init_Commands();
+#ifdef CONFIG_MENU
+ MR_Init_Commands();
+#endif
+ VID_Shared_Init_Commands();
+ VID_Init_Commands();
+ Render_Init_Commands();
+ S_Init_Commands();
+ CDAudio_Init_Commands();
+ Key_Init_Commands();
+ V_Init();
+
+ CL_InitInput();
+ CL_Demo_Init();
+ CL_Parse_Init();
+ CL_Particles_Init();
+ CL_Screen_Init_Commands();
+ CL_Video_Init_Commands();
- //
- // register our commands
- //
- CL_InitCommands();
+ CL_InitServer_Commands();
Cvar_RegisterVariable (&cl_upspeed);
Cvar_RegisterVariable (&cl_forwardspeed);
Cvar_RegisterVariable (&cl_itembobspeed);
Cvar_RegisterVariable (&cl_itembobheight);
- Cmd_AddCommand(CMD_CLIENT, "entities", CL_PrintEntities_f, "print information on network entities known to client");
- Cmd_AddCommand(CMD_CLIENT, "disconnect", CL_Disconnect_f, "disconnect from server (or disconnect all clients if running a server)");
- Cmd_AddCommand(CMD_CLIENT, "connect", CL_Connect_f, "connect to a server by IP address or hostname");
- Cmd_AddCommand(CMD_CLIENT | CMD_CLIENT_FROM_SERVER, "reconnect", CL_Reconnect_f, "reconnect to the last server you were on, or resets a quakeworld connection (do not use if currently playing on a netquake server)");
-
- CL_Demo_Init();
-
+ Cmd_AddCommand(CF_CLIENT, "entities", CL_PrintEntities_f, "print information on network entities known to client");
+ Cmd_AddCommand(CF_CLIENT, "disconnect", CL_Disconnect_f, "disconnect from server (or disconnect all clients if running a server)");
+ Cmd_AddCommand(CF_CLIENT, "connect", CL_Connect_f, "connect to a server by IP address or hostname");
+ Cmd_AddCommand(CF_CLIENT | CF_CLIENT_FROM_SERVER, "reconnect", CL_Reconnect_f, "reconnect to the last server you were on, or resets a quakeworld connection (do not use if currently playing on a netquake server)");
// Support Client-side Model Index List
- Cmd_AddCommand(CMD_CLIENT, "cl_modelindexlist", CL_ModelIndexList_f, "list information on all models in the client modelindex");
+ Cmd_AddCommand(CF_CLIENT, "cl_modelindexlist", CL_ModelIndexList_f, "list information on all models in the client modelindex");
// Support Client-side Sound Index List
- Cmd_AddCommand(CMD_CLIENT, "cl_soundindexlist", CL_SoundIndexList_f, "list all sounds in the client soundindex");
+ Cmd_AddCommand(CF_CLIENT, "cl_soundindexlist", CL_SoundIndexList_f, "list all sounds in the client soundindex");
- Cmd_AddCommand(CMD_CLIENT, "fog", CL_Fog_f, "set global fog parameters (density red green blue [alpha [mindist [maxdist [top [fadedepth]]]]])");
- Cmd_AddCommand(CMD_CLIENT, "fog_heighttexture", CL_Fog_HeightTexture_f, "set global fog parameters (density red green blue alpha mindist maxdist top depth textures/mapname/fogheight.tga)");
+ Cmd_AddCommand(CF_CLIENT, "fog", CL_Fog_f, "set global fog parameters (density red green blue [alpha [mindist [maxdist [top [fadedepth]]]]])");
+ Cmd_AddCommand(CF_CLIENT, "fog_heighttexture", CL_Fog_HeightTexture_f, "set global fog parameters (density red green blue alpha mindist maxdist top depth textures/mapname/fogheight.tga)");
- Cmd_AddCommand(CMD_CLIENT, "cl_areastats", CL_AreaStats_f, "prints statistics on entity culling during collision traces");
+ Cmd_AddCommand(CF_CLIENT, "cl_areastats", CL_AreaStats_f, "prints statistics on entity culling during collision traces");
Cvar_RegisterVariable(&r_draweffects);
Cvar_RegisterVariable(&cl_explosions_alpha_start);
// for QW connections
Cvar_RegisterVariable(&qport);
- Cvar_SetValueQuick(&qport, (rand() * RAND_MAX + rand()) & 0xffff);
- Cmd_AddCommand(CMD_CLIENT, "timerefresh", CL_TimeRefresh_f, "turn quickly and print rendering statistcs");
+ Cmd_AddCommand(CF_CLIENT, "timerefresh", CL_TimeRefresh_f, "turn quickly and print rendering statistcs");
Cvar_RegisterVariable(&cl_locs_enable);
Cvar_RegisterVariable(&cl_locs_show);
}
void CL_Screen_Init(void)
- if (COM_CheckParm ("-noconsole"))
+{
+ // if we want no console, turn it off here too
++ if (Sys_CheckParm ("-noconsole"))
+ Cvar_SetQuick(&scr_conforcewhiledisconnected, "0");
+
+#ifdef CONFIG_VIDEO_CAPTURE
+ SCR_CaptureVideo_Ogg_Init();
+#endif
+
+ scr_initialized = true;
+}
+
+void CL_Screen_Init_Commands(void)
{
int i;
Cvar_RegisterVariable (&scr_fov);
Cvar_RegisterVariable(&r_speeds_graph_height);
Cvar_RegisterVariable(&r_speeds_graph_maxtimedelta);
Cvar_RegisterVariable(&r_speeds_graph_maxdefault);
- Cmd_AddCommand(CMD_CLIENT, "sizeup",SCR_SizeUp_f, "increase view size (increases viewsize cvar)");
- Cmd_AddCommand(CMD_CLIENT, "sizedown",SCR_SizeDown_f, "decrease view size (decreases viewsize cvar)");
- Cmd_AddCommand(CMD_CLIENT, "screenshot",SCR_ScreenShot_f, "takes a screenshot of the next rendered frame");
- Cmd_AddCommand(CMD_CLIENT, "envmap", R_Envmap_f, "render a cubemap (skybox) of the current scene");
- Cmd_AddCommand(CMD_CLIENT, "infobar", SCR_InfoBar_f, "display a text in the infobar (usage: infobar expiretime string)");
+
- // if we want no console, turn it off here too
- if (Sys_CheckParm ("-noconsole"))
- Cvar_SetQuick(&scr_conforcewhiledisconnected, "0");
-
+ Cmd_AddCommand(CF_CLIENT, "sizeup",SCR_SizeUp_f, "increase view size (increases viewsize cvar)");
+ Cmd_AddCommand(CF_CLIENT, "sizedown",SCR_SizeDown_f, "decrease view size (decreases viewsize cvar)");
+ Cmd_AddCommand(CF_CLIENT, "screenshot",SCR_ScreenShot_f, "takes a screenshot of the next rendered frame");
+ Cmd_AddCommand(CF_CLIENT, "envmap", R_Envmap_f, "render a cubemap (skybox) of the current scene");
+ Cmd_AddCommand(CF_CLIENT, "infobar", SCR_InfoBar_f, "display a text in the infobar (usage: infobar expiretime string)");
-
-#ifdef CONFIG_VIDEO_CAPTURE
- SCR_CaptureVideo_Ogg_Init();
-#endif
-
- scr_initialized = true;
}
/*
bgra.i = 0;bgra.b[1] = 0xFF;cl_videogmask = bgra.i;
bgra.i = 0;bgra.b[2] = 0xFF;cl_videormask = bgra.i;
- Cmd_AddCommand(CMD_CLIENT, "playvideo", CL_PlayVideo_f, "play a .dpv video file" );
- Cmd_AddCommand(CMD_CLIENT, "stopvideo", CL_StopVideo_f, "stop playing a .dpv video file" );
+ R_RegisterModule( "CL_Video", cl_video_start, cl_video_shutdown, cl_video_newmap, NULL, NULL );
+
+ LibAvW_OpenLibrary();
+}
+
+void CL_Video_Init_Commands(void)
+{
+ Cmd_AddCommand(CF_CLIENT, "playvideo", CL_PlayVideo_f, "play a .dpv video file" );
+ Cmd_AddCommand(CF_CLIENT, "stopvideo", CL_StopVideo_f, "stop playing a .dpv video file" );
Cvar_RegisterVariable(&cl_video_subtitles);
Cvar_RegisterVariable(&cl_video_subtitles_lines);
void CL_Shutdown (void);
void CL_Init (void);
+void CL_Init_Commands(void);
+ void CL_StartVideo(void);
+
void CL_EstablishConnection(const char *host, int firstarg);
void CL_Disconnect (void);
logqueue = (unsigned char *)Mem_Alloc (tempmempool, logq_size);
logq_ind = 0;
- if (COM_CheckParm ("-condebug") != 0)
+ // support for the classic Quake option
+// COMMANDLINEOPTION: Console: -condebug logs console messages to qconsole.log, see also log_file
++ if (Sys_CheckParm ("-condebug") != 0)
+ Cvar_SetQuick (&log_file, "qconsole.log");
+
+ con_initialized = true;
+ // initialize console window (only used by sys_win.c)
+ Sys_InitConsole();
+
+ Con_Print("Console initialized.\n");
+}
+
+void Con_Init_Commands(void)
+{
Cvar_RegisterVariable (&sys_colortranslation);
Cvar_RegisterVariable (&sys_specialcharactertranslation);
Cvar_RegisterVariable(&rcon_password);
// register our commands
- Cmd_AddCommand(CMD_CLIENT, "toggleconsole", Con_ToggleConsole_f, "opens or closes the console");
- Cmd_AddCommand(CMD_CLIENT, "messagemode", Con_MessageMode_f, "input a chat message to say to everyone");
- Cmd_AddCommand(CMD_CLIENT, "messagemode2", Con_MessageMode2_f, "input a chat message to say to only your team");
- Cmd_AddCommand(CMD_CLIENT, "commandmode", Con_CommandMode_f, "input a console command");
- Cmd_AddCommand(CMD_SHARED, "clear", Con_Clear_f, "clear console history");
- Cmd_AddCommand(CMD_SHARED, "maps", Con_Maps_f, "list information about available maps");
- Cmd_AddCommand(CMD_SHARED, "condump", Con_ConDump_f, "output console history to a file (see also log_file)");
+ Cmd_AddCommand(CF_CLIENT, "toggleconsole", Con_ToggleConsole_f, "opens or closes the console");
+ Cmd_AddCommand(CF_CLIENT, "messagemode", Con_MessageMode_f, "input a chat message to say to everyone");
+ Cmd_AddCommand(CF_CLIENT, "messagemode2", Con_MessageMode2_f, "input a chat message to say to only your team");
+ Cmd_AddCommand(CF_CLIENT, "commandmode", Con_CommandMode_f, "input a console command");
+ Cmd_AddCommand(CF_SHARED, "clear", Con_Clear_f, "clear console history");
+ Cmd_AddCommand(CF_SHARED, "maps", Con_Maps_f, "list information about available maps");
+ Cmd_AddCommand(CF_SHARED, "condump", Con_ConDump_f, "output console history to a file (see also log_file)");
-
- con_initialized = true;
- // initialize console window (only used by sys_win.c)
- Sys_InitConsole();
-
- Con_Print("Console initialized.\n");
}
void Con_Shutdown (void)
Cvar_RegisterVariable(&gl_paranoid);
Cvar_RegisterVariable(&gl_printcheckerror);
- Cmd_AddCommand(CMD_CLIENT, "gl_vbostats", GL_VBOStats_f, "prints a list of all buffer objects (vertex data and triangle elements) and total video memory used by them");
+ Cmd_AddCommand(CF_CLIENT, "gl_vbostats", GL_VBOStats_f, "prints a list of all buffer objects (vertex data and triangle elements) and total video memory used by them");
-
- R_RegisterModule("GL_Backend", gl_backend_start, gl_backend_shutdown, gl_backend_newmap, gl_backend_devicelost, gl_backend_devicerestored);
}
- void GL_SetMirrorState(qboolean state);
+ void GL_SetMirrorState(qbool state);
void R_Viewport_TransformToScreen(const r_viewport_t *v, const vec4_t in, vec4_t out)
{
R_RegisterModule("GL_Draw", gl_draw_start, gl_draw_shutdown, gl_draw_newmap, NULL, NULL);
}
- Cmd_AddCommand(CMD_CLIENT, "loadfont", LoadFont_f, "loadfont function tganame loads a font; example: loadfont console gfx/veramono; loadfont without arguments lists the available functions");
+void GL_Draw_Init_Commands(void)
+{
+ Cvar_RegisterVariable(&r_font_postprocess_blur);
+ Cvar_RegisterVariable(&r_font_postprocess_outline);
+ Cvar_RegisterVariable(&r_font_postprocess_shadow_x);
+ Cvar_RegisterVariable(&r_font_postprocess_shadow_y);
+ Cvar_RegisterVariable(&r_font_postprocess_shadow_z);
+ Cvar_RegisterVariable(&r_font_hinting);
+ Cvar_RegisterVariable(&r_font_antialias);
+ Cvar_RegisterVariable(&r_textshadow);
+ Cvar_RegisterVariable(&r_textbrightness);
+ Cvar_RegisterVariable(&r_textcontrast);
+ Cvar_RegisterVariable(&r_nearest_2d);
+ Cvar_RegisterVariable(&r_nearest_conchars);
++ Cmd_AddCommand(CF_CLIENT, "loadfont", LoadFont_f, "loadfont function tganame loads a font; example: loadfont console gfx/veramono; loadfont without arguments lists the available functions");
+}
+
void DrawQ_Start(void)
{
r_refdef.draw2dstage = 1;
r_main_mempool = Mem_AllocPool("Renderer", 0, NULL);
R_InitShaderModeInfo();
- Cmd_AddCommand(CMD_CLIENT, "r_glsl_restart", R_GLSL_Restart_f, "unloads GLSL shaders, they will then be reloaded as needed");
- Cmd_AddCommand(CMD_CLIENT, "r_glsl_dumpshader", R_GLSL_DumpShader_f, "dumps the engine internal default.glsl shader into glsl/default.glsl");
+ if (gamemode == GAME_NEHAHRA || gamemode == GAME_TENEBRAE)
+ Cvar_SetValue(&cvars_all, "r_fullbrights", 0);
+
+ R_RegisterModule("GL_Main", gl_main_start, gl_main_shutdown, gl_main_newmap, NULL, NULL);
+}
+
+void GL_Main_Init_Commands(void)
+{
+ Cmd_AddCommand(CF_CLIENT, "r_glsl_restart", R_GLSL_Restart_f, "unloads GLSL shaders, they will then be reloaded as needed");
+ Cmd_AddCommand(CF_CLIENT, "r_glsl_dumpshader", R_GLSL_DumpShader_f, "dumps the engine internal default.glsl shader into glsl/default.glsl");
// FIXME: the client should set up r_refdef.fog stuff including the fogmasktable
if (gamemode == GAME_NEHAHRA)
{
void R_Textures_Init (void)
+{
+ R_RegisterModule("R_Textures", r_textures_start, r_textures_shutdown, r_textures_newmap, r_textures_devicelost, r_textures_devicerestored);
+}
+
+void R_Textures_Init_Commands(void)
{
- Cmd_AddCommand(CMD_CLIENT, "gl_texturemode", &GL_TextureMode_f, "set texture filtering mode (GL_NEAREST, GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, etc); an additional argument 'force' forces the texture mode even in cases where it may not be appropriate");
- Cmd_AddCommand(CMD_CLIENT, "r_texturestats", R_TextureStats_f, "print information about all loaded textures and some statistics");
+ Cmd_AddCommand(CF_CLIENT, "gl_texturemode", &GL_TextureMode_f, "set texture filtering mode (GL_NEAREST, GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, etc); an additional argument 'force' forces the texture mode even in cases where it may not be appropriate");
+ Cmd_AddCommand(CF_CLIENT, "r_texturestats", R_TextureStats_f, "print information about all loaded textures and some statistics");
Cvar_RegisterVariable (&gl_max_size);
Cvar_RegisterVariable (&gl_picmip);
Cvar_RegisterVariable (&gl_picmip_world);
void Host_LoadConfig_f(cmd_state_t *cmd);
extern cvar_t sv_writepicture_quality;
extern cvar_t r_texture_jpeg_fastpicmip;
-static void Host_InitLocal (void)
+static void Host_InitLocal_Commands (void)
{
- Cmd_AddCommand(CMD_SHARED, "quit", Host_Quit_f, "quit the game");
- Cmd_AddCommand(CMD_SHARED, "version", Host_Version_f, "print engine version");
- Cmd_AddCommand(CMD_SHARED, "saveconfig", Host_SaveConfig_f, "save settings to config.cfg (or a specified filename) immediately (also automatic when quitting)");
- Cmd_AddCommand(CMD_SHARED, "loadconfig", Host_LoadConfig_f, "reset everything and reload configs");
+ Cmd_AddCommand(CF_SHARED, "quit", Host_Quit_f, "quit the game");
+ Cmd_AddCommand(CF_SHARED, "version", Host_Version_f, "print engine version");
+ Cmd_AddCommand(CF_SHARED, "saveconfig", Host_SaveConfig_f, "save settings to config.cfg (or a specified filename) immediately (also automatic when quitting)");
+ Cmd_AddCommand(CF_SHARED, "loadconfig", Host_LoadConfig_f, "reset everything and reload configs");
Cvar_RegisterVariable (&cl_maxphysicsframesperserverframe);
Cvar_RegisterVariable (&host_framerate);
Cvar_RegisterCallback (&host_framerate, Host_Framerate_c);
}
// COMMANDLINEOPTION: Console: -nostdout disables text output to the terminal the game was launched from
- if (COM_CheckParm("-nostdout"))
+ if (Sys_CheckParm("-nostdout"))
sys_nostdout = 1;
+ /* FIXME: We don't know if we're dedicated until after cvars are initialized
+ * yet we use this to gate off some cvars. Setting this early.
+ */
+ if(!cl_available)
+ cls.state = ca_dedicated;
+
// initialize console command/cvar/alias/command execution systems
Cmd_Init();
Mod_Init();
World_Init();
SV_Init();
- Host_ServerOptions();
- Host_InitLocal();
Thread_Init();
- TaskQueue_Init();
CL_Init();
extern char chat_buffer[MAX_INPUTLINE];
extern int chat_bufferpos;
- int Key_ClearEditLine(qboolean is_console);
+ int Key_ClearEditLine(qbool is_console);
void Key_WriteBindings(qfile_t *f);
void Key_Init(void);
+void Key_Init_Commands(void);
void Key_Shutdown(void);
- void Key_Event(int key, int ascii, qboolean down);
-void Key_Init_Cvars(void);
+ void Key_Event(int key, int ascii, qbool down);
void Key_ReleaseAll (void);
void Key_ReleaseAll_f(cmd_state_t *cmd);
void Key_EventQueue_Block(void);
static texture_t mod_q1bsp_texture_slime;
static texture_t mod_q1bsp_texture_water;
- static qboolean Mod_Q3BSP_TraceLineOfSight(struct model_s *model, const vec3_t start, const vec3_t end, const vec3_t acceptmins, const vec3_t acceptmaxs);
+ static qbool Mod_Q3BSP_TraceLineOfSight(struct model_s *model, const vec3_t start, const vec3_t end, const vec3_t acceptmins, const vec3_t acceptmaxs);
void Mod_BrushInit(void)
+{
+ // these games were made for older DP engines and are no longer
+ // maintained; use this hack to show their textures properly
+ if(gamemode == GAME_NEXUIZ)
+ Cvar_SetQuick(&mod_q3shader_force_addalpha, "1");
+
+ memset(&mod_q1bsp_texture_solid, 0, sizeof(mod_q1bsp_texture_solid));
+ strlcpy(mod_q1bsp_texture_solid.name, "solid" , sizeof(mod_q1bsp_texture_solid.name));
+ mod_q1bsp_texture_solid.surfaceflags = 0;
+ mod_q1bsp_texture_solid.supercontents = SUPERCONTENTS_SOLID;
+
+ mod_q1bsp_texture_sky = mod_q1bsp_texture_solid;
+ strlcpy(mod_q1bsp_texture_sky.name, "sky", sizeof(mod_q1bsp_texture_sky.name));
+ mod_q1bsp_texture_sky.surfaceflags = Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT | Q3SURFACEFLAG_NOMARKS | Q3SURFACEFLAG_NODLIGHT | Q3SURFACEFLAG_NOLIGHTMAP;
+ mod_q1bsp_texture_sky.supercontents = SUPERCONTENTS_SKY | SUPERCONTENTS_NODROP;
+
+ mod_q1bsp_texture_lava = mod_q1bsp_texture_solid;
+ strlcpy(mod_q1bsp_texture_lava.name, "*lava", sizeof(mod_q1bsp_texture_lava.name));
+ mod_q1bsp_texture_lava.surfaceflags = Q3SURFACEFLAG_NOMARKS;
+ mod_q1bsp_texture_lava.supercontents = SUPERCONTENTS_LAVA | SUPERCONTENTS_NODROP;
+
+ mod_q1bsp_texture_slime = mod_q1bsp_texture_solid;
+ strlcpy(mod_q1bsp_texture_slime.name, "*slime", sizeof(mod_q1bsp_texture_slime.name));
+ mod_q1bsp_texture_slime.surfaceflags = Q3SURFACEFLAG_NOMARKS;
+ mod_q1bsp_texture_slime.supercontents = SUPERCONTENTS_SLIME;
+
+ mod_q1bsp_texture_water = mod_q1bsp_texture_solid;
+ strlcpy(mod_q1bsp_texture_water.name, "*water", sizeof(mod_q1bsp_texture_water.name));
+ mod_q1bsp_texture_water.surfaceflags = Q3SURFACEFLAG_NOMARKS;
+ mod_q1bsp_texture_water.supercontents = SUPERCONTENTS_WATER;
+}
+
+void Mod_BrushInit_Commands(void)
{
// Cvar_RegisterVariable(&r_subdivide_size);
Cvar_RegisterVariable(&mod_bsp_portalize);
Cvar_RegisterVariable(&mod_q3shader_force_terrain_alphaflag);
Cvar_RegisterVariable(&mod_q1bsp_polygoncollisions);
Cvar_RegisterVariable(&mod_recalculatenodeboxes);
-
- // these games were made for older DP engines and are no longer
- // maintained; use this hack to show their textures properly
- if(gamemode == GAME_NEXUIZ)
- Cvar_SetQuick(&mod_q3shader_force_addalpha, "1");
-
- memset(&mod_q1bsp_texture_solid, 0, sizeof(mod_q1bsp_texture_solid));
- strlcpy(mod_q1bsp_texture_solid.name, "solid" , sizeof(mod_q1bsp_texture_solid.name));
- mod_q1bsp_texture_solid.surfaceflags = 0;
- mod_q1bsp_texture_solid.supercontents = SUPERCONTENTS_SOLID;
-
- mod_q1bsp_texture_sky = mod_q1bsp_texture_solid;
- strlcpy(mod_q1bsp_texture_sky.name, "sky", sizeof(mod_q1bsp_texture_sky.name));
- mod_q1bsp_texture_sky.surfaceflags = Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT | Q3SURFACEFLAG_NOMARKS | Q3SURFACEFLAG_NODLIGHT | Q3SURFACEFLAG_NOLIGHTMAP;
- mod_q1bsp_texture_sky.supercontents = SUPERCONTENTS_SKY | SUPERCONTENTS_NODROP;
-
- mod_q1bsp_texture_lava = mod_q1bsp_texture_solid;
- strlcpy(mod_q1bsp_texture_lava.name, "*lava", sizeof(mod_q1bsp_texture_lava.name));
- mod_q1bsp_texture_lava.surfaceflags = Q3SURFACEFLAG_NOMARKS;
- mod_q1bsp_texture_lava.supercontents = SUPERCONTENTS_LAVA | SUPERCONTENTS_NODROP;
-
- mod_q1bsp_texture_slime = mod_q1bsp_texture_solid;
- strlcpy(mod_q1bsp_texture_slime.name, "*slime", sizeof(mod_q1bsp_texture_slime.name));
- mod_q1bsp_texture_slime.surfaceflags = Q3SURFACEFLAG_NOMARKS;
- mod_q1bsp_texture_slime.supercontents = SUPERCONTENTS_SLIME;
-
- mod_q1bsp_texture_water = mod_q1bsp_texture_solid;
- strlcpy(mod_q1bsp_texture_water.name, "*water", sizeof(mod_q1bsp_texture_water.name));
- mod_q1bsp_texture_water.surfaceflags = Q3SURFACEFLAG_NOMARKS;
- mod_q1bsp_texture_water.supercontents = SUPERCONTENTS_WATER;
}
- static mleaf_t *Mod_BSP_PointInLeaf(dp_model_t *model, const vec3_t p)
+ static mleaf_t *Mod_BSP_PointInLeaf(model_t *model, const vec3_t p)
{
mnode_t *node;
} modloader_t;
// sky/water subdivision
- //extern cvar_t gl_subdivide_size;
+ //extern struct cvar_s gl_subdivide_size;
// texture fullbrights
- extern cvar_t r_fullbrights;
-
- extern cvar_t mod_noshader_default_offsetmapping;
- extern cvar_t mod_q3shader_default_offsetmapping;
- extern cvar_t mod_q3shader_default_offsetmapping_scale;
- extern cvar_t mod_q3shader_default_offsetmapping_bias;
- extern cvar_t mod_q3shader_default_polygonoffset;
- extern cvar_t mod_q3shader_default_polygonfactor;
- extern cvar_t mod_q3shader_default_refractive_index;
- extern cvar_t mod_q3shader_force_addalpha;
- extern cvar_t mod_q3shader_force_terrain_alphaflag;
- extern cvar_t mod_q3bsp_lightgrid_texture;
- extern cvar_t mod_q3bsp_lightgrid_world_surfaces;
- extern cvar_t mod_q3bsp_lightgrid_bsp_surfaces;
+ extern struct cvar_s r_fullbrights;
+
+ extern struct cvar_s mod_noshader_default_offsetmapping;
+ extern struct cvar_s mod_q3shader_default_offsetmapping;
+ extern struct cvar_s mod_q3shader_default_offsetmapping_scale;
+ extern struct cvar_s mod_q3shader_default_offsetmapping_bias;
+ extern struct cvar_s mod_q3shader_default_polygonoffset;
+ extern struct cvar_s mod_q3shader_default_polygonfactor;
+ extern struct cvar_s mod_q3shader_default_refractive_index;
+ extern struct cvar_s mod_q3shader_force_addalpha;
+ extern struct cvar_s mod_q3shader_force_terrain_alphaflag;
+ extern struct cvar_s mod_q3bsp_lightgrid_texture;
+ extern struct cvar_s mod_q3bsp_lightgrid_world_surfaces;
+ extern struct cvar_s mod_q3bsp_lightgrid_bsp_surfaces;
void Mod_Init (void);
+void Mod_Init_Commands (void);
void Mod_Reload (void);
- dp_model_t *Mod_LoadModel(dp_model_t *mod, qboolean crash, qboolean checkdisk);
- dp_model_t *Mod_FindName (const char *name, const char *parentname);
- dp_model_t *Mod_ForName (const char *name, qboolean crash, qboolean checkdisk, const char *parentname);
- void Mod_UnloadModel (dp_model_t *mod);
+ model_t *Mod_LoadModel(model_t *mod, qbool crash, qbool checkdisk);
+ model_t *Mod_FindName (const char *name, const char *parentname);
+ model_t *Mod_ForName (const char *name, qbool crash, qbool checkdisk, const char *parentname);
+ void Mod_UnloadModel (model_t *mod);
void Mod_ClearUsed(void);
void Mod_PurgeUnused(void);
struct frameblend_s;
struct skeleton_s;
void Mod_AliasInit(void);
- int Mod_Alias_GetTagMatrix(const dp_model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, int tagindex, matrix4x4_t *outmatrix);
- int Mod_Alias_GetTagIndexForName(const dp_model_t *model, unsigned int skin, const char *tagname);
- int Mod_Alias_GetExtendedTagInfoForIndex(const dp_model_t *model, unsigned int skin, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, int tagindex, int *parentindex, const char **tagname, matrix4x4_t *tag_localmatrix);
+void Mod_AliasInit_Commands(void);
+ int Mod_Alias_GetTagMatrix(const model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, int tagindex, matrix4x4_t *outmatrix);
+ int Mod_Alias_GetTagIndexForName(const model_t *model, unsigned int skin, const char *tagname);
+ int Mod_Alias_GetExtendedTagInfoForIndex(const model_t *model, unsigned int skin, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, int tagindex, int *parentindex, const char **tagname, matrix4x4_t *tag_localmatrix);
void Mod_Skeletal_FreeBuffers(void);
// sprite models
-void Mod_SpriteInit(void);
+void Mod_SpriteInit_Commands(void);
// loaders
- void Mod_2PSB_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_BSP2_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_HLBSP_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_Q1BSP_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_IBSP_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_MAP_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_OBJ_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_IDP0_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_IDP2_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_IDP3_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_ZYMOTICMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_DARKPLACESMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_PSKMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_IDSP_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_IDS2_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_INTERQUAKEMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend);
+ void Mod_2PSB_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_BSP2_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_HLBSP_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_Q1BSP_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_IBSP_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_MAP_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_OBJ_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_IDP0_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_IDP2_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_IDP3_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_ZYMOTICMODEL_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_DARKPLACESMODEL_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_PSKMODEL_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_IDSP_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_IDS2_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_INTERQUAKEMODEL_Load(model_t *mod, void *buffer, void *bufferend);
#endif // MODEL_SHARED_H
int i;
lhnetaddress_t tempaddress;
netconn_mempool = Mem_AllocPool("network connections", 0, NULL);
- if ((i = COM_CheckParm("-ip")) && i + 1 < sys.argc)
+
+// COMMANDLINEOPTION: Server: -ip <ipaddress> sets the ip address of this machine for purposes of networking (default 0.0.0.0 also known as INADDR_ANY), use only if you have multiple network adapters and need to choose one specifically.
- if (((i = COM_CheckParm("-port")) || (i = COM_CheckParm("-ipport")) || (i = COM_CheckParm("-udpport"))) && i + 1 < sys.argc)
++ if ((i = Sys_CheckParm("-ip")) && i + 1 < sys.argc)
+ {
+ if (LHNETADDRESS_FromString(&tempaddress, sys.argv[i + 1], 0) == 1)
+ {
+ Con_Printf("-ip option used, setting net_address to \"%s\"\n", sys.argv[i + 1]);
+ Cvar_SetQuick(&net_address, sys.argv[i + 1]);
+ }
+ else
+ Con_Printf(CON_ERROR "-ip option used, but unable to parse the address \"%s\"\n", sys.argv[i + 1]);
+ }
+// COMMANDLINEOPTION: Server: -port <portnumber> sets the port to use for a server (default 26000, the same port as QUAKE itself), useful if you host multiple servers on your machine
- Cmd_AddCommand(CMD_SHARED, "net_stats", Net_Stats_f, "print network statistics");
++ if (((i = Sys_CheckParm("-port")) || (i = Sys_CheckParm("-ipport")) || (i = Sys_CheckParm("-udpport"))) && i + 1 < sys.argc)
+ {
+ i = atoi(sys.argv[i + 1]);
+ if (i >= 0 && i < 65536)
+ {
+ Con_Printf("-port option used, setting port cvar to %i\n", i);
+ Cvar_SetValueQuick(&sv_netport, i);
+ }
+ else
+ Con_Printf(CON_ERROR "-port option used, but %i is not a valid port number\n", i);
+ }
+ cl_numsockets = 0;
+ sv_numsockets = 0;
+ cl_message.data = cl_message_buf;
+ cl_message.maxsize = sizeof(cl_message_buf);
+ cl_message.cursize = 0;
+ sv_message.data = sv_message_buf;
+ sv_message.maxsize = sizeof(sv_message_buf);
+ sv_message.cursize = 0;
+ LHNET_Init();
+ if (Thread_HasThreads())
+ netconn_mutex = Thread_CreateMutex();
+}
+
+void NetConn_Init_Commands(void)
+{
+ Cmd_AddCommand(CF_SHARED, "net_stats", Net_Stats_f, "print network statistics");
#ifdef CONFIG_MENU
- Cmd_AddCommand(CMD_CLIENT, "net_slist", Net_Slist_f, "query dp master servers and print all server information");
- Cmd_AddCommand(CMD_CLIENT, "net_slistqw", Net_SlistQW_f, "query qw master servers and print all server information");
- Cmd_AddCommand(CMD_CLIENT, "net_refresh", Net_Refresh_f, "query dp master servers and refresh all server information");
+ Cmd_AddCommand(CF_CLIENT, "net_slist", Net_Slist_f, "query dp master servers and print all server information");
+ Cmd_AddCommand(CF_CLIENT, "net_slistqw", Net_SlistQW_f, "query qw master servers and print all server information");
+ Cmd_AddCommand(CF_CLIENT, "net_refresh", Net_Refresh_f, "query dp master servers and refresh all server information");
#endif
- Cmd_AddCommand(CMD_SERVER, "heartbeat", Net_Heartbeat_f, "send a heartbeat to the master server (updates your server information)");
+ Cmd_AddCommand(CF_SERVER, "heartbeat", Net_Heartbeat_f, "send a heartbeat to the master server (updates your server information)");
Cvar_RegisterVariable(&net_test);
Cvar_RegisterVariable(&net_usesizelimit);
Cvar_RegisterVariable(&net_burstreserve);
===============
*/
void PRVM_Init (void)
- prvm_runawaycheck = !COM_CheckParm("-norunaway");
+{
+ // COMMANDLINEOPTION: PRVM: -norunaway disables the runaway loop check (it might be impossible to exit DarkPlaces if used!)
++ prvm_runawaycheck = !Sys_CheckParm("-norunaway");
+
+ //VM_Cmd_Init();
+}
+
+void PRVM_Init_Commands (void)
{
- Cmd_AddCommand(CMD_SHARED, "prvm_edict", PRVM_ED_PrintEdict_f, "print all data about an entity number in the selected VM (server, client, menu)");
- Cmd_AddCommand(CMD_SHARED, "prvm_edicts", PRVM_ED_PrintEdicts_f, "prints all data about all entities in the selected VM (server, client, menu)");
- Cmd_AddCommand(CMD_SHARED, "prvm_edictcount", PRVM_ED_Count_f, "prints number of active entities in the selected VM (server, client, menu)");
- Cmd_AddCommand(CMD_SHARED, "prvm_profile", PRVM_Profile_f, "prints execution statistics about the most used QuakeC functions in the selected VM (server, client, menu)");
- Cmd_AddCommand(CMD_SHARED, "prvm_childprofile", PRVM_ChildProfile_f, "prints execution statistics about the most used QuakeC functions in the selected VM (server, client, menu), sorted by time taken in function with child calls");
- Cmd_AddCommand(CMD_SHARED, "prvm_callprofile", PRVM_CallProfile_f, "prints execution statistics about the most time consuming QuakeC calls from the engine in the selected VM (server, client, menu)");
- Cmd_AddCommand(CMD_SHARED, "prvm_fields", PRVM_Fields_f, "prints usage statistics on properties (how many entities have non-zero values) in the selected VM (server, client, menu)");
- Cmd_AddCommand(CMD_SHARED, "prvm_globals", PRVM_Globals_f, "prints all global variables in the selected VM (server, client, menu)");
- Cmd_AddCommand(CMD_SHARED, "prvm_global", PRVM_Global_f, "prints value of a specified global variable in the selected VM (server, client, menu)");
- Cmd_AddCommand(CMD_SHARED, "prvm_globalset", PRVM_GlobalSet_f, "sets value of a specified global variable in the selected VM (server, client, menu)");
- Cmd_AddCommand(CMD_SHARED, "prvm_edictset", PRVM_ED_EdictSet_f, "changes value of a specified property of a specified entity in the selected VM (server, client, menu)");
- Cmd_AddCommand(CMD_SHARED, "prvm_edictget", PRVM_ED_EdictGet_f, "retrieves the value of a specified property of a specified entity in the selected VM (server, client menu) into a cvar or to the console");
- Cmd_AddCommand(CMD_SHARED, "prvm_globalget", PRVM_ED_GlobalGet_f, "retrieves the value of a specified global variable in the selected VM (server, client menu) into a cvar or to the console");
- Cmd_AddCommand(CMD_SHARED, "prvm_printfunction", PRVM_PrintFunction_f, "prints a disassembly (QuakeC instructions) of the specified function in the selected VM (server, client, menu)");
- Cmd_AddCommand(CMD_SHARED, "cl_cmd", PRVM_GameCommand_Client_f, "calls the client QC function GameCommand with the supplied string as argument");
- Cmd_AddCommand(CMD_SHARED, "menu_cmd", PRVM_GameCommand_Menu_f, "calls the menu QC function GameCommand with the supplied string as argument");
- Cmd_AddCommand(CMD_SHARED, "sv_cmd", PRVM_GameCommand_Server_f, "calls the server QC function GameCommand with the supplied string as argument");
- Cmd_AddCommand(CMD_SHARED, "prvm_breakpoint", PRVM_Breakpoint_f, "marks a statement or function as breakpoint (when this is executed, a stack trace is printed); to actually halt and investigate state, combine this with a gdb breakpoint on PRVM_Breakpoint, or with prvm_breakpointdump; run with just progs name to clear breakpoint");
- Cmd_AddCommand(CMD_SHARED, "prvm_globalwatchpoint", PRVM_GlobalWatchpoint_f, "marks a global as watchpoint (when this is executed, a stack trace is printed); to actually halt and investigate state, combine this with a gdb breakpoint on PRVM_Breakpoint, or with prvm_breakpointdump; run with just progs name to clear watchpoint");
- Cmd_AddCommand(CMD_SHARED, "prvm_edictwatchpoint", PRVM_EdictWatchpoint_f, "marks an entity field as watchpoint (when this is executed, a stack trace is printed); to actually halt and investigate state, combine this with a gdb breakpoint on PRVM_Breakpoint, or with prvm_breakpointdump; run with just progs name to clear watchpoint");
+ Cmd_AddCommand(CF_SHARED, "prvm_edict", PRVM_ED_PrintEdict_f, "print all data about an entity number in the selected VM (server, client, menu)");
+ Cmd_AddCommand(CF_SHARED, "prvm_edicts", PRVM_ED_PrintEdicts_f, "prints all data about all entities in the selected VM (server, client, menu)");
+ Cmd_AddCommand(CF_SHARED, "prvm_edictcount", PRVM_ED_Count_f, "prints number of active entities in the selected VM (server, client, menu)");
+ Cmd_AddCommand(CF_SHARED, "prvm_profile", PRVM_Profile_f, "prints execution statistics about the most used QuakeC functions in the selected VM (server, client, menu)");
+ Cmd_AddCommand(CF_SHARED, "prvm_childprofile", PRVM_ChildProfile_f, "prints execution statistics about the most used QuakeC functions in the selected VM (server, client, menu), sorted by time taken in function with child calls");
+ Cmd_AddCommand(CF_SHARED, "prvm_callprofile", PRVM_CallProfile_f, "prints execution statistics about the most time consuming QuakeC calls from the engine in the selected VM (server, client, menu)");
+ Cmd_AddCommand(CF_SHARED, "prvm_fields", PRVM_Fields_f, "prints usage statistics on properties (how many entities have non-zero values) in the selected VM (server, client, menu)");
+ Cmd_AddCommand(CF_SHARED, "prvm_globals", PRVM_Globals_f, "prints all global variables in the selected VM (server, client, menu)");
+ Cmd_AddCommand(CF_SHARED, "prvm_global", PRVM_Global_f, "prints value of a specified global variable in the selected VM (server, client, menu)");
+ Cmd_AddCommand(CF_SHARED, "prvm_globalset", PRVM_GlobalSet_f, "sets value of a specified global variable in the selected VM (server, client, menu)");
+ Cmd_AddCommand(CF_SHARED, "prvm_edictset", PRVM_ED_EdictSet_f, "changes value of a specified property of a specified entity in the selected VM (server, client, menu)");
+ Cmd_AddCommand(CF_SHARED, "prvm_edictget", PRVM_ED_EdictGet_f, "retrieves the value of a specified property of a specified entity in the selected VM (server, client menu) into a cvar or to the console");
+ Cmd_AddCommand(CF_SHARED, "prvm_globalget", PRVM_ED_GlobalGet_f, "retrieves the value of a specified global variable in the selected VM (server, client menu) into a cvar or to the console");
+ Cmd_AddCommand(CF_SHARED, "prvm_printfunction", PRVM_PrintFunction_f, "prints a disassembly (QuakeC instructions) of the specified function in the selected VM (server, client, menu)");
+ Cmd_AddCommand(CF_SHARED, "cl_cmd", PRVM_GameCommand_Client_f, "calls the client QC function GameCommand with the supplied string as argument");
+ Cmd_AddCommand(CF_SHARED, "menu_cmd", PRVM_GameCommand_Menu_f, "calls the menu QC function GameCommand with the supplied string as argument");
+ Cmd_AddCommand(CF_SHARED, "sv_cmd", PRVM_GameCommand_Server_f, "calls the server QC function GameCommand with the supplied string as argument");
+ Cmd_AddCommand(CF_SHARED, "prvm_breakpoint", PRVM_Breakpoint_f, "marks a statement or function as breakpoint (when this is executed, a stack trace is printed); to actually halt and investigate state, combine this with a gdb breakpoint on PRVM_Breakpoint, or with prvm_breakpointdump; run with just progs name to clear breakpoint");
+ Cmd_AddCommand(CF_SHARED, "prvm_globalwatchpoint", PRVM_GlobalWatchpoint_f, "marks a global as watchpoint (when this is executed, a stack trace is printed); to actually halt and investigate state, combine this with a gdb breakpoint on PRVM_Breakpoint, or with prvm_breakpointdump; run with just progs name to clear watchpoint");
+ Cmd_AddCommand(CF_SHARED, "prvm_edictwatchpoint", PRVM_EdictWatchpoint_f, "marks an entity field as watchpoint (when this is executed, a stack trace is printed); to actually halt and investigate state, combine this with a gdb breakpoint on PRVM_Breakpoint, or with prvm_breakpointdump; run with just progs name to clear watchpoint");
Cvar_RegisterVariable (&prvm_language);
Cvar_RegisterVariable (&prvm_traceqc);
Cvar_RegisterVariable(&r_lightningbeam_color_green);
Cvar_RegisterVariable(&r_lightningbeam_color_blue);
Cvar_RegisterVariable(&r_lightningbeam_qmbtexture);
- R_RegisterModule("R_LightningBeams", r_lightningbeams_start, r_lightningbeams_shutdown, r_lightningbeams_newmap, NULL, NULL);
}
- static void CL_Beam_AddQuad(dp_model_t *mod, msurface_t *surf, const vec3_t start, const vec3_t end, const vec3_t offset, float t1, float t2)
+ static void CL_Beam_AddQuad(model_t *mod, msurface_t *surf, const vec3_t start, const vec3_t end, const vec3_t offset, float t1, float t2)
{
int e0, e1, e2, e3;
vec3_t n;
void R_Sky_Init(void)
+{
+ memset(&skyboxskinframe, 0, sizeof(skyboxskinframe));
+ skyname[0] = 0;
+ R_RegisterModule("R_Sky", r_sky_start, r_sky_shutdown, r_sky_newmap, NULL, NULL);
+}
+
+void R_Sky_Init_Commands(void)
{
- Cmd_AddCommand(CMD_CLIENT, "loadsky", &LoadSky_f, "load a skybox by basename (for example loadsky mtnsun_ loads mtnsun_ft.tga and so on)");
+ Cmd_AddCommand(CF_CLIENT, "loadsky", &LoadSky_f, "load a skybox by basename (for example loadsky mtnsun_ loads mtnsun_ft.tga and so on)");
Cvar_RegisterVariable (&r_sky);
Cvar_RegisterVariable (&r_skyscroll1);
Cvar_RegisterVariable (&r_skyscroll2);
void R_BuildLightMap(const entity_render_t *ent, msurface_t *surface);
void R_Water_AddWaterPlane(msurface_t *surface, int entno);
int R_Shadow_GetRTLightInfo(unsigned int lightindex, float *origin, float *radius, float *color);
- dp_font_t *FindFont(const char *title, qboolean allocate_new);
- void LoadFont(qboolean override, const char *name, dp_font_t *fnt, float scale, float voffset);
+ dp_font_t *FindFont(const char *title, qbool allocate_new);
+ void LoadFont(qbool override, const char *name, dp_font_t *fnt, float scale, float voffset);
void Render_Init(void);
+void Render_Init_Commands(void);
// these are called by Render_Init
void R_Textures_Init(void);
void Mod_RenderInit(void);
void Font_Init(void);
- qboolean R_CompileShader_CheckStaticParms(void);
+void R_Textures_Init_Commands(void);
+void GL_Draw_Init_Commands(void);
+void GL_Main_Init_Commands(void);
+void R_Shadow_Init_Commands(void);
+void R_Sky_Init_Commands(void);
+void R_Particles_Init_Commands(void);
+void R_Explosion_Init_Commands(void);
+void gl_backend_init_Commands(void);
+void Sbar_Init_Commands(void);
+void R_LightningBeams_Init_Commands(void);
+void Font_Init_Commands(void);
+
+ qbool R_CompileShader_CheckStaticParms(void);
void R_GLSL_Restart_f(cmd_state_t *cmd);
#endif
void Sbar_Init (void)
{
+ // FIXME: Don't know what game we're running until after cvars are initialized.
+ // So we're not doing this in our Init_Commands function yet.
if(gamemode == GAME_NORMAL) // Workaround so Quake doesn't trample on Xonotic.
{
- Cmd_AddCommand(CMD_CLIENT, "+showscores", Sbar_ShowScores_f, "show scoreboard");
- Cmd_AddCommand(CMD_CLIENT, "-showscores", Sbar_DontShowScores_f, "hide scoreboard");
+ Cmd_AddCommand(CF_CLIENT, "+showscores", Sbar_ShowScores_f, "show scoreboard");
+ Cmd_AddCommand(CF_CLIENT, "-showscores", Sbar_DontShowScores_f, "hide scoreboard");
}
+ R_RegisterModule("sbar", sbar_start, sbar_shutdown, sbar_newmap, NULL, NULL);
+}
+
+void Sbar_Init_Commands(void)
+{
Cvar_RegisterVariable(&cl_showfps);
Cvar_RegisterVariable(&cl_showsound);
Cvar_RegisterVariable(&cl_showblur);
//===========================================================
void SV_Init (void);
+void SV_Init_Commands(void);
+ double SV_Frame(double time);
+ void SV_Shutdown(void);
+
+ int SV_IsLocalServer(void);
void SV_StartParticle (vec3_t org, vec3_t dir, int color, int count);
void SV_StartEffect (vec3_t org, int modelindex, int startframe, int framecount, int framerate);
================
*/
void S_Init(void)
- if (COM_CheckParm("-nosound"))
+{
+// COMMANDLINEOPTION: Sound: -nosound disables sound (including CD audio)
- if (COM_CheckParm("-simsound"))
++ if (Sys_CheckParm("-nosound"))
+ return;
+
+ snd_mempool = Mem_AllocPool("sound", 0, NULL);
+
+// COMMANDLINEOPTION: Sound: -simsound runs sound mixing but with no output
++ if (Sys_CheckParm("-simsound"))
+ simsound = true;
+
+ Cvar_SetValueQuick(&snd_initialized, true);
+
+ known_sfx = NULL;
+
+ total_channels = MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS; // no statics
+ memset(channels, 0, MAX_CHANNELS * sizeof(channel_t));
+
+ OGG_OpenLibrary ();
+#ifdef USEXMP
+ XMP_OpenLibrary ();
+#endif
+}
+
+void S_Init_Commands(void)
{
Cvar_RegisterVariable(&volume);
Cvar_RegisterVariable(&bgmvolume);
Cvar_RegisterVariable(&snd_identicalsoundrandomization_time);
Cvar_RegisterVariable(&snd_identicalsoundrandomization_tics);
- if (COM_CheckParm("-nosound"))
-
-// COMMANDLINEOPTION: Sound: -nosound disables sound (including CD audio)
+ if (Sys_CheckParm("-nosound"))
{
// dummy out Play and Play2 because mods stuffcmd that
- Cmd_AddCommand(CMD_CLIENT, "play", Host_NoOperation_f, "does nothing because -nosound was specified");
- Cmd_AddCommand(CMD_CLIENT, "play2", Host_NoOperation_f, "does nothing because -nosound was specified");
+ Cmd_AddCommand(CF_CLIENT, "play", Host_NoOperation_f, "does nothing because -nosound was specified");
+ Cmd_AddCommand(CF_CLIENT, "play2", Host_NoOperation_f, "does nothing because -nosound was specified");
return;
}
- Cmd_AddCommand(CMD_CLIENT, "play", S_Play_f, "play a sound at your current location (not heard by anyone else)");
- Cmd_AddCommand(CMD_CLIENT, "play2", S_Play2_f, "play a sound globally throughout the level (not heard by anyone else)");
- Cmd_AddCommand(CMD_CLIENT, "playvol", S_PlayVol_f, "play a sound at the specified volume level at your current location (not heard by anyone else)");
- Cmd_AddCommand(CMD_CLIENT, "stopsound", S_StopAllSounds_f, "silence");
- Cmd_AddCommand(CMD_CLIENT, "pausesound", S_PauseSound_f, "temporary silence");
- Cmd_AddCommand(CMD_CLIENT, "soundlist", S_SoundList_f, "list loaded sounds");
- Cmd_AddCommand(CMD_CLIENT, "soundinfo", S_SoundInfo_f, "print sound system information (such as channels and speed)");
- Cmd_AddCommand(CMD_CLIENT, "snd_restart", S_Restart_f, "restart sound system");
- Cmd_AddCommand(CMD_CLIENT, "snd_unloadallsounds", S_UnloadAllSounds_f, "unload all sound files");
- snd_mempool = Mem_AllocPool("sound", 0, NULL);
-
-// COMMANDLINEOPTION: Sound: -simsound runs sound mixing but with no output
- if (Sys_CheckParm("-simsound"))
- simsound = true;
-
+ Cmd_AddCommand(CF_CLIENT, "play", S_Play_f, "play a sound at your current location (not heard by anyone else)");
+ Cmd_AddCommand(CF_CLIENT, "play2", S_Play2_f, "play a sound globally throughout the level (not heard by anyone else)");
+ Cmd_AddCommand(CF_CLIENT, "playvol", S_PlayVol_f, "play a sound at the specified volume level at your current location (not heard by anyone else)");
+ Cmd_AddCommand(CF_CLIENT, "stopsound", S_StopAllSounds_f, "silence");
+ Cmd_AddCommand(CF_CLIENT, "pausesound", S_PauseSound_f, "temporary silence");
+ Cmd_AddCommand(CF_CLIENT, "soundlist", S_SoundList_f, "list loaded sounds");
+ Cmd_AddCommand(CF_CLIENT, "soundinfo", S_SoundInfo_f, "print sound system information (such as channels and speed)");
+ Cmd_AddCommand(CF_CLIENT, "snd_restart", S_Restart_f, "restart sound system");
+ Cmd_AddCommand(CF_CLIENT, "snd_unloadallsounds", S_UnloadAllSounds_f, "unload all sound files");
Cvar_RegisterVariable(&nosound);
Cvar_RegisterVariable(&snd_precache);
#include "quakedef.h"
- cvar_t bgmvolume = {CVAR_SAVE, "bgmvolume", "1", "volume of background music (such as CD music or replacement files such as sound/cdtracks/track002.ogg)"};
- cvar_t mastervolume = {CVAR_SAVE, "mastervolume", "1", "master volume"};
- cvar_t volume = {CVAR_SAVE, "volume", "0.7", "volume of sound effects"};
- cvar_t snd_staticvolume = {CVAR_SAVE, "snd_staticvolume", "1", "volume of ambient sound effects (such as swampy sounds at the start of e1m2)"};
- cvar_t snd_initialized = { CVAR_READONLY, "snd_initialized", "0", "indicates the sound subsystem is active"};
- cvar_t snd_mutewhenidle = {CVAR_SAVE, "snd_mutewhenidle", "1", "whether to disable sound output when game window is inactive"};
+ cvar_t bgmvolume = {CF_ARCHIVE, "bgmvolume", "1", "volume of background music (such as CD music or replacement files such as sound/cdtracks/track002.ogg)"};
+ cvar_t mastervolume = {CF_ARCHIVE, "mastervolume", "1", "master volume"};
+ cvar_t volume = {CF_ARCHIVE, "volume", "0.7", "volume of sound effects"};
+ cvar_t snd_staticvolume = {CF_ARCHIVE, "snd_staticvolume", "1", "volume of ambient sound effects (such as swampy sounds at the start of e1m2)"};
+ cvar_t snd_initialized = { CF_READONLY, "snd_initialized", "0", "indicates the sound subsystem is active"};
+ cvar_t snd_mutewhenidle = {CF_ARCHIVE, "snd_mutewhenidle", "1", "whether to disable sound output when game window is inactive"};
void S_Init (void)
+{
+}
+
+void S_Init_Commands (void)
{
Cvar_RegisterVariable(&bgmvolume);
Cvar_RegisterVariable(&mastervolume);
===============
*/
void SV_Init (void)
+{
+ sv_mempool = Mem_AllocPool("server", 0, NULL);
++
++ host.hook.SV_CanSave = SV_CanSave;
++
++ SV_ServerOptions();
+}
+
+void SV_Init_Commands(void)
{
// init the csqc progs cvars, since they are updated/used by the server code
// TODO: fix this since this is a quick hack to make some of [515]'s broken code run ;) [9/13/2006 Black]
// t->p[0] = array of taskqueue_task_t to check
void TaskQueue_Task_CheckTasksDone(taskqueue_task_t *t);
-void TaskQueue_Init(void);
+void TaskQueue_Init_Commands(void);
void TaskQueue_Shutdown(void);
- void TaskQueue_Frame(qboolean shutdown);
+ void TaskQueue_Frame(qbool shutdown);
#endif
================================================================================
*/
// for compatibility this defaults to 0
- cvar_t utf8_enable = {CVAR_CLIENT | CVAR_SERVER | CVAR_SAVE, "utf8_enable", "0", "Enable UTF-8 support. For compatibility, this is disabled by default in most games."};
+ cvar_t utf8_enable = {CF_CLIENT | CF_SERVER | CF_ARCHIVE, "utf8_enable", "0", "Enable UTF-8 support. For compatibility, this is disabled by default in most games."};
-void u8_Init(void)
+void u8_Init_Commands(void)
{
Cvar_RegisterVariable(&utf8_enable);
}
// a non-utf8 version to work: u8_strlen() will wrap to strlen()
// u8_byteofs() and u8_charidx() will simply return whatever is passed as index parameter
// u8_getchar() will will just return the next byte, u8_fromchar will write one byte, ...
- extern cvar_t utf8_enable;
+ extern struct cvar_s utf8_enable;
-void u8_Init(void);
+void u8_Init_Commands(void);
size_t u8_strlen(const char*);
size_t u8_strnlen(const char*, size_t);
InitSig(); // trap evil signals
}
- qboolean VID_InitMode(viddef_mode_t *mode)
+void VID_Init_Commands(void)
+{
+}
+
+ qbool VID_InitMode(viddef_mode_t *mode)
{
return false;
}
vid_isfullscreen = false;
}
+void VID_Init_Commands(void)
+{
+#ifndef __IPHONEOS__
+#ifdef MACOSX
+ Cvar_RegisterVariable(&apple_mouse_noaccel);
+#endif
+#endif
+ Cvar_RegisterVariable(&joy_sdl2_trigger_deadzone);
+}
+
static int vid_sdljoystickindex = -1;
- void VID_EnableJoystick(qboolean enable)
+ void VID_EnableJoystick(qbool enable)
{
int index = joy_enable.integer > 0 ? joy_index.integer : -1;
int numsdljoysticks;
Cvar_RegisterVariable(&joy_x360_sensitivitypitch);
Cvar_RegisterVariable(&joy_x360_sensitivityyaw);
//Cvar_RegisterVariable(&joy_x360_sensitivityroll);
- Cmd_AddCommand(CMD_CLIENT, "force_centerview", Force_CenterView_f, "recenters view (stops looking up/down)");
- Cmd_AddCommand(CMD_CLIENT, "vid_restart", VID_Restart_f, "restarts video system (closes and reopens the window, restarts renderer)");
-
-#ifdef WIN32
- Sys_LoadLibrary(xinputdllnames, &xinputdll_dll, xinputdllfuncs);
-#endif
-
+ Cmd_AddCommand(CF_CLIENT, "force_centerview", Force_CenterView_f, "recenters view (stops looking up/down)");
+ Cmd_AddCommand(CF_CLIENT, "vid_restart", VID_Restart_f, "restarts video system (closes and reopens the window, restarts renderer)");
}
static int VID_Mode(int fullscreen, int width, int height, int bpp, float refreshrate, int stereobuffer)