Browse Source

Merge branch 'cmake' into cmake-proper-interrogate

Conflicts:
	cmake/macros/Interrogate.cmake
	panda/src/express/CMakeLists.txt
	panda/src/ode/CMakeLists.txt
Sam Edwards 11 years ago
parent
commit
0d13247721
100 changed files with 1471 additions and 665 deletions
  1. 5 0
      CMakeLists.txt
  2. 8 8
      cmake/macros/Interrogate.cmake
  3. 1 1
      cmake/macros/PackageConfig.cmake
  4. 3 2
      cmake/modules/FindEigen3.cmake
  5. 93 0
      cmake/modules/FindFFMPEG.cmake
  6. 52 0
      cmake/modules/FindSWResample.cmake
  7. 52 0
      cmake/modules/FindSWScale.cmake
  8. 1 1
      direct/CMakeLists.txt
  9. 2 2
      direct/src/dcparser/CMakeLists.txt
  10. 1 1
      direct/src/directbase/CMakeLists.txt
  11. 4 4
      direct/src/directtools/DirectSelection.py
  12. 1 3
      direct/src/distributed/MsgTypes.py
  13. 1 3
      direct/src/distributed/MsgTypesCMU.py
  14. 3 4
      direct/src/fsm/FSM.py
  15. 22 44
      direct/src/gui/DirectGuiBase.py
  16. 2 3
      direct/src/gui/OnscreenGeom.py
  17. 2 3
      direct/src/gui/OnscreenImage.py
  18. 2 3
      direct/src/gui/OnscreenText.py
  19. 6 6
      direct/src/leveleditor/ObjectMgrBase.py
  20. 6 0
      direct/src/p3d/thirdparty.pdef
  21. 2 2
      direct/src/particles/Particles.py
  22. 1 0
      direct/src/plugin/handleStreamBuf.cxx
  23. 1 2
      direct/src/plugin/mkdir_complete.cxx
  24. 1 0
      direct/src/plugin/p3dAuthSession.cxx
  25. 4 0
      direct/src/plugin/p3dHost.cxx
  26. 1 4
      direct/src/showbase/ElementTree.py
  27. 1 1
      direct/src/showbase/PythonUtil.py
  28. 3 2
      direct/src/showbase/extend_frozen.c
  29. 20 2
      dtool/Config.cmake
  30. 0 34
      dtool/Config.pp
  31. 0 13
      dtool/LocalSetup.pp
  32. 0 6
      dtool/Package.pp
  33. 0 7
      dtool/pptempl/Global.pp
  34. 1 3
      dtool/src/dtoolbase/CMakeLists.txt
  35. 10 1
      dtool/src/dtoolbase/atomicAdjust.h
  36. 148 0
      dtool/src/dtoolbase/atomicAdjustGccImpl.I
  37. 60 0
      dtool/src/dtoolbase/atomicAdjustGccImpl.h
  38. 23 1
      dtool/src/dtoolbase/cmath.I
  39. 3 1
      dtool/src/dtoolbase/cmath.h
  40. 11 0
      dtool/src/dtoolbase/dtoolbase_cc.h
  41. 8 1
      dtool/src/dtoolbase/nearly_zero.h
  42. 2 2
      dtool/src/dtoolbase/register_type.cxx
  43. 6 0
      dtool/src/dtoolbase/register_type.h
  44. 4 0
      dtool/src/dtoolbase/typeHandle.cxx
  45. 7 5
      dtool/src/dtoolbase/typeHandle.h
  46. 2 0
      dtool/src/dtoolbase/typeRegistry.h
  47. 4 0
      dtool/src/dtoolutil/filename.cxx
  48. 4 0
      dtool/src/dtoolutil/globPattern.cxx
  49. 1 1
      dtool/src/interrogate/CMakeLists.txt
  50. 59 43
      dtool/src/interrogate/functionRemap.cxx
  51. 1 0
      dtool/src/interrogate/functionRemap.h
  52. 8 6
      dtool/src/interrogate/interfaceMaker.cxx
  53. 23 0
      dtool/src/interrogate/interfaceMaker.h
  54. 2 7
      dtool/src/interrogate/interfaceMakerPython.cxx
  55. 416 206
      dtool/src/interrogate/interfaceMakerPythonNative.cxx
  56. 25 21
      dtool/src/interrogate/interfaceMakerPythonNative.h
  57. 49 36
      dtool/src/interrogate/interrogateBuilder.cxx
  58. 3 2
      dtool/src/interrogate/typeManager.cxx
  59. 1 1
      dtool/src/interrogatedb/dtool_super_base.cxx
  60. 21 5
      dtool/src/interrogatedb/py_panda.cxx
  61. 13 8
      dtool/src/interrogatedb/py_panda.h
  62. 0 0
      dtool/src/parser-inc/Cg/cg.h
  63. 0 0
      dtool/src/parser-inc/Cg/cgGL.h
  64. 0 0
      dtool/src/parser-inc/Core/Core.h
  65. 0 0
      dtool/src/parser-inc/Eigen/Dense
  66. 0 0
      dtool/src/parser-inc/Eigen/StdVector
  67. 0 0
      dtool/src/parser-inc/Forest/Forest.h
  68. 3 1
      dtool/src/parser-inc/Python.h
  69. 0 0
      dtool/src/parser-inc/Renderers/OpenGL/DirectX9Renderer.h
  70. 0 0
      dtool/src/parser-inc/Renderers/OpenGL/OpenGLRenderer.h
  71. 0 0
      dtool/src/parser-inc/Rocket/Core/RenderInterface.h
  72. 0 0
      dtool/src/parser-inc/glew/glew.h
  73. 0 0
      dtool/src/parser-inc/netinet/ip.h
  74. 0 0
      dtool/src/parser-inc/netinet/tcp.h
  75. 4 0
      dtool/src/prc/configVariableCore.h
  76. 1 0
      dtool/src/prc/configVariableManager.h
  77. 2 2
      dtool/src/prc/notifyCategory.I
  78. 2 2
      dtool/src/prc/notifyCategory.h
  79. 12 4
      dtool/src/prc/notifyCategoryProxy.I
  80. 2 2
      dtool/src/prc/notifyCategoryProxy.h
  81. 20 0
      dtool/src/pystub/pystub.cxx
  82. 5 5
      makepanda/installpanda.py
  83. 92 109
      makepanda/makepanda.py
  84. 15 5
      makepanda/makepandacore.py
  85. 5 2
      panda/CMakeLists.txt
  86. 1 1
      panda/metalibs/pandaegg/CMakeLists.txt
  87. 2 4
      panda/src/androiddisplay/androidGraphicsStateGuardian.cxx
  88. 1 1
      panda/src/androiddisplay/androidGraphicsStateGuardian.h
  89. 1 0
      panda/src/audiotraits/fmodAudioManager.cxx
  90. 2 0
      panda/src/audiotraits/fmodAudioSound.cxx
  91. 1 0
      panda/src/audiotraits/fmodAudioSound.h
  92. 1 1
      panda/src/audiotraits/openalAudioSound.cxx
  93. 1 0
      panda/src/audiotraits/openalAudioSound.h
  94. 1 0
      panda/src/bullet/bulletManifoldPoint.cxx
  95. 1 1
      panda/src/cocoadisplay/CMakeLists.txt
  96. 1 1
      panda/src/cocoadisplay/Sources.pp
  97. 1 1
      panda/src/cocoadisplay/cocoaGraphicsStateGuardian.h
  98. 4 5
      panda/src/cocoadisplay/cocoaGraphicsStateGuardian.mm
  99. 3 2
      panda/src/cocoadisplay/cocoaGraphicsWindow.h
  100. 71 5
      panda/src/cocoadisplay/cocoaGraphicsWindow.mm

+ 5 - 0
CMakeLists.txt

@@ -31,6 +31,7 @@ include_directories("${CMAKE_BINARY_DIR}/include")
 option(BUILD_DTOOL  "Build the dtool source tree." ON)
 option(BUILD_DTOOL  "Build the dtool source tree." ON)
 option(BUILD_PANDA  "Build the panda source tree." ON)
 option(BUILD_PANDA  "Build the panda source tree." ON)
 option(BUILD_DIRECT "Build the direct source tree." ON)
 option(BUILD_DIRECT "Build the direct source tree." ON)
+option(BUILD_PANDATOOL "Build the pandatool source tree." ON)
 
 
 # Include Panda3D packages
 # Include Panda3D packages
 if(BUILD_DTOOL)
 if(BUILD_DTOOL)
@@ -44,3 +45,7 @@ endif()
 if(BUILD_DIRECT)
 if(BUILD_DIRECT)
   add_subdirectory(direct)
   add_subdirectory(direct)
 endif()
 endif()
+
+if(BUILD_PANDATOOL)
+  add_subdirectory(pandatool)
+endif()

+ 8 - 8
cmake/macros/Interrogate.cmake

@@ -78,8 +78,11 @@ function(target_interrogate target)
     set(absolute_sources)
     set(absolute_sources)
     set(absolute_extensions)
     set(absolute_extensions)
     foreach(source ${sources})
     foreach(source ${sources})
-      get_source_file_property(location "${source}" LOCATION)
-      list(APPEND absolute_sources ${location})
+      get_source_file_property(exclude "${source}" WRAP_EXCLUDE)
+      if(NOT exclude)
+        get_source_file_property(location "${source}" LOCATION)
+        list(APPEND absolute_sources ${location})
+      endif()
     endforeach(source)
     endforeach(source)
     foreach(extension ${extensions})
     foreach(extension ${extensions})
       get_source_file_property(location "${extension}" LOCATION)
       get_source_file_property(location "${extension}" LOCATION)
@@ -145,11 +148,6 @@ function(interrogate_sources target output database module)
         endif()
         endif()
       endforeach(regex)
       endforeach(regex)
 
 
-      get_source_file_property(source_excluded ${source} WRAP_EXCLUDE)
-      if(source_excluded)
-        set(exclude ON)
-      endif()
-
       if(NOT exclude)
       if(NOT exclude)
         # This file is to be scanned by Interrogate. In order to avoid
         # This file is to be scanned by Interrogate. In order to avoid
         # cluttering up the command line, we should first make it relative:
         # cluttering up the command line, we should first make it relative:
@@ -283,6 +281,8 @@ function(add_python_module module)
       set_target_properties(${module} PROPERTIES SUFFIX ".pyd")
       set_target_properties(${module} PROPERTIES SUFFIX ".pyd")
     endif()
     endif()
 
 
+    install(TARGETS ${module} DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d")
+
     list(APPEND ALL_INTERROGATE_MODULES "${module}")
     list(APPEND ALL_INTERROGATE_MODULES "${module}")
     set(ALL_INTERROGATE_MODULES "${ALL_INTERROGATE_MODULES}" CACHE INTERNAL "Internal variable")
     set(ALL_INTERROGATE_MODULES "${ALL_INTERROGATE_MODULES}" CACHE INTERNAL "Internal variable")
   endif()
   endif()
@@ -296,5 +296,5 @@ if(HAVE_PYTHON)
 
 
   # The Interrogate path needs to be installed to the architecture-dependent
   # The Interrogate path needs to be installed to the architecture-dependent
   # Python directory.
   # Python directory.
-  install(DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" DESTINATION "${PYTHON_ARCH_INSTALL_DIR}")
+  install(FILES "${PROJECT_BINARY_DIR}/panda3d/__init__.py" DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d")
 endif()
 endif()

+ 1 - 1
cmake/macros/PackageConfig.cmake

@@ -128,7 +128,7 @@ macro(target_use_packages target)
   foreach(lib ${libs})
   foreach(lib ${libs})
     if(HAVE_${lib})
     if(HAVE_${lib})
       target_include_directories("${target}" PUBLIC "${${lib}_INCLUDE_DIRS};${${lib}_INCLUDE_DIR}")
       target_include_directories("${target}" PUBLIC "${${lib}_INCLUDE_DIRS};${${lib}_INCLUDE_DIR}")
-      if(${lib}_LIBRARIES)
+      if(_${lib}_LIBRARIES)
         target_link_libraries("${target}" ${_${lib}_LIBRARIES})
         target_link_libraries("${target}" ${_${lib}_LIBRARIES})
       else()
       else()
         target_link_libraries("${target}" ${_${lib}_LIBRARY})
         target_link_libraries("${target}" ${_${lib}_LIBRARY})

+ 3 - 2
cmake/modules/FindEigen3.cmake

@@ -25,5 +25,6 @@ include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR)
 find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR)
 
 
 if(EIGEN3_FOUND)
 if(EIGEN3_FOUND)
-	set(EIGEN_FOUND TRUE)
-endif()
+  set(EIGEN_FOUND TRUE)
+  set(EIGEN_INCLUDE_DIR ${EIGEN3_INCLUDE_DIR})
+endif()

+ 93 - 0
cmake/modules/FindFFMPEG.cmake

@@ -0,0 +1,93 @@
+# Filename: FindFFMPEG.cmake
+# Author: CFSworks (10 Apr, 2014)
+#
+# Usage:
+#   find_package(FFMPEG [REQUIRED] [QUIET])
+#
+# Once done this will define:
+#   FFMPEG_FOUND       - system has ffmpeg
+#   FFMPEG_INCLUDE_DIR - the ffmpeg include directory
+#   FFMPEG_LIBRARIES   - the path to the library binary
+#
+#   FFMPEG_LIBAVCODEC  - the path to the libavcodec library binary
+#   FFMPEG_LIBAVFORMAT - the path to the libavformat library binary
+#   FFMPEG_LIBAVUTIL   - the path to the libavutil library binary
+#
+
+if(NOT FFMPEG_INCLUDE_DIR OR NOT FFMPEG_LIBRARY_DIR)
+	# Find the libffmpeg include files
+	find_path(FFMPEG_INCLUDE_DIR
+		NAMES "libavcodec/avcodec.h"
+		PATHS "/usr/include"
+		      "/usr/local/include"
+		      "/sw/include"
+		      "/opt/include"
+		      "/opt/local/include"
+		      "/opt/csw/include"
+		PATH_SUFFIXES "libav" "ffmpeg"
+	)
+
+	# Find the libavcodec library
+  find_library(FFMPEG_LIBAVCODEC
+		NAMES "avcodec"
+		PATHS "/usr"
+		      "/usr/local"
+		      "/usr/freeware"
+		      "/sw"
+		      "/opt"
+		      "/opt/csw"
+		PATH_SUFFIXES "lib" "lib32" "lib64"
+	)
+
+	# Find the libavformat library
+  find_library(FFMPEG_LIBAVFORMAT
+		NAMES "avformat"
+		PATHS "/usr"
+		      "/usr/local"
+		      "/usr/freeware"
+		      "/sw"
+		      "/opt"
+		      "/opt/csw"
+		PATH_SUFFIXES "lib" "lib32" "lib64"
+	)
+
+	# Find the libavutil library
+  find_library(FFMPEG_LIBAVUTIL
+		NAMES "avutil"
+		PATHS "/usr"
+		      "/usr/local"
+		      "/usr/freeware"
+		      "/sw"
+		      "/opt"
+		      "/opt/csw"
+		PATH_SUFFIXES "lib" "lib32" "lib64"
+	)
+
+	mark_as_advanced(FFMPEG_INCLUDE_DIR)
+  mark_as_advanced(FFMPEG_LIBAVCODEC)
+  mark_as_advanced(FFMPEG_LIBAVFORMAT)
+  mark_as_advanced(FFMPEG_LIBAVUTIL)
+endif()
+
+# Translate library into library directory
+if(FFMPEG_LIBAVCODEC)
+  unset(FFMPEG_LIBRARY_DIR CACHE)
+  get_filename_component(FFMPEG_LIBRARY_DIR "${FFMPEG_LIBAVCODEC}" PATH)
+  set(FFMPEG_LIBRARY_DIR "${FFMPEG_LIBRARY_DIR}" CACHE PATH "The path to libffmpeg's library directory.") # Library path
+endif()
+
+set(FFMPEG_LIBRARIES)
+if(FFMPEG_LIBAVCODEC)
+  list(APPEND FFMPEG_LIBRARIES "${FFMPEG_LIBAVCODEC}")
+endif()
+if(FFMPEG_LIBAVFORMAT)
+  list(APPEND FFMPEG_LIBRARIES "${FFMPEG_LIBAVFORMAT}")
+endif()
+if(FFMPEG_LIBAVUTIL)
+  list(APPEND FFMPEG_LIBRARIES "${FFMPEG_LIBAVUTIL}")
+endif()
+
+mark_as_advanced(FFMPEG_LIBRARY_DIR)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(FFMPEG DEFAULT_MSG FFMPEG_LIBRARIES FFMPEG_LIBAVCODEC FFMPEG_LIBAVFORMAT FFMPEG_LIBAVUTIL FFMPEG_INCLUDE_DIR FFMPEG_LIBRARY_DIR)

+ 52 - 0
cmake/modules/FindSWResample.cmake

@@ -0,0 +1,52 @@
+# Filename: FindSWResample.cmake
+# Author: CFSworks (10 Apr, 2014)
+#
+# Usage:
+#   find_package(SWResample [REQUIRED] [QUIET])
+#
+# Once done this will define:
+#   SWRESAMPLE_FOUND       - system has ffmpeg's libswresample
+#   SWRESAMPLE_INCLUDE_DIR - the libswresample include directory
+#   SWRESAMPLE_LIBRARY     - the path to the library binary
+#
+
+if(NOT SWRESAMPLE_INCLUDE_DIR OR NOT SWRESAMPLE_LIBRARY)
+	# Find the libswresample include files
+	find_path(SWRESAMPLE_INCLUDE_DIR
+    NAMES "libswresample/swresample.h"
+		PATHS "/usr/include"
+		      "/usr/local/include"
+		      "/sw/include"
+		      "/opt/include"
+		      "/opt/local/include"
+		      "/opt/csw/include"
+		PATH_SUFFIXES "libav" "ffmpeg"
+	)
+
+	# Find the libswresample library
+  find_library(SWRESAMPLE_LIBRARY
+		NAMES "swresample"
+		PATHS "/usr"
+		      "/usr/local"
+		      "/usr/freeware"
+		      "/sw"
+		      "/opt"
+		      "/opt/csw"
+		PATH_SUFFIXES "lib" "lib32" "lib64"
+	)
+
+	mark_as_advanced(SWRESAMPLE_INCLUDE_DIR)
+  mark_as_advanced(SWRESAMPLE_LIBRARY)
+endif()
+
+# Translate library into library directory
+if(SWRESAMPLE_LIBRARY)
+  unset(SWRESAMPLE_LIBRARY_DIR CACHE)
+  get_filename_component(SWRESAMPLE_LIBRARY_DIR "${SWRESAMPLE_LIBRARY}" PATH)
+  set(SWRESAMPLE_LIBRARY_DIR "${SWRESAMPLE_LIBRARY_DIR}" CACHE PATH "The path to libffmpeg's library directory.") # Library path
+endif()
+
+mark_as_advanced(SWRESAMPLE_LIBRARY_DIR)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(SWResample DEFAULT_MSG SWRESAMPLE_LIBRARY SWRESAMPLE_INCLUDE_DIR SWRESAMPLE_LIBRARY_DIR)

+ 52 - 0
cmake/modules/FindSWScale.cmake

@@ -0,0 +1,52 @@
+# Filename: FindSWScale.cmake
+# Author: CFSworks (10 Apr, 2014)
+#
+# Usage:
+#   find_package(SWScale [REQUIRED] [QUIET])
+#
+# Once done this will define:
+#   SWSCALE_FOUND       - system has ffmpeg's libswscale
+#   SWSCALE_INCLUDE_DIR - the libswscale include directory
+#   SWSCALE_LIBRARY     - the path to the library binary
+#
+
+if(NOT SWSCALE_INCLUDE_DIR OR NOT SWSCALE_LIBRARY)
+	# Find the libswscale include files
+	find_path(SWSCALE_INCLUDE_DIR
+    NAMES "libswscale/swscale.h"
+		PATHS "/usr/include"
+		      "/usr/local/include"
+		      "/sw/include"
+		      "/opt/include"
+		      "/opt/local/include"
+		      "/opt/csw/include"
+		PATH_SUFFIXES "libav" "ffmpeg"
+	)
+
+	# Find the libswscale library
+  find_library(SWSCALE_LIBRARY
+		NAMES "swscale"
+		PATHS "/usr"
+		      "/usr/local"
+		      "/usr/freeware"
+		      "/sw"
+		      "/opt"
+		      "/opt/csw"
+		PATH_SUFFIXES "lib" "lib32" "lib64"
+	)
+
+	mark_as_advanced(SWSCALE_INCLUDE_DIR)
+  mark_as_advanced(SWSCALE_LIBRARY)
+endif()
+
+# Translate library into library directory
+if(SWSCALE_LIBRARY)
+  unset(SWSCALE_LIBRARY_DIR CACHE)
+  get_filename_component(SWSCALE_LIBRARY_DIR "${SWSCALE_LIBRARY}" PATH)
+  set(SWSCALE_LIBRARY_DIR "${SWSCALE_LIBRARY_DIR}" CACHE PATH "The path to libffmpeg's library directory.") # Library path
+endif()
+
+mark_as_advanced(SWSCALE_LIBRARY_DIR)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(SWSCALE DEFAULT_MSG SWSCALE_LIBRARY SWSCALE_INCLUDE_DIR SWSCALE_LIBRARY_DIR)

+ 1 - 1
direct/CMakeLists.txt

@@ -32,7 +32,7 @@ if(HAVE_PYTHON)
     install(
     install(
       DIRECTORY "src/${dir}"
       DIRECTORY "src/${dir}"
       DESTINATION "${PYTHON_LIB_INSTALL_DIR}/direct"
       DESTINATION "${PYTHON_LIB_INSTALL_DIR}/direct"
-      PATTERN "*.py")
+      FILES_MATCHING PATTERN "*.py")
   endforeach()
   endforeach()
 
 
   # We also need an __init__.py file, which we have to generate:
   # We also need an __init__.py file, which we have to generate:

+ 2 - 2
direct/src/dcparser/CMakeLists.txt

@@ -46,10 +46,10 @@ set(P3DCPARSER_PARSER_SOURCES
     dcLexer.cxx)
     dcLexer.cxx)
 
 
 composite_sources(p3dcparser P3DCPARSER_SOURCES)
 composite_sources(p3dcparser P3DCPARSER_SOURCES)
-add_library(p3dcparser ${P3DCPARSER_SOURCES} ${P3DCPARSER_HEADERS}
+add_library(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES}
   ${P3DCPARSER_PARSER_SOURCES})
   ${P3DCPARSER_PARSER_SOURCES})
 set_target_properties(p3dcparser PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA)
 set_target_properties(p3dcparser PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA)
 target_link_libraries(p3dcparser p3directbase p3express p3pstatclient p3prc)
 target_link_libraries(p3dcparser p3directbase p3express p3pstatclient p3prc)
-target_interrogate(p3dcparser ${P3DCPARSER_SOURCES} ${P3DCPARSER_HEADERS})
+target_interrogate(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES})
 
 
 install(TARGETS p3dcparser DESTINATION lib)
 install(TARGETS p3dcparser DESTINATION lib)

+ 1 - 1
direct/src/directbase/CMakeLists.txt

@@ -7,7 +7,7 @@ set(P3DIRECTBASE_HEADERS
 )
 )
 
 
 # Not worth compositing sources, there's really only one.
 # Not worth compositing sources, there's really only one.
-add_library(p3directbase ${P3DIRECTBASE_SOURCES} ${P3DIRECTBASE_HEADERS})
+add_library(p3directbase ${P3DIRECTBASE_HEADERS} ${P3DIRECTBASE_SOURCES})
 target_link_libraries(p3directbase p3pandabase)
 target_link_libraries(p3directbase p3pandabase)
 
 
 install(TARGETS p3directbase DESTINATION lib)
 install(TARGETS p3directbase DESTINATION lib)

+ 4 - 4
direct/src/directtools/DirectSelection.py

@@ -83,7 +83,7 @@ class SelectedNodePaths(DirectObject):
                     break
                     break
 
 
         # Get this pointer
         # Get this pointer
-        id = nodePath.id()
+        id = nodePath.get_key()
         # First see if its already in the selected dictionary
         # First see if its already in the selected dictionary
         dnp = self.getSelectedDict(id)
         dnp = self.getSelectedDict(id)
         # If so, deselect it
         # If so, deselect it
@@ -104,7 +104,7 @@ class SelectedNodePaths(DirectObject):
                 # Show its bounding box
                 # Show its bounding box
                 dnp.highlight(fRecompute = 0)
                 dnp.highlight(fRecompute = 0)
             # Add it to the selected dictionary
             # Add it to the selected dictionary
-            self.selectedDict[dnp.id()] = dnp
+            self.selectedDict[dnp.get_key()] = dnp
             self.selectedList.append(dnp) # [gjeon]
             self.selectedList.append(dnp) # [gjeon]
 
 
         # And update last
         # And update last
@@ -117,7 +117,7 @@ class SelectedNodePaths(DirectObject):
     def deselect(self, nodePath):
     def deselect(self, nodePath):
         """ Deselect the specified node path """
         """ Deselect the specified node path """
         # Get this pointer
         # Get this pointer
-        id = nodePath.id()
+        id = nodePath.get_key()
         # See if it is in the selected dictionary
         # See if it is in the selected dictionary
         dnp = self.getSelectedDict(id)
         dnp = self.getSelectedDict(id)
         if dnp:
         if dnp:
@@ -240,7 +240,7 @@ class SelectedNodePaths(DirectObject):
 
 
     def getDirectNodePath(self, nodePath):
     def getDirectNodePath(self, nodePath):
         # Get this pointer
         # Get this pointer
-        id = nodePath.id()
+        id = nodePath.get_key()
         # First check selected dict
         # First check selected dict
         dnp = self.getSelectedDict(id)
         dnp = self.getSelectedDict(id)
         if dnp:
         if dnp:

+ 1 - 3
direct/src/distributed/MsgTypes.py

