BVB Source Codes

CRYENGINE Show AttachmentBase.cpp Source code

Return Download CRYENGINE: download AttachmentBase.cpp Source code - Download CRYENGINE Source code - Type:.cpp
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #include "stdafx.h"
  4. #include "AttachmentBase.h"
  5.  
  6. #include "AttachmentManager.h"
  7.  
  8. void SAttachmentBase::AddBinding(IAttachmentObject* pModel, ISkin* pISkin /*= 0*/, uint32 nLoadingFlags /*= 0*/)
  9. {
  10.         if (nLoadingFlags & CA_CharEditModel)
  11.         {
  12.                 // The reason for introducing these special cases is twofold:
  13.                 // - Certain modification commands (such as CAddAttachmentObject) contain specialized control paths for CA_CharEditModel
  14.                 //   that may end up in a recursive CModificationCommandBuffer flush. This can cause a whole range of various mean things,
  15.                 //   including but not limited to stack overflows and calling methods on dangling pointers.
  16.                 // - CModificationCommandBuffer is currently not flushed when user interacts continuously with the CT model
  17.                 //   (e.g. dragging attachments around), which ends up with buffer overflows.
  18.                 //
  19.                 // There's no point in buffering modification commands in the character edit mode anyway, so we simply reverted to the old synchronous behavior as an ad-hoc fix.
  20.                 // Ideally, the attachment management code should be redesigned from the ground up to get rid of the massive technical debt and properly account for current, more dynamic use cases.
  21.                 Immediate_AddBinding(pModel, pISkin, nLoadingFlags);
  22.                 return;
  23.         }
  24.  
  25.         m_pAttachmentManager->AddAttachmentObject(this, pModel, pISkin, nLoadingFlags);
  26.         // Immediate_AddBinding(pModel, pISkin, nLoadingFlags);
  27. }
  28.  
  29. void SAttachmentBase::ClearBinding(uint32 nLoadingFlags /*= 0*/)
  30. {
  31.         if (nLoadingFlags & CA_CharEditModel)
  32.         {
  33.                 Immediate_ClearBinding(nLoadingFlags);
  34.                 return;
  35.         }
  36.  
  37.         m_pAttachmentManager->ClearAttachmentObject(this, nLoadingFlags);
  38.         // Immediate_ClearBinding(nLoadingFlags);
  39. }
  40.  
  41. void SAttachmentBase::SwapBinding(IAttachment* pNewAttachment)
  42. {
  43.         m_pAttachmentManager->SwapAttachmentObject(this, pNewAttachment);
  44.         // Immediate_SwapBinding(pNewAttachment);
  45. }
  46.  
downloadAttachmentBase.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