Commit Graph

11957 Commits

Author SHA1 Message Date
rdb eaf8cb79d5 Add pickle support to a variety of classes 2021-12-12 18:35:44 +01:00
rdb 650b958217 display: Add convenient shorthand for win.request_properties()
Now instead of this:

    win.request_properties(WindowProperties(title="Test"))

You can directly do this:

    win.request_properties(title="Test")
2021-12-12 14:54:47 +01:00
rdb f79ef139ba device: Don't try to access raw input devices an Android
Fixes a log warning
2021-12-12 14:27:56 +01:00
rdb cc865e6d21 pipeline: Don't exit process when SystemExit happens on external thread
PyErr_Print() causes the process to be forcibly exited when a SystemExit exception occurred, this is a big issue on Android.
2021-12-10 14:56:01 +01:00
rdb 429acd6e0d general: Remove use of proprietary unsigned integer typedefs 2021-12-08 14:51:52 +01:00
rdb 6a50a657be express: Add support for adding JAR-style signatures to .zip files
This is useful for writing apk/aab files in bdist_apps
2021-12-08 14:48:14 +01:00
rdb 60cc334cd9 gobj: Fix some TexturePeeker docstrings
[skip ci]
2021-12-07 23:05:49 +01:00
rdb 44e10d10a0 Support deploying Python apps for Android using bdist_apps 2021-12-07 21:00:08 +01:00
rdb af6230cfda android: Update android_native_app_glue to latest from upstream 2021-12-06 22:30:13 +01:00
rdb c594ab38ef Support building pandagles2 on Android 2021-12-06 22:26:56 +01:00
rdb c977df33a3 express: Fix issue on platforms without signed cha 2021-12-05 00:01:24 +01:00
rdb 5de31c6293 Merge branch 'release/1.10.x' 2021-12-04 21:57:35 +01:00
rdb 82ebf908fa gobj: Fix spelling error in doc of async-load-delay config variable 2021-12-04 20:38:31 +01:00
rdb e2c26adcf0 event: Mention that ButtonEvent API is not stable for Python use 2021-12-04 20:38:13 +01:00
rdb 11edd1a0dc ffmpeg: Change thread to use lambda 2021-12-01 11:34:48 +01:00
rdb b1b05c2be9 thread: Allow arbitrary std::function (incl. lambdas) in GenericThread 2021-12-01 11:31:45 +01:00
rdb 37b45a010d gobj: More efficient tracking of simple image changes
Remove the separate simple_image_modified field, instead, the image_modified value is updated if the simple image is changed while there is no RAM image.

This robustifies the tracking on the GSG end, which previously ended up repeatedly calling upload_texture() unnecessarily
2021-11-30 10:56:48 +01:00
rdb fa0ea312ea gobj: Move TextureReloadRequest to new Texture::async_ensure_ram_image()
The task is implemented with just a simple lambda, much more compact than a whole TextureReloadRequest task.  The latter is now deprecated.

Since Loader can't be used within Texture, there's now a new task chain, configurable with texture-reload-num-threads and texture-reload-thread-priority.  This does mean that it no longer happens on the same thread as model loads, but I think that's fine, and perhaps texture reloads should be higher priority than model loads anyway since a long texture reload delay with allow-incomplete-render directly and negatively affects user experience during gameplay.

The new name also better communicates that it just calls get_ram_image(), it doesn't force a reload, but we could add an async_reload() for that if we want.
2021-11-30 10:34:00 +01:00
rdb 9e7ca63662 Add missing @since to docstrings of some new methods 2021-11-29 16:02:22 +01:00
rdb 653cc3e091 event: Support C++11 lambdas as event handlers
It's unfortunate that we now have three maps on EventHandler for three different types of functions.  I'd love to unify them all under std::function, but the fact that it doesn't support comparison means the behavior would be different.

Perhaps in the future we can create a new interface or deprecate the existing behaviors and unify everything under std::function.
2021-11-29 14:48:06 +01:00
rdb 4af5bc9e6d event: Support lambdas as tasks via new FunctionAsyncTask
This is intended to replace GenericAsyncTask.
2021-11-29 14:47:44 +01:00
rdb c980643649 chan: Lock PartBundle while binding animation
This seems like the right thing to do that could prevent some potential race conditions; let me known if this is breaking anything.
2021-11-28 16:21:59 +01:00
rdb 78fb565f2b Merge branch 'release/1.10.x' 2021-11-28 16:14:18 +01:00
loonaticx 15c84afbe9 doc: Improve egg syntax documentation
[skip ci]

Closes #1199
2021-11-28 16:12:44 +01:00
rdb 980399d142 event: Expose ButtonEvent to Python 2021-11-28 14:36:20 +01:00
rdb 2abf867203 gobj: Don't load textures when loading bam file if preloading is off
This is wasteful (especially when the bam file already has the simple RAM images baked in if needed) since we are throwing away the texture data right away anyway.  Just locate it on disk, it will be loaded later when it is needed.

Fixes #1208
2021-11-28 14:04:41 +01:00
rdb c0a9123dde gobj: Fix TextureReloadRequest not reloading in certain situations
This prevented async texture loading from working unless mipmapping was enabled
2021-11-28 14:01:33 +01:00
rdb 5eaa67fbc9 gobj: Add TexturePool::get_texture() for querying tex from pool 2021-11-28 14:00:59 +01:00
rdb 5cad0eb973 glgsg: Don't use simple RAM image in shaders for non-sampler2D types
Simple RAM images are always 2D right now, so this would otherwise cause an error.
2021-11-28 13:59:46 +01:00
rdb 8f9d23ff29 linmath: Remove redundant sin() calculation in LQuaternion 2021-11-28 13:58:13 +01:00
rdb 54de9f9fa4 glgsg: Fix possibility of simple RAM image going out of scope 2021-11-28 13:57:20 +01:00
rdb ea61e53ab2 event: Fix ButtonEvent docstring 2021-11-28 13:56:55 +01:00
rdb 6adb6be4b5 egg2pg: slight comment cleanup in characterMaker.cxx
[skip ci]
2021-11-16 17:55:32 +01:00
rdb 3aa77a1260 framework: Fix unnecessary ternary check 2021-11-16 17:31:27 +01:00
rdb 9ebfef4b83 pgraph: Change TransformState hashing not to require grabbing lock
Instead, set it atomically, with a special hash value used instead of a flag for indicating that the hash is not known.
2021-11-16 17:30:36 +01:00
rdb 60c5589671 pgraph: Optimize handling/checking of identity/invalid transforms 2021-11-16 17:30:36 +01:00
rdb fac6916151 pgraph: Major traversal optimizations
In particular, these optimize the traversal of nodes that are not in view, which are discarded more efficiently.
This change affects both the cull and collision traversers.
2021-11-16 17:30:33 +01:00
rdb 20e4704be2 Merge branch 'release/1.10.x' into incoming 2021-11-16 16:35:08 +01:00
rdb 0f7a575ac0 bullet: Add bullet-split-impulse config variable
Fixes #1201

Co-authored-by: K9Kraken <K9Kraken@users.noreply.github.com>
2021-11-16 15:16:25 +01:00
rdb ab6d3b2e15 gobj: Show better error if calling tex.write() with unknown extension 2021-11-16 15:04:46 +01:00
rdb 32584f0a68 pgraph: Fix prepare_scene() not properly invoking the shader generator 2021-11-09 15:46:14 +01:00
rdb cf681eb8dd bullet: Clean up fix for #1193
See ad7cbcd4ec
2021-11-02 15:34:26 +01:00
rdb 0bc0709b72 Merge branch 'release/1.10.x' 2021-11-02 15:20:41 +01:00
rdb 04c6636744 pgraph: Add some missing properties to PlaneNode 2021-11-02 15:02:40 +01:00
rdb 9587965c5d bullet: Add some API documentation strings for BulletDebugNode 2021-11-02 15:02:14 +01:00
rdb ad7cbcd4ec bullet: Fix memory leak getting persistent manifolds from Python
These classes ought to be returned by value. Cleaner fix will be in master.

Fixes #1193
2021-10-27 11:20:19 +02:00
rdb a4ea476cce linmath: Implement read-only buffer protocol support for vectors
Fixes #1194
2021-10-27 10:53:35 +02:00
rdb 77c6bc199d gobj: Remove unused member variable from TexturePeeker 2021-10-27 10:46:43 +02:00
rdb 2ae6e5c6ce glgsg: Remove unused variable from glGSG 2021-10-26 17:28:01 +02:00
rdb 605651f0e8 Merge branch 'release/1.10.x' 2021-10-26 17:27:56 +02:00
rdb 57d7bc2f53 display: document make_texture_buffer() behavior when size is 0
Fixes panda3d/panda3d-docs#100
2021-10-26 14:00:25 +02:00
rdb 9b55279fde glgsg: Minor code cleanup in FBO code 2021-10-26 14:00:04 +02:00
rdb 618e6f3fee pgui: Fix slider thumb entering dragging state on button press
This caused updating the slider while a button is pressed and the mouse is held over the thumb not to work.

