From 1c6e33bc7ed68464bdb9d6fd1934bb00936ce043 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 5 Nov 2010 09:12:28 +0000 Subject: [PATCH] From Wang Rui, "Attached is a fix to the latest PVR plugin to make it compile under MSVC. I've added definition to uint_32 and replaced std::max() with osg::maximum(), because it is not supported by some VisualStudio versions." --- src/osgPlugins/pvr/ReaderWriterPVR.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/osgPlugins/pvr/ReaderWriterPVR.cpp b/src/osgPlugins/pvr/ReaderWriterPVR.cpp index 443fbb561..4150c6715 100644 --- a/src/osgPlugins/pvr/ReaderWriterPVR.cpp +++ b/src/osgPlugins/pvr/ReaderWriterPVR.cpp @@ -1,5 +1,9 @@ // ReaderWriter for pvr images +#if defined(_MSC_VER) +#include +#endif + #include #include @@ -14,7 +18,17 @@ #include #include #include + +#if defined(_MSC_VER) +typedef UINT64 uint64_t; +typedef INT64 int64_t; +typedef UINT32 uint32_t; +typedef INT32 int32_t; +typedef UINT16 uint16_t; +typedef UINT8 uint8_t; +#else #include +#endif using namespace osg; @@ -193,8 +207,8 @@ public: dataOffset += widthBlocks * heightBlocks * ((blockSize * bpp) / 8); - width = std::max(width >> 1, (uint32_t)1); - height = std::max(height >> 1, (uint32_t)1); + width = osg::maximum(width >> 1, (uint32_t)1); + height = osg::maximum(height >> 1, (uint32_t)1); } if(!mipmapdata.empty())