fix wrong FindTexinfo call
fix Lightmap_ForStyle call change M_PI to Q_PI switch to Q_strncasecmp
This commit is contained in:
parent
1630b8756e
commit
1f05b7976a
|
|
@ -624,7 +624,7 @@ void Matrix4x4_CM_Projection_Inf(float *proj, float fovx, float fovy, float near
|
||||||
float nudge = 1;
|
float nudge = 1;
|
||||||
|
|
||||||
//proj
|
//proj
|
||||||
ymax = neard * tan( fovy * M_PI / 360.0 );
|
ymax = neard * tan( fovy * Q_PI / 360.0 );
|
||||||
ymin = -ymax;
|
ymin = -ymax;
|
||||||
|
|
||||||
if (fovx == fovy)
|
if (fovx == fovy)
|
||||||
|
|
@ -634,7 +634,7 @@ void Matrix4x4_CM_Projection_Inf(float *proj, float fovx, float fovy, float near
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xmax = neard * tan( fovx * M_PI / 360.0 );
|
xmax = neard * tan( fovx * Q_PI / 360.0 );
|
||||||
xmin = -xmax;
|
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 *Matrix4x4_CM_NewRotation(float ret[16], float a, float x, float y, float z)
|
||||||
{
|
{
|
||||||
float c = cos(a* M_PI / 180.0);
|
float c = cos(a* Q_PI / 180.0);
|
||||||
float s = sin(a* M_PI / 180.0);
|
float s = sin(a* Q_PI / 180.0);
|
||||||
|
|
||||||
ret[0] = x*x*(1-c)+c;
|
ret[0] = x*x*(1-c)+c;
|
||||||
ret[4] = x*y*(1-c)-z*s;
|
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)
|
if (fov_x < 1 || fov_x > 179)
|
||||||
Error ("Bad fov: %f", fov_x);
|
Error ("Bad fov: %f", fov_x);
|
||||||
|
|
||||||
x = fov_x/360*M_PI;
|
x = fov_x/360*Q_PI;
|
||||||
x = tan(x);
|
x = tan(x);
|
||||||
x = width/x;
|
x = width/x;
|
||||||
|
|
||||||
a = atan (height/x);
|
a = atan (height/x);
|
||||||
|
|
||||||
a = a*360/M_PI;
|
a = a*360/Q_PI;
|
||||||
|
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1351,7 +1351,7 @@ LightFace_Min(const lightsample_t *light,
|
||||||
if ((*entity)->formula != LF_LOCALMIN)
|
if ((*entity)->formula != LF_LOCALMIN)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
lightmap = Lightmap_ForStyle(lightmaps, (*entity)->style, lightsurf);
|
lightmap = Lightmap_ForStyle(lightmaps, (*entity)->style, lightsurf->numpoints);
|
||||||
|
|
||||||
hit = false;
|
hit = false;
|
||||||
sample = lightmap->samples;
|
sample = lightmap->samples;
|
||||||
|
|
@ -1807,11 +1807,11 @@ LightFace(bsp2_dface_t *face, facesup_t *facesup, const modelinfo_t *modelinfo,
|
||||||
if (*miptex->name != '*')
|
if (*miptex->name != '*')
|
||||||
return; //non-water surfaces should still not be lit
|
return; //non-water surfaces should still not be lit
|
||||||
//texture name starts with a *, so light it anyway.
|
//texture name starts with a *, so light it anyway.
|
||||||
if (!strncasecmp(miptex->name, "*tele", 5))
|
if (!Q_strncasecmp(miptex->name, "*tele", 5))
|
||||||
turbtype = 3;
|
turbtype = 3;
|
||||||
else if (!strncasecmp(miptex->name, "*lava", 5))
|
else if (!Q_strncasecmp(miptex->name, "*lava", 5))
|
||||||
turbtype = 2;
|
turbtype = 2;
|
||||||
else if (!strncasecmp(miptex->name, "*slime", 6))
|
else if (!Q_strncasecmp(miptex->name, "*slime", 6))
|
||||||
turbtype = 1;
|
turbtype = 1;
|
||||||
else
|
else
|
||||||
turbtype = 0;
|
turbtype = 0;
|
||||||
|
|
|
||||||
|
|
@ -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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -562,6 +562,7 @@ void LoadMapFile(void);
|
||||||
|
|
||||||
int FindMiptex(const char *name);
|
int FindMiptex(const char *name);
|
||||||
int FindTexinfo(texinfo_t *texinfo, unsigned int flags);
|
int FindTexinfo(texinfo_t *texinfo, unsigned int flags);
|
||||||
|
int FindTexinfoEnt(texinfo_t *texinfo, mapentity_t *entity);
|
||||||
|
|
||||||
void PrintEntity(const mapentity_t *entity);
|
void PrintEntity(const mapentity_t *entity);
|
||||||
const char *ValueForKey(const mapentity_t *entity, const char *key);
|
const char *ValueForKey(const mapentity_t *entity, const char *key);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue