Fixes for MacOSX build from Bob Kuehne.

This commit is contained in:
Robert Osfield
2002-07-16 15:13:57 +00:00
parent 442b266f2e
commit a389dfef8b
6 changed files with 54 additions and 48 deletions

View File

@@ -122,7 +122,7 @@ ifeq ($(OS),IRIX)
C++ = CC
DEPFLAGS = -M
INC += -I${TOPDIR}/include
INC += -I${TOPDIR}/include -I/usr/freeware/
DEF += -LANG:std -OPT:Olimit=0 \
-DEBUG:woff=1682 -DEBUG:woff=3303\
-MDupdate $(MAKEDEPEND)
@@ -250,17 +250,23 @@ ifeq ($(OS),Darwin)
SOCKET_LIBS =
OTHER_LIBS = -lm -ldl -lstdc++ -lobjc
LIB_EXT = dylib
QUICKTIME_LIB = -framework QuickTime
QUICKTIME = -framework QuickTime $(CARBON_LIB)
TIFF_LIB = -ltiff
SRC_DIRS = osg osgUtil osgDB osgGA osgGLUT osgParticle \
osgPlugins Demos
PLUGIN_DIRS = osg rgb lib3ds flt obj lwo txp bmp pic tga \
osgtgz tgz zip
DEMOS_DIRS = hangglide osgbillboard osgcluster osgconv osgcopy \
osgcube osgcallback osgclip osgimpostor osgoccluder \
osgreflect osgscribe osgstereoimage osgtexture \
osgviews osgversion sgv osgparticle
SRC_DIRS = osg osgUtil osgDB osgPlugins \
osgGA osgGLUT osgParticle \
Demos
# Plugins which require external libs: gif jpeg png
PLUGIN_DIRS = bmp dw flt \
lib3ds logos lwo obj \
osg osgtgz pic \
quicktime rgb tga tgz tiff \
txp zip
# Demos which require external libs: osghud osgtext
DEMOS_DIRS = osgbillboard osgcallback osgclip \
osgcluster osgconv osgcopy osgcube osggeometry \
osghangglide osgimpostor osgmultitexture osgoccluder \
osgparticle osgprerender osgreflect osgscribe osgstereoimage \
osgtexture osgversion osgviews sgv
endif
#### Cygwin/Mingw specific definitions

View File

@@ -76,6 +76,7 @@ DEMOS_DIRS = \
osghangglide\
osghud\
osgimpostor\
osglight\
osgmultitexture\
osgoccluder\
osgparticle\

View File

