*remap[i] = 0;
#endif
- Cvar_RegisterVariable(&cdaudioinitialized);
Cvar_SetValueQuick(&cdaudioinitialized, true);
enabled = true;
+ return 0;
+}
+
+void CDAudio_Init_Commands(void)
+{
+ int i;
+
+ Cvar_RegisterVariable(&cdaudioinitialized);
Cvar_RegisterVariable(&music_playlist_index);
for (i = 0;i < MAX_PLAYLISTS;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");
-
- return 0;
}
int CDAudio_Startup (void)
extern cvar_t cdaudioinitialized;
int CDAudio_Init(void);
+void CDAudio_Init_Commands(void);
void CDAudio_Play(int track, qboolean looping);
void CDAudio_Stop(void);
void CDAudio_Pause(void);
}
}
-void CL_InitCommands(void)
+void CL_InitServer_Commands(void)
{
dpsnprintf(cls.userinfo, sizeof(cls.userinfo), "\\name\\player\\team\\none\\topcolor\\0\\bottomcolor\\0\\rate\\10000\\msg\\1\\noaim\\1\\*ver\\dp");
void CL_Init (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)");
- }
+ return;
else
{
Con_Printf("Initializing client\n");
- R_Modules_Init();
Palette_Init();
-#ifdef CONFIG_MENU
- MR_Init_Commands();
-#endif
+
VID_Shared_Init();
VID_Init();
Render_Init();
S_Init();
CDAudio_Init();
Key_Init();
- V_Init();
cls.levelmempool = Mem_AllocPool("client (per-level memory)", 0, NULL);
cls.permanentmempool = Mem_AllocPool("client (long term memory)", 0, NULL);
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;
- //
- // register our commands
- //
- CL_InitCommands();
+ #ifdef CONFIG_MENU
+ Cbuf_InsertText(&cmd_client,"menu_start\n");
+ #endif
+ }
+}
+
+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)");
+ }
+ 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();
+
+ CL_InitServer_Commands();
Cvar_RegisterVariable (&cl_upspeed);
Cvar_RegisterVariable (&cl_forwardspeed);
Cvar_RegisterVariable (&cl_itembobspeed);
Cvar_RegisterVariable (&cl_itembobheight);
-
- CL_Demo_Init();
-
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");
// 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");
Cvar_RegisterVariable (&cl_maxfps);
Cvar_RegisterVariable (&cl_maxfps_alwayssleep);
Cvar_RegisterVariable (&cl_maxidlefps);
-
- CL_Parse_Init();
- CL_Particles_Init();
- 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
}
-}
+}
\ No newline at end of file
particle_elements[i*6+5] = i*4+3;
}
+ R_RegisterModule("R_Particles", r_part_start, r_part_shutdown, r_part_newmap, NULL, NULL);
+}
+
+void R_Particles_Init_Commands (void)
+{
Cvar_RegisterVariable(&r_drawparticles);
Cvar_RegisterVariable(&r_drawparticles_drawdistance);
Cvar_RegisterVariable(&r_drawparticles_nearclip_min);
Cvar_RegisterVariable(&r_drawparticles_nearclip_max);
Cvar_RegisterVariable(&r_drawdecals);
Cvar_RegisterVariable(&r_drawdecals_drawdistance);
- R_RegisterModule("R_Particles", r_part_start, r_part_shutdown, r_part_newmap, NULL, NULL);
}
static void R_DrawParticle_TransparentCallback(const entity_render_t *ent, const rtlight_t *rtlight, int numsurfaces, int *surfacelist)
}
void CL_Screen_Init(void)
+{
+ // if we want no console, turn it off here too
+ if (COM_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);
-
- // if we want no console, turn it off here too
- if (COM_CheckParm ("-noconsole"))
- Cvar_SetQuick(&scr_conforcewhiledisconnected, "0");
-
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)");
-
-#ifdef CONFIG_VIDEO_CAPTURE
- SCR_CaptureVideo_Ogg_Init();
-#endif
-
- scr_initialized = true;
}
/*
void CL_Screen_NewMap(void);
void CL_Screen_Init(void);
+void CL_Screen_Init_Commands(void);
void CL_Screen_Shutdown(void);
void CL_UpdateScreen(void);
bgra.i = 0;bgra.b[1] = 0xFF;cl_videogmask = bgra.i;
bgra.i = 0;bgra.b[2] = 0xFF;cl_videormask = bgra.i;
+ 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(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" );
Cvar_RegisterVariable(&cl_video_fadeout);
Cvar_RegisterVariable(&v_glslgamma_video);
-
- R_RegisterModule( "CL_Video", cl_video_start, cl_video_shutdown, cl_video_newmap, NULL, NULL );
-
- LibAvW_OpenLibrary();
}
void CL_Video_Shutdown( void )
void CL_Video_Frame( void ); // update all videos
void CL_Video_Init( void );
+void CL_Video_Init_Commands( void );
void CL_Video_Shutdown( void );
// old interface
void CL_Shutdown (void);
void CL_Init (void);
+void CL_Init_Commands(void);
void CL_EstablishConnection(const char *host, int firstarg);
/// things like godmode, noclip, etc, are commands directed to the server,
/// so when they are typed in at the console, they will need to be forwarded.
void CL_ForwardToServer_f (cmd_state_t *cmd);
-void CL_InitCommands(void);
+void CL_InitServer_Commands(void);
//
mempool_t *collision_mempool;
void Collision_Init (void)
+{
+ collision_mempool = Mem_AllocPool("collision cache", 0, NULL);
+ Collision_Cache_Init(collision_mempool);
+}
+
+void Collision_Init_Commands(void)
{
Cvar_RegisterVariable(&collision_impactnudge);
Cvar_RegisterVariable(&collision_extendmovelength);
Cvar_RegisterVariable(&collision_triangle_bevelsides);
Cvar_RegisterVariable(&collision_triangle_axialsides);
Cvar_RegisterVariable(&collision_bih_fullrecursion);
- collision_mempool = Mem_AllocPool("collision cache", 0, NULL);
- Collision_Cache_Init(collision_mempool);
}
-
-
static void Collision_PrintBrushAsQHull(colbrushf_t *brush, const char *name)
{
int i;
trace_t;
void Collision_Init(void);
+void Collision_Init_Commands(void);
void Collision_ClipTrace_Box(trace_t *trace, const vec3_t cmins, const vec3_t cmaxs, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, int boxsupercontents, int boxq3surfaceflags, const texture_t *boxtexture);
void Collision_ClipTrace_Point(trace_t *trace, const vec3_t cmins, const vec3_t cmaxs, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, int boxsupercontents, int boxq3surfaceflags, const texture_t *boxtexture);
COM_Init
================
*/
-void COM_Init_Commands (void)
+void COM_Init (void)
{
int i, j, n;
char com_cmdline[MAX_INPUTLINE];
- Cvar_RegisterVariable (®istered);
- Cvar_RegisterVariable (&cmdline);
- Cvar_RegisterVariable(&cl_playermodel);
- Cvar_RegisterAlias(&cl_playermodel, "_cl_playermodel");
- Cvar_RegisterVariable(&cl_playerskin);
- Cvar_RegisterAlias(&cl_playerskin, "_cl_playerskin");
-
// reconstitute the command line for the cmdline externally visible cvar
n = 0;
for (j = 0;(j < MAX_NUM_ARGVS) && (j < sys.argc);j++)
Cvar_SetQuick(&cmdline, com_cmdline);
}
+void COM_Init_Commands (void)
+{
+ Cvar_RegisterVariable (®istered);
+ Cvar_RegisterVariable (&cmdline);
+ Cvar_RegisterVariable(&cl_playermodel);
+ Cvar_RegisterAlias(&cl_playermodel, "_cl_playermodel");
+ Cvar_RegisterVariable(&cl_playerskin);
+ Cvar_RegisterAlias(&cl_playerskin, "_cl_playerskin");
+}
+
/*
============
va
logqueue = (unsigned char *)Mem_Alloc (tempmempool, logq_size);
logq_ind = 0;
+ // support for the classic Quake option
+// COMMANDLINEOPTION: Console: -condebug logs console messages to qconsole.log, see also log_file
+ if (COM_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 (&log_file);
Cvar_RegisterVariable (&log_file_stripcolors);
Cvar_RegisterVariable (&log_dest_udp);
-
- // support for the classic Quake option
-// COMMANDLINEOPTION: Console: -condebug logs console messages to qconsole.log, see also log_file
- if (COM_CheckParm ("-condebug") != 0)
- Cvar_SetQuick (&log_file, "qconsole.log");
-
// register our cvars
Cvar_RegisterVariable (&con_chat);
Cvar_RegisterVariable (&con_chatpos);
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)");
-
- con_initialized = true;
- // initialize console window (only used by sys_win.c)
- Sys_InitConsole();
-
- Con_Print("Console initialized.\n");
}
void Con_Shutdown (void)
{
fs_mempool = Mem_AllocPool("file management", 0, NULL);
- FS_Init_Commands();
-
PK3_OpenLibrary ();
// initialize the self-pack (must be before COM_InitGameType as it may add command line options)
}
void Font_Init(void)
+{
+ // let's open it at startup already
+ Font_OpenLibrary();
+}
+
+void Font_Init_Commands(void)
{
Cvar_RegisterVariable(&r_font_nonpoweroftwo);
Cvar_RegisterVariable(&r_font_disable_freetype);
Cvar_RegisterVariable(&r_font_diskcache);
Cvar_RegisterVariable(&r_font_compress);
Cvar_RegisterVariable(&developer_font);
-
- // let's open it at startup already
- Font_OpenLibrary();
}
/*
for (i = 0;i < QUADELEMENTS_MAXQUADS*6;i++)
quadelement3i[i] = quadelement3s[i];
+ R_RegisterModule("GL_Backend", gl_backend_start, gl_backend_shutdown, gl_backend_newmap, gl_backend_devicelost, gl_backend_devicerestored);
+}
+
+void gl_backend_init_Commands(void)
+{
Cvar_RegisterVariable(&r_render);
Cvar_RegisterVariable(&r_renderview);
Cvar_RegisterVariable(&r_waterwarp);
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");
-
- R_RegisterModule("GL_Backend", gl_backend_start, gl_backend_shutdown, gl_backend_newmap, gl_backend_devicelost, gl_backend_devicerestored);
}
void GL_SetMirrorState(qboolean state);
// adds console variables and registers the render module (only call from GL_Init)
void gl_backend_init(void);
+void gl_backend_init_Commands(void);
// starts mesh rendering for the frame
void R_Mesh_Start(void);
{
int i, j;
- 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);
-
// allocate fonts storage
fonts_mempool = Mem_AllocPool("FONTS", 0, NULL);
dp_fonts.maxsize = MAX_FONTS;
if(!FONT_USER(i)->title[0])
dpsnprintf(FONT_USER(i)->title, sizeof(FONT_USER(i)->title), "user%d", j++);
- 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");
R_RegisterModule("GL_Draw", gl_draw_start, gl_draw_shutdown, gl_draw_newmap, NULL, NULL);
}
+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(CMD_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;
void GL_Main_Init(void)
{
- int i;
r_main_mempool = Mem_AllocPool("Renderer", 0, NULL);
R_InitShaderModeInfo();
+ 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(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");
// FIXME: the client should set up r_refdef.fog stuff including the fogmasktable
Cvar_RegisterVariable(&r_glsl_saturation_redcompensate);
Cvar_RegisterVariable(&r_glsl_vertextextureblend_usebothalphas);
Cvar_RegisterVariable(&r_framedatasize);
- for (i = 0;i < R_BUFFERDATA_COUNT;i++)
+ for (int i = 0;i < R_BUFFERDATA_COUNT;i++)
Cvar_RegisterVariable(&r_buffermegs[i]);
Cvar_RegisterVariable(&r_batch_dynamicbuffer);
- if (gamemode == GAME_NEHAHRA || gamemode == GAME_TENEBRAE)
- Cvar_SetValue(&cvars_all, "r_fullbrights", 0);
#ifdef DP_MOBILETOUCH
// GLES devices have terrible depth precision in general, so...
Cvar_SetValueQuick(&r_nearclip, 4);
Cvar_SetValueQuick(&r_farclip_world, 0);
Cvar_SetValueQuick(&r_useinfinitefarclip, 0);
#endif
- R_RegisterModule("GL_Main", gl_main_start, gl_main_shutdown, gl_main_newmap, NULL, NULL);
}
void Render_Init(void)
GL_Draw_Init();
R_Shadow_Init();
R_Sky_Init();
- GL_Surf_Init();
+ //GL_Surf_Init();
Sbar_Init();
R_Particles_Init();
R_Explosion_Init();
Mod_RenderInit();
}
+void Render_Init_Commands(void)
+{
+ gl_backend_init_Commands();
+ R_Textures_Init_Commands();
+ GL_Main_Init_Commands();
+ Font_Init_Commands();
+ GL_Draw_Init_Commands();
+ R_Shadow_Init_Commands();
+ R_Sky_Init_Commands();
+ GL_Surf_Init();
+ Sbar_Init_Commands();
+ R_Particles_Init_Commands();
+ R_Explosion_Init_Commands();
+ R_LightningBeams_Init_Commands();
+}
+
int R_CullBox(const vec3_t mins, const vec3_t maxs)
{
int i;
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");
Cvar_RegisterVariable (&r_texture_dds_load_alphamode);
Cvar_RegisterVariable (&r_texture_dds_load_logfailure);
Cvar_RegisterVariable (&r_texture_dds_swdecode);
-
- R_RegisterModule("R_Textures", r_textures_start, r_textures_shutdown, r_textures_newmap, r_textures_devicelost, r_textures_devicerestored);
}
void R_Textures_Frame (void)
/*
=======================
-Host_InitLocal
+Host_InitLocal_Commands
======================
*/
void Host_SaveConfig_f(cmd_state_t *cmd);
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");
if (COM_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();
// initialize memory subsystem cvars/commands
Memory_Init_Commands();
- // initialize console and logging and its cvars/commands
- Con_Init();
-
+ // initialize console cvars/commands
+ Con_Init_Commands();
// initialize various cvars that could not be initialized earlier
- u8_Init();
- Curl_Init_Commands();
+ u8_Init_Commands();
Sys_Init_Commands();
COM_Init_Commands();
+ FS_Init_Commands();
+ Crypto_Init_Commands();
+ NetConn_Init_Commands();
+ Curl_Init_Commands();
+ PRVM_Init_Commands();
+ Mod_Init_Commands();
+ World_Init_Commands();
+ SV_Init_Commands();
+ Host_InitLocal_Commands();
+ TaskQueue_Init_Commands();
+ CL_Init_Commands();
+
+ // register the cvars for session locking
+ Host_InitSession();
+
+ // initialize console and logging
+ Con_Init();
+ COM_Init();
// initialize filesystem (including fs_basedir, fs_gamedir, -game, scr_screenshot_name)
FS_Init();
// initialize ixtable
Mathlib_Init();
- // register the cvars for session locking
- Host_InitSession();
-
// must be after FS_Init
Crypto_Init();
- Crypto_Init_Commands();
NetConn_Init();
Curl_Init();
Mod_Init();
World_Init();
SV_Init();
- Host_InitLocal();
Host_ServerOptions();
Thread_Init();
- TaskQueue_Init();
CL_Init();
{
Key_History_Init();
key_linepos = Key_ClearEditLine(true);
+}
+void
+Key_Init_Commands (void)
+{
//
// register our functions
//
int Key_ClearEditLine(qboolean is_console);
void Key_WriteBindings(qfile_t *f);
void Key_Init(void);
+void Key_Init_Commands(void);
void Key_Shutdown(void);
-void Key_Init_Cvars(void);
void Key_Event(int key, int ascii, qboolean down);
void Key_ReleaseAll (void);
void Key_ReleaseAll_f(cmd_state_t *cmd);
void Mod_AliasInit (void)
{
int i;
+ for (i = 0;i < 320;i++)
+ mod_md3_sin[i] = sin(i * M_PI * 2.0f / 256.0);
+}
+
+void Mod_AliasInit_Commands(void)
+{
Cvar_RegisterVariable(&r_skeletal_debugbone);
Cvar_RegisterVariable(&r_skeletal_debugbonecomponent);
Cvar_RegisterVariable(&r_skeletal_debugbonevalue);
Cvar_RegisterVariable(&r_skeletal_debugtranslatez);
Cvar_RegisterVariable(&mod_alias_supporttagscale);
Cvar_RegisterVariable(&mod_alias_force_animated);
- for (i = 0;i < 320;i++)
- mod_md3_sin[i] = sin(i * M_PI * 2.0f / 256.0);
#ifdef SSE_POSSIBLE
if(Sys_HaveSSE())
{
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);
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)
Mod_BrushInit();
Mod_AliasInit();
- Mod_SpriteInit();
+}
+
+void Mod_Init_Commands(void)
+{
+ Mod_BrushInit_Commands();
+ Mod_AliasInit_Commands();
+ Mod_SpriteInit_Commands();
Cvar_RegisterVariable(&r_mipskins);
Cvar_RegisterVariable(&r_mipnormalmaps);
extern cvar_t 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);
// bsp models
void Mod_BrushInit(void);
+void Mod_BrushInit_Commands(void);
// used for talking to the QuakeC mainly
int Mod_Q1BSP_NativeContentsFromSuperContents(int supercontents);
int Mod_Q1BSP_SuperContentsFromNativeContents(int nativecontents);
struct frameblend_s;
struct skeleton_s;
void Mod_AliasInit(void);
+void Mod_AliasInit_Commands(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_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);
/*
===============
-Mod_SpriteInit
+Mod_SpriteInit_Commands
===============
*/
-void Mod_SpriteInit (void)
+void Mod_SpriteInit_Commands (void)
{
Cvar_RegisterVariable(&r_mipsprites);
Cvar_RegisterVariable(&r_labelsprites_scale);
int i;
lhnetaddress_t tempaddress;
netconn_mempool = Mem_AllocPool("network connections", 0, NULL);
+
+// 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("-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
+ if (((i = COM_CheckParm("-port")) || (i = COM_CheckParm("-ipport")) || (i = COM_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(CMD_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");
Cvar_RegisterVariable(&sv_public);
Cvar_RegisterVariable(&sv_public_rejectreason);
Cvar_RegisterVariable(&sv_heartbeatperiod);
- for (i = 0;sv_masters[i].name;i++)
+ for (int i = 0;sv_masters[i].name;i++)
Cvar_RegisterVariable(&sv_masters[i]);
Cvar_RegisterVariable(&gameversion);
Cvar_RegisterVariable(&gameversion_min);
Cvar_RegisterVariable(&gameversion_max);
-// 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("-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
- if (((i = COM_CheckParm("-port")) || (i = COM_CheckParm("-ipport")) || (i = COM_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_Shutdown(void)
void NetConn_UpdateSockets(void);
lhnetsocket_t *NetConn_ChooseClientSocketForAddress(lhnetaddress_t *address);
lhnetsocket_t *NetConn_ChooseServerSocketForAddress(lhnetaddress_t *address);
+void NetConn_Init_Commands(void);
void NetConn_Init(void);
void NetConn_Shutdown(void);
netconn_t *NetConn_Open(lhnetsocket_t *mysocket, lhnetaddress_t *peeraddress);
void Palette_Init(void)
{
R_RegisterModule("Palette", Palette_Load, Palette_Shutdown, Palette_NewMap, NULL, NULL);
- Cvar_RegisterVariable(&r_colormap_palette);
Palette_Load();
}
+
+void Palette_Init_Commands(void)
+{
+ Cvar_RegisterVariable(&r_colormap_palette);
+}
\ No newline at end of file
void BuildGammaTable16(float prescale, float gamma, float scale, float base, float contrastboost, unsigned short *out, int rampsize);
void Palette_Init(void);
+void Palette_Init_Commands(void);
#endif
//============================================================================
void PRVM_Init (void);
-
+void PRVM_Init_Commands (void);
#ifdef PROFILING
void SVVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessage);
void CLVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessage);
===============
*/
void PRVM_Init (void)
+{
+ // COMMANDLINEOPTION: PRVM: -norunaway disables the runaway loop check (it might be impossible to exit DarkPlaces if used!)
+ prvm_runawaycheck = !COM_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)");
Cvar_RegisterVariable (&prvm_garbagecollection_scan_limit);
Cvar_RegisterVariable (&prvm_garbagecollection_strings);
Cvar_RegisterVariable (&prvm_stringdebug);
-
- // COMMANDLINEOPTION: PRVM: -norunaway disables the runaway loop check (it might be impossible to exit DarkPlaces if used!)
- prvm_runawaycheck = !COM_CheckParm("-norunaway");
-
- //VM_Cmd_Init();
}
/*
#endif
}
+void R_Explosion_Init_Commands(void)
+{
+ Cvar_RegisterVariable(&r_explosionclip);
+#ifdef MAX_EXPLOSIONS
+ Cvar_RegisterVariable(&r_drawexplosions);
+#endif
+}
+
void R_NewExplosion(const vec3_t org)
{
#ifdef MAX_EXPLOSIONS
}
void R_LightningBeams_Init(void)
+{
+ R_RegisterModule("R_LightningBeams", r_lightningbeams_start, r_lightningbeams_shutdown, r_lightningbeams_newmap, NULL, NULL);
+}
+
+void R_LightningBeams_Init_Commands(void)
{
Cvar_RegisterVariable(&r_lightningbeam_thickness);
Cvar_RegisterVariable(&r_lightningbeam_scroll);
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)
}
void R_Shadow_Init(void)
+{
+ Mem_ExpandableArray_NewArray(&r_shadow_worldlightsarray, r_main_mempool, sizeof(dlight_t), 128);
+ r_shadow_scenemaxlights = 0;
+ r_shadow_scenenumlights = 0;
+ r_shadow_scenelightlist = NULL;
+ maxshadowtriangles = 0;
+ shadowelements = NULL;
+ maxshadowvertices = 0;
+ shadowvertex3f = NULL;
+ maxvertexupdate = 0;
+ vertexupdate = NULL;
+ vertexremap = NULL;
+ vertexupdatenum = 0;
+ maxshadowmark = 0;
+ numshadowmark = 0;
+ shadowmark = NULL;
+ shadowmarklist = NULL;
+ shadowmarkcount = 0;
+ maxshadowsides = 0;
+ numshadowsides = 0;
+ shadowsides = NULL;
+ shadowsideslist = NULL;
+ r_shadow_buffer_numleafpvsbytes = 0;
+ r_shadow_buffer_visitingleafpvs = NULL;
+ r_shadow_buffer_leafpvs = NULL;
+ r_shadow_buffer_leaflist = NULL;
+ r_shadow_buffer_numsurfacepvsbytes = 0;
+ r_shadow_buffer_surfacepvs = NULL;
+ r_shadow_buffer_surfacelist = NULL;
+ r_shadow_buffer_surfacesides = NULL;
+ r_shadow_buffer_shadowtrispvs = NULL;
+ r_shadow_buffer_lighttrispvs = NULL;
+ R_RegisterModule("R_Shadow", r_shadow_start, r_shadow_shutdown, r_shadow_newmap, NULL, NULL);
+}
+
+void R_Shadow_Init_Commands(void)
{
Cvar_RegisterVariable(&r_shadow_bumpscale_basetexture);
Cvar_RegisterVariable(&r_shadow_bumpscale_bumpmap);
Cvar_RegisterVariable(&r_coronas_occlusionsizescale);
Cvar_RegisterVariable(&r_coronas_occlusionquery);
Cvar_RegisterVariable(&gl_flashblend);
+
R_Shadow_EditLights_Init();
- Mem_ExpandableArray_NewArray(&r_shadow_worldlightsarray, r_main_mempool, sizeof(dlight_t), 128);
- r_shadow_scenemaxlights = 0;
- r_shadow_scenenumlights = 0;
- r_shadow_scenelightlist = NULL;
- maxshadowtriangles = 0;
- shadowelements = NULL;
- maxshadowvertices = 0;
- shadowvertex3f = NULL;
- maxvertexupdate = 0;
- vertexupdate = NULL;
- vertexremap = NULL;
- vertexupdatenum = 0;
- maxshadowmark = 0;
- numshadowmark = 0;
- shadowmark = NULL;
- shadowmarklist = NULL;
- shadowmarkcount = 0;
- maxshadowsides = 0;
- numshadowsides = 0;
- shadowsides = NULL;
- shadowsideslist = NULL;
- r_shadow_buffer_numleafpvsbytes = 0;
- r_shadow_buffer_visitingleafpvs = NULL;
- r_shadow_buffer_leafpvs = NULL;
- r_shadow_buffer_leaflist = NULL;
- r_shadow_buffer_numsurfacepvsbytes = 0;
- r_shadow_buffer_surfacepvs = NULL;
- r_shadow_buffer_surfacelist = NULL;
- r_shadow_buffer_surfacesides = NULL;
- r_shadow_buffer_shadowtrispvs = NULL;
- r_shadow_buffer_lighttrispvs = NULL;
- R_RegisterModule("R_Shadow", r_shadow_start, r_shadow_shutdown, r_shadow_newmap, NULL, NULL);
}
matrix4x4_t matrix_attenuationxyz =
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)");
Cvar_RegisterVariable (&r_sky);
Cvar_RegisterVariable (&r_skyscroll1);
Cvar_RegisterVariable (&r_skyscroll2);
Cvar_RegisterVariable (&r_sky_scissor);
- memset(&skyboxskinframe, 0, sizeof(skyboxskinframe));
- skyname[0] = 0;
- R_RegisterModule("R_Sky", r_sky_start, r_sky_shutdown, r_sky_newmap, NULL, NULL);
}
-
void LoadFont(qboolean 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);
+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);
+
qboolean R_CompileShader_CheckStaticParms(void);
void R_GLSL_Restart_f(cmd_state_t *cmd);
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");
}
+ 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);
Cvar_RegisterVariable(&sbar_flagstatus_right); // (GAME_NEXUZI ONLY)
Cvar_RegisterVariable(&sbar_flagstatus_pos); // (GAME_NEXUIZ ONLY)
-
- R_RegisterModule("sbar", sbar_start, sbar_shutdown, sbar_newmap, NULL, NULL);
}
-
//=============================================================================
// drawing routines are relative to the status bar location
//===========================================================
void SV_Init (void);
+void SV_Init_Commands(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)
+{
+// COMMANDLINEOPTION: Sound: -nosound disables sound (including CD audio)
+ if (COM_CheckParm("-nosound"))
+ return;
+
+ snd_mempool = Mem_AllocPool("sound", 0, NULL);
+
+// COMMANDLINEOPTION: Sound: -simsound runs sound mixing but with no output
+ if (COM_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);
-
-// COMMANDLINEOPTION: Sound: -nosound disables sound (including CD audio)
if (COM_CheckParm("-nosound"))
{
// dummy out Play and Play2 because mods stuffcmd that
return;
}
- snd_mempool = Mem_AllocPool("sound", 0, NULL);
-
-// COMMANDLINEOPTION: Sound: -simsound runs sound mixing but with no output
- if (COM_CheckParm("-simsound"))
- simsound = true;
-
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)");
Cvar_RegisterVariable(&snd_swapstereo); // for people with backwards sound wiring
Cvar_RegisterVariable(&snd_channellayout);
Cvar_RegisterVariable(&snd_soundradius);
-
- 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
}
-
/*
================
S_Terminate
cvar_t snd_mutewhenidle = {CVAR_SAVE, "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 S_Init (void);
+void S_Init_Commands(void);
void S_Terminate (void);
void S_Startup (void);
===============
*/
void SV_Init (void)
+{
+ sv_mempool = Mem_AllocPool("server", 0, NULL);
+}
+
+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]
Cvar_RegisterVariable (&sv_mapformat_is_quake3);
SV_InitOperatorCommands();
-
- sv_mempool = Mem_AllocPool("server", 0, NULL);
}
static void SV_SaveEntFile_f(cmd_state_t *cmd)
static taskqueue_state_t taskqueue_state;
-void TaskQueue_Init(void)
+void TaskQueue_Init_Commands(void)
{
Cvar_RegisterVariable(&taskqueue_minthreads);
Cvar_RegisterVariable(&taskqueue_maxthreads);
// 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);
// 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."};
-void u8_Init(void)
+void u8_Init_Commands(void)
{
Cvar_RegisterVariable(&utf8_enable);
}
// 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;
-void u8_Init(void);
+void u8_Init_Commands(void);
size_t u8_strlen(const char*);
size_t u8_strnlen(const char*, size_t);
void VID_Shared_Init(void);
+void VID_Shared_Init_Commands(void);
+
void GL_Setup(void);
void VID_ClearExtensions(void);
void VID_Init (void);
+void VID_Init_Commands(void);
// Called at startup
void VID_Shutdown (void);
InitSig(); // trap evil signals
}
+void VID_Init_Commands(void)
+{
+}
+
qboolean VID_InitMode(viddef_mode_t *mode)
{
return false;
void VID_Init (void)
{
-#ifndef __IPHONEOS__
-#ifdef MACOSX
- Cvar_RegisterVariable(&apple_mouse_noaccel);
-#endif
-#endif
#ifdef DP_MOBILETOUCH
Cvar_SetValueQuick(&vid_touchscreen, 1);
#endif
- Cvar_RegisterVariable(&joy_sdl2_trigger_deadzone);
#ifdef SDL_R_RESTART
R_RegisterModule("SDL", sdl_start, sdl_shutdown, sdl_newmap, NULL, NULL);
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)
{
#endif
void VID_Shared_Init(void)
+{
+#ifdef WIN32
+ Sys_LoadLibrary(xinputdllnames, &xinputdll_dll, xinputdllfuncs);
+#endif
+}
+
+void VID_Shared_Init_Commands(void)
{
Cvar_RegisterVariable(&gl_info_vendor);
Cvar_RegisterVariable(&gl_info_renderer);
Cvar_RegisterVariable(&joy_x360_sensitivitypitch);
Cvar_RegisterVariable(&joy_x360_sensitivityyaw);
//Cvar_RegisterVariable(&joy_x360_sensitivityroll);
-
-#ifdef WIN32
- Sys_LoadLibrary(xinputdllnames, &xinputdll_dll, xinputdllfuncs);
-#endif
-
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)");
}
*/
static void World_Physics_Init(void);
+static void World_Physics_Init_Commands(void);
void World_Init(void)
{
Collision_Init();
World_Physics_Init();
}
+void World_Init_Commands(void)
+{
+ Collision_Init_Commands();
+ World_Physics_Init_Commands();
+}
+
static void World_Physics_Shutdown(void);
void World_Shutdown(void)
{
};
#endif
- Cvar_RegisterVariable(&physics_ode_quadtree_depth);
- Cvar_RegisterVariable(&physics_ode_contactsurfacelayer);
- Cvar_RegisterVariable(&physics_ode_worldstep_iterations);
- Cvar_RegisterVariable(&physics_ode_contact_mu);
- Cvar_RegisterVariable(&physics_ode_contact_erp);
- Cvar_RegisterVariable(&physics_ode_contact_cfm);
- Cvar_RegisterVariable(&physics_ode_contact_maxpoints);
- Cvar_RegisterVariable(&physics_ode_world_erp);
- Cvar_RegisterVariable(&physics_ode_world_cfm);
- Cvar_RegisterVariable(&physics_ode_world_damping);
- Cvar_RegisterVariable(&physics_ode_world_damping_linear);
- Cvar_RegisterVariable(&physics_ode_world_damping_linear_threshold);
- Cvar_RegisterVariable(&physics_ode_world_damping_angular);
- Cvar_RegisterVariable(&physics_ode_world_damping_angular_threshold);
- Cvar_RegisterVariable(&physics_ode_world_gravitymod);
- Cvar_RegisterVariable(&physics_ode_iterationsperframe);
- Cvar_RegisterVariable(&physics_ode_constantstep);
- Cvar_RegisterVariable(&physics_ode_movelimit);
- Cvar_RegisterVariable(&physics_ode_spinlimit);
- Cvar_RegisterVariable(&physics_ode_trick_fixnan);
- Cvar_RegisterVariable(&physics_ode_autodisable);
- Cvar_RegisterVariable(&physics_ode_autodisable_steps);
- Cvar_RegisterVariable(&physics_ode_autodisable_time);
- Cvar_RegisterVariable(&physics_ode_autodisable_threshold_linear);
- Cvar_RegisterVariable(&physics_ode_autodisable_threshold_angular);
- Cvar_RegisterVariable(&physics_ode_autodisable_threshold_samples);
- Cvar_RegisterVariable(&physics_ode_printstats);
- Cvar_RegisterVariable(&physics_ode_allowconvex);
- Cvar_RegisterVariable(&physics_ode);
-
#ifndef LINK_TO_LIBODE
// Load the DLL
if (Sys_LoadLibrary (dllnames, &ode_dll, odefuncs))
#endif
}
+static void World_Physics_Init_Commands(void)
+{
+#ifdef USEODE
+ Cvar_RegisterVariable(&physics_ode_quadtree_depth);
+ Cvar_RegisterVariable(&physics_ode_contactsurfacelayer);
+ Cvar_RegisterVariable(&physics_ode_worldstep_iterations);
+ Cvar_RegisterVariable(&physics_ode_contact_mu);
+ Cvar_RegisterVariable(&physics_ode_contact_erp);
+ Cvar_RegisterVariable(&physics_ode_contact_cfm);
+ Cvar_RegisterVariable(&physics_ode_contact_maxpoints);
+ Cvar_RegisterVariable(&physics_ode_world_erp);
+ Cvar_RegisterVariable(&physics_ode_world_cfm);
+ Cvar_RegisterVariable(&physics_ode_world_damping);
+ Cvar_RegisterVariable(&physics_ode_world_damping_linear);
+ Cvar_RegisterVariable(&physics_ode_world_damping_linear_threshold);
+ Cvar_RegisterVariable(&physics_ode_world_damping_angular);
+ Cvar_RegisterVariable(&physics_ode_world_damping_angular_threshold);
+ Cvar_RegisterVariable(&physics_ode_world_gravitymod);
+ Cvar_RegisterVariable(&physics_ode_iterationsperframe);
+ Cvar_RegisterVariable(&physics_ode_constantstep);
+ Cvar_RegisterVariable(&physics_ode_movelimit);
+ Cvar_RegisterVariable(&physics_ode_spinlimit);
+ Cvar_RegisterVariable(&physics_ode_trick_fixnan);
+ Cvar_RegisterVariable(&physics_ode_autodisable);
+ Cvar_RegisterVariable(&physics_ode_autodisable_steps);
+ Cvar_RegisterVariable(&physics_ode_autodisable_time);
+ Cvar_RegisterVariable(&physics_ode_autodisable_threshold_linear);
+ Cvar_RegisterVariable(&physics_ode_autodisable_threshold_angular);
+ Cvar_RegisterVariable(&physics_ode_autodisable_threshold_samples);
+ Cvar_RegisterVariable(&physics_ode_printstats);
+ Cvar_RegisterVariable(&physics_ode_allowconvex);
+ Cvar_RegisterVariable(&physics_ode);
+#endif
+}
+
static void World_Physics_Shutdown(void)
{
#ifdef USEODE
void World_InsertLinkBefore(link_t *l, link_t *before, int entitynumber);
void World_Init(void);
+void World_Init_Commands(void);
void World_Shutdown(void);
/// called after the world model has been loaded, before linking any entities