[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] libvob org/nongnu/libvob/gl/MipzipLoader.java v...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] libvob org/nongnu/libvob/gl/MipzipLoader.java v... |
Date: |
Tue, 22 Apr 2003 21:27:48 -0400 |
CVSROOT: /cvsroot/libvob
Module name: libvob
Changes by: Tuomas J. Lukka <address@hidden> 03/04/22 21:27:48
Modified files:
org/nongnu/libvob/gl: MipzipLoader.java
vob/util : mipzipmaker.py
Log message:
Pass original sizes
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/gl/MipzipLoader.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/util/mipzipmaker.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
Patches:
Index: libvob/org/nongnu/libvob/gl/MipzipLoader.java
diff -u libvob/org/nongnu/libvob/gl/MipzipLoader.java:1.1
libvob/org/nongnu/libvob/gl/MipzipLoader.java:1.2
--- libvob/org/nongnu/libvob/gl/MipzipLoader.java:1.1 Wed Mar 26 13:13:25 2003
+++ libvob/org/nongnu/libvob/gl/MipzipLoader.java Tue Apr 22 21:27:48 2003
@@ -88,6 +88,8 @@
private final Level[] levels;
+ public final float origWidth, origHeight;
+
/** Open (if not already open) and return the ZipFile.
*/
synchronized private ZipFile getZipFile() throws IOException {
@@ -471,6 +473,19 @@
if(e == null) throw new IOException("Invalid format: no texformat
in mipzip");
this.texFormat = e.getComment();
this.compressedFormat = texFormat.indexOf("COMPRESS") != -1;
+
+ e = f.getEntry("origsize");
+ if(e == null) throw new IOException("Invalid format: no origsize in
mipzip");
+ String origSize = e.getComment();
+
+ {
+ int i = origSize.indexOf('x');
+ if(i < 0) throw new IOException("Invalid size string");
+ origWidth = Float.parseFloat(origSize.substring(0,i));
+ origHeight = Float.parseFloat(origSize.substring(i+1));
+ }
+
+
ArrayList l = new ArrayList();
for(int i=0; i<100; i++) {
e = f.getEntry(""+i);
Index: libvob/vob/util/mipzipmaker.py
diff -u libvob/vob/util/mipzipmaker.py:1.6 libvob/vob/util/mipzipmaker.py:1.7
--- libvob/vob/util/mipzipmaker.py:1.6 Tue Apr 22 16:16:36 2003
+++ libvob/vob/util/mipzipmaker.py Tue Apr 22 21:27:48 2003
@@ -94,6 +94,13 @@
out.putNextEntry(entry)
out.closeEntry()
+ entry = zip.ZipEntry("origsize")
+ entry.setComment("%sx%s" % (d.width / float(w),
+ d.height/ float(h)))
+ entry.setSize(0)
+ out.putNextEntry(entry)
+ out.closeEntry()
+
l = 0
while 1:
w = int(tex.getLevelParameter(l, "TEXTURE_WIDTH")[0])
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] libvob org/nongnu/libvob/gl/MipzipLoader.java v...,
Tuomas J. Lukka <=