Main repository of MikuMikuStudio
Révision | ace47ad678817cf540b375d30a060191e002f320 (tree) |
---|---|
l'heure | 2013-02-27 06:55:59 |
Auteur | remy.bouquet@gmail.com <remy.bouquet@gmai...> |
Commiter | remy.bouquet@gmail.com |
Reverted accidental commit of GeometryList
git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@10442 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
@@ -33,7 +33,6 @@ package com.jme3.renderer.queue; | ||
33 | 33 | |
34 | 34 | import com.jme3.renderer.Camera; |
35 | 35 | import com.jme3.scene.Geometry; |
36 | -import com.jme3.util.ListSort; | |
37 | 36 | import com.jme3.util.SortUtil; |
38 | 37 | |
39 | 38 | /** |
@@ -49,15 +48,9 @@ public class GeometryList { | ||
49 | 48 | private static final int DEFAULT_SIZE = 32; |
50 | 49 | |
51 | 50 | private Geometry[] geometries; |
52 | - // private Geometry[] geometries2; | |
53 | - private ListSort listSort; | |
51 | + private Geometry[] geometries2; | |
54 | 52 | private int size; |
55 | 53 | private GeometryComparator comparator; |
56 | - | |
57 | - /*static private int count =0; | |
58 | - static private int cpt =0; | |
59 | - static private long time = 0; | |
60 | - */ | |
61 | 54 | |
62 | 55 | /** |
63 | 56 | * Initializes the GeometryList to use the given {@link GeometryComparator} |
@@ -68,9 +61,8 @@ public class GeometryList { | ||
68 | 61 | public GeometryList(GeometryComparator comparator) { |
69 | 62 | size = 0; |
70 | 63 | geometries = new Geometry[DEFAULT_SIZE]; |
71 | - // geometries2 = new Geometry[DEFAULT_SIZE]; | |
64 | + geometries2 = new Geometry[DEFAULT_SIZE]; | |
72 | 65 | this.comparator = comparator; |
73 | - listSort = new ListSort<Geometry>(); | |
74 | 66 | } |
75 | 67 | |
76 | 68 | /** |
@@ -123,9 +115,9 @@ public class GeometryList { | ||
123 | 115 | System.arraycopy(geometries, 0, temp, 0, size); |
124 | 116 | geometries = temp; // original list replaced by double-size list |
125 | 117 | |
126 | - // geometries2 = new Geometry[size * 2]; | |
118 | + geometries2 = new Geometry[size * 2]; | |
127 | 119 | } |
128 | - geometries[size++] = g; | |
120 | + geometries[size++] = g; | |
129 | 121 | } |
130 | 122 | |
131 | 123 | /** |
@@ -136,7 +128,7 @@ public class GeometryList { | ||
136 | 128 | geometries[i] = null; |
137 | 129 | } |
138 | 130 | |
139 | - size = 0; | |
131 | + size = 0; | |
140 | 132 | } |
141 | 133 | |
142 | 134 | /** |
@@ -145,34 +137,14 @@ public class GeometryList { | ||
145 | 137 | public void sort() { |
146 | 138 | if (size > 1) { |
147 | 139 | // sort the spatial list using the comparator |
148 | -// count++; | |
149 | -// long t = System.nanoTime(); | |
150 | - | |
151 | - if(listSort.getLength() != size){ | |
152 | - listSort.allocateStack(size); | |
153 | - } | |
154 | - listSort.sort(geometries,comparator); | |
155 | 140 | |
156 | -// time += System.nanoTime() - t; | |
141 | +// SortUtil.qsort(geometries, 0, size, comparator); | |
142 | +// Arrays.sort(geometries, 0, size, comparator); | |
157 | 143 | |
158 | - | |
144 | + System.arraycopy(geometries, 0, geometries2, 0, size); | |
145 | + SortUtil.msort(geometries2, geometries, 0, size-1, comparator); | |
159 | 146 | |
160 | -// count++; | |
161 | -// long t = System.nanoTime(); | |
162 | -// System.arraycopy(geometries, 0, geometries2, 0, size); | |
163 | -// SortUtil.msort(geometries2, geometries, 0, size-1, comparator); | |
164 | -// time += System.nanoTime() - t; | |
165 | -// | |
166 | -// count++; | |
167 | -// long t = System.nanoTime(); | |
168 | -// Arrays.sort(geometries,0,size, comparator); | |
169 | -// time += System.nanoTime() - t; | |
147 | + | |
170 | 148 | } |
171 | - | |
172 | -// if( count>50){ | |
173 | -// count = 0; | |
174 | -// cpt++; | |
175 | -// System.err.println(50*cpt+"\t"+time/1000000); | |
176 | -// } | |
177 | 149 | } |
178 | 150 | } |
\ No newline at end of file |