예제 #1
0
void Cursor::onUpdateVertexCache()
{
	clearVertices();

	std::vector<sf::Vertex> vertices;

	// pos coords.
	sf::Vector2f tl(myCursorTransform.getTransform().transformPoint(sf::Vector2f(0,0)));
	sf::Vector2f tr(myCursorTransform.getTransform().transformPoint(sf::Vector2f(getTextureRect().width,0)));
	sf::Vector2f br(myCursorTransform.getTransform().transformPoint(sf::Vector2f(getTextureRect().width,getTextureRect().height)));
	sf::Vector2f bl(myCursorTransform.getTransform().transformPoint(sf::Vector2f(0,getTextureRect().height)));

	// tex coords.
	sf::Vector2f ttl(getTextureRect().left, getTextureRect().top);
	sf::Vector2f tbr(getTextureRect().left + getTextureRect().width, getTextureRect().top + getTextureRect().height);
	sf::Vector2f ttr(tbr.x, ttl.y);
	sf::Vector2f tbl(ttl.x, tbr.y);

	// add vertices.
	vertices.push_back(sf::Vertex(tl, sf::Color::White, ttl));
	vertices.push_back(sf::Vertex(tr, sf::Color::White, ttr));
	vertices.push_back(sf::Vertex(bl, sf::Color::White, tbl));
	vertices.push_back(sf::Vertex(tr, sf::Color::White, ttr));
	vertices.push_back(sf::Vertex(br, sf::Color::White, tbr));
	vertices.push_back(sf::Vertex(bl, sf::Color::White, tbl));

	vertexAddTextured(vertices);
}
예제 #2
0
/** Convert a MDY+TBR file into VGM. */
void convertMDY(const std::string &mdyFile, const std::string &tbrFile) {
	status("Converting MDY \"%s\" with TBR \"%s\" to VGM...", mdyFile.c_str(), tbrFile.c_str());

	// Open the input files
	Common::File mdy(mdyFile);
	Common::File tbr(tbrFile);
	AdLib::MUSPlayer musPlayer(mdy, tbr);

	musPlayer.convert(findFilename(mdyFile) + ".vgm");
}
예제 #3
0
 void prune (size_t max_size, func on_remove)
 {
     while (size_ > max_size)
     {
         pair_t& tbr (list_.back());
         on_remove(tbr.first, tbr.second);
         map_.erase(tbr.first);
         list_.pop_back();
         --size_;
     }
 }