CmPixelData.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #include "CmPixelData.h"
  2. #include "CmPixelUtil.h"
  3. #include "CmPixelDataRTTI.h"
  4. namespace BansheeEngine
  5. {
  6. PixelData::PixelData(const PixelData& copy)
  7. :GpuResourceData(copy)
  8. {
  9. mFormat = copy.mFormat;
  10. mRowPitch = copy.mRowPitch;
  11. mSlicePitch = copy.mSlicePitch;
  12. mExtents = copy.mExtents;
  13. }
  14. PixelData& PixelData::operator=(const PixelData& rhs)
  15. {
  16. GpuResourceData::operator= (rhs);
  17. mFormat = rhs.mFormat;
  18. mRowPitch = rhs.mRowPitch;
  19. mSlicePitch = rhs.mSlicePitch;
  20. mExtents = rhs.mExtents;
  21. return *this;
  22. }
  23. UINT32 PixelData::getInternalBufferSize()
  24. {
  25. return PixelUtil::getMemorySize(getWidth(), getHeight(), getDepth(), getFormat());
  26. }
  27. /************************************************************************/
  28. /* SERIALIZATION */
  29. /************************************************************************/
  30. RTTITypeBase* PixelData::getRTTIStatic()
  31. {
  32. return PixelDataRTTI::instance();
  33. }
  34. RTTITypeBase* PixelData::getRTTI() const
  35. {
  36. return PixelData::getRTTIStatic();
  37. }
  38. }