From Vivek Rajan, fixes to Solaris build.

This commit is contained in:
Robert Osfield 2004-11-18 10:08:29 +00:00
parent 02ee5ff0cc
commit 595dda6fe4
8 changed files with 31 additions and 22 deletions

View File

@ -381,8 +381,8 @@ int main( int argc, char **argv )
root->addChild(sunLight); root->addChild(sunLight);
// create the sun // create the sun
osg::Node* sun = solarSystem.createPlanet( solarSystem._radiusSun, "Sun", osg::Vec4( 1.0f, 1.0f, 1.0f, 1.0f), solarSystem._mapSun ); osg::Node* solarSun = solarSystem.createPlanet( solarSystem._radiusSun, "Sun", osg::Vec4( 1.0f, 1.0f, 1.0f, 1.0f), solarSystem._mapSun );
osg::StateSet* sunStateSet = sun->getOrCreateStateSet(); osg::StateSet* sunStateSet = solarSun->getOrCreateStateSet();
osg::Material* material = new osg::Material; osg::Material* material = new osg::Material;
material->setEmission( osg::Material::FRONT_AND_BACK, osg::Vec4( 1.0f, 1.0f, 0.0f, 0.0f ) ); material->setEmission( osg::Material::FRONT_AND_BACK, osg::Vec4( 1.0f, 1.0f, 0.0f, 0.0f ) );
sunStateSet->setAttributeAndModes( material, osg::StateAttribute::ON ); sunStateSet->setAttributeAndModes( material, osg::StateAttribute::ON );
@ -396,7 +396,7 @@ int main( int argc, char **argv )
sunLight->addChild( sunBillboard ); sunLight->addChild( sunBillboard );
// stick sun right under root, no transformations for the sun // stick sun right under root, no transformations for the sun
sunLight->addChild( sun ); sunLight->addChild( solarSun );
// create light source in the sun // create light source in the sun

View File

@ -99,7 +99,7 @@ bool osgDB::makeDirectory( const std::string &path )
break; break;
default: default:
osg::notify(osg::DEBUG_INFO) << "osgDB::makeDirectory(): " << sys_errlist[errno] << std::endl; osg::notify(osg::DEBUG_INFO) << "osgDB::makeDirectory(): " << strerror(errno) << std::endl;
return false; return false;
} }
} }
@ -112,7 +112,7 @@ bool osgDB::makeDirectory( const std::string &path )
if( mkdir( dir.c_str(), 0755 )< 0 ) if( mkdir( dir.c_str(), 0755 )< 0 )
{ {
osg::notify(osg::DEBUG_INFO) << "osgDB::makeDirectory(): " << sys_errlist[errno] << std::endl; osg::notify(osg::DEBUG_INFO) << "osgDB::makeDirectory(): " << strerror(errno) << std::endl;
return false; return false;
} }
paths.pop(); paths.pop();

View File

@ -773,7 +773,7 @@ void Geode::ProcessGeometry(ostream& fout, const unsigned int ioffset)
const osg::StateSet::ModeList& ModeList = TextureModeList[0]; const osg::StateSet::ModeList& ModeList = TextureModeList[0];
assert(ModeList.size() == 1); assert(ModeList.size() == 1);
// Check for a single mode of GL_TEXTURE_2D and ON // Check for a single mode of GL_TEXTURE_2D and ON
std::pair<osg::StateAttribute::GLMode, osg::StateAttribute::GLModeValue> ModeValuePair = *ModeList.begin(); osg::StateSet::ModeList::value_type ModeValuePair = *ModeList.begin();
assert(ModeValuePair.first == GL_TEXTURE_2D); assert(ModeValuePair.first == GL_TEXTURE_2D);
assert(ModeValuePair.second == osg::StateAttribute::ON); assert(ModeValuePair.second == osg::StateAttribute::ON);
const osg::StateSet::AttributeList& AttributeList = TextureAttributeList[0]; const osg::StateSet::AttributeList& AttributeList = TextureAttributeList[0];

View File

@ -123,7 +123,7 @@ void Surface::compile(const lwo2::FORM::SURF *surf, const Clip_map &clips)
osg::notify(osg::WARN) << "Warning: lwosg::Surface: cannot find clip number " << new_block.get_image_map().image_map << std::endl; osg::notify(osg::WARN) << "Warning: lwosg::Surface: cannot find clip number " << new_block.get_image_map().image_map << std::endl;
} }
} }
blocks_.insert(std::make_pair(new_block.get_ordinal(), new_block)); blocks_.insert(Block_map::value_type(new_block.get_ordinal(), new_block));
} }
} }
} }

