mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Add code for saving/loading planedisplace_t thinkers to/from $$$.sav
This commit is contained in:
parent
edba7834ae
commit
c9b623390f
1 changed files with 43 additions and 0 deletions
|
@ -974,6 +974,7 @@ typedef enum
|
||||||
tc_noenemies,
|
tc_noenemies,
|
||||||
tc_eachtime,
|
tc_eachtime,
|
||||||
tc_disappear,
|
tc_disappear,
|
||||||
|
tc_planedisplace,
|
||||||
#ifdef POLYOBJECTS
|
#ifdef POLYOBJECTS
|
||||||
tc_polyrotate, // haleyjd 03/26/06: polyobjects
|
tc_polyrotate, // haleyjd 03/26/06: polyobjects
|
||||||
tc_polymove,
|
tc_polymove,
|
||||||
|
@ -1537,6 +1538,21 @@ static void SaveDisappearThinker(const thinker_t *th, const UINT8 type)
|
||||||
WRITEINT32(save_p, ht->exists);
|
WRITEINT32(save_p, ht->exists);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// SavePlaneDisplaceThinker
|
||||||
|
//
|
||||||
|
// Saves a planedisplace_t thinker
|
||||||
|
//
|
||||||
|
static void SavePlaneDisplaceThinker(const thinker_t *th, const UINT8 type)
|
||||||
|
{
|
||||||
|
const planedisplace_t *ht = (const void *)th;
|
||||||
|
WRITEUINT8(save_p, type);
|
||||||
|
WRITEINT32(save_p, ht->affectee);
|
||||||
|
WRITEINT32(save_p, ht->control);
|
||||||
|
WRITEFIXED(save_p, ht->last_height);
|
||||||
|
WRITEFIXED(save_p, ht->speed);
|
||||||
|
WRITEUINT8(save_p, ht->type);
|
||||||
|
}
|
||||||
#ifdef POLYOBJECTS
|
#ifdef POLYOBJECTS
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -1818,6 +1834,12 @@ static void P_NetArchiveThinkers(void)
|
||||||
SaveDisappearThinker(th, tc_disappear);
|
SaveDisappearThinker(th, tc_disappear);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (th->function.acp1 == (actionf_p1)T_PlaneDisplace)
|
||||||
|
{
|
||||||
|
SavePlaneDisplaceThinker(th, tc_planedisplace);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
#ifdef POLYOBJECTS
|
#ifdef POLYOBJECTS
|
||||||
else if (th->function.acp1 == (actionf_p1)T_PolyObjRotate)
|
else if (th->function.acp1 == (actionf_p1)T_PolyObjRotate)
|
||||||
{
|
{
|
||||||
|
@ -2486,6 +2508,23 @@ static inline void LoadDisappearThinker(actionf_p1 thinker)
|
||||||
P_AddThinker(&ht->thinker);
|
P_AddThinker(&ht->thinker);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// LoadPlaneDisplaceThinker
|
||||||
|
//
|
||||||
|
// Loads a planedisplace_t thinker
|
||||||
|
//
|
||||||
|
static inline void LoadPlaneDisplaceThinker(actionf_p1 thinker)
|
||||||
|
{
|
||||||
|
planedisplace_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||||
|
ht->thinker.function.acp1 = thinker;
|
||||||
|
ht->affectee = READINT32(save_p);
|
||||||
|
ht->control = READINT32(save_p);
|
||||||
|
ht->last_height = READFIXED(save_p);
|
||||||
|
ht->speed = READFIXED(save_p);
|
||||||
|
ht->type = READUINT8(save_p);
|
||||||
|
P_AddThinker(&ht->thinker);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
#ifdef POLYOBJECTS
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -2769,6 +2808,10 @@ static void P_NetUnArchiveThinkers(void)
|
||||||
case tc_disappear:
|
case tc_disappear:
|
||||||
LoadDisappearThinker((actionf_p1)T_Disappear);
|
LoadDisappearThinker((actionf_p1)T_Disappear);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case tc_planedisplace:
|
||||||
|
LoadPlaneDisplaceThinker((actionf_p1)T_PlaneDisplace);
|
||||||
|
break;
|
||||||
#ifdef POLYOBJECTS
|
#ifdef POLYOBJECTS
|
||||||
case tc_polyrotate:
|
case tc_polyrotate:
|
||||||
LoadPolyrotatetThinker((actionf_p1)T_PolyObjRotate);
|
LoadPolyrotatetThinker((actionf_p1)T_PolyObjRotate);
|
||||||
|
|
Loading…
Reference in a new issue