Fixes #1188
2021-10-26 13:45:38 +02:00
rdb 2b0571ee92 glgsg: Also pick up glClearTexSubImageEXT in OpenGL ES 2+ 2021-08-31 15:37:21 +02:00
rdb 1739cef318 Merge branch 'release/1.10.x' into incoming 2021-08-31 14:03:57 +02:00
rdb c96189e53c display: Fix compilation on Windows (can't name variables near/far) 2021-08-31 14:01:03 +02:00
rdb cb4bcbe67e collide: Fix typo causing compile error on Windows with Python 3.10 2021-08-30 21:27:53 +02:00
rdb 2cc1633a77 pgraph: Clarify in find() documentation that this node not included 2021-08-30 14:03:17 +02:00
rdb 8c01f7faff gles2gsg: Implement support for GL_EXT_clear_texture in OpenGL ES 2+ 2021-08-30 14:02:41 +02:00
rdb 481fc67996 gles2gsg: Support gl-depth-zero-to-one in OpenGL ES 2+
Requires GL_EXT_clip_control support in the driver.
2021-08-30 14:02:09 +02:00
rdb 32b78a382a express: Protect clock debug print with is_debug() check 2021-08-30 14:00:59 +02:00
rdb 53741ffa13 pgraph: Implement new DepthBiasAttrib to replace DepthOffsetAttrib
Fixes #1157
2021-08-26 10:47:07 +02:00
rdb 280175f267 display: Support specifying depth range on DisplayRegion
See https://discourse.panda3d.org/t/depthoffsetattrib-z-range-composition-order/27943/4
2021-08-26 10:42:25 +02:00
rdb 3d4dd50358 Merge branch 'release/1.10.x' 2021-08-11 15:02:05 +02:00
rdb 8ad4234df8 pgui: prevent error when rendering in offscreen mode
Fixes #1174
2021-08-11 09:19:27 +02:00
rdb 20e081482f glgsg: detect and fix overlapping SSBO bindings
Fixes #1176
2021-08-05 09:37:26 +02:00
rdb c293ad3da2 Merge branch 'release/1.10.x' 2021-08-03 20:19:15 +02:00
rdb 5b30fa7adf putil: Fix reading/writing BitArray from/to bam file on 64-bit
Fixes #1181
2021-08-03 20:13:56 +02:00
rdb 7ac7a95843 glgsg: Delete multisample FBO properly
Related to #1166
2021-08-03 11:43:49 +02:00
rdb 1f84469cd9 filter: Fix issue with cached CullResult persisting after cleanup
This can cause issues if a DR gets assigned an inactive camera - the old cull result will persist and be used for draw.  Possibly we need to do this in set_camera.

Reproduced by #1166
2021-08-03 11:43:49 +02:00
rdb ea45ff691d display: Improve error message when display module isn't loaded 2021-08-03 11:43:49 +02:00
rdb 3dc09c38d3 dxgsg9: Fix crash when resizing window in multi-window setup
Fixes #1167
2021-07-31 09:56:52 +02:00
rdb 089a615adb pgui: If no explicit candidate_inactive style given, use underscore 2021-07-05 18:01:05 +02:00
rdb 4cd579d0ba x11: Implement ime-aware setting using XIM 2021-07-05 17:53:19 +02:00
rdb 4ba3df7082 pgui: Fix missing cursor when typing candidate 2021-07-05 17:37:48 +02:00
rdb 25f9d3ff13 pgui: Don't clear candidate on keypresses like shift/ctrl etc 2021-07-05 17:37:15 +02:00
rdb f27e9b2a86 linmath: Add __rmul__ operator for left scalar multiplication
Fixes #1048
2021-07-05 14:16:55 +02:00
rdb bfe595f4dc glgsg: Implement partial updates of texture arrays / cube maps
Also, simplify the cube map upload mechanism somewhat.

Fixes #1168
2021-07-04 17:03:14 +02:00
rdb 494631ac54 gobj: Implement texture modification tracking for individual pages
Part of #1168, GL implementation in following commit
2021-07-04 16:36:26 +02:00
rdb 77f486a07b putil: Improve SparseArray output printing 2021-07-04 16:35:11 +02:00
rdb 0c5fedfc9b Merge branch 'release/1.10.x' 2021-07-02 16:03:41 +02:00
rdb 0e219fa5c9 display: Remove obsolete mouse_mode_relative/absolute methods 2021-07-02 16:00:41 +02:00
rdb bcbef3f6c8 pgraph: Add RenderState::get_unused_states() by analogy with TransformState 2021-07-02 15:22:44 +02:00
rdb 1415ccca61 pgraph: Fix assertion error in get_num_unused_states()
Fixes #1172
2021-07-02 15:11:33 +02:00
rdb 388ddda9d7 x11: Fix black screen when switching fullscreen without WM
Reconfiguring the window to origin 0, 0 is unnecessary and if the win origin is already 0, 0 this results in Panda waiting for a ConfigureNotify that never comes.
2021-07-02 14:04:57 +02:00
rdb 199b797d72 Merge branch 'release/1.10.x' 2021-06-01 11:50:12 +02:00
Ben Humphries 0415a08416 cocoadisplay: Round refresh rates when choosing display mode on macOS
Closes #1144

Co-authored-by: rdb <git@rdb.name>
2021-06-01 10:56:55 +02:00
rdb 2386e80448 linmath: Backport support for floor division to 1.10
Backport of 8944737844

(Also fixes return type of `__pow__` to always be derived class)
2021-06-01 10:45:56 +02:00
rdb 4e0e945279 linmath: Backport round(), floor(), ceil() support for vectors
See #821
2021-06-01 10:23:58 +02:00
rdb 42d292ee17 glgsg: Slight optimization, don't get texture type more than once 2021-06-01 10:00:43 +02:00
rdb 967fbbc49e glgsg: Fix regression uploading buffer texture with null image
Regression in c1babd1ad1 - it caused an assertion to be thrown when uploading a buffer texture without a RAM image.
2021-06-01 09:56:04 +02:00
rdb c9508f3215 task: Prevent error indicator being sporadically cleared 2021-05-31 17:44:57 +02:00
rdb e63eab9aa2 Merge branch 'release/1.10.x' 2021-05-31 17:44:53 +02:00
Paul m. p. P 70ac82d5da bullet: Fix compilation issue with BulletHeightfieldShape
Fixes #1161
2021-05-31 17:43:50 +02:00
rdb 1d2407f667 ffmpeg: Fix compile error with latest ffmpeg version
Fixes #1164
2021-05-17 11:19:55 +02:00
rdb 571946739e task: Fix cancelling gather() of tasks 2021-05-11 12:21:37 +02:00
rdb 91a6ff1d81 task: Prevent "unexpected task state" when cancelling task sometimes 2021-05-11 12:21:30 +02:00
rdb 55fb14b792 Merge branch 'release/1.10.x' 2021-05-11 12:21:24 +02:00
rdb 9410418840 pnmimagetypes: Changes to support compilation with OpenEXR 3.0.1 2021-05-11 11:38:40 +02:00
rdb 2ed61c91fc gobj: make_lines_in_place() (& points, patches) should change primitive type 2021-05-10 13:35:47 +02:00
rdb c1babd1ad1 texture: Don't try to compress buffer textures by default
Buffer textures don't support compression, so we shouldn't try to driver-compress them, and we should not try to compress the RAM image unless explicitly overridden.
2021-04-29 20:33:52 +02:00
rdb 5ef1b44455 event: cancel future being awaited when cancelling coroutine task
Fixes #1136
2021-04-18 17:05:00 +02:00
rdb cdf5b16ddd task: Add AsyncFuture::shield() ability, part of #1136
This is modelled after `asyncio.shield()` and can be used to protect an inner future from cancellation when the outer future is cancelled.
2021-04-09 18:28:07 +02:00
rdb e9e1bb1bc6 dtoolutil/express: Resolving empty filename should yield no result
See #1140 - I may revert this if someone can demonstrate a compelling use case (for current directory, you can use "." instead), but it seems to have the potential to cause unintuitive behavior.
2021-04-09 18:26:00 +02:00
rdb 47f35a287c Merge branch 'release/1.10.x' 2021-04-09 18:25:57 +02:00
rdb 69c6050fa8 glgsg: Only copy depth of 32-bit float depth-stencil framebuffer
We don't support float-32-unsigned-int-24-8 component types in texture yet, so this is the only choice.  Avoids a GL error when binding to RTP_depth_stencil slot.

Fixes case 2 of #1142
2021-04-09 10:47:54 +02:00
rdb 715d786813 display: Prevent attempt to copy depth from non-depth framebuffer
Fixes case 1 of #1142
2021-04-09 10:45:22 +02:00
rdb 99a3188af2 glgsg: Fix missing component types in glReadPixels spam message 2021-04-09 10:30:45 +02:00
rdb 31feeb9b9f glgsg: Fixes to format selection for copy-to-ram of framebuffer
Fixes #1141
2021-04-08 18:46:10 +02:00
rdb eee1426e37 glgsg: Fix ability to get r11g11b10 float renderbuffer 2021-04-08 18:44:52 +02:00
rdb dd3510eea7 Merge branch 'release/1.10.x' 2021-04-08 12:30:35 +02:00
rdb 4a7d03d9b1 pnmtext: Fix loading an invalid font resulting in a crash
Related to #1140
2021-04-08 12:08:03 +02:00
rdb ab4367ee7b glgsg: Fixes to format selection in OpenGL renderbuffers
Fixes #1137
2021-04-07 00:20:38 +02:00
rdb bcb61fec09 pgraphnodes: Fix draw callback called twice in certain cases
This would happen if you call upcall() in a CallbackNode's cull callback.
2021-04-06 16:38:51 +02:00
rdb 51a6923008 device: Work around FreeBSD kernel bug for querying gamepad axes
This is to support older kernels, which always returned 0 from successful ioctl, rather than the number of bits.  This was fixed in the FreeBSD kernel trunk.
2021-04-05 17:19:47 +02:00
rdb 7be4b7c3bb device: Support evdev gamepads on FreeBSD 2021-04-05 17:14:30 +02:00
rdb e034e7f4b3 Merge branch 'release/1.10.x' 2021-03-31 23:08:21 +02:00
rdb fa73657d03 pgui: Revert part of f2e488fd6b
This caused a regression due to a removal of update_frame invocation in single-threaded pipeline, needs to be revisited later on master branch
2021-03-31 17:27:11 +02:00
rdb 43fb82fa66 gobj: Add config switch for Panda not to default to packed vertex colors
See #981.  Setting `vertex-colors-prefer-packed` to false will make Panda default to OpenGL-style vertex colors, which is useful if are targeting OpenGL and not DirectX 9, avoiding a potential performance cost.
2021-03-25 23:15:58 +01:00
rdb b405df72fa Merge branch 'release/1.10.x' 2021-03-25 23:13:36 +01:00
rdb c36fa1ef17 glgsg: Workaround driver bug causing flickering in AMD RDNA cards
Apparently, the use of glColorPointer with GL_BGRA causes these cards to display garbled vertex colors (tested with RX 5700 XT).  This bug doesn't seem to affect glVertexAttribPointer.

The "fix" is to just disable packed-dabc colors if these cards are detected.  This may cause a minor performance regression since the vertex data now needs to be munged--possibly even unnecessarily, if shaders are used, but this effect is likely very minor (and can be addressed in other ways).

Fixes #981
2021-03-25 23:12:35 +01:00
rdb 6e0af8abe4 physics: Fix Mac OS X 10.6 compilation issue with <atomic> header 2021-03-25 15:37:52 +01:00
rdb eb6eb9f1dd Merge branch 'release/1.10.x' 2021-03-24 13:58:00 +01:00
rdb 8372b8150a gobj: Cube map sampling support in TexturePeeker
Closes #1098

Co-authored-by: Mitchell Stokes <mogurijin@gmail.com>
2021-03-24 12:50:42 +01:00
LD 23150bd6d6 pgraph: Add the shader attrib to the filled wireframe render state
Fixes #1021
Closes #1124
2021-03-23 16:18:00 +01:00
rdb 94806801e3 Add p3headlessgl render plug-in on Linux using EGL as fallback for GLX
Fixes #1086
2021-03-23 15:04:20 +01:00
rdb 3ecc8c857a gobj: Also fix GeomPrimitive::offset_vertices() overload with begin/end
See 40b94c1f97
2021-03-22 22:04:03 +01:00
rdb d0028ba103 physics: Make PhysicalNode class thread-safe
It is, however, not yet pipeline-cycled, and the Physical object itself is not yet thread-safe.
2021-03-22 16:01:13 +01:00
rdb 0e36a99574 Merge branch 'release/1.10.x' 2021-03-22 15:45:45 +01:00
rdb 8f55d32cb1 glgsg: Workaround for Cg shader issue with multiple GSGs
Fixes #1117
2021-03-22 15:37:43 +01:00
rdb 40b94c1f97 gobj: Fix GeomPrimitive::offset_vertices() with strip cut index
This was called, among other things, by the egg-unify process, which could ruin the strip cut index.

At the same time, I've reimplemented the indexed case for offset_vertices() to make it a little bit more efficient.

Fixes #1122
2021-03-22 11:35:03 +01:00
rdb c1fbb70c6d display: Temporary fix for base.win.properties.size et al
Previously, calling that without storing a temporary object would cause the WindowProperties to go out of scope and the return value to point to random memory.
2021-03-21 16:55:19 +01:00
rdb f450aa5edf physics: Add additional properties 2021-03-21 14:40:10 +01:00
rdb db2936a318 physics: Slight code cleanup in PhysicalNode::clear() 2021-03-21 14:39:57 +01:00
rdb f1782d73e5 physics: Fix crash in PhysicsNode::add_physicals_from() 2021-03-21 14:39:31 +01:00
rdb 74910ff310 physics: Don't assert destructing
This could have been produced with make_copy(), which can create a situation where the Physical objects don't have the same node associated -- see b6a118448d
2021-03-21 14:36:14 +01:00
rdb b6a118448d physics: Warn when copying PhysicalNode with physicals attached
We can't currently support this because a Physical can have only one PhysicalNode associated.
2021-03-21 14:35:28 +01:00
rdb 1c754738bd physics: Prevent adding same Physical to more than one PhysicalNode
Also silently ignore if the same Physical is added to the same PhysicalNode more than once.
2021-03-21 13:00:08 +01:00
rdb 52c0e2759e glgsg: Fix copy-to-texture/ram for multisample FBO
Should read from resolved FBO, not from multisample FBO

Fixes #1129
2021-03-16 18:45:27 +01:00
rdb b817e19ab6 Merge branch 'release/1.10.x' 2021-03-13 16:50:12 +01:00
LD 209e031964 cocoadisplay: Test all the fullscreen modes to find the valid one
Closes #1039
2021-03-13 12:44:30 +01:00
rdb eca18f3c19 windisplay: Don't try to activate window when resizing/moving it
This fixes an issue where if you quickly alt-tab when the window opens, it receives a WM_ACTIVATE event and thinks it continues to be active, which causes issues with applying cursor confinement.

I think you can probably still reproduce that issue, but your reflexes have to be significantly more ninja now.
2021-03-11 23:50:45 +01:00
rdb 7f4d030032 windisplay: Fix some situations in which the mouse could stay confined
Fixes #1115
2021-03-11 23:29:13 +01:00
rdb c1c2183561 windisplay: Parented child windows are implicitly undecorated
I'm pretty sure applying these styles does nothing anyway, but we shouldn't specify them.
2021-03-11 22:30:35 +01:00
rdb 48fb2f721f windisplay: Fix parented child window being offset
This would happen if the undecorated flag is not set; it would receive an additional offset equal to the size of the window decoration.

Fixes regression presumably caused by a968caf1d2
2021-03-11 22:19:41 +01:00
rdb ff80adc680 Merge branch 'release/1.10.x' 2021-03-05 11:59:21 +01:00
rdb 5cadd86d1e glgsg: Fix get_screenshot() for multisample FBOs
An FM_refresh bind should not bind the multisample FBO, but the resolved one (and while we're at it, FM_refresh should not try to resolve multisamples).
2021-03-05 11:57:05 +01:00
rdb b4a242a4e3 x11: Provide labels for more keys (esp. international keys) 2021-03-04 21:49:55 +01:00
rdb 2e3ce27865 device: Add Windows gamepad mapping with VID:PID 2563:0523
From https://discourse.panda3d.org/t/gamepad-emulator-and-panda/27336
2021-03-04 20:47:55 +01:00
rdb 9be2f307c5 text: Fix glyphs with flipped UVs not being processed correctly
This caused the cheesy-accent code to not flip the caron correctly.
2021-03-04 20:06:51 +01:00
rdb 050d86dadb event: AsyncFuture::set_result() behavior changes:
* Passing a Python subclass of a C++ class now works, the extra Python stuff isn't just discarded
* EventParameter objects are no longer automagically unwrapped - there's no more reason to pass an EventParameter to this method anyway, and it might be unexpected if it is treated specially.
2021-03-01 20:50:25 +01:00
rdb 99569fa8f2 CMake: Updates to compile new ParamPyObject class 2021-03-01 20:34:17 +01:00
rdb 402c303dba event: Make AsyncFuture::set_result() slightly more robust 2021-03-01 19:33:39 +01:00
rdb 8cbe36b352 Merge branch 'release/1.10.x' 2021-03-01 19:33:27 +01:00
rdb 064e0383be event: Allow AsyncFuture to store arbitrary PyObject result 2021-03-01 19:16:22 +01:00
rdb bdb2ef1631 pipeline: Fix crash upon exception in custom thread
We can't call PyErr_Restore() without a valid thread state, which won't exist in a custom thread if we just called PyGILState_Release().  Not sure how this has ever worked.
2021-03-01 16:19:53 +01:00
rdb 2b3f2bb98c event: gather() should schedule coroutines with task manager
This matches the behaviour of asyncio.  It schedules with the current task's manager and chain.  If no current manager is found, it prints a warning.  (The user can just add the coroutine to a task manager themselves and pass the resulting task into gather() if needed.)

See discussion here:
https://discourse.panda3d.org/t/task-gather-does-not-seem-to-work/27313
2021-03-01 11:22:13 +01:00
rdb e348d216e5 event: Fix memory leak getting future result in some cases 2021-03-01 11:09:10 +01:00
rdb b6096c3d40 glgsg: Suppress useless shader linking warnings on macOS 2021-02-26 13:33:25 +01:00
rdb 6a51709332 event: Don't suppress coroutine exceptions in optimized builds 2021-02-26 11:44:50 +01:00
rdb ada74e3b0c Merge branch 'release/1.10.x' 2021-02-24 18:10:15 +01:00
rdb 2d9cc2dea0 egl: Further robustify EGL device initialization process
Sometimes, the default device fails to initialize, so then we need to fall back to alternatives (eg. GBM)
2021-02-24 17:31:00 +01:00
rdb 7a838e7212 Merge branch 'release/1.10.x' 2021-02-24 12:14:04 +01:00
rdb 2e38ca1042 egl: Fall back to EGL_EXT_platform_device for device selection
See #557
2021-02-24 11:41:42 +01:00
rdb 7f20bcd8e0 egl: Fix ability to create multisample FBO
Fixes #1089
2021-02-24 10:11:58 +01:00
rdb 778c6ee6be pgui: Add missing pipeline.h include 2021-02-24 09:46:53 +01:00
Stephen Imhoff 18873ffbf1 Add use of TransformState::make_pos_quat() in some places (#1116)
Fixes #1116
2021-02-22 20:06:26 +01:00
Stephen Imhoff a196f1adcc gobj: Add missing TransformState.make_pos_quat (#1116)
matches to TransformState.make_pos_hpr
2021-02-22 20:05:58 +01:00
rdb 8944737844 linmath: Support floor division for vector types
Also fix __pow__ so that it returns the derived type, not the base type
2021-02-22 20:01:30 +01:00
rdb 5ae08eadf7 Merge branch 'release/1.10.x' 2021-02-22 19:38:49 +01:00
rdb 18cb4a7ccc vorbis: Disable cross-lapped seeking by default, to reduce clicking
Fixes #1108
2021-02-22 10:58:18 +01:00
rdb f2e488fd6b pgui: Workaround for text disappearing in multithreaded pipeline
The text could appear from a DirectButton or other GUI element if updating eg. the text_fg property.
2021-02-21 11:00:22 +01:00
rdb 5c4909b4ab pgui: Some code cleanup for PGItem 2021-02-21 10:17:14 +01:00
rdb a05405c475 pgraph: API reference improvements for NodePath 2021-02-21 10:15:33 +01:00
rdb fb9b334d58 Merge branch 'release/1.10.x' 2021-02-17 10:57:30 +01:00
rdb 3592404fa8 display: Fix GraphicsWindow::get_pointer() listed as deprecated
[skip ci]
2021-02-17 10:56:46 +01:00
rdb ca577c8b35 Merge branch 'release/1.10.x' 2021-02-15 14:14:10 +01:00
rdb 6374a7f240 express: Fix up Patchfile docstrings
[skip ci]
2021-02-15 14:13:24 +01:00
rdb a704d2c228 display: Fix typos in docstrings
[skip ci]
2021-02-15 12:46:29 +01:00
rdb 592f776f76 downloader: Fix missing includes in virtualFileHTTP.cxx 2021-02-15 12:36:29 +01:00
rdb 8afd0e526f Merge branch 'release/1.10.x' 2021-02-15 11:38:45 +01:00
rdb 70e972a7c0 downloader: Remove duplicated string manipulation methods
These already exist in string_utils.h
2021-02-15 11:35:16 +01:00
rdb 84c2a18d00 downloader: Implement VirtualFileHTTP::read_file() 2021-02-15 11:18:13 +01:00
rdb 20bdd32765 downloader: Fix an uninitialized member 2021-02-15 11:13:57 +01:00
rdb 86e0915621 downloader: Add samesite flag to HTTPCookie 2021-02-14 17:47:29 +01:00
rdb 8f1e2f1945 downloader: Support gzip and deflate Content-Encoding values 2021-02-14 17:29:45 +01:00
rdb 62d072cfb4 downloader: Remove unused HTTPChannel::request_path member 2021-02-14 17:28:44 +01:00
rdb 4e27264cac downloader: Add properties to HTTPCookie 2021-02-11 03:28:43 +01:00
rdb 59ab828098 linmath: Fix typo in Mat4 isub docstring
Fixes panda3d/panda3d-docs#96
2021-02-11 03:28:34 +01:00
rdb 28ad032210 collide: Fix CollisionHandlerGravity docstrings
[skip ci]
2021-02-08 19:41:46 +01:00
rdb a64dcd7c5d event: (BREAKING CHANGE) bare yield in task now means "cont"
This is more useful and consistent; you can after all just use "return" to end the task, whereas you can now just use "yield" to continue the next frame rather than "yield Task.cont".

This is a follow-up to f6b39345f7, which already enabled this behavior when an __await__ (that is awaited from a task) yielded None.
2021-02-07 15:14:04 +01:00
rdb e8b4b6476c Merge branch 'release/1.10.x' 2021-02-07 15:01:36 +01:00
rdb 8c8a73a1a7 event: Fix compilation with Python 2.7 2021-02-07 14:49:10 +01:00
rdb f6b39345f7 event: don't exit task if future __await__ yields None
This matches the behavior of asyncio's Task implementation, where this is the equivalent of `yield Task.cont`.

I've kept regular generator tasks unaffected for now, since this might break existing usage.
2021-02-07 12:38:16 +01:00
rdb 3657eb9bce glgsg: Support texture transforms in default shader 2021-02-06 19:36:50 +01:00
rdb 64f0414f57 Merge branch 'release/1.10.x' 2021-02-06 19:36:39 +01:00
rdb af60f8200e glgsg: Gracefully degrade when using 64-bit float in OpenGL ES 2021-02-06 19:35:48 +01:00
rdb c5568c3d5f collide: Improve CollisionSphere viz, add outline 2021-02-06 01:25:07 +01:00
rdb c73c94c862 Merge branch 'release/1.10.x' 2021-02-06 01:23:34 +01:00
rdb 068ceaaf58 event: Clear exception flag after trying asyncio exception import 2021-02-06 01:21:52 +01:00
rdb 3052bcf289 pnmimagetypes: Remove vestigial init_pnm() call 2021-02-06 01:20:44 +01:00
rdb 642f4a4e55 bullet: Implement make_copy() for BulletGhostNode 2021-02-05 23:48:41 +01:00
Stephen Imhoff cc4701d299 Add ability to persist ghost nodes. 2021-02-05 20:31:10 +00:00
rdb 492cce8a49 event: Compile out threaded code when compiling without HAVE_THREADS 2021-02-03 13:29:28 +01:00
rdb 8c2b3c3192 pgraph: Add missing InstancedNode::CData type handle 2021-02-03 13:27:07 +01:00
rdb a1e4cf059f glgsg: Fix attempt to detect glTexStorage1D in OpenGL ES 2021-02-03 12:53:20 +01:00
rdb 60f3ac5163 gobj: Assert instead of crash when printing unresolved GV(A)D 2021-01-30 20:06:32 +01:00
rdb 79dae16a2c glgsg: Show error for unrecognized p3d_TextureXYZ input 2021-01-30 20:05:36 +01:00
rdb b1942e8065 collide: Add wires to CollisionBox viz
This should make it a lot easier to see the box as opposed to looking at a continuous white shape.
2021-01-30 13:52:03 +01:00
rdb 613441060b Merge branch 'release/1.10.x' 2021-01-18 23:47:36 +01:00
rdb 29cdd78c4e mathutil: Fix scaling BoundingSphere to infinite causing assertions
This error occurs when a BoundingSphere with a large radius is scaled by an even larger radius such that the radius becomes infinite.  In this case, the BoundingSphere should be properly marked as infinite so that it behaves properly (and doesn't cause other assertions down the line).
2021-01-18 19:03:00 +01:00
rdb 3e1d98c105 multify: Respect SOURCE_DATE_EPOCH variable when used from command-line
That said, we should probably encourage the use of -T0 (which doesn't write out timestamps to begin with).
2021-01-18 14:16:25 +01:00
rdb ef4b1d5721 glgsg: Fix compile error with OpenGL ES 1 2021-01-18 00:19:39 +01:00
rdb 842452594d Merge branch 'release/1.10.x' 2021-01-17 17:28:19 +01:00
rdb 8924b77da4 egldisplay: Backport changes for creating headless EGL contexts
Backport of fbc4947455 and 9f1289b492

See #557
2021-01-17 16:46:57 +01:00
rdb fb6ec557ce egl: Add missing init_type() for eglGraphicsBuffer/Pixmap 2021-01-17 15:40:19 +01:00
rdb a5a0809949 gobj: Support integer texture formats in TexturePeeker 2021-01-17 15:27:19 +01:00
rdb 4783c2902d grutil: Add missing switch case 2021-01-17 15:17:13 +01:00
rdb b060767bd8 glgsg: slight refactor of get_internal_image_format() 2021-01-17 15:17:09 +01:00
rdb 1fda6e7d51 texture: Add missing integer texture formats 2021-01-17 15:17:03 +01:00
rdb 38d304f2fe glgsg: Force nearest filtering on isampler/usampler
Without this, Intel drivers will sample (0, 0, 0, 1)
2021-01-17 12:10:42 +01:00
rdb f20d859fe2 pgraph: Fix bug passing non-tuple sequence to shader input 2021-01-16 14:05:43 +01:00
rdb c5705e0137 Merge branch 'release/1.10.x' 2021-01-12 23:15:36 +01:00
rdb 3a41db130b gobj: Fix Texture.set_ram_image_as for 3D and multiview textures
Fixes #1095
2021-01-12 23:13:02 +01:00
rdb 6e168c2bc4 collide: Implement respect-prev-transform for capsule-into-poly
It's not perfect by any means, but it's better than nothing, and should prevent capsules from flying through walls.
2021-01-12 15:55:10 +01:00
rdb 3f08781eac collide: Improve box-into-polygon test
* Use nearly-zero test to check which edges to snap the interior/surface points to, if any, to be less sensitive to fp precision
* The respect-prev-transform test now tests for a sphere that fits inside the box, to prevent a false positive test when the box has been rotated since the last test
* More appropriate surface point for respect-prev-transform test
2021-01-12 14:59:31 +01:00
rdb 1b7f3e4bbd collide: Fix pusher if interior and surface point don't lie along normal
Currently, all tests I'm aware of put the surface point above the interior point (ie. along the normal), but there seems to be no good reason for this requirement, especially since a dot product is more efficient than a length().
2021-01-12 14:51:42 +01:00
rdb 84034f06f5 collide: Respect prev transform in box-into-poly test
Only takes changes in position in account, and the test is not entirely perfect, but mostly right
2021-01-11 19:06:24 +01:00
rdb c52ea9a8df express: Fix reading zip file with comment at the end 2021-01-04 12:33:11 +01:00
rdb 3f6a8b88c0 egg: Another fix for older bison versions 2021-01-02 21:51:50 +01:00
rdb 0c94f98c84 egg: Keep compatibility with Bison 2.3 (for macOS) 2021-01-02 20:55:59 +01:00
rdb 91380e8718 egg: Make egg parser and lexer reentrant
This avoids the need for the global mutex lock and allows two egg files to be read simultaneously.

Error reporting has also been improved by specifically pinpointing the offending token when an error occurs.
2021-01-02 20:11:10 +01:00
rdb ce235c3e60 Merge branch 'release/1.10.x' 2021-01-02 19:59:33 +01:00
rdb 5d5efb75e8 egg: Fix egg lexer hanging on unterminated quote or C-style comment 2021-01-02 18:43:32 +01:00
rdb 6f5362c3fe egg: Add missing include 2021-01-02 12:53:24 +01:00
rdb ea2816f4ea CMake: Add extension sources for egg and collide directories 2021-01-02 03:11:34 +01:00
rdb f003e3434e collide: Use virtual read_datagram/write_datagram on handlers 2021-01-02 02:40:52 +01:00
rdb e099d9e787 Merge branch 'release/1.10.x' 2021-01-02 02:33:35 +01:00
rdb a84f1b5595 express: distinguish between null vs empty in CPTA pickle as well 2021-01-02 02:22:06 +01:00
rdb c81c506df3 express: Fix PointerToArray comparison operator 2021-01-01 17:54:09 +01:00
rdb b2462c1d8c express: Support pickling PointerToArray objects 2021-01-01 17:42:30 +01:00
rdb e755f87130 pgraph: Add pickling for LoaderFileTypeRegistry
Useful to test that pickling singletons works
2021-01-01 17:08:55 +01:00
rdb c77593f3f0 egg: add pickle support to most EggData classes 2021-01-01 17:06:23 +01:00
rdb f8ce339960 collide: Add pickle support for most collision handlers
Also redo CollisionHandlerEvent pickling to use Datagram instead

Related to #1090
2021-01-01 16:56:18 +01:00
rdb 152d317c8c egg: Fix egg lexer state not being cleaned up after error 2021-01-01 15:52:57 +01:00
rdb 339331c1ad egg: Add properties to EggAnimPreload 2021-01-01 15:51:23 +01:00
rdb 8852c835fc collide: Support pickling for CollisionTraverser, HandlerEvent+Queue
Fixes #1090
2020-12-31 16:57:34 +01:00
rdb ac991e4c5e collide: Fix error with CollisionHandler's again_patterns property 2020-12-31 16:55:22 +01:00
rdb 8d22b80698 display: Fix memory leak in GSG::get_prepared_textures() 2020-12-31 16:43:37 +01:00
rdb e9c7d345df display: Move GraphicsPipe::_detected_display_zoom to class member 2020-12-28 16:31:23 +01:00
rdb b38e9d552a Merge branch 'release/1.10.x' 2020-12-28 16:26:48 +01:00
rdb 90fb31ac21 ffmpeg: Fix crash cleaning up audio/video context 2020-12-28 16:23:04 +01:00
rdb 21aa31f8c0 gobj: Fix build error on Windows 2020-12-28 12:07:17 +01:00
rdb 2b0a6b995a display: Add a way to query system DPI scaling
See #426
2020-12-26 16:25:51 +01:00
rdb 2156e6deb2 Merge branch 'release/1.10.x' 2020-12-26 14:00:29 +01:00
rdb 55d43a1d57 device: Fix macOS crash when unplugging device in threaded pipeline
Fixes #1082
2020-12-26 12:46:45 +01:00
rdb a3010a43a5 Merge branch 'release/1.10.x' 2020-12-24 15:31:52 +01:00
rdb 35b7ef0dcb shader: Add additional mode-based texture inputs to GLSL shaders
This adds the following inputs:
  p3d_Texture[] (as alternative to p3d_Texture0, etc.)
  p3d_TextureFF[]
  p3d_TextureModulate[]
  p3d_TextureAdd[]
  p3d_TextureNormal[]
  p3d_TextureHeight[]
  p3d_TextureSelector[]
  p3d_TextureGloss[]
  p3d_TextureEmission[]
2020-12-23 18:20:43 +01:00
rdb 05876317cf Add TextureStage::M_emission mode
This is similar to M_glow, except that the emission factor is in the RGB channels.
2020-12-23 17:33:59 +01:00
rdb 8dd3301c43 text: Fix issue with TextNode::set_text() called from non-App stage
Because TextEncoder is not pipeline-cycled, text_changed() should propagate text changes up to stage 0.

See #1070; this caused the frame rate meter to show 0.0 fps most of the frames.
2020-12-21 16:53:05 +01:00
rdb 3786dc2aea CMake: Fix detection and use of SSE2 compiler flag on MSVC
This is one half of the fix for #1072
2020-12-20 18:35:17 +01:00
rdb e08282003b putil: Give SimpleHashMap a type handle to enable memory usage tracking
Previously SimpleHashMap were entirely absent from the PStats memory statistics.
2020-12-20 01:02:23 +01:00
rdb dee8df9427 Merge branch 'release/1.10.x' 2020-12-20 01:02:08 +01:00
rdb ac021e94d6 putil: Ensure SimpleHashMap::_deleted_chain/_table are always initialized
Good to be on the safe side.
2020-12-20 00:59:55 +01:00
rdb f7ab42da56 putil: Fix memory leak in SimpleHashMap
Fixes #1077
2020-12-20 00:23:04 +01:00
rdb b5c857c73f pgraphnodes: Backport ShaderGenerator stub to 1.10.x
Needed if interrogate is being run with the __aarch64__ definition in a multi-arch build
2020-12-19 23:50:07 +01:00
rdb 10bb4a33d3 ShaderGenerator: remove unnecessary member, define all stub methods 2020-12-19 11:15:00 +01:00
rdb f65fd44c08 pgraphnodes: Add missing ShaderGenerator stub symbols 2020-12-19 02:56:41 +01:00
rdb 7ae72cd880 pgraphnodes: Fix ShaderGenerator includes 2020-12-19 02:00:59 +01:00
rdb 1c974092e4 express: Fix compile error with certain macOS SDKs 2020-12-19 01:00:07 +01:00
rdb abe3c2bf0b CMake: Mark all system macOS frameworks as advanced variables
It should be extremely unusual to want to change these, and they are just cluttering up the CMake GUI.
2020-12-19 00:33:22 +01:00
rdb 113dd6a357 CMake: Don't try to build FMOD Ex audio module for arm64 2020-12-19 00:26:22 +01:00
rdb 617a759fd2 pgraphnodes: Add exposed methods to ShaderGenerator stub
Since HAVE_CG is now dependent on __aarch64__, it otherwise relies on interrogate having been run with the same architecture flags.
2020-12-19 00:26:13 +01:00
rdb a5ae292c3e Merge branch 'release/1.10.x' 2020-12-18 12:56:31 +01:00
rdb 6f35cb0235 device: Silently ignore invalid evdev keycodes generated by some drivers
Fixes #1066
2020-12-15 12:33:22 +01:00
rdb fa8c8e71b5 gobj: Assert instead of crash if primitive references out-of-bounds vert 2020-12-14 16:54:20 +01:00
rdb 79714392cb gobj: Enable slightly more efficient GeomVertexReader/Writer ctor
This allows moving an existing PT(GeomVertexData) into the object, preventing an extra refcount increase.
2020-12-14 11:16:25 +01:00
rdb 902ada10b8 gobj: Slight optimization for GeomTristrips::append_unused_vertices() 2020-12-14 11:11:46 +01:00
rdb 454179a276 collide: Fix typo in STDFLOAT_DOUBLE case 2020-12-14 11:00:49 +01:00
rdb a11e21e4f4 audio: Fix sound resuming after reactivation if stop() was called while inactive
Backport of fix for #559
2020-12-12 19:50:48 +01:00
rdb e5eb5f8ed2 audio: Fix stop() not working for looped sound while sound is inactive
Fixes #559

Also fixes #1031 for FMOD
2020-12-12 18:45:45 +01:00
rdb 9f09857397 collide: Error checking for CollisionPolygon::setup/verify_points() 2020-12-12 17:28:41 +01:00
rdb eaf509a226 pgraph: Make PandaNode::r_copy_subgraph no longer virtual (unused) 2020-12-12 17:28:21 +01:00
rdb a1b2d5b8dc Make use of new function call methods in Python 3.9 2020-12-12 17:28:21 +01:00
rdb ab5730831c audio: Add some properties to AudioSound 2020-12-12 17:28:21 +01:00
rdb 2b29c757d9 pgraph: Optimization for GeomNode::add_for_draw() 2020-12-12 17:28:21 +01:00
rdb 251d73a47b ShaderGenerator: very slight optimization setting ShaderAttrib flags 2020-12-12 14:15:27 +01:00
rdb ac4faf3d74 text: Make TextNode pipeline-cycled
Fixes #1070

Note that text property changes are not pipeline-cycled at the moment.
2020-12-12 14:05:48 +01:00
rdb 54a4a6abfc Merge branch 'release/1.10.x' 2020-12-12 14:02:04 +01:00
rdb 761c54f63d pgui: Workaround for DirectEntry flickering issues w/ pipelining
See #1070.  This is a temporary solution (one which isn't complete- it doesn't properly handle state changes).
2020-12-12 13:57:49 +01:00
Daniel 4f63ef635d panda: Remove PyEval_InitThreads calls when compiling against Python 3.9+
Cherry-pick from #1053
2020-12-12 00:16:58 +01:00
rdb c8a35641c1 pgraphnodes: Remove unused variable 2020-12-10 17:37:05 +01:00
rdb ed397b3ab8 Merge branch 'release/1.10.x' 2020-12-09 17:59:37 +01:00
rdb bf59e880c6 bullet: Fix compilation error with Bullet 2.90+ 2020-12-09 16:25:29 +01:00
rdb 8e2c0dff4a pgraph: Hack fix for copying model with LightAttrib on root
When a LightAttrib is set on the root of a model and the light is contained within that model, creating a copy (like the one Loader makes automatically) causes the LightAttrib to still point to the original light, not to the newly copied light.

This works around it only for the case when the LightAttrib is set on the root, and only for the case of NodePath::copy_to() (it turns out there are edge cases when doing it in PandaNode::copy_subgraph() that would be hard to explain).

See Moguri/blend2bam#44
2020-12-09 15:51:36 +01:00
rdb 9525ddbfef pgraph: LightAttrib::get_on_light(n) should call check_sorted() 2020-12-09 15:48:10 +01:00
rdb 615502aef6 pgraphnodes: Support hardware instancing for LODNode
LODNode will now correctly calculate LOD for individual instances.

It turns out implementing it for FadeLODNode is hard (wrt. tracking state for individual instances) so I have not bothered with supporting it - FadeLODNode instead calculates a single switch level for all instances based on the centroid of the visible instances.
2020-11-26 16:47:35 +01:00
rdb e13756f43e pgraph: Support hardware instancing in BillboardEffect and CompassEffect 2020-11-26 16:47:11 +01:00
Daniel 54cb519dc9 panda: Remove PyEval_InitThreads calls when compiling against Python 3.9+
Closes #1053
2020-11-23 10:56:09 +01:00
rdb 01b2f1f759 gobj: Fix typo in docstring
[skip ci]
2020-11-23 10:54:03 +01:00