Commit Graph

10061 Commits

Author SHA1 Message Date
Sam Edwards 32aceab7b4 grutil: Fix missing EXPCL_PANDA_GRUTIL 2018-03-15 12:48:44 -06:00
Sam Edwards 350f437fbe pandabase: Alphabetically sort pandasymbols.h
[skip ci]
2018-03-12 18:53:58 -06:00
Sam Edwards de2e35ee9a pandabase: Remove unused defines from pandasymbols 2018-03-12 18:33:16 -06:00
rdb 94ceace5af android: add activity for running Python programs
It can be launched from the termux shell using the provided run_python.sh script, which can communicate with the Panda activity using a socket (which is the only way we can reliably get command-line output back to the program.)

The Python script needs to be readable by the Panda activity (which implies it needs to be in /sdcard).

The standard library is packed into the .apk, and loaded using zipimport.  Extension modules are included using a special naming convention and import hook in order to comply with Android's strict demands on how libraries must be named to be included in an .apk.

[skip ci]
2018-03-11 22:53:08 +01:00
rdb 8e8283cbe1 android: enable writing stdout/stderr to a socket
This can be done by setting the extra string org.panda3d.OUTPUT_URI to tcp://host:port
Writing to a log file can still be done using file:///path/to/log.txt

[skip ci]
2018-03-11 22:36:17 +01:00
rdb 319b331553 ShaderGenerator: fix M_modulate_gloss regression
It was mapping the alpha channel of M_modulate_gloss to the glow channel.
2018-03-11 16:40:21 +01:00
rdb e0f8d7885a video4linux: don't block on reading camera frames
Add v4l-blocking variable to enable the old behaviour.
2018-03-11 16:39:00 +01:00
rdb 2563b65249 video4linux: support greyscale pixel format (eg. IR cameras) 2018-03-11 16:33:01 +01:00
Sam Edwards 5f14d9c48f char: Move JointVertexTransform::_matrix to CharacterJoint
The rationale is that CharacterJoint should contain all of the joint
state information, and JointVertexTransform should be pretty much devoid
of state so that we don't have to worry about synchronizing it.
JointVertexTransform::_matrix was just a cached/precomputed matrix
that transforms from original vertex positions to animated vertex
positions, so moving it to CharacterJoint doesn't change any engine
functionality.

This also removes the useless lock on recomputing that matrix. It was
useless because it was computing from shared state in CharacterJoint
that wasn't properly synchronized, but this would have to be fixed by
making CharacterJoint pipeline-cycled - a lock won't do.
2018-03-10 20:26:02 -07:00
Sam Edwards 280b13a289 char: Remove references to dead "ComputedVertices" class
This hasn't been a thing for nearly 13 years.
2018-03-10 20:15:39 -07:00
rdb 5d2110c644 bullet: add force_update_all_aabbs property to BulletWorld 2018-03-08 12:19:22 +01:00
rdb 15f6ed1ba2 androiddisplay: remove error messages leftover from debugging 2018-03-08 11:39:03 +01:00
rdb 9a31478744 task: remove accidentally committed debug message 2018-03-08 11:19:43 +01:00
Sam Edwards d8b48a3837 openal: `ptr != 0` -> `ptr != NULL` 2018-03-06 19:02:05 -07:00
Sam Edwards 99dc462174 openal: assert -> nassert 2018-03-06 19:02:05 -07:00
Sam Edwards c89bb3d030 openal: "reattempt" -> "retry" 2018-03-06 19:02:05 -07:00
Sam Edwards cb85d01de6 openal: Always use INLINE in .I files 2018-03-06 19:02:05 -07:00
Sam Edwards a10cd7d8bb openal: Always use release_sound_data
This simplifies cleanup() a little bit.
2018-03-06 19:02:05 -07:00
Sam Edwards 9a5d7d8254 openal: Add several asserts
This also includes a few slight style fixes.
2018-03-06 19:02:05 -07:00
Sam Edwards 1a6fb5300b openal: Be explicit about what constructs like `_sound != 0` mean 2018-03-06 19:02:05 -07:00
Sam Edwards fd5ce687b3 openal: Add cleanup guards to buffer functions
Without this, the audio might encounter an error, call cleanup()
on itself, and (if in the middle of update()) try to dereference
its recently cleaned-up _sd pointer.

