diff --git a/common/gl_rmain.c b/common/gl_rmain.c index f2e5e91..36e591c 100644 --- a/common/gl_rmain.c +++ b/common/gl_rmain.c @@ -940,29 +940,48 @@ R_RenderScene ( void ) { R_Clear */ void -R_Clear ( void ) { - if (gl_ztrick.value) { +R_Clear ( void ) +{ + static int l; + + if (gl_ztrick.value) + { static int trickframe; if (gl_clear.value) + { + if (l != (int)r_clearcolor.value) + { + l = (int)r_clearcolor.value; + glClearColor (host_basepal[l*3]/255.0, + host_basepal[l*3+1]/255.0, + host_basepal[l*3+2]/255.0, + 1.0); + } glClear (GL_COLOR_BUFFER_BIT); + } trickframe++; - if (trickframe & 1) { + if (trickframe & 1) + { gldepthmin = 0; gldepthmax = 0.49999; glDepthFunc (GL_LEQUAL); - } else { + } + else + { gldepthmin = 1; gldepthmax = 0.5; glDepthFunc (GL_GEQUAL); } - } else { - if (gl_clear.value) { + } + else + { + if (gl_clear.value) glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - } else { + else glClear (GL_DEPTH_BUFFER_BIT); - } + gldepthmin = 0; gldepthmax = 1; glDepthFunc (GL_LEQUAL); @@ -1017,10 +1036,10 @@ R_RenderView ( void ) { if (!r_worldentity.model || !cl.worldmodel) Sys_Error ("R_RenderView: NULL worldmodel"); - if ((int)cl_sbar.value == 1) - TileBC (0, 0, vid.width, vid.height - sb_lines); - else - TileBC (0, 0, vid.width, vid.height); +// if ((int)cl_sbar.value == 1) +// TileBC (0, 0, vid.width, vid.height - sb_lines); +// else +// TileBC (0, 0, vid.width, vid.height); if (r_speeds.value) { diff --git a/common/gl_vidglx.c b/common/gl_vidglx.c index 94ce4da..24c0589 100644 --- a/common/gl_vidglx.c +++ b/common/gl_vidglx.c @@ -300,7 +300,7 @@ void GL_Init (void) // Con_Printf ("%s %s\n", gl_renderer, gl_version); - glClearColor (1,0,0,0); + glClearColor (0,0,0,0); glCullFace(GL_FRONT); glEnable(GL_TEXTURE_2D); diff --git a/qw_server/sv_ccmds.c b/qw_server/sv_ccmds.c index 925fedd..6013ec6 100644 --- a/qw_server/sv_ccmds.c +++ b/qw_server/sv_ccmds.c @@ -1,4 +1,5 @@ /* +sv_ccmds.c Copyright (C) 1996-1997 Id Software, Inc. Portions Copyright (C) 1999,2000 Nelson Rush. Copyright (C) 1999,2000 contributors of the QuakeForge project @@ -625,62 +626,6 @@ void SV_Localinfo_f (void) } -/* -=========== -SV_User_f - -Examine a users info strings -=========== -*/ -void SV_User_f (void) -{ - if (Cmd_Argc() != 2) - { - Con_Printf ("Usage: info \n"); - return; - } - - if (!SV_SetPlayer ()) - return; - - Info_Print (host_client->userinfo); -} - -/* -================ -SV_Gamedir - -Sets the fake *gamedir to a different directory. -================ -*/ -void SV_Gamedir (void) -{ - char *dir; - - if (Cmd_Argc() == 1) - { - Con_Printf ("Current *gamedir: %s\n", Info_ValueForKey (svs.info, "*gamedir")); - return; - } - - if (Cmd_Argc() != 2) - { - Con_Printf ("Usage: sv_gamedir \n"); - return; - } - - dir = Cmd_Argv(1); - - if (strstr(dir, "..") || strstr(dir, "/") - || strstr(dir, "\\") || strstr(dir, ":") ) - { - Con_Printf ("*Gamedir should be a single filename, not a path\n"); - return; - } - - Info_SetValueForStarKey (svs.info, "*gamedir", dir, MAX_SERVERINFO_STRING); -} - /* ================ SV_Floodport_f @@ -739,7 +684,70 @@ void SV_Floodprotmsg_f (void) } snprintf(fp_msg, sizeof(fp_msg), "%s", Cmd_Argv(1)); } - + +/* + SV_Fly_f +*/ +void +SV_Fly_f ( void ) +{ + if (!sv_allow_cheats) + { + Con_Printf ("You must run the server with -cheats to enable this command.\n"); + return; + } + + if (!SV_SetPlayer()) + return; + + if (sv_player->v.movetype != MOVETYPE_FLY) + { + sv_player->v.movetype = MOVETYPE_FLY; + SV_ClientPrintf (host_client, PRINT_HIGH, "Fly mode ON\n"); + } + else + { + sv_player->v.movetype = MOVETYPE_WALK; + SV_ClientPrintf (host_client, PRINT_HIGH, "Fly mode OFF\n"); + } +} + + +/* +================ +SV_Gamedir + +Sets the fake *gamedir to a different directory. +================ +*/ +void SV_Gamedir (void) +{ + char *dir; + + if (Cmd_Argc() == 1) + { + Con_Printf ("Current *gamedir: %s\n", Info_ValueForKey (svs.info, "*gamedir")); + return; + } + + if (Cmd_Argc() != 2) + { + Con_Printf ("Usage: sv_gamedir \n"); + return; + } + + dir = Cmd_Argv(1); + + if (strstr(dir, "..") || strstr(dir, "/") + || strstr(dir, "\\") || strstr(dir, ":") ) + { + Con_Printf ("*Gamedir should be a single filename, not a path\n"); + return; + } + + Info_SetValueForStarKey (svs.info, "*gamedir", dir, MAX_SERVERINFO_STRING); +} + /* ================ SV_Gamedir_f @@ -871,6 +879,27 @@ void SV_SnapAll_f (void) } } +/* +=========== +SV_User_f + +Examine a users info strings +=========== +*/ +void SV_User_f (void) +{ + if (Cmd_Argc() != 2) + { + Con_Printf ("Usage: info \n"); + return; + } + + if (!SV_SetPlayer ()) + return; + + Info_Print (host_client->userinfo); +} + /* ================== SV_InitOperatorCommands @@ -908,6 +937,7 @@ void SV_InitOperatorCommands (void) Cmd_AddCommand ("sv_gamedir", SV_Gamedir); Cmd_AddCommand ("floodprot", SV_Floodprot_f); Cmd_AddCommand ("floodprotmsg", SV_Floodprotmsg_f); + Cmd_AddCommand ("fly", SV_Fly_f); cl_warncmd.value = 1; } diff --git a/qw_server/sv_phys.c b/qw_server/sv_phys.c index d87cd31..86772fc 100644 --- a/qw_server/sv_phys.c +++ b/qw_server/sv_phys.c @@ -1,4 +1,5 @@ /* +sv_phys.c Copyright (C) 1996-1997 Id Software, Inc. Copyright (C) 1999,2000 contributors of the QuakeForge project Please see the file "AUTHORS" for a list of contributors @@ -19,7 +20,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// sv_phys.c #include #include @@ -86,8 +86,9 @@ void SV_CheckAllEnts (void) if (check->free) continue; if (check->v.movetype == MOVETYPE_PUSH - || check->v.movetype == MOVETYPE_NONE - || check->v.movetype == MOVETYPE_NOCLIP) + || check->v.movetype == MOVETYPE_NONE + || check->v.movetype == MOVETYPE_NOCLIP + || check->v.movetype == MOVETYPE_FLY) continue; if (SV_TestEntityPosition (check)) @@ -742,8 +743,8 @@ void SV_Physics_Toss (edict_t *ent) SV_CheckVelocity (ent); // add gravity - if (ent->v.movetype != MOVETYPE_FLY - && ent->v.movetype != MOVETYPE_FLYMISSILE) + if (ent->v.movetype != MOVETYPE_FLYMISSILE + && ent->v.movetype != MOVETYPE_FLY) SV_AddGravity (ent, 1.0); // move angles @@ -867,9 +868,13 @@ void SV_RunEntity (edict_t *ent) case MOVETYPE_STEP: SV_Physics_Step (ent); break; + case MOVETYPE_FLY: + if (!SV_RunThink (ent)) + return; + SV_FlyMove (ent, host_frametime, NULL); + break; case MOVETYPE_TOSS: case MOVETYPE_BOUNCE: - case MOVETYPE_FLY: case MOVETYPE_FLYMISSILE: SV_Physics_Toss (ent); break;