difficulty: formatting

This commit is contained in:
Andrei Alexeyev 2023-01-31 06:04:03 +01:00
parent 6938b0f8a8
commit ea5374bbc6
No known key found for this signature in database
GPG key ID: 72D26128040B9690
2 changed files with 7 additions and 7 deletions

View file

@ -28,7 +28,7 @@ static DiffDef diffs[] = {
{ "Extra", "difficulty/lunatic", { 0.5, 1.0, 1.0, 1.0 } },
};
static inline DiffDef* get_diff_def(Difficulty diff) {
static inline DiffDef *get_diff_def(Difficulty diff) {
uint idx = diff - D_Easy;
if(idx < sizeof(diffs)/sizeof(*diffs)) {
@ -38,17 +38,17 @@ static inline DiffDef* get_diff_def(Difficulty diff) {
return NULL;
}
const char* difficulty_name(Difficulty diff) {
const char *difficulty_name(Difficulty diff) {
DiffDef *d = get_diff_def(diff);
return d ? d->name : "Unknown";
}
const char* difficulty_sprite_name(Difficulty diff) {
const char *difficulty_sprite_name(Difficulty diff) {
DiffDef *d = get_diff_def(diff);
return d ? d->spr_name : "difficulty/unknown";
}
const Color* difficulty_color(Difficulty diff) {
const Color *difficulty_color(Difficulty diff) {
static Color unknown_clr = { 0.5, 0.5, 0.5, 1.0 };
DiffDef *d = get_diff_def(diff);
return d ? &d->color : &unknown_clr;

View file

@ -22,13 +22,13 @@ typedef enum {
#define NUM_SELECTABLE_DIFFICULTIES D_Lunatic
const char* difficulty_name(Difficulty diff)
const char *difficulty_name(Difficulty diff)
attr_pure attr_returns_nonnull;
const char* difficulty_sprite_name(Difficulty diff)
const char *difficulty_sprite_name(Difficulty diff)
attr_pure attr_returns_nonnull;
const Color* difficulty_color(Difficulty diff)
const Color *difficulty_color(Difficulty diff)
attr_pure attr_returns_nonnull;
void difficulty_preload(void);