View File

@ -72,17 +72,6 @@ namespace lwosg
inline const Animation_list &get_camera_animations() const { return camera_animations_; } inline const Animation_list &get_camera_animations() const { return camera_animations_; }
inline Animation_list &get_camera_animations() { return camera_animations_; } inline Animation_list &get_camera_animations() { return camera_animations_; }
protected:
bool parse_block(const std::string &name, const std::string &data);
bool parse_block(const std::string &name, const std::vector<std::string> &data);
void clear();
private:
typedef std::map<std::string, osg::ref_ptr<osg::Group> > Object_map;
Object_map objects_;
Animation_list camera_animations_;
struct Motion_envelope { struct Motion_envelope {
struct Key { struct Key {
osg::Vec3 position; osg::Vec3 position;
@ -94,6 +83,17 @@ namespace lwosg
Key_map keys; Key_map keys;
}; };
protected:
bool parse_block(const std::string &name, const std::string &data);
bool parse_block(const std::string &name, const std::vector<std::string> &data);
void clear();
private:
typedef std::map<std::string, osg::ref_ptr<osg::Group> > Object_map;
Object_map objects_;
Animation_list camera_animations_;
struct Scene_object { struct Scene_object {
osg::ref_ptr<osg::Node> layer_node; osg::ref_ptr<osg::Node> layer_node;
int parent; int parent;

View File

@ -59,6 +59,10 @@ extern "C" {
# define ENOPROTOOPT WSAENOPROTOOPT # define ENOPROTOOPT WSAENOPROTOOPT
#endif // !WIN32 #endif // !WIN32
#ifndef INADDR_NONE
#define INADDR_NONE ((in_addr_t) 0xffffffff)
#endif
void herror(const char*); void herror(const char*);
sockinetaddr::sockinetaddr () sockinetaddr::sockinetaddr ()

View File

@ -123,6 +123,11 @@ extern "C" {
#endif // !WIN32 #endif // !WIN32
#ifdef __sun
#include <sys/sockio.h>
#include <sys/filio.h>
#endif
#ifndef BUFSIZ #ifndef BUFSIZ
# define BUFSIZ 1024 # define BUFSIZ 1024
#endif #endif
@ -135,7 +140,7 @@ extern "C" {
const char* sockerr::errstr () const const char* sockerr::errstr () const
{ {
#if defined(__CYGWIN__) || !defined(WIN32) #if defined(__CYGWIN__) || !defined(WIN32)
return sys_errlist[err]; return strerror(err);
#else #else
return 0; // TODO return 0; // TODO
#endif #endif
@ -195,7 +200,7 @@ bool sockerr::op () const
case EHOSTDOWN: case EHOSTDOWN:
case EHOSTUNREACH: case EHOSTUNREACH:
case ENOTEMPTY: case ENOTEMPTY:
# if !defined(__linux__) // LN # if !defined(__linux__) && !defined(__sun)// LN
case EPROCLIM: case EPROCLIM:
# endif # endif
case EUSERS: case EUSERS:
@ -240,7 +245,7 @@ bool sockerr::benign () const
case EWOULDBLOCK: case EWOULDBLOCK:
// On FreeBSD (and probably on Linux too) // On FreeBSD (and probably on Linux too)
// EAGAIN has the same value as EWOULDBLOCK // EAGAIN has the same value as EWOULDBLOCK
#if !defined(__CYGWIN__) && !defined( __sgi) && !defined(__linux__) && !(defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__)) // LN #if !defined(__CYGWIN__) && !defined( __sgi) && !defined(__linux__) && !defined(__sun) && !(defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__)) // LN
case EAGAIN: case EAGAIN:
#endif #endif
return true; return true;

View File

@ -417,7 +417,7 @@ void TriStripVisitor::stripify(Geometry& geom)
{ {
std::swap(pitr->m_Indices[2],pitr->m_Indices[3]); std::swap(pitr->m_Indices[2],pitr->m_Indices[3]);
unsigned int minValue = *(std::max_element(pitr->m_Indices.begin(),pitr->m_Indices.end())); unsigned int minValue = *(std::max_element(pitr->m_Indices.begin(),pitr->m_Indices.end()));
quadMap.insert(std::pair<unsigned int,prim_iterator>(minValue,pitr)); quadMap.insert(QuadMap::value_type(minValue,pitr));
} }
} }