83 lines
1.8 KiB
C++
83 lines
1.8 KiB
C++
// Platform skeleton for EterLib/GrpImage.h (40250 EterLib/GrpImage.cpp), generated by platform_stub.py.
|
|
// Every MT_PLATFORM_STUB() body is unimplemented: replace it with the platform implementation.
|
|
#include "EterLib/StdAfx.h"
|
|
#include "EterLib/GrpImage.h"
|
|
|
|
#include "../PlatformStub.h"
|
|
|
|
auto CGraphicImage::Type() -> TType
|
|
{
|
|
static TType type = StringToType("CGraphicImage");
|
|
return type;
|
|
}
|
|
|
|
CGraphicImage::CGraphicImage(const char * c_szFileName, DWORD dwFilter) : CResource(c_szFileName), m_dwFilter(dwFilter) // initializers as in 40250
|
|
{
|
|
m_rect = {0, 0, 0, 0};
|
|
}
|
|
|
|
CGraphicImage::~CGraphicImage()
|
|
{
|
|
MT_PLATFORM_STUB();
|
|
}
|
|
|
|
auto CGraphicImage::CreateDeviceObjects() -> bool
|
|
{
|
|
MT_PLATFORM_STUB();
|
|
return mt_platform_stub_return<bool>();
|
|
}
|
|
|
|
auto CGraphicImage::DestroyDeviceObjects() -> void
|
|
{
|
|
MT_PLATFORM_STUB();
|
|
}
|
|
|
|
auto CGraphicImage::GetWidth() const -> int
|
|
{
|
|
return m_rect.right - m_rect.left;
|
|
}
|
|
|
|
auto CGraphicImage::GetHeight() const -> int
|
|
{
|
|
return m_rect.bottom - m_rect.top;
|
|
}
|
|
|
|
auto CGraphicImage::GetRectReference() const -> const RECT &
|
|
{
|
|
return m_rect;
|
|
}
|
|
|
|
auto CGraphicImage::GetTextureReference() const -> const CGraphicTexture &
|
|
{
|
|
return m_imageTexture;
|
|
}
|
|
|
|
auto CGraphicImage::GetTexturePointer() -> CGraphicTexture *
|
|
{
|
|
return &m_imageTexture;
|
|
}
|
|
|
|
auto CGraphicImage::OnLoad(int size, const void *data) -> bool
|
|
{
|
|
m_imageTexture.SetFileName(GetFileName());
|
|
if (!m_imageTexture.CreateFromMemoryFile(size, data, D3DFMT_UNKNOWN, m_dwFilter)) return false;
|
|
m_rect = {0, 0, m_imageTexture.GetWidth(), m_imageTexture.GetHeight()};
|
|
return true;
|
|
}
|
|
|
|
auto CGraphicImage::OnClear() -> void
|
|
{
|
|
m_imageTexture.Destroy();
|
|
m_rect = {0, 0, 0, 0};
|
|
}
|
|
|
|
auto CGraphicImage::OnIsEmpty() const -> bool
|
|
{
|
|
return m_imageTexture.IsEmpty();
|
|
}
|
|
|
|
auto CGraphicImage::OnIsType(TType type) -> bool
|
|
{
|
|
return type == Type() || CResource::OnIsType(type);
|
|
}
|