diff options
author | Filippos Karapetis | 2009-09-25 07:05:26 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-09-25 07:05:26 +0000 |
commit | 7106caca810bb8012f3c04edc4ef01d73215bd66 (patch) | |
tree | a76a72d4d5e0b2b7d03106a870c8a74acdf80a6d | |
parent | edd338b229f4c6d6fc0b2aeb7e3bcf412c80071d (diff) | |
download | scummvm-rg350-7106caca810bb8012f3c04edc4ef01d73215bd66.tar.gz scummvm-rg350-7106caca810bb8012f3c04edc4ef01d73215bd66.tar.bz2 scummvm-rg350-7106caca810bb8012f3c04edc4ef01d73215bd66.zip |
Replaced the C99 lround() with floor(), to get draci to compile under non-C99 compilers (e.g. VS)
svn-id: r44328
-rw-r--r-- | engines/draci/game.cpp | 4 | ||||
-rw-r--r-- | engines/draci/sprite.cpp | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp index 9c68d00907..4d4755b419 100644 --- a/engines/draci/game.cpp +++ b/engines/draci/game.cpp @@ -1045,8 +1045,8 @@ void Game::walkHero(int x, int y) { uint height = frame->getHeight(); uint width = frame->getWidth(); - _persons[kDragonObject]._x = x + (lround(scaleX) * width) / 2; - _persons[kDragonObject]._y = y - lround(scaleY) * height; + _persons[kDragonObject]._x = x + (floor(scaleX) * width) / 2; + _persons[kDragonObject]._y = y - floor(scaleY) * height; // Set the per-animation scaling factor anim->setScaleFactors(scaleX, scaleY); diff --git a/engines/draci/sprite.cpp b/engines/draci/sprite.cpp index e37d40dd46..8d21453ef6 100644 --- a/engines/draci/sprite.cpp +++ b/engines/draci/sprite.cpp @@ -138,8 +138,8 @@ int Sprite::getPixel(int x, int y) const { double scaleX = double(_scaledWidth) / _width; double scaleY = double(_scaledHeight) / _height; - int sy = lround(dy * scaleY); - int sx = lround(dx * scaleX); + int sy = floor(dy * scaleY); + int sx = floor(dx * scaleX); if (_mirror) return _data[sy * _width + (_width - sx)]; @@ -188,11 +188,11 @@ void Sprite::drawScaled(Surface *surface, bool markDirty) const { // Precalculate pixel indexes for (int i = 0; i < rows; ++i) { - rowIndices[i] = lround(i / scaleY); + rowIndices[i] = floor(i / scaleY); } for (int j = 0; j < columns; ++j) { - columnIndices[j] = lround(j / scaleX); + columnIndices[j] = floor(j / scaleX); } // Blit the sprite to the surface |