mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-14 12:09:36 +00:00
Level editor work
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include "QDPixMap.h"
|
||||
#include "Externs.h"
|
||||
#include "IconLoader.h"
|
||||
#include "ResourceFile.h"
|
||||
#include "Utilities.h"
|
||||
|
||||
|
||||
@@ -314,14 +315,39 @@ void LoadScaledGraphic (DrawSurface *surface, short resID, Rect *theRect)
|
||||
//-------------------------------------------------------------- LargeIconPlot
|
||||
// Draws a standard b&w icon (32 x 32) - resource is an 'ICON'.
|
||||
|
||||
void LargeIconPlot (Rect *theRect, short theID)
|
||||
bool LargeIconPlot (DrawSurface *surface, PortabilityLayer::ResourceFile *resFile, short resID, const Rect &theRect)
|
||||
{
|
||||
PLError_t theErr;
|
||||
Handle theSuite;
|
||||
|
||||
theErr = GetIconSuite(&theSuite, theID, svAllLargeData);
|
||||
if (theErr == PLErrors::kNone)
|
||||
theErr = PlotIconSuite(theRect, theSuite);
|
||||
Handle hdl = resFile->GetResource('icl8', resID, true);
|
||||
if (hdl)
|
||||
{
|
||||
THandle<PortabilityLayer::PixMapImpl> img = PortabilityLayer::IconLoader::GetInstance()->LoadSimpleColorIcon(hdl);
|
||||
|
||||
if (img)
|
||||
{
|
||||
CopyBits(*img, *surface->m_port.GetPixMap(), &(*img)->m_rect, &theRect, srcCopy);
|
||||
img.Dispose();
|
||||
}
|
||||
|
||||
hdl.Dispose();
|
||||
return true;
|
||||
}
|
||||
|
||||
hdl = resFile->GetResource('ICN#', resID, true);
|
||||
if (hdl)
|
||||
{
|
||||
THandle<PortabilityLayer::PixMapImpl> img = PortabilityLayer::IconLoader::GetInstance()->LoadBWIcon(hdl);
|
||||
|
||||
if (img)
|
||||
{
|
||||
CopyBits(*img, *surface->m_port.GetPixMap(), &(*img)->m_rect, &theRect, srcCopy);
|
||||
img.Dispose();
|
||||
}
|
||||
|
||||
hdl.Dispose();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawCIcon
|
||||
|
||||
Reference in New Issue
Block a user