- function separators in 6 files

This commit is contained in:
Christoph Oelckers 2022-09-08 16:33:07 +02:00
parent 05af0c81d5
commit 3e3e3714dc
6 changed files with 447 additions and 6 deletions

View file

@ -71,6 +71,12 @@ extern TILE_INFO_TYPE aVoxelArray[MAXTILES];
void PreDrawStackedWater(void);
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
#if 1
void ShadeSprite(tspritetype* tsp)
{
@ -87,6 +93,12 @@ void ShadeSprite(tspritetype* tsp)
#endif
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int GetRotation(tspriteArray& tsprites, int tSpriteNum, const DVector2& view)
{
static const uint8_t RotTable8[] = {0, 7, 6, 5, 4, 3, 2, 1};
@ -148,6 +160,12 @@ int GetRotation(tspriteArray& tsprites, int tSpriteNum, const DVector2& view)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
/*
@ -192,6 +210,12 @@ int SetActorRotation(tspriteArray& tsprites, int tSpriteNum, const DVector2& vie
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
double DoShadowFindGroundPoint(tspritetype* tspr)
{
// USES TSPRITE !!!!!
@ -246,6 +270,12 @@ double DoShadowFindGroundPoint(tspritetype* tspr)
return loz;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void DoShadows(tspriteArray& tsprites, tspritetype* tsp, double viewz)
{
auto ownerActor = static_cast<DSWActor*>(tsp->ownerActor);
@ -345,6 +375,12 @@ void DoShadows(tspriteArray& tsprites, tspritetype* tsp, double viewz)
//DoVoxelShadow(New);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void DoMotionBlur(tspriteArray& tsprites, tspritetype const * const tsp)
{
auto ownerActor = static_cast<DSWActor*>(tsp->ownerActor);
@ -406,6 +442,12 @@ void DoMotionBlur(tspriteArray& tsprites, tspritetype const * const tsp)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void WarpCopySprite(tspriteArray& tsprites)
{
int spnum;
@ -461,6 +503,12 @@ void WarpCopySprite(tspriteArray& tsprites)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void DoStarView(tspritetype* tsp, DSWActor* tActor, double viewz)
{
extern STATE s_Star[], s_StarDown[];
@ -484,8 +532,13 @@ void DoStarView(tspritetype* tsp, DSWActor* tActor, double viewz)
}
}
template<class sprt>
DSWActor* CopySprite(sprt const* tsp, sectortype* newsector)
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
DSWActor* CopySprite(spritetypebase const* tsp, sectortype* newsector)
{
auto actorNew = insertActor(newsector, STAT_FAF_COPY);
@ -510,6 +563,12 @@ DSWActor* CopySprite(sprt const* tsp, sectortype* newsector)
return actorNew;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
DSWActor* ConnectCopySprite(spritetypebase const* tsp)
{
sectortype* newsector;
@ -546,6 +605,11 @@ DSWActor* ConnectCopySprite(spritetypebase const* tsp)
return nullptr;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void analyzesprites(tspriteArray& tsprites, const DVector3& viewpos, double interpfrac)
{
@ -842,7 +906,12 @@ static void analyzesprites(tspriteArray& tsprites, const DVector3& viewpos, doub
}
#if 1
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
tspritetype* get_tsprite(tspriteArray& tsprites, DSWActor* actor)
{
int tSpriteNum;
@ -856,6 +925,12 @@ tspritetype* get_tsprite(tspriteArray& tsprites, DSWActor* actor)
return nullptr;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void post_analyzesprites(tspriteArray& tsprites)
{
int tSpriteNum;
@ -892,7 +967,12 @@ void post_analyzesprites(tspriteArray& tsprites)
}
}
}
#endif
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
std::pair<DVector3, DAngle> GameInterface::GetCoordinates()
{
@ -900,6 +980,12 @@ std::pair<DVector3, DAngle> GameInterface::GetCoordinates()
return std::make_pair(pp->pos, pp->angle.ang);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void PrintSpriteInfo(PLAYER* pp)
{
const int Y_STEP = 7;
@ -938,11 +1024,23 @@ void PrintSpriteInfo(PLAYER* pp)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void DrawCrosshair(PLAYER* pp, const double inputfrac)
{
::DrawCrosshair(2326, pp->actor->user.Health, -pp->angle.look_anghalf(inputfrac), (pp->Flags & PF_VIEW_FROM_OUTSIDE) ? 5 : 0, 2, shadeToLight(10));
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void PreDraw(void)
{
int i;
@ -955,6 +1053,12 @@ void PreDraw(void)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void PostDraw(void)
{
int i;
@ -972,6 +1076,12 @@ void PostDraw(void)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void PreDrawStackedWater(void)
{
SWStatIterator it(STAT_CEILING_FLOOR_PIC_OVERRIDE);
@ -1022,7 +1132,11 @@ void PreDrawStackedWater(void)
void DoPlayerDiveMeter(PLAYER* pp);
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void UpdateWallPortalState()
{
@ -1085,6 +1199,12 @@ void UpdateWallPortalState()
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void RestorePortalState()
{
SWStatIterator it(STAT_CEILING_FLOOR_PIC_OVERRIDE);
@ -1106,6 +1226,12 @@ void RestorePortalState()
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void drawscreen(PLAYER* pp, double interpfrac, bool sceneonly)
{
DAngle tang, trotscrnang;
@ -1264,6 +1390,12 @@ void drawscreen(PLAYER* pp, double interpfrac, bool sceneonly)
PostDraw();
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool GameInterface::GenerateSavePic()
{
drawscreen(Player + myconnectindex, 65536, true);
@ -1271,7 +1403,11 @@ bool GameInterface::GenerateSavePic()
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const interpfrac)
{
@ -1352,6 +1488,12 @@ bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos,
return true;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void GameInterface::processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double interpfrac)
{
analyzesprites(tsprites, DVector3(viewx * inttoworld, viewy * inttoworld, viewz * zinttoworld), interpfrac);

View file

@ -500,6 +500,12 @@ ACTOR_ACTION_SET SkelActionSet =
nullptr
};
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int SetupSkel(DSWActor* actor)
{
ANIMATOR DoActorDecide;
@ -525,6 +531,12 @@ int SetupSkel(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoSkelInitTeleport(DSWActor* actor)
{
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
@ -532,6 +544,12 @@ int DoSkelInitTeleport(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoSkelTeleport(DSWActor* actor)
{
auto pos = actor->spr.pos;
@ -559,12 +577,24 @@ int DoSkelTeleport(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoSkelTermTeleport(DSWActor* actor)
{
actor->spr.cstat |= (CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int NullSkel(DSWActor* actor)
{
if (actor->user.Flags & (SPR_SLIDING))
@ -576,6 +606,12 @@ int NullSkel(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoSkelPain(DSWActor* actor)
{
NullSkel(actor);
@ -586,6 +622,12 @@ int DoSkelPain(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoSkelMove(DSWActor* actor)
{
if (actor->user.Flags & (SPR_SLIDING))
@ -603,6 +645,12 @@ int DoSkelMove(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
#include "saveable.h"

View file

@ -207,6 +207,12 @@ STATE* sg_SkullExplode[] =
};
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int SetupSkull(DSWActor* actor)
{
ANIMATOR DoActorDecide;
@ -250,6 +256,12 @@ int SetupSkull(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoSkullMove(DSWActor* actor)
{
auto vect = actor->spr.angle.ToVector() * actor->vel.X;
@ -261,6 +273,12 @@ int DoSkullMove(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoSkullBeginDeath(DSWActor* actor)
{
int16_t i,num_ord=0;
@ -339,6 +357,12 @@ int DoSkullBeginDeath(DSWActor* actor)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoSkullJump(DSWActor* actor)
{
if(actor->vel.X != 0)
@ -398,6 +422,12 @@ int DoSkullJump(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoSkullBob(DSWActor* actor)
{
// actor does a sine wave about actor->user.sz - this is the z mid point
@ -409,6 +439,12 @@ int DoSkullBob(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoSkullSpawnShrap(DSWActor* actor)
{
SpawnShrap(actor, nullptr);
@ -417,6 +453,12 @@ int DoSkullSpawnShrap(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoSkullWait(DSWActor* actor)
{
int a,b,c,dist;
@ -588,6 +630,12 @@ STATE* sg_BettyExplode[] =
};
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int SetupBetty(DSWActor* actor)
{
ANIMATOR DoActorDecide;
@ -631,11 +679,23 @@ int SetupBetty(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoBettyMove(DSWActor* actor)
{
return DoSkullMove(actor);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoBettyBeginDeath(DSWActor* actor)
{
int16_t i,num_ord=0;
@ -707,6 +767,11 @@ int DoBettyBeginDeath(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoBettyJump(DSWActor* actor)
{
@ -765,6 +830,12 @@ int DoBettyJump(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoBettyBob(DSWActor* actor)
{
// actor does a sine wave about actor->user.sz - this is the z mid point
@ -776,12 +847,24 @@ int DoBettyBob(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoBettySpawnShrap(DSWActor* actor)
{
SpawnShrap(actor, nullptr);
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoBettyWait(DSWActor* actor)
{
int a,b,c,dist;
@ -828,6 +911,11 @@ int DoBettyWait(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
#include "saveable.h"

View file

@ -39,6 +39,12 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
BEGIN_SW_NS
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void ReverseSlidor(DSWActor* actor)
{
ROTATOR* r;
@ -66,6 +72,11 @@ void ReverseSlidor(DSWActor* actor)
r->vel = -r->vel;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool SlidorSwitch(short match, short setting)
{
@ -84,6 +95,12 @@ bool SlidorSwitch(short match, short setting)
return found;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void SetSlidorActive(DSWActor* actor)
{
ROTATOR* r;
@ -105,6 +122,12 @@ void SetSlidorActive(DSWActor* actor)
VatorSwitch(SP_TAG2(actor), true);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void SetSlidorInactive(DSWActor* actor)
{
DoSlidorInterp(actor, StopInterpolation);
@ -115,7 +138,12 @@ void SetSlidorInactive(DSWActor* actor)
actor->user.Flags &= ~(SPR_ACTIVE);
}
//---------------------------------------------------------------------------
//
// called for operation from the space bar
//
//---------------------------------------------------------------------------
void DoSlidorOperate(PLAYER* pp, sectortype* sect)
{
short match;
@ -130,8 +158,13 @@ void DoSlidorOperate(PLAYER* pp, sectortype* sect)
}
}
//---------------------------------------------------------------------------
//
// called from switches and triggers
// returns first vator found
//
//---------------------------------------------------------------------------
void DoSlidorMatch(PLAYER* pp, short match, bool manual)
{
SWStatIterator it(STAT_SLIDOR);
@ -179,6 +212,12 @@ void DoSlidorMatch(PLAYER* pp, short match, bool manual)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool TestSlidorMatchActive(short match)
{
SWStatIterator it(STAT_SLIDOR);
@ -198,6 +237,12 @@ bool TestSlidorMatchActive(short match)
return false;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void DoSlidorInterp(DSWActor* actor, INTERP_FUNC interp_func)
{
auto sect = actor->sector();
@ -250,6 +295,12 @@ void DoSlidorInterp(DSWActor* actor, INTERP_FUNC interp_func)
while (wal != startWall);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoSlidorMoveWalls(DSWActor* actor, double amt)
{
auto sect = actor->sector();
@ -370,6 +421,12 @@ int DoSlidorMoveWalls(DSWActor* actor, double amt)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoSlidorInstantClose(DSWActor* actor)
{
double diff;
@ -410,6 +467,12 @@ int DoSlidorInstantClose(DSWActor* actor)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoSlidor(DSWActor* actor)
{
ROTATOR* r;
@ -546,6 +609,12 @@ int DoSlidor(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
#include "saveable.h"
static saveable_code saveable_slidor_code[] =

View file

@ -38,6 +38,12 @@ BEGIN_SW_NS
bool TestSpikeMatchActive(short match);
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void ReverseSpike(DSWActor* actor)
{
// if paused go ahead and start it up again
@ -67,6 +73,12 @@ void ReverseSpike(DSWActor* actor)
actor->user.vel_rate = -actor->user.vel_rate;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool SpikeSwitch(short match, short setting)
{
bool found = false;
@ -84,6 +96,12 @@ bool SpikeSwitch(short match, short setting)
return found;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void SetSpikeActive(DSWActor* actor)
{
sectortype* sectp = actor->sector();
@ -110,6 +128,12 @@ void SetSpikeActive(DSWActor* actor)
VatorSwitch(SP_TAG2(actor), false);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void SetSpikeInactive(DSWActor* actor)
{
sectortype* sectp = actor->sector();
@ -127,7 +151,12 @@ void SetSpikeInactive(DSWActor* actor)
actor->user.Flags &= ~(SPR_ACTIVE);
}
//---------------------------------------------------------------------------
//
// called for operation from the space bar
//
//---------------------------------------------------------------------------
void DoSpikeOperate(sectortype* sect)
{
short match;
@ -151,8 +180,13 @@ void DoSpikeOperate(sectortype* sect)
}
}
//---------------------------------------------------------------------------
//
// called from switches and triggers
// returns first spike found
//
//---------------------------------------------------------------------------
void DoSpikeMatch(short match)
{
SWStatIterator it(STAT_SPIKE);
@ -171,6 +205,12 @@ void DoSpikeMatch(short match)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool TestSpikeMatchActive(short match)
{
SWStatIterator it(STAT_SPIKE);
@ -190,6 +230,12 @@ bool TestSpikeMatchActive(short match)
return false;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoSpikeMove(DSWActor* actor, double *lptr)
{
double zval;
@ -226,6 +272,12 @@ int DoSpikeMove(DSWActor* actor, double *lptr)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void SpikeAlign(DSWActor* actor)
{
// either work on single sector or all tagged in SOBJ
@ -245,6 +297,12 @@ void SpikeAlign(DSWActor* actor)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void MoveSpritesWithSpike(sectortype* sect)
{
double cz,fz;
@ -263,6 +321,12 @@ void MoveSpritesWithSpike(sectortype* sect)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoSpike(DSWActor* actor)
{
// zclip = floor or ceiling z
@ -369,6 +433,12 @@ int DoSpike(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoSpikeAuto(DSWActor* actor)
{
DoSpikeMove(actor, &actor->user.zclip);
@ -407,6 +477,12 @@ int DoSpikeAuto(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
#include "saveable.h"

View file

@ -75,6 +75,12 @@ bool WarpPlaneSectorInfo(sectortype* sect, DSWActor** sp_ceiling, DSWActor** sp_
return true;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
DSWActor* WarpPlane(int32_t* x, int32_t* y, int32_t* z, sectortype** sect)
{
DSWActor* sp_floor,* sp_ceiling;
@ -104,6 +110,12 @@ DSWActor* WarpPlane(int32_t* x, int32_t* y, int32_t* z, sectortype** sect)
return nullptr;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
DSWActor* WarpToArea(DSWActor* sp_from, int32_t* x, int32_t* y, int32_t* z, sectortype** sect)
{
int xoff;
@ -227,6 +239,12 @@ bool WarpSectorInfo(sectortype* sect, DSWActor** sp_warp)
return true;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
DSWActor* Warp(int32_t* x, int32_t* y, int32_t* z, sectortype** sect)
{
DSWActor* sp_warp;