Simplified rectangle height and width calculation in Sprite::drawScaled() (use methods of Common::Rect instead of doing it manually).

svn-id: r42779
This commit is contained in:
Denis Kasak 2009-07-25 18:33:20 +00:00
parent 6970e178dc
commit 20a744bdd2

View File

@ -126,7 +126,6 @@ void Sprite::setMirrorOff() {
_mirror = false;
}
// TODO: Research what kind of sampling the original player uses
void Sprite::drawScaled(Surface *surface, bool markDirty) const {
Common::Rect sourceRect(0, 0, _width, _height);
@ -155,8 +154,8 @@ void Sprite::drawScaled(Surface *surface, bool markDirty) const {
const int transparent = surface->getTransparentColour();
// Calculate how many rows and columns we need to draw
const int rows = clippedDestRect.bottom - clippedDestRect.top;
const int columns = clippedDestRect.right - clippedDestRect.left;
const int rows = clippedDestRect.height();
const int columns = clippedDestRect.width();
int *rowIndices = new int[rows];
int *columnIndices = new int[columns];