diff --git a/direct/src/plugin/p3dX11SplashWindow.cxx b/direct/src/plugin/p3dX11SplashWindow.cxx index 7cbd5af1f8..3b912ad42a 100755 --- a/direct/src/plugin/p3dX11SplashWindow.cxx +++ b/direct/src/plugin/p3dX11SplashWindow.cxx @@ -361,19 +361,29 @@ subprocess_run() { if (_image_filename_changed) { update_image_filename(_image_filename, _image_filename_temp); + override = true; } _image_filename_changed = false; - + if (override || have_event || install_label != prev_label) { redraw(install_label); override = false; - XFillRectangle(_display, _window, _graphics_context, 12, _height - 18, - (unsigned int)(install_progress * (_width - 24)), 7); + + // Don't draw the progress bar unless we have some text in + // install_label. + if (!install_label.empty()) { + XFillRectangle(_display, _window, _graphics_context, 12, _height - 18, + (unsigned int)(install_progress * (_width - 24)), 7); + } XFlush(_display); + } else if (install_progress != prev_progress) { - XFillRectangle(_display, _window, _graphics_context, 12, _height - 18, - (unsigned int)(install_progress * (_width - 24)), 7); + if (!install_label.empty()) { + XFillRectangle(_display, _window, _graphics_context, 12, _height - 18, + (unsigned int)(install_progress * (_width - 24)), 7); + } } + prev_label = install_label; prev_progress = install_progress; @@ -502,11 +512,21 @@ redraw(string label) { } XClearArea(_display, _window, 10, _height - 20, _width - 20, 10, false); } - - // Draw the rest - the label and the progress bar outline. - XDrawString(_display, _window, _graphics_context, _width / 2 - label.size() * 3, - _height - 30, label.c_str(), label.size()); - XDrawRectangle(_display, _window, _graphics_context, 10, _height - 20, _width - 20, 10); + + if (!label.empty()) { + // Draw the rest - the label and the progress bar outline. + int text_width = label.size() * 6; + int text_height = 10; + int text_x = (_width - text_width) / 2; + int text_y = _height - 30; + + XClearArea(_display, _window, + text_x - 2, text_y - text_height - 2, + text_width + 4, text_height + 4, false); + XDrawString(_display, _window, _graphics_context, text_x, text_y, + label.c_str(), label.size()); + XDrawRectangle(_display, _window, _graphics_context, 10, _height - 20, _width - 20, 10); + } } //////////////////////////////////////////////////////////////////// diff --git a/direct/src/showutil/Packager.py b/direct/src/showutil/Packager.py index 43c1ef586c..1ddfff7ebb 100644 --- a/direct/src/showutil/Packager.py +++ b/direct/src/showutil/Packager.py @@ -855,8 +855,6 @@ class Packager: not already been included. Returns the new name within the package tree. """ - assert not filename.isLocal() - filename = Filename(filename) filename.makeCanonical() @@ -1370,6 +1368,32 @@ class Packager: version = args.get('version', None) self.require(packageName, version = version) + def parse_model_path(self, words): + """ + model_path directory + """ + newName = None + + try: + command, dirName = words + except ValueError: + raise ArgumentError + + getModelPath().appendDirectory(Filename.fromOsSpecific(dirName)) + + def parse_reset_model_path(self, words): + """ + reset_model_path + """ + newName = None + + try: + (command,) = words + except ValueError: + raise ArgumentError + + getModelPath().clear() + def parse_module(self, words): """ module moduleName [newName] diff --git a/direct/src/showutil/packp3d.py b/direct/src/showutil/packp3d.py index 5907bcf09e..0ca7e24df4 100755 --- a/direct/src/showutil/packp3d.py +++ b/direct/src/showutil/packp3d.py @@ -116,6 +116,7 @@ def makePackedApp(args): mainModule = main.cStr().replace('/', '.') packager.installDir = appDir + getModelPath().appendDirectory(root) packager.setup() packager.beginPackage(appBase, p3dApplication = True)