/[fenfire]/fenfire/org/fenfire/spanimages/gl/PoolManager.java
ViewVC logotype

Diff of /fenfire/org/fenfire/spanimages/gl/PoolManager.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by tjl, Tue Jun 24 11:11:52 2003 UTC revision 1.7 by tjl, Thu Jun 26 08:54:18 2003 UTC
# Line 43  public class PoolManager implements GL.S Line 43  public class PoolManager implements GL.S
43      public float DICELENGTH2 = 1;      public float DICELENGTH2 = 1;
44      public int DICEDEPTH = 10;      public int DICEDEPTH = 10;
45    
46        public int MIN_ACTIVES = 20; // minimum number to retain actively
47    
48      Set activeSet = Collections.synchronizedSet(new HashSet());      Set activeSet = Collections.synchronizedSet(new HashSet());
49    
50      class MySIV extends AbstractVob implements SpanImageVob {      class MySIV extends AbstractVob implements SpanImageVob {
# Line 94  public class PoolManager implements GL.S Line 96  public class PoolManager implements GL.S
96    
97          siv.sx0 = sx0; siv.sx1 = sx1; siv.sy0 = sy0; siv.sy1 = sy1;          siv.sx0 = sx0; siv.sx1 = sx1; siv.sy0 = sy0; siv.sy1 = sy1;
98    
99            activeSet.add(i);
100    
101          if(dbg)          if(dbg)
102              p("Makevob: "+mult+" "+w+" "+h);              p("Makevob: "+mult+" "+w+" "+h);
# Line 144  public class PoolManager implements GL.S Line 147  public class PoolManager implements GL.S
147          bgThread.start();          bgThread.start();
148      }      }
149    
150        /** A set of singleimages that are to be locked at
151         * maximum resolution.
152         */
153        public Set locked = Collections.synchronizedSet(new HashSet());
154    
155      SingleImage[] templ = new SingleImage[0];      SingleImage[] templ = new SingleImage[0];
156      public void updateAllocs() {      public void updateAllocs() {
157          SingleImage[] actives = (SingleImage[])activeSet.toArray(templ);          SingleImage[] actives = (SingleImage[])activeSet.toArray(templ);
# Line 155  public class PoolManager implements GL.S Line 163  public class PoolManager implements GL.S
163              actives[i].updateTime(time);              actives[i].updateTime(time);
164          }          }
165          for(int i=0; i<actives.length; i++) {          for(int i=0; i<actives.length; i++) {
166                if(locked.contains(actives[i])) {
167                    actives[i].loader.setGoalBaseLevel(0,
168                                    Background.getDefaultInstance(),
169                                    1);
170                    continue;
171                }
172              int l = 0;              int l = 0;
173              if(dbg) p("Loop: "+i+" "+actives.length);              if(dbg) p("Loop: "+i+" "+actives.length);
174              for(; l < actives[i].missingPixels.length; l++) {              for(; l < actives[i].missingPixels.length; l++) {
# Line 175  public class PoolManager implements GL.S Line 189  public class PoolManager implements GL.S
189              actives[i].loader.setGoalBaseLevel(l,              actives[i].loader.setGoalBaseLevel(l,
190                              Background.getDefaultInstance(),                              Background.getDefaultInstance(),
191                              (float)(10 + .1 * i));                              (float)(10 + .1 * i));
192              if(l == actives[i].loader.getNLevels()-1)              if(i >= MIN_ACTIVES && l == actives[i].loader.getNLevels()-1)
193                  activeSet.remove(actives[i]);                  activeSet.remove(actives[i]);
194          }          }
195      }      }

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26