A couple of less interesting changes.

- strip 'inline' from animateoffs() definition, remove declaration in build.h
- one min/max -> clamp
- one malloc/strlen/strcpy -> strdup

git-svn-id: https://svn.eduke32.com/eduke32@2592 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-04-05 19:49:54 +00:00
parent c01109c483
commit 9a7d1ed1a5
4 changed files with 9 additions and 9 deletions

View File

@ -731,8 +731,6 @@ void setrollangle(int32_t rolla);
// clamping is for sprites, repeating is for walls // clamping is for sprites, repeating is for walls
void invalidatetile(int16_t tilenume, int32_t pal, int32_t how); void invalidatetile(int16_t tilenume, int32_t pal, int32_t how);
int32_t animateoffs(int16_t tilenum, int16_t fakevar);
void setpolymost2dview(void); // sets up GL for 2D drawing void setpolymost2dview(void); // sets up GL for 2D drawing
int32_t polymost_drawtilescreen(int32_t tilex, int32_t tiley, int32_t wallnum, int32_t dimen, int32_t tilezoom, int32_t polymost_drawtilescreen(int32_t tilex, int32_t tiley, int32_t wallnum, int32_t dimen, int32_t tilezoom,

View File

@ -3037,7 +3037,7 @@ static void prepwall(int32_t z, walltype *wal)
// //
// animateoffs (internal) // animateoffs (internal)
// //
inline int32_t animateoffs(int16_t tilenum, int16_t fakevar) int32_t animateoffs(int16_t tilenum, int16_t fakevar)
{ {
int32_t i, k, offs; int32_t i, k, offs;
@ -6859,8 +6859,6 @@ static void dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t
if ((dastat&1) == 0) if ((dastat&1) == 0)
#endif #endif
{ {
char bad;
int32_t xx, xend;
int32_t y1ve[4], y2ve[4], u4, d4; int32_t y1ve[4], y2ve[4], u4, d4;
if (((a&1023) == 0) && (ysiz <= 256)) //vlineasm4 has 256 high limit! if (((a&1023) == 0) && (ysiz <= 256)) //vlineasm4 has 256 high limit!
@ -6873,6 +6871,9 @@ static void dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t
for (x=x1; x<x2; x+=4) for (x=x1; x<x2; x+=4)
{ {
char bad;
int32_t xx, xend;
bad = 15; xend = min(x2-x,4); bad = 15; xend = min(x2-x,4);
for (xx=0; xx<xend; xx++) for (xx=0; xx<xend; xx++)
{ {
@ -13149,7 +13150,7 @@ restart_grand:
if ((pos->z < daz2) && (daz2 < *florz if ((pos->z < daz2) && (daz2 < *florz
#ifdef YAX_ENABLE #ifdef YAX_ENABLE
// can have a floor-sprite laying directly on the floor! // can have a floor-sprite lying directly on the floor!
|| (daz2 == *florz && yax_getbunch(clipsectorlist[i], YAX_FLOOR)>=0) || (daz2 == *florz && yax_getbunch(clipsectorlist[i], YAX_FLOOR)>=0)
#endif #endif
)) ))
@ -13539,7 +13540,7 @@ void setbrightness(char dabrightness, uint8_t dapalid, uint8_t flags)
if (!(flags&4)) if (!(flags&4))
{ {
curbrightness = min(max((int32_t)dabrightness,0),15); curbrightness = clamp(dabrightness, 0, 15);
// if (lastbright != (unsigned)curbrightness) // if (lastbright != (unsigned)curbrightness)
// vid_gamma = 1.0 + ((float)curbrightness / 10.0); // vid_gamma = 1.0 + ((float)curbrightness / 10.0);
} }

View File

@ -480,9 +480,8 @@ int32_t md_defineskin(int32_t modelid, const char *skinfn, int32_t palnum, int32
sk->param = param; sk->param = param;
sk->specpower = specpower; sk->specpower = specpower;
sk->specfactor = specfactor; sk->specfactor = specfactor;
sk->fn = (char *)Bmalloc(strlen(skinfn)+1); sk->fn = Bstrdup(skinfn);
if (!sk->fn) return(-4); if (!sk->fn) return(-4);
strcpy(sk->fn, skinfn);
return 0; return 0;
} }

View File

@ -550,7 +550,9 @@ nextdemo:
} }
if (foundemo == 0) // XXX: not better "demo is playing"? if (foundemo == 0) // XXX: not better "demo is playing"?
{
G_DrawBackground(); G_DrawBackground();
}
else else
{ {
static uint32_t nextrender = 0, framewaiting = 0; static uint32_t nextrender = 0, framewaiting = 0;