wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src mapgen.cpp sdl_utils.cpp


From: Guillaume Melquiond
Subject: [Wesnoth-cvs-commits] wesnoth/src mapgen.cpp sdl_utils.cpp
Date: Sun, 26 Dec 2004 17:12:43 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Guillaume Melquiond <address@hidden>    04/12/26 22:01:12

Modified files:
        src            : mapgen.cpp sdl_utils.cpp 

Log message:
        According to the standard, cmath functions are in the std namespace; 
better qualify them then, since a compiler complains.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/mapgen.cpp.diff?tr1=1.47&tr2=1.48&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/sdl_utils.cpp.diff?tr1=1.65&tr2=1.66&r1=text&r2=text

Patches:
Index: wesnoth/src/mapgen.cpp
diff -u wesnoth/src/mapgen.cpp:1.47 wesnoth/src/mapgen.cpp:1.48
--- wesnoth/src/mapgen.cpp:1.47 Sun Dec  5 22:14:29 2004
+++ wesnoth/src/mapgen.cpp      Sun Dec 26 22:01:12 2004
@@ -133,7 +133,7 @@
                if(island_size != 0) {
                        const size_t diffx = abs(x1 - int(center_x));
                        const size_t diffy = abs(y1 - int(center_y));
-                       const size_t dist = size_t(sqrt(double(diffx*diffx + 
diffy*diffy)));
+                       const size_t dist = size_t(std::sqrt(double(diffx*diffx 
+ diffy*diffy)));
                        is_valley = dist > island_size;
                }
 
@@ -149,7 +149,7 @@
                                const int xdiff = (x2-x1);
                                const int ydiff = (y2-y1);
 
-                               const int height = radius - 
int(sqrt(double(xdiff*xdiff + ydiff*ydiff)));
+                               const int height = radius - 
int(std::sqrt(double(xdiff*xdiff + ydiff*ydiff)));
 
                                if(height > 0) {
                                        if(is_valley) {
Index: wesnoth/src/sdl_utils.cpp
diff -u wesnoth/src/sdl_utils.cpp:1.65 wesnoth/src/sdl_utils.cpp:1.66
--- wesnoth/src/sdl_utils.cpp:1.65      Thu Nov 18 22:00:12 2004
+++ wesnoth/src/sdl_utils.cpp   Sun Dec 26 22:01:12 2004
@@ -1,4 +1,4 @@
-/* $Id: sdl_utils.cpp,v 1.65 2004/11/18 22:00:12 ydirson Exp $ */
+/* $Id: sdl_utils.cpp,v 1.66 2004/12/26 22:01:12 silene Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -186,12 +186,12 @@
                                //we now have a rectangle, 
(xsrc,ysrc,xratio,yratio) which we
                                //want to derive the pixel from
                                for(double xloc = xsrc; xloc < xsrc+xratio; 
xloc += 1.0) {
-                                       const double xsize = 
minimum<double>(floor(xloc+1.0)-xloc,xsrc+xratio-xloc);
+                                       const double xsize = 
minimum<double>(std::floor(xloc+1.0)-xloc,xsrc+xratio-xloc);
                                        for(double yloc = ysrc; yloc < 
ysrc+yratio; yloc += 1.0) {
                                                const int xsrcint = 
maximum<int>(0,minimum<int>(src->w-1,static_cast<int>(xsrc)));
                                                const int ysrcint = 
maximum<int>(0,minimum<int>(src->h-1,static_cast<int>(ysrc)));
 
-                                               const double ysize = 
minimum<double>(floor(yloc+1.0)-yloc,ysrc+yratio-yloc);            
+                                               const double ysize = 
minimum<double>(std::floor(yloc+1.0)-yloc,ysrc+yratio-yloc);               
 
                                                Uint8 r,g,b,a;
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]