[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/gfx demo/fisheye.py jni/GzzGL-jni.cxx libmo...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] gzz/gfx demo/fisheye.py jni/GzzGL-jni.cxx libmo... |
Date: |
Thu, 12 Sep 2002 11:30:04 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Tuomas J. Lukka <address@hidden> 02/09/12 11:30:04
Modified files:
gfx/demo : fisheye.py
gfx/jni : GzzGL-jni.cxx
gfx/libmosaic : Mosaic.cxx Mosaic.hxx
gfx/libpaper : textures.py
gfx/libtext : Text.hxx
Log message:
Fix a MAJOR bug in texture handling. Was converting to bool a little
too easily and then returning those and comparing those, which worked fine as
long as you were only using one texture ;)
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/fisheye.py.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/jni/GzzGL-jni.cxx.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libmosaic/Mosaic.cxx.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libmosaic/Mosaic.hxx.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/textures.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libtext/Text.hxx.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
Patches:
Index: gzz/gfx/demo/fisheye.py
diff -c gzz/gfx/demo/fisheye.py:1.4 gzz/gfx/demo/fisheye.py:1.5
*** gzz/gfx/demo/fisheye.py:1.4 Thu Sep 12 10:52:27 2002
--- gzz/gfx/demo/fisheye.py Thu Sep 12 11:30:04 2002
***************
*** 17,22 ****
--- 17,23 ----
def addpdftex(pap):
passno = pap.getNPasses()
+ passno = 0
pap.setNPasses(passno + 1)
ppass = pap.getPass(passno)
***************
*** 24,32 ****
--- 25,36 ----
if pdftex == None:
pdftex = getTex(pdfimg)
texid = pdftex.getTexId()
+ print "TEXID: ",texid
ppass.setSetupcode("""
PushAttrib ENABLE_BIT TEXTURE_BIT
+ ActiveTexture TEXTURE1
+ Disable TEXTURE_2D
ActiveTexture TEXTURE0
Enable BLEND
BlendFunc ZERO SRC_COLOR
***************
*** 34,54 ****
Color 1 1 1
Enable TEXTURE_2D
Disable ALPHA_TEST
BindTexture TEXTURE_2D %(texid)s
TexParameter TEXTURE_2D TEXTURE_WRAP_S REPEAT
TexParameter TEXTURE_2D TEXTURE_WRAP_T REPEAT
TexParameter TEXTURE_2D TEXTURE_MIN_FILTER LINEAR_MIPMAP_LINEAR
TexParameter TEXTURE_2D TEXTURE_MAG_FILTER LINEAR
! """ % locals())
ppass.setTeardowncode("""
PopAttrib
""")
ppass.setNTexGens(1)
! ppass.putNormalTexGen(0, [.2,0,0,.25,
! 0,.2,0,.2,
0,0,1,0,
0,0,0,1])
--- 38,59 ----
Color 1 1 1
Enable TEXTURE_2D
Disable ALPHA_TEST
+ Disable REGISTER_COMBINERS_NV
BindTexture TEXTURE_2D %(texid)s
TexParameter TEXTURE_2D TEXTURE_WRAP_S REPEAT
TexParameter TEXTURE_2D TEXTURE_WRAP_T REPEAT
TexParameter TEXTURE_2D TEXTURE_MIN_FILTER LINEAR_MIPMAP_LINEAR
TexParameter TEXTURE_2D TEXTURE_MAG_FILTER LINEAR
! """ % locals() )
ppass.setTeardowncode("""
PopAttrib
""")
ppass.setNTexGens(1)
! ppass.putNormalTexGen(0, [2,0,0,.25,
! 0,2,0,.2,
0,0,1,0,
0,0,0,1])
Index: gzz/gfx/jni/GzzGL-jni.cxx
diff -c gzz/gfx/jni/GzzGL-jni.cxx:1.14 gzz/gfx/jni/GzzGL-jni.cxx:1.15
*** gzz/gfx/jni/GzzGL-jni.cxx:1.14 Wed Sep 4 04:12:09 2002
--- gzz/gfx/jni/GzzGL-jni.cxx Thu Sep 12 11:30:04 2002
***************
*** 320,326 ****
img->loadInto(*t, 0, 0, w, h);
mosaicbuilder->prepare();
releaseWindow();
! DBG(dbg) << "Created tex rect\n";
return imagetiles.add(t);
}
--- 320,326 ----
img->loadInto(*t, 0, 0, w, h);
mosaicbuilder->prepare();
releaseWindow();
! DBG(dbg) << "Created tex rect, in "<<t->getRect().tex<<"\n";
return imagetiles.add(t);
}
***************
*** 334,340 ****
JNIEXPORT jint JNICALL Java_gzz_gfx_gl_GZZGL_getTexRectTexID
(JNIEnv *, jclass, jint id)
{
! return imagetiles[id]->getRect().tex;
}
JNIEXPORT jdouble JNICALL Java_gzz_gfx_gl_GZZGL_getTexRectTexCoord
--- 334,340 ----
JNIEXPORT jint JNICALL Java_gzz_gfx_gl_GZZGL_getTexRectTexID
(JNIEnv *, jclass, jint id)
{
! return imagetiles[id]->getRect().tex.getTexId();
}
JNIEXPORT jdouble JNICALL Java_gzz_gfx_gl_GZZGL_getTexRectTexCoord
Index: gzz/gfx/libmosaic/Mosaic.cxx
diff -c gzz/gfx/libmosaic/Mosaic.cxx:1.5 gzz/gfx/libmosaic/Mosaic.cxx:1.6
*** gzz/gfx/libmosaic/Mosaic.cxx:1.5 Wed Sep 4 03:37:10 2002
--- gzz/gfx/libmosaic/Mosaic.cxx Thu Sep 12 11:30:04 2002
***************
*** 15,21 ****
DBG(dbg) << "TexId:: allocating\n";
glGenTextures(1, &id);
DBG(dbg) << "TexId:: got "<<id<<"\n";
! if(!*this) throw InvalidTexture();
DBG(dbg) << "TexId:: allocated\n";
}
--- 15,21 ----
DBG(dbg) << "TexId:: allocating\n";
glGenTextures(1, &id);
DBG(dbg) << "TexId:: got "<<id<<"\n";
! if(this->isGood()) throw InvalidTexture();
DBG(dbg) << "TexId:: allocated\n";
}
Index: gzz/gfx/libmosaic/Mosaic.hxx
diff -c gzz/gfx/libmosaic/Mosaic.hxx:1.7 gzz/gfx/libmosaic/Mosaic.hxx:1.8
*** gzz/gfx/libmosaic/Mosaic.hxx:1.7 Wed Sep 4 03:37:10 2002
--- gzz/gfx/libmosaic/Mosaic.hxx Thu Sep 12 11:30:04 2002
***************
*** 64,73 ****
/** Compare two Ids -- usual semantics.
*/
bool operator==(const Id &t) const { return id == t.id; }
/** True if this id is allocated.
* This test only checks whether the Id is null or not.
*/
! operator bool() const { return id != 0; }
friend ostream& operator<<(ostream &o, const Id &t);
};
--- 64,80 ----
/** Compare two Ids -- usual semantics.
*/
bool operator==(const Id &t) const { return id == t.id; }
+ /** Compare two Ids -- usual semantics.
+ */
+ bool operator!=(const Id &t) const { return id != t.id; }
/** True if this id is allocated.
* This test only checks whether the Id is null or not.
*/
! bool isGood() { return id != 0; }
!
! /** Break encapsulation for JNI ;)
! */
! GLuint getTexId() { return id; }
friend ostream& operator<<(ostream &o, const Id &t);
};
Index: gzz/gfx/libpaper/textures.py
diff -c gzz/gfx/libpaper/textures.py:1.6 gzz/gfx/libpaper/textures.py:1.7
*** gzz/gfx/libpaper/textures.py:1.6 Wed Sep 4 03:37:10 2002
--- gzz/gfx/libpaper/textures.py Thu Sep 12 11:30:04 2002
***************
*** 19,25 ****
self.texture = GZZGL.createTexture()
res = self.texture.shade(*args)
self.name = name
! print "SHADER: ", res
def getTexId(self):
return self.texture.getTexId()
def getName(self):
--- 19,25 ----
self.texture = GZZGL.createTexture()
res = self.texture.shade(*args)
self.name = name
! print "SHADER: ", res, self.texture.getTexId()
def getTexId(self):
return self.texture.getTexId()
def getName(self):
Index: gzz/gfx/libtext/Text.hxx
diff -c gzz/gfx/libtext/Text.hxx:1.6 gzz/gfx/libtext/Text.hxx:1.7
*** gzz/gfx/libtext/Text.hxx:1.6 Wed Aug 21 03:12:43 2002
--- gzz/gfx/libtext/Text.hxx Thu Sep 12 11:30:04 2002
***************
*** 155,161 ****
Rect rect;
QuadGlyph() {}
QuadGlyph(Glyph glyph, Rect &rect) : glyph(glyph), rect(rect) { }
! bool valid() { return (bool)(rect.tex) ; }
template<class Vertex> void draw(int &cx, int &cy, Vertex &vertex) {
if(glyph.extents.width != 0) {
int cx1 = cx + glyph.extents.left;
--- 155,161 ----
Rect rect;
QuadGlyph() {}
QuadGlyph(Glyph glyph, Rect &rect) : glyph(glyph), rect(rect) { }
! bool valid() { return rect.tex.isGood() ; }
template<class Vertex> void draw(int &cx, int &cy, Vertex &vertex) {
if(glyph.extents.width != 0) {
int cx1 = cx + glyph.extents.left;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz/gfx demo/fisheye.py jni/GzzGL-jni.cxx libmo...,
Tuomas J. Lukka <=