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:
parent
6970e178dc
commit
20a744bdd2
1 changed files with 2 additions and 3 deletions
|
@ -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];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue