- spawn function transitioned.

This commit is contained in:
Christoph Oelckers 2020-05-15 22:59:13 +02:00
parent cd55c21a5e
commit 26f3bc1857
26 changed files with 3850 additions and 3145 deletions

View file

@ -16,6 +16,9 @@ set( PCH_SOURCES
src/sectors_d.cpp src/sectors_d.cpp
src/sectors_r.cpp src/sectors_r.cpp
src/sounds.cpp src/sounds.cpp
src/spawn.cpp
src/spawn_d.cpp
src/spawn_r.cpp
src/zz_actors.cpp src/zz_actors.cpp
src/zz_anim.cpp src/zz_anim.cpp
src/zz_cheats.cpp src/zz_cheats.cpp

View file

@ -549,7 +549,7 @@ void movefx(void)
case RESPAWN: case RESPAWN:
if (sprite[i].extra == 66) if (sprite[i].extra == 66)
{ {
j = spawn(i, sprite[i].hitag); j = fi.spawn(i, sprite[i].hitag);
if (isRRRA()) if (isRRRA())
{ {
respawn_rrra(i, j); respawn_rrra(i, j);
@ -869,7 +869,7 @@ void moveflammable(int i, int tire, int box, int pool)
if (!isRR() && s->picnum == tire && hittype[i].temp_data[1] == 32) if (!isRR() && s->picnum == tire && hittype[i].temp_data[1] == 32)
{ {
s->cstat = 0; s->cstat = 0;
j = spawn(i, pool); j = fi.spawn(i, pool);
sprite[j].shade = 127; sprite[j].shade = 127;
} }
else else
@ -946,7 +946,7 @@ void detonate(int i, int explosion)
if ((t[3] == 1 && s->xrepeat) || s->lotag == -99) if ((t[3] == 1 && s->xrepeat) || s->lotag == -99)
{ {
int x = s->extra; int x = s->extra;
spawn(i, explosion); fi.spawn(i, explosion);
fi.hitradius(i, seenineblastradius, x >> 2, x - (x >> 1), x - (x >> 2), x); fi.hitradius(i, seenineblastradius, x >> 2, x - (x >> 1), x - (x >> 2), x);
spritesound(PIPEBOMB_EXPLODE, i); spritesound(PIPEBOMB_EXPLODE, i);
} }
@ -1271,7 +1271,7 @@ void movecanwithsomething(int i)
for (j = 0; j < 10; j++) for (j = 0; j < 10; j++)
RANDOMSCRAP(s, i); RANDOMSCRAP(s, i);
if (s->lotag) spawn(i, s->lotag); if (s->lotag) fi.spawn(i, s->lotag);
deletesprite(i); deletesprite(i);
} }
@ -1547,7 +1547,7 @@ void forcesphere(int i, int forcesphere)
for (int l = 512; l < (2048 - 512); l += 128) for (int l = 512; l < (2048 - 512); l += 128)
for (int j = 0; j < 2048; j += 128) for (int j = 0; j < 2048; j += 128)
{ {
int k = spawn(i, forcesphere); int k = fi.spawn(i, forcesphere);
sprite[k].cstat = 257 + 128; sprite[k].cstat = 257 + 128;
sprite[k].clipdist = 64; sprite[k].clipdist = 64;
sprite[k].ang = j; sprite[k].ang = j;
@ -1630,7 +1630,7 @@ void recon(int i, int explosion, int firelaser, int attacksnd, int painsnd, int
{ {
s->z += 1024; s->z += 1024;
t[2]++; t[2]++;
if ((t[2] & 3) == 0) spawn(i, explosion); if ((t[2] & 3) == 0) fi.spawn(i, explosion);
getglobalz(i); getglobalz(i);
s->ang += 96; s->ang += 96;
s->xvel = 128; s->xvel = 128;
@ -1641,7 +1641,7 @@ void recon(int i, int explosion, int firelaser, int attacksnd, int painsnd, int
RANDOMSCRAP(s, i); RANDOMSCRAP(s, i);
spritesound(LASERTRIP_EXPLODE, i); spritesound(LASERTRIP_EXPLODE, i);
int sp = getspawn(i); int sp = getspawn(i);
if (sp >= 0) spawn(i, sp); if (sp >= 0) fi.spawn(i, sp);
ps[myconnectindex].actors_killed++; ps[myconnectindex].actors_killed++;
deletesprite(i); deletesprite(i);
} }
@ -2514,7 +2514,7 @@ void scrap(int i, int SCRAP1, int SCRAP6)
{ {
if (s->picnum == SCRAP1 && s->yvel > 0) if (s->picnum == SCRAP1 && s->yvel > 0)
{ {
int j = spawn(i, s->yvel); int j = fi.spawn(i, s->yvel);
setsprite(j, s->x, s->y, s->z); setsprite(j, s->x, s->y, s->z);
getglobalz(j); getglobalz(j);
sprite[j].hitag = sprite[j].lotag = 0; sprite[j].hitag = sprite[j].lotag = 0;
@ -4537,12 +4537,12 @@ void handle_se35(int i, int SMALLSMOKE, int EXPLOSION2)
for (int j = 0; j < 8; j++) for (int j = 0; j < 8; j++)
{ {
s->ang += krand() & 511; s->ang += krand() & 511;
int k = spawn(i, SMALLSMOKE); int k = fi.spawn(i, SMALLSMOKE);
sprite[k].xvel = 96 + (krand() & 127); sprite[k].xvel = 96 + (krand() & 127);
ssp(k, CLIPMASK0); ssp(k, CLIPMASK0);
setsprite(k, sprite[k].x, sprite[k].y, sprite[k].z); setsprite(k, sprite[k].x, sprite[k].y, sprite[k].z);
if (rnd(16)) if (rnd(16))
spawn(i, EXPLOSION2); fi.spawn(i, EXPLOSION2);
} }
switch (t[0]) switch (t[0])
@ -4628,7 +4628,7 @@ void handle_se130(int i, int countmax, int EXPLOSION2)
if (rnd(64)) if (rnd(64))
{ {
int k = spawn(i, EXPLOSION2); int k = fi.spawn(i, EXPLOSION2);
sprite[k].xrepeat = sprite[k].yrepeat = 2 + (krand() & 7); sprite[k].xrepeat = sprite[k].yrepeat = 2 + (krand() & 7);
sprite[k].z = sc->floorz - (krand() % x); sprite[k].z = sc->floorz - (krand() % x);
sprite[k].ang += 256 - (krand() % 511); sprite[k].ang += 256 - (krand() % 511);
@ -5021,7 +5021,7 @@ void fall_common(int g_i, int g_p, int JIBS6, int DRONE, int BLOODPOOL, int SHOT
{ {
fi.guts(g_sp, JIBS6, 15, g_p); fi.guts(g_sp, JIBS6, 15, g_p);
spritesound(squished, g_i); spritesound(squished, g_i);
spawn(g_i, BLOODPOOL); fi.spawn(g_i, BLOODPOOL);
} }
} }

View file

@ -1005,7 +1005,7 @@ static void movetripbomb(int i)
x = s->extra; x = s->extra;
fi.hitradius(i, tripbombblastradius, x >> 2, x >> 1, x - (x >> 2), x); fi.hitradius(i, tripbombblastradius, x >> 2, x >> 1, x - (x >> 2), x);
j = spawn(i, EXPLOSION2); j = fi.spawn(i, EXPLOSION2);
sprite[j].ang = s->ang; sprite[j].ang = s->ang;
sprite[j].xvel = 348; sprite[j].xvel = 348;
ssp(j, CLIPMASK0); ssp(j, CLIPMASK0);
@ -1066,7 +1066,7 @@ static void movetripbomb(int i)
// we're on a trip wire // we're on a trip wire
while (x > 0) while (x > 0)
{ {
j = spawn(i, LASERLINE); j = fi.spawn(i, LASERLINE);
setsprite(j, sprite[j].x, sprite[j].y, sprite[j].z); setsprite(j, sprite[j].x, sprite[j].y, sprite[j].z);
sprite[j].hitag = s->hitag; sprite[j].hitag = s->hitag;
hittype[j].temp_data[1] = sprite[j].z; hittype[j].temp_data[1] = sprite[j].z;
@ -1177,7 +1177,7 @@ static void movefireext(int i)
sprite[j].pal = 2; sprite[j].pal = 2;
} }
spawn(i, EXPLOSION2); fi.spawn(i, EXPLOSION2);
spritesound(PIPEBOMB_EXPLODE, i); spritesound(PIPEBOMB_EXPLODE, i);
spritesound(GLASS_HEAVYBREAK, i); spritesound(GLASS_HEAVYBREAK, i);
@ -1193,7 +1193,7 @@ static void movefireext(int i)
} }
int x = s->extra; int x = s->extra;
spawn(i, EXPLOSION2); fi.spawn(i, EXPLOSION2);
fi.hitradius(i, pipebombblastradius, x >> 2, x - (x >> 1), x - (x >> 2), x); fi.hitradius(i, pipebombblastradius, x >> 2, x - (x >> 1), x - (x >> 2), x);
spritesound(PIPEBOMB_EXPLODE, i); spritesound(PIPEBOMB_EXPLODE, i);
detonate(i, EXPLOSION2); detonate(i, EXPLOSION2);
@ -1520,7 +1520,7 @@ void moveweapons_d(void)
case FREEZEBLAST: case FREEZEBLAST:
if (s->yvel < 1 || s->extra < 2 || (s->xvel|s->zvel) == 0) if (s->yvel < 1 || s->extra < 2 || (s->xvel|s->zvel) == 0)
{ {
j = spawn(i,TRANSPORTERSTAR); j = fi.spawn(i,TRANSPORTERSTAR);
sprite[j].pal = 1; sprite[j].pal = 1;
sprite[j].xrepeat = 32; sprite[j].xrepeat = 32;
sprite[j].yrepeat = 32; sprite[j].yrepeat = 32;
@ -1564,7 +1564,7 @@ void moveweapons_d(void)
case RPG: case RPG:
if (hittype[i].picnum != BOSS2 && s->xrepeat >= 10 && sector[s->sectnum].lotag != 2) if (hittype[i].picnum != BOSS2 && s->xrepeat >= 10 && sector[s->sectnum].lotag != 2)
{ {
j = spawn(i,SMALLSMOKE); j = fi.spawn(i,SMALLSMOKE);
sprite[j].z += (1 << 8); sprite[j].z += (1 << 8);
} }
break; break;
@ -1584,7 +1584,7 @@ void moveweapons_d(void)
{ {
float siz = 1.0f - (hittype[i].temp_data[0] * 0.2f); float siz = 1.0f - (hittype[i].temp_data[0] * 0.2f);
int trail = hittype[i].temp_data[1]; int trail = hittype[i].temp_data[1];
j = hittype[i].temp_data[1] = spawn(i, FIREBALL); j = hittype[i].temp_data[1] = fi.spawn(i, FIREBALL);
auto spr = &sprite[j]; auto spr = &sprite[j];
spr->xvel = sprite[i].xvel; spr->xvel = sprite[i].xvel;
@ -1688,7 +1688,7 @@ void moveweapons_d(void)
if (s->picnum == FREEZEBLAST && sprite[j].pal == 1) if (s->picnum == FREEZEBLAST && sprite[j].pal == 1)
if (badguy(&sprite[j]) || sprite[j].picnum == APLAYER) if (badguy(&sprite[j]) || sprite[j].picnum == APLAYER)
{ {
j = spawn(i,TRANSPORTERSTAR); j = fi.spawn(i,TRANSPORTERSTAR);
sprite[j].pal = 1; sprite[j].pal = 1;
sprite[j].xrepeat = 32; sprite[j].xrepeat = 32;
sprite[j].yrepeat = 32; sprite[j].yrepeat = 32;
@ -1746,7 +1746,7 @@ void moveweapons_d(void)
wall[wall[j].point2].y-wall[j].y); wall[wall[j].point2].y-wall[j].y);
s->ang = ((k << 1) - s->ang)&2047; s->ang = ((k << 1) - s->ang)&2047;
s->owner = i; s->owner = i;
spawn(i,TRANSPORTERSTAR); fi.spawn(i,TRANSPORTERSTAR);
continue; continue;
} }
else else
@ -1787,7 +1787,7 @@ void moveweapons_d(void)
} }
else if (fireball) else if (fireball)
{ {
j = spawn(i, LAVAPOOL); j = fi.spawn(i, LAVAPOOL);
sprite[j].owner = sprite[i].owner; sprite[j].owner = sprite[i].owner;
sprite[j].yvel = sprite[i].yvel; sprite[j].yvel = sprite[i].yvel;
actor[j].owner = sprite[i].owner; actor[j].owner = sprite[i].owner;
@ -1815,7 +1815,7 @@ void moveweapons_d(void)
{ {
if (s->picnum == RPG) if (s->picnum == RPG)
{ {
k = spawn(i,EXPLOSION2); k = fi.spawn(i,EXPLOSION2);
sprite[k].x = dax; sprite[k].x = dax;
sprite[k].y = day; sprite[k].y = day;
sprite[k].z = daz; sprite[k].z = daz;
@ -1828,19 +1828,19 @@ void moveweapons_d(void)
else if ((j&49152) == 16384) else if ((j&49152) == 16384)
{ {
if (s->zvel > 0) if (s->zvel > 0)
spawn(i,EXPLOSION2BOT); fi.spawn(i,EXPLOSION2BOT);
else { sprite[k].cstat |= 8; sprite[k].z += (48 << 8); } else { sprite[k].cstat |= 8; sprite[k].z += (48 << 8); }
} }
} }
else if (s->picnum == SHRINKSPARK) else if (s->picnum == SHRINKSPARK)
{ {
spawn(i,SHRINKEREXPLOSION); fi.spawn(i,SHRINKEREXPLOSION);
spritesound(SHRINKER_HIT,i); spritesound(SHRINKER_HIT,i);
fi.hitradius(i,shrinkerblastradius,0,0,0,0); fi.hitradius(i,shrinkerblastradius,0,0,0,0);
} }
else if (s->picnum != COOLEXPLOSION1 && s->picnum != FREEZEBLAST && s->picnum != FIRELASER && (!isWorldTour() || s->picnum != FIREBALL)) else if (s->picnum != COOLEXPLOSION1 && s->picnum != FREEZEBLAST && s->picnum != FIRELASER && (!isWorldTour() || s->picnum != FIREBALL))
{ {
k = spawn(i,EXPLOSION2); k = fi.spawn(i,EXPLOSION2);
sprite[k].xrepeat = sprite[k].yrepeat = s->xrepeat>>1; sprite[k].xrepeat = sprite[k].yrepeat = s->xrepeat>>1;
if ((j&49152) == 16384) if ((j&49152) == 16384)
{ {
@ -1867,7 +1867,7 @@ void moveweapons_d(void)
} }
if (fireball) if (fireball)
{ {
j = spawn(i, EXPLOSION2); j = fi.spawn(i, EXPLOSION2);
sprite[j].xrepeat = sprite[j].yrepeat = (short)(s->xrepeat >> 1); sprite[j].xrepeat = sprite[j].yrepeat = (short)(s->xrepeat >> 1);
} }
} }
@ -1887,7 +1887,7 @@ void moveweapons_d(void)
} }
} }
else if (s->picnum == RPG && sector[s->sectnum].lotag == 2 && s->xrepeat >= 10 && rnd(140)) else if (s->picnum == RPG && sector[s->sectnum].lotag == 2 && s->xrepeat >= 10 && rnd(140))
spawn(i,WATERBUBBLE); fi.spawn(i,WATERBUBBLE);
break; break;
case SHOTSPARK1: case SHOTSPARK1:
@ -1948,7 +1948,7 @@ void movetransports_d(void)
{ {
if (sprite[i].pal == 0) if (sprite[i].pal == 0)
{ {
spawn(i, TRANSPORTERBEAM); fi.spawn(i, TRANSPORTERBEAM);
spritesound(TELEPORTER, i); spritesound(TELEPORTER, i);
} }
@ -1977,7 +1977,7 @@ void movetransports_d(void)
if (sprite[i].pal == 0) if (sprite[i].pal == 0)
{ {
k = spawn(sprite[i].owner, TRANSPORTERBEAM); k = fi.spawn(sprite[i].owner, TRANSPORTERBEAM);
spritesound(TELEPORTER, k); spritesound(TELEPORTER, k);
} }
@ -2060,12 +2060,12 @@ void movetransports_d(void)
setpal(&ps[p]); setpal(&ps[p]);
if ((krand() & 255) < 32) if ((krand() & 255) < 32)
spawn(j, WATERSPLASH2); fi.spawn(j, WATERSPLASH2);
if (sectlotag == 1) if (sectlotag == 1)
for (l = 0; l < 9; l++) for (l = 0; l < 9; l++)
{ {
q = spawn(ps[p].i, WATERBUBBLE); q = fi.spawn(ps[p].i, WATERBUBBLE);
sprite[q].z += krand() & 16383; sprite[q].z += krand() & 16383;
} }
} }
@ -2144,7 +2144,7 @@ void movetransports_d(void)
if (sectlotag > 0) if (sectlotag > 0)
{ {
k = spawn(j, WATERSPLASH2); k = fi.spawn(j, WATERSPLASH2);
if (sectlotag == 1 && sprite[j].statnum == 4) if (sectlotag == 1 && sprite[j].statnum == 4)
{ {
sprite[k].xvel = sprite[j].xvel >> 1; sprite[k].xvel = sprite[j].xvel >> 1;
@ -2171,10 +2171,10 @@ void movetransports_d(void)
if (sprite[i].pal == 0) if (sprite[i].pal == 0)
{ {
k = spawn(i, TRANSPORTERBEAM); k = fi.spawn(i, TRANSPORTERBEAM);
spritesound(TELEPORTER, k); spritesound(TELEPORTER, k);
k = spawn(sprite[i].owner, TRANSPORTERBEAM); k = fi.spawn(sprite[i].owner, TRANSPORTERBEAM);
spritesound(TELEPORTER, k); spritesound(TELEPORTER, k);
} }
@ -2351,7 +2351,7 @@ static void greenslime(int i)
spritesound(SQUISHED, i); spritesound(SQUISHED, i);
if ((krand() & 255) < 32) if ((krand() & 255) < 32)
{ {
j = spawn(i, BLOODPOOL); j = fi.spawn(i, BLOODPOOL);
sprite[j].pal = 0; sprite[j].pal = 0;
} }
ps[p].actors_killed++; ps[p].actors_killed++;
@ -2451,7 +2451,7 @@ static void greenslime(int i)
if ((krand() & 255) < 32) if ((krand() & 255) < 32)
{ {
j = spawn(i, BLOODPOOL); j = fi.spawn(i, BLOODPOOL);
sprite[j].pal = 0; sprite[j].pal = 0;
} }
@ -2663,7 +2663,7 @@ static void flamethrowerflame(int i)
t[0]++; t[0]++;
if (sector[sect].lotag == 2) if (sector[sect].lotag == 2)
{ {
sprite[spawn(i, EXPLOSION2)].shade = 127; sprite[fi.spawn(i, EXPLOSION2)].shade = 127;
deletesprite(i); deletesprite(i);
return; return;
} }
@ -2682,7 +2682,7 @@ static void flamethrowerflame(int i)
t[3] = krand() % 10; t[3] = krand() % 10;
if (t[0] > 30) if (t[0] > 30)
{ {
sprite[spawn(i, EXPLOSION2)].shade = 127; sprite[fi.spawn(i, EXPLOSION2)].shade = 127;
deletesprite(i); deletesprite(i);
return; return;
} }
@ -2766,7 +2766,7 @@ static void heavyhbomb(int i)
if (t[2] <= 0) if (t[2] <= 0)
{ {
spritesound(TELEPORTER, i); spritesound(TELEPORTER, i);
spawn(i, TRANSPORTERSTAR); fi.spawn(i, TRANSPORTERSTAR);
s->cstat = 257; s->cstat = 257;
} }
return; return;
@ -2821,7 +2821,7 @@ static void heavyhbomb(int i)
if (t[5] == 0) if (t[5] == 0)
{ {
t[5] = 1; t[5] = 1;
spawn(i, WATERSPLASH2); fi.spawn(i, WATERSPLASH2);
} }
} }
else t[5] = 0; else t[5] = 0;
@ -2891,9 +2891,9 @@ DETONATEB:
} }
fi.hitradius(i, m, x >> 2, x >> 1, x - (x >> 2), x); fi.hitradius(i, m, x >> 2, x >> 1, x - (x >> 2), x);
spawn(i, EXPLOSION2); fi.spawn(i, EXPLOSION2);
if (s->zvel == 0) if (s->zvel == 0)
spawn(i, EXPLOSION2BOT); fi.spawn(i, EXPLOSION2BOT);
spritesound(PIPEBOMB_EXPLODE, i); spritesound(PIPEBOMB_EXPLODE, i);
for (x = 0; x < 8; x++) for (x = 0; x < 8; x++)
RANDOMSCRAP(s, i); RANDOMSCRAP(s, i);
@ -2915,7 +2915,7 @@ DETONATEB:
else else
{ {
t[2] = respawnitemtime; t[2] = respawnitemtime;
spawn(i, RESPAWNMARKERRED); fi.spawn(i, RESPAWNMARKERRED);
s->cstat = (short)32768; s->cstat = (short)32768;
s->yrepeat = 9; s->yrepeat = 9;
return; return;
@ -2958,7 +2958,7 @@ DETONATEB:
else else
{ {
t[2] = respawnitemtime; t[2] = respawnitemtime;
spawn(i, RESPAWNMARKERRED); fi.spawn(i, RESPAWNMARKERRED);
s->cstat = (short)32768; s->cstat = (short)32768;
} }
} }
@ -3079,7 +3079,7 @@ void moveactors_d(void)
continue; continue;
} }
else if ((t[0] & 3) == 0) else if ((t[0] & 3) == 0)
spawn(i, EXPLOSION2); fi.spawn(i, EXPLOSION2);
ssp(i, CLIPMASK0); ssp(i, CLIPMASK0);
break; break;
case RAT: case RAT:
@ -3115,7 +3115,7 @@ void moveactors_d(void)
case BOUNCEMINE: case BOUNCEMINE:
case MORTER: case MORTER:
j = spawn(i, FRAMEEFFECT1); j = fi.spawn(i, FRAMEEFFECT1);
hittype[j].temp_data[0] = 3; hittype[j].temp_data[0] = 3;
case HEAVYHBOMB: case HEAVYHBOMB:
@ -3743,7 +3743,7 @@ void moveeffectors_d(void) //STATNUM 3
if (rnd(32) && (hittype[i].temp_data[2] & 1)) if (rnd(32) && (hittype[i].temp_data[2] & 1))
{ {
sprite[j].cstat &= 32767; sprite[j].cstat &= 32767;
spawn(j, SMALLSMOKE); fi.spawn(j, SMALLSMOKE);
p = findplayer(s, &x); p = findplayer(s, &x);
x = ldist(&sprite[ps[p].i], &sprite[j]); x = ldist(&sprite[ps[p].i], &sprite[j]);

View file

@ -1178,7 +1178,7 @@ void moveweapons_r(void)
case FREEZEBLAST: case FREEZEBLAST:
if (s->yvel < 1 || s->extra < 2 || (s->xvel | s->zvel) == 0) if (s->yvel < 1 || s->extra < 2 || (s->xvel | s->zvel) == 0)
{ {
j = spawn(i, TRANSPORTERSTAR); j = fi.spawn(i, TRANSPORTERSTAR);
sprite[j].pal = 1; sprite[j].pal = 1;
sprite[j].xrepeat = 32; sprite[j].xrepeat = 32;
sprite[j].yrepeat = 32; sprite[j].yrepeat = 32;
@ -1223,7 +1223,7 @@ void moveweapons_r(void)
case RPG: case RPG:
if (hittype[i].picnum != BOSS2 && s->xrepeat >= 10 && sector[s->sectnum].lotag != 2) if (hittype[i].picnum != BOSS2 && s->xrepeat >= 10 && sector[s->sectnum].lotag != 2)
{ {
j = spawn(i, SMALLSMOKE); j = fi.spawn(i, SMALLSMOKE);
sprite[j].z += (1 << 8); sprite[j].z += (1 << 8);
} }
break; break;
@ -1232,11 +1232,11 @@ void moveweapons_r(void)
s->hitag++; s->hitag++;
if (hittype[i].picnum != BOSS2 && s->xrepeat >= 10 && sector[s->sectnum].lotag != 2) if (hittype[i].picnum != BOSS2 && s->xrepeat >= 10 && sector[s->sectnum].lotag != 2)
{ {
j = spawn(i, SMALLSMOKE); j = fi.spawn(i, SMALLSMOKE);
sprite[j].z += (1 << 8); sprite[j].z += (1 << 8);
if ((krand() & 15) == 2) if ((krand() & 15) == 2)
{ {
j = spawn(i, 1310); j = fi.spawn(i, 1310);
} }
} }
if (sprite[s->lotag].extra <= 0) if (sprite[s->lotag].extra <= 0)
@ -1282,7 +1282,7 @@ void moveweapons_r(void)
makeitfall(i); makeitfall(i);
if (s->xrepeat >= 10 && sector[s->sectnum].lotag != 2) if (s->xrepeat >= 10 && sector[s->sectnum].lotag != 2)
{ {
j = spawn(i, SMALLSMOKE); j = fi.spawn(i, SMALLSMOKE);
sprite[j].z += (1 << 8); sprite[j].z += (1 << 8);
} }
break; break;
@ -1350,7 +1350,7 @@ void moveweapons_r(void)
&& sprite[j].pal == 19) && sprite[j].pal == 19)
{ {
spritesound(RPG_EXPLODE, i); spritesound(RPG_EXPLODE, i);
k = spawn(i, EXPLOSION2); k = fi.spawn(i, EXPLOSION2);
sprite[k].x = dax; sprite[k].x = dax;
sprite[k].y = day; sprite[k].y = day;
sprite[k].z = daz; sprite[k].z = daz;
@ -1360,7 +1360,7 @@ void moveweapons_r(void)
else if (s->picnum == FREEZEBLAST && sprite[j].pal == 1) else if (s->picnum == FREEZEBLAST && sprite[j].pal == 1)
if (badguy(&sprite[j]) || sprite[j].picnum == APLAYER) if (badguy(&sprite[j]) || sprite[j].picnum == APLAYER)
{ {
j = spawn(i,TRANSPORTERSTAR); j = fi.spawn(i,TRANSPORTERSTAR);
sprite[j].pal = 1; sprite[j].pal = 1;
sprite[j].xrepeat = 32; sprite[j].xrepeat = 32;
sprite[j].yrepeat = 32; sprite[j].yrepeat = 32;
@ -1422,7 +1422,7 @@ void moveweapons_r(void)
wall[wall[j].point2].y - wall[j].y); wall[wall[j].point2].y - wall[j].y);
s->ang = ((k << 1) - s->ang) & 2047; s->ang = ((k << 1) - s->ang) & 2047;
s->owner = i; s->owner = i;
spawn(i, TRANSPORTERSTAR); fi.spawn(i, TRANSPORTERSTAR);
continue; continue;
} }
else else
@ -1460,7 +1460,7 @@ void moveweapons_r(void)
s->y += sintable[s->ang & 2047] >> 7; s->y += sintable[s->ang & 2047] >> 7;
if (!isRRRA() || (sprite[s->owner].picnum != CHEER && sprite[s->owner].picnum != CHEERSTAYPUT)) if (!isRRRA() || (sprite[s->owner].picnum != CHEER && sprite[s->owner].picnum != CHEERSTAYPUT))
{ {
j = spawn(i, CIRCLESTUCK); j = fi.spawn(i, CIRCLESTUCK);
sprite[j].xrepeat = 8; sprite[j].xrepeat = 8;
sprite[j].yrepeat = 8; sprite[j].yrepeat = 8;
sprite[j].cstat = 16; sprite[j].cstat = 16;
@ -1525,7 +1525,7 @@ void moveweapons_r(void)
{ {
if (s->picnum == RPG) if (s->picnum == RPG)
{ {
k = spawn(i, EXPLOSION2); k = fi.spawn(i, EXPLOSION2);
sprite[k].x = dax; sprite[k].x = dax;
sprite[k].y = day; sprite[k].y = day;
sprite[k].z = daz; sprite[k].z = daz;
@ -1543,7 +1543,7 @@ void moveweapons_r(void)
} }
else if (isRRRA() && s->picnum == RPG2) else if (isRRRA() && s->picnum == RPG2)
{ {
k = spawn(i, EXPLOSION2); k = fi.spawn(i, EXPLOSION2);
sprite[k].x = dax; sprite[k].x = dax;
sprite[k].y = day; sprite[k].y = day;
sprite[k].z = daz; sprite[k].z = daz;
@ -1562,7 +1562,7 @@ void moveweapons_r(void)
else if (isRRRA() && s->picnum == RRTILE1790) else if (isRRRA() && s->picnum == RRTILE1790)
{ {
s->extra = 160; s->extra = 160;
k = spawn(i, EXPLOSION2); k = fi.spawn(i, EXPLOSION2);
sprite[k].x = dax; sprite[k].x = dax;
sprite[k].y = day; sprite[k].y = day;
sprite[k].z = daz; sprite[k].z = daz;
@ -1580,7 +1580,7 @@ void moveweapons_r(void)
} }
else if (s->picnum != FREEZEBLAST && s->picnum != FIRELASER && s->picnum != SHRINKSPARK) else if (s->picnum != FREEZEBLAST && s->picnum != FIRELASER && s->picnum != SHRINKSPARK)
{ {
k = spawn(i, 1441); k = fi.spawn(i, 1441);
sprite[k].xrepeat = sprite[k].yrepeat = s->xrepeat >> 1; sprite[k].xrepeat = sprite[k].yrepeat = s->xrepeat >> 1;
if ((j & 49152) == 16384) if ((j & 49152) == 16384)
{ {
@ -1642,7 +1642,7 @@ void moveweapons_r(void)
continue; continue;
} }
if ((s->picnum == RPG || (isRRRA() && s->picnum == RPG2)) && sector[s->sectnum].lotag == 2 && s->xrepeat >= 10 && rnd(184)) if ((s->picnum == RPG || (isRRRA() && s->picnum == RPG2)) && sector[s->sectnum].lotag == 2 && s->xrepeat >= 10 && rnd(184))
spawn(i, WATERBUBBLE); fi.spawn(i, WATERBUBBLE);
continue; continue;
@ -1707,7 +1707,7 @@ void movetransports_r(void)
{ {
if (ps[p].on_ground && sectlotag == 0 && onfloorz && ps[p].jetpack_on == 0) if (ps[p].on_ground && sectlotag == 0 && onfloorz && ps[p].jetpack_on == 0)
{ {
spawn(i, TRANSPORTERBEAM); fi.spawn(i, TRANSPORTERBEAM);
spritesound(TELEPORTER, i); spritesound(TELEPORTER, i);
for (k = connecthead; k >= 0; k = connectpoint2[k])// connectpoinhittype[i].temp_data[1][k]) for (k = connecthead; k >= 0; k = connectpoint2[k])// connectpoinhittype[i].temp_data[1][k])
@ -1733,7 +1733,7 @@ void movetransports_r(void)
changespritesect(j, sprite[OW].sectnum); changespritesect(j, sprite[OW].sectnum);
ps[p].cursectnum = sprite[j].sectnum; ps[p].cursectnum = sprite[j].sectnum;
k = spawn(OW, TRANSPORTERBEAM); k = fi.spawn(OW, TRANSPORTERBEAM);
spritesound(TELEPORTER, k); spritesound(TELEPORTER, k);
break; break;
@ -1823,7 +1823,7 @@ void movetransports_r(void)
setpal(&ps[p]); setpal(&ps[p]);
if ((krand() & 255) < 32) if ((krand() & 255) < 32)
spawn(ps[p].i, WATERSPLASH2); fi.spawn(ps[p].i, WATERSPLASH2);
} }
else if (isRRRA() && k == 2) else if (isRRRA() && k == 2)
{ {
@ -1925,7 +1925,7 @@ void movetransports_r(void)
if (sectlotag > 0) if (sectlotag > 0)
{ {
k = spawn(j, WATERSPLASH2); k = fi.spawn(j, WATERSPLASH2);
if (sectlotag == 1 && sprite[j].statnum == 4) if (sectlotag == 1 && sprite[j].statnum == 4)
{ {
sprite[k].xvel = sprite[j].xvel >> 1; sprite[k].xvel = sprite[j].xvel >> 1;
@ -1950,10 +1950,10 @@ void movetransports_r(void)
hittype[j].bposy = sprite[j].y; hittype[j].bposy = sprite[j].y;
hittype[j].bposz = sprite[j].z; hittype[j].bposz = sprite[j].z;
k = spawn(i, TRANSPORTERBEAM); k = fi.spawn(i, TRANSPORTERBEAM);
spritesound(TELEPORTER, k); spritesound(TELEPORTER, k);
k = spawn(OW, TRANSPORTERBEAM); k = fi.spawn(OW, TRANSPORTERBEAM);
spritesound(TELEPORTER, k); spritesound(TELEPORTER, k);
if (sprite[OW].owner != OW) if (sprite[OW].owner != OW)
@ -2088,7 +2088,7 @@ static void rrra_specialstats()
sprite[i].extra--; sprite[i].extra--;
if (sprite[i].extra <= -104) if (sprite[i].extra <= -104)
{ {
spawn(i, sprite[i].lotag); fi.spawn(i, sprite[i].lotag);
deletesprite(i); deletesprite(i);
} }
} }
@ -2221,7 +2221,7 @@ static void rrra_specialstats()
setsprite(i, sprite[i].x, sprite[i].y, sector[sprite[i].sectnum].floorz - 10); setsprite(i, sprite[i].x, sprite[i].y, sector[sprite[i].sectnum].floorz - 10);
sprite[i].extra = 1; sprite[i].extra = 1;
sprite[i].picnum = PIG + 11; sprite[i].picnum = PIG + 11;
spawn(i, TRANSPORTERSTAR); fi.spawn(i, TRANSPORTERSTAR);
} }
i = nexti; i = nexti;
} }
@ -2236,7 +2236,7 @@ static void rrra_specialstats()
{ {
sprite[i].hitag--; sprite[i].hitag--;
sprite[i].extra = 150; sprite[i].extra = 150;
spawn(i, RABBIT); fi.spawn(i, RABBIT);
} }
else else
sprite[i].extra--; sprite[i].extra--;
@ -2298,7 +2298,7 @@ static void rrra_specialstats()
else else
{ {
sprite[i].picnum = RRTILE8162 + 2; sprite[i].picnum = RRTILE8162 + 2;
spawn(i, BATTERYAMMO); fi.spawn(i, BATTERYAMMO);
ps[screenpeek].SlotWin |= 1; ps[screenpeek].SlotWin |= 1;
spritesound(52, i); spritesound(52, i);
} }
@ -2312,7 +2312,7 @@ static void rrra_specialstats()
else else
{ {
sprite[i].picnum = RRTILE8162 + 6; sprite[i].picnum = RRTILE8162 + 6;
spawn(i, HEAVYHBOMB); fi.spawn(i, HEAVYHBOMB);
ps[screenpeek].SlotWin |= 2; ps[screenpeek].SlotWin |= 2;
spritesound(52, i); spritesound(52, i);
} }
@ -2326,7 +2326,7 @@ static void rrra_specialstats()
else else
{ {
sprite[i].picnum = RRTILE8162 + 5; sprite[i].picnum = RRTILE8162 + 5;
spawn(i, SIXPAK); fi.spawn(i, SIXPAK);
ps[screenpeek].SlotWin |= 4; ps[screenpeek].SlotWin |= 4;
spritesound(52, i); spritesound(52, i);
} }
@ -2340,7 +2340,7 @@ static void rrra_specialstats()
else else
{ {
sprite[i].picnum = RRTILE8162 + 4; sprite[i].picnum = RRTILE8162 + 4;
spawn(i, ATOMICHEALTH); fi.spawn(i, ATOMICHEALTH);
ps[screenpeek].SlotWin |= 8; ps[screenpeek].SlotWin |= 8;
spritesound(52, i); spritesound(52, i);
} }
@ -2376,7 +2376,7 @@ static void rrra_specialstats()
else else
{ {
sprite[i].picnum = RRTILE8589 + 5; sprite[i].picnum = RRTILE8589 + 5;
spawn(i, BATTERYAMMO); fi.spawn(i, BATTERYAMMO);
ps[screenpeek].SlotWin |= 1; ps[screenpeek].SlotWin |= 1;
spritesound(342, i); spritesound(342, i);
} }
@ -2390,7 +2390,7 @@ static void rrra_specialstats()
else else
{ {
sprite[i].picnum = RRTILE8589 + 6; sprite[i].picnum = RRTILE8589 + 6;
spawn(i, HEAVYHBOMB); fi.spawn(i, HEAVYHBOMB);
ps[screenpeek].SlotWin |= 2; ps[screenpeek].SlotWin |= 2;
spritesound(342, i); spritesound(342, i);
} }
@ -2404,7 +2404,7 @@ static void rrra_specialstats()
else else
{ {
sprite[i].picnum = RRTILE8589 + 2; sprite[i].picnum = RRTILE8589 + 2;
spawn(i, SIXPAK); fi.spawn(i, SIXPAK);
ps[screenpeek].SlotWin |= 4; ps[screenpeek].SlotWin |= 4;
spritesound(342, i); spritesound(342, i);
} }
@ -2418,7 +2418,7 @@ static void rrra_specialstats()
else else
{ {
sprite[i].picnum = RRTILE8589 + 3; sprite[i].picnum = RRTILE8589 + 3;
spawn(i, ATOMICHEALTH); fi.spawn(i, ATOMICHEALTH);
ps[screenpeek].SlotWin |= 8; ps[screenpeek].SlotWin |= 8;
spritesound(342, i); spritesound(342, i);
} }
@ -2499,7 +2499,7 @@ void rr_specialstats()
sprite[i].lotag--; sprite[i].lotag--;
if (sprite[i].lotag < 0) if (sprite[i].lotag < 0)
{ {
j = spawn(i, RRTILE3190); j = fi.spawn(i, RRTILE3190);
sprite[j].ang = sprite[i].ang; sprite[j].ang = sprite[i].ang;
sprite[i].lotag = 128; sprite[i].lotag = 128;
} }
@ -2508,7 +2508,7 @@ void rr_specialstats()
sprite[i].lotag--; sprite[i].lotag--;
if (sprite[i].lotag < 0) if (sprite[i].lotag < 0)
{ {
j = spawn(i, RRTILE3192); j = fi.spawn(i, RRTILE3192);
sprite[j].ang = sprite[i].ang; sprite[j].ang = sprite[i].ang;
sprite[i].lotag = 256; sprite[i].lotag = 256;
} }
@ -2525,7 +2525,7 @@ void rr_specialstats()
sprite[i].lotag--; sprite[i].lotag--;
if (sprite[i].lotag < 0) if (sprite[i].lotag < 0)
{ {
j = spawn(i, RRTILE3132); j = fi.spawn(i, RRTILE3132);
sprite[i].lotag = 96; sprite[i].lotag = 96;
if (!isRRRA()) spritesound(472, j); if (!isRRRA()) spritesound(472, j);
} }
@ -2534,7 +2534,7 @@ void rr_specialstats()
sprite[i].lotag--; sprite[i].lotag--;
if (sprite[i].lotag < 0) if (sprite[i].lotag < 0)
{ {
j = spawn(i, RRTILE3120); j = fi.spawn(i, RRTILE3120);
sprite[j].ang = sprite[i].ang; sprite[j].ang = sprite[i].ang;
sprite[i].lotag = 448; sprite[i].lotag = 448;
} }
@ -2543,7 +2543,7 @@ void rr_specialstats()
sprite[i].lotag--; sprite[i].lotag--;
if (sprite[i].lotag < 0) if (sprite[i].lotag < 0)
{ {
j = spawn(i, RRTILE3122); j = fi.spawn(i, RRTILE3122);
sprite[j].ang = sprite[i].ang; sprite[j].ang = sprite[i].ang;
sprite[i].lotag = 64; sprite[i].lotag = 64;
} }
@ -2552,7 +2552,7 @@ void rr_specialstats()
sprite[i].lotag--; sprite[i].lotag--;
if (sprite[i].lotag < 0) if (sprite[i].lotag < 0)
{ {
j = spawn(i, RRTILE3123); j = fi.spawn(i, RRTILE3123);
sprite[j].ang = sprite[i].ang; sprite[j].ang = sprite[i].ang;
sprite[i].lotag = 512; sprite[i].lotag = 512;
} }
@ -2561,7 +2561,7 @@ void rr_specialstats()
sprite[i].lotag--; sprite[i].lotag--;
if (sprite[i].lotag < 0) if (sprite[i].lotag < 0)
{ {
j = spawn(i, RRTILE3124); j = fi.spawn(i, RRTILE3124);
sprite[j].ang = sprite[i].ang; sprite[j].ang = sprite[i].ang;
sprite[i].lotag = 224; sprite[i].lotag = 224;
} }
@ -2665,7 +2665,7 @@ static void heavyhbomb(int i)
if (t[2] <= 0) if (t[2] <= 0)
{ {
spritesound(TELEPORTER, i); spritesound(TELEPORTER, i);
spawn(i, TRANSPORTERSTAR); fi.spawn(i, TRANSPORTERSTAR);
s->cstat = 257; s->cstat = 257;
} }
return; return;
@ -2727,7 +2727,7 @@ static void heavyhbomb(int i)
if (t[5] == 0) if (t[5] == 0)
{ {
t[5] = 1; t[5] = 1;
spawn(i, WATERSPLASH2); fi.spawn(i, WATERSPLASH2);
if (isRRRA() && s->picnum == MORTER) if (isRRRA() && s->picnum == MORTER)
s->xvel = 0; s->xvel = 0;
} }
@ -2811,9 +2811,9 @@ DETONATEB:
if (sector[s->sectnum].lotag != 800) if (sector[s->sectnum].lotag != 800)
{ {
fi.hitradius(i, m, x >> 2, x >> 1, x - (x >> 2), x); fi.hitradius(i, m, x >> 2, x >> 1, x - (x >> 2), x);
spawn(i, EXPLOSION2); fi.spawn(i, EXPLOSION2);
if (s->picnum == CHEERBOMB) if (s->picnum == CHEERBOMB)
spawn(i, BURNING); fi.spawn(i, BURNING);
spritesound(PIPEBOMB_EXPLODE, i); spritesound(PIPEBOMB_EXPLODE, i);
for (x = 0; x < 8; x++) for (x = 0; x < 8; x++)
RANDOMSCRAP(s, i); RANDOMSCRAP(s, i);
@ -2833,7 +2833,7 @@ DETONATEB:
} }
if (s->picnum == CHEERBOMB) if (s->picnum == CHEERBOMB)
{ {
spawn(i, BURNING); fi.spawn(i, BURNING);
deletesprite(i); deletesprite(i);
return; return;
} }
@ -2876,7 +2876,7 @@ DETONATEB:
else else
{ {
t[2] = respawnitemtime; t[2] = respawnitemtime;
spawn(i, RESPAWNMARKERRED); fi.spawn(i, RESPAWNMARKERRED);
s->cstat = (short)32768; s->cstat = (short)32768;
} }
} }
@ -2902,7 +2902,7 @@ static int henstand(int i)
s->lotag--; s->lotag--;
if (s->lotag == 0) if (s->lotag == 0)
{ {
spawn(i, HEN); fi.spawn(i, HEN);
deletesprite(i); deletesprite(i);
return 1; return 1;
} }
@ -2932,7 +2932,7 @@ static int henstand(int i)
fi.checkhitsprite(i, j); fi.checkhitsprite(i, j);
if (sprite[j].picnum == HEN) if (sprite[j].picnum == HEN)
{ {
int ns = spawn(j, HENSTAND); int ns = fi.spawn(j, HENSTAND);
deletesprite(j); deletesprite(j);
sprite[ns].xvel = 32; sprite[ns].xvel = 32;
sprite[ns].lotag = 40; sprite[ns].lotag = 40;
@ -3117,7 +3117,7 @@ void moveactors_r(void)
{ {
if (sector[s->sectnum].lotag == 1) if (sector[s->sectnum].lotag == 1)
{ {
j = spawn(i,WATERSPLASH2); j = fi.spawn(i,WATERSPLASH2);
sprite[j].z = sector[sprite[j].sectnum].floorz; sprite[j].z = sector[sprite[j].sectnum].floorz;
} }
deletesprite(i); deletesprite(i);
@ -3132,7 +3132,7 @@ void moveactors_r(void)
} }
else else
{ {
spawn(i,BOWLINGBALLSPRITE); fi.spawn(i,BOWLINGBALLSPRITE);
deletesprite(i); deletesprite(i);
continue; continue;
} }
@ -3555,7 +3555,7 @@ void moveeffectors_r(void) //STATNUM 3
if ((!isRRRA() || lastlevel) && hulkspawn) if ((!isRRRA() || lastlevel) && hulkspawn)
{ {
hulkspawn--; hulkspawn--;
ns = spawn(i, HULK); ns = fi.spawn(i, HULK);
sprite[ns].z = sector[sprite[ns].sectnum].ceilingz; sprite[ns].z = sector[sprite[ns].sectnum].ceilingz;
sprite[ns].pal = 33; sprite[ns].pal = 33;
if (!hulkspawn) if (!hulkspawn)
@ -3565,7 +3565,7 @@ void moveeffectors_r(void) //STATNUM 3
sprite[ns].pal = 7; sprite[ns].pal = 7;
sprite[ns].xrepeat = 80; sprite[ns].xrepeat = 80;
sprite[ns].yrepeat = 255; sprite[ns].yrepeat = 255;
ns = spawn(i, 296); ns = fi.spawn(i, 296);
sprite[ns].cstat = 0; sprite[ns].cstat = 0;
sprite[ns].cstat |= 32768; sprite[ns].cstat |= 32768;
sprite[ns].z = sector[s->sectnum].floorz - 6144; sprite[ns].z = sector[s->sectnum].floorz - 6144;
@ -3608,7 +3608,7 @@ void moveeffectors_r(void) //STATNUM 3
} }
} }
else pn = UFO1_RRRA; else pn = UFO1_RRRA;
ns = spawn(i, pn); ns = fi.spawn(i, pn);
sprite[ns].z = sector[sprite[ns].sectnum].ceilingz; sprite[ns].z = sector[sprite[ns].sectnum].ceilingz;
} }
j = nextj; j = nextj;
@ -4360,16 +4360,16 @@ void fakebubbaspawn(int g_i, int g_p)
default: default:
break; break;
case 1: case 1:
spawn(g_i, PIG); fi.spawn(g_i, PIG);
break; break;
case 2: case 2:
spawn(g_i, MINION); fi.spawn(g_i, MINION);
break; break;
case 3: case 3:
spawn(g_i, CHEER); fi.spawn(g_i, CHEER);
break; break;
case 4: case 4:
spawn(g_i, VIXEN); fi.spawn(g_i, VIXEN);
operateactivators(666, ps[g_p].i); operateactivators(666, ps[g_p].i);
break; break;
} }
@ -4391,8 +4391,8 @@ static int fallspecial(int g_i, int g_p)
{ {
if (g_sp->picnum == ROCK) if (g_sp->picnum == ROCK)
{ {
spawn(g_i, ROCK2); fi.spawn(g_i, ROCK2);
spawn(g_i, ROCK2); fi.spawn(g_i, ROCK2);
addspritetodelete(g_i); addspritetodelete(g_i);
} }
return 0; return 0;
@ -4613,7 +4613,7 @@ void mamaspawn(int g_i)
if (mamaspawn_count) if (mamaspawn_count)
{ {
mamaspawn_count--; mamaspawn_count--;
spawn(g_i, RABBIT); fi.spawn(g_i, RABBIT);
} }
} }

View file

@ -52,7 +52,7 @@ void ballreturn(short spr)
nextj = nextspritestat[j]; nextj = nextspritestat[j];
if (sprite[j].picnum == RRTILE282) if (sprite[j].picnum == RRTILE282)
if (sprite[i].hitag == sprite[j].hitag) if (sprite[i].hitag == sprite[j].hitag)
spawn(j, BOWLINGBALLSPRITE); fi.spawn(j, BOWLINGBALLSPRITE);
if (sprite[j].picnum == RRTILE280) if (sprite[j].picnum == RRTILE280)
if (sprite[i].hitag == sprite[j].hitag) if (sprite[i].hitag == sprite[j].hitag)
if (sprite[j].lotag == 0) if (sprite[j].lotag == 0)
@ -207,7 +207,7 @@ void resetpins(short sect)
nexti = nextspritesect[i]; nexti = nextspritesect[i];
if (sprite[i].picnum == 283) if (sprite[i].picnum == 283)
{ {
j = spawn(i,3440); j = fi.spawn(i,3440);
sprite[j].lotag = sprite[i].lotag; sprite[j].lotag = sprite[i].lotag;
if (sprite[j].lotag == 3 || sprite[j].lotag == 5) if (sprite[j].lotag == 3 || sprite[j].lotag == 5)
{ {

View file

@ -86,6 +86,8 @@ void checktimetosleep_d(int g_i);
void checktimetosleep_r(int g_i); void checktimetosleep_r(int g_i);
void move_d(int g_i, int g_p, int g_x); void move_d(int g_i, int g_p, int g_x);
void move_r(int g_i, int g_p, int g_x); void move_r(int g_i, int g_p, int g_x);
int spawn_d(int j, int pn);
int spawn_r(int j, int pn);
Dispatcher fi; Dispatcher fi;
@ -122,7 +124,8 @@ void SetDispatcher()
spawnweapondebris_d, spawnweapondebris_d,
respawnhitag_d, respawnhitag_d,
checktimetosleep_d, checktimetosleep_d,
move_d move_d,
spawn_d,
}; };
} }
else else
@ -157,6 +160,7 @@ void SetDispatcher()
respawnhitag_r, respawnhitag_r,
checktimetosleep_r, checktimetosleep_r,
move_r, move_r,
spawn_r,
}; };
} }
} }

View file

@ -230,11 +230,6 @@ inline int inventory(spritetype* S)
int32_t A_InsertSprite(int16_t whatsect, int32_t s_x, int32_t s_y, int32_t s_z, int16_t s_pn, int8_t s_s, uint8_t s_xr, int32_t A_InsertSprite(int16_t whatsect, int32_t s_x, int32_t s_y, int32_t s_z, int16_t s_pn, int8_t s_s, uint8_t s_xr,
uint8_t s_yr, int16_t s_a, int16_t s_ve, int16_t s_zv, int16_t s_ow, int16_t s_ss); uint8_t s_yr, int16_t s_a, int16_t s_ve, int16_t s_zv, int16_t s_ow, int16_t s_ss);
#define EGS A_InsertSprite #define EGS A_InsertSprite
int A_Spawn(int spriteNum,int tileNum);
inline int spawn(int s, int t)
{
return A_Spawn(s, t);
}
int G_DoMoveThings(void); int G_DoMoveThings(void);
//int32_t G_EndOfLevel(void); //int32_t G_EndOfLevel(void);
@ -291,7 +286,7 @@ void OnBoat(DukePlayer_t *pPlayer, int spriteNum);
void OffBoat(DukePlayer_t *pPlayer); void OffBoat(DukePlayer_t *pPlayer);
// Cstat protection mask for (currently) spawned MASKWALL* sprites. // Cstat protection mask for (currently) spawned MASKWALL* sprites.
// TODO: look at more cases of cstat=(cstat&PROTECTED)|ADDED in A_Spawn()? // TODO: look at more cases of cstat=(cstat&PROTECTED)|ADDED in fi.spawn()?
// 2048+(32+16)+8+4 // 2048+(32+16)+8+4
#define SPAWN_PROTECT_CSTAT_MASK (CSTAT_SPRITE_NOSHADE|CSTAT_SPRITE_ALIGNMENT_SLAB|CSTAT_SPRITE_XFLIP|CSTAT_SPRITE_YFLIP); #define SPAWN_PROTECT_CSTAT_MASK (CSTAT_SPRITE_NOSHADE|CSTAT_SPRITE_ALIGNMENT_SLAB|CSTAT_SPRITE_XFLIP|CSTAT_SPRITE_YFLIP);
@ -452,6 +447,17 @@ extern void G_PrintCurrentMusic(void);
void addspritetodelete(int spnum); void addspritetodelete(int spnum);
int initspriteforspawn(int j, int pn, const std::initializer_list<int> &excludes);
void spawninitdefault(int j, int i);
void spawntransporter(int j, int i, bool beam);
int spawnbloodpoolpart1(int j, int i);
void initfootprint(int j, int i);
void initshell(int j, int i, bool isshell);
void initcrane(int j, int i, int CRANEPOLE);
void initwaterdrip(int j, int i);
int initreactor(int j, int i, bool isrecon);
void spawneffector(int i);
struct Dispatcher struct Dispatcher
{ {
// sectors_?.cpp // sectors_?.cpp
@ -484,6 +490,7 @@ struct Dispatcher
void (*respawnhitag)(spritetype* g_sp); void (*respawnhitag)(spritetype* g_sp);
void (*checktimetosleep)(int g_i); void (*checktimetosleep)(int g_i);
void (*move)(int g_i, int g_p, int g_x); void (*move)(int g_i, int g_p, int g_x);
int (*spawn)(int j, int pn);
}; };

View file

@ -106,7 +106,6 @@ void SortCommands()
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#if 0
enum enum
{ {
ERROR_ISAKEYWORD = 1, ERROR_ISAKEYWORD = 1,
@ -118,13 +117,7 @@ enum
ERROR_NOTAGAMEVAR, ERROR_NOTAGAMEVAR,
ERROR_OPENBRACKET, ERROR_OPENBRACKET,
ERROR_CLOSEBRACKET, ERROR_CLOSEBRACKET,
ERROR_NOENDSWITCH ERROR_NOENDSWITCH,
};
#endif
enum
{
ERROR_PARMUNDEFINED = 20,
}; };
void ReportError(int iError) void ReportError(int iError)
@ -1607,7 +1600,7 @@ int parsecommand()
max_ammo_amount[8] = parseone(); max_ammo_amount[8] = parseone();
max_ammo_amount[9] = parseone(); max_ammo_amount[9] = parseone();
max_ammo_amount[11] = parseone(); max_ammo_amount[11] = parseone();
if (isRR()) max_ammo_amount[12] = parseone(); if (isRR() || isWorldTour()) max_ammo_amount[12] = parseone();
camerashitable = parseone(); camerashitable = parseone();
numfreezebounces = parseone(); numfreezebounces = parseone();
freezerhurtowner = parseone(); freezerhurtowner = parseone();

View file

@ -75,37 +75,9 @@ typedef struct {
extern char const * VM_GetKeywordForID(int32_t id); extern char const * VM_GetKeywordForID(int32_t id);
enum ScriptError_t
{
ERROR_CLOSEBRACKET,
ERROR_EXCEEDSMAXTILES,
ERROR_EXPECTEDKEYWORD,
ERROR_FOUNDWITHIN,
ERROR_ISAKEYWORD,
ERROR_OPENBRACKET,
ERROR_NOTAGAMEVAR,
ERROR_PARAMUNDEFINED,
ERROR_SYNTAXERROR,
ERROR_VARREADONLY,
ERROR_VARTYPEMISMATCH,
WARNING_BADGAMEVAR,
WARNING_DUPLICATEDEFINITION,
WARNING_LABELSONLY,
WARNING_VARMASKSKEYWORD,
ERROR_COULDNOTFIND,
ERROR_NOTAGAMEDEF,
ERROR_NOENDSWITCH
};
enum
{
};
#include "concmd.h" #include "concmd.h"
// KEEPINSYNC with the keyword list in lunatic/con_lang.lua
END_DUKE_NS END_DUKE_NS

View file

@ -848,7 +848,7 @@ int parse(void)
case concmd_spawn: case concmd_spawn:
insptr++; insptr++;
if(g_sp->sectnum >= 0 && g_sp->sectnum < MAXSECTORS) if(g_sp->sectnum >= 0 && g_sp->sectnum < MAXSECTORS)
spawn(g_i,*insptr); fi.spawn(g_i,*insptr);
insptr++; insptr++;
break; break;
case concmd_ifwasweapon: case concmd_ifwasweapon:

View file

@ -217,11 +217,11 @@ inline int32_t G_DefaultActorHealth(int spriteNum) // rename!
G_EXTERN vec2_t g_origins[MAXANIMPOINTS]; G_EXTERN vec2_t g_origins[MAXANIMPOINTS];
struct msx_ struct msx_
{ {
int operator[](int v) { return g_origins[v].x; } int &operator[](int v) { return g_origins[v].x; }
}; };
struct msy_ struct msy_
{ {
int operator[](int v) { return g_origins[v].y; } int &operator[](int v) { return g_origins[v].y; }
}; };
G_EXTERN msx_ msx; G_EXTERN msx_ msx;
G_EXTERN msy_ msy; G_EXTERN msy_ msy;
@ -231,7 +231,7 @@ G_EXTERN int16_t fakebubba_spawn, mamaspawn_count, banjosound, g_bellTime, g_bel
#define BellTime g_bellTime #define BellTime g_bellTime
#define word_119BE0 g_bellSprite #define word_119BE0 g_bellSprite
G_EXTERN uint8_t g_spriteExtra[MAXSPRITES], g_sectorExtra[MAXSECTORS]; // move these back into the base structs! G_EXTERN uint8_t g_spriteExtra[MAXSPRITES], g_sectorExtra[MAXSECTORS]; // move these back into the base structs!
G_EXTERN uint8_t enemysizecheat, ufospawnsminion, pistonsound, g_chickenWeaponTimer, RRRA_ExitedLevel, RRRA_EndEpisode, g_fogType; G_EXTERN uint8_t enemysizecheat, ufospawnsminion, pistonsound, g_chickenWeaponTimer, RRRA_ExitedLevel, RRRA_EndEpisode, fogactive;
G_EXTERN int32_t g_cdTrack; G_EXTERN int32_t g_cdTrack;
#define raat607 enemysizecheat // only as a reminder #define raat607 enemysizecheat // only as a reminder

View file

@ -764,6 +764,7 @@ enum
DEVELOPERCOMMENTARY = 5294, DEVELOPERCOMMENTARY = 5294,
BOSS5 = 5310, BOSS5 = 5310,
BOSS5STAYPUT = 5311, BOSS5STAYPUT = 5311,
SERIOUSSAM = 5846
}; };
END_DUKE_NS END_DUKE_NS

View file

@ -3585,6 +3585,7 @@ enum dukeweapon_t_alt
FREEZE_WEAPON, FREEZE_WEAPON,
HANDREMOTE_WEAPON, // 10 HANDREMOTE_WEAPON, // 10
GROW_WEAPON, GROW_WEAPON,
FLAMETHROWER_WEAPON, // World Tour
MIN_WEAPON = 0, MIN_WEAPON = 0,
MAX_WEAPON = 9 MAX_WEAPON = 9

View file

@ -43,7 +43,7 @@ void P_ResetWeapons(int playerNum);
void G_ClearFIFO(void); void G_ClearFIFO(void);
void G_ResetInterpolations(void); void G_ResetInterpolations(void);
extern int32_t fragbarheight(void); extern int32_t fragbarheight(void);
void G_SetFog(int fogtype); void setmapfog(int fogtype);
void G_InitRRRASkies(void); void G_InitRRRASkies(void);
END_DUKE_NS END_DUKE_NS

View file

@ -196,7 +196,7 @@ void operaterespawns_d(int low)
case RESPAWN: case RESPAWN:
if (badguypic(sprite[i].hitag) && ud.monsters_off) break; if (badguypic(sprite[i].hitag) && ud.monsters_off) break;
j = spawn(i, TRANSPORTERSTAR); j = fi.spawn(i, TRANSPORTERSTAR);
sprite[j].z -= (32 << 8); sprite[j].z -= (32 << 8);
sprite[i].extra = 66 - 12; // Just a way to killit sprite[i].extra = 66 - 12; // Just a way to killit
@ -1053,7 +1053,7 @@ void checkhitsprite_d(int i, int sn)
case OCEANSPRITE3: case OCEANSPRITE3:
case OCEANSPRITE4: case OCEANSPRITE4:
case OCEANSPRITE5: case OCEANSPRITE5:
spawn(i, SMALLSMOKE); fi.spawn(i, SMALLSMOKE);
deletesprite(i); deletesprite(i);
break; break;
case QUEBALL: case QUEBALL:
@ -1096,7 +1096,7 @@ void checkhitsprite_d(int i, int sn)
{ {
sprite[i].cstat &= ~257; sprite[i].cstat &= ~257;
hittype[i].temp_data[0] = 1; hittype[i].temp_data[0] = 1;
spawn(i, BURNING); fi.spawn(i, BURNING);
} }
break; break;
} }
@ -1149,7 +1149,7 @@ void checkhitsprite_d(int i, int sn)
case WATERFOUNTAIN + 2: case WATERFOUNTAIN + 2:
case WATERFOUNTAIN + 3: case WATERFOUNTAIN + 3:
sprite[i].picnum = WATERFOUNTAINBROKE; sprite[i].picnum = WATERFOUNTAINBROKE;
spawn(i, TOILETWATER); fi.spawn(i, TOILETWATER);
break; break;
case SATELITE: case SATELITE:
case FUELPOD: case FUELPOD:
@ -1160,7 +1160,7 @@ void checkhitsprite_d(int i, int sn)
for (j = 0; j < 15; j++) for (j = 0; j < 15; j++)
EGS(sprite[i].sectnum, sprite[i].x, sprite[i].y, sector[sprite[i].sectnum].floorz - (12 << 8) - (j << 9), SCRAP1 + (krand() & 15), -8, 64, 64, EGS(sprite[i].sectnum, sprite[i].x, sprite[i].y, sector[sprite[i].sectnum].floorz - (12 << 8) - (j << 9), SCRAP1 + (krand() & 15), -8, 64, 64,
krand() & 2047, (krand() & 127) + 64, -(krand() & 511) - 256, i, 5); krand() & 2047, (krand() & 127) + 64, -(krand() & 511) - 256, i, 5);
spawn(i, EXPLOSION2); fi.spawn(i, EXPLOSION2);
deletesprite(i); deletesprite(i);
} }
break; break;
@ -1236,7 +1236,7 @@ void checkhitsprite_d(int i, int sn)
hittype[sprite[i].owner].temp_data[0] = 32; hittype[sprite[i].owner].temp_data[0] = 32;
hittype[sprite[i].owner].temp_data[1] = !hittype[sprite[i].owner].temp_data[1]; hittype[sprite[i].owner].temp_data[1] = !hittype[sprite[i].owner].temp_data[1];
hittype[sprite[i].owner].temp_data[2] ++; hittype[sprite[i].owner].temp_data[2] ++;
spawn(i, EXPLOSION2); fi.spawn(i, EXPLOSION2);
break; break;
case BROKEHYDROPLANT: case BROKEHYDROPLANT:
@ -1253,7 +1253,7 @@ void checkhitsprite_d(int i, int sn)
sprite[i].picnum = TOILETBROKE; sprite[i].picnum = TOILETBROKE;
sprite[i].cstat |= (krand() & 1) << 2; sprite[i].cstat |= (krand() & 1) << 2;
sprite[i].cstat &= ~257; sprite[i].cstat &= ~257;
spawn(i, TOILETWATER); fi.spawn(i, TOILETWATER);
spritesound(GLASS_BREAKING, i); spritesound(GLASS_BREAKING, i);
break; break;
@ -1261,13 +1261,13 @@ void checkhitsprite_d(int i, int sn)
sprite[i].picnum = STALLBROKE; sprite[i].picnum = STALLBROKE;
sprite[i].cstat |= (krand() & 1) << 2; sprite[i].cstat |= (krand() & 1) << 2;
sprite[i].cstat &= ~257; sprite[i].cstat &= ~257;
spawn(i, TOILETWATER); fi.spawn(i, TOILETWATER);
spritesound(GLASS_HEAVYBREAK, i); spritesound(GLASS_HEAVYBREAK, i);
break; break;
case HYDRENT: case HYDRENT:
sprite[i].picnum = BROKEFIREHYDRENT; sprite[i].picnum = BROKEFIREHYDRENT;
spawn(i, TOILETWATER); fi.spawn(i, TOILETWATER);
// for(k=0;k<5;k++) // for(k=0;k<5;k++)
// { // {
@ -1315,7 +1315,7 @@ void checkhitsprite_d(int i, int sn)
case PIPE6:sprite[i].picnum = PIPE6B; break; case PIPE6:sprite[i].picnum = PIPE6B; break;
} }
j = spawn(i, STEAM); j = fi.spawn(i, STEAM);
sprite[j].z = sector[sprite[i].sectnum].floorz - (32 << 8); sprite[j].z = sector[sprite[i].sectnum].floorz - (32 << 8);
break; break;
@ -1324,7 +1324,7 @@ void checkhitsprite_d(int i, int sn)
case INDY: case INDY:
case JURYGUY: case JURYGUY:
spritesound(sprite[i].lotag, i); spritesound(sprite[i].lotag, i);
spawn(i, sprite[i].hitag); fi.spawn(i, sprite[i].hitag);
case SPACEMARINE: case SPACEMARINE:
sprite[i].extra -= sprite[sn].extra; sprite[i].extra -= sprite[sn].extra;
if (sprite[i].extra > 0) break; if (sprite[i].extra > 0) break;
@ -1389,7 +1389,7 @@ void checkhitsprite_d(int i, int sn)
if (sprite[sn].picnum != FREEZEBLAST) if (sprite[sn].picnum != FREEZEBLAST)
//if (actortype[sprite[i].picnum] == 0) //TRANSITIONAL. Cannot be done right with EDuke mess backing the engine. //if (actortype[sprite[i].picnum] == 0) //TRANSITIONAL. Cannot be done right with EDuke mess backing the engine.
{ {
j = spawn(sn, JIBS6); j = fi.spawn(sn, JIBS6);
if (sprite[sn].pal == 6) if (sprite[sn].pal == 6)
sprite[j].pal = 6; sprite[j].pal = 6;
sprite[j].z += (4 << 8); sprite[j].z += (4 << 8);

View file

@ -311,7 +311,7 @@ void operaterespawns_r(int low)
case RESPAWN: case RESPAWN:
if (badguypic(sprite[i].hitag) && ud.monsters_off) break; if (badguypic(sprite[i].hitag) && ud.monsters_off) break;
j = spawn(i, TRANSPORTERSTAR); j = fi.spawn(i, TRANSPORTERSTAR);
sprite[j].z -= (32 << 8); sprite[j].z -= (32 << 8);
sprite[i].extra = 66 - 12; // Just a way to killit sprite[i].extra = 66 - 12; // Just a way to killit
@ -2096,7 +2096,7 @@ void checkhitsprite_r(int i, int sn)
{ {
sprite[i].cstat &= ~257; sprite[i].cstat &= ~257;
hittype[i].temp_data[0] = 1; hittype[i].temp_data[0] = 1;
spawn(i, BURNING); fi.spawn(i, BURNING);
} }
break; break;
} }
@ -2144,7 +2144,7 @@ void checkhitsprite_r(int i, int sn)
case WATERFOUNTAIN + 1: case WATERFOUNTAIN + 1:
case WATERFOUNTAIN + 2: case WATERFOUNTAIN + 2:
case WATERFOUNTAIN + 3: case WATERFOUNTAIN + 3:
spawn(i, TOILETWATER); fi.spawn(i, TOILETWATER);
break; break;
case SATELITE: case SATELITE:
case FUELPOD: case FUELPOD:
@ -2155,7 +2155,7 @@ void checkhitsprite_r(int i, int sn)
for (j = 0; j < 15; j++) for (j = 0; j < 15; j++)
EGS(sprite[i].sectnum, sprite[i].x, sprite[i].y, sector[sprite[i].sectnum].floorz - (12 << 8) - (j << 9), SCRAP1 + (krand() & 15), -8, 64, 64, EGS(sprite[i].sectnum, sprite[i].x, sprite[i].y, sector[sprite[i].sectnum].floorz - (12 << 8) - (j << 9), SCRAP1 + (krand() & 15), -8, 64, 64,
krand() & 2047, (krand() & 127) + 64, -(krand() & 511) - 256, i, 5); krand() & 2047, (krand() & 127) + 64, -(krand() & 511) - 256, i, 5);
spawn(i, EXPLOSION2); fi.spawn(i, EXPLOSION2);
deletesprite(i); deletesprite(i);
} }
break; break;
@ -2217,13 +2217,13 @@ void checkhitsprite_r(int i, int sn)
hittype[sprite[i].owner].temp_data[0] = 32; hittype[sprite[i].owner].temp_data[0] = 32;
hittype[sprite[i].owner].temp_data[1] = !hittype[sprite[i].owner].temp_data[1]; hittype[sprite[i].owner].temp_data[1] = !hittype[sprite[i].owner].temp_data[1];
hittype[sprite[i].owner].temp_data[2] ++; hittype[sprite[i].owner].temp_data[2] ++;
spawn(i, EXPLOSION2); fi.spawn(i, EXPLOSION2);
break; break;
case TOILET: case TOILET:
sprite[i].picnum = TOILETBROKE; sprite[i].picnum = TOILETBROKE;
sprite[i].cstat |= (krand() & 1) << 2; sprite[i].cstat |= (krand() & 1) << 2;
sprite[i].cstat &= ~257; sprite[i].cstat &= ~257;
spawn(i, TOILETWATER); fi.spawn(i, TOILETWATER);
spritesound(GLASS_BREAKING, i); spritesound(GLASS_BREAKING, i);
break; break;
@ -2231,13 +2231,13 @@ void checkhitsprite_r(int i, int sn)
sprite[i].picnum = STALLBROKE; sprite[i].picnum = STALLBROKE;
sprite[i].cstat |= (krand() & 1) << 2; sprite[i].cstat |= (krand() & 1) << 2;
sprite[i].cstat &= ~257; sprite[i].cstat &= ~257;
spawn(i, TOILETWATER); fi.spawn(i, TOILETWATER);
spritesound(GLASS_HEAVYBREAK, i); spritesound(GLASS_HEAVYBREAK, i);
break; break;
case HYDRENT: case HYDRENT:
sprite[i].picnum = BROKEFIREHYDRENT; sprite[i].picnum = BROKEFIREHYDRENT;
spawn(i, TOILETWATER); fi.spawn(i, TOILETWATER);
// for(k=0;k<5;k++) // for(k=0;k<5;k++)
// { // {
@ -2275,7 +2275,7 @@ void checkhitsprite_r(int i, int sn)
case PIPE6:sprite[i].picnum = PIPE6B; break; case PIPE6:sprite[i].picnum = PIPE6B; break;
} }
j = spawn(i, STEAM); j = fi.spawn(i, STEAM);
sprite[j].z = sector[sprite[i].sectnum].floorz - (32 << 8); sprite[j].z = sector[sprite[i].sectnum].floorz - (32 << 8);
break; break;
@ -2315,7 +2315,7 @@ void checkhitsprite_r(int i, int sn)
if (sprite[sn].picnum != FREEZEBLAST) if (sprite[sn].picnum != FREEZEBLAST)
//if (actortype[sprite[i].picnum] == 0) //TRANSITIONAL. Cannot be done right with EDuke mess backing the engine. //if (actortype[sprite[i].picnum] == 0) //TRANSITIONAL. Cannot be done right with EDuke mess backing the engine.
{ {
j = spawn(sn, JIBS6); j = fi.spawn(sn, JIBS6);
if (sprite[sn].pal == 6) if (sprite[sn].pal == 6)
sprite[j].pal = 6; sprite[j].pal = 6;
sprite[j].z += (4 << 8); sprite[j].z += (4 << 8);

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -96,7 +96,7 @@ void A_SpawnMultiple(int spriteNum, int tileNum, int spawnCnt)
int32_t const r1 = krand2(), r2 = krand2(); int32_t const r1 = krand2(), r2 = krand2();
int const j = A_InsertSprite(pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z - (r2 % (47 << 8)), tileNum, -32, 8, int const j = A_InsertSprite(pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z - (r2 % (47 << 8)), tileNum, -32, 8,
8, r1 & 2047, 0, 0, spriteNum, 5); 8, r1 & 2047, 0, 0, spriteNum, 5);
//A_Spawn(-1, j); //fi.spawn(-1, j);
sprite[j].cstat = krand2()&12; sprite[j].cstat = krand2()&12;
} }
} }

