Merge remote-tracking branch 'origin/release/1.9.x'

This commit is contained in:
rdb 2015-08-23 17:03:55 +02:00
commit cbb3969017
15 changed files with 114 additions and 337 deletions

View File

@ -1,44 +0,0 @@
##############################################################################
#
# cleancvstree
#
# Cleancvstree searches a CVS tree for files that are not in CVS, and
# deletes them. Be careful using it --- it's very aggressive.
#
##############################################################################
import sys,os
def cleanCvsTree(dir):
try:
sub = os.listdir(dir)
except:
print "Could not read directory: "+dir
return
valid = {}
try:
readentries = 0
cvsent = open(dir + "/CVS/Entries")
for line in cvsent:
words = line.split("/")
if (len(words) > 1):
valid[words[1]] = 1
cvsent.close()
readentries = 1
except:
print "Could not read "+dir+"/CVS/Entries"
if (readentries):
for file in sub:
if (os.path.isfile(dir+"/"+file)):
if (valid.has_key(file)==0):
os.unlink(dir+"/"+file)
for file in sub:
if (file != "CVS"):
if (os.path.isdir(dir+"/"+file)):
cleanCvsTree(dir+"/"+file)
if (os.path.isdir(sys.argv[1])==0):
print "Not a directory: "+sys.argv[1]
os.exit(1)
cleanCvsTree(sys.argv[1])

View File

@ -1,124 +0,0 @@
#!/usr/bin/env python
"""This script generates the panda3d-date.tar.gz tarball for a file
release of panda3d onto the SourceForge download site.
Options:
-d cvsroot
Specifies the CVSROOT string to use to tag and export the
tree. The default is $SFROOT if it is defined, or $CVSROOT
otherwise.
-r tag
Specifies the tag to export from. If this parameter is
specified, the tree is not tagged again; otherwise, the
current head of the CVS tree is tagged with the file version
name.
-m module
Specifies the module to check out and build. The default is
panda3d.
"""
import sys
import os
import os.path
import getopt
import time
import glob
import shutil
CVSROOT = os.getenv('SFROOT') or os.getenv('CVSROOT')
ORIGTAG = ''
MODULE = 'panda3d'
def usage(code, msg = ''):
print >> sys.stderr, __doc__
print >> sys.stderr, msg
sys.exit(code)
try:
opts, args = getopt.getopt(sys.argv[1:], 'd:r:m:h')
except getopt.error, msg:
usage(1, msg)
for opt, arg in opts:
if opt == '-d':
CVSROOT = arg
elif opt == '-r':
ORIGTAG = arg
elif opt == '-m':
MODULE = arg
elif opt == '-h':
usage(0)
if not CVSROOT:
usage(1, 'CVSROOT must have a value.')
if not MODULE:
usage(1, 'MODULE must have a value.')
basename = MODULE + '-' + time.strftime("%Y-%m-%d")
tarfile = basename + '.tar.gz'
zipfile = basename + '.zip'
if os.path.exists(basename):
print basename, 'already exists in the local directory!'
sys.exit(1)
if not ORIGTAG:
# If we weren't given a starting tag, make one.
tag = basename
print 'Tagging sources.'
cmd = 'cvs -f -d "%s" rtag -F -r HEAD "%s" "%s"' % (CVSROOT, tag, MODULE)
if os.system(cmd) != 0:
sys.exit(1)
else:
# Otherwise, we were given a starting tag, so use it.
tag = ORIGTAG
print 'Checking out "%s" as "%s".' % (MODULE, basename)
cmd = 'cvs -z3 -f -d "%s" export -r "%s" -d "%s" "%s"' % (CVSROOT, tag,
basename, MODULE)
if os.system(cmd) != 0:
sys.exit(1)
# Move the contents of the doc module into the root directory where people
# will expect to see it.
docdir = basename + os.sep + 'doc'
if os.path.exists(docdir):
files = glob.glob(docdir + os.sep + '*')
for file in files:
shutil.copy(file, basename)
os.remove(file)
os.rmdir(docdir)
# Generate the autoconf scripts for ppremake.
if MODULE == 'ppremake':
ppremakedir = basename
else:
ppremakedir = basename + os.sep + 'ppremake'
if os.path.exists(ppremakedir):
cmd = 'cd "./%s" && aclocal && autoheader && automake --foreign -a && autoconf' % (ppremakedir)
if os.system(cmd) != 0:
sys.exit(1)
# Generate the tarball.
print 'Generating %s' % (tarfile)
if os.path.exists(tarfile):
os.remove(tarfile)
cmd = 'tar cf - "%s" | gzip -9 > "%s"' % (basename, tarfile)
if os.system(cmd) != 0:
sys.exit(1)
# Also generate a zip file.
print 'Generating %s' % (zipfile)
if os.path.exists(zipfile):
os.remove(zipfile)
cmd = 'zip -9rq "%s" "%s"' % (zipfile, basename)
if os.system(cmd) != 0:
sys.exit(1)
shutil.rmtree(basename)

View File

@ -641,7 +641,7 @@ class AppRunner(DirectObject):
if hasattr(__builtin__, "base"):
base.destroy()
self.notify.info("Normal exit with status %d." % err.code)
self.notify.info("Normal exit with status %s." % repr(err.code))
raise
except:

View File

@ -2371,7 +2371,7 @@ class Packager:
# Binary files that are copied (and compressed) without
# processing.
self.binaryExtensions = [ 'ttf', 'TTF', 'mid', 'ico' ]
self.binaryExtensions = [ 'ttf', 'TTF', 'mid', 'ico', 'cur' ]
# Files that can have an existence in multiple different
# packages simultaneously without conflict.
@ -2411,7 +2411,7 @@ class Packager:
}
# Files that should be extracted to disk.
self.extractExtensions = self.executableExtensions[:] + self.manifestExtensions[:] + [ 'ico' ]
self.extractExtensions = self.executableExtensions[:] + self.manifestExtensions[:] + [ 'ico', 'cur' ]
# Files that indicate a platform dependency.
self.platformSpecificExtensions = self.executableExtensions[:]

View File

@ -111,7 +111,7 @@ class ArgumentError(StandardError):
pass
def makePackedApp(args):
opts, args = getopt.getopt(args, 'o:d:m:S:e:n:p:c:r:s:Dh')
opts, args = getopt.getopt(args, 'o:d:m:S:e:n:x:p:c:r:s:Dh')
packager = Packager.Packager()

View File

@ -2,8 +2,8 @@
if __name__ == "__main__":
from direct.directbase.TestStart import *
from pandac.LinearVectorForce import LinearVectorForce
from pandac.Vec3 import Vec3
from panda3d.physics import LinearVectorForce
from panda3d.core import Vec3
import ParticleEffect
from direct.tkpanels import ParticlePanel
import Particles

View File

