2009-03-04 08:01:04 +01:00
|
|
|
/****************************************************************************
|
2009-04-10 09:51:55 +02:00
|
|
|
* libwiigui
|
2009-03-04 08:01:04 +01:00
|
|
|
*
|
2009-04-10 09:51:55 +02:00
|
|
|
* Tantric 2009
|
2009-03-04 08:01:04 +01:00
|
|
|
*
|
|
|
|
* gui_imagedata.cpp
|
|
|
|
*
|
|
|
|
* GUI class definitions
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#include "gui.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor for the GuiImageData class.
|
|
|
|
*/
|
2010-06-04 01:16:47 +02:00
|
|
|
GuiImageData::GuiImageData(const u8 * i, int maxw, int maxh)
|
2009-03-04 08:01:04 +01:00
|
|
|
{
|
2009-04-07 04:57:49 +02:00
|
|
|
data = NULL;
|
|
|
|
width = 0;
|
|
|
|
height = 0;
|
|
|
|
|
2009-10-17 02:16:06 +02:00
|
|
|
if(i)
|
2010-06-04 01:16:47 +02:00
|
|
|
data = DecodePNG(i, &width, &height, maxw, maxh);
|
2009-03-04 08:01:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destructor for the GuiImageData class.
|
|
|
|
*/
|
|
|
|
GuiImageData::~GuiImageData()
|
|
|
|
{
|
|
|
|
if(data)
|
|
|
|
{
|
|
|
|
free(data);
|
|
|
|
data = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
u8 * GuiImageData::GetImage()
|
|
|
|
{
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
|
|
|
|
int GuiImageData::GetWidth()
|
|
|
|
{
|
|
|
|
return width;
|
|
|
|
}
|
|
|
|
|
|
|
|
int GuiImageData::GetHeight()
|
|
|
|
{
|
|
|
|
return height;
|
|
|
|
}
|