summaryrefslogtreecommitdiff
path: root/src/engine/rendermodel.cpp
diff options
context:
space:
mode:
authorxolatile2025-08-10 00:19:46 +0200
committerxolatile2025-08-10 00:19:46 +0200
commit757096e7df15c14b9b10352fa91663483f9e34f8 (patch)
treedcad789d0abd8be76463277dc01bf32c4e6a527b /src/engine/rendermodel.cpp
parentb2c89d7060e99a36c8c7ac897b7386686c74deac (diff)
downloadxolatile-badassbug-757096e7df15c14b9b10352fa91663483f9e34f8.tar.xz
xolatile-badassbug-757096e7df15c14b9b10352fa91663483f9e34f8.tar.zst
all
Diffstat (limited to 'src/engine/rendermodel.cpp')
-rw-r--r--src/engine/rendermodel.cpp19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/engine/rendermodel.cpp b/src/engine/rendermodel.cpp
index 0355213..cfdf326 100644
--- a/src/engine/rendermodel.cpp
+++ b/src/engine/rendermodel.cpp
@@ -265,10 +265,6 @@ void mmodel(char *name) {
mmi.m = NULL;
}
-void mapmodelcompat(int *rad, int *h, int *tex, char *name, char *shadow) {
- mmodel(name);
-}
-
void mapmodelreset(int *n) {
if(!(identflags&IDF_OVERRIDDEN) && !game::allowedittoggle()) return;
mapmodels.shrink(clamp(*n, 0, mapmodels.length()));
@@ -278,7 +274,6 @@ mapmodelinfo *getmminfo(int i) { return mapmodels.inrange(i) ? &mapmodels[i] : 0
const char *mapmodelname(int i) { return mapmodels.inrange(i) ? mapmodels[i].name : NULL; }
COMMAND(mmodel, "s");
-COMMANDN(mapmodel, mapmodelcompat, "iiiss");
COMMAND(mapmodelreset, "i");
ICOMMAND(mapmodelname, "i", (int *index), { result(mapmodels.inrange(*index) ? mapmodels[*index].name : ""); });
ICOMMAND(mapmodelloaded, "i", (int *index), { intret(mapmodels.inrange(*index) && mapmodels[*index].m ? 1 : 0); });
@@ -620,7 +615,7 @@ static inline void disablecullmodelquery() {
endbb();
}
-static inline int cullmodel(model *m, const vec &center, float radius, int flags, dynent *d = NULL, bool shadow = false) {
+static inline int cullmodel(const vec &center, float radius, int flags, dynent *d = NULL) {
if(flags&MDL_CULL_DIST && center.dist(camera1->o)/radius>maxmodelradiusdistance) return MDL_CULL_DIST;
if(flags&MDL_CULL_VFC) {
if(shadowmapping && !isshadowmapcaster(center, radius)) return MDL_CULL_VFC;
@@ -664,7 +659,7 @@ void rendermodel(entitylight *light, const char *mdl, int anim, const vec &o, fl
center.rotate_around_z(yaw*RAD);
center.add(o);
}
- int culled = cullmodel(m, center, radius, flags, d, shadow);
+ int culled = cullmodel(center, radius, flags, d);
if(culled) {
if(culled&(MDL_CULL_OCCLUDED|MDL_CULL_QUERY) && flags&MDL_CULL_QUERY) {
enablecullmodelquery();
@@ -703,24 +698,20 @@ void rendermodel(entitylight *light, const char *mdl, int anim, const vec &o, fl
pos.z += radius/2;
}
else if(d->type < ENT_CAMERA) pos.z += 0.75f*(d->eyeheight + d->aboveeye);
- lightreaching(pos, light->color, light->dir, (flags&MDL_LIGHT_FAST)!=0);
- dynlightreaching(pos, light->color, light->dir, (flags&MDL_HUD)!=0);
+ lightreaching(pos, light->color, light->dir);
light->millis = lastmillis;
}
}
else if(flags&MDL_LIGHT) {
if(!light) {
- lightreaching(pos, lightcolor, lightdir, (flags&MDL_LIGHT_FAST)!=0);
- dynlightreaching(pos, lightcolor, lightdir, (flags&MDL_HUD)!=0);
+ lightreaching(pos, lightcolor, lightdir);
}
else if(light->millis!=lastmillis) {
- lightreaching(pos, light->color, light->dir, (flags&MDL_LIGHT_FAST)!=0);
- dynlightreaching(pos, light->color, light->dir, (flags&MDL_HUD)!=0);
+ lightreaching(pos, light->color, light->dir);
light->millis = lastmillis;
}
}
if(light) { lightcolor = light->color; lightdir = light->dir; }
- if(flags&MDL_DYNLIGHT) dynlightreaching(pos, lightcolor, lightdir, (flags&MDL_HUD)!=0);
}
if(a) for(int i = 0; a[i].tag; i++) {
if(a[i].name) a[i].m = loadmodel(a[i].name);