BVB Source Codes

CRYENGINE Show ProceduralBreak.cpp Source code

Return Download CRYENGINE: download ProceduralBreak.cpp Source code - Download CRYENGINE Source code - Type:.cpp
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. /*************************************************************************
  4.    -------------------------------------------------------------------------
  5.    $Id$
  6.    $DateTime$
  7.    Description:  network breakability: basic information for procedural breaks
  8.    -------------------------------------------------------------------------
  9.    History:
  10.    - 22/01/2007   10:34 : Created by Craig Tiller
  11. *************************************************************************/
  12.  
  13. #include "StdAfx.h"
  14.  
  15. #if !NET_USE_SIMPLE_BREAKAGE
  16.  
  17.         #include "ProceduralBreak.h"
  18.         #include "BreakReplicator.h"
  19.         #include "SerializeBits.h"
  20.         #include "SerializeDirHelper.h"
  21.  
  22. void SProceduralSpawnRec::SerializeWith(TSerialize ser)
  23. {
  24.         ser.EnumValue("typ", op, eNBO_Create, eNBO_NUM_OPERATIONS);
  25.         #define CSER(cond, val) if (BIT(op) & cond) ser.Value( # val, val); else \
  26.           val = -1
  27.         CSER(OPS_WITH_PARTIDS, partid);
  28.         CSER(OPS_REFERENCING_ENTS, idxRef);
  29.         CSER(OPS_CAUSING_ENTS, idx);
  30.         #undef CSER
  31. }
  32.  
  33. void SJointBreakRec::SerializeWith(TSerialize ser)
  34. {
  35.         LOGBREAK("SJointBreakRec, %s", ser.IsReading() ? "Reading:" : "Writing");
  36.  
  37.         ser.Value("ref", idxRef);
  38.         ser.Value("id", id);
  39.         #if BREAK_HIERARCHICAL_TRACKING
  40.         ser.Value("frame", frame);
  41.         #endif
  42.         ser.Value("epicenter", epicenter);
  43. }
  44.  
  45.         #pragma warning(push)
  46.         #pragma warning(disable : 6262)// 32k of stack space of CBitArray
  47. void SJointBreakParticleRec::SerializeWith(TSerialize ser)
  48. {
  49.         LOGBREAK("SJointBreakParticleRec");
  50.         CBitArray array(&ser);
  51.         SerializeDirVector(array, vel, 20.f, 8, 8, 8);
  52.         if (ser.IsWriting()) array.WriteToSerializer();
  53. }
  54.         #pragma warning(pop)
  55.  
  56. void SProceduralBreak::AddProceduralSendables(int breakId, INetSendableSink* pSink)
  57. {
  58.         if (magicId >= 0)
  59.                 CBreakReplicator::SendSetMagicIdWith(SSetMagicId(breakId, magicId), pSink);
  60.         for (int i = 0; i < jointBreaks.size(); i++)
  61.         {
  62.                 CBreakReplicator::SendDeclareJointBreakRecWith(SDeclareJointBreakRec(breakId, jointBreaks[i]), pSink);
  63.         }
  64.         for (int i = 0; i < spawnRecs.size(); i++)
  65.         {
  66.                 CBreakReplicator::SendDeclareProceduralSpawnRecWith(SDeclareProceduralSpawnRec(breakId, spawnRecs[i]), pSink);
  67.         }
  68. }
  69.  
  70. #endif // !NET_USE_SIMPLE_BREAKAGE
  71.  
downloadProceduralBreak.cpp Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top