2017-02-27 15:27:48 +01:00
|
|
|
/*
|
2019-08-03 19:43:48 +02:00
|
|
|
* This software is licensed under the terms of the MIT License.
|
2017-02-27 15:27:48 +01:00
|
|
|
* See COPYING for further information.
|
|
|
|
* ---
|
2024-05-16 23:30:41 +02:00
|
|
|
* Copyright (c) 2011-2024, Lukas Weber <laochailan@web.de>.
|
|
|
|
* Copyright (c) 2012-2024, Andrei Alexeyev <akari@taisei-project.org>.
|
2017-02-27 15:27:48 +01:00
|
|
|
*/
|
|
|
|
|
2021-08-12 23:09:01 +02:00
|
|
|
#pragma once
|
2017-11-25 20:45:11 +01:00
|
|
|
#include "taisei.h"
|
2017-02-27 15:27:48 +01:00
|
|
|
|
|
|
|
#include "color.h"
|
2023-03-22 23:41:32 +01:00
|
|
|
#include "resource/resource.h"
|
2017-02-27 15:27:48 +01:00
|
|
|
|
|
|
|
typedef enum {
|
2018-01-12 19:26:07 +01:00
|
|
|
D_Any = 0,
|
|
|
|
D_Easy,
|
|
|
|
D_Normal,
|
|
|
|
D_Hard,
|
|
|
|
D_Lunatic,
|
|
|
|
D_Extra // reserved for later
|
2017-02-27 15:27:48 +01:00
|
|
|
} Difficulty;
|
|
|
|
|
|
|
|
#define NUM_SELECTABLE_DIFFICULTIES D_Lunatic
|
|
|
|
|
2023-01-31 06:04:03 +01:00
|
|
|
const char *difficulty_name(Difficulty diff)
|
2018-07-23 19:07:59 +02:00
|
|
|
attr_pure attr_returns_nonnull;
|
2018-04-12 16:08:48 +02:00
|
|
|
|
2023-01-31 06:04:03 +01:00
|
|
|
const char *difficulty_sprite_name(Difficulty diff)
|
2018-07-23 19:07:59 +02:00
|
|
|
attr_pure attr_returns_nonnull;
|
2018-04-12 16:08:48 +02:00
|
|
|
|
2023-01-31 06:04:03 +01:00
|
|
|
const Color *difficulty_color(Difficulty diff)
|
2018-07-23 19:07:59 +02:00
|
|
|
attr_pure attr_returns_nonnull;
|
2018-04-12 16:08:48 +02:00
|
|
|
|
2023-03-22 23:41:32 +01:00
|
|
|
void difficulty_preload(ResourceGroup *rg);
|
2019-01-23 21:10:43 +01:00
|
|
|
|
2023-01-31 06:17:50 +01:00
|
|
|
#define difficulty_value(easy, normal, hard, lunatic) ({ \
|
|
|
|
typeof((easy)+(normal)+(hard)+(lunatic)) val; \
|
|
|
|
switch(global.diff) { \
|
|
|
|
case D_Easy: val = easy; break; \
|
|
|
|
case D_Normal: val = normal; break; \
|
|
|
|
case D_Hard: val = hard; break; \
|
|
|
|
case D_Lunatic: val = lunatic; break; \
|
|
|
|
default: UNREACHABLE; \
|
|
|
|
} \
|
|
|
|
val; \
|
|
|
|
})
|