diff --git a/direct/src/p3d/Packager.py b/direct/src/p3d/Packager.py index 8685de09ea..f478f4178d 100644 --- a/direct/src/p3d/Packager.py +++ b/direct/src/p3d/Packager.py @@ -3341,7 +3341,7 @@ class Packager: self.do_module('VFSImporter', filename = filename) self.do_freeze('_vfsimporter', compileToExe = False) - self.do_file('panda3d/core.pyd'); + self.do_file('panda3d/_core.pyd'); # Now that we're done freezing, explicitly add 'direct' to # counteract the previous explicit excludeModule(). diff --git a/direct/src/plugin/p3dPythonRun.cxx b/direct/src/plugin/p3dPythonRun.cxx index 667f34e7dc..e3be05bfc8 100644 --- a/direct/src/plugin/p3dPythonRun.cxx +++ b/direct/src/plugin/p3dPythonRun.cxx @@ -236,29 +236,37 @@ run_python() { } Py_DECREF(app_runner_class); + // Import the JavaScript module. + PyObject *javascript_module = PyImport_ImportModule("direct.p3d.JavaScript"); + if (javascript_module == NULL) { + nout << "Failed to import direct.p3d.JavaScript\n"; + PyErr_Print(); + return false; + } + // Get the UndefinedObject class. - _undefined_object_class = PyObject_GetAttrString(app_runner_module, "UndefinedObject"); + _undefined_object_class = PyObject_GetAttrString(javascript_module, "UndefinedObject"); if (_undefined_object_class == NULL) { PyErr_Print(); return false; } // And the "Undefined" instance. - _undefined = PyObject_GetAttrString(app_runner_module, "Undefined"); + _undefined = PyObject_GetAttrString(javascript_module, "Undefined"); if (_undefined == NULL) { PyErr_Print(); return false; } // Get the ConcreteStruct class. - _concrete_struct_class = PyObject_GetAttrString(app_runner_module, "ConcreteStruct"); + _concrete_struct_class = PyObject_GetAttrString(javascript_module, "ConcreteStruct"); if (_concrete_struct_class == NULL) { PyErr_Print(); return false; } // Get the BrowserObject class. - _browser_object_class = PyObject_GetAttrString(app_runner_module, "BrowserObject"); + _browser_object_class = PyObject_GetAttrString(javascript_module, "BrowserObject"); if (_browser_object_class == NULL) { PyErr_Print(); return false; @@ -272,7 +280,7 @@ run_python() { } Py_DECREF(app_runner_module); - + Py_DECREF(javascript_module); // Construct a Python wrapper around our methods we need to expose to Python. static PyMethodDef p3dpython_methods[] = { diff --git a/direct/src/showbase/VFSImporter.py b/direct/src/showbase/VFSImporter.py index 6f8c76266f..1fc8c6796d 100644 --- a/direct/src/showbase/VFSImporter.py +++ b/direct/src/showbase/VFSImporter.py @@ -1,7 +1,7 @@ __all__ = ['register', 'sharedPackages', 'reloadSharedPackage', 'reloadSharedPackages'] -from panda3d.core import Filename, VirtualFileSystem, VirtualFileMountSystem, OFileStream, copyStream +from panda3d._core import Filename, VirtualFileSystem, VirtualFileMountSystem, OFileStream, copyStream import sys import marshal import imp diff --git a/direct/src/showutil/FreezeTool.py b/direct/src/showutil/FreezeTool.py index df845b0c26..781caf9588 100644 --- a/direct/src/showutil/FreezeTool.py +++ b/direct/src/showutil/FreezeTool.py @@ -17,7 +17,6 @@ except ImportError: p3extend_frozen = None from panda3d.core import * -from pandac.extension_native_helpers import dll_suffix, dll_ext # Check to see if we are running python_d, which implies we have a # debug build, and we have to build the module with debug options. @@ -1394,15 +1393,6 @@ class PandaModuleFinder(modulefinder.ModuleFinder): # It's a frozen module. return (None, name, ('', '', imp.PY_FROZEN)) - # Look for a dtool extension. This loop is roughly lifted - # from extension_native_helpers.Dtool_PreloadDLL(). - filename = name + dll_suffix + dll_ext - for dir in sys.path + [sys.prefix]: - lib = os.path.join(dir, filename) - if os.path.exists(lib): - file = open(lib, 'rb') - return (file, lib, (dll_ext, 'rb', imp.C_EXTENSION)) - message = "DLL loader cannot find %s." % (name) raise ImportError, message diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 35bfea1e7f..30de3f1552 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -5026,11 +5026,13 @@ if (RTDIST or RUNTIME): TargetAdd('p3dpython.exe', input='p3dpython_p3dPythonMain.obj') TargetAdd('p3dpython.exe', input=COMMON_PANDA_LIBS) TargetAdd('p3dpython.exe', input='libp3tinyxml.ilb') + TargetAdd('p3dpython.exe', input='libp3interrogatedb.dll') TargetAdd('p3dpython.exe', opts=['PYTHON', 'WINUSER']) TargetAdd('libp3dpython.dll', input='p3dpython_p3dpython_composite1.obj') TargetAdd('libp3dpython.dll', input=COMMON_PANDA_LIBS) TargetAdd('libp3dpython.dll', input='libp3tinyxml.ilb') + TargetAdd('libp3dpython.dll', input='libp3interrogatedb.dll') TargetAdd('libp3dpython.dll', opts=['PYTHON', 'WINUSER']) if GetTarget() == 'windows': @@ -5042,6 +5044,7 @@ if (RTDIST or RUNTIME): TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dPythonMain.obj') TargetAdd('p3dpythonw.exe', input=COMMON_PANDA_LIBS) TargetAdd('p3dpythonw.exe', input='libp3tinyxml.ilb') + TargetAdd('p3dpythonw.exe', input='libp3interrogatedb.dll') TargetAdd('p3dpythonw.exe', opts=['SUBSYSTEM:WINDOWS', 'PYTHON', 'WINUSER']) if (PkgSkip("OPENSSL")==0 and RTDIST): diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 89227ee1bf..bfc5914b03 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -8799,6 +8799,7 @@ get_usage(Geom::UsageHint usage_hint) { return GL_STATIC_DRAW; } +#ifndef NDEBUG //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::get_compressed_format_string // Access: Public, Static @@ -8917,6 +8918,7 @@ get_compressed_format_string(GLenum format) { return NULL; } } +#endif //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::get_light_color