Esempio n. 1
0
Ring::Ring(const float radius, const float hole, const unsigned int numberOfSides)
    : m_radius(radius)
    , m_hole(hole)
    , m_sectorSize(1.f)
    , m_sectorOffset(0.f)
    , m_numberOfSides(numberOfSides)
    , m_color(sf::Color::White)
    , m_primitiveType(sf::PrimitiveType::TrianglesStrip)
    , m_vertices((m_numberOfSides + 1) * 2)
    , m_texture(nullptr)
    , m_textureRect()
{
    priv_updateVertices();
}
Esempio n. 2
0
void TileMap::draw(sf::RenderTarget& target, sf::RenderStates states) const
{
	if (m_redrawRequired)
	{
		priv_updateVertices();
		priv_updateRender();
		m_redrawRequired = false;
	}

	states.texture = &m_renderTexture.getTexture();
	states.transform = getTransform();

	target.draw(&m_render.front(), 4, sf::PrimitiveType::Quads, states); // final render is always 4 vertices & quad
}
Esempio n. 3
0
void Ring::setNumberOfSides(const unsigned int numberOfSides)
{
    m_numberOfSides = numberOfSides;
    priv_updateVertices();
}
Esempio n. 4
0
void Ring::setHole(const float hole)
{
    m_hole = hole;
    priv_updateVertices();
}
Esempio n. 5
0
void Ring::setRadius(const float radius)
{
    m_radius = radius;
    priv_updateVertices();
}
Esempio n. 6
0
void Ring::setSectorOffset(const float sectorOffset)
{
    m_sectorOffset = sectorOffset;
    priv_updateVertices();
}
Esempio n. 7
0
void Ring::setSectorSize(const float sectorSize)
{
    m_sectorSize = sectorSize;
    priv_updateVertices();
}
Esempio n. 8
0
void Ring::setTextureRect(const sf::IntRect& textureRect)
{
    m_textureRect = textureRect;
    priv_updateVertices();
}
Esempio n. 9
0
void TileMap::redraw()
{
	priv_updateVertices();
	priv_updateRender();
}