summaryrefslogtreecommitdiff
path: root/movieobjects/dmeimage.cpp
blob: 2b972dc5a14773b7f5f0717d83fc0f8d4ae11da8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
//=============================================================================
#include "movieobjects/dmeimage.h"
#include "datamodel/dmelementfactoryhelper.h"
#include "bitmap/imageformat.h"


//-----------------------------------------------------------------------------
// Expose this class to the scene database 
//-----------------------------------------------------------------------------
IMPLEMENT_ELEMENT_FACTORY( DmeImage, CDmeImage );


//-----------------------------------------------------------------------------
// Constructor, destructor
//-----------------------------------------------------------------------------
void CDmeImage::OnConstruction()
{
	m_Width.Init( this, "width" );
	m_Height.Init( this, "height" );
	m_Format.Init( this, "format" );
	m_Bits.Init( this, "bits" );
}

void CDmeImage::OnDestruction()
{
}


//-----------------------------------------------------------------------------
// Image format
//-----------------------------------------------------------------------------
ImageFormat CDmeImage::Format() const
{
	return (ImageFormat)( m_Format.Get() );
}

const char *CDmeImage::FormatName() const
{
	return ImageLoader::GetName( Format() );
}