- fixed mixed up tile numbers.

For consistency all shared numbers now use the TILE_ prefix.
This commit is contained in:
Christoph Oelckers 2020-05-14 21:42:11 +02:00
parent 1b135ecb0b
commit 5c780e5c5f
9 changed files with 31 additions and 53 deletions

View file

@ -179,7 +179,7 @@ void clearcamera(player_struct* ps)
int k = headspritestat[STAT_ACTOR]; int k = headspritestat[STAT_ACTOR];
while (k >= 0) while (k >= 0)
{ {
if (sprite[k].picnum == CAMERA1) if (sprite[k].picnum == TILE_CAMERA1)
sprite[k].yvel = 0; sprite[k].yvel = 0;
k = nextspritestat[k]; k = nextspritestat[k];
} }
@ -1350,7 +1350,7 @@ void movetongue(int i, int tongue, int jaw)
s->ang = sprite[s->owner].ang; s->ang = sprite[s->owner].ang;
s->x = sprite[s->owner].x; s->x = sprite[s->owner].x;
s->y = sprite[s->owner].y; s->y = sprite[s->owner].y;
if (sprite[s->owner].picnum == APLAYER) if (sprite[s->owner].picnum == TILE_APLAYER)
s->z = sprite[s->owner].z - (34 << 8); s->z = sprite[s->owner].z - (34 << 8);
for (int k = 0; k < hittype[i].temp_data[0]; k++) for (int k = 0; k < hittype[i].temp_data[0]; k++)
{ {
@ -2673,7 +2673,7 @@ void handle_se00(int i, int LASERLINE)
if (sprite[p].statnum != 3 && sprite[p].statnum != 4) if (sprite[p].statnum != 3 && sprite[p].statnum != 4)
if (LASERLINE < 0 || sprite[p].picnum != LASERLINE) if (LASERLINE < 0 || sprite[p].picnum != LASERLINE)
{ {
if (sprite[p].picnum == APLAYER && sprite[p].owner >= 0) if (sprite[p].picnum == TILE_APLAYER && sprite[p].owner >= 0)
{ {
p = nextspritesect[p]; p = nextspritesect[p];
continue; continue;
@ -4014,7 +4014,7 @@ void handle_se18(int i, bool morecheck)
int j = headspritesect[s->sectnum]; int j = headspritesect[s->sectnum];
while (j >= 0) while (j >= 0)
{ {
if (sprite[j].picnum == APLAYER && sprite[j].owner >= 0) if (sprite[j].picnum == TILE_APLAYER && sprite[j].owner >= 0)
if (ps[sprite[j].yvel].on_ground == 1) if (ps[sprite[j].yvel].on_ground == 1)
ps[sprite[j].yvel].posz += sc->extra; ps[sprite[j].yvel].posz += sc->extra;
if (sprite[j].zvel == 0 && sprite[j].statnum != STAT_EFFECTOR && sprite[j].statnum != STAT_PROJECTILE) if (sprite[j].zvel == 0 && sprite[j].statnum != STAT_EFFECTOR && sprite[j].statnum != STAT_PROJECTILE)
@ -4053,7 +4053,7 @@ void handle_se18(int i, bool morecheck)
int j = headspritesect[s->sectnum]; int j = headspritesect[s->sectnum];
while (j >= 0) while (j >= 0)
{ {
if (sprite[j].picnum == APLAYER && sprite[j].owner >= 0) if (sprite[j].picnum == TILE_APLAYER && sprite[j].owner >= 0)
if (ps[sprite[j].yvel].on_ground == 1) if (ps[sprite[j].yvel].on_ground == 1)
ps[sprite[j].yvel].posz -= sc->extra; ps[sprite[j].yvel].posz -= sc->extra;
if (sprite[j].zvel == 0 && sprite[j].statnum != STAT_EFFECTOR && sprite[j].statnum != STAT_PROJECTILE) if (sprite[j].zvel == 0 && sprite[j].statnum != STAT_EFFECTOR && sprite[j].statnum != STAT_PROJECTILE)
@ -4695,14 +4695,14 @@ void getglobalz(int i)
ssp(i,CLIPMASK0); ssp(i,CLIPMASK0);
} }
} }
else if(sprite[lz].picnum == APLAYER && badguy(s) ) else if(sprite[lz].picnum == TILE_APLAYER && badguy(s) )
{ {
hittype[i].flags |= SFLAG_NOFLOORSHADOW; hittype[i].flags |= SFLAG_NOFLOORSHADOW;
//hittype[i].dispicnum = -4; // No shadows on actors //hittype[i].dispicnum = -4; // No shadows on actors
s->xvel = -256; s->xvel = -256;
ssp(i,CLIPMASK0); ssp(i,CLIPMASK0);
} }
else if(s->statnum == 4 && sprite[lz].picnum == APLAYER) else if(s->statnum == 4 && sprite[lz].picnum == TILE_APLAYER)
if(s->owner == lz) if(s->owner == lz)
{ {
hittype[i].ceilingz = sector[s->sectnum].ceilingz; hittype[i].ceilingz = sector[s->sectnum].ceilingz;
@ -4819,7 +4819,7 @@ int furthestangle(int i, int angs)
greatestd = -(1 << 30); greatestd = -(1 << 30);
angincs = 2048 / angs; angincs = 2048 / angs;
if (s->picnum != APLAYER) if (s->picnum != TILE_APLAYER)
if ((hittype[i].t_data[0] & 63) > 2) return(s->ang + 1024); if ((hittype[i].t_data[0] & 63) > 2) return(s->ang + 1024);
for (j = s->ang; j < (2048 + s->ang); j += angincs) for (j = s->ang; j < (2048 + s->ang); j += angincs)
@ -4914,7 +4914,7 @@ void alterang(int a, int g_i, int g_p)
g_sp->owner = j; g_sp->owner = j;
else g_sp->owner = ps[g_p].i; else g_sp->owner = ps[g_p].i;
if (sprite[g_sp->owner].picnum == APLAYER) if (sprite[g_sp->owner].picnum == TILE_APLAYER)
goalang = getangle(hittype[g_i].lastvx - g_sp->x, hittype[g_i].lastvy - g_sp->y); goalang = getangle(hittype[g_i].lastvx - g_sp->x, hittype[g_i].lastvy - g_sp->y);
else else
goalang = getangle(sprite[g_sp->owner].x - g_sp->x, sprite[g_sp->owner].y - g_sp->y); goalang = getangle(sprite[g_sp->owner].x - g_sp->x, sprite[g_sp->owner].y - g_sp->y);
@ -5004,14 +5004,14 @@ void fall_common(int g_i, int g_p, int JIBS6, int DRONE, int BLOODPOOL, int SHOT
{ {
g_sp->z = hittype[g_i].floorz - FOURSLEIGHT; g_sp->z = hittype[g_i].floorz - FOURSLEIGHT;
if (badguy(g_sp) || (g_sp->picnum == APLAYER && g_sp->owner >= 0)) if (badguy(g_sp) || (g_sp->picnum == TILE_APLAYER && g_sp->owner >= 0))
{ {
if (g_sp->zvel > 3084 && g_sp->extra <= 1) if (g_sp->zvel > 3084 && g_sp->extra <= 1)
{ {
if (g_sp->pal != 1 && g_sp->picnum != DRONE) if (g_sp->pal != 1 && g_sp->picnum != DRONE)
{ {
if (g_sp->picnum == APLAYER && g_sp->extra > 0) if (g_sp->picnum == TILE_APLAYER && g_sp->extra > 0)
goto SKIPJIBS; goto SKIPJIBS;
if (sphit) if (sphit)
{ {

View file

@ -3129,7 +3129,7 @@ void moveactors_d(void)
reactor(i, REACTOR, REACTOR2, REACTOR2BURNT, REACTOR2BURNT); reactor(i, REACTOR, REACTOR2, REACTOR2BURNT, REACTOR2BURNT);
continue; continue;
case DUKE_CAMERA1: case CAMERA1:
camera(i); camera(i);
continue; continue;
} }

View file

@ -3229,7 +3229,7 @@ void moveactors_r(void)
reactor(i, REACTOR, REACTOR2, REACTOR2BURNT, REACTOR2BURNT); reactor(i, REACTOR, REACTOR2, REACTOR2BURNT, REACTOR2BURNT);
continue; continue;
case RR_CAMERA1: case CAMERA1:
camera(i); camera(i);
continue; continue;
} }
@ -4589,7 +4589,7 @@ void destroyit(int g_i)
case DESTRUCTO: case DESTRUCTO:
case RRTILE63: case RRTILE63:
case TORNADO: case TORNADO:
case RR_APLAYER: case APLAYER:
case COOT: case COOT:
break; break;
default: default:

View file

@ -272,7 +272,7 @@ int parse(void)
case concmd_ifdead: case concmd_ifdead:
{ {
j = g_sp->extra; j = g_sp->extra;
if (g_sp->picnum == APLAYER) if (g_sp->picnum == TILE_APLAYER)
j--; j--;
parseifelse(j < 0); parseifelse(j < 0);
} }
@ -412,7 +412,7 @@ int parse(void)
break; break;
case concmd_getlastpal: case concmd_getlastpal:
insptr++; insptr++;
if (g_sp->picnum == APLAYER) if (g_sp->picnum == TILE_APLAYER)
g_sp->pal = ps[g_sp->yvel].palookup; g_sp->pal = ps[g_sp->yvel].palookup;
else g_sp->pal = hittype[g_i].tempang; else g_sp->pal = hittype[g_i].tempang;
hittype[g_i].tempang = 0; hittype[g_i].tempang = 0;
@ -432,12 +432,12 @@ int parse(void)
case concmd_pkick: case concmd_pkick:
insptr++; insptr++;
if (ud.multimode > 1 && g_sp->picnum == APLAYER) if (ud.multimode > 1 && g_sp->picnum == TILE_APLAYER)
{ {
if (ps[otherp].quick_kick == 0) if (ps[otherp].quick_kick == 0)
ps[otherp].quick_kick = 14; ps[otherp].quick_kick = 14;
} }
else if (g_sp->picnum != APLAYER && ps[g_p].quick_kick == 0) else if (g_sp->picnum != TILE_APLAYER && ps[g_p].quick_kick == 0)
ps[g_p].quick_kick = 14; ps[g_p].quick_kick = 14;
break; break;
case concmd_sizeto: case concmd_sizeto:
@ -453,7 +453,7 @@ int parse(void)
insptr++; insptr++;
if ((g_sp->picnum == APLAYER && g_sp->yrepeat < 36) || *insptr < g_sp->yrepeat || ((g_sp->yrepeat * (tilesiz[g_sp->picnum].y + 8)) << 2) < (hittype[g_i].floorz - hittype[g_i].ceilingz)) if ((g_sp->picnum == TILE_APLAYER && g_sp->yrepeat < 36) || *insptr < g_sp->yrepeat || ((g_sp->yrepeat * (tilesiz[g_sp->picnum].y + 8)) << 2) < (hittype[g_i].floorz - hittype[g_i].ceilingz))
{ {
j = ((*insptr) - g_sp->yrepeat) << 1; j = ((*insptr) - g_sp->yrepeat) << 1;
if (abs(j)) g_sp->yrepeat += ksgn(j); if (abs(j)) g_sp->yrepeat += ksgn(j);
@ -775,9 +775,9 @@ int parse(void)
setpal(&ps[g_p]); setpal(&ps[g_p]);
j = headspritestat[1]; j = headspritestat[1];
while(j >= 0) while (j >= 0)
{ {
if(sprite[j].picnum==CAMERA1) if (sprite[j].picnum == TILE_CAMERA1)
sprite[j].yvel = 0; sprite[j].yvel = 0;
j = nextspritestat[j]; j = nextspritestat[j];
} }
@ -1113,7 +1113,7 @@ int parse(void)
j = 1; j = 1;
else if( (l& pfacing) ) else if( (l& pfacing) )
{ {
if (g_sp->picnum == APLAYER && ud.multimode > 1) if (g_sp->picnum == TILE_APLAYER && ud.multimode > 1)
j = getincangle(ps[otherp].getang(), getangle(ps[g_p].posx - ps[otherp].posx, ps[g_p].posy - ps[otherp].posy)); j = getincangle(ps[otherp].getang(), getangle(ps[g_p].posx - ps[otherp].posx, ps[g_p].posy - ps[otherp].posy));
else else
j = getincangle(ps[g_p].getang(), getangle(g_sp->x - ps[g_p].posx, g_sp->y - ps[g_p].posy)); j = getincangle(ps[g_p].getang(), getangle(g_sp->x - ps[g_p].posx, g_sp->y - ps[g_p].posy));
@ -1198,7 +1198,7 @@ int parse(void)
case concmd_spritepal: case concmd_spritepal:
insptr++; insptr++;
if(g_sp->picnum != APLAYER) if(g_sp->picnum != TILE_APLAYER)
hittype[g_i].tempang = g_sp->pal; hittype[g_i].tempang = g_sp->pal;
g_sp->pal = *insptr; g_sp->pal = *insptr;
insptr++; insptr++;

View file

@ -201,7 +201,7 @@ enum
PIPE1B = 617, PIPE1B = 617,
PIPE3 = 618, PIPE3 = 618,
PIPE1 = 619, PIPE1 = 619,
DUKE_CAMERA1 = 621, CAMERA1 = 621,
BRICK = 626, BRICK = 626,
SPLINTERWOOD = 630, SPLINTERWOOD = 630,
PIPE2B = 633, PIPE2B = 633,
@ -402,7 +402,7 @@ enum
SCRATCH = 1393, SCRATCH = 1393,
FEM7 = 1395, FEM7 = 1395,
APLAYERTOP = 1400, APLAYERTOP = 1400,
DUKE_APLAYER = 1405, APLAYER = 1405,
PLAYERONWATER = 1420, PLAYERONWATER = 1420,
DUKELYINGDEAD = 1518, DUKELYINGDEAD = 1518,
DUKETORSO = 1520, DUKETORSO = 1520,
@ -766,6 +766,4 @@ enum
BOSS5STAYPUT = 5311, BOSS5STAYPUT = 5311,
}; };
extern int APLAYER;
extern int CAMERA1;
END_DUKE_NS END_DUKE_NS

View file

@ -295,7 +295,7 @@ enum
PIPE2B = 1126, PIPE2B = 1126,
BOLT1 = 1127, BOLT1 = 1127,
PIPE3B = 1132, PIPE3B = 1132,
RR_CAMERA1 = 1134, CAMERA1 = 1134,
BRICK = 1139, BRICK = 1139,
VACUUM = 1141, VACUUM = 1141,
JURYGUY = 1142, JURYGUY = 1142,
@ -969,7 +969,7 @@ enum
RRTILE3827 = 3827, RRTILE3827 = 3827,
RRTILE3837 = 3837, RRTILE3837 = 3837,
APLAYERTOP = 3840, APLAYERTOP = 3840,
RR_APLAYER = 3845, APLAYER = 3845,
PLAYERONWATER = 3860, PLAYERONWATER = 3860,
DUKELYINGDEAD = 3998, DUKELYINGDEAD = 3998,
DUKEGUN = 4041, DUKEGUN = 4041,
@ -1389,6 +1389,4 @@ enum
MAMAJIBB = 8895, MAMAJIBB = 8895,
}; };
extern int APLAYER;
extern int CAMERA1;
END_DUKE_NS END_DUKE_NS

View file

@ -3595,8 +3595,8 @@ enum redneck_weapon_t
// These names have been pieced together from RedneckGDX and RedNukem because the reconstructed source recycled Duke's names for the first 11 weapons. // These names have been pieced together from RedneckGDX and RedNukem because the reconstructed source recycled Duke's names for the first 11 weapons.
// Names for 0-2 are the same // Names for 0-2 are the same
RIFLEGUN_WEAPON = 3, RIFLEGUN_WEAPON = 3,
DYNAMITE_WEAPON = 4, DYNAMITE_WEAPON = 5,
CROSSBOW_WEAPON = 5, CROSSBOW_WEAPON = 4,
THROWSAW_WEAPON = 6, THROWSAW_WEAPON = 6,
ALIENBLASTER_WEAPON = 7, ALIENBLASTER_WEAPON = 7,
POWDERKEG_WEAPON = 8, POWDERKEG_WEAPON = 8,
@ -3610,8 +3610,6 @@ enum redneck_weapon_t
CHICKEN_WEAPON = 16, CHICKEN_WEAPON = 16,
}; };
extern int APLAYER, CAMERA1;
#define DYNAMICWEAPONMAP(Weaponnum) Weaponnum #define DYNAMICWEAPONMAP(Weaponnum) Weaponnum
END_DUKE_NS END_DUKE_NS

View file

@ -601,7 +601,7 @@ void operatesectors(int sn, int ii)
case ST_15_WARP_ELEVATOR://Warping elevators case ST_15_WARP_ELEVATOR://Warping elevators
if (sprite[ii].picnum != APLAYER) return; if (sprite[ii].picnum != TILE_APLAYER) return;
// if(ps[sprite[ii].yvel].select_dir == 1) return; // if(ps[sprite[ii].yvel].select_dir == 1) return;
i = headspritesect[sn]; i = headspritesect[sn];

View file

@ -2891,22 +2891,6 @@ void G_InitDynamicTiles(void)
{ {
int32_t i; int32_t i;
// this cannot include the constant headers so it has to use literal numbers
// Not sure yet about the weapons - this should probably be done by using the real RR constants where applicable
if (!isRR())
{
APLAYER = 3845;
CAMERA1 = 1134;
//DRONE = 1880;
}
else
{
APLAYER = 1405;
CAMERA1 = 621;
//DRONE = 4916;
}
Bmemset(DynamicTileMap, 0, sizeof(DynamicTileMap)); Bmemset(DynamicTileMap, 0, sizeof(DynamicTileMap));