1
0
forked from 0ad/0ad
0ad/source/gui/CImage.cpp
Ykkrosh ba0ebd6644 Renamed icon-size/icon-id to cell-size/cell-id, and allowed cell-id to be used in <icon>s.
Added <effect>s to sprites/images - currently multiply-color and
add-color, though they're far from perfect.

This was SVN commit r1525.
2004-12-18 13:32:00 +00:00

42 lines
757 B
C++
Executable File

/*
CImage
by Gustav Larsson
gee@pyro.nu
*/
#include "precompiled.h"
#include "GUI.h"
#include "CImage.h"
#include "ogl.h"
using namespace std;
//-------------------------------------------------------------------
// Constructor / Destructor
//-------------------------------------------------------------------
CImage::CImage()
{
AddSetting(GUIST_CGUISpriteInstance, "sprite");
AddSetting(GUIST_int, "cell-id");
}
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);
}
}