Update of /cvsroot/plib/plib/src/ssg
In directory sc8-pr-cvs1:/tmp/cvs-serv581
Modified Files:
ssgLoadMDL.cxx
Log Message:
"export" no of LoDs.
Also, no of LoDs was too small by one.
Index: ssgLoadMDL.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadMDL.cxx,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- ssgLoadMDL.cxx 13 Dec 2003 23:09:16 -0000 1.51
+++ ssgLoadMDL.cxx 11 Jan 2004 23:14:38 -0000 1.52
@@ -614,6 +614,7 @@
// wk : It's not completely clear to me whether the following two functions can not be merged; Oh well.
// CreateAndAddLeaf1 is called then faces are created and then CreateAndAddLeaf2 is called
+
static void CreateAndAddLeaf1(GLenum ty, ssgTexCoordArray *tex_coords_P, bool use_texture)
{
curr_index_ = new ssgIndexArray();
@@ -1757,6 +1758,10 @@
}
}
+
+// kludge: global
+int g_noLoDs =1;
+
ssgEntity *ssgLoadMDL(const char *fname, const ssgLoaderOptions *options)
{
ssgSetCurrentOptions ( (ssgLoaderOptions*)options ) ;
@@ -1857,7 +1862,8 @@
last_idx_ = 0;
curr_var_ = 0;
stack_depth_ = 0;
- noLoDs = 0;
+ noLoDs = 1; // if there is no "branch" and no "++noLoDs" is called, we have 1 LoD.
+ // If there is one branch, we have 2, etc.
curr_lod = 0;
sgMakeIdentMat4(curr_matrix_);
@@ -1879,9 +1885,10 @@
#endif
// :-((( delete curr_vtx_;
delete curr_norm_;
-
- DEBUGPRINT("\n" << vertex_array_->getNum() << " vertices\n");
+
+ DEBUGPRINT("\n" << vertex_array_->getNum() << " vertices\n");
printf("NoLoDs = %d\n", (int)noLoDs);
+ g_noLoDs = noLoDs;
return model_;
}
|