Fixes #230
2018-03-06 19:02:05 -07:00
Sam Edwards 6ca0a68042 openal: Retry deleting a buffer until success
The rationale for this change is Apple's OpenAL implementation,
which needs a little time after the
`alSourcei(source, AL_BUFFER, 0);`
call before any buffers used by that source are free for deletion.

The defaults in the config variables are such that the OpenAL manager
will attempt to delete a buffer up to 6 times (that is, the original
attempt plus 5 reattempts), with delays of 1ms, 2ms, 4ms, 8ms, and 16ms
before each reattempt - which means it'll wait a grand total of 31ms for
a buffer to be free before assuming that some even greater problem must
be happening and giving up.
2018-03-06 19:02:05 -07:00
Sam Edwards 1862100bac openal: Don't assume alSourceUnqueueBuffers is FIFO 2018-03-06 19:02:05 -07:00
Sam Edwards 1b1c76b2e8 pgraph: Fix "Unknown render mode 5" errors
This happened when a M_dual transparent object is given the
M_filled_wireframe render attrib. M_dual would copy the transparent
parts of the object to the transparent back-to-front bin, before
the M_filled_wireframe handler could deal with the M_filled_wireframe
flag.

The solution is just to switch the order - let M_filled_wireframe be
dealt with before the transparency code gets a chance to make a copy.
2018-03-05 06:10:25 -07:00
Sam Edwards fd6eebb7fe bam: Fix circular reference with ClipPlaneAttrib
What's being addressed here is the circumstance where an ancestor of
a PlaneNode has a ClipPlaneAttrib that references said PlaneNode.

The code here is just being copied out of LightAttrib, which has the
exact same mode of operation (it nominates a sorted list of on/off
NodePaths) and a compatible structure. LightAttrib has had this problem
in the past, so using the same solution makes sense.
2018-03-05 05:26:54 -07:00
Sam Edwards 74bb2fef2e bam: Fix typo in ClipPlaneAttrib::fillin 2018-03-05 05:26:50 -07:00
Sam Edwards d088341da1 bam: Log object IDs when spamming read 2018-03-05 05:26:45 -07:00
deflected 8ad4c8e23c bullet: Fixed deadlock when loading from collision solids
- Fixed deadlock when loading ghost nodes from collision solids and
        have non-identity scale applied.

Signed-off-by: deflected <deflected@users.noreply.github.com>
2018-03-01 23:36:10 +02:00
rdb 9638eb47eb Add support for geometry with adjacency information
Example code: https://gist.github.com/rdb/7cebb8941b962c59d5a092048efb3855
2018-03-01 21:20:19 +01:00
rdb 4e640fcb60 Merge remote-tracking branch 'deflected/panda3d-master' 2018-02-27 20:41:01 +01:00
Sam Edwards 01b0835797 pandabase: Remove reference to DIRECTORY_DLLS
Nothing defines this under any circumstances.

Also this moves the various component EXPCLs and EXPTPs
within the include guard of the entire header.
2018-02-26 00:25:03 -07:00
rdb a5beccc99e chan: fix crash when AnimControl is destroyed in threaded pipeline
See #254 for related discussion.
2018-02-24 12:15:56 +01:00
deflected 8fd4584bd0 grutil: Add control over heightfield filtering in shaderTerrainMesh
Signed-off-by: deflected <deflected@users.noreply.github.com>
2018-02-23 13:37:07 +02:00
Sam Edwards e3cc3eff82 putil: Optimize DatagramInputFile::get_datagram
This new loop is better in two ways:
1) It reads straight into the Datagram's internal buffer,
   saving the trouble of allocating an intermediate buffer
   and wasting CPU time to copy out of it.
