diff --git a/direct/src/p3d/Packager.py b/direct/src/p3d/Packager.py index 16ebdabbff..5efebd1869 100644 --- a/direct/src/p3d/Packager.py +++ b/direct/src/p3d/Packager.py @@ -16,6 +16,7 @@ import types import getpass import struct import subprocess +import copy from direct.p3d.FileSpec import FileSpec from direct.p3d.SeqValue import SeqValue from direct.showbase import Loader @@ -839,6 +840,14 @@ class Packager: self.packager.contents[pe.getKey()] = pe self.packager.contentsChanged = True + # Hack for coreapi package, to preserve backward compatibility + # with old versions of the runtime, which still called the + # 32-bit Windows platform "win32". + if self.packageName == "coreapi" and self.platform == "win_i386": + pe2 = copy.copy(pe) + pe2.platform = "win32" + self.packager.contents[pe2.getKey()] = pe2 + self.cleanup() return True @@ -1832,7 +1841,10 @@ class Packager: self.notify.warning(message) return - self.freezer.addModule(moduleName, filename = file.filename) + if file.text: + self.freezer.addModule(moduleName, filename = file.filename, text = file.text) + else: + self.freezer.addModule(moduleName, filename = file.filename) def addEggFile(self, file): # Precompile egg files to bam's. diff --git a/direct/src/p3d/panda3d.pdef b/direct/src/p3d/panda3d.pdef index 4f3df21c97..87a42eff2b 100644 --- a/direct/src/p3d/panda3d.pdef +++ b/direct/src/p3d/panda3d.pdef @@ -362,8 +362,16 @@ class rocket(package): config(display_name = "Panda3D libRocket support") require('panda3d') - module('panda3d.rocket', required = True) - module('_rocketcore', '_rocketcontrols') + file('rocket.py', extract = True, text = """ +from _rocketcore import * +try: + from _rocketcontrols import * +except ImportError: + pass +""") + + module('panda3d.rocket', '_rocketcore', required = True) + module('_rocketcontrols') file('libp3rocket.dll', required = True) class vrpn(package): diff --git a/direct/src/plugin/p3dInstanceManager.cxx b/direct/src/plugin/p3dInstanceManager.cxx index b5536b8836..793e6cf36e 100644 --- a/direct/src/plugin/p3dInstanceManager.cxx +++ b/direct/src/plugin/p3dInstanceManager.cxx @@ -258,14 +258,22 @@ initialize(int api_version, const string &contents_filename, // TODO: Linux multiplatform support. Just add the // appropriate platform strings to _supported_platforms. + } else { + nout << "Platform string was set by plugin to " << _platform << "\n"; } if (_supported_platforms.empty()) { + // Hack for older plug-ins, which should still remain compatible with + // newer versions of the runtime distribution. + if (_platform == "win32") { + _supported_platforms.push_back("win_i386"); + } + // We always support at least the specific platform on which we're // running. _supported_platforms.push_back(_platform); } - + #ifdef P3D_PLUGIN_LOG_DIRECTORY if (_log_directory.empty()) { _log_directory = P3D_PLUGIN_LOG_DIRECTORY; diff --git a/direct/src/plugin/p3dX11SplashWindow.cxx b/direct/src/plugin/p3dX11SplashWindow.cxx index f1afc5a15b..76c0175a18 100644 --- a/direct/src/plugin/p3dX11SplashWindow.cxx +++ b/direct/src/plugin/p3dX11SplashWindow.cxx @@ -681,10 +681,13 @@ subprocess_run() { } } - if (input_ready) { + while (input_ready) { + // Empty the pipe of whatever is in it. receive_command(); + input_ready = _pipe_read.has_gdata(); } + // Sleep a good amount in order not to lock up the system. struct timespec req; req.tv_sec = 0; req.tv_nsec = 50000000; // 50 ms diff --git a/direct/src/showbase/VFSImporter.py b/direct/src/showbase/VFSImporter.py index 1fc8c6796d..16b1ac4bec 100644 --- a/direct/src/showbase/VFSImporter.py +++ b/direct/src/showbase/VFSImporter.py @@ -76,8 +76,7 @@ class VFSImporter: if desc[2] != imp.C_EXTENSION: continue - filename = Filename(path) - filename.setExtension(desc[0][1:]) + filename = Filename(path + desc[0]) vfile = vfs.getFile(filename, True) if vfile: return VFSLoader(dir_path, vfile, filename, FTExtensionModule, diff --git a/direct/src/showutil/FreezeTool.py b/direct/src/showutil/FreezeTool.py index 871cf403a2..50f1077e30 100644 --- a/direct/src/showutil/FreezeTool.py +++ b/direct/src/showutil/FreezeTool.py @@ -8,6 +8,7 @@ import marshal import imp import platform import types +from StringIO import StringIO from distutils.sysconfig import PREFIX, get_python_inc, get_python_version, get_config_var # Temporary (?) try..except to protect against unbuilt p3extend_frozen. @@ -497,7 +498,8 @@ class Freezer: def __init__(self, moduleName, filename = None, implicit = False, guess = False, exclude = False, forbid = False, - allowChildren = False, fromSource = None): + allowChildren = False, fromSource = None, + text = None): # The Python module name. self.moduleName = moduleName @@ -532,6 +534,9 @@ class Freezer: # record came from, supplied by the caller. self.fromSource = fromSource + # If this is set, it contains Python code of the module. + self.text = text + # Some sanity checks. if not self.exclude: self.allowChildren = True @@ -748,7 +753,8 @@ class Freezer: return modules def addModule(self, moduleName, implicit = False, newName = None, - filename = None, guess = False, fromSource = None): + filename = None, guess = False, fromSource = None, + text = None): """ Adds a module to the list of modules to be exported by this tool. If implicit is true, it is OK if the module does not actually exist. @@ -804,7 +810,7 @@ class Freezer: # It's actually a regular module. self.modules[newParentName] = self.ModuleDef( parentName, implicit = implicit, guess = guess, - fromSource = fromSource) + fromSource = fromSource, text = text) else: # Now get all the py files in the parent directory. @@ -819,7 +825,7 @@ class Freezer: # A normal, explicit module name. self.modules[newName] = self.ModuleDef( moduleName, filename = filename, implicit = implicit, - guess = guess, fromSource = fromSource) + guess = guess, fromSource = fromSource, text = text) def done(self, compileToExe = False): """ Call this method after you have added all modules with @@ -970,7 +976,10 @@ class Freezer: stuff = ("", "rb", imp.PY_COMPILED) self.mf.load_module(mdef.moduleName, fp, pathname, stuff) else: - fp = open(pathname, 'U') + if mdef.text: + fp = StringIO(mdef.text) + else: + fp = open(pathname, 'U') stuff = ("", "r", imp.PY_SOURCE) self.mf.load_module(mdef.moduleName, fp, pathname, stuff) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 28acd9b1f8..d7269f78b1 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -455,9 +455,8 @@ SdkAutoDisableMax() SdkAutoDisablePhysX() SdkAutoDisableSpeedTree() -if (RTDIST and DISTRIBUTOR == "cmu"): - HOST_URL = "https://runtime.panda3d.org/" - +if RTDIST and DISTRIBUTOR == "cmu": + # Some validation checks for the CMU builds. if (RTDIST_VERSION == "cmu_1.7" and SDK["PYTHONVERSION"] != "python2.6"): exit("The CMU 1.7 runtime distribution must be built against Python 2.6!") elif (RTDIST_VERSION == "cmu_1.8" and SDK["PYTHONVERSION"] != "python2.7"): @@ -465,7 +464,7 @@ if (RTDIST and DISTRIBUTOR == "cmu"): elif (RTDIST_VERSION == "cmu_1.9" and SDK["PYTHONVERSION"] != "python2.7"): exit("The CMU 1.9 runtime distribution must be built against Python 2.7!") -elif RTDIST and not HOST_URL: +if RTDIST and not HOST_URL: exit("You must specify a host URL when building the rtdist!") if RUNTIME and not HOST_URL: diff --git a/panda/src/rocket/rocketInputHandler.cxx b/panda/src/rocket/rocketInputHandler.cxx index 71ea099192..c0a4e22464 100644 --- a/panda/src/rocket/rocketInputHandler.cxx +++ b/panda/src/rocket/rocketInputHandler.cxx @@ -34,6 +34,8 @@ TypeHandle RocketInputHandler::_type_handle; RocketInputHandler:: RocketInputHandler(const string &name) : DataNode(name), + _mouse_xy(-1), + _mouse_xy_changed(false), _modifiers(0), _wheel_delta(0) { diff --git a/pandatool/src/progbase/programBase.cxx b/pandatool/src/progbase/programBase.cxx index 94bcb0e13b..a9b7c666bf 100644 --- a/pandatool/src/progbase/programBase.cxx +++ b/pandatool/src/progbase/programBase.cxx @@ -27,7 +27,7 @@ #include "configVariableBool.h" #include "panda_getopt_long.h" #include "preprocess_argv.h" -#include "pandaVersion.h" +#include "pandaSystem.h" #include #include @@ -222,7 +222,8 @@ write_man_page(ostream &out) { } } - out << " 1 \"" << date_str << "\" \"" PANDA_VERSION_STR "\" Panda3D\n"; + out << " 1 \"" << date_str << "\" \"" + << PandaSystem::get_version_string() << "\" Panda3D\n"; out << ".SH NAME\n"; if (_brief.empty()) {