diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 83c3a2653..94f87c514 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -468,9 +468,7 @@ int movesprite(int spritenum, long xchange, long ychange, long zchange, unsigned { long daz,h, oldx, oldy; short retval, dasectnum, cd; - char bg; - - bg = badguy(&sprite[spritenum]); + int bg = badguy(&sprite[spritenum]); if (sprite[spritenum].statnum == 5 || (bg && sprite[spritenum].xrepeat < 4)) { diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 0a8929ad5..b4b09057e 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -1730,9 +1730,9 @@ static void Keys3d(void) } if (tabgraphic == 1) - rotatesprite((44+(tilesizx[temppicnum]>>2))<<16,(114)<<16,32768,0,temppicnum,tempshade,temppal,2,0L,0L,xdim-1L,ydim-1L); + rotatesprite((44+(tilesizx[temppicnum]>>3))<<16,(114)<<16,32768,0,temppicnum,tempshade,temppal,2,0L,0L,xdim-1L,ydim-1L); else if (tabgraphic == 2) - rotatesprite((44+(tilesizx[temppicnum]>>2))<<16,(114)<<16,16384,0,temppicnum,tempshade,temppal,2,0L,0L,xdim-1L,ydim-1L); + rotatesprite((44+(tilesizx[temppicnum]>>3))<<16,(114)<<16,16384,0,temppicnum,tempshade,temppal,2,0L,0L,xdim-1L,ydim-1L); begindrawing(); j = xdimgame>640?0:1; diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index 146b553d6..428994062 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -498,6 +498,15 @@ struct weaponhit { extern struct weaponhit hittype[MAXSPRITES]; +struct spriteinterpolate { + long x; + long y; + long z; + int ang; +}; + +extern struct spriteinterpolate sprpos[MAXSPRITES]; + extern input loc; extern input recsync[RECSYNCBUFSIZ]; extern long avgfvel, avgsvel, avgavel, avghorz, avgbits, avgextbits; diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index f327c6bf6..2d87e25fd 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -4247,6 +4247,11 @@ int EGS(int whatsect,long s_x,long s_y,long s_z,int s_pn,int s_s,int s_xr,int s_ actorspriteflags[i] = 0; + sprpos[i].x = sprite[i].x; + sprpos[i].y = sprite[i].y; + sprpos[i].z = sprite[i].z; + sprpos[i].ang = sprite[i].ang; + if (actorscrptr[s_pn]) { s->extra = *actorscrptr[s_pn]; @@ -4376,6 +4381,11 @@ int spawn(int j, int pn) actorspriteflags[i] = 0; + sprpos[i].x = sprite[i].x; + sprpos[i].y = sprite[i].y; + sprpos[i].z = sprite[i].z; + sprpos[i].ang = sprite[i].ang; + if (PN != SPEAKER && PN != LETTER && PN != DUCK && PN != TARGET && PN != TRIPBOMB && PN != VIEWSCREEN && PN != VIEWSCREEN2 && (CS&48)) if (!(PN >= CRACK1 && PN <= CRACK4)) { @@ -6221,6 +6231,16 @@ void animatesprites(long x,long y,int a,long smoothratio) t = &tsprite[j]; i = t->owner; s = &sprite[t->owner]; + +/* + t->x = sprpos[i].x+mulscale16((long)(s->x-sprpos[i].x),smoothratio); + t->y = sprpos[i].y+mulscale16((long)(s->y-sprpos[i].y),smoothratio); + t->z = sprpos[i].z+mulscale16((long)(s->z-sprpos[i].z),smoothratio); + + sprpos[i].x = s->x; + sprpos[i].y = s->y; + sprpos[i].z = s->z; +*/ //greenslime can't be handled through the dynamictostatic system due to addition on constant if ((t->picnum >= GREENSLIME)&&(t->picnum <= GREENSLIME+7)) {} diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 28b2391a8..8d000eabd 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -3256,6 +3256,8 @@ static void move(void) goalang = getangle(ps[g_p].oposx-g_sp->x,ps[g_p].oposy-g_sp->y); else goalang = getangle(ps[g_p].posx-g_sp->x,ps[g_p].posy-g_sp->y); angdif = getincangle(g_sp->ang,goalang)>>2; + if ((angdif > -8 && angdif < 0) || (angdif < 8 && angdif > 0)) + angdif *= 2; g_sp->ang += angdif; } @@ -3268,6 +3270,8 @@ static void move(void) goalang = getangle(ps[g_p].oposx-g_sp->x,ps[g_p].oposy-g_sp->y); else goalang = getangle(ps[g_p].posx-g_sp->x,ps[g_p].posy-g_sp->y); angdif = getincangle(g_sp->ang,goalang)>>4; + if ((angdif > -8 && angdif < 0) || (angdif < 8 && angdif > 0)) + angdif *= 2; g_sp->ang += angdif; } @@ -3284,6 +3288,8 @@ static void move(void) goalang = getangle(newx-g_sp->x,newy-g_sp->y); angdif = getincangle(g_sp->ang,goalang)>>2; + if ((angdif > -8 && angdif < 0) || (angdif < 8 && angdif > 0)) + angdif *= 2; g_sp->ang += angdif; } diff --git a/polymer/eduke32/source/global.c b/polymer/eduke32/source/global.c index 70d928ad2..4e3e44ef7 100644 --- a/polymer/eduke32/source/global.c +++ b/polymer/eduke32/source/global.c @@ -34,6 +34,8 @@ long gc=176; // long temp_data[MAXSPRITES][6]; struct weaponhit hittype[MAXSPRITES]; +struct spriteinterpolate sprpos[MAXSPRITES]; + short spriteq[1024],spriteqloc,spriteqamount=64; struct animwalltype animwall[MAXANIMWALLS]; short numanimwalls;