[Scummvm-cvs-logs] SF.net SVN: scummvm:[39802] scummvm/trunk/engines/sci/engine/kpathing.cpp
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Thu Apr 2 21:37:56 CEST 2009
Revision: 39802
http://scummvm.svn.sourceforge.net/scummvm/?rev=39802&view=rev
Author: thebluegr
Date: 2009-04-02 19:37:56 +0000 (Thu, 02 Apr 2009)
Log Message:
-----------
Applied fingolfin's suggestion to remove the roundf() implementation and make the code in that bit simpler and more readable (since points are always positive)
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 16:54:21 UTC (rev 39801)
+++ scummvm/trunk/engines/sci/engine/kpathing.cpp 2009-04-02 19:37:56 UTC (rev 39802)
@@ -77,15 +77,13 @@
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)scummvm_roundf(x), (int16)scummvm_roundf(y));
+ return Common::Point(x + 0.5, y + 0.5);
}
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