@ -376,12 +376,30 @@ run_python() {
// An uncaught application exception, and not handled by
// appRunner.exceptionHandler. If it is a SystemExit, extract
// the exit status that we should return.
if (PyErr_Occurred() == PyExc_SystemExit) {
if (PyErr_ExceptionMatches(PyExc_SystemExit)) {
PyObject *ptype, *ptraceback;
PySystemExitObject *value = NULL;
PyErr_Fetch(&ptype, (PyObject **)&value, &ptraceback);
if (value != NULL) {
status = (int)PyInt_AsLong(value->code);
PyObject *value = NULL;
PyErr_Fetch(&ptype, &value, &ptraceback);
if (value != NULL && PyExceptionInstance_Check(value)) {
PyObject *code = PyObject_GetAttrString(value, "code");
if (code) {
Py_DECREF(value);
value = code;
}
}
if (value == NULL || value == Py_None) {
status = 0;
#if PY_MAJOR_VERSION >= 3
} else if (PyLong_Check(value)) {
status = (int)PyLong_AsLong(value);
#else
} else if (PyInt_Check(value)) {
status = (int)PyInt_AsLong(value);
#endif
} else {
status = 1;
}
} else {
PyErr_Print();

View File

@ -855,7 +855,7 @@ class Loader(DirectObject):
def loadShader (self, shaderPath, okMissing = False):
shader = ShaderPool.loadShader (shaderPath)
if not shader and not okMissing:
message = 'Could not shader file: %s' % (shaderPath)
message = 'Could not load shader file: %s' % (shaderPath)
raise IOError, message
return shader

View File

@ -21,7 +21,7 @@ goto done
:missing2
echo You seem to be missing the 'thirdparty' directory. You probably checked
echo the source code out from sourceforge. The sourceforge repository is
echo the source code out from GitHub. The GitHub repository is
echo missing the 'thirdparty' directory. You will need to supplement the
echo code by downloading the 'thirdparty' directory from www.panda3d.org
goto done

View File

@ -21,7 +21,7 @@ goto done
:missing2
echo You seem to be missing the 'thirdparty' directory. You probably checked
echo the source code out from sourceforge. The sourceforge repository is
echo the source code out from GitHub. The GitHub repository is
echo missing the 'thirdparty' directory. You will need to supplement the
echo code by downloading the 'thirdparty' directory from www.panda3d.org
goto done

View File

@ -21,7 +21,7 @@ goto done
:missing2
echo You seem to be missing the 'thirdparty' directory. You probably checked
echo the source code out from sourceforge. The sourceforge repository is
echo the source code out from GitHub. The GitHub repository is
echo missing the 'thirdparty' directory. You will need to supplement the
echo code by downloading the 'thirdparty' directory from www.panda3d.org
goto done

View File

@ -31,7 +31,7 @@ goto done
:missing2
echo %thirdparty%
echo You seem to be missing the 'thirdparty' directory. You probably checked
echo the source code out from sourceforge. The sourceforge repository is
echo the source code out from GitHub. The GitHub repository is
echo missing the 'thirdparty' directory. You will need to supplement the
echo code by downloading the 'thirdparty' directory from www.panda3d.org
goto done

View File

@ -1,95 +0,0 @@
VC7 upgrade instructions in 2 easy steps
------------------------
Step 1. cvs update wintools & dtool
Step 2. Run v:\msvc7\vc_setup\setup.exe, or install from the MSDN
'Visual Studio.NET' CD. Click on 'Windows Component Update' (if it is
highlighted, else click '2'). Click 'Continue' (Selecting 'Do not use
this machine to host web projects') You will install IE6, which will
requires a reboot. Give your pw if you want it to happen
automatically.
After rebooting, setup should start again. If it does not, go back and
rerun it, it should remember where it left off.
After installing components, you are ready to install VC7 in Step 2.
Enter this step and enter the product-key, which is stored in
V:\msvc7\vc7-prodkey.txt
On the 'select items to install page', you need uncheck things to
avoid wasting gigs of extra space and install time. Uncheck
everything except for Language Tools->Visual C++, Server
Components->Remote Debugger->Native Remote Debugger, and if you want,
Documentation (this is a gig, and is only a slight update if you
already have MSDN installed locally though. You will want to
uninstall the separately-installed MSDN docs if you get this.)
Unlike VC 6.0, there is no option to add the required compiler bin
directories to the environment path automatically. To do this, if you
are running from the NT command line, run
"C:\Program Files\Microsoft Visual Studio .NET\Vc7\bin\vcvars32.bat"
If you are using tcsh.exe under cygwin, enable VC7 using
'source $WINTOOLS/etc/setup_msvc7.csh'
You will want to copy the top portion of setup_msvc7.csh to your
.cshrc, so you can do 'set_msvc7' to set up the PATH properly in the
future, or you can add the required dirs to the front of your path
explicitly as well as 'setenv USE_COMPILER MSVC7' to always use VC7.
The easiest thing to do is just put the 'set_msvc7' at the end of your
.cshrc.
IMPORTANT:
After finishing this process, make sure you are using VC7 in your
shell by typing 'cl' at the prompt. If you see:
> Microsoft (R)32-bit C/C++ Optimizing Compiler Version 13.00.9466 for 80x86
> Copyright (C) Microsoft Corporation 1984-2001.
then you have VC7. If you have still VC6, you will see
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
> Copyright (C) Microsoft Corp 1984-1998.
If you try to build with this broken setup, the build process
will get confused and compile with VC6 but try to link with
the VC7 libraries and you will get link errors.
To correct this problem, check your tcsh path to make sure it has the
.NET dirs in it, and make sure the cygwin softlink mount point /msvc7
exists, and is not empty but points to the proper VC7 directory. Doing
'ls /msvc7' should give you something like
Common7/ Visual Studio .NET Enterprise Architect - English/
Crystal Reports/ Visual Studio SDKs/
EnterpriseFrameworks/ contents.htm
FrameworkSDK/ readme.htm
Msdn/ redist.txt
Setup/ sqlserver/
Vb7/ toc.htm
Vc7/ vdt70vcs.dll*
If it does not, try running 'source ~/player/wintools/etc/setup_env.csh'
again to get it to do the
'mount -s C:/Program\ Files/Microsoft\ Visual\ Studio\ .NET /msvc7'
cmd to create the softlink, or run the cmd yourself.
---
Notes:
The debug C runtime seems significantly slower than the vc6 one, which has
slowed Opt2 install builds considerably.
---------
To distribute toontown,
We need to rebuild the python and nspr DLLs to link to the new
VC7 C and C++ runtime DLLs, which are
msvcp70.dll
msvcr70.dll
and these must replace
msvcp60.dll
msvcrt.dll
in the Toontown download.

View File

@ -430,6 +430,7 @@ process_events() {
// inner corner, anyway, but that means we need to fix
// XConfigureWindow too.)
properties.set_origin(configure_event.x, configure_event.y);
properties.set_size(configure_event.width, configure_event.height);
if (_properties.get_fixed_size()) {
// If the window properties indicate a fixed size only, undo
@ -437,21 +438,15 @@ process_events() {
// doesn't appear to be a way to universally disallow this
// directly (although we do set the min_size and max_size to
// the same value, which seems to work for most window
// managers.) Incidentally, this also works to force my
// tiling window manager into 'floating' mode.
WindowProperties current_props = get_properties();
if (configure_event.width != current_props.get_x_size() ||
configure_event.height != current_props.get_y_size()) {
// managers.)
if (configure_event.width != _fixed_size.get_x() ||
configure_event.height != _fixed_size.get_y()) {
XWindowChanges changes;
changes.width = current_props.get_x_size();
changes.height = current_props.get_y_size();
changes.width = _fixed_size.get_x();
changes.height = _fixed_size.get_y();
int value_mask = (CWWidth | CWHeight);
XConfigureWindow(_display, _xwindow, value_mask, &changes);
}
} else {
// A normal window may be resized by the user at will.
properties.set_size(configure_event.width, configure_event.height);
}
changed_properties = true;
}
@ -495,16 +490,19 @@ set_properties_now(WindowProperties &properties) {
x11GraphicsPipe *x11_pipe;
DCAST_INTO_V(x11_pipe, _pipe);
// Handle fullscreen mode.
if (properties.has_fullscreen()) {
if (properties.get_fullscreen()) {
// We're either going into or out of fullscreen, or are in fullscreen
// and are changing the resolution.
bool is_fullscreen = _properties.has_fullscreen() && _properties.get_fullscreen();
bool want_fullscreen = properties.has_fullscreen() ? properties.get_fullscreen() : is_fullscreen;
if (is_fullscreen != want_fullscreen || (is_fullscreen && properties.has_size())) {
if (want_fullscreen) {
if (_have_xrandr) {
#ifdef HAVE_XRANDR
XRRScreenConfiguration* conf = XRRGetScreenInfo(_display, x11_pipe->get_root());
if (_orig_size_id == (SizeID) -1) {
_orig_size_id = XRRConfigCurrentConfiguration(conf, &_orig_rotation);
}
int num_sizes, reqsizex, reqsizey, new_size_id = -1;
SizeID old_size_id = XRRConfigCurrentConfiguration(conf, &_orig_rotation);
SizeID new_size_id = (SizeID) -1;
int num_sizes = 0, reqsizex, reqsizey;
if (properties.has_size()) {
reqsizex = properties.get_x_size();
reqsizey = properties.get_y_size();
@ -520,16 +518,18 @@ set_properties_now(WindowProperties &properties) {
new_size_id = i;
}
}
if (new_size_id == -1) {
if (new_size_id == (SizeID) -1) {
x11display_cat.error()
<< "Videocard has no supported display resolutions at specified res ("
<< reqsizex << " x " << reqsizey <<")\n";
_orig_size_id = -1;
<< reqsizex << " x " << reqsizey << ")\n";
} else {
if (new_size_id != _orig_size_id) {
if (new_size_id != old_size_id) {
XRRSetScreenConfig(_display, conf, x11_pipe->get_root(), new_size_id, _orig_rotation, CurrentTime);
} else {
_orig_size_id = -1;
if (_orig_size_id == (SizeID) -1) {
// Remember the original resolution so we can switch back to it.
_orig_size_id = old_size_id;
}
}
}
#endif
@ -546,7 +546,7 @@ set_properties_now(WindowProperties &properties) {
if (_have_xrandr && _orig_size_id != (SizeID) -1) {
XRRScreenConfiguration* conf = XRRGetScreenInfo(_display, x11_pipe->get_root());
XRRSetScreenConfig(_display, conf, x11_pipe->get_root(), _orig_size_id, _orig_rotation, CurrentTime);
_orig_size_id = -1;
_orig_size_id = (SizeID) -1;
}
#endif
// Set the origin back to what it was
@ -590,8 +590,7 @@ set_properties_now(WindowProperties &properties) {
// on the fly.
// We'll pass some property requests on as a window manager hint.
WindowProperties wm_properties = _properties;
wm_properties.add_properties(properties);
set_wm_properties(properties, true);
// The window title may be changed by issuing another hint request.
// Assume this will be honored.
@ -618,6 +617,7 @@ set_properties_now(WindowProperties &properties) {
changes.y = 0;
value_mask |= CWX | CWY;
properties.clear_origin();
} else if (properties.has_origin()) {
changes.x = properties.get_x_origin();
changes.y = properties.get_y_origin();
@ -626,10 +626,21 @@ set_properties_now(WindowProperties &properties) {
properties.clear_origin();
}
// This, too. But we can't currently change out of fixed_size mode.
if (properties.has_fixed_size() && properties.get_fixed_size()) {
_properties.set_fixed_size(properties.get_fixed_size());
properties.clear_fixed_size();
_fixed_size = _properties.get_size();
}
if (properties.has_size()) {
changes.width = properties.get_x_size();
changes.height = properties.get_y_size();
value_mask |= (CWWidth | CWHeight);
if (_properties.get_fixed_size()) {
_fixed_size = properties.get_size();
}
properties.clear_size();
}
@ -657,13 +668,6 @@ set_properties_now(WindowProperties &properties) {
properties.clear_z_order();
}
if (value_mask != 0) {
XReconfigureWMWindow(_display, _xwindow, _screen, value_mask, &changes);
// Don't draw anything until this is done reconfiguring.
_awaiting_configure = true;
}
// We hide the cursor by setting it to an invisible pixmap.
// We can also load a custom cursor from a file.
if (properties.has_cursor_hidden() || properties.has_cursor_filename()) {
@ -784,7 +788,14 @@ set_properties_now(WindowProperties &properties) {
}
}
set_wm_properties(wm_properties, true);
if (value_mask != 0) {
// We must call this after changing the WM properties, otherwise
// we may get misleading ConfigureNotify events in the wrong order.
XReconfigureWMWindow(_display, _xwindow, _screen, value_mask, &changes);
// Don't draw anything until this is done reconfiguring.
_awaiting_configure = true;
}
}
////////////////////////////////////////////////////////////////////
@ -964,6 +975,11 @@ open_window() {
<< "failed to create X window.\n";
return false;
}
if (_properties.get_fixed_size()) {
_fixed_size = _properties.get_size();
}
set_wm_properties(_properties, false);
// We don't specify any fancy properties of the XIC. It would be
@ -1036,8 +1052,8 @@ set_wm_properties(const WindowProperties &properties, bool already_mapped) {
XTextProperty window_name;
XTextProperty *window_name_p = (XTextProperty *)NULL;
if (properties.has_title()) {
char *name = (char *)properties.get_title().c_str();
if (XStringListToTextProperty(&name, 1, &window_name) != 0) {
const char *name = properties.get_title().c_str();
if (XStringListToTextProperty((char **)&name, 1, &window_name) != 0) {
window_name_p = &window_name;
}
}
@ -1058,18 +1074,19 @@ set_wm_properties(const WindowProperties &properties, bool already_mapped) {
}
size_hints_p->flags |= USPosition;
}
LVecBase2i size = _properties.get_size();
if (properties.has_size()) {
size_hints_p->width = properties.get_x_size();
size_hints_p->height = properties.get_y_size();
size = properties.get_size();
size_hints_p->width = size.get_x();
size_hints_p->height = size.get_y();
size_hints_p->flags |= USSize;
if (properties.get_fixed_size()) {
size_hints_p->min_width = properties.get_x_size();
size_hints_p->min_height = properties.get_y_size();
size_hints_p->max_width = properties.get_x_size();
size_hints_p->max_height = properties.get_y_size();
size_hints_p->flags |= (PMinSize | PMaxSize);
}
}
if (properties.get_fixed_size()) {
size_hints_p->min_width = size.get_x();
size_hints_p->min_height = size.get_y();
size_hints_p->max_width = size.get_x();
size_hints_p->max_height = size.get_y();
size_hints_p->flags |= (PMinSize | PMaxSize);
}
}
}
@ -1109,18 +1126,21 @@ set_wm_properties(const WindowProperties &properties, bool already_mapped) {
SetAction set_data[max_set_data];
int next_set_data = 0;
if (properties.get_fullscreen()) {
// For a "fullscreen" request, we pass this through, hoping the
// window manager will support EWMH.
type_data[next_type_data++] = x11_pipe->_net_wm_window_type_fullscreen;
if (properties.has_fullscreen()) {
if (properties.get_fullscreen()) {
// For a "fullscreen" request, we pass this through, hoping the
// window manager will support EWMH.
type_data[next_type_data++] = x11_pipe->_net_wm_window_type_fullscreen;
// We also request it as a state.
state_data[next_state_data++] = x11_pipe->_net_wm_state_fullscreen;
// Don't ask me why this has to be 1/0 and not _net_wm_state_add.
// It doesn't seem to work otherwise.
set_data[next_set_data++] = SetAction(x11_pipe->_net_wm_state_fullscreen, 1);
} else {
set_data[next_set_data++] = SetAction(x11_pipe->_net_wm_state_fullscreen, 0);
// We also request it as a state.
state_data[next_state_data++] = x11_pipe->_net_wm_state_fullscreen;
// Don't ask me why this has to be 1/0 and not _net_wm_state_add.
// It doesn't seem to work otherwise.
set_data[next_set_data++] = SetAction(x11_pipe->_net_wm_state_fullscreen, 1);
} else {
set_data[next_set_data++] = SetAction(x11_pipe->_net_wm_state_fullscreen, 0);
}
}
// If we asked for a window without a border, there's no excellent

View File

@ -96,6 +96,8 @@ protected:
SizeID _orig_size_id;
#endif
LVecBase2i _fixed_size;
long _event_mask;
bool _awaiting_configure;
bool _dga_mouse_enabled;