21887 Commits

Author SHA1 Message Date
rdb
d13464104c Fix compilation issue with --nothing on MSVC
I have no idea why this error happens, but it does not seem worth the effort to investigate further, so I'm just reverting the previous change to this file.
2018-04-06 20:50:31 +02:00
rdb
22f933a419 tests: disable datagram bytes() test on Python 2
See #297
2018-04-06 20:34:48 +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
7125a3e587 interrogate: allow passing None for args that have NULL as default value 2018-04-05 20:49:13 +02:00
rdb
552a649ef3 interrogate: add back NULL definition, fixes some keyword arguments
I am not sure why the definition of NULL was removed; it might have been by mistake, but in any case it broke code like this:

    img = PNMImage(w, h, color_space=CS_srgb)

since it would not understand the default value (NULL) for the argument preceding color_space.
2018-04-04 21:50:02 +02: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
e9ae7dcc40 Use vector_uchar instead of string for binary network/file data
This distinction allows us to better support Python 3, since it will raise exceptions when trying to put arbitrary binary data in a str object.

This also adds some convenience functions for efficiently initializing a Datagram or PTA_uchar from a vector_uchar.
2018-04-02 23:17:14 +02:00
Sam Edwards
fadbcd91e5 ffmpeg: Bump supported minimums lower for libav 9.20
We need to support this because Ubuntu 14.04 ships with this
version, and has no "backports" option to bring in a newer version
(without use of a PPA or compiling it yourself).

We can consider raising the minimums again once Trusty is EOL.
2018-03-31 05:53:45 -06:00
Sam Edwards
bb6e0abeba ffmpeg: Switch the video cursor to the new decoding API 2018-03-31 04:17:07 -06:00
Sam Edwards
8d36908556 ffmpeg: Use avcodec_flush_buffers when seeking
Previously this would close and reopen the codec context;
that's entirely unnecessary, as all supported versions of
libavcodec support flushing the buffers instead.
2018-03-31 04:17:07 -06:00
Sam Edwards
e430428703 ffmpeg: Add async audio decoding loop
This leverages libavcodec >= 57.37.100's new asynchronous API,
which both allows decoding in hardware and in a separate thread,
and in any case would free up more CPU time for Panda's app loop.

This also avoids use of the now-deprecated `avcodec_decode_audio4`
2018-03-31 04:17:07 -06:00
Sam Edwards
62f9de101a ffmpeg: Tell swresample the channel count 2018-03-31 04:17:07 -06:00
Sam Edwards
4ffd364415 ffmpeg: Simplify ffmpegAudioCursor.cxx a little
This refactors the `reload_buffer` loop so all of the decode
logic is inside the loop, and all of the resampling logic is
outside.
2018-03-31 04:17:07 -06:00
Sam Edwards
eb591674e0 ffmpeg: Prefer av_packet_alloc over allocating AVPacket ourselves
av_packet_alloc/av_packet_free will know the correct size of AVPacket,
even if the ABI should change. So, we use it when it's available.
2018-03-31 04:17:07 -06:00
Sam Edwards
9596095294 ffmpeg: Use AVStream.codecpar
AVStream.codec is deprecated as of libavformat version 57.41.100,
so if this version is detected, we switch to AVStream.codecpar instead.

Note this also makes it necessary to construct and use our own codec
context - but doing that is a cleaner approach anyway.
2018-03-31 04:17:07 -06:00
Sam Edwards
cc77c5dbe2 ffmpeg: Clean up ffmpeg_prefer_libvpx implementation 2018-03-31 04:17:07 -06:00
Sam Edwards
148010c5f0 ffmpeg: Remove code to support deprecated versions
See previous commit; now that we're enforcing explicit minimums, any
code to support anything older than those minimums is trivially dead.
2018-03-31 04:17:07 -06:00
Sam Edwards
a19e9aea63 ffmpeg: Enforce minimum supported versions of ffmpeg
lavcodec:  54.86.100
lavformat: 54.59.106
lavutil:   52.13.100