2) It's more cautious in the face of large (>4MB) lengths,
   which are more likely to be due to corruption than the
   datagram *actually* being that large.
2018-02-23 01:38:27 -07:00
Sam Edwards 10f1ffa9a7 express: Fix Datagram::modify_array()
This just copies the array initialization out of append_data, so a
COW/uninitialized Datagram can be initialized with modify_array()
2018-02-23 01:38:26 -07:00
Sam Edwards 04cb128140 cftalk: Remove this
It was an incomplete experiment for distributing rendering pipelines over
a LAN of computers all working in concert.

Who knows, it may return someday. Until then, it's best not to keep it
around.
2018-02-22 15:18:34 -07:00
Sam Edwards f8e321d155 bam: Start more strongly checking pointer types in complete_pointers
This just starts with PandaNode, and uses DCAST_INTO_R instead of DCAST
to catch bad bams. BamWriter should never produce bam output that will
trigger this; I found this with a fuzzer.

I'm unsure about the tradeoff between bam loading performance and
robustness in the face of bad bams. It certainly makes a lot of sense
in debug builds, but we might want to consider a compile flag that
forces bam-related asserts always on even in release builds.
2018-02-22 04:57:29 -07:00
Sam Edwards 293465a516 bam: Add sanity-check against object IDs appearing twice
Found this by fuzzing; not concerned about updating the writer as
the writer itself should never do this. This is just to protect
against segfaults in the face of corrupt or malicious bams.
2018-02-22 03:13:33 -07:00
Sam Edwards 47a9aa4a80 bam: Simplify the resolve_*_pointers loops in BamReader
This should also be a slight performance boost since breaking out
of the loop upon discovering an incomplete child object means we don't
bother resolving everything else just to discard it all.
2018-02-22 02:03:33 -07:00
deflected 6c7894f68d terrain: set ShaderTerrainMesh heightfield wrap mode to clamp 2018-02-21 15:27:15 +01:00
deflected 9afdb78d94 bullet: make thread-safe by adding global lock mechanism
Also addresses some memory leaks.
2018-02-21 15:04:47 +01:00
Sam Edwards 50b3b87ad5 openal: Explicitly signal a needed cleanup from require_sound_data 2018-02-20 00:55:49 -07:00
Sam Edwards f970bc3229 openal: Don't return OpenALAudioSounds that fail to initialize
Also don't register them in _all_sounds, where they won't remove themselves
due to having already called cleanup() on themselves.

Additionally stops a sound in a cleaned-up state from being passed to the
app and played.
2018-02-20 00:55:49 -07:00
Sam Edwards ad7669e12a mathutil: Update FFTCompressor for FFTW3
This has been due for a while. The last FFTW 2.x release was in 1999.

Note that this does change some of the loops; this has two benefits:
1) The halfcomplex storage order is now explained with a comment.
2) It fixed the special case "don't break a run of bytes for a zero" which
   was never triggering due to the value not being *exactly* 0.0.

I have tested these changes against older FFT-compressed animation .bams
and no noticeable decompression changes are present, so a .bam version
bump is not necessary.
2018-02-17 22:32:38 -07:00
rdb 5c90f64182 text: fix is_whitespace() assertion when invalid chars are included 2018-02-17 20:50:18 +01:00
rdb 95eee0cab2 android: load prc files from assets. Move assets to /android_asset 2018-02-17 20:09:24 +01:00
rdb 8dea93bf38 android: fix touch/stylus taps triggering mouse1 for compatibility 2018-02-17 18:42:39 +01:00
rdb 6bd1976892 android: support writing png/jpg/webp via android.graphics.Bitmap 2018-02-17 18:40:08 +01:00
rdb 854d736882 pgraph: fix alignment error in 32-bit Windows with Eigen
Fixes #251
2018-02-17 18:30:58 +01:00
Sam Edwards ab7dbebf3f general: Remove lingering references to Helix
Support for Helix has been dropped long ago; it's very unlikely to return.
See also de4280ea20.
2018-02-14 17:26:35 -07:00