Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #include "movieobjects/dmeimage.h"
  7. #include "datamodel/dmelementfactoryhelper.h"
  8. #include "bitmap/imageformat.h"
  9. //-----------------------------------------------------------------------------
  10. // Expose this class to the scene database
  11. //-----------------------------------------------------------------------------
  12. IMPLEMENT_ELEMENT_FACTORY( DmeImage, CDmeImage );
  13. //-----------------------------------------------------------------------------
  14. // Constructor, destructor
  15. //-----------------------------------------------------------------------------
  16. void CDmeImage::OnConstruction()
  17. {
  18. m_Width.Init( this, "width" );
  19. m_Height.Init( this, "height" );
  20. m_Format.Init( this, "format" );
  21. m_Bits.Init( this, "bits" );
  22. }
  23. void CDmeImage::OnDestruction()
  24. {
  25. }
  26. //-----------------------------------------------------------------------------
  27. // Image format
  28. //-----------------------------------------------------------------------------
  29. ImageFormat CDmeImage::Format() const
  30. {
  31. return (ImageFormat)( m_Format.Get() );
  32. }
  33. const char *CDmeImage::FormatName() const
  34. {
  35. return ImageLoader::GetName( Format() );
  36. }