- tabified animatesprites_d.cpp and animatesprites_r.cpp.

This commit is contained in:
Christoph Oelckers 2020-10-13 21:44:05 +02:00
parent 99b4a64a67
commit f0ef7a1322
2 changed files with 1523 additions and 1521 deletions

View file

@ -42,25 +42,25 @@ EXTERN_CVAR(Bool, wt_commentary)
BEGIN_DUKE_NS BEGIN_DUKE_NS
void animatesprites_d(int x,int y,int a,int smoothratio) void animatesprites_d(int x, int y, int a, int smoothratio)
{ {
int i, j, k, p; int i, j, k, p;
short sect; short sect;
int l, t1,t3,t4; int l, t1, t3, t4;
spritetype *s; spritetype* s;
tspritetype *t; tspritetype* t;
for(j=0;j < spritesortcnt; j++) for (j = 0; j < spritesortcnt; j++)
{ {
t = &tsprite[j]; t = &tsprite[j];
i = t->owner; i = t->owner;
s = &sprite[t->owner]; s = &sprite[t->owner];
switch(t->picnum) switch (t->picnum)
{ {
case DEVELOPERCOMMENTARY: case DEVELOPERCOMMENTARY:
case DEVELOPERCOMMENTARY + 1: case DEVELOPERCOMMENTARY + 1:
if(isWorldTour() && !wt_commentary) if (isWorldTour() && !wt_commentary)
t->xrepeat = t->yrepeat = 0; t->xrepeat = t->yrepeat = 0;
break; break;
case BLOODPOOL: case BLOODPOOL:
@ -69,12 +69,12 @@ void animatesprites_d(int x,int y,int a,int smoothratio)
case FOOTPRINTS2: case FOOTPRINTS2:
case FOOTPRINTS3: case FOOTPRINTS3:
case FOOTPRINTS4: case FOOTPRINTS4:
if(t->shade == 127) continue; if (t->shade == 127) continue;
break; break;
case RESPAWNMARKERRED: case RESPAWNMARKERRED:
case RESPAWNMARKERYELLOW: case RESPAWNMARKERYELLOW:
case RESPAWNMARKERGREEN: case RESPAWNMARKERGREEN:
if(ud.marker == 0) if (ud.marker == 0)
t->xrepeat = t->yrepeat = 0; t->xrepeat = t->yrepeat = 0;
continue; continue;
case CHAIR3: case CHAIR3:
@ -85,20 +85,20 @@ void animatesprites_d(int x,int y,int a,int smoothratio)
} }
*/ */
k = (((t->ang+3072+128-a)&2047)>>8)&7; k = (((t->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
if(k>4) if (k > 4)
{ {
k = 8-k; k = 8 - k;
t->cstat |= 4; t->cstat |= 4;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
t->picnum = s->picnum+k; t->picnum = s->picnum + k;
break; break;
case BLOODSPLAT1: case BLOODSPLAT1:
case BLOODSPLAT2: case BLOODSPLAT2:
case BLOODSPLAT3: case BLOODSPLAT3:
case BLOODSPLAT4: case BLOODSPLAT4:
if(t->pal == 6) if (t->pal == 6)
{ {
t->shade = -127; t->shade = -127;
continue; continue;
@ -118,42 +118,42 @@ void animatesprites_d(int x,int y,int a,int smoothratio)
case NEON6: case NEON6:
continue; continue;
case GREENSLIME: case GREENSLIME:
case GREENSLIME+1: case GREENSLIME + 1:
case GREENSLIME+2: case GREENSLIME + 2:
case GREENSLIME+3: case GREENSLIME + 3:
case GREENSLIME+4: case GREENSLIME + 4:
case GREENSLIME+5: case GREENSLIME + 5:
case GREENSLIME+6: case GREENSLIME + 6:
case GREENSLIME+7: case GREENSLIME + 7:
break; break;
default: default:
if( ( (t->cstat&16) ) || ( badguy(t) && t->extra > 0) || t->statnum == 10) if (((t->cstat & 16)) || (badguy(t) && t->extra > 0) || t->statnum == 10)
continue; continue;
} }
if (sector[t->sectnum].ceilingstat&1) if (sector[t->sectnum].ceilingstat & 1)
l = sector[t->sectnum].ceilingshade; l = sector[t->sectnum].ceilingshade;
else else
l = sector[t->sectnum].floorshade; l = sector[t->sectnum].floorshade;
if(l < -127) l = -127; if (l < -127) l = -127;
if(l > 128) l = 127; if (l > 128) l = 127;
t->shade = l; t->shade = l;
} }
for(j=0;j < spritesortcnt; j++ ) //Between drawrooms() and drawmasks() for (j = 0; j < spritesortcnt; j++) //Between drawrooms() and drawmasks()
{ //is the perfect time to animate sprites { //is the perfect time to animate sprites
t = &tsprite[j]; t = &tsprite[j];
i = t->owner; i = t->owner;
s = &sprite[i]; s = &sprite[i];
switch(s->picnum) switch (s->picnum)
{ {
case SECTOREFFECTOR: case SECTOREFFECTOR:
if(t->lotag == 27 && ud.recstat == 1) if (t->lotag == 27 && ud.recstat == 1)
{ {
t->picnum = 11+((ud.levelclock>>3)&1); t->picnum = 11 + ((ud.levelclock >> 3) & 1);
t->cstat |= 128; t->cstat |= 128;
} }
else else
@ -167,19 +167,19 @@ void animatesprites_d(int x,int y,int a,int smoothratio)
break; break;
} }
if( t->statnum == 99 ) continue; if (t->statnum == 99) continue;
if( s->statnum != STAT_ACTOR && s->picnum == APLAYER && ps[s->yvel].newowner == -1 && s->owner >= 0 ) if (s->statnum != STAT_ACTOR && s->picnum == APLAYER && ps[s->yvel].newowner == -1 && s->owner >= 0)
{ {
t->x -= mulscale16(MaxSmoothRatio-smoothratio,ps[s->yvel].posx-ps[s->yvel].oposx); t->x -= mulscale16(MaxSmoothRatio - smoothratio, ps[s->yvel].posx - ps[s->yvel].oposx);
t->y -= mulscale16(MaxSmoothRatio-smoothratio,ps[s->yvel].posy-ps[s->yvel].oposy); t->y -= mulscale16(MaxSmoothRatio - smoothratio, ps[s->yvel].posy - ps[s->yvel].oposy);
t->z = ps[s->yvel].oposz + mulscale16(smoothratio,ps[s->yvel].posz-ps[s->yvel].oposz); t->z = ps[s->yvel].oposz + mulscale16(smoothratio, ps[s->yvel].posz - ps[s->yvel].oposz);
t->z += (40<<8); t->z += (40 << 8);
} }
else if(s->picnum != CRANEPOLE) else if (s->picnum != CRANEPOLE)
{ {
t->x -= mulscale16(MaxSmoothRatio-smoothratio,s->x-hittype[i].bposx); t->x -= mulscale16(MaxSmoothRatio - smoothratio, s->x - hittype[i].bposx);
t->y -= mulscale16(MaxSmoothRatio-smoothratio,s->y-hittype[i].bposy); t->y -= mulscale16(MaxSmoothRatio - smoothratio, s->y - hittype[i].bposy);
t->z -= mulscale16(MaxSmoothRatio-smoothratio,s->z-hittype[i].bposz); t->z -= mulscale16(MaxSmoothRatio - smoothratio, s->z - hittype[i].bposz);
} }
sect = s->sectnum; sect = s->sectnum;
@ -187,76 +187,76 @@ void animatesprites_d(int x,int y,int a,int smoothratio)
t3 = hittype[i].temp_data[3]; t3 = hittype[i].temp_data[3];
t4 = hittype[i].temp_data[4]; t4 = hittype[i].temp_data[4];
switch(s->picnum) switch (s->picnum)
{ {
case DUKELYINGDEAD: case DUKELYINGDEAD:
t->z += (24<<8); t->z += (24 << 8);
break; break;
case BLOODPOOL: case BLOODPOOL:
case FOOTPRINTS: case FOOTPRINTS:
case FOOTPRINTS2: case FOOTPRINTS2:
case FOOTPRINTS3: case FOOTPRINTS3:
case FOOTPRINTS4: case FOOTPRINTS4:
if(t->pal == 6) if (t->pal == 6)
t->shade = -127; t->shade = -127;
case PUKE: case PUKE:
case MONEY: case MONEY:
case MONEY+1: case MONEY + 1:
case MAIL: case MAIL:
case MAIL+1: case MAIL + 1:
case PAPER: case PAPER:
case PAPER+1: case PAPER + 1:
break; break;
case TRIPBOMB: case TRIPBOMB:
continue; continue;
case FORCESPHERE: case FORCESPHERE:
if(t->statnum == 5) if (t->statnum == 5)
{ {
short sqa,sqb; short sqa, sqb;
sqa = sqa =
getangle( getangle(
sprite[s->owner].x-ps[screenpeek].posx, sprite[s->owner].x - ps[screenpeek].posx,
sprite[s->owner].y-ps[screenpeek].posy); sprite[s->owner].y - ps[screenpeek].posy);
sqb = sqb =
getangle( getangle(
sprite[s->owner].x-t->x, sprite[s->owner].x - t->x,
sprite[s->owner].y-t->y); sprite[s->owner].y - t->y);
if( abs(getincangle(sqa,sqb)) > 512 ) if (abs(getincangle(sqa, sqb)) > 512)
if( ldist(&sprite[s->owner],t) < ldist(&sprite[ps[screenpeek].i],&sprite[s->owner]) ) if (ldist(&sprite[s->owner], t) < ldist(&sprite[ps[screenpeek].i], &sprite[s->owner]))
t->xrepeat = t->yrepeat = 0; t->xrepeat = t->yrepeat = 0;
} }
continue; continue;
case BURNING: case BURNING:
case BURNING2: case BURNING2:
if( sprite[s->owner].statnum == 10 ) if (sprite[s->owner].statnum == 10)
{ {
if( display_mirror == 0 && sprite[s->owner].yvel == screenpeek && ps[sprite[s->owner].yvel].over_shoulder_on == 0 ) if (display_mirror == 0 && sprite[s->owner].yvel == screenpeek && ps[sprite[s->owner].yvel].over_shoulder_on == 0)
t->xrepeat = 0; t->xrepeat = 0;
else else
{ {
t->ang = getangle(x-t->x,y-t->y); t->ang = getangle(x - t->x, y - t->y);
t->x = sprite[s->owner].x; t->x = sprite[s->owner].x;
t->y = sprite[s->owner].y; t->y = sprite[s->owner].y;
t->x += sintable[(t->ang+512)&2047]>>10; t->x += sintable[(t->ang + 512) & 2047] >> 10;
t->y += sintable[t->ang&2047]>>10; t->y += sintable[t->ang & 2047] >> 10;
} }
} }
break; break;
case ATOMICHEALTH: case ATOMICHEALTH:
t->z -= (4<<8); t->z -= (4 << 8);
break; break;
case CRYSTALAMMO: case CRYSTALAMMO:
t->shade = (sintable[(ud.levelclock<<4)&2047]>>10); t->shade = (sintable[(ud.levelclock << 4) & 2047] >> 10);
continue; continue;
case VIEWSCREEN: case VIEWSCREEN:
case VIEWSCREEN2: case VIEWSCREEN2:
if(camsprite >= 0 && hittype[sprite[i].owner].temp_data[0] == 1) if (camsprite >= 0 && hittype[sprite[i].owner].temp_data[0] == 1)
{ {
t->picnum = STATIC; t->picnum = STATIC;
t->cstat |= (rand()&12); t->cstat |= (rand() & 12);
t->xrepeat += 8; t->xrepeat += 8;
t->yrepeat += 8; t->yrepeat += 8;
} }
@ -267,10 +267,10 @@ void animatesprites_d(int x,int y,int a,int smoothratio)
break; break;
case SHRINKSPARK: case SHRINKSPARK:
t->picnum = SHRINKSPARK+( (ud.levelclock>>4)&3 ); t->picnum = SHRINKSPARK + ((ud.levelclock >> 4) & 3);
break; break;
case GROWSPARK: case GROWSPARK:
t->picnum = GROWSPARK+( (ud.levelclock>>4)&3 ); t->picnum = GROWSPARK + ((ud.levelclock >> 4) & 3);
break; break;
case RPG: case RPG:
/*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) { /*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) {
@ -278,15 +278,15 @@ void animatesprites_d(int x,int y,int a,int smoothratio)
break; break;
}*/ }*/
k = getangle(s->x-x,s->y-y); k = getangle(s->x - x, s->y - y);
k = (((s->ang+3072+128-k)&2047)/170); k = (((s->ang + 3072 + 128 - k) & 2047) / 170);
if(k > 6) if (k > 6)
{ {
k = 12-k; k = 12 - k;
t->cstat |= 4; t->cstat |= 4;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
t->picnum = RPG+k; t->picnum = RPG + k;
break; break;
case RECON: case RECON:
@ -295,20 +295,20 @@ void animatesprites_d(int x,int y,int a,int smoothratio)
break; break;
}*/ }*/
k = getangle(s->x-x,s->y-y); k = getangle(s->x - x, s->y - y);
if( hittype[i].temp_data[0] < 4 ) if (hittype[i].temp_data[0] < 4)
k = (((s->ang+3072+128-k)&2047)/170); k = (((s->ang + 3072 + 128 - k) & 2047) / 170);
else k = (((s->ang+3072+128-k)&2047)/170); else k = (((s->ang + 3072 + 128 - k) & 2047) / 170);
if(k>6) if (k > 6)
{ {
k = 12-k; k = 12 - k;
t->cstat |= 4; t->cstat |= 4;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
if( abs(t3) > 64 ) k += 7; if (abs(t3) > 64) k += 7;
t->picnum = RECON+k; t->picnum = RECON + k;
break; break;
@ -316,12 +316,12 @@ void animatesprites_d(int x,int y,int a,int smoothratio)
p = s->yvel; p = s->yvel;
if(t->pal == 1) t->z -= (18<<8); if (t->pal == 1) t->z -= (18 << 8);
if(ps[p].over_shoulder_on > 0 && ps[p].newowner < 0 ) if (ps[p].over_shoulder_on > 0 && ps[p].newowner < 0)
{ {
t->cstat |= 2; t->cstat |= 2;
if ( screenpeek == myconnectindex && numplayers >= 2 ) if (screenpeek == myconnectindex && numplayers >= 2)
{ {
t->x = omyx + mulscale16((int)(myx - omyx), smoothratio); t->x = omyx + mulscale16((int)(myx - omyx), smoothratio);
t->y = omyy + mulscale16((int)(myy - omyy), smoothratio); t->y = omyy + mulscale16((int)(myy - omyy), smoothratio);
@ -331,70 +331,71 @@ void animatesprites_d(int x,int y,int a,int smoothratio)
} }
} }
if( ( display_mirror == 1 || screenpeek != p || s->owner == -1 ) && ud.multimode > 1 && ud.showweapons && sprite[ps[p].i].extra > 0 && ps[p].curr_weapon > 0 ) if ((display_mirror == 1 || screenpeek != p || s->owner == -1) && ud.multimode > 1 && ud.showweapons && sprite[ps[p].i].extra > 0 && ps[p].curr_weapon > 0)
{ {
memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype)); auto newtspr = &tsprite[spritesortcnt];
memcpy(newtspr, t, sizeof(spritetype));
tsprite[spritesortcnt].statnum = 99; newtspr->statnum = 99;
tsprite[spritesortcnt].yrepeat = ( t->yrepeat>>3 ); newtspr->yrepeat = (t->yrepeat >> 3);
if(t->yrepeat < 4) t->yrepeat = 4; if (t->yrepeat < 4) t->yrepeat = 4;
tsprite[spritesortcnt].shade = t->shade; newtspr->shade = t->shade;
tsprite[spritesortcnt].cstat = 0; newtspr->cstat = 0;
switch(ps[p].curr_weapon) switch (ps[p].curr_weapon)
{ {
case PISTOL_WEAPON: tsprite[spritesortcnt].picnum = FIRSTGUNSPRITE; break; case PISTOL_WEAPON: newtspr->picnum = FIRSTGUNSPRITE; break;
case SHOTGUN_WEAPON: tsprite[spritesortcnt].picnum = SHOTGUNSPRITE; break; case SHOTGUN_WEAPON: newtspr->picnum = SHOTGUNSPRITE; break;
case CHAINGUN_WEAPON: tsprite[spritesortcnt].picnum = CHAINGUNSPRITE; break; case CHAINGUN_WEAPON: newtspr->picnum = CHAINGUNSPRITE; break;
case RPG_WEAPON: tsprite[spritesortcnt].picnum = RPGSPRITE; break; case RPG_WEAPON: newtspr->picnum = RPGSPRITE; break;
case HANDREMOTE_WEAPON: case HANDREMOTE_WEAPON:
case HANDBOMB_WEAPON: tsprite[spritesortcnt].picnum = HEAVYHBOMB; break; case HANDBOMB_WEAPON: newtspr->picnum = HEAVYHBOMB; break;
case TRIPBOMB_WEAPON: tsprite[spritesortcnt].picnum = TRIPBOMBSPRITE; break; case TRIPBOMB_WEAPON: newtspr->picnum = TRIPBOMBSPRITE; break;
case GROW_WEAPON: tsprite[spritesortcnt].picnum = GROWSPRITEICON; break; case GROW_WEAPON: newtspr->picnum = GROWSPRITEICON; break;
case SHRINKER_WEAPON: tsprite[spritesortcnt].picnum = SHRINKERSPRITE; break; case SHRINKER_WEAPON: newtspr->picnum = SHRINKERSPRITE; break;
case FREEZE_WEAPON: tsprite[spritesortcnt].picnum = FREEZESPRITE; break; case FREEZE_WEAPON: newtspr->picnum = FREEZESPRITE; break;
case FLAMETHROWER_WEAPON: //Twentieth Anniversary World Tour case FLAMETHROWER_WEAPON: //Twentieth Anniversary World Tour
if(isWorldTour()) if (isWorldTour())
tsprite[spritesortcnt].picnum = FLAMETHROWERSPRITE; break; newtspr->picnum = FLAMETHROWERSPRITE; break;
case DEVISTATOR_WEAPON: tsprite[spritesortcnt].picnum = DEVISTATORSPRITE; break; case DEVISTATOR_WEAPON: newtspr->picnum = DEVISTATORSPRITE; break;
} }
if(s->owner >= 0) if (s->owner >= 0)
tsprite[spritesortcnt].z = ps[p].posz-(12<<8); newtspr->z = ps[p].posz - (12 << 8);
else tsprite[spritesortcnt].z = s->z-(51<<8); else newtspr->z = s->z - (51 << 8);
if(ps[p].curr_weapon == HANDBOMB_WEAPON) if (ps[p].curr_weapon == HANDBOMB_WEAPON)
{ {
tsprite[spritesortcnt].xrepeat = 10; newtspr->xrepeat = 10;
tsprite[spritesortcnt].yrepeat = 10; newtspr->yrepeat = 10;
} }
else else
{ {
tsprite[spritesortcnt].xrepeat = 16; newtspr->xrepeat = 16;
tsprite[spritesortcnt].yrepeat = 16; newtspr->yrepeat = 16;
} }
tsprite[spritesortcnt].pal = 0; newtspr->pal = 0;
spritesortcnt++; spritesortcnt++;
} }
if(s->owner == -1) if (s->owner == -1)
{ {
/*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) { /*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) {
k = 0; k = 0;
t->cstat &= ~4; t->cstat &= ~4;
} else*/ { } else*/ {
k = (((s->ang+3072+128-a)&2047)>>8)&7; k = (((s->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
if(k>4) if (k > 4)
{ {
k = 8-k; k = 8 - k;
t->cstat |= 4; t->cstat |= 4;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
} }
if(sector[t->sectnum].lotag == 2) k += 1795-1405; if (sector[t->sectnum].lotag == 2) k += 1795 - 1405;
else if( (hittype[i].floorz-s->z) > (64<<8) ) k += 60; else if ((hittype[i].floorz - s->z) > (64 << 8)) k += 60;
t->picnum += k; t->picnum += k;
t->pal = ps[p].palookup; t->pal = ps[p].palookup;
@ -402,24 +403,24 @@ void animatesprites_d(int x,int y,int a,int smoothratio)
goto PALONLY; goto PALONLY;
} }
if( ps[p].on_crane == -1 && (sector[s->sectnum].lotag&0x7ff) != 1 ) if (ps[p].on_crane == -1 && (sector[s->sectnum].lotag & 0x7ff) != 1)
{ {
l = s->z-hittype[ps[p].i].floorz+(3<<8); l = s->z - hittype[ps[p].i].floorz + (3 << 8);
if( l > 1024 && s->yrepeat > 32 && s->extra > 0 ) if (l > 1024 && s->yrepeat > 32 && s->extra > 0)
s->yoffset = (signed char)(l/(s->yrepeat<<2)); s->yoffset = (signed char)(l / (s->yrepeat << 2));
else s->yoffset=0; else s->yoffset = 0;
} }
if(ps[p].newowner > -1) if (ps[p].newowner > -1)
{ {
t4 = ScriptCode[actorinfo[APLAYER].scriptaddress + 1]; t4 = ScriptCode[actorinfo[APLAYER].scriptaddress + 1];
t3 = 0; t3 = 0;
t1 = ScriptCode[actorinfo[APLAYER].scriptaddress + 2]; t1 = ScriptCode[actorinfo[APLAYER].scriptaddress + 2];
} }
if(ud.camerasprite == -1 && ps[p].newowner == -1) if (ud.camerasprite == -1 && ps[p].newowner == -1)
if(s->owner >= 0 && display_mirror == 0 && ps[p].over_shoulder_on == 0 ) if (s->owner >= 0 && display_mirror == 0 && ps[p].over_shoulder_on == 0)
if( ud.multimode < 2 || ( ud.multimode > 1 && p == screenpeek ) ) if (ud.multimode < 2 || (ud.multimode > 1 && p == screenpeek))
{ {
t->owner = -1; t->owner = -1;
t->xrepeat = t->yrepeat = 0; t->xrepeat = t->yrepeat = 0;
@ -428,12 +429,12 @@ void animatesprites_d(int x,int y,int a,int smoothratio)
PALONLY: PALONLY:
if( sector[sect].floorpal ) if (sector[sect].floorpal)
t->pal = sector[sect].floorpal; t->pal = sector[sect].floorpal;
if(s->owner == -1) continue; if (s->owner == -1) continue;
if( t->z > hittype[i].floorz && t->xrepeat < 32 ) if (t->z > hittype[i].floorz && t->xrepeat < 32)
t->z = hittype[i].floorz; t->z = hittype[i].floorz;
break; break;
@ -453,7 +454,7 @@ void animatesprites_d(int x,int y,int a,int smoothratio)
case DUKELEG: case DUKELEG:
case DUKEGUN: case DUKEGUN:
case DUKETORSO: case DUKETORSO:
if(t->pal == 6) t->shade = -120; if (t->pal == 6) t->shade = -120;
case SCRAP1: case SCRAP1:
case SCRAP2: case SCRAP2:
@ -461,83 +462,83 @@ void animatesprites_d(int x,int y,int a,int smoothratio)
case SCRAP4: case SCRAP4:
case SCRAP5: case SCRAP5:
case SCRAP6: case SCRAP6:
case SCRAP6+1: case SCRAP6 + 1:
case SCRAP6+2: case SCRAP6 + 2:
case SCRAP6+3: case SCRAP6 + 3:
case SCRAP6+4: case SCRAP6 + 4:
case SCRAP6+5: case SCRAP6 + 5:
case SCRAP6+6: case SCRAP6 + 6:
case SCRAP6+7: case SCRAP6 + 7:
if(hittype[i].picnum == BLIMP && t->picnum == SCRAP1 && s->yvel >= 0) if (hittype[i].picnum == BLIMP && t->picnum == SCRAP1 && s->yvel >= 0)
t->picnum = s->yvel; t->picnum = s->yvel;
else t->picnum += hittype[i].temp_data[0]; else t->picnum += hittype[i].temp_data[0];
t->shade -= 6; t->shade -= 6;
if( sector[sect].floorpal ) if (sector[sect].floorpal)
t->pal = sector[sect].floorpal; t->pal = sector[sect].floorpal;
break; break;
case WATERBUBBLE: case WATERBUBBLE:
if(sector[t->sectnum].floorpicnum == FLOORSLIME) if (sector[t->sectnum].floorpicnum == FLOORSLIME)
{ {
t->pal = 7; t->pal = 7;
break; break;
} }
default: default:
if( sector[sect].floorpal ) if (sector[sect].floorpal)
t->pal = sector[sect].floorpal; t->pal = sector[sect].floorpal;
break; break;
} }
if (actorinfo[s->picnum].scriptaddress) if (actorinfo[s->picnum].scriptaddress)
{ {
if(t4) if (t4)
{ {
l = ScriptCode[t4 + 2]; l = ScriptCode[t4 + 2];
/*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) { /*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) {
k = 0; k = 0;
t->cstat &= ~4; t->cstat &= ~4;
} else*/ switch( l ) { } else*/ switch (l) {
case 2: case 2:
k = (((s->ang+3072+128-a)&2047)>>8)&1; k = (((s->ang + 3072 + 128 - a) & 2047) >> 8) & 1;
break; break;
case 3: case 3:
case 4: case 4:
k = (((s->ang+3072+128-a)&2047)>>7)&7; k = (((s->ang + 3072 + 128 - a) & 2047) >> 7) & 7;
if(k > 3) if (k > 3)
{ {
t->cstat |= 4; t->cstat |= 4;
k = 7-k; k = 7 - k;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
break; break;
case 5: case 5:
k = getangle(s->x-x,s->y-y); k = getangle(s->x - x, s->y - y);
k = (((s->ang+3072+128-k)&2047)>>8)&7; k = (((s->ang + 3072 + 128 - k) & 2047) >> 8) & 7;
if(k>4) if (k > 4)
{ {
k = 8-k; k = 8 - k;
t->cstat |= 4; t->cstat |= 4;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
break; break;
case 7: case 7:
k = getangle(s->x-x,s->y-y); k = getangle(s->x - x, s->y - y);
k = (((s->ang+3072+128-k)&2047)/170); k = (((s->ang + 3072 + 128 - k) & 2047) / 170);
if(k>6) if (k > 6)
{ {
k = 12-k; k = 12 - k;
t->cstat |= 4; t->cstat |= 4;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
break; break;
case 8: case 8:
k = (((s->ang+3072+128-a)&2047)>>8)&7; k = (((s->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
t->cstat &= ~4; t->cstat &= ~4;
break; break;
default: default:
@ -551,18 +552,18 @@ void animatesprites_d(int x,int y,int a,int smoothratio)
while (!tileGetTexture(t->picnum)->isValid() && t->picnum > 0) while (!tileGetTexture(t->picnum)->isValid() && t->picnum > 0)
t->picnum -= l; //Hack, for actors t->picnum -= l; //Hack, for actors
if( hittype[i].dispicnum >= 0) if (hittype[i].dispicnum >= 0)
hittype[i].dispicnum = t->picnum; hittype[i].dispicnum = t->picnum;
} }
else if(display_mirror == 1) else if (display_mirror == 1)
t->cstat |= 4; t->cstat |= 4;
} }
if( s->statnum == STAT_DUMMYPLAYER || badguy(s) || (s->picnum == APLAYER && s->owner >= 0) ) if (s->statnum == STAT_DUMMYPLAYER || badguy(s) || (s->picnum == APLAYER && s->owner >= 0))
if(t->statnum != 99 && s->picnum != EXPLOSION2 && s->picnum != HANGLIGHT && s->picnum != DOMELITE) if (t->statnum != 99 && 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)
{ {
hittype[i].dispicnum++; hittype[i].dispicnum++;
continue; continue;
@ -616,7 +617,7 @@ void animatesprites_d(int x,int y,int a,int smoothratio)
} }
} }
if( ps[screenpeek].heat_amount > 0 && ps[screenpeek].heat_on ) if (ps[screenpeek].heat_amount > 0 && ps[screenpeek].heat_on)
{ {
t->pal = 6; t->pal = 6;
t->shade = 0; t->shade = 0;
@ -624,12 +625,12 @@ void animatesprites_d(int x,int y,int a,int smoothratio)
} }
switch(s->picnum) switch (s->picnum)
{ {
case LASERLINE: case LASERLINE:
if(sector[t->sectnum].lotag == 2) t->pal = 8; if (sector[t->sectnum].lotag == 2) t->pal = 8;
t->z = sprite[s->owner].z-(3<<8); t->z = sprite[s->owner].z - (3 << 8);
if(lasermode == 2 && ps[screenpeek].heat_on == 0 ) if (lasermode == 2 && ps[screenpeek].heat_on == 0)
t->yrepeat = 0; t->yrepeat = 0;
case EXPLOSION2: case EXPLOSION2:
case EXPLOSION2BOT: case EXPLOSION2BOT:
@ -642,10 +643,10 @@ void animatesprites_d(int x,int y,int a,int smoothratio)
case SHRINKEREXPLOSION: case SHRINKEREXPLOSION:
case RPG: case RPG:
case FLOORFLAME: case FLOORFLAME:
if(t->picnum == EXPLOSION2) if (t->picnum == EXPLOSION2)
{ {
ps[screenpeek].visibility = -127; ps[screenpeek].visibility = -127;
lastvisinc = ud.levelclock+32; lastvisinc = ud.levelclock + 32;
} }
t->shade = -127; t->shade = -127;
break; break;
@ -654,63 +655,63 @@ void animatesprites_d(int x,int y,int a,int smoothratio)
t->cstat |= 128; t->cstat |= 128;
case BURNING: case BURNING:
case BURNING2: case BURNING2:
if( sprite[s->owner].picnum != TREE1 && sprite[s->owner].picnum != TREE2 ) if (sprite[s->owner].picnum != TREE1 && sprite[s->owner].picnum != TREE2)
t->z = sector[t->sectnum].floorz; t->z = sector[t->sectnum].floorz;
t->shade = -127; t->shade = -127;
break; break;
case COOLEXPLOSION1: case COOLEXPLOSION1:
t->shade = -127; t->shade = -127;
t->picnum += (s->shade>>1); t->picnum += (s->shade >> 1);
break; break;
case PLAYERONWATER: case PLAYERONWATER:
/*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) { /*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) {
k = 0; k = 0;
t->cstat &= ~4; t->cstat &= ~4;
} else*/ { } else*/ {
k = (((t->ang+3072+128-a)&2047)>>8)&7; k = (((t->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
if(k>4) if (k > 4)
{ {
k = 8-k; k = 8 - k;
t->cstat |= 4; t->cstat |= 4;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
} }
t->picnum = s->picnum+k+((hittype[i].temp_data[0]<4)*5); t->picnum = s->picnum + k + ((hittype[i].temp_data[0] < 4) * 5);
t->shade = sprite[s->owner].shade; t->shade = sprite[s->owner].shade;
break; break;
case WATERSPLASH2: case WATERSPLASH2:
t->picnum = WATERSPLASH2+t1; t->picnum = WATERSPLASH2 + t1;
break; break;
case REACTOR2: case REACTOR2:
t->picnum = s->picnum + hittype[i].temp_data[2]; t->picnum = s->picnum + hittype[i].temp_data[2];
break; break;
case SHELL: case SHELL:
t->picnum = s->picnum+(hittype[i].temp_data[0]&1); t->picnum = s->picnum + (hittype[i].temp_data[0] & 1);
case SHOTGUNSHELL: case SHOTGUNSHELL:
t->cstat |= 12; t->cstat |= 12;
if(hittype[i].temp_data[0] > 1) t->cstat &= ~4; if (hittype[i].temp_data[0] > 1) t->cstat &= ~4;
if(hittype[i].temp_data[0] > 2) t->cstat &= ~12; if (hittype[i].temp_data[0] > 2) t->cstat &= ~12;
break; break;
case FRAMEEFFECT1: case FRAMEEFFECT1:
if(s->owner >= 0 && sprite[s->owner].statnum < MAXSTATUS) if (s->owner >= 0 && sprite[s->owner].statnum < MAXSTATUS)
{ {
if(sprite[s->owner].picnum == APLAYER) if (sprite[s->owner].picnum == APLAYER)
if(ud.camerasprite == -1) if (ud.camerasprite == -1)
if(screenpeek == sprite[s->owner].yvel && display_mirror == 0) if (screenpeek == sprite[s->owner].yvel && display_mirror == 0)
{ {
t->owner = -1; t->owner = -1;
break; break;
} }
if( (sprite[s->owner].cstat&32768) == 0 ) if ((sprite[s->owner].cstat & 32768) == 0)
{ {
t->picnum = hittype[s->owner].dispicnum; t->picnum = hittype[s->owner].dispicnum;
t->pal = sprite[s->owner].pal; t->pal = sprite[s->owner].pal;
t->shade = sprite[s->owner].shade; t->shade = sprite[s->owner].shade;
t->ang = sprite[s->owner].ang; t->ang = sprite[s->owner].ang;
t->cstat = 2|sprite[s->owner].cstat; t->cstat = 2 | sprite[s->owner].cstat;
} }
} }
break; break;
@ -722,19 +723,19 @@ void animatesprites_d(int x,int y,int a,int smoothratio)
break; break;
}*/ }*/
k = (((t->ang+3072+128-a)&2047)>>8)&7; k = (((t->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
if(k>4) if (k > 4)
{ {
k = 8-k; k = 8 - k;
t->cstat |= 4; t->cstat |= 4;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
t->picnum = s->picnum+k; t->picnum = s->picnum + k;
break; break;
} }
hittype[i].dispicnum = t->picnum; hittype[i].dispicnum = t->picnum;
if(sector[t->sectnum].floorpicnum == MIRROR) if (sector[t->sectnum].floorpicnum == MIRROR)
t->xrepeat = t->yrepeat = 0; t->xrepeat = t->yrepeat = 0;
} }
} }

View file

@ -35,47 +35,47 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
BEGIN_DUKE_NS BEGIN_DUKE_NS
void animatesprites_r(int x,int y,int a,int smoothratio) void animatesprites_r(int x, int y, int a, int smoothratio)
{ {
int i, j, k, p; int i, j, k, p;
short sect; short sect;
int l, t1,t3,t4; int l, t1, t3, t4;
spritetype* s; spritetype* s;
tspritetype *t; tspritetype* t;
int bg = 0; int bg = 0;
for(j=0;j < spritesortcnt; j++) for (j = 0; j < spritesortcnt; j++)
{ {
t = &tsprite[j]; t = &tsprite[j];
i = t->owner; i = t->owner;
s = &sprite[t->owner]; s = &sprite[t->owner];
switch(t->picnum) switch (t->picnum)
{ {
case BLOODPOOL: case BLOODPOOL:
case FOOTPRINTS: case FOOTPRINTS:
case FOOTPRINTS2: case FOOTPRINTS2:
case FOOTPRINTS3: case FOOTPRINTS3:
case FOOTPRINTS4: case FOOTPRINTS4:
if(t->shade == 127) continue; if (t->shade == 127) continue;
break; break;
case CHAIR3: case CHAIR3:
k = (((t->ang+3072+128-a)&2047)>>8)&7; k = (((t->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
if(k>4) if (k > 4)
{ {
k = 8-k; k = 8 - k;
t->cstat |= 4; t->cstat |= 4;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
t->picnum = s->picnum+k; t->picnum = s->picnum + k;
break; break;
case BLOODSPLAT1: case BLOODSPLAT1:
case BLOODSPLAT2: case BLOODSPLAT2:
case BLOODSPLAT3: case BLOODSPLAT3:
case BLOODSPLAT4: case BLOODSPLAT4:
if(t->pal == 6) if (t->pal == 6)
{ {
t->shade = -127; t->shade = -127;
continue; continue;
@ -104,7 +104,7 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
case NEON6: case NEON6:
continue; continue;
default: default:
if( ( (t->cstat&16) ) || ( badguy(t) && t->extra > 0) || t->statnum == 10) if (((t->cstat & 16)) || (badguy(t) && t->extra > 0) || t->statnum == 10)
{ {
if (shadedsector[s->sectnum] == 1 && s->statnum != 1) if (shadedsector[s->sectnum] == 1 && s->statnum != 1)
{ {
@ -115,7 +115,7 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
} }
} }
if (sector[t->sectnum].ceilingstat&1) if (sector[t->sectnum].ceilingstat & 1)
{ {
if (badguy(s)) if (badguy(s))
l = s->shade; l = s->shade;
@ -125,13 +125,13 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
else else
l = sector[t->sectnum].floorshade; l = sector[t->sectnum].floorshade;
if(l < -127) l = -127; if (l < -127) l = -127;
if(l > 128) l = 127; if (l > 128) l = 127;
t->shade = l; t->shade = l;
} }
for(j=0;j < spritesortcnt; j++ ) //Between drawrooms() and drawmasks() for (j = 0; j < spritesortcnt; j++) //Between drawrooms() and drawmasks()
{ //is the perfect time to animate sprites { //is the perfect time to animate sprites
t = &tsprite[j]; t = &tsprite[j];
i = t->owner; i = t->owner;
@ -152,21 +152,21 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
break; break;
} }
if( t->statnum == 99 ) continue; if (t->statnum == 99) continue;
if( s->statnum != STAT_ACTOR && s->picnum == APLAYER && ps[s->yvel].newowner == -1 && s->owner >= 0 ) if (s->statnum != STAT_ACTOR && s->picnum == APLAYER && ps[s->yvel].newowner == -1 && s->owner >= 0)
{ {
t->x -= mulscale16(MaxSmoothRatio-smoothratio,ps[s->yvel].posx-ps[s->yvel].oposx); t->x -= mulscale16(MaxSmoothRatio - smoothratio, ps[s->yvel].posx - ps[s->yvel].oposx);
t->y -= mulscale16(MaxSmoothRatio-smoothratio,ps[s->yvel].posy-ps[s->yvel].oposy); t->y -= mulscale16(MaxSmoothRatio - smoothratio, ps[s->yvel].posy - ps[s->yvel].oposy);
t->z = ps[s->yvel].oposz + mulscale16(smoothratio,ps[s->yvel].posz-ps[s->yvel].oposz); t->z = ps[s->yvel].oposz + mulscale16(smoothratio, ps[s->yvel].posz - ps[s->yvel].oposz);
t->z += (40<<8); t->z += (40 << 8);
s->xrepeat = 24; s->xrepeat = 24;
s->yrepeat = 17; s->yrepeat = 17;
} }
else if (s->picnum != CRANEPOLE) else if (s->picnum != CRANEPOLE)
{ {
t->x -= mulscale16(MaxSmoothRatio-smoothratio,s->x-hittype[i].bposx); t->x -= mulscale16(MaxSmoothRatio - smoothratio, s->x - hittype[i].bposx);
t->y -= mulscale16(MaxSmoothRatio-smoothratio,s->y-hittype[i].bposy); t->y -= mulscale16(MaxSmoothRatio - smoothratio, s->y - hittype[i].bposy);
t->z -= mulscale16(MaxSmoothRatio-smoothratio,s->z-hittype[i].bposz); t->z -= mulscale16(MaxSmoothRatio - smoothratio, s->z - hittype[i].bposz);
} }
sect = s->sectnum; sect = s->sectnum;
@ -174,12 +174,12 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
t3 = hittype[i].temp_data[3]; t3 = hittype[i].temp_data[3];
t4 = hittype[i].temp_data[4]; t4 = hittype[i].temp_data[4];
switch(s->picnum) switch (s->picnum)
{ {
case RESPAWNMARKERRED: case RESPAWNMARKERRED:
case RESPAWNMARKERYELLOW: case RESPAWNMARKERYELLOW:
case RESPAWNMARKERGREEN: case RESPAWNMARKERGREEN:
t->picnum = 861+( (ud.levelclock>>4) & 13); t->picnum = 861 + ((ud.levelclock >> 4) & 13);
if (s->picnum == RESPAWNMARKERRED) if (s->picnum == RESPAWNMARKERRED)
t->pal = 0; t->pal = 0;
else if (s->picnum == RESPAWNMARKERYELLOW) else if (s->picnum == RESPAWNMARKERYELLOW)
@ -193,69 +193,69 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
s->xrepeat = 24; s->xrepeat = 24;
s->yrepeat = 17; s->yrepeat = 17;
if (s->extra > 0) if (s->extra > 0)
t->z += (6<<8); t->z += (6 << 8);
break; break;
case BLOODPOOL: case BLOODPOOL:
case FOOTPRINTS: case FOOTPRINTS:
case FOOTPRINTS2: case FOOTPRINTS2:
case FOOTPRINTS3: case FOOTPRINTS3:
case FOOTPRINTS4: case FOOTPRINTS4:
if(t->pal == 6) if (t->pal == 6)
t->shade = -127; t->shade = -127;
case MONEY: case MONEY:
case MONEY+1: case MONEY + 1:
break; break;
case TRIPBOMBSPRITE: case TRIPBOMBSPRITE:
continue; continue;
case FORCESPHERE: case FORCESPHERE:
if(t->statnum == 5) if (t->statnum == 5)
{ {
short sqa,sqb; short sqa, sqb;
sqa = sqa =
getangle( getangle(
sprite[s->owner].x-ps[screenpeek].posx, sprite[s->owner].x - ps[screenpeek].posx,
sprite[s->owner].y-ps[screenpeek].posy); sprite[s->owner].y - ps[screenpeek].posy);
sqb = sqb =
getangle( getangle(
sprite[s->owner].x-t->x, sprite[s->owner].x - t->x,
sprite[s->owner].y-t->y); sprite[s->owner].y - t->y);
if( abs(getincangle(sqa,sqb)) > 512 ) if (abs(getincangle(sqa, sqb)) > 512)
if( ldist(&sprite[s->owner],t) < ldist(&sprite[ps[screenpeek].i],&sprite[s->owner]) ) if (ldist(&sprite[s->owner], t) < ldist(&sprite[ps[screenpeek].i], &sprite[s->owner]))
t->xrepeat = t->yrepeat = 0; t->xrepeat = t->yrepeat = 0;
} }
continue; continue;
case BURNING: case BURNING:
if( sprite[s->owner].statnum == 10 ) if (sprite[s->owner].statnum == 10)
{ {
if( display_mirror == 0 && sprite[s->owner].yvel == screenpeek && ps[sprite[s->owner].yvel].over_shoulder_on == 0 ) if (display_mirror == 0 && sprite[s->owner].yvel == screenpeek && ps[sprite[s->owner].yvel].over_shoulder_on == 0)
t->xrepeat = 0; t->xrepeat = 0;
else else
{ {
t->ang = getangle(x-t->x,y-t->y); t->ang = getangle(x - t->x, y - t->y);
t->x = sprite[s->owner].x; t->x = sprite[s->owner].x;
t->y = sprite[s->owner].y; t->y = sprite[s->owner].y;
t->x += sintable[(t->ang+512)&2047]>>10; t->x += sintable[(t->ang + 512) & 2047] >> 10;
t->y += sintable[t->ang&2047]>>10; t->y += sintable[t->ang & 2047] >> 10;
} }
} }
break; break;
case ATOMICHEALTH: case ATOMICHEALTH:
t->z -= (4<<8); t->z -= (4 << 8);
break; break;
case CRYSTALAMMO: case CRYSTALAMMO:
t->shade = (sintable[(ud.levelclock<<4)&2047]>>10); t->shade = (sintable[(ud.levelclock << 4) & 2047] >> 10);
break; break;
case SHRINKSPARK: case SHRINKSPARK:
if ((sprite[s->owner].picnum == CHEER || sprite[s->owner].picnum == CHEERSTAYPUT) && isRRRA()) if ((sprite[s->owner].picnum == CHEER || sprite[s->owner].picnum == CHEERSTAYPUT) && isRRRA())
{ {
t->picnum = CHEERBLADE+( (ud.levelclock>>4)&3 ); t->picnum = CHEERBLADE + ((ud.levelclock >> 4) & 3);
t->shade = -127; t->shade = -127;
} }
else else
t->picnum = SHRINKSPARK+( (ud.levelclock>>4)&7 ); t->picnum = SHRINKSPARK + ((ud.levelclock >> 4) & 7);
break; break;
case CHEERBOMB: case CHEERBOMB:
if (isRRRA()) if (isRRRA())
@ -265,7 +265,7 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
} }
else goto default_case; else goto default_case;
case SPIT: case SPIT:
if(isRRRA()) if (isRRRA())
{ {
if (sprite[s->owner].picnum == MINION && sprite[s->owner].pal == 8) if (sprite[s->owner].picnum == MINION && sprite[s->owner].pal == 8)
t->picnum = RRTILE3500 + ((ud.levelclock >> 4) % 6); t->picnum = RRTILE3500 + ((ud.levelclock >> 4) % 6);
@ -294,68 +294,68 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
break; break;
case EMPTYBIKE: case EMPTYBIKE:
if (!isRRRA()) goto default_case; if (!isRRRA()) goto default_case;
k = getangle(s->x-x,s->y-y); k = getangle(s->x - x, s->y - y);
k = (((s->ang+3072+128-k)&2047)/170); k = (((s->ang + 3072 + 128 - k) & 2047) / 170);
if(k > 6) if (k > 6)
{ {
k = 12-k; k = 12 - k;
t->cstat |= 4; t->cstat |= 4;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
t->picnum = EMPTYBIKE+k; t->picnum = EMPTYBIKE + k;
break; break;
case EMPTYBOAT: case EMPTYBOAT:
if (!isRRRA()) goto default_case; if (!isRRRA()) goto default_case;
k = getangle(s->x-x,s->y-y); k = getangle(s->x - x, s->y - y);
k = (((s->ang+3072+128-k)&2047)/170); k = (((s->ang + 3072 + 128 - k) & 2047) / 170);
if(k > 6) if (k > 6)
{ {
k = 12-k; k = 12 - k;
t->cstat |= 4; t->cstat |= 4;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
t->picnum = EMPTYBOAT+k; t->picnum = EMPTYBOAT + k;
break; break;
case RPG: case RPG:
k = getangle(s->x-x,s->y-y); k = getangle(s->x - x, s->y - y);
k = (((s->ang+3072+128-k)&2047)/170); k = (((s->ang + 3072 + 128 - k) & 2047) / 170);
if(k > 6) if (k > 6)
{ {
k = 12-k; k = 12 - k;
t->cstat |= 4; t->cstat |= 4;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
t->picnum = RPG+k; t->picnum = RPG + k;
break; break;
case RPG2: case RPG2:
if (!isRRRA()) goto default_case; if (!isRRRA()) goto default_case;
k = getangle(s->x-x,s->y-y); k = getangle(s->x - x, s->y - y);
k = (((s->ang+3072+128-k)&2047)/170); k = (((s->ang + 3072 + 128 - k) & 2047) / 170);
if(k > 6) if (k > 6)
{ {
k = 12-k; k = 12 - k;
t->cstat |= 4; t->cstat |= 4;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
t->picnum = RPG2+k; t->picnum = RPG2 + k;
break; break;
case RECON: case RECON:
k = getangle(s->x-x,s->y-y); k = getangle(s->x - x, s->y - y);
if( hittype[i].temp_data[0] < 4 ) if (hittype[i].temp_data[0] < 4)
k = (((s->ang+3072+128-k)&2047)/170); k = (((s->ang + 3072 + 128 - k) & 2047) / 170);
else k = (((s->ang+3072+128-k)&2047)/170); else k = (((s->ang + 3072 + 128 - k) & 2047) / 170);
if(k>6) if (k > 6)
{ {
k = 12-k; k = 12 - k;
t->cstat |= 4; t->cstat |= 4;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
if( abs(t3) > 64 ) k += 7; if (abs(t3) > 64) k += 7;
t->picnum = RECON+k; t->picnum = RECON + k;
break; break;
@ -363,9 +363,9 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
p = s->yvel; p = s->yvel;
if(t->pal == 1) t->z -= (18<<8); if (t->pal == 1) t->z -= (18 << 8);
if(ps[p].over_shoulder_on > 0 && ps[p].newowner < 0 ) if (ps[p].over_shoulder_on > 0 && ps[p].newowner < 0)
{ {
t->cstat |= 2; t->cstat |= 2;
if (screenpeek == myconnectindex && numplayers >= 2) if (screenpeek == myconnectindex && numplayers >= 2)
@ -378,74 +378,75 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
} }
} }
if( ( display_mirror == 1 || screenpeek != p || s->owner == -1 ) && ud.multimode > 1 && ud.showweapons && sprite[ps[p].i].extra > 0 && ps[p].curr_weapon > 0 ) if ((display_mirror == 1 || screenpeek != p || s->owner == -1) && ud.multimode > 1 && ud.showweapons && sprite[ps[p].i].extra > 0 && ps[p].curr_weapon > 0)
{ {
memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype)); auto newtspr = &tsprite[spritesortcnt];
memcpy(newtspr, t, sizeof(spritetype));
tsprite[spritesortcnt].statnum = 99; newtspr->statnum = 99;
tsprite[spritesortcnt].yrepeat = ( t->yrepeat>>3 ); newtspr->yrepeat = (t->yrepeat >> 3);
if(t->yrepeat < 4) t->yrepeat = 4; if (t->yrepeat < 4) t->yrepeat = 4;
tsprite[spritesortcnt].shade = t->shade; newtspr->shade = t->shade;
tsprite[spritesortcnt].cstat = 0; newtspr->cstat = 0;
switch(ps[p].curr_weapon) switch (ps[p].curr_weapon)
{ {
case PISTOL_WEAPON: tsprite[spritesortcnt].picnum = FIRSTGUNSPRITE; break; case PISTOL_WEAPON: newtspr->picnum = FIRSTGUNSPRITE; break;
case SHOTGUN_WEAPON: tsprite[spritesortcnt].picnum = SHOTGUNSPRITE; break; case SHOTGUN_WEAPON: newtspr->picnum = SHOTGUNSPRITE; break;
case RIFLEGUN_WEAPON: tsprite[spritesortcnt].picnum = CHAINGUNSPRITE; break; case RIFLEGUN_WEAPON: newtspr->picnum = CHAINGUNSPRITE; break;
case CROSSBOW_WEAPON: tsprite[spritesortcnt].picnum = RPGSPRITE; break; case CROSSBOW_WEAPON: newtspr->picnum = RPGSPRITE; break;
case CHICKEN_WEAPON: tsprite[spritesortcnt].picnum = RPGSPRITE; break; case CHICKEN_WEAPON: newtspr->picnum = RPGSPRITE; break;
case THROWINGDYNAMITE_WEAPON: case THROWINGDYNAMITE_WEAPON:
case DYNAMITE_WEAPON: tsprite[spritesortcnt].picnum = HEAVYHBOMB; break; case DYNAMITE_WEAPON: newtspr->picnum = HEAVYHBOMB; break;
case POWDERKEG_WEAPON: tsprite[spritesortcnt].picnum = TRIPBOMBSPRITE; break; case POWDERKEG_WEAPON: newtspr->picnum = TRIPBOMBSPRITE; break;
case BOWLING_WEAPON: tsprite[spritesortcnt].picnum = 3437; break; case BOWLING_WEAPON: newtspr->picnum = 3437; break;
case THROWSAW_WEAPON: tsprite[spritesortcnt].picnum = SHRINKSPARK; break; case THROWSAW_WEAPON: newtspr->picnum = SHRINKSPARK; break;
case BUZZSAW_WEAPON: tsprite[spritesortcnt].picnum = SHRINKSPARK; break; case BUZZSAW_WEAPON: newtspr->picnum = SHRINKSPARK; break;
case ALIENBLASTER_WEAPON: tsprite[spritesortcnt].picnum = DEVISTATORSPRITE; break; case ALIENBLASTER_WEAPON: newtspr->picnum = DEVISTATORSPRITE; break;
case TIT_WEAPON: tsprite[spritesortcnt].picnum = FREEZESPRITE; break; case TIT_WEAPON: newtspr->picnum = FREEZESPRITE; break;
} }
if(s->owner >= 0) if (s->owner >= 0)
tsprite[spritesortcnt].z = ps[p].posz-(12<<8); newtspr->z = ps[p].posz - (12 << 8);
else tsprite[spritesortcnt].z = s->z-(51<<8); else newtspr->z = s->z - (51 << 8);
if(ps[p].curr_weapon == HANDBOMB_WEAPON) if (ps[p].curr_weapon == HANDBOMB_WEAPON)
{ {
tsprite[spritesortcnt].xrepeat = 10; newtspr->xrepeat = 10;
tsprite[spritesortcnt].yrepeat = 10; newtspr->yrepeat = 10;
} }
else if(ps[p].OnMotorcycle || ps[p].OnBoat) else if (ps[p].OnMotorcycle || ps[p].OnBoat)
{ {
tsprite[spritesortcnt].xrepeat = 0; newtspr->xrepeat = 0;
tsprite[spritesortcnt].yrepeat = 0; newtspr->yrepeat = 0;
} }
else else
{ {
tsprite[spritesortcnt].xrepeat = 16; newtspr->xrepeat = 16;
tsprite[spritesortcnt].yrepeat = 16; newtspr->yrepeat = 16;
} }
tsprite[spritesortcnt].pal = 0; newtspr->pal = 0;
spritesortcnt++; spritesortcnt++;
} }
if(s->owner == -1) if (s->owner == -1)
{ {
/*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) { /*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) {
k = 0; k = 0;
t->cstat &= ~4; t->cstat &= ~4;
} else*/ { } else*/ {
k = (((s->ang+3072+128-a)&2047)>>8)&7; k = (((s->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
if(k>4) if (k > 4)
{ {
k = 8-k; k = 8 - k;
t->cstat |= 4; t->cstat |= 4;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
} }
if(sector[t->sectnum].lotag == 2) k += 1795-1405; if (sector[t->sectnum].lotag == 2) k += 1795 - 1405;
else if( (hittype[i].floorz-s->z) > (64<<8) ) k += 60; else if ((hittype[i].floorz - s->z) > (64 << 8)) k += 60;
t->picnum += k; t->picnum += k;
t->pal = ps[p].palookup; t->pal = ps[p].palookup;
@ -453,24 +454,24 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
goto PALONLY; goto PALONLY;
} }
if( ps[p].on_crane == -1 && (sector[s->sectnum].lotag&0x7ff) != 1 ) if (ps[p].on_crane == -1 && (sector[s->sectnum].lotag & 0x7ff) != 1)
{ {
l = s->z-hittype[ps[p].i].floorz+(3<<8); l = s->z - hittype[ps[p].i].floorz + (3 << 8);
if( l > 1024 && s->yrepeat > 32 && s->extra > 0 ) if (l > 1024 && s->yrepeat > 32 && s->extra > 0)
s->yoffset = (signed char)(l/(s->yrepeat<<2)); s->yoffset = (signed char)(l / (s->yrepeat << 2));
else s->yoffset=0; else s->yoffset = 0;
} }
if(ps[p].newowner > -1) if (ps[p].newowner > -1)
{ {
t4 = ScriptCode[actorinfo[APLAYER].scriptaddress + 1]; t4 = ScriptCode[actorinfo[APLAYER].scriptaddress + 1];
t3 = 0; t3 = 0;
t1 = ScriptCode[actorinfo[APLAYER].scriptaddress + 2]; t1 = ScriptCode[actorinfo[APLAYER].scriptaddress + 2];
} }
if(ud.camerasprite == -1 && ps[p].newowner == -1) if (ud.camerasprite == -1 && ps[p].newowner == -1)
if(s->owner >= 0 && display_mirror == 0 && ps[p].over_shoulder_on == 0 ) if (s->owner >= 0 && display_mirror == 0 && ps[p].over_shoulder_on == 0)
if( ud.multimode < 2 || ( ud.multimode > 1 && p == screenpeek ) ) if (ud.multimode < 2 || (ud.multimode > 1 && p == screenpeek))
{ {
t->owner = -1; t->owner = -1;
t->xrepeat = t->yrepeat = 0; t->xrepeat = t->yrepeat = 0;
@ -479,12 +480,12 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
PALONLY: PALONLY:
if( sector[sect].floorpal ) if (sector[sect].floorpal)
t->pal = sector[sect].floorpal; t->pal = sector[sect].floorpal;
if(s->owner == -1) continue; if (s->owner == -1) continue;
if( t->z > hittype[i].floorz && t->xrepeat < 32 ) if (t->z > hittype[i].floorz && t->xrepeat < 32)
t->z = hittype[i].floorz; t->z = hittype[i].floorz;
if (ps[p].OnMotorcycle && p == screenpeek) if (ps[p].OnMotorcycle && p == screenpeek)
@ -498,15 +499,15 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
} }
else if (ps[p].OnMotorcycle) else if (ps[p].OnMotorcycle)
{ {
k = (((s->ang+3072+128-a)&2047)/170); k = (((s->ang + 3072 + 128 - a) & 2047) / 170);
if(k>6) if (k > 6)
{ {
k = 12-k; k = 12 - k;
t->cstat |= 4; t->cstat |= 4;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
t->picnum = RRTILE7213+k; t->picnum = RRTILE7213 + k;
t->xrepeat = 18; t->xrepeat = 18;
t->yrepeat = 18; t->yrepeat = 18;
t4 = 0; t4 = 0;
@ -524,15 +525,15 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
} }
else if (ps[p].OnBoat) else if (ps[p].OnBoat)
{ {
k = (((s->ang+3072+128-a)&2047)/170); k = (((s->ang + 3072 + 128 - a) & 2047) / 170);
if(k>6) if (k > 6)
{ {
k = 12-k; k = 12 - k;
t->cstat |= 4; t->cstat |= 4;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
t->picnum = RRTILE7184+k; t->picnum = RRTILE7184 + k;
t->xrepeat = 32; t->xrepeat = 32;
t->yrepeat = 32; t->yrepeat = 32;
t4 = 0; t4 = 0;
@ -588,7 +589,7 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
case COOTJIBB: case COOTJIBB:
case COOTJIBC: case COOTJIBC:
stuff: stuff:
if(t->pal == 6) t->shade = -120; if (t->pal == 6) t->shade = -120;
if (shadedsector[s->sectnum] == 1) if (shadedsector[s->sectnum] == 1)
t->shade = 16; t->shade = 16;
@ -599,24 +600,24 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
case SCRAP4: case SCRAP4:
case SCRAP5: case SCRAP5:
case SCRAP6: case SCRAP6:
case SCRAP6+1: case SCRAP6 + 1:
case SCRAP6+2: case SCRAP6 + 2:
case SCRAP6+3: case SCRAP6 + 3:
case SCRAP6+4: case SCRAP6 + 4:
case SCRAP6+5: case SCRAP6 + 5:
case SCRAP6+6: case SCRAP6 + 6:
case SCRAP6+7: case SCRAP6 + 7:
if(t->picnum == SCRAP1 && s->yvel >= 0) if (t->picnum == SCRAP1 && s->yvel >= 0)
t->picnum = s->yvel; t->picnum = s->yvel;
else t->picnum += hittype[i].temp_data[0]; else t->picnum += hittype[i].temp_data[0];
if( sector[sect].floorpal ) if (sector[sect].floorpal)
t->pal = sector[sect].floorpal; t->pal = sector[sect].floorpal;
break; break;
case WATERBUBBLE: case WATERBUBBLE:
if(sector[t->sectnum].floorpicnum == FLOORSLIME) if (sector[t->sectnum].floorpicnum == FLOORSLIME)
{ {
t->pal = 7; t->pal = 7;
break; break;
@ -624,69 +625,69 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
default: default:
default_case: default_case:
if( sector[sect].floorpal ) if (sector[sect].floorpal)
t->pal = sector[sect].floorpal; t->pal = sector[sect].floorpal;
break; break;
} }
if(actorinfo[s->picnum].scriptaddress && (t->cstat & 48) != 48) if (actorinfo[s->picnum].scriptaddress && (t->cstat & 48) != 48)
{ {
if(t4) if (t4)
{ {
l = ScriptCode[t4 + 2]; l = ScriptCode[t4 + 2];
/*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) { /*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) {
k = 0; k = 0;
t->cstat &= ~4; t->cstat &= ~4;
} else*/ switch( l ) { } else*/ switch (l) {
case 2: case 2:
k = (((s->ang+3072+128-a)&2047)>>8)&1; k = (((s->ang + 3072 + 128 - a) & 2047) >> 8) & 1;
break; break;
case 3: case 3:
case 4: case 4:
k = (((s->ang+3072+128-a)&2047)>>7)&7; k = (((s->ang + 3072 + 128 - a) & 2047) >> 7) & 7;
if(k > 3) if (k > 3)
{ {
t->cstat |= 4; t->cstat |= 4;
k = 7-k; k = 7 - k;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
break; break;
case 5: case 5:
k = getangle(s->x-x,s->y-y); k = getangle(s->x - x, s->y - y);
k = (((s->ang+3072+128-k)&2047)>>8)&7; k = (((s->ang + 3072 + 128 - k) & 2047) >> 8) & 7;
if(k>4) if (k > 4)
{ {
k = 8-k; k = 8 - k;
t->cstat |= 4; t->cstat |= 4;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
break; break;
case 7: case 7:
k = getangle(s->x-x,s->y-y); k = getangle(s->x - x, s->y - y);
k = (((s->ang+3072+128-k)&2047)/170); k = (((s->ang + 3072 + 128 - k) & 2047) / 170);
if(k>6) if (k > 6)
{ {
k = 12-k; k = 12 - k;
t->cstat |= 4; t->cstat |= 4;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
break; break;
case 8: case 8:
k = (((s->ang+3072+128-a)&2047)>>8)&7; k = (((s->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
t->cstat &= ~4; t->cstat &= ~4;
break; break;
default: default:
bg = badguy(s); bg = badguy(s);
if (bg && s->statnum == 2 && s->extra > 0) if (bg && s->statnum == 2 && s->extra > 0)
{ {
k = getangle(s->x-x,s->y-y); k = getangle(s->x - x, s->y - y);
k = (((s->ang+3072+128-k)&2047)>>8)&7; k = (((s->ang + 3072 + 128 - k) & 2047) >> 8) & 7;
if(k>4) if (k > 4)
{ {
k = 8-k; k = 8 - k;
t->cstat |= 4; t->cstat |= 4;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
@ -703,37 +704,37 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
while (!tileGetTexture(t->picnum)->isValid() && t->picnum > 0) while (!tileGetTexture(t->picnum)->isValid() && t->picnum > 0)
t->picnum -= l; //Hack, for actors t->picnum -= l; //Hack, for actors
if( hittype[i].dispicnum >= 0) if (hittype[i].dispicnum >= 0)
hittype[i].dispicnum = t->picnum; hittype[i].dispicnum = t->picnum;
} }
else if(display_mirror == 1) else if (display_mirror == 1)
t->cstat |= 4; t->cstat |= 4;
} }
if (!isRRRA() && s->picnum == SBMOVE) if (!isRRRA() && s->picnum == SBMOVE)
t->shade = -127; t->shade = -127;
if( s->statnum == 13 || badguy(s) || (s->picnum == APLAYER && s->owner >= 0) ) if (s->statnum == 13 || badguy(s) || (s->picnum == APLAYER && s->owner >= 0))
if( (s->cstat&48) == 0 && t->statnum != 99 ) if ((s->cstat & 48) == 0 && t->statnum != 99)
if ( s->picnum != EXPLOSION2 && s->picnum != DOMELITE && s->picnum != TORNADO && s->picnum != EXPLOSION3 && (s->picnum != SBMOVE || isRRRA())) if (s->picnum != EXPLOSION2 && s->picnum != DOMELITE && s->picnum != TORNADO && s->picnum != EXPLOSION3 && (s->picnum != SBMOVE || isRRRA()))
{ {
if( hittype[i].dispicnum < 0 ) if (hittype[i].dispicnum < 0)
{ {
hittype[i].dispicnum++; hittype[i].dispicnum++;
continue; continue;
} }
else if( r_shadows && spritesortcnt < (MAXSPRITESONSCREEN-2)) else if (r_shadows && spritesortcnt < (MAXSPRITESONSCREEN - 2))
{ {
int daz; int daz;
if (isRRRA() && sector[sect].lotag == 160) continue; if (isRRRA() && sector[sect].lotag == 160) continue;
if( (sector[sect].lotag&0xff) > 2 || s->statnum == 4 || s->statnum == 5 || s->picnum == DRONE ) if ((sector[sect].lotag & 0xff) > 2 || s->statnum == 4 || s->statnum == 5 || s->picnum == DRONE)
daz = sector[sect].floorz; daz = sector[sect].floorz;
else else
daz = hittype[i].floorz; daz = hittype[i].floorz;
if( (s->z-daz) < (8<<8) ) if ((s->z - daz) < (8 << 8))
if( ps[screenpeek].posz < daz ) if (ps[screenpeek].posz < daz)
{ {
auto shadowspr = &tsprite[spritesortcnt]; auto shadowspr = &tsprite[spritesortcnt];
*shadowspr = *t; *shadowspr = *t;
@ -774,7 +775,7 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
} }
switch(s->picnum) switch (s->picnum)
{ {
case RPG2: case RPG2:
case RRTILE1790: case RRTILE1790:
@ -790,15 +791,15 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
case COOLEXPLOSION1: case COOLEXPLOSION1:
case OWHIP: case OWHIP:
case UWHIP: case UWHIP:
if(t->picnum == EXPLOSION2) if (t->picnum == EXPLOSION2)
{ {
ps[screenpeek].visibility = -127; ps[screenpeek].visibility = -127;
lastvisinc = ud.levelclock+32; lastvisinc = ud.levelclock + 32;
t->pal = 0; t->pal = 0;
} }
else if(t->picnum == FIRELASER) else if (t->picnum == FIRELASER)
{ {
t->picnum = FIRELASER+((ud.levelclock>>2)&5); t->picnum = FIRELASER + ((ud.levelclock >> 2) & 5);
} }
t->shade = -127; t->shade = -127;
break; break;
@ -813,7 +814,7 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
break; break;
case FIRE: case FIRE:
case BURNING: case BURNING:
if( sprite[s->owner].picnum != TREE1 && sprite[s->owner].picnum != TREE2 ) if (sprite[s->owner].picnum != TREE1 && sprite[s->owner].picnum != TREE2)
t->z = sector[t->sectnum].floorz; t->z = sector[t->sectnum].floorz;
t->shade = -127; t->shade = -127;
break; break;
@ -872,7 +873,7 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
break; break;
case CHEER: case CHEER:
if (!isRRRA()) break; if (!isRRRA()) break;
if (t->picnum >= CHEER+102 && t->picnum <= CHEER+151) if (t->picnum >= CHEER + 102 && t->picnum <= CHEER + 151)
t->shade = -127; t->shade = -127;
break; break;
case MINION: case MINION:
@ -882,92 +883,92 @@ void animatesprites_r(int x,int y,int a,int smoothratio)
break; break;
case BIKER: case BIKER:
if (!isRRRA()) break; if (!isRRRA()) break;
if (t->picnum >= BIKER+54 && t->picnum <= BIKER+58) if (t->picnum >= BIKER + 54 && t->picnum <= BIKER + 58)
t->shade = -127; t->shade = -127;
else if (t->picnum >= BIKER+84 && t->picnum <= BIKER+88) else if (t->picnum >= BIKER + 84 && t->picnum <= BIKER + 88)
t->shade = -127; t->shade = -127;
break; break;
case BILLYRAY: case BILLYRAY:
case BILLYRAYSTAYPUT: case BILLYRAYSTAYPUT:
if (!isRRRA()) break; if (!isRRRA()) break;
if (t->picnum >= BILLYRAY+5 && t->picnum <= BILLYRAY+9) if (t->picnum >= BILLYRAY + 5 && t->picnum <= BILLYRAY + 9)
t->shade = -127; t->shade = -127;
break; break;
case RRTILE2034: case RRTILE2034:
t->picnum = RRTILE2034 + ((ud.levelclock>>2)&1); t->picnum = RRTILE2034 + ((ud.levelclock >> 2) & 1);
break; break;
case RRTILE2944: case RRTILE2944:
t->shade = -127; t->shade = -127;
t->picnum = RRTILE2944+((ud.levelclock>>2)&4); t->picnum = RRTILE2944 + ((ud.levelclock >> 2) & 4);
break; break;
case PLAYERONWATER: case PLAYERONWATER:
k = (((t->ang+3072+128-a)&2047)>>8)&7; k = (((t->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
if(k>4) if (k > 4)
{ {
k = 8-k; k = 8 - k;
t->cstat |= 4; t->cstat |= 4;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
t->picnum = s->picnum+k+((hittype[i].temp_data[0] <4)*5); t->picnum = s->picnum + k + ((hittype[i].temp_data[0] < 4) * 5);
t->shade = sprite[s->owner].shade; t->shade = sprite[s->owner].shade;
break; break;
case MUD: case MUD:
t->picnum = MUD+t1; t->picnum = MUD + t1;
break; break;
case WATERSPLASH2: case WATERSPLASH2:
t->picnum = WATERSPLASH2+t1; t->picnum = WATERSPLASH2 + t1;
break; break;
case REACTOR2: case REACTOR2:
t->picnum = s->picnum + hittype[i].temp_data[2]; t->picnum = s->picnum + hittype[i].temp_data[2];
break; break;
case SHELL: case SHELL:
t->picnum = s->picnum+(hittype[i].temp_data[0] &1); t->picnum = s->picnum + (hittype[i].temp_data[0] & 1);
case SHOTGUNSHELL: case SHOTGUNSHELL:
t->cstat |= 12; t->cstat |= 12;
if(hittype[i].temp_data[0] > 1) t->cstat &= ~4; if (hittype[i].temp_data[0] > 1) t->cstat &= ~4;
if(hittype[i].temp_data[0] > 2) t->cstat &= ~12; if (hittype[i].temp_data[0] > 2) t->cstat &= ~12;
break; break;
case FRAMEEFFECT1: case FRAMEEFFECT1:
if(s->owner >= 0 && sprite[s->owner].statnum < MAXSTATUS) if (s->owner >= 0 && sprite[s->owner].statnum < MAXSTATUS)
{ {
if(sprite[s->owner].picnum == APLAYER) if (sprite[s->owner].picnum == APLAYER)
if(ud.camerasprite == -1) if (ud.camerasprite == -1)
if(screenpeek == sprite[s->owner].yvel && display_mirror == 0) if (screenpeek == sprite[s->owner].yvel && display_mirror == 0)
{ {
t->owner = -1; t->owner = -1;
break; break;
} }
if( (sprite[s->owner].cstat&32768) == 0 ) if ((sprite[s->owner].cstat & 32768) == 0)
{ {
if(sprite[s->owner].picnum == APLAYER) if (sprite[s->owner].picnum == APLAYER)
t->picnum = 1554; t->picnum = 1554;
else else
t->picnum = hittype[s->owner].dispicnum; t->picnum = hittype[s->owner].dispicnum;
t->pal = sprite[s->owner].pal; t->pal = sprite[s->owner].pal;
t->shade = sprite[s->owner].shade; t->shade = sprite[s->owner].shade;
t->ang = sprite[s->owner].ang; t->ang = sprite[s->owner].ang;
t->cstat = 2|sprite[s->owner].cstat; t->cstat = 2 | sprite[s->owner].cstat;
} }
} }
break; break;
case CAMERA1: case CAMERA1:
case RAT: case RAT:
k = (((t->ang+3072+128-a)&2047)>>8)&7; k = (((t->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
if(k>4) if (k > 4)
{ {
k = 8-k; k = 8 - k;
t->cstat |= 4; t->cstat |= 4;
} }
else t->cstat &= ~4; else t->cstat &= ~4;
t->picnum = s->picnum+k; t->picnum = s->picnum + k;
break; break;
} }
hittype[i].dispicnum = t->picnum; hittype[i].dispicnum = t->picnum;
if(sector[t->sectnum].floorpicnum == MIRROR) if (sector[t->sectnum].floorpicnum == MIRROR)
t->xrepeat = t->yrepeat = 0; t->xrepeat = t->yrepeat = 0;
} }
} }