gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog libgeometry/kd_tree_dynamic.cpp


From: Markus Gothe
Subject: [Gnash-commit] gnash ChangeLog libgeometry/kd_tree_dynamic.cpp
Date: Mon, 27 Nov 2006 23:34:03 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Markus Gothe <nihilus>  06/11/27 23:34:03

Modified files:
        .              : ChangeLog 
        libgeometry    : kd_tree_dynamic.cpp 

Log message:
                * Reverted naming-changes.
                * libgeometry/kd_tree_dynamic.cpp: switch to <map> from hash().

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1793&r2=1.1794
http://cvs.savannah.gnu.org/viewcvs/gnash/libgeometry/kd_tree_dynamic.cpp?cvsroot=gnash&r1=1.13&r2=1.14

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1793
retrieving revision 1.1794
diff -u -b -r1.1793 -r1.1794
--- ChangeLog   27 Nov 2006 22:49:07 -0000      1.1793
+++ ChangeLog   27 Nov 2006 23:34:03 -0000      1.1794
@@ -1,7 +1,7 @@
 2006-11-25 Markus Gothe <address@hidden>
 
-       * server/StringPredicates.h: Changed struct's to classes. Added id-tag.
-         Use <cstring>-comparsion-functions.
+       * Reverted naming-changes.
+       * libgeometry/kd_tree_dynamic.cpp: switch to <map> from hash().
 
 2006-11-27 Sandro Santilli <address@hidden>
 

Index: libgeometry/kd_tree_dynamic.cpp
===================================================================
RCS file: /sources/gnash/gnash/libgeometry/kd_tree_dynamic.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- libgeometry/kd_tree_dynamic.cpp     13 Oct 2006 23:56:52 -0000      1.13
+++ libgeometry/kd_tree_dynamic.cpp     27 Nov 2006 23:34:03 -0000      1.14
@@ -13,6 +13,7 @@
 #include "kd_tree_dynamic.h"
 #include "tu_file.h"
 #include <cfloat>
+#include <map>
 
 using namespace gnash;
 
@@ -20,6 +21,38 @@
 static const int       LEAF_FACE_COUNT = 6;
 static const int       MAX_SPLIT_PLANES_TESTED = 10;
 
+class indexed
+{
+private:
+
+       typedef std::map<int, int> container;
+
+       container _map;
+
+public:
+
+       indexed() {}
+
+       bool get(const int& key, int* ret)
+       {
+               container::iterator it = _map.find(key);
+               if ( it != _map.end() )
+               {
+                       *ret = it->second;
+                       return true;
+               }
+               else
+               {
+                       return false;
+               }
+       }
+
+       void add(const int& key, int& mov)
+       {
+               _map[key] = mov;
+       }
+};
+
 //#define CARVE_OFF_SPACE
 //#define ADHOC_METRIC
 #define MACDONALD_AND_BOOTH_METRIC
@@ -73,8 +106,8 @@
        assert(tris1->size() == 0);
 
        // Remap table from verts array to new verts0/1 arrays.
-       hash<int, int>  verts_to_verts0;
-       hash<int, int>  verts_to_verts1;
+       indexed verts_to_verts0;
+       indexed verts_to_verts1;
 
        // Divide the faces.
        for (int i = 0; i < triangle_count; i++)
@@ -132,7 +165,7 @@
 }
 
 
-static void    remap_vertex_order(kd_tree_dynamic::node* node, hash<int,int>* 
map_indices_old_to_new, int* new_vertex_count)
+static void    remap_vertex_order(kd_tree_dynamic::node* node, indexed* 
map_indices_old_to_new, int* new_vertex_count)
 // Traverse this tree in depth-first order, and remap the vertex
 // indices to go in order.
 {
@@ -264,7 +297,7 @@
        // depth-first traversal of the tree.  Idea is to exploit
        // cache coherency when traversing tree.
 
-       hash<int, int>  map_indices_old_to_new;
+       index   map_indices_old_to_new;
        int     new_vertex_count = 0;
        remap_vertex_order(m_root, &map_indices_old_to_new, &new_vertex_count);
 




reply via email to

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