From: cloudwalk Date: Thu, 9 Jul 2020 16:58:41 +0000 (+0000) Subject: Rename model functions to make them more generic and obvious what they're for X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5c5ab2a47a1cf85c4726874fbd5332a90c10ae39;p=xonotic%2Fdarkplaces.git Rename model functions to make them more generic and obvious what they're for git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12792 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_draw.c b/gl_draw.c index ac5c98b9..3e33b344 100644 --- a/gl_draw.c +++ b/gl_draw.c @@ -1481,7 +1481,7 @@ void DrawQ_FlushUI(void) return; } - // this is roughly equivalent to R_Q1BSP_Draw, so the UI can use full material feature set + // this is roughly equivalent to R_Mod_Draw, so the UI can use full material feature set r_refdef.view.colorscale = 1; r_textureframe++; // used only by R_GetCurrentTexture GL_DepthMask(false); diff --git a/gl_rsurf.c b/gl_rsurf.c index 1a52a66c..e49162b5 100644 --- a/gl_rsurf.c +++ b/gl_rsurf.c @@ -600,14 +600,14 @@ void R_View_WorldVisibility(qboolean forcenovis) R_View_WorldVisibility_CullSurfaces(); } -void R_Q1BSP_DrawSky(entity_render_t *ent) +void R_Mod_DrawSky(entity_render_t *ent) { if (ent->model == NULL) return; R_DrawModelSurfaces(ent, true, true, false, false, false, false); } -void R_Q1BSP_DrawAddWaterPlanes(entity_render_t *ent) +void R_Mod_DrawAddWaterPlanes(entity_render_t *ent) { int i, j, n, flagsmask; dp_model_t *model = ent->model; @@ -647,7 +647,7 @@ void R_Q1BSP_DrawAddWaterPlanes(entity_render_t *ent) rsurface.entity = NULL; // used only by R_GetCurrentTexture and RSurf_ActiveModelEntity } -void R_Q1BSP_Draw(entity_render_t *ent) +void R_Mod_Draw(entity_render_t *ent) { dp_model_t *model = ent->model; if (model == NULL) @@ -655,7 +655,7 @@ void R_Q1BSP_Draw(entity_render_t *ent) R_DrawModelSurfaces(ent, false, true, false, false, false, false); } -void R_Q1BSP_DrawDepth(entity_render_t *ent) +void R_Mod_DrawDepth(entity_render_t *ent) { dp_model_t *model = ent->model; if (model == NULL || model->surfmesh.isanimated) @@ -670,14 +670,14 @@ void R_Q1BSP_DrawDepth(entity_render_t *ent) GL_ColorMask(r_refdef.view.colormask[0], r_refdef.view.colormask[1], r_refdef.view.colormask[2], 1); } -void R_Q1BSP_DrawDebug(entity_render_t *ent) +void R_Mod_DrawDebug(entity_render_t *ent) { if (ent->model == NULL) return; R_DrawModelSurfaces(ent, false, false, false, true, false, false); } -void R_Q1BSP_DrawPrepass(entity_render_t *ent) +void R_Mod_DrawPrepass(entity_render_t *ent) { dp_model_t *model = ent->model; if (model == NULL) @@ -1212,7 +1212,7 @@ static int R_Q1BSP_GetLightInfo_comparefunc(const void *ap, const void *bp) extern cvar_t r_shadow_sortsurfaces; -void R_Q1BSP_GetLightInfo(entity_render_t *ent, vec3_t relativelightorigin, float lightradius, vec3_t outmins, vec3_t outmaxs, int *outleaflist, unsigned char *outleafpvs, int *outnumleafspointer, int *outsurfacelist, unsigned char *outsurfacepvs, int *outnumsurfacespointer, unsigned char *outshadowtrispvs, unsigned char *outlighttrispvs, unsigned char *visitingleafpvs, int numfrustumplanes, const mplane_t *frustumplanes, qboolean noocclusion) +void R_Mod_GetLightInfo(entity_render_t *ent, vec3_t relativelightorigin, float lightradius, vec3_t outmins, vec3_t outmaxs, int *outleaflist, unsigned char *outleafpvs, int *outnumleafspointer, int *outsurfacelist, unsigned char *outsurfacepvs, int *outnumsurfacespointer, unsigned char *outshadowtrispvs, unsigned char *outlighttrispvs, unsigned char *visitingleafpvs, int numfrustumplanes, const mplane_t *frustumplanes, qboolean noocclusion) { r_q1bsp_getlightinfo_t info; info.frontsidecasting = r_shadow_frontsidecasting.integer != 0; @@ -1296,7 +1296,7 @@ void R_Q1BSP_GetLightInfo(entity_render_t *ent, vec3_t relativelightorigin, floa qsort(info.outsurfacelist, info.outnumsurfaces, sizeof(*info.outsurfacelist), R_Q1BSP_GetLightInfo_comparefunc); } -void R_Q1BSP_CompileShadowMap(entity_render_t *ent, vec3_t relativelightorigin, vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist) +void R_Mod_CompileShadowMap(entity_render_t *ent, vec3_t relativelightorigin, vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist) { dp_model_t *model = ent->model; msurface_t *surface; @@ -1327,7 +1327,7 @@ void R_Q1BSP_CompileShadowMap(entity_render_t *ent, vec3_t relativelightorigin, static const msurface_t *batchsurfacelist[RSURF_MAX_BATCHSURFACES]; -void R_Q1BSP_DrawShadowMap(int side, entity_render_t *ent, const vec3_t relativelightorigin, const vec3_t relativelightdirection, float lightradius, int modelnumsurfaces, const int *modelsurfacelist, const unsigned char *surfacesides, const vec3_t lightmins, const vec3_t lightmaxs) +void R_Mod_DrawShadowMap(int side, entity_render_t *ent, const vec3_t relativelightorigin, const vec3_t relativelightdirection, float lightradius, int modelnumsurfaces, const int *modelsurfacelist, const unsigned char *surfacesides, const vec3_t lightmins, const vec3_t lightmaxs) { dp_model_t *model = ent->model; const msurface_t *surface; @@ -1406,7 +1406,7 @@ static void R_Q1BSP_DrawLight_TransparentCallback(const entity_render_t *ent, co } extern qboolean r_shadow_usingdeferredprepass; -void R_Q1BSP_DrawLight(entity_render_t *ent, int numsurfaces, const int *surfacelist, const unsigned char *lighttrispvs) +void R_Mod_DrawLight(entity_render_t *ent, int numsurfaces, const int *surfacelist, const unsigned char *lighttrispvs) { dp_model_t *model = ent->model; const msurface_t *surface; diff --git a/model_alias.c b/model_alias.c index 04bc821f..5aa98c53 100644 --- a/model_alias.c +++ b/model_alias.c @@ -1006,13 +1006,13 @@ void Mod_IDP0_Load(dp_model_t *mod, void *buffer, void *bufferend) loadmodel->type = mod_alias; loadmodel->DrawSky = NULL; loadmodel->DrawAddWaterPlanes = NULL; - loadmodel->Draw = R_Q1BSP_Draw; - loadmodel->DrawDepth = R_Q1BSP_DrawDepth; - loadmodel->DrawDebug = R_Q1BSP_DrawDebug; - loadmodel->DrawPrepass = R_Q1BSP_DrawPrepass; - loadmodel->CompileShadowMap = R_Q1BSP_CompileShadowMap; - loadmodel->DrawShadowMap = R_Q1BSP_DrawShadowMap; - loadmodel->DrawLight = R_Q1BSP_DrawLight; + loadmodel->Draw = R_Mod_Draw; + loadmodel->DrawDepth = R_Mod_DrawDepth; + loadmodel->DrawDebug = R_Mod_DrawDebug; + loadmodel->DrawPrepass = R_Mod_DrawPrepass; + loadmodel->CompileShadowMap = R_Mod_CompileShadowMap; + loadmodel->DrawShadowMap = R_Mod_DrawShadowMap; + loadmodel->DrawLight = R_Mod_DrawLight; loadmodel->TraceBox = Mod_MDLMD2MD3_TraceBox; loadmodel->TraceLine = Mod_MDLMD2MD3_TraceLine; // FIXME add TraceBrush! @@ -1325,9 +1325,9 @@ void Mod_IDP0_Load(dp_model_t *mod, void *buffer, void *bufferend) for (i = 0;i < loadmodel->num_textures;i++) { if (loadmodel->data_textures[i].basematerialflags & (MATERIALFLAG_SKY)) - mod->DrawSky = R_Q1BSP_DrawSky; + mod->DrawSky = R_Mod_DrawSky; if (loadmodel->data_textures[i].basematerialflags & (MATERIALFLAG_WATERSHADER | MATERIALFLAG_REFRACTION | MATERIALFLAG_REFLECTION | MATERIALFLAG_CAMERA)) - mod->DrawAddWaterPlanes = R_Q1BSP_DrawAddWaterPlanes; + mod->DrawAddWaterPlanes = R_Mod_DrawAddWaterPlanes; } } @@ -1365,13 +1365,13 @@ void Mod_IDP2_Load(dp_model_t *mod, void *buffer, void *bufferend) loadmodel->type = mod_alias; loadmodel->DrawSky = NULL; loadmodel->DrawAddWaterPlanes = NULL; - loadmodel->Draw = R_Q1BSP_Draw; - loadmodel->DrawDepth = R_Q1BSP_DrawDepth; - loadmodel->DrawDebug = R_Q1BSP_DrawDebug; - loadmodel->DrawPrepass = R_Q1BSP_DrawPrepass; - loadmodel->CompileShadowMap = R_Q1BSP_CompileShadowMap; - loadmodel->DrawShadowMap = R_Q1BSP_DrawShadowMap; - loadmodel->DrawLight = R_Q1BSP_DrawLight; + loadmodel->Draw = R_Mod_Draw; + loadmodel->DrawDepth = R_Mod_DrawDepth; + loadmodel->DrawDebug = R_Mod_DrawDebug; + loadmodel->DrawPrepass = R_Mod_DrawPrepass; + loadmodel->CompileShadowMap = R_Mod_CompileShadowMap; + loadmodel->DrawShadowMap = R_Mod_DrawShadowMap; + loadmodel->DrawLight = R_Mod_DrawLight; loadmodel->TraceBox = Mod_MDLMD2MD3_TraceBox; loadmodel->TraceLine = Mod_MDLMD2MD3_TraceLine; loadmodel->PointSuperContents = NULL; @@ -1589,9 +1589,9 @@ void Mod_IDP2_Load(dp_model_t *mod, void *buffer, void *bufferend) for (i = 0;i < loadmodel->num_textures;i++) { if (loadmodel->data_textures[i].basematerialflags & (MATERIALFLAG_SKY)) - mod->DrawSky = R_Q1BSP_DrawSky; + mod->DrawSky = R_Mod_DrawSky; if (loadmodel->data_textures[i].basematerialflags & (MATERIALFLAG_WATERSHADER | MATERIALFLAG_REFRACTION | MATERIALFLAG_REFLECTION | MATERIALFLAG_CAMERA)) - mod->DrawAddWaterPlanes = R_Q1BSP_DrawAddWaterPlanes; + mod->DrawAddWaterPlanes = R_Mod_DrawAddWaterPlanes; } } @@ -1624,13 +1624,13 @@ void Mod_IDP3_Load(dp_model_t *mod, void *buffer, void *bufferend) loadmodel->type = mod_alias; loadmodel->DrawSky = NULL; loadmodel->DrawAddWaterPlanes = NULL; - loadmodel->Draw = R_Q1BSP_Draw; - loadmodel->DrawDepth = R_Q1BSP_DrawDepth; - loadmodel->DrawDebug = R_Q1BSP_DrawDebug; - loadmodel->DrawPrepass = R_Q1BSP_DrawPrepass; - loadmodel->CompileShadowMap = R_Q1BSP_CompileShadowMap; - loadmodel->DrawShadowMap = R_Q1BSP_DrawShadowMap; - loadmodel->DrawLight = R_Q1BSP_DrawLight; + loadmodel->Draw = R_Mod_Draw; + loadmodel->DrawDepth = R_Mod_DrawDepth; + loadmodel->DrawDebug = R_Mod_DrawDebug; + loadmodel->DrawPrepass = R_Mod_DrawPrepass; + loadmodel->CompileShadowMap = R_Mod_CompileShadowMap; + loadmodel->DrawShadowMap = R_Mod_DrawShadowMap; + loadmodel->DrawLight = R_Mod_DrawLight; loadmodel->TraceBox = Mod_MDLMD2MD3_TraceBox; loadmodel->TraceLine = Mod_MDLMD2MD3_TraceLine; loadmodel->PointSuperContents = NULL; @@ -1779,9 +1779,9 @@ void Mod_IDP3_Load(dp_model_t *mod, void *buffer, void *bufferend) for (i = 0;i < loadmodel->num_textures;i++) { if (loadmodel->data_textures[i].basematerialflags & (MATERIALFLAG_SKY)) - mod->DrawSky = R_Q1BSP_DrawSky; + mod->DrawSky = R_Mod_DrawSky; if (loadmodel->data_textures[i].basematerialflags & (MATERIALFLAG_WATERSHADER | MATERIALFLAG_REFRACTION | MATERIALFLAG_REFLECTION | MATERIALFLAG_CAMERA)) - mod->DrawAddWaterPlanes = R_Q1BSP_DrawAddWaterPlanes; + mod->DrawAddWaterPlanes = R_Mod_DrawAddWaterPlanes; } } @@ -1859,13 +1859,13 @@ void Mod_ZYMOTICMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend) loadmodel->DrawSky = NULL; loadmodel->DrawAddWaterPlanes = NULL; - loadmodel->Draw = R_Q1BSP_Draw; - loadmodel->DrawDepth = R_Q1BSP_DrawDepth; - loadmodel->DrawDebug = R_Q1BSP_DrawDebug; - loadmodel->DrawPrepass = R_Q1BSP_DrawPrepass; - loadmodel->CompileShadowMap = R_Q1BSP_CompileShadowMap; - loadmodel->DrawShadowMap = R_Q1BSP_DrawShadowMap; - loadmodel->DrawLight = R_Q1BSP_DrawLight; + loadmodel->Draw = R_Mod_Draw; + loadmodel->DrawDepth = R_Mod_DrawDepth; + loadmodel->DrawDebug = R_Mod_DrawDebug; + loadmodel->DrawPrepass = R_Mod_DrawPrepass; + loadmodel->CompileShadowMap = R_Mod_CompileShadowMap; + loadmodel->DrawShadowMap = R_Mod_DrawShadowMap; + loadmodel->DrawLight = R_Mod_DrawLight; loadmodel->TraceBox = Mod_MDLMD2MD3_TraceBox; loadmodel->TraceLine = Mod_MDLMD2MD3_TraceLine; loadmodel->PointSuperContents = NULL; @@ -2172,9 +2172,9 @@ void Mod_ZYMOTICMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend) for (i = 0;i < loadmodel->num_textures;i++) { if (loadmodel->data_textures[i].basematerialflags & (MATERIALFLAG_SKY)) - mod->DrawSky = R_Q1BSP_DrawSky; + mod->DrawSky = R_Mod_DrawSky; if (loadmodel->data_textures[i].basematerialflags & (MATERIALFLAG_WATERSHADER | MATERIALFLAG_REFRACTION | MATERIALFLAG_REFLECTION | MATERIALFLAG_CAMERA)) - mod->DrawAddWaterPlanes = R_Q1BSP_DrawAddWaterPlanes; + mod->DrawAddWaterPlanes = R_Mod_DrawAddWaterPlanes; } } @@ -2236,13 +2236,13 @@ void Mod_DARKPLACESMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend) loadmodel->DrawSky = NULL; loadmodel->DrawAddWaterPlanes = NULL; - loadmodel->Draw = R_Q1BSP_Draw; - loadmodel->DrawDepth = R_Q1BSP_DrawDepth; - loadmodel->DrawDebug = R_Q1BSP_DrawDebug; - loadmodel->DrawPrepass = R_Q1BSP_DrawPrepass; - loadmodel->CompileShadowMap = R_Q1BSP_CompileShadowMap; - loadmodel->DrawShadowMap = R_Q1BSP_DrawShadowMap; - loadmodel->DrawLight = R_Q1BSP_DrawLight; + loadmodel->Draw = R_Mod_Draw; + loadmodel->DrawDepth = R_Mod_DrawDepth; + loadmodel->DrawDebug = R_Mod_DrawDebug; + loadmodel->DrawPrepass = R_Mod_DrawPrepass; + loadmodel->CompileShadowMap = R_Mod_CompileShadowMap; + loadmodel->DrawShadowMap = R_Mod_DrawShadowMap; + loadmodel->DrawLight = R_Mod_DrawLight; loadmodel->TraceBox = Mod_MDLMD2MD3_TraceBox; loadmodel->TraceLine = Mod_MDLMD2MD3_TraceLine; loadmodel->PointSuperContents = NULL; @@ -2546,9 +2546,9 @@ void Mod_DARKPLACESMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend) for (i = 0;i < loadmodel->num_textures;i++) { if (loadmodel->data_textures[i].basematerialflags & (MATERIALFLAG_SKY)) - mod->DrawSky = R_Q1BSP_DrawSky; + mod->DrawSky = R_Mod_DrawSky; if (loadmodel->data_textures[i].basematerialflags & (MATERIALFLAG_WATERSHADER | MATERIALFLAG_REFRACTION | MATERIALFLAG_REFLECTION | MATERIALFLAG_CAMERA)) - mod->DrawAddWaterPlanes = R_Q1BSP_DrawAddWaterPlanes; + mod->DrawAddWaterPlanes = R_Mod_DrawAddWaterPlanes; } } @@ -2585,13 +2585,13 @@ void Mod_PSKMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend) loadmodel->type = mod_alias; loadmodel->DrawSky = NULL; loadmodel->DrawAddWaterPlanes = NULL; - loadmodel->Draw = R_Q1BSP_Draw; - loadmodel->DrawDepth = R_Q1BSP_DrawDepth; - loadmodel->DrawDebug = R_Q1BSP_DrawDebug; - loadmodel->DrawPrepass = R_Q1BSP_DrawPrepass; - loadmodel->CompileShadowMap = R_Q1BSP_CompileShadowMap; - loadmodel->DrawShadowMap = R_Q1BSP_DrawShadowMap; - loadmodel->DrawLight = R_Q1BSP_DrawLight; + loadmodel->Draw = R_Mod_Draw; + loadmodel->DrawDepth = R_Mod_DrawDepth; + loadmodel->DrawDebug = R_Mod_DrawDebug; + loadmodel->DrawPrepass = R_Mod_DrawPrepass; + loadmodel->CompileShadowMap = R_Mod_CompileShadowMap; + loadmodel->DrawShadowMap = R_Mod_DrawShadowMap; + loadmodel->DrawLight = R_Mod_DrawLight; loadmodel->TraceBox = Mod_MDLMD2MD3_TraceBox; loadmodel->TraceLine = Mod_MDLMD2MD3_TraceLine; loadmodel->PointSuperContents = NULL; @@ -3217,9 +3217,9 @@ void Mod_PSKMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend) for (i = 0;i < loadmodel->num_textures;i++) { if (loadmodel->data_textures[i].basematerialflags & (MATERIALFLAG_SKY)) - mod->DrawSky = R_Q1BSP_DrawSky; + mod->DrawSky = R_Mod_DrawSky; if (loadmodel->data_textures[i].basematerialflags & (MATERIALFLAG_WATERSHADER | MATERIALFLAG_REFRACTION | MATERIALFLAG_REFLECTION | MATERIALFLAG_CAMERA)) - mod->DrawAddWaterPlanes = R_Q1BSP_DrawAddWaterPlanes; + mod->DrawAddWaterPlanes = R_Mod_DrawAddWaterPlanes; } } @@ -3409,13 +3409,13 @@ void Mod_INTERQUAKEMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend) loadmodel->DrawSky = NULL; loadmodel->DrawAddWaterPlanes = NULL; - loadmodel->Draw = R_Q1BSP_Draw; - loadmodel->DrawDepth = R_Q1BSP_DrawDepth; - loadmodel->DrawDebug = R_Q1BSP_DrawDebug; - loadmodel->DrawPrepass = R_Q1BSP_DrawPrepass; - loadmodel->CompileShadowMap = R_Q1BSP_CompileShadowMap; - loadmodel->DrawShadowMap = R_Q1BSP_DrawShadowMap; - loadmodel->DrawLight = R_Q1BSP_DrawLight; + loadmodel->Draw = R_Mod_Draw; + loadmodel->DrawDepth = R_Mod_DrawDepth; + loadmodel->DrawDebug = R_Mod_DrawDebug; + loadmodel->DrawPrepass = R_Mod_DrawPrepass; + loadmodel->CompileShadowMap = R_Mod_CompileShadowMap; + loadmodel->DrawShadowMap = R_Mod_DrawShadowMap; + loadmodel->DrawLight = R_Mod_DrawLight; loadmodel->TraceBox = Mod_MDLMD2MD3_TraceBox; loadmodel->TraceLine = Mod_MDLMD2MD3_TraceLine; loadmodel->PointSuperContents = NULL; @@ -3964,8 +3964,8 @@ void Mod_INTERQUAKEMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend) for (i = 0;i < loadmodel->num_textures;i++) { if (loadmodel->data_textures[i].basematerialflags & (MATERIALFLAG_SKY)) - mod->DrawSky = R_Q1BSP_DrawSky; + mod->DrawSky = R_Mod_DrawSky; if (loadmodel->data_textures[i].basematerialflags & (MATERIALFLAG_WATERSHADER | MATERIALFLAG_REFRACTION | MATERIALFLAG_REFLECTION | MATERIALFLAG_CAMERA)) - mod->DrawAddWaterPlanes = R_Q1BSP_DrawAddWaterPlanes; + mod->DrawAddWaterPlanes = R_Mod_DrawAddWaterPlanes; } } diff --git a/model_brush.c b/model_brush.c index 3c418765..b56321f5 100644 --- a/model_brush.c +++ b/model_brush.c @@ -148,7 +148,7 @@ void Mod_BrushInit(void) mod_q1bsp_texture_water.supercontents = SUPERCONTENTS_WATER; } -static mleaf_t *Mod_Q1BSP_PointInLeaf(dp_model_t *model, const vec3_t p) +static mleaf_t *Mod_BSP_PointInLeaf(dp_model_t *model, const vec3_t p) { mnode_t *node; @@ -168,7 +168,7 @@ static void Mod_Q1BSP_AmbientSoundLevelsForPoint(dp_model_t *model, const vec3_t { int i; mleaf_t *leaf; - leaf = Mod_Q1BSP_PointInLeaf(model, p); + leaf = Mod_BSP_PointInLeaf(model, p); if (leaf) { i = min(outsize, (int)sizeof(leaf->ambient_sound_level)); @@ -183,7 +183,7 @@ static void Mod_Q1BSP_AmbientSoundLevelsForPoint(dp_model_t *model, const vec3_t memset(out, 0, outsize); } -static int Mod_Q1BSP_FindBoxClusters(dp_model_t *model, const vec3_t mins, const vec3_t maxs, int maxclusters, int *clusterlist) +static int Mod_BSP_FindBoxClusters(dp_model_t *model, const vec3_t mins, const vec3_t maxs, int maxclusters, int *clusterlist) { int numclusters = 0; int nodestackindex = 0; @@ -249,7 +249,7 @@ static int Mod_Q1BSP_FindBoxClusters(dp_model_t *model, const vec3_t mins, const return numclusters; } -static int Mod_Q1BSP_BoxTouchingPVS(dp_model_t *model, const unsigned char *pvs, const vec3_t mins, const vec3_t maxs) +static int Mod_BSP_BoxTouchingPVS(dp_model_t *model, const unsigned char *pvs, const vec3_t mins, const vec3_t maxs) { int nodestackindex = 0; mnode_t *node, *nodestack[1024]; @@ -320,7 +320,7 @@ static int Mod_Q1BSP_BoxTouchingPVS(dp_model_t *model, const unsigned char *pvs, return false; } -static int Mod_Q1BSP_BoxTouchingLeafPVS(dp_model_t *model, const unsigned char *pvs, const vec3_t mins, const vec3_t maxs) +static int Mod_BSP_BoxTouchingLeafPVS(dp_model_t *model, const unsigned char *pvs, const vec3_t mins, const vec3_t maxs) { int nodestackindex = 0; mnode_t *node, *nodestack[1024]; @@ -391,7 +391,7 @@ static int Mod_Q1BSP_BoxTouchingLeafPVS(dp_model_t *model, const unsigned char * return false; } -static int Mod_Q1BSP_BoxTouchingVisibleLeafs(dp_model_t *model, const unsigned char *visibleleafs, const vec3_t mins, const vec3_t maxs) +static int Mod_BSP_BoxTouchingVisibleLeafs(dp_model_t *model, const unsigned char *visibleleafs, const vec3_t mins, const vec3_t maxs) { int nodestackindex = 0; mnode_t *node, *nodestack[1024]; @@ -595,7 +595,7 @@ static void Mod_Q1BSP_FindNonSolidLocation_r(findnonsolidlocationinfo_t *info, m } } -static void Mod_Q1BSP_FindNonSolidLocation(dp_model_t *model, const vec3_t in, vec3_t out, float radius) +static void Mod_BSP_FindNonSolidLocation(dp_model_t *model, const vec3_t in, vec3_t out, float radius) { int i; findnonsolidlocationinfo_t info; @@ -1327,7 +1327,7 @@ static int Mod_Q1BSP_LightPoint_RecursiveBSPNode(dp_model_t *model, vec3_t ambie return false; } -static void Mod_Q1BSP_LightPoint(dp_model_t *model, const vec3_t p, vec3_t ambientcolor, vec3_t diffusecolor, vec3_t diffusenormal) +static void Mod_BSP_LightPoint(dp_model_t *model, const vec3_t p, vec3_t ambientcolor, vec3_t diffusecolor, vec3_t diffusenormal) { // pretend lighting is coming down from above (due to lack of a lightgrid to know primary lighting direction) VectorSet(diffusenormal, 0, 0, 1); @@ -1562,12 +1562,12 @@ static void Mod_Q1BSP_DecompressVis(const unsigned char *in, const unsigned char /* ============= -R_Q1BSP_LoadSplitSky +Mod_Q1BSP_LoadSplitSky A sky texture is 256*128, with the right side being a masked overlay ============== */ -static void R_Q1BSP_LoadSplitSky (unsigned char *src, int width, int height, int bytesperpixel) +static void Mod_Q1BSP_LoadSplitSky (unsigned char *src, int width, int height, int bytesperpixel) { int x, y; int w = width/2; @@ -1904,11 +1904,11 @@ static void Mod_Q1BSP_LoadTextures(sizebuf_t *sb) data = loadimagepixelsbgra(gamemode == GAME_TENEBRAE ? tx->name : va(vabuf, sizeof(vabuf), "textures/%s", tx->name), false, false, false, NULL); if (data && image_width == image_height * 2) { - R_Q1BSP_LoadSplitSky(data, image_width, image_height, 4); + Mod_Q1BSP_LoadSplitSky(data, image_width, image_height, 4); Mem_Free(data); } else if (mtdata != NULL) - R_Q1BSP_LoadSplitSky(mtdata, mtwidth, mtheight, 1); + Mod_Q1BSP_LoadSplitSky(mtdata, mtwidth, mtheight, 1); } else if (mtdata) // texture included tx->materialshaderpass->skinframes[0] = R_SkinFrame_LoadInternalQuake(tx->name, TEXF_MIPMAP | TEXF_ISWORLD | TEXF_PICMIP, false, r_fullbrights.integer, mtdata, tx->width, tx->height); @@ -3387,7 +3387,7 @@ static void Mod_Q1BSP_RecursiveRecalcNodeBBox(mnode_t *node) node->maxs[2] = max(node->children[0]->maxs[2], node->children[1]->maxs[2]); } -static void Mod_Q1BSP_FinalizePortals(void) +static void Mod_BSP_FinalizePortals(void) { int i, j, numportals, numpoints, portalindex, portalrange = (int)Mem_ExpandableArray_IndexRange(&portalarray); portal_t *p; @@ -3590,7 +3590,7 @@ static void RemovePortalFromNodes(portal_t *portal) static double *portalpointsbuffer; static int portalpointsbufferoffset; static int portalpointsbuffersize; -static void Mod_Q1BSP_RecursiveNodePortals(mnode_t *node) +static void Mod_BSP_RecursiveNodePortals(mnode_t *node) { int i, side; mnode_t *front, *back, *other_node; @@ -3619,7 +3619,7 @@ static void Mod_Q1BSP_RecursiveNodePortals(mnode_t *node) front = node->children[0]; back = node->children[1]; if (front == back) - Host_Error("Mod_Q1BSP_RecursiveNodePortals: corrupt node hierarchy"); + Host_Error("Mod_BSP_RecursiveNodePortals: corrupt node hierarchy"); // create the new portal by generating a polygon for the node plane, // and clipping it by all of the other portals(which came from nodes above this one) @@ -3634,7 +3634,7 @@ static void Mod_Q1BSP_RecursiveNodePortals(mnode_t *node) { clipplane = portal->plane; if (portal->nodes[0] == portal->nodes[1]) - Host_Error("Mod_Q1BSP_RecursiveNodePortals: portal has same node on both sides(1)"); + Host_Error("Mod_BSP_RecursiveNodePortals: portal has same node on both sides(1)"); if (portal->nodes[0] == node) side = 0; else if (portal->nodes[1] == node) @@ -3645,7 +3645,7 @@ static void Mod_Q1BSP_RecursiveNodePortals(mnode_t *node) } else { - Host_Error("Mod_Q1BSP_RecursiveNodePortals: mislinked portal"); + Host_Error("Mod_BSP_RecursiveNodePortals: mislinked portal"); side = 0; // hush warning } @@ -3658,12 +3658,12 @@ static void Mod_Q1BSP_RecursiveNodePortals(mnode_t *node) if (nodeportal->numpoints < 3) { - Con_Print(CON_WARN "Mod_Q1BSP_RecursiveNodePortals: WARNING: new portal was clipped away\n"); + Con_Print(CON_WARN "Mod_BSP_RecursiveNodePortals: WARNING: new portal was clipped away\n"); nodeportal->numpoints = 0; } else if (nodeportal->numpoints >= MAX_PORTALPOINTS) { - Con_Print(CON_WARN "Mod_Q1BSP_RecursiveNodePortals: WARNING: new portal has too many points\n"); + Con_Print(CON_WARN "Mod_BSP_RecursiveNodePortals: WARNING: new portal has too many points\n"); nodeportal->numpoints = 0; } @@ -3674,14 +3674,14 @@ static void Mod_Q1BSP_RecursiveNodePortals(mnode_t *node) for (portal = (portal_t *)node->portals;portal;portal = nextportal) { if (portal->nodes[0] == portal->nodes[1]) - Host_Error("Mod_Q1BSP_RecursiveNodePortals: portal has same node on both sides(2)"); + Host_Error("Mod_BSP_RecursiveNodePortals: portal has same node on both sides(2)"); if (portal->nodes[0] == node) side = 0; else if (portal->nodes[1] == node) side = 1; else { - Host_Error("Mod_Q1BSP_RecursiveNodePortals: mislinked portal"); + Host_Error("Mod_BSP_RecursiveNodePortals: mislinked portal"); side = 0; // hush warning } nextportal = portal->next[side]; @@ -3735,30 +3735,30 @@ static void Mod_Q1BSP_RecursiveNodePortals(mnode_t *node) } } - Mod_Q1BSP_RecursiveNodePortals(front); - Mod_Q1BSP_RecursiveNodePortals(back); + Mod_BSP_RecursiveNodePortals(front); + Mod_BSP_RecursiveNodePortals(back); portalpointsbufferoffset -= 6*MAX_PORTALPOINTS; } -static void Mod_Q1BSP_MakePortals(void) +static void Mod_BSP_MakePortals(void) { Mem_ExpandableArray_NewArray(&portalarray, loadmodel->mempool, sizeof(portal_t), 1020*1024/sizeof(portal_t)); portalpointsbufferoffset = 0; portalpointsbuffersize = 6*MAX_PORTALPOINTS*128; portalpointsbuffer = (double *)Mem_Alloc(loadmodel->mempool, portalpointsbuffersize * sizeof(*portalpointsbuffer)); - Mod_Q1BSP_RecursiveNodePortals(loadmodel->brush.data_nodes + loadmodel->brushq1.hulls[0].firstclipnode); + Mod_BSP_RecursiveNodePortals(loadmodel->brush.data_nodes + loadmodel->brushq1.hulls[0].firstclipnode); Mem_Free(portalpointsbuffer); portalpointsbuffer = NULL; portalpointsbufferoffset = 0; portalpointsbuffersize = 0; - Mod_Q1BSP_FinalizePortals(); + Mod_BSP_FinalizePortals(); Mem_ExpandableArray_FreeArray(&portalarray); } //Returns PVS data for a given point //(note: can return NULL) -static unsigned char *Mod_Q1BSP_GetPVS(dp_model_t *model, const vec3_t p) +static unsigned char *Mod_BSP_GetPVS(dp_model_t *model, const vec3_t p) { mnode_t *node; node = model->brush.data_nodes + model->brushq1.hulls[0].firstclipnode; @@ -3770,7 +3770,7 @@ static unsigned char *Mod_Q1BSP_GetPVS(dp_model_t *model, const vec3_t p) return NULL; } -static void Mod_Q1BSP_FatPVS_RecursiveBSPNode(dp_model_t *model, const vec3_t org, vec_t radius, unsigned char *pvsbuffer, int pvsbytes, mnode_t *node) +static void Mod_BSP_FatPVS_RecursiveBSPNode(dp_model_t *model, const vec3_t org, vec_t radius, unsigned char *pvsbuffer, int pvsbytes, mnode_t *node) { while (node->plane) { @@ -3782,7 +3782,7 @@ static void Mod_Q1BSP_FatPVS_RecursiveBSPNode(dp_model_t *model, const vec3_t or else { // go down both sides - Mod_Q1BSP_FatPVS_RecursiveBSPNode(model, org, radius, pvsbuffer, pvsbytes, node->children[0]); + Mod_BSP_FatPVS_RecursiveBSPNode(model, org, radius, pvsbuffer, pvsbytes, node->children[0]); node = node->children[1]; } } @@ -3798,18 +3798,18 @@ static void Mod_Q1BSP_FatPVS_RecursiveBSPNode(dp_model_t *model, const vec3_t or //Calculates a PVS that is the inclusive or of all leafs within radius pixels //of the given point. -static int Mod_Q1BSP_FatPVS(dp_model_t *model, const vec3_t org, vec_t radius, unsigned char *pvsbuffer, int pvsbufferlength, qboolean merge) +static int Mod_BSP_FatPVS(dp_model_t *model, const vec3_t org, vec_t radius, unsigned char *pvsbuffer, int pvsbufferlength, qboolean merge) { int bytes = model->brush.num_pvsclusterbytes; bytes = min(bytes, pvsbufferlength); - if (r_novis.integer || r_trippy.integer || !model->brush.num_pvsclusters || !Mod_Q1BSP_GetPVS(model, org)) + if (r_novis.integer || r_trippy.integer || !model->brush.num_pvsclusters || !Mod_BSP_GetPVS(model, org)) { memset(pvsbuffer, 0xFF, bytes); return bytes; } if (!merge) memset(pvsbuffer, 0, bytes); - Mod_Q1BSP_FatPVS_RecursiveBSPNode(model, org, radius, pvsbuffer, bytes, model->brush.data_nodes + model->brushq1.hulls[0].firstclipnode); + Mod_BSP_FatPVS_RecursiveBSPNode(model, org, radius, pvsbuffer, bytes, model->brush.data_nodes + model->brushq1.hulls[0].firstclipnode); return bytes; } @@ -3937,25 +3937,25 @@ void Mod_Q1BSP_Load(dp_model_t *mod, void *buffer, void *bufferend) mod->brush.TraceLineOfSight = Mod_Q1BSP_TraceLineOfSight; mod->brush.SuperContentsFromNativeContents = Mod_Q1BSP_SuperContentsFromNativeContents; mod->brush.NativeContentsFromSuperContents = Mod_Q1BSP_NativeContentsFromSuperContents; - mod->brush.GetPVS = Mod_Q1BSP_GetPVS; - mod->brush.FatPVS = Mod_Q1BSP_FatPVS; - mod->brush.BoxTouchingPVS = Mod_Q1BSP_BoxTouchingPVS; - mod->brush.BoxTouchingLeafPVS = Mod_Q1BSP_BoxTouchingLeafPVS; - mod->brush.BoxTouchingVisibleLeafs = Mod_Q1BSP_BoxTouchingVisibleLeafs; - mod->brush.FindBoxClusters = Mod_Q1BSP_FindBoxClusters; - mod->brush.LightPoint = Mod_Q1BSP_LightPoint; - mod->brush.FindNonSolidLocation = Mod_Q1BSP_FindNonSolidLocation; + mod->brush.GetPVS = Mod_BSP_GetPVS; + mod->brush.FatPVS = Mod_BSP_FatPVS; + mod->brush.BoxTouchingPVS = Mod_BSP_BoxTouchingPVS; + mod->brush.BoxTouchingLeafPVS = Mod_BSP_BoxTouchingLeafPVS; + mod->brush.BoxTouchingVisibleLeafs = Mod_BSP_BoxTouchingVisibleLeafs; + mod->brush.FindBoxClusters = Mod_BSP_FindBoxClusters; + mod->brush.LightPoint = Mod_BSP_LightPoint; + mod->brush.FindNonSolidLocation = Mod_BSP_FindNonSolidLocation; mod->brush.AmbientSoundLevelsForPoint = Mod_Q1BSP_AmbientSoundLevelsForPoint; mod->brush.RoundUpToHullSize = Mod_Q1BSP_RoundUpToHullSize; - mod->brush.PointInLeaf = Mod_Q1BSP_PointInLeaf; - mod->Draw = R_Q1BSP_Draw; - mod->DrawDepth = R_Q1BSP_DrawDepth; - mod->DrawDebug = R_Q1BSP_DrawDebug; - mod->DrawPrepass = R_Q1BSP_DrawPrepass; - mod->GetLightInfo = R_Q1BSP_GetLightInfo; - mod->CompileShadowMap = R_Q1BSP_CompileShadowMap; - mod->DrawShadowMap = R_Q1BSP_DrawShadowMap; - mod->DrawLight = R_Q1BSP_DrawLight; + mod->brush.PointInLeaf = Mod_BSP_PointInLeaf; + mod->Draw = R_Mod_Draw; + mod->DrawDepth = R_Mod_DrawDepth; + mod->DrawDebug = R_Mod_DrawDebug; + mod->DrawPrepass = R_Mod_DrawPrepass; + mod->GetLightInfo = R_Mod_GetLightInfo; + mod->CompileShadowMap = R_Mod_CompileShadowMap; + mod->DrawShadowMap = R_Mod_DrawShadowMap; + mod->DrawLight = R_Mod_DrawLight; // load into heap @@ -4005,7 +4005,7 @@ void Mod_Q1BSP_Load(dp_model_t *mod, void *buffer, void *bufferend) Mod_Q1BSP_MakeHull0(); if (mod_bsp_portalize.integer) - Mod_Q1BSP_MakePortals(); + Mod_BSP_MakePortals(); mod->numframes = 2; // regular and alternate animation mod->numskins = 1; @@ -4134,13 +4134,13 @@ void Mod_Q1BSP_Load(dp_model_t *mod, void *buffer, void *bufferend) if (surface->texture->basematerialflags & MATERIALFLAG_SKY) break; if (j < mod->nummodelsurfaces) - mod->DrawSky = R_Q1BSP_DrawSky; + mod->DrawSky = R_Mod_DrawSky; for (j = 0, surface = &mod->data_surfaces[mod->firstmodelsurface];j < mod->nummodelsurfaces;j++, surface++) if (surface->texture && surface->texture->basematerialflags & (MATERIALFLAG_WATERSHADER | MATERIALFLAG_REFRACTION | MATERIALFLAG_REFLECTION | MATERIALFLAG_CAMERA)) break; if (j < mod->nummodelsurfaces) - mod->DrawAddWaterPlanes = R_Q1BSP_DrawAddWaterPlanes; + mod->DrawAddWaterPlanes = R_Mod_DrawAddWaterPlanes; // build lightstyle update chains // (used to rapidly mark lightmapupdateflags on many surfaces @@ -4915,25 +4915,25 @@ static void Mod_Q2BSP_Load(dp_model_t *mod, void *buffer, void *bufferend) mod->brush.TraceLineOfSight = Mod_Q3BSP_TraceLineOfSight; mod->brush.SuperContentsFromNativeContents = Mod_Q2BSP_SuperContentsFromNativeContents; mod->brush.NativeContentsFromSuperContents = Mod_Q2BSP_NativeContentsFromSuperContents; - mod->brush.GetPVS = Mod_Q1BSP_GetPVS; - mod->brush.FatPVS = Mod_Q1BSP_FatPVS; - mod->brush.BoxTouchingPVS = Mod_Q1BSP_BoxTouchingPVS; - mod->brush.BoxTouchingLeafPVS = Mod_Q1BSP_BoxTouchingLeafPVS; - mod->brush.BoxTouchingVisibleLeafs = Mod_Q1BSP_BoxTouchingVisibleLeafs; - mod->brush.FindBoxClusters = Mod_Q1BSP_FindBoxClusters; - mod->brush.LightPoint = Mod_Q1BSP_LightPoint; - mod->brush.FindNonSolidLocation = Mod_Q1BSP_FindNonSolidLocation; + mod->brush.GetPVS = Mod_BSP_GetPVS; + mod->brush.FatPVS = Mod_BSP_FatPVS; + mod->brush.BoxTouchingPVS = Mod_BSP_BoxTouchingPVS; + mod->brush.BoxTouchingLeafPVS = Mod_BSP_BoxTouchingLeafPVS; + mod->brush.BoxTouchingVisibleLeafs = Mod_BSP_BoxTouchingVisibleLeafs; + mod->brush.FindBoxClusters = Mod_BSP_FindBoxClusters; + mod->brush.LightPoint = Mod_BSP_LightPoint; + mod->brush.FindNonSolidLocation = Mod_BSP_FindNonSolidLocation; mod->brush.AmbientSoundLevelsForPoint = NULL; mod->brush.RoundUpToHullSize = NULL; - mod->brush.PointInLeaf = Mod_Q1BSP_PointInLeaf; - mod->Draw = R_Q1BSP_Draw; - mod->DrawDepth = R_Q1BSP_DrawDepth; - mod->DrawDebug = R_Q1BSP_DrawDebug; - mod->DrawPrepass = R_Q1BSP_DrawPrepass; - mod->GetLightInfo = R_Q1BSP_GetLightInfo; - mod->CompileShadowMap = R_Q1BSP_CompileShadowMap; - mod->DrawShadowMap = R_Q1BSP_DrawShadowMap; - mod->DrawLight = R_Q1BSP_DrawLight; + mod->brush.PointInLeaf = Mod_BSP_PointInLeaf; + mod->Draw = R_Mod_Draw; + mod->DrawDepth = R_Mod_DrawDepth; + mod->DrawDebug = R_Mod_DrawDebug; + mod->DrawPrepass = R_Mod_DrawPrepass; + mod->GetLightInfo = R_Mod_GetLightInfo; + mod->CompileShadowMap = R_Mod_CompileShadowMap; + mod->DrawShadowMap = R_Mod_DrawShadowMap; + mod->DrawLight = R_Mod_DrawLight; // load into heap @@ -4988,7 +4988,7 @@ static void Mod_Q2BSP_Load(dp_model_t *mod, void *buffer, void *bufferend) // the MakePortals code works fine on the q2bsp data as well if (mod_bsp_portalize.integer) - Mod_Q1BSP_MakePortals(); + Mod_BSP_MakePortals(); mod->numframes = 0; // q2bsp animations are kind of special, frame is unbounded... mod->numskins = 1; @@ -5111,13 +5111,13 @@ static void Mod_Q2BSP_Load(dp_model_t *mod, void *buffer, void *bufferend) if (surface->texture->basematerialflags & MATERIALFLAG_SKY) break; if (j < mod->nummodelsurfaces) - mod->DrawSky = R_Q1BSP_DrawSky; + mod->DrawSky = R_Mod_DrawSky; for (j = 0, surface = &mod->data_surfaces[mod->firstmodelsurface];j < mod->nummodelsurfaces;j++, surface++) if (surface->texture->basematerialflags & (MATERIALFLAG_WATERSHADER | MATERIALFLAG_REFRACTION | MATERIALFLAG_REFLECTION | MATERIALFLAG_CAMERA)) break; if (j < mod->nummodelsurfaces) - mod->DrawAddWaterPlanes = R_Q1BSP_DrawAddWaterPlanes; + mod->DrawAddWaterPlanes = R_Mod_DrawAddWaterPlanes; // build lightstyle update chains // (used to rapidly mark lightmapupdateflags on many surfaces @@ -7495,25 +7495,25 @@ static void Mod_Q3BSP_Load(dp_model_t *mod, void *buffer, void *bufferend) mod->brush.TraceLineOfSight = Mod_Q3BSP_TraceLineOfSight; mod->brush.SuperContentsFromNativeContents = Mod_Q3BSP_SuperContentsFromNativeContents; mod->brush.NativeContentsFromSuperContents = Mod_Q3BSP_NativeContentsFromSuperContents; - mod->brush.GetPVS = Mod_Q1BSP_GetPVS; - mod->brush.FatPVS = Mod_Q1BSP_FatPVS; - mod->brush.BoxTouchingPVS = Mod_Q1BSP_BoxTouchingPVS; - mod->brush.BoxTouchingLeafPVS = Mod_Q1BSP_BoxTouchingLeafPVS; - mod->brush.BoxTouchingVisibleLeafs = Mod_Q1BSP_BoxTouchingVisibleLeafs; - mod->brush.FindBoxClusters = Mod_Q1BSP_FindBoxClusters; + mod->brush.GetPVS = Mod_BSP_GetPVS; + mod->brush.FatPVS = Mod_BSP_FatPVS; + mod->brush.BoxTouchingPVS = Mod_BSP_BoxTouchingPVS; + mod->brush.BoxTouchingLeafPVS = Mod_BSP_BoxTouchingLeafPVS; + mod->brush.BoxTouchingVisibleLeafs = Mod_BSP_BoxTouchingVisibleLeafs; + mod->brush.FindBoxClusters = Mod_BSP_FindBoxClusters; mod->brush.LightPoint = Mod_Q3BSP_LightPoint; - mod->brush.FindNonSolidLocation = Mod_Q1BSP_FindNonSolidLocation; + mod->brush.FindNonSolidLocation = Mod_BSP_FindNonSolidLocation; mod->brush.AmbientSoundLevelsForPoint = NULL; mod->brush.RoundUpToHullSize = NULL; - mod->brush.PointInLeaf = Mod_Q1BSP_PointInLeaf; - mod->Draw = R_Q1BSP_Draw; - mod->DrawDepth = R_Q1BSP_DrawDepth; - mod->DrawDebug = R_Q1BSP_DrawDebug; - mod->DrawPrepass = R_Q1BSP_DrawPrepass; - mod->GetLightInfo = R_Q1BSP_GetLightInfo; - mod->CompileShadowMap = R_Q1BSP_CompileShadowMap; - mod->DrawShadowMap = R_Q1BSP_DrawShadowMap; - mod->DrawLight = R_Q1BSP_DrawLight; + mod->brush.PointInLeaf = Mod_BSP_PointInLeaf; + mod->Draw = R_Mod_Draw; + mod->DrawDepth = R_Mod_DrawDepth; + mod->DrawDebug = R_Mod_DrawDebug; + mod->DrawPrepass = R_Mod_DrawPrepass; + mod->GetLightInfo = R_Mod_GetLightInfo; + mod->CompileShadowMap = R_Mod_CompileShadowMap; + mod->DrawShadowMap = R_Mod_DrawShadowMap; + mod->DrawLight = R_Mod_DrawLight; mod_base = (unsigned char *)header; @@ -7586,7 +7586,7 @@ static void Mod_Q3BSP_Load(dp_model_t *mod, void *buffer, void *bufferend) // the MakePortals code works fine on the q3bsp data as well if (mod_bsp_portalize.integer) - Mod_Q1BSP_MakePortals(); + Mod_BSP_MakePortals(); // FIXME: shader alpha should replace r_wateralpha support in q3bsp loadmodel->brush.supportwateralpha = true; @@ -7683,13 +7683,13 @@ static void Mod_Q3BSP_Load(dp_model_t *mod, void *buffer, void *bufferend) if (mod->data_surfaces[j + mod->firstmodelsurface].texture->basematerialflags & MATERIALFLAG_SKY) break; if (j < mod->nummodelsurfaces) - mod->DrawSky = R_Q1BSP_DrawSky; + mod->DrawSky = R_Mod_DrawSky; for (j = 0;j < mod->nummodelsurfaces;j++) if (mod->data_surfaces[j + mod->firstmodelsurface].texture->basematerialflags & (MATERIALFLAG_WATERSHADER | MATERIALFLAG_REFRACTION | MATERIALFLAG_REFLECTION | MATERIALFLAG_CAMERA)) break; if (j < mod->nummodelsurfaces) - mod->DrawAddWaterPlanes = R_Q1BSP_DrawAddWaterPlanes; + mod->DrawAddWaterPlanes = R_Mod_DrawAddWaterPlanes; Mod_MakeCollisionBIH(mod, false, &mod->collision_bih); Mod_MakeCollisionBIH(mod, true, &mod->render_bih); @@ -7826,14 +7826,14 @@ void Mod_OBJ_Load(dp_model_t *mod, void *buffer, void *bufferend) loadmodel->brush.AmbientSoundLevelsForPoint = NULL; loadmodel->brush.RoundUpToHullSize = NULL; loadmodel->brush.PointInLeaf = NULL; - loadmodel->Draw = R_Q1BSP_Draw; - loadmodel->DrawDepth = R_Q1BSP_DrawDepth; - loadmodel->DrawDebug = R_Q1BSP_DrawDebug; - loadmodel->DrawPrepass = R_Q1BSP_DrawPrepass; - loadmodel->GetLightInfo = R_Q1BSP_GetLightInfo; - loadmodel->CompileShadowMap = R_Q1BSP_CompileShadowMap; - loadmodel->DrawShadowMap = R_Q1BSP_DrawShadowMap; - loadmodel->DrawLight = R_Q1BSP_DrawLight; + loadmodel->Draw = R_Mod_Draw; + loadmodel->DrawDepth = R_Mod_DrawDepth; + loadmodel->DrawDebug = R_Mod_DrawDebug; + loadmodel->DrawPrepass = R_Mod_DrawPrepass; + loadmodel->GetLightInfo = R_Mod_GetLightInfo; + loadmodel->CompileShadowMap = R_Mod_CompileShadowMap; + loadmodel->DrawShadowMap = R_Mod_DrawShadowMap; + loadmodel->DrawLight = R_Mod_DrawLight; skinfiles = Mod_LoadSkinFiles(); if (loadmodel->numskins < 1) @@ -8332,13 +8332,13 @@ void Mod_OBJ_Load(dp_model_t *mod, void *buffer, void *bufferend) if (mod->data_surfaces[j + mod->firstmodelsurface].texture->basematerialflags & MATERIALFLAG_SKY) break; if (j < mod->nummodelsurfaces) - mod->DrawSky = R_Q1BSP_DrawSky; + mod->DrawSky = R_Mod_DrawSky; for (j = 0;j < mod->nummodelsurfaces;j++) if (mod->data_surfaces[j + mod->firstmodelsurface].texture->basematerialflags & (MATERIALFLAG_WATERSHADER | MATERIALFLAG_REFRACTION | MATERIALFLAG_REFLECTION | MATERIALFLAG_CAMERA)) break; if (j < mod->nummodelsurfaces) - mod->DrawAddWaterPlanes = R_Q1BSP_DrawAddWaterPlanes; + mod->DrawAddWaterPlanes = R_Mod_DrawAddWaterPlanes; Mod_MakeCollisionBIH(mod, true, &mod->collision_bih); mod->render_bih = mod->collision_bih; diff --git a/model_shared.c b/model_shared.c index c6e98641..14b8ec90 100644 --- a/model_shared.c +++ b/model_shared.c @@ -4375,13 +4375,13 @@ void Mod_Mesh_Create(dp_model_t *mod, const char *name) strlcpy(mod->name, name, sizeof(mod->name)); mod->mempool = Mem_AllocPool(name, 0, NULL); mod->texturepool = R_AllocTexturePool(); - mod->Draw = R_Q1BSP_Draw; - mod->DrawDepth = R_Q1BSP_DrawDepth; - mod->DrawDebug = R_Q1BSP_DrawDebug; - mod->DrawPrepass = R_Q1BSP_DrawPrepass; - mod->GetLightInfo = R_Q1BSP_GetLightInfo; - mod->DrawShadowMap = R_Q1BSP_DrawShadowMap; - mod->DrawLight = R_Q1BSP_DrawLight; + mod->Draw = R_Mod_Draw; + mod->DrawDepth = R_Mod_DrawDepth; + mod->DrawDebug = R_Mod_DrawDebug; + mod->DrawPrepass = R_Mod_DrawPrepass; + mod->GetLightInfo = R_Mod_GetLightInfo; + mod->DrawShadowMap = R_Mod_DrawShadowMap; + mod->DrawLight = R_Mod_DrawLight; } void Mod_Mesh_Destroy(dp_model_t *mod) @@ -4473,9 +4473,9 @@ msurface_t *Mod_Mesh_AddSurface(dp_model_t *mod, texture_t *tex, qboolean batchw surf->num_firsttriangle = mod->surfmesh.num_triangles; surf->num_firstvertex = mod->surfmesh.num_vertices; if (tex->basematerialflags & (MATERIALFLAG_SKY)) - mod->DrawSky = R_Q1BSP_DrawSky; + mod->DrawSky = R_Mod_DrawSky; if (tex->basematerialflags & (MATERIALFLAG_WATERSHADER | MATERIALFLAG_REFRACTION | MATERIALFLAG_REFLECTION | MATERIALFLAG_CAMERA)) - mod->DrawAddWaterPlanes = R_Q1BSP_DrawAddWaterPlanes; + mod->DrawAddWaterPlanes = R_Mod_DrawAddWaterPlanes; return surf; } diff --git a/model_shared.h b/model_shared.h index 066051ed..fc04c7fb 100644 --- a/model_shared.h +++ b/model_shared.h @@ -1195,16 +1195,16 @@ int Mod_Q2BSP_NativeContentsFromSuperContents(int supercontents); // a lot of model formats use the Q1BSP code, so here are the prototypes... struct entity_render_s; -void R_Q1BSP_DrawAddWaterPlanes(struct entity_render_s *ent); -void R_Q1BSP_DrawSky(struct entity_render_s *ent); -void R_Q1BSP_Draw(struct entity_render_s *ent); -void R_Q1BSP_DrawDepth(struct entity_render_s *ent); -void R_Q1BSP_DrawDebug(struct entity_render_s *ent); -void R_Q1BSP_DrawPrepass(struct entity_render_s *ent); -void R_Q1BSP_GetLightInfo(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius, vec3_t outmins, vec3_t outmaxs, int *outleaflist, unsigned char *outleafpvs, int *outnumleafspointer, int *outsurfacelist, unsigned char *outsurfacepvs, int *outnumsurfacespointer, unsigned char *outshadowtrispvs, unsigned char *outlighttrispvs, unsigned char *visitingleafpvs, int numfrustumplanes, const mplane_t *frustumplanes, qboolean noocclusion); -void R_Q1BSP_CompileShadowMap(struct entity_render_s *ent, vec3_t relativelightorigin, vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist); -void R_Q1BSP_DrawShadowMap(int side, struct entity_render_s *ent, const vec3_t relativelightorigin, const vec3_t relativelightdirection, float lightradius, int modelnumsurfaces, const int *modelsurfacelist, const unsigned char *surfacesides, const vec3_t lightmins, const vec3_t lightmaxs); -void R_Q1BSP_DrawLight(struct entity_render_s *ent, int numsurfaces, const int *surfacelist, const unsigned char *trispvs); +void R_Mod_DrawAddWaterPlanes(struct entity_render_s *ent); +void R_Mod_DrawSky(struct entity_render_s *ent); +void R_Mod_Draw(struct entity_render_s *ent); +void R_Mod_DrawDepth(struct entity_render_s *ent); +void R_Mod_DrawDebug(struct entity_render_s *ent); +void R_Mod_DrawPrepass(struct entity_render_s *ent); +void R_Mod_GetLightInfo(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius, vec3_t outmins, vec3_t outmaxs, int *outleaflist, unsigned char *outleafpvs, int *outnumleafspointer, int *outsurfacelist, unsigned char *outsurfacepvs, int *outnumsurfacespointer, unsigned char *outshadowtrispvs, unsigned char *outlighttrispvs, unsigned char *visitingleafpvs, int numfrustumplanes, const mplane_t *frustumplanes, qboolean noocclusion); +void R_Mod_CompileShadowMap(struct entity_render_s *ent, vec3_t relativelightorigin, vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist); +void R_Mod_DrawShadowMap(int side, struct entity_render_s *ent, const vec3_t relativelightorigin, const vec3_t relativelightdirection, float lightradius, int modelnumsurfaces, const int *modelsurfacelist, const unsigned char *surfacesides, const vec3_t lightmins, const vec3_t lightmaxs); +void R_Mod_DrawLight(struct entity_render_s *ent, int numsurfaces, const int *surfacelist, const unsigned char *trispvs); // dynamic mesh building (every frame) for debugging and other uses void Mod_Mesh_Create(dp_model_t *mod, const char *name);