MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / logic_serialize

Function logic_serialize

TheForceEngine/TFE_DarkForces/logic.cpp:449–471  ·  view source on GitHub ↗

Root serialization functions for Logics.

Source from the content-addressed store, hash-verified

447
448 // Root serialization functions for Logics.
449 void logic_serialize(Logic*& logic, SecObject* obj, Stream* stream)
450 {
451 LogicType type;
452 if (serialization_getMode() == SMODE_WRITE)
453 {
454 type = logic->type;
455 }
456
457 SERIALIZE(ObjState_InitVersion, type, LOGIC_UNKNOWN);
458 const u32 index = type < LOGIC_UNKNOWN ? type : LOGIC_UNKNOWN;
459
460 if (c_serializeFn[index])
461 {
462 c_serializeFn[index](logic, obj, stream);
463 if (logic) { logic->type = type; }
464 }
465 else
466 {
467 TFE_System::logWrite(LOG_ERROR, "Logic", "Serialize - invalid logic type: %d.", type);
468 if (logic) { logic->type = LOGIC_UNKNOWN; }
469 assert(0);
470 }
471 }
472
473
474 ///////////////////////////////////////////////////

Callers 1

objData_serializeFunction · 0.85

Calls 2

serialization_getModeFunction · 0.85
logWriteFunction · 0.85

Tested by

no test coverage detected