From 75d9afc8c73002728e084037e66825b8c82be35c Mon Sep 17 00:00:00 2001 From: Molgrum Date: Mon, 6 Aug 2007 21:13:15 +0000 Subject: [PATCH] Fixed _alot_ of warnings, happy reviewing! git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2574 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/Makefile | 2 +- engine/client/cl_ui.c | 16 +++------- engine/client/client.h | 22 ++++++++++++- engine/client/menu.h | 1 + engine/client/pr_csqc.c | 68 +++++++++++++++++++--------------------- engine/client/renderer.c | 1 - engine/client/sbar.c | 5 +-- engine/client/screen.h | 2 ++ engine/client/sound.h | 3 ++ engine/common/cmd.h | 2 ++ engine/common/common.h | 3 ++ engine/common/net.h | 1 + engine/gl/gl_model.h | 1 + engine/gl/glquake.h | 4 +++ 14 files changed, 76 insertions(+), 55 deletions(-) diff --git a/engine/Makefile b/engine/Makefile index 56ffd91f2..4bdc74543 100644 --- a/engine/Makefile +++ b/engine/Makefile @@ -565,7 +565,7 @@ endif GL_EXE_NAME=../fteqwglcyg.exe GLCL_EXE_NAME=../fteqwclglcyg.exe GL_LDFLAGS=$(GLLDFLAGS) $(GLXLDFLAGS) - GL_CFLAGS=$(GLCFLAGS) + GL_CFLAGS=$(GLCFLAGS) -I/usr/X11R6/include GLB_DIR=gl_cygwin GLCL_DIR=glcl_cygwin diff --git a/engine/client/cl_ui.c b/engine/client/cl_ui.c index b60e55839..689c7160b 100644 --- a/engine/client/cl_ui.c +++ b/engine/client/cl_ui.c @@ -678,16 +678,8 @@ int VM_LerpTag(void *out, model_t *model, int f1, int f2, float l2, char *tagnam org = (float*)out; ang = ((float*)out+3); - if (Mod_GetTag) - { - if (Mod_TagNumForName) - tagnum = Mod_TagNumForName(model, tagname); - else - tagnum = 0; - found = Mod_GetTag(model, tagnum, f1, f2, l2, 0, 0, tr); - } - else - found = false; + tagnum = Mod_TagNumForName(model, tagname); + found = Mod_GetTag(model, tagnum, f1, f2, l2, 0, 0, tr); if (found) { @@ -1687,9 +1679,9 @@ qboolean UI_KeyPress(int key, qboolean down) } if (cls.state) - VM_Call(uivm, UI_SET_ACTIVE_MENU, 2)>0; + VM_Call(uivm, UI_SET_ACTIVE_MENU, 2); else - VM_Call(uivm, UI_SET_ACTIVE_MENU, 1)>0; + VM_Call(uivm, UI_SET_ACTIVE_MENU, 1); scr_conlines = 0; return true; diff --git a/engine/client/client.h b/engine/client/client.h index eaa7fff9f..62a9699aa 100644 --- a/engine/client/client.h +++ b/engine/client/client.h @@ -674,8 +674,15 @@ void CL_Disconnect (void); void CL_Disconnect_f (void); void CL_Reconnect_f (void); void CL_NextDemo (void); +void CL_Startdemos_f (void); +void CL_Demos_f (void); +void CL_Stopdemo_f (void); +void CL_Changing_f (void); +void CL_Reconnect_f (void); +void CL_ConnectionlessPacket (void); qboolean CL_DemoBehind(void); void CL_SaveInfo(vfsfile_t *f); +void CL_SetInfo (char *key, char *value); void CL_BeginServerConnect(void); void CLNQ_BeginServerConnect(void); @@ -754,6 +761,7 @@ void CL_Record_f (void); void CL_ReRecord_f (void); void CL_PlayDemo_f (void); void CL_QTVPlay_f (void); +void CL_QTVPoll (void); void CL_QTVList_f (void); void CL_QTVDemos_f (void); void CL_DemoJump_f(void); @@ -784,6 +792,8 @@ void CL_StopUpload(void); void CL_RequestNextDownload (void); void CL_SendDownloadReq(sizebuf_t *msg); +qboolean CL_CheckBaselines (int size); + // // view.c // @@ -1047,6 +1057,16 @@ void Media_ShutdownCin(cin_t *cin); void MVD_Interpolate(void); -void Stats_NewMap(void); +int Stats_GetKills(int playernum); +int Stats_GetTKills(int playernum); +int Stats_GetDeaths(int playernum); +int Stats_GetTouches(int playernum); +int Stats_GetCaptures(int playernum); +qboolean Stats_HaveFlags(void); +qboolean Stats_HaveKills(void); +void VARGS Stats_Message(char *msg, ...); +int qm_strcmp(char *s1, char *s2); +int qm_stricmp(char *s1, char *s2); void Stats_ParsePrintLine(char *line); +void Stats_NewMap(void); diff --git a/engine/client/menu.h b/engine/client/menu.h index 60f16fa2e..56d792537 100644 --- a/engine/client/menu.h +++ b/engine/client/menu.h @@ -285,6 +285,7 @@ menucheck_t *MC_AddCheckBoxFunc(menu_t *menu, int x, int y, const char *text, qb menubutton_t *MC_AddConsoleCommand(menu_t *menu, int x, int y, const char *text, const char *command); menubutton_t *MC_AddConsoleCommandQBigFont(menu_t *menu, int x, int y, const char *text, const char *command); mpic_t *QBigFontWorks(void); +menubutton_t *MC_AddConsoleCommandHexen2BigFont(menu_t *menu, int x, int y, const char *text, const char *command); menubutton_t *MC_AddCommand(menu_t *menu, int x, int y, char *text, qboolean (*command) (union menuoption_s *,struct menu_s *,int)); menucombo_t *MC_AddCombo(menu_t *menu, int x, int y, const char *caption, const char **text, int initialvalue); menubutton_t *MC_AddCommand(menu_t *menu, int x, int y, char *text, qboolean (*command) (union menuoption_s *,struct menu_s *,int)); diff --git a/engine/client/pr_csqc.c b/engine/client/pr_csqc.c index bb3751c64..64e87539e 100644 --- a/engine/client/pr_csqc.c +++ b/engine/client/pr_csqc.c @@ -2594,43 +2594,42 @@ void PF_rotatevectorsbytag (progfuncs_t *prinst, struct globalvars_s *pr_globals if (lerp < 0) lerp = 0; if (lerp > 1) lerp = 1; - if (Mod_GetTag) - if (Mod_GetTag(mod, tagnum, frame1, frame2, lerp, frame1time, frame2time, transforms)) + if (Mod_GetTag(mod, tagnum, frame1, frame2, lerp, frame1time, frame2time, transforms)) + { + VectorCopy(csqcg.forward, src+0); + src[3] = 0; + VectorNegate(csqcg.right, src+4); + src[7] = 0; + VectorCopy(csqcg.up, src+8); + src[11] = 0; + + if (ent->v->scale) { - VectorCopy(csqcg.forward, src+0); - src[3] = 0; - VectorNegate(csqcg.right, src+4); - src[7] = 0; - VectorCopy(csqcg.up, src+8); - src[11] = 0; - - if (ent->v->scale) + for (i = 0; i < 12; i+=4) { - for (i = 0; i < 12; i+=4) - { - transforms[i+0] *= ent->v->scale; - transforms[i+1] *= ent->v->scale; - transforms[i+2] *= ent->v->scale; - transforms[i+3] *= ent->v->scale; - } + transforms[i+0] *= ent->v->scale; + transforms[i+1] *= ent->v->scale; + transforms[i+2] *= ent->v->scale; + transforms[i+3] *= ent->v->scale; } - - R_ConcatRotationsPad((void*)transforms, (void*)src, (void*)dest); - - VectorCopy(dest+0, csqcg.forward); - VectorNegate(dest+4, csqcg.right); - VectorCopy(dest+8, csqcg.up); - - VectorCopy(srcorg, retorg); - for (i = 0 ; i < 3 ; i++) - { - retorg[0] += transforms[i*4+3]*src[4*i+0]; - retorg[1] += transforms[i*4+3]*src[4*i+1]; - retorg[2] += transforms[i*4+3]*src[4*i+2]; - } - return; } + R_ConcatRotationsPad((void*)transforms, (void*)src, (void*)dest); + + VectorCopy(dest+0, csqcg.forward); + VectorNegate(dest+4, csqcg.right); + VectorCopy(dest+8, csqcg.up); + + VectorCopy(srcorg, retorg); + for (i = 0 ; i < 3 ; i++) + { + retorg[0] += transforms[i*4+3]*src[4*i+0]; + retorg[1] += transforms[i*4+3]*src[4*i+1]; + retorg[2] += transforms[i*4+3]*src[4*i+2]; + } + return; + } + VectorCopy(srcorg, retorg); } static void PF_cs_gettagindex (progfuncs_t *prinst, struct globalvars_s *pr_globals) @@ -2639,10 +2638,7 @@ static void PF_cs_gettagindex (progfuncs_t *prinst, struct globalvars_s *pr_glob char *tagname = PR_GetStringOfs(prinst, OFS_PARM1); model_t *mod = CSQC_GetModelForIndex(ent->v->modelindex); - if (Mod_TagNumForName) - G_FLOAT(OFS_RETURN) = Mod_TagNumForName(mod, tagname); - else - G_FLOAT(OFS_RETURN) = 0; + G_FLOAT(OFS_RETURN) = Mod_TagNumForName(mod, tagname); } static void PF_rotatevectorsbyangles (progfuncs_t *prinst, struct globalvars_s *pr_globals) { diff --git a/engine/client/renderer.c b/engine/client/renderer.c index 5f7908c57..cbd8ca230 100644 --- a/engine/client/renderer.c +++ b/engine/client/renderer.c @@ -1461,7 +1461,6 @@ void D3DSucks(void) qboolean R_ApplyRenderer (rendererstate_t *newr) { - int i, j; extern model_t *loadmodel; extern int host_hunklevel; diff --git a/engine/client/sbar.c b/engine/client/sbar.c index 30c3bf0b8..c596b59e7 100644 --- a/engine/client/sbar.c +++ b/engine/client/sbar.c @@ -118,7 +118,7 @@ int Sbar_PlayerNum(void) int num; num = cl.spectator?Cam_TrackNum(0):-1; if (num < 0) - num = cl.playernum; + num = cl.playernum[0]; return num; } @@ -1714,8 +1714,6 @@ qboolean Sbar_ShouldDraw (void) extern qboolean editoractive; #endif qboolean headsup; - char st[512]; - int pnum; int deadcount=0; @@ -2157,7 +2155,6 @@ void Sbar_DeathmatchOverlay (int start) player_info_t *s; int total; int minutes; - int p; int skip = 10; int showcolumns; int startx; diff --git a/engine/client/screen.h b/engine/client/screen.h index 24420f6f0..31fe4a941 100644 --- a/engine/client/screen.h +++ b/engine/client/screen.h @@ -67,6 +67,8 @@ void SCR_UpdateWholeScreen (void); //this stuff is internal to the screen systems. +void RSpeedShow(void); + void SCR_CrosshairPosition(int pnum, int *x, int *y); void SCR_DrawLoading (void); void SCR_CalcRefdef (void); diff --git a/engine/client/sound.h b/engine/client/sound.h index a3d3b408b..814e5f796 100644 --- a/engine/client/sound.h +++ b/engine/client/sound.h @@ -131,6 +131,9 @@ void S_InitPaintChannels (soundcardinfo_t *sc); void S_ShutdownCard (soundcardinfo_t *sc); void S_StopSoundCard (soundcardinfo_t *sc, int entnum, int entchannel); +void S_DefaultSpeakerConfiguration(soundcardinfo_t *sc); +void S_ResetFailedLoad(void); + qboolean S_IsPlayingSomewhere(sfx_t *s); void ResampleSfx (sfx_t *sfx, int inrate, int inwidth, qbyte *data); diff --git a/engine/common/cmd.h b/engine/common/cmd.h index b282c50a0..2676cbc49 100644 --- a/engine/common/cmd.h +++ b/engine/common/cmd.h @@ -113,6 +113,8 @@ void Cmd_TokenizeString (char *text, qboolean expandmacros, qboolean qctokenize) void Cmd_ExecuteString (char *text, int restrictionlevel); +void Cmd_Args_Set(char *newargs); + #define RESTRICT_MAX 64 //1-64 it's all about bit size. This is max settable. servers are +1 #define RESTRICT_DEFAULT 50 //rcon get's 63, local always gets 64 #define RESTRICT_MIN 1 //rcon get's 63, local always gets 64 diff --git a/engine/common/common.h b/engine/common/common.h index 41a7cb656..48962f9d8 100644 --- a/engine/common/common.h +++ b/engine/common/common.h @@ -256,6 +256,9 @@ char *COM_SkipPath (char *pathname); void COM_StripExtension (char *in, char *out, int outlen); void COM_FileBase (char *in, char *out, int outlen); void COM_DefaultExtension (char *path, char *extension, int maxlen); +void COM_DeFunString(unsigned long *str, char *out, int outsize, qboolean ignoreflags); +void COM_ParseFunString(char *str, unsigned long *out, int outsize); +int COM_FunStringLength(unsigned char *str); char *COM_FileExtension (char *in); void COM_CleanUpPath(char *str); diff --git a/engine/common/net.h b/engine/common/net.h index 88f0b3474..694513b84 100644 --- a/engine/common/net.h +++ b/engine/common/net.h @@ -79,6 +79,7 @@ qboolean NET_CompareAdr (netadr_t a, netadr_t b); qboolean NET_CompareBaseAdr (netadr_t a, netadr_t b); char *NET_AdrToString (netadr_t a); char *NET_BaseAdrToString (netadr_t a); +qboolean NET_StringToSockaddr (char *s, struct sockaddr_qstorage *sadr); qboolean NET_StringToAdr (char *s, netadr_t *a); qboolean NET_IsClientLegal(netadr_t *adr); diff --git a/engine/gl/gl_model.h b/engine/gl/gl_model.h index 0758b9bcb..33e26fb7e 100644 --- a/engine/gl/gl_model.h +++ b/engine/gl/gl_model.h @@ -402,6 +402,7 @@ qboolean Q1BSP_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, void Q1BSP_FatPVS (struct model_s *mod, vec3_t org, qboolean add); qboolean Q1BSP_EdictInFatPVS(struct model_s *mod, struct edict_s *ent); void Q1BSP_FindTouchedLeafs(struct model_s *mod, struct edict_s *ent); +qbyte *Q1BSP_LeafPVS (struct model_s *model, mleaf_t *leaf, qbyte *buffer); /* ============================================================================== diff --git a/engine/gl/glquake.h b/engine/gl/glquake.h index 4683409c9..d61204fe9 100644 --- a/engine/gl/glquake.h +++ b/engine/gl/glquake.h @@ -281,6 +281,10 @@ void GL_DoSwap (void); // // gl_warp.c // +#ifdef RGLQUAKE +void GL_DrawSkyBox (msurface_t *s); +#endif + void GL_SubdivideSurface (msurface_t *fa, float dividesize); void GL_EmitBothSkyLayers (msurface_t *fa); void EmitWaterPolys (msurface_t *fa, float basealpha);