Пример #1
0
		const rectf getNormalisedTextureCoords(const std::vector<TexturePtr>::const_iterator& it, const geometry::Rect<T>& r) {
			float w = static_cast<float>((*it)->width());
			float h = static_cast<float>((*it)->height());
			return rectf(static_cast<float>(r.x())/w, static_cast<float>(r.y())/h, static_cast<float>(r.x2())/w, static_cast<float>(r.y2())/h);
		}
Пример #2
0
		const rectf getNormalisedTextureCoords(const geometry::Rect<T>& r) {
			float w = static_cast<float>(width());
			float h = static_cast<float>(height());
			return rectf(static_cast<float>(r.x())/w, static_cast<float>(r.y())/h, static_cast<float>(r.x2())/w, static_cast<float>(r.y2())/h);
		}
Пример #3
0
		const geometry::Rect<N> getNormalisedTextureCoords(const geometry::Rect<T>& r) {
			float w = static_cast<float>(surface_width_);
			float h = static_cast<float>(surface_height_);
			return geometry::Rect<N>(static_cast<N>(r.x())/w, static_cast<N>(r.y())/h, static_cast<N>(r.x2())/w, static_cast<N>(r.y2())/h);		
		}