From: cloudwalk Date: Fri, 2 Oct 2020 01:56:48 +0000 (+0000) Subject: Remove unneeded #includes in some headers. Make some headers standalone. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=19dc59c888b9bd06b45d619d5f4861c984730f2d;p=xonotic%2Fdarkplaces.git Remove unneeded #includes in some headers. Make some headers standalone. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12981 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_particles.h b/cl_particles.h index a37bc489..8e07e19e 100644 --- a/cl_particles.h +++ b/cl_particles.h @@ -2,32 +2,31 @@ #define CL_PARTICLES_H #include "qtypes.h" -#include "cvar.h" -typedef struct entity_s entity_t; +struct entity_s; -extern cvar_t cl_particles; -extern cvar_t cl_particles_quality; -extern cvar_t cl_particles_size; -extern cvar_t cl_particles_quake; -extern cvar_t cl_particles_blood; -extern cvar_t cl_particles_blood_alpha; -extern cvar_t cl_particles_blood_decal_alpha; -extern cvar_t cl_particles_blood_decal_scalemin; -extern cvar_t cl_particles_blood_decal_scalemax; -extern cvar_t cl_particles_blood_bloodhack; -extern cvar_t cl_particles_bulletimpacts; -extern cvar_t cl_particles_explosions_sparks; -extern cvar_t cl_particles_explosions_shell; -extern cvar_t cl_particles_rain; -extern cvar_t cl_particles_snow; -extern cvar_t cl_particles_smoke; -extern cvar_t cl_particles_smoke_alpha; -extern cvar_t cl_particles_smoke_alphafade; -extern cvar_t cl_particles_sparks; -extern cvar_t cl_particles_bubbles; -extern cvar_t cl_decals; -extern cvar_t cl_decals_time; -extern cvar_t cl_decals_fadetime; +extern struct cvar_s cl_particles; +extern struct cvar_s cl_particles_quality; +extern struct cvar_s cl_particles_size; +extern struct cvar_s cl_particles_quake; +extern struct cvar_s cl_particles_blood; +extern struct cvar_s cl_particles_blood_alpha; +extern struct cvar_s cl_particles_blood_decal_alpha; +extern struct cvar_s cl_particles_blood_decal_scalemin; +extern struct cvar_s cl_particles_blood_decal_scalemax; +extern struct cvar_s cl_particles_blood_bloodhack; +extern struct cvar_s cl_particles_bulletimpacts; +extern struct cvar_s cl_particles_explosions_sparks; +extern struct cvar_s cl_particles_explosions_shell; +extern struct cvar_s cl_particles_rain; +extern struct cvar_s cl_particles_snow; +extern struct cvar_s cl_particles_smoke; +extern struct cvar_s cl_particles_smoke_alpha; +extern struct cvar_s cl_particles_smoke_alphafade; +extern struct cvar_s cl_particles_sparks; +extern struct cvar_s cl_particles_bubbles; +extern struct cvar_s cl_decals; +extern struct cvar_s cl_decals_time; +extern struct cvar_s cl_decals_fadetime; typedef enum { @@ -154,13 +153,13 @@ effectnameindex_t; int CL_ParticleEffectIndexForName(const char *name); const char *CL_ParticleEffectNameForIndex(int i); -void CL_ParticleEffect(int effectindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor); -void CL_ParticleTrail(int effectindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor, qbool spawndlight, qbool spawnparticles, float tintmins[4], float tintmaxs[4], float fade); -void CL_ParticleBox(int effectindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor, qbool spawndlight, qbool spawnparticles, float tintmins[4], float tintmaxs[4], float fade); +void CL_ParticleEffect(int effectindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, struct entity_s *ent, int palettecolor); +void CL_ParticleTrail(int effectindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, struct entity_s *ent, int palettecolor, qbool spawndlight, qbool spawnparticles, float tintmins[4], float tintmaxs[4], float fade); +void CL_ParticleBox(int effectindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, struct entity_s *ent, int palettecolor, qbool spawndlight, qbool spawnparticles, float tintmins[4], float tintmaxs[4], float fade); void CL_ParseParticleEffect (void); void CL_ParticleCube (const vec3_t mins, const vec3_t maxs, const vec3_t dir, int count, int colorbase, vec_t gravity, vec_t randomvel); void CL_ParticleRain (const vec3_t mins, const vec3_t maxs, const vec3_t dir, int count, int colorbase, int type); -void CL_EntityParticles (const entity_t *ent); +void CL_EntityParticles (const struct entity_s *ent); void CL_ParticleExplosion (const vec3_t org); void CL_ParticleExplosion2 (const vec3_t org, int colorStart, int colorLength); diff --git a/cl_screen.h b/cl_screen.h index 77281d99..aef5a234 100644 --- a/cl_screen.h +++ b/cl_screen.h @@ -3,20 +3,19 @@ #define CL_SCREEN_H #include "qtypes.h" -#include "cvar.h" void SHOWLMP_decodehide(void); void SHOWLMP_decodeshow(void); void SHOWLMP_drawall(void); -extern cvar_t vid_conwidth; -extern cvar_t vid_conheight; -extern cvar_t vid_pixelheight; -extern cvar_t scr_screenshot_jpeg; -extern cvar_t scr_screenshot_jpeg_quality; -extern cvar_t scr_screenshot_png; -extern cvar_t scr_screenshot_gammaboost; -extern cvar_t scr_screenshot_name; +extern struct cvar_s vid_conwidth; +extern struct cvar_s vid_conheight; +extern struct cvar_s vid_pixelheight; +extern struct cvar_s scr_screenshot_jpeg; +extern struct cvar_s scr_screenshot_jpeg_quality; +extern struct cvar_s scr_screenshot_png; +extern struct cvar_s scr_screenshot_gammaboost; +extern struct cvar_s scr_screenshot_name; void CL_Screen_NewMap(void); void CL_Screen_Init(void); diff --git a/cl_video.h b/cl_video.h index 9976c738..7c6140fa 100644 --- a/cl_video.h +++ b/cl_video.h @@ -2,7 +2,8 @@ #ifndef CL_VIDEO_H #define CL_VIDEO_H -#include "draw.h" +#include "qtypes.h" +#include "qdefs.h" #define CLVIDEOPREFIX "video/" #define CLTHRESHOLD 2.0 @@ -22,14 +23,14 @@ typedef enum clvideostate_e #define CLVIDEO_MAX_SUBTITLES 512 -extern cvar_t cl_video_subtitles; -extern cvar_t cl_video_subtitles_lines; -extern cvar_t cl_video_subtitles_textsize; -extern cvar_t cl_video_scale; -extern cvar_t cl_video_scale_vpos; -extern cvar_t cl_video_stipple; -extern cvar_t cl_video_brightness; -extern cvar_t cl_video_keepaspectratio; +extern struct cvar_s cl_video_subtitles; +extern struct cvar_s cl_video_subtitles_lines; +extern struct cvar_s cl_video_subtitles_textsize; +extern struct cvar_s cl_video_scale; +extern struct cvar_s cl_video_scale_vpos; +extern struct cvar_s cl_video_stipple; +extern struct cvar_s cl_video_brightness; +extern struct cvar_s cl_video_keepaspectratio; typedef struct clvideo_s { @@ -46,7 +47,7 @@ typedef struct clvideo_s void *imagedata; // cachepic holds the relevant texture_t and we simply update the texture as needed - cachepic_t *cachepic; + struct cachepic_s *cachepic; char name[MAX_QPATH]; // name of this video UI element (not the filename) int width; int height; diff --git a/cmd.h b/cmd.h index dd9b4326..445e08c1 100644 --- a/cmd.h +++ b/cmd.h @@ -38,10 +38,8 @@ The game starts with a Cbuf_AddText ("exec quake.rc\n"); Cbuf_Execute (); #define CMD_H #include "qtypes.h" +#include "qdefs.h" #include "com_list.h" -#include "cvar.h" -#include "thread.h" -#include "zone.h" struct cmd_state_s; @@ -124,7 +122,7 @@ typedef struct cmd_buf_s /// command interpreter state - the tokenizing and execution of commands, as well as pointers to which cvars and aliases they can access typedef struct cmd_state_s { - mempool_t *mempool; + struct mempool_s *mempool; int argc; const char *argv[MAX_ARGS]; @@ -138,7 +136,7 @@ typedef struct cmd_state_s cmd_function_t *engine_functions; - cvar_state_t *cvars; // which cvar system is this cmd state able to access? (&cvars_all or &cvars_null) + struct cvar_state_s *cvars; // which cvar system is this cmd state able to access? (&cvars_all or &cvars_null) int cvars_flagsmask; // which CVAR_* flags should be visible to this interpreter? (CF_CLIENT | CF_SERVER, or just CF_SERVER) int cmd_flags; // cmd flags that identify this interpreter diff --git a/collision.h b/collision.h index ebd1f22f..f62356b0 100644 --- a/collision.h +++ b/collision.h @@ -2,11 +2,9 @@ #ifndef COLLISION_H #define COLLISION_H -#include "cvar.h" #include "matrixlib.h" -#include "zone.h" -typedef struct texture_s texture_t; -typedef struct model_s dp_model_t; +struct mempool_s; +struct model_s; typedef union plane_s { @@ -78,7 +76,7 @@ void Collision_ClipTrace_Box(trace_t *trace, const vec3_t cmins, const vec3_t cm 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); void Collision_Cache_Reset(qbool resetlimits); -void Collision_Cache_Init(mempool_t *mempool); +void Collision_Cache_Init(struct mempool_s *mempool); void Collision_Cache_NewFrame(void); typedef struct colpointf_s @@ -143,7 +141,7 @@ typedef struct colboxbrushf_s colboxbrushf_t; void Collision_CalcPlanesForTriangleBrushFloat(colbrushf_t *brush); -colbrushf_t *Collision_NewBrushFromPlanes(mempool_t *mempool, int numoriginalplanes, const colplanef_t *originalplanes, int supercontents, int q3surfaceflags, const texture_t *texture, int hasaabbplanes); +colbrushf_t *Collision_NewBrushFromPlanes(struct mempool_s *mempool, int numoriginalplanes, const colplanef_t *originalplanes, int supercontents, int q3surfaceflags, const texture_t *texture, int hasaabbplanes); void Collision_TraceBrushBrushFloat(trace_t *trace, const colbrushf_t *thisbrush_start, const colbrushf_t *thisbrush_end, const colbrushf_t *thatbrush_start, const colbrushf_t *thatbrush_end); void Collision_TraceBrushTriangleMeshFloat(trace_t *trace, const colbrushf_t *thisbrush_start, const colbrushf_t *thisbrush_end, int numtriangles, const int *element3i, const float *vertex3f, int stride, float *bbox6f, int supercontents, int q3surfaceflags, const texture_t *texture, const vec3_t segmentmins, const vec3_t segmentmaxs); void Collision_TraceLineBrushFloat(trace_t *trace, const vec3_t linestart, const vec3_t lineend, const colbrushf_t *thatbrush_start, const colbrushf_t *thatbrush_end); @@ -173,16 +171,16 @@ void Collision_TraceBrushTriangleFloat(trace_t *trace, const colbrushf_t *thisbr // passedict is excluded from clipping checks struct frameblend_s; struct skeleton_s; -void Collision_ClipToGenericEntity(trace_t *trace, dp_model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, const vec3_t bodymins, const vec3_t bodymaxs, int bodysupercontents, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend); -void Collision_ClipLineToGenericEntity(trace_t *trace, dp_model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, const vec3_t bodymins, const vec3_t bodymaxs, int bodysupercontents, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qbool hitsurfaces); -void Collision_ClipPointToGenericEntity(trace_t *trace, dp_model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, const vec3_t bodymins, const vec3_t bodymaxs, int bodysupercontents, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); +void Collision_ClipToGenericEntity(trace_t *trace, struct model_s *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, const vec3_t bodymins, const vec3_t bodymaxs, int bodysupercontents, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend); +void Collision_ClipLineToGenericEntity(trace_t *trace, struct model_s *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, const vec3_t bodymins, const vec3_t bodymaxs, int bodysupercontents, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qbool hitsurfaces); +void Collision_ClipPointToGenericEntity(trace_t *trace, struct model_s *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, const vec3_t bodymins, const vec3_t bodymaxs, int bodysupercontents, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); // like above but does not do a transform and does nothing if model is NULL -void Collision_ClipToWorld(trace_t *trace, dp_model_t *model, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend); -void Collision_ClipLineToWorld(trace_t *trace, dp_model_t *model, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qbool hitsurfaces); -void Collision_ClipPointToWorld(trace_t *trace, dp_model_t *model, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); +void Collision_ClipToWorld(trace_t *trace, struct model_s *model, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend); +void Collision_ClipLineToWorld(trace_t *trace, struct model_s *model, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qbool hitsurfaces); +void Collision_ClipPointToWorld(trace_t *trace, struct model_s *model, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); // caching surface trace for renderer (NOT THREAD SAFE) -void Collision_Cache_ClipLineToGenericEntitySurfaces(trace_t *trace, dp_model_t *model, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); -void Collision_Cache_ClipLineToWorldSurfaces(trace_t *trace, dp_model_t *model, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); +void Collision_Cache_ClipLineToGenericEntitySurfaces(trace_t *trace, struct model_s *model, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); +void Collision_Cache_ClipLineToWorldSurfaces(trace_t *trace, struct model_s *model, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); // combines data from two traces: // merges contents flags, startsolid, allsolid, inwater // updates fraction, endpos, plane and surface info if new fraction is shorter @@ -196,10 +194,10 @@ void Collision_CombineTraces(trace_t *cliptrace, const trace_t *trace, void *tou // 3 = spew detailed trace flow (bsp tree recursion info) #define COLLISIONPARANOID 0 -extern cvar_t collision_impactnudge; -extern cvar_t collision_extendtracelinelength; -extern cvar_t collision_extendtraceboxlength; -extern cvar_t collision_extendmovelength; -extern cvar_t collision_bih_fullrecursion; +extern struct cvar_s collision_impactnudge; +extern struct cvar_s collision_extendtracelinelength; +extern struct cvar_s collision_extendtraceboxlength; +extern struct cvar_s collision_extendmovelength; +extern struct cvar_s collision_bih_fullrecursion; #endif diff --git a/crypto.h b/crypto.h index 2d97948a..abfe2b5b 100644 --- a/crypto.h +++ b/crypto.h @@ -3,11 +3,10 @@ #include #include "qtypes.h" -#include "cvar.h" -#include "lhnet.h" +struct lhnetaddress_s; -extern cvar_t crypto_developer; -extern cvar_t crypto_aeslevel; +extern struct cvar_s crypto_developer; +extern struct cvar_s crypto_aeslevel; #define ENCRYPTION_REQUIRED (crypto_aeslevel.integer >= 3) extern int crypto_keyfp_recommended_length; // applies to LOCAL IDs, and to ALL keys @@ -46,19 +45,19 @@ const void *Crypto_DecryptPacket(crypto_t *crypto, const void *data_src, size_t #define CRYPTO_MATCH 1 // process as usual (packet was used) #define CRYPTO_DISCARD 2 // discard this packet #define CRYPTO_REPLACE 3 // make the buffer the current packet -int Crypto_ClientParsePacket(const char *data_in, size_t len_in, char *data_out, size_t *len_out, lhnetaddress_t *peeraddress); -int Crypto_ServerParsePacket(const char *data_in, size_t len_in, char *data_out, size_t *len_out, lhnetaddress_t *peeraddress); +int Crypto_ClientParsePacket(const char *data_in, size_t len_in, char *data_out, size_t *len_out, struct lhnetaddress_s *peeraddress); +int Crypto_ServerParsePacket(const char *data_in, size_t len_in, char *data_out, size_t *len_out, struct lhnetaddress_s *peeraddress); // if len_out is nonzero, the packet is to be sent to the client qbool Crypto_ServerAppendToChallenge(const char *data_in, size_t len_in, char *data_out, size_t *len_out, size_t maxlen); -crypto_t *Crypto_ServerGetInstance(lhnetaddress_t *peeraddress); +crypto_t *Crypto_ServerGetInstance(struct lhnetaddress_s *peeraddress); qbool Crypto_FinishInstance(crypto_t *out, crypto_t *in); // also clears allocated memory, and frees the instance received by ServerGetInstance const char *Crypto_GetInfoResponseDataString(void); // retrieves a host key for an address (can be exposed to menuqc, or used by the engine to look up stored keys e.g. for server bookmarking) // pointers may be NULL -qbool Crypto_RetrieveHostKey(lhnetaddress_t *peeraddress, int *keyid, char *keyfp, size_t keyfplen, char *idfp, size_t idfplen, int *aeslevel, qbool *issigned); +qbool Crypto_RetrieveHostKey(struct lhnetaddress_s *peeraddress, int *keyid, char *keyfp, size_t keyfplen, char *idfp, size_t idfplen, int *aeslevel, qbool *issigned); int Crypto_RetrieveLocalKey(int keyid, char *keyfp, size_t keyfplen, char *idfp, size_t idfplen, qbool *issigned); // return value: -1 if more to come, +1 if valid, 0 if end of list size_t Crypto_SignData(const void *data, size_t datasize, int keyid, void *signed_data, size_t signed_size); diff --git a/cvar.h b/cvar.h index 65a2e1c5..67115fc9 100644 --- a/cvar.h +++ b/cvar.h @@ -58,8 +58,8 @@ interface from being ambiguous. #include "qtypes.h" #include "qdefs.h" -typedef struct cmd_state_s cmd_state_t; -typedef struct qfile_s qfile_t; +struct cmd_state_s; +struct qfile_s; typedef struct cvar_s { @@ -159,7 +159,7 @@ void Cvar_PrintHelp(cvar_t *cvar, const char *name, qbool full); void Cvar_CompleteCvarPrint (cvar_state_t *cvars, const char *partial, int neededflags); -qbool Cvar_Command (cmd_state_t *cmd); +qbool Cvar_Command (struct cmd_state_s *cmd); // called by Cmd_ExecuteString when Cmd_Argv(cmd, 0) doesn't match a known // command. Returns true if the command was a variable reference that // was handled. (print or change) @@ -167,13 +167,13 @@ qbool Cvar_Command (cmd_state_t *cmd); void Cvar_SaveInitState(cvar_state_t *cvars); void Cvar_RestoreInitState(cvar_state_t *cvars); -void Cvar_UnlockDefaults(cmd_state_t *cmd); -void Cvar_LockDefaults_f(cmd_state_t *cmd); -void Cvar_ResetToDefaults_All_f(cmd_state_t *cmd); -void Cvar_ResetToDefaults_NoSaveOnly_f(cmd_state_t *cmd); -void Cvar_ResetToDefaults_SaveOnly_f(cmd_state_t *cmd); +void Cvar_UnlockDefaults(struct cmd_state_s *cmd); +void Cvar_LockDefaults_f(struct cmd_state_s *cmd); +void Cvar_ResetToDefaults_All_f(struct cmd_state_s *cmd); +void Cvar_ResetToDefaults_NoSaveOnly_f(struct cmd_state_s *cmd); +void Cvar_ResetToDefaults_SaveOnly_f(struct cmd_state_s *cmd); -void Cvar_WriteVariables (cvar_state_t *cvars, qfile_t *f); +void Cvar_WriteVariables (cvar_state_t *cvars, struct qfile_s *f); // Writes lines containing "set variable value" for all variables // with the archive flag set to true. @@ -190,11 +190,11 @@ const char **Cvar_CompleteBuildList(cvar_state_t *cvars, const char *partial, in /// Referenced in cmd.c in Cmd_Init hence it's inclusion here. /// Added by EvilTypeGuy eviltypeguy@qeradiant.com /// Thanks to Matthias "Maddes" Buecher, http://www.inside3d.com/qip/ -void Cvar_List_f(cmd_state_t *cmd); +void Cvar_List_f(struct cmd_state_s *cmd); -void Cvar_Set_f(cmd_state_t *cmd); -void Cvar_SetA_f(cmd_state_t *cmd); -void Cvar_Del_f(cmd_state_t *cmd); +void Cvar_Set_f(struct cmd_state_s *cmd); +void Cvar_SetA_f(struct cmd_state_s *cmd); +void Cvar_Del_f(struct cmd_state_s *cmd); // commands to create new cvars (or set existing ones) // seta creates an archived cvar (saved to config) diff --git a/menu.h b/menu.h index 93abb624..d0b3189e 100644 --- a/menu.h +++ b/menu.h @@ -22,8 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define MENU_H #include "qtypes.h" - -typedef struct serverlist_entry_s serverlist_entry_t; +struct serverlist_entry_s; enum m_state_e { m_none, @@ -85,7 +84,7 @@ extern void (*MR_Draw) (void); extern void (*MR_ToggleMenu) (int mode); extern void (*MR_Shutdown) (void); extern void (*MR_NewMap) (void); -extern int (*MR_GetServerListEntryCategory) (const serverlist_entry_t *entry); +extern int (*MR_GetServerListEntryCategory) (const struct serverlist_entry_s *entry); typedef struct video_resolution_s { diff --git a/model_alias.h b/model_alias.h index 270d6e35..8f153e55 100644 --- a/model_alias.h +++ b/model_alias.h @@ -21,6 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef MODEL_ALIAS_H #define MODEL_ALIAS_H +#include +#include "qtypes.h" /* ============================================================================== @@ -46,7 +48,7 @@ typedef struct daliashdr_s int numverts; int numtris; int numframes; - synctype_t synctype; + int synctype; int flags; float size; } @@ -235,18 +237,19 @@ aliasbone_t; // for decoding md3 model latlong vertex normals extern float mod_md3_sin[320]; -extern cvar_t r_skeletal_debugbone; -extern cvar_t r_skeletal_debugbonecomponent; -extern cvar_t r_skeletal_debugbonevalue; -extern cvar_t r_skeletal_debugtranslatex; -extern cvar_t r_skeletal_debugtranslatey; -extern cvar_t r_skeletal_debugtranslatez; +extern struct cvar_s r_skeletal_debugbone; +extern struct cvar_s r_skeletal_debugbonecomponent; +extern struct cvar_s r_skeletal_debugbonevalue; +extern struct cvar_s r_skeletal_debugtranslatex; +extern struct cvar_s r_skeletal_debugtranslatey; +extern struct cvar_s r_skeletal_debugtranslatez; struct model_s; struct frameblend_s; +struct skeleton_s; void *Mod_Skeletal_AnimateVertices_AllocBuffers(size_t nbytes); -void Mod_Skeletal_BuildTransforms(const struct model_s * RESTRICT model, const struct frameblend_s * RESTRICT frameblend, const skeleton_t *skeleton, float * RESTRICT bonepose, float * RESTRICT boneposerelative); +void Mod_Skeletal_BuildTransforms(const struct model_s * RESTRICT model, const struct frameblend_s * RESTRICT frameblend, const struct skeleton_s *skeleton, float * RESTRICT bonepose, float * RESTRICT boneposerelative); #endif diff --git a/model_shared.h b/model_shared.h index 04529c56..463af5f1 100644 --- a/model_shared.h +++ b/model_shared.h @@ -21,12 +21,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef MODEL_SHARED_H #define MODEL_SHARED_H +#include +#include "qdefs.h" #include "bspfile.h" #include "r_qshader.h" -#include "protocol.h" -#include "r_textures.h" #include "matrixlib.h" - +struct rtexture_s; +struct mempool_s; +struct skeleton_s; typedef enum synctype_e {ST_SYNC=0, ST_RAND } synctype_t; /* @@ -50,16 +52,16 @@ animscene_t; typedef struct skinframe_s { - rtexture_t *stain; // inverse modulate with background (used for decals and such) - rtexture_t *merged; // original texture without glow - rtexture_t *base; // original texture without pants/shirt/glow - rtexture_t *pants; // pants only (in greyscale) - rtexture_t *shirt; // shirt only (in greyscale) - rtexture_t *nmap; // normalmap (bumpmap for dot3) - rtexture_t *gloss; // glossmap (for dot3) - rtexture_t *glow; // glow only (fullbrights) - rtexture_t *fog; // alpha of the base texture (if not opaque) - rtexture_t *reflect; // colored mask for cubemap reflections + struct rtexture_s *stain; // inverse modulate with background (used for decals and such) + struct rtexture_s *merged; // original texture without glow + struct rtexture_s *base; // original texture without pants/shirt/glow + struct rtexture_s *pants; // pants only (in greyscale) + struct rtexture_s *shirt; // shirt only (in greyscale) + struct rtexture_s *nmap; // normalmap (bumpmap for dot3) + struct rtexture_s *gloss; // glossmap (for dot3) + struct rtexture_s *glow; // glow only (fullbrights) + struct rtexture_s *fog; // alpha of the base texture (if not opaque) + struct rtexture_s *reflect; // colored mask for cubemap reflections // accounting data for hash searches: // the compare variables are used to identify internal skins from certain // model formats @@ -197,7 +199,7 @@ shadowmeshvertexhash_t; typedef struct shadowmesh_s { - mempool_t *mempool; + struct mempool_s *mempool; int numverts; int maxverts; @@ -288,19 +290,19 @@ typedef struct texture_s unsigned char endpostshaderpass; // number of postshaderpasses qbool colormapping; - rtexture_t *basetexture; // original texture without pants/shirt/glow - rtexture_t *pantstexture; // pants only (in greyscale) - rtexture_t *shirttexture; // shirt only (in greyscale) - rtexture_t *nmaptexture; // normalmap (bumpmap for dot3) - rtexture_t *glosstexture; // glossmap (for dot3) - rtexture_t *glowtexture; // glow only (fullbrights) - rtexture_t *fogtexture; // alpha of the base texture (if not opaque) - rtexture_t *reflectmasktexture; // mask for fake reflections - rtexture_t *reflectcubetexture; // fake reflections cubemap - rtexture_t *backgroundbasetexture; // original texture without pants/shirt/glow - rtexture_t *backgroundnmaptexture; // normalmap (bumpmap for dot3) - rtexture_t *backgroundglosstexture; // glossmap (for dot3) - rtexture_t *backgroundglowtexture; // glow only (fullbrights) + struct rtexture_s *basetexture; // original texture without pants/shirt/glow + struct rtexture_s *pantstexture; // pants only (in greyscale) + struct rtexture_s *shirttexture; // shirt only (in greyscale) + struct rtexture_s *nmaptexture; // normalmap (bumpmap for dot3) + struct rtexture_s *glosstexture; // glossmap (for dot3) + struct rtexture_s *glowtexture; // glow only (fullbrights) + struct rtexture_s *fogtexture; // alpha of the base texture (if not opaque) + struct rtexture_s *reflectmasktexture; // mask for fake reflections + struct rtexture_s *reflectcubetexture; // fake reflections cubemap + struct rtexture_s *backgroundbasetexture; // original texture without pants/shirt/glow + struct rtexture_s *backgroundnmaptexture; // normalmap (bumpmap for dot3) + struct rtexture_s *backgroundglosstexture; // glossmap (for dot3) + struct rtexture_s *backgroundglowtexture; // glow only (fullbrights) float specularpower; // rendering parameters - updated by R_GetCurrentTexture using rsurface.render_* fields @@ -417,9 +419,9 @@ typedef struct msurface_s // the texture to use on the surface texture_t *texture; // the lightmap texture fragment to use on the rendering mesh - rtexture_t *lightmaptexture; + struct rtexture_s *lightmaptexture; // the lighting direction texture fragment to use on the rendering mesh - rtexture_t *deluxemaptexture; + struct rtexture_s *deluxemaptexture; // lightmaptexture rebuild information not used in q3bsp msurface_lightmapinfo_t *lightmapinfo; // q1bsp // fog volume info in q3bsp @@ -469,7 +471,7 @@ typedef struct model_s // mod_brush, mod_alias, mod_sprite modtype_t type; // memory pool for allocations - mempool_t *mempool; + struct mempool_s *mempool; // all models use textures... rtexturepool_t *texturepool; // EF_* flags (translated from the model file's different flags layout) @@ -597,22 +599,22 @@ typedef struct modloader_s } modloader_t; // sky/water subdivision -//extern cvar_t gl_subdivide_size; +//extern struct cvar_s gl_subdivide_size; // texture fullbrights -extern cvar_t r_fullbrights; - -extern cvar_t mod_noshader_default_offsetmapping; -extern cvar_t mod_q3shader_default_offsetmapping; -extern cvar_t mod_q3shader_default_offsetmapping_scale; -extern cvar_t mod_q3shader_default_offsetmapping_bias; -extern cvar_t mod_q3shader_default_polygonoffset; -extern cvar_t mod_q3shader_default_polygonfactor; -extern cvar_t mod_q3shader_default_refractive_index; -extern cvar_t mod_q3shader_force_addalpha; -extern cvar_t mod_q3shader_force_terrain_alphaflag; -extern cvar_t mod_q3bsp_lightgrid_texture; -extern cvar_t mod_q3bsp_lightgrid_world_surfaces; -extern cvar_t mod_q3bsp_lightgrid_bsp_surfaces; +extern struct cvar_s r_fullbrights; + +extern struct cvar_s mod_noshader_default_offsetmapping; +extern struct cvar_s mod_q3shader_default_offsetmapping; +extern struct cvar_s mod_q3shader_default_offsetmapping_scale; +extern struct cvar_s mod_q3shader_default_offsetmapping_bias; +extern struct cvar_s mod_q3shader_default_polygonoffset; +extern struct cvar_s mod_q3shader_default_polygonfactor; +extern struct cvar_s mod_q3shader_default_refractive_index; +extern struct cvar_s mod_q3shader_force_addalpha; +extern struct cvar_s mod_q3shader_force_terrain_alphaflag; +extern struct cvar_s mod_q3bsp_lightgrid_texture; +extern struct cvar_s mod_q3bsp_lightgrid_world_surfaces; +extern struct cvar_s mod_q3bsp_lightgrid_bsp_surfaces; void Mod_Init (void); void Mod_Reload (void); @@ -633,17 +635,17 @@ void Mod_BuildNormals(int firstvertex, int numvertices, int numtriangles, const void Mod_BuildTextureVectorsFromNormals(int firstvertex, int numvertices, int numtriangles, const float *vertex3f, const float *texcoord2f, const float *normal3f, const int *elements, float *svector3f, float *tvector3f, qbool areaweighting); qbool Mod_ValidateElements(int *element3i, unsigned short *element3s, int numtriangles, int firstvertex, int numvertices, const char *filename, int fileline); -void Mod_AllocSurfMesh(mempool_t *mempool, int numvertices, int numtriangles, qbool lightmapoffsets, qbool vertexcolors); +void Mod_AllocSurfMesh(struct mempool_s *mempool, int numvertices, int numtriangles, qbool lightmapoffsets, qbool vertexcolors); void Mod_MakeSortedSurfaces(dp_model_t *mod); // called specially by brush model loaders before generating submodels // automatically called after model loader returns void Mod_BuildVBOs(void); -shadowmesh_t *Mod_ShadowMesh_Alloc(mempool_t *mempool, int maxverts, int maxtriangles); +shadowmesh_t *Mod_ShadowMesh_Alloc(struct mempool_s *mempool, int maxverts, int maxtriangles); int Mod_ShadowMesh_AddVertex(shadowmesh_t *mesh, const float *vertex3f); void Mod_ShadowMesh_AddMesh(shadowmesh_t *mesh, const float *vertex3f, int numtris, const int *element3i); -shadowmesh_t *Mod_ShadowMesh_Begin(mempool_t *mempool, int maxverts, int maxtriangles); +shadowmesh_t *Mod_ShadowMesh_Begin(struct mempool_s *mempool, int maxverts, int maxtriangles); shadowmesh_t *Mod_ShadowMesh_Finish(shadowmesh_t *firstmesh, qbool createvbo); void Mod_ShadowMesh_CalcBBox(shadowmesh_t *firstmesh, vec3_t mins, vec3_t maxs, vec3_t center, float *radius); void Mod_ShadowMesh_Free(shadowmesh_t *mesh); @@ -653,16 +655,16 @@ void Mod_CreateCollisionMesh(dp_model_t *mod); void Mod_FreeQ3Shaders(void); void Mod_LoadQ3Shaders(void); shader_t *Mod_LookupQ3Shader(const char *name); -qbool Mod_LoadTextureFromQ3Shader(mempool_t *mempool, const char *modelname, texture_t *texture, const char *name, qbool warnmissing, qbool fallback, int defaulttexflags, int defaultmaterialflags); -texture_shaderpass_t *Mod_CreateShaderPass(mempool_t *mempool, skinframe_t *skinframe); -texture_shaderpass_t *Mod_CreateShaderPassFromQ3ShaderLayer(mempool_t *mempool, const char *modelname, q3shaderinfo_layer_t *layer, int layerindex, int texflags, const char *texturename); +qbool Mod_LoadTextureFromQ3Shader(struct mempool_s *mempool, const char *modelname, texture_t *texture, const char *name, qbool warnmissing, qbool fallback, int defaulttexflags, int defaultmaterialflags); +texture_shaderpass_t *Mod_CreateShaderPass(struct mempool_s *mempool, skinframe_t *skinframe); +texture_shaderpass_t *Mod_CreateShaderPassFromQ3ShaderLayer(struct mempool_s *mempool, const char *modelname, q3shaderinfo_layer_t *layer, int layerindex, int texflags, const char *texturename); /// Sets up a material to render the provided skinframe. See also R_SkinFrame_LoadInternalBGRA. -void Mod_LoadCustomMaterial(mempool_t *mempool, texture_t *texture, const char *name, int supercontents, int materialflags, skinframe_t *skinframe); +void Mod_LoadCustomMaterial(struct mempool_s *mempool, texture_t *texture, const char *name, int supercontents, int materialflags, skinframe_t *skinframe); /// Removes all shaderpasses from material, and optionally deletes the textures in the skinframes. void Mod_UnloadCustomMaterial(texture_t *texture, qbool purgeskins); -extern cvar_t r_mipskins; -extern cvar_t r_mipnormalmaps; +extern struct cvar_s r_mipskins; +extern struct cvar_s r_mipnormalmaps; typedef struct skinfileitem_s { @@ -704,7 +706,7 @@ typedef struct mod_alloclightmap_state_s } mod_alloclightmap_state_t; -void Mod_AllocLightmap_Init(mod_alloclightmap_state_t *state, mempool_t *mempool, int width, int height); +void Mod_AllocLightmap_Init(mod_alloclightmap_state_t *state, struct mempool_s *mempool, int width, int height); void Mod_AllocLightmap_Free(mod_alloclightmap_state_t *state); void Mod_AllocLightmap_Reset(mod_alloclightmap_state_t *state); qbool Mod_AllocLightmap_Block(mod_alloclightmap_state_t *state, int blockwidth, int blockheight, int *outx, int *outy); @@ -743,11 +745,11 @@ void Mod_Mesh_Validate(dp_model_t *mod); void Mod_Mesh_Finalize(dp_model_t *mod); // Collision optimization using Bounding Interval Hierarchy -void Mod_CollisionBIH_TracePoint(dp_model_t *model, const struct frameblend_s *frameblend, const skeleton_t *skeleton, struct trace_s *trace, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); -void Mod_CollisionBIH_TraceLine(dp_model_t *model, const struct frameblend_s *frameblend, const skeleton_t *skeleton, struct trace_s *trace, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); -void Mod_CollisionBIH_TraceBox(dp_model_t *model, const struct frameblend_s *frameblend, const skeleton_t *skeleton, struct trace_s *trace, const vec3_t start, const vec3_t boxmins, const vec3_t boxmaxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); -void Mod_CollisionBIH_TraceBrush(dp_model_t *model, const struct frameblend_s *frameblend, const skeleton_t *skeleton, struct trace_s *trace, struct colbrushf_s *start, struct colbrushf_s *end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); -void Mod_CollisionBIH_TracePoint_Mesh(dp_model_t *model, const struct frameblend_s *frameblend, const skeleton_t *skeleton, struct trace_s *trace, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); +void Mod_CollisionBIH_TracePoint(dp_model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); +void Mod_CollisionBIH_TraceLine(dp_model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); +void Mod_CollisionBIH_TraceBox(dp_model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, const vec3_t boxmins, const vec3_t boxmaxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); +void Mod_CollisionBIH_TraceBrush(dp_model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, struct colbrushf_s *start, struct colbrushf_s *end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); +void Mod_CollisionBIH_TracePoint_Mesh(dp_model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); qbool Mod_CollisionBIH_TraceLineOfSight(struct model_s *model, const vec3_t start, const vec3_t end, const vec3_t acceptmins, const vec3_t acceptmaxs); int Mod_CollisionBIH_PointSuperContents(struct model_s *model, int frame, const vec3_t point); int Mod_CollisionBIH_PointSuperContents_Mesh(struct model_s *model, int frame, const vec3_t point); diff --git a/modelgen.h b/modelgen.h index 0ddb7761..cd48ed09 100644 --- a/modelgen.h +++ b/modelgen.h @@ -30,6 +30,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef MODELGEN_H #define MODELGEN_H +#include "qtypes.h" + #define ALIAS_VERSION 6 #define ALIAS_ONSEAM 0x0020 @@ -52,7 +54,7 @@ typedef struct mdl_s int numverts; int numtris; int numframes; - synctype_t synctype; + int synctype; int flags; float size; } diff --git a/netconn.h b/netconn.h index 144a35b8..9249af10 100755 --- a/netconn.h +++ b/netconn.h @@ -24,11 +24,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include "qtypes.h" -#include "cmd.h" -#include "cvar.h" #include "crypto.h" #include "lhnet.h" #include "common.h" +struct cmd_state_s; #define NET_HEADERSIZE (2 * sizeof(unsigned int)) @@ -245,10 +244,10 @@ typedef struct netconn_s } netconn_t; extern netconn_t *netconn_list; -extern mempool_t *netconn_mempool; +extern struct mempool_s *netconn_mempool; -extern cvar_t hostname; -extern cvar_t developer_networking; +extern struct cvar_s hostname; +extern struct cvar_s developer_networking; #ifdef CONFIG_MENU #define SERVERLIST_VIEWLISTSIZE SERVERLIST_TOTALSIZE @@ -425,16 +424,16 @@ extern sizebuf_t sv_message; extern char cl_readstring[MAX_INPUTLINE]; extern char sv_readstring[MAX_INPUTLINE]; -extern cvar_t sv_public; +extern struct cvar_s sv_public; -extern cvar_t net_fakelag; +extern struct cvar_s net_fakelag; -extern cvar_t cl_netport; -extern cvar_t sv_netport; -extern cvar_t net_address; -extern cvar_t net_address_ipv6; -extern cvar_t net_usesizelimit; -extern cvar_t net_burstreserve; +extern struct cvar_s cl_netport; +extern struct cvar_s sv_netport; +extern struct cvar_s net_address; +extern struct cvar_s net_address_ipv6; +extern struct cvar_s net_usesizelimit; +extern struct cvar_s net_burstreserve; qbool NetConn_CanSend(netconn_t *conn); int NetConn_SendUnreliableMessage(netconn_t *conn, sizebuf_t *data, protocolversion_t protocol, int rate, int burstsize, qbool quakesignon_suppressreliables); @@ -460,14 +459,14 @@ void NetConn_ClientFrame(void); void NetConn_ServerFrame(void); void NetConn_SleepMicroseconds(int microseconds); void NetConn_Heartbeat(int priority); -void Net_Stats_f(cmd_state_t *cmd); +void Net_Stats_f(struct cmd_state_s *cmd); #ifdef CONFIG_MENU void NetConn_QueryMasters(qbool querydp, qbool queryqw); void NetConn_QueryQueueFrame(void); -void Net_Slist_f(cmd_state_t *cmd); -void Net_SlistQW_f(cmd_state_t *cmd); -void Net_Refresh_f(cmd_state_t *cmd); +void Net_Slist_f(struct cmd_state_s *cmd); +void Net_SlistQW_f(struct cmd_state_s *cmd); +void Net_Refresh_f(struct cmd_state_s *cmd); /// ServerList interface (public) /// manually refresh the view set, do this after having changed the mask or any other flag @@ -476,7 +475,7 @@ void ServerList_ResetMasks(void); void ServerList_QueryList(qbool resetcache, qbool querydp, qbool queryqw, qbool consoleoutput); /// called whenever net_slist_favorites changes -void NetConn_UpdateFavorites_c(cvar_t *var); +void NetConn_UpdateFavorites_c(struct cvar_s *var); #endif #define MAX_CHALLENGES 128 diff --git a/protocol.h b/protocol.h index 31be9783..7fde8312 100644 --- a/protocol.h +++ b/protocol.h @@ -22,19 +22,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef PROTOCOL_H #define PROTOCOL_H +#include #include "qtypes.h" #include "qdefs.h" -#include "cvar.h" -#include "zone.h" #include "qstats.h" -#include "common.h" - +struct mempool_s; +struct sizebuf_s; // protocolversion_t is defined in common.h +enum protocolversion_e; -protocolversion_t Protocol_EnumForName(const char *s); -const char *Protocol_NameForEnum(protocolversion_t p); -protocolversion_t Protocol_EnumForNumber(int n); -int Protocol_NumberForEnum(protocolversion_t p); +enum protocolversion_e Protocol_EnumForName(const char *s); +const char *Protocol_NameForEnum(enum protocolversion_e p); +enum protocolversion_e Protocol_EnumForNumber(int n); +int Protocol_NumberForEnum(enum protocolversion_e p); void Protocol_Names(char *buffer, size_t buffersize); #define ENTITYSIZEPROFILING_START(msg, num, flags) \ @@ -455,7 +455,7 @@ void Protocol_UpdateClientStats(const int *stats); void Protocol_WriteStatsReliable(void); // writes a list of quake entities to the network stream // (or as many will fit) -qbool EntityFrameQuake_WriteFrame(sizebuf_t *msg, int maxsize, int numstates, const entity_state_t **states); +qbool EntityFrameQuake_WriteFrame(struct sizebuf_s *msg, int maxsize, int numstates, const entity_state_t **states); // cleans up dead entities each frame after ReadEntity (which doesn't clear unused entities) void EntityFrameQuake_ISeeDeadEntities(void); @@ -617,18 +617,18 @@ entityframe_database_t; // returns difference between two states as E_ flags int EntityState_DeltaBits(const entity_state_t *o, const entity_state_t *n); // write E_ flags to a msg -void EntityState_WriteExtendBits(sizebuf_t *msg, unsigned int bits); +void EntityState_WriteExtendBits(struct sizebuf_s *msg, unsigned int bits); // write values for the E_ flagged fields to a msg -void EntityState_WriteFields(const entity_state_t *ent, sizebuf_t *msg, unsigned int bits); +void EntityState_WriteFields(const entity_state_t *ent, struct sizebuf_s *msg, unsigned int bits); // write entity number and E_ flags and their values, or a remove number, describing the change from delta to ent -void EntityState_WriteUpdate(const entity_state_t *ent, sizebuf_t *msg, const entity_state_t *delta); +void EntityState_WriteUpdate(const entity_state_t *ent, struct sizebuf_s *msg, const entity_state_t *delta); // read E_ flags int EntityState_ReadExtendBits(void); // read values for E_ flagged fields and apply them to a state void EntityState_ReadFields(entity_state_t *e, unsigned int bits); // (client and server) allocates a new empty database -entityframe_database_t *EntityFrame_AllocDatabase(mempool_t *mempool); +entityframe_database_t *EntityFrame_AllocDatabase(struct mempool_s *mempool); // (client and server) frees the database void EntityFrame_FreeDatabase(entityframe_database_t *d); // (server) clears the database to contain no frames (thus delta compression @@ -645,7 +645,7 @@ void EntityFrame_AddFrame_Client(entityframe_database_t *d, vec3_t eye, int fram // (server) adds a entity_frame to the database, for future reference void EntityFrame_AddFrame_Server(entityframe_database_t *d, vec3_t eye, int framenum, int numentities, const entity_state_t **entitydata); // (server) writes a frame to network stream -qbool EntityFrame_WriteFrame(sizebuf_t *msg, int maxsize, entityframe_database_t *d, int numstates, const entity_state_t **states, int viewentnum); +qbool EntityFrame_WriteFrame(struct sizebuf_s *msg, int maxsize, entityframe_database_t *d, int numstates, const entity_state_t **states, int viewentnum); // (client) reads a frame from network stream void EntityFrame_CL_ReadFrame(void); // (client) returns the frame number of the most recent frame recieved @@ -666,7 +666,7 @@ entity_database4_commit_t; typedef struct entity_database4_s { // what mempool to use for allocations - mempool_t *mempool; + struct mempool_s *mempool; // reference frame int referenceframenum; // reference entities array is resized according to demand @@ -691,7 +691,7 @@ entity_state_t *EntityFrame4_GetReferenceEntity(entityframe4_database_t *d, int void EntityFrame4_AddCommitEntity(entityframe4_database_t *d, const entity_state_t *s); // allocate a database -entityframe4_database_t *EntityFrame4_AllocDatabase(mempool_t *pool); +entityframe4_database_t *EntityFrame4_AllocDatabase(struct mempool_s *pool); // free a database void EntityFrame4_FreeDatabase(entityframe4_database_t *d); // reset a database (resets compression but does not reallocate anything) @@ -699,7 +699,7 @@ void EntityFrame4_ResetDatabase(entityframe4_database_t *d); // updates database to account for a frame-received acknowledgment int EntityFrame4_AckFrame(entityframe4_database_t *d, int framenum, int servermode); // writes a frame to the network stream -qbool EntityFrame4_WriteFrame(sizebuf_t *msg, int maxsize, entityframe4_database_t *d, int numstates, const entity_state_t **states); +qbool EntityFrame4_WriteFrame(struct sizebuf_s *msg, int maxsize, entityframe4_database_t *d, int numstates, const entity_state_t **states); // reads a frame from the network stream void EntityFrame4_CL_ReadFrame(void); @@ -854,16 +854,16 @@ typedef struct entityframe5_database_s } entityframe5_database_t; -entityframe5_database_t *EntityFrame5_AllocDatabase(mempool_t *pool); +entityframe5_database_t *EntityFrame5_AllocDatabase(struct mempool_s *pool); void EntityFrame5_FreeDatabase(entityframe5_database_t *d); -void EntityState5_WriteUpdate(int number, const entity_state_t *s, int changedbits, sizebuf_t *msg); +void EntityState5_WriteUpdate(int number, const entity_state_t *s, int changedbits, struct sizebuf_s *msg); int EntityState5_DeltaBitsForState(entity_state_t *o, entity_state_t *n); void EntityFrame5_CL_ReadFrame(void); void EntityFrame5_LostFrame(entityframe5_database_t *d, int framenum); void EntityFrame5_AckFrame(entityframe5_database_t *d, int framenum); -qbool EntityFrame5_WriteFrame(sizebuf_t *msg, int maxsize, entityframe5_database_t *d, int numstates, const entity_state_t **states, int viewentnum, unsigned int movesequence, qbool need_empty); +qbool EntityFrame5_WriteFrame(struct sizebuf_s *msg, int maxsize, entityframe5_database_t *d, int numstates, const entity_state_t **states, int viewentnum, unsigned int movesequence, qbool need_empty); -extern cvar_t developer_networkentities; +extern struct cvar_s developer_networkentities; // QUAKEWORLD // server to client @@ -1035,14 +1035,14 @@ typedef struct entityframeqw_database_s } entityframeqw_database_t; -entityframeqw_database_t *EntityFrameQW_AllocDatabase(mempool_t *pool); +entityframeqw_database_t *EntityFrameQW_AllocDatabase(struct mempool_s *pool); void EntityFrameQW_FreeDatabase(entityframeqw_database_t *d); void EntityStateQW_ReadPlayerUpdate(void); void EntityFrameQW_CL_ReadFrame(qbool delta); struct client_s; void EntityFrameCSQC_LostFrame(struct client_s *client, int framenum); -qbool EntityFrameCSQC_WriteFrame (sizebuf_t *msg, int maxsize, int numnumbers, const unsigned short *numbers, int framenum); +qbool EntityFrameCSQC_WriteFrame (struct sizebuf_s *msg, int maxsize, int numnumbers, const unsigned short *numbers, int framenum); #endif diff --git a/r_modules.h b/r_modules.h index 7ce282fe..0b8d4b38 100644 --- a/r_modules.h +++ b/r_modules.h @@ -7,7 +7,7 @@ void R_RegisterModule(const char *name, void(*start)(void), void(*shutdown)(void void R_Modules_Start(void); void R_Modules_Shutdown(void); void R_Modules_NewMap(void); -void R_Modules_Restart_f(cmd_state_t *cmd); +void R_Modules_Restart_f(struct cmd_state_s *cmd); void R_Modules_DeviceLost(void); void R_Modules_DeviceRestored(void); diff --git a/r_shadow.h b/r_shadow.h index 7766838e..b11420c2 100644 --- a/r_shadow.h +++ b/r_shadow.h @@ -2,37 +2,42 @@ #ifndef R_SHADOW_H #define R_SHADOW_H +#include "qtypes.h" #include "taskqueue.h" +#include "matrixlib.h" +struct rtlight_s; +struct msurface_s; +struct entity_render_s; #define R_SHADOW_SHADOWMAP_NUMCUBEMAPS 8 -extern cvar_t r_shadow_bumpscale_basetexture; -extern cvar_t r_shadow_bumpscale_bumpmap; -extern cvar_t r_shadow_debuglight; -extern cvar_t r_shadow_gloss; -extern cvar_t r_shadow_gloss2intensity; -extern cvar_t r_shadow_glossintensity; -extern cvar_t r_shadow_glossexponent; -extern cvar_t r_shadow_gloss2exponent; -extern cvar_t r_shadow_glossexact; -extern cvar_t r_shadow_lightattenuationpower; -extern cvar_t r_shadow_lightattenuationscale; -extern cvar_t r_shadow_lightintensityscale; -extern cvar_t r_shadow_lightradiusscale; -extern cvar_t r_shadow_projectdistance; -extern cvar_t r_shadow_frontsidecasting; -extern cvar_t r_shadow_realtime_dlight; -extern cvar_t r_shadow_realtime_dlight_shadows; -extern cvar_t r_shadow_realtime_dlight_svbspculling; -extern cvar_t r_shadow_realtime_dlight_portalculling; -extern cvar_t r_shadow_realtime_world; -extern cvar_t r_shadow_realtime_world_lightmaps; -extern cvar_t r_shadow_realtime_world_shadows; -extern cvar_t r_shadow_realtime_world_compile; -extern cvar_t r_shadow_realtime_world_compileshadow; -extern cvar_t r_shadow_realtime_world_compilesvbsp; -extern cvar_t r_shadow_realtime_world_compileportalculling; -extern cvar_t r_shadow_scissor; +extern struct cvar_s r_shadow_bumpscale_basetexture; +extern struct cvar_s r_shadow_bumpscale_bumpmap; +extern struct cvar_s r_shadow_debuglight; +extern struct cvar_s r_shadow_gloss; +extern struct cvar_s r_shadow_gloss2intensity; +extern struct cvar_s r_shadow_glossintensity; +extern struct cvar_s r_shadow_glossexponent; +extern struct cvar_s r_shadow_gloss2exponent; +extern struct cvar_s r_shadow_glossexact; +extern struct cvar_s r_shadow_lightattenuationpower; +extern struct cvar_s r_shadow_lightattenuationscale; +extern struct cvar_s r_shadow_lightintensityscale; +extern struct cvar_s r_shadow_lightradiusscale; +extern struct cvar_s r_shadow_projectdistance; +extern struct cvar_s r_shadow_frontsidecasting; +extern struct cvar_s r_shadow_realtime_dlight; +extern struct cvar_s r_shadow_realtime_dlight_shadows; +extern struct cvar_s r_shadow_realtime_dlight_svbspculling; +extern struct cvar_s r_shadow_realtime_dlight_portalculling; +extern struct cvar_s r_shadow_realtime_world; +extern struct cvar_s r_shadow_realtime_world_lightmaps; +extern struct cvar_s r_shadow_realtime_world_shadows; +extern struct cvar_s r_shadow_realtime_world_compile; +extern struct cvar_s r_shadow_realtime_world_compileshadow; +extern struct cvar_s r_shadow_realtime_world_compilesvbsp; +extern struct cvar_s r_shadow_realtime_world_compileportalculling; +extern struct cvar_s r_shadow_scissor; // used by shader for bouncegrid feature typedef struct r_shadow_bouncegrid_settings_s @@ -92,7 +97,7 @@ typedef struct r_shadow_bouncegrid_state_s qbool allowdirectionalshading; qbool directional; // copied from settings.directionalshading after createtexture is decided qbool createtexture; // set to true to recreate the texture rather than updating it - happens when size changes or directional changes - rtexture_t *texture; + struct rtexture_s *texture; matrix4x4_t matrix; vec_t intensity; double lastupdatetime; @@ -138,16 +143,16 @@ void R_Shadow_ShadowMapFromList(int numverts, int numtris, const float *vertex3f int R_Shadow_CalcTriangleSideMask(const vec3_t p1, const vec3_t p2, const vec3_t p3, float bias); int R_Shadow_CalcSphereSideMask(const vec3_t p1, float radius, float bias); int R_Shadow_ChooseSidesFromBox(int firsttriangle, int numtris, const float *invertex3f, const int *elements, const matrix4x4_t *worldtolight, const vec3_t projectorigin, const vec3_t projectdirection, const vec3_t lightmins, const vec3_t lightmaxs, const vec3_t surfacemins, const vec3_t surfacemaxs, int *totals); -void R_Shadow_RenderLighting(int texturenumsurfaces, const msurface_t **texturesurfacelist); +void R_Shadow_RenderLighting(int texturenumsurfaces, const struct msurface_s **texturesurfacelist); void R_Shadow_RenderMode_Begin(void); -void R_Shadow_RenderMode_ActiveLight(const rtlight_t *rtlight); +void R_Shadow_RenderMode_ActiveLight(const struct rtlight_s *rtlight); void R_Shadow_RenderMode_Reset(void); void R_Shadow_RenderMode_Lighting(qbool transparent, qbool shadowmapping, qbool noselfshadowpass); void R_Shadow_RenderMode_DrawDeferredLight(qbool shadowmapping); void R_Shadow_RenderMode_VisibleLighting(qbool transparent); void R_Shadow_RenderMode_End(void); void R_Shadow_ClearStencil(void); -void R_Shadow_SetupEntityLight(const entity_render_t *ent); +void R_Shadow_SetupEntityLight(const struct entity_render_s *ent); qbool R_Shadow_ScissorForBBox(const float *mins, const float *maxs); @@ -157,11 +162,11 @@ extern matrix4x4_t matrix_attenuationz; void R_Shadow_UpdateWorldLightSelection(void); -extern rtlight_t *r_shadow_compilingrtlight; +extern struct rtlight_s *r_shadow_compilingrtlight; -void R_RTLight_Update(rtlight_t *rtlight, int isstatic, matrix4x4_t *matrix, vec3_t color, int style, const char *cubemapname, int shadow, vec_t corona, vec_t coronasizescale, vec_t ambientscale, vec_t diffusescale, vec_t specularscale, int flags); -void R_RTLight_Compile(rtlight_t *rtlight); -void R_RTLight_Uncompile(rtlight_t *rtlight); +void R_RTLight_Update(struct rtlight_s *rtlight, int isstatic, matrix4x4_t *matrix, vec3_t color, int style, const char *cubemapname, int shadow, vec_t corona, vec_t coronasizescale, vec_t ambientscale, vec_t diffusescale, vec_t specularscale, int flags); +void R_RTLight_Compile(struct rtlight_s *rtlight); +void R_RTLight_Uncompile(struct rtlight_s *rtlight); void R_Shadow_PrepareLights(void); void R_Shadow_ClearShadowMapTexture(void); diff --git a/r_textures.h b/r_textures.h index 5914f5d9..130780ae 100644 --- a/r_textures.h +++ b/r_textures.h @@ -3,7 +3,6 @@ #define R_TEXTURES_H #include "qtypes.h" -#include "cvar.h" // transparent #define TEXF_ALPHA 0x00000001 @@ -130,19 +129,19 @@ rtexturepool_t *R_AllocTexturePool(void); void R_FreeTexturePool(rtexturepool_t **rtexturepool); // the color/normal/etc cvars should be checked by callers of R_LoadTexture* functions to decide whether to add TEXF_COMPRESS to the flags -extern cvar_t gl_texturecompression; -extern cvar_t gl_texturecompression_color; -extern cvar_t gl_texturecompression_normal; -extern cvar_t gl_texturecompression_gloss; -extern cvar_t gl_texturecompression_glow; -extern cvar_t gl_texturecompression_2d; -extern cvar_t gl_texturecompression_q3bsplightmaps; -extern cvar_t gl_texturecompression_q3bspdeluxemaps; -extern cvar_t gl_texturecompression_sky; -extern cvar_t gl_texturecompression_lightcubemaps; -extern cvar_t gl_texturecompression_reflectmask; -extern cvar_t r_texture_dds_load; -extern cvar_t r_texture_dds_save; +extern struct cvar_s gl_texturecompression; +extern struct cvar_s gl_texturecompression_color; +extern struct cvar_s gl_texturecompression_normal; +extern struct cvar_s gl_texturecompression_gloss; +extern struct cvar_s gl_texturecompression_glow; +extern struct cvar_s gl_texturecompression_2d; +extern struct cvar_s gl_texturecompression_q3bsplightmaps; +extern struct cvar_s gl_texturecompression_q3bspdeluxemaps; +extern struct cvar_s gl_texturecompression_sky; +extern struct cvar_s gl_texturecompression_lightcubemaps; +extern struct cvar_s gl_texturecompression_reflectmask; +extern struct cvar_s r_texture_dds_load; +extern struct cvar_s r_texture_dds_save; // add a texture to a pool and optionally precache (upload) it // (note: data == NULL is perfectly acceptable) diff --git a/sbar.h b/sbar.h index 23c6d362..8f82d15b 100644 --- a/sbar.h +++ b/sbar.h @@ -21,13 +21,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef SBAR_H #define SBAR_H -#include "cvar.h" - #define SBAR_HEIGHT 24 extern int sb_lines; ///< scan lines to draw -extern cvar_t sbar_alpha_bg; -extern cvar_t sbar_alpha_fg; +extern struct cvar_s sbar_alpha_bg; +extern struct cvar_s sbar_alpha_fg; void Sbar_Init (void); diff --git a/screen.h b/screen.h index d8ed7244..01d264ca 100644 --- a/screen.h +++ b/screen.h @@ -24,8 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include "qtypes.h" -#include "cvar.h" -#include "snd_main.h" +struct portable_samplepair_s; void CL_Screen_Init (void); void CL_UpdateScreen (void); @@ -43,39 +42,39 @@ void SCR_PushLoadingScreen (const char *msg, float len_in_parent); void SCR_PopLoadingScreen (qbool redraw); void SCR_ClearLoadingScreen (qbool redraw); -void SCR_CaptureVideo_SoundFrame(const portable_sampleframe_t *paintbuffer, size_t length); +void SCR_CaptureVideo_SoundFrame(const struct portable_samplepair_s *paintbuffer, size_t length); extern float scr_con_current; // current height of displayed console extern int sb_lines; -extern cvar_t scr_viewsize; -extern cvar_t scr_fov; -extern cvar_t cl_showfps; -extern cvar_t cl_showtime; -extern cvar_t cl_showdate; - -extern cvar_t crosshair; -extern cvar_t crosshair_size; - -extern cvar_t scr_conalpha; -extern cvar_t scr_conalphafactor; -extern cvar_t scr_conalpha2factor; -extern cvar_t scr_conalpha3factor; -extern cvar_t scr_conscroll_x; -extern cvar_t scr_conscroll_y; -extern cvar_t scr_conscroll2_x; -extern cvar_t scr_conscroll2_y; -extern cvar_t scr_conscroll3_x; -extern cvar_t scr_conscroll3_y; -extern cvar_t scr_conbrightness; -extern cvar_t r_letterbox; - -extern cvar_t scr_refresh; -extern cvar_t scr_stipple; - -extern cvar_t r_stereo_separation; -extern cvar_t r_stereo_angle; +extern struct cvar_s scr_viewsize; +extern struct cvar_s scr_fov; +extern struct cvar_s cl_showfps; +extern struct cvar_s cl_showtime; +extern struct cvar_s cl_showdate; + +extern struct cvar_s crosshair; +extern struct cvar_s crosshair_size; + +extern struct cvar_s scr_conalpha; +extern struct cvar_s scr_conalphafactor; +extern struct cvar_s scr_conalpha2factor; +extern struct cvar_s scr_conalpha3factor; +extern struct cvar_s scr_conscroll_x; +extern struct cvar_s scr_conscroll_y; +extern struct cvar_s scr_conscroll2_x; +extern struct cvar_s scr_conscroll2_y; +extern struct cvar_s scr_conscroll3_x; +extern struct cvar_s scr_conscroll3_y; +extern struct cvar_s scr_conbrightness; +extern struct cvar_s r_letterbox; + +extern struct cvar_s scr_refresh; +extern struct cvar_s scr_stipple; + +extern struct cvar_s r_stereo_separation; +extern struct cvar_s r_stereo_angle; qbool R_Stereo_Active(void); extern int r_stereo_side; diff --git a/snd_main.h b/snd_main.h index e3ccdecd..ff5e43f1 100644 --- a/snd_main.h +++ b/snd_main.h @@ -21,8 +21,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef SND_MAIN_H #define SND_MAIN_H -#include "sound.h" - +#include +#include "qtypes.h" +#include "qdefs.h" +struct mempool_s; +struct sfx_s; typedef struct snd_format_s { @@ -50,7 +53,7 @@ typedef struct snd_ringbuffer_s // may be smaller than startframe if the "ring" buffer has wrapped } snd_ringbuffer_t; -// sfx_t flags +// struct sfx_s flags #define SFXFLAG_NONE 0 #define SFXFLAG_FILEMISSING (1 << 0) // wasn't able to load the associated sound file #define SFXFLAG_LEVELSOUND (1 << 1) // the sfx is part of the server or client precache list for this level @@ -61,8 +64,8 @@ typedef struct snd_fetcher_s snd_fetcher_t; struct sfx_s { char name[MAX_QPATH]; - sfx_t *next; - size_t memsize; // total memory used (including sfx_t and fetcher data) + struct sfx_s *next; + size_t memsize; // total memory used (including struct sfx_s and fetcher data) snd_format_t format; // format describing the audio data that fetcher->getsamplesfloat will return unsigned int flags; // cf SFXFLAG_* defines @@ -81,7 +84,7 @@ struct sfx_s typedef struct channel_s { // provided sound information - sfx_t *sfx; // pointer to sound sample being used + struct sfx_s *sfx; // pointer to sound sample being used float basevolume; // 0-1 master volume unsigned int flags; // cf CHANNELFLAG_* defines int entnum; // makes sound follow entity origin (allows replacing interrupting existing sound on same id) @@ -105,9 +108,9 @@ typedef struct channel_s // Sound fetching functions // "start" is both an input and output parameter: it returns the actual start time of the sound buffer -typedef void (*snd_fetcher_getsamplesfloat_t) (channel_t *ch, sfx_t *sfx, int firstsampleframe, int numsampleframes, float *outsamplesfloat); +typedef void (*snd_fetcher_getsamplesfloat_t) (channel_t *ch, struct sfx_s *sfx, int firstsampleframe, int numsampleframes, float *outsamplesfloat); typedef void (*snd_fetcher_stopchannel_t) (channel_t *ch); -typedef void (*snd_fetcher_freesfx_t) (sfx_t *sfx); +typedef void (*snd_fetcher_freesfx_t) (struct sfx_s *sfx); struct snd_fetcher_s { snd_fetcher_getsamplesfloat_t getsamplesfloat; @@ -122,19 +125,19 @@ extern snd_ringbuffer_t *snd_renderbuffer; extern qbool snd_threaded; // enables use of snd_usethreadedmixing, provided that no sound hacks are in effect (like timedemo) extern qbool snd_usethreadedmixing; // if true, the main thread does not mix sound, soundtime does not advance, and neither does snd_renderbuffer->endframe, instead the audio thread will call S_MixToBuffer as needed -extern cvar_t _snd_mixahead; -extern cvar_t snd_swapstereo; -extern cvar_t snd_streaming; -extern cvar_t snd_streaming_length; +extern struct cvar_s _snd_mixahead; +extern struct cvar_s snd_swapstereo; +extern struct cvar_s snd_streaming; +extern struct cvar_s snd_streaming_length; #define SND_CHANNELLAYOUT_AUTO 0 #define SND_CHANNELLAYOUT_STANDARD 1 #define SND_CHANNELLAYOUT_ALSA 2 -extern cvar_t snd_channellayout; +extern struct cvar_s snd_channellayout; extern int snd_blocked; // counter. When > 0, we stop submitting sound to the audio device -extern mempool_t *snd_mempool; +extern struct mempool_s *snd_mempool; // If simsound is true, the sound card is not initialized and no sound is submitted to it. // More generally, all arch-dependent operations are skipped or emulated. @@ -151,7 +154,7 @@ extern qbool simsound; void S_MixToBuffer(void *stream, unsigned int frames); -qbool S_LoadSound (sfx_t *sfx, qbool complain); +qbool S_LoadSound (struct sfx_s *sfx, qbool complain); // If "buffer" is NULL, the function allocates one buffer of "sampleframes" sample frames itself // (if "sampleframes" is 0, the function chooses the size). diff --git a/snd_mem.c b/snd_mem.c index 87dccbd0..519ef0e2 100644 --- a/snd_mem.c +++ b/snd_mem.c @@ -27,6 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifdef USEXMP #include "snd_xmp.h" #endif +#include "sound.h" void SCR_PushLoadingScreen (const char *, float); void SCR_PopLoadingScreen (qbool); diff --git a/snd_ogg.c b/snd_ogg.c index 315ec202..79c1b035 100644 --- a/snd_ogg.c +++ b/snd_ogg.c @@ -26,6 +26,7 @@ #include "snd_main.h" #include "snd_ogg.h" #include "snd_wav.h" +#include "sound.h" #ifdef LINK_TO_LIBVORBIS #define OV_EXCLUDE_STATIC_CALLBACKS diff --git a/snd_ogg.h b/snd_ogg.h index 0b30e24a..35296e1a 100644 --- a/snd_ogg.h +++ b/snd_ogg.h @@ -24,10 +24,12 @@ #ifndef SND_OGG_H #define SND_OGG_H +#include "qtypes.h" +struct sfx_s; qbool OGG_OpenLibrary (void); void OGG_CloseLibrary (void); -qbool OGG_LoadVorbisFile (const char *filename, sfx_t *sfx); +qbool OGG_LoadVorbisFile (const char *filename, struct sfx_s *sfx); #endif diff --git a/snd_wav.c b/snd_wav.c index 66c8d627..d23a8b51 100644 --- a/snd_wav.c +++ b/snd_wav.c @@ -25,7 +25,7 @@ #include "darkplaces.h" #include "snd_main.h" #include "snd_wav.h" - +#include "sound.h" typedef struct wavinfo_s { diff --git a/snd_wav.h b/snd_wav.h index d192d43a..68fc6d64 100644 --- a/snd_wav.h +++ b/snd_wav.h @@ -26,12 +26,11 @@ #define SND_WAV_H #include "qtypes.h" -#include "sound.h" -#include "snd_main.h" +struct sfx_s; -extern const snd_fetcher_t wav_fetcher; +extern const struct snd_fetcher_s wav_fetcher; -qbool S_LoadWavFile (const char *filename, sfx_t *sfx); +qbool S_LoadWavFile (const char *filename, struct sfx_s *sfx); #endif diff --git a/snd_xmp.c b/snd_xmp.c index 20cf55bb..85a58ef8 100644 --- a/snd_xmp.c +++ b/snd_xmp.c @@ -23,6 +23,7 @@ #include "darkplaces.h" #include "snd_main.h" #include "snd_xmp.h" +#include "sound.h" #ifdef LINK_TO_LIBXMP #include diff --git a/snd_xmp.h b/snd_xmp.h index 23171ea3..3268dee8 100644 --- a/snd_xmp.h +++ b/snd_xmp.h @@ -21,11 +21,11 @@ #define SND_XMP_H #include "qtypes.h" -#include "sound.h" +struct sfx_s; qbool XMP_OpenLibrary (void); void XMP_CloseLibrary (void); -qbool XMP_LoadModFile (const char *filename, sfx_t *sfx); +qbool XMP_LoadModFile (const char *filename, struct sfx_s *sfx); #endif diff --git a/sound.h b/sound.h index 6a581317..697ded8e 100644 --- a/sound.h +++ b/sound.h @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef SOUND_H #define SOUND_H -#include "cmd.h" #include "matrixlib.h" +struct cmd_state_s; // ==================================================================== @@ -47,12 +47,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef struct sfx_s sfx_t; -extern cvar_t mastervolume; -extern cvar_t bgmvolume; -extern cvar_t volume; -extern cvar_t snd_initialized; -extern cvar_t snd_staticvolume; -extern cvar_t snd_mutewhenidle; +extern struct cvar_s mastervolume; +extern struct cvar_s bgmvolume; +extern struct cvar_s volume; +extern struct cvar_s snd_initialized; +extern struct cvar_s snd_staticvolume; +extern struct cvar_s snd_mutewhenidle; // ==================================================================== @@ -64,7 +64,7 @@ void S_Terminate (void); void S_Startup (void); void S_Shutdown (void); -void S_UnloadAllSounds_f(cmd_state_t *cmd); +void S_UnloadAllSounds_f(struct cmd_state_s *cmd); void S_Update(const matrix4x4_t *listenermatrix); void S_ExtraUpdate (void); @@ -103,7 +103,7 @@ qbool S_LocalSound (const char *s); void S_StaticSound (sfx_t *sfx, vec3_t origin, float fvol, float attenuation); void S_StopSound (int entnum, int entchannel); void S_StopAllSounds (void); -void S_StopAllSounds_f(cmd_state_t *cmd); +void S_StopAllSounds_f(struct cmd_state_s *cmd); void S_PauseGameSounds (qbool toggle); void S_StopChannel (unsigned int channel_ind, qbool lockmutex, qbool freesfx); diff --git a/spritegn.h b/spritegn.h index b2d2e3b1..a64f4be9 100644 --- a/spritegn.h +++ b/spritegn.h @@ -61,7 +61,7 @@ typedef struct dsprite_s int height; int numframes; float beamlength; - synctype_t synctype; + int synctype; } dsprite_t; typedef struct dspritehl_s @@ -75,7 +75,7 @@ typedef struct dspritehl_s int height; int numframes; float beamlength; - synctype_t synctype; + int synctype; } dspritehl_t; typedef struct dsprite2frame_s @@ -128,4 +128,3 @@ typedef struct dspriteframetype_s { } dspriteframetype_t; #endif - diff --git a/sv_demo.h b/sv_demo.h index dc16441d..fed19257 100644 --- a/sv_demo.h +++ b/sv_demo.h @@ -2,12 +2,12 @@ #define SV_DEMO_H #include "qtypes.h" -#include "common.h" -typedef struct client_s client_t; +struct sizebuf_s; +struct client_s; -void SV_StartDemoRecording(client_t *client, const char *filename, int forcetrack); -void SV_WriteDemoMessage(client_t *client, sizebuf_t *sendbuffer, qbool clienttoserver); -void SV_StopDemoRecording(client_t *client); -void SV_WriteNetnameIntoDemo(client_t *client); +void SV_StartDemoRecording(struct client_s *client, const char *filename, int forcetrack); +void SV_WriteDemoMessage(struct client_s *client, struct sizebuf_s *sendbuffer, qbool clienttoserver); +void SV_StopDemoRecording(struct client_s *client); +void SV_WriteNetnameIntoDemo(struct client_s *client); #endif diff --git a/sys.h b/sys.h index e1b6c393..0852662d 100644 --- a/sys.h +++ b/sys.h @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define SYS_H #include "qtypes.h" -#include "cvar.h" +#include "qdefs.h" /* Preprocessor macros to identify platform DP_OS_NAME - "friendly" name of the OS, for humans to read @@ -148,7 +148,7 @@ typedef struct sys_s extern sys_t sys; -extern cvar_t sys_usenoclockbutbenchmark; +extern struct cvar_s sys_usenoclockbutbenchmark; // // DLL management diff --git a/taskqueue.h b/taskqueue.h index d87db72e..0f64cf6f 100644 --- a/taskqueue.h +++ b/taskqueue.h @@ -4,7 +4,6 @@ #include #include "qtypes.h" -#include "thread.h" typedef struct taskqueue_task_s { diff --git a/utf8lib.h b/utf8lib.h index 41255a4e..f5454776 100644 --- a/utf8lib.h +++ b/utf8lib.h @@ -6,7 +6,6 @@ #include #include "qtypes.h" -#include "cvar.h" // types for unicode strings // let them be 32 bit for now @@ -21,7 +20,7 @@ typedef int32_t Uchar; // a non-utf8 version to work: u8_strlen() will wrap to strlen() // u8_byteofs() and u8_charidx() will simply return whatever is passed as index parameter // u8_getchar() will will just return the next byte, u8_fromchar will write one byte, ... -extern cvar_t utf8_enable; +extern struct cvar_s utf8_enable; void u8_Init(void); size_t u8_strlen(const char*); diff --git a/vid.h b/vid.h index b8cd2308..8b8fa3f5 100644 --- a/vid.h +++ b/vid.h @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include "qtypes.h" -#include "cmd.h" +struct cmd_state_s; #define ENGINE_ICON ( (gamemode == GAME_NEXUIZ) ? nexuiz_xpm : darkplaces_xpm ) @@ -115,10 +115,10 @@ vid_joystate_t; extern vid_joystate_t vid_joystate; -extern cvar_t joy_index; -extern cvar_t joy_enable; -extern cvar_t joy_detected; -extern cvar_t joy_active; +extern struct cvar_s joy_index; +extern struct cvar_s joy_enable; +extern struct cvar_s joy_detected; +extern struct cvar_s joy_active; float VID_JoyState_GetAxis(const vid_joystate_t *joystate, int axis, float sensitivity, float deadzone); void VID_ApplyJoyState(vid_joystate_t *joystate); @@ -133,50 +133,50 @@ extern qbool vid_hidden; extern qbool vid_activewindow; extern qbool vid_supportrefreshrate; -extern cvar_t vid_fullscreen; -extern cvar_t vid_borderless; -extern cvar_t vid_width; -extern cvar_t vid_height; -extern cvar_t vid_bitsperpixel; -extern cvar_t vid_samples; -extern cvar_t vid_refreshrate; -extern cvar_t vid_userefreshrate; -extern cvar_t vid_touchscreen_density; -extern cvar_t vid_touchscreen_xdpi; -extern cvar_t vid_touchscreen_ydpi; -extern cvar_t vid_vsync; -extern cvar_t vid_mouse; -extern cvar_t vid_mouse_clickthrough; -extern cvar_t vid_grabkeyboard; -extern cvar_t vid_touchscreen; -extern cvar_t vid_touchscreen_showkeyboard; -extern cvar_t vid_touchscreen_supportshowkeyboard; -extern cvar_t vid_stick_mouse; -extern cvar_t vid_resizable; -extern cvar_t vid_desktopfullscreen; +extern struct cvar_s vid_fullscreen; +extern struct cvar_s vid_borderless; +extern struct cvar_s vid_width; +extern struct cvar_s vid_height; +extern struct cvar_s vid_bitsperpixel; +extern struct cvar_s vid_samples; +extern struct cvar_s vid_refreshrate; +extern struct cvar_s vid_userefreshrate; +extern struct cvar_s vid_touchscreen_density; +extern struct cvar_s vid_touchscreen_xdpi; +extern struct cvar_s vid_touchscreen_ydpi; +extern struct cvar_s vid_vsync; +extern struct cvar_s vid_mouse; +extern struct cvar_s vid_mouse_clickthrough; +extern struct cvar_s vid_grabkeyboard; +extern struct cvar_s vid_touchscreen; +extern struct cvar_s vid_touchscreen_showkeyboard; +extern struct cvar_s vid_touchscreen_supportshowkeyboard; +extern struct cvar_s vid_stick_mouse; +extern struct cvar_s vid_resizable; +extern struct cvar_s vid_desktopfullscreen; #ifdef WIN32 -extern cvar_t vid_ignore_taskbar; +extern struct cvar_s vid_ignore_taskbar; #endif -extern cvar_t vid_minwidth; -extern cvar_t vid_minheight; -extern cvar_t vid_sRGB; -extern cvar_t vid_sRGB_fallback; - -extern cvar_t gl_finish; - -extern cvar_t v_gamma; -extern cvar_t v_contrast; -extern cvar_t v_brightness; -extern cvar_t v_color_enable; -extern cvar_t v_color_black_r; -extern cvar_t v_color_black_g; -extern cvar_t v_color_black_b; -extern cvar_t v_color_grey_r; -extern cvar_t v_color_grey_g; -extern cvar_t v_color_grey_b; -extern cvar_t v_color_white_r; -extern cvar_t v_color_white_g; -extern cvar_t v_color_white_b; +extern struct cvar_s vid_minwidth; +extern struct cvar_s vid_minheight; +extern struct cvar_s vid_sRGB; +extern struct cvar_s vid_sRGB_fallback; + +extern struct cvar_s gl_finish; + +extern struct cvar_s v_gamma; +extern struct cvar_s v_contrast; +extern struct cvar_s v_brightness; +extern struct cvar_s v_color_enable; +extern struct cvar_s v_color_black_r; +extern struct cvar_s v_color_black_g; +extern struct cvar_s v_color_black_b; +extern struct cvar_s v_color_grey_r; +extern struct cvar_s v_color_grey_g; +extern struct cvar_s v_color_grey_b; +extern struct cvar_s v_color_white_r; +extern struct cvar_s v_color_white_g; +extern struct cvar_s v_color_white_b; // brand of graphics chip extern const char *gl_vendor; @@ -226,7 +226,7 @@ qbool VID_ShowingKeyboard(void); void VID_SetMouse (qbool fullscreengrab, qbool relative, qbool hidecursor); void VID_Finish (void); -void VID_Restart_f(cmd_state_t *cmd); +void VID_Restart_f(struct cmd_state_s *cmd); void VID_Start(void); void VID_Stop(void); diff --git a/view.h b/view.h index 89b77458..2c6c311b 100644 --- a/view.h +++ b/view.h @@ -3,7 +3,7 @@ #include "qtypes.h" #include "matrixlib.h" -#include "cmd.h" +struct cmd_state_s; void V_Init (void); void V_UpdateBlends (void); @@ -16,6 +16,6 @@ void V_CalcRefdef(void); void V_MakeViewIsometric(void); void V_StartPitchDrift(void); void V_StopPitchDrift (void); -void V_StartPitchDrift_f(cmd_state_t *cmd); +void V_StartPitchDrift_f(struct cmd_state_s *cmd); #endif diff --git a/wad.h b/wad.h index 18d7d410..2aaa1b8d 100644 --- a/wad.h +++ b/wad.h @@ -22,8 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef WAD_H #define WAD_H -#include "common.h" -#include "fs.h" +#include +struct sizebuf_s; //=============== // TYPES @@ -69,12 +69,12 @@ typedef struct lumpinfo_s } lumpinfo_t; void W_UnloadAll(void); -unsigned char *W_GetLumpName(const char *name, fs_offset_t *returnfilesize); +unsigned char *W_GetLumpName(const char *name, int64_t *returnfilesize); // halflife texture wads void W_LoadTextureWadFile(char *filename, int complain); unsigned char *W_GetTextureBGRA(char *name); // returns tempmempool allocated image data, width and height are in image_width and image_height -unsigned char *W_ConvertWAD3TextureBGRA(sizebuf_t *sb); // returns tempmempool allocated image data, width and height are in image_width and image_height +unsigned char *W_ConvertWAD3TextureBGRA(struct sizebuf_s *sb); // returns tempmempool allocated image data, width and height are in image_width and image_height #endif diff --git a/world.h b/world.h index 7e20c801..01968a0a 100644 --- a/world.h +++ b/world.h @@ -23,13 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define WORLD_H #include "qtypes.h" -#include "qdefs.h" -#include "cvar.h" #include "com_list.h" #include "collision.h" -#include "matrixlib.h" -#include "r_textures.h" -typedef struct model_s dp_model_t; #define MOVE_NORMAL 0 #define MOVE_NOMONSTERS 1