Replay fixes (#17)

Fixes to work with our game.
Replay fixes and improvements.
Removed shape names (save memory).
B3_DEFAULT_CATEGORY_BITS  is now UINT64_MAX to make selection easier.
This commit is contained in:
Erin Catto 2026-06-26 21:10:10 -07:00 • committed by GitHub
commit 0c8ef46931
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
51 changed files with 5653 additions and 3853 deletions

View file

@ -1,17 +1,19 @@
// SPDX-FileCopyrightText: 2025 Erin Catto
// SPDX-FileCopyrightText: 2026 Erin Catto
// SPDX-License-Identifier: MIT
#pragma once
#include <stddef.h>
#include <string.h>
#define B3_TYPE_OF( A ) __typeof__( A )
// Swap two same-size lvalues through a byte buffer. Avoids __typeof__ so it builds on any C compiler.
#define B3_SWAP( x, y ) \
do \
{ \
B3_TYPE_OF( x ) B3_SWAP_TEMP = x; \
x = y; \
y = B3_SWAP_TEMP; \
_Static_assert( sizeof( x ) == sizeof( y ), "size mismatch" ); \
char B3_SWAP_TEMP[sizeof( x )]; \
memcpy( B3_SWAP_TEMP, &( x ), sizeof( x ) ); \
memcpy( &( x ), &( y ), sizeof( x ) ); \
memcpy( &( y ), B3_SWAP_TEMP, sizeof( x ) ); \
} \
while ( 0 )