int, this fixes a crash reported by Andreas Dehmel in certain quoth
maps, I have no idea how coordinates can be negative though
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7708
d7cf8633-e32d-0410-b094-
e92efae38249
float FogPoint_World(const vec3_t p)
{
float FogPoint_World(const vec3_t p)
{
- int fogmasktableindex = (int)(VectorDistance((p), r_view.origin) * r_refdef.fogmasktabledistmultiplier);
+ unsigned int fogmasktableindex = (unsigned int)(VectorDistance((p), r_view.origin) * r_refdef.fogmasktabledistmultiplier);
return r_refdef.fogmasktable[min(fogmasktableindex, FOGMASKTABLEWIDTH - 1)];
}
float FogPoint_Model(const vec3_t p)
{
return r_refdef.fogmasktable[min(fogmasktableindex, FOGMASKTABLEWIDTH - 1)];
}
float FogPoint_Model(const vec3_t p)
{
- int fogmasktableindex = (int)(VectorDistance((p), rsurface.modelorg) * r_refdef.fogmasktabledistmultiplier);
+ unsigned int fogmasktableindex = (unsigned int)(VectorDistance((p), rsurface.modelorg) * r_refdef.fogmasktabledistmultiplier);
return r_refdef.fogmasktable[min(fogmasktableindex, FOGMASKTABLEWIDTH - 1)];
}
return r_refdef.fogmasktable[min(fogmasktableindex, FOGMASKTABLEWIDTH - 1)];
}