151 |
state = STATE_NONE; |
state = STATE_NONE; |
152 |
} |
} |
153 |
|
|
154 |
|
/** The texture level from the GL side was discarded. |
155 |
|
* Because discard() doesn't work on NV drivers, |
156 |
|
* do it this way. |
157 |
|
*/ |
158 |
|
synchronized void wasDiscarded() { |
159 |
|
if(dbg) |
160 |
|
pa("Discarded "+MipzipLoader.this+" "+level+ |
161 |
|
" "+state); |
162 |
|
loadedData = null; |
163 |
|
state = STATE_NONE; |
164 |
|
} |
165 |
|
|
166 |
|
|
167 |
/** Create a level. |
/** Create a level. |
168 |
* @param l The mipmap level index |
* @param l The mipmap level index |
169 |
* @param s The size string from the comment in the file, e.g."64x128" |
* @param s The size string from the comment in the file, e.g."64x128" |
192 |
*/ |
*/ |
193 |
synchronized public void loadToBaseLevelSynch(int level) throws IOException { |
synchronized public void loadToBaseLevelSynch(int level) throws IOException { |
194 |
for(int i=0; i<level; i++) { |
for(int i=0; i<level; i++) { |
195 |
levels[i].discard(); |
levels[i].discard(); // XXX fix |
196 |
} |
} |
197 |
for(int i=level; i<levels.length; i++) { |
for(int i=level; i<levels.length; i++) { |
198 |
levels[i].loadData(); |
levels[i].loadData(); |
274 |
if(dbg) pa("MipzipLoader "+this+" discard: "+ |
if(dbg) pa("MipzipLoader "+this+" discard: "+ |
275 |
i+" "+levels[i].state+" "+ |
i+" "+levels[i].state+" "+ |
276 |
currentBaseLevel); |
currentBaseLevel); |
277 |
levels[i].discard(); |
if(false) { |
278 |
if(currentBaseLevel <= i) |
levels[i].discard(); |
279 |
setBaseLevel(i+1); |
if(currentBaseLevel <= i) |
280 |
AbstractUpdateManager.doWhenIdle(r_runGL, |
setBaseLevel(i+1); |
281 |
priority); |
AbstractUpdateManager.doWhenIdle(r_runGL, |
282 |
return; |
priority); |
283 |
|
return; |
284 |
|
} |
285 |
|
for(int j=0; j<goalBaseLevel; j++) |
286 |
|
levels[j].wasDiscarded(); |
287 |
|
GLUtil.reloadCompressed(tex, |
288 |
|
goalBaseLevel, levels.length); |
289 |
|
break; |
290 |
|
|
291 |
} |
} |
292 |
} |
} |
293 |
if(dbg) pa("MipzipLoader "+this+" no discards"); |
if(dbg) pa("MipzipLoader "+this+" no discards"); |