@@ -245,13 +245,13 @@ void for_each_triangle2(const osg::GeoSet& gset,T& op)
}
else
{
osg::uint* base = gset.getCoordIndices()._ptr._uint;
osg::uint* iptr = base;
GLuint* base = gset.getCoordIndices()._ptr._uint;
GLuint* iptr = base;
const int numPrim = gset.getNumPrims();
for(int i=0; i<numPrim; ++i )
{
const int primLength = gset.getPrimLengths()[i];
osg::uint* iend = iptr+primLength;
GLuint* iend = iptr+primLength;
int tri=0;
for(int j = 2; j < primLength; j++ )
{
@@ -310,8 +310,8 @@ void for_each_triangle2(const osg::GeoSet& gset,T& op)
}
else
{
osg::uint* base = gset.getCoordIndices()._ptr._uint;
osg::uint* iptr = base;
GLuint* base = gset.getCoordIndices()._ptr._uint;
GLuint* iptr = base;
const int numPrim = gset.getNumPrims();
for(int i=0; i<numPrim; ++i )
{
@@ -363,13 +363,13 @@ void for_each_triangle2(const osg::GeoSet& gset,T& op)
}
else
{
osg::uint* base = gset.getCoordIndices()._ptr._uint;
osg::uint* iptr = base;
GLuint* base = gset.getCoordIndices()._ptr._uint;
GLuint* iptr = base;
const int numPrim = gset.getNumPrims();
for(int i=0; i<numPrim; ++i )
{
const int primLength = gset.getPrimLengths()[i];
osg::uint* iend = iptr+primLength;
GLuint* iend = iptr+primLength;
int tri=0;
for(int j = 3; j < primLength; j+=2 )
{
@@ -426,8 +426,8 @@ void for_each_triangle2(const osg::GeoSet& gset,T& op)
}
else
{
osg::uint* base = gset.getCoordIndices()._ptr._uint;
osg::uint* iptr = base;
GLuint* base = gset.getCoordIndices()._ptr._uint;
GLuint* iptr = base;
const int numPrim = gset.getNumPrims();
for(int i=0; i<numPrim; ++i )
{
@@ -487,8 +487,8 @@ void for_each_triangle2(const osg::GeoSet& gset,T& op)
}
else
{
osg::uint* base = gset.getCoordIndices()._ptr._uint;
osg::uint* iptr = base;
GLuint* base = gset.getCoordIndices()._ptr._uint;
GLuint* iptr = base;
const int numPrim = gset.getNumPrims();
for(int i=0; i<numPrim; ++i )
{
@@ -496,8 +496,8 @@ void for_each_triangle2(const osg::GeoSet& gset,T& op)
int tri=0;
if (primLength>0)
{
osg::uint *start = iptr;
osg::uint* iend = iptr+primLength;
GLuint *start = iptr;
GLuint* iend = iptr+primLength;
++iptr;
for(int j = 2; j < primLength; ++j )
{
@@ -587,20 +587,20 @@ osg::GeoSet *AreaGeoSetTriangulator::BuildGeoSet()
sizeof(osg::Vec2) * _area_geoset.getNumTextureCoords() );
// Now generate the index arrays
osg::uint *new_cindex = 0;
osg::uint *new_nindex = 0;
osg::uint *new_colindex = 0;
osg::uint *new_tindex = 0;
GLuint *new_cindex = 0;
GLuint *new_nindex = 0;
GLuint *new_colindex = 0;
GLuint *new_tindex = 0;
if ( _cindex.size() ) new_cindex = new osg::uint[ _cindex.size() ];
if ( _nindex.size() ) new_nindex = new osg::uint[ _nindex.size() ];
if ( _colindex.size() ) new_colindex = new osg::uint[ _colindex.size() ];
if ( _tindex.size() ) new_tindex = new osg::uint[ _tindex.size() ];
if ( _cindex.size() ) new_cindex = new GLuint[ _cindex.size() ];
if ( _nindex.size() ) new_nindex = new GLuint[ _nindex.size() ];
if ( _colindex.size() ) new_colindex = new GLuint[ _colindex.size() ];
if ( _tindex.size() ) new_tindex = new GLuint[ _tindex.size() ];
memcpy( new_cindex , &_cindex [0], sizeof(osg::uint) * _cindex.size() );
memcpy( new_nindex , &_nindex [0], sizeof(osg::uint) * _nindex.size() );
memcpy( new_colindex, &_colindex[0], sizeof(osg::uint) * _colindex.size() );
memcpy( new_tindex , &_tindex [0], sizeof(osg::uint) * _tindex.size() );
memcpy( new_cindex , &_cindex [0], sizeof(GLuint) * _cindex.size() );
memcpy( new_nindex , &_nindex [0], sizeof(GLuint) * _nindex.size() );
memcpy( new_colindex, &_colindex[0], sizeof(GLuint) * _colindex.size() );
memcpy( new_tindex , &_tindex [0], sizeof(GLuint) * _tindex.size() );
res->setCoords ( new_coords , new_cindex );
res->setNormals( new_normals, new_nindex );

View File

@@ -819,7 +819,7 @@ void DXArrayWriter::WriteIndexArray(
fprintf( fp, " " );
{
if ( ip.null() ) fprintf( fp, " %d", i );
else fprintf( fp, " %d", ip[i] );
else fprintf( fp, " %d", static_cast<int>( ip[i] ) );
}
if ( (i+1) % shape == 0 )
fprintf( fp, "\n" );
@@ -1106,18 +1106,17 @@ void DXArrayWriter::WritePerVertexColors(
// same applies here, namely that there may be multiple colors
// mapping to the same point definiton.)
int num_points = geoset.getNumCoords();
int num_pindices = geoset.getNumCoordIndices();
int num_colors = geoset.getNumColors();
int num_cindices = geoset.getNumColorIndices();
//const osg::Vec3 *points = geoset.getCoords();
unsigned int num_points = geoset.getNumCoords();
unsigned int num_pindices = geoset.getNumCoordIndices();
unsigned int num_colors = geoset.getNumColors();
unsigned int num_cindices = geoset.getNumColorIndices();
const osg::Vec4 *colors = geoset.getColors();
const osg::GeoSet::IndexPointer &pindices = geoset.getCoordIndices();
const osg::GeoSet::IndexPointer &cindices = geoset.getColorIndices();
// Create a list of color indices per vertex "definition"
osg::uint *pt_cindices = new osg::uint[ num_points ];
int *set = new int [ num_points ];
GLuint *pt_cindices = new GLuint[ num_points ];
int *set = new int[ num_points ];
try {
memset( set, '\0', num_points * sizeof(int) );
@@ -1547,7 +1546,7 @@ void DXWriter::WritePolylineConnections( osg::GeoSet &geoset,
int count = 0;
for ( i = 0; i < num_prims; i++ )
count += ( line_loops ? prim_lengths[i]+1 : prim_lengths[i] );
osg::uint *indices = new osg::uint[ count ];
GLuint *indices = new GLuint[ count ];
osg::GeoSet::IndexPointer ip;
ip.set( count, indices );

View File

@@ -4,7 +4,7 @@ include $(TOPDIR)/Make/makedefs
CXXFILES =\
ReaderWriterLOGO.cpp\
LIBS += $(OSG_LIBS) $(OTHER_LIBS)
LIBS += $(OSG_LIBS) $(GL_LIBS) $(OTHER_LIBS)
TARGET_BASENAME = logo
include $(TOPDIR)/Make/cygwin_plugin_def

View File

@@ -35,7 +35,7 @@ class Logos: public osg::Drawable
struct logosCullCallback : public osg::Drawable::CullCallback
{
virtual bool cull(osg::NodeVisitor *visitor, osg::Drawable* drawable, osg::State *state=NULL) const
virtual bool cull(osg::NodeVisitor *visitor, osg::Drawable* drawable, osg::State*) const
{
Logos *logos = dynamic_cast <Logos *>(drawable);
osgUtil::CullVisitor *cv = dynamic_cast<osgUtil::CullVisitor *>(visitor);