View file

@ -824,7 +824,7 @@ void G_DoCheats(void)
case CHEAT_RAKFC: case CHEAT_RAKFC:
for (int i = 0; i < 7; i++) for (int i = 0; i < 7; i++)
{ {
int const newSprite = A_Spawn(pPlayer->i, TILE_HEN); int const newSprite = fi.spawn(pPlayer->i, TILE_HEN);
sprite[newSprite].pal = 1; sprite[newSprite].pal = 1;
sprite[newSprite].xrepeat <<= 2; sprite[newSprite].xrepeat <<= 2;
sprite[newSprite].yrepeat <<= 2; sprite[newSprite].yrepeat <<= 2;

File diff suppressed because it is too large Load diff

View file

@ -302,7 +302,7 @@ static int osdcmd_spawn(CCmdFuncPtr parm)
return OSDCMD_SHOWHELP; return OSDCMD_SHOWHELP;
} }
idx = A_Spawn(g_player[myconnectindex].ps->i, picnum); idx = fi.spawn(g_player[myconnectindex].ps->i, picnum);
if (set & 1) sprite[idx].pal = (uint8_t)pal; if (set & 1) sprite[idx].pal = (uint8_t)pal;
if (set & 2) sprite[idx].cstat = (int16_t)cstat; if (set & 2) sprite[idx].cstat = (int16_t)cstat;
if (set & 4) sprite[idx].ang = ang; if (set & 4) sprite[idx].ang = ang;

