Misc bits

This commit is contained in:
2014-11-29 03:21:28 -05:00
parent 6f73841764
commit 1cdc7ddb7c
3 changed files with 5 additions and 0 deletions

View File

@@ -1023,6 +1023,7 @@ void Region::setStencil(sf::RenderWindow& where) {
}
void clip_rect(sf::RenderTarget& where, RECT rect) {
rect |= RECT(where); // Make sure we don't draw out of bounds
// TODO: Make sure this works for the scissor test...
setActiveRenderTarget(where);
glEnable(GL_SCISSOR_TEST);
@@ -1066,6 +1067,7 @@ void tileImage(sf::RenderTarget& target, RECT area, sf::Texture& img, sf::BlendM
RECT clipArea = area;
area.left -= area.left % imgSz.x;
area.top -= area.top % imgSz.y;
area |= RECT(target); // Make sure we don't draw out of bounds
unsigned int hrep = int((double(area.width())/imgSz.x)+0.5);
unsigned int vrep = int((double(area.height())/imgSz.y)+0.5);
@@ -1091,6 +1093,7 @@ void tileImage(sf::RenderTarget& target, RECT area, sf::Texture& img, RECT srcRe
RECT clipArea = area;
area.left -= area.left % tesselRect.width();
area.top -= area.top % tesselRect.height();
area |= RECT(target); // Make sure we don't draw out of bounds
sf::RectangleShape tessel(sf::Vector2f(area.width(),area.height()));
tessel.setTexture(&temp.getTexture());