Render

PHOTO EMBED

Sat Oct 02 2021 18:08:51 GMT+0000 (UTC)

Saved by @Eonaap #c++

SDL_Rect rsc{}, dst{};
	for (const Tile& tile : m_pTiles)
	{
		rsc.x = static_cast<int>((m_LevelNumber * m_TileSize.x * 3) + m_TileSize.x * int(tile.tileState));
		rsc.y = 0;
		rsc.w = static_cast<int>(m_TileSize.x);
		rsc.h = static_cast<int>(m_TileSize.y);

		dst.x = static_cast<int>(tile.pos.x);
		dst.y = static_cast<int>(tile.pos.y);
		dst.w = static_cast<int>(m_TileSize.x);
		dst.h = static_cast<int>(m_TileSize.y);

		kaas::Renderer::GetInstance().RenderTexture(*m_pTexture, dst, rsc);
	}

	for (const Disc& disc : m_pPossibleDiscLocations)
	{
		if (disc.level == m_LevelNumber)
		{
			kaas::Renderer::GetInstance().RenderTexture(*m_pDiscTexture, disc.pos.x, disc.pos.y);
		}
	}
content_copyCOPY