Commit Graph

11210 Commits

Author SHA1 Message Date
rdb b656b0bbf9 dxgsg9: recreate vertex buffer if size was modified
Fixes #824
2019-12-28 18:01:51 +01:00
rdb 72c5555dc0 device: invert digitizer Y axis on Linux to match Windows
It may intuitively feel upside down, but the current behaviour actually matches base.mouseWatcherNode, so this is probably the most consistent thing to do.
2019-12-18 17:55:44 +01:00
rdb 986b803e71 device: recognize digitizers and pressure axis as well in evdev
Note that the Y axis is still inverted compared to on Windows; we need to decide what convention to follow here.
2019-12-17 22:56:26 +01:00
rdb b67c7dd84f device: support digitizers via Win32 raw input API 2019-12-17 22:33:27 +01:00
rdb 55f624e073 windisplay: add a variable to disable Panda's message pump
This is particularly important for Tcl/Tk, which assumes it is in charge of the Windows event loop.

Fixes #586
2019-12-08 15:04:06 +01:00
LD 791be4766a MacOS: Don't crash if no elements are returned by IOHIDDeviceCopyMatchingElements
Fixes #797
2019-12-03 23:26:25 +01:00
LD f72c72b36a MacOS: Force disable application HiDPI support on NSView, fixes #794 2019-11-29 10:07:48 +01:00
Thaumaturge c0daa75353 particles: add parameter to delay particle birth in soft_start()
Also adds a get_tics_since_birth() getter.

This feature can be used to synchronize different particle effects.

