Skip to content

Commit

Permalink
style(compression): use explicit default initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrechette committed Oct 22, 2023
1 parent c035b73 commit 99a15b2
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 45 deletions.
22 changes: 11 additions & 11 deletions includes/acl/decompression/database/impl/database_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,32 +44,32 @@ namespace acl
// one offset for the base, and index with the tier * desc.size
struct database_context_v0
{
// // offsets
// // offsets
// Only member used to detect if we are initialized, must be first
const compressed_database* db; // 0 | 0
const compressed_database* db = nullptr; // 0 | 0

// We use arrays so we can index with (tier - 1) as our index
// Index 0 = medium importance tier, index 1 = low importance

// Runtime related data, commonly accessed
uint8_t* clip_segment_headers; // 4 | 8
uint8_t* clip_segment_headers = nullptr; // 4 | 8

const uint8_t* bulk_data[k_num_database_tiers]; // 8 | 16
const uint8_t* bulk_data[k_num_database_tiers] = { nullptr }; // 8 | 16

// Streaming related data not commonly accessed
database_streamer* streamers[k_num_database_tiers]; // 16 | 32
database_streamer* streamers[k_num_database_tiers] = { nullptr }; // 16 | 32

uint32_t* loaded_chunks[k_num_database_tiers]; // 24 | 48
uint32_t* streaming_chunks[k_num_database_tiers]; // 32 | 64
uint32_t* loaded_chunks[k_num_database_tiers] = { nullptr }; // 24 | 48
uint32_t* streaming_chunks[k_num_database_tiers] = { nullptr }; // 32 | 64

iallocator* allocator; // 40 | 72
iallocator* allocator = nullptr; // 40 | 72

// Cached hash of the bound database instance
uint32_t db_hash; // 44 | 88
uint32_t db_hash = 0; // 44 | 88

uint8_t padding1[sizeof(void*) == 4 ? 16 : 36]; // 48 | 92
uint8_t padding1[sizeof(void*) == 4 ? 16 : 36] = { 0 }; // 48 | 92

// Total size: 64 | 128
// Total size: 64 | 128

//////////////////////////////////////////////////////////////////////////

Expand Down
20 changes: 10 additions & 10 deletions includes/acl/decompression/impl/decompression.scalar.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,26 @@ namespace acl
{
struct persistent_scalar_decompression_context_v0
{
// Clip related data // offsets
// Clip related data // offsets
// Only member used to detect if we are initialized, must be first
const compressed_tracks* tracks; // 0 | 0
const compressed_tracks* tracks = nullptr; // 0 | 0

// Cached hash of the bound compressed track instance
uint32_t tracks_hash; // 4 | 8
uint32_t tracks_hash = 0; // 4 | 8

// Only used when the wrap loop policy isn't supported
float duration; // 8 | 12
float duration = 0.0F; // 8 | 12

// Seeking related data
float interpolation_alpha; // 12 | 16
float sample_time; // 16 | 20
float interpolation_alpha = 0.0F; // 12 | 16
float sample_time = 0.0F; // 16 | 20

uint32_t key_frame_bit_offsets[2]; // 20 | 24 // Variable quantization
uint32_t key_frame_bit_offsets[2] = { 0 }; // 20 | 24 // Variable quantization

uint8_t looping_policy; // 28 | 32
uint8_t rounding_policy; // 29 | 33
uint8_t looping_policy = 0; // 28 | 32
uint8_t rounding_policy = 0; // 29 | 33

uint8_t padding_tail[sizeof(void*) == 4 ? 34 : 30]; // 30 | 34
uint8_t padding_tail[sizeof(void*) == 4 ? 34 : 30] = { 0 }; // 30 | 34

//////////////////////////////////////////////////////////////////////////

Expand Down
48 changes: 24 additions & 24 deletions includes/acl/decompression/impl/decompression_context.transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,52 +52,52 @@ namespace acl
{
struct persistent_transform_decompression_context_v0
{
// Clip related data // offsets
// Clip related data // offsets
// Only member used to detect if we are initialized, must be first
const compressed_tracks* tracks; // 0 | 0
const compressed_tracks* tracks = nullptr; // 0 | 0

// Database context, optional
const database_context_v0* db; // 4 | 8
const database_context_v0* db = nullptr; // 4 | 8

// Cached hashes of the bound compressed track and database instances
uint32_t tracks_hash; // 8 | 16
uint32_t db_hash; // 12 | 20
uint32_t tracks_hash = 0; // 8 | 16
uint32_t db_hash = 0; // 12 | 20

// Only used when the wrap loop policy isn't supported
float clip_duration; // 16 | 24
float clip_duration = 0.0F; // 16 | 24

rotation_format8 rotation_format; // 20 | 28
vector_format8 translation_format; // 21 | 29
vector_format8 scale_format; // 22 | 30
rotation_format8 rotation_format = rotation_format8::quatf_full; // 20 | 28
vector_format8 translation_format = vector_format8::vector3f_full; // 21 | 29
vector_format8 scale_format = vector_format8::vector3f_full; // 22 | 30

uint8_t has_scale; // 23 | 31
uint8_t has_segments; // 24 | 32
uint8_t has_scale = 0; // 23 | 31
uint8_t has_segments = 0; // 24 | 32

uint8_t looping_policy; // 25 | 33
uint8_t looping_policy = 0; // 25 | 33

uint8_t padding0[16]; // 26 | 34
uint8_t padding0[16] = { 0 }; // 26 | 34

// Seeking related data
uint8_t rounding_policy; // 42 | 50
uint8_t uses_single_segment; // 43 | 51
uint8_t rounding_policy = 0; // 42 | 50
uint8_t uses_single_segment = 0; // 43 | 51

float sample_time; // 44 | 52
float sample_time = 0.0F; // 44 | 52

// Offsets in bytes relative to the 'tracks' pointer
ptr_offset32<segment_header> segment_offsets[2]; // 48 | 56
ptr_offset32<segment_header> segment_offsets[2]; // 48 | 56

const uint8_t* format_per_track_data[2]; // 56 | 64
const uint8_t* segment_range_data[2]; // 64 | 80
const uint8_t* animated_track_data[2]; // 72 | 96
const uint8_t* format_per_track_data[2] = { nullptr }; // 56 | 64
const uint8_t* segment_range_data[2] = { nullptr }; // 64 | 80
const uint8_t* animated_track_data[2] = { nullptr }; // 72 | 96

// Offsets in bits relative to the 'animated_track_data' pointers
uint32_t key_frame_bit_offsets[2]; // 80 | 112
uint32_t key_frame_bit_offsets[2] = { 0 }; // 80 | 112

float interpolation_alpha; // 88 | 120
float interpolation_alpha = 0.0F; // 88 | 120

uint8_t padding1[sizeof(void*) == 4 ? 36 : 4]; // 92 | 124
uint8_t padding1[sizeof(void*) == 4 ? 36 : 4] = { 0 }; // 92 | 124

// Total size: 128 | 128
// Total size: 128 | 128

//////////////////////////////////////////////////////////////////////////

Expand Down

0 comments on commit 99a15b2

Please sign in to comment.