[Scummvm-cvs-logs] SF.net SVN: scummvm:[39799] scummvm/trunk/engines/sci/engine/kpathing.cpp
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Thu Apr 2 18:30:44 CEST 2009
Revision: 39799
http://scummvm.svn.sourceforge.net/scummvm/?rev=39799&view=rev
Author: thebluegr
Date: 2009-04-02 16:30:42 +0000 (Thu, 02 Apr 2009)
Log Message:
-----------
Fixed compilation under MSVC by implementing roundf()
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kpathing.cpp
Modified: scummvm/trunk/engines/sci/engine/kpathing.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kpathing.cpp 2009-04-02 15:28:34 UTC (rev 39798)
+++ scummvm/trunk/engines/sci/engine/kpathing.cpp 2009-04-02 16:30:42 UTC (rev 39799)
@@ -77,13 +77,15 @@
PF_FATAL = -2
};
+#define scummvm_roundf(a) ((fmod(a,1)<0.5) ? floor(a) : ceil(a))
+
// Floating point struct
struct FloatPoint {
FloatPoint() : x(0), y(0) {}
FloatPoint(float x_, float y_) : x(x_), y(y_) {}
Common::Point toPoint() {
- return Common::Point((int16)roundf(x), (int16)roundf(y));
+ return Common::Point((int16)scummvm_roundf(x), (int16)scummvm_roundf(y));
}
float x, y;
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