diff --git a/dtool/metalibs/dtoolconfig/pydtool.cxx b/dtool/metalibs/dtoolconfig/pydtool.cxx index 3350380ba4..0293df157f 100644 --- a/dtool/metalibs/dtoolconfig/pydtool.cxx +++ b/dtool/metalibs/dtoolconfig/pydtool.cxx @@ -60,6 +60,8 @@ static PyObject *_inP07ytISgV(PyObject *self, PyObject *args); static PyObject *_inP07ytH3bx(PyObject *self, PyObject *args); static PyObject *_inP07ytzeUk(PyObject *self, PyObject *args); static PyObject *_inP07ytUeI5(PyObject *self, PyObject *args); +static PyObject *_inP07ytbmxJ(PyObject *self, PyObject *args); +static PyObject *_inP07ytY8Lc(PyObject *self, PyObject *args); static PyObject *_inP07ytJAAI(PyObject *self, PyObject *args); static PyObject *_inP07yt0UXw(PyObject *self, PyObject *args); static PyObject *_inP07ytuSvx(PyObject *self, PyObject *args); @@ -95,6 +97,8 @@ static PyObject *_inP07ytiytI(PyObject *self, PyObject *args); static PyObject *_inP07ytZc07(PyObject *self, PyObject *args); static PyObject *_inP07ytfaH0(PyObject *self, PyObject *args); static PyObject *_inP07ytGB9D(PyObject *self, PyObject *args); +static PyObject *_inP07ytrppS(PyObject *self, PyObject *args); +static PyObject *_inP07ytO50x(PyObject *self, PyObject *args); static PyObject *_inP07ytsxxs(PyObject *self, PyObject *args); static PyObject *_inP07ytMT0z(PyObject *self, PyObject *args); static PyObject *_inP07ytiW3v(PyObject *self, PyObject *args); @@ -126,6 +130,8 @@ static PyObject *_inP07ytDyRd(PyObject *self, PyObject *args); static PyObject *_inP07ytMnKa(PyObject *self, PyObject *args); static PyObject *_inP07ytRtji(PyObject *self, PyObject *args); static PyObject *_inP07ytCnbQ(PyObject *self, PyObject *args); +static PyObject *_inP07ytoxqc(PyObject *self, PyObject *args); +static PyObject *_inP07ytZQIS(PyObject *self, PyObject *args); static PyObject *_inP07ytdUVN(PyObject *self, PyObject *args); static PyObject *_inP07ytZtNk(PyObject *self, PyObject *args); static PyObject *_inP07ytihbt(PyObject *self, PyObject *args); @@ -828,6 +834,34 @@ _inP07ytUeI5(PyObject *, PyObject *args) { return nullptr; } +/* + * Python simple wrapper for + * bool interrogate_function_is_unary_op(FunctionIndex function) + */ +static PyObject * +_inP07ytbmxJ(PyObject *, PyObject *args) { + int param0; + if (PyArg_ParseTuple(args, "i", ¶m0)) { + bool return_value = (::interrogate_function_is_unary_op)((FunctionIndex)param0); + return PyBool_FromLong(return_value); + } + return nullptr; +} + +/* + * Python simple wrapper for + * bool interrogate_function_is_operator_typecast(FunctionIndex function) + */ +static PyObject * +_inP07ytY8Lc(PyObject *, PyObject *args) { + int param0; + if (PyArg_ParseTuple(args, "i", ¶m0)) { + bool return_value = (::interrogate_function_is_operator_typecast)((FunctionIndex)param0); + return PyBool_FromLong(return_value); + } + return nullptr; +} + /* * Python simple wrapper for * bool interrogate_function_is_constructor(FunctionIndex function) @@ -1405,6 +1439,42 @@ _inP07ytGB9D(PyObject *, PyObject *args) { return nullptr; } +/* + * Python simple wrapper for + * FunctionIndex interrogate_make_seq_num_getter(MakeSeqIndex make_seq) + */ +static PyObject * +_inP07ytrppS(PyObject *, PyObject *args) { + int param0; + if (PyArg_ParseTuple(args, "i", ¶m0)) { + FunctionIndex return_value = (::interrogate_make_seq_num_getter)((MakeSeqIndex)param0); +#if PY_MAJOR_VERSION >= 3 + return PyLong_FromLong(return_value); +#else + return PyInt_FromLong(return_value); +#endif + } + return nullptr; +} + +/* + * Python simple wrapper for + * FunctionIndex interrogate_make_seq_element_getter(MakeSeqIndex make_seq) + */ +static PyObject * +_inP07ytO50x(PyObject *, PyObject *args) { + int param0; + if (PyArg_ParseTuple(args, "i", ¶m0)) { + FunctionIndex return_value = (::interrogate_make_seq_element_getter)((MakeSeqIndex)param0); +#if PY_MAJOR_VERSION >= 3 + return PyLong_FromLong(return_value); +#else + return PyInt_FromLong(return_value); +#endif + } + return nullptr; +} + /* * Python simple wrapper for * int interrogate_number_of_global_types(void) @@ -1901,6 +1971,38 @@ _inP07ytCnbQ(PyObject *, PyObject *args) { return nullptr; } +/* + * Python simple wrapper for + * bool interrogate_type_is_array(TypeIndex type) + */ +static PyObject * +_inP07ytoxqc(PyObject *, PyObject *args) { + int param0; + if (PyArg_ParseTuple(args, "i", ¶m0)) { + bool return_value = (::interrogate_type_is_array)((TypeIndex)param0); + return PyBool_FromLong(return_value); + } + return nullptr; +} + +/* + * Python simple wrapper for + * int interrogate_type_array_size(TypeIndex type) + */ +static PyObject * +_inP07ytZQIS(PyObject *, PyObject *args) { + int param0; + if (PyArg_ParseTuple(args, "i", ¶m0)) { + int return_value = (::interrogate_type_array_size)((TypeIndex)param0); +#if PY_MAJOR_VERSION >= 3 + return PyLong_FromLong(return_value); +#else + return PyInt_FromLong(return_value); +#endif + } + return nullptr; +} + /* * Python simple wrapper for * bool interrogate_type_is_enum(TypeIndex type) @@ -2565,6 +2667,8 @@ static PyMethodDef python_simple_funcs[] = { { "interrogate_function_prototype", &_inP07ytH3bx, METH_VARARGS, nullptr }, { "interrogate_function_is_method", &_inP07ytzeUk, METH_VARARGS, nullptr }, { "interrogate_function_class", &_inP07ytUeI5, METH_VARARGS, nullptr }, + { "interrogate_function_is_unary_op", &_inP07ytbmxJ, METH_VARARGS, nullptr }, + { "interrogate_function_is_operator_typecast", &_inP07ytY8Lc, METH_VARARGS, nullptr }, { "interrogate_function_is_constructor", &_inP07ytJAAI, METH_VARARGS, nullptr }, { "interrogate_function_is_destructor", &_inP07yt0UXw, METH_VARARGS, nullptr }, { "interrogate_function_has_module_name", &_inP07ytuSvx, METH_VARARGS, nullptr }, @@ -2600,6 +2704,8 @@ static PyMethodDef python_simple_funcs[] = { { "interrogate_make_seq_comment", &_inP07ytZc07, METH_VARARGS, nullptr }, { "interrogate_make_seq_num_name", &_inP07ytfaH0, METH_VARARGS, nullptr }, { "interrogate_make_seq_element_name", &_inP07ytGB9D, METH_VARARGS, nullptr }, + { "interrogate_make_seq_num_getter", &_inP07ytrppS, METH_VARARGS, nullptr }, + { "interrogate_make_seq_element_getter", &_inP07ytO50x, METH_VARARGS, nullptr }, { "interrogate_number_of_global_types", &_inP07ytsxxs, METH_VARARGS, nullptr }, { "interrogate_get_global_type", &_inP07ytMT0z, METH_VARARGS, nullptr }, { "interrogate_number_of_types", &_inP07ytiW3v, METH_VARARGS, nullptr }, @@ -2631,6 +2737,8 @@ static PyMethodDef python_simple_funcs[] = { { "interrogate_type_is_const", &_inP07ytMnKa, METH_VARARGS, nullptr }, { "interrogate_type_is_typedef", &_inP07ytRtji, METH_VARARGS, nullptr }, { "interrogate_type_wrapped_type", &_inP07ytCnbQ, METH_VARARGS, nullptr }, + { "interrogate_type_is_array", &_inP07ytoxqc, METH_VARARGS, nullptr }, + { "interrogate_type_array_size", &_inP07ytZQIS, METH_VARARGS, nullptr }, { "interrogate_type_is_enum", &_inP07ytdUVN, METH_VARARGS, nullptr }, { "interrogate_type_is_scoped_enum", &_inP07ytZtNk, METH_VARARGS, nullptr }, { "interrogate_type_number_of_enum_values", &_inP07ytihbt, METH_VARARGS, nullptr }, diff --git a/dtool/src/interrogatedb/interrogate_interface.cxx b/dtool/src/interrogatedb/interrogate_interface.cxx index 38f03bad11..d7f4ce58dd 100644 --- a/dtool/src/interrogatedb/interrogate_interface.cxx +++ b/dtool/src/interrogatedb/interrogate_interface.cxx @@ -266,6 +266,19 @@ interrogate_function_class(FunctionIndex function) { return InterrogateDatabase::get_ptr()->get_function(function).get_class(); } +bool +interrogate_function_is_unary_op(FunctionIndex function) { + // cerr << "interrogate_function_is_unary_op(" << function << ")\n"; + return InterrogateDatabase::get_ptr()->get_function(function).is_unary_op(); +} + +bool +interrogate_function_is_operator_typecast(FunctionIndex function) { + // cerr << "interrogate_function_is_operator_typecast(" << function << + // ")\n"; + return InterrogateDatabase::get_ptr()->get_function(function).is_operator_typecast(); +} + bool interrogate_function_is_constructor(FunctionIndex function) { // cerr << "interrogate_function_is_constructor(" << function << ")\n"; @@ -697,6 +710,18 @@ interrogate_type_wrapped_type(TypeIndex type) { return InterrogateDatabase::get_ptr()->get_type(type).get_wrapped_type(); } +bool +interrogate_type_is_array(TypeIndex type) { + // cerr << "interrogate_type_is_array(" << type << ")\n"; + return InterrogateDatabase::get_ptr()->get_type(type).is_array(); +} + +int +interrogate_type_array_size(TypeIndex type) { + // cerr << "interrogate_type_array_size(" << type << ")\n"; + return InterrogateDatabase::get_ptr()->get_type(type).get_array_size(); +} + bool interrogate_type_is_enum(TypeIndex type) { // cerr << "interrogate_type_is_enum(" << type << ")\n"; diff --git a/dtool/src/interrogatedb/interrogate_interface.h b/dtool/src/interrogatedb/interrogate_interface.h index fa44a00f2c..a44f9fef92 100644 --- a/dtool/src/interrogatedb/interrogate_interface.h +++ b/dtool/src/interrogatedb/interrogate_interface.h @@ -210,6 +210,8 @@ EXPCL_INTERROGATEDB const char *interrogate_function_prototype(FunctionIndex fun // if the function is a class method. EXPCL_INTERROGATEDB bool interrogate_function_is_method(FunctionIndex function); EXPCL_INTERROGATEDB TypeIndex interrogate_function_class(FunctionIndex function); +EXPCL_INTERROGATEDB bool interrogate_function_is_unary_op(FunctionIndex function); +EXPCL_INTERROGATEDB bool interrogate_function_is_operator_typecast(FunctionIndex function); EXPCL_INTERROGATEDB bool interrogate_function_is_constructor(FunctionIndex function); EXPCL_INTERROGATEDB bool interrogate_function_is_destructor(FunctionIndex function); @@ -424,6 +426,10 @@ EXPCL_INTERROGATEDB bool interrogate_type_is_const(TypeIndex type); EXPCL_INTERROGATEDB bool interrogate_type_is_typedef(TypeIndex type); EXPCL_INTERROGATEDB TypeIndex interrogate_type_wrapped_type(TypeIndex type); +// If interrogate_type_is_array() returns true, this is an array type. +EXPCL_INTERROGATEDB bool interrogate_type_is_array(TypeIndex type); +EXPCL_INTERROGATEDB int interrogate_type_array_size(TypeIndex type); + // If interrogate_type_is_enum() returns true, this is an enumerated type, // which means it may take any one of a number of named integer values. EXPCL_INTERROGATEDB bool interrogate_type_is_enum(TypeIndex type); diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 1a086196fb..c1d921cf0c 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -6118,7 +6118,7 @@ if PkgSkip("PYTHON") == 0: if GetTarget() == 'linux' or GetTarget() == 'freebsd': # Setup rpath so libs can be found in the same directory as the deployed game - LibName('DEPLOYSTUB', "-Wl,-rpath,\\$ORIGIN") + LibName('DEPLOYSTUB', "-Wl,--disable-new-dtags,-rpath,\\$ORIGIN") LibName('DEPLOYSTUB', "-Wl,-z,origin") LibName('DEPLOYSTUB', "-rdynamic") diff --git a/panda/src/display/config_display.cxx b/panda/src/display/config_display.cxx index 093069a2b5..1a5f975215 100644 --- a/panda/src/display/config_display.cxx +++ b/panda/src/display/config_display.cxx @@ -475,6 +475,12 @@ ConfigVariableInt shadow_depth_bits PRC_DESC("The minimum number of depth buffer bits requested when rendering " "shadow maps. Set this to 32 for more depth resolution in shadow " "maps.")); +ConfigVariableBool shadow_cube_map_filter +("shadow-cube-map-filter", false, + PRC_DESC("If true, Panda enables hardware depth map comparison mode for " + "point lights, if supported. If false, does not. Keep this set to " + "false if you want the shader generator to work correctly for point " + "light shadows.")); ConfigVariableColor background_color ("background-color", "0.41 0.41 0.41 0.0", diff --git a/panda/src/display/config_display.h b/panda/src/display/config_display.h index 8560251f1b..82cf8ea2e7 100644 --- a/panda/src/display/config_display.h +++ b/panda/src/display/config_display.h @@ -105,6 +105,7 @@ extern EXPCL_PANDA_DISPLAY ConfigVariableInt accum_bits; extern EXPCL_PANDA_DISPLAY ConfigVariableInt multisamples; extern EXPCL_PANDA_DISPLAY ConfigVariableInt back_buffers; extern EXPCL_PANDA_DISPLAY ConfigVariableInt shadow_depth_bits; +extern EXPCL_PANDA_DISPLAY ConfigVariableBool shadow_cube_map_filter; extern EXPCL_PANDA_DISPLAY ConfigVariableDouble pixel_zoom; diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index 89d4e7b73f..6f23741a15 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -3549,8 +3549,15 @@ get_dummy_shadow_map(Texture::TextureType texture_type) const { dummy_cube->setup_cube_map(1, Texture::T_unsigned_byte, Texture::F_depth_component); dummy_cube->set_clear_color(1); // Note: cube map shadow filtering doesn't seem to work in Cg. - dummy_cube->set_minfilter(SamplerState::FT_linear); - dummy_cube->set_magfilter(SamplerState::FT_linear); + // That is why it is currently disabled by default, but it can be + // overridden in Config.prc for apps that have custom GLSL shaders. + if (shadow_cube_map_filter && get_supports_shadow_filter()) { + dummy_cube->set_minfilter(SamplerState::FT_shadow); + dummy_cube->set_magfilter(SamplerState::FT_shadow); + } else { + dummy_cube->set_minfilter(SamplerState::FT_linear); + dummy_cube->set_magfilter(SamplerState::FT_linear); + } } return dummy_cube; } diff --git a/panda/src/ffmpeg/ffmpegAudio.h b/panda/src/ffmpeg/ffmpegAudio.h index 6559f59ff5..fe22f93c23 100644 --- a/panda/src/ffmpeg/ffmpegAudio.h +++ b/panda/src/ffmpeg/ffmpegAudio.h @@ -38,7 +38,7 @@ public: return _type_handle; } static void init_type() { - TypedWritableReferenceCount::init_type(); + MovieAudio::init_type(); register_type(_type_handle, "FfmpegAudio", MovieAudio::get_class_type()); } diff --git a/pandatool/src/deploy-stub/deploy-stub.c b/pandatool/src/deploy-stub/deploy-stub.c index f1b5e10852..3d3ba9c9c1 100644 --- a/pandatool/src/deploy-stub/deploy-stub.c +++ b/pandatool/src/deploy-stub/deploy-stub.c @@ -388,6 +388,10 @@ int Py_FrozenMain(int argc, char **argv) Py_NoSiteFlag = 0; Py_NoUserSiteDirectory = 1; +#if PY_VERSION_HEX >= 0x03020000 + Py_OptimizeFlag = 2; +#endif + #ifndef NDEBUG if ((p = Py_GETENV("PYTHONINSPECT")) && *p != '\0') inspect = 1;