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 { |
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); |
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); |
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++) { |
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 |
} |
} |