diff --git a/source/games/sw/src/save.cpp b/source/games/sw/src/save.cpp index a8cafa9cf..aaf88b66e 100644 --- a/source/games/sw/src/save.cpp +++ b/source/games/sw/src/save.cpp @@ -1112,7 +1112,8 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, TRACK& w, TRACK* d void DSWActor::Serialize(FSerializer& arc) { Super::Serialize(arc); - arc("hasuser", hasUser); + arc("hasuser", hasUser) + ("owner", ownerActor); if (hasUser) arc("user", user); // only write if defined. } diff --git a/source/games/sw/src/sounds.h b/source/games/sw/src/sounds.h index 603169044..6578b2e8d 100644 --- a/source/games/sw/src/sounds.h +++ b/source/games/sw/src/sounds.h @@ -147,35 +147,6 @@ struct VOCstruct }; -// JIMSOUND3D(tm) variables section ////////////////////////////////////////// - -#if 0 -struct VOC3Dstruct -{ - VOC_INFOp vp; // Pointer to the sound - int *x; // Pointer to x coordinate - int *y; // Pointer to y coordinate - int *z; // Pointer to z coordinate - int fx, fy, fz; // Non-Follow literal values - Voc3D_Flags flags; // 3d voc sound flags - int handle; // Current handle to the voc - short doplr_delta; // Change in distance since last call - VOC3D_INFOp prev, next; // Linked voc list - short owner; // Hold index into user array to - // delete looping sounds - int num; // Digital Entry number used for - // callback of looping sounds - // If sound is active but user == 0, stop the sound - short dist; // Current distance of sound from player - uint8_t priority; // Used to force a higher priority based on distance - int tics; // Tics used to count to next sound occurance - int maxtics; // Tics until next sound occurance - // for intermittent sounds - bool deleted; // Has sound been marked for deletion? - bool FX_Ok; // Did this sound play ok? -}; -#endif - extern VOC_INFO voc[]; END_SW_NS diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index ff4c0a4e9..3e1c1db2f 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -581,26 +581,22 @@ STATE s_IconFlag[] = void SetOwner(DSWActor* ownr, DSWActor* child, bool flag) { - SPRITEp cp = &child->s(); - if (flag && ownr != nullptr && ownr->hasU()) { SET(ownr->u()->Flags2, SPR2_CHILDREN); } - - cp->owner = ownr? ownr->GetSpriteIndex() : -1; + child->ownerActor = ownr; } DSWActor* GetOwner(DSWActor* child) { - if (!child || child->s().owner < 0) return nullptr; - return &swActors[child->s().owner]; + return child ? child->ownerActor : nullptr; } void ClearOwner(DSWActor* child) { - if (child) child->s().owner = -1; + if (child) child->ownerActor = nullptr; } void SetAttach(DSWActor* ownr, DSWActor* child) diff --git a/source/games/sw/src/swactor.h b/source/games/sw/src/swactor.h index 0cbf28807..cdea58ce2 100644 --- a/source/games/sw/src/swactor.h +++ b/source/games/sw/src/swactor.h @@ -16,6 +16,7 @@ public: bool hasUser; USER user; walltype* tempwall; // transient, to replace a hack using a 16 bit sprite field. + DSWActor* ownerActor; DSWActor() {