snes9xgx/source/gui/gui_imagedata.cpp

52 lines
810 B
C++
Raw Normal View History

2009-03-11 18:28:37 +01:00
/****************************************************************************
2009-04-10 10:12:37 +02:00
* libwiigui
2009-03-11 18:28:37 +01:00
*
2009-04-10 10:12:37 +02:00
* Tantric 2009
2009-03-11 18:28:37 +01:00
*
* gui_imagedata.cpp
*
* GUI class definitions
***************************************************************************/
#include "gui.h"
/**
* Constructor for the GuiImageData class.
*/
GuiImageData::GuiImageData(const u8 * i, int maxw, int maxh)
2009-03-11 18:28:37 +01:00
{
2009-03-21 03:01:40 +01:00
data = NULL;
width = 0;
height = 0;
2009-10-17 02:15:58 +02:00
if(i)
data = DecodePNG(i, &width, &height, data, maxw, maxh);
2009-03-11 18:28:37 +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;
}