These are the versions included in FFmpeg 1.1, which is the oldest
release that works with Panda already: we've been using
`av_opt_set_sample_fmt` (introduced in FFmpeg 1.1) since
03e96d8c4a903be7222365b40613429768659892 (August 2013) and nobody has
complained since. In other words, I'm not dropping support for anything
here, I'm just making the supported versions explicit.
2018-03-31 04:17:07 -06:00
Sam Edwards
65210a5e49 ffmpeg: Fix a typo in version detection
See f0b3e08e9c75e5cdcd98c0f3142469918d1d2fd5
2018-03-31 04:17:07 -06:00
Tohka
0b1ad67e13 distributed: Fix DC file reading regression (#295) 2018-03-31 04:01:35 -06:00
Sebastian Hoffmann
78377ca10c Cursor after newline character appears on beginning of next line.
DirectEntry.updateNumLines updates text geom.
DirectEntry API less inadequate.

Closes #257
2018-03-30 20:17:31 +02:00
rdb
84915073e1 Fix compilation warning on MSVC 2015 2018-03-30 20:15:13 +02:00
deflected
30cf1dbbb1 pgraphnodes: Fixed the type of texture bytes in sceneGraphAnalyzer
- Corrected the type of texture bytes variable as it is possible
        to wrap it around

Signed-off-by: deflected <deflected@users.noreply.github.com>
2018-03-30 14:38:39 +03:00
rdb
b8af5bf64f cocoa: fix compile error caused by faulty merge
[skip ci]
2018-03-29 14:44:10 +02:00
rdb
2bde4d839a makepanda: set MSVC 2015 as default, deprecate MSVC 2010 support
See #288 for discussion; make your voice heard there if you object to this change!

[skip ci]
2018-03-29 14:36:41 +02:00
Donny Lawrence
7830aab21d cocoa: Fix unresponsive menubar, add default item for application menu.
Closes #259
2018-03-29 14:30:16 +02:00
rdb
7062da944a cocoa: fix ability to type AltGr characters and dead keys
It would seem that interpretKeyEvents/insertText would be the right way to do this, but while that does handle AltGr keys correctly, it does not handle dead keys at all.  This approach seems to do the right things.
2018-03-29 14:22:59 +02:00
rdb
95bffa8503 Fix crash when typing unicode characters above 7fff into text field
Can be reproduced when typing Shift+AltGr+5 into a DirectEntry on macOS.
2018-03-29 14:17:39 +02:00
rdb
63b1e44977 framework: fix pview crash when exit is called inside render_frame
This can happen when a system event (eg. on macOS) triggers a terminate from within process_events.

This is a workaround for a common error; the proper fix is not to put PandaFramework in the global scope.
2018-03-29 14:11:21 +02:00
Sam Edwards
4eb250cb87 dcparser: Write ranged-blob parameters correctly 2018-03-25 22:03:55 -06:00
Sam Edwards
9dd37e9dbc general: Add guards to ensure proper BUILDING_ macros defined
This is designed to sanity-check the buildsystem, ensuring that the
expected BUILDING_ macros are defined at the expected time. It
also helps catch cases where the wrong BUILDING_/EXPCL_ macros
are used.
2018-03-25 13:17:52 -06:00
Sam Edwards
f231ba4cd7 directbase: Introduce BUILDING_ defines for each component
Ditto everything before, but for direct.
2018-03-25 13:17:52 -06:00
Sam Edwards
bd2a9d709a dtoolbase: Introduce BUILDING_ defines for each component
This mirrors the prior commit.
2018-03-25 13:17:52 -06:00
Sam Edwards
98797d0090 pandabase: Introduce BUILDING_ defines for each component
This reverses the relationship between EXPCL_PANDA_COMPONENT
and BUILDING_PANDA, where BUILDING_PANDA is just shorthand for
BUILDING_PANDA_COMPONENT and BUILDING_PANDA_COMPONENT itself
sets the EXPCL_PANDA_COMPONENT defines.

Also removes EXPCL_PANDA.
2018-03-25 13:17:52 -06:00
Sam Edwards
9739923593 dconfig: Change export macros to EXP*_DTOOL_DCONFIG
This is for consistency with `panda`, which follows this format.
2018-03-25 13:17:52 -06:00
Sam Edwards
775fcb5b0b prc: Change export macros to EXP*_DTOOL_PRC
This is for consistency with `panda`, which follows this format.
2018-03-25 13:17:52 -06:00
Sam Edwards
ad5b45811d dtoolutil: Change export macros to EXP*_DTOOL_DTOOLUTIL
This is for consistency with `panda`, which follows this format.
2018-03-25 13:17:52 -06:00
Sam Edwards
9852ada792 dtoolbase: Change export macros to EXP*_DTOOL_DTOOLBASE
This is for consistency with `panda`, which follows this format.
2018-03-25 13:17:52 -06:00
Sam Edwards
29318992d9 metalibs/panda: EXPCL_PANDA -> EXPCL_LIBPANDA 2018-03-25 13:17:52 -06:00
rdb
69d24993b6 bullet: fix compilation error with Bullet 2.81 2018-03-22 15:30:31 +01:00
deflected
3a88308f45 bullet: Cleanup copying of shapes
- Fixed copy constructors
        - Dropped operator= from shapes

Signed-off-by: deflected <deflected@users.noreply.github.com>

Closes #283
2018-03-22 15:22:44 +01:00
deflected
733085e38e bullet: Write saved _up value for cylinder shapes
- Missed in previous commit.

Signed-off-by: deflected <deflected@users.noreply.github.com>
2018-03-22 15:22:37 +01:00
deflected
5fec62b6fa bullet: Corrected possible false check
- When a bullet world is created it sets the filter
        algorithm callback that will use. Later changes to
        PRC config data should not lead to false assumptions
        that the bullet world is working with the new config.

Signed-off-by: deflected <deflected@users.noreply.github.com>

Closes #289
2018-03-22 15:17:27 +01:00
deflected
09a9a8ff22 multifile: Return vector_uchar from readSubfile
- Return vector_uchar from readSubfile instead of
        string. This will correct problems with Python 3 unicode
        strings and will return bytes instead.

Signed-off-by: deflected <deflected@users.noreply.github.com>

Closes #290
2018-03-22 15:12:30 +01:00
Sam Edwards
cfd70ebead general: Remove '#pragma interface'/'#pragma implementation'
The GCC documentation states that, as of GCC 2.7.2, these aren't
necessary for proper program behavior. The documentation further
discourages their use because they don't suppress unnecessary code
duplication.

The Panda codebase these days uses "extern template class" instead,
which tells the compiler not to perform implicit template expansion
because an explicit template expansion is available for linking
elsewhere in the program. This is a more compiler-neutral way of
achieving the same thing as '#pragma interface', making
'#pragma interface' not only redundant, it could also mask problems
in the "extern template class" machinery.
2018-03-20 14:36:19 -04:00
Sam Edwards
a4c1b44371 dtoolbase: Remove EXPORT_TEMPLATES define
As of f69354d9fa603ac05dfd924af3844f749fd50cdd, this is just always
expected on all platforms. If it's not defined,
TemplateClass<X>::_type_handle won't link correctly with some compilers
(e.g. Clang) and the lack of 'extern template class' will result in
duplicated code in any case. In short, turning it off causes problems.

makepanda also always turns this on, so it doesn't represent any
optional feature or autodetected platform-specific behavior anyway.
2018-03-20 14:36:19 -04:00
Sam Edwards
2031409a6e gobj: Fix missing include 2018-03-18 00:27:05 -06:00
rdb
adbab8deae x11display: reenable confined mode on window reconfigure
Fixes #280
2018-03-16 21:22:23 +01:00