2017-02-27 15:27:48 +01:00
|
|
|
/*
|
|
|
|
* This software is licensed under the terms of the MIT-License
|
|
|
|
* See COPYING for further information.
|
|
|
|
* ---
|
2018-01-04 18:14:31 +01:00
|
|
|
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
|
|
|
|
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
|
2017-02-27 15:27:48 +01:00
|
|
|
*/
|
|
|
|
|
2017-11-25 20:45:11 +01:00
|
|
|
#include "taisei.h"
|
|
|
|
|
2017-02-27 15:27:48 +01:00
|
|
|
#include "difficulty.h"
|
2017-03-11 04:41:57 +01:00
|
|
|
#include "resource/resource.h"
|
2017-02-27 15:27:48 +01:00
|
|
|
|
|
|
|
const char* difficulty_name(Difficulty diff) {
|
2018-01-12 19:26:07 +01:00
|
|
|
switch(diff) {
|
|
|
|
case D_Easy: return "Easy";
|
|
|
|
case D_Normal: return "Normal";
|
|
|
|
case D_Hard: return "Hard";
|
|
|
|
case D_Lunatic: return "Lunatic";
|
|
|
|
case D_Extra: return "Extra";
|
|
|
|
default: return "Unknown";
|
|
|
|
}
|
2017-02-27 15:27:48 +01:00
|
|
|
}
|
|
|
|
|
2017-03-10 16:26:10 +01:00
|
|
|
const char* difficulty_tex(Difficulty diff) {
|
2018-01-12 19:26:07 +01:00
|
|
|
switch(diff) {
|
|
|
|
case D_Easy: return "difficulty/easy";
|
|
|
|
case D_Normal: return "difficulty/normal";
|
|
|
|
case D_Hard: return "difficulty/hard";
|
|
|
|
case D_Lunatic: return "difficulty/lunatic";
|
|
|
|
case D_Extra: return "difficulty/lunatic";
|
|
|
|
default: return "difficulty/unknown"; // This texture is not supposed to exist.
|
|
|
|
}
|
2017-03-10 16:26:10 +01:00
|
|
|
}
|
|
|
|
|
2017-02-26 21:59:51 +01:00
|
|
|
Color difficulty_color(Difficulty diff) {
|
2018-01-12 19:26:07 +01:00
|
|
|
switch(diff) {
|
|
|
|
case D_Easy: return rgb(0.5, 1.0, 0.5);
|
|
|
|
case D_Normal: return rgb(0.5, 0.5, 1.0);
|
|
|
|
case D_Hard: return rgb(1.0, 0.5, 0.5);
|
|
|
|
case D_Lunatic: return rgb(1.0, 0.5, 1.0);
|
|
|
|
case D_Extra: return rgb(0.5, 1.0, 1.0);
|
|
|
|
default: return rgb(0.5, 0.5, 0.5);
|
|
|
|
}
|
2017-02-27 15:27:48 +01:00
|
|
|
}
|
2017-03-11 04:41:57 +01:00
|
|
|
|
|
|
|
void difficulty_preload(void) {
|
2018-01-12 19:26:07 +01:00
|
|
|
for(Difficulty diff = D_Easy; diff < NUM_SELECTABLE_DIFFICULTIES + D_Easy; ++diff) {
|
|
|
|
preload_resource(RES_TEXTURE, difficulty_tex(diff), RESF_PERMANENT);
|
|
|
|
}
|
2017-03-11 04:41:57 +01:00
|
|
|
}
|