1
0
Fork 0

Codechange: Capitalise static consts (#13342)

pull/13345/head
SamuXarick 2025-01-19 23:58:21 +00:00 committed by GitHub
parent a589793e27
commit 9a3b656a62
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 6 deletions

View File

@ -151,11 +151,11 @@
/** Fixed point type for heights */ /** Fixed point type for heights */
using Height = int16_t; using Height = int16_t;
static const int height_decimal_bits = 4; static const int HEIGHT_DECIMAL_BITS = 4;
/** Fixed point array for amplitudes (and percent values) */ /** Fixed point array for amplitudes (and percent values) */
using Amplitude = int; using Amplitude = int;
static const int amplitude_decimal_bits = 10; static const int AMPLITUDE_DECIMAL_BITS = 10;
/** Height map - allocated array of heights (MapSizeX() + 1) x (MapSizeY() + 1) */ /** Height map - allocated array of heights (MapSizeX() + 1) x (MapSizeY() + 1) */
struct HeightMap struct HeightMap
@ -183,15 +183,15 @@ struct HeightMap
static HeightMap _height_map = { {}, 0, 0, 0 }; static HeightMap _height_map = { {}, 0, 0, 0 };
/** Conversion: int to Height */ /** Conversion: int to Height */
#define I2H(i) ((i) << height_decimal_bits) #define I2H(i) ((i) << HEIGHT_DECIMAL_BITS)
/** Conversion: Height to int */ /** Conversion: Height to int */
#define H2I(i) ((i) >> height_decimal_bits) #define H2I(i) ((i) >> HEIGHT_DECIMAL_BITS)
/** Conversion: Amplitude to int */ /** Conversion: Amplitude to int */
#define A2I(i) ((i) >> amplitude_decimal_bits) #define A2I(i) ((i) >> AMPLITUDE_DECIMAL_BITS)
/** Conversion: Amplitude to Height */ /** Conversion: Amplitude to Height */
#define A2H(a) ((a) >> (amplitude_decimal_bits - height_decimal_bits)) #define A2H(a) ((a) >> (AMPLITUDE_DECIMAL_BITS - HEIGHT_DECIMAL_BITS))
/** Maximum number of TGP noise frequencies. */ /** Maximum number of TGP noise frequencies. */
static const int MAX_TGP_FREQUENCIES = 10; static const int MAX_TGP_FREQUENCIES = 10;