[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] libvob include/vob/poly/Dicer.hxx include/vob/v...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] libvob include/vob/poly/Dicer.hxx include/vob/v... |
Date: |
Mon, 23 Jun 2003 10:53:19 -0400 |
CVSROOT: /cvsroot/libvob
Module name: libvob
Branch:
Changes by: Tuomas J. Lukka <address@hidden> 03/06/23 10:53:19
Modified files:
include/vob/poly: Dicer.hxx
include/vob/vobs: Paper.hxx
src/jni : TexAccum.cxx
src/stats : Stats.cxx TexAccum.cxx
Log message:
Debug infoing
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/poly/Dicer.hxx.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/vobs/Paper.hxx.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/jni/TexAccum.cxx.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/stats/Stats.cxx.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/stats/TexAccum.cxx.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
Patches:
Index: libvob/include/vob/poly/Dicer.hxx
diff -u libvob/include/vob/poly/Dicer.hxx:1.6
libvob/include/vob/poly/Dicer.hxx:1.7
--- libvob/include/vob/poly/Dicer.hxx:1.6 Wed Jun 11 13:41:55 2003
+++ libvob/include/vob/poly/Dicer.hxx Mon Jun 23 10:53:19 2003
@@ -164,8 +164,14 @@
}
}
template <class F> void iterateTriangles(F func) {
- for(Titer x = tris.begin(); x != tris.end(); x++)
+ DBG(dbg) << "IterateTriangles: start\n";
+ for(Titer x = tris.begin(); x != tris.end(); x++) {
+ DBG(dbg) << "IterateTriangles: tri " <<
+ (*x).v[0] <<" "<<
+ (*x).v[1] <<" "<<
+ (*x).v[2] << "\n";
func( (*x).v[0], (*x).v[1], (*x).v[2]);
+ }
}
void draw() {
glBegin(GL_TRIANGLES);
Index: libvob/include/vob/vobs/Paper.hxx
diff -u libvob/include/vob/vobs/Paper.hxx:1.14
libvob/include/vob/vobs/Paper.hxx:1.15
--- libvob/include/vob/vobs/Paper.hxx:1.14 Wed Jun 18 05:44:38 2003
+++ libvob/include/vob/vobs/Paper.hxx Mon Jun 23 10:53:19 2003
@@ -245,27 +245,26 @@
verts.append(Pt(x1,y1));
using namespace boost;
using namespace boost::lambda;
- DBG(dbg_paperquad) << "Set_and_initial\n";
+ DBG(dbg_paperquad) << "FQ: Set_and_initial "<<texAccum<<"\n";
- {
- triangler.add(0, 1, 3);
- triangler.add(0, 3, 2);
- DBG(dbg_paperquad) << "dice\n";
+ triangler.add(0, 1, 3);
+ triangler.add(0, 3, 2);
+ DBG(dbg_paperquad) << "dice\n";
- if(texAccum) {
- // First, dice roughly for the texture magnification
- // accumulator
- triangler.dice(bind(splitTri, ref(verts),
- diceLength*2, diceLength2*2, _1, _2, _3));
- // Then, calculate the texture surface estimates
- triangler.iterateTriangles(
- bind(addToAccum, texAccum, ref(verts), _1, _2, _3,
texAreaMult));
- }
-
- // Dice to finish
- triangler.dice(bind(splitTri, ref(verts), diceLength, diceLength2,
_1, _2, _3));
- DBG(dbg_paperquad) << "diced\n";
+ if(texAccum) {
+ // First, dice roughly for the texture magnification
+ // accumulator
+ triangler.dice(bind(splitTri, ref(verts),
+ diceLength*2, diceLength2*2, _1, _2, _3));
+ // Then, calculate the texture surface estimates
+ DBG(dbg_paperquad) << "callbacks\n";
+ triangler.iterateTriangles(
+ bind(addToAccum, texAccum, ref(verts), _1, _2, _3,
texAreaMult));
}
+
+ // Dice to finish
+ triangler.dice(bind(splitTri, ref(verts), diceLength, diceLength2, _1,
_2, _3));
+ DBG(dbg_paperquad) << "diced\n";
Paper::LightParam lightParam;
lightParam.orig = ZPt(0,0,0);
Index: libvob/src/jni/TexAccum.cxx
diff -u libvob/src/jni/TexAccum.cxx:1.3 libvob/src/jni/TexAccum.cxx:1.4
--- libvob/src/jni/TexAccum.cxx:1.3 Wed Jun 18 05:44:38 2003
+++ libvob/src/jni/TexAccum.cxx Mon Jun 23 10:53:19 2003
@@ -49,6 +49,8 @@
namespace Vob {
namespace JNI {
+DBGVAR(dbg_texaccum, "JNI.texaccum");
+
Stats::Statistics statistics;
ObjectStorer<TexAccum_JNI> texaccums("texaccums");
@@ -83,12 +85,14 @@
jf( jint, impl_1TexAccum_1create )
(JNIEnv *env, jclass) {
+ DBG(dbg_texaccum)<<"Create without cb\n";
TexAccum_JNI *accum = new TexAccum_JNI(env, 0, 0);
return texaccums.add(accum);
}
jf( jint, impl_1TexAccum_1create_1cb )
(JNIEnv *env, jclass, jobject cb) {
+ DBG(dbg_texaccum)<<"Create with cb: "<<cb<<"\n";
TexAccum_JNI *accum = new TexAccum_JNI(env, &statistics, cb);
if(!globalclass_WeakStatsCaller) {
globalclass_WeakStatsCaller =
Index: libvob/src/stats/Stats.cxx
diff -u libvob/src/stats/Stats.cxx:1.2 libvob/src/stats/Stats.cxx:1.3
--- libvob/src/stats/Stats.cxx:1.2 Wed Jun 18 05:44:38 2003
+++ libvob/src/stats/Stats.cxx Mon Jun 23 10:53:19 2003
@@ -24,12 +24,15 @@
* Written by Tuomas J. Lukka
*/
+#include <boost/format.hpp>
+
#include <vob/Debug.hxx>
#include <vob/stats/Stats.hxx>
namespace Vob {
namespace Stats {
DBGVAR(dbg, "Stats");
+ using boost::format;
Statistics::Statistics() {
first = 0;
@@ -43,6 +46,8 @@
}
void Statistics::triggered(Collector *c) {
+ DBG(dbg) << format("Triggered: %x %d %x %x\n")
+ % c % c->onList % first % c->next;
if(!c->onList) {
// XXX Asserts
c->next = first;
@@ -52,6 +57,7 @@
}
void Statistics::toBeDeleted(Collector *c) {
+ DBG(dbg) << format("ToBeDeleted: %x %x\n") % first % c;
if(c->onList) {
if(first == c)
first = c->next;
@@ -67,6 +73,7 @@
}
}
void Statistics::clear() {
+ DBG(dbg) << format("Clear: %x\n") % first;
for(Collector *i = first; i != 0; i = i->next) {
i->clear();
}
@@ -77,7 +84,9 @@
first = 0;
}
void Statistics::call(void *u) {
+ DBG(dbg) << format("Call: %x\n") % first;
for(Collector *i = first; i != 0; i = i->next) {
+ DBG(dbg) << format("Calling: %x") % i;
i->call(u);
}
}
Index: libvob/src/stats/TexAccum.cxx
diff -u libvob/src/stats/TexAccum.cxx:1.2 libvob/src/stats/TexAccum.cxx:1.3
--- libvob/src/stats/TexAccum.cxx:1.2 Wed Jun 18 05:44:38 2003
+++ libvob/src/stats/TexAccum.cxx Mon Jun 23 10:53:19 2003
@@ -53,15 +53,20 @@
frexp(parea / tarea, &exponent);
int mip = exponent / 2;
+
+ DBG(dbg_texaccum) << "Stats got "<<mip<<" "<<parea<<"\n";
+
if(mip < 0) return;
if(mip >= NLEVELS) mip = NLEVELS-1;
this->pixels[mip] += parea;
+
gotStatistics();
}
void TexAccum::clear() {
+ DBG(dbg_texaccum) << "Stats clear\n";
for(int i=0; i<NLEVELS; i++) pixels[i] = 0;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] libvob include/vob/poly/Dicer.hxx include/vob/v...,
Tuomas J. Lukka <=