Really minor accumulated readability tweaks.

git-svn-id: https://svn.eduke32.com/eduke32@4395 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2014-03-25 21:04:33 +00:00
parent 75baf37812
commit e304f3a518
4 changed files with 11 additions and 6 deletions

View file

@ -1187,7 +1187,7 @@ static inline int32_t logapproach(int32_t val, int32_t targetval)
void rotatepoint(int32_t xpivot, int32_t ypivot, int32_t x, int32_t y,
int16_t daang, int32_t *x2, int32_t *y2) ATTRIBUTE((nonnull(6,7)));
int32_t lastwall(int16_t point);
int32_t nextsectorneighborz(int16_t sectnum, int32_t thez, int16_t topbottom, int16_t direction);
int32_t nextsectorneighborz(int16_t sectnum, int32_t refz, int16_t topbottom, int16_t direction);
int32_t getceilzofslopeptr(const sectortype *sec, int32_t dax, int32_t day) ATTRIBUTE((nonnull(1)));
int32_t getflorzofslopeptr(const sectortype *sec, int32_t dax, int32_t day) ATTRIBUTE((nonnull(1)));

View file

@ -60,9 +60,14 @@ static inline float getshadefactor(int32_t shade)
{
int32_t shadebound = (shadescale_unbounded || shade>=numshades) ? numshades : numshades-1;
float clamped_shade = min(max(shade*shadescale, 0), shadebound);
// 8-bit tiles, i.e. non-hightiles and non-models, don't get additional
// glColor() shading with r_usetileshades!
if (getrendermode() == REND_POLYMOST && r_usetileshades &&
(!usehightile || !hicfindsubst(globalpicnum, globalpal, 0)) &&
(!usemodels || md_tilehasmodel(globalpicnum, globalpal) < 0)) return 1.f;
(!usemodels || md_tilehasmodel(globalpicnum, globalpal) < 0))
return 1.f;
return ((float)(numshades-clamped_shade))/(float)numshades;
}

View file

@ -12062,7 +12062,7 @@ int32_t setspritez(int16_t spritenum, const vec3_t *newpos)
//
// -1: ceiling or up
// 1: floor or down
int32_t nextsectorneighborz(int16_t sectnum, int32_t thez, int16_t topbottom, int16_t direction)
int32_t nextsectorneighborz(int16_t sectnum, int32_t refz, int16_t topbottom, int16_t direction)
{
int32_t nextz = (direction==1) ? INT32_MAX : INT32_MIN;
int32_t sectortouse = -1;
@ -12080,8 +12080,8 @@ int32_t nextsectorneighborz(int16_t sectnum, int32_t thez, int16_t topbottom, in
sector[ns].floorz : sector[ns].ceilingz;
const int32_t update = (direction == 1) ?
(testz > thez && testz < nextz) :
(testz < thez && testz > nextz);
(nextz > testz && testz > refz) :
(nextz < testz && testz < refz);
if (update)
{

View file

@ -1308,7 +1308,7 @@ void drawpoly(double *dpx, double *dpy, int32_t n, int32_t method)
int32_t texunits = GL_TEXTURE0_ARB;
#endif
// backup of the n for possible redrawing of fullbright
int32_t n_ = n, method_ = method;
const int32_t n_ = n, method_ = method;
if (method == -1) return;
#ifdef YAX_ENABLE