get rid of VAR_BITS

I hate this stupid fucking thing you can't print them normally
This commit is contained in:
jacekpoz 2024-04-18 20:16:01 +02:00
parent 7d34861da8
commit f6784c2848
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8
3 changed files with 10 additions and 27 deletions

View file

@ -48,8 +48,6 @@
#define VAR_ENUM(section, name, enum_type) enum_type name;
#define VAR_ENUM_D(section, name, enum_type, default) enum_type name = enum_type::default;
#define VAR_BITS(section, name, amount, offset) unsigned int name : amount;
#define STRUCT(name, ...) \
struct name {\
__VA_ARGS__\
@ -142,8 +140,6 @@
#undef VAR_ENUM
#undef VAR_ENUM_D
#undef VAR_BITS
#undef STRUCT_FIELD_TO_STRING
#undef STRUCT_FROM_STRING

View file

@ -31,8 +31,6 @@
#define VAR_ENUM(section, name, enum_type)
#define VAR_ENUM_D(section, name, enum_type, default)
#define VAR_BITS(section, name, amount, offset)
#define STRUCT_STREAM_OPS(name, ...)
#define STRUCT(name, ...)
@ -84,20 +82,20 @@ STRUCT(TimingPoint,
STRUCT_STREAM_OPS(TimingPoint, time, beatLength, meter, sampleSet, sampleIndex, volume, uninherited, effects)
STRUCT(HitObjectType,
VAR_BITS(, hitCircle, 1, 0)
VAR_BITS(, slider, 1, 1)
VAR_BITS(, newCombo, 1, 2)
VAR_BITS(, spinner, 1, 3)
VAR_BITS(, colourHax, 3, 4)
VAR_BITS(, holdNote, 1, 7)
VAR_UINT(, hitCircle)
VAR_UINT(, slider)
VAR_UINT(, newCombo)
VAR_UINT(, spinner)
VAR_UINT(, colourHax)
VAR_UINT(, holdNote)
)
STRUCT_STREAM_OPS(HitObjectType, hitCircle, slider, newCombo, spinner, colourHax, holdNote)
STRUCT(HitSound,
VAR_BITS(, normal, 1, 0)
VAR_BITS(, whistle, 1, 1)
VAR_BITS(, finish, 1, 2)
VAR_BITS(, clap, 1, 3)
VAR_UINT(, normal)
VAR_UINT(, whistle)
VAR_UINT(, finish)
VAR_UINT(, clap)
)
STRUCT_STREAM_OPS(HitSound, normal, whistle, finish, clap)
@ -200,8 +198,6 @@ CONFIG(Difficulty,
#undef VAR_ENUM
#undef VAR_ENUM_D
#undef VAR_BITS
#undef STRUCT
#undef VAR_STRUCT
#undef VAR_STRUCT_D

View file

@ -156,15 +156,6 @@ inline void toLower(std::string &str) {
value << ss;\
)
#define VAR_BITS(section, name, amount, offset) \
VAR_GENERIC(section, name,\
uint8_t val = std::stoul(checkAndRemove(line, namePascalCased));\
unsigned int value = 0;\
for (size_t i = offset; i < offset + amount; ++i) {\
value |= (1 << i);\
}\
)
#define STRUCT(name, ...)
#define VAR_STRUCT(section, name, struct_type) \
VAR_GENERIC(section, name,\