diff --git a/light/entities.c b/light/entities.c index aacf6b09..c8f58e05 100644 --- a/light/entities.c +++ b/light/entities.c @@ -624,7 +624,7 @@ void Matrix4x4_CM_Projection_Inf(float *proj, float fovx, float fovy, float near float nudge = 1; //proj - ymax = neard * tan( fovy * M_PI / 360.0 ); + ymax = neard * tan( fovy * Q_PI / 360.0 ); ymin = -ymax; if (fovx == fovy) @@ -634,7 +634,7 @@ void Matrix4x4_CM_Projection_Inf(float *proj, float fovx, float fovy, float near } else { - xmax = neard * tan( fovx * M_PI / 360.0 ); + xmax = neard * tan( fovx * Q_PI / 360.0 ); xmin = -xmax; } @@ -660,8 +660,8 @@ void Matrix4x4_CM_Projection_Inf(float *proj, float fovx, float fovy, float near } float *Matrix4x4_CM_NewRotation(float ret[16], float a, float x, float y, float z) { - float c = cos(a* M_PI / 180.0); - float s = sin(a* M_PI / 180.0); + float c = cos(a* Q_PI / 180.0); + float s = sin(a* Q_PI / 180.0); ret[0] = x*x*(1-c)+c; ret[4] = x*y*(1-c)-z*s; @@ -776,13 +776,13 @@ float CalcFov (float fov_x, float width, float height) if (fov_x < 1 || fov_x > 179) Error ("Bad fov: %f", fov_x); - x = fov_x/360*M_PI; + x = fov_x/360*Q_PI; x = tan(x); x = width/x; a = atan (height/x); - a = a*360/M_PI; + a = a*360/Q_PI; return a; } diff --git a/light/ltface.c b/light/ltface.c index 586c4796..7f966de4 100644 --- a/light/ltface.c +++ b/light/ltface.c @@ -1351,7 +1351,7 @@ LightFace_Min(const lightsample_t *light, if ((*entity)->formula != LF_LOCALMIN) continue; - lightmap = Lightmap_ForStyle(lightmaps, (*entity)->style, lightsurf); + lightmap = Lightmap_ForStyle(lightmaps, (*entity)->style, lightsurf->numpoints); hit = false; sample = lightmap->samples; @@ -1807,11 +1807,11 @@ LightFace(bsp2_dface_t *face, facesup_t *facesup, const modelinfo_t *modelinfo, if (*miptex->name != '*') return; //non-water surfaces should still not be lit //texture name starts with a *, so light it anyway. - if (!strncasecmp(miptex->name, "*tele", 5)) + if (!Q_strncasecmp(miptex->name, "*tele", 5)) turbtype = 3; - else if (!strncasecmp(miptex->name, "*lava", 5)) + else if (!Q_strncasecmp(miptex->name, "*lava", 5)) turbtype = 2; - else if (!strncasecmp(miptex->name, "*slime", 6)) + else if (!Q_strncasecmp(miptex->name, "*slime", 6)) turbtype = 1; else turbtype = 0; diff --git a/qbsp/map.c b/qbsp/map.c index 925c2277..62ee45b7 100644 --- a/qbsp/map.c +++ b/qbsp/map.c @@ -576,7 +576,7 @@ ParseBrushFace(parser_t *parser, mapface_t *face, mapentity_t *entity) } - face->texinfo = FindTexinfo(&tx, entity); + face->texinfo = FindTexinfoEnt(&tx, entity); return true; } diff --git a/qbsp/qbsp.h b/qbsp/qbsp.h index 51453b85..68708f10 100644 --- a/qbsp/qbsp.h +++ b/qbsp/qbsp.h @@ -562,6 +562,7 @@ void LoadMapFile(void); int FindMiptex(const char *name); int FindTexinfo(texinfo_t *texinfo, unsigned int flags); +int FindTexinfoEnt(texinfo_t *texinfo, mapentity_t *entity); void PrintEntity(const mapentity_t *entity); const char *ValueForKey(const mapentity_t *entity, const char *key);