@@ -107,9 +107,7 @@ MsgName2Id = {
 MsgId2Names = invertDictLossless(MsgName2Id)
 MsgId2Names = invertDictLossless(MsgName2Id)
     
     
 # put msg names in module scope, assigned to msg value
 # put msg names in module scope, assigned to msg value
-for name, value in MsgName2Id.items():
-    exec('%s = %s' % (name, value))
-del name, value
+globals().update(MsgName2Id)
 
 
 # These messages are ignored when the client is headed to the quiet zone
 # These messages are ignored when the client is headed to the quiet zone
 QUIET_ZONE_IGNORED_LIST = [
 QUIET_ZONE_IGNORED_LIST = [

+ 1 - 3
direct/src/distributed/MsgTypesCMU.py

@@ -26,6 +26,4 @@ MsgName2Id = {
 MsgId2Names = invertDictLossless(MsgName2Id)
 MsgId2Names = invertDictLossless(MsgName2Id)
     
     
 # put msg names in module scope, assigned to msg value
 # put msg names in module scope, assigned to msg value
-for name, value in MsgName2Id.items():
-    exec('%s = %s' % (name, value))
-del name, value
+globals().update(MsgName2Id)

+ 3 - 4
direct/src/fsm/FSM.py

@@ -10,7 +10,6 @@ from direct.directnotify import DirectNotifyGlobal
 from direct.showbase import PythonUtil
 from direct.showbase import PythonUtil
 from direct.stdpy.threading import RLock
 from direct.stdpy.threading import RLock
 import types
 import types
-import string
 
 
 class FSMException(Exception):
 class FSMException(Exception):
     pass
     pass
@@ -364,7 +363,7 @@ class FSM(DirectObject):
             # If self.defaultTransitions is None, it means to accept
             # If self.defaultTransitions is None, it means to accept
             # all requests whose name begins with a capital letter.
             # all requests whose name begins with a capital letter.
             # These are direct requests to a particular state.
             # These are direct requests to a particular state.
-            if request[0] in string.uppercase:
+            if request[0].isupper():
                 return (request,) + args
                 return (request,) + args
         else:
         else:
             # If self.defaultTransitions is not None, it is a map of
             # If self.defaultTransitions is not None, it is a map of
@@ -381,7 +380,7 @@ class FSM(DirectObject):
             # to request a direct state transition (capital letter
             # to request a direct state transition (capital letter
             # request) not listed in defaultTransitions and not
             # request) not listed in defaultTransitions and not
             # handled by an earlier filter.
             # handled by an earlier filter.
-            if request[0] in string.uppercase:
+            if request[0].isupper():
                 raise RequestDenied, "%s (from state: %s)" % (request, self.state)
                 raise RequestDenied, "%s (from state: %s)" % (request, self.state)
 
 
         # In either case, we quietly ignore unhandled command
         # In either case, we quietly ignore unhandled command
@@ -392,7 +391,7 @@ class FSM(DirectObject):
     def filterOff(self, request, args):
     def filterOff(self, request, args):
         """From the off state, we can always go directly to any other
         """From the off state, we can always go directly to any other
         state."""
         state."""
-        if request[0] in string.uppercase:
+        if request[0].isupper():
             return (request,) + args
             return (request,) + args
         return self.defaultFilter(request, args)
         return self.defaultFilter(request, args)
         
         

+ 22 - 44
direct/src/gui/DirectGuiBase.py

@@ -14,7 +14,7 @@ from direct.task import Task
 from direct.showbase import ShowBase
 from direct.showbase import ShowBase
 from direct.showbase.PythonUtil import recordCreationStackStr
 from direct.showbase.PythonUtil import recordCreationStackStr
 from pandac.PandaModules import PStatCollector
 from pandac.PandaModules import PStatCollector
-import string, types
+import types
 
 
 guiObjectCollector = PStatCollector("Client::GuiObjects")
 guiObjectCollector = PStatCollector("Client::GuiObjects")
 
 
@@ -192,9 +192,9 @@ class DirectGuiBase(DirectObject.DirectObject):
 
 
         # optimisations:
         # optimisations:
         optionInfo = self._optionInfo
         optionInfo = self._optionInfo
-        optionInfo_has_key = optionInfo.has_key
+        optionInfo_has_key = optionInfo.__contains__
         keywords = self._constructorKeywords
         keywords = self._constructorKeywords
-        keywords_has_key = keywords.has_key
+        keywords_has_key = keywords.__contains__
         FUNCTION = DGG._OPT_FUNCTION
         FUNCTION = DGG._OPT_FUNCTION
 
 
         for name, default, function in optionDefs:
         for name, default, function in optionDefs:
@@ -251,7 +251,7 @@ class DirectGuiBase(DirectObject.DirectObject):
                     # This keyword argument has not been used.  If it
                     # This keyword argument has not been used.  If it
                     # does not refer to a dynamic group, mark it as
                     # does not refer to a dynamic group, mark it as
                     # unused.
                     # unused.
-                    index = string.find(name, '_')
+                    index = name.find('_')
                     if index < 0 or name[:index] not in self._dynamicGroups:
                     if index < 0 or name[:index] not in self._dynamicGroups:
                         unusedOptions.append(name)
                         unusedOptions.append(name)
             self._constructorKeywords = {}
             self._constructorKeywords = {}
@@ -260,7 +260,7 @@ class DirectGuiBase(DirectObject.DirectObject):
                     text = 'Unknown option "'
                     text = 'Unknown option "'
                 else:
                 else:
                     text = 'Unknown options "'
                     text = 'Unknown options "'
-                raise KeyError, text + string.join(unusedOptions, ', ') + \
+                raise KeyError, text + ', '.join(unusedOptions) + \
                         '" for ' + myClass.__name__
                         '" for ' + myClass.__name__
             # Can now call post init func
             # Can now call post init func
             self.postInitialiseFunc()
             self.postInitialiseFunc()
@@ -326,11 +326,11 @@ class DirectGuiBase(DirectObject.DirectObject):
 
 
         # optimizations:
         # optimizations:
         optionInfo = self._optionInfo
         optionInfo = self._optionInfo
-        optionInfo_has_key = optionInfo.has_key
+        optionInfo_has_key = optionInfo.__contains__
         componentInfo = self.__componentInfo
         componentInfo = self.__componentInfo
-        componentInfo_has_key = componentInfo.has_key
+        componentInfo_has_key = componentInfo.__contains__
         componentAliases = self.__componentAliases
         componentAliases = self.__componentAliases
-        componentAliases_has_key = componentAliases.has_key
+        componentAliases_has_key = componentAliases.__contains__
         VALUE = DGG._OPT_VALUE
         VALUE = DGG._OPT_VALUE
         FUNCTION = DGG._OPT_FUNCTION
         FUNCTION = DGG._OPT_FUNCTION
 
 
@@ -345,7 +345,7 @@ class DirectGuiBase(DirectObject.DirectObject):
         # component and whose values are a dictionary of options and
         # component and whose values are a dictionary of options and
         # values for the component.
         # values for the component.
         indirectOptions = {}
         indirectOptions = {}
-        indirectOptions_has_key = indirectOptions.has_key
+        indirectOptions_has_key = indirectOptions.__contains__
 
 
         for option, value in kw.items():
         for option, value in kw.items():
             if optionInfo_has_key(option):
             if optionInfo_has_key(option):
@@ -361,7 +361,7 @@ class DirectGuiBase(DirectObject.DirectObject):
                 optionInfo[option][VALUE] = value
                 optionInfo[option][VALUE] = value
                 directOptions.append(option)
                 directOptions.append(option)
             else:
             else:
-                index = string.find(option, '_')
+                index = option.find('_')
                 if index >= 0:
                 if index >= 0:
                     # This option may be of the form <component>_<option>.
                     # This option may be of the form <component>_<option>.
                     # e.g. if alias ('efEntry', 'entryField_entry')
                     # e.g. if alias ('efEntry', 'entryField_entry')
@@ -420,8 +420,8 @@ class DirectGuiBase(DirectObject.DirectObject):
 
 
         # Call the configure methods for any components.
         # Call the configure methods for any components.
         # Pass in the dictionary of keyword/values created above
         # Pass in the dictionary of keyword/values created above
-        map(apply, indirectOptions.keys(),
-                ((),) * len(indirectOptions), indirectOptions.values())
+        for func, options in indirectOptions.items():
+            func(**options)
 
 
         # Call the configuration callback function for each option.
         # Call the configuration callback function for each option.
         for option in directOptions:
         for option in directOptions:
@@ -432,7 +432,7 @@ class DirectGuiBase(DirectObject.DirectObject):
 
 
     # Allow index style references
     # Allow index style references
     def __setitem__(self, key, value):
     def __setitem__(self, key, value):
-        apply(self.configure, (), {key: value})
+        self.configure(**{key: value})
 
 
     def cget(self, option):
     def cget(self, option):
         """
         """
@@ -442,7 +442,7 @@ class DirectGuiBase(DirectObject.DirectObject):
         if option in self._optionInfo:
         if option in self._optionInfo:
             return self._optionInfo[option][DGG._OPT_VALUE]
             return self._optionInfo[option][DGG._OPT_VALUE]
         else:
         else:
-            index = string.find(option, '_')
+            index = option.find('_')
             if index >= 0:
             if index >= 0:
                 component = option[:index]
                 component = option[:index]
                 componentOption = option[(index + 1):]
                 componentOption = option[(index + 1):]
@@ -494,7 +494,7 @@ class DirectGuiBase(DirectObject.DirectObject):
 
 
         for alias, component in componentAliases:
         for alias, component in componentAliases:
             # Create aliases to the component and its sub-components.
             # Create aliases to the component and its sub-components.
-            index = string.find(component, '_')
+            index = component.find('_')
             if index < 0:
             if index < 0:
                 # Just a shorter name for one of this widget's components
                 # Just a shorter name for one of this widget's components
                 self.__componentAliases[alias] = (component, None)
                 self.__componentAliases[alias] = (component, None)
@@ -529,7 +529,7 @@ class DirectGuiBase(DirectObject.DirectObject):
             # keyword argument as being used, but do not remove it
             # keyword argument as being used, but do not remove it
             # since it may be required when creating another
             # since it may be required when creating another
             # component.
             # component.
-            index = string.find(option, '_')
+            index = option.find('_')
             if index >= 0 and componentGroup == option[:index]:
             if index >= 0 and componentGroup == option[:index]:
                 rest = option[(index + 1):]
                 rest = option[(index + 1):]
                 kw[rest] = keywords[option][0]
                 kw[rest] = keywords[option][0]
@@ -559,7 +559,7 @@ class DirectGuiBase(DirectObject.DirectObject):
             # single tuple argument.
             # single tuple argument.
             widgetArgs = widgetArgs[0]
             widgetArgs = widgetArgs[0]
         # Create the widget
         # Create the widget
-        widget = apply(widgetClass, widgetArgs, kw)
+        widget = widgetClass(*widgetArgs, **kw)
         componentClass = widget.__class__.__name__
         componentClass = widget.__class__.__name__
         self.__componentInfo[componentName] = (widget, widget.configure,
         self.__componentInfo[componentName] = (widget, widget.configure,
                 componentClass, widget.cget, componentGroup)
                 componentClass, widget.cget, componentGroup)
@@ -572,7 +572,7 @@ class DirectGuiBase(DirectObject.DirectObject):
         # widget components directly.
         # widget components directly.
 
 
         # Find the main component and any subcomponents
         # Find the main component and any subcomponents
-        index = string.find(name, '_')
+        index = name.find('_')
         if index < 0:
         if index < 0:
             component = name
             component = name
             remainingComponents = None
             remainingComponents = None
@@ -748,35 +748,13 @@ class DirectGuiWidget(DirectGuiBase, NodePath):
         self.assign(parent.attachNewNode(self.guiItem, self['sortOrder']))
         self.assign(parent.attachNewNode(self.guiItem, self['sortOrder']))
         # Update pose to initial values
         # Update pose to initial values
         if self['pos']:
         if self['pos']:
-            pos = self['pos']
-            # Can either be a VBase3 or a tuple of 3 values
-            if isinstance(pos, VBase3):
-                self.setPos(pos)
-            else:
-                apply(self.setPos, pos)
+            self.setPos(self['pos'])
         if self['hpr']:
         if self['hpr']:
-            hpr = self['hpr']
-            # Can either be a VBase3 or a tuple of 3 values
-            if isinstance(hpr, VBase3):
-                self.setHpr(hpr)
-            else:
-                apply(self.setHpr, hpr)
+            self.setHpr(self['hpr'])
         if self['scale']:
         if self['scale']:
-            scale = self['scale']
-            # Can either be a VBase3 or a tuple of 3 values
-            if (isinstance(scale, VBase3) or
-                (type(scale) == types.IntType) or
-                (type(scale) == types.FloatType)):
-                self.setScale(scale)
-            else:
-                apply(self.setScale, scale)
+            self.setScale(self['scale'])
         if self['color']:
         if self['color']:
-            color = self['color']
-            # Can either be a VBase4 or a tuple of 4 values
-            if (isinstance(color, VBase4)):
-                self.setColor(color)
-            else:
-                apply(self.setColor, color)
+            self.setColor(self['color'])
         # Initialize names
         # Initialize names
         # Putting the class name in helps with debugging.
         # Putting the class name in helps with debugging.
         self.setName("%s-%s" % (self.__class__.__name__, self.guiId))
         self.setName("%s-%s" % (self.__class__.__name__, self.guiId))

+ 2 - 3
direct/src/gui/OnscreenGeom.py

@@ -113,8 +113,7 @@ class OnscreenGeom(DirectObject, NodePath):
         for option, value in kw.items():
         for option, value in kw.items():
             # Use option string to access setter function
             # Use option string to access setter function
             try:
             try:
-                setter = eval('self.set' +
-                              string.upper(option[0]) + option[1:])
+                setter = getattr(self, 'set' + option[0].upper() + option[1:])
                 if (((setter == self.setPos) or
                 if (((setter == self.setPos) or
                      (setter == self.setHpr) or
                      (setter == self.setHpr) or
                      (setter == self.setScale)) and
                      (setter == self.setScale)) and
@@ -133,7 +132,7 @@ class OnscreenGeom(DirectObject, NodePath):
     def cget(self, option):
     def cget(self, option):
         # Get current configuration setting.
         # Get current configuration setting.
         # This is for compatibility with DirectGui functions
         # This is for compatibility with DirectGui functions
-        getter = eval('self.get' + string.upper(option[0]) + option[1:])
+        getter = getattr(self, 'get' + option[0].upper() + option[1:])
         return getter()
         return getter()
 
 
     # Allow index style refererences
     # Allow index style refererences

+ 2 - 3
direct/src/gui/OnscreenImage.py

@@ -130,8 +130,7 @@ class OnscreenImage(DirectObject, NodePath):
         for option, value in kw.items():
         for option, value in kw.items():
             # Use option string to access setter function
             # Use option string to access setter function
             try:
             try:
-                setter = eval('self.set' +
-                              string.upper(option[0]) + option[1:])
+                setter = getattr(self, 'set' + option[0].upper() + option[1:])
                 if (((setter == self.setPos) or
                 if (((setter == self.setPos) or
                      (setter == self.setHpr) or
                      (setter == self.setHpr) or
                      (setter == self.setScale)) and
                      (setter == self.setScale)) and
@@ -150,7 +149,7 @@ class OnscreenImage(DirectObject, NodePath):
     def cget(self, option):
     def cget(self, option):
         # Get current configuration setting.
         # Get current configuration setting.
         # This is for compatibility with DirectGui functions
         # This is for compatibility with DirectGui functions
-        getter = eval('self.get' + string.upper(option[0]) + option[1:])
+        getter = getattr(self, 'get' + option[0].upper() + option[1:])
         return getter()
         return getter()
 
 
     # Allow index style refererences
     # Allow index style refererences

+ 2 - 3
direct/src/gui/OnscreenText.py

@@ -381,8 +381,7 @@ class OnscreenText(DirectObject, NodePath):
         for option, value in kw.items():
         for option, value in kw.items():
             # Use option string to access setter function
             # Use option string to access setter function
             try:
             try:
-                setter = eval('self.set' +
-                              string.upper(option[0]) + option[1:])
+                setter = getattr(self, 'set' + option[0].upper() + option[1:])
                 if setter == self.setPos:
                 if setter == self.setPos:
                     setter(value[0], value[1])
                     setter(value[0], value[1])
                 else:
                 else:
@@ -397,7 +396,7 @@ class OnscreenText(DirectObject, NodePath):
     def cget(self, option):
     def cget(self, option):
         # Get current configuration setting.
         # Get current configuration setting.
         # This is for compatibility with DirectGui functions
         # This is for compatibility with DirectGui functions
-        getter = eval('self.get' + string.upper(option[0]) + option[1:])
+        getter = getattr(self, 'get' + option[0].upper() + option[1:])
         return getter()
         return getter()
 
 
     def setAlign(self, align):
     def setAlign(self, align):

+ 6 - 6
direct/src/leveleditor/ObjectMgrBase.py

@@ -189,9 +189,9 @@ class ObjectMgrBase:
                         if funcName.startswith('.'):
                         if funcName.startswith('.'):
                             # when it's using default objectHandler
                             # when it's using default objectHandler
                             if self.editor:
                             if self.editor:
-                                func = Functor(eval("self.editor.objectHandler%s"%funcName))
+                                func = Functor(getattr(self.editor, "objectHandler%s"%funcName))
                             else: # when loaded outside of LE
                             else: # when loaded outside of LE
-                                func = Functor(eval("base.objectHandler%s"%funcName))                        
+                                func = Functor(getattr(base, "objectHandler%s"%funcName))                        
                         else:
                         else:
                             # when it's not using default objectHandler, whole name of the handling obj
                             # when it's not using default objectHandler, whole name of the handling obj
                             # should be included in function name
                             # should be included in function name
@@ -686,11 +686,11 @@ class ObjectMgrBase:
                 if type(funcName) == types.StringType:
                 if type(funcName) == types.StringType:
                     if funcName.startswith('.'):
                     if funcName.startswith('.'):
                         if self.editor:
                         if self.editor:
-                            func = Functor(eval("self.editor.objectHandler%s"%funcName), **kwargs)
-                            undoFunc = Functor(eval("self.editor.objectHandler%s"%funcName), **undoKwargs)
+                            func = Functor(getattr(self.editor, "objectHandler%s"%funcName), **kwargs)
+                            undoFunc = Functor(getattr(self.editor, "objectHandler%s"%funcName), **undoKwargs)
                         else: # when loaded outside of LE
                         else: # when loaded outside of LE
-                            func = Functor(eval("base.objectHandler%s"%funcName), **kwargs)
-                            undoFunc = Functor(eval("base.objectHandler%s"%funcName), **undoKwargs)                    
+                            func = Functor(getattr(base, "objectHandler%s"%funcName), **kwargs)
+                            undoFunc = Functor(getattr(base, ".objectHandler%s"%funcName), **undoKwargs)                    
                     else:
                     else:
                         func = Functor(eval(funcName), **kwargs)
                         func = Functor(eval(funcName), **kwargs)
                         undoFunc = Functor(eval(funcName), **undoKwargs)
                         undoFunc = Functor(eval(funcName), **undoKwargs)

+ 6 - 0
direct/src/p3d/thirdparty.pdef

@@ -147,3 +147,9 @@ class box2d(package):
     require('panda3d')
     require('panda3d')
 
 
     module('Box2D', required = True)
     module('Box2D', required = True)
+
+class pyglet(package):
+    config(display_name = "pyglet")
+    require('panda3d')
+
+    module('pyglet', required = True)

+ 2 - 2
direct/src/particles/Particles.py

@@ -354,7 +354,7 @@ class Particles(ParticleSystem):
                     else:
                     else:
                         file.write(targ+'.renderer.setColorBlendMode(ColorBlendAttrib.%s)\n' % cbmLut[cbMode])
                         file.write(targ+'.renderer.setColorBlendMode(ColorBlendAttrib.%s)\n' % cbmLut[cbMode])
             cim = self.renderer.getColorInterpolationManager()
             cim = self.renderer.getColorInterpolationManager()
-            segIdList = eval('['+cim.getSegmentIdList().replace(' ',', ')+']')
+            segIdList = [int(seg) for seg in cim.getSegmentIdList().split()]
             for sid in segIdList:
             for sid in segIdList:
                 seg = cim.getSegment(sid)
                 seg = cim.getSegment(sid)
                 if seg.isEnabled():
                 if seg.isEnabled():
@@ -457,7 +457,7 @@ class Particles(ParticleSystem):
                     else:
                     else:
                         file.write(targ+'.renderer.setColorBlendMode(ColorBlendAttrib.%s)\n' % cbmLut[cbMode])
                         file.write(targ+'.renderer.setColorBlendMode(ColorBlendAttrib.%s)\n' % cbmLut[cbMode])
             cim = self.renderer.getColorInterpolationManager()
             cim = self.renderer.getColorInterpolationManager()
-            segIdList = eval('['+cim.getSegmentIdList().replace(' ',', ')+']')
+            segIdList = [int(seg) for seg in cim.getSegmentIdList().split()]
             for sid in segIdList:
             for sid in segIdList:
                 seg = cim.getSegment(sid)
                 seg = cim.getSegment(sid)
                 if seg.isEnabled():
                 if seg.isEnabled():

+ 1 - 0
direct/src/plugin/handleStreamBuf.cxx

@@ -22,6 +22,7 @@
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <errno.h>
+#include <unistd.h>
 #endif  // _WIN32
 #endif  // _WIN32
 
 
 #if !defined(_WIN32) && !defined(__APPLE__) && !defined(__FreeBSD__)
 #if !defined(_WIN32) && !defined(__APPLE__) && !defined(__FreeBSD__)

+ 1 - 2
direct/src/plugin/mkdir_complete.cxx

@@ -24,10 +24,9 @@
 #include <sys/stat.h>  // for mkdir()
 #include <sys/stat.h>  // for mkdir()
 #include <errno.h>
 #include <errno.h>
 #include <string.h>     // strerror()
 #include <string.h>     // strerror()
+#include <unistd.h>
 #endif
 #endif
 
 
-
-
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: get_dirname
 //     Function: get_dirname
 //  Description: Returns the directory component of the indicated
 //  Description: Returns the directory component of the indicated

+ 1 - 0
direct/src/plugin/p3dAuthSession.cxx

@@ -28,6 +28,7 @@
 #include <sys/select.h>
 #include <sys/select.h>
 #include <signal.h>
 #include <signal.h>
 #include <dlfcn.h>
 #include <dlfcn.h>
+#include <unistd.h>
 #endif
 #endif
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 4 - 0
direct/src/plugin/p3dHost.cxx

@@ -22,6 +22,10 @@
 
 
 #include <algorithm>
 #include <algorithm>
 
 
+#ifndef _WIN32
+#include <unistd.h>
+#endif
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: P3DHost::Constructor
 //     Function: P3DHost::Constructor
 //       Access: Private
 //       Access: Private

+ 1 - 4
direct/src/showbase/ElementTree.py

@@ -749,10 +749,7 @@ def _encode(s, encoding):
     except AttributeError:
     except AttributeError:
         return s # 1.5.2: assume the string uses the right encoding
         return s # 1.5.2: assume the string uses the right encoding
 
 
-if sys.version[:3] == "1.5":
-    _escape = re.compile(r"[&<>\"\x80-\xff]+") # 1.5.2
-else:
-    _escape = re.compile(eval(r'u"[&<>\"\u0080-\uffff]+"'))
+_escape = re.compile(u"[&<>\"\u0080-\uffff]+")
 
 
 _escape_map = {
 _escape_map = {
     "&": "&amp;",
     "&": "&amp;",

+ 1 - 1
direct/src/showbase/PythonUtil.py

@@ -4188,7 +4188,7 @@ def unescapeHtmlString(s):
             char = ' '
             char = ' '
         elif char == '%':
         elif char == '%':
             if i < (len(s)-2):
             if i < (len(s)-2):
-                num = eval('0x' + s[i+1:i+3])
+                num = int(s[i+1:i+3], 16)
                 char = chr(num)
                 char = chr(num)
                 i += 2
                 i += 2
         i += 1
         i += 1

+ 3 - 2
direct/src/showbase/extend_frozen.c

@@ -1,3 +1,4 @@
+#define PY_SSIZE_T_CLEAN
 #include <Python.h>
 #include <Python.h>
 
 
 #ifdef _WIN32
 #ifdef _WIN32
@@ -105,7 +106,7 @@ py_extend_frozen_modules(PyObject *self, PyObject *args) {
     PyObject *tuple;
     PyObject *tuple;
     const char *name;
     const char *name;
     const char *code;
     const char *code;
-    int size;
+    Py_ssize_t size;
 
 
     tuple = PySequence_GetItem(list, i);
     tuple = PySequence_GetItem(list, i);
     if (!PyArg_ParseTuple(tuple, "ss#", &name, &code, &size)) {
     if (!PyArg_ParseTuple(tuple, "ss#", &name, &code, &size)) {
@@ -178,7 +179,7 @@ py_get_frozen_module_code(PyObject *self, PyObject *args) {
     if (strcmp(PyImport_FrozenModules[i].name, name) == 0) {
     if (strcmp(PyImport_FrozenModules[i].name, name) == 0) {
       int is_package = (PyImport_FrozenModules[i].size < 0);
       int is_package = (PyImport_FrozenModules[i].size < 0);
       return Py_BuildValue("(s#i)", PyImport_FrozenModules[i].code,
       return Py_BuildValue("(s#i)", PyImport_FrozenModules[i].code,
-                           abs(PyImport_FrozenModules[i].size),
+                           (Py_ssize_t) abs(PyImport_FrozenModules[i].size),
                            is_package);
                            is_package);
     }
     }
     ++i;
     ++i;

+ 20 - 2
dtool/Config.cmake

@@ -591,10 +591,22 @@ find_package(ZLIB)
 package_option(ZLIB DEFAULT ON
 package_option(ZLIB DEFAULT ON
   "Enables support for compression of Panda assets.")
   "Enables support for compression of Panda assets.")
 
 
+# Is FFMPEG installed, and where?
+find_package(FFMPEG)
+find_package(SWScale)
+find_package(SWResample)
+
+package_option(FFMPEG
+  "Enables support for audio- and video-decoding using the FFMPEG library.")
+package_option(SWSCALE
+  "Enables support for FFMPEG's libswscale for video rescaling.")
+package_option(SWRESAMPLE
+  "Enables support for FFMPEG's libresample for audio resampling.")
+
 # Is ODE installed, and where?
 # Is ODE installed, and where?
 find_package(ODE)
 find_package(ODE)
 
 
-package_option(ODE DEFAULT ON
+package_option(ODE
   "Enables support for ridid-body physics using the Open Dynamics Engine.")
   "Enables support for ridid-body physics using the Open Dynamics Engine.")
 
 
 # Is OpenGL installed, and where?
 # Is OpenGL installed, and where?
@@ -608,7 +620,7 @@ package_option(GL "Enable OpenGL support.")
 # libraries appropriate to the version you want to compile against.
 # libraries appropriate to the version you want to compile against.
 set(MIN_GL_VERSION "1 1" CACHE STRING
 set(MIN_GL_VERSION "1 1" CACHE STRING
   "The variable is the major, minor version of OpenGL, separated by a
   "The variable is the major, minor version of OpenGL, separated by a
-space (instead of a dot).  Thus, "1 1" means OpenGL version 1.1.
+space (instead of a dot).  Thus, \"1 1\" means OpenGL version 1.1.
 
 
 This defines the minimum runtime version of OpenGL that Panda will
 This defines the minimum runtime version of OpenGL that Panda will
 require. Setting it to a higher version will compile in hard
 require. Setting it to a higher version will compile in hard
@@ -788,6 +800,12 @@ option(HAVE_EGG
 avoid building this, unless you really want to make a low-footprint
 avoid building this, unless you really want to make a low-footprint
 build (such as, for instance, for the iPhone)." ON)
 build (such as, for instance, for the iPhone)." ON)
 
 
+option(HAVE_AUDIO
+  "Do you want to build the audio interface?" ON)
+
+option(DO_PSTATS
+  "Enable the pstats client?" ON)
+
 # These image formats don't require the assistance of a third-party
 # These image formats don't require the assistance of a third-party
 # library to read and write, so there's normally no reason to disable
 # library to read and write, so there's normally no reason to disable
 # them int he build, unless you are looking to reduce the memory footprint.
 # them int he build, unless you are looking to reduce the memory footprint.

+ 0 - 34
dtool/Config.pp

@@ -653,40 +653,6 @@
 // space (instead of a dot).  Thus, "1 1" means OpenGL version 1.1.
 // space (instead of a dot).  Thus, "1 1" means OpenGL version 1.1.
 #define MIN_GL_VERSION 1 1
 #define MIN_GL_VERSION 1 1
 
 
-// Is Mesa installed separately from OpenGL?  Mesa is an open-source
-// software-only OpenGL renderer.  Panda can link with it
-// independently from OpenGL (and if Mesa is built statically, and/or
-// with -DUSE_MGL_NAMESPACE declared to rename gl* to mgl*, it can
-// switch between the system OpenGL implementation and the Mesa
-// implementation at runtime).
-
-// Also, Mesa includes some core libraries (in libOSMesa.so) that
-// allow totally headless rendering, handy if you want to run a
-// renderer as a batch service, and you don't want to insist that a
-// user be logged on to the desktop or otherwise deal with X11 or
-// Windows.
-
-// If you define HAVE_MESA here, and the appropriate paths to headers
-// and libraries, then Panda will build libmesadisplay, which can be
-// used in lieu of libpandagl or libpandadx to do rendering.  However,
-// for most applications, you don't need to do this, since (a) if you
-// have hardware rendering capability, you probably don't want to use
-// Mesa, since it's software-only, and (b) if you don't have hardware
-// rendering, you can install Mesa as the system's OpenGL
-// implementation, so you can just use the normal libpandagl.  You
-// only need to define HAVE_MESA if you want to run totally headless,
-// or if you want to be able to easily switch between Mesa and the
-// system OpenGL implementation at runtime.  If you compiled Mesa with
-// USE_MGL_NAMESPACE defined, define MESA_MGL here.
-#define MESA_IPATH
-#define MESA_LPATH
-#define MESA_LIBS
-#define MESA_MGL
-#defer HAVE_MESA $[libtest $[MESA_LPATH],$[MESA_LIBS]]
-
-// Similar to MIN_GL_VERSION, above.
-#define MIN_MESA_VERSION 1 1
-
 // Do you want to build tinydisplay, a light and fast software
 // Do you want to build tinydisplay, a light and fast software
 // renderer built into Panda, based on TinyGL?  This isn't as
 // renderer built into Panda, based on TinyGL?  This isn't as
 // full-featured as Mesa, but it is many times faster, and in fact
 // full-featured as Mesa, but it is many times faster, and in fact

+ 0 - 13
dtool/LocalSetup.pp

@@ -176,11 +176,6 @@
 #else
 #else
 #print - Did not find X11
 #print - Did not find X11
 #endif
 #endif
-#if $[HAVE_MESA]
-#print + Mesa
-#else
-#print - Did not find Mesa
-#endif
 #if $[HAVE_OPENCV]
 #if $[HAVE_OPENCV]
 #print + OpenCV
 #print + OpenCV
 #else
 #else
@@ -437,14 +432,6 @@ $[cdefine HAVE_ODE]
 /* Define if we have AWESOMIUM installed and want to build for AWESOMIUM.  */
 /* Define if we have AWESOMIUM installed and want to build for AWESOMIUM.  */
 $[cdefine HAVE_AWESOMIUM]
 $[cdefine HAVE_AWESOMIUM]
 
 
-/* Define if we have Mesa installed and want to build mesadisplay.  */
-$[cdefine HAVE_MESA]
-$[cdefine MESA_MGL]
-#if HAVE_MESA
-# define MIN_MESA_VERSION_MAJOR $[word 1,$[MIN_MESA_VERSION]]
-# define MIN_MESA_VERSION_MINOR $[word 2,$[MIN_MESA_VERSION]]
-#endif
-
 /* Define if we have GLX installed and want to build for GLX.  */
 /* Define if we have GLX installed and want to build for GLX.  */
 $[cdefine HAVE_GLX]
 $[cdefine HAVE_GLX]
 
 

+ 0 - 6
dtool/Package.pp

@@ -236,12 +236,6 @@
 #set GLES2_LIBS $[GLES2_LIBS]
 #set GLES2_LIBS $[GLES2_LIBS]
 #set HAVE_GLES2 $[HAVE_GLES2]
 #set HAVE_GLES2 $[HAVE_GLES2]
 
 
-#set MESA_IPATH $[unixfilename $[MESA_IPATH]]
-#set MESA_LPATH $[unixfilename $[MESA_LPATH]]
-#set MESA_LIBS $[MESA_LIBS]
-#set MESA_MGL $[MESA_MGL]
-#set HAVE_MESA $[HAVE_MESA]
-
 #set GLX_IPATH $[unixfilename $[GLX_IPATH]]
 #set GLX_IPATH $[unixfilename $[GLX_IPATH]]
 #set GLX_LPATH $[unixfilename $[GLX_LPATH]]
 #set GLX_LPATH $[unixfilename $[GLX_LPATH]]
 #set HAVE_GLX $[HAVE_GLX]
 #set HAVE_GLX $[HAVE_GLX]

+ 0 - 7
dtool/pptempl/Global.pp

@@ -185,13 +185,6 @@
   #define xcursor_libs $[XCURSOR_LIBS]
   #define xcursor_libs $[XCURSOR_LIBS]
 #endif
 #endif
 
 
-#if $[HAVE_MESA]
-  #define mesa_ipath $[wildcard $[MESA_IPATH]]
-  #define mesa_lpath $[wildcard $[MESA_LPATH]]
-  #define mesa_cflags $[MESA_CFLAGS]
-  #define mesa_libs $[MESA_LIBS]
-#endif
-
 #if $[HAVE_GLX]
 #if $[HAVE_GLX]
   #define glx_ipath $[wildcard $[GLX_IPATH]]
   #define glx_ipath $[wildcard $[GLX_IPATH]]
   #define glx_lpath $[wildcard $[GLX_LPATH]]
   #define glx_lpath $[wildcard $[GLX_LPATH]]

+ 1 - 3
dtool/src/dtoolbase/CMakeLists.txt

@@ -62,8 +62,6 @@ set(P3DTOOLBASE_SOURCES
 composite_sources(p3dtoolbase P3DTOOLBASE_SOURCES)
 composite_sources(p3dtoolbase P3DTOOLBASE_SOURCES)
 
 
 add_library(p3dtoolbase	${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES})
 add_library(p3dtoolbase	${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES})
-if(HAVE_PYTHON)
-  target_link_libraries(p3dtoolbase ${PYTHON_LIBRARIES})
-endif()
+target_use_packages(p3dtoolbase THREADS PYTHON)
 
 
 install(TARGETS p3dtoolbase DESTINATION lib)
 install(TARGETS p3dtoolbase DESTINATION lib)

+ 10 - 1
dtool/src/dtoolbase/atomicAdjust.h

@@ -23,7 +23,7 @@
 #include "atomicAdjustDummyImpl.h"
 #include "atomicAdjustDummyImpl.h"
 typedef AtomicAdjustDummyImpl AtomicAdjust;
 typedef AtomicAdjustDummyImpl AtomicAdjust;
 
 
-#elif  defined(__i386__) || defined(_M_IX86)
+#elif defined(__i386__) || defined(_M_IX86)
 // For an i386 architecture, we'll always use the i386 implementation.
 // For an i386 architecture, we'll always use the i386 implementation.
 // It should be safe for any OS, and it might be a bit faster than
 // It should be safe for any OS, and it might be a bit faster than
 // any OS-provided calls.
 // any OS-provided calls.
@@ -39,6 +39,15 @@ typedef AtomicAdjustI386Impl AtomicAdjust;
 #define HAVE_ATOMIC_COMPARE_AND_EXCHANGE 1
 #define HAVE_ATOMIC_COMPARE_AND_EXCHANGE 1
 #define HAVE_ATOMIC_COMPARE_AND_EXCHANGE_PTR 1
 #define HAVE_ATOMIC_COMPARE_AND_EXCHANGE_PTR 1
 
 
+#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
+// GCC 4.7 and above has built-in __atomic functions for atomic operations.
+
+#include "atomicAdjustGccImpl.h"
+typedef AtomicAdjustGccImpl AtomicAdjust;
+
+#define HAVE_ATOMIC_COMPARE_AND_EXCHANGE 1
+#define HAVE_ATOMIC_COMPARE_AND_EXCHANGE_PTR 1
+
 #elif defined(THREAD_WIN32_IMPL)
 #elif defined(THREAD_WIN32_IMPL)
 
 
 #include "atomicAdjustWin32Impl.h"
 #include "atomicAdjustWin32Impl.h"

+ 148 - 0
dtool/src/dtoolbase/atomicAdjustGccImpl.I

@@ -0,0 +1,148 @@
+// Filename: atomicAdjustGccImpl.I
+// Created by:  rdb (04Jul14)
+//
+////////////////////////////////////////////////////////////////////
+//
+// PANDA 3D SOFTWARE
+// Copyright (c) Carnegie Mellon University.  All rights reserved.
+//
+// All use of this software is subject to the terms of the revised BSD
+// license.  You should have received a copy of this license along
+// with this source code in a file named "LICENSE."
+//
+////////////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////////////
+//     Function: AtomicAdjustGccImpl::inc
+//       Access: Public, Static
+//  Description: Atomically increments the indicated variable.
+////////////////////////////////////////////////////////////////////
+INLINE void AtomicAdjustGccImpl::
+inc(TVOLATILE AtomicAdjustGccImpl::Integer &var) {
+  __atomic_fetch_add(&var, 1, __ATOMIC_SEQ_CST);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: AtomicAdjustGccImpl::dec
+//       Access: Public, Static
+//  Description: Atomically decrements the indicated variable and
+//               returns true if the new value is nonzero, false if it
+//               is zero.
+////////////////////////////////////////////////////////////////////
+INLINE bool AtomicAdjustGccImpl::
+dec(TVOLATILE AtomicAdjustGccImpl::Integer &var) {
+  return (__atomic_sub_fetch(&var, 1, __ATOMIC_SEQ_CST) != 0);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: AtomicAdjustGccImpl::add
+//       Access: Public, Static
+//  Description: Atomically computes var += delta.  It is legal for
+//               delta to be negative.
+////////////////////////////////////////////////////////////////////
+INLINE void AtomicAdjustGccImpl::
+add(TVOLATILE AtomicAdjustGccImpl::Integer &var,
+    AtomicAdjustGccImpl::Integer delta) {
+  __atomic_fetch_add(&var, delta, __ATOMIC_SEQ_CST);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: AtomicAdjustGccImpl::set
+//       Access: Public, Static
+//  Description: Atomically changes the indicated variable and
+//               returns the original value.
+////////////////////////////////////////////////////////////////////
+INLINE AtomicAdjustGccImpl::Integer AtomicAdjustGccImpl::
+set(TVOLATILE AtomicAdjustGccImpl::Integer &var,
+    AtomicAdjustGccImpl::Integer new_value) {
+
+  return __atomic_exchange_n(&var, new_value, __ATOMIC_SEQ_CST);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: AtomicAdjustGccImpl::get
+//       Access: Public, Static
+//  Description: Atomically retrieves the snapshot value of the
+//               indicated variable.  This is the only guaranteed safe
+//               way to retrieve the value that other threads might be
+//               asynchronously setting, incrementing, or decrementing
+//               (via other AtomicAjust methods).
+////////////////////////////////////////////////////////////////////
+INLINE AtomicAdjustGccImpl::Integer AtomicAdjustGccImpl::
+get(const TVOLATILE AtomicAdjustGccImpl::Integer &var) {
+  return __atomic_load_n(&var, __ATOMIC_SEQ_CST);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: AtomicAdjustGccImpl::set_ptr
+//       Access: Public, Static
+//  Description: Atomically changes the indicated variable and
+//               returns the original value.
+////////////////////////////////////////////////////////////////////
+INLINE AtomicAdjustGccImpl::Pointer AtomicAdjustGccImpl::
+set_ptr(TVOLATILE AtomicAdjustGccImpl::Pointer &var,
+        AtomicAdjustGccImpl::Pointer new_value) {
+
+  return __atomic_exchange_n(&var, new_value, __ATOMIC_SEQ_CST);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: AtomicAdjustGccImpl::get_ptr
+//       Access: Public, Static
+//  Description: Atomically retrieves the snapshot value of the
+//               indicated variable.  This is the only guaranteed safe
+//               way to retrieve the value that other threads might be
+//               asynchronously setting, incrementing, or decrementing
+//               (via other AtomicAjust methods).
+////////////////////////////////////////////////////////////////////
+INLINE AtomicAdjustGccImpl::Pointer AtomicAdjustGccImpl::
+get_ptr(const TVOLATILE AtomicAdjustGccImpl::Pointer &var) {
+  return __atomic_load_n(&var, __ATOMIC_SEQ_CST);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: AtomicAdjustGccImpl::compare_and_exchange
+//       Access: Public, Static
+//  Description: Atomic compare and exchange.
+//
+//               If mem is equal to old_value, store new_value in mem.
+//               In either case, return the original value of mem.
+//               The caller can test for success by comparing
+//               return_value == old_value.
+//
+//               The atomic function expressed in pseudo-code:
+//
+//                 orig_value = mem;
+//                 if (mem == old_value) {
+//                   mem = new_value;
+//                 }
+//                 return orig_value;
+//
+////////////////////////////////////////////////////////////////////
+INLINE AtomicAdjustGccImpl::Integer AtomicAdjustGccImpl::
+compare_and_exchange(TVOLATILE AtomicAdjustGccImpl::Integer &mem,
+                     AtomicAdjustGccImpl::Integer old_value,
+                     AtomicAdjustGccImpl::Integer new_value) {
+
+  __atomic_compare_exchange_n(&mem, &old_value, new_value, false,
+                              __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
+  return old_value;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: AtomicAdjustGccImpl::compare_and_exchange_ptr
+//       Access: Public, Static
+//  Description: Atomic compare and exchange.
+//
+//               As above, but works on pointers instead of integers.
+////////////////////////////////////////////////////////////////////
+INLINE AtomicAdjustGccImpl::Pointer AtomicAdjustGccImpl::
+compare_and_exchange_ptr(TVOLATILE AtomicAdjustGccImpl::Pointer &mem,
+                         AtomicAdjustGccImpl::Pointer old_value,
+                         AtomicAdjustGccImpl::Pointer new_value) {
+
+  __atomic_compare_exchange_n(&mem, &old_value, new_value, false,
+                              __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
+  return old_value;
+}

+ 60 - 0
dtool/src/dtoolbase/atomicAdjustGccImpl.h

@@ -0,0 +1,60 @@
+// Filename: atomicAdjustGccImpl.h
+// Created by:  rdb (04Jul14)
+//
+////////////////////////////////////////////////////////////////////
+//
+// PANDA 3D SOFTWARE
+// Copyright (c) Carnegie Mellon University.  All rights reserved.
+//
+// All use of this software is subject to the terms of the revised BSD
+// license.  You should have received a copy of this license along
+// with this source code in a file named "LICENSE."
+//
+////////////////////////////////////////////////////////////////////
+
+#ifndef ATOMICADJUSTGCCIMPL_H
+#define ATOMICADJUSTGCCIMPL_H
+
+#include "dtoolbase.h"
+#include "selectThreadImpl.h"
+
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
+
+////////////////////////////////////////////////////////////////////
+//       Class : AtomicAdjustGccImpl
+// Description : Uses GCC built-ins to implement atomic adjustments.
+////////////////////////////////////////////////////////////////////
+class EXPCL_DTOOL AtomicAdjustGccImpl {
+public:
+#if __GCC_ATOMIC_LONG_LOCK_FREE > __GCC_ATOMIC_INT_LOCK_FREE
+  // If the long can be more lock-free than int, use it instead.
+  typedef __attribute__ ((aligned (__SIZEOF_LONG__))) long Integer;
+#else
+  typedef __attribute__ ((aligned (__SIZEOF_INT__))) int Integer;
+#endif
+  typedef void *UnalignedPointer;
+  typedef __attribute__ ((aligned (__SIZEOF_POINTER__))) UnalignedPointer Pointer;
+
+  INLINE static void inc(TVOLATILE Integer &var);
+  INLINE static bool dec(TVOLATILE Integer &var);
+  INLINE static void add(TVOLATILE Integer &var, Integer delta);
+  INLINE static Integer set(TVOLATILE Integer &var, Integer new_value);
+  INLINE static Integer get(const TVOLATILE Integer &var);
+
+  INLINE static Pointer set_ptr(TVOLATILE Pointer &var, Pointer new_value);
+  INLINE static Pointer get_ptr(const TVOLATILE Pointer &var);
+
+  INLINE static Integer compare_and_exchange(TVOLATILE Integer &mem,
+                                             Integer old_value,
+                                             Integer new_value);
+
+  INLINE static Pointer compare_and_exchange_ptr(TVOLATILE Pointer &mem,
+                                                 Pointer old_value,
+                                                 Pointer new_value);
+};
+
+#include "atomicAdjustGccImpl.I"
+
+#endif  // HAVE_POSIX_THREADS
+
+#endif

+ 23 - 1
dtool/src/dtoolbase/cmath.I

@@ -336,6 +336,28 @@ cpow(double x, double y) {
   return pow(x, y);
   return pow(x, y);
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: cpow
+//  Description: 
+////////////////////////////////////////////////////////////////////
+INLINE int
+cpow(int x, int y) {
+  int result = 1;
+
+  if (y >= 0) {
+    for(; y > 0; --y) {
+      result *= x;
+    }
+    return result;
+
+  } else {
+    for(; y < 0; ++y) {
+      result *= x;
+    }
+    return 1 / result;
+  }
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: cnan
 //     Function: cnan
 //  Description: 
 //  Description: 
@@ -343,7 +365,7 @@ cpow(double x, double y) {
 INLINE bool
 INLINE bool
 cnan(double v) {
 cnan(double v) {
 #ifndef _WIN32
 #ifndef _WIN32
-  return (isnan(v) != 0);
+  return (std::isnan(v) != 0);
 #else
 #else
   return (_isnan(v) != 0);
   return (_isnan(v) != 0);
 #endif
 #endif

+ 3 - 1
dtool/src/dtoolbase/cmath.h

@@ -23,7 +23,7 @@
 
 
 #include "dtoolbase.h"
 #include "dtoolbase.h"
 
 
-#include <math.h>
+#include <cmath>
 
 
 // Windows defines isnan() in a different place and with a different
 // Windows defines isnan() in a different place and with a different
 // name than everyone else.  Sheesh.
 // name than everyone else.  Sheesh.
@@ -62,6 +62,8 @@ INLINE double cacos(double v);
 INLINE double cmod(double x, double y);
 INLINE double cmod(double x, double y);
 INLINE double cpow(double x, double y);
 INLINE double cpow(double x, double y);
 
 
+INLINE int cpow(int x, int y);
+
 // Returns true if the number is NaN, false if it's a genuine number
 // Returns true if the number is NaN, false if it's a genuine number
 // or infinity.
 // or infinity.
 INLINE bool cnan(double v);
 INLINE bool cnan(double v);

+ 11 - 0
dtool/src/dtoolbase/dtoolbase_cc.h

@@ -33,6 +33,7 @@ using namespace std;
 
 
 #define INLINE inline
 #define INLINE inline
 #define TYPENAME typename
 #define TYPENAME typename
+#define CONSTEXPR
 
 
 #define EXPORT_TEMPLATE_CLASS(expcl, exptp, classname)
 #define EXPORT_TEMPLATE_CLASS(expcl, exptp, classname)
 
 
@@ -119,6 +120,16 @@ typedef ios::seekdir ios_seekdir;
 #define INLINE inline
 #define INLINE inline
 #endif
 #endif
 
 
+#if defined(__has_extension) // Clang magic.
+#if __has_extension(cxx_constexpr)
+#define CONSTEXPR constexpr
+#endif
+#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) && (__cplusplus >= 201103L)
+#define CONSTEXPR constexpr
+#else
+#define CONSTEXPR INLINE
+#endif
+
 #if defined(WIN32_VC) && !defined(LINK_ALL_STATIC) && defined(EXPORT_TEMPLATES)
 #if defined(WIN32_VC) && !defined(LINK_ALL_STATIC) && defined(EXPORT_TEMPLATES)
 // This macro must be used to export an instantiated template class
 // This macro must be used to export an instantiated template class
 // from a DLL.  If the template class name itself contains commas, it
 // from a DLL.  If the template class name itself contains commas, it

+ 8 - 1
dtool/src/dtoolbase/nearly_zero.h

@@ -35,6 +35,13 @@ get_nearly_zero_value(float) {
   return 1.0e-6f;
   return 1.0e-6f;
 }
 }
 
 
+INLINE int
+get_nearly_zero_value(int) {
+  // This is a bit silly, but we should nevertheless define it in
+  // case it is called for an integer type.
+  return 0;
+}
+
 
 
 // IS_THRESHOLD_ZERO(value, threshold) returns true if the value is
 // IS_THRESHOLD_ZERO(value, threshold) returns true if the value is
 // within threshold of zero.
 // within threshold of zero.
@@ -73,7 +80,7 @@ get_nearly_zero_value(float) {
 // MAYBE_ZERO(value) returns 0 if the value is nearly zero, and the
 // MAYBE_ZERO(value) returns 0 if the value is nearly zero, and the
 // value itself otherwise.
 // value itself otherwise.
 #define MAYBE_ZERO(value) \
 #define MAYBE_ZERO(value) \
-  (IS_NEARLY_ZERO(value) ? 0.0 : (value))
+  (IS_NEARLY_ZERO(value) ? 0 : (value))
 
 
 
 
 #endif
 #endif

+ 2 - 2
dtool/src/dtoolbase/register_type.cxx

@@ -26,6 +26,7 @@ TypeHandle bool_type_handle;
 TypeHandle double_type_handle;
 TypeHandle double_type_handle;
 TypeHandle float_type_handle;
 TypeHandle float_type_handle;
 TypeHandle string_type_handle;
 TypeHandle string_type_handle;
+TypeHandle wstring_type_handle;
 
 
 TypeHandle long_p_type_handle;
 TypeHandle long_p_type_handle;
 TypeHandle int_p_type_handle;
 TypeHandle int_p_type_handle;
@@ -58,6 +59,7 @@ void init_system_type_handles() {
     register_type(double_type_handle, "double");
     register_type(double_type_handle, "double");
     register_type(float_type_handle, "float");
     register_type(float_type_handle, "float");
     register_type(string_type_handle, "string");
     register_type(string_type_handle, "string");
+    register_type(wstring_type_handle, "wstring");
 
 
     register_type(int_p_type_handle, "int*");
     register_type(int_p_type_handle, "int*");
     register_type(short_p_type_handle, "short*");
     register_type(short_p_type_handle, "short*");
@@ -75,5 +77,3 @@ void init_system_type_handles() {
     register_type(pset_type_handle, "pset");
     register_type(pset_type_handle, "pset");
   }
   }
 }
 }
-
-

+ 6 - 0
dtool/src/dtoolbase/register_type.h

@@ -92,6 +92,7 @@ extern TypeHandle EXPCL_DTOOL bool_type_handle;
 extern TypeHandle EXPCL_DTOOL double_type_handle;
 extern TypeHandle EXPCL_DTOOL double_type_handle;
 extern TypeHandle EXPCL_DTOOL float_type_handle;
 extern TypeHandle EXPCL_DTOOL float_type_handle;
 extern TypeHandle EXPCL_DTOOL string_type_handle;
 extern TypeHandle EXPCL_DTOOL string_type_handle;
+extern TypeHandle EXPCL_DTOOL wstring_type_handle;
 
 
 extern TypeHandle long_p_type_handle;
 extern TypeHandle long_p_type_handle;
 extern TypeHandle int_p_type_handle;
 extern TypeHandle int_p_type_handle;
@@ -175,6 +176,11 @@ INLINE TypeHandle _get_type_handle(const string *) {
   return string_type_handle;
   return string_type_handle;
 }
 }
 
 
+template<>
+INLINE TypeHandle _get_type_handle(const wstring *) {
+  return wstring_type_handle;
+}
+
 template<>
 template<>
 INLINE TypeHandle _get_type_handle(const long * const *) {
 INLINE TypeHandle _get_type_handle(const long * const *) {
   return long_p_type_handle;
   return long_p_type_handle;

+ 4 - 0
dtool/src/dtoolbase/typeHandle.cxx

@@ -16,6 +16,10 @@
 #include "typeRegistryNode.h"
 #include "typeRegistryNode.h"
 #include "atomicAdjust.h"
 #include "atomicAdjust.h"
 
 
+#ifdef HAVE_PYTHON
+#include "Python.h"
+#endif
+
 // This is initialized to zero by static initialization.
 // This is initialized to zero by static initialization.
 TypeHandle TypeHandle::_none;
 TypeHandle TypeHandle::_none;
 
 

+ 7 - 5
dtool/src/dtoolbase/typeHandle.h

@@ -66,7 +66,10 @@
 class TypedObject;
 class TypedObject;
 
 
 #ifdef HAVE_PYTHON
 #ifdef HAVE_PYTHON
-#include "Python.h"
+#ifndef PyObject_HEAD
+struct _object;
+typedef _object PyObject;
+#endif
 #endif
 #endif
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -127,15 +130,15 @@ PUBLISHED:
 
 
   INLINE TypeHandle get_parent_towards(TypeHandle ancestor,
   INLINE TypeHandle get_parent_towards(TypeHandle ancestor,
                                        TypedObject *object = (TypedObject *)NULL) const;
                                        TypedObject *object = (TypedObject *)NULL) const;
-  
-  INLINE  int get_best_parent_from_Set(const std::set< int > &legal_vals) const;
+
+  INLINE int get_best_parent_from_Set(const std::set< int > &legal_vals) const;
 
 
 #ifdef DO_MEMORY_USAGE
 #ifdef DO_MEMORY_USAGE
   int get_memory_usage(MemoryClass memory_class) const;
   int get_memory_usage(MemoryClass memory_class) const;
   void inc_memory_usage(MemoryClass memory_class, int size);
   void inc_memory_usage(MemoryClass memory_class, int size);
   void dec_memory_usage(MemoryClass memory_class, int size);
   void dec_memory_usage(MemoryClass memory_class, int size);
 #else
 #else
-  INLINE int get_memory_usage(MemoryClass) const { return 0; }
+  CONSTEXPR int get_memory_usage(MemoryClass) const { return 0; }
   INLINE void inc_memory_usage(MemoryClass, int) { }
   INLINE void inc_memory_usage(MemoryClass, int) { }
   INLINE void dec_memory_usage(MemoryClass, int) { }
   INLINE void dec_memory_usage(MemoryClass, int) { }
 #endif  // DO_MEMORY_USAGE
 #endif  // DO_MEMORY_USAGE
@@ -170,4 +173,3 @@ EXPCL_DTOOL ostream &operator << (ostream &out, TypeHandle::MemoryClass mem_clas
 #include "typeHandle.I"
 #include "typeHandle.I"
 
 
 #endif
 #endif
-

+ 2 - 0
dtool/src/dtoolbase/typeRegistry.h

@@ -58,9 +58,11 @@ PUBLISHED:
 
 
   int get_num_typehandles();
   int get_num_typehandles();
   TypeHandle get_typehandle(int n);
   TypeHandle get_typehandle(int n);
+  MAKE_SEQ(get_typehandles, get_num_typehandles, get_typehandle);
 
 
   int get_num_root_classes();
   int get_num_root_classes();
   TypeHandle get_root_class(int n);
   TypeHandle get_root_class(int n);
+  MAKE_SEQ(get_root_classes, get_num_root_classes, get_root_class);
 
 
   int get_num_parent_classes(TypeHandle child,
   int get_num_parent_classes(TypeHandle child,
                              TypedObject *child_object) const;
                              TypedObject *child_object) const;

+ 4 - 0
dtool/src/dtoolutil/filename.cxx

@@ -49,6 +49,10 @@
 #include <unistd.h>
 #include <unistd.h>
 #endif
 #endif
 
 
+#ifdef HAVE_PYTHON
+#include "Python.h"
+#endif
+
 TextEncoder::Encoding Filename::_filesystem_encoding = TextEncoder::E_utf8;
 TextEncoder::Encoding Filename::_filesystem_encoding = TextEncoder::E_utf8;
 
 
 TVOLATILE AtomicAdjust::Pointer Filename::_home_directory;
 TVOLATILE AtomicAdjust::Pointer Filename::_home_directory;

+ 4 - 0
dtool/src/dtoolutil/globPattern.cxx

@@ -15,6 +15,10 @@
 #include "globPattern.h"
 #include "globPattern.h"
 #include <ctype.h>
 #include <ctype.h>
 
 
+#ifdef HAVE_PYTHON
+#include "Python.h"
+#endif
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: GlobPattern::has_glob_characters
 //     Function: GlobPattern::has_glob_characters
 //       Access: Published
 //       Access: Published

+ 1 - 1
dtool/src/interrogate/CMakeLists.txt

@@ -57,4 +57,4 @@ add_executable(interrogate_module interrogate_module.cxx)
 target_link_libraries(interrogate_module
 target_link_libraries(interrogate_module
 	p3cppParser p3interrogatedb p3dconfig p3prc p3dtoolutil p3dtoolbase
 	p3cppParser p3interrogatedb p3dconfig p3prc p3dtoolutil p3dtoolbase
 	p3pystub ${_OPENSSL_LIBRARIES})
 	p3pystub ${_OPENSSL_LIBRARIES})
-install(TARGETS interrogate DESTINATION bin)
+install(TARGETS interrogate_module DESTINATION bin)

+ 59 - 43
dtool/src/interrogate/functionRemap.cxx

@@ -50,6 +50,7 @@ FunctionRemap(const InterrogateType &itype, const InterrogateFunction &ifunc,
   _num_default_parameters = num_default_parameters;
   _num_default_parameters = num_default_parameters;
   _type = T_normal;
   _type = T_normal;
   _flags = 0;
   _flags = 0;
+  _args_type = 0;
   _wrapper_index = 0;
   _wrapper_index = 0;
 
 
   _return_value_needs_management = false;
   _return_value_needs_management = false;
@@ -303,26 +304,6 @@ make_wrapper_entry(FunctionIndex function_index) {
     assert(!iwrapper._parameters.empty());
     assert(!iwrapper._parameters.empty());
     iwrapper._parameters.front()._parameter_flags |=
     iwrapper._parameters.front()._parameter_flags |=
       InterrogateFunctionWrapper::PF_is_this;
       InterrogateFunctionWrapper::PF_is_this;
-
-    if (_parameters.size() >= 2 && _parameters[1]._name == "self" &&
-        TypeManager::is_pointer_to_PyObject(_parameters[1]._remap->get_orig_type())) {
-      // Here's a special case.  If the first parameter of a nonstatic
-      // method is a PyObject * called "self", then we will
-      // automatically fill it in from the this pointer, and remove it
-      // from the generated parameter list.
-      _parameters.erase(_parameters.begin() + 1);
-      _flags |= F_explicit_self;
-    }
-
-  } else if (_type == T_constructor) {
-    // We also allow "self" to be passed in to a constructor, even
-    // though the constructor doesn't normally accept a this pointer.
-    // But this makes sense to Python programmers.
-    if (_parameters.size() >= 1 && _parameters[0]._name == "self" &&
-        TypeManager::is_pointer_to_PyObject(_parameters[0]._remap->get_orig_type())) {
-      _parameters.erase(_parameters.begin() + 0);
-      _flags |= F_explicit_self;
-    }
   }
   }
 
 
   if (!_void_return) {
   if (!_void_return) {
@@ -650,12 +631,32 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak
   }
   }
 
 
   // Check for a special meaning by name and signature.
   // Check for a special meaning by name and signature.
-  if (_type == T_normal) {
-    int first_param = 0;
-    if (_has_this) {
-      first_param = 1;
+  int first_param = 0;
+  if (_has_this) {
+    first_param = 1;
+  }
+
+  if (_has_this || _type == T_constructor) {
+    if (_parameters.size() > first_param && _parameters[first_param]._name == "self" &&
+        TypeManager::is_pointer_to_PyObject(_parameters[first_param]._remap->get_orig_type())) {
+      // Here's a special case.  If the first parameter of a nonstatic
+      // method is a PyObject * called "self", then we will
+      // automatically fill it in from the this pointer, and remove it
+      // from the generated parameter list.
+      _parameters.erase(_parameters.begin() + first_param);
+      _flags |= F_explicit_self;
     }
     }
+  }
 
 
+  if (_parameters.size() == first_param) {
+    _args_type = InterfaceMaker::AT_no_args;
+  } else if (_parameters.size() == first_param + 1) {
+    _args_type = InterfaceMaker::AT_single_arg;
+  } else {
+    _args_type = InterfaceMaker::AT_varargs;
+  }
+
+  if (_type == T_normal) {
     if (fname == "operator []" || fname == "__getitem__") {
     if (fname == "operator []" || fname == "__getitem__") {
       _flags |= F_getitem;
       _flags |= F_getitem;
       if (_has_this && _parameters.size() == 2) {
       if (_has_this && _parameters.size() == 2) {
@@ -671,6 +672,7 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak
         if (TypeManager::is_integer(_parameters[1]._remap->get_new_type())) {
         if (TypeManager::is_integer(_parameters[1]._remap->get_new_type())) {
           // Its first parameter is an int parameter, presumably an index.
           // Its first parameter is an int parameter, presumably an index.
           _flags |= F_setitem_int;
           _flags |= F_setitem_int;
+          _args_type = InterfaceMaker::AT_varargs;
         }
         }
       }
       }
 
 
@@ -681,55 +683,69 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak
         _flags |= F_size;
         _flags |= F_size;
       }
       }
 
 
-    } else if (fname == "make_copy" ) {
+    } else if (fname == "make_copy") {
       if (_has_this && _parameters.size() == 1 &&
       if (_has_this && _parameters.size() == 1 &&
           TypeManager::is_pointer(_return_type->get_new_type())) {
           TypeManager::is_pointer(_return_type->get_new_type())) {
         // It receives no parameters, and returns a pointer.
         // It receives no parameters, and returns a pointer.
         _flags |= F_make_copy;
         _flags |= F_make_copy;
       }
       }
 
 
-    } else if (fname == "__iter__" ) {
+    } else if (fname == "__iter__") {
       if (_has_this && _parameters.size() == 1 &&
       if (_has_this && _parameters.size() == 1 &&
           TypeManager::is_pointer(_return_type->get_new_type())) {
           TypeManager::is_pointer(_return_type->get_new_type())) {
         // It receives no parameters, and returns a pointer.
         // It receives no parameters, and returns a pointer.
         _flags |= F_iter;
         _flags |= F_iter;
       }
       }
 
 
-    } else if (fname == "__getbuffer__" ) {
-      if (_has_this && _parameters.size() == 4 &&
+    } else if (fname == "__getbuffer__") {
+      if (_has_this && _parameters.size() == 3 &&
           TypeManager::is_integer(_return_type->get_new_type()) &&
           TypeManager::is_integer(_return_type->get_new_type()) &&
-          TypeManager::is_pointer_to_PyObject(_parameters[1]._remap->get_orig_type()) &&
-          TypeManager::is_pointer_to_Py_buffer(_parameters[2]._remap->get_orig_type()) &&
-          TypeManager::is_integer(_parameters[3]._remap->get_orig_type())) {
+          TypeManager::is_pointer_to_Py_buffer(_parameters[1]._remap->get_orig_type()) &&
+          TypeManager::is_integer(_parameters[2]._remap->get_orig_type())) {
 
 
         _flags |= F_getbuffer;
         _flags |= F_getbuffer;
       }
       }
 
 
-    } else if (fname == "__releasebuffer__" ) {
-      if (_has_this && _parameters.size() == 3 &&
-          TypeManager::is_pointer_to_PyObject(_parameters[1]._remap->get_orig_type()) &&
-          TypeManager::is_pointer_to_Py_buffer(_parameters[2]._remap->get_orig_type())) {
+    } else if (fname == "__releasebuffer__") {
+      if (_has_this && _parameters.size() == 2 &&
+          TypeManager::is_pointer_to_Py_buffer(_parameters[1]._remap->get_orig_type())) {
 
 
         _flags |= F_releasebuffer;
         _flags |= F_releasebuffer;
       }
       }
 
 
-    } else if (fname == "compare_to" ) {
+    } else if (fname == "compare_to") {
       if (_has_this && _parameters.size() == 2 &&
       if (_has_this && _parameters.size() == 2 &&
           TypeManager::is_integer(_return_type->get_new_type())) {
           TypeManager::is_integer(_return_type->get_new_type())) {
         // It receives one parameter, and returns an integer.
         // It receives one parameter, and returns an integer.
         _flags |= F_compare_to;
         _flags |= F_compare_to;
       }
       }
+
+    } else if (fname == "operator ()" || fname == "__call__") {
+      // Call operators always take keyword arguments.
+      _args_type = InterfaceMaker::AT_keyword_args;
+
+    } else if (fname == "__setattr__" || fname == "__getattr__") {
+      // Just to prevent these from getting keyword arguments.
+
+    } else {
+      if (_args_type == InterfaceMaker::AT_varargs) {
+        // Every other method can take keyword arguments, if they
+        // take more than one argument.
+        _args_type = InterfaceMaker::AT_keyword_args;
+      }
     }
     }
 
 
   } else if (_type == T_constructor) {
   } else if (_type == T_constructor) {
-    if (!_has_this && _parameters.size() == 1) {
-      if (TypeManager::unwrap(_parameters[0]._remap->get_orig_type()) ==
-          TypeManager::unwrap(_return_type->get_orig_type())) {
-        // If this is the only parameter, and it's the same as the
-        // "this" type, this is a copy constructor.
-        _flags |= F_copy_constructor;
-      }
+    if (!_has_this && _parameters.size() == 1 &&
+        TypeManager::unwrap(_parameters[0]._remap->get_orig_type()) ==
+        TypeManager::unwrap(_return_type->get_orig_type())) {
+      // If this is the only parameter, and it's the same as the
+      // "this" type, this is a copy constructor.
+      _flags |= F_copy_constructor;
+
     }
     }
+    // Constructors always take varargs and keyword args.
+    _args_type = InterfaceMaker::AT_keyword_args;
   }
   }
 
 
   return true;
   return true;

+ 1 - 0
dtool/src/interrogate/functionRemap.h

@@ -107,6 +107,7 @@ public:
   int _num_default_parameters;
   int _num_default_parameters;
   Type _type;
   Type _type;
   int _flags;
   int _flags;
+  int _args_type;
   string _expression;
   string _expression;
   string _function_signature;
   string _function_signature;
   string _hash;
   string _hash;

+ 8 - 6
dtool/src/interrogate/interfaceMaker.cxx

@@ -57,6 +57,7 @@ Function(const string &name,
 {
 {
   _has_this = false;
   _has_this = false;
   _flags = 0;
   _flags = 0;
+  _args_type = AT_unknown;
 }
 }
  
  
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -632,13 +633,13 @@ record_function(const InterrogateType &itype, FunctionIndex func_index) {
       CPPInstance *cppfunc = (*ii).second;
       CPPInstance *cppfunc = (*ii).second;
       CPPFunctionType *ftype = cppfunc->_type->as_function_type();
       CPPFunctionType *ftype = cppfunc->_type->as_function_type();
       int max_default_parameters = 0;
       int max_default_parameters = 0;
-      
+
       if (separate_overloading()) {
       if (separate_overloading()) {
         // Count up the number of default parameters this function might
         // Count up the number of default parameters this function might
         // take.
         // take.
         CPPParameterList *parameters = ftype->_parameters;
         CPPParameterList *parameters = ftype->_parameters;
         CPPParameterList::Parameters::reverse_iterator pi;
         CPPParameterList::Parameters::reverse_iterator pi;
-        for (pi = parameters->_parameters.rbegin(); 
+        for (pi = parameters->_parameters.rbegin();
              pi != parameters->_parameters.rend();
              pi != parameters->_parameters.rend();
              ++pi) {
              ++pi) {
           CPPInstance *param = (*pi);
           CPPInstance *param = (*pi);
@@ -651,7 +652,7 @@ record_function(const InterrogateType &itype, FunctionIndex func_index) {
           }
           }
         }
         }
       }
       }
-      
+
       // Now make a different wrapper for each combination of default
       // Now make a different wrapper for each combination of default
       // parameters.  This will happen only if separate_overloading(),
       // parameters.  This will happen only if separate_overloading(),
       // tested above, returned true; otherwise, max_default_parameters
       // tested above, returned true; otherwise, max_default_parameters
@@ -663,7 +664,7 @@ record_function(const InterrogateType &itype, FunctionIndex func_index) {
           make_function_remap(itype, ifunc, cppfunc, num_default_parameters);
           make_function_remap(itype, ifunc, cppfunc, num_default_parameters);
         if (remap != (FunctionRemap *)NULL) {
         if (remap != (FunctionRemap *)NULL) {
           func->_remaps.push_back(remap);
           func->_remaps.push_back(remap);
-          
+
           // If *any* of the variants of this function has a "this"
           // If *any* of the variants of this function has a "this"
           // pointer, the entire set of functions is deemed to have a
           // pointer, the entire set of functions is deemed to have a
           // "this" pointer.
           // "this" pointer.
@@ -672,9 +673,10 @@ record_function(const InterrogateType &itype, FunctionIndex func_index) {
           }
           }
 
 
           func->_flags |= remap->_flags;
           func->_flags |= remap->_flags;
-          
+          func->_args_type = (ArgsType)((int)func->_args_type | (int)remap->_args_type);
+
           // Make a wrapper for the function.
           // Make a wrapper for the function.
-          FunctionWrapperIndex wrapper_index = 
+          FunctionWrapperIndex wrapper_index =
             remap->make_wrapper_entry(func_index);
             remap->make_wrapper_entry(func_index);
           if (wrapper_index != 0) {
           if (wrapper_index != 0) {
             InterrogateFunction &mod_ifunc = idb->update_function(func_index);
             InterrogateFunction &mod_ifunc = idb->update_function(func_index);

+ 23 - 0
dtool/src/interrogate/interfaceMaker.h

@@ -71,6 +71,28 @@ public:
   static ostream &indent(ostream &out, int indent_level);
   static ostream &indent(ostream &out, int indent_level);
 
 
 public:
 public:
+  // This contains information about the number
+  // of arguments that the wrapping function should take.
+  enum ArgsType {
+    // This is deliberately engineered such that these
+    // values can be OR'ed together to produce another
+    // valid enum value.
+    AT_unknown      = 0x00,
+
+    // The method or function takes no arguments.
+    AT_no_args      = 0x01,
+
+    // There is only a single argument.
+    AT_single_arg   = 0x02,
+
+    // The method takes a variable number of arguments.
+    AT_varargs      = 0x03,
+
+    // The method may take keyword arguments, if appropriate
+    // in the scripting language.  Implies AT_varargs.
+    AT_keyword_args = 0x07,
+  };
+
   class Function {
   class Function {
   public:
   public:
     Function(const string &name,
     Function(const string &name,
@@ -85,6 +107,7 @@ public:
     Remaps _remaps;
     Remaps _remaps;
     bool _has_this;
     bool _has_this;
     int _flags;
     int _flags;
+    ArgsType _args_type;
   };
   };
   typedef vector<Function *> Functions;
   typedef vector<Function *> Functions;
   Functions _functions;
   Functions _functions;

+ 2 - 7
dtool/src/interrogate/interfaceMakerPython.cxx

@@ -36,17 +36,12 @@ InterfaceMakerPython(InterrogateModuleDef *def) :
 void InterfaceMakerPython::
 void InterfaceMakerPython::
 write_includes(ostream &out) {
 write_includes(ostream &out) {
   InterfaceMaker::write_includes(out);
   InterfaceMaker::write_includes(out);
-  out << "#undef HAVE_LONG_LONG\n"
-      << "#undef _POSIX_C_SOURCE\n\n"
+  out << "#undef _POSIX_C_SOURCE\n\n"
       << "#if PYTHON_FRAMEWORK\n"
       << "#if PYTHON_FRAMEWORK\n"
       << "  #include \"Python/Python.h\"\n"
       << "  #include \"Python/Python.h\"\n"
       << "#else\n"
       << "#else\n"
       << "  #include \"Python.h\"\n"
       << "  #include \"Python.h\"\n"
-      << "#endif\n"
-      << "#ifdef HAVE_LONG_LONG\n"
-      << "#undef HAVE_LONG_LONG\n"
-      << "#endif \n";
-
+      << "#endif\n";
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

File diff suppressed because it is too large
+ 416 - 206
dtool/src/interrogate/interfaceMakerPythonNative.cxx


+ 25 - 21
dtool/src/interrogate/interfaceMakerPythonNative.h

@@ -27,8 +27,7 @@ class FunctionRemap;
 // Description : An InterfaceMaker for generating complex Python
 // Description : An InterfaceMaker for generating complex Python
 //               function wrappers around C++ code.
 //               function wrappers around C++ code.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-class InterfaceMakerPythonNative : public InterfaceMakerPython 
-{
+class InterfaceMakerPythonNative : public InterfaceMakerPython {
 public:
 public:
   InterfaceMakerPythonNative(InterrogateModuleDef *def);
   InterfaceMakerPythonNative(InterrogateModuleDef *def);
   virtual ~InterfaceMakerPythonNative();
   virtual ~InterfaceMakerPythonNative();
@@ -76,6 +75,9 @@ private:
     WT_inquiry,
     WT_inquiry,
     WT_getbuffer,
     WT_getbuffer,
     WT_releasebuffer,
     WT_releasebuffer,
+    WT_iter_next,
+    WT_one_or_two_params,
+    WT_ternary_operator,
   };
   };
 
 
   class SlottedFunctionDef {
   class SlottedFunctionDef {
@@ -86,25 +88,28 @@ private:
   };
   };
 
 
   static bool get_slotted_function_def(Object *obj, Function *func, SlottedFunctionDef &def);
   static bool get_slotted_function_def(Object *obj, Function *func, SlottedFunctionDef &def);
-  
+
   void write_prototype_for_name(ostream &out, Function *func, const std::string &name);
   void write_prototype_for_name(ostream &out, Function *func, const std::string &name);
   void write_prototype_for(ostream &out, Function *func);
   void write_prototype_for(ostream &out, Function *func);
-  void write_function_for_name(ostream &out, Object *obj, Function *func, const std::string &name, const std::string &PreProcess, const std::string &ClassName,
-                               bool coercion_allowed, bool &coercion_attempted);
-  void write_function_for_top(ostream &out, Object *obj, Function *func, const std::string &PreProcess);
-  void write_function_instance(ostream &out, Object *obj, Function *func,
-                               FunctionRemap *remap, string &expected_params, 
-                               int indent_level, bool errors_fatal, 
-                               ostream &forwarddecl, const std::string &functionnamestr,
-                               bool is_inplace, bool coercion_allowed,
-                               bool &coercion_attempted,
-                               const string &args_cleanup);
-  
+  void write_function_for_top(ostream &out, Object *obj, Function *func);
+  void write_function_for_name(ostream &out, Object *obj, Function *func,
+                               const std::string &name,
+                               bool coercion_allowed, bool &coercion_attempted,
+                               ArgsType args_type, bool return_int);
+
   void write_function_forset(ostream &out, Object *obj, Function *func,
   void write_function_forset(ostream &out, Object *obj, Function *func,
                              std::set<FunctionRemap*> &remaps, string &expected_params,
                              std::set<FunctionRemap*> &remaps, string &expected_params,
-                             int indent_level, ostream &forwarddecl, bool inplace,
-                             bool coercion_allowed, bool &coercion_attempted, 
-                             const string &args_cleanup);
+                             int indent_level, bool inplace,
+                             bool coercion_allowed, bool &coercion_attempted,
+                             ArgsType args_type, bool return_int,
+                             const string &first_expr = string());
+
+  void write_function_instance(ostream &out, Object *obj, Function *func,
+                               FunctionRemap *remap, string &expected_params,
+                               int indent_level, bool is_inplace,
+                               bool coercion_allowed, bool &coercion_attempted,
+                               ArgsType args_type, bool return_int,
+                               const string &first_pexpr = string());
 
 
   void pack_return_value(ostream &out, int indent_level, FunctionRemap *remap,
   void pack_return_value(ostream &out, int indent_level, FunctionRemap *remap,
                          const std::string &return_expr, bool in_place);
                          const std::string &return_expr, bool in_place);
@@ -118,17 +123,16 @@ private:
   void write_class_prototypes(ostream &out) ;
   void write_class_prototypes(ostream &out) ;
   void write_class_declarations(ostream &out, ostream *out_h, Object *obj);
   void write_class_declarations(ostream &out, ostream *out_h, Object *obj);
   void write_class_details(ostream &out, Object *obj);
   void write_class_details(ostream &out, Object *obj);
-  
-  void do_assert_init(ostream &out, int &indent_level, bool constructor, const string &args_cleanup) const;
+
 public:
 public:
-  bool is_remap_legal(FunctionRemap &remap);
+  bool is_remap_legal(FunctionRemap *remap);
   bool is_function_legal( Function *func);
   bool is_function_legal( Function *func);
   bool is_cpp_type_legal(CPPType *ctype);
   bool is_cpp_type_legal(CPPType *ctype);
   bool isExportThisRun(CPPType *ctype);
   bool isExportThisRun(CPPType *ctype);
   bool isExportThisRun(Function *func);
   bool isExportThisRun(Function *func);
   bool isFunctionWithThis( Function *func);
   bool isFunctionWithThis( Function *func);
   bool IsRunTimeTyped(const InterrogateType &itype);
   bool IsRunTimeTyped(const InterrogateType &itype);
-  
+
   // comunicates the cast capabilites among methods..
   // comunicates the cast capabilites among methods..
   struct CastDetails {
   struct CastDetails {
     CPPStructType   *_structType;
     CPPStructType   *_structType;

+ 49 - 36
dtool/src/interrogate/interrogateBuilder.cxx

@@ -1863,26 +1863,34 @@ get_type(CPPType *type, bool global) {
 
 
   // First, check to see if it's already there.
   // First, check to see if it's already there.
   string true_name = type->get_local_name(&parser);
   string true_name = type->get_local_name(&parser);
-  TypesByName::const_iterator tni = _types_by_name.find(true_name);
-  if (tni != _types_by_name.end()) {
-    // It's already here, so update the global flag.
-    index = (*tni).second;
-    if (index == 0) {
-      // This is an invalid type; we don't know anything about it.
-      return 0;
-    }
 
 
-    InterrogateType &itype = InterrogateDatabase::get_ptr()->update_type(index);
-    if (global) {
-      itype._flags |= InterrogateType::F_global;
-    }
+  if (true_name.empty()) {
+    // Whoops, it's an anonymous type.  That's okay, because we'll
+    // usually only encounter them once anyway, so let's go ahead and
+    // define it without checking in _types_by_name.
 
 
-    if ((itype._flags & InterrogateType::F_fully_defined) != 0) {
-      return index;
-    }
+  } else {
+    TypesByName::const_iterator tni = _types_by_name.find(true_name);
+    if (tni != _types_by_name.end()) {
+      // It's already here, so update the global flag.
+      index = (*tni).second;
+      if (index == 0) {
+        // This is an invalid type; we don't know anything about it.
+        return 0;
+      }
+
+      InterrogateType &itype = InterrogateDatabase::get_ptr()->update_type(index);
+      if (global) {
+        itype._flags |= InterrogateType::F_global;
+      }
 
 
-    // But wait--it's not fully defined yet!  We'll go ahead and
-    // define it now.
+      if ((itype._flags & InterrogateType::F_fully_defined) != 0) {
+        return index;
+      }
+
+      // But wait--it's not fully defined yet!  We'll go ahead and
+      // define it now.
+    }
   }
   }
 
 
   bool forced = in_forcetype(true_name);
   bool forced = in_forcetype(true_name);
@@ -1890,7 +1898,9 @@ get_type(CPPType *type, bool global) {
   if (index == 0) {
   if (index == 0) {
     // It isn't already there, so we have to define it.
     // It isn't already there, so we have to define it.
     index = InterrogateDatabase::get_ptr()->get_next_index();
     index = InterrogateDatabase::get_ptr()->get_next_index();
-    _types_by_name[true_name] = index;
+    if (!true_name.empty()) {
+      _types_by_name[true_name] = index;
+    }
 
 
     InterrogateType itype;
     InterrogateType itype;
     if (global) {
     if (global) {
@@ -1904,7 +1914,7 @@ get_type(CPPType *type, bool global) {
     InterrogateDatabase::get_ptr()->update_type(index);
     InterrogateDatabase::get_ptr()->update_type(index);
 
 
   itype._name = get_preferred_name(type);
   itype._name = get_preferred_name(type);
-  
+
   int num_alt_names = type->get_num_alt_names();
   int num_alt_names = type->get_num_alt_names();
   if (num_alt_names != 0) {
   if (num_alt_names != 0) {
     itype._alt_names.clear();
     itype._alt_names.clear();
@@ -1954,23 +1964,19 @@ get_type(CPPType *type, bool global) {
     }
     }
   }
   }
 
 
-  if (forced || !in_ignoretype(true_name)) 
-  {
+  if (forced || !in_ignoretype(true_name)) {
     itype._flags |= InterrogateType::F_fully_defined;
     itype._flags |= InterrogateType::F_fully_defined;
 
 
-    if (type->as_simple_type() != (CPPSimpleType *)NULL) 
-    {
+    if (type->as_simple_type() != (CPPSimpleType *)NULL) {
       define_atomic_type(itype, type->as_simple_type());
       define_atomic_type(itype, type->as_simple_type());
 
 
-    } else if (type->as_pointer_type() != (CPPPointerType *)NULL)
-    {
+    } else if (type->as_pointer_type() != (CPPPointerType *)NULL) {
       define_wrapped_type(itype, type->as_pointer_type());
       define_wrapped_type(itype, type->as_pointer_type());
 
 
     } else if (type->as_const_type() != (CPPConstType *)NULL) {
     } else if (type->as_const_type() != (CPPConstType *)NULL) {
       define_wrapped_type(itype, type->as_const_type());
       define_wrapped_type(itype, type->as_const_type());
 
 
-    } else if (type->as_struct_type() != (CPPStructType *)NULL) 
-    {
+    } else if (type->as_struct_type() != (CPPStructType *)NULL) {
       define_struct_type(itype, type->as_struct_type(), index, forced);
       define_struct_type(itype, type->as_struct_type(), index, forced);
 
 
     } else if (type->as_enum_type() != (CPPEnumType *)NULL) {
     } else if (type->as_enum_type() != (CPPEnumType *)NULL) {
@@ -1984,7 +1990,9 @@ get_type(CPPType *type, bool global) {
 
 
       // Remove the type from the database.
       // Remove the type from the database.
       InterrogateDatabase::get_ptr()->remove_type(index);
       InterrogateDatabase::get_ptr()->remove_type(index);
-      _types_by_name[true_name] = 0;
+      if (!true_name.empty()) {
+        _types_by_name[true_name] = 0;
+      }
       index = 0;
       index = 0;
     }
     }
   }
   }
@@ -2229,6 +2237,7 @@ define_struct_type(InterrogateType &itype, CPPStructType *cpptype,
   for (di = scope->_declarations.begin();
   for (di = scope->_declarations.begin();
        di != scope->_declarations.end();
        di != scope->_declarations.end();
        ++di) {
        ++di) {
+
     if ((*di)->get_subtype() == CPPDeclaration::ST_instance) {
     if ((*di)->get_subtype() == CPPDeclaration::ST_instance) {
       CPPInstance *inst = (*di)->as_instance();
       CPPInstance *inst = (*di)->as_instance();
       if (inst->_type->get_subtype() == CPPDeclaration::ST_function) {
       if (inst->_type->get_subtype() == CPPDeclaration::ST_function) {
@@ -2243,15 +2252,12 @@ define_struct_type(InterrogateType &itype, CPPStructType *cpptype,
         }
         }
       }
       }
 
 
-    } else if ((*di)->get_subtype() == CPPDeclaration::ST_type_declaration) 
-    {
+    } else if ((*di)->get_subtype() == CPPDeclaration::ST_type_declaration) {
       CPPType *type = (*di)->as_type_declaration()->_type;
       CPPType *type = (*di)->as_type_declaration()->_type;
 
 
-      if ((*di)->_vis <= min_vis || in_forcetype(type->get_local_name(&parser))) 
-      {
+      if ((*di)->_vis <= min_vis || in_forcetype(type->get_local_name(&parser))) {
         if (type->as_struct_type() != (CPPStructType *)NULL ||
         if (type->as_struct_type() != (CPPStructType *)NULL ||
-            type->as_enum_type() != (CPPEnumType *)NULL) 
-        {
+            type->as_enum_type() != (CPPEnumType *)NULL) {
           // Here's a nested class or enum definition.
           // Here's a nested class or enum definition.
           type->_vis = (*di)->_vis;
           type->_vis = (*di)->_vis;
 
 
@@ -2259,13 +2265,20 @@ define_struct_type(InterrogateType &itype, CPPStructType *cpptype,
           assert(nested_type != (CPPExtensionType *)NULL);
           assert(nested_type != (CPPExtensionType *)NULL);
 
 
           // Only try to export named types.
           // Only try to export named types.
-          if (nested_type->_ident != (CPPIdentifier *)NULL) 
-          {
+          if (nested_type->_ident != (CPPIdentifier *)NULL) {
             TypeIndex nested_index = get_type(nested_type, false);
             TypeIndex nested_index = get_type(nested_type, false);
             itype._nested_types.push_back(nested_index);
             itype._nested_types.push_back(nested_index);
           }
           }
         }
         }
       }
       }
+    } else if ((*di)->get_subtype() == CPPDeclaration::ST_enum) {
+      CPPType *type = (*di)->as_enum_type();
+
+      // An anonymous enum type.
+      if ((*di)->_vis <= min_vis) {
+        TypeIndex nested_index = get_type(type, false);
+        itype._nested_types.push_back(nested_index);
+      }
     }
     }
   }
   }
 
 

+ 3 - 2
dtool/src/interrogate/typeManager.cxx

@@ -934,7 +934,7 @@ bool TypeManager::
 is_double(CPPType *type) {
 is_double(CPPType *type) {
   switch (type->get_subtype()) {
   switch (type->get_subtype()) {
   case CPPDeclaration::ST_const:
   case CPPDeclaration::ST_const:
-    return is_float(type->as_const_type()->_wrapped_around);
+    return is_double(type->as_const_type()->_wrapped_around);
 
 
   case CPPDeclaration::ST_simple:
   case CPPDeclaration::ST_simple:
     {
     {
@@ -1199,7 +1199,8 @@ is_PyObject(CPPType *type) {
     return is_PyObject(type->as_const_type()->_wrapped_around);
     return is_PyObject(type->as_const_type()->_wrapped_around);
 
 
   case CPPDeclaration::ST_extension:
   case CPPDeclaration::ST_extension:
-    return (type->get_local_name(&parser) == "PyObject");
+    return (type->get_local_name(&parser) == "PyObject" ||
+            type->get_local_name(&parser) == "_object");
 
 
   default:
   default:
     return false;
     return false;

+ 1 - 1
dtool/src/interrogatedb/dtool_super_base.cxx

@@ -83,7 +83,7 @@ int Dtool_Init_DTOOL_SUPER_BASE(PyObject *self, PyObject *args, PyObject *kwds)
   return -1;
   return -1;
 }
 }
 
 
-int Dtool_InitNoCoerce_DTOOL_SUPER_BASE(PyObject *self, PyObject *args, PyObject *kwds) {
+int Dtool_InitNoCoerce_DTOOL_SUPER_BASE(PyObject *self, PyObject *args) {
   PyErr_SetString(PyExc_TypeError, "cannot init super base");
   PyErr_SetString(PyExc_TypeError, "cannot init super base");
   return -1;
   return -1;
 }
 }

+ 21 - 5
dtool/src/interrogatedb/py_panda.cxx

@@ -79,9 +79,21 @@ attempt_coercion(PyObject *self, Dtool_PyTypedObject *classdef,
     if (classdef->_PyType.tp_new != NULL) {
     if (classdef->_PyType.tp_new != NULL) {
       obj = classdef->_PyType.tp_new(&classdef->_PyType, self, NULL);
       obj = classdef->_PyType.tp_new(&classdef->_PyType, self, NULL);
       assert(obj != NULL);
       assert(obj != NULL);
-      if (classdef->_Dtool_InitNoCoerce(obj, self, NULL) != 0) {
-        Py_DECREF(obj);
-        obj = NULL;
+
+      if (PyTuple_Check(self)) {
+        // A tuple was passed, which we assume are the constructor arguments.
+        if (classdef->_Dtool_InitNoCoerce(obj, self) != 0) {
+          Py_DECREF(obj);
+          obj = NULL;
+        }
+      } else {
+        // We need to pack the value into an args tuple.
+        PyObject *args = PyTuple_Pack(1, self);
+        if (classdef->_Dtool_InitNoCoerce(obj, args) != 0) {
+          Py_DECREF(obj);
+          obj = NULL;
+        }
+        Py_DECREF(args);
       }
       }
     }
     }
     if (obj == NULL) {
     if (obj == NULL) {
@@ -93,7 +105,11 @@ attempt_coercion(PyObject *self, Dtool_PyTypedObject *classdef,
       PyObject *make = PyObject_GetAttrString((PyObject *)classdef, "make");
       PyObject *make = PyObject_GetAttrString((PyObject *)classdef, "make");
       if (make != NULL) {
       if (make != NULL) {
         PyErr_Clear();
         PyErr_Clear();
-        obj = PyObject_Call(make, self, NULL);
+        if (PyTuple_Check(self)) {
+          obj = PyObject_CallObject(make, self);
+        } else {
+          obj = PyObject_CallFunctionObjArgs(make, self, NULL);
+        }
         Py_DECREF(make);
         Py_DECREF(make);
       }
       }
     }
     }
@@ -598,7 +614,7 @@ int DTOOL_PyObject_Compare(PyObject *v1, PyObject *v2) {
     PyErr_Clear();
     PyErr_Clear();
   } else {
   } else {
     PyObject *res = NULL;
     PyObject *res = NULL;
-    PyObject *args = Py_BuildValue("(O)", v2);
+    PyObject *args = PyTuple_Pack(1, v2);
     if (args != NULL) {
     if (args != NULL) {
       res = PyObject_Call(func, args, NULL);
       res = PyObject_Call(func, args, NULL);
       Py_DECREF(args);
       Py_DECREF(args);

+ 13 - 8
dtool/src/interrogatedb/py_panda.h

@@ -42,18 +42,23 @@
 
 
 #if defined(HAVE_PYTHON) && !defined(CPPPARSER)
 #if defined(HAVE_PYTHON) && !defined(CPPPARSER)
 
 
-#ifdef HAVE_LONG_LONG
-#undef HAVE_LONG_LONG
-#endif 
 #ifdef _POSIX_C_SOURCE
 #ifdef _POSIX_C_SOURCE
 #undef _POSIX_C_SOURCE
 #undef _POSIX_C_SOURCE
 #endif
 #endif
 
 
+#define PY_SSIZE_T_CLEAN 1
+
 #include "Python.h"
 #include "Python.h"
 #include "structmember.h"
 #include "structmember.h"
-#ifdef HAVE_LONG_LONG
-#undef HAVE_LONG_LONG
-#endif 
+
+#ifndef HAVE_LONG_LONG
+#define PyLong_FromLongLong(x) PyLong_FromLong((long) (x))
+#define PyLong_FromUnsignedLongLong(x) PyLong_FromUnsignedLong((unsigned long) (x))
+#define PyLong_AsLongLong(x) PyLong_AsLong(x)
+#define PyLong_AsUnsignedLongLong(x) PyLong_AsUnsignedLong(x)
+#define PyLong_AsUnsignedLongLongMask(x) PyLong_AsUnsignedLongMask(x)
+#define PyLong_AsLongLongAndOverflow(x) PyLong_AsLongAndOverflow(x)
+#endif
 
 
 #if PY_VERSION_HEX < 0x02050000
 #if PY_VERSION_HEX < 0x02050000
 
 
@@ -139,7 +144,7 @@ typedef void * ( * ConvertFunctionType  )(PyObject *,Dtool_PyTypedObject * );
 typedef void * ( * ConvertFunctionType1  )(void *, Dtool_PyTypedObject *);
 typedef void * ( * ConvertFunctionType1  )(void *, Dtool_PyTypedObject *);
 typedef void   ( *FreeFunction  )(PyObject *);
 typedef void   ( *FreeFunction  )(PyObject *);
 typedef void   ( *PyModuleClassInit)(PyObject *module);
 typedef void   ( *PyModuleClassInit)(PyObject *module);
-typedef int    ( *InitNoCoerce)(PyObject *self, PyObject *args, PyObject *kwds);
+typedef int    ( *InitNoCoerce)(PyObject *self, PyObject *args);
 
 
 //inline          Dtool_PyTypedObject *  Dtool_RuntimeTypeDtoolType(int type);
 //inline          Dtool_PyTypedObject *  Dtool_RuntimeTypeDtoolType(int type);
 inline void     Dtool_Deallocate_General(PyObject * self);
 inline void     Dtool_Deallocate_General(PyObject * self);
@@ -369,7 +374,7 @@ EXPCL_DTOOLCONFIG PyObject *DTool_CreatePyInstance(void *local_this, Dtool_PyTyp
 extern EXPORT_THIS   Dtool_PyTypedObject Dtool_##CLASS_NAME;\
 extern EXPORT_THIS   Dtool_PyTypedObject Dtool_##CLASS_NAME;\
 extern struct        PyMethodDef Dtool_Methods_##CLASS_NAME[];\
 extern struct        PyMethodDef Dtool_Methods_##CLASS_NAME[];\
 int         Dtool_Init_##CLASS_NAME(PyObject *self, PyObject *args, PyObject *kwds);\
 int         Dtool_Init_##CLASS_NAME(PyObject *self, PyObject *args, PyObject *kwds);\
-int         Dtool_InitNoCoerce_##CLASS_NAME(PyObject *self, PyObject *args, PyObject *kwds);\
+int         Dtool_InitNoCoerce_##CLASS_NAME(PyObject *self, PyObject *args);\
 PyObject *  Dtool_new_##CLASS_NAME(PyTypeObject *type, PyObject *args, PyObject *kwds);\
 PyObject *  Dtool_new_##CLASS_NAME(PyTypeObject *type, PyObject *args, PyObject *kwds);\
 void  *     Dtool_UpcastInterface_##CLASS_NAME(PyObject *self, Dtool_PyTypedObject *requested_type);\
 void  *     Dtool_UpcastInterface_##CLASS_NAME(PyObject *self, Dtool_PyTypedObject *requested_type);\
 void  *     Dtool_DowncastInterface_##CLASS_NAME(void *self, Dtool_PyTypedObject *requested_type);\
 void  *     Dtool_DowncastInterface_##CLASS_NAME(void *self, Dtool_PyTypedObject *requested_type);\

+ 0 - 0
dtool/src/parser-inc/cg.h → dtool/src/parser-inc/Cg/cg.h


+ 0 - 0
dtool/src/parser-inc/cgGL.h → dtool/src/parser-inc/Cg/cgGL.h


+ 0 - 0
dtool/src/parser-inc/Core.h → dtool/src/parser-inc/Core/Core.h


+ 0 - 0
dtool/src/parser-inc/Dense → dtool/src/parser-inc/Eigen/Dense


+ 0 - 0
dtool/src/parser-inc/StdVector → dtool/src/parser-inc/Eigen/StdVector


+ 0 - 0
dtool/src/parser-inc/Forest.h → dtool/src/parser-inc/Forest/Forest.h


+ 3 - 1
dtool/src/parser-inc/Python.h

@@ -20,7 +20,9 @@
 #ifndef PYTHON_H
 #ifndef PYTHON_H
 #define PYTHON_H
 #define PYTHON_H
 
 
-class PyObject;
+struct _object;
+typedef _object PyObject;
+
 class PyThreadState;
 class PyThreadState;
 typedef int Py_ssize_t;
 typedef int Py_ssize_t;
 struct Py_buffer;
 struct Py_buffer;

+ 0 - 0
dtool/src/parser-inc/DirectX9Renderer.h → dtool/src/parser-inc/Renderers/OpenGL/DirectX9Renderer.h


+ 0 - 0
dtool/src/parser-inc/OpenGLRenderer.h → dtool/src/parser-inc/Renderers/OpenGL/OpenGLRenderer.h


+ 0 - 0
dtool/src/parser-inc/RenderInterface.h → dtool/src/parser-inc/Rocket/Core/RenderInterface.h


+ 0 - 0
dtool/src/parser-inc/glew.h → dtool/src/parser-inc/glew/glew.h


+ 0 - 0
dtool/src/parser-inc/ip.h → dtool/src/parser-inc/netinet/ip.h


+ 0 - 0
dtool/src/parser-inc/tcp.h → dtool/src/parser-inc/netinet/tcp.h


+ 4 - 0
dtool/src/prc/configVariableCore.h

@@ -66,15 +66,19 @@ PUBLISHED:
   bool has_value() const;
   bool has_value() const;
   int get_num_declarations() const;
   int get_num_declarations() const;
   const ConfigDeclaration *get_declaration(int n) const;
   const ConfigDeclaration *get_declaration(int n) const;
+  MAKE_SEQ(get_declarations, get_num_declarations, get_declaration);
 
 
   INLINE int get_num_references() const;
   INLINE int get_num_references() const;
   INLINE const ConfigDeclaration *get_reference(int n) const;
   INLINE const ConfigDeclaration *get_reference(int n) const;
+  MAKE_SEQ(get_references, get_num_references, get_reference);
 
 
   INLINE int get_num_trusted_references() const;
   INLINE int get_num_trusted_references() const;
   INLINE const ConfigDeclaration *get_trusted_reference(int n) const;
   INLINE const ConfigDeclaration *get_trusted_reference(int n) const;
+  MAKE_SEQ(get_trusted_references, get_num_trusted_references, get_trusted_reference);
 
 
   INLINE int get_num_unique_references() const;
   INLINE int get_num_unique_references() const;
   INLINE const ConfigDeclaration *get_unique_reference(int n) const;
   INLINE const ConfigDeclaration *get_unique_reference(int n) const;
+  MAKE_SEQ(get_unique_references, get_num_unique_references, get_unique_reference);
 
 
   void output(ostream &out) const;
   void output(ostream &out) const;
   void write(ostream &out) const;
   void write(ostream &out) const;

+ 1 - 0
dtool/src/prc/configVariableManager.h

@@ -47,6 +47,7 @@ PUBLISHED:
 
 
   INLINE int get_num_variables() const;
   INLINE int get_num_variables() const;
   INLINE ConfigVariableCore *get_variable(int n) const;
   INLINE ConfigVariableCore *get_variable(int n) const;
+  MAKE_SEQ(get_variables, get_num_variables, get_variable);
   string get_variable_name(int n) const;
   string get_variable_name(int n) const;
   bool is_variable_used(int n) const;
   bool is_variable_used(int n) const;
 
 

+ 2 - 2
dtool/src/prc/notifyCategory.I

@@ -106,7 +106,7 @@ is_debug() const {
 //               methods are redefined to be static to make it more
 //               methods are redefined to be static to make it more
 //               obvious to the compiler.
 //               obvious to the compiler.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE bool NotifyCategory::
+CONSTEXPR bool NotifyCategory::
 is_spam() {
 is_spam() {
   return false;
   return false;
 }
 }
@@ -119,7 +119,7 @@ is_spam() {
 //               methods are redefined to be static to make it more
 //               methods are redefined to be static to make it more
 //               obvious to the compiler.
 //               obvious to the compiler.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE bool NotifyCategory::
+CONSTEXPR bool NotifyCategory::
 is_debug() {
 is_debug() {
   return false;
   return false;
 }
 }

+ 2 - 2
dtool/src/prc/notifyCategory.h

@@ -56,8 +56,8 @@ PUBLISHED:
   INLINE bool is_spam() const;
   INLINE bool is_spam() const;
   INLINE bool is_debug() const;
   INLINE bool is_debug() const;
 #else
 #else
-  INLINE static bool is_spam();
-  INLINE static bool is_debug();
+  CONSTEXPR static bool is_spam();
+  CONSTEXPR static bool is_debug();
 #endif
 #endif
   INLINE bool is_info() const;
   INLINE bool is_info() const;
   INLINE bool is_warning() const;
   INLINE bool is_warning() const;

+ 12 - 4
dtool/src/prc/notifyCategoryProxy.I

@@ -80,30 +80,38 @@ is_on(NotifySeverity severity) {
 //       Access: Public
 //       Access: Public
 //  Description:
 //  Description:
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
+#ifdef NOTIFY_DEBUG
 template<class GetCategory>
 template<class GetCategory>
 INLINE bool NotifyCategoryProxy<GetCategory>::
 INLINE bool NotifyCategoryProxy<GetCategory>::
 is_spam() {
 is_spam() {
-#ifdef NOTIFY_DEBUG
   return get_unsafe_ptr()->is_spam();
   return get_unsafe_ptr()->is_spam();
+}
 #else
 #else
+template<class GetCategory>
+CONSTEXPR bool NotifyCategoryProxy<GetCategory>::
+is_spam() {
   return false;
   return false;
-#endif
 }
 }
+#endif
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: NotifyCategoryProxy::is_debug
 //     Function: NotifyCategoryProxy::is_debug
 //       Access: Public
 //       Access: Public
 //  Description:
 //  Description:
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
+#ifdef NOTIFY_DEBUG
 template<class GetCategory>
 template<class GetCategory>
 INLINE bool NotifyCategoryProxy<GetCategory>::
 INLINE bool NotifyCategoryProxy<GetCategory>::
 is_debug() {
 is_debug() {
-#ifdef NOTIFY_DEBUG
   return get_unsafe_ptr()->is_debug();
   return get_unsafe_ptr()->is_debug();
+}
 #else
 #else
+template<class GetCategory>
+CONSTEXPR bool NotifyCategoryProxy<GetCategory>::
+is_debug() {
   return false;
   return false;
-#endif
 }
 }
+#endif
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: NotifyCategoryProxy::is_info
 //     Function: NotifyCategoryProxy::is_info

+ 2 - 2
dtool/src/prc/notifyCategoryProxy.h

@@ -85,8 +85,8 @@ public:
   INLINE bool is_spam();
   INLINE bool is_spam();
   INLINE bool is_debug();
   INLINE bool is_debug();
 #else
 #else
-  INLINE static bool is_spam();
-  INLINE static bool is_debug();
+  CONSTEXPR static bool is_spam();
+  CONSTEXPR static bool is_debug();
 #endif
 #endif
   INLINE bool is_info();
   INLINE bool is_info();
   INLINE bool is_warning();
   INLINE bool is_warning();

+ 20 - 0
dtool/src/pystub/pystub.cxx

@@ -18,6 +18,7 @@ extern "C" {
   EXPCL_PYSTUB int PyArg_Parse(...);
   EXPCL_PYSTUB int PyArg_Parse(...);
   EXPCL_PYSTUB int PyArg_ParseTuple(...);
   EXPCL_PYSTUB int PyArg_ParseTuple(...);
   EXPCL_PYSTUB int PyArg_ParseTupleAndKeywords(...);
   EXPCL_PYSTUB int PyArg_ParseTupleAndKeywords(...);
+  EXPCL_PYSTUB int PyArg_UnpackTuple(...);
   EXPCL_PYSTUB int PyBool_FromLong(...);
   EXPCL_PYSTUB int PyBool_FromLong(...);
   EXPCL_PYSTUB int PyBuffer_Release(...);
   EXPCL_PYSTUB int PyBuffer_Release(...);
   EXPCL_PYSTUB int PyBytes_AsString(...);
   EXPCL_PYSTUB int PyBytes_AsString(...);
@@ -84,11 +85,14 @@ extern "C" {
   EXPCL_PYSTUB int PyModule_AddObject(...);
   EXPCL_PYSTUB int PyModule_AddObject(...);
   EXPCL_PYSTUB int PyModule_AddStringConstant(...);
   EXPCL_PYSTUB int PyModule_AddStringConstant(...);
   EXPCL_PYSTUB int PyModule_Create2(...);
   EXPCL_PYSTUB int PyModule_Create2(...);
+  EXPCL_PYSTUB int PyNumber_Check(...);
   EXPCL_PYSTUB int PyNumber_Float(...);
   EXPCL_PYSTUB int PyNumber_Float(...);
+  EXPCL_PYSTUB int PyNumber_Int(...);
   EXPCL_PYSTUB int PyNumber_Long(...);
   EXPCL_PYSTUB int PyNumber_Long(...);
   EXPCL_PYSTUB int PyObject_ASCII(...);
   EXPCL_PYSTUB int PyObject_ASCII(...);
   EXPCL_PYSTUB int PyObject_Call(...);
   EXPCL_PYSTUB int PyObject_Call(...);
   EXPCL_PYSTUB int PyObject_CallFunction(...);
   EXPCL_PYSTUB int PyObject_CallFunction(...);
+  EXPCL_PYSTUB int PyObject_CallFunctionObjArgs(...);
   EXPCL_PYSTUB int PyObject_CallMethod(...);
   EXPCL_PYSTUB int PyObject_CallMethod(...);
   EXPCL_PYSTUB int PyObject_CallMethodObjArgs(...);
   EXPCL_PYSTUB int PyObject_CallMethodObjArgs(...);
   EXPCL_PYSTUB int PyObject_CallObject(...);
   EXPCL_PYSTUB int PyObject_CallObject(...);
@@ -152,8 +156,14 @@ extern "C" {
   EXPCL_PYSTUB int Py_InitModule4(...);
   EXPCL_PYSTUB int Py_InitModule4(...);
   EXPCL_PYSTUB int Py_InitModule4_64(...);
   EXPCL_PYSTUB int Py_InitModule4_64(...);
   EXPCL_PYSTUB int Py_InitModule4TraceRefs(...);
   EXPCL_PYSTUB int Py_InitModule4TraceRefs(...);
+  EXPCL_PYSTUB int _PyArg_ParseTuple_SizeT(...);
+  EXPCL_PYSTUB int _PyArg_ParseTupleAndKeywords_SizeT(...);
+  EXPCL_PYSTUB int _PyArg_Parse_SizeT(...);
+  EXPCL_PYSTUB int _PyObject_CallFunction_SizeT(...);
+  EXPCL_PYSTUB int _PyObject_CallMethod_SizeT(...);
   EXPCL_PYSTUB int _PyObject_DebugFree(...);
   EXPCL_PYSTUB int _PyObject_DebugFree(...);
   EXPCL_PYSTUB int _PyObject_Del(...);
   EXPCL_PYSTUB int _PyObject_Del(...);
+  EXPCL_PYSTUB int _Py_BuildValue_SizeT(...);
   EXPCL_PYSTUB int _Py_Dealloc(...);
   EXPCL_PYSTUB int _Py_Dealloc(...);
   EXPCL_PYSTUB int _Py_NegativeRefcount(...);
   EXPCL_PYSTUB int _Py_NegativeRefcount(...);
   EXPCL_PYSTUB int _Py_RefTotal(...);
   EXPCL_PYSTUB int _Py_RefTotal(...);
@@ -182,6 +192,7 @@ extern "C" {
 int PyArg_Parse(...) { return 0; };
 int PyArg_Parse(...) { return 0; };
 int PyArg_ParseTuple(...) { return 0; }
 int PyArg_ParseTuple(...) { return 0; }
 int PyArg_ParseTupleAndKeywords(...) { return 0; }
 int PyArg_ParseTupleAndKeywords(...) { return 0; }
+int PyArg_UnpackTuple(...) { return 0; };
 int PyBool_FromLong(...) { return 0; }
 int PyBool_FromLong(...) { return 0; }
 int PyBuffer_Release(...) { return 0; }
 int PyBuffer_Release(...) { return 0; }
 int PyBytes_AsString(...) { return 0; }
 int PyBytes_AsString(...) { return 0; }
@@ -248,11 +259,14 @@ int PyModule_AddIntConstant(...) { return 0; };
 int PyModule_AddObject(...) { return 0; };
 int PyModule_AddObject(...) { return 0; };
 int PyModule_AddStringConstant(...) { return 0; };
 int PyModule_AddStringConstant(...) { return 0; };
 int PyModule_Create2(...) { return 0; };
 int PyModule_Create2(...) { return 0; };
+int PyNumber_Check(...) { return 0; }
 int PyNumber_Float(...) { return 0; }
 int PyNumber_Float(...) { return 0; }
+int PyNumber_Int(...) { return 0; }
 int PyNumber_Long(...) { return 0; }
 int PyNumber_Long(...) { return 0; }
 int PyObject_ASCII(...) { return 0; }
 int PyObject_ASCII(...) { return 0; }
 int PyObject_Call(...) { return 0; }
 int PyObject_Call(...) { return 0; }
 int PyObject_CallFunction(...) { return 0; }
 int PyObject_CallFunction(...) { return 0; }
+int PyObject_CallFunctionObjArgs(...) { return 0; }
 int PyObject_CallMethod(...) { return 0; }
 int PyObject_CallMethod(...) { return 0; }
 int PyObject_CallMethodObjArgs(...) { return 0; }
 int PyObject_CallMethodObjArgs(...) { return 0; }
 int PyObject_CallObject(...) { return 0; }
 int PyObject_CallObject(...) { return 0; }
@@ -316,8 +330,14 @@ int Py_BuildValue(...) { return 0; }
 int Py_InitModule4(...) { return 0; }
 int Py_InitModule4(...) { return 0; }
 int Py_InitModule4_64(...) { return 0; }
 int Py_InitModule4_64(...) { return 0; }
 int Py_InitModule4TraceRefs(...) { return 0; };
 int Py_InitModule4TraceRefs(...) { return 0; };
+int _PyArg_ParseTuple_SizeT(...) { return 0; };
+int _PyArg_ParseTupleAndKeywords_SizeT(...) { return 0; };
+int _PyArg_Parse_SizeT(...) { return 0; };
+int _PyObject_CallFunction_SizeT(...) { return 0; };
+int _PyObject_CallMethod_SizeT(...) { return 0; };
 int _PyObject_DebugFree(...) { return 0; };
 int _PyObject_DebugFree(...) { return 0; };
 int _PyObject_Del(...) { return 0; };
 int _PyObject_Del(...) { return 0; };
+int _Py_BuildValue_SizeT(...) { return 0; };
 int _Py_Dealloc(...) { return 0; };
 int _Py_Dealloc(...) { return 0; };
 int _Py_NegativeRefcount(...) { return 0; };
 int _Py_NegativeRefcount(...) { return 0; };
 int _Py_RefTotal(...) { return 0; };
 int _Py_RefTotal(...) { return 0; };

+ 5 - 5
makepanda/installpanda.py

@@ -204,15 +204,15 @@ def InstallRuntime(destdir="", prefix="/usr", outputdir="built"):
         if sys.platform.startswith("freebsd"):
         if sys.platform.startswith("freebsd"):
             oscmd("mkdir -m 0755 -p "+destdir+libdir+"/browser_plugins/symlinks/gecko19")
             oscmd("mkdir -m 0755 -p "+destdir+libdir+"/browser_plugins/symlinks/gecko19")
             oscmd("mkdir -m 0755 -p "+destdir+libdir+"/libxul/plugins")
             oscmd("mkdir -m 0755 -p "+destdir+libdir+"/libxul/plugins")
-            oscmd("ln -s "+libdir+"/nppanda3d.so  "+destdir+libdir+"/browser_plugins/symlinks/gecko19/nppanda3d.so")
-            oscmd("ln -s "+libdir+"/nppanda3d.so  "+destdir+libdir+"/libxul/plugins/nppanda3d.so")
+            oscmd("ln -f -s "+libdir+"/nppanda3d.so  "+destdir+libdir+"/browser_plugins/symlinks/gecko19/nppanda3d.so")
+            oscmd("ln -f -s "+libdir+"/nppanda3d.so  "+destdir+libdir+"/libxul/plugins/nppanda3d.so")
         else:
         else:
             oscmd("mkdir -m 0755 -p "+destdir+libdir+"/mozilla/plugins")
             oscmd("mkdir -m 0755 -p "+destdir+libdir+"/mozilla/plugins")
             oscmd("mkdir -m 0755 -p "+destdir+libdir+"/mozilla-firefox/plugins")
             oscmd("mkdir -m 0755 -p "+destdir+libdir+"/mozilla-firefox/plugins")
             oscmd("mkdir -m 0755 -p "+destdir+libdir+"/xulrunner-addons/plugins")
             oscmd("mkdir -m 0755 -p "+destdir+libdir+"/xulrunner-addons/plugins")
-            oscmd("ln -s "+libdir+"/nppanda3d.so  "+destdir+libdir+"/mozilla/plugins/nppanda3d.so")
-            oscmd("ln -s "+libdir+"/nppanda3d.so  "+destdir+libdir+"/mozilla-firefox/plugins/nppanda3d.so")
-            oscmd("ln -s "+libdir+"/nppanda3d.so  "+destdir+libdir+"/xulrunner-addons/plugins/nppanda3d.so")
+            oscmd("ln -f -s "+libdir+"/nppanda3d.so  "+destdir+libdir+"/mozilla/plugins/nppanda3d.so")
+            oscmd("ln -f -s "+libdir+"/nppanda3d.so  "+destdir+libdir+"/mozilla-firefox/plugins/nppanda3d.so")
+            oscmd("ln -f -s "+libdir+"/nppanda3d.so  "+destdir+libdir+"/xulrunner-addons/plugins/nppanda3d.so")
     WriteMimeFile(destdir+prefix+"/share/mime-info/panda3d-runtime.mime", MIME_INFO_PLUGIN)
     WriteMimeFile(destdir+prefix+"/share/mime-info/panda3d-runtime.mime", MIME_INFO_PLUGIN)
     WriteKeysFile(destdir+prefix+"/share/mime-info/panda3d-runtime.keys", MIME_INFO_PLUGIN)
     WriteKeysFile(destdir+prefix+"/share/mime-info/panda3d-runtime.keys", MIME_INFO_PLUGIN)
     WriteMimeXMLFile(destdir+prefix+"/share/mime/packages/panda3d-runtime.xml", MIME_INFO_PLUGIN)
     WriteMimeXMLFile(destdir+prefix+"/share/mime/packages/panda3d-runtime.xml", MIME_INFO_PLUGIN)

+ 92 - 109
makepanda/makepanda.py

@@ -92,7 +92,7 @@ PkgListSet(["PYTHON", "DIRECT",                        # Python support
   "GTK2", "WX", "FLTK",                                # Toolkit support
   "GTK2", "WX", "FLTK",                                # Toolkit support
   "ROCKET",                                            # GUI libraries
   "ROCKET",                                            # GUI libraries
   "CARBON", "COCOA",                                   # Mac OS X toolkits
   "CARBON", "COCOA",                                   # Mac OS X toolkits
-  "OSMESA", "X11", "XF86DGA", "XRANDR", "XCURSOR",     # Unix platform support
+  "X11", "XF86DGA", "XRANDR", "XCURSOR",               # Unix platform support
   "PANDATOOL", "PVIEW", "DEPLOYTOOLS",                 # Toolchain
   "PANDATOOL", "PVIEW", "DEPLOYTOOLS",                 # Toolchain
   "SKEL",                                              # Example SKEL project
   "SKEL",                                              # Example SKEL project
   "PANDAFX",                                           # Some distortion special lenses 
   "PANDAFX",                                           # Some distortion special lenses 
@@ -697,7 +697,6 @@ if (COMPILER=="GCC"):
         SmartPkgEnable("GLES",      "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
         SmartPkgEnable("GLES",      "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
         SmartPkgEnable("GLES2",     "glesv2",    ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
         SmartPkgEnable("GLES2",     "glesv2",    ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
         SmartPkgEnable("EGL",       "egl",       ("EGL"), ("EGL/egl.h"))
         SmartPkgEnable("EGL",       "egl",       ("EGL"), ("EGL/egl.h"))
-        SmartPkgEnable("OSMESA",    "osmesa",    ("OSMesa"), ("GL/osmesa.h"))
         SmartPkgEnable("NVIDIACG",  "",          ("Cg"), "Cg/cg.h", framework = "Cg")
         SmartPkgEnable("NVIDIACG",  "",          ("Cg"), "Cg/cg.h", framework = "Cg")
         SmartPkgEnable("ODE",       "",          ("ode"), "ode/ode.h", tool = "ode-config")
         SmartPkgEnable("ODE",       "",          ("ode"), "ode/ode.h", tool = "ode-config")
         SmartPkgEnable("OPENAL",    "openal",    ("openal"), "AL/al.h", framework = "OpenAL")
         SmartPkgEnable("OPENAL",    "openal",    ("openal"), "AL/al.h", framework = "OpenAL")
@@ -715,12 +714,12 @@ if (COMPILER=="GCC"):
             # We use a statically linked libboost_python on OSX
             # We use a statically linked libboost_python on OSX
             rocket_libs += ("boost_python",)
             rocket_libs += ("boost_python",)
         SmartPkgEnable("ROCKET",    "",          rocket_libs, "Rocket/Core.h")
         SmartPkgEnable("ROCKET",    "",          rocket_libs, "Rocket/Core.h")
-        SmartPkgEnable("GTK2",      "gtk+-2.0")
 
 
     SmartPkgEnable("JPEG",      "",          ("jpeg"), "jpeglib.h")
     SmartPkgEnable("JPEG",      "",          ("jpeg"), "jpeglib.h")
     SmartPkgEnable("OPENSSL",   "openssl",   ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
     SmartPkgEnable("OPENSSL",   "openssl",   ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
     SmartPkgEnable("PNG",       "libpng",    ("png"), "png.h", tool = "libpng-config")
     SmartPkgEnable("PNG",       "libpng",    ("png"), "png.h", tool = "libpng-config")
     SmartPkgEnable("ZLIB",      "zlib",      ("z"), "zlib.h")
     SmartPkgEnable("ZLIB",      "zlib",      ("z"), "zlib.h")
+    SmartPkgEnable("GTK2",      "gtk+-2.0")
 
 
     if (RTDIST and GetHost() == "darwin" and "PYTHONVERSION" in SDK):
     if (RTDIST and GetHost() == "darwin" and "PYTHONVERSION" in SDK):
         # Don't use the framework for the OSX rtdist build. I'm afraid it gives problems somewhere.
         # Don't use the framework for the OSX rtdist build. I'm afraid it gives problems somewhere.
@@ -1901,9 +1900,6 @@ DTOOL_CONFIG=[
     ("HAVE_GL",                        '1',                      'UNDEF'),
     ("HAVE_GL",                        '1',                      'UNDEF'),
     ("HAVE_GLES",                      'UNDEF',                  'UNDEF'),
     ("HAVE_GLES",                      'UNDEF',                  'UNDEF'),
     ("HAVE_GLES2",                     'UNDEF',                  'UNDEF'),
     ("HAVE_GLES2",                     'UNDEF',                  'UNDEF'),
-    ("HAVE_MESA",                      'UNDEF',                  'UNDEF'),
-    ("MESA_MGL",                       'UNDEF',                  'UNDEF'),
-    ("HAVE_SGIGL",                     'UNDEF',                  'UNDEF'),
     ("HAVE_GLX",                       'UNDEF',                  '1'),
     ("HAVE_GLX",                       'UNDEF',                  '1'),
     ("HAVE_EGL",                       'UNDEF',                  'UNDEF'),
     ("HAVE_EGL",                       'UNDEF',                  'UNDEF'),
     ("HAVE_WGL",                       '1',                      'UNDEF'),
     ("HAVE_WGL",                       '1',                      'UNDEF'),
@@ -2973,7 +2969,7 @@ TargetAdd('p3express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx
 TargetAdd('p3express_ext_composite.obj', opts=OPTS, input='p3express_ext_composite.cxx')
 TargetAdd('p3express_ext_composite.obj', opts=OPTS, input='p3express_ext_composite.cxx')
 IGATEFILES=GetDirectoryContents('panda/src/express', ["*.h", "*_composite*.cxx"])
 IGATEFILES=GetDirectoryContents('panda/src/express', ["*.h", "*_composite*.cxx"])
 TargetAdd('libp3express.in', opts=OPTS, input=IGATEFILES)
 TargetAdd('libp3express.in', opts=OPTS, input=IGATEFILES)
-TargetAdd('libp3express.in', opts=['IMOD:core', 'ILIB:libp3express', 'SRCDIR:panda/src/express'])
+TargetAdd('libp3express.in', opts=['IMOD:panda3d.core', 'ILIB:libp3express', 'SRCDIR:panda/src/express'])
 TargetAdd('libp3express_igate.obj', input='libp3express.in', opts=["DEPENDENCYONLY"])
 TargetAdd('libp3express_igate.obj', input='libp3express.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -2985,7 +2981,7 @@ TargetAdd('p3downloader_composite1.obj', opts=OPTS, input='p3downloader_composit
 TargetAdd('p3downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
 TargetAdd('p3downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
 IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cxx"])
 IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cxx"])
 TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES)
 TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES)
-TargetAdd('libp3downloader.in', opts=['IMOD:core', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader'])
+TargetAdd('libp3downloader.in', opts=['IMOD:panda3d.core', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader'])
 TargetAdd('libp3downloader_igate.obj', input='libp3downloader.in', opts=["DEPENDENCYONLY"])
 TargetAdd('libp3downloader_igate.obj', input='libp3downloader.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3017,7 +3013,7 @@ if (not RUNTIME):
   TargetAdd('p3pipeline_contextSwitch.obj', opts=OPTS, input='contextSwitch.c')
   TargetAdd('p3pipeline_contextSwitch.obj', opts=OPTS, input='contextSwitch.c')
   IGATEFILES=GetDirectoryContents('panda/src/pipeline', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/pipeline', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3pipeline.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3pipeline.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3pipeline.in', opts=['IMOD:core', 'ILIB:libp3pipeline', 'SRCDIR:panda/src/pipeline'])
+  TargetAdd('libp3pipeline.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pipeline', 'SRCDIR:panda/src/pipeline'])
   TargetAdd('libp3pipeline_igate.obj', input='libp3pipeline.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3pipeline_igate.obj', input='libp3pipeline.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3031,7 +3027,7 @@ if (not RUNTIME):
   IGATEFILES=GetDirectoryContents('panda/src/putil', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/putil', ["*.h", "*_composite*.cxx"])
   IGATEFILES.remove("test_bam.h")
   IGATEFILES.remove("test_bam.h")
   TargetAdd('libp3putil.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3putil.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3putil.in', opts=['IMOD:core', 'ILIB:libp3putil', 'SRCDIR:panda/src/putil'])
+  TargetAdd('libp3putil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3putil', 'SRCDIR:panda/src/putil'])
   TargetAdd('libp3putil_igate.obj', input='libp3putil.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3putil_igate.obj', input='libp3putil.in', opts=["DEPENDENCYONLY"])
   TargetAdd('p3putil_typedWritable_ext.obj', opts=OPTS, input='typedWritable_ext.cxx')
   TargetAdd('p3putil_typedWritable_ext.obj', opts=OPTS, input='typedWritable_ext.cxx')
 
 
@@ -3044,7 +3040,7 @@ if (not RUNTIME):
   TargetAdd('p3audio_composite1.obj', opts=OPTS, input='p3audio_composite1.cxx')
   TargetAdd('p3audio_composite1.obj', opts=OPTS, input='p3audio_composite1.cxx')
   IGATEFILES=["audio.h"]
   IGATEFILES=["audio.h"]
   TargetAdd('libp3audio.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3audio.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3audio.in', opts=['IMOD:core', 'ILIB:libp3audio', 'SRCDIR:panda/src/audio'])
+  TargetAdd('libp3audio.in', opts=['IMOD:panda3d.core', 'ILIB:libp3audio', 'SRCDIR:panda/src/audio'])
   TargetAdd('libp3audio_igate.obj', input='libp3audio.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3audio_igate.obj', input='libp3audio.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3057,7 +3053,7 @@ if (not RUNTIME):
   TargetAdd('p3event_composite2.obj', opts=OPTS, input='p3event_composite2.cxx')
   TargetAdd('p3event_composite2.obj', opts=OPTS, input='p3event_composite2.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/event', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/event', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3event.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3event.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3event.in', opts=['IMOD:core', 'ILIB:libp3event', 'SRCDIR:panda/src/event'])
+  TargetAdd('libp3event.in', opts=['IMOD:panda3d.core', 'ILIB:libp3event', 'SRCDIR:panda/src/event'])
   TargetAdd('libp3event_igate.obj', input='libp3event.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3event_igate.obj', input='libp3event.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3076,7 +3072,7 @@ if (not RUNTIME):
   IGATEFILES.remove('lmat_ops.h')
   IGATEFILES.remove('lmat_ops.h')
   IGATEFILES.remove('cast_to_float.h')
   IGATEFILES.remove('cast_to_float.h')
   TargetAdd('libp3linmath.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3linmath.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3linmath.in', opts=['IMOD:core', 'ILIB:libp3linmath', 'SRCDIR:panda/src/linmath'])
+  TargetAdd('libp3linmath.in', opts=['IMOD:panda3d.core', 'ILIB:libp3linmath', 'SRCDIR:panda/src/linmath'])
   TargetAdd('libp3linmath_igate.obj', input='libp3linmath.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3linmath_igate.obj', input='libp3linmath.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3089,7 +3085,7 @@ if (not RUNTIME):
   TargetAdd('p3mathutil_composite2.obj', opts=OPTS, input='p3mathutil_composite2.cxx')
   TargetAdd('p3mathutil_composite2.obj', opts=OPTS, input='p3mathutil_composite2.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/mathutil', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/mathutil', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3mathutil.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3mathutil.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3mathutil.in', opts=['IMOD:core', 'ILIB:libp3mathutil', 'SRCDIR:panda/src/mathutil'])
+  TargetAdd('libp3mathutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3mathutil', 'SRCDIR:panda/src/mathutil'])
   TargetAdd('libp3mathutil_igate.obj', input='libp3mathutil.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3mathutil_igate.obj', input='libp3mathutil.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3101,7 +3097,7 @@ if (not RUNTIME):
   TargetAdd('p3gsgbase_composite1.obj', opts=OPTS, input='p3gsgbase_composite1.cxx')
   TargetAdd('p3gsgbase_composite1.obj', opts=OPTS, input='p3gsgbase_composite1.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/gsgbase', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/gsgbase', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3gsgbase.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3gsgbase.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3gsgbase.in', opts=['IMOD:core', 'ILIB:libp3gsgbase', 'SRCDIR:panda/src/gsgbase'])
+  TargetAdd('libp3gsgbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gsgbase', 'SRCDIR:panda/src/gsgbase'])
   TargetAdd('libp3gsgbase_igate.obj', input='libp3gsgbase.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3gsgbase_igate.obj', input='libp3gsgbase.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3114,7 +3110,7 @@ if (not RUNTIME):
   TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx')
   TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3pnmimage.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3pnmimage.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3pnmimage.in', opts=['IMOD:core', 'ILIB:libp3pnmimage', 'SRCDIR:panda/src/pnmimage'])
+  TargetAdd('libp3pnmimage.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmimage', 'SRCDIR:panda/src/pnmimage'])
   TargetAdd('libp3pnmimage_igate.obj', input='libp3pnmimage.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3pnmimage_igate.obj', input='libp3pnmimage.in', opts=["DEPENDENCYONLY"])
   TargetAdd('p3pnmimage_pfmFile_ext.obj', opts=OPTS, input='pfmFile_ext.cxx')
   TargetAdd('p3pnmimage_pfmFile_ext.obj', opts=OPTS, input='pfmFile_ext.cxx')
 
 
@@ -3127,7 +3123,7 @@ if (not RUNTIME):
   TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx')
   TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3nativenet.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3nativenet.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3nativenet.in', opts=['IMOD:core', 'ILIB:libp3nativenet', 'SRCDIR:panda/src/nativenet'])
+  TargetAdd('libp3nativenet.in', opts=['IMOD:panda3d.core', 'ILIB:libp3nativenet', 'SRCDIR:panda/src/nativenet'])
   TargetAdd('libp3nativenet_igate.obj', input='libp3nativenet.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3nativenet_igate.obj', input='libp3nativenet.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3141,7 +3137,7 @@ if (not RUNTIME):
   IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"])
   IGATEFILES.remove("datagram_ui.h")
   IGATEFILES.remove("datagram_ui.h")
   TargetAdd('libp3net.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3net.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3net.in', opts=['IMOD:core', 'ILIB:libp3net', 'SRCDIR:panda/src/net'])
+  TargetAdd('libp3net.in', opts=['IMOD:panda3d.core', 'ILIB:libp3net', 'SRCDIR:panda/src/net'])
   TargetAdd('libp3net_igate.obj', input='libp3net.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3net_igate.obj', input='libp3net.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3154,7 +3150,7 @@ if (not RUNTIME):
   TargetAdd('p3pstatclient_composite2.obj', opts=OPTS, input='p3pstatclient_composite2.cxx')
   TargetAdd('p3pstatclient_composite2.obj', opts=OPTS, input='p3pstatclient_composite2.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/pstatclient', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/pstatclient', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3pstatclient.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3pstatclient.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3pstatclient.in', opts=['IMOD:core', 'ILIB:libp3pstatclient', 'SRCDIR:panda/src/pstatclient'])
+  TargetAdd('libp3pstatclient.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pstatclient', 'SRCDIR:panda/src/pstatclient'])
   TargetAdd('libp3pstatclient_igate.obj', input='libp3pstatclient.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3pstatclient_igate.obj', input='libp3pstatclient.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3168,7 +3164,7 @@ if (not RUNTIME):
   IGATEFILES=GetDirectoryContents('panda/src/gobj', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/gobj', ["*.h", "*_composite*.cxx"])
   if ("cgfx_states.h" in IGATEFILES): IGATEFILES.remove("cgfx_states.h")
   if ("cgfx_states.h" in IGATEFILES): IGATEFILES.remove("cgfx_states.h")
   TargetAdd('libp3gobj.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3gobj.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3gobj.in', opts=['IMOD:core', 'ILIB:libp3gobj', 'SRCDIR:panda/src/gobj'])
+  TargetAdd('libp3gobj.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gobj', 'SRCDIR:panda/src/gobj'])
   TargetAdd('libp3gobj_igate.obj', input='libp3gobj.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3gobj_igate.obj', input='libp3gobj.in', opts=["DEPENDENCYONLY"])
   TargetAdd('p3gobj_geomVertexArrayData_ext.obj', opts=OPTS, input='geomVertexArrayData_ext.cxx')
   TargetAdd('p3gobj_geomVertexArrayData_ext.obj', opts=OPTS, input='geomVertexArrayData_ext.cxx')
 
 
@@ -3182,7 +3178,7 @@ if (not RUNTIME):
   TargetAdd('p3pgraphnodes_composite2.obj', opts=OPTS, input='p3pgraphnodes_composite2.cxx')
   TargetAdd('p3pgraphnodes_composite2.obj', opts=OPTS, input='p3pgraphnodes_composite2.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/pgraphnodes', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/pgraphnodes', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3pgraphnodes.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3pgraphnodes.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3pgraphnodes.in', opts=['IMOD:core', 'ILIB:libp3pgraphnodes', 'SRCDIR:panda/src/pgraphnodes'])
+  TargetAdd('libp3pgraphnodes.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraphnodes', 'SRCDIR:panda/src/pgraphnodes'])
   TargetAdd('libp3pgraphnodes_igate.obj', input='libp3pgraphnodes.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3pgraphnodes_igate.obj', input='libp3pgraphnodes.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3198,10 +3194,9 @@ if (not RUNTIME):
   TargetAdd('p3pgraph_composite4.obj', opts=OPTS, input='p3pgraph_composite4.cxx')
   TargetAdd('p3pgraph_composite4.obj', opts=OPTS, input='p3pgraph_composite4.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/pgraph', ["*.h", "nodePath.cxx", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/pgraph', ["*.h", "nodePath.cxx", "*_composite*.cxx"])
   TargetAdd('libp3pgraph.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3pgraph.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3pgraph.in', opts=['IMOD:core', 'ILIB:libp3pgraph', 'SRCDIR:panda/src/pgraph'])
+  TargetAdd('libp3pgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraph', 'SRCDIR:panda/src/pgraph'])
   TargetAdd('libp3pgraph_igate.obj', input='libp3pgraph.in', opts=["DEPENDENCYONLY","BIGOBJ"])
   TargetAdd('libp3pgraph_igate.obj', input='libp3pgraph.in', opts=["DEPENDENCYONLY","BIGOBJ"])
-  TargetAdd('p3pgraph_nodePath_ext.obj', opts=OPTS, input='nodePath_ext.cxx')
-  TargetAdd('p3pgraph_nodePathCollection_ext.obj', opts=OPTS, input='nodePathCollection_ext.cxx')
+  TargetAdd('p3pgraph_ext_composite.obj', opts=OPTS, input='p3pgraph_ext_composite.cxx')
 
 
 #
 #
 # DIRECTORY: panda/src/cull/
 # DIRECTORY: panda/src/cull/
@@ -3213,7 +3208,7 @@ if (not RUNTIME):
   TargetAdd('p3cull_composite2.obj', opts=OPTS, input='p3cull_composite2.cxx')
   TargetAdd('p3cull_composite2.obj', opts=OPTS, input='p3cull_composite2.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/cull', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/cull', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3cull.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3cull.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3cull.in', opts=['IMOD:core', 'ILIB:libp3cull', 'SRCDIR:panda/src/cull'])
+  TargetAdd('libp3cull.in', opts=['IMOD:panda3d.core', 'ILIB:libp3cull', 'SRCDIR:panda/src/cull'])
   TargetAdd('libp3cull_igate.obj', input='libp3cull.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3cull_igate.obj', input='libp3cull.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3228,7 +3223,7 @@ if (not RUNTIME):
   IGATEFILES.remove('movingPart.h')
   IGATEFILES.remove('movingPart.h')
   IGATEFILES.remove('animChannelFixed.h')
   IGATEFILES.remove('animChannelFixed.h')
   TargetAdd('libp3chan.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3chan.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3chan.in', opts=['IMOD:core', 'ILIB:libp3chan', 'SRCDIR:panda/src/chan'])
+  TargetAdd('libp3chan.in', opts=['IMOD:panda3d.core', 'ILIB:libp3chan', 'SRCDIR:panda/src/chan'])
   TargetAdd('libp3chan_igate.obj', input='libp3chan.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3chan_igate.obj', input='libp3chan.in', opts=["DEPENDENCYONLY"])
 
 
 
 
@@ -3241,7 +3236,7 @@ if (not RUNTIME):
   TargetAdd('p3char_composite2.obj', opts=OPTS, input='p3char_composite2.cxx')
   TargetAdd('p3char_composite2.obj', opts=OPTS, input='p3char_composite2.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/char', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/char', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3char.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3char.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3char.in', opts=['IMOD:core', 'ILIB:libp3char', 'SRCDIR:panda/src/char'])
+  TargetAdd('libp3char.in', opts=['IMOD:panda3d.core', 'ILIB:libp3char', 'SRCDIR:panda/src/char'])
   TargetAdd('libp3char_igate.obj', input='libp3char.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3char_igate.obj', input='libp3char.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3254,7 +3249,7 @@ if (not RUNTIME):
   TargetAdd('p3dgraph_composite2.obj', opts=OPTS, input='p3dgraph_composite2.cxx')
   TargetAdd('p3dgraph_composite2.obj', opts=OPTS, input='p3dgraph_composite2.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/dgraph', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/dgraph', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3dgraph.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3dgraph.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3dgraph.in', opts=['IMOD:core', 'ILIB:libp3dgraph', 'SRCDIR:panda/src/dgraph'])
+  TargetAdd('libp3dgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dgraph', 'SRCDIR:panda/src/dgraph'])
   TargetAdd('libp3dgraph_igate.obj', input='libp3dgraph.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3dgraph_igate.obj', input='libp3dgraph.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3268,7 +3263,7 @@ if (not RUNTIME):
   IGATEFILES=GetDirectoryContents('panda/src/display', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/display', ["*.h", "*_composite*.cxx"])
   IGATEFILES.remove("renderBuffer.h")
   IGATEFILES.remove("renderBuffer.h")
   TargetAdd('libp3display.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3display.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3display.in', opts=['IMOD:core', 'ILIB:libp3display', 'SRCDIR:panda/src/display'])
+  TargetAdd('libp3display.in', opts=['IMOD:panda3d.core', 'ILIB:libp3display', 'SRCDIR:panda/src/display'])
   TargetAdd('libp3display_igate.obj', input='libp3display.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3display_igate.obj', input='libp3display.in', opts=["DEPENDENCYONLY"])
   TargetAdd('p3display_graphicsStateGuardian_ext.obj', opts=OPTS, input='graphicsStateGuardian_ext.cxx')
   TargetAdd('p3display_graphicsStateGuardian_ext.obj', opts=OPTS, input='graphicsStateGuardian_ext.cxx')
 
 
@@ -3287,7 +3282,7 @@ if (not RUNTIME):
   TargetAdd('p3device_composite2.obj', opts=OPTS, input='p3device_composite2.cxx')
   TargetAdd('p3device_composite2.obj', opts=OPTS, input='p3device_composite2.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/device', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/device', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3device.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3device.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3device.in', opts=['IMOD:core', 'ILIB:libp3device', 'SRCDIR:panda/src/device'])
+  TargetAdd('libp3device.in', opts=['IMOD:panda3d.core', 'ILIB:libp3device', 'SRCDIR:panda/src/device'])
   TargetAdd('libp3device_igate.obj', input='libp3device.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3device_igate.obj', input='libp3device.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3299,7 +3294,7 @@ if (PkgSkip("FREETYPE")==0 and not RUNTIME):
   TargetAdd('p3pnmtext_composite1.obj', opts=OPTS, input='p3pnmtext_composite1.cxx')
   TargetAdd('p3pnmtext_composite1.obj', opts=OPTS, input='p3pnmtext_composite1.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/pnmtext', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/pnmtext', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3pnmtext.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3pnmtext.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3pnmtext.in', opts=['IMOD:core', 'ILIB:libp3pnmtext', 'SRCDIR:panda/src/pnmtext'])
+  TargetAdd('libp3pnmtext.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmtext', 'SRCDIR:panda/src/pnmtext'])
   TargetAdd('libp3pnmtext_igate.obj', input='libp3pnmtext.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3pnmtext_igate.obj', input='libp3pnmtext.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3312,7 +3307,7 @@ if (not RUNTIME):
   TargetAdd('p3text_composite2.obj', opts=OPTS, input='p3text_composite2.cxx')
   TargetAdd('p3text_composite2.obj', opts=OPTS, input='p3text_composite2.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/text', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/text', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3text.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3text.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3text.in', opts=['IMOD:core', 'ILIB:libp3text', 'SRCDIR:panda/src/text'])
+  TargetAdd('libp3text.in', opts=['IMOD:panda3d.core', 'ILIB:libp3text', 'SRCDIR:panda/src/text'])
   TargetAdd('libp3text_igate.obj', input='libp3text.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3text_igate.obj', input='libp3text.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3324,7 +3319,7 @@ if (not RUNTIME):
   TargetAdd('p3movies_composite1.obj', opts=OPTS, input='p3movies_composite1.cxx')
   TargetAdd('p3movies_composite1.obj', opts=OPTS, input='p3movies_composite1.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/movies', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/movies', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3movies.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3movies.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3movies.in', opts=['IMOD:core', 'ILIB:libp3movies', 'SRCDIR:panda/src/movies'])
+  TargetAdd('libp3movies.in', opts=['IMOD:panda3d.core', 'ILIB:libp3movies', 'SRCDIR:panda/src/movies'])
   TargetAdd('libp3movies_igate.obj', input='libp3movies.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3movies_igate.obj', input='libp3movies.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3339,7 +3334,7 @@ if (not RUNTIME):
   IGATEFILES=GetDirectoryContents('panda/src/grutil', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/grutil', ["*.h", "*_composite*.cxx"])
   if 'convexHull.h' in IGATEFILES: IGATEFILES.remove('convexHull.h')
   if 'convexHull.h' in IGATEFILES: IGATEFILES.remove('convexHull.h')
   TargetAdd('libp3grutil.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3grutil.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3grutil.in', opts=['IMOD:core', 'ILIB:libp3grutil', 'SRCDIR:panda/src/grutil'])
+  TargetAdd('libp3grutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3grutil', 'SRCDIR:panda/src/grutil'])
   TargetAdd('libp3grutil_igate.obj', input='libp3grutil.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3grutil_igate.obj', input='libp3grutil.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3352,7 +3347,7 @@ if (not RUNTIME):
   TargetAdd('p3tform_composite2.obj', opts=OPTS, input='p3tform_composite2.cxx')
   TargetAdd('p3tform_composite2.obj', opts=OPTS, input='p3tform_composite2.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/tform', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/tform', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3tform.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3tform.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3tform.in', opts=['IMOD:core', 'ILIB:libp3tform', 'SRCDIR:panda/src/tform'])
+  TargetAdd('libp3tform.in', opts=['IMOD:panda3d.core', 'ILIB:libp3tform', 'SRCDIR:panda/src/tform'])
   TargetAdd('libp3tform_igate.obj', input='libp3tform.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3tform_igate.obj', input='libp3tform.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3365,7 +3360,7 @@ if (not RUNTIME):
   TargetAdd('p3collide_composite2.obj', opts=OPTS, input='p3collide_composite2.cxx')
   TargetAdd('p3collide_composite2.obj', opts=OPTS, input='p3collide_composite2.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/collide', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/collide', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3collide.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3collide.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3collide.in', opts=['IMOD:core', 'ILIB:libp3collide', 'SRCDIR:panda/src/collide'])
+  TargetAdd('libp3collide.in', opts=['IMOD:panda3d.core', 'ILIB:libp3collide', 'SRCDIR:panda/src/collide'])
   TargetAdd('libp3collide_igate.obj', input='libp3collide.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3collide_igate.obj', input='libp3collide.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3378,7 +3373,7 @@ if (not RUNTIME):
   TargetAdd('p3parametrics_composite2.obj', opts=OPTS, input='p3parametrics_composite2.cxx')
   TargetAdd('p3parametrics_composite2.obj', opts=OPTS, input='p3parametrics_composite2.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/parametrics', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/parametrics', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3parametrics.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3parametrics.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3parametrics.in', opts=['IMOD:core', 'ILIB:libp3parametrics', 'SRCDIR:panda/src/parametrics'])
+  TargetAdd('libp3parametrics.in', opts=['IMOD:panda3d.core', 'ILIB:libp3parametrics', 'SRCDIR:panda/src/parametrics'])
   TargetAdd('libp3parametrics_igate.obj', input='libp3parametrics.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3parametrics_igate.obj', input='libp3parametrics.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3391,7 +3386,7 @@ if (not RUNTIME):
   TargetAdd('p3pgui_composite2.obj', opts=OPTS, input='p3pgui_composite2.cxx')
   TargetAdd('p3pgui_composite2.obj', opts=OPTS, input='p3pgui_composite2.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/pgui', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/pgui', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3pgui.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3pgui.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3pgui.in', opts=['IMOD:core', 'ILIB:libp3pgui', 'SRCDIR:panda/src/pgui'])
+  TargetAdd('libp3pgui.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgui', 'SRCDIR:panda/src/pgui'])
   TargetAdd('libp3pgui_igate.obj', input='libp3pgui.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3pgui_igate.obj', input='libp3pgui.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3413,7 +3408,7 @@ if (not RUNTIME):
   TargetAdd('p3recorder_composite2.obj', opts=OPTS, input='p3recorder_composite2.cxx')
   TargetAdd('p3recorder_composite2.obj', opts=OPTS, input='p3recorder_composite2.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/recorder', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/recorder', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3recorder.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3recorder.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3recorder.in', opts=['IMOD:core', 'ILIB:libp3recorder', 'SRCDIR:panda/src/recorder'])
+  TargetAdd('libp3recorder.in', opts=['IMOD:panda3d.core', 'ILIB:libp3recorder', 'SRCDIR:panda/src/recorder'])
   TargetAdd('libp3recorder_igate.obj', input='libp3recorder.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3recorder_igate.obj', input='libp3recorder.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3432,7 +3427,7 @@ if (not RUNTIME):
   TargetAdd('p3dxml_composite1.obj', opts=OPTS, input='p3dxml_composite1.cxx')
   TargetAdd('p3dxml_composite1.obj', opts=OPTS, input='p3dxml_composite1.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/dxml', ["*.h", "p3dxml_composite1.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/dxml', ["*.h", "p3dxml_composite1.cxx"])
   TargetAdd('libp3dxml.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3dxml.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3dxml.in', opts=['IMOD:core', 'ILIB:libp3dxml', 'SRCDIR:panda/src/dxml'])
+  TargetAdd('libp3dxml.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dxml', 'SRCDIR:panda/src/dxml'])
   TargetAdd('libp3dxml_igate.obj', input='libp3dxml.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3dxml_igate.obj', input='libp3dxml.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3543,8 +3538,7 @@ if (not RUNTIME):
   TargetAdd('libpanda.dll', input='p3putil_typedWritable_ext.obj')
   TargetAdd('libpanda.dll', input='p3putil_typedWritable_ext.obj')
   TargetAdd('libpanda.dll', input='p3pnmimage_pfmFile_ext.obj')
   TargetAdd('libpanda.dll', input='p3pnmimage_pfmFile_ext.obj')
   TargetAdd('libpanda.dll', input='p3gobj_geomVertexArrayData_ext.obj')
   TargetAdd('libpanda.dll', input='p3gobj_geomVertexArrayData_ext.obj')
-  TargetAdd('libpanda.dll', input='p3pgraph_nodePath_ext.obj')
-  TargetAdd('libpanda.dll', input='p3pgraph_nodePathCollection_ext.obj')
+  TargetAdd('libpanda.dll', input='p3pgraph_ext_composite.obj')
   TargetAdd('libpanda.dll', input='p3display_graphicsStateGuardian_ext.obj')
   TargetAdd('libpanda.dll', input='p3display_graphicsStateGuardian_ext.obj')
 
 
   if PkgSkip("FREETYPE")==0:
   if PkgSkip("FREETYPE")==0:
@@ -3590,7 +3584,7 @@ if (not RUNTIME):
   if PkgSkip("FREETYPE")==0:
   if PkgSkip("FREETYPE")==0:
     TargetAdd('core_module.obj', input='libp3pnmtext.in')
     TargetAdd('core_module.obj', input='libp3pnmtext.in')
 
 
-  TargetAdd('core_module.obj', opts=['IMOD:core', 'ILIB:core'])
+  TargetAdd('core_module.obj', opts=['IMOD:panda3d.core', 'ILIB:core'])
 
 
   TargetAdd('core.pyd', input='core_module.obj')
   TargetAdd('core.pyd', input='core_module.obj')
   TargetAdd('core.pyd', input=COMMON_PANDA_LIBS)
   TargetAdd('core.pyd', input=COMMON_PANDA_LIBS)
@@ -3611,12 +3605,12 @@ if (PkgSkip("VISION") == 0) and (not RUNTIME):
   OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG']
   OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG']
   IGATEFILES=GetDirectoryContents('panda/src/vision', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/vision', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3vision.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3vision.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3vision.in', opts=['IMOD:vision', 'ILIB:libp3vision', 'SRCDIR:panda/src/vision'])
+  TargetAdd('libp3vision.in', opts=['IMOD:panda3d.vision', 'ILIB:libp3vision', 'SRCDIR:panda/src/vision'])
   TargetAdd('libp3vision_igate.obj', input='libp3vision.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3vision_igate.obj', input='libp3vision.in', opts=["DEPENDENCYONLY"])
 
 
   TargetAdd('vision_module.obj', input='libp3vision.in')
   TargetAdd('vision_module.obj', input='libp3vision.in')
   TargetAdd('vision_module.obj', opts=OPTS)
   TargetAdd('vision_module.obj', opts=OPTS)
-  TargetAdd('vision_module.obj', opts=['IMOD:vision', 'ILIB:vision'])
+  TargetAdd('vision_module.obj', opts=['IMOD:panda3d.vision', 'ILIB:vision'])
 
 
   TargetAdd('vision.pyd', input='vision_module.obj')
   TargetAdd('vision.pyd', input='vision_module.obj')
   TargetAdd('vision.pyd', input='libp3vision_igate.obj')
   TargetAdd('vision.pyd', input='libp3vision_igate.obj')
@@ -3641,13 +3635,13 @@ if (PkgSkip("ROCKET") == 0) and (not RUNTIME):
   IGATEFILES=GetDirectoryContents('panda/src/rocket', ["rocketInputHandler.h",
   IGATEFILES=GetDirectoryContents('panda/src/rocket', ["rocketInputHandler.h",
     "rocketInputHandler.cxx", "rocketRegion.h", "rocketRegion.cxx", "rocketRegion_ext.h"])
     "rocketInputHandler.cxx", "rocketRegion.h", "rocketRegion.cxx", "rocketRegion_ext.h"])
   TargetAdd('libp3rocket.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3rocket.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3rocket.in', opts=['IMOD:rocket', 'ILIB:libp3rocket', 'SRCDIR:panda/src/rocket'])
+  TargetAdd('libp3rocket.in', opts=['IMOD:panda3d.rocket', 'ILIB:libp3rocket', 'SRCDIR:panda/src/rocket'])
   TargetAdd('libp3rocket_igate.obj', input='libp3rocket.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3rocket_igate.obj', input='libp3rocket.in', opts=["DEPENDENCYONLY"])
   TargetAdd('p3rocket_rocketRegion_ext.obj', opts=OPTS, input='rocketRegion_ext.cxx')
   TargetAdd('p3rocket_rocketRegion_ext.obj', opts=OPTS, input='rocketRegion_ext.cxx')
 
 
   TargetAdd('rocket_module.obj', input='libp3rocket.in')
   TargetAdd('rocket_module.obj', input='libp3rocket.in')
   TargetAdd('rocket_module.obj', opts=OPTS)
   TargetAdd('rocket_module.obj', opts=OPTS)
-  TargetAdd('rocket_module.obj', opts=['IMOD:rocket', 'ILIB:rocket'])
+  TargetAdd('rocket_module.obj', opts=['IMOD:panda3d.rocket', 'ILIB:rocket'])
 
 
   TargetAdd('rocket.pyd', input='rocket_module.obj')
   TargetAdd('rocket.pyd', input='rocket_module.obj')
   TargetAdd('rocket.pyd', input='libp3rocket_igate.obj')
   TargetAdd('rocket.pyd', input='libp3rocket_igate.obj')
@@ -3670,12 +3664,12 @@ if PkgSkip("AWESOMIUM") == 0 and not RUNTIME:
   OPTS=['DIR:panda/src/awesomium', 'AWESOMIUM']
   OPTS=['DIR:panda/src/awesomium', 'AWESOMIUM']
   IGATEFILES=GetDirectoryContents('panda/src/awesomium', ["*.h", "*_composite1.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/awesomium', ["*.h", "*_composite1.cxx"])
   TargetAdd('libp3awesomium.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3awesomium.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3awesomium.in', opts=['IMOD:awesomium', 'ILIB:libp3awesomium', 'SRCDIR:panda/src/awesomium'])
+  TargetAdd('libp3awesomium.in', opts=['IMOD:panda3d.awesomium', 'ILIB:libp3awesomium', 'SRCDIR:panda/src/awesomium'])
   TargetAdd('libp3awesomium_igate.obj', input='libp3awesomium.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3awesomium_igate.obj', input='libp3awesomium.in', opts=["DEPENDENCYONLY"])
 
 
   TargetAdd('awesomium_module.obj', input='libp3awesomium.in')
   TargetAdd('awesomium_module.obj', input='libp3awesomium.in')
   TargetAdd('awesomium_module.obj', opts=OPTS)
   TargetAdd('awesomium_module.obj', opts=OPTS)
-  TargetAdd('awesomium_module.obj', opts=['IMOD:awesomium', 'ILIB:awesomium'])
+  TargetAdd('awesomium_module.obj', opts=['IMOD:panda3d.awesomium', 'ILIB:awesomium'])
 
 
   TargetAdd('awesomium.pyd', input='awesomium_module.obj')
   TargetAdd('awesomium.pyd', input='awesomium_module.obj')
   TargetAdd('awesomium.pyd', input='libp3awesomium_igate.obj')
   TargetAdd('awesomium.pyd', input='libp3awesomium_igate.obj')
@@ -3695,7 +3689,7 @@ if (PkgSkip('SKEL')==0) and (not RUNTIME):
   OPTS=['DIR:panda/src/skel', 'ADVAPI']
   OPTS=['DIR:panda/src/skel', 'ADVAPI']
   IGATEFILES=GetDirectoryContents("panda/src/skel", ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents("panda/src/skel", ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3skel.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3skel.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3skel.in', opts=['IMOD:skel', 'ILIB:libp3skel', 'SRCDIR:panda/src/skel'])
+  TargetAdd('libp3skel.in', opts=['IMOD:panda3d.skel', 'ILIB:libp3skel', 'SRCDIR:panda/src/skel'])
   TargetAdd('libp3skel_igate.obj', input='libp3skel.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3skel_igate.obj', input='libp3skel.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3709,7 +3703,7 @@ if (PkgSkip('SKEL')==0) and (not RUNTIME):
   TargetAdd('libpandaskel.dll', opts=OPTS)
   TargetAdd('libpandaskel.dll', opts=OPTS)
 
 
   TargetAdd('skel_module.obj', input='libp3skel.in')
   TargetAdd('skel_module.obj', input='libp3skel.in')
-  TargetAdd('skel_module.obj', opts=['IMOD:skel', 'ILIB:skel'])
+  TargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel'])
 
 
   TargetAdd('skel.pyd', input='skel_module.obj')
   TargetAdd('skel.pyd', input='skel_module.obj')
   TargetAdd('skel.pyd', input='libp3skel_igate.obj')
   TargetAdd('skel.pyd', input='libp3skel_igate.obj')
@@ -3729,7 +3723,7 @@ if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
   OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
   OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
   IGATEFILES=GetDirectoryContents('panda/src/distort', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/distort', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3distort.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3distort.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3distort.in', opts=['IMOD:fx', 'ILIB:libp3distort', 'SRCDIR:panda/src/distort'])
+  TargetAdd('libp3distort.in', opts=['IMOD:panda3d.fx', 'ILIB:libp3distort', 'SRCDIR:panda/src/distort'])
   TargetAdd('libp3distort_igate.obj', input='libp3distort.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3distort_igate.obj', input='libp3distort.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -3748,7 +3742,7 @@ if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
   OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
   OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
   TargetAdd('fx_module.obj', input='libp3distort.in')
   TargetAdd('fx_module.obj', input='libp3distort.in')
   TargetAdd('fx_module.obj', opts=OPTS)
   TargetAdd('fx_module.obj', opts=OPTS)
-  TargetAdd('fx_module.obj', opts=['IMOD:fx', 'ILIB:fx'])
+  TargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx'])
 
 
   TargetAdd('fx.pyd', input='fx_module.obj')
   TargetAdd('fx.pyd', input='fx_module.obj')
   TargetAdd('fx.pyd', input='libp3distort_igate.obj')
   TargetAdd('fx.pyd', input='libp3distort_igate.obj')
@@ -3771,12 +3765,12 @@ if (PkgSkip("VRPN")==0 and not RUNTIME):
   OPTS=['DIR:panda/src/vrpn', 'VRPN']
   OPTS=['DIR:panda/src/vrpn', 'VRPN']
   IGATEFILES=GetDirectoryContents('panda/src/vrpn', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/vrpn', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3vrpn.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3vrpn.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3vrpn.in', opts=['IMOD:vrpn', 'ILIB:libp3vrpn', 'SRCDIR:panda/src/vrpn'])
+  TargetAdd('libp3vrpn.in', opts=['IMOD:panda3d.vrpn', 'ILIB:libp3vrpn', 'SRCDIR:panda/src/vrpn'])
   TargetAdd('libp3vrpn_igate.obj', input='libp3vrpn.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3vrpn_igate.obj', input='libp3vrpn.in', opts=["DEPENDENCYONLY"])
 
 
   TargetAdd('vrpn_module.obj', input='libp3vrpn.in')
   TargetAdd('vrpn_module.obj', input='libp3vrpn.in')
   TargetAdd('vrpn_module.obj', opts=OPTS)
   TargetAdd('vrpn_module.obj', opts=OPTS)
-  TargetAdd('vrpn_module.obj', opts=['IMOD:vrpn', 'ILIB:vrpn'])
+  TargetAdd('vrpn_module.obj', opts=['IMOD:panda3d.vrpn', 'ILIB:vrpn'])
 
 
   TargetAdd('vrpn.pyd', input='vrpn_module.obj')
   TargetAdd('vrpn.pyd', input='vrpn_module.obj')
   TargetAdd('vrpn.pyd', input='libp3vrpn_igate.obj')
   TargetAdd('vrpn.pyd', input='libp3vrpn_igate.obj')
@@ -3830,15 +3824,16 @@ if (PkgSkip("OPENSSL")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOL
   TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS_PYSTUB)
   TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS_PYSTUB)
   TargetAdd('build_patch.exe', opts=OPTS)
   TargetAdd('build_patch.exe', opts=OPTS)
 
 
-  TargetAdd('check_adler_check_adler.obj', opts=OPTS, input='check_adler.cxx')
-  TargetAdd('check_adler.exe', input=['check_adler_check_adler.obj'])
-  TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS_PYSTUB)
-  TargetAdd('check_adler.exe', opts=OPTS)
+  if not PkgSkip("ZLIB"):
+    TargetAdd('check_adler_check_adler.obj', opts=OPTS, input='check_adler.cxx')
+    TargetAdd('check_adler.exe', input=['check_adler_check_adler.obj'])
+    TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS_PYSTUB)
+    TargetAdd('check_adler.exe', opts=OPTS)
 
 
-  TargetAdd('check_crc_check_crc.obj', opts=OPTS, input='check_crc.cxx')
-  TargetAdd('check_crc.exe', input=['check_crc_check_crc.obj'])
-  TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS_PYSTUB)
-  TargetAdd('check_crc.exe', opts=OPTS)
+    TargetAdd('check_crc_check_crc.obj', opts=OPTS, input='check_crc.cxx')
+    TargetAdd('check_crc.exe', input=['check_crc_check_crc.obj'])
+    TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS_PYSTUB)
+    TargetAdd('check_crc.exe', opts=OPTS)
 
 
   TargetAdd('check_md5_check_md5.obj', opts=OPTS, input='check_md5.cxx')
   TargetAdd('check_md5_check_md5.obj', opts=OPTS, input='check_md5.cxx')
   TargetAdd('check_md5.exe', input=['check_md5_check_md5.obj'])
   TargetAdd('check_md5.exe', input=['check_md5_check_md5.obj'])
@@ -3947,7 +3942,7 @@ if (not RUNTIME):
   IGATEFILES=GetDirectoryContents('panda/src/egg', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/egg', ["*.h", "*_composite*.cxx"])
   if "parser.h" in IGATEFILES: IGATEFILES.remove("parser.h")
   if "parser.h" in IGATEFILES: IGATEFILES.remove("parser.h")
   TargetAdd('libp3egg.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3egg.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3egg.in', opts=['IMOD:egg', 'ILIB:libp3egg', 'SRCDIR:panda/src/egg'])
+  TargetAdd('libp3egg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg', 'SRCDIR:panda/src/egg'])
   TargetAdd('libp3egg_igate.obj', input='libp3egg.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3egg_igate.obj', input='libp3egg.in', opts=["DEPENDENCYONLY"])
   TargetAdd('p3egg_eggGroupNode_ext.obj', opts=OPTS, input='eggGroupNode_ext.cxx')
   TargetAdd('p3egg_eggGroupNode_ext.obj', opts=OPTS, input='eggGroupNode_ext.cxx')
 
 
@@ -3963,7 +3958,7 @@ if (not RUNTIME):
   OPTS=['DIR:panda/src/egg2pg']
   OPTS=['DIR:panda/src/egg2pg']
   IGATEFILES=['load_egg_file.h']
   IGATEFILES=['load_egg_file.h']
   TargetAdd('libp3egg2pg.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3egg2pg.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3egg2pg.in', opts=['IMOD:egg', 'ILIB:libp3egg2pg', 'SRCDIR:panda/src/egg2pg'])
+  TargetAdd('libp3egg2pg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg2pg', 'SRCDIR:panda/src/egg2pg'])
   TargetAdd('libp3egg2pg_igate.obj', input='libp3egg2pg.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3egg2pg_igate.obj', input='libp3egg2pg.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -4026,7 +4021,7 @@ if (not RUNTIME):
   TargetAdd('egg_module.obj', input='libp3egg2pg.in')
   TargetAdd('egg_module.obj', input='libp3egg2pg.in')
   TargetAdd('egg_module.obj', input='libp3egg.in')
   TargetAdd('egg_module.obj', input='libp3egg.in')
   TargetAdd('egg_module.obj', opts=OPTS)
   TargetAdd('egg_module.obj', opts=OPTS)
-  TargetAdd('egg_module.obj', opts=['IMOD:egg', 'ILIB:egg'])
+  TargetAdd('egg_module.obj', opts=['IMOD:panda3d.egg', 'ILIB:egg'])
 
 
   TargetAdd('egg.pyd', input='egg_module.obj')
   TargetAdd('egg.pyd', input='egg_module.obj')
   TargetAdd('egg.pyd', input='p3egg_eggGroupNode_ext.obj')
   TargetAdd('egg.pyd', input='p3egg_eggGroupNode_ext.obj')
@@ -4037,20 +4032,6 @@ if (not RUNTIME):
   TargetAdd('egg.pyd', input=COMMON_PANDA_LIBS)
   TargetAdd('egg.pyd', input=COMMON_PANDA_LIBS)
   TargetAdd('egg.pyd', opts=['PYTHON'])
   TargetAdd('egg.pyd', opts=['PYTHON'])
 
 
-#
-# DIRECTORY: panda/src/mesadisplay/
-#
-
-if (GetTarget() != 'windows' and PkgSkip("GL")==0 and PkgSkip("OSMESA")==0 and not RUNTIME):
-  OPTS=['DIR:panda/src/mesadisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAMESA', 'NVIDIACG', 'GL', 'OSMESA']
-  TargetAdd('p3mesadisplay_composite1.obj', opts=OPTS, input='p3mesadisplay_composite1.cxx')
-  OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAMESA', 'NVIDIACG', 'GL']
-  TargetAdd('libpandamesa.dll', input='p3mesadisplay_composite1.obj')
-  if (PkgSkip('PANDAFX')==0):
-    TargetAdd('libpandamesa.dll', input='libpandafx.dll')
-  TargetAdd('libpandamesa.dll', input=COMMON_PANDA_LIBS)
-  TargetAdd('libpandamesa.dll', opts=['MODULE', 'GL', 'OSMESA'])
-
 #
 #
 # DIRECTORY: panda/src/x11display/
 # DIRECTORY: panda/src/x11display/
 #
 #
@@ -4186,7 +4167,7 @@ if (PkgSkip("ODE")==0 and not RUNTIME):
   IGATEFILES.remove("odeHeightFieldGeom.h")
   IGATEFILES.remove("odeHeightFieldGeom.h")
   IGATEFILES.remove("odeHelperStructs.h")
   IGATEFILES.remove("odeHelperStructs.h")
   TargetAdd('libpandaode.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libpandaode.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libpandaode.in', opts=['IMOD:ode', 'ILIB:libpandaode', 'SRCDIR:panda/src/ode'])
+  TargetAdd('libpandaode.in', opts=['IMOD:panda3d.ode', 'ILIB:libpandaode', 'SRCDIR:panda/src/ode'])
   TargetAdd('libpandaode_igate.obj', input='libpandaode.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libpandaode_igate.obj', input='libpandaode.in', opts=["DEPENDENCYONLY"])
   TargetAdd('p3ode_ext_composite.obj', opts=OPTS, input='p3ode_ext_composite.cxx')
   TargetAdd('p3ode_ext_composite.obj', opts=OPTS, input='p3ode_ext_composite.cxx')
 
 
@@ -4207,7 +4188,7 @@ if (PkgSkip("ODE")==0 and not RUNTIME):
   OPTS=['DIR:panda/metalibs/pandaode', 'ODE']
   OPTS=['DIR:panda/metalibs/pandaode', 'ODE']
   TargetAdd('ode_module.obj', input='libpandaode.in')
   TargetAdd('ode_module.obj', input='libpandaode.in')
   TargetAdd('ode_module.obj', opts=OPTS)
   TargetAdd('ode_module.obj', opts=OPTS)
-  TargetAdd('ode_module.obj', opts=['IMOD:ode', 'ILIB:ode'])
+  TargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode'])
 
 
   TargetAdd('ode.pyd', input='ode_module.obj')
   TargetAdd('ode.pyd', input='ode_module.obj')
   TargetAdd('ode.pyd', input='libpandaode_igate.obj')
   TargetAdd('ode.pyd', input='libpandaode_igate.obj')
@@ -4227,7 +4208,7 @@ if (PkgSkip("BULLET")==0 and not RUNTIME):
   OPTS=['DIR:panda/src/bullet', 'BULLET']
   OPTS=['DIR:panda/src/bullet', 'BULLET']
   IGATEFILES=GetDirectoryContents('panda/src/bullet', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/bullet', ["*.h", "*_composite*.cxx"])
   TargetAdd('libpandabullet.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libpandabullet.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libpandabullet.in', opts=['IMOD:bullet', 'ILIB:libpandabullet', 'SRCDIR:panda/src/bullet'])
+  TargetAdd('libpandabullet.in', opts=['IMOD:panda3d.bullet', 'ILIB:libpandabullet', 'SRCDIR:panda/src/bullet'])
   TargetAdd('libpandabullet_igate.obj', input='libpandabullet.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libpandabullet_igate.obj', input='libpandabullet.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -4245,7 +4226,7 @@ if (PkgSkip("BULLET")==0 and not RUNTIME):
   OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET']
   OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET']
   TargetAdd('bullet_module.obj', input='libpandabullet.in')
   TargetAdd('bullet_module.obj', input='libpandabullet.in')
   TargetAdd('bullet_module.obj', opts=OPTS)
   TargetAdd('bullet_module.obj', opts=OPTS)
-  TargetAdd('bullet_module.obj', opts=['IMOD:bullet', 'ILIB:bullet'])
+  TargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet'])
 
 
   TargetAdd('bullet.pyd', input='bullet_module.obj')
   TargetAdd('bullet.pyd', input='bullet_module.obj')
   TargetAdd('bullet.pyd', input='libpandabullet_igate.obj')
   TargetAdd('bullet.pyd', input='libpandabullet_igate.obj')
@@ -4265,7 +4246,7 @@ if (PkgSkip("PHYSX")==0):
   OPTS=['DIR:panda/src/physx', 'PHYSX', 'NOPPC']
   OPTS=['DIR:panda/src/physx', 'PHYSX', 'NOPPC']
   IGATEFILES=GetDirectoryContents('panda/src/physx', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/physx', ["*.h", "*_composite*.cxx"])
   TargetAdd('libpandaphysx.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libpandaphysx.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libpandaphysx.in', opts=['IMOD:physx', 'ILIB:libpandaphysx', 'SRCDIR:panda/src/physx'])
+  TargetAdd('libpandaphysx.in', opts=['IMOD:panda3d.physx', 'ILIB:libpandaphysx', 'SRCDIR:panda/src/physx'])
   TargetAdd('libpandaphysx_igate.obj', input='libpandaphysx.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libpandaphysx_igate.obj', input='libpandaphysx.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -4284,7 +4265,7 @@ if (PkgSkip("PHYSX")==0):
   OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOPPC']
   OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOPPC']
   TargetAdd('physx_module.obj', input='libpandaphysx.in')
   TargetAdd('physx_module.obj', input='libpandaphysx.in')
   TargetAdd('physx_module.obj', opts=OPTS)
   TargetAdd('physx_module.obj', opts=OPTS)
-  TargetAdd('physx_module.obj', opts=['IMOD:physx', 'ILIB:physx'])
+  TargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx'])
 
 
   TargetAdd('physx.pyd', input='physx_module.obj')
   TargetAdd('physx.pyd', input='physx_module.obj')
   TargetAdd('physx.pyd', input='libpandaphysx_igate.obj')
   TargetAdd('physx.pyd', input='libpandaphysx_igate.obj')
@@ -4306,7 +4287,7 @@ if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
   IGATEFILES=GetDirectoryContents('panda/src/physics', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/physics', ["*.h", "*_composite*.cxx"])
   IGATEFILES.remove("forces.h")
   IGATEFILES.remove("forces.h")
   TargetAdd('libp3physics.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3physics.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3physics.in', opts=['IMOD:physics', 'ILIB:libp3physics', 'SRCDIR:panda/src/physics'])
+  TargetAdd('libp3physics.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3physics', 'SRCDIR:panda/src/physics'])
   TargetAdd('libp3physics_igate.obj', input='libp3physics.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3physics_igate.obj', input='libp3physics.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -4326,7 +4307,7 @@ if (PkgSkip("PANDAPHYSICS")==0) and (PkgSkip("PANDAPARTICLESYSTEM")==0) and (not
   IGATEFILES.remove('emitters.h')
   IGATEFILES.remove('emitters.h')
   IGATEFILES.remove('particles.h')
   IGATEFILES.remove('particles.h')
   TargetAdd('libp3particlesystem.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3particlesystem.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3particlesystem.in', opts=['IMOD:physics', 'ILIB:libp3particlesystem', 'SRCDIR:panda/src/particlesystem'])
+  TargetAdd('libp3particlesystem.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3particlesystem', 'SRCDIR:panda/src/particlesystem'])
   TargetAdd('libp3particlesystem_igate.obj', input='libp3particlesystem.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3particlesystem_igate.obj', input='libp3particlesystem.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -4350,7 +4331,7 @@ if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
   if (PkgSkip("PANDAPARTICLESYSTEM")==0):
   if (PkgSkip("PANDAPARTICLESYSTEM")==0):
     TargetAdd('physics_module.obj', input='libp3particlesystem.in')
     TargetAdd('physics_module.obj', input='libp3particlesystem.in')
   TargetAdd('physics_module.obj', opts=OPTS)
   TargetAdd('physics_module.obj', opts=OPTS)
-  TargetAdd('physics_module.obj', opts=['IMOD:physics', 'ILIB:physics'])
+  TargetAdd('physics_module.obj', opts=['IMOD:panda3d.physics', 'ILIB:physics'])
 
 
   TargetAdd('physics.pyd', input='physics_module.obj')
   TargetAdd('physics.pyd', input='physics_module.obj')
   TargetAdd('physics.pyd', input='libp3physics_igate.obj')
   TargetAdd('physics.pyd', input='libp3physics_igate.obj')
@@ -4370,11 +4351,11 @@ if (PkgSkip("SPEEDTREE")==0):
   TargetAdd('pandaspeedtree_composite1.obj', opts=OPTS, input='pandaspeedtree_composite1.cxx')
   TargetAdd('pandaspeedtree_composite1.obj', opts=OPTS, input='pandaspeedtree_composite1.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/speedtree', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('panda/src/speedtree', ["*.h", "*_composite*.cxx"])
   TargetAdd('libpandaspeedtree.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libpandaspeedtree.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libpandaspeedtree.in', opts=['IMOD:pandaspeedtree', 'ILIB:libpandaspeedtree', 'SRCDIR:panda/src/speedtree'])
+  TargetAdd('libpandaspeedtree.in', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree', 'SRCDIR:panda/src/speedtree'])
   TargetAdd('libpandaspeedtree_igate.obj', input='libpandaspeedtree.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libpandaspeedtree_igate.obj', input='libpandaspeedtree.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libpandaspeedtree_module.obj', input='libpandaspeedtree.in')
   TargetAdd('libpandaspeedtree_module.obj', input='libpandaspeedtree.in')
   TargetAdd('libpandaspeedtree_module.obj', opts=OPTS)
   TargetAdd('libpandaspeedtree_module.obj', opts=OPTS)
-  TargetAdd('libpandaspeedtree_module.obj', opts=['IMOD:pandaspeedtree', 'ILIB:libpandaspeedtree'])
+  TargetAdd('libpandaspeedtree_module.obj', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree'])
   TargetAdd('libpandaspeedtree.dll', input='pandaspeedtree_composite1.obj')
   TargetAdd('libpandaspeedtree.dll', input='pandaspeedtree_composite1.obj')
   TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_igate.obj')
   TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_igate.obj')
   TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_module.obj')
   TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_module.obj')
@@ -4510,7 +4491,7 @@ if (PkgSkip("DIRECT")==0):
   if "dcParser.h" in IGATEFILES: IGATEFILES.remove("dcParser.h")
   if "dcParser.h" in IGATEFILES: IGATEFILES.remove("dcParser.h")
   if "dcmsgtypes.h" in IGATEFILES: IGATEFILES.remove('dcmsgtypes.h')
   if "dcmsgtypes.h" in IGATEFILES: IGATEFILES.remove('dcmsgtypes.h')
   TargetAdd('libp3dcparser.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3dcparser.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3dcparser.in', opts=['IMOD:direct', 'ILIB:libp3dcparser', 'SRCDIR:direct/src/dcparser'])
+  TargetAdd('libp3dcparser.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3dcparser', 'SRCDIR:direct/src/dcparser'])
   TargetAdd('libp3dcparser_igate.obj', input='libp3dcparser.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3dcparser_igate.obj', input='libp3dcparser.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -4522,7 +4503,7 @@ if (PkgSkip("DIRECT")==0):
   TargetAdd('p3deadrec_composite1.obj', opts=OPTS, input='p3deadrec_composite1.cxx')
   TargetAdd('p3deadrec_composite1.obj', opts=OPTS, input='p3deadrec_composite1.cxx')
   IGATEFILES=GetDirectoryContents('direct/src/deadrec', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('direct/src/deadrec', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3deadrec.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3deadrec.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3deadrec.in', opts=['IMOD:direct', 'ILIB:libp3deadrec', 'SRCDIR:direct/src/deadrec'])
+  TargetAdd('libp3deadrec.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3deadrec', 'SRCDIR:direct/src/deadrec'])
   TargetAdd('libp3deadrec_igate.obj', input='libp3deadrec.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3deadrec_igate.obj', input='libp3deadrec.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -4536,7 +4517,7 @@ if (PkgSkip("DIRECT")==0):
   TargetAdd('p3distributed_cDistributedSmoothNodeBase.obj', opts=OPTS, input='cDistributedSmoothNodeBase.cxx')
   TargetAdd('p3distributed_cDistributedSmoothNodeBase.obj', opts=OPTS, input='cDistributedSmoothNodeBase.cxx')
   IGATEFILES=GetDirectoryContents('direct/src/distributed', ["*.h", "*.cxx"])
   IGATEFILES=GetDirectoryContents('direct/src/distributed', ["*.h", "*.cxx"])
   TargetAdd('libp3distributed.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3distributed.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3distributed.in', opts=['IMOD:direct', 'ILIB:libp3distributed', 'SRCDIR:direct/src/distributed'])
+  TargetAdd('libp3distributed.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3distributed', 'SRCDIR:direct/src/distributed'])
   TargetAdd('libp3distributed_igate.obj', input='libp3distributed.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3distributed_igate.obj', input='libp3distributed.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -4548,7 +4529,7 @@ if (PkgSkip("DIRECT")==0):
   TargetAdd('p3interval_composite1.obj', opts=OPTS, input='p3interval_composite1.cxx')
   TargetAdd('p3interval_composite1.obj', opts=OPTS, input='p3interval_composite1.cxx')
   IGATEFILES=GetDirectoryContents('direct/src/interval', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('direct/src/interval', ["*.h", "*_composite*.cxx"])
   TargetAdd('libp3interval.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3interval.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3interval.in', opts=['IMOD:direct', 'ILIB:libp3interval', 'SRCDIR:direct/src/interval'])
+  TargetAdd('libp3interval.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3interval', 'SRCDIR:direct/src/interval'])
   TargetAdd('libp3interval_igate.obj', input='libp3interval.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3interval_igate.obj', input='libp3interval.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -4562,7 +4543,7 @@ if (PkgSkip("DIRECT")==0):
     TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm')
     TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm')
   IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"])
   IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"])
   TargetAdd('libp3showbase.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libp3showbase.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libp3showbase.in', opts=['IMOD:direct', 'ILIB:libp3showbase', 'SRCDIR:direct/src/showbase'])
+  TargetAdd('libp3showbase.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3showbase', 'SRCDIR:direct/src/showbase'])
   TargetAdd('libp3showbase_igate.obj', input='libp3showbase.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libp3showbase_igate.obj', input='libp3showbase.in', opts=["DEPENDENCYONLY"])
 
 
 #
 #
@@ -4602,7 +4583,7 @@ if (PkgSkip("DIRECT")==0):
   TargetAdd('direct_module.obj', input='libp3interval.in')
   TargetAdd('direct_module.obj', input='libp3interval.in')
   TargetAdd('direct_module.obj', input='libp3distributed.in')
   TargetAdd('direct_module.obj', input='libp3distributed.in')
   TargetAdd('direct_module.obj', opts=OPTS)
   TargetAdd('direct_module.obj', opts=OPTS)
-  TargetAdd('direct_module.obj', opts=['IMOD:direct', 'ILIB:direct'])
+  TargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct'])
 
 
   TargetAdd('direct.pyd', input='direct_module.obj')
   TargetAdd('direct.pyd', input='direct_module.obj')
   TargetAdd('direct.pyd', input='libp3direct.dll')
   TargetAdd('direct.pyd', input='libp3direct.dll')
@@ -4721,7 +4702,7 @@ if (RTDIST or RUNTIME):
 #
 #
 
 
 if (RUNTIME and PkgSkip("NPAPI")==0):
 if (RUNTIME and PkgSkip("NPAPI")==0):
-  OPTS=['DIR:direct/src/plugin_npapi', 'RUNTIME']
+  OPTS=['DIR:direct/src/plugin_npapi', 'RUNTIME', 'GTK2']
   if GetTarget() == 'windows':
   if GetTarget() == 'windows':
     nppanda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
     nppanda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
                     "version" : VERSION,
                     "version" : VERSION,
@@ -5541,15 +5522,17 @@ if (PkgSkip("PANDATOOL")==0):
 # DIRECTORY: pandatool/src/miscprogs/
 # DIRECTORY: pandatool/src/miscprogs/
 #
 #
 
 
-if (PkgSkip("PANDATOOL")==0):
-    OPTS=['DIR:pandatool/src/miscprogs']
-    TargetAdd('bin2c_binToC.obj', opts=OPTS, input='binToC.cxx')
-    TargetAdd('bin2c.exe', input='bin2c_binToC.obj')
-    TargetAdd('bin2c.exe', input='libp3progbase.lib')
-    TargetAdd('bin2c.exe', input='libp3pandatoolbase.lib')
-    TargetAdd('bin2c.exe', input=COMMON_PANDA_LIBS)
-    TargetAdd('bin2c.exe', input='libp3pystub.lib')
-    TargetAdd('bin2c.exe', opts=['ADVAPI'])
+# This is a bit of an esoteric tool, and it causes issues because
+# it conflicts with tools of the same name in different packages.
+#if (PkgSkip("PANDATOOL")==0):
+#    OPTS=['DIR:pandatool/src/miscprogs']
+#    TargetAdd('bin2c_binToC.obj', opts=OPTS, input='binToC.cxx')
+#    TargetAdd('bin2c.exe', input='bin2c_binToC.obj')
+#    TargetAdd('bin2c.exe', input='libp3progbase.lib')
+#    TargetAdd('bin2c.exe', input='libp3pandatoolbase.lib')
+#    TargetAdd('bin2c.exe', input=COMMON_PANDA_LIBS)
+#    TargetAdd('bin2c.exe', input='libp3pystub.lib')
+#    TargetAdd('bin2c.exe', opts=['ADVAPI'])
 
 
 #
 #
 # DIRECTORY: pandatool/src/pstatserver/
 # DIRECTORY: pandatool/src/pstatserver/
@@ -5790,12 +5773,12 @@ if (PkgSkip("CONTRIB")==0 and not RUNTIME):
   OPTS=['DIR:contrib/src/ai']
   OPTS=['DIR:contrib/src/ai']
   IGATEFILES=GetDirectoryContents('contrib/src/ai', ["*.h", "*_composite*.cxx"])
   IGATEFILES=GetDirectoryContents('contrib/src/ai', ["*.h", "*_composite*.cxx"])
   TargetAdd('libpandaai.in', opts=OPTS, input=IGATEFILES)
   TargetAdd('libpandaai.in', opts=OPTS, input=IGATEFILES)
-  TargetAdd('libpandaai.in', opts=['IMOD:ai', 'ILIB:libpandaai', 'SRCDIR:contrib/src/ai'])
+  TargetAdd('libpandaai.in', opts=['IMOD:panda3d.ai', 'ILIB:libpandaai', 'SRCDIR:contrib/src/ai'])
   TargetAdd('libpandaai_igate.obj', input='libpandaai.in', opts=["DEPENDENCYONLY"])
   TargetAdd('libpandaai_igate.obj', input='libpandaai.in', opts=["DEPENDENCYONLY"])
 
 
   TargetAdd('ai_module.obj', input='libpandaai.in')
   TargetAdd('ai_module.obj', input='libpandaai.in')
   TargetAdd('ai_module.obj', opts=OPTS)
   TargetAdd('ai_module.obj', opts=OPTS)
-  TargetAdd('ai_module.obj', opts=['IMOD:ai', 'ILIB:ai'])
+  TargetAdd('ai_module.obj', opts=['IMOD:panda3d.ai', 'ILIB:ai'])
 
 
   TargetAdd('ai.pyd', input='ai_module.obj')
   TargetAdd('ai.pyd', input='ai_module.obj')
   TargetAdd('ai.pyd', input='libpandaai_igate.obj')
   TargetAdd('ai.pyd', input='libpandaai_igate.obj')

+ 15 - 5
makepanda/makepandacore.py

@@ -73,6 +73,7 @@ MAYAVERSIONINFO = [("MAYA6",   "6.0"),
                    ("MAYA2013","2013"),
                    ("MAYA2013","2013"),
                    ("MAYA20135","2013.5"),
                    ("MAYA20135","2013.5"),
                    ("MAYA2014","2014"),
                    ("MAYA2014","2014"),
+                   ("MAYA2015","2015"),
 ]
 ]
 
 
 MAXVERSIONINFO = [("MAX6", "SOFTWARE\\Autodesk\\3DSMAX\\6.0", "installdir", "maxsdk\\cssdk\\include"),
 MAXVERSIONINFO = [("MAX6", "SOFTWARE\\Autodesk\\3DSMAX\\6.0", "installdir", "maxsdk\\cssdk\\include"),
@@ -2327,14 +2328,23 @@ def SetupBuildEnvironment(compiler):
 ########################################################################
 ########################################################################
 
 
 def CopyFile(dstfile, srcfile):
 def CopyFile(dstfile, srcfile):
-    if (dstfile[-1]=='/'):
+    if dstfile[-1] == '/':
         dstdir = dstfile
         dstdir = dstfile
         fnl = srcfile.rfind("/")
         fnl = srcfile.rfind("/")
-        if (fnl < 0): fn = srcfile
-        else: fn = srcfile[fnl+1:]
+        if fnl < 0:
+            fn = srcfile
+        else:
+            fn = srcfile[fnl+1:]
         dstfile = dstdir + fn
         dstfile = dstdir + fn
-    if (NeedsBuild([dstfile], [srcfile])):
-        WriteBinaryFile(dstfile, ReadBinaryFile(srcfile))
+
+    if NeedsBuild([dstfile], [srcfile]):
+        if os.path.islink(srcfile):
+            # Preserve symlinks
+            if os.path.exists(dstfile):
+                os.unlink(dstfile)
+            os.symlink(os.readlink(srcfile), dstfile)
+        else:
+            WriteBinaryFile(dstfile, ReadBinaryFile(srcfile))
         JustBuilt([dstfile], [srcfile])
         JustBuilt([dstfile], [srcfile])
 
 
 def CopyAllFiles(dstdir, srcdir, suffix=""):
 def CopyAllFiles(dstdir, srcdir, suffix=""):

+ 5 - 2
panda/CMakeLists.txt

@@ -19,10 +19,14 @@ if(HAVE_FREETYPE)
 endif()
 endif()
 
 
 # Include panda source directories
 # Include panda source directories
+add_subdirectory(src/configfiles)
 add_subdirectory(src/pandabase)
 add_subdirectory(src/pandabase)
 add_subdirectory(src/express)
 add_subdirectory(src/express)
 add_subdirectory(src/downloader)
 add_subdirectory(src/downloader)
+add_subdirectory(src/downloadertools)
 add_subdirectory(src/pipeline)
 add_subdirectory(src/pipeline)
+add_subdirectory(src/nativenet)
+add_subdirectory(src/net)
 add_subdirectory(src/putil)
 add_subdirectory(src/putil)
 add_subdirectory(src/pstatclient)
 add_subdirectory(src/pstatclient)
 add_subdirectory(src/linmath)
 add_subdirectory(src/linmath)
@@ -45,6 +49,7 @@ add_subdirectory(src/wgldisplay)
 add_subdirectory(src/osxdisplay)
 add_subdirectory(src/osxdisplay)
 add_subdirectory(src/cocoadisplay)
 add_subdirectory(src/cocoadisplay)
 add_subdirectory(src/movies)
 add_subdirectory(src/movies)
+add_subdirectory(src/ffmpeg)
 add_subdirectory(src/audio)
 add_subdirectory(src/audio)
 add_subdirectory(src/audiotraits)
 add_subdirectory(src/audiotraits)
 add_subdirectory(src/chan)
 add_subdirectory(src/chan)
@@ -59,8 +64,6 @@ add_subdirectory(src/tform)
 add_subdirectory(src/pgui)
 add_subdirectory(src/pgui)
 add_subdirectory(src/recorder)
 add_subdirectory(src/recorder)
 add_subdirectory(src/collide)
 add_subdirectory(src/collide)
-add_subdirectory(src/nativenet)
-add_subdirectory(src/net)
 add_subdirectory(src/egg)
 add_subdirectory(src/egg)
 add_subdirectory(src/egg2pg)
 add_subdirectory(src/egg2pg)
 add_subdirectory(src/framework)
 add_subdirectory(src/framework)

+ 1 - 1
panda/metalibs/pandaegg/CMakeLists.txt

@@ -1,5 +1,5 @@
 if(HAVE_EGG)
 if(HAVE_EGG)
-  set(PANDAEGG_LINK_TARGETS p3egg p3egg2pg)
+  set(PANDAEGG_LINK_TARGETS p3egg p3egg2pg panda)
 
 
   add_library(pandaegg pandaegg.cxx)
   add_library(pandaegg pandaegg.cxx)
   target_link_libraries(pandaegg ${PANDAEGG_LINK_TARGETS})
   target_link_libraries(pandaegg ${PANDAEGG_LINK_TARGETS})

+ 2 - 4
panda/src/androiddisplay/androidGraphicsStateGuardian.cxx

@@ -405,8 +405,6 @@ get_extra_extensions() {
 //               not defined.
 //               not defined.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void *AndroidGraphicsStateGuardian::
 void *AndroidGraphicsStateGuardian::
-do_get_extension_func(const char *prefix, const char *name) {
-  string fullname = string(prefix) + string(name);
-
-  return (void *)eglGetProcAddress(fullname.c_str());
+do_get_extension_func(const char *name) {
+  return (void *)eglGetProcAddress(name);
 }
 }

+ 1 - 1
panda/src/androiddisplay/androidGraphicsStateGuardian.h

@@ -61,7 +61,7 @@ protected:
 
 
   virtual void query_gl_version();
   virtual void query_gl_version();
   virtual void get_extra_extensions();
   virtual void get_extra_extensions();
-  virtual void *do_get_extension_func(const char *prefix, const char *name);
+  virtual void *do_get_extension_func(const char *name);
 
 
 private:
 private:
   int _egl_version_major, _egl_version_minor;
   int _egl_version_major, _egl_version_minor;

+ 1 - 0
panda/src/audiotraits/fmodAudioManager.cxx

@@ -17,6 +17,7 @@
 
 
 #include "pandabase.h"
 #include "pandabase.h"
 #include "config_audio.h"
 #include "config_audio.h"
+#include "config_fmodAudio.h"
 #include "dcast.h"
 #include "dcast.h"
 
 
 #ifdef HAVE_FMODEX //[
 #ifdef HAVE_FMODEX //[

+ 2 - 0
panda/src/audiotraits/fmodAudioSound.cxx

@@ -23,10 +23,12 @@
 
 
 //Panda Headers
 //Panda Headers
 #include "config_audio.h"
 #include "config_audio.h"
+#include "config_fmodAudio.h"
 #include "fmodAudioSound.h"
 #include "fmodAudioSound.h"
 #include "string_utils.h"
 #include "string_utils.h"
 #include "subfileInfo.h"
 #include "subfileInfo.h"
 #include "reMutexHolder.h"
 #include "reMutexHolder.h"
+#include "virtualFileSystem.h"
 
 
 TypeHandle FmodAudioSound::_type_handle;
 TypeHandle FmodAudioSound::_type_handle;
 
 

+ 1 - 0
panda/src/audiotraits/fmodAudioSound.h

@@ -77,6 +77,7 @@
 
 
 #include "audioSound.h"
 #include "audioSound.h"
 #include "reMutex.h"
 #include "reMutex.h"
+#include "fmodAudioManager.h"
 
 
 #include <fmod.hpp>
 #include <fmod.hpp>
 #include <fmod_errors.h>
 #include <fmod_errors.h>

+ 1 - 1
panda/src/audiotraits/openalAudioSound.cxx

@@ -64,7 +64,7 @@ OpenALAudioSound(OpenALAudioManager* manager,
   _start_time(0.0),
   _start_time(0.0),
   _current_time(0.0),
   _current_time(0.0),
   _basename(movie->get_filename().get_basename()),
   _basename(movie->get_filename().get_basename()),
-  _active(true),
+  _active(manager->get_active()),
   _paused(false)
   _paused(false)
 {
 {
   _location[0] = 0.0f;
   _location[0] = 0.0f;

+ 1 - 0
panda/src/audiotraits/openalAudioSound.h

@@ -25,6 +25,7 @@
 #include "audioSound.h"
 #include "audioSound.h"
 #include "movieAudioCursor.h"
 #include "movieAudioCursor.h"
 #include "trueClock.h"
 #include "trueClock.h"
+#include "openalAudioManager.h"
 
 
 // OSX uses the OpenAL framework
 // OSX uses the OpenAL framework
 #ifdef IS_OSX
 #ifdef IS_OSX

+ 1 - 0
panda/src/bullet/bulletManifoldPoint.cxx

@@ -44,6 +44,7 @@ BulletManifoldPoint(const BulletManifoldPoint &other)
 BulletManifoldPoint& BulletManifoldPoint::
 BulletManifoldPoint& BulletManifoldPoint::
 operator=(const BulletManifoldPoint& other) {
 operator=(const BulletManifoldPoint& other) {
  
  
+  this->_pt = other._pt;
   return *this;
   return *this;
 }
 }
 
 

+ 1 - 1
panda/src/cocoadisplay/CMakeLists.txt

@@ -16,7 +16,7 @@ if(APPLE AND HAVE_GL AND HAVE_COCOA)
       cocoaPandaWindowDelegate.mm)
       cocoaPandaWindowDelegate.mm)
 
 
   #composite_sources(p3cocoadisplay P3COCOADISPLAY_SOURCES)
   #composite_sources(p3cocoadisplay P3COCOADISPLAY_SOURCES)
-  add_library(p3cocoadisplay ${P3COCOADISPLAY_SOURCES} ${P3COCOADISPLAY_HEADERS})
+  add_library(p3cocoadisplay ${P3COCOADISPLAY_HEADERS} ${P3COCOADISPLAY_SOURCES})
   target_link_libraries(p3cocoadisplay p3display p3putil p3glgsg)
   target_link_libraries(p3cocoadisplay p3display p3putil p3glgsg)
 
 
   # Frameworks:
   # Frameworks:

+ 1 - 1
panda/src/cocoadisplay/Sources.pp

@@ -3,7 +3,7 @@
 #define OTHER_LIBS p3interrogatedb:c p3dconfig:c p3dtoolconfig:m \
 #define OTHER_LIBS p3interrogatedb:c p3dconfig:c p3dtoolconfig:m \
                    p3dtoolutil:c p3dtoolbase:c p3dtool:m
                    p3dtoolutil:c p3dtoolbase:c p3dtool:m
 
 
-#define OSX_SYS_FRAMEWORKS ApplicationServices AppKit
+#define OSX_SYS_FRAMEWORKS ApplicationServices AppKit Carbon
 
 
 #begin lib_target
 #begin lib_target
   #define TARGET p3cocoadisplay
   #define TARGET p3cocoadisplay

+ 1 - 1
panda/src/cocoadisplay/cocoaGraphicsStateGuardian.h

@@ -46,7 +46,7 @@ public:
 
 
 protected:
 protected:
   virtual void query_gl_version();
   virtual void query_gl_version();
-  virtual void *do_get_extension_func(const char *prefix, const char *name);
+  virtual void *do_get_extension_func(const char *name);
 
 
 public:
 public:
   static TypeHandle get_class_type() {
   static TypeHandle get_class_type() {

+ 4 - 5
panda/src/cocoadisplay/cocoaGraphicsStateGuardian.mm

@@ -276,10 +276,9 @@ query_gl_version() {
 //               not defined.
 //               not defined.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void *CocoaGraphicsStateGuardian::
 void *CocoaGraphicsStateGuardian::
-do_get_extension_func(const char *prefix, const char *name) {
-  char* fullname = (char*) malloc(strlen(prefix) + strlen(name) + 2);
-  strcpy(fullname + 1, prefix);
-  strcpy(fullname + 1 + strlen(prefix), name);
+do_get_extension_func(const char *name) {
+  char* fullname = (char*) malloc(strlen(name) + 2);
+  strcpy(fullname + 1, name);
   fullname[0] = '_';
   fullname[0] = '_';
 
 
   // Believe it or not, but this is actually the
   // Believe it or not, but this is actually the
@@ -292,7 +291,7 @@ do_get_extension_func(const char *prefix, const char *name) {
   }
   }
 
 
   cocoadisplay_cat.warning() <<
   cocoadisplay_cat.warning() <<
-    "do_get_extension_func failed for " << prefix << name << "!\n";
+    "do_get_extension_func failed for " << fullname << "!\n";
 
 
   free(fullname);
   free(fullname);
   return NULL;
   return NULL;

+ 3 - 2
panda/src/cocoadisplay/cocoaGraphicsWindow.h

@@ -58,6 +58,7 @@ public:
   void handle_mouse_button_event(int button, bool down);
   void handle_mouse_button_event(int button, bool down);
   void handle_mouse_moved_event(bool in_window, double x, double y, bool absolute);
   void handle_mouse_moved_event(bool in_window, double x, double y, bool absolute);
   void handle_wheel_event(double x, double y);
   void handle_wheel_event(double x, double y);
+  virtual ButtonMap *get_keyboard_map() const;
 
 
   INLINE NSWindow *get_nswindow() const;
   INLINE NSWindow *get_nswindow() const;
   INLINE NSView *get_nsview() const;
   INLINE NSView *get_nsview() const;
@@ -81,8 +82,8 @@ private:
   NSImage *load_image(const Filename &filename);
   NSImage *load_image(const Filename &filename);
 
 
   void handle_modifier(NSUInteger modifierFlags, NSUInteger mask, ButtonHandle button);
   void handle_modifier(NSUInteger modifierFlags, NSUInteger mask, ButtonHandle button);
-  ButtonHandle map_key(unsigned short c);
-  ButtonHandle map_raw_key(unsigned short keycode);
+  ButtonHandle map_key(unsigned short c) const;
+  ButtonHandle map_raw_key(unsigned short keycode) const;
 
 
 private:
 private:
   NSWindow *_window;
   NSWindow *_window;

+ 71 - 5
panda/src/cocoadisplay/cocoaGraphicsWindow.mm

@@ -40,7 +40,7 @@
 #import <AppKit/NSScreen.h>
 #import <AppKit/NSScreen.h>
 #import <AppKit/NSText.h>
 #import <AppKit/NSText.h>
 #import <OpenGL/OpenGL.h>
 #import <OpenGL/OpenGL.h>
-//#import <Carbon/Carbon.h>
+#import <Carbon/Carbon.h>
 
 
 TypeHandle CocoaGraphicsWindow::_type_handle;
 TypeHandle CocoaGraphicsWindow::_type_handle;
 
 
@@ -1731,13 +1731,70 @@ handle_wheel_event(double x, double y) {
   }
   }
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: CocoaGraphicsWindow::get_keyboard_map
+//       Access: Published, Virtual
+//  Description: Returns a ButtonMap containing the association
+//               between raw buttons and virtual buttons.
+////////////////////////////////////////////////////////////////////
+ButtonMap *CocoaGraphicsWindow::
+get_keyboard_map() const {
+  TISInputSourceRef input_source;
+  CFDataRef layout_data;
+  const UCKeyboardLayout *layout;
+
+  // Get the current keyboard layout data.
+  input_source = TISCopyCurrentKeyboardInputSource();
+  layout_data = (CFDataRef) TISGetInputSourceProperty(input_source, kTISPropertyUnicodeKeyLayoutData);
+  layout = (const UCKeyboardLayout *)CFDataGetBytePtr(layout_data);
+
+  ButtonMap *map = new ButtonMap;
+
+  UniChar chars[4];
+  UniCharCount num_chars;
+
+  // Iterate through the known scancode range and see what
+  // every scan code is mapped to.
+  for (int k = 0; k <= 0x7E; ++k) {
+    ButtonHandle raw_button = map_raw_key(k);
+    if (raw_button == ButtonHandle::none()) {
+      continue;
+    }
+
+    UInt32 dead_keys = 0;
+    if (UCKeyTranslate(layout, k, kUCKeyActionDisplay, 0, LMGetKbdType(),
+                       kUCKeyTranslateNoDeadKeysMask, &dead_keys, 4,
+                       &num_chars, chars) == noErr) {
+      if (num_chars > 0 && chars[0] != 0x10) {
+        ButtonHandle button = ButtonHandle::none();
+
+        if (chars[0] > 0 && chars[0] <= 0x7f) {
+          button = KeyboardButton::ascii_key(chars[0]);
+        }
+        if (button == ButtonHandle::none()) {
+          button = map_key(chars[0]);
+        }
+        if (button != ButtonHandle::none()) {
+          map->map_button(raw_button, button);
+        }
+      } else {
+        // A special function key or modifier key, which isn't remapped by the OS.
+        map->map_button(raw_button, raw_button);
+      }
+    }
+  }
+
+  CFRelease(input_source);
+  return map;
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: CocoaGraphicsWindow::map_key
 //     Function: CocoaGraphicsWindow::map_key
 //       Access: Private
 //       Access: Private
-//  Description: Maps a Cocoa key character to a ButtonHandle.
+//  Description: Maps a unicode key character to a ButtonHandle.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 ButtonHandle CocoaGraphicsWindow::
 ButtonHandle CocoaGraphicsWindow::
-map_key(unsigned short c) {
+map_key(unsigned short c) const {
   switch (c) {
   switch (c) {
   case NSEnterCharacter:
   case NSEnterCharacter:
     return KeyboardButton::enter();
     return KeyboardButton::enter();
@@ -1750,17 +1807,21 @@ map_key(unsigned short c) {
     // BackTabCharacter is sent when shift-tab is used.
     // BackTabCharacter is sent when shift-tab is used.
     return KeyboardButton::tab();
     return KeyboardButton::tab();
 
 
-  case 16:
+  case 0x10:
     // No idea where this constant comes from, but it
     // No idea where this constant comes from, but it
     // is sent whenever the menu key is pressed.
     // is sent whenever the menu key is pressed.
     return KeyboardButton::menu();
     return KeyboardButton::menu();
 
 
+  case 0x1e:
   case NSUpArrowFunctionKey:
   case NSUpArrowFunctionKey:
     return KeyboardButton::up();
     return KeyboardButton::up();
+  case 0x1f:
   case NSDownArrowFunctionKey:
   case NSDownArrowFunctionKey:
     return KeyboardButton::down();
     return KeyboardButton::down();
+  case 0x1c:
   case NSLeftArrowFunctionKey:
   case NSLeftArrowFunctionKey:
     return KeyboardButton::left();
     return KeyboardButton::left();
+  case 0x1d:
   case NSRightArrowFunctionKey:
   case NSRightArrowFunctionKey:
     return KeyboardButton::right();
     return KeyboardButton::right();
   case NSF1FunctionKey:
   case NSF1FunctionKey:
@@ -1819,14 +1880,18 @@ map_key(unsigned short c) {
     return KeyboardButton::insert();
     return KeyboardButton::insert();
   case NSDeleteFunctionKey:
   case NSDeleteFunctionKey:
     return KeyboardButton::del();
     return KeyboardButton::del();
+  case 0x01:
   case NSHomeFunctionKey:
   case NSHomeFunctionKey:
     return KeyboardButton::home();
     return KeyboardButton::home();
   case NSBeginFunctionKey:
   case NSBeginFunctionKey:
     break;
     break;
+  case 0x04:
   case NSEndFunctionKey:
   case NSEndFunctionKey:
     return KeyboardButton::end();
     return KeyboardButton::end();
+  case 0x0b:
   case NSPageUpFunctionKey:
   case NSPageUpFunctionKey:
     return KeyboardButton::page_up();
     return KeyboardButton::page_up();
+  case 0x0c:
   case NSPageDownFunctionKey:
   case NSPageDownFunctionKey:
     return KeyboardButton::page_down();
     return KeyboardButton::page_down();
   case NSPrintScreenFunctionKey:
   case NSPrintScreenFunctionKey:
@@ -1859,6 +1924,7 @@ map_key(unsigned short c) {
   case NSRedoFunctionKey:
   case NSRedoFunctionKey:
   case NSFindFunctionKey:
   case NSFindFunctionKey:
     break;
     break;
+  case 0x05:
   case NSHelpFunctionKey:
   case NSHelpFunctionKey:
     return KeyboardButton::help();
     return KeyboardButton::help();
   case NSModeSwitchFunctionKey:
   case NSModeSwitchFunctionKey:
@@ -1873,7 +1939,7 @@ map_key(unsigned short c) {
 //  Description: Maps a keycode to a ButtonHandle.
 //  Description: Maps a keycode to a ButtonHandle.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 ButtonHandle CocoaGraphicsWindow::
 ButtonHandle CocoaGraphicsWindow::
-map_raw_key(unsigned short keycode) {
+map_raw_key(unsigned short keycode) const {
   if (keycode > 0x7f) {
   if (keycode > 0x7f) {
     return ButtonHandle::none();
     return ButtonHandle::none();
   }
   }

Some files were not shown because too many files changed in this diff