- function separators

This commit is contained in:
Christoph Oelckers 2022-09-04 22:52:03 +02:00
parent 64e915868e
commit fd5cf15e0e
15 changed files with 456 additions and 0 deletions

View file

@ -57,6 +57,12 @@ void PreCacheRange(int start_pic, int end_pic, int pal = 0)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void PreCacheOverride(void)
{
SWStatIterator it(STAT_CEILING_FLOOR_PIC_OVERRIDE);
@ -68,6 +74,12 @@ void PreCacheOverride(void)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void precacheMap(void)
{
int i;
@ -97,6 +109,12 @@ void precacheMap(void)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void SetupPreCache(void)
{
precacheMap();
@ -308,6 +326,12 @@ void PreCachePachinko(int pal)
PreCacheRange(4840,4863, pal);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void PreCacheActor(void)
{
int pic;
@ -437,6 +461,11 @@ void PreCacheActor(void)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void DoTheCache(void)
{

View file

@ -53,6 +53,12 @@ extern bool ToggleFlyMode;
const char *CheatKeyType;
void KeysCheat(PLAYER* pp, const char *cheat_string);
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static PLAYER* checkCheat(cheatseq_t* c)
{
if (::CheckCheatmode(true, true)) return nullptr;
@ -97,6 +103,11 @@ const char *GameInterface::GenericCheat(int player, int cheat)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool RestartCheat(cheatseq_t* c)
{
@ -139,6 +150,11 @@ bool MapCheat(cheatseq_t* c)
return true;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool WarpCheat(cheatseq_t* c)
{
@ -163,6 +179,12 @@ bool WarpCheat(cheatseq_t* c)
return true;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool EveryCheatToggle(cheatseq_t* c)
{
EveryCheat = !EveryCheat;
@ -192,6 +214,12 @@ static cheatseq_t swcheats[] = {
{"lwroom", nullptr, RoomCheat, true}, // Room above room debug
};
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void WeaponCheat(int player)
{
auto p = &Player[player];
@ -217,6 +245,12 @@ static void WeaponCheat(int player)
PlayerUpdateWeapon(p, p->actor->user.WeaponNum);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void ItemCheat(int player)
{
auto p = &Player[player];
@ -243,6 +277,11 @@ static void ItemCheat(int player)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void cmd_Give(int player, uint8_t** stream, bool skip)
{
@ -330,6 +369,12 @@ static void cmd_Give(int player, uint8_t** stream, bool skip)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void InitCheats()
{
SetCheats(swcheats, countof(swcheats));

View file

@ -34,6 +34,12 @@ BEGIN_SW_NS
int f_c = 3;
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void MapColors(int num, COLOR_MAP cm, int create, uint8_t *tempbuf)
{
int i;
@ -57,6 +63,12 @@ void MapColors(int num, COLOR_MAP cm, int create, uint8_t *tempbuf)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
#define PLAYER_COLOR_MAPS 15
static COLOR_MAP PlayerColorMap[PLAYER_COLOR_MAPS][1] =
{
@ -109,6 +121,12 @@ static COLOR_MAP PlayerColorMap[PLAYER_COLOR_MAPS][1] =
};
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void GameInterface::loadPalette(void)
{
static COLOR_MAP AllToRed[] =

View file

@ -40,6 +40,12 @@ BEGIN_SW_NS
extern DAngle GlobSpeedSO;
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void CopySectorWalls(sectortype* dest_sect, sectortype* src_sect)
{
SECTOR_OBJECT* sop;
@ -104,6 +110,12 @@ void CopySectorWalls(sectortype* dest_sect, sectortype* src_sect)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void CopySectorMatch(int match)
{
sectortype* dsectp, *ssectp;

View file

@ -89,6 +89,12 @@ bool GameInterface::CanSave()
return (gamestate == GS_LEVEL && !CommEnabled && numplayers ==1 && /*!DemoMode &&*/ !(Player[myconnectindex].Flags & PF_DEAD));
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool GameInterface::StartGame(FNewGameStartup& gs)
{
PLAYER* pp = Player + screenpeek;

View file

@ -357,6 +357,12 @@ ACTOR_ACTION_SET EelActionSet =
int DoEelMatchPlayerZ(DSWActor* actor);
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void EelCommon(DSWActor* actor)
{
actor->spr.clipdist = (100) >> 2;
@ -371,6 +377,12 @@ void EelCommon(DSWActor* actor)
actor->user.Radius = 400;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int SetupEel(DSWActor* actor)
{
ANIMATOR DoActorDecide;
@ -400,6 +412,12 @@ int SetupEel(DSWActor* actor)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int NullEel(DSWActor* actor)
{
if (actor->user.Flags & (SPR_SLIDING))
@ -412,6 +430,12 @@ int NullEel(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoEelMatchPlayerZ(DSWActor* actor)
{
int dist,a,b,c;
@ -507,6 +531,12 @@ int DoEelMatchPlayerZ(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoEelDeath(DSWActor* actor)
{
if (actor->user.Flags & (SPR_FALLING))
@ -544,6 +574,12 @@ int DoEelDeath(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoEelMove(DSWActor* actor)
{
ASSERT(actor->user.Rot != nullptr);
@ -567,6 +603,12 @@ int DoEelMove(DSWActor* actor)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
#include "saveable.h"

View file

@ -364,6 +364,11 @@ void spawnactors(SpawnSpriteDef& sprites)
leveltimer = sprites.sprites.Size();
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void InitLevel(MapRecord *maprec)
{

View file

@ -710,6 +710,12 @@ ACTOR_ACTION_SET GirlNinjaActionSet =
nullptr
};
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int SetupGirlNinja(DSWActor* actor)
{
ANIMATOR DoActorDecide;
@ -738,6 +744,11 @@ int SetupGirlNinja(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoGirlNinjaMove(DSWActor* actor)
{
@ -774,6 +785,12 @@ int DoGirlNinjaMove(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int GirlNinjaJumpActionFunc(DSWActor* actor)
{
// if cannot move the sprite
@ -790,6 +807,12 @@ int GirlNinjaJumpActionFunc(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int NullGirlNinja(DSWActor* actor)
{
if (actor->user.WaitTics > 0) actor->user.WaitTics -= ACTORMOVETICS;
@ -805,6 +828,11 @@ int NullGirlNinja(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoGirlNinjaPain(DSWActor* actor)
{
@ -816,6 +844,12 @@ int DoGirlNinjaPain(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoGirlNinjaSpecial(DSWActor* actor)
{
if (actor->user.spal == PALETTE_PLAYER5)
@ -828,6 +862,11 @@ int DoGirlNinjaSpecial(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
#include "saveable.h"

View file

@ -481,6 +481,12 @@ ACTOR_ACTION_SET GoroActionSet =
nullptr
};
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int SetupGoro(DSWActor* actor)
{
ANIMATOR DoActorDecide;
@ -505,6 +511,12 @@ int SetupGoro(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int NullGoro(DSWActor* actor)
{
if (actor->user.Flags & (SPR_SLIDING))
@ -516,6 +528,12 @@ int NullGoro(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoGoroPain(DSWActor* actor)
{
NullGoro(actor);
@ -525,6 +543,12 @@ int DoGoroPain(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoGoroMove(DSWActor* actor)
{
if (actor->user.Flags & (SPR_SLIDING))
@ -541,6 +565,12 @@ int DoGoroMove(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
#include "saveable.h"

View file

@ -287,6 +287,12 @@ ACTOR_ACTION_SET HornetActionSet =
int DoHornetMatchPlayerZ(DSWActor* actor);
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int SetupHornet(DSWActor* actor)
{
ANIMATOR DoActorDecide;
@ -323,6 +329,12 @@ int SetupHornet(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int NullHornet(DSWActor* actor)
{
if (actor->user.Flags & (SPR_SLIDING))
@ -334,6 +346,12 @@ int NullHornet(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static const int HORNET_BOB_AMT = 16;
int DoHornetMatchPlayerZ(DSWActor* actor)
@ -403,6 +421,12 @@ int DoHornetMatchPlayerZ(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int InitHornetCircle(DSWActor* actor)
{
actor->user.ActorActionFunc = DoHornetCircle;
@ -432,6 +456,12 @@ int InitHornetCircle(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoHornetCircle(DSWActor* actor)
{
double bound;
@ -477,6 +507,12 @@ int DoHornetCircle(DSWActor* actor)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoHornetDeath(DSWActor* actor)
{
if (actor->user.Flags & (SPR_FALLING))
@ -515,7 +551,12 @@ int DoHornetDeath(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
// Hornets can swarm around other hornets or whatever is tagged as swarm target
//
//---------------------------------------------------------------------------
int DoCheckSwarm(DSWActor* actor)
{
int dist, pdist, a,b,c;
@ -556,6 +597,12 @@ int DoCheckSwarm(DSWActor* actor)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int DoHornetMove(DSWActor* actor)
{
// Check for swarming
@ -579,6 +626,12 @@ int DoHornetMove(DSWActor* actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
#include "saveable.h"

View file

@ -41,6 +41,12 @@ void DoPlayerTurnTurret(PLAYER* pp, float avel);
static InputPacket loc;
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void InitNetVars(void)
{
loc = {};

View file

@ -69,6 +69,12 @@ static struct so_interp
bool hasvator;
} so_interpdata[MAX_SECTOR_OBJECTS];
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void MarkSOInterp()
{
int32_t i;
@ -88,6 +94,12 @@ void MarkSOInterp()
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static double getvalue(so_interp::interp_data& element)
{
int index = element.curelement & soi_base;
@ -126,6 +138,12 @@ static double getvalue(so_interp::interp_data& element)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void setvalue(so_interp::interp_data& element, double value)
{
int index = element.curelement & soi_base;
@ -172,6 +190,12 @@ static void setvalue(so_interp::interp_data& element, double value)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void so_setpointinterpolation(so_interp *interp, int element, DSWActor* actor = nullptr)
{
int32_t i;
@ -193,6 +217,12 @@ static void so_setpointinterpolation(so_interp *interp, int element, DSWActor* a
data->lastoldipos = getvalue(*data);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void so_setspriteanginterpolation(so_interp *interp, DSWActor* actor)
{
int32_t i;
@ -213,7 +243,12 @@ static void so_setspriteanginterpolation(so_interp *interp, DSWActor* actor)
data->actorofang = actor;
}
//---------------------------------------------------------------------------
//
// Covers points and angles altogether
//
//---------------------------------------------------------------------------
static void so_stopdatainterpolation(so_interp *interp, int element, DSWActor* actor)
{
for (int i = 0; i < interp->numinterpolations; i++)
@ -226,6 +261,12 @@ static void so_stopdatainterpolation(so_interp *interp, int element, DSWActor* a
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void so_addinterpolation(SECTOR_OBJECT* sop)
{
sectortype* *sectp;
@ -277,6 +318,12 @@ void so_addinterpolation(SECTOR_OBJECT* sop)
interp->lasttic = synctics;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void so_setspriteinterpolation(SECTOR_OBJECT* sop, DSWActor* actor)
{
so_interp *interp = &so_interpdata[sop - SectorObject];
@ -288,6 +335,12 @@ void so_setspriteinterpolation(SECTOR_OBJECT* sop, DSWActor* actor)
so_setspriteanginterpolation(interp, actor);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void so_stopspriteinterpolation(SECTOR_OBJECT* sop, DSWActor *actor)
{
so_interp *interp = &so_interpdata[sop - SectorObject];
@ -299,6 +352,12 @@ void so_stopspriteinterpolation(SECTOR_OBJECT* sop, DSWActor *actor)
so_stopdatainterpolation(interp, soi_sprang, actor);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void so_setinterpolationtics(SECTOR_OBJECT* sop, int16_t locktics)
{
so_interp *interp = &so_interpdata[sop - SectorObject];
@ -307,6 +366,12 @@ void so_setinterpolationtics(SECTOR_OBJECT* sop, int16_t locktics)
interp->lasttic = locktics;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void so_updateinterpolations(void) // Stick at beginning of domovethings
{
int32_t i;
@ -350,8 +415,13 @@ void so_updateinterpolations(void) // Stick at beginning of domovethings
}
}
//---------------------------------------------------------------------------
//
// must call restore for every do interpolations
// make sure you don't exit
//
//---------------------------------------------------------------------------
void so_dointerpolations(double interpfrac) // Stick at beginning of drawscreen
{
int32_t i;
@ -454,6 +524,12 @@ void so_dointerpolations(double interpfrac) // Stick at beg
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void so_restoreinterpolations(void) // Stick at end of drawscreen
{
int32_t i;
@ -481,6 +557,12 @@ void so_restoreinterpolations(void) // Stick at end of drawscree
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void so_serializeinterpolations(FSerializer& arc)
{
SECTOR_OBJECT* sop;

View file

@ -82,6 +82,12 @@ INVENTORY_DATA InventoryData[MAX_INVENTORY+1] =
{nullptr, nullptr, nullptr, 0, 0, 0, 0}
};
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void PanelInvTestSuicide(PANEL_SPRITE* psp)
{
if (psp->flags & (PANF_SUICIDE))
@ -137,6 +143,12 @@ void AutoPickInventory(PLAYER* pp)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void UseInventoryMedkit(PLAYER* pp)
{
short diff;
@ -489,6 +501,12 @@ void InventoryKeys(PLAYER* pp)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void InventoryTimer(PLAYER* pp)
{
// called every time through loop
@ -567,6 +585,12 @@ void InventoryTimer(PLAYER* pp)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void InventoryUse(PLAYER* pp)
{
INVENTORY_DATA* id = &InventoryData[pp->InventoryNum];

View file

@ -34,6 +34,12 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
BEGIN_SW_NS
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void SectorLightShade(DSWActor* actor, short intensity)
{
int8_t* wall_shade;
@ -88,6 +94,12 @@ void SectorLightShade(DSWActor* actor, short intensity)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void DiffuseLighting(DSWActor* actor)
{
int i;
@ -117,6 +129,12 @@ void DiffuseLighting(DSWActor* actor)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void DoLightingMatch(short match, short state)
{
SWStatIterator it(STAT_LIGHTING);
@ -235,6 +253,12 @@ void DoLightingMatch(short match, short state)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void InitLighting(void)
{
// processed on level startup
@ -249,6 +273,12 @@ void InitLighting(void)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void DoLighting(void)
{
SWStatIterator it(STAT_LIGHTING);

View file

@ -37,6 +37,12 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
BEGIN_SW_NS
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
Collision MultiClipMove(PLAYER* pp, double zz, double floordist)
{
int i;
@ -112,6 +118,12 @@ Collision MultiClipMove(PLAYER* pp, double zz, double floordist)
return min_ret;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int MultiClipTurn(PLAYER* pp, DAngle new_ang, double zz, double floordist)
{
int i;
@ -147,6 +159,12 @@ int MultiClipTurn(PLAYER* pp, DAngle new_ang, double zz, double floordist)
return true;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int testquadinsect(int *point_num, DVector2 const * qp, sectortype* sect)
{
int i,next_i;
@ -176,7 +194,12 @@ int testquadinsect(int *point_num, DVector2 const * qp, sectortype* sect)
}
//---------------------------------------------------------------------------
//
//Ken gives the tank clippin' a try...
//
//---------------------------------------------------------------------------
int RectClipMove(PLAYER* pp, DVector2* qpos)
{
int i;
@ -232,6 +255,12 @@ int RectClipMove(PLAYER* pp, DVector2* qpos)
return false;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int testpointinquad(const DVector2& pt, const DVector2* quad)
{
for (int i = 0; i < 4; i++)
@ -242,6 +271,12 @@ int testpointinquad(const DVector2& pt, const DVector2* quad)
return true;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
short RectClipTurn(PLAYER* pp, DAngle new_angl, DVector2* qpos, DVector2* opos)
{
int i;