diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-08-18 17:28:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-18 17:28:04 +0200 |
commit | 01675eb75a6bed4820383fd0d200bf5aad71d612 (patch) | |
tree | fabb7f9e494e4042c2594f46781c239fd048fcdb /scene/resources | |
parent | 2a9c4a59dfd2d0f25e2789d8339f91f97f5dd2bb (diff) | |
parent | b88a41a16114c02088720453511bf0376a7f7568 (diff) |
Merge pull request #51837 from pycbouh/particles-adjust-material-bit-size
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/particles_material.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scene/resources/particles_material.h b/scene/resources/particles_material.h index ac7a500f73..1e1821024e 100644 --- a/scene/resources/particles_material.h +++ b/scene/resources/particles_material.h @@ -61,6 +61,7 @@ public: PARAM_MAX }; + // When extending, make sure not to overflow the size of the MaterialKey below. enum ParticleFlags { PARTICLE_FLAG_ALIGN_Y_TO_VELOCITY, PARTICLE_FLAG_ROTATE_Y, @@ -68,6 +69,7 @@ public: PARTICLE_FLAG_MAX }; + // When extending, make sure not to overflow the size of the MaterialKey below. enum EmissionShape { EMISSION_SHAPE_POINT, EMISSION_SHAPE_SPHERE, @@ -78,6 +80,7 @@ public: EMISSION_SHAPE_MAX }; + // When extending, make sure not to overflow the size of the MaterialKey below. enum SubEmitterMode { SUB_EMITTER_DISABLED, SUB_EMITTER_CONSTANT, @@ -88,11 +91,13 @@ public: private: union MaterialKey { + // The bit size of the struct must be kept below or equal to 32 bits. + // Consider this when extending ParticleFlags, EmissionShape, or SubEmitterMode. struct { uint32_t texture_mask : 16; uint32_t texture_color : 1; uint32_t particle_flags : 4; - uint32_t emission_shape : 2; + uint32_t emission_shape : 3; uint32_t invalid_key : 1; uint32_t has_emission_color : 1; uint32_t sub_emitter : 2; |