Commit Graph

823 Commits

Author SHA1 Message Date
rdb 6374a7f240 express: Fix up Patchfile docstrings
[skip ci]
2021-02-15 14:13:24 +01:00
rdb 3e1d98c105 multify: Respect SOURCE_DATE_EPOCH variable when used from command-line
That said, we should probably encourage the use of -T0 (which doesn't write out timestamps to begin with).
2021-01-18 14:16:25 +01:00
rdb a84f1b5595 express: distinguish between null vs empty in CPTA pickle as well 2021-01-02 02:22:06 +01:00
rdb c81c506df3 express: Fix PointerToArray comparison operator 2021-01-01 17:54:09 +01:00
rdb b2462c1d8c express: Support pickling PointerToArray objects 2021-01-01 17:42:30 +01:00
rdb 064da09cf0 putil: add pickling support to Datagram class 2020-04-01 18:25:43 +02:00
rdb 1b67931f16 express: invert return value of unref_if_one()
This is more consistent with how the return value of unref() works.  Someone might otherwise trip over this.
2020-03-14 14:59:20 +01:00
rdb c5c1d4557b pgraph: fix double free if weak ptr to state is locked while being gc'ed
Fixes #499
2020-03-10 12:10:23 +01:00
rdb 1c357f32ca putil: fix asserts when model-cache-dir cannot be created
Fixes #790
2020-02-29 15:08:05 +01:00
rdb 6fd662335d express: fix typo in VirtualFileSystem docstring 2019-11-09 20:27:03 +01:00
rdb 08572f3c38 general: Fix a variety of ABI incompatibility issues with opt4 builds 2019-10-08 19:44:29 +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 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 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 84a1315104 More fixes to work around broken libc++ eof() in Mac OS X 10.7 2019-01-10 21:53:02 +01:00
Sam Edwards 952031455c express: Remove stray reference to DConfig 2018-12-29 02:29:56 -07: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
Sam Edwards c3d52eeee1 express: Fix compiler error with HAVE_TAR 2018-11-12 17:24:15 -07: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 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 5ac3cf3fc6 Eliminate C++ DConfig; replace it with a Python compatibility shim 2018-11-02 23:27:07 +01: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 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
Sam Edwards 4695557a5d general: Don't require BUILDING_* for static builds 2018-08-31 23:54:32 -06: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
rdb fe1bfef5c0 express: fix a few compile errors with certain WeakPointerTo uses
Fixes #367
2018-07-31 14:02:58 +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 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 886e1c2f16 general: fix many compilation warnings in GCC 8 2018-06-19 00:37:28 +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
Younguk Kim d22da73a4c Fix macro redefinition warning 2018-06-14 09:33:19 +09: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 7790f8429d general: Fully qualify header references into the std namespace
Closes #341
2018-06-07 10:35:12 +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