[Scummvm-cvs-logs] SF.net SVN: scummvm: [29905] scummvm/trunk/graphics/primitives.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Dec 19 15:02:04 CET 2007


Revision: 29905
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29905&view=rev
Author:   fingolfin
Date:     2007-12-19 06:02:03 -0800 (Wed, 19 Dec 2007)

Log Message:
-----------
Replaced sqrtf by sqrt (the former causes more problems than the tiny potential improvement is worth it)

Modified Paths:
--------------
    scummvm/trunk/graphics/primitives.cpp

Modified: scummvm/trunk/graphics/primitives.cpp
===================================================================
--- scummvm/trunk/graphics/primitives.cpp	2007-12-19 09:28:35 UTC (rev 29904)
+++ scummvm/trunk/graphics/primitives.cpp	2007-12-19 14:02:03 UTC (rev 29905)
@@ -26,13 +26,6 @@
 
 namespace Graphics {
 
-#if defined (MACOSX) || defined (__SYMBIAN32__)
-// Older versions of Mac OS X didn't supply a sqrtf function. To ensure
-// binary compatibility, we force using sqrt instead of sqrtf (the only
-// potential drawback is that it might be a little bit slower).
-#define sqrtf sqrt
-#endif
-
 void drawLine(int x0, int y0, int x1, int y1, int color, void (*plotProc)(int, int, int, void *), void *data) {
 	// Bresenham's line algorithm, as described by Wikipedia
 	const bool steep = ABS(y1 - y0) > ABS(x1 - x0);
@@ -89,7 +82,7 @@
 
 	float dx = x1 - x0;
 	float dy = y1 - y0;
-	float d = sqrtf(dx * dx + dy * dy);
+	float d = (float)sqrt(dx * dx + dy * dy);
 
 	if (!d)
         return;


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