projectileTypeIGC.cpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. ** Copyright (C) 1996, 1997 Microsoft Corporation. All Rights Reserved.
  3. **
  4. ** File: projectileTypeIGC.cpp
  5. **
  6. ** Author:
  7. **
  8. ** Description:
  9. ** Implementation of the CprojectileTypeIGC class. This file was initially created by
  10. ** the ATL wizard for the core object.
  11. **
  12. ** History:
  13. */
  14. // projectileTypeIGC.cpp : Implementation of CprojectileTypeIGC
  15. #include "pch.h"
  16. #include "projectileTypeIGC.h"
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CprojectileTypeIGC
  19. HRESULT CprojectileTypeIGC::Initialize(ImissionIGC* pMission, Time now, const void* data, int dataSize)
  20. {
  21. assert (pMission);
  22. m_pMission = pMission;
  23. ZRetailAssert (data && (dataSize == sizeof(DataProjectileTypeIGC)));
  24. {
  25. m_data = *((DataProjectileTypeIGC*)data);
  26. if (iswalpha(m_data.modelName[0]))
  27. pMission->GetIgcSite()->Preload(m_data.modelName, iswalpha(m_data.textureName[0])
  28. ? m_data.textureName
  29. : NULL);
  30. else
  31. pMission->GetIgcSite()->Preload(NULL, m_data.textureName);
  32. pMission->AddProjectileType(this);
  33. }
  34. return S_OK;
  35. }
  36. int CprojectileTypeIGC::Export(void* data) const
  37. {
  38. if (data)
  39. *((DataProjectileTypeIGC*)data) = m_data;
  40. return sizeof(DataProjectileTypeIGC);
  41. }