Fixed problem with loading interleaved arrays in the .osg loader, and corrected

a spelling mistake in osg::GeoSet.
This commit is contained in:
Robert Osfield
2001-12-12 12:55:01 +00:00
parent 363d1d9d70
commit 05e4a0b4ce
4 changed files with 58 additions and 10 deletions

44
NEWS
View File

@@ -1,6 +1,50 @@
OSG News (most significant items from ChangeLog)
================================================
14th December 2001 - osg-0.8.43.tar.gz
>>> Support for TrueType text, Stereo out of the box, and much more.
Since the last release the OSG has moved to CVS based developments so
many users will have seen gradual increments in functionality and changes
to the API. Whereas a the leap from 0.8.42 to 0.8.43 is actually quite
significant is likely to require code changes as several significant parts
of the API have evolved to a more mature state.
The most significant new functionality is the addition of the osgText
library which provides support for true type font rendering, as textured,
polygonal, pixmap, bitmap and 3D fonts.
An new osg::Matrix class has been implemented which cleans its interface.
Also all angular paramters are now based on radians rather than degrees
as before (and as in Performer), this has been done to be more consistent
with the basic trignometric functions and standard maths conventions.
Scene graph optimization has been added which can boost performance
on some database by as much as an order of magnititude, this is
particularily noticable in .flt based databases. Display list performance
has also been boosted on NVidia based machines thanks to changing the
compilation and execution of display list into two seperate operations.
App callbacks are now supported on all Nodes, and there now a proper
app traversal which can be used to animate the scene.
Stereo support has been added into the osgUtil::SceneView which allows
quad buffered/anaglyphic stereo to enabled easily for almost all OSG
applications without code modifications - simple set environmental
variable or pass in appropriate arguments and your app will render in
stereo!
src/Demos/osgcluster has been added to demonstrate how easy it is
to set up a graphics cluster across a standard networked PC's.
There have been many minor code changes to fix bugs, bottlenecks or
hinderances to extensibility have been addressed, there are too many
to list, but it does represent a significant step towards API maturity
and a beta release which is now not far away.
9th August 2001 - osg-0.8.42.tar.gz
>>> New osgWX library for integration of OSG with wxWindows apps.

View File

@@ -276,7 +276,7 @@ class SG_EXPORT GeoSet : public Drawable
/** get the interleaved index array. */
inline const IndexPointer& getInterleavedIndices() const { return _iaindex; }
/** get the interleaved array storage format. */
inline const InterleaveArrayType getInterleavedFromat() const { return _iaformat; }
inline const InterleaveArrayType getInterleavedFormat() const { return _iaformat; }
/** set the interleaved arrays of the geoset.*/
void setInterleavedArray( const InterleaveArrayType format, float *ia );

View File

@@ -296,6 +296,7 @@ bool FieldReaderIterator::matchSequence(const char* str)
{
if (str==NULL) return false;
if (*str==0) return false;
int fieldCount = 0;
const char* end = str;
while((*end)!=0 && (*end)==' ') ++end;
@@ -333,6 +334,7 @@ bool FieldReaderIterator::matchSequence(const char* str)
if (!field(fieldCount).isQuotedString()) return false;
break;
}
case('w') :
default :// expecting an word
{
if (!field(fieldCount).isWord()) return false;

View File

@@ -480,8 +480,8 @@ bool GeoSet_readLocalData(Object& obj, Input& fr)
fieldAdvanced = true;
}
if (matchFirst=fr.matchSequence("InterleavedArray %s {") ||
fr.matchSequence("InterleavedArray %s %i {"))
if ((matchFirst=fr.matchSequence("InterleavedArray %w {")) ||
fr.matchSequence("InterleavedArray %w %i {"))
{
// set up coordinates.
@@ -515,7 +515,7 @@ bool GeoSet_readLocalData(Object& obj, Input& fr)
}
else
{
fr[3].getInt(capacity);
fr[2].getInt(capacity);
fr += 4;
}
@@ -530,7 +530,7 @@ bool GeoSet_readLocalData(Object& obj, Input& fr)
// now read the data rows between the {}.
const char* rowComp = GeoSet_getInterleavedRowComposition(iaType);
int rowLength = GeoSet_getInterleavedRowLength(iaType);
int size = 0;
unsigned char* dataList = new unsigned char[capacity*rowLength];
@@ -544,11 +544,10 @@ bool GeoSet_readLocalData(Object& obj, Input& fr)
unsigned char* itrRowData = rowData;
const char* itrRowComp = rowComp;
int rn = 0;
while (*itrRowComp!=0)
while (*itrRowComp!=0 && !fr.eof() && fr[0].getNoNestedBrackets()>entry)
{
if (*itrRowComp=='f')
{
if (!fr[rn].getFloat(floatData)) break;
*(float*)itrRowData = floatData;
itrRowData += 4;
@@ -559,6 +558,7 @@ bool GeoSet_readLocalData(Object& obj, Input& fr)
*itrRowData = (unsigned char)intData;
itrRowData += 1;
}
++itrRowComp;
++rn;
}
if (*itrRowComp==0)
@@ -579,10 +579,12 @@ bool GeoSet_readLocalData(Object& obj, Input& fr)
}
else
{
++fr;
if (!fr.eof() && fr[0].getNoNestedBrackets()>entry) ++fr;
}
}
delete [] rowData;
interleavedArray = (float*)dataList;
}
@@ -829,10 +831,10 @@ bool GeoSet_writeLocalData(const Object& obj, Output& fw)
if (geoset.getInterleavedArray())
{
// write out the interleaved arrays.
const char* rowComp = GeoSet_getInterleavedRowComposition(geoset.getInterleavedFromat());
const char* rowComp = GeoSet_getInterleavedRowComposition(geoset.getInterleavedFormat());
fw.indent() << "InterleavedArray ";
switch(geoset.getInterleavedFromat())
switch(geoset.getInterleavedFormat())
{
case(GeoSet::IA_OFF): fw << "IA_OFF"; break;
case(GeoSet::IA_V2F): fw << "IA_V2F"; break;