mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Merge branch 'release/1.9.x'
Conflicts: .travis.yml direct/src/directtools/DirectLights.py panda/src/nativenet/buffered_datagramconnection.h
This commit is contained in:
commit
50d2e8324e
34
.travis.yml
34
.travis.yml
@ -1,10 +1,32 @@
|
|||||||
language: cpp
|
language: cpp
|
||||||
compiler:
|
sudo: false
|
||||||
- gcc
|
matrix:
|
||||||
- clang
|
include:
|
||||||
before_script:
|
- compiler: gcc
|
||||||
- sudo apt-get install python-dev libpng-dev zlib1g-dev libssl-dev libx11-dev libgl1-mesa-dev libxrandr-dev libxxf86dga-dev libxcursor-dev bison flex libfreetype6-dev libvorbis-dev libjpeg-dev libopenal-dev libode-dev nvidia-cg-toolkit
|
env: PYTHONV=python2.7
|
||||||
script: python makepanda/makepanda.py --everything --verbose --git-commit $TRAVIS_COMMIT --installer --threads 4
|
- compiler: clang
|
||||||
|
env: PYTHONV=python3
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- bison
|
||||||
|
- flex
|
||||||
|
- libfreetype6-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
- libjpeg-dev
|
||||||
|
- libode-dev
|
||||||
|
- libopenal-dev
|
||||||
|
- libpng-dev
|
||||||
|
- libssl-dev
|
||||||
|
- libvorbis-dev
|
||||||
|
- libx11-dev
|
||||||
|
- libxcursor-dev
|
||||||
|
- libxrandr-dev
|
||||||
|
- nvidia-cg-toolkit
|
||||||
|
- python-dev
|
||||||
|
- python3-dev
|
||||||
|
- zlib1g-dev
|
||||||
|
script: $PYTHONV makepanda/makepanda.py --everything --git-commit $TRAVIS_COMMIT --installer --threads 4
|
||||||
notifications:
|
notifications:
|
||||||
irc:
|
irc:
|
||||||
channels:
|
channels:
|
||||||
|
@ -22,6 +22,10 @@
|
|||||||
#include "dcClassParameter.h"
|
#include "dcClassParameter.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
#ifdef HAVE_PYTHON
|
||||||
|
#include "py_panda.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WITHIN_PANDA
|
#ifdef WITHIN_PANDA
|
||||||
#include "pStatTimer.h"
|
#include "pStatTimer.h"
|
||||||
|
|
||||||
|
@ -19,6 +19,10 @@
|
|||||||
#include "hashGenerator.h"
|
#include "hashGenerator.h"
|
||||||
#include "dcmsgtypes.h"
|
#include "dcmsgtypes.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_PYTHON
|
||||||
|
#include "py_panda.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WITHIN_PANDA
|
#ifdef WITHIN_PANDA
|
||||||
#include "pStatTimer.h"
|
#include "pStatTimer.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
|
|
||||||
from panda3d.core import *
|
from panda3d.core import *
|
||||||
from string import lower
|
|
||||||
|
|
||||||
class DirectLight(NodePath):
|
class DirectLight(NodePath):
|
||||||
def __init__(self, light, parent):
|
def __init__(self, light, parent):
|
||||||
|
@ -1315,7 +1315,7 @@ class Enum:
|
|||||||
i = start
|
i = start
|
||||||
for item in items:
|
for item in items:
|
||||||
# remove leading/trailing whitespace
|
# remove leading/trailing whitespace
|
||||||
item = string.strip(item)
|
item = item.strip()
|
||||||
# is there anything left?
|
# is there anything left?
|
||||||
if len(item) == 0:
|
if len(item) == 0:
|
||||||
continue
|
continue
|
||||||
|
@ -4733,13 +4733,17 @@ write_function_instance(ostream &out, FunctionRemap *remap,
|
|||||||
expected_params += "str";
|
expected_params += "str";
|
||||||
|
|
||||||
} else if (TypeManager::is_wchar_pointer(orig_type)) {
|
} else if (TypeManager::is_wchar_pointer(orig_type)) {
|
||||||
|
indent(out, indent_level) << "#if PY_VERSION_HEX >= 0x03020000\n";
|
||||||
|
indent(out, indent_level) << "PyObject *" << param_name << ";\n";
|
||||||
|
indent(out, indent_level) << "#else\n";
|
||||||
indent(out, indent_level) << "PyUnicodeObject *" << param_name << ";\n";
|
indent(out, indent_level) << "PyUnicodeObject *" << param_name << ";\n";
|
||||||
|
indent(out, indent_level) << "#endif\n";
|
||||||
format_specifiers += "U";
|
format_specifiers += "U";
|
||||||
parameter_list += ", &" + param_name;
|
parameter_list += ", &" + param_name;
|
||||||
|
|
||||||
extra_convert
|
extra_convert
|
||||||
<< "#if PY_VERSION_HEX >= 0x03030000\n"
|
<< "#if PY_VERSION_HEX >= 0x03030000\n"
|
||||||
<< "wchar_t *" << param_name << "_str = PyUnicode_AsWideCharString((PyObject *)" << param_name << ", NULL);\n"
|
<< "wchar_t *" << param_name << "_str = PyUnicode_AsWideCharString(" << param_name << ", NULL);\n"
|
||||||
<< "#else"
|
<< "#else"
|
||||||
<< "Py_ssize_t " << param_name << "_len = PyUnicode_GET_SIZE(" << param_name << ");\n"
|
<< "Py_ssize_t " << param_name << "_len = PyUnicode_GET_SIZE(" << param_name << ");\n"
|
||||||
<< "wchar_t *" << param_name << "_str = (wchar_t *)alloca(sizeof(wchar_t) * (" + param_name + "_len + 1));\n"
|
<< "wchar_t *" << param_name << "_str = (wchar_t *)alloca(sizeof(wchar_t) * (" + param_name + "_len + 1));\n"
|
||||||
@ -4757,14 +4761,18 @@ write_function_instance(ostream &out, FunctionRemap *remap,
|
|||||||
expected_params += "unicode";
|
expected_params += "unicode";
|
||||||
|
|
||||||
} else if (TypeManager::is_wstring(orig_type)) {
|
} else if (TypeManager::is_wstring(orig_type)) {
|
||||||
|
indent(out, indent_level) << "#if PY_VERSION_HEX >= 0x03020000\n";
|
||||||
|
indent(out, indent_level) << "PyObject *" << param_name << ";\n";
|
||||||
|
indent(out, indent_level) << "#else\n";
|
||||||
indent(out, indent_level) << "PyUnicodeObject *" << param_name << ";\n";
|
indent(out, indent_level) << "PyUnicodeObject *" << param_name << ";\n";
|
||||||
|
indent(out, indent_level) << "#endif\n";
|
||||||
format_specifiers += "U";
|
format_specifiers += "U";
|
||||||
parameter_list += ", &" + param_name;
|
parameter_list += ", &" + param_name;
|
||||||
|
|
||||||
extra_convert
|
extra_convert
|
||||||
<< "#if PY_VERSION_HEX >= 0x03030000\n"
|
<< "#if PY_VERSION_HEX >= 0x03030000\n"
|
||||||
<< "Py_ssize_t " << param_name << "_len;\n"
|
<< "Py_ssize_t " << param_name << "_len;\n"
|
||||||
<< "wchar_t *" << param_name << "_str = PyUnicode_AsWideCharString((PyObject *)"
|
<< "wchar_t *" << param_name << "_str = PyUnicode_AsWideCharString("
|
||||||
<< param_name << ", &" << param_name << "_len);\n"
|
<< param_name << ", &" << param_name << "_len);\n"
|
||||||
<< "#else\n"
|
<< "#else\n"
|
||||||
<< "Py_ssize_t " << param_name << "_len = PyUnicode_GET_SIZE(" << param_name << ");\n"
|
<< "Py_ssize_t " << param_name << "_len = PyUnicode_GET_SIZE(" << param_name << ");\n"
|
||||||
@ -4782,14 +4790,18 @@ write_function_instance(ostream &out, FunctionRemap *remap,
|
|||||||
expected_params += "unicode";
|
expected_params += "unicode";
|
||||||
|
|
||||||
} else if (TypeManager::is_const_ptr_to_basic_string_wchar(orig_type)) {
|
} else if (TypeManager::is_const_ptr_to_basic_string_wchar(orig_type)) {
|
||||||
|
indent(out, indent_level) << "#if PY_VERSION_HEX >= 0x03020000\n";
|
||||||
|
indent(out, indent_level) << "PyObject *" << param_name << ";\n";
|
||||||
|
indent(out, indent_level) << "#else\n";
|
||||||
indent(out, indent_level) << "PyUnicodeObject *" << param_name << ";\n";
|
indent(out, indent_level) << "PyUnicodeObject *" << param_name << ";\n";
|
||||||
|
indent(out, indent_level) << "#endif\n";
|
||||||
format_specifiers += "U";
|
format_specifiers += "U";
|
||||||
parameter_list += ", &" + param_name;
|
parameter_list += ", &" + param_name;
|
||||||
|
|
||||||
extra_convert
|
extra_convert
|
||||||
<< "#if PY_VERSION_HEX >= 0x03030000\n"
|
<< "#if PY_VERSION_HEX >= 0x03030000\n"
|
||||||
<< "Py_ssize_t " << param_name << "_len;\n"
|
<< "Py_ssize_t " << param_name << "_len;\n"
|
||||||
<< "wchar_t *" << param_name << "_str = PyUnicode_AsWideCharString((PyObject *)"
|
<< "wchar_t *" << param_name << "_str = PyUnicode_AsWideCharString("
|
||||||
<< param_name << ", &" << param_name << "_len);\n"
|
<< param_name << ", &" << param_name << "_len);\n"
|
||||||
<< "#else\n"
|
<< "#else\n"
|
||||||
<< "Py_ssize_t " << param_name << "_len = PyUnicode_GET_SIZE(" << param_name << ");\n"
|
<< "Py_ssize_t " << param_name << "_len = PyUnicode_GET_SIZE(" << param_name << ");\n"
|
||||||
|
@ -135,6 +135,18 @@ inline PyObject* doPy_RETURN_FALSE()
|
|||||||
typedef long Py_hash_t;
|
typedef long Py_hash_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if PY_MAJOR_VERSION >= 3
|
||||||
|
// Python 3 versions before 3.3.3 defined this incorrectly.
|
||||||
|
#undef _PyErr_OCCURRED
|
||||||
|
#define _PyErr_OCCURRED() (PyThreadState_GET()->curexc_type)
|
||||||
|
|
||||||
|
// Python versions before 3.3 did not define this.
|
||||||
|
#if PY_VERSION_HEX < 0x03030000
|
||||||
|
#define PyUnicode_AsUTF8 _PyUnicode_AsString
|
||||||
|
#define PyUnicode_AsUTF8AndSize _PyUnicode_AsStringAndSize
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -144,10 +144,14 @@ extern "C" {
|
|||||||
EXPCL_PYSTUB int PyType_GenericAlloc(...);
|
EXPCL_PYSTUB int PyType_GenericAlloc(...);
|
||||||
EXPCL_PYSTUB int PyType_IsSubtype(...);
|
EXPCL_PYSTUB int PyType_IsSubtype(...);
|
||||||
EXPCL_PYSTUB int PyType_Ready(...);
|
EXPCL_PYSTUB int PyType_Ready(...);
|
||||||
|
EXPCL_PYSTUB int PyUnicodeUCS2_FromFormat(...);
|
||||||
|
EXPCL_PYSTUB int PyUnicodeUCS2_FromString(...);
|
||||||
EXPCL_PYSTUB int PyUnicodeUCS2_FromStringAndSize(...);
|
EXPCL_PYSTUB int PyUnicodeUCS2_FromStringAndSize(...);
|
||||||
EXPCL_PYSTUB int PyUnicodeUCS2_FromWideChar(...);
|
EXPCL_PYSTUB int PyUnicodeUCS2_FromWideChar(...);
|
||||||
EXPCL_PYSTUB int PyUnicodeUCS2_AsWideChar(...);
|
EXPCL_PYSTUB int PyUnicodeUCS2_AsWideChar(...);
|
||||||
EXPCL_PYSTUB int PyUnicodeUCS2_GetSize(...);
|
EXPCL_PYSTUB int PyUnicodeUCS2_GetSize(...);
|
||||||
|
EXPCL_PYSTUB int PyUnicodeUCS4_FromFormat(...);
|
||||||
|
EXPCL_PYSTUB int PyUnicodeUCS4_FromString(...);
|
||||||
EXPCL_PYSTUB int PyUnicodeUCS4_FromStringAndSize(...);
|
EXPCL_PYSTUB int PyUnicodeUCS4_FromStringAndSize(...);
|
||||||
EXPCL_PYSTUB int PyUnicodeUCS4_FromWideChar(...);
|
EXPCL_PYSTUB int PyUnicodeUCS4_FromWideChar(...);
|
||||||
EXPCL_PYSTUB int PyUnicodeUCS4_AsWideChar(...);
|
EXPCL_PYSTUB int PyUnicodeUCS4_AsWideChar(...);
|
||||||
@ -175,6 +179,8 @@ extern "C" {
|
|||||||
EXPCL_PYSTUB int _PyObject_CallMethod_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 _PyUnicode_AsString(...);
|
||||||
|
EXPCL_PYSTUB int _PyUnicode_AsStringAndSize(...);
|
||||||
EXPCL_PYSTUB int _Py_BuildValue_SizeT(...);
|
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(...);
|
||||||
@ -190,6 +196,7 @@ extern "C" {
|
|||||||
EXPCL_PYSTUB extern void *PyExc_Exception;
|
EXPCL_PYSTUB extern void *PyExc_Exception;
|
||||||
EXPCL_PYSTUB extern void *PyExc_FutureWarning;
|
EXPCL_PYSTUB extern void *PyExc_FutureWarning;
|
||||||
EXPCL_PYSTUB extern void *PyExc_IndexError;
|
EXPCL_PYSTUB extern void *PyExc_IndexError;
|
||||||
|
EXPCL_PYSTUB extern void *PyExc_OSError;
|
||||||
EXPCL_PYSTUB extern void *PyExc_RuntimeError;
|
EXPCL_PYSTUB extern void *PyExc_RuntimeError;
|
||||||
EXPCL_PYSTUB extern void *PyExc_StandardError;
|
EXPCL_PYSTUB extern void *PyExc_StandardError;
|
||||||
EXPCL_PYSTUB extern void *PyExc_StopIteration;
|
EXPCL_PYSTUB extern void *PyExc_StopIteration;
|
||||||
@ -334,10 +341,14 @@ int PyTuple_Type(...) { return 0; };
|
|||||||
int PyType_GenericAlloc(...) { return 0; };
|
int PyType_GenericAlloc(...) { return 0; };
|
||||||
int PyType_IsSubtype(...) { return 0; }
|
int PyType_IsSubtype(...) { return 0; }
|
||||||
int PyType_Ready(...) { return 0; };
|
int PyType_Ready(...) { return 0; };
|
||||||
|
int PyUnicodeUCS2_FromFormat(...) { return 0; }
|
||||||
|
int PyUnicodeUCS2_FromString(...) { return 0; }
|
||||||
int PyUnicodeUCS2_FromStringAndSize(...) { return 0; }
|
int PyUnicodeUCS2_FromStringAndSize(...) { return 0; }
|
||||||
int PyUnicodeUCS2_FromWideChar(...) { return 0; }
|
int PyUnicodeUCS2_FromWideChar(...) { return 0; }
|
||||||
int PyUnicodeUCS2_AsWideChar(...) { return 0; }
|
int PyUnicodeUCS2_AsWideChar(...) { return 0; }
|
||||||
int PyUnicodeUCS2_GetSize(...) { return 0; }
|
int PyUnicodeUCS2_GetSize(...) { return 0; }
|
||||||
|
int PyUnicodeUCS4_FromFormat(...) { return 0; }
|
||||||
|
int PyUnicodeUCS4_FromString(...) { return 0; }
|
||||||
int PyUnicodeUCS4_FromStringAndSize(...) { return 0; }
|
int PyUnicodeUCS4_FromStringAndSize(...) { return 0; }
|
||||||
int PyUnicodeUCS4_FromWideChar(...) { return 0; }
|
int PyUnicodeUCS4_FromWideChar(...) { return 0; }
|
||||||
int PyUnicodeUCS4_AsWideChar(...) { return 0; }
|
int PyUnicodeUCS4_AsWideChar(...) { return 0; }
|
||||||
@ -365,6 +376,8 @@ int _PyObject_CallFunction_SizeT(...) { return 0; };
|
|||||||
int _PyObject_CallMethod_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 _PyUnicode_AsString(...) { return 0; };
|
||||||
|
int _PyUnicode_AsStringAndSize(...) { return 0; };
|
||||||
int _Py_BuildValue_SizeT(...) { 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; };
|
||||||
@ -385,6 +398,7 @@ void *PyExc_ConnectionError = (void *)NULL;
|
|||||||
void *PyExc_Exception = (void *)NULL;
|
void *PyExc_Exception = (void *)NULL;
|
||||||
void *PyExc_FutureWarning = (void *)NULL;
|
void *PyExc_FutureWarning = (void *)NULL;
|
||||||
void *PyExc_IndexError = (void *)NULL;
|
void *PyExc_IndexError = (void *)NULL;
|
||||||
|
void *PyExc_OSError = (void *)NULL;
|
||||||
void *PyExc_RuntimeError = (void *)NULL;
|
void *PyExc_RuntimeError = (void *)NULL;
|
||||||
void *PyExc_StandardError = (void *)NULL;
|
void *PyExc_StandardError = (void *)NULL;
|
||||||
void *PyExc_StopIteration = (void *)NULL;
|
void *PyExc_StopIteration = (void *)NULL;
|
||||||
|
@ -1519,7 +1519,7 @@ def CompileLink(dll, obj, opts):
|
|||||||
else:
|
else:
|
||||||
cmd += ",5.01"
|
cmd += ",5.01"
|
||||||
|
|
||||||
if dll.endswith(".dll"):
|
if dll.endswith(".dll") or dll.endswith(".pyd"):
|
||||||
cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
|
cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
|
||||||
|
|
||||||
for (opt, dir) in LIBDIRECTORIES:
|
for (opt, dir) in LIBDIRECTORIES:
|
||||||
@ -1527,10 +1527,8 @@ def CompileLink(dll, obj, opts):
|
|||||||
cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
|
cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
|
||||||
|
|
||||||
for x in obj:
|
for x in obj:
|
||||||
if x.endswith(".dll"):
|
if x.endswith(".dll") or x.endswith(".pyd"):
|
||||||
cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
|
cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
|
||||||
elif x.endswith(".pyd"):
|
|
||||||
cmd += ' ' + os.path.splitext(x)[0] + ".lib"
|
|
||||||
elif x.endswith(".lib"):
|
elif x.endswith(".lib"):
|
||||||
dname = os.path.splitext(os.path.basename(x))[0] + ".dll"
|
dname = os.path.splitext(os.path.basename(x))[0] + ".dll"
|
||||||
if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + dname)):
|
if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + dname)):
|
||||||
@ -1587,10 +1585,8 @@ def CompileLink(dll, obj, opts):
|
|||||||
cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
|
cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
|
||||||
|
|
||||||
for x in obj:
|
for x in obj:
|
||||||
if x.endswith(".dll"):
|
if x.endswith(".dll") or x.endswith(".pyd"):
|
||||||
cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
|
cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
|
||||||
elif x.endswith(".pyd"):
|
|
||||||
cmd += ' ' + os.path.splitext(x)[0] + ".lib"
|
|
||||||
elif x.endswith(".lib"):
|
elif x.endswith(".lib"):
|
||||||
dname = os.path.splitext(dll)[0]+".dll"
|
dname = os.path.splitext(dll)[0]+".dll"
|
||||||
if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + os.path.splitext(os.path.basename(x))[0] + ".dll")):
|
if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + os.path.splitext(os.path.basename(x))[0] + ".dll")):
|
||||||
|
@ -42,10 +42,10 @@ SendMessage(const Datagram &msg) {
|
|||||||
#ifdef HAVE_PYTHON
|
#ifdef HAVE_PYTHON
|
||||||
ostringstream s;
|
ostringstream s;
|
||||||
|
|
||||||
#if PY_MAJOR_VERSION >= 3
|
#if PY_VERSION_HEX >= 0x03030000
|
||||||
PyObject *exc_type = PyExc_ConnectionError;
|
PyObject *exc_type = PyExc_ConnectionError;
|
||||||
#else
|
#else
|
||||||
PyObject *exc_type = PyExc_StandardError;
|
PyObject *exc_type = PyExc_OSError;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
s << endl << "Error sending message: " << endl;
|
s << endl << "Error sending message: " << endl;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user