From 7dfd907e1733179259cab65a4d579f44c0f55308 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 27 Jun 2016 00:38:14 +0200 Subject: [PATCH 1/2] Try to report red/green/blue bits for Cocoa windows --- .../cocoaGraphicsStateGuardian.mm | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/panda/src/cocoadisplay/cocoaGraphicsStateGuardian.mm b/panda/src/cocoadisplay/cocoaGraphicsStateGuardian.mm index 01e4624015..6856fecbc5 100644 --- a/panda/src/cocoadisplay/cocoaGraphicsStateGuardian.mm +++ b/panda/src/cocoadisplay/cocoaGraphicsStateGuardian.mm @@ -105,6 +105,26 @@ get_properties(FrameBufferProperties &properties, NSOpenGLPixelFormat* pixel_for } //TODO: add aux buffers + // Cocoa doesn't provide individual RGB bits. Make assumptions. + // Note that color_size seems to be returning values like 32, which + // suggests that it contains the alpha size as well. + + if (color_size == 24 || color_size == 32) { + properties.set_rgba_bits(8, 8, 8, alpha_size); + + } else if (color_size == 64) { + properties.set_rgba_bits(16, 16, 16, alpha_size); + + } else if (color_size == 128) { + properties.set_rgba_bits(32, 32, 32, alpha_size); + + } else if (color_size >= 3) { + // Assume it's giving us at least one of each. + properties.set_red_bits(1); + properties.set_green_bits(1); + properties.set_blue_bits(1); + } + // Extract the renderer ID bits and check if our // renderer matches the known software renderers. renderer_id &= kCGLRendererIDMatchingMask; From 46147e9a09fb55d94b4d8bb8aa2e5833bac4f98f Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 27 Jun 2016 01:06:07 +0200 Subject: [PATCH 2/2] Maya 2016.5 on 1.9 branch; fix Maya 2016.5 build on Mac OS X --- doc/ReleaseNotes | 1 + makepanda/makepandacore.py | 1 + pandatool/src/maya/mayaApi.cxx | 5 +++-- pandatool/src/maya/pre_maya_include.h | 8 ++++++-- pandatool/src/mayaprogs/mayaSavePview.h | 8 ++++++-- pandatool/src/mayaprogs/mayapath.cxx | 1 + 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index a4a0b49a02..ec8621329d 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -15,6 +15,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Work around GLSL issue with #pragma and certain Intel drivers * Improve performance of texture load and store operations * Fix crashes with pbuffers on Intel cards on Windows +* Support for Autodesk Maya 2016.5 ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index 205caa896e..1b011188ff 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -80,6 +80,7 @@ MAYAVERSIONINFO = [("MAYA6", "6.0"), ("MAYA2014","2014"), ("MAYA2015","2015"), ("MAYA2016","2016"), + ("MAYA20165","2016.5"), ] MAXVERSIONINFO = [("MAX6", "SOFTWARE\\Autodesk\\3DSMAX\\6.0", "installdir", "maxsdk\\cssdk\\include"), diff --git a/pandatool/src/maya/mayaApi.cxx b/pandatool/src/maya/mayaApi.cxx index 1014b64661..be1c281918 100644 --- a/pandatool/src/maya/mayaApi.cxx +++ b/pandatool/src/maya/mayaApi.cxx @@ -199,9 +199,10 @@ open_api(string program_name, bool view_license, bool revertdir) { size_t dot2 = runtime_version.find('.', dot1 + 1); if (dot2 == string::npos) { - rtver_b = 0; + string_to_int(runtime_version.substr(dot1 + 1), rtver_b); + } else { - string_to_int(runtime_version.substr(dot1, dot2 - dot1), rtver_b); + string_to_int(runtime_version.substr(dot1 + 1, dot2 - dot1 - 1), rtver_b); simple_runtime_version = runtime_version.substr(0, dot2); } } diff --git a/pandatool/src/maya/pre_maya_include.h b/pandatool/src/maya/pre_maya_include.h index 5f6d2f9877..1138e89daa 100644 --- a/pandatool/src/maya/pre_maya_include.h +++ b/pandatool/src/maya/pre_maya_include.h @@ -64,8 +64,12 @@ typedef istream maya_istream; #endif // PHAVE_IOSTREAM #ifdef __MACH__ -#undef _BOOL -#include "maya/OpenMayaMac.h" +#define OSMac_ 1 +// This defines MAYA_API_VERSION +#include +#if MAYA_API_VERSION < 201600 +#include +#endif #endif #endif // MAYA_PRE_5_0 diff --git a/pandatool/src/mayaprogs/mayaSavePview.h b/pandatool/src/mayaprogs/mayaSavePview.h index 5cd8d5dafd..6eeb744bd4 100644 --- a/pandatool/src/mayaprogs/mayaSavePview.h +++ b/pandatool/src/mayaprogs/mayaSavePview.h @@ -26,8 +26,12 @@ #endif #ifdef __MACH__ -#undef _BOOL -#include "maya/OpenMayaMac.h" +#define OSMac_ 1 +// This defines MAYA_API_VERSION +#include +#if MAYA_API_VERSION < 201600 +#include +#endif #endif // Even though we don't include any Panda headers, it's safe to diff --git a/pandatool/src/mayaprogs/mayapath.cxx b/pandatool/src/mayaprogs/mayapath.cxx index dfeb68fc5c..22b854fdc5 100644 --- a/pandatool/src/mayaprogs/mayapath.cxx +++ b/pandatool/src/mayaprogs/mayapath.cxx @@ -102,6 +102,7 @@ struct MayaVerInfo maya_versions[] = { { "MAYA2014", "2014"}, { "MAYA2015", "2015"}, { "MAYA2016", "2016"}, + { "MAYA20165", "2016.5"}, { 0, 0 }, };