View file

@ -628,7 +628,7 @@ growspark_rr:
if (hitwal->hitag == 0) if (hitwal->hitag == 0)
{ {
int const spawnedSprite = A_Spawn(spriteNum, projecTile); int const spawnedSprite = fi.spawn(spriteNum, projecTile);
sprite[spawnedSprite].xvel = -12; sprite[spawnedSprite].xvel = -12;
sprite[spawnedSprite].ang sprite[spawnedSprite].ang
= (getangle(hitwal->x - wall[hitwal->point2].x, hitwal->y - wall[hitwal->point2].y) + 512) & 2047; = (getangle(hitwal->x - wall[hitwal->point2].x, hitwal->y - wall[hitwal->point2].y) + 512) & 2047;
@ -657,7 +657,7 @@ growspark_rr:
if (playerNum >= 0) if (playerNum >= 0)
{ {
int k = A_Spawn(kneeSprite, TILE_SMALLSMOKE); int k = fi.spawn(kneeSprite, TILE_SMALLSMOKE);
sprite[k].z -= ZOFFSET3; sprite[k].z -= ZOFFSET3;
if (!RR || projecTile == TILE_KNEE) if (!RR || projecTile == TILE_KNEE)
A_PlaySound(KICK_HIT, kneeSprite); A_PlaySound(KICK_HIT, kneeSprite);
@ -688,7 +688,7 @@ growspark_rr:
} }
else if(playerNum >= 0 && hitData.pos.z > 0 && sector[hitData.sect].lotag == 1) else if(playerNum >= 0 && hitData.pos.z > 0 && sector[hitData.sect].lotag == 1)
{ {
int splashSprite = A_Spawn(pPlayer->i, TILE_WATERSPLASH2); int splashSprite = fi.spawn(pPlayer->i, TILE_WATERSPLASH2);
sprite[splashSprite].x = hitData.pos.x; sprite[splashSprite].x = hitData.pos.x;
sprite[splashSprite].y = hitData.pos.y; sprite[splashSprite].y = hitData.pos.y;
sprite[splashSprite].ang = fix16_to_int(pPlayer->q16ang); // Total tweek sprite[splashSprite].ang = fix16_to_int(pPlayer->q16ang); // Total tweek
@ -745,7 +745,7 @@ growspark_rr:
} }
if (!RR || sector[hitData.sect].lotag != ST_1_ABOVE_WATER) if (!RR || sector[hitData.sect].lotag != ST_1_ABOVE_WATER)
A_Spawn(spawnedSprite, TILE_SMALLSMOKE); fi.spawn(spawnedSprite, TILE_SMALLSMOKE);
} }
if (hitData.sprite >= 0) if (hitData.sprite >= 0)
@ -758,7 +758,7 @@ growspark_rr:
(ud.ffire == 1 || (!GTFLAGS(GAMETYPE_PLAYERSFRIENDLY) && GTFLAGS(GAMETYPE_TDM) && (ud.ffire == 1 || (!GTFLAGS(GAMETYPE_PLAYERSFRIENDLY) && GTFLAGS(GAMETYPE_TDM) &&
g_player[P_Get(hitData.sprite)].ps->team != g_player[P_Get(spriteNum)].ps->team))) g_player[P_Get(hitData.sprite)].ps->team != g_player[P_Get(spriteNum)].ps->team)))
{ {
int jibSprite = A_Spawn(spawnedSprite, TILE_JIBS6); int jibSprite = fi.spawn(spawnedSprite, TILE_JIBS6);
sprite[spawnedSprite].xrepeat = sprite[spawnedSprite].yrepeat = 0; sprite[spawnedSprite].xrepeat = sprite[spawnedSprite].yrepeat = 0;
sprite[jibSprite].z += ZOFFSET6; sprite[jibSprite].z += ZOFFSET6;
@ -768,7 +768,7 @@ growspark_rr:
} }
else else
{ {
A_Spawn(spawnedSprite, TILE_SMALLSMOKE); fi.spawn(spawnedSprite, TILE_SMALLSMOKE);
} }
if (playerNum >= 0 && CheckShootSwitchTile(sprite[hitData.sprite].picnum)) if (playerNum >= 0 && CheckShootSwitchTile(sprite[hitData.sprite].picnum))
@ -781,7 +781,7 @@ growspark_rr:
{ {
uwalltype const * const hitWall = (uwalltype *)&wall[hitData.wall]; uwalltype const * const hitWall = (uwalltype *)&wall[hitData.wall];
A_Spawn(spawnedSprite, TILE_SMALLSMOKE); fi.spawn(spawnedSprite, TILE_SMALLSMOKE);
if (fi.isadoorwall(hitWall->picnum) == 1) if (fi.isadoorwall(hitWall->picnum) == 1)
goto SKIPBULLETHOLE; goto SKIPBULLETHOLE;
@ -811,7 +811,7 @@ growspark_rr:
if (sprite[decalSprite].picnum == TILE_BULLETHOLE && dist(&sprite[decalSprite], &sprite[spawnedSprite]) < (12 + (krand2() & 7))) if (sprite[decalSprite].picnum == TILE_BULLETHOLE && dist(&sprite[decalSprite], &sprite[spawnedSprite]) < (12 + (krand2() & 7)))
goto SKIPBULLETHOLE; goto SKIPBULLETHOLE;
decalSprite = A_Spawn(spawnedSprite, TILE_BULLETHOLE); decalSprite = fi.spawn(spawnedSprite, TILE_BULLETHOLE);
sprite[decalSprite].xvel = -1; sprite[decalSprite].xvel = -1;
sprite[decalSprite].ang sprite[decalSprite].ang
@ -835,7 +835,7 @@ growspark_rr:
{ {
fi.checkhitsprite(hitData.sprite, spawnedSprite); fi.checkhitsprite(hitData.sprite, spawnedSprite);
if (sprite[hitData.sprite].picnum != TILE_APLAYER) if (sprite[hitData.sprite].picnum != TILE_APLAYER)
A_Spawn(spawnedSprite, TILE_SMALLSMOKE); fi.spawn(spawnedSprite, TILE_SMALLSMOKE);
else else
{ {
sprite[spawnedSprite].xrepeat = 0; sprite[spawnedSprite].xrepeat = 0;
@ -855,7 +855,7 @@ growspark_rr:
case TRIPBOMBSPRITE__STATIC: case TRIPBOMBSPRITE__STATIC:
{ {
if (!RR) break; if (!RR) break;
int const newSprite = A_Spawn(spriteNum, projecTile); int const newSprite = fi.spawn(spriteNum, projecTile);
sprite[newSprite].xvel = 32; sprite[newSprite].xvel = 32;
sprite[newSprite].ang = sprite[spriteNum].ang; sprite[newSprite].ang = sprite[spriteNum].ang;
sprite[newSprite].z -= (5<<8); sprite[newSprite].z -= (5<<8);
@ -864,7 +864,7 @@ growspark_rr:
case BOWLINGBALL__STATICRR: case BOWLINGBALL__STATICRR:
{ {
int const newSprite = A_Spawn(spriteNum, projecTile); int const newSprite = fi.spawn(spriteNum, projecTile);
sprite[newSprite].xvel = 250; sprite[newSprite].xvel = 250;
sprite[newSprite].ang = sprite[spriteNum].ang; sprite[newSprite].ang = sprite[spriteNum].ang;
sprite[newSprite].z -= (15<<8); sprite[newSprite].z -= (15<<8);
@ -1717,7 +1717,7 @@ static void P_DoWeaponSpawn(int playerNum)
if (PWEAPON(playerNum, pPlayer->curr_weapon, Spawn) <= 0) // <=0 : AMC TC beta/RC2 has WEAPONx_SPAWN -1 if (PWEAPON(playerNum, pPlayer->curr_weapon, Spawn) <= 0) // <=0 : AMC TC beta/RC2 has WEAPONx_SPAWN -1
return; return;
int newSprite = A_Spawn(pPlayer->i, PWEAPON(playerNum, pPlayer->curr_weapon, Spawn)); int newSprite = fi.spawn(pPlayer->i, PWEAPON(playerNum, pPlayer->curr_weapon, Spawn));
if ((PWEAPON(playerNum, pPlayer->curr_weapon, Flags) & WEAPON_SPAWNTYPE2)) if ((PWEAPON(playerNum, pPlayer->curr_weapon, Flags) & WEAPON_SPAWNTYPE2))
{ {
@ -4602,7 +4602,7 @@ void checkweapons(DukePlayer_t* const pPlayer)
{ {
if (pPlayer->OnMotorcycle) if (pPlayer->OnMotorcycle)
{ {
int const newSprite = A_Spawn(pPlayer->i, TILE_EMPTYBIKE); int const newSprite = fi.spawn(pPlayer->i, TILE_EMPTYBIKE);
sprite[newSprite].ang = fix16_to_int(pPlayer->q16ang); sprite[newSprite].ang = fix16_to_int(pPlayer->q16ang);
sprite[newSprite].owner = pPlayer->ammo_amount[MOTORCYCLE_WEAPON]; sprite[newSprite].owner = pPlayer->ammo_amount[MOTORCYCLE_WEAPON];
pPlayer->OnMotorcycle = 0; pPlayer->OnMotorcycle = 0;
@ -4618,7 +4618,7 @@ void checkweapons(DukePlayer_t* const pPlayer)
} }
else if (pPlayer->OnBoat) else if (pPlayer->OnBoat)
{ {
int const newSprite = A_Spawn(pPlayer->i, TILE_EMPTYBOAT); int const newSprite = fi.spawn(pPlayer->i, TILE_EMPTYBOAT);
sprite[newSprite].ang = fix16_to_int(pPlayer->q16ang); sprite[newSprite].ang = fix16_to_int(pPlayer->q16ang);
sprite[newSprite].owner = pPlayer->ammo_amount[BOAT_WEAPON]; sprite[newSprite].owner = pPlayer->ammo_amount[BOAT_WEAPON];
pPlayer->OnBoat = 0; pPlayer->OnBoat = 0;
@ -4638,7 +4638,7 @@ void checkweapons(DukePlayer_t* const pPlayer)
return; return;
if (krand2() & 1) if (krand2() & 1)
A_Spawn(pPlayer->i, WeaponPickupSprites[currentWeapon]); fi.spawn(pPlayer->i, WeaponPickupSprites[currentWeapon]);
else else
switch (DYNAMICWEAPONMAP(currentWeapon)) switch (DYNAMICWEAPONMAP(currentWeapon))
{ {
@ -4646,7 +4646,7 @@ void checkweapons(DukePlayer_t* const pPlayer)
if (!RRRA) break; if (!RRRA) break;
fallthrough__; fallthrough__;
case RPG_WEAPON__STATIC: case RPG_WEAPON__STATIC:
case HANDBOMB_WEAPON__STATIC: A_Spawn(pPlayer->i, TILE_EXPLOSION2); break; case HANDBOMB_WEAPON__STATIC: fi.spawn(pPlayer->i, TILE_EXPLOSION2); break;
} }
if (RR) if (RR)
@ -4655,7 +4655,7 @@ void checkweapons(DukePlayer_t* const pPlayer)
{ {
if (pPlayer->keys[key] == 1) if (pPlayer->keys[key] == 1)
{ {
int const newSprite = A_Spawn(pPlayer->i, TILE_ACCESSCARD); int const newSprite = fi.spawn(pPlayer->i, TILE_ACCESSCARD);
switch (key) switch (key)
{ {
case 1: case 1:
@ -5526,7 +5526,7 @@ static void P_ProcessWeapon(int playerNum)
if (((*weaponFrame) % 3) == 0) if (((*weaponFrame) % 3) == 0)
{ {
spriteNum = A_Spawn(pPlayer->i, TILE_SHELL); spriteNum = fi.spawn(pPlayer->i, TILE_SHELL);
sprite[spriteNum].ang += 1024; sprite[spriteNum].ang += 1024;
sprite[spriteNum].ang &= 2047; sprite[spriteNum].ang &= 2047;
@ -6131,7 +6131,7 @@ static void P_ProcessWeapon(int playerNum)
} }
else if ((*weaponFrame) == 2) else if ((*weaponFrame) == 2)
{ {
A_Spawn(pPlayer->i, TILE_SHELL); fi.spawn(pPlayer->i, TILE_SHELL);
} }
if (++(*weaponFrame) >= 5) if (++(*weaponFrame) >= 5)
@ -6195,7 +6195,7 @@ static void P_ProcessWeapon(int playerNum)
pPlayer->kickback_pic++; pPlayer->kickback_pic++;
break; break;
case 24: case 24:
spriteNum = A_Spawn(pPlayer->i, TILE_SHOTGUNSHELL); spriteNum = fi.spawn(pPlayer->i, TILE_SHOTGUNSHELL);
sprite[spriteNum].ang += 1024; sprite[spriteNum].ang += 1024;
A_SetSprite(spriteNum, CLIPMASK0); A_SetSprite(spriteNum, CLIPMASK0);
sprite[spriteNum].ang += 1024; sprite[spriteNum].ang += 1024;
@ -6216,7 +6216,7 @@ static void P_ProcessWeapon(int playerNum)
if (((*weaponFrame) % 3) == 0) if (((*weaponFrame) % 3) == 0)
{ {
spriteNum = A_Spawn(pPlayer->i, TILE_SHELL); spriteNum = fi.spawn(pPlayer->i, TILE_SHELL);
sprite[spriteNum].ang += 1024; sprite[spriteNum].ang += 1024;
sprite[spriteNum].ang &= 2047; sprite[spriteNum].ang &= 2047;
@ -6620,7 +6620,7 @@ static void P_DoWater(int const playerNum, int const playerBits, int const floor
if (pPlayer->scuba_on && (krand2()&255) < 8) if (pPlayer->scuba_on && (krand2()&255) < 8)
{ {
int const spriteNum = A_Spawn(pPlayer->i, TILE_WATERBUBBLE); int const spriteNum = fi.spawn(pPlayer->i, TILE_WATERBUBBLE);
int const q16ang = fix16_to_int(pPlayer->q16ang); int const q16ang = fix16_to_int(pPlayer->q16ang);
sprite[spriteNum].x += sintable[(q16ang + 512 + 64 - (g_globalRandom & 128)+(RR ? 128 : 0)) & 2047] >> 6; sprite[spriteNum].x += sintable[(q16ang + 512 + 64 - (g_globalRandom & 128)+(RR ? 128 : 0)) & 2047] >> 6;
@ -7705,7 +7705,7 @@ check_enemy_sprite:
if (pPlayer->on_ground == 1) if (pPlayer->on_ground == 1)
{ {
if (pPlayer->dummyplayersprite < 0) if (pPlayer->dummyplayersprite < 0)
pPlayer->dummyplayersprite = A_Spawn(pPlayer->i,TILE_PLAYERONWATER); pPlayer->dummyplayersprite = fi.spawn(pPlayer->i,TILE_PLAYERONWATER);
pPlayer->footprintcount = 6; pPlayer->footprintcount = 6;
//sprite[pPlayer->dummyplayersprite].cstat |= 32768; //sprite[pPlayer->dummyplayersprite].cstat |= 32768;
@ -7753,10 +7753,10 @@ check_enemy_sprite:
{ {
switch (krand2() & 3) switch (krand2() & 3)
{ {
case 0: spriteNum = A_Spawn(pPlayer->i, TILE_FOOTPRINTS); break; case 0: spriteNum = fi.spawn(pPlayer->i, TILE_FOOTPRINTS); break;
case 1: spriteNum = A_Spawn(pPlayer->i, TILE_FOOTPRINTS2); break; case 1: spriteNum = fi.spawn(pPlayer->i, TILE_FOOTPRINTS2); break;
case 2: spriteNum = A_Spawn(pPlayer->i, TILE_FOOTPRINTS3); break; case 2: spriteNum = fi.spawn(pPlayer->i, TILE_FOOTPRINTS3); break;
default: spriteNum = A_Spawn(pPlayer->i, TILE_FOOTPRINTS4); break; default: spriteNum = fi.spawn(pPlayer->i, TILE_FOOTPRINTS4); break;
} }
sprite[spriteNum].pal = pPlayer->footprintpal; sprite[spriteNum].pal = pPlayer->footprintpal;
sprite[spriteNum].shade = pPlayer->footprintshade; sprite[spriteNum].shade = pPlayer->footprintshade;
@ -8598,7 +8598,7 @@ HORIZONLY:;
dist(&sprite[pPlayer->i], &sprite[pPlayer->actorsqu]) < 1400) dist(&sprite[pPlayer->i], &sprite[pPlayer->actorsqu]) < 1400)
{ {
A_DoGuts(pPlayer->actorsqu, TILE_JIBS6, 7); A_DoGuts(pPlayer->actorsqu, TILE_JIBS6, 7);
A_Spawn(pPlayer->actorsqu, TILE_BLOODPOOL); fi.spawn(pPlayer->actorsqu, TILE_BLOODPOOL);
A_PlaySound(SQUISHED, pPlayer->actorsqu); A_PlaySound(SQUISHED, pPlayer->actorsqu);
switch (DYNAMICTILEMAP(sprite[pPlayer->actorsqu].picnum)) switch (DYNAMICTILEMAP(sprite[pPlayer->actorsqu].picnum))
{ {

View file

@ -1261,8 +1261,8 @@ static void prelevel(char g)
if (RRRA) if (RRRA)
{ {
G_SetFog(0); setmapfog(0);
g_fogType = 0; fogactive = 0;
ufospawnsminion = 0; ufospawnsminion = 0;
pistonsound = 0; pistonsound = 0;
enemysizecheat = 0; enemysizecheat = 0;
@ -1578,14 +1578,14 @@ static void prelevel(char g)
for (size_t i = 0; i < MAXSPRITES; i++) for (size_t i = 0; i < MAXSPRITES; i++)
{ {
if (sprite[i].statnum < MAXSTATUS && (DEER || PN(i) != TILE_SECTOREFFECTOR || SLT(i) != SE_14_SUBWAY_CAR)) if (sprite[i].statnum < MAXSTATUS && (DEER || PN(i) != TILE_SECTOREFFECTOR || SLT(i) != SE_14_SUBWAY_CAR))
A_Spawn(-1, i); fi.spawn(-1, i);
} }
if (!DEER) if (!DEER)
for (size_t i = 0; i < MAXSPRITES; i++) for (size_t i = 0; i < MAXSPRITES; i++)
{ {
if (sprite[i].statnum < MAXSTATUS && PN(i) == TILE_SECTOREFFECTOR && SLT(i) == SE_14_SUBWAY_CAR) if (sprite[i].statnum < MAXSTATUS && PN(i) == TILE_SECTOREFFECTOR && SLT(i) == SE_14_SUBWAY_CAR)
A_Spawn(-1, i); fi.spawn(-1, i);
if (RR && sprite[i].picnum == TILE_RRTILE19) if (RR && sprite[i].picnum == TILE_RRTILE19)
A_DeleteSprite(i); A_DeleteSprite(i);
if (RR && sprite[i].picnum == TILE_RRTILE34) if (RR && sprite[i].picnum == TILE_RRTILE34)
@ -2460,7 +2460,7 @@ int G_EnterLevel(int gameMode)
return 0; return 0;
} }
void G_SetFog(int fogtype) void setmapfog(int fogtype)
{ {
GLInterface.SetMapFog(fogtype != 0); GLInterface.SetMapFog(fogtype != 0);
} }

View file

@ -906,7 +906,7 @@ static const dataspec_t svgm_anmisc[] =
{ 0, &g_chickenWeaponTimer, sizeof(g_chickenWeaponTimer), 1 }, { 0, &g_chickenWeaponTimer, sizeof(g_chickenWeaponTimer), 1 },
{ 0, &RRRA_ExitedLevel, sizeof(RRRA_ExitedLevel), 1 }, { 0, &RRRA_ExitedLevel, sizeof(RRRA_ExitedLevel), 1 },
{ 0, &RRRA_EndEpisode, sizeof(RRRA_EndEpisode), 1 }, { 0, &RRRA_EndEpisode, sizeof(RRRA_EndEpisode), 1 },
{ 0, &g_fogType, sizeof(g_fogType), 1 }, { 0, &fogactive, sizeof(fogactive), 1 },
{ DS_LOADFN, (void *)sv_rrrafog, 0, 1 }, { DS_LOADFN, (void *)sv_rrrafog, 0, 1 },
{ DS_SAVEFN, (void *)&sv_restsave, 0, 1 }, { DS_SAVEFN, (void *)&sv_restsave, 0, 1 },
@ -1403,7 +1403,7 @@ int32_t sv_updatestate(int32_t frominit)
static void sv_rrrafog() static void sv_rrrafog()
{ {
G_SetFog(g_fogType ? 2 : 0); setmapfog(fogactive ? 2 : 0);
} }
static void postloadplayer(int32_t savegamep) static void postloadplayer(int32_t savegamep)