mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-14 12:09:36 +00:00
Scaled blit, plus fix some level editor things
This commit is contained in:
31
PortabilityLayer/PLImageWidget.cpp
Normal file
31
PortabilityLayer/PLImageWidget.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "PLImageWidget.h"
|
||||
#include "PLQDraw.h"
|
||||
#include "ResourceManager.h"
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
ImageWidget::ImageWidget(const WidgetBasicState &state)
|
||||
: WidgetSpec<ImageWidget>(state)
|
||||
{
|
||||
}
|
||||
|
||||
ImageWidget::~ImageWidget()
|
||||
{
|
||||
}
|
||||
|
||||
bool ImageWidget::Init(const WidgetBasicState &state)
|
||||
{
|
||||
m_pict = PortabilityLayer::ResourceManager::GetInstance()->GetResource('PICT', state.m_resID).StaticCast<Picture>();
|
||||
|
||||
if (!m_pict)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ImageWidget::DrawControl(DrawSurface *surface)
|
||||
{
|
||||
if (m_pict && m_rect.IsValid())
|
||||
surface->DrawPicture(m_pict, m_rect);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user