Closes #769
2019-11-10 20:33:45 +01:00
rdb ccca3cca3a gobj: fix crash printing out residency trackers 2019-11-10 19:23:10 +01:00
rdb 2d836697b0 glgsg: fix issue extracting texture data for multiview textures 2019-11-10 19:20:10 +01:00
rdb cb01d45eb6 glgsg: fix RTM_copy_ram for multiview textures 2019-11-10 19:09:31 +01:00
rdb 6fd662335d express: fix typo in VirtualFileSystem docstring 2019-11-09 20:27:03 +01:00
rdb 78c3db379c gobj: fix tests crash due to ShaderBuffer context not cleared at GSG death 2019-11-03 11:48:51 +01:00
rdb c611abc6c2 physx: fix a pair of misformatted docstrings 2019-11-02 20:39:29 +01:00
rdb 3bfd994cf8 general: Fix a couple of misformatted docstrings. 2019-11-02 19:54:25 +01:00
rdb 39988e4787 general: update a few outdated links in API documentation 2019-11-02 19:41:56 +01:00
rdb fd8405cd87 x11display: change info message about unavailable XF86DGA to warning 2019-10-25 10:26:32 +02:00
rdb 3e99d16eb1 gobj: clarify range of GeomPrimitive::offset_vertices() parameters 2019-10-25 10:25:11 +02:00
rdb dae762f52b pstatclient: fix compile error when compiling without DO_PSTATS 2019-10-25 10:24:30 +02:00
rdb 6dcaab2d3a glgsg: fix multisample FBO for 16-bit float buffer
Fixes #756
2019-10-10 15:18:45 +02:00
rdb 08572f3c38 general: Fix a variety of ABI incompatibility issues with opt4 builds 2019-10-08 19:44:29 +02:00
rdb 0247f9e3fa physics/particlesystem: remove some unused macros 2019-10-08 19:43:17 +02:00
rdb 5b938278c2 physics: also add set_name/get_name if NDEBUG is set, for ABI compat 2019-10-07 11:36:58 +02:00
rdb 1eeea718c5 display: fix ABI compat with GraphicsStateGuardian flash texture 2019-10-06 11:54:31 +02:00
rdb ec6638314c general: remove some oddly-placed audio_error macros 2019-10-06 11:51:15 +02:00
rdb 8b0256e0f9 glgsg: fix NV driver crash after deletion of buffer that is still bound to a generic attribute index not used by Cg shader after having been used by a GLSL shader directly prior if no shaders are used afterwards 2019-10-05 21:04:09 +02:00
rdb 3a19dfb62e Fix load_dso error message sometimes being suppressed 2019-10-05 20:56:58 +02:00
rdb 9f9e1d8293 chan: print out actual anim info when showing AnimBundleNode in ls()
This allows one to more easily discover the animations present in a scene graph, such as when using bam-info -ls to inspect a .bam file.
2019-09-30 14:02:53 +02:00
rdb 66b338c112 mathutil: workaround for infinite loop in Triangulator
Fixes #737
2019-09-18 15:45:45 +02:00
rdb f4926bff20 Fix a variety of ABI compatibility issues
We need third-party extensions that link with the Panda3D libraries to continue to work when shipping them with the optimized libraries that deploy-ng uses.  To do this, we need the optimized build not to omit symbols that these extensions might depend on.
2019-09-16 03:33:09 +02:00
rdb 05ed918d63 general: mark deprecated methods with the @deprecated tag
This makes them easier to find and, if necessary, automatically generate deprecation warnings for.
2019-09-08 09:50:28 +02:00
rdb 8b241b8c18 windisplay: fix issues with losing mouse cursor confinement
Fixes #727
Fixes #729
2019-09-06 15:36:36 +02:00
rdb 323f74cb55 event: squelch unprotected NewFrame event spam warning 2019-09-04 10:19:01 +02:00
rdb 79c71a5d97 pgraph: fix missing includes of *Collection classes in nodePath.h 2019-09-03 22:46:18 +02:00
rdb 833f778cb7 pnmimage: add quantize feature to reduce number of colors in image 2019-08-28 22:44:16 +02:00
rdb f63b3a86b9 loader: add LoaderFileTypeRegistry.unregister_type() 2019-08-20 13:23:11 +02:00
rdb c2f49f4c4a loader: a few additional checks for Python loader plug-ins 2019-08-20 13:23:11 +02:00
rdb 6364485b49 ffmpeg: fix an unprotected debug print 2019-08-19 21:58:08 +02:00
rdb 818ed57894 linmath: work around obscure MSVC optimization bug with Eigen 2019-08-18 18:07:00 +02:00
rdb 1e846709d3 Add various @since tags to methods that are new in 1.10.4 2019-08-17 13:49:47 +02:00
rdb 0e27f19d94 bullet: fix various unprotected debug() prints 2019-08-14 15:07:06 +02:00
rdb c54f964a3b bullet: workaround for deadlock adding shape to scaled body (#689) 2019-08-14 14:38:58 +02:00
rdb acb0a41049 ode: fix several unprotected debug() prints
This should especially help with trimesh generation performance, which previously formatted a complete description of the trimesh to the debug output even if it was disabled.
2019-08-14 13:11:02 +02:00
rdb 8f9d0ab6f6 pgraph: fix some TextureAttrib state cache issues
The _render_stages and _render_ff_stages cannot simply be copied, because they contain pointer references to the previous TextureAttrib.  Never copy them, and always mark _sort_seq as stale.

This fixes a test failure in replace_texture.
2019-08-13 18:08:48 +02:00
rdb 8be70ed16d glgsg: auto convert to srgb(a) if sluminance not supported
This is particularly the case when requesting a core-only profile (gl-version 3 2) where luminance textures are deprecated.

There is apparently no way to emulate them with swizzles (as we do with luminance textures), so we'll have to duplicate the channels out.

Fixes #693
2019-08-12 21:04:48 +02:00
rdb dc599901bc Work around shutdown hang when compiling with SIMPLE_THREADS=1
This is a workaround for a specific case of #508
2019-08-12 19:37:11 +02:00
rdb 932e981572 device: fix deadlock when building with SIMPLE_THREADS=1
GetMessage blocks without yielding, so we need to use an alternative message pump using PeekMessage instead.

Fixes #704
2019-08-12 19:34:17 +02:00
rdb 42dff65e4d general: fix various unprotected debug() outputs
These should be protected by an is_debug() check so that they can be optimized out properly in a release build.  Setting check-debug-notify-protect in Config.prc can be used to track down cases of missed checks.
2019-08-03 10:33:43 +02:00
Mitchell Stokes f2686c5ad8 glsl: Fix Shader::_error_flag not being set on compile errors (#622) 2019-08-01 12:14:31 +02:00
rdb 7f385b5ddf glsl: fix use of multiple p3d_TextureMatrix[] values 2019-07-30 19:30:15 +02:00
rdb 5449f963a5 loader: fix leak of EntryPoint.name reference 2019-07-30 19:29:18 +02:00
rdb aea5ee8c7a task: work around MSVC compiler bug crashing test suite in release mode 2019-07-30 18:38:16 +02:00
rdb 93ed9632ac loader: fix incorrect EXPCL that prevents compilation on Windows 2019-07-30 13:28:10 +02:00
rdb 7b9f87412a loader: support Python loader plug-ins
This allows defining custom loader types from Python code.  Packages can use metadata entry points to register file types with the loader.

Example code: https://gist.github.com/rdb/cb3c2f4a98ce371c722e3f297b445153
2019-07-30 13:04:46 +02:00
rdb f989bce584 wgldisplay: don't restore gamma atexit if we never modified it
This avoids possible instability (see #685) when this feature isn't even used
2019-07-29 17:05:36 +02:00
rdb 224a32090f task: fix other task chains still running after exception occurs
A task returning DS_interrupt would only interrupt the current task chain, not the entire task manager.  This meant that other tasks might get run with an exception state set, causing the exception state to get stomped on or the Python interpreter to complain.

Fixes #692
2019-07-26 08:30:16 +02:00
rdb 9dd35f9c3a gobj: default current_thread arg for Geom.get_animated_vertex_data() 2019-07-16 13:40:14 +02:00
rdb 23232a5b20 pgraphnodes: fix assert when analyzing geoms with strip cut index 2019-07-15 19:42:33 +02:00
rdb ce6d02b8d7 egg: remove unused matrix_2d variable 2019-07-15 14:54:55 +02:00
rdb 11990833fe text: fix compilation warnings with implicit int->char32_t cast 2019-07-10 11:20:15 +02:00
rdb 4bb31029f0 pgraph: fix ScissorAttrib compare (fix flickering DirectScrolledFrame)
Fixes #681
2019-07-10 11:14:54 +02:00
rdb bac376541f pgraph: add NodePath.replace_texture() 2019-07-10 09:53:42 +02:00
rdb ab238bd153 gobj: support non-affine transformations in calc_tight_bounds
This makes it possible to get the 2D bounding volume of an object as it appears on screen.
2019-07-10 09:30:16 +02:00
rdb 291f3825f4 ffmpeg: fix rare "bad src image pointers" after seek
Fixes #391
2019-05-13 13:53:34 +02:00
rdb f183d901cb bullet: sync rigid body transform when node is reparented
Reparenting a node will change its net transform, so it should cause a transform sync.

Fixes #629
2019-05-13 13:53:33 +02:00
rdb 750afbb188 device: Linux fixes for Trust GXT 24 and a few other cheap gamepads
Fixes #576
2019-05-12 20:34:19 +02:00
rdb c1c74e2cd3 mathutil: add some more assertion checks to PerlinNoise2 2019-05-12 19:22:26 +02:00
rdb f25532db78 glgsg: properly handle shader compilation failure
Fixes #645
2019-05-03 20:49:08 +02:00
rdb 0568312324 windisplay: add config var to disable Ctrl+V behaviour
Fixes #512
2019-05-03 19:41:27 +02:00
rdb 54c6eaeb96 pgui: allow keyboard keys to be added as PGButton click buttons
These will respond as clicks not when the mouse cursor is hovering over them, but when they have keyboard focus.

Fixes #600
2019-05-03 19:22:21 +02:00
rdb 475bd55bb1 glgsg: add gl-forward-compatible config variable
This is meant to be used alongside gl-version to request a "forward compatible" OpenGL 3.0 or 3.1 context, which removes support for deprecated features such as the fixed-function pipeline.
2019-05-03 15:46:01 +02:00
rdb 53612512d5 glgsg: more reliable check for core/compat profile
Fixes #643
2019-05-03 15:43:20 +02:00
rdb 7f0ac22ca5 device: fix mappings for various generic gamepads on Windows
See also #576
2019-05-02 21:32:31 +02:00
rdb cc4d5259cc linmath: fix mat4.get_col3() and mat4.get_row3() when using Eigen 2019-05-02 19:40:23 +02:00
Sebastian Hoffmann 16c3ca5c87 device: Fix swapped axes on right stick for Jess Colour Rumble Pad
Closes #639
2019-05-01 17:19:18 +02:00
rdb d9d30cdfd2 collide: compat for typo'ed respect_prev_transform property in 1.10 2019-04-29 22:29:36 +02:00
rdb 333db2b17e movies: fix compilation issue in MSVC 2015 2019-04-29 22:28:59 +02:00
rdb fa1ff3d489 movies: fix for loading unseekable Opus files
Same fix as 00b3fbdb1a but for Opus files.
2019-04-29 11:41:13 +02:00
rdb 2c55663472 movies: allow seeking compressed Ogg Vorbis file to beginning 2019-04-29 11:39:30 +02:00
rdb a726592244 movies: support looping compressed .wav files
Any kind of skipping is supported on any kind of stream, actually, but some uses may require reopening the file and skipping some number of bytes, so a warning will be displayed in some cases.

I figure this feature is particularly interesting for .wav files since they are (1) often used for short samples, where skipping bytes is not really a big deal, and (2) aren't inherently compressed so would benefit particularly from zlib compression.
2019-04-29 10:48:04 +02:00
rdb 00b5faca2d ode: add OdeBody.joints property 2019-04-29 01:06:44 +02:00
Rishabh Tewari bfb50ab7ff device: don't crash on Linux if no devices are found
Fixes #634
Closes #635
2019-04-29 00:32:34 +02:00
rdb 00b3fbdb1a movies: fix for loading unseekable ogg vorbis files
Now, compressed/encrypted ogg files will properly be detected as unseekable, and will still be able to be played.
2019-04-28 22:57:06 +02:00
rdb ca5b4e7b54 ode: fix OdeJoint.attach with None parameters
Fixes #633
2019-04-28 22:29:29 +02:00
rdb 186d8feef4 movies: properly detect extension of pz/gz audio/video files 2019-04-28 21:49:23 +02:00
rdb 239dc40032 device: fix crash when unplugging certain devices on macOS
Fixes #621
2019-04-14 22:11:20 +02:00
rdb 5530074945 cocoa: fix crash when typing with RIME as input method
Fixes #620
2019-04-14 22:10:32 +02:00
rdb 5d3499dc64 x11display: fix crash when starting in fullscreen on Linux/X11
Fixes #618
2019-04-14 18:01:55 +02:00
rdb 98227daaa5 putil: fix SparseArray::clear_range et al
Fixes #588
2019-04-14 17:11:42 +02:00
rdb 8b79fb75b9 glgsg: allow multisampling on FBO even if host has no multisamples
Fixes #601
2019-04-09 13:24:52 +02:00
rdb 77d6a9f5c9 ffmpeg: add "FFmpeg" tag to PandaSystem 2019-04-09 12:09:21 +02:00
rdb 1a9867ae2e device: remove executable permissions from inputDeviceSet.* 2019-04-02 02:08:47 +02:00
rdb 3ea562d404 collide: handle degenerate case for into-sphere test more robustly
This case happens, for example, when colliding a capsule with identical begin and end points into a sphere.
2019-03-29 13:29:14 +01:00
rdb 63a764a61b display: fix missed cases in 364d5d82fe 2019-03-29 13:28:12 +01:00
rdb 364d5d82fe display: don't apply color-scale-via-lighting to shader inputs
This isn't working properly at the moment, since the state gets set for the *next* object, causing significant artifacts.  I wasn't entirely sure whether to restore the "proper" behavior or not, since applications may be relying on one or the other behavior, but enabling this feature for shaders is a minefield and it's a lot better to just tell people to use p3d_ColorScale instead.
2019-03-26 23:12:41 +01:00
rdb b0a5cceafd glgsg: fix support for matrix arrays in vertex data 2019-03-21 12:35:53 +01:00
Sam Edwards c63562088b device: Fix missing include 2019-03-18 04:10:35 -06:00
rdb 4f94b3aa0e egg2pg: fix CollisionBox generation for transformed objects
Rather than xforming after the fact, which does not work properly for boxes, we need to apply the transform to the vertices around which the box is generated.

Fixes #506
2019-03-17 19:07:47 +01:00
rdb e486bbcb3f collide: fix printing CollisionBox 2019-03-17 19:06:45 +01:00
rdb 029d7363cd distort: fix use of cylindrical_k in oSphereLens.cxx 2019-03-17 00:17:11 +01:00
rdb bafd523e2b mathutil: fix bad assert in BoundingBox::set_min_max 2019-03-12 15:36:47 +01:00
rdb 0e70997fbf x11display: fixes for multi-monitor and fullscreen support
- DisplayInformation now gives the list of display modes returned by XRRGetScreenResources if RandR 1.2 is supported, which is apparently more reliable than the previous XRRSizes/XRRRates approach.
- Switching fullscreen on X11 to the current resolution on the CRTC that the monitor is on will make the window cover the CRTC properly, rather than forcing the window to have an origin of (0, 0).
- Passing in the pipe's display width/height is commonly done to go fullscreen at native res, but this may not correspond to a real display resolution.  It now detects when this is done, and interprets this as "go fullscreen at the native resolution on the current CRTC".

Fixes #575
2019-03-10 19:33:13 +01:00
rdb 08c686ba18 windisplay: fix issues with runtime fullscreen switching 2019-03-08 11:14:56 +01:00
rdb 45778b9e9f device: use threaded message loop on Windows (see #562) 2019-03-04 16:20:52 +01:00
rdb 4e92b708ff Merge branch 'macosstuckwindowfix' of github.com:treamology/panda3d into release/1.10.x
Closes #536
Fixes #534
2019-03-04 12:23:53 +01:00
rdb 155b1c38ad bullet: properly expose bullet_contact_added_callback symbol
Fixes #571 (alongside 92993fe889)
2019-03-03 21:14:47 +01:00
rdb 92993fe889 bullet: fix assert when setting mass before shape (#571)
Requires compiling Bullet in debug mode to reproduce.
2019-03-03 21:13:36 +01:00
rdb 7f4491cb98 device: disable message loop in WinInputDeviceManager for now
This was a change in aadc62a96c but seems to cause other problems, see #562
2019-03-02 12:39:42 +01:00
rdb 1f9b4690e6 pgraph: fix writing to SequenceNode frame_rate property 2019-02-19 21:29:21 +01:00
rdb 6a008ae724 x11display: fix threaded crash when using get_keyboard_map() 2019-02-19 21:21:22 +01:00
rdb ba3a826bff gobj: fix crash reading unaligned float4 column in GeomVertexReader
Observed when calling flatten_strong() on model with vertex colors loaded via Assimp.
2019-02-17 13:02:56 +01:00
rdb 9bf37051ac collide: fix _collider_sort not copied in CollisionNode copy ctor
See #554
2019-02-17 10:56:02 +01:00
rdb 20f0a69c75 pipeline: use decimal representation for unique thread ID on FreeBSD
This matches the behaviour on Linux.
2019-02-14 22:40:46 +01:00
rdb f97ba9000b pipeline: don't use uninitialized value for main thread unique id
See #554
2019-02-14 22:39:56 +01:00
rdb 18b7350400 egg: update prebuilt parser.cxx and parser.h 2019-02-12 00:31:13 +01:00
rdb 4d0970c072 pgraph: StencilAttrib.make() takes default write_mask argument 2019-02-11 23:48:00 +01:00
rdb f741c9476f display: fix lighting being disabled when only AmbientLight is on 2019-02-10 16:19:45 +01:00
rdb 3875cc8259 device: add proper mapping for 8bitdo N30 Pro Controller on Linux 2019-02-07 22:28:04 +01:00
tc 96bb90b5e9 cocoa: guarantee 24bit depth when Config.prc has `depth-bits` set to `1`
Checks if the value of Config.prc for `depth-bits` is `1` and sets it
manually to 24.
This prevents getting a 16 bit depth buffer on macos
Intended to address #501

Closes #551
2019-02-07 22:26:54 +01:00
rdb 0ef9f9bef5 device: various button/axis mapping fixes in Windows raw impl
Now uses a table like on Linux with the various mappings.
2019-02-06 22:06:43 +01:00
rdb f8d7941fe8 device: fix a bad axis mapping on Linux 2019-02-06 22:03:44 +01:00
rdb 1b4035f29a device: move HID API definitions to separate header file 2019-02-06 21:56:47 +01:00
rdb aadc62a96c device: fix inability to detect devices with pipelining enabled
This is because the message window is being created in the main thread, but there is nothing processing messages in the main thread.
2019-02-06 21:51:06 +01:00
rdb 63d2992d5e egg: add ability to read <Tangent> with four components
This is not intended to be used just yet in 1.10, but already added in preparation for changes on master to support #546.  I'm just allowing Panda to parse the syntax ahead of time to reduce potential .egg incompatiblities.
2019-02-05 00:30:54 +01:00
rdb 2afd604c9d collide: implement capsule-into-invsphere and box-into-invsphere tests 2019-02-04 23:50:53 +01:00
rdb 22cac1cdf9 device: fix stack corruption crashes on 32-bit Windows 2019-01-31 18:23:29 +01:00
rdb 0ba1235d35 ShaderGenerator: print out generated shader in spam output mode 2019-01-31 00:05:23 +01:00
rdb 0e447b7429 ShaderGenerator: do shadow map calcs in fshader if out of varyings
If too many shadow-casting lights are active, too many TEXCOORD varyings will be used and a shader compilation error will be displayed.  Instead, Panda will now just do the calculation in the fragment shader if not enough varyings are available.  It's slower, but better than crashing.
2019-01-30 23:54:22 +01:00
rdb dc8f01df8a ShaderGenerator: pack eye-space normal to save one varying
Only when normal mapping is enabled.
2019-01-30 23:51:50 +01:00
rdb 9d12a4c437 general: improvements to doxygen API reference:
* In C++ reference, only pick up classes defined in .h file
* Add a few excludes to C++ reference that aren't public API
* On class index pages, reduce number of columns
* Add @since for some methods/classes that are new in 1.10.0
* Fix/improve a few docstrings here and there
2019-01-23 22:24:02 +01:00
rdb 66655aae85 device: fix incorrect features when printing InputDevice 2019-01-21 15:32:22 +01:00
rdb 7968022c23 Fix some warnings comparing char against EOF
This is not possible on platforms where char is unsigned.  In cases where fail() is checked, it is also unnecessary.
2019-01-20 00:31:43 +01:00
rdb 7d09451b2d display: remove unused iterator variable 2019-01-19 23:08:14 +01:00
rdb 73076c7115 android: add missing include for open() definition 2019-01-19 23:04:19 +01:00
rdb e4f0a9ce32 pgraph: allow getting NodePath from CullTraverserData in Python 2019-01-19 22:59:51 +01:00
Donny Lawrence 2c513ba1c4 Move handle_close_event() call to windowShouldClose, which only triggers when the close button is pressed by the user. 2019-01-13 19:07:43 -05:00
Sam Edwards 955081f81f movies: Fix missing includes in {opus,vorbis}AudioCursor.cxx 2019-01-13 13:59:08 -07:00
Donny Lawrence d51db6e39e Fix an instance where a macOS window will stick around when trying to have it destroyed.
This commit also removes an extraneous call to [_window setReleasedWhenClosed], which is already set in cocoaPandaWindow's init method.
2019-01-13 11:54:56 -05:00
rdb 84a1315104 More fixes to work around broken libc++ eof() in Mac OS X 10.7 2019-01-10 21:53:02 +01:00
rdb 3ccfbfaba7 putil: fix hang reading bam due to macOS libc++ bug in istream::eof()
Apparently eof() in older versions of libc++ returns true if the last character has just been read, whereas the proper behavior is only to return true when attempting to read past the end of the stream.  Since failbit is reliably set in all cases when reading past the length of the stream, we should only trust the result of eof() if fail() also returns true.
2019-01-09 22:56:40 +01:00
rdb 60a944e783 glgsg: fix shader inputs not being updated in esoteric case
Specifically, this happens if you have a custom ShaderGenerator that assigns shader inputs via the ShaderAttrib.  If two objects then both have the auto-shader turned on, and the shader generator generates ShaderAttribs with the same shaders but different inputs, the inputs will not be updated properly for one of the objects.
2019-01-09 22:39:36 +01:00
rdb 886d44d15d glgsg: fix multisampling for floating-point framebuffers 2019-01-09 22:39:05 +01:00
rdb d1845530aa task: fix mutex recursion when task awaiting other task ends 2019-01-09 22:12:02 +01:00
rdb e64a342a9f task: fix error awaiting already scheduled task
To reproduce this issue, try `await taskMgr.add(Task.pause(1.0))`
2019-01-09 20:10:10 +01:00
rdb 84df25cfe3 glgsg: fix sRGB support in multisample FBOs 2019-01-09 00:49:14 +01:00
Sam Edwards 0cd850fbb4 vision: Allow including from OpenCV's videoio, for 3.x+
This commit doesn't add buildsystem support yet.
2019-01-06 15:33:11 -07:00
rdb d106fd6a3a device: added checks, robustness, debug output for Windows raw input 2019-01-05 22:00:34 +01:00
rdb 7e562b0eb3 device: remove unused variables on Windows 2019-01-03 16:01:10 +01:00
rdb 8cdeb9b60b device: fix a case issue in include statement 2019-01-03 15:34:30 +01:00
rdb 3e22578529 New branding images for 1.10.0 2019-01-03 14:44:17 +01:00
Sam Edwards 6e951773a6 pipeline: (Light)ReMutexDirect should include thread.h
Thread methods are used in the respective .I files, so
an incomplete forward declaration won't suffice here.
2019-01-02 01:41:25 -07:00
rdb c365beaf11 device: hide Steam Controller on Linux while Steam is running
When Steam runs, it mutes all input from the Steam Controller and instead registers a virtual gamepad that obeys the Big Picture controller remapping.  We want to make sure to pick that one, since the "real" Steam Controller doesn't report any events while the virtual device is active.  So we carefully consider the "real" Steam Controller "inactive" if the presence of the virtual device is detected, until the virtual device is disconnected (ie. when Steam is closed) or if it turns out that it is generating events after all, in which case it gets automatically reactivated.

This is a bit of a hack, maybe there is a cleaner way of doing this.
2019-01-02 00:56:40 +01:00
rdb dccf8074fd android: fix compile errors in androiddisplay module 2019-01-01 22:05:26 +01:00
rdb a02920bb42 device: detect XInput devices on start-up
This is needed to handle cases where XInput is being emulated, such as when running via Steam with the Steam Controller active.  Steam's shim does not send out WM_INPUT_DEVICE_CHANGE events.
2019-01-01 16:27:55 +01:00
rdb 2bde2baed2 device: a couple of fixes with Windows device input 2019-01-01 16:23:16 +01:00
rdb c61b480a41 Revert "bam2egg: support exposed joints properly"
This reverts commit dee4cd6201.

Fixes #237
2018-12-31 17:07:42 +01:00
rdb 6559932c7b ShaderTerrainMesh: silently reload texture if it has no RAM image
Fixes #492
2018-12-31 16:28:27 +01:00
rdb f3ba1d317c device: support for Steam Controller on Linux
Adds lgrip and rgrip button handles, which are present on Steam Controller but also on the Oculus Touch
2018-12-31 16:10:56 +01:00
rdb 4699dfcd5b ShaderGenerator: fix toggling shadows while shader gen is on 2018-12-31 14:07:14 +01:00
rdb 83374de0ff shader: don't use GENERIC profile to compile Cg shaders
Instead, make an educated guess of what the GSG we are going to be compiling this shader for wants to use as profile.
2018-12-31 14:01:26 +01:00
rdb 9382e09b7c display: fix returning reference to temporary in shader input
This might cause issues when the transform cache is off.
2018-12-31 13:13:45 +01:00
rdb 8119547e90 device: add hacky detection of Trust GXT 24 as gamepad for now 2018-12-31 13:12:40 +01:00
rdb 0cfd86d0f4 glgsg: warn if Cg shader uses float4 vtx_normal
See #495; Cg's glslv profile does not handle a float4 vtx_normal well and causes garbage to be in the w coordinate.
2018-12-31 13:11:33 +01:00
rdb 42405dff2e pnmimagetypes: fix allocation efficiency in PNG reader
Rather than making one allocation per row, it instead makes one allocation for all rows.
2018-12-30 20:13:12 +01:00
rdb 73083127bf x11display: bypass compositor when switching to fullscreen mode 2018-12-30 16:59:32 +01:00
Sam Edwards 952031455c express: Remove stray reference to DConfig 2018-12-29 02:29:56 -07:00
Sam Edwards 5d74411c37 display: Fix export/import macro for MouseAndKeyboard
It was moved here from device, so we should not use
EXPCL_PANDA_DEVICE anymore.
2018-12-28 20:59:14 -07:00
Sam Edwards bc2450441d device: Fix some includes 2018-12-28 20:59:09 -07:00
rdb 31c532387e pgraph: remove unused weakKeyHashMap.h import 2018-12-28 21:36:16 +01:00
rdb 30446952cb putil: remove no-longer-used WeakKeyHashMap for now 2018-12-28 21:26:46 +01:00
rdb 01915a36db Merge branch 'master' into deploy-ng 2018-12-26 23:41:50 +01:00
rdb 981c44f636 glgsg: fix misleading errors from p3d_LightSource[].shadowMap 2018-12-26 23:31:48 +01:00
rdb 669a655366 Fix ShaderBuffer cleanup assertion with state cache disabled 2018-12-26 22:47:14 +01:00
Donny Lawrence f29643dd14 cocoa: Prevent a deadlock when using SIMPLE_THREADS on macOS
Closes #491
Fixes #490
2018-12-26 22:47:14 +01:00
Donny Lawrence 0fa0ad673f cocoa: use CVDisplayLink on macOS to sync video to display(s)
Closes #487
Fixes #486
2018-12-24 13:36:13 +01:00
rdb 8cb7f7d9c0 ffmpeg: don't hold AV lock while fetching first packet/frame
This allows loading multiple videos side-by-side more effectively.

Closes #397
2018-12-23 22:28:12 +01:00
rdb e2574af82d collide: create compatibility header collisionTube.h
This is a separate commit from the previous one in order not to confuse Git's rename tracking.
2018-12-23 22:28:12 +01:00
rdb bd6ef2b0ea Rename CollisionTube to CollisionCapsule (bam 6.44)
Adds ability to register "obsolete" names for certain types under older .bam versions, so that we are still able to write out old .bam files.

Fixes #347
2018-12-23 22:28:06 +01:00
rdb b40ecd6c51 general: fix some old-style docstring comment blocks 2018-12-23 16:27:08 +01:00
rdb 729a2364bc windisplay: remove unused WHQL stuff 2018-12-23 16:25:29 +01:00
rdb 9035b4a610 pgraph: don't bother calling xform() on empty BoundingVolume 2018-12-19 20:56:42 +01:00
rdb 837d3d6b6d tform: add properties to MouseWatcherRegion 2018-12-19 20:54:48 +01:00
rdb cbda6166a8 tform: fix MouseWatcherRegion area calculation
Fixes #233
2018-12-19 20:54:34 +01:00
rdb daa3100bf1 pgraph: mark TransformState as invalid in destructor
This, in combination with ebef9f3de8, makes it easier to catch issues in code that is accidentally letting get temporary TransformState objects get destroyed.  It does not affect release builds.
2018-12-19 20:47:57 +01:00
rdb ebef9f3de8 pgraph: add assertions to prevent invalid TransformState
If this commit is causing crashes in your code, it is probably exposing a bug in some other system that is assigning bad TransformState objects.
2018-12-19 20:45:57 +01:00
rdb 5cafe8552b gobj: add F_rg, F_rg16, F_rg32, F_rgb32 to TexturePeeker 2018-12-19 20:26:51 +01:00
rdb 840f28ef18 glgsg: fix framebuffer_copy_to_ram format for float framebuffers 2018-12-19 12:43:39 +01:00
Mitchell Stokes 88470106b6 Merge branch 'master' into deploy-ng 2018-12-18 20:44:16 -08:00
Mitchell Stokes 587237577f deploy-ng: Move distribution related files from direct.showtutil to direct.dist 2018-12-18 20:33:12 -08:00
Mitchell Stokes 8dcb735f2b x11display: Release M_relative mouse when window loses focus
Fixes #480
2018-12-18 19:43:37 -08:00
rdb 11526852ed glgsg: add ability to get red/rg-only floating-point renderbuffers 2018-12-18 20:00:59 +01:00
Derzsi Dániel b7d638e53d
pgraph: fix BillboardEffect regression with older models
In older BAM files (version <= 6.42), _fixed_depth will have an uncertain value after loading, leading to incorrect transform calculations, which cause rendering issues (see issue #474)
2018-12-18 16:49:00 +02:00
rdb 4c0fa1e75d Merge branch 'master' into deploy-ng 2018-12-16 22:36:45 +01:00
rdb 6b8814f9c9 mathutil: add some properties for bounding volumes 2018-12-16 21:03:43 +01:00
rdb 65a86d1b3f shader: warn if GLSL shader does not contain #version line
Shaders without #version line (which are supposed to indicate GLSL 1.10) will be interpreted differently by different drivers, so this is almost certainly a mistake.  In the future, we can forbid this altogether or insert #version 110 automatically.
2018-12-16 21:01:38 +01:00
rdb 73452957ee gobj: better handle NaNs in vertex data when calculating bounds 2018-12-16 20:43:30 +01:00
rdb a7752da4f1 Merge branch 'master' into deploy-ng 2018-12-09 20:22:23 +01:00
rdb a17ac6516c pgraph: fix regression in 89236ac136 2018-12-09 20:19:40 +01:00
rdb b5b77e5956 pgraph: fix issues with serializing empty NodePaths 2018-12-09 20:16:55 +01:00
loblao 68b7986557 NodePath: Implement replace_material
Closes #472
2018-12-09 19:05:25 +01:00
rdb 4213e0a50a Remove awesomium (see #440) 2018-12-09 15:53:23 +01:00
Mitchell Stokes a5ad186a66 x11display: Do not grab the mouse in confined mode when the window does not have focus 2018-12-08 17:21:59 -08:00
rdb ca9ad5f174 pgraph: fix ignored fixed_depth parameter 2018-12-07 00:57:21 +01:00
rdb 89236ac136 pgraph: fixed-depth billboards, bam additions (6.43)
This makes it possible to use BillboardEffect to specify a fixed distance to the camera, in order to keep them at a fixed apparent size.

This also enables serialization to .bam of the reference NodePaths of BillboardEffect and CompassEffect.
2018-12-06 23:52:58 +01:00
rdb b38faadf5f bullet: restore behavior of in_contact flag
c18abad8c3 added a call that resets the m_isInContact flag, so this resets it, for better or worse.  We may want to revisit whether #349 was indeed the right fix to #250.

Fixes #453
2018-12-06 22:29:09 +01:00
rdb 3adc7d977e glgsg: fix compilation in double-precision mode 2018-12-04 16:16:05 +01:00
rdb fb8a2f2af0 Revert "openal: Grab volume from manager instead of assuming max volume."
This reverts commit 7fb30ae070.

See #64 for discussion.
2018-12-04 15:54:02 +01:00
rdb 3c6b6e47ec glgsg: don't call glLineWidth with higher value than maximum
Officially, in core profile OpenGL 3.2+, calling it with a value higher than 1.0 is an error, but many vendors seem to let us.  Apple's implementation does not.  It appears that checking the maximum line width is a way to deal with this.

Fixes #466
2018-12-04 15:53:56 +01:00
rdb 301957c591 gobj: improve performance of GeomPrimitive::make_nonindexed()
It now no longer has to create two GeomVertexArrayDataHandle objects for every vertex it visits.
2018-12-04 12:36:03 +01:00
Donny Lawrence 8a0f438156 Get rid of the flickering that occurs on Mojave as a result of changes in the way AppKit handles view layers. 2018-12-03 23:05:05 -05:00
rdb f2f4b4c264 Merge branch 'master' into deploy-ng 2018-12-02 16:26:13 +01:00
Younguk Kim ad8a6b4a88 display: fix pointer casting in get_pointer() 2018-12-02 14:44:40 +09:00
rdb c560c502b9 Merge branch 'master' into deploy-ng 2018-12-01 22:14:01 +01:00
rdb 7ed8b01a84 Merge branch 'input-overhaul' 2018-11-30 22:04:13 +01:00
rdb 585ba2d647 Prepare input API for multipointer support 2018-11-30 20:54:37 +01:00
rdb 29170278e9 device: a few InputDevice API tweaks
find_button() and find_axis() should not error since there is no way to find out whether a button/axis exists or not
2018-11-30 20:54:35 +01:00
rdb 2087d8ee84 device: change InputDevice enums to enum classes 2018-11-30 20:41:06 +01:00
rdb cc08bacec5 cocoa: fix compilation error 2018-11-30 17:13:35 +01:00
David Staer aa750f4046 Fix BulletCapsuleShape creation from Panda CollisionTube
Functions get_point_a() and get_point_b() appear to return the top of the cylinder section of the tube, not the tip of the endcap, making subtracting the radius unnecessary.
2018-11-29 23:24:09 +08:00
rdb d7124d4df4 Merge branch 'master' into deploy-ng 2018-11-29 12:57:49 +01:00
rdb 97d4e32a06 general: use nassert_raise instead of nassertv(false) et al
Even a brief error message in the assertion is infinitely more useful to a user who is not at home in the source code, especially for assertions that may reasonably be triggered by honest user mistakes.
2018-11-28 17:35:20 +01:00
rdb 594e6b394b chan: add various property interfaces to animation system 2018-11-28 16:46:49 +01:00
rdb 69f8f8b7b7 ffmpeg: remove call deprecated in ffmpeg's libavformat 58.9.100 2018-11-28 16:22:27 +01:00
rdb 85cb742f79 ffmpeg: drain avcodec contexts on close, fixes leak
Fixes #398
2018-11-28 16:14:45 +01:00
rdb 32df05b528 Fix crash when unmounting/closing multifile while streams are open
It's not really reasonable to expect a user to find every occurrence of a cached resource that might be using an open stream and remove it or crash otherwise.

This is fixed by keeping the multifile stream open as long as any substreams are still pointing to it, using a simplified reference counting (care is taken not to fully make StreamWrapper reference-counted, since it's not in express and existing uses should not be broken).

Fixes #449
Also see #428
2018-11-27 21:19:38 +01:00
rdb 7ed9655e06 openal: fix leak of sound data when uncache_sound on stream
This is an addendum to cd2ea97b1f (fix for #428) which did
not properly delete the SoundData when uncaching sounds that were loaded as streams.
2018-11-27 21:11:57 +01:00
rdb 5dd0db300b flac: fix leak; properly close stream upon closing FlacAudioCursor 2018-11-27 20:59:51 +01:00
rdb da079c5ffe glxdisplay: remove lock in dtor, which causes crash on shutdown 2018-11-27 17:10:40 +01:00
rdb c427357db9 pnmimage: fix PixelSpec coercion, add PixelSpec unit test 2018-11-27 17:09:40 +01:00
rdb 37d2ff64de putil: add id and pressure fields to PointerData 2018-11-25 23:38:07 +01:00
rdb 26fcf131c9 Merge branch 'master' into input-overhaul 2018-11-25 17:10:31 +01:00
rdb 272f13023e glgsg: unbind buffers after draw callback
Some libraries (eg. Kivy) leave their buffers bound, so this takes care of that.
2018-11-25 16:46:38 +01:00
rdb 7c0a77af78 display: disable depth test before DisplayRegion draw callback
Having depth test disabled is the default OpenGL state, and callbacks may quite reasonably expect to see the default state.  Kivy seems to expect this, for one.
2018-11-24 22:45:41 +01:00
rdb 544ef137ee x11display: fix crash with multithreading and NVIDIA driver 2018-11-24 22:44:55 +01:00
rdb 3f91615a22 glgsg: reset color write mask before calling draw callback 2018-11-23 00:23:52 +01:00
rdb bafb0ac3db x11display: add x-init-threads var to call XInitThreads()
This is off by default, but could be used if you stumble upon a race condition issue with X11 and threading.
2018-11-23 00:22:27 +01:00
rdb 8ad0cb6b57 glgsg: add support for p3d_FragData fragment output
This is necessary for GLSL 1.30 which deprecates gl_FragData but does not yet support layout(location=) specifiers

Also fix some function pointer checks for pre-GL 3.0

Fixes #455
2018-11-22 23:55:54 +01:00
rdb 0a1b6df648 glxdisplay: grab X11 lock around various GLX calls 2018-11-22 23:14:29 +01:00
rdb 254cea63bb display: fix assertion in threaded pipeline 2018-11-22 23:13:58 +01:00
rdb d093cbbb90 grutil: apply FPS meter improvements to scene graph analyzer too
This fixes the aspect ratio scaling issue in particular.

Fixes #456
2018-11-22 23:05:59 +01:00
rdb ec4b0825e9 glgsg: restore more OpenGL state after draw callback 2018-11-20 12:41:43 +01:00
rdb 53cec96c07 Fix draw calls being listed under Primitive Setup in PStats, etc.
Previously, all draw calls would be grouped under "Primitive Setup", rather than under the appropriate bin collector.  This commit fixes that and adds a few other useful collectors as well.
2018-11-20 12:41:30 +01:00
rdb c18cdcf36e display: add support for debug markers, to help with debugging
This is useful when running Panda in a tool like apitrace, so that the different calls in a frame are ordered in a neat hierarchy.
2018-11-20 12:41:20 +01:00
rdb d902ea5ce4 display: don't render window if all its DRs are inactive
This is an optimization, which will skip begin_frame/end_frame for a buffer that isn't going to have anything rendered to it.  Affects the RenderPipeline.
2018-11-20 00:39:44 +01:00
rdb e759a1b605 display: give DisplayRegions a more recognisable name in PStats 2018-11-19 21:01:43 +01:00
rdb 8f73f95e79 display: make PStats clear collectors per-window 2018-11-19 20:02:38 +01:00
Sam Edwards c3d52eeee1 express: Fix compiler error with HAVE_TAR 2018-11-12 17:24:15 -07:00
rdb 3d7fcf2ce9 Merge branch 'master' into deploy-ng 2018-11-12 18:31:43 +01:00
rdb 074c5187b0 Adopt new WindowProperties(size=(x, y), ...) short-hand
This is intended as replacement for WindowProperties.size(x, y), which is deprecated since it conflicts with the `size` property.  See #444.
2018-11-12 17:53:53 +01:00
rdb d62c2bf132 Remove unfinished native COLLADA loader 2018-11-12 12:02:08 +01:00
Sam Edwards a9dfd8352e general: Distinguish local/system includes
This changes includes so that local includes are consistently
#include "localFile.h"
while system and third-party includes are consistently
#include <systemFile.h>

This commit mostly converts the former to the latter; the two
exceptions are in android_main.cxx and fmodAudioSound.h, where
the reverse was necessary.
2018-11-10 18:00:10 -07:00
Sam Edwards 37e265cb63 ode: Delete unused odeHeightFieldGeom.h file 2018-11-10 18:00:07 -07:00
rdb f629a5df1a cocoa: don't enable sRGB unless it was explicitly requested
Fixes #443
2018-11-09 18:25:07 +01:00
Sam Edwards 6c5da232a4 general: Add a couple of missing EXPCLs
Although these aren't used outside of libpanda(express), they
are used by their neighboring component libraries, which means
they should be exported so that this works correctly when the
metalibs feature is disabled.
2018-11-09 00:30:44 -07:00
rdb 6051e6f305 ShaderGenerator: normalize tangent/binormal/normal after interpolation
Also changes l_eye_normal interpolant from float4 to float3.
2018-11-08 15:53:34 +01:00
rdb dfbe728bad glgsg: fix shader point sprites when not using core-only profile 2018-11-08 15:50:44 +01:00
rdb cd2ea97b1f openal: fix issues with uncache_sound not uncaching sound:
* Previously it only looked for the resolved path, but sounds are not stored with resolved path in the cache (possibly a different bug?)
* It only uncached samples, not streams

Fixes #428
2018-11-08 15:38:20 +01:00
rdb cf65010a54 Merge branch 'master' into deploy-ng 2018-11-06 23:40:24 +01:00
rdb 70bfe21a63 Merge branch 'master' into input-overhaul 2018-11-06 22:10:39 +01:00
rdb 98e767c370 fmod: fix FmodAudioSound::get_speaker_mix() 2018-11-06 20:33:56 +01:00
rdb f43bd1a409 gobj: remove use of PY_MAJOR_VERSION in internalName.h
We should not use this symbol in the interrogated headers as it means we cannot reuse the output of interrogate with different versions of Python.
2018-11-06 19:26:25 +01:00
rdb 82459fa21b ode: remove dependency on Python.h from odeBody.h 2018-11-06 19:26:21 +01:00
rdb 49b72fb198 Move Python support code from libp3interrogatedb to generated module
This prevents libp3interrogatedb from having a dependency on the Python library.

See #387
2018-11-06 19:24:37 +01:00
Brian Lach da05ef1f5c glgsg: send fog parameters to GLSL shaders
Closes #438
2018-11-05 22:14:25 +01:00
rdb 23bb814f3f Merge branch 'master' into deploy-ng 2018-11-04 15:26:58 +01:00
rdb 842667fd1a physx: fix missing include
[skip ci]
2018-11-04 15:26:00 +01:00
Sam Edwards 0b91b3eeb3 vrpn: Add VRPN headers to parser-inc, remove CPPPARSER workarounds 2018-11-03 22:51:32 -06:00
Sam Edwards b5bf6cd73c vision: Fix missing includes/declarations 2018-11-03 22:51:28 -06:00
rdb a799bcaec9 Merge branch 'master' into deploy-ng 2018-11-03 22:51:32 +01:00
rdb 5ac3cf3fc6 Eliminate C++ DConfig; replace it with a Python compatibility shim 2018-11-02 23:27:07 +01:00
Sam Edwards a246acc640 windisplay: Undefine Configure before including d3d9.h
This is for consistency with fbbc5bb9e6 which introduced the
same `#undef Configure` in dxgsg9. This prevents dtool's own
Configure() macro from conflicting with the declaration of
D3D9's Configure function in d3d9.h.
2018-11-01 21:52:56 -06:00
rdb c4f5ed308f shader: reduce unnecessary newlines and #line in preprocessed GLSL
This is done by only writing out a #line when the first non-whitespace line is encountered; any blank lines before that are trimmed.  This cuts down the size of the preprocessed shaders for a large project with many shader includes, such as the RenderPipeline.
2018-11-01 23:25:17 +01:00
rdb f4a8e923f7 dxgsg9: fix startup freeze when VRAM is 4GiB or higher 2018-11-01 22:27:28 +01:00
rdb be464b61b3 shader: do not require whitespace around : in #extension directive 2018-11-01 22:27:28 +01:00
rdb bc22f5781b shader: supports preprocessed GLSL shaders in Shader.make()
Fixes #436
2018-11-01 22:27:15 +01:00
rdb 763049ac81 event: fix incorrect include in asyncFuture_ext.h 2018-11-01 17:05:33 +01:00
loblao 604366aaa7 CollisionEntrySorter: Check if entry has surface point
Fixes #435
2018-11-01 16:28:43 +01:00
rdb 14411f592e Remove obsolete .init files in configfiles directories
These look like they were part of some now-defunct Disney tool.
2018-11-01 16:26:07 +01:00
rdb 63484c83cb pipeline: CycleData should always inherit from MemoryBase
We need to guarantee that CData classes are aligned properly, even if DO_PIPELINING is not enabled.
2018-10-31 21:25:31 +01:00
Sam Edwards b45f6fbbed dxgsg9: Remove DirectX 9.1 "detection" code
This method of checking for pnhpast.dll was actually for
DirectX 8.1 (see a16fe56c7) and its presence in the DX9 code
is largely due to the copy-and-paste nature of how the DX9
GSG was created from the DX8 code.
2018-10-29 17:50:22 -06:00
rdb 357b6d3093 Merge branch 'master' into input-overhaul 2018-10-29 23:40:46 +01:00
Sam Edwards 33385facfb dxgsg9: Delete dead dxInput9.{cxx,h} files
This file isn't compiled, and I'm pretty sure never has been
compiled. The dependence on "config_wdxdisplay9.h" (which has
never existed) and absence of any commits that address its
functionality reinforce the idea that this is actually just
dead code.

This seems like an artifact copied over from the DX8 code,
that nobody cared enough to get working or delete.
2018-10-29 16:05:59 -06:00
rdb 54b3474670 Merge branch 'master' into deploy-ng 2018-10-28 20:47:36 +01:00
rdb ed96a52703 cocoa: cautiously enable sRGB framebuffers on macOS
[skip ci]
2018-10-28 20:41:14 +01:00
rdb afc994b2fb display: fix crash when removing DisplayRegion in pipelined render
Maybe not a perfect solution; we should consider keeping the DisplayRegions around until they have gone through the entire pipeline.

Fixes #427
2018-10-28 11:48:05 +01:00
rdb e5c3ce1995 pipeline: fix missing symbols for CycleDataLockedReader 2018-10-28 11:44:24 +01:00
TLOPOOperations 35d095c2cf GSG: Fix symbol name conflict 2018-10-28 11:43:19 +01:00
rdb fb52a8e15e text: fix deadlock in TextNode::write
Fixes #431
2018-10-28 11:41:05 +01:00
Sam Edwards b8b86dc2f2 glesgsg: Only use the iOS GLES framework when "BUILD_IPHONE" is defined 2018-10-27 19:42:36 -06:00
Mitchell Stokes b16f9f8f4f Merge branch 'master' into deploy-ng 2018-10-18 17:58:21 -07:00
rdb df77bacf06 makepanda: compile graphicsStateGuardian.cxx separately, earlier
Since this still takes a long time to build, even with the previous change, it would be better for one CPU to chew on this in the background while the rest of the build continues.
2018-10-19 00:37:00 +02:00
rdb 175d7ff56b display: significantly decrease p3display_composite2 compile time
This applies to building with MSVC and Eigen specifically.  Apparently, fetch_specified_part is taking up most of the compile time here.  I have no idea why these changes in particular make it faster, but they just do.
2018-10-19 00:30:14 +02:00
rdb 30f1c8ba92 display: slight cleanup of graphicsPipeSelection.cxx
This seemed to halve the compile time of this file under MSVC.
2018-10-19 00:12:53 +02:00
rdb f35c9e5d79 chan: adjust _net_blend when AnimControl destructs 2018-10-18 22:03:16 +02:00
rdb 2cd5a04f3f pipeline: fix compiler error on older versions of GCC 2018-10-17 19:54:29 +02:00
rdb a05e928a75 chan: fix crash in certain cases after AnimControl destruction 2018-10-17 19:44:39 +02:00
rdb eac88fc64a chan: disable AnimControl copy ctor and assignment operators 2018-10-17 19:43:41 +02:00
rdb 775e4cecff pgraph: fix freeze in garbage_collect(), esp. when rate-limit is on 2018-10-17 19:09:36 +02:00
rdb 6488e46cc7 Fix errors when building with --override DO_PIPELINING=UNDEF 2018-10-17 17:33:27 +02:00
rdb 90c13cbd4e glgsg: fix error downloading texture with WM_repeat 2018-10-17 17:32:19 +02:00
rdb bea15cd39a pgraph: fix crash when cull_callback modifies node in some way 2018-10-17 17:29:30 +02:00
rdb 9da335ac42 Merge branch 'master' into deploy-ng 2018-10-16 23:02:19 +02:00
rdb 90cc8fe385 Fix building with SIMPLE_THREADS=1 2018-10-16 22:15:36 +02:00
rdb 88b0f3327d Warning fixes and cleanups when building with SIMPLE_THREADS 2018-10-16 21:32:42 +02:00
rdb 0c9c698d13 pipeline: make BlockerSimple constexpr (needed by MutexSimpleImpl) 2018-10-16 21:18:02 +02:00
rdb fbf939141b gobj: fix typo causing crash when preparing shader 2018-10-16 21:13:27 +02:00
rdb b569875bf9 windisplay: fix window size changing when switching undecorated 2018-10-16 16:31:46 +02:00
rdb bfeb5060b8 gobj: don't create pointless future in TextureReloadRequest 2018-10-16 15:23:52 +02:00
rdb 75826c9a51 glgsg: fix error with multisampled float depth buffer
Fixes #416
2018-10-16 15:20:45 +02:00
rdb dd50d7d206 Merge branch 'master' into deploy-ng 2018-10-16 12:37:32 +02:00
rdb bcc2e3e404 gobj: add Geom::get_animated_vertex_data() short-hand
This is a method for getting the animated vertex data that will keep working even if GeomVertexData::animate_vertices() gets deprecated due to #421 being fixed.
2018-10-15 22:13:21 +02:00
rdb 0131d1013b gobj: fix assert when enabling hw anim if blend has 5+ transforms
Instead, we reduce the TransformBlend down to the 4 most-weighted joints.
2018-10-15 22:07:32 +02:00
rdb 6e370ebbdd gobj: speed up GeomVertexData::get_num_rows() considerably 2018-10-15 22:06:04 +02:00
rdb c28045990c Merge branch 'master' into deploy-ng 2018-10-15 15:42:48 +02:00
rdb 70f4c1cd4e glgsg: change missing Cg attrib error message to debug
This can occur if a variable is optimized out by the GLSL compiler but not by the Cg compiler.  So it should not be reported as an error.

Fixes #417
2018-10-15 14:09:39 +02:00
Sam Edwards 2d80d6d063 general: Add missing includes and remove deprecated type
Credit for missing includes to @treamology in Git commit
16cfac4829

CGTableCount removed; modern macOS seems to call this
a uint32_t instead. I can find no reference to CGTableCount
in any documentation, and the (very old) source code I dig
up just typedefs it anyway.
2018-10-14 15:50:06 -06:00
Sam Edwards 602ea6ebf4 general: Fix a couple more compiler warnings
- express: Fix a warning when compiling for debug

- dtoolutil: Give TextEncoder a virtual destructor
2018-10-13 16:14:34 -06:00
Sam Edwards 84ed19e8a7 display: Add two missing includes
(lightAttrib.h and materialAttrib.h)
2018-10-12 21:49:49 -06:00
Sam Edwards 6f62396373 general: Resolve a few compiler warnings
- display: GraphicsWindowProc should have a virtual destructor,
           as it's meant to be subclassed.

- express: set_matrix_view helper should always fail an assert
           when 'size' is wrong, even on release builds.

- express: Fix filename capitalization on some #includes.
           They're normally Windows-only, where case doesn't
           matter, but it's better to be consistent.

- gobj: Fix typo.

- particlesystem: Remove BaseParticle::_last_position.
                  Last position is tracked by PhysicsObject now.

- windisplay: Heed warnings about casting bool to (PVOID).
              Also, per MSDN docs, SPI_SETMOUSETRAILS uses the
              uiParam argument and ignores pvParam, so pass the
              _saved_mouse_trails value in that way.
2018-10-12 15:37:40 -06:00
rdb 7bd8cbdeb6 windisplay: allow changing undecorated/fixed_size after window open
Fixes #405
2018-10-08 23:20:04 +02:00
rdb 9061fd9416 dtoolutil: fix TextEncoder methods for Python 3
The no-arguments get_text() and set_text() will now return Unicode strings in Python 3, but passing in an encoding will make them return/take bytes objects.

In Python 2, they all take regular strings, but Unicode is also accepted by the no-argument get_text() and set_text().

In the future we probably want to remove most of this interface for Python users, to whom all this is unnecessary since it duplicates functionality already in the standard library.
2018-10-08 22:14:51 +02:00
rdb 96860b88e0 dxgsg9: fix problems with window without depth buffer 2018-10-08 22:11:55 +02:00
rdb 93a3e7e699 Changes to make ColorAttrib behavior more consistent:
- T_off now actually properly disables vertex colours
- T_vertex is now the default, to preserve the previous behaviour
- ShaderGenerator behavior is now the same as in the FFP
- tests are updated to verify new behavior
- tests now properly use vertex colours, previously they accidentally only used flat colors
- With color-scale-via-lighting off and no color scale, color is no longer munged
- p3d_Color in GLSL shaders is now properly set to white instead of black with T_off mode
- In DX9 shaders will now sample white color for absent or disabled vertex color

Fixes #401
Also see #371
2018-10-08 22:09:22 +02:00
rdb ada3fa5513 Compile fixes on input-overhaul branch 2018-10-08 01:44:17 +02:00
rdb 14042faa3d Merge branch 'master' into input-overhaul 2018-10-08 01:25:33 +02:00
rdb 80951b3268 task: provide more properties on AsyncTask 2018-10-07 23:02:50 +02:00
rdb 51414466da display: ignore material if no lights are applied
This fixes materials suddenly showing up when a color scale is applied and color-scale-via-lighting is set.

Fixes #404
2018-10-07 22:52:49 +02:00
rdb e1af4abf11 glgsg: fix sRGB for FBOs created from non-sRGB host window
In this case _current_properties in begin_frame() will not have srgb_color set, as the current props are set by the host window
2018-10-07 21:42:23 +02:00
rdb b0c9000000 display: fix assert when app exits before window fully opens
Possibly addressing #403
2018-10-07 21:41:02 +02:00
rdb 9618cd2193 device: ensure libputil is initialized before scanning devices 2018-10-07 21:06:24 +02:00
rdb 4b77812b35 device: fix inverted flight stick throttle on Linux 2018-10-07 20:49:13 +02:00
rdb f518b9aaf1 device: fixes to sporadic device class detection on Linux 2018-10-07 20:48:39 +02:00
Sam Edwards 51497da8fb movies: Fix missing include 2018-10-07 01:36:43 -06:00
Sam Edwards 87d1048f79 mathutil: mersenne.h parameters should not be an enum
This makes no sense as an enum; they're constants, so
they should be static const.
2018-09-30 16:05:39 -06:00
rdb 85752b06f5 device: delete InputDevice copy ctor / assign operator 2018-09-28 17:32:38 +02:00
rdb 9b85a28861 putil: rename MouseData to PointerData to be more inclusive 2018-09-28 17:18:38 +02:00
rdb 3ffe11485d Merge branch 'master' into input-overhaul 2018-09-28 15:12:49 +02:00
rdb 183d66a5c2 pipeline: fix compiler warning due to PAUSE symbol redefined 2018-09-28 14:20:47 +02:00
rdb fac82e6dca pgraph: fix precision issues with Color(Scale)Attrib quantization 2018-09-28 13:19:36 +02:00
rdb 5ae38a8a92 Fix crash loading from search path
Possible fix for #395
2018-09-27 22:16:56 +02:00
rdb a099c85245 ShaderGenerator: fix broken handling of CO_undefined alpha operand
Fixes #394
2018-09-25 21:19:30 +02:00
rdb cd033c27e8 grutil: add thread safety to ShaderTerrainMesh 2018-09-25 21:00:08 +02:00
rdb 1e084e0b2b text: add thread safety to TextNode
This does not 100% cover all the base class TextProperties, however, so you still need to be careful not to access those from two threads at once.
2018-09-25 11:35:16 +02:00
rdb 5457d76b94 text: slight perf improvement for TextNode card/frame generation 2018-09-25 11:08:22 +02:00
rdb 3ac50a2347 movies: fix crash on simultaneous threaded audio/video load 2018-09-23 14:22:41 +02:00
Sam Edwards b64e850539 egg(2pg): Fix missing EXPCL_PANDA_EGG(2PG) 2018-09-21 18:26:13 -06:00
Younguk Kim ba9ea8ea27 chan: add missing export macro 2018-09-21 19:49:21 -04:00
rdb 338b428e65 Merge branch 'master' into deploy-ng 2018-09-17 17:37:07 +02:00
rdb 8edc019307 device: overhaul InputDevice API:
- Rename "controls" terminology for analog inputs to "axes"
- Change some naming of accessors
- Unexpose methods where they are available as properties
- Add serial_number field
- Put battery levels under a "battery" field
2018-09-16 20:22:22 +02:00
rdb 8d8c5a546d input: rename "action_x" button handles to "face_x" 2018-09-16 14:50:00 +02:00
rdb e30b597926 Merge branch 'master' into input-overhaul 2018-09-16 12:28:22 +02:00
rdb 3417b9df09 egg: work around compiler bug in Visual Studio 2017
Fixes #379
2018-09-13 21:14:04 +02:00
rdb ecb2b6f546 movies: forbid automatic coercion from string to MovieAudio
This was causing issues in the unit test when calling audiomgr.get_sound() with string.
2018-09-13 21:14:05 +02:00
rdb 47496068d3 Show materials with only base color applied properly 2018-09-09 20:56:37 +02:00
rdb b183e99692 gobj: fix bug printing Material base color 2018-09-09 20:23:48 +02:00
rdb 11ecd3af87 putil: make ButtonHandle::none() constexpr 2018-09-04 12:58:48 +02:00
rdb 809f9b04f6 Fix problems with spinlock mutex/cvar implementation
This reimplements the spinlock on top of std::atomic_flag, which is guaranteed to be lockless.  It also inserts the PAUSE (REP NOP) instruction which is strongly recommended to be placed in busy-wait loops by Intel.

This also includes a recursive spinlock implementation.

The spinlock implementation is disabled by default, but can be enabled by adding the --override MUTEX_SPINLOCK=1 flag to makepanda.
2018-09-04 12:58:48 +02:00
rdb cf4f8b35b6 pgui: fix deadlock in PGScrollFrame/PGSliderBar 2018-09-04 12:58:37 +02:00
rdb 217cecb77f pgui: remove some unnecessary reentrant locking in PGItem 2018-09-04 12:02:13 +02:00
Sam Edwards e13a4d6539 pstatclient: Never pass nullptr to memcpy
Even though the only time this happened was when the size was 0,
it's still undefined to pass memcpy a nullptr.
2018-09-03 16:10:40 -06:00
Sam Edwards 5f72e9c763 bullet: Fix misplaced INLINE getter 2018-09-02 16:04:33 -06:00
Sam Edwards 8c09477e37 bullet: Add missing includes and declarations for non-composite build 2018-09-02 16:04:25 -06:00
rdb 17bf50f1e8 audio: get_sound and uncache_sound should take Filename, not string 2018-09-02 20:55:58 +02:00
rdb 845ec7a990 cull: don't munge_points_to_quads if shader handles point size 2018-09-02 20:55:18 +02:00
rdb b1f32e3f84 shader: reserve SL_SPIR_V ShaderLanguage value (as on vulkan branch) 2018-09-02 12:00:30 +02:00
rdb 9dec2aafb5 Fix static init ordering crashes in static build of pview
Fixes #381
2018-09-02 10:59:46 +02:00
rdb 3495537bf9 gobj: support clearing half-float textures
Fixes #374
2018-09-02 10:58:02 +02:00
rdb c670cd45d9 gobj: handle infinity and NaN when peeking half float values 2018-09-02 10:56:20 +02:00
rdb c4fe1ed883 gobj: slight refactor of Texture::do_get_clear_data() 2018-09-02 10:54:07 +02:00
Sam Edwards 4695557a5d general: Don't require BUILDING_* for static builds 2018-08-31 23:54:32 -06:00
rdb 7cc100c38c device: change ControlAxis enum to an Axis enum class 2018-08-26 21:18:29 +02:00
rdb aae2b1e5ad putil: fix a compiler warning 2018-08-26 21:18:11 +02:00
rdb 1d6c3f6486 Merge branch 'master' into input-overhaul 2018-08-26 19:03:21 +02:00
rdb 115f8df4d5 putil: work around GCC bug causing undefined reference in debug build 2018-08-26 14:03:44 +02:00
rdb c9372c3699 Fix a few GCC compile warnings 2018-08-26 14:02:33 +02:00
rdb 57b66ebeaf Merge branch 'master' into deploy-ng 2018-08-20 19:13:04 +02:00
Mitchell Stokes f663d215d5 Remove some unused variables 2018-08-19 16:55:07 +02:00
rdb 371c34d13b linmath: allow constructing matrix from rows
This also enables using mat[n] wherever an LVecBase4 is accepted, as well as Mat4(*mat).
2018-08-19 16:42:36 +02:00
rdb b1d2111037 express: add Datagram add_blob and add_blob32, et al.
This is for writing Python 2/3 agnostic code for writing binary data to a datagram, and reading from it using DatagramIterator.
2018-08-19 16:01:39 +02:00
rdb 74442e41f1 express: slight Datagram constructor cleanup 2018-08-19 14:21:23 +02:00
rdb ba345d590f express: make Datagram.get_message() return bytes in Python 3
This is done using a Python extension function, which also happens to make the call more efficient as this avoids an extra copy.  The C++ version still returns std::string as there is still a lot of C++ code that relies on that.

Fixes #297
2018-08-19 13:40:58 +02:00
Sam Edwards 06f7da5215 express: Fix misclassified EXPCL_PANDA_ macro 2018-08-14 21:58:11 -06:00
Sam Edwards 6105953b40 general: Add forgotten include 2018-08-14 17:23:56 -06:00
Mitchell Stokes 49c47164ff Merge remote-tracking branch 'origin/master' into deploy-ng 2018-08-12 19:58:15 -07:00
rdb 72e593800f gobj: don't recalculate proj mat on set_near/far with existing value 2018-08-12 22:06:13 +02:00
rdb 54ec575472 egg: add properties to EggData / EggNode 2018-08-12 22:05:25 +02:00
deflected eb0f753a3c x11display: fix loading cursor from compressed/encrypted stream 2018-08-08 21:54:58 +02:00
rdb 433f734d43 mathutil: BoundingPlane improvements 2018-08-08 21:54:52 +02:00
rdb 2556d006f7 glgsg: a few version check tweaks 2018-08-05 13:09:25 +02:00
rdb 8348f16665 glgsg: fix incorrect behavior if mat has either ambient or diffuse
This might have only been an issue in some drivers (not sure, spec is a bit vague here).
Apparently we need to call glMaterial *after* the color material setting has been disabled for it to stick.

Fixes #369
2018-08-05 12:54:32 +02:00
rdb 60468b0bec ShaderGenerator: additional case where vtx_color isn't needed
See sample code in a comment in #370
2018-08-05 12:49:03 +02:00
rdb b836a60adb cull: remove unused variable declarations 2018-08-03 22:59:04 +02:00
rdb 929808b867 ShaderGenerator: fix regression with flat colors 2018-08-03 22:58:29 +02:00
rdb 8806dedb51 ShaderGenerator: avoid writing vtx_color input if unneeded 2018-08-03 22:24:48 +02:00
rdb 9ba2d7242e gobj: get rid of enforce-attrib-lock, just DTRT instead
This setting causes asserts when modifying certain material flags after they are assigned to a node, in case a shader has been generated that uses the materials, which cannot efficiently detect whether the material has changed.  However, we already sort of have a (inefficient, but effective) solution for this in TextureStage (see #178) that we could just apply here as well: changing the material attributes after such a shader has been generated could call GraphicsStateGuardianBase::mark_rehash_generated_shaders().

In the future, we should replace the material model with one that does not require shader regeneration for such seemingly trivial property changes.

Fixes #370
2018-08-03 21:55:06 +02:00
rdb 7e290b221b Remove a few unused and obsolete C++ test files 2018-08-03 21:09:36 +02:00
rdb 668a093c26 gobj: try to fix some deadlocks modifying geometry while rendering
The correct locking order should be: the Geom's GeomVertexArrayData first, *then* the GeomPrimitive.
2018-08-03 20:45:29 +02:00
rdb 0cd69c8748 gobj: fix TexturePool ambiguity when loading tex with other settings
Previously, if you called load_texture a second time with different parameters (such as an alpha filename), you would still get the old texture.
2018-07-31 14:56:04 +02:00
rdb fe1bfef5c0 express: fix a few compile errors with certain WeakPointerTo uses
Fixes #367
2018-07-31 14:02:58 +02:00
rdb 4e42c4c941 nativenet: fix interrogate error recognizing sockaddr types 2018-07-31 11:08:14 +02:00
Mitchell Stokes 247575df62 CoordinateSystem: Document enumerators 2018-07-30 21:26:50 -07:00
rdb 91b01e5621 collide: add tube-into-box collision test 2018-07-30 22:37:02 +02:00
rdb 243ee75e47 express: refactor WeakPointerTo::lock() a little bit 2018-07-30 22:24:55 +02:00
rdb ad3ab3ad21 Define stable ordering for WeakPointerTo for use as map/set key
Currently, the WeakPointerTo comparison operators compare the raw pointers, but this is not useful as it may cause a false equality if one weak pointer in the comparison is expired and points to memory that has since been reused.

Instead, we can define a comparison based on the control block pointer, which exists since the new weak pointer implementation in 0bb81a43c9.  This is implemented in the owner_before method, matching C++11 std::weak_ptr semantics.

I would now recommend deprecating most comparison operators of WeakPointerTo or redefining them to make more sense, ie. comparing equal if they (once) referred to the same object and not if they simply point to the same memory address.  This has not yet been done, though code that uses the comparison operators has been fixed in this commit.

Overloads of std::owner_less have been provided for creating a map or set with Weak(Const)PointerTo keys.
2018-07-30 17:27:09 +02:00
rdb 2d7e80a89e express: add full range of WeakPointerTo ctors and assign ops
Matches PointerTo constructors/assignment operators, supporting conversion between related pointer types.

Fixes #367
2018-07-30 17:26:02 +02:00
rdb 0cb763a10a ShaderGenerator: always use generic attr on Linux
48808fe269 disabled this on Linux, but I believe this was an accidental change.
2018-07-26 22:58:15 +02:00
rdb 02b32a5814 glgsg: support vertices-float64 in core profile shaders
Requires OpenGL 4.1 or GL_ARB_vertex_attrib_64bit extension.
2018-07-26 22:58:15 +02:00
rdb 0f4168a304 text: use 64-bit coords in TextAssembler if vertices-float64 set 2018-07-26 22:58:07 +02:00
rdb d081b4d420 mathutil: override plane.normalize() to be meaningful for planes
Now it only divides by the length of the normal, rather than also adding in the square of the w component.
2018-07-26 22:08:37 +02:00
rdb c634c455fd framework: add zero-argument version of open_framework() 2018-07-26 22:08:37 +02:00
rdb ecfeae8a27 shader: support double-precision vertex columns in GLSL 2018-07-26 22:07:20 +02:00
rdb 7fe72c47f3 glgsg: update copy of glext.h 2018-07-23 09:02:12 +02:00
rdb 1a6d329fde gobj: support T_unsigned_int_24_8 in TexturePeeker 2018-07-23 08:32:58 +02:00
rdb f45fa747d1 x11display: fix BadWindow if get_pointer called after win close 2018-07-17 23:01:44 +02:00
rdb bbb15631c6 mathutil: support infinite near/far in LFrustum
I don't know if anyone is using LFrustum, but just in case, it's good to support this corner case.
2018-07-17 23:00:57 +02:00
rdb cf240d95c1 gobj: support infinite near distance in PerspectiveLens
Useful when rendering with near/far planes flipped around.
2018-07-17 22:59:54 +02:00
rdb 359ce3e9ef glgsg: fix error with glObjectLabel and SSBO 2018-07-17 22:59:23 +02:00
rdb b5194d9ff2 glgsg: pad SSBOs to 16 byte boundary (required by some drivers) 2018-07-17 22:59:15 +02:00
rdb 06539f5c66 glsl: support passing uint variables to shader 2018-07-17 22:32:34 +02:00
rdb 911a549386 collide: add tube-into-tube collision test 2018-07-17 22:30:06 +02:00
rdb 71b4b807f8 collide: add line-into-box test, improve segment/ray into box 2018-07-17 22:24:35 +02:00
rdb 6cd59807dd Remove useless test_display.cxx file 2018-07-17 19:38:10 +02:00
rdb 799f0b4f78 glgsg: work around driver bug extracting buffer texture data
Some drivers would report the wrong internal format.  But it's silly that we query the internal format anyway, since buffer textures have a fixed sized internal format.
2018-07-17 17:04:50 +02:00
Mitchell Stokes e4cf73378c Merge remote-tracking branch 'origin/master' into deploy-ng 2018-07-15 14:38:05 -07:00
Mitchell Stokes c33ae8a95f Merge branch 'master' into deploy-ng 2018-07-15 12:42:51 -07:00
rdb 61084a3f4e pgraph: work around C++11 bug in something or other (see #355) 2018-07-12 14:24:40 +02:00
rdb 10fe8659c6 gobj: work around a deadlock in GeomCacheManager::flush() 2018-07-12 14:22:27 +02:00
rdb e41eeaae23 glgsg: if 32-bit unorm depth is not available, fallback to float
This prevents falling back to 24-bit depth if 32-bit depth is requested.
2018-07-12 14:17:02 +02:00
rdb 828233a8f2 glgsg: support gl-depth-zero-to-one to get same NDC Z range as D3D 2018-07-12 14:13:32 +02:00
rdb 16daf08e42 glgsg: fix some GCC warning messages 2018-07-11 13:33:50 +02:00
rdb ff3d005230 x11display: fix Xlib thread safety problems 2018-07-11 13:33:21 +02:00
rdb 55146b9f82 dxgsg9: fix compilation error with WeakPointerTo comparison 2018-07-09 17:09:11 +02:00
rdb fbce833aae pgui: reduce unnecessary locking in PGItem
A deadlock has been observed if the lock is held while traversing the scene graph, so the need for locking in cull_callback is now reduced.
2018-07-09 16:13:01 +02:00
rdb abe20fc489 fmod: return NullAudioSound if file does not exist
This matches the OpenAL behaviour, and is needed to fix the unit tests on macOS.
2018-07-08 21:49:37 +02:00
rdb c6ed4e1836 general: don't cast to regular pointer when returning a PointerTo
This is inefficient because it induces an unnecessary ref()/unref() pair when we just need to move the pointer out of the function.  Thanks to 23128e4695, we can now move between related pointer types, making the .p() hack unnecessary.
2018-07-08 21:40:58 +02:00
rdb 23128e4695 express: support casting between compatible PointerTo types
This makes it possible to implicitly convert a PT of a derived type to a (C)PT of a base type, without needing to first convert it to a regular pointer.  This also applies to moves, which are now more efficient due to the lack of need for ref/unref pair even if the pointer type is not exactly the same.
2018-07-08 21:33:49 +02:00
rdb 409231d214 express: make WeakPointerTo cast operators explicit
This prevents accidentally (and unsafely) decaying a WeakPointerTo to a regular pointer.
2018-07-08 21:25:08 +02:00
rdb fb82a1c557 express: enable WeakPointerToBase comparison operators on Win32
I'm not sure why they were ifdeffed out, but they should certainly be available so that it is possible to compare WeakPointerTo in a thread-safe manner.
2018-07-08 21:22:25 +02:00
rdb 269d154aea chan: fix thread-unsafe access of WeakPointerTo 2018-07-08 21:15:40 +02:00
rdb eda47c7f3b bullet: support Plane class in BulletPlaneShape 2018-07-08 21:13:13 +02:00
rdb 835a895c51 windisplay: don't adjust in_window during get_pointer
This restores the old behaviour from before 29a08932ea, which makes in_window true during pointer capture (ie. click-and-drag) even if the cursor leaves the window.

X11 behaviour is already not to adjust in_window.

Fixes #363
2018-07-07 22:55:45 +02:00
Brian Lach fd227f6492 bullet: allow creation of BulletCapsuleShape from CollisionTube 2018-07-06 13:31:00 -04:00
rdb d4d582484f display: fix ability to make screenshots in multithreaded pipeline
Problem is that WGL is strict about binding context in different thread while it is still bound in another thread.  Either way we need to make sure the draw thread is not rendering, so if you call get_screenshot() from a thread other than the draw thread, it uses the GraphicsEngine to wait until the draw thread is idle and then asks it to do the get_screenshot().

Fixes #360
2018-07-05 19:02:37 +02:00
rdb b85fead09d wgldisplay: report context binding error, keep track of thread
This isn't really a complete solution, just a stopgap measure to prevent a crash.
2018-07-05 17:55:39 +02:00
rdb 5fe294a467 bullet: prevent softbody with AABB out of bounds from asserting
See #357
2018-07-05 12:48:11 +02:00
rdb 96a48a6848 glgsg: fix issue with extract_texture_data and buffer textures
It would always extract the last-created buffer texture, not the texture in question.
2018-07-04 20:56:07 +02:00
rdb 00888518fe gobj: add F_r32i and F_r32 to TexturePeeker 2018-07-04 20:31:08 +02:00
rdb f2976b03ec gobj: add alignment support and move semantics to SimpleAllocator 2018-07-02 12:55:18 +02:00
rdb f5a78d599d putil: make LinkedListNode moveable 2018-06-30 21:38:45 +02:00
rdb 94cbdc563b general: fix a few more compiler warnings 2018-06-30 17:19:23 +02:00
rdb 11723b27ee device: various warning fixes for input-overhaul on Linux 2018-06-23 23:30:44 +02:00
rdb 234fd675b1 Merge branch 'master' into input-overhaul 2018-06-23 23:24:09 +02:00
David Carlsson 371e60c768 bullet: Change the b2p sync-order to allow parenting BulletWheels to a BulletVehicle
Parenting a BulletVehicle's wheels to the chassis-BulletRigidBodyNode now works as expected. Previously doing this would make the wheels appear to be positioned one frame ahead of the chassis, because the wheel's position were synced before the chassis' position.

For more information see issue #250.

Closes #349
2018-06-23 00:02:10 +02:00
David Carlsson c18abad8c3 bullet: Interpolate BulletVehicle-wheel transform before syncing it to panda
Bullet automatically interpolate most bodies for us (for example the "chassis"
of a BulletVehicle), but BulletVehicle-wheels must be manually interpolated by
calling 'updateWheelTransform()'. Otherwise they will slowly rubber-band
between their intended position and a position one frame ahead in time.

For more information see issue #250.
2018-06-23 00:01:41 +02:00
rdb 29a08932ea display: improve mouselook smoothness significantly, esp if low FPS
This problem occurs when movePointer is used to reset the mouse back to the center every frame, a very common way to implement mouselook on Windows (which has no relative mouse mode).  Any movement between the last event loop run and the call to movePointer is destroyed, resulting in quite choppy mouselook in most implementations.

The solution is for getPointer to always return the latest mouse cursor position.  This goes a long way but is not 100% perfect; see the discussion in #359 for other solutions.

Fixes #359
2018-06-22 23:58:56 +02:00
rdb 927fcda817 shader: fix shader newline error with Intel drivers
It appears that Intel drivers always need a newline at the end of the file.
2018-06-22 20:53:56 +02:00
rdb 582cc2991e pipeline: add TypeHandle for CycleData if DO_PIPELINING is set
This helps to identify CycleData when tracking memory usage via MemoryUsage.
2018-06-22 20:52:44 +02:00
rdb b0bbc66f06 bullet: document that sweep_test_closest is convex-only in API ref
Closes #356
2018-06-19 00:37:29 +02:00
rdb 886e1c2f16 general: fix many compilation warnings in GCC 8 2018-06-19 00:37:28 +02:00
rdb 835aab5424 physx: fix compiler errors 2018-06-15 18:05:41 +02:00
rdb d48695cb2e glgsg: fix occasional WeakPointerTo dereference 2018-06-14 22:51:35 +02:00
rdb 19e1b1d877 pgraph: add version of RenderState::get_attrib(_def) taking a CPT 2018-06-14 22:51:12 +02:00
rdb f804b10d45 Fix more compiler warnings 2018-06-14 22:49:45 +02:00
rdb 83f637ea9f ffmpeg: fix compilation for older FFMpeg versions 2018-06-14 19:00:13 +02:00
rdb c1fbeaea51 display: allow full access to all 4 of each aux buffer category
I think there was some confusion about how set_aux_rgba (and friends) worked; it seems the original intent was to toggle each individual buffer whereas it is actually interpreted as a count of how many of these buffers should be enabled.  We should try to clarify the API and/or replace it with something better as soon as possible.
2018-06-14 16:08:33 +02:00
Sam Edwards b2bfb31114 general: Remove `using std::*` from headers
Also remove most `using namespace std;` statements. The only one that remains is in py_panda.h.

Closes #350
Closes #335
2018-06-14 16:04:49 +02:00
rdb d284cedbea movies/ffmpeg: support grayscale and grayscale-alpha videos
Fixes #352
2018-06-14 14:22:56 +02:00
rdb 9231694f8f gobj: fix Python 3 support for GVADHandle::get_(sub)data/set_(sub)data
That said, you should really be using the buffer protocol; you can create a memoryview() directly around the GeomVertexArrayData.
2018-06-14 14:11:34 +02:00
Younguk Kim d22da73a4c Fix macro redefinition warning 2018-06-14 09:33:19 +09:00
Sam Edwards 69d5fcf3b0 pgraph: Fix use of incomplete GeomNode in PT(GeomNode) 2018-06-12 16:18:15 -06:00
Sam Edwards a971bc1dfc general: Break apart BUILDING_PANDAGL 2018-06-12 16:15:45 -06:00
Sam Edwards 768f78306a general: Break apart BUILDING_PANDAEGG 2018-06-12 16:15:25 -06:00
Sam Edwards e73c25d15e general: Break apart BUILDING_PANDAPHYSICS 2018-06-12 16:15:04 -06:00
Sam Edwards 7e61891c09 general: Fix more DLL linkage and EXPCL_PANDA_ macros 2018-06-12 16:14:33 -06:00
rdb eab8b1c7a3 tform: MouseWatcher sort should uniquify duplicates
Also change the code to use range-for when appropriate, which improves code readability.
2018-06-12 13:44:24 +02:00
rdb 65217a258d tform: allow calling MouseWatcher::add_region with same region twice
Previously, this was an error.  Now, it will simply silently be ignored, making it behave more like a set.
2018-06-12 12:45:48 +02:00
rdb b88bd99704 Various compiler warning fixes 2018-06-12 12:38:07 +02:00
rdb 494ba40c5e Fix compilation error on Android 2018-06-11 14:35:37 +02:00
Sam Edwards bc596797a3 general: Resolve some warnings unique to Windows 2018-06-10 02:25:10 -06:00
Sam Edwards 3c6ebb56bd general: pvector<unsigned char> -> vector_uchar 2018-06-10 02:25:10 -06:00
Sam Edwards f1eb811c0e general: Break apart BUILDING_PANDAEXPRESS 2018-06-10 01:37:31 -06:00
Sam Edwards b8bc1bb5e9 gobj: Include, don't forward-declare, BamCacheRecord in shader.h
Closes #346
2018-06-10 01:37:13 -06:00
rdb ba2de46beb Merge branch 'master' into input-overhaul 2018-06-08 15:23:47 +02:00
Sam Edwards 7790f8429d general: Fully qualify header references into the std namespace
Closes #341
2018-06-07 10:35:12 +02:00
rdb b7f8ddfe35 dxgsg9: fix type mismatch in min() call 2018-06-07 10:34:47 +02:00
rdb 8a9d83b604 physx: fix compile error 2018-06-04 17:28:13 +02:00
rdb be282627a8 express: make PointerTo directly initializable from nullptr 2018-06-04 11:21:18 +02:00
Sam Edwards f0fc6e6d56 express: Fully qualify std::nullptr_t 2018-06-03 16:56:53 -06:00
Sam Edwards 5e82671084 general: Do away with TYPENAME macro 2018-06-03 16:36:34 -06:00
Sam Edwards e2b4353800 general: Replace NULL (and 0 as pointer) with C++11 nullptr
Exceptions to this replacement are:
- .c files
- Headers included by a .c file
- stb_image.h
- dr_flac.h
- Strings
- Comments
2018-06-03 16:35:13 -06:00
Sam Edwards 92d2f5e195 general: Don't use NULL where not appropriate 2018-06-03 16:31:01 -06:00
Sam Edwards d422d74abb general: Clean up asserts which were abusing NULL 2018-06-03 16:26:44 -06:00
Sam Edwards ebe1b0763f express: Allow WeakPointer comparisons to nullptr
This saves us from having to do casts like:
if (foo == (const FooType *)nullptr) {
  ...
}
2018-06-03 16:26:44 -06:00
rdb 57602d750f cocoadisplay: don't crash if window/buffer fails to open 2018-06-03 22:35:37 +02:00
rdb eb960669a5 display: fix assert when window fails to open
The assert is being triggered because the window is already being removed in open_windows.  It does not really matter if it returns false anyway, as long as the window is removed one way or another.
2018-06-03 22:33:59 +02:00
rdb c08339e8ce ShaderGenerator: fix error with normal map and only ambient light
Closes #331
2018-06-03 22:30:40 +02:00
rdb e0245d2777 First step towards eliminating `using namespace std;` (#335) 2018-06-03 20:32:23 +02:00
rdb 298147bb39 Give several additional classes constexpr constructors
This is useful because these types are created at static init time, and giving them a constexpr constructor and trivial destructor lets them be created during constant initialization, which helps to prevent static init ordering issues.
2018-06-03 10:45:58 -04:00
rdb 21d8c29645 More warning fixes 2018-06-03 06:45:35 -04:00
rdb 213ae6b029 Change some .T files to new docstring style that were missed 2018-06-01 20:44:30 +02:00
Sam Edwards 159b43e563 general: Address a few more compiler warnings 2018-06-01 02:54:13 -06:00
rdb 283d43f988 putil: workaround macOS 10.6 compile error until #300 is fixed
[skip ci]
2018-05-30 23:29:59 +02:00
rdb 190c553c57 dtool_config.h: remove some macros for ancient C++ compilers 2018-05-30 23:15:24 +02:00
rdb aa1b06f132 putil: make BitMask et al literal types 2018-05-30 23:04:43 +02:00
rdb db5dd98d33 general: further warning fixes, use -Wno-unused-variable if NDEBUG
Disabling unused variable checking is needed in NDEBUG builds because of the heavy use of temporary variables in asserts.
2018-05-30 22:51:04 +02:00
rdb 6b726fa697 general: fix various compiler warnings and issues exposed thereby 2018-05-30 11:09:35 +02:00
Sam Edwards 32e1ca2252 general: Fix several miscategorized EXPCL_PANDA_* macros 2018-05-29 22:49:35 -06:00
Sam Edwards a251c6dd8f general: Change HAVE_LOCKF to PHAVE_LOCKF
HAVE_LOCKF is already defined by pyconfig.h in
(at least) Python 3.6 - changing the macro name
here avoids warnings
2018-05-27 14:06:14 -06:00
Sam Edwards 24c8ef9887 general: Fix missing include 2018-05-27 14:06:08 -06:00
rdb 8d84c58d73 express: explicitly declare defaulted Datagram copy/move ctor/assign
Fixes #329
2018-05-27 15:38:19 +02:00
rdb 3d49986ce2 char: fix crash during Character destructor (regression)
This was a regression in 0bb81a43c9 which was not keeping an edge case in mind if a weak pointer is locked during object destruction.  This issue was fixed by 525a05ea2b1d00a1db901f883f1755943aeff33c, but that is not enough since it causes CharacterJointEffect::get_character() to return null now, so we need a separate method to check if a CharacterJointEffect belongs to a given character.  This is more efficient, too.

Fixes #330
2018-05-27 15:37:45 +02:00
rdb f2d429b817 express: weakptr.lock() should return null during object destruction
This came up in #330; the Character destructor caused something to call lock() on a weak pointer to that character, which would induce a ref() and unref() pair, but since the refcount was 0, this would call the destructor and thereby create infinite recursion.

I considered instead calling mark_deleted() inside unref() so that the callbacks get to run before the object is actually deleted, and was_deleted() will become true as soon as unref() reaches 0.  However, this would require grabbing the lock in unref() to be fully thread-safe, since we would need to bring the refcount to 0 and mark the object as deleted in one atomic operation, so this would be an unacceptable general performance penalty.

Instead, WeakPointerTo::lock() now atomically increments the reference count if it is not already zero, and returns null otherwise.  This should be safe because the object cannot be deleted while the WeakReferenceList lock is held.
2018-05-27 15:37:03 +02:00
Sam Edwards 0ce9dc98b1 general: Move inclusion of checkPandaVersion.h to dtoolbase
This includes it everywhere, meaning developers no longer must
remember to include it in each metalib init file.
2018-05-26 18:39:24 -06:00
Sam Edwards e4c9526e08 ffmpeg: Make read_packet return AVERROR_EOF
Newer versions of FFmpeg deprecate returning 0 to indicate
EOF, and instead request use of AVERROR_EOF.

The oldest supported versions of FFmpeg/libav will treat any
error code the same as returning 0.

Fixes #315
2018-05-26 15:17:43 -06:00
rdb 5c9705c21c pgraph: fix crash accessing python_tags via dict property
Fixes #326
2018-05-24 22:44:08 +02:00
rdb ec04dbed0c gobj: fix static init ordering issue with VertexTransform cycler
This comes up when building with DEBUG_THREADS; there is a PipelineCycler created at static init time, and the type tracking in Pipeline won't work properly if the CData's parent's TypeHandle has not yet been initialized.
2018-05-24 21:40:48 +02:00
rdb 2e7bca90b0 express: fix PointerToArray coercibility regression, fix clear()
This was caused by the assignment operators not being visible to interrogate.
2018-05-24 21:39:54 +02:00
rdb 323ddc7d67 putil: fix UpdateSeq::fresh().is_special() return value 2018-05-24 21:37:58 +02:00
rdb 5e0ce969fe Work around clang 3.1 compile error with static constexpr
There is a bug in clang versions before 3.2 (including the one shipped with Xcode) that makes it give a "conflicting types" compile error when there is a static constexpr function defined outside the class.  The way to work around this is either to remove one of the "static" or "constexpr" keywords, or to simply put the definition inline.

See: https://stackoverflow.com/a/17494592/2135754

I would try and upgrade Xcode to version 5 to see if the problem is fixed, but the buildbot still runs OS X Lion (10.7) and the last version of Xcode that works on Lion is 4.6.3, so it seems easier to just apply these workarounds for now.
2018-05-24 14:34:03 +02:00
rdb 8eeab7a26a dxgsg9: fix compile error due to WeakPointerTo changes 2018-05-24 14:26:21 +02:00
rdb 3077316782 general: use proper deleted funcs instead of stubs with asserts
This gives better compile-time diagnostics and saves on code, while also better communicating intent.
2018-05-23 23:35:27 +02:00
rdb 9fad3dba60 general: remove macros for compatibility with non-C++11 compilers
Now that we require MSVC 2015, we no longer need all this nonsense, so we can write cleaner code.
2018-05-23 23:33:05 +02:00
rdb f45ddcab2f general: switch to C++11 Lockable semantics for mutexes
This renames acquire/release to lock/unlock in order to be compatible with std::lock_guard and std::unique_lock (which will eventually replace the *MutexHolder classes).  It will also allow us to typedef MutexImpl to std::mutex later on.
2018-05-23 20:37:56 +02:00
rdb 3653413cd4 bullet: fix BulletSoftBodyNode::get_node deadlock 2018-05-23 16:55:17 +02:00
rdb 941fda6ec3 pgraph: fix comparisons between WeakNodePath and NodePath
Previously it would only work correctly if the WeakNodePath appeared on the left side of the comparison operator.
2018-05-20 15:57:23 +02:00
rdb 14f118b672 pgraph: expose WeakNodePath to Python 2018-05-20 15:56:58 +02:00
rdb 0bb81a43c9 express: make a thread safe weak pointer implementation (#321)
To access a WeakPointerTo in a thread-safe way, use something like this:

    if (auto ptr = weak_ptr.lock()) {
      ..use ptr as regular PointerTo
    }

The new implementation no longer needs a reference to be stored to all weak pointers on the WeakReferenceList; a mere count of weak pointers is sufficient.  Therefore, callbacks theoretically no longer require a WeakPointerTo to be constructed.

The WeakPointerTo class is not actually atomic; it could be made so, but I don't believe it's worth it at this time.
2018-05-15 13:40:21 +02:00
Sam Edwards 47f7d3f297 general: Add headers explaining the renamed config_*.h 2018-05-14 02:36:42 -06:00
Sam Edwards 52e7c952b3 putil: Rename config_util to config_putil 2018-05-14 02:36:42 -06:00
Sam Edwards 87c11d8018 pstatclient: Rename config_pstats to config_pstatclient 2018-05-14 02:36:42 -06:00
Mitchell Stokes bf1b486e5a Merge branch 'master' into deploy-ng 2018-05-06 11:30:01 -07:00
Mitchell Stokes ebe2588a50 Merge branch 'master' into deploy-ng 2018-05-06 11:21:13 -07:00
Mitchell Stokes aaf7ff9a6c device: Define BTN_DPAD* if not present 2018-05-05 18:12:52 -07:00
rdb 549301d0f0 putil: keep reference to objects queued for writing
This prevents a crash when a reference counted object is destroyed right after a write_pointer call.

Fixes #310
2018-05-05 23:10:41 +02:00
rdb b45726001e task: fix double free when failing to retrieve coroutine exception 2018-05-05 20:53:04 +02:00
rdb 9db74bca1d task: use consistent ordering for tasks with same sort value
We don't guarantee a specific order in this case, especially because they can be run in either order if there is more than one thread, but it is still useful to have a defined order for single-threaded task chains.  To that end, tasks
are now run in the order in which they were added to taskMgr.add (in absence of any other ordering constraints).

Fixes #309
2018-05-01 15:06:27 +02:00
rdb 3b4d4b0804 glgsg: fix broken upload of downscaled texture without mipmaps
Fixes #306
2018-04-30 19:13:54 -04:00
Donny Lawrence 574000aedd Add getter and setter for Content-Type header
Fixes #296
Closes #305
2018-04-21 11:20:18 +02:00
deflected 1ac351d594 bullet: Allow intractions with bullet world during tick callbacks
- Release the global lock during the user tick callback
        and allow interactions with bullet world
        - Acquire the lock again after the callback

Signed-off-by: deflected <deflected@users.noreply.github.com>
2018-04-20 21:29:08 +03:00
rdb e6e39cce0e bullet: fix deadlock in get_manifold 2018-04-20 12:51:26 +02:00
rdb 0cef19fd90 putil: more validation in DatagramInputFile::get_datagram
Intended to fix test_file_corrupt for 32-bit platforms.

See discussion in 89be2c19af
2018-04-11 17:29:49 +02:00
Younguk Kim 9ca0d089a6 event: fix a crash when removing a task is not owned by user 2018-04-10 19:45:54 +09:00
rdb b0cece7faf Merge branch 'master' into deploy-ng 2018-04-08 15:44:32 +02:00
rdb b4d29e6096 express: allow using bytes() on Datagram
Closes: #297
2018-04-06 17:42:59 +02:00
rdb de6d753f79 net: don't use get_message() when constructing datagram header
This is causing an unnecessary copy operation.
2018-04-06 17:17:04 +02:00
rdb 664d628cbc device: D-Pad mappings for DualShock 3 driver on Linux 2018-04-05 21:05:02 +02:00
Mitchell Stokes ff66728212 LinuxInputDeviceManager: Fix fcntl() call 2018-04-04 19:11:03 -07:00
rdb 94476fd1f0 glgsg: fix invalid operation error with multisample FBO
Panda is forgetting to reset the current FBO when resolving multisamples.
2018-04-04 21:46:01 +02:00
rdb 7cbdd3b6c4 gobj: release GIL for (un)compress_ram_image 2018-04-04 21:36:26 +02:00
rdb 77f33f3642 device: never use inotify_init1(), it is not in older kernels 2018-04-04 21:32:44 +02:00