- removed old code.

This commit is contained in:
Christoph Oelckers 2020-05-21 11:42:56 +02:00
parent 9e08d81a6b
commit 98fad20dd2
1 changed files with 0 additions and 578 deletions

View File

@ -233,584 +233,6 @@ void G_InitRRRASkies(void)
void prelevel_d(int g);
void prelevel_r(int g);
#if 0
static void prelevel(char g)
{
uint8_t *tagbitmap = (uint8_t *)Xcalloc(65536>>3, 1);
int32_t p1 = 0, p2 = 0, p3 = 0;
//DukePlayer_t *ps = g_player[screenpeek].ps;
if (RRRA)
{
setmapfog(0);
fogactive = 0;
ufospawnsminion = 0;
pistonsound = 0;
enemysizecheat = 0;
g_player[myconnectindex].ps->MamaEnd = 0;
mamaspawn_count = 15;
banjosound = 0;
RRRA_ExitedLevel = 0;
if (!DEER)
{
for (bssize_t TRAVERSE_CONNECT(playerNum))
{
DukePlayer_t *ps = g_player[playerNum].ps;
ps->sea_sick_stat = 0;
ps->SlotWin = 0;
if (ud.level_number == 4 && ud.volume_number == 1)
ps->inv_amount[GET_STEROIDS] = 0;
}
if (ud.level_number == 3 && ud.volume_number == 0)
mamaspawn_count = 5;
else if (ud.level_number == 2 && ud.volume_number == 1)
mamaspawn_count = 10;
else if (ud.level_number == 6 && ud.volume_number == 1)
mamaspawn_count = 15;
}
}
Bmemset(g_spriteExtra, 0, sizeof(g_spriteExtra));
Bmemset(g_sectorExtra, 0, sizeof(g_sectorExtra));
Bmemset(shadedsector, 0, sizeof(shadedsector));
Bmemset(geosectorwarp, -1, sizeof(geosectorwarp));
Bmemset(geosectorwarp2, -1, sizeof(geosectorwarp2));
Bmemset(ambienthitag, -1, sizeof(ambienthitag));
Bmemset(ambientlotag, -1, sizeof(ambientlotag));
show2dsector.Zero();
resetprestat(0,g);
if (RR)
{
lava_cleararrays();
geocnt = 0;
ambientfx = 0;
thunderon = 0;
chickenplant = 0;
if (RRRA)
{
WindTime = 0;
WindDir = 0;
fakebubba_spawn = 0;
RRRA_ExitedLevel = 0;
mamaspawn_count = 15; // ???
g_bellTime = 0;
BellSprite = 0;
for (bssize_t spriteNum = 0; spriteNum < MAXSPRITES; spriteNum++)
{
if (sprite[spriteNum].pal == 100)
{
if (g_netServer || numplayers > 1)
A_DeleteSprite(spriteNum);
else
sprite[spriteNum].pal = 0;
}
else if (sprite[spriteNum].pal == 101)
{
sprite[spriteNum].extra = 0;
sprite[spriteNum].hitag = 1;
sprite[spriteNum].pal = 0;
changespritestat(spriteNum, 118);
}
}
}
}
numclouds = 0;
int missedCloudSectors = 0;
if (!DEER)
for (bssize_t i=0; i<numsectors; i++)
{
if (RR && sector[i].ceilingpicnum == TILE_RRTILE2577)
thunderon = 1;
sector[i].extra = 256;
switch (sector[i].lotag)
{
case 41:
{
if (!RR) break;
int k = headspritesect[i];
while (k != -1)
{
int const nexti = nextspritesect[k];
if (sprite[k].picnum == TILE_RRTILE11)
{
p1 = sprite[k].lotag << 4;
p2 = sprite[k].hitag;
A_DeleteSprite(k);
}
if (sprite[k].picnum == TILE_RRTILE38)
{
p3 = sprite[k].lotag;
A_DeleteSprite(k);
}
k = nexti;
}
for (bssize_t j = 0; j<numsectors; j++)
{
if (sector[i].hitag == sector[j].hitag && i != j)
{
addjaildoor(p1, p2, sector[i].hitag, sector[j].lotag, p3, j);
}
}
break;
}
case 42:
{
if (!RR) break;
int childsectnum = -1;
int k = headspritesect[i];
while (k != -1)
{
int const nexti = nextspritesect[k];
if (sprite[k].picnum == TILE_RRTILE64)
{
p1 = sprite[k].lotag << 4;
p2 = sprite[k].hitag;
for (bssize_t kk = 0; kk < MAXSPRITES; kk++)
{
if (sprite[kk].picnum == TILE_RRTILE66)
if (sprite[kk].lotag == sprite[k].sectnum)
{
childsectnum = sprite[kk].sectnum;
A_DeleteSprite(kk);
}
}
A_DeleteSprite(k);
}
if (sprite[k].picnum == TILE_RRTILE65)
{
p3 = sprite[k].lotag;
A_DeleteSprite(k);
}
k = nexti;
}
addminecart(p1, p2, i, sector[i].hitag, p3, childsectnum);
break;
}
case ST_20_CEILING_DOOR:
case ST_22_SPLITTING_DOOR:
if (sector[i].floorz > sector[i].ceilingz)
sector[i].lotag |= 32768u;
continue;
}
if (sector[i].ceilingstat&1)
{
if (!RR && sector[i].ceilingpicnum == TILE_CLOUDYSKIES)
{
if (numclouds < ARRAY_SSIZE(clouds))
clouds[numclouds++] = i;
else
missedCloudSectors++;
}
if (g_player[0].ps->one_parallax_sectnum == -1)
g_player[0].ps->one_parallax_sectnum = i;
}
if (sector[i].lotag == 32767) //Found a secret room
{
g_player[0].ps->max_secret_rooms++;
continue;
}
if ((uint16_t)sector[i].lotag == UINT16_MAX)
{
g_player[0].ps->exitx = wall[sector[i].wallptr].x;
g_player[0].ps->exity = wall[sector[i].wallptr].y;
continue;
}
}
if (missedCloudSectors > 0)
Printf(TEXTCOLOR_RED "Map warning: have %d unhandled TILE_CLOUDYSKIES ceilings.\n", missedCloudSectors);
// NOTE: must be safe loop because callbacks could delete sprites.
if (!DEER)
for (bssize_t nextSprite, SPRITES_OF_STAT_SAFE(STAT_DEFAULT, i, nextSprite))
{
//A_LoadActor(i);
if (G_CheckExitSprite(i))
{
g_player[0].ps->exitx = SX(i);
g_player[0].ps->exity = SY(i);
}
else switch (DYNAMICTILEMAP(PN(i)))
{
case NUKEBUTTON__STATIC:
if (RR) chickenplant = 1;
break;
case GPSPEED__STATIC:
// DELETE_AFTER_LOADACTOR. Must not change statnum.
sector[SECT(i)].extra = SLT(i);
A_DeleteSprite(i);
break;
case CYCLER__STATIC:
// DELETE_AFTER_LOADACTOR. Must not change statnum.
if (g_cyclerCnt >= MAXCYCLERS)
{
Bsprintf(tempbuf,"\nToo many cycling sectors (%d max).",MAXCYCLERS);
G_GameExit(tempbuf);
}
g_cyclers[g_cyclerCnt][0] = SECT(i);
g_cyclers[g_cyclerCnt][1] = SLT(i);
g_cyclers[g_cyclerCnt][2] = SS(i);
g_cyclers[g_cyclerCnt][3] = sector[SECT(i)].floorshade;
g_cyclers[g_cyclerCnt][4] = SHT(i);
g_cyclers[g_cyclerCnt][5] = (SA(i) == 1536);
g_cyclerCnt++;
A_DeleteSprite(i);
break;
case RRTILE18__STATICRR:
if (!RR) break;
addtorch(i);
A_DeleteSprite(i);
break;
case RRTILE35__STATICRR:
addlightning(i);
A_DeleteSprite(i);
break;
case RRTILE68__STATICRR:
shadedsector[SECT(i)] = 1;
A_DeleteSprite(i);
break;
case RRTILE67__STATICRR:
sprite[i].cstat |= 32768;
break;
case SOUNDFX__STATICRR:
if (ambientfx >= 64)
G_GameExit("\nToo many ambient effects");
else
{
ambienthitag[ambientfx] = SHT(i);
ambientlotag[ambientfx] = SLT(i);
sprite[i].ang = ambientfx++;
sprite[i].lotag = 0;
sprite[i].hitag = 0;
}
break;
//case SECTOREFFECTOR__STATIC:
//case ACTIVATOR__STATIC:
//case TOUCHPLATE__STATIC:
//case ACTIVATORLOCKED__STATIC:
//case MUSICANDSFX__STATIC:
//case LOCATORS__STATIC:
//case MASTERSWITCH__STATIC:
//case RESPAWN__STATIC:
// sprite[i].cstat &= ~(1|16|32|256);
// break;
}
}
if (RR && !DEER)
{
for (bssize_t i = 0; i < MAXSPRITES; i++)
{
if (sprite[i].picnum == TILE_RRTILE19)
{
if (sprite[i].hitag == 0)
{
if (geocnt >= MAXGEOSECTORS)
G_GameExit("\nToo many geometry effects");
geosector[geocnt] = sprite[i].sectnum;
for (bssize_t j = 0; j < MAXSPRITES; j++)
{
if (sprite[i].lotag == sprite[j].lotag && i != j && sprite[j].picnum == TILE_RRTILE19)
{
if (sprite[j].hitag == 1)
{
geosectorwarp[geocnt] = sprite[j].sectnum;
geox[geocnt] = sprite[i].x - sprite[j].x;
geoy[geocnt] = sprite[i].y - sprite[j].y;
}
if (sprite[j].hitag == 2)
{
geosectorwarp2[geocnt] = sprite[j].sectnum;
geox2[geocnt] = sprite[i].x - sprite[j].x;
geoy2[geocnt] = sprite[i].y - sprite[j].y;
}
}
}
geocnt++;
}
}
}
}
for (size_t i = 0; i < MAXSPRITES; i++)
{
if (sprite[i].statnum < MAXSTATUS && (DEER || PN(i) != TILE_SECTOREFFECTOR || SLT(i) != SE_14_SUBWAY_CAR))
fi.spawn(-1, i);
}
if (!DEER)
for (size_t i = 0; i < MAXSPRITES; i++)
{
if (sprite[i].statnum < MAXSTATUS && PN(i) == TILE_SECTOREFFECTOR && SLT(i) == SE_14_SUBWAY_CAR)
fi.spawn(-1, i);
if (RR && sprite[i].picnum == TILE_RRTILE19)
A_DeleteSprite(i);
if (RR && sprite[i].picnum == TILE_RRTILE34)
{
g_sectorExtra[sprite[i].sectnum] = sprite[i].lotag;
A_DeleteSprite(i);
}
}
//G_SetupRotfixedSprites();
if (!DEER)
for (bssize_t i=headspritestat[STAT_DEFAULT]; i>=0; i=nextspritestat[i])
{
if (PN(i) <= 0) // oob safety for switch below
continue;
for (bsize_t ii=0; ii<2; ii++)
{
switch (DYNAMICTILEMAP(PN(i)-1+ii))
{
case DIPSWITCH__STATIC:
case DIPSWITCH2__STATIC:
case PULLSWITCH__STATIC:
case HANDSWITCH__STATIC:
case SLOTDOOR__STATIC:
case LIGHTSWITCH__STATIC:
case SPACELIGHTSWITCH__STATIC:
case SPACEDOORSWITCH__STATIC:
case FRANKENSTINESWITCH__STATIC:
case LIGHTSWITCH2__STATIC:
case POWERSWITCH1__STATIC:
case LOCKSWITCH1__STATIC:
case POWERSWITCH2__STATIC:
case RRTILE8464__STATICRR:
if (RR && !RRRA && PN(i)-1+ii == (uint32_t)TILE_RRTILE8464) break;
// the lower code only for the 'on' state (*)
if (ii==0)
{
uint16_t const tag = sprite[i].lotag;
tagbitmap[tag>>3] |= 1<<(tag&7);
}
break;
}
}
}
// initially 'on' SE 12 light (*)
if (!DEER)
for (bssize_t j=headspritestat[STAT_EFFECTOR]; j>=0; j=nextspritestat[j])
{
uint16_t const tag = sprite[j].hitag;
if (sprite[j].lotag == SE_12_LIGHT_SWITCH && tagbitmap[tag>>3]&(1<<(tag&7)))
actor[j].t_data[0] = 1;
}
Xfree(tagbitmap);
mirrorcnt = 0;
for (bssize_t i = 0; i < numwalls; i++)
{
walltype * const pWall = &wall[i];
if (!DEER && pWall->overpicnum == TILE_MIRROR && (pWall->cstat&32) != 0)
{
int const nextSectnum = pWall->nextsector;
if ((nextSectnum >= 0) && sector[nextSectnum].ceilingpicnum != TILE_MIRROR)
{
if (mirrorcnt > 63)
{
G_GameExit("\nToo many mirrors (64 max.)");
}
sector[nextSectnum].ceilingpicnum = TILE_MIRROR;
sector[nextSectnum].floorpicnum = TILE_MIRROR;
mirrorwall[mirrorcnt] = i;
mirrorsector[mirrorcnt] = nextSectnum;
mirrorcnt++;
continue;
}
}
if (g_animWallCnt >= MAXANIMWALLS)
{
Bsprintf(tempbuf,"\nToo many 'anim' walls (%d max).",MAXANIMWALLS);
G_GameExit(tempbuf);
}
animwall[g_animWallCnt].tag = 0;
animwall[g_animWallCnt].wallnum = 0;
int const switchPic = G_GetForcefieldPicnum(i);
if (switchPic >= 0)
{
switch (DYNAMICTILEMAP(switchPic))
{
case FANSHADOW__STATIC:
if (RR) break;
fallthrough__;
case FANSPRITE__STATIC:
wall->cstat |= 65;
animwall[g_animWallCnt].wallnum = i;
g_animWallCnt++;
break;
case W_FORCEFIELD__STATIC:
if (RR) break;
if (pWall->overpicnum == W_FORCEFIELD__STATIC)
for (bsize_t j = 0; j < 3; j++) markTileForPrecache(TILE_W_FORCEFIELD + j, 0);
if (pWall->shade > 31)
pWall->cstat = 0;
else
pWall->cstat |= FORCEFIELD_CSTAT | 256;
if (pWall->lotag && pWall->nextwall >= 0)
wall[pWall->nextwall].lotag = pWall->lotag;
fallthrough__;
case BIGFORCE__STATIC:
animwall[g_animWallCnt].wallnum = i;
g_animWallCnt++;
continue;
}
}
pWall->extra = -1;
switch (DYNAMICTILEMAP(pWall->picnum))
{
case WATERTILE2__STATIC:
for (bsize_t j = 0; j < 3; j++)
markTileForPrecache(pWall->picnum + j, 0);
break;
case RRTILE1814__STATICRR:
case RRTILE1817__STATICRR:
markTileForPrecache(pWall->picnum, 0);
break;
case RRTILE1939__STATICRR:
case RRTILE1986__STATICRR:
case RRTILE1987__STATICRR:
case RRTILE1988__STATICRR:
case RRTILE2004__STATICRR:
case RRTILE2005__STATICRR:
case RRTILE2123__STATICRR:
case RRTILE2124__STATICRR:
case RRTILE2125__STATICRR:
case RRTILE2126__STATICRR:
case RRTILE2636__STATICRR:
case RRTILE2637__STATICRR:
case RRTILE2878__STATICRR:
case RRTILE2879__STATICRR:
case RRTILE2898__STATICRR:
case RRTILE2899__STATICRR:
markTileForPrecache(pWall->picnum, 0);
break;
case TECHLIGHT2__STATIC:
case TECHLIGHT4__STATIC: markTileForPrecache(pWall->picnum, 0); break;
case W_TECHWALL1__STATIC:
case W_TECHWALL2__STATIC:
case W_TECHWALL3__STATIC:
case W_TECHWALL4__STATIC:
if (RR) break;
animwall[g_animWallCnt].wallnum = i;
// animwall[g_numAnimWalls].tag = -1;
g_animWallCnt++;
break;
case SCREENBREAK6__STATIC:
case SCREENBREAK7__STATIC:
case SCREENBREAK8__STATIC:
for (bssize_t j = TILE_SCREENBREAK6; j < TILE_SCREENBREAK9; j++)
markTileForPrecache(j, 0);
animwall[g_animWallCnt].wallnum = i;
animwall[g_animWallCnt].tag = -1;
g_animWallCnt++;
break;
case FEMPIC1__STATIC:
case FEMPIC2__STATIC:
case FEMPIC3__STATIC:
if (RR) break;
pWall->extra = pWall->picnum;
animwall[g_animWallCnt].tag = -1;
if (adult_lockout)
pWall->picnum = (pWall->picnum == TILE_FEMPIC1) ? TILE_BLANKSCREEN : TILE_SCREENBREAK6;
animwall[g_animWallCnt].wallnum = i;
animwall[g_animWallCnt].tag = pWall->picnum;
g_animWallCnt++;
break;
case SCREENBREAK1__STATIC:
case SCREENBREAK2__STATIC:
case SCREENBREAK3__STATIC:
case SCREENBREAK4__STATIC:
case SCREENBREAK5__STATIC:
//
case SCREENBREAK9__STATIC:
case SCREENBREAK10__STATIC:
case SCREENBREAK11__STATIC:
case SCREENBREAK12__STATIC:
case SCREENBREAK13__STATIC:
case SCREENBREAK14__STATIC:
case SCREENBREAK15__STATIC:
case SCREENBREAK16__STATIC:
case SCREENBREAK17__STATIC:
case SCREENBREAK18__STATIC:
case SCREENBREAK19__STATIC:
if (RR) break;
animwall[g_animWallCnt].wallnum = i;
animwall[g_animWallCnt].tag = pWall->picnum;
g_animWallCnt++;
break;
}
}
//Invalidate textures in sector behind mirror
for (bssize_t i=0; i<mirrorcnt; i++)
{
int const startWall = sector[mirrorsector[i]].wallptr;
int const endWall = startWall + sector[mirrorsector[i]].wallnum;
for (bssize_t j = startWall; j < endWall; j++)
{
wall[j].picnum = TILE_MIRROR;
wall[j].overpicnum = TILE_MIRROR;
}
}
if (RR && !thunderon)
{
videoSetPalette(BASEPAL,0);
g_visibility = g_player[screenpeek].ps->visibility;
}
if (RR)
{
tileDelete(0);
}
G_SetupGlobalPsky();
}
#endif
void G_NewGame(int volumeNum, int levelNum, int skillNum)
{
DukePlayer_t *const pPlayer = g_player[0].ps;