gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog libbase/postscript.cpp libbase/...


From: Markus Gothe
Subject: [Gnash-commit] gnash ChangeLog libbase/postscript.cpp libbase/...
Date: Thu, 12 Oct 2006 13:45:26 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Markus Gothe <nihilus>  06/10/12 13:45:26

Modified files:
        .              : ChangeLog 
        libbase        : postscript.cpp triangulate_impl.h tu_math.h 
                         utility.h 
        libgeometry    : collision.cpp cull.cpp geometry.cpp 
                         kd_tree_dynamic.cpp kd_tree_packed.cpp 

Log message:
        Removed SGI-defs and std::math_functions in-code instead.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1164&r2=1.1165
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/postscript.cpp?cvsroot=gnash&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/triangulate_impl.h?cvsroot=gnash&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/tu_math.h?cvsroot=gnash&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/utility.h?cvsroot=gnash&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/gnash/libgeometry/collision.cpp?cvsroot=gnash&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/gnash/libgeometry/cull.cpp?cvsroot=gnash&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/gnash/libgeometry/geometry.cpp?cvsroot=gnash&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/gnash/libgeometry/kd_tree_dynamic.cpp?cvsroot=gnash&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/gnash/libgeometry/kd_tree_packed.cpp?cvsroot=gnash&r1=1.7&r2=1.8

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1164
retrieving revision 1.1165
diff -u -b -r1.1164 -r1.1165
--- ChangeLog   12 Oct 2006 13:31:12 -0000      1.1164
+++ ChangeLog   12 Oct 2006 13:45:26 -0000      1.1165
@@ -1,3 +1,11 @@
+2006-10-12 Markus Gothe <address@hidden>
+
+       * libbase/postscript.cpp, libbase/triangulate_impl.h, libbase/tu_math.h
+         libbase/utility.h, libgeometry/collision.cpp, libgeometry/cull.cpp,
+         libgeometry/geometry.cpp, libgeometry/kd_tree_dynamic.cpp, 
+         libgeometry/kd_tree_packed.cpp: Removed special-SGI std-declareation.
+         std::math_function in-code instead.
+
 2006-10-12 Sandro Santilli <address@hidden>
 
        * server/dlist.{h,cpp}: dump() inpsector correctly made const.

Index: libbase/postscript.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/postscript.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- libbase/postscript.cpp      30 Aug 2006 13:50:04 -0000      1.7
+++ libbase/postscript.cpp      12 Oct 2006 13:45:26 -0000      1.8
@@ -271,10 +271,10 @@
 void   postscript::update(float x, float y)
 // enlarge the bounding box if necessary.
 {
-       if (x < m_x0) m_x0 = floorf(x);
-       if (x > m_x1) m_x1 = ceilf(x);
-       if (y < m_y0) m_y0 = floorf(y);
-       if (y > m_y1) m_y1 = ceilf(y);
+       if (x < m_x0) m_x0 = std::floorf(x);
+       if (x > m_x1) m_x1 = std::ceilf(x);
+       if (y < m_y0) m_y0 = std::floorf(y);
+       if (y > m_y1) m_y1 = std::ceilf(y);
 
        m_empty = false;
 }

Index: libbase/triangulate_impl.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/triangulate_impl.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- libbase/triangulate_impl.h  2 Oct 2006 16:28:11 -0000       1.19
+++ libbase/triangulate_impl.h  12 Oct 2006 13:45:26 -0000      1.20
@@ -24,7 +24,7 @@
 // code, see the FIST web page at:
 // http://www.cosy.sbg.ac.at/~held/projects/triang/triang.html
 
-/* $Id: triangulate_impl.h,v 1.19 2006/10/02 16:28:11 bjacques Exp $ */
+/* $Id: triangulate_impl.h,v 1.20 2006/10/12 13:45:26 nihilus Exp $ */
 
 #include "utility.h"
 #include "triangulate.h"
