MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / WriteGroupObject

Function WriteGroupObject

editor/Group.cpp:657–674  ·  view source on GitHub ↗

Saves an object for a group

Source from the content-addressed store, hash-verified

655
656// Saves an object for a group
657void WriteGroupObject(CFILE *ofile, object *objp) {
658 cf_WriteByte(ofile, objp->type);
659 cf_WriteShort(ofile, objp->id);
660 cf_WriteInt(ofile, objp->flags);
661
662 if (objp->type == OBJ_DOOR)
663 cf_WriteShort(ofile, objp->shields);
664
665 cf_WriteInt(ofile, objp->roomnum);
666 cf_WriteVector(ofile, &objp->pos);
667 cf_WriteMatrix(ofile, &objp->orient);
668
669 cf_WriteByte(ofile, objp->contains_type);
670 cf_WriteByte(ofile, objp->contains_id);
671 cf_WriteByte(ofile, objp->contains_count);
672
673 cf_WriteFloat(ofile, objp->lifeleft);
674}
675
676void WriteGroupTrigger(CFILE *ofile, trigger *tp) {
677 cf_WriteShort(ofile, tp->roomnum);

Callers 1

SaveGroupFunction · 0.85

Calls 4

cf_WriteByteFunction · 0.85
cf_WriteShortFunction · 0.85
cf_WriteIntFunction · 0.85
cf_WriteFloatFunction · 0.85

Tested by

no test coverage detected