• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ VArchive类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中VArchive的典型用法代码示例。如果您正苦于以下问题:C++ VArchive类的具体用法?C++ VArchive怎么用?C++ VArchive使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了VArchive类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Serialize

void VLineFollowerComponent::Serialize(VArchive &ar)
{
  char iLocalVersion = 1;

  IVObjectComponent::Serialize(ar);

  if (ar.IsLoading())
  {
    ar >> iLocalVersion;
    VASSERT_MSG(iLocalVersion==1, "Invalid local version. Please re-export");

    ar.ReadStringBinary(Model_AnimationName, sizeof(Model_AnimationName));
    ar.ReadStringBinary(Path_Key, sizeof(Path_Key));
    ar >> Path_NumberSteps;
    ar >> Path_TriggerDistance;
    ar >> Path_InitialOffset;
    ar >> Model_DeltaRotation;
    ar >> Model_GroundOffset;
    ar >> Model_CapsuleHeight;
    ar >> Model_CapsuleRadius;
    ar >> Debug_DisplayBoxes;
    
    Debug_RenderMesh = false;
    CommonInit();
  }
开发者ID:Alagong,项目名称:projectanarchy,代码行数:25,代码来源:VLineFollowerComponent.cpp


示例2: Serialize

void VFmodEvent::Serialize( VArchive &ar )
{
  VisObject3D_cl::Serialize(ar);
  char iVersion = -1;
  if (ar.IsLoading())
  {
    ar >> iVersion; 
    VASSERT(iVersion >= VFMOD_EVENT_VERSION_0 && iVersion <= VFMOD_EVENT_VERSION_CURRENT);

    // load resource 
    char szEventProjectPath[FS_MAX_PATH+1];
    char szEventGroupName[FS_MAX_PATH+1];
    ar.ReadStringBinary(szEventProjectPath, FS_MAX_PATH);
    ar.ReadStringBinary(szEventGroupName, FS_MAX_PATH);

    // event properties
    ar >> m_sEventName;

    // @@@ Force events to be non-disposable
    //m_iFlags |= VFMOD_FLAG_NODISPOSE;
    
    ar >> m_iFlags;

    if(iVersion >= VFMOD_EVENT_VERSION_1)
    {
      ar >> m_bPlayedOnce;
    }
开发者ID:RexBaribal,项目名称:projectanarchy,代码行数:27,代码来源:VFmodEventNull.cpp


示例3: Serialize

void VFmodSoundObject::Serialize( VArchive &ar )
{
  VisObject3D_cl::Serialize(ar);
  char iVersion = -1;
  if (ar.IsLoading())
  {
    ar >> iVersion; 
    VASSERT(iVersion >= VFMOD_SOUNDOBJECT_VERSION_0 && iVersion <= VFMOD_SOUNDOBJECT_VERSION_CURRENT);

    // first, load resource file
    int iResourceFlags;
    char szResourceFile[FS_MAX_PATH+1];
    ar >> iResourceFlags;
    ar.ReadStringBinary(szResourceFile, FS_MAX_PATH); 
    m_spResource = VFmodManager::GlobalManager().LoadSoundResource(szResourceFile, iResourceFlags);

    // sound properties
    ar >> m_iFlags;
    ar >> m_iPriority;
    ar >> m_fVolume >> m_fPan >> m_fConeInside >> m_fConeOutside;
    ar >> m_fFadeMin >> m_fFadeMax;
    ar >> m_bFading;
    ar >> m_fVolumeFadeTime >> m_fVolumeFadeDuration;
    ar >> m_fVolumeFadeStart >> m_fVolumeFadeTarget;
    ar >> m_fPitch;

    if(iVersion >= VFMOD_SOUNDOBJECT_VERSION_1)
    {
      ar >> m_bPlayedOnce;
    }
开发者ID:RexBaribal,项目名称:projectanarchy,代码行数:30,代码来源:VFmodSoundObject.cpp


示例4: Serialize

void VFmodCollisionMeshInstance::Serialize( VArchive &ar )
{
  if (ar.IsLoading())
  {
    char iVersion = -1;
    bool bActive;
    int iMeshType;
    ar >> iVersion; 
    VASSERT(iVersion >= V_FMODCOLLISIONMESHINSTANCE_VERSION_0 && iVersion <= V_FMODCOLLISIONMESHINSTANCE_VERSION_CURRENT);

    VisObject3D_cl::Serialize(ar);
    ar >> bActive;
    m_vScale.SerializeAsVec3(ar);
    ar >> m_fDirectOcclusion >> m_fReverbOcclusion;
    ar >> iMeshType; // mesh type; 0==VBaseMesh

    if (iMeshType==0)
    {
      VBaseMesh *pMesh = (VBaseMesh *)ar.ReadProxyObject();
      SetCollisionMesh(pMesh, m_fDirectOcclusion, m_fReverbOcclusion);
    } 
    else
    {
      VASSERT(!"Yet unsupported mesh type for sound collision geometry");
    }

    SetActive(bActive);
  } 
开发者ID:cDoru,项目名称:projectanarchy,代码行数:28,代码来源:VFmodCollisionMeshInstance.cpp


示例5: Serialize

//TODO: serialize added events!
void VAnimationComponent::Serialize( VArchive &ar )
{
  char iLocalVersion = 0;
  IVObjectComponent::Serialize(ar);
  if (ar.IsLoading())
  {
    ar >> iLocalVersion;
    VASSERT_MSG(iLocalVersion == 0, "Invalid local version. Please re-export");

    char pBuffer[512];
    ar.ReadStringBinary(pBuffer, 512);

    if(pBuffer && pBuffer[0])
    {
      unsigned int flags = 0;
      float time = 0;
      bool isPlaying = true;

      ar >> flags;
      ar >> time;
      ar >> isPlaying;

      Play(pBuffer, (flags&VANIMCTRL_LOOP)!=0);
      if(!isPlaying) Pause();
      SetTime(time);
    }
开发者ID:Arpit007,项目名称:projectanarchy,代码行数:27,代码来源:VAnimationComponent.cpp


示例6: SerializeX

 inline void SerializeX(VArchive &ar)
 {
   if (ar.IsLoading())
   {
     int iBitCount;
     ar >> iBitCount;
     AllocateBitfield(iBitCount);
     const int iIntCount = GetIntCount();
     if (iIntCount>0)
       ar.Read(GetIntArray(),iIntCount*sizeof(int),"i",iIntCount);
   } else
开发者ID:guozanhua,项目名称:projectanarchy,代码行数:11,代码来源:VBitField.hpp


示例7: SerializeX

void VDialogFrame::SerializeX( VArchive &ar )
{
  char iLocalVersion = 0;
  if (ar.IsLoading())
  {
    ar >> iLocalVersion; VASSERT_MSG(iLocalVersion==0,"Invalid version");
    ar >> m_pOwner;
    VTextureObject *pTex = (VTextureObject *)ar.ReadProxyObject();
    SetTexture(pTex);
    ar >> m_iColor;
  } else
开发者ID:cDoru,项目名称:projectanarchy,代码行数:11,代码来源:VDialogFrame.cpp


示例8: Serialize

void VScriptComponent::Serialize( VArchive &ar )
{
  char iLocalVersion = VERSION_CURRENT;
  IVObjectComponent::Serialize(ar);

  if (ar.IsLoading())
  {
    ar >> iLocalVersion;
    if (iLocalVersion<VERSION_INITIAL||iLocalVersion>VERSION_CURRENT)
      hkvLog::FatalError("Invalid script serialization version - please re-export scene.");

    // This is a workaround for [#21287] : This component must be immediately added to the owner's component list,
    // otherwise script function calls on it create a new script component which results in one object having two script components
    // [8.1: need to serialize it here]
    VisTypedEngineObject_cl *pOwner = ar.ReadObject<VisTypedEngineObject_cl>();
    if (pOwner != NULL && !pOwner->Components().Contains(this))
      ((VObjectComponentCollection &)pOwner->Components()).Add(this);
    // additionally we have to temporarily pretend the owner is set:
    m_pOwner = pOwner;

    m_iScriptRefID = LUA_REFNIL;
    VScriptInstance *pInstance = NULL;
    ar >> pInstance;
    // we shouldn't call SetScriptInstance since it calls the Lua OnCreate function, which may try to access the object
    //SetScriptInstance(pInstance);
    m_spInstance = pInstance;

    if(iLocalVersion >= VERSION_CUSTOM_EXPOSED_MEMBERS)
    {
      int iNumOfSerializedMembers;
      ar >> iNumOfSerializedMembers;

      m_CustomExposeVars.Clear();

      // read all members storead as Name+Type
      for(int i = 0;i < iNumOfSerializedMembers; i++)
      {
        char szBuffer1[64];
        char szBuffer2[64];
        bool bAllocated1 = false;
        bool bAllocated2 = false;
        const char *szName = ar.ReadEncryptedString(szBuffer1, 64, bAllocated1);
        const char *szValue = ar.ReadEncryptedString(szBuffer2, 64, bAllocated2);

        m_CustomExposeVars.Add(VScriptMember(szName, szValue));

        if(bAllocated1) V_SAFE_DELETE(szName);
        if(bAllocated2) V_SAFE_DELETE(szValue);
      }
    }
开发者ID:Arpit007,项目名称:projectanarchy,代码行数:50,代码来源:VScriptComponent.cpp


示例9: Serialize

void VBlobShadow::Serialize( VArchive &ar )
{
  char iLocalVersion = 2;
  IVObjectComponent::Serialize(ar);
  if (ar.IsLoading())
  {
    ar >> iLocalVersion;
    VASSERT_MSG(iLocalVersion==2, "Invalid local version. Please re-export");
    ar >> Enabled >> m_bNormalFalloff;
    m_ShadowBox.SerializeAs_VisBoundingBox (ar);
    ar >> Radius >> Height;
    ar >> ShadowColor >> m_vBlendColor;
    m_spShadowTex = (VTextureObject *)ar.ReadProxyObject();
  } else
开发者ID:guozanhua,项目名称:projectanarchy,代码行数:14,代码来源:BlobShadow.cpp


示例10: Serialize

// ----------------------------------------------------------------------------
void vHavokGenericConstraintDesc::Serialize( VArchive &ar )
{
  vHavokConstraintDesc::Serialize(ar);
  if (ar.IsLoading())
  {
    unsigned int iVersion = 0;
    ar >> iVersion;
    VASSERT((iVersion > 0) && (iVersion <= s_iSerialVersion));

    m_vGenericPivot.SerializeAsVisVector (ar);
    m_vAngularAxis.SerializeAsVisVector (ar);

    int iTmp;
    ar >> iTmp; m_eXMotion = (VGenericMotion_e)iTmp;
    ar >> iTmp; m_eYMotion = (VGenericMotion_e)iTmp;
    ar >> iTmp; m_eZMotion = (VGenericMotion_e)iTmp;
    ar >> iTmp; m_eAngularMotion = (VGenericMotion_e)iTmp;

    ar >> m_fLinearMin;
    ar >> m_fLinearMax;
    ar >> m_fAngularMin;
    ar >> m_fAngularMax;
    ar >> m_fVelocityTarget;
    ar >> m_fTau;
    ar >> m_fMinForce;
    ar >> m_fMaxForce;
    ar >> m_fLinearFriction;
    ar >> m_fAngularFriction;
  }
开发者ID:RexBaribal,项目名称:projectanarchy,代码行数:30,代码来源:vHavokGenericConstraint.cpp


示例11: SerializeX

void VSkyLayer::SerializeX( VArchive &ar )
{
  char iVersion = 0;
  if (ar.IsLoading())
  {
    ar >> iVersion; VVERIFY(iVersion==0 && "Invalid sky serialization version");

    // main properties
    char mapping;
    ar >> mapping;
    ar >> m_vMappingParams;
    ar >> m_vColor;
    ar >> m_vTextureTransform;
    ar >> m_vScrollSpeed;
    SetMapping((VIS_SKY_MappingType)mapping);

    // textures
    float fProgressStep = mapping==VIS_SKYMAPPING_CUBEMAP ? 100.f/6.f : 100.f;
    float fProgress = 0.f;
    VMemoryTempBuffer<FS_MAX_PATH> buffer;
    SAFE_LOAD_TEXTURE(m_spTexture, mapping==VIS_SKYMAPPING_SPHERICAL || mapping==VIS_SKYMAPPING_CYLINDRICAL);
    for (int i=0;i<6;i++)
      SAFE_LOAD_TEXTURE(m_spCubemapFace[i],mapping==VIS_SKYMAPPING_CUBEMAP);

  } else
开发者ID:RexBaribal,项目名称:projectanarchy,代码行数:25,代码来源:SkyLayer.cpp


示例12: Serialize

void vHavokTriggerVolume::Serialize( VArchive &ar )
{
  char iLocalVersion = VHAVOKTRIGGERVOLUME_VERSION_CURRENT;
  IVObjectComponent::Serialize(ar);
  if (ar.IsLoading())
  {
    char iFileVersion = 0;
    ar >> iFileVersion;
    VASSERT_MSG(iFileVersion <= iLocalVersion, "Invalid file version. Please re-export");
  
    ar >> Havok_ShapeType;
    ar >> Havok_MotionType;
    ar >> Havok_QualityType;
    ar >> Havok_CollisionLayer;
    ar >> Havok_CollisionGroup;
    ar >> Havok_SubSystemId;
    ar >> Havok_SubSystemDontCollideWith;
    ar >> Debug_Color;

    VisTriggerSourceComponent_cl *pComp = NULL;
    ar >> pComp;m_spOnObjectEnter = pComp;
    ar >> pComp;m_spOnObjectLeave = pComp;
    ar >> pComp;m_spOnCharacterEnter = pComp;
    ar >> pComp;m_spOnCharacterLeave = pComp;
  } 
开发者ID:RexBaribal,项目名称:projectanarchy,代码行数:25,代码来源:vHavokTriggerVolume.cpp


示例13: VASSERT

void VCurve2DBase::SerializeX( VArchive &ar )
{
  char iVersion = 0;
  if (ar.IsLoading())
  {
    int iLookupCount;
    ar >> iVersion; VASSERT(iVersion==0);
    ar >> m_iNumCurvePoints;
    AllocatePoints(m_iNumCurvePoints);
    if (m_iNumCurvePoints>0)
      ar.Read(m_pPoints,m_iNumCurvePoints*sizeof(VCurvePoint2D),"ffffff",m_iNumCurvePoints);
    ar >> m_fDuration >> m_fMax;
    ar >> iLookupCount;
    if (iLookupCount>0)
      CreateLookup(iLookupCount);
  } else
开发者ID:cDoru,项目名称:projectanarchy,代码行数:16,代码来源:Curve.cpp


示例14: Synchronize

void RPG_PlayerCharacterSynchronizationGroup::Synchronize(const VNetworkViewContext& context, VNetworkSynchronizationGroupInstanceInfo_t &instanceInfo, VArchive &ar)
{
  RPG_PlayerCharacter *pObj = (RPG_PlayerCharacter*) instanceInfo.m_pInstance;
  VHistoryData* pData = (VHistoryData*) instanceInfo.m_pCustomData;

  if (ar.IsLoading())
  {
    // Get timing
    __int64 iTimeMS;
    ar >> iTimeMS; //8 byte
    ar >> pData->m_iDataFlagsToSend; // 1 byte

    //hkvLog::Warning("Server time: %.5f", iTimeMS / 1000.0f);


    if (pData->m_iDataFlagsToSend & VCD_POSITION)
    {
      float fX, fY, fZ;

      ar >> fX; //4 byte
      ar >> fY; //4 byte
      ar >> fZ; //4 byte
      hkvVec3 vNewPosition (fX, fY, fZ);
      pData->m_positionHistory.Write (vNewPosition, iTimeMS);
    }
开发者ID:Arpit007,项目名称:projectanarchy,代码行数:25,代码来源:PlayerCharacterSynchronizationGroup.cpp


示例15: Serialize

void VScriptInstance::Serialize( VArchive &ar )
{
  IVScriptInstance::Serialize(ar);
  if (ar.IsLoading())
  {
    char iVersion;
    ar >> iVersion; VVERIFY(iVersion==0 && "invalid version number");
    VScriptResource *pRes = (VScriptResource *)ar.ReadProxyObject();
    Init();
    SetResource(pRes);
    if (pRes)
    {
      VScriptResourceManager *pManager = (VScriptResourceManager *)pRes->GetParentManager();
      pManager->Instances().Add(this);
    }
  }
开发者ID:cDoru,项目名称:projectanarchy,代码行数:16,代码来源:VScriptInstance.cpp


示例16: Serialize

void VPostProcessScreenMasks::Serialize( VArchive &ar )
{
  char iLocalVersion = 0;
  if (ar.IsLoading())
  {
    ar >> iLocalVersion;
    ar >> m_bActive;
  }
开发者ID:guozanhua,项目名称:projectanarchy,代码行数:8,代码来源:VPostProcessScreenMasks.cpp


示例17: Serialize

void VSimpleCopyPostprocess::Serialize( VArchive &ar )
{
  if (ar.IsLoading())
  {
    ar >> m_bActive;

    VRendererNodeCommon* pDummy;
    ar >> pDummy;
  }
开发者ID:RexBaribal,项目名称:projectanarchy,代码行数:9,代码来源:SimpleCopyPostprocess.cpp


示例18: Serialize

void VLookupItem::Serialize( VArchive &ar )
{
  char iLocalVersion = 0;
  VListControlItem::Serialize(ar);
  if (ar.IsLoading())
  {
    ar >> iLocalVersion; VASSERT_MSG(iLocalVersion==0,"Invalid version");
    ar >> m_iMatchColor;
  } else
开发者ID:Arpit007,项目名称:projectanarchy,代码行数:9,代码来源:VMapLookupControl.cpp


示例19: Serialize

void VDlgControlBase::Serialize( VArchive &ar )
{
  VWindowBase::Serialize(ar);
  if (ar.IsLoading())
  {
  } else
  {
  }
}
开发者ID:cDoru,项目名称:projectanarchy,代码行数:9,代码来源:VDlgControlBase.cpp


示例20: Serialize

void VUndoableSectorAction::Serialize( VArchive &ar )
{
  VisTypedEngineObject_cl::Serialize(ar);
  char iLocalVersion = 0;
  if (ar.IsLoading())
  {
    ar >> iLocalVersion;VASSERT_MSG(iLocalVersion==0, "Invalid version number");
    ar >> m_iSectorX >> m_iSectorY;
  }
开发者ID:guozanhua,项目名称:projectanarchy,代码行数:9,代码来源:UndoableSectorActions.cpp



注:本文中的VArchive类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ VArray类代码示例发布时间:2022-05-31
下一篇:
C++ V8TestingScope类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap