void Sprite::DrawOn(SDL_Renderer * ren, int x, int y ) { TextureLocation tl = TextureManager().getSingleton()->getTexture(location); SDL_Rect outRect; outRect.x = x; outRect.y = y; outRect.w = visRect.w; outRect.h = visRect.h; SDL_Rect sRect = getSubRect(tl.lrect, visRect); SDL_RenderCopy(ren, tl.texture, &sRect, &outRect); }
void Sprite::selectFrame() { sf::IntRect visibleRect = getSubRect(); sprite->SetSubRect(getSubRect()); }