[Scummvm-cvs-logs] SF.net SVN: scummvm:[44328] scummvm/trunk/engines/draci
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Fri Sep 25 09:05:26 CEST 2009
Revision: 44328
http://scummvm.svn.sourceforge.net/scummvm/?rev=44328&view=rev
Author: thebluegr
Date: 2009-09-25 07:05:26 +0000 (Fri, 25 Sep 2009)
Log Message:
-----------
Replaced the C99 lround() with floor(), to get draci to compile under non-C99 compilers (e.g. VS)
Modified Paths:
--------------
scummvm/trunk/engines/draci/game.cpp
scummvm/trunk/engines/draci/sprite.cpp
Modified: scummvm/trunk/engines/draci/game.cpp
===================================================================
--- scummvm/trunk/engines/draci/game.cpp 2009-09-25 06:43:33 UTC (rev 44327)
+++ scummvm/trunk/engines/draci/game.cpp 2009-09-25 07:05:26 UTC (rev 44328)
@@ -1045,8 +1045,8 @@
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);
Modified: scummvm/trunk/engines/draci/sprite.cpp
===================================================================
--- scummvm/trunk/engines/draci/sprite.cpp 2009-09-25 06:43:33 UTC (rev 44327)
+++ scummvm/trunk/engines/draci/sprite.cpp 2009-09-25 07:05:26 UTC (rev 44328)
@@ -138,8 +138,8 @@
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 @@
// 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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list