git-svn-id: https://svn.eduke32.com/eduke32@888 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2008-07-22 12:17:05 +00:00
parent 53bd9bc6a4
commit 0f607b70dd
4 changed files with 24 additions and 20 deletions

View file

@ -49,7 +49,8 @@ extern "C" {
#define GREENPAL (MAXPALOOKUPS - 7) #define GREENPAL (MAXPALOOKUPS - 7)
#define SPECPAL (MAXPALOOKUPS - 8) #define SPECPAL (MAXPALOOKUPS - 8)
#define STAT_NOCULL 99 #define TSPR_TEMP 99
#define TSPR_MIRROR 100
#define CLIPMASK0 (((1L)<<16)+1L) #define CLIPMASK0 (((1L)<<16)+1L)
#define CLIPMASK1 (((256L)<<16)+64L) #define CLIPMASK1 (((256L)<<16)+64L)

View file

@ -4422,7 +4422,7 @@ void polymost_drawmaskwall(int damaskwallcnt)
drawpoly(dpx,dpy,n,method); drawpoly(dpx,dpy,n,method);
} }
int lastcullcheck[MAXSPRITES]; // int lastcullcheck[MAXSPRITES];
char cullmodel[MAXSPRITES]; char cullmodel[MAXSPRITES];
int polymost_checkcoordinates(int x, int y, spritetype *tspr) int polymost_checkcoordinates(int x, int y, spritetype *tspr)
@ -4447,9 +4447,9 @@ int polymost_checkcoordinates(int x, int y, spritetype *tspr)
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
tspr->x+x, tspr->y+y, tspr->z-((tilesizy[tspr->picnum]*tspr->yrepeat)*i)-512, datempsectnum)) tspr->x+x, tspr->y+y, tspr->z-((tilesizy[tspr->picnum]*tspr->yrepeat)*i)-512, datempsectnum))
return 1; return 1;
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, /* if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
tspr->x+x, tspr->y+y, tspr->z+((tilesizy[tspr->picnum]*tspr->yrepeat)*i), datempsectnum)) tspr->x+x, tspr->y+y, tspr->z+((tilesizy[tspr->picnum]*tspr->yrepeat)*i), datempsectnum))
return 1; return 1; */
} }
return 0; return 0;
} }
@ -4508,15 +4508,18 @@ void polymost_drawsprite(int snum)
{ {
if (usemodels && tile2model[Ptile2tile(tspr->picnum,tspr->pal)].modelid >= 0 && tile2model[Ptile2tile(tspr->picnum,tspr->pal)].framenum >= 0) if (usemodels && tile2model[Ptile2tile(tspr->picnum,tspr->pal)].modelid >= 0 && tile2model[Ptile2tile(tspr->picnum,tspr->pal)].framenum >= 0)
{ {
if (tspr->owner < 0 || tspr->owner >= MAXSPRITES || tspr->statnum == TSPR_MIRROR)
{
if (mddraw(tspr)) return;
break; // else, render as flat sprite
}
if (r_cullobstructedmodels) if (r_cullobstructedmodels)
{ {
do // this is so gay do // this is so gay
{ {
if (totalclock < lastcullcheck[tspr->owner]) if (/*totalclock < lastcullcheck[tspr->owner] ||*/ tspr->statnum == TSPR_TEMP)
break; break;
cullmodel[tspr->owner] = 1; cullmodel[tspr->owner] = 1;
if (tspr->statnum == STAT_NOCULL)
{ cullmodel[tspr->owner] = 0; break; }
/* if (cansee(globalposx, globalposy, sector[globalcursectnum].ceilingz, globalcursectnum, /* if (cansee(globalposx, globalposy, sector[globalcursectnum].ceilingz, globalcursectnum,
tspr->x, tspr->y, tspr->z, tspr->sectnum)) tspr->x, tspr->y, tspr->z, tspr->sectnum))
{ cullmodel[tspr->owner] = 0; break; } { cullmodel[tspr->owner] = 0; break; }
@ -4558,8 +4561,8 @@ void polymost_drawsprite(int snum)
break; break;
} }
while (1); while (1);
if (totalclock >= lastcullcheck[tspr->owner]) /* if (totalclock >= lastcullcheck[tspr->owner])
lastcullcheck[tspr->owner] = totalclock + CULL_DELAY; lastcullcheck[tspr->owner] = totalclock + CULL_DELAY; */
} }
else cullmodel[tspr->owner] = 0; else cullmodel[tspr->owner] = 0;
if (cullmodel[tspr->owner]) break; if (cullmodel[tspr->owner]) break;

View file

@ -315,7 +315,7 @@ int gametext_z(int small, int starttile, int x,int y,const char *t,int s,int p,i
if (ac < starttile || ac > (starttile + 93)) break; if (ac < starttile || ac > (starttile + 93)) break;
if (*t >= '0' && *t <= '9') if (*t >= '0' && *t <= '9')
newx += (8-squishtext)*z/65536; newx += (8)*z/65536;
else newx += (tilesizx[ac]-squishtext)*z/65536; else newx += (tilesizx[ac]-squishtext)*z/65536;
t++; t++;
} }
@ -356,10 +356,10 @@ int gametext_z(int small, int starttile, int x,int y,const char *t,int s,int p,i
if (ac < starttile || ac > (starttile + 93)) if (ac < starttile || ac > (starttile + 93))
break; break;
rotatesprite(x<<16,(y<<16)+(small?ud.config.ScreenHeight<<15:0),z,0,ac,s,p,small?(8|16):(2|orientation),x1,y1,x2,y2); rotatesprite(x<<16,(y<<16)+((small&1)?ud.config.ScreenHeight<<15:0),z,0,ac,s,p,(small&1)?(8|16):(2|orientation),x1,y1,x2,y2);
if ((*t >= '0' && *t <= '9')) if ((*t >= '0' && *t <= '9'))
x += (8-squishtext)*z/65536; x += (8)*z/65536;
else x += (tilesizx[ac]-squishtext)*z/65536;//(tilesizx[ac]>>small); else x += (tilesizx[ac]-squishtext)*z/65536;//(tilesizx[ac]>>small);
if (x > (ud.config.ScreenWidth - 14)) oldt = (char *)t, x = oldx, y+=8*z/65536; if (x > (ud.config.ScreenWidth - 14)) oldt = (char *)t, x = oldx, y+=8*z/65536;
t++; t++;
@ -2706,7 +2706,7 @@ static int strget_(int small,int x,int y,char *t,int dalen,int c)
y += 8; y += 8;
} }
rotatesprite((x+(small?4:8))<<16,((y+(small?0:4))<<16)+(small?ud.config.ScreenHeight<<15:0),32768,0,SPINNINGNUKEICON+((totalclock>>3)%7),c,0,small?(8|16):2+8,0,0,xdim-1,ydim-1); rotatesprite((x+((small&1)?4:8))<<16,((y+((small&1)?0:4))<<16)+((small&1)?ud.config.ScreenHeight<<15:0),32768,0,SPINNINGNUKEICON+((totalclock>>3)%7),c,0,(small&1)?(8|16):2+8,0,0,xdim-1,ydim-1);
return (0); return (0);
} }
@ -6469,7 +6469,7 @@ void animatesprites(int x,int y,int a,int smoothratio)
} }
} }
if (t->statnum == STAT_NOCULL) continue; if (t->statnum == TSPR_TEMP) continue;
if (s->statnum != 1 && s->picnum == APLAYER && g_player[s->yvel].ps->newowner == -1 && s->owner >= 0) if (s->statnum != 1 && s->picnum == APLAYER && g_player[s->yvel].ps->newowner == -1 && s->owner >= 0)
{ {
t->x -= mulscale16(65536-smoothratio,g_player[s->yvel].ps->posx-g_player[s->yvel].ps->oposx); t->x -= mulscale16(65536-smoothratio,g_player[s->yvel].ps->posx-g_player[s->yvel].ps->oposx);
@ -6660,7 +6660,7 @@ void animatesprites(int x,int y,int a,int smoothratio)
{ {
memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype)); memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype));
tsprite[spritesortcnt].statnum = STAT_NOCULL; tsprite[spritesortcnt].statnum = TSPR_TEMP;
/* tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3); /* tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3);
if (t->yrepeat < 4) t->yrepeat = 4; */ if (t->yrepeat < 4) t->yrepeat = 4; */
@ -6692,7 +6692,7 @@ void animatesprites(int x,int y,int a,int smoothratio)
{ {
memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype)); memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype));
tsprite[spritesortcnt].statnum = STAT_NOCULL; tsprite[spritesortcnt].statnum = TSPR_TEMP;
tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3); tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3);
if (t->yrepeat < 4) t->yrepeat = 4; if (t->yrepeat < 4) t->yrepeat = 4;
@ -6911,7 +6911,7 @@ PALONLY:
} }
if (s->statnum == 13 || badguy(s) || checkspriteflags(t->owner,SPRITE_FLAG_SHADOW) || (s->picnum == APLAYER && s->owner >= 0)) if (s->statnum == 13 || badguy(s) || checkspriteflags(t->owner,SPRITE_FLAG_SHADOW) || (s->picnum == APLAYER && s->owner >= 0))
if (t->statnum != 99 && s->picnum != EXPLOSION2 && s->picnum != HANGLIGHT && s->picnum != DOMELITE) if (t->statnum != TSPR_TEMP && s->picnum != EXPLOSION2 && s->picnum != HANGLIGHT && s->picnum != DOMELITE)
if (s->picnum != HOTMEAT) if (s->picnum != HOTMEAT)
{ {
if (hittype[i].dispicnum < 0) if (hittype[i].dispicnum < 0)
@ -6933,7 +6933,7 @@ PALONLY:
{ {
memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype)); memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype));
tsprite[spritesortcnt].statnum = STAT_NOCULL; tsprite[spritesortcnt].statnum = TSPR_TEMP;
tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3); tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3);
if (t->yrepeat < 4) t->yrepeat = 4; if (t->yrepeat < 4) t->yrepeat = 4;
@ -7101,7 +7101,7 @@ PALONLY:
} }
for (j=0;j < spritesortcnt; j++) for (j=0;j < spritesortcnt; j++)
{ {
if (display_mirror) tsprite[j].statnum = STAT_NOCULL; if (display_mirror) tsprite[j].statnum = TSPR_MIRROR;
if (tsprite[j].owner > 0 && tsprite[j].owner < MAXSPRITES && spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS) if (tsprite[j].owner > 0 && tsprite[j].owner < MAXSPRITES && spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS)
{ {
OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1); OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1);

View file

@ -2549,7 +2549,7 @@ cheat_for_port_credits:
enabled = usemodels; enabled = usemodels;
if (enabled && x==io) r_animsmoothing = !r_animsmoothing; if (enabled && x==io) r_animsmoothing = !r_animsmoothing;
if (enabled) modval(0,1,(int *)&r_animsmoothing,1,probey==io); if (enabled) modval(0,1,(int *)&r_animsmoothing,1,probey==io);
mgametextpal(d,yy, r_animsmoothing && enabled ? "On" : "Off", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0); mgametextpal(d,yy, r_animsmoothing && enabled ? "Yes" : "No", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0);
break; break;
default: default:
break; break;