1
0
forked from 0ad/0ad
0ad/source/gui/CImage.cpp
janwas b755ddefda remove all author/modified by tags.
make include guards consistent.

This was SVN commit r5040.
2007-05-07 16:33:24 +00:00

42 lines
817 B
C++

/*
CImage
*/
#include "precompiled.h"
#include "GUI.h"
#include "CImage.h"
#include "lib/ogl.h"
using namespace std;
//-------------------------------------------------------------------
// Constructor / Destructor
//-------------------------------------------------------------------
CImage::CImage()
{
AddSetting(GUIST_CGUISpriteInstance, "sprite");
AddSetting(GUIST_int, "cell_id");
AddSetting(GUIST_CStr, "tooltip");
AddSetting(GUIST_CStr, "tooltip_style");
}
CImage::~CImage()
{
}
void CImage::Draw()
{
if (GetGUI())
{
float bz = GetBufferedZ();
CGUISpriteInstance *sprite;
int cell_id;
GUI<CGUISpriteInstance>::GetSettingPointer(this, "sprite", sprite);
GUI<int>::GetSetting(this, "cell_id", cell_id);
GetGUI()->DrawSprite(*sprite, cell_id, bz, m_CachedActualSize);
}
}