/[gzz]/gzz/gzz/gfx/gl/MipzipLoader.java
ViewVC logotype

Diff of /gzz/gzz/gfx/gl/MipzipLoader.java

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

revision 1.13 by tjl, Sat Jan 18 21:08:27 2003 UTC revision 1.14 by tjl, Sun Jan 19 10:08:12 2003 UTC
# Line 151  public class MipzipLoader { Line 151  public class MipzipLoader {
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"
# Line 179  public class MipzipLoader { Line 192  public class MipzipLoader {
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();
# Line 261  public class MipzipLoader { Line 274  public class MipzipLoader {
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");

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

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