From 0f607b70dd6b7e5d3375429d160173db21ae704d Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 22 Jul 2008 12:17:05 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@888 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/include/build.h | 3 ++- polymer/build/src/polymost.c | 19 +++++++++++-------- polymer/eduke32/source/game.c | 20 ++++++++++---------- polymer/eduke32/source/menus.c | 2 +- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/polymer/build/include/build.h b/polymer/build/include/build.h index 52a0df519..64b3f488f 100644 --- a/polymer/build/include/build.h +++ b/polymer/build/include/build.h @@ -49,7 +49,8 @@ extern "C" { #define GREENPAL (MAXPALOOKUPS - 7) #define SPECPAL (MAXPALOOKUPS - 8) -#define STAT_NOCULL 99 +#define TSPR_TEMP 99 +#define TSPR_MIRROR 100 #define CLIPMASK0 (((1L)<<16)+1L) #define CLIPMASK1 (((256L)<<16)+64L) diff --git a/polymer/build/src/polymost.c b/polymer/build/src/polymost.c index bb9fab04b..9d4b810a6 100644 --- a/polymer/build/src/polymost.c +++ b/polymer/build/src/polymost.c @@ -4422,7 +4422,7 @@ void polymost_drawmaskwall(int damaskwallcnt) drawpoly(dpx,dpy,n,method); } -int lastcullcheck[MAXSPRITES]; +// int lastcullcheck[MAXSPRITES]; char cullmodel[MAXSPRITES]; 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, tspr->x+x, tspr->y+y, tspr->z-((tilesizy[tspr->picnum]*tspr->yrepeat)*i)-512, datempsectnum)) 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)) - return 1; + return 1; */ } 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 (tspr->owner < 0 || tspr->owner >= MAXSPRITES || tspr->statnum == TSPR_MIRROR) + { + if (mddraw(tspr)) return; + break; // else, render as flat sprite + } if (r_cullobstructedmodels) { do // this is so gay { - if (totalclock < lastcullcheck[tspr->owner]) + if (/*totalclock < lastcullcheck[tspr->owner] ||*/ tspr->statnum == TSPR_TEMP) break; cullmodel[tspr->owner] = 1; - if (tspr->statnum == STAT_NOCULL) - { cullmodel[tspr->owner] = 0; break; } /* if (cansee(globalposx, globalposy, sector[globalcursectnum].ceilingz, globalcursectnum, tspr->x, tspr->y, tspr->z, tspr->sectnum)) { cullmodel[tspr->owner] = 0; break; } @@ -4558,8 +4561,8 @@ void polymost_drawsprite(int snum) break; } while (1); - if (totalclock >= lastcullcheck[tspr->owner]) - lastcullcheck[tspr->owner] = totalclock + CULL_DELAY; +/* if (totalclock >= lastcullcheck[tspr->owner]) + lastcullcheck[tspr->owner] = totalclock + CULL_DELAY; */ } else cullmodel[tspr->owner] = 0; if (cullmodel[tspr->owner]) break; diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 99f37519e..654d727b8 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -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 (*t >= '0' && *t <= '9') - newx += (8-squishtext)*z/65536; + newx += (8)*z/65536; else newx += (tilesizx[ac]-squishtext)*z/65536; 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)) 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')) - x += (8-squishtext)*z/65536; + x += (8)*z/65536; 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; t++; @@ -2706,7 +2706,7 @@ static int strget_(int small,int x,int y,char *t,int dalen,int c) 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); } @@ -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) { 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)); - tsprite[spritesortcnt].statnum = STAT_NOCULL; + tsprite[spritesortcnt].statnum = TSPR_TEMP; /* tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3); 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)); - tsprite[spritesortcnt].statnum = STAT_NOCULL; + tsprite[spritesortcnt].statnum = TSPR_TEMP; tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3); 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 (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 (hittype[i].dispicnum < 0) @@ -6933,7 +6933,7 @@ PALONLY: { memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype)); - tsprite[spritesortcnt].statnum = STAT_NOCULL; + tsprite[spritesortcnt].statnum = TSPR_TEMP; tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3); if (t->yrepeat < 4) t->yrepeat = 4; @@ -7101,7 +7101,7 @@ PALONLY: } 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) { OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1); diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index 9c60d477e..504fde528 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -2549,7 +2549,7 @@ cheat_for_port_credits: enabled = usemodels; if (enabled && x==io) r_animsmoothing = !r_animsmoothing; 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; default: break;