diff --git a/OSGConfigured.h.cmake b/OSGConfigured.h.cmake index 39d8e07c9..a8fa0b132 100644 --- a/OSGConfigured.h.cmake +++ b/OSGConfigured.h.cmake @@ -20,6 +20,8 @@ #cmakedefine OSG_ENABLE_MEMORY_DEBUGGING 1 +#cmakedefine OSG_ENABLE_DOUBLE_MATRIX_STACK 1 + #cmakedefine OSG_WITH_GDAL 1 /* Do not use GL subdir for glut */ diff --git a/Source/Base/Base/OSGBaseFunctions.inl b/Source/Base/Base/OSGBaseFunctions.inl index c6d4fe7d4..123782b47 100644 --- a/Source/Base/Base/OSGBaseFunctions.inl +++ b/Source/Base/Base/OSGBaseFunctions.inl @@ -2697,9 +2697,8 @@ OSG::Int32 putenv(Char8 *string) inline Char8 *getenv(const Char8 *string) { - return NULL; + return ::getenv(string); } -#else #endif /*! Pause program execution for the given number of milliseconds. diff --git a/Source/Base/Base/OSGColor.inl b/Source/Base/Base/OSGColor.inl index 73fcc5e93..58f0db44d 100644 --- a/Source/Base/Base/OSGColor.inl +++ b/Source/Base/Base/OSGColor.inl @@ -224,9 +224,9 @@ UInt32 Color3::minPart(const ValueType *rgbP) template inline Color3::Color3(void) { - setValues(TypeTraits::getZeroElement(), - TypeTraits::getZeroElement(), - TypeTraits::getZeroElement()); + this->setValues(TypeTraits::getZeroElement(), + TypeTraits::getZeroElement(), + TypeTraits::getZeroElement()); } @@ -243,7 +243,7 @@ Color3::Color3(const ValueType red, const ValueType green, const ValueType blue) { - setValues(red, green, blue); + this->setValues(red, green, blue); } @@ -255,9 +255,9 @@ Color3::~Color3(void) template inline void Color3::clear(void) { - setValues(TypeTraits::getZeroElement(), - TypeTraits::getZeroElement(), - TypeTraits::getZeroElement()); + this->setValues(TypeTraits::getZeroElement(), + TypeTraits::getZeroElement(), + TypeTraits::getZeroElement()); } @@ -266,7 +266,7 @@ void Color3::setValuesRGB(const ValueType red, const ValueType green, const ValueType blue) { - setValues(red, green, blue); + this->setValues(red, green, blue); } @@ -284,9 +284,9 @@ void Color3::setRandom(void) { Real32 rf = 1.0 / Real32(RAND_MAX); - setValuesRGB(TypeTraits::getPortion(rf * rand()), - TypeTraits::getPortion(rf * rand()), - TypeTraits::getPortion(rf * rand())); + this->setValuesRGB(TypeTraits::getPortion(rf * rand()), + TypeTraits::getPortion(rf * rand()), + TypeTraits::getPortion(rf * rand())); } /*! method to set the rgb values (BBGGRR) @@ -399,10 +399,10 @@ const Color4 Color4::Null; template inline Color4::Color4(void) { - setValues(TypeTraits::getZeroElement(), - TypeTraits::getZeroElement(), - TypeTraits::getZeroElement(), - TypeTraits::getZeroElement()); + this->setValues(TypeTraits::getZeroElement(), + TypeTraits::getZeroElement(), + TypeTraits::getZeroElement(), + TypeTraits::getZeroElement()); } @@ -420,7 +420,7 @@ Color4::Color4(const ValueType red, const ValueType blue, const ValueType alpha) { - setValues(red, green, blue, alpha); + this->setValues(red, green, blue, alpha); } @@ -432,10 +432,10 @@ Color4::~Color4(void) template inline void Color4::clear(void) { - setValues(TypeTraits::getZeroElement(), - TypeTraits::getZeroElement(), - TypeTraits::getZeroElement(), - TypeTraits::getZeroElement()); + this->setValues(TypeTraits::getZeroElement(), + TypeTraits::getZeroElement(), + TypeTraits::getZeroElement(), + TypeTraits::getZeroElement()); } @@ -445,7 +445,7 @@ void Color4::setValuesRGBA(const ValueType red, const ValueType blue, const ValueType alpha) { - setValues(red, green, blue, alpha); + this->setValues(red, green, blue, alpha); } template inline diff --git a/Source/Base/Base/OSGConfig.h b/Source/Base/Base/OSGConfig.h index a44fb5534..e2b6b888b 100644 --- a/Source/Base/Base/OSGConfig.h +++ b/Source/Base/Base/OSGConfig.h @@ -618,7 +618,7 @@ # define OSG_TMPL_STATIC_MEMBER_NEEDS_CLASS_INSTANTIATION -# define OSG_STATIC_MEMEBER_NEEDS_COPY_ASIGN_INIT +//# define OSG_STATIC_MEMEBER_NEEDS_COPY_ASIGN_INIT # define OSG_MICROSOFT_DOTNET_COMPILER_HACKS diff --git a/Source/Base/FieldContainer/Base/OSGFieldContainer.cpp b/Source/Base/FieldContainer/Base/OSGFieldContainer.cpp index 5cc4f695e..b62247404 100644 --- a/Source/Base/FieldContainer/Base/OSGFieldContainer.cpp +++ b/Source/Base/FieldContainer/Base/OSGFieldContainer.cpp @@ -47,6 +47,7 @@ #include "OSGFieldContainer.h" #include "OSGContainerPtrFuncs.h" +#include "OSGNameAttachment.h" #include #include @@ -272,7 +273,7 @@ void FieldContainer::registerChangedContainer(void) _pContainerChanges, _bvChanged); #endif -// osgSpinLock(&_uiContainerId, SpinLockBit); + osgSpinLock(&_uiContainerId, SpinLockBit); if(_pContainerChanges == NULL) { @@ -283,10 +284,28 @@ void FieldContainer::registerChangedContainer(void) _pContainerChanges->uiContainerId = this->getId(); _pContainerChanges->bvUncommittedChanges = &_bvChanged; } + else + { + if(_pContainerChanges->pList != Thread::getCurrentChangeList()) + { + std::string name("Unknown Name"); + AttachmentContainer* attachment_container(dynamic_cast(this)); + if (NULL != attachment_container) + { + const Char8* temp_name(OSG::getName(attachment_container)); + if (NULL != temp_name) + { + name = temp_name; + } + } + SWARNING << "Unsafe change from multiple threads for FieldContainer [" + << getType().getCName() << "]: " << name << std::endl; + } + } Thread::getCurrentChangeList()->addUncommited(_pContainerChanges); -// osgSpinLockRelease(&_uiContainerId, SpinLockClearMask); + osgSpinLockRelease(&_uiContainerId, SpinLockClearMask); } void FieldContainer::registerChangedContainerV(void) diff --git a/Source/Base/FieldContainer/Base/OSGFieldContainer.inl b/Source/Base/FieldContainer/Base/OSGFieldContainer.inl index ed79cec49..851b45d68 100644 --- a/Source/Base/FieldContainer/Base/OSGFieldContainer.inl +++ b/Source/Base/FieldContainer/Base/OSGFieldContainer.inl @@ -213,12 +213,16 @@ FieldContainer::~FieldContainer(void) _pFieldFlags = NULL; } + osgSpinLock(&_uiContainerId, SpinLockBit); + if(_pContainerChanges != NULL) { _pContainerChanges->release(); _pContainerChanges = NULL; } + + osgSpinLockRelease(&_uiContainerId, SpinLockClearMask); } inline @@ -382,11 +386,13 @@ void FieldContainer::editMField(ConstFieldMaskArg whichField, inline void FieldContainer::clearUncommited(ConstFieldMaskArg whichField) { + osgSpinLock(&_uiContainerId, SpinLockBit); if(_pContainerChanges != NULL) { _pContainerChanges->whichField |= whichField; *(_pContainerChanges->bvUncommittedChanges) &= ~whichField; } + osgSpinLockRelease(&_uiContainerId, SpinLockClearMask); } #ifdef OSG_MT_CPTR_ASPECT diff --git a/Source/Base/FieldContainer/Base/OSGReflexiveContainer.inl b/Source/Base/FieldContainer/Base/OSGReflexiveContainer.inl index 551b50b42..b97fc9193 100644 --- a/Source/Base/FieldContainer/Base/OSGReflexiveContainer.inl +++ b/Source/Base/FieldContainer/Base/OSGReflexiveContainer.inl @@ -133,7 +133,9 @@ void ReflexiveContainer::onDestroyAspect(UInt32, inline void ReflexiveContainer::execEndEdit(ConstFieldMaskArg whichField) { + osgSpinLock(&_uiContainerId, SpinLockBit); _pContainerChanges->whichField |= whichField; + osgSpinLockRelease(&_uiContainerId, SpinLockClearMask); } #if 0 @@ -147,7 +149,7 @@ ContainerChangeEntry *ReflexiveContainer::getChangeEntry(void) inline void ReflexiveContainer::clearChangeEntry(ContainerChangeEntry *pRef) { -// osgSpinLock(&_uiContainerId, SpinLockBit); + osgSpinLock(&_uiContainerId, SpinLockBit); if(_pContainerChanges == pRef) { @@ -155,7 +157,7 @@ void ReflexiveContainer::clearChangeEntry(ContainerChangeEntry *pRef) _bvChanged = 0x0000; } -// osgSpinLockRelease(&_uiContainerId, SpinLockClearMask); + osgSpinLockRelease(&_uiContainerId, SpinLockClearMask); } inline diff --git a/Source/Base/FieldContainer/Mixins/OSGDynamicAttachmentMixin.inl b/Source/Base/FieldContainer/Mixins/OSGDynamicAttachmentMixin.inl index 7d6af56bb..4b97a3daa 100644 --- a/Source/Base/FieldContainer/Mixins/OSGDynamicAttachmentMixin.inl +++ b/Source/Base/FieldContainer/Mixins/OSGDynamicAttachmentMixin.inl @@ -359,9 +359,9 @@ typename DynFieldAttachment::ObjCPtr { ObjCPtr returnValue; - newAspectCopy(returnValue, - dynamic_cast(pRefAspect), - dynamic_cast(this)); + this->newAspectCopy(returnValue, + dynamic_cast(pRefAspect), + dynamic_cast(this)); return returnValue; } diff --git a/Source/Contrib/ComplexSceneManager/VRMLNodes/OSGLimitedCounters.inl b/Source/Contrib/ComplexSceneManager/VRMLNodes/OSGLimitedCounters.inl index b62e8ef25..84660efd8 100644 --- a/Source/Contrib/ComplexSceneManager/VRMLNodes/OSGLimitedCounters.inl +++ b/Source/Contrib/ComplexSceneManager/VRMLNodes/OSGLimitedCounters.inl @@ -543,9 +543,9 @@ FieldContainer *LimitedCounterImpl::createAspectCopy( { Self *returnValue; - newAspectCopy(returnValue, - dynamic_cast(pRefAspect), - dynamic_cast(this)); + this->newAspectCopy(returnValue, + dynamic_cast(pRefAspect), + dynamic_cast(this)); return returnValue; } diff --git a/Source/System/Action/RenderAction/OSGRenderPartition.h b/Source/System/Action/RenderAction/OSGRenderPartition.h index b2d307426..585473a4c 100644 --- a/Source/System/Action/RenderAction/OSGRenderPartition.h +++ b/Source/System/Action/RenderAction/OSGRenderPartition.h @@ -283,7 +283,8 @@ class OSG_SYSTEM_DLLMAPPING RenderPartition : public RenderPartitionBase const Matrix &topMatrix ( void ); const Matrix &getModelMatrix ( void ) const; - const Matrix &getModelViewMatrix( void ) const; + + const MatrixStore::second_type &getModelViewMatrix( void ) const; const MatrixStore &getMatrixStackTop ( void ) const; diff --git a/Source/System/Action/RenderAction/OSGRenderPartition.inl b/Source/System/Action/RenderAction/OSGRenderPartition.inl index 6a92a68a8..1938fe2d6 100644 --- a/Source/System/Action/RenderAction/OSGRenderPartition.inl +++ b/Source/System/Action/RenderAction/OSGRenderPartition.inl @@ -282,8 +282,8 @@ const Matrix &RenderPartition::getModelMatrix(void) const return _modelMatrix; } -inline -const Matrix &RenderPartition::getModelViewMatrix(void) const +inline const RenderPartition::MatrixStore::second_type & +RenderPartition::getModelViewMatrix(void) const { return _modelViewMatrix.second; } diff --git a/Source/System/FileIO/Base/OSGZStream.inl b/Source/System/FileIO/Base/OSGZStream.inl index 6e309d00b..d078d8944 100644 --- a/Source/System/FileIO/Base/OSGZStream.inl +++ b/Source/System/FileIO/Base/OSGZStream.inl @@ -94,7 +94,7 @@ basic_zip_streambuf::overflow(int_type c) } if (zip_to_stream(this->pbase(), w)) { - setp(this->pbase(), this->epptr() - 1); + this->setp(this->pbase(), this->epptr() - 1); return c; } else diff --git a/Source/System/FileIO/Collada/OSGColladaEffect.cpp b/Source/System/FileIO/Collada/OSGColladaEffect.cpp index e64d3cac5..205427490 100644 --- a/Source/System/FileIO/Collada/OSGColladaEffect.cpp +++ b/Source/System/FileIO/Collada/OSGColladaEffect.cpp @@ -276,9 +276,16 @@ ColladaEffect::readProfileCommon(domProfile_COMMON *prof) } readImageArray(prof->getImage_array()); + readNewParams(prof->getNewparam_array()); - const domCommon_newparam_type_Array &newParams = prof->getNewparam_array(); + domProfile_COMMON::domTechniqueRef tech = prof->getTechnique(); + readNewParams(tech->getNewparam_array()); + readImageArray(tech->getImage_array()); +} +void +ColladaEffect::readNewParams(const domCommon_newparam_type_Array& newParams) +{ for(UInt32 i = 0; i < newParams.getCount(); ++i) { // must read surface params before sampler params, because their @@ -326,9 +333,6 @@ ColladaEffect::readProfileCommon(domProfile_COMMON *prof) << std::endl; } - domProfile_COMMON::domTechniqueRef tech = prof->getTechnique(); - - readImageArray(tech->getImage_array()); } void diff --git a/Source/System/FileIO/Collada/OSGColladaEffect.h b/Source/System/FileIO/Collada/OSGColladaEffect.h index 91b560cec..3cadb751c 100644 --- a/Source/System/FileIO/Collada/OSGColladaEffect.h +++ b/Source/System/FileIO/Collada/OSGColladaEffect.h @@ -166,6 +166,7 @@ class OSG_FILEIO_DLLMAPPING ColladaEffect : public ColladaInstantiableElement virtual void readProfileCommon(domProfile_COMMON *prof); virtual void readProfileGLSL (domProfile_GLSL *prof); virtual void readProfileCG (domProfile_CG *prof); + virtual void readNewParams (const domCommon_newparam_type_Array& newParams); virtual MaterialTransitPtr createInstanceProfileCommon( domProfile_COMMON *prof, domEffect *effect, diff --git a/Source/System/FileIO/Collada/OSGColladaGeometry.cpp b/Source/System/FileIO/Collada/OSGColladaGeometry.cpp index 4883e4bcb..a697d180f 100644 --- a/Source/System/FileIO/Collada/OSGColladaGeometry.cpp +++ b/Source/System/FileIO/Collada/OSGColladaGeometry.cpp @@ -1099,6 +1099,34 @@ ColladaGeometry::handleBindMaterial( } } + // Clean up the texcood property indices by ensuring that if we have at + // least one texture coordinate property, that it is assigned to the first + // texture coordinate slot. This should be a safe assumption since we are + // in the common profile. + GeoVectorProperty* tex_coord0(geo->getProperty(Geometry::TexCoordsIndex)); + if (NULL == tex_coord0) + { + + for (UInt16 idx = Geometry::TexCoords1Index; idx <= Geometry::TexCoords7Index; ++idx) + { + GeoVectorProperty* tex_coord(geo->getProperty(idx)); + if (NULL != tex_coord) + { + OSG_COLLADA_LOG(("ColladaGeometry::handleBindMaterial: " + "Manual switch texture coords from [%d] to [%s].\n", + idx, Geometry::TexCoords1Index)); + + geo->setProperty(tex_coord, Geometry::TexCoordsIndex); + geo->setProperty(NULL, idx); + + GeoIntegralProperty* index(geo->getIndex(idx)); + geo->setIndex(index, Geometry::TexCoordsIndex); + geo->setIndex(NULL, idx); + break; + } + } + } + if(material != NULL) { geo->setMaterial(material); diff --git a/Source/System/Image/FileIO/OSGGDALImageFileType.cpp b/Source/System/Image/FileIO/OSGGDALImageFileType.cpp index 8cfbb9119..cfe31aaec 100644 --- a/Source/System/Image/FileIO/OSGGDALImageFileType.cpp +++ b/Source/System/Image/FileIO/OSGGDALImageFileType.cpp @@ -48,9 +48,9 @@ #include "OSGGeoReferenceAttachment.h" #ifdef OSG_WITH_GDAL -#include "gdal/gdal_priv.h" -#include "gdal/ogr_srs_api.h" -#include "gdal/cpl_multiproc.h" +#include "gdal_priv.h" +#include "ogr_srs_api.h" +#include "cpl_multiproc.h" #endif diff --git a/Source/System/Image/FileIO/OSGGDALImageFileType.h b/Source/System/Image/FileIO/OSGGDALImageFileType.h index 1b9b92dc4..ac0549d0c 100644 --- a/Source/System/Image/FileIO/OSGGDALImageFileType.h +++ b/Source/System/Image/FileIO/OSGGDALImageFileType.h @@ -48,8 +48,8 @@ #include "boost/shared_ptr.hpp" #ifdef OSG_WITH_GDAL -#include "gdal/gdal_priv.h" -#include "gdal/ogr_srs_api.h" +#include "gdal_priv.h" +#include "ogr_srs_api.h" #endif OSG_BEGIN_NAMESPACE diff --git a/Source/System/Image/FileIO/OSGGIFImageFileType.cpp b/Source/System/Image/FileIO/OSGGIFImageFileType.cpp index 1caa32e22..d4d28f035 100644 --- a/Source/System/Image/FileIO/OSGGIFImageFileType.cpp +++ b/Source/System/Image/FileIO/OSGGIFImageFileType.cpp @@ -160,7 +160,7 @@ static GIFStream *GIFRead (std::istream &is); int GIFTest (char *); int GIFWrite (char *, GIFStream *, int); static int GIFWriteFP(FILE *, GIFStream *, int); -static int GIFFree (GIFStream *); +static int GIFFree (const GIFStream *); #endif @@ -192,18 +192,20 @@ bool GIFImageFileType::read( Image *OSG_GIF_ARG(pImage), #ifdef OSG_WITH_GIF Image::PixelFormat pixelFormat = Image::OSG_INVALID_PF; - GIFStream *gifStream = GIFRead(is); - GIFData *gifData = 0; + const GIFStream *gifStream = GIFRead(is); + const GIFData *gifData = 0; bool isColor; int i, j, destI, lineSize, lineEnd; unsigned red, green, blue; int transparentIndex; - int width = 0, height = 0, channel = 0; + int streamWidth = 0, streamHeight = 0; + int curWidth = 0, curHeight = 0, channel = 0; int xOff = 0, yOff = 0; - unsigned char *srcData = 0, *destData = 0; + const unsigned char *srcData = 0; + unsigned char *destData = 0; int colorIndex; unsigned frameCount = 0, currentFrame = 0; - unsigned char *colorMap = 0; + const unsigned char *colorMap = 0; // int imageSize = 0; int colorMapSize; @@ -224,6 +226,9 @@ bool GIFImageFileType::read( Image *OSG_GIF_ARG(pImage), if(gifStream) { + streamWidth = gifStream->width; + streamHeight = gifStream->height; + for(gifData = gifStream->data; gifData; gifData = gifData->next) { switch(gifData->type) @@ -238,10 +243,10 @@ bool GIFImageFileType::read( Image *OSG_GIF_ARG(pImage), // get the att. transparentIndex = gifData->info.transparent; frameDelay = float(gifData->info.delayTime) / 100.0f; - width = gifData->width; - height = gifData->height; - xOff = gifData->x; - yOff = gifData->y; + curWidth = gifData->width; + curHeight = gifData->height; + xOff = gifData->x; + yOff = gifData->y; // check if the movie is color or greyscale isColor = false; @@ -249,7 +254,7 @@ bool GIFImageFileType::read( Image *OSG_GIF_ARG(pImage), { colorMapSize = gifData->data.image.cmapSize; colorMap = - reinterpret_cast( + reinterpret_cast( gifData->data.image.cmapData); // cout << "INFO: Use gifData colorMap" << endl; @@ -258,7 +263,7 @@ bool GIFImageFileType::read( Image *OSG_GIF_ARG(pImage), { colorMapSize = gifStream->cmapSize; colorMap = - reinterpret_cast( + reinterpret_cast( gifStream->cmapData); // cout << "INFO: Use gifStream colorMap" << endl; @@ -294,8 +299,8 @@ bool GIFImageFileType::read( Image *OSG_GIF_ARG(pImage), { // is not the first frame if((channel == pImage->getBpp()) && - (width == pImage->getWidth()) && - (height == pImage->getHeight())) + (streamWidth == pImage->getWidth()) && + (streamHeight == pImage->getHeight())) { destData = pImage->editData(0, currentFrame); } @@ -380,17 +385,17 @@ bool GIFImageFileType::read( Image *OSG_GIF_ARG(pImage), break; }; pImage->set(pixelFormat, - width, - height, + streamWidth, + streamHeight, 1, 1, frameCount, frameDelay); destData = pImage->editData(); } - // copy the image data) + // copy the image data lineSize = pImage->getWidth() * channel; - lineEnd = width * channel + xOff * channel; + lineEnd = curWidth * channel + xOff * channel; srcData = gifData->data.image.data; destData = destData + ((pImage->getHeight() - yOff - 1)*lineSize); @@ -399,10 +404,10 @@ bool GIFImageFileType::read( Image *OSG_GIF_ARG(pImage), { case 1: // Greyscale without Alpha destI = 0; - for(i = width * height; i--;) + for(i = curWidth * curHeight; i--;) { destData[destI++] = colorMap[*srcData++ *3]; - if(destI >= lineSize) + if(destI >= lineEnd) { destI = 0; destData -= lineSize; @@ -412,7 +417,7 @@ bool GIFImageFileType::read( Image *OSG_GIF_ARG(pImage), case 2: // Greyscale with Alpha destI = 0; - for(i = width * height; i--;) + for(i = curWidth * curHeight; i--;) { colorIndex = *srcData++; if(colorIndex == transparentIndex) @@ -426,7 +431,7 @@ bool GIFImageFileType::read( Image *OSG_GIF_ARG(pImage), destData[destI++] = 255; } - if(destI >= lineSize) + if(destI >= lineEnd) { destI = 0; destData -= lineSize; @@ -436,7 +441,7 @@ bool GIFImageFileType::read( Image *OSG_GIF_ARG(pImage), case 3: // RGB without Alpha destI = 0; - for(i = width * height; i--;) + for(i = curWidth * curHeight; i--;) { colorIndex = *srcData++; for(j = 0; j < 3; j++) @@ -445,7 +450,7 @@ bool GIFImageFileType::read( Image *OSG_GIF_ARG(pImage), colorMap[colorIndex * 3 + j]; } - if(destI >= lineSize) + if(destI >= lineEnd) { destI = 0; destData -= lineSize; @@ -456,7 +461,7 @@ bool GIFImageFileType::read( Image *OSG_GIF_ARG(pImage), case 4: // RGB with Alpha destI = xOff * 4; - for(i = width * height; i--;) + for(i = curWidth * curHeight; i--;) { colorIndex = *srcData++; if(colorIndex == transparentIndex) @@ -898,7 +903,7 @@ static GIFStream *GIFRead(std::istream &is) } /* */ -static int GIFFreeData(GIFData *gifData) +static int GIFFreeData(const GIFData *gifData) { int retCode = 0; @@ -935,7 +940,7 @@ static int GIFFreeData(GIFData *gifData) } /* */ -static int GIFFree(GIFStream *gifStream) +static int GIFFree(const GIFStream *gifStream) { int retCode = 1; GIFData *gifData, *gifNext; diff --git a/Source/System/Image/FileIO/OSGPNGImageFileType.cpp b/Source/System/Image/FileIO/OSGPNGImageFileType.cpp index cd6b63d88..0a1ddb48c 100644 --- a/Source/System/Image/FileIO/OSGPNGImageFileType.cpp +++ b/Source/System/Image/FileIO/OSGPNGImageFileType.cpp @@ -125,7 +125,7 @@ static void errorOutput (png_structp png_ptr, const char *message) { FFATAL (("PNG: %s\n", message )); - longjmp(png_ptr->jmpbuf, 1); + longjmp(png_jmpbuf(png_ptr), 1); } static void warningOutput (png_structp OSG_CHECK_ARG(png_ptr), @@ -175,7 +175,7 @@ bool PNGImageFileType::read( Image *OSG_PNG_ARG(pImage ), return false; } - if(setjmp(png_ptr->jmpbuf)) + if(setjmp(png_jmpbuf(png_ptr))) { png_destroy_read_struct(&png_ptr, &info_ptr, 0); return false; @@ -204,7 +204,7 @@ bool PNGImageFileType::read( Image *OSG_PNG_ARG(pImage ), // Convert < 8 bit to 8 bit if(color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) { - png_set_gray_1_2_4_to_8(png_ptr); + png_set_expand_gray_1_2_4_to_8(png_ptr); bit_depth = 8; } @@ -651,7 +651,7 @@ UInt64 PNGImageFileType::restoreData( Image *OSG_PNG_ARG (pImage ), return 0; } - if(setjmp(png_ptr->jmpbuf)) + if(setjmp(png_jmpbuf(png_ptr))) { png_destroy_read_struct(&png_ptr, &info_ptr, 0); return 0; @@ -681,7 +681,7 @@ UInt64 PNGImageFileType::restoreData( Image *OSG_PNG_ARG (pImage ), // Convert < 8 bit to 8 bit if(color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) { - png_set_gray_1_2_4_to_8(png_ptr); + png_set_expand_gray_1_2_4_to_8(png_ptr); bit_depth = 8; } diff --git a/Source/System/NodeCores/Drawables/Geometry/Base/OSGGeometry.cpp b/Source/System/NodeCores/Drawables/Geometry/Base/OSGGeometry.cpp index 5139fb47b..fc83c4497 100644 --- a/Source/System/NodeCores/Drawables/Geometry/Base/OSGGeometry.cpp +++ b/Source/System/NodeCores/Drawables/Geometry/Base/OSGGeometry.cpp @@ -385,7 +385,7 @@ void Geometry::drawPrimitives(DrawEnv *pEnv) { bool usesShader = false; - usesShader = (pEnv->getActiveShader() != 0); +// usesShader = (pEnv->getActiveShader() != 0); // store glColor. Color4f color; diff --git a/Source/System/RenderingBackend/OSGOcclusionCullingTreeBuilder.cpp b/Source/System/RenderingBackend/OSGOcclusionCullingTreeBuilder.cpp index dae49946e..a182fe006 100644 --- a/Source/System/RenderingBackend/OSGOcclusionCullingTreeBuilder.cpp +++ b/Source/System/RenderingBackend/OSGOcclusionCullingTreeBuilder.cpp @@ -799,7 +799,7 @@ OcclusionCullingTreeBuilder::createNode(RenderActionBase *pAction, Pnt3d objPos(TypeTraits::getMax(), TypeTraits::getMax(), TypeTraits::getMax() ); - Pnt3f volVert[8]; + Pnt3d volVert[8]; #endif Pnt3f volMin;