/[libvob]/libvob/org/nongnu/libvob/gl/MipzipLoader.java
ViewVC logotype

Diff of /libvob/org/nongnu/libvob/gl/MipzipLoader.java

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

revision 1.4 by tjl, Thu Jun 26 08:51:47 2003 UTC revision 1.5 by tjl, Mon Aug 18 09:44:08 2003 UTC
# Line 92  public class MipzipLoader { Line 92  public class MipzipLoader {
92       */       */
93      public final float origWidth, origHeight;      public final float origWidth, origHeight;
94    
95        private String filterSettings;
96    
97        /** Set the callgl string for filtering the texture.
98         * The texture should be assumed to be loaded to TEXTURE_2D already.
99         */
100        public void setFilterSettings(String s) {
101            filterSettings = s;
102            reFilter();
103        }
104    
105      /** Open (if not already open) and return the ZipFile.      /** Open (if not already open) and return the ZipFile.
106       */       */
107      synchronized private ZipFile getZipFile() throws IOException {      synchronized private ZipFile getZipFile() throws IOException {
# Line 251  public class MipzipLoader { Line 261  public class MipzipLoader {
261                  levels[j].wasDiscarded();                  levels[j].wasDiscarded();
262              GLUtil.reloadCompressed(tex,              GLUtil.reloadCompressed(tex,
263                          currentBaseLevel, levels.length);                          currentBaseLevel, levels.length);
264                reFilter();
265          }          }
266          for(int i=currentBaseLevel; i<levels.length; i++) {          for(int i=currentBaseLevel; i<levels.length; i++) {
267              levels[i].loadData();              levels[i].loadData();
# Line 351  public class MipzipLoader { Line 362  public class MipzipLoader {
362    
363                  GLUtil.reloadCompressed(tex,                  GLUtil.reloadCompressed(tex,
364                              goalBaseLevel, levels.length);                              goalBaseLevel, levels.length);
365                    reFilter();
366                  if(currentBaseLevel < goalBaseLevel)                  if(currentBaseLevel < goalBaseLevel)
367                      setBaseLevel(goalBaseLevel);                      setBaseLevel(goalBaseLevel);
368                  else                  else
# Line 394  public class MipzipLoader { Line 406  public class MipzipLoader {
406          return tex;          return tex;
407      }      }
408    
409        /** CallGL to set the texture filters right.
410         */
411        private void reFilter() {
412            GL.call("BindTexture TEXTURE_2D "+tex.getTexId()+"\n"+
413                    filterSettings+"\n"+
414                    "BindTexture TEXTURE_2D 0\n");
415        }
416    
417      /** Get the amount of memory currently used.      /** Get the amount of memory currently used.
418       * @return Memory, in bytes       * @return Memory, in bytes
419       */       */

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

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