@@ -1226,13 +1226,13 @@
        int     y_cells = 1;
        if (sorted_verts.size() > 0)
        {
-               const float     GRID_SCALE = sqrtf(0.5f);
+               const float     GRID_SCALE = std::sqrtf(0.5f);
                coord_t width = bound_of_all_verts.get_width();
                coord_t height = bound_of_all_verts.get_height();
                float   area = float(width) * float(height);
                if (area > 0)
                {
-                       float   sqrt_n = sqrt((float) sorted_verts.size());
+                       float   sqrt_n = std::sqrt((float) sorted_verts.size());
                        float   w = width * width / area * GRID_SCALE;
                        float   h = height * height / area * GRID_SCALE;
                        x_cells = int(w * sqrt_n);
@@ -1334,13 +1334,13 @@
        int     y_cells = 1;
        if (reflex_vert_count > 0)
        {
-               const float     GRID_SCALE = sqrtf(0.5f);
+               const float     GRID_SCALE = std::sqrtf(0.5f);
                coord_t width = reflex_bound.get_width();
                coord_t height = reflex_bound.get_height();
                float   area = float(width) * float(height);
                if (area > 0)
                {
-                       float   sqrt_n = sqrt((float) reflex_vert_count);
+                       float   sqrt_n = std::sqrt((float) reflex_vert_count);
                        float   w = width * width / area * GRID_SCALE;
                        float   h = height * height / area * GRID_SCALE;
                        x_cells = int(w * sqrt_n);

Index: libbase/tu_math.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/tu_math.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- libbase/tu_math.h   30 Aug 2006 15:54:18 -0000      1.12
+++ libbase/tu_math.h   12 Oct 2006 13:45:26 -0000      1.13
@@ -28,35 +28,6 @@
     #define powf pow
 #endif
 
-#if defined(__sgi) || defined(SGI) || defined(__sgi__)
-       #define fabs std::fabs
-       #define fabsf std::fabsf
-       #define modff std::modff
-       #define floorf std::floorf
-       #define ceilf std::ceilf
-       #define sqrt std::sqrt
-       #define sqrtf std::sqrtf
-       #define cosf std::cosf
-       #define sinf std::sinf
-       #define asin std::asin
-       #define asinf std::asinf
-       #define acosf std::acosf
-       #define acos std::acos
-       #define atan std::atan
-        #define atanf std::atanf
-        #define atan2 std::atan2
-        #define atan2f std::atan2f
-       #define logf std::logf
-       #define log std::log    
-       #define floor std::floor
-       #define pow std::pow
-       #define tan std::tan
-       #define cos std::cos
-       #define sin std::sin
-       #define exp std::exp
-       #define ceil std::ceil
-#endif
-
 // isfinite() comes with C99; fake version here in case compiler lacks it.
 #ifndef isfinite
 #define isfinite(x) (sizeof(x) == sizeof(float) ? isfinitef(x) : isfinited(x))

Index: libbase/utility.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/utility.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- libbase/utility.h   30 Aug 2006 14:10:49 -0000      1.16
+++ libbase/utility.h   12 Oct 2006 13:45:26 -0000      1.17
@@ -92,7 +92,7 @@
 inline float flerp(float a, float b, float f) { return (b - a) * f + a; }
 
 const float LN_2 = 0.693147180559945f;
-inline float   log2(float f) { return logf(f) / LN_2; }
+inline float   log2(float f) { return std::logf(f) / LN_2; }
 inline int     fchop( float f ) { return (int) f; }    // replace w/ inline 
asm if desired
 inline int     frnd(float f) { return fchop(f + 0.5f); }       // replace with 
inline asm if desired
 

Index: libgeometry/collision.cpp
===================================================================
RCS file: /sources/gnash/gnash/libgeometry/collision.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- libgeometry/collision.cpp   30 Aug 2006 13:50:05 -0000      1.8
+++ libgeometry/collision.cpp   12 Oct 2006 13:45:26 -0000      1.9
@@ -55,7 +55,7 @@
        {
                // m_inv_dir
                float   comp = m_dir[i];
-               if (fabsf(comp) <= DANGER_LIMIT_MIN)
+               if (std::fabsf(comp) <= DANGER_LIMIT_MIN)
                {
                        m_inv_dir[i] = -FLT_MAX;        // arbitrary crap
                        m_dir[i] = 0;   // don't tolerate tiny tiny component.  
Client code will know not to use this axis.
@@ -67,7 +67,7 @@
 
                // m_inv_displacement
                comp = disp[i];
-               if (fabsf(comp) <= DANGER_LIMIT_MIN)
+               if (std::fabsf(comp) <= DANGER_LIMIT_MIN)
                {
                        m_inv_displacement[i] = -FLT_MAX;       // arbitrary 
crap
                        m_dir[i] = 0;   // don't tolerate tiny tiny component.  
Client code will know not to use this axis.

Index: libgeometry/cull.cpp
===================================================================
RCS file: /sources/gnash/gnash/libgeometry/cull.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- libgeometry/cull.cpp        30 Aug 2006 13:50:05 -0000      1.5
+++ libgeometry/cull.cpp        12 Oct 2006 13:45:26 -0000      1.6
@@ -29,9 +29,9 @@
                const plane_info&       p = frustum[i];
                // Check box against this plane.
                float   d = p.normal * center - p.d;
-               float   extent_toward_plane = fabsf(extent.get_x() * 
p.normal.get_x())
-                       + fabsf(extent.get_y() * p.normal.get_y())
-                       + fabsf(extent.get_z() * p.normal.get_z());
+               float   extent_toward_plane = std::fabsf(extent.get_x() * 
p.normal.get_x())
+                       + std::fabsf(extent.get_y() * p.normal.get_y())
+                       + std::fabsf(extent.get_z() * p.normal.get_z());
                if (d < 0) {
                        if (-d > extent_toward_plane) {
                                // Box is culled by plane; it's not visible.

Index: libgeometry/geometry.cpp
===================================================================
RCS file: /sources/gnash/gnash/libgeometry/geometry.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- libgeometry/geometry.cpp    26 Aug 2006 00:25:07 -0000      1.5
+++ libgeometry/geometry.cpp    12 Oct 2006 13:45:26 -0000      1.6
@@ -149,7 +149,7 @@
 float  vec3::magnitude() const
 // Returns the length of *this.
 {
-       return sqrtf(sqrmag());
+       return std::sqrtf(sqrmag());
 }
 
 
@@ -402,7 +402,7 @@
        float tr = m[0].get(0) + m[1].get(1) + m[2].get(2);     // trace
 
        if (tr >= 0) {
-               s = sqrtf(tr + 1);
+               s = std::sqrtf(tr + 1);
                q.SetS(0.5f * s);
                s = 0.5f / s;
                q.SetV(vec3(m[1].get(2) - m[2].get(1), m[2].get(0) - 
m[0].get(2), m[0].get(1) - m[1].get(0)) * s);
@@ -420,7 +420,7 @@
                switch (i) {
                default:
                case 0:
-                       s = sqrtf((m[0].get(0) - (m[1].get(1) + m[2].get(2))) + 
1);
+                       s = std::sqrtf((m[0].get(0) - (m[1].get(1) + 
m[2].get(2))) + 1);
                        qi = 0.5f * s;
                        s = 0.5f / s;
                        qj = (m[1].get(0) + m[0].get(1)) * s;
@@ -429,7 +429,7 @@
                        break;
 
                case 1:
-                       s = sqrtf((m[1].get(1) - (m[2].get(2) + m[0].get(0))) + 
1);
+                       s = std::sqrtf((m[1].get(1) - (m[2].get(2) + 
m[0].get(0))) + 1);
                        qj = 0.5f * s;
                        s = 0.5f / s;
                        qk = (m[2].get(1) + m[1].get(2)) * s;
@@ -438,7 +438,7 @@
                        break;
 
                case 2:
-                       s = sqrtf((m[2].get(2) - (m[0].get(0) + m[1].get(1))) + 
1);
+                       s = std::sqrtf((m[2].get(2) - (m[0].get(0) + 
m[1].get(1))) + 1);
                        qk = 0.5f * s;
                        s = 0.5f / s;
                        qi = (m[0].get(2) + m[2].get(0)) * s;
@@ -462,9 +462,9 @@
 quaternion::quaternion(const vec3& Axis, float Angle)
 // Constructs the quaternion defined by the rotation about the given axis of 
the given angle (in radians).
 {
-       S = cosf(Angle / 2);
+       S = std::cosf(Angle / 2);
        V = Axis;
-       V *= sinf(Angle / 2);
+       V *= std::sinf(Angle / 2);
 }
 
 
@@ -479,7 +479,7 @@
 quaternion&    quaternion::normalize()
 // Ensures that the quaternion has magnitude 1.
 {
-       float   mag = sqrtf(S * S + V * V);
+       float   mag = std::sqrtf(S * S + V * V);
        if (mag > 0.0000001) {
                float   inv = 1.0f / mag;
                S *= inv;
@@ -533,10 +533,10 @@
 
        if (cos_omega < 0.99) {
                // Do the spherical interp.
-               float   omega = acosf(cos_omega);
-               float   sin_omega = sinf(omega);
-               f0 = sinf((1 - f) * omega) / sin_omega;
-               f1 = sinf(f * omega) / sin_omega;
+               float   omega = std::acosf(cos_omega);
+               float   sin_omega = std::sinf(omega);
+               f0 = std::sinf((1 - f) * omega) / sin_omega;
+               f1 = std::sinf(f * omega) / sin_omega;
        } else {
                // Quaternions are close; just do straight lerp and avoid 
division by near-zero.
                f0 = 1 - f;
@@ -632,7 +632,7 @@
 // Rotates the given point through the given angle (in radians) about the given
 // axis.
 {
-       quaternion      q(cosf(Angle/2), Axis * sinf(Angle/2));
+       quaternion      q(std::cosf(Angle/2), Axis * std::sinf(Angle/2));
 
        vec3    result;
        q.ApplyRotation(&result, Point);

Index: libgeometry/kd_tree_dynamic.cpp
===================================================================
RCS file: /sources/gnash/gnash/libgeometry/kd_tree_dynamic.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- libgeometry/kd_tree_dynamic.cpp     27 Aug 2006 20:01:01 -0000      1.10
+++ libgeometry/kd_tree_dynamic.cpp     12 Oct 2006 13:45:26 -0000      1.11
@@ -360,7 +360,7 @@
                {
                        float   neg_offset = faces[i].get_max_coord(axis, 
m_verts);
 
-                       if (fabsf(neg_offset - last_offset_tried) < EPSILON)
+                       if (std::fabsf(neg_offset - last_offset_tried) < 
EPSILON)
                        {
                                // Already tried this.
                                continue;
@@ -703,11 +703,11 @@
 #ifdef ADHOC_METRIC
        // compute a figure for how close to the center this splitting
        // plane is.  Normalize in [0,1].
-       float   volume_balance = 1.0f - fabsf(center - (neg_offset + 
*pos_offset) / 2) / extent;
+       float   volume_balance = 1.0f - std::fabsf(center - (neg_offset + 
*pos_offset) / 2) / extent;
 
        // Compute a figure for how well we balance the faces.  0 == bad,
        // 1 == good.
-       float   face_balance = 1.0f - (fabsf(float(front_count - back_count))) 
/ face_count;
+       float   face_balance = 1.0f - (std::fabsf(float(front_count - 
back_count))) / face_count;
 
        float   split_quality = bounds.get_surface_area() * volume_balance * 
face_balance;
 

Index: libgeometry/kd_tree_packed.cpp
===================================================================
RCS file: /sources/gnash/gnash/libgeometry/kd_tree_packed.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- libgeometry/kd_tree_packed.cpp      26 Aug 2006 18:32:57 -0000      1.7
+++ libgeometry/kd_tree_packed.cpp      12 Oct 2006 13:45:26 -0000      1.8
@@ -407,7 +407,7 @@
        pvec.set_cross(dir, edge2);
 
        /* if determinant is near zero, ray lies in plane of triangle */
-       const float det = fabsf( edge1 * pvec ); // = 
vec3U::TripleProduct(dir,edge1,edge2);
+       const float det = std::fabsf( edge1 * pvec ); // = 
vec3U::TripleProduct(dir,edge1,edge2);
 
        /* calculate distance from vert0 to ray origin */
        const vec3 tvec = orig - vert0;




reply via email to

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