diff --git a/Quake/chase.c b/Quake/chase.c index 526b4c96..ff1a2c74 100644 --- a/Quake/chase.c +++ b/Quake/chase.c @@ -83,7 +83,6 @@ TODO: stay at least 8 units away from all walls in this leaf void Chase_UpdateForDrawing (void) { int i; - //float dist; vec3_t forward, up, right; vec3_t ideal, crosshair, temp; diff --git a/Quake/cl_input.c b/Quake/cl_input.c index e3a2be66..8852a0f2 100644 --- a/Quake/cl_input.c +++ b/Quake/cl_input.c @@ -183,25 +183,33 @@ float CL_KeyState (kbutton_t *key) val = 0; if (impulsedown && !impulseup) + { if (down) val = 0.5; // pressed and held this frame else val = 0; // I_Error (); + } if (impulseup && !impulsedown) + { if (down) val = 0; // I_Error (); else val = 0; // released this frame + } if (!impulsedown && !impulseup) + { if (down) val = 1.0; // held the entire frame else val = 0; // up the entire frame + } if (impulsedown && impulseup) + { if (down) val = 0.75; // released and re-pressed this frame else val = 0.25; // pressed and released this frame + } key->state &= 1; // clear impulses diff --git a/Quake/cl_parse.c b/Quake/cl_parse.c index 3f0e9086..97cd2f11 100644 --- a/Quake/cl_parse.c +++ b/Quake/cl_parse.c @@ -932,6 +932,7 @@ void CL_ParseServerMessage (void) // MSG_BeginReading (); + lastcmd = 0; while (1) { if (msg_badread) diff --git a/Quake/client.h b/Quake/client.h index 9a2dd137..5bbd2544 100644 --- a/Quake/client.h +++ b/Quake/client.h @@ -368,3 +368,4 @@ void V_SetContentsColor (int contents); // void CL_InitTEnts (void); void CL_SignonReply (void); + diff --git a/Quake/common.c b/Quake/common.c index 5246d542..7aff542b 100644 --- a/Quake/common.c +++ b/Quake/common.c @@ -1143,7 +1143,7 @@ void COM_InitArgv (int argc, char **argv) break; } - if (com_cmdline[n-1] = ' ') + if (n > 0 && com_cmdline[n-1] == ' ') com_cmdline[n-1] = 0; //johnfitz -- kill the trailing space Con_Printf("\nCommand line: %s",com_cmdline); diff --git a/Quake/common.h b/Quake/common.h index 88c85e17..1d457745 100644 --- a/Quake/common.h +++ b/Quake/common.h @@ -158,6 +158,7 @@ char *COM_SkipPath (char *pathname); void COM_StripExtension (char *in, char *out); void COM_FileBase (char *in, char *out); void COM_DefaultExtension (char *path, char *extension); +void COM_CreatePath (char *path); char *va(char *format, ...); // does a varargs printf into a temp buffer diff --git a/Quake/console.h b/Quake/console.h index 05a055eb..7b99def8 100644 --- a/Quake/console.h +++ b/Quake/console.h @@ -51,3 +51,8 @@ void Con_NotifyBox (char *text); // during startup for sound / cd warnings void Con_Show (void); void Con_Hide (void); + +char *Con_Quakebar (int len); +void Con_TabComplete (void); +void Con_LogCenterPrint (char *str); + diff --git a/Quake/cvar.h b/Quake/cvar.h index 7964b6e7..042b4566 100644 --- a/Quake/cvar.h +++ b/Quake/cvar.h @@ -97,4 +97,7 @@ void Cvar_WriteVariables (FILE *f); cvar_t *Cvar_FindVar (char *var_name); +void Cvar_Init (void); + extern cvar_t *cvar_vars; + diff --git a/Quake/draw.h b/Quake/draw.h index 66b4e244..0d66d40f 100644 --- a/Quake/draw.h +++ b/Quake/draw.h @@ -37,5 +37,7 @@ void Draw_FadeScreen (void); void Draw_String (int x, int y, char *str); qpic_t *Draw_PicFromWad (char *name); qpic_t *Draw_CachePic (char *path); +void Draw_NewGame (void); + +void GL_SetCanvas (canvastype newcanvas); //johnfitz -//void GL_SetCanvas (canvastype newcanvas); //johnfitz diff --git a/Quake/gl_draw.c b/Quake/gl_draw.c index dfd56fdc..139b8c1f 100644 --- a/Quake/gl_draw.c +++ b/Quake/gl_draw.c @@ -149,7 +149,6 @@ int Scrap_AllocBlock (int w, int h, int *x, int *y) { int i, j; int best, best2; - //int bestx; unused -- kristian int texnum; for (texnum=0 ; texnum cl.time) { - float f;//, d; unused -- kristian + float f; f = (fade_done - cl.time) / fade_time; old_density = f * old_density + (1.0 - f) * fog_density; diff --git a/Quake/gl_mesh.c b/Quake/gl_mesh.c index d0396216..c5158eac 100644 --- a/Quake/gl_mesh.c +++ b/Quake/gl_mesh.c @@ -203,14 +203,6 @@ void BuildTris (void) { int i, j, k; int startv; - /* unused -- kristian - mtriangle_t *last, *check; - int m1, m2; - int striplength; - trivertx_t *v; - mtriangle_t *tv; - int index; - */ float s, t; int len, bestlen, besttype; int bestverts[1024]; @@ -230,6 +222,7 @@ void BuildTris (void) continue; bestlen = 0; + besttype = 0; for (type = 0 ; type < 2 ; type++) // type = 1; { @@ -298,13 +291,6 @@ void GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr) int i, j; int *cmds; trivertx_t *verts; - /* unused -- kristian - maliasgroup_t *paliasgroup; - char cache[MAX_QPATH], fullpath[MAX_OSPATH], *c; - FILE *f; - int len; - byte *data; - */ float hscale, vscale; //johnfitz -- padded skins int count; //johnfitz -- precompute texcoords for padded skins int *loadcmds; //johnfitz @@ -319,64 +305,9 @@ void GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr) //johnfitz -- generate meshes -#if 1 //always regenerate meshes - Con_DPrintf ("meshing %s...\n",m->name); BuildTris (); -#else //conditional regeneration - - if (gl_alwaysmesh.value) // build it from scratch, and don't bother saving it to disk - { - Con_DPrintf ("meshing %s...\n",m->name); - BuildTris (); - } - else // check disk cache, and rebuild it and save to disk if necessary - { - // FITZQUAKE 0.85 CREATES DIRECTORIES HERE - // - // look for a cached version - // - strcpy (cache, "glquake/"); - COM_StripExtension (m->name+strlen("progs/"), cache+strlen("glquake/")); - strcat (cache, ".ms2"); - - COM_FOpenFile (cache, &f); - if (f) - { - fread (&numcommands, 4, 1, f); - fread (&numorder, 4, 1, f); - fread (&commands, numcommands * sizeof(commands[0]), 1, f); - fread (&vertexorder, numorder * sizeof(vertexorder[0]), 1, f); - fclose (f); - } - else - { - // - // build it from scratch - // - Con_Printf ("meshing %s...\n",m->name); - BuildTris (); - - // - // save out the cached version - // - sprintf (fullpath, "%s/%s", com_gamedir, cache); - f = fopen (fullpath, "wb"); - if (f) - { - fwrite (&numcommands, 4, 1, f); - fwrite (&numorder, 4, 1, f); - fwrite (&commands, numcommands * sizeof(commands[0]), 1, f); - fwrite (&vertexorder, numorder * sizeof(vertexorder[0]), 1, f); - fclose (f); - } - } - } -#endif -//johnfitz - - // save the data out paliashdr->poseverts = numorder; diff --git a/Quake/gl_model.c b/Quake/gl_model.c index 7db19d3b..950e8f7e 100644 --- a/Quake/gl_model.c +++ b/Quake/gl_model.c @@ -379,7 +379,6 @@ void Mod_LoadTextures (lump_t *l) int mark, fwidth, fheight; char filename[MAX_OSPATH], filename2[MAX_OSPATH], mapname[MAX_OSPATH]; byte *data; - FILE *f; extern byte *hunk_base; //johnfitz @@ -900,7 +899,6 @@ void Mod_PolyForUnlitSurface (msurface_t *fa) vec3_t verts[64]; int numverts, i, lindex; float *vec; - // texture_t *t; unused -- kristian glpoly_t *poly; float texscale; @@ -1643,8 +1641,8 @@ Mod_LoadAliasFrame */ void * Mod_LoadAliasFrame (void * pin, maliasframedesc_t *frame) { - trivertx_t *pframe, *pinframe; - int i, j; + trivertx_t *pinframe; + int i; daliasframe_t *pdaliasframe; pdaliasframe = (daliasframe_t *)pin; @@ -1807,10 +1805,9 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype) { int i, j, k, size, groupskins; char name[32]; - byte *copy, *skin, *texels; + byte *skin, *texels; daliasskingroup_t *pinskingroup; daliasskininterval_t *pinskinintervals; - int padx, pady, ii, jj; //johnfitz -- padded player skin char fbr_mask_name[64]; //johnfitz -- added for fullbright support unsigned offset; //johnfitz @@ -2017,7 +2014,7 @@ void Mod_LoadAliasModel (model_t *mod, void *buffer) mdl_t *pinmodel; stvert_t *pinstverts; dtriangle_t *pintriangles; - int version, numframes;//, numskins; unused -- kristian + int version, numframes; int size; daliasframetype_t *pframetype; daliasskintype_t *pskintype; @@ -2174,11 +2171,7 @@ void * Mod_LoadSpriteFrame (void * pin, mspriteframe_t **ppframe, int framenum) { dspriteframe_t *pinframe; mspriteframe_t *pspriteframe; - int width, height, size, origin[2];//, i; unused -- kristian - /* unused -- kristian - unsigned short *ppixout; - byte *ppixin; - */ + int width, height, size, origin[2]; char name[64]; unsigned offset; //johnfitz diff --git a/Quake/gl_model.h b/Quake/gl_model.h index c31f3a52..e5277e78 100644 --- a/Quake/gl_model.h +++ b/Quake/gl_model.h @@ -451,4 +451,6 @@ void Mod_TouchModel (char *name); mleaf_t *Mod_PointInLeaf (float *p, model_t *model); byte *Mod_LeafPVS (mleaf_t *leaf, model_t *model); +void Mod_SetExtraFlags (model_t *mod); + #endif // __MODEL__ diff --git a/Quake/gl_rmain.c b/Quake/gl_rmain.c index 2a0d8861..88034702 100644 --- a/Quake/gl_rmain.c +++ b/Quake/gl_rmain.c @@ -100,6 +100,7 @@ cvar_t r_showbboxes = {"r_showbboxes", "0"}; cvar_t r_lerpmodels = {"r_lerpmodels", "1"}; cvar_t r_lerpmove = {"r_lerpmove", "1"}; cvar_t r_nolerp_list = {"r_nolerp_list", "progs/flame.mdl,progs/flame2.mdl,progs/braztall.mdl,progs/brazshrt.mdl,progs/longtrch.mdl,progs/flame_pyre.mdl,progs/v_saw.mdl,progs/v_xfist.mdl,progs/h2stuff/newfire.mdl"}; +extern cvar_t r_vfog; //johnfitz /* @@ -456,7 +457,6 @@ R_DrawEntitiesOnList */ void R_DrawEntitiesOnList (qboolean alphapass) //johnfitz -- added parameter { - extern cvar_t r_vfog; //johnfitz int i; if (!r_drawentities.value) diff --git a/Quake/gl_rmisc.c b/Quake/gl_rmisc.c index 4e253947..9f7e8b6a 100644 --- a/Quake/gl_rmisc.c +++ b/Quake/gl_rmisc.c @@ -120,7 +120,6 @@ Grab six views for environment mapping tests void R_Envmap_f (void) { byte buffer[256*256*4]; - // char name[1024]; unused -- kristian glDrawBuffer (GL_FRONT); glReadBuffer (GL_FRONT); @@ -184,7 +183,6 @@ R_Init */ void R_Init (void) { - // extern byte *hunk_base; unused -- kristian extern cvar_t gl_finish; Cmd_AddCommand ("timerefresh", R_TimeRefresh_f); @@ -376,10 +374,6 @@ void R_TimeRefresh_f (void) { int i; float start, stop, time; - /* unused -- kristian - int startangle; - vrect_t vr; - */ glDrawBuffer (GL_FRONT); glFinish (); diff --git a/Quake/gl_screen.c b/Quake/gl_screen.c index 9889a4e4..1ebc2253 100644 --- a/Quake/gl_screen.c +++ b/Quake/gl_screen.c @@ -263,10 +263,7 @@ Internal use only static void SCR_CalcRefdef (void) { float size, scale; //johnfitz -- scale - /* unused -- kristian - vrect_t vrect; - int h; - */ + vid.recalc_refdef = 0; // force the status bar to redraw @@ -959,8 +956,6 @@ needs almost the entire 256k of stack space! */ void SCR_UpdateScreen (void) { - // vrect_t vrect; unused -- kristian - if (block_drawing) return; diff --git a/Quake/gl_sky.c b/Quake/gl_sky.c index ce3be049..543a2061 100644 --- a/Quake/gl_sky.c +++ b/Quake/gl_sky.c @@ -149,7 +149,6 @@ char *suf[6] = {"rt", "bk", "lf", "ft", "up", "dn"}; void Sky_LoadSkyBox (char *name) { int i, mark, width, height; - // FILE *f; unused -- kristian char filename[MAX_OSPATH]; byte *data; qboolean nonefound = true; @@ -494,7 +493,6 @@ Sky_ProcessPoly void Sky_ProcessPoly (glpoly_t *p) { int i; - // float *v; unused -- kristian vec3_t verts[MAX_CLIP_VERTS]; //draw it @@ -676,11 +674,6 @@ FIXME: eliminate cracks by adding an extra vert on tjuncs void Sky_DrawSkyBox (void) { int i; - /* unused -- kristian - , j, k; - vec3_t v; - float s, t; - */ for (i=0 ; i<6 ; i++) { diff --git a/Quake/gl_texmgr.c b/Quake/gl_texmgr.c index f0bf8ac4..7bb8a1d3 100644 --- a/Quake/gl_texmgr.c +++ b/Quake/gl_texmgr.c @@ -23,6 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.h" +extern qboolean gl_anisotropy_able; + cvar_t gl_texture_anisotropy = {"gl_texture_anisotropy", "1", true}; cvar_t gl_max_size = {"gl_max_size", "0"}; cvar_t gl_picmip = {"gl_picmip", "0"}; @@ -173,7 +175,6 @@ FIXME: this is getting called twice (becuase of the recursive Cvar_SetValue call */ void TexMgr_Anisotropy_f (void) { - // extern qboolean gl_anisotropy_able; unused -- kristian extern float gl_max_anisotropy; gltexture_t *glt; @@ -228,9 +229,9 @@ void TexMgr_Imagedump_f (void) for (glt=active_gltextures; glt; glt=glt->next) { Q_strcpy(tempname, glt->name); - while (c = strchr(tempname, ':')) *c = '_'; - while (c = strchr(tempname, '/')) *c = '_'; - while (c = strchr(tempname, '*')) *c = '_'; + while ( (c = strchr(tempname, ':')) ) *c = '_'; + while ( (c = strchr(tempname, '/')) ) *c = '_'; + while ( (c = strchr(tempname, '*')) ) *c = '_'; sprintf(tganame, "imagedump/%s.tga", tempname); GL_Bind (glt); @@ -545,7 +546,7 @@ must be called before any texture loading */ void TexMgr_Init (void) { - int i; //, mark; unused -- kristian + int i; static byte notexture_data[16] = {159,91,83,255,0,0,0,255,0,0,0,255,159,91,83,255}; //black and pink checker static byte nulltexture_data[16] = {127,191,255,255,0,0,0,255,0,0,0,255,127,191,255,255}; //black and blue checker extern texture_t *r_notexture_mip, *r_notexture_mip2; @@ -1121,7 +1122,7 @@ gltexture_t *TexMgr_LoadImage (model_t *owner, char *name, int width, int height extern int lightmap_bytes; unsigned short crc; gltexture_t *glt; - int mark; //, bytes; unused -- kristian + int mark; if (isDedicated) return NULL; diff --git a/Quake/glquake.h b/Quake/glquake.h index afeedba9..83ee26ff 100644 --- a/Quake/glquake.h +++ b/Quake/glquake.h @@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. void GL_BeginRendering (int *x, int *y, int *width, int *height); void GL_EndRendering (void); +void GL_Set2D (void); //johnfitz -- removed texture object stuff since they are standard in gl 1.1 @@ -162,9 +163,6 @@ extern const char *gl_renderer; extern const char *gl_version; extern const char *gl_extensions; -void R_TranslatePlayerSkin (int playernum); -void R_TranslateNewPlayerSkin (int playernum); //johnfitz -- this handles cases when the actual texture changes - // Multitexture #define TEXTURE0_SGIS 0x835E #define TEXTURE1_SGIS 0x835F @@ -272,3 +270,61 @@ void Fog_SetupFrame (void); void Fog_NewMap (void); void Fog_Init (void); //johnfitz + +void R_NewGame (void); + +void R_AnimateLight (void); +void R_MarkSurfaces (void); +void R_CullSurfaces (void); +qboolean R_CullBox (vec3_t emins, vec3_t emaxs); +void R_StoreEfrags (efrag_t **ppefrag); +qboolean R_CullModelForEntity (entity_t *e); +void R_RotateForEntity (vec3_t origin, vec3_t angles); +void R_MarkLights (dlight_t *light, int bit, mnode_t *node); + +void R_InitParticles (void); +void R_DrawParticles (void); +void CL_RunParticles (void); +void R_ClearParticles (void); + +void R_TranslatePlayerSkin (int playernum); +void R_TranslateNewPlayerSkin (int playernum); //johnfitz -- this handles cases when the actual texture changes +void R_UpdateWarpTextures (void); + +void R_DrawWorld (void); +void R_DrawAliasModel (entity_t *e); +void R_DrawBrushModel (entity_t *e); +void R_DrawSpriteModel (entity_t *e); + +void R_DrawTextureChains_Water (void); + +void R_RenderDlights (void); +void GL_BuildLightmaps (void); +void R_RebuildAllLightmaps (void); + +int R_LightPoint (vec3_t p); + +void GL_SubdivideSurface (msurface_t *fa); +void R_BuildLightMap (msurface_t *surf, byte *dest, int stride); +void R_RenderDynamicLightmaps (msurface_t *fa); +void R_UploadLightmap (int lmap); + +void R_DrawTextureChains_ShowTris (void); +void R_DrawBrushModel_ShowTris (entity_t *e); +void R_DrawAliasModel_ShowTris (entity_t *e); +void R_DrawParticles_ShowTris (void); + +void GL_DrawAliasShadow (entity_t *e); +void DrawGLTriangleFan (glpoly_t *p); +void DrawGLPoly (glpoly_t *p); +void DrawWaterPoly (glpoly_t *p); +void GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr); + +void Sky_Init (void); +void Sky_DrawSky (void); +void Sky_NewMap (void); +void Sky_LoadTexture (texture_t *mt); +void Sky_LoadSkyBox (char *name); + +void TexMgr_RecalcWarpImageSize (void); + diff --git a/Quake/host.c b/Quake/host.c index 4a9d0f48..fcb4ba6c 100644 --- a/Quake/host.c +++ b/Quake/host.c @@ -454,7 +454,7 @@ void Host_ShutdownServer(qboolean crash) int i; int count; sizebuf_t buf; - char message[4]; + byte message[4]; double start; if (!sv.active) diff --git a/Quake/keys.c b/Quake/keys.c index 7a074b5d..15c8b166 100644 --- a/Quake/keys.c +++ b/Quake/keys.c @@ -168,7 +168,7 @@ keyname_t keynames[] = // dedicated before exiting byte key_map[SDLK_LAST]; -void BuildKeyMaps() +void BuildKeyMaps (void) { int i; @@ -383,7 +383,6 @@ void Key_Console (int key) { extern int con_vislines; extern char key_tabpartial[MAXCMDLINE]; - // char *cmd; unused -- kristian switch (key) { @@ -434,7 +433,6 @@ void Key_Console (int key) char *line; extern int con_current, con_linewidth; extern char *con_text; - //extern float scr_con_current; unused -- kristian for (i = con_current - con_totallines + 1 ; i <= con_current ; i++) { diff --git a/Quake/keys.h b/Quake/keys.h index 63282ea2..d31718cd 100644 --- a/Quake/keys.h +++ b/Quake/keys.h @@ -151,4 +151,8 @@ void Key_Init (void); void Key_WriteBindings (FILE *f); void Key_SetBinding (int keynum, char *binding); void Key_ClearStates (void); +void BuildKeyMaps (void); + +int Key_Map (SDL_KeyboardEvent *event); + diff --git a/Quake/main.c b/Quake/main.c index 8d9e77fc..c9ad8810 100644 --- a/Quake/main.c +++ b/Quake/main.c @@ -75,6 +75,7 @@ int main(int argc, char *argv[]) switch (event.type) { case SDL_ACTIVEEVENT: if (event.active.state & SDL_APPACTIVE & SDL_APPINPUTFOCUS) + { if (event.active.gain) { IN_Activate(); @@ -84,6 +85,7 @@ int main(int argc, char *argv[]) // TODO: handle sound IN_Deactivate(vid.type == MODE_WINDOWED); } + } break; case SDL_MOUSEMOTION: IN_MouseMove(event.motion.xrel, event.motion.yrel); @@ -112,7 +114,8 @@ int main(int argc, char *argv[]) case SDL_KEYDOWN: case SDL_KEYUP: // LSHIFT + ESC and circomflex always opens the console no matter what - if ((event.key.keysym.sym == SDLK_ESCAPE && (event.key.keysym.mod & KMOD_LSHIFT != 0)) || (event.key.keysym.sym == SDLK_CARET)) + if ((event.key.keysym.sym == SDLK_ESCAPE && (event.key.keysym.mod & KMOD_LSHIFT) != 0) + || (event.key.keysym.sym == SDLK_CARET)) { if (event.key.type == SDL_KEYDOWN) Con_ToggleConsole_f(); diff --git a/Quake/menu.c b/Quake/menu.c index 03697422..d2549d05 100644 --- a/Quake/menu.c +++ b/Quake/menu.c @@ -1607,7 +1607,7 @@ void M_Quit_Draw (void) //johnfitz -- modified for new quit message char msg1[40]; char msg2[40]; char msg3[40]; - int boxlen, y; + int boxlen; if (wasInMenus) { @@ -1913,16 +1913,20 @@ forward: } if (DirectConfig && (serialConfig_cursor == 3 || serialConfig_cursor == 4)) + { if (key == K_UPARROW) serialConfig_cursor = 2; else serialConfig_cursor = 5; + } if (SerialConfig && StartingGame && serialConfig_cursor == 4) + { if (key == K_UPARROW) serialConfig_cursor = 3; else serialConfig_cursor = 5; + } } //============================================================================= @@ -2289,10 +2293,12 @@ void M_LanConfig_Key (int key) } if (StartingGame && lanConfig_cursor == 2) + { if (key == K_UPARROW) lanConfig_cursor = 1; else lanConfig_cursor = 0; + } l = Q_atoi(lanConfig_portname); if (l > 65535) diff --git a/Quake/menu.h b/Quake/menu.h index f2729a7f..9b864992 100644 --- a/Quake/menu.h +++ b/Quake/menu.h @@ -36,4 +36,5 @@ void M_Keydown (int key); void M_Draw (void); void M_ToggleMenu_f (void); +void M_Print (int cx, int cy, char *str); diff --git a/Quake/pr_cmds.c b/Quake/pr_cmds.c index b4a98a12..b84a9a20 100644 --- a/Quake/pr_cmds.c +++ b/Quake/pr_cmds.c @@ -537,10 +537,12 @@ void PF_ambientsound (void) //johnfitz -- PROTOCOL_FITZQUAKE if (soundnum > 255) + { if (sv.protocol == PROTOCOL_NETQUAKE) return; //don't send any info protocol can't support else large = true; + } //johnfitz // add an svc_spawnambient command to the level signon packet diff --git a/Quake/quakedef.h b/Quake/quakedef.h index 7caaf9bf..2ce89c92 100644 --- a/Quake/quakedef.h +++ b/Quake/quakedef.h @@ -229,9 +229,9 @@ typedef struct #include "wad.h" -#include "draw.h" #include "cvar.h" #include "screen.h" +#include "draw.h" #include "net.h" #include "protocol.h" #include "cmd.h" @@ -309,6 +309,10 @@ void Host_Frame (float time); void Host_Quit_f (void); void Host_ClientCommands (char *fmt, ...); void Host_ShutdownServer (qboolean crash); +void Host_WriteConfiguration (void); + +void ExtraMaps_Init (void); +void Modlist_Init (void); extern qboolean msg_suppress_1; // suppresses resolution and cache size console output // an fullscreen DIB focus gain/loss @@ -326,5 +330,7 @@ extern int minimum_memory; extern cvar_t chase_active; void Chase_Init (void); +void TraceLine (vec3_t start, vec3_t end, vec3_t impact); void Chase_UpdateForClient (void); //johnfitz void Chase_UpdateForDrawing (void); //johnfitz + diff --git a/Quake/r_alias.c b/Quake/r_alias.c index bfb25446..9ebb0ec0 100644 --- a/Quake/r_alias.c +++ b/Quake/r_alias.c @@ -383,7 +383,6 @@ R_DrawAliasModel -- johnfitz -- almost completely rewritten void R_DrawAliasModel (entity_t *e) { aliashdr_t *paliashdr; - vec3_t mins, maxs; int i, anim; gltexture_t *tx, *fb; lerpdata_t lerpdata; @@ -657,7 +656,6 @@ void GL_DrawAliasShadow (entity_t *e) 0, 0, SHADOW_HEIGHT, 1}; float lheight; aliashdr_t *paliashdr; - vec3_t mins, maxs; lerpdata_t lerpdata; if (R_CullModelForEntity(e)) @@ -711,7 +709,6 @@ R_DrawAliasModel_ShowTris -- johnfitz void R_DrawAliasModel_ShowTris (entity_t *e) { aliashdr_t *paliashdr; - vec3_t mins, maxs; lerpdata_t lerpdata; if (R_CullModelForEntity(e)) diff --git a/Quake/r_brush.c b/Quake/r_brush.c index 05b406b0..449246b9 100644 --- a/Quake/r_brush.c +++ b/Quake/r_brush.c @@ -47,9 +47,6 @@ int allocated[MAX_LIGHTMAPS][BLOCK_WIDTH]; // main memory so texsubimage can update properly byte lightmaps[4*MAX_LIGHTMAPS*BLOCK_WIDTH*BLOCK_HEIGHT]; -void R_RenderDynamicLightmaps (msurface_t *fa); -void R_BuildLightMap (msurface_t *surf, byte *dest, int stride); -void R_UploadLightmap (int lmap); /* =============== @@ -500,8 +497,7 @@ R_DrawBrushModel */ void R_DrawBrushModel (entity_t *e) { - int j, k; - int i, numsurfaces; + int i, k; msurface_t *psurf; float dot; mplane_t *pplane; @@ -582,7 +578,7 @@ R_DrawBrushModel_ShowTris -- johnfitz */ void R_DrawBrushModel_ShowTris (entity_t *e) { - int i, j, k, numsurfaces; + int i; msurface_t *psurf; float dot; mplane_t *pplane; @@ -711,9 +707,6 @@ int AllocBlock (int w, int h, int *x, int *y) int i, j; int best, best2; int texnum; - /* unused -- kristian - int bestx; - */ for (texnum=0 ; texnumextents[0]>>4)+1; tmax = (surf->extents[1]>>4)+1; @@ -791,15 +781,6 @@ void BuildSurfaceDisplayList (msurface_t *fa) float *vec; float s, t; glpoly_t *poly; - /* unused -- kristian - int s_axis, t_axis; - float dist, lastdist, lzi, scale, u, v, frac; - unsigned mask; - vec3_t local, transformed; - mplane_t *pplane; - int newverts, newpage, lastvert; - qboolean visible; - */ // reconstruct the polygon pedges = currentmodel->edges; @@ -1049,9 +1030,6 @@ void R_BuildLightMap (msurface_t *surf, byte *dest, int stride) unsigned scale; int maps; unsigned *bl; - /* unused -- kristian - int lightadj[4]; - */ surf->cached_dlight = (surf->dlightframe == r_framecount); @@ -1094,7 +1072,7 @@ void R_BuildLightMap (msurface_t *surf, byte *dest, int stride) } // bound, invert, and shift -store: +// store: //johnfitz -- only support GL_RGB lightmaps switch (gl_lightmap_format) diff --git a/Quake/r_part.c b/Quake/r_part.c index fa96ed1f..f86f3079 100644 --- a/Quake/r_part.c +++ b/Quake/r_part.c @@ -715,9 +715,6 @@ void CL_RunParticles (void) int i; float time1, time2, time3, dvel, frametime, grav; extern cvar_t sv_gravity; - /* unused -- kristian - float scale; - */ frametime = cl.time - cl.oldtime; time3 = frametime * 15; @@ -825,9 +822,7 @@ void R_DrawParticles (void) vec3_t up, right, p_up, p_right, p_upright; //johnfitz -- p_ vectors byte color[4]; //johnfitz -- particle transparency extern cvar_t r_particles; //johnfitz - /* unused -- kristian - float alpha; //johnfitz -- particle transparency - */ + //float alpha; //johnfitz -- particle transparency if (!r_particles.value) return; diff --git a/Quake/r_sprite.c b/Quake/r_sprite.c index 70ed36f3..36c899f9 100644 --- a/Quake/r_sprite.c +++ b/Quake/r_sprite.c @@ -85,9 +85,6 @@ void R_DrawSpriteModel (entity_t *e) mspriteframe_t *frame; float *s_up, *s_right; float angle, sr, cr; - /* unused -- kristian - float len; - */ //TODO: frustum cull it? diff --git a/Quake/r_world.c b/Quake/r_world.c index 8b6c3553..99f53db9 100644 --- a/Quake/r_world.c +++ b/Quake/r_world.c @@ -473,10 +473,6 @@ void R_DrawTextureChains_Water (void) texture_t *t; glpoly_t *p; qboolean bound; - /* unused -- kristian - int j; - float *v; - */ if (r_drawflat_cheatsafe || r_lightmap_cheatsafe || !r_drawworld_cheatsafe) return; diff --git a/Quake/sbar.c b/Quake/sbar.c index c8265e53..34d9f802 100644 --- a/Quake/sbar.c +++ b/Quake/sbar.c @@ -277,7 +277,7 @@ void Sbar_DrawPic (int x, int y, qpic_t *pic) Sbar_DrawPicAlpha -- johnfitz ============= */ -Sbar_DrawPicAlpha (int x, int y, qpic_t *pic, float alpha) +void Sbar_DrawPicAlpha (int x, int y, qpic_t *pic, float alpha) { glDisable (GL_ALPHA_TEST); glEnable (GL_BLEND); @@ -1162,7 +1162,6 @@ void Sbar_MiniDeathmatchOverlay (void) int i, k, l, top, bottom, x, y, f, numlines; char num[12]; float scale; //johnfitz - qpic_t *pic; scoreboard_t *s; scale = CLAMP (1.0, scr_sbarscale.value, (float)glwidth / 320.0); //johnfitz diff --git a/Quake/sbar.h b/Quake/sbar.h index 819552fd..0dbcf04c 100644 --- a/Quake/sbar.h +++ b/Quake/sbar.h @@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern int sb_lines; // scan lines to draw void Sbar_Init (void); +void Sbar_LoadPics (void); void Sbar_Changed (void); // call whenever any of the client stats represented on the sbar changes diff --git a/Quake/screen.h b/Quake/screen.h index e4c1872f..e368c209 100644 --- a/Quake/screen.h +++ b/Quake/screen.h @@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // screen.h void SCR_Init (void); +void SCR_LoadPics (void); void SCR_UpdateScreen (void); diff --git a/Quake/snd_dma.c b/Quake/snd_dma.c index 3aaa237a..2f31287d 100644 --- a/Quake/snd_dma.c +++ b/Quake/snd_dma.c @@ -102,8 +102,6 @@ S_Startup void S_Startup (void) { - int rc; - if (!snd_initialized) return; diff --git a/Quake/snd_mem.c b/Quake/snd_mem.c index 24906be4..6ef74855 100644 --- a/Quake/snd_mem.c +++ b/Quake/snd_mem.c @@ -263,7 +263,7 @@ wavinfo_t GetWavinfo (char *name, byte *wav, int wavlength) // find "RIFF" chunk FindChunk("RIFF"); - if (!(data_p && !Q_strncmp(data_p+8, "WAVE", 4))) + if (!(data_p && !Q_strncmp((char *)data_p + 8, "WAVE", 4))) { Con_Printf("Missing RIFF/WAVE chunks\n"); return info; @@ -303,7 +303,7 @@ wavinfo_t GetWavinfo (char *name, byte *wav, int wavlength) FindNextChunk ("LIST"); if (data_p) { - if (!strncmp (data_p + 28, "mark", 4)) + if (!strncmp((char *)data_p + 28, "mark", 4)) { // this is not a proper parse, but it works with cooledit... data_p += 24; i = GetLittleLong (); // samples in loop diff --git a/Quake/snd_mix.c b/Quake/snd_mix.c index 2e4c0c85..0e16c3e9 100644 --- a/Quake/snd_mix.c +++ b/Quake/snd_mix.c @@ -257,7 +257,7 @@ void SND_PaintChannelFrom8 (channel_t *ch, sfxcache_t *sc, int count) lscale = snd_scaletable[ch->leftvol >> 3]; rscale = snd_scaletable[ch->rightvol >> 3]; - sfx = (signed char *)sc->data + ch->pos; + sfx = (unsigned char *) ((signed char *)sc->data + ch->pos); for (i=0 ; i= 8192) + { if (sv.protocol == PROTOCOL_NETQUAKE) return; //don't send any info protocol can't support else field_mask |= SND_LARGEENTITY; + } if (sound_num >= 256 || channel >= 8) + { if (sv.protocol == PROTOCOL_NETQUAKE) return; //don't send any info protocol can't support else field_mask |= SND_LARGESOUND; + } //johnfitz // directed messages go only to the entity the are targeted on @@ -1218,7 +1222,7 @@ Tell all the clients that the server is changing levels */ void SV_SendReconnect (void) { - char data[128]; + byte data[128]; sizebuf_t msg; msg.data = data; diff --git a/Quake/sys_sdl.c b/Quake/sys_sdl.c index 3f4a3754..db39f010 100644 --- a/Quake/sys_sdl.c +++ b/Quake/sys_sdl.c @@ -150,7 +150,6 @@ void Sys_Error (char *error, ...) char *text4 = "***********************************\n"; char *text5 = "\n"; double starttime; - //static int in_sys_error0 = 0; unused -- kristian static int in_sys_error1 = 0; static int in_sys_error2 = 0; static int in_sys_error3 = 0; diff --git a/Quake/vid.h b/Quake/vid.h index 683c3eba..6826544a 100644 --- a/Quake/vid.h +++ b/Quake/vid.h @@ -78,3 +78,8 @@ void VID_Update (vrect_t *rects); int VID_SetMode (int modenum); //johnfitz -- removed palette from argument list // sets the mode; only used by the Quake engine for resetting to mode 0 (the // base mode) on memory allocation failures + +void VID_SyncCvars (void); + +void VID_Toggle (void); + diff --git a/Quake/view.h b/Quake/view.h index fae058b4..e8fb9ab2 100644 --- a/Quake/view.h +++ b/Quake/view.h @@ -26,6 +26,8 @@ extern float v_blend[4]; void V_Init (void); void V_RenderView (void); +void V_CalcBlend (void); +void V_UpdateBlend (void); float V_CalcRoll (vec3_t angles, vec3_t velocity); //void V_UpdatePalette (void); //johnfitz diff --git a/Quake/world.c b/Quake/world.c index 68ff4daf..3b369fa3 100644 --- a/Quake/world.c +++ b/Quake/world.c @@ -390,7 +390,6 @@ SV_LinkEdict void SV_LinkEdict (edict_t *ent, qboolean touch_triggers) { areanode_t *node; - // model_t *mod = NULL; //johnfitz unused -- kristian if (ent->area.prev) SV_UnlinkEdict (ent); // unlink from old position diff --git a/Quake/world.h b/Quake/world.h index 4354d901..7081b907 100644 --- a/Quake/world.h +++ b/Quake/world.h @@ -77,3 +77,6 @@ trace_t SV_Move (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int type, e // shouldn't be considered solid objects // passedict is explicitly excluded from clipping checks (normally NULL) + +qboolean SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1, vec3_t p2, trace_t *trace); +