mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-01-23 09:34:35 -05:00
Change 'col' to 'color' in EnvSettings menu and some other places
This commit is contained in:
parent
002d9497cb
commit
faf499d26a
5 changed files with 52 additions and 52 deletions
|
@ -545,7 +545,7 @@ static void Cw_Callback_2(struct NbtTag* tag) {
|
|||
|
||||
static BlockID cw_curID;
|
||||
static int cw_colR, cw_colG, cw_colB;
|
||||
static PackedCol Cw_ParseCol(PackedCol defValue) {
|
||||
static PackedCol Cw_ParseColor(PackedCol defValue) {
|
||||
int r = cw_colR, g = cw_colG, b = cw_colB;
|
||||
if (r > 255 || g > 255 || b > 255) return defValue;
|
||||
return PackedCol_Make(r, g, b, 255);
|
||||
|
@ -580,15 +580,15 @@ static void Cw_Callback_4(struct NbtTag* tag) {
|
|||
/* Callback for compound tag is called after all its children have been processed */
|
||||
if (IsTag(tag->parent, "EnvColors")) {
|
||||
if (IsTag(tag, "Sky")) {
|
||||
Env.SkyCol = Cw_ParseCol(ENV_DEFAULT_SKY_COL); return;
|
||||
Env.SkyCol = Cw_ParseColor(ENV_DEFAULT_SKY_COLOR); return;
|
||||
} else if (IsTag(tag, "Cloud")) {
|
||||
Env.CloudsCol = Cw_ParseCol(ENV_DEFAULT_CLOUDS_COL); return;
|
||||
Env.CloudsCol = Cw_ParseColor(ENV_DEFAULT_CLOUDS_COLOR); return;
|
||||
} else if (IsTag(tag, "Fog")) {
|
||||
Env.FogCol = Cw_ParseCol(ENV_DEFAULT_FOG_COL); return;
|
||||
Env.FogCol = Cw_ParseColor(ENV_DEFAULT_FOG_COLOR); return;
|
||||
} else if (IsTag(tag, "Sunlight")) {
|
||||
Env_SetSunCol(Cw_ParseCol(ENV_DEFAULT_SUN_COL)); return;
|
||||
Env_SetSunCol(Cw_ParseColor(ENV_DEFAULT_SUN_COLOR)); return;
|
||||
} else if (IsTag(tag, "Ambient")) {
|
||||
Env_SetShadowCol(Cw_ParseCol(ENV_DEFAULT_SHADOW_COL)); return;
|
||||
Env_SetShadowCol(Cw_ParseColor(ENV_DEFAULT_SHADOW_COLOR)); return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
50
src/Menus.c
50
src/Menus.c
|
@ -2633,14 +2633,14 @@ void ClassicOptionsScreen_Show(void) {
|
|||
/*########################################################################################################################*
|
||||
*----------------------------------------------------EnvSettingsScreen----------------------------------------------------*
|
||||
*#########################################################################################################################*/
|
||||
static void EnvSettingsScreen_GetCloudsCol(cc_string* v) { PackedCol_ToHex(v, Env.CloudsCol); }
|
||||
static void EnvSettingsScreen_SetCloudsCol(const cc_string* v) { Env_SetCloudsCol(Menu_HexCol(v)); }
|
||||
static void EnvSettingsScreen_GetCloudsColor(cc_string* v) { PackedCol_ToHex(v, Env.CloudsCol); }
|
||||
static void EnvSettingsScreen_SetCloudsColor(const cc_string* v) { Env_SetCloudsCol(Menu_HexCol(v)); }
|
||||
|
||||
static void EnvSettingsScreen_GetSkyCol(cc_string* v) { PackedCol_ToHex(v, Env.SkyCol); }
|
||||
static void EnvSettingsScreen_SetSkyCol(const cc_string* v) { Env_SetSkyCol(Menu_HexCol(v)); }
|
||||
static void EnvSettingsScreen_GetSkyColor(cc_string* v) { PackedCol_ToHex(v, Env.SkyCol); }
|
||||
static void EnvSettingsScreen_SetSkyColor(const cc_string* v) { Env_SetSkyCol(Menu_HexCol(v)); }
|
||||
|
||||
static void EnvSettingsScreen_GetFogCol(cc_string* v) { PackedCol_ToHex(v, Env.FogCol); }
|
||||
static void EnvSettingsScreen_SetFogCol(const cc_string* v) { Env_SetFogCol(Menu_HexCol(v)); }
|
||||
static void EnvSettingsScreen_GetFogColor(cc_string* v) { PackedCol_ToHex(v, Env.FogCol); }
|
||||
static void EnvSettingsScreen_SetFogColor(const cc_string* v) { Env_SetFogCol(Menu_HexCol(v)); }
|
||||
|
||||
static void EnvSettingsScreen_GetCloudsSpeed(cc_string* v) { String_AppendFloat(v, Env.CloudsSpeed, 2); }
|
||||
static void EnvSettingsScreen_SetCloudsSpeed(const cc_string* v) { Env_SetCloudsSpeed(Menu_Float(v)); }
|
||||
|
@ -2648,11 +2648,11 @@ static void EnvSettingsScreen_SetCloudsSpeed(const cc_string* v) { Env_SetClouds
|
|||
static void EnvSettingsScreen_GetCloudsHeight(cc_string* v) { String_AppendInt(v, Env.CloudsHeight); }
|
||||
static void EnvSettingsScreen_SetCloudsHeight(const cc_string* v) { Env_SetCloudsHeight(Menu_Int(v)); }
|
||||
|
||||
static void EnvSettingsScreen_GetSunCol(cc_string* v) { PackedCol_ToHex(v, Env.SunCol); }
|
||||
static void EnvSettingsScreen_SetSunCol(const cc_string* v) { Env_SetSunCol(Menu_HexCol(v)); }
|
||||
static void EnvSettingsScreen_GetSunColor(cc_string* v) { PackedCol_ToHex(v, Env.SunCol); }
|
||||
static void EnvSettingsScreen_SetSunColor(const cc_string* v) { Env_SetSunCol(Menu_HexCol(v)); }
|
||||
|
||||
static void EnvSettingsScreen_GetShadowCol(cc_string* v) { PackedCol_ToHex(v, Env.ShadowCol); }
|
||||
static void EnvSettingsScreen_SetShadowCol(const cc_string* v) { Env_SetShadowCol(Menu_HexCol(v)); }
|
||||
static void EnvSettingsScreen_GetShadowColor(cc_string* v) { PackedCol_ToHex(v, Env.ShadowCol); }
|
||||
static void EnvSettingsScreen_SetShadowColor(const cc_string* v) { Env_SetShadowCol(Menu_HexCol(v)); }
|
||||
|
||||
static void EnvSettingsScreen_GetWeather(cc_string* v) { String_AppendConst(v, Weather_Names[Env.Weather]); }
|
||||
static void EnvSettingsScreen_SetWeather(const cc_string* v) {
|
||||
|
@ -2668,21 +2668,21 @@ static void EnvSettingsScreen_SetEdgeHeight(const cc_string* v) { Env_SetEdgeHei
|
|||
|
||||
static void EnvSettingsScreen_InitWidgets(struct MenuOptionsScreen* s) {
|
||||
static const struct MenuOptionDesc buttons[10] = {
|
||||
{ -1, -150, "Clouds col", MenuOptionsScreen_Input,
|
||||
EnvSettingsScreen_GetCloudsCol, EnvSettingsScreen_SetCloudsCol },
|
||||
{ -1, -100, "Sky col", MenuOptionsScreen_Input,
|
||||
EnvSettingsScreen_GetSkyCol, EnvSettingsScreen_SetSkyCol },
|
||||
{ -1, -50, "Fog col", MenuOptionsScreen_Input,
|
||||
EnvSettingsScreen_GetFogCol, EnvSettingsScreen_SetFogCol },
|
||||
{ -1, -150, "Clouds color", MenuOptionsScreen_Input,
|
||||
EnvSettingsScreen_GetCloudsColor, EnvSettingsScreen_SetCloudsColor },
|
||||
{ -1, -100, "Sky color", MenuOptionsScreen_Input,
|
||||
EnvSettingsScreen_GetSkyColor, EnvSettingsScreen_SetSkyColor },
|
||||
{ -1, -50, "Fog color", MenuOptionsScreen_Input,
|
||||
EnvSettingsScreen_GetFogColor, EnvSettingsScreen_SetFogColor },
|
||||
{ -1, 0, "Clouds speed", MenuOptionsScreen_Input,
|
||||
EnvSettingsScreen_GetCloudsSpeed, EnvSettingsScreen_SetCloudsSpeed },
|
||||
{ -1, 50, "Clouds height", MenuOptionsScreen_Input,
|
||||
EnvSettingsScreen_GetCloudsHeight, EnvSettingsScreen_SetCloudsHeight },
|
||||
|
||||
{ 1, -150, "Sunlight col", MenuOptionsScreen_Input,
|
||||
EnvSettingsScreen_GetSunCol, EnvSettingsScreen_SetSunCol },
|
||||
{ 1, -100, "Shadow col", MenuOptionsScreen_Input,
|
||||
EnvSettingsScreen_GetShadowCol, EnvSettingsScreen_SetShadowCol },
|
||||
{ 1, -150, "Sunlight color", MenuOptionsScreen_Input,
|
||||
EnvSettingsScreen_GetSunColor, EnvSettingsScreen_SetSunColor },
|
||||
{ 1, -100, "Shadow color", MenuOptionsScreen_Input,
|
||||
EnvSettingsScreen_GetShadowColor, EnvSettingsScreen_SetShadowColor },
|
||||
{ 1, -50, "Weather", MenuOptionsScreen_Enum,
|
||||
EnvSettingsScreen_GetWeather, EnvSettingsScreen_SetWeather },
|
||||
{ 1, 0, "Rain/Snow speed", MenuOptionsScreen_Input,
|
||||
|
@ -2698,14 +2698,14 @@ static void EnvSettingsScreen_InitWidgets(struct MenuOptionsScreen* s) {
|
|||
|
||||
void EnvSettingsScreen_Show(void) {
|
||||
static struct MenuInputDesc descs[11];
|
||||
MenuInput_Hex(descs[0], ENV_DEFAULT_CLOUDS_COL);
|
||||
MenuInput_Hex(descs[1], ENV_DEFAULT_SKY_COL);
|
||||
MenuInput_Hex(descs[2], ENV_DEFAULT_FOG_COL);
|
||||
MenuInput_Hex(descs[0], ENV_DEFAULT_CLOUDS_COLOR);
|
||||
MenuInput_Hex(descs[1], ENV_DEFAULT_SKY_COLOR);
|
||||
MenuInput_Hex(descs[2], ENV_DEFAULT_FOG_COLOR);
|
||||
MenuInput_Float(descs[3], 0, 1000, 1);
|
||||
MenuInput_Int(descs[4], -10000, 10000, World.Height + 2);
|
||||
|
||||
MenuInput_Hex(descs[5], ENV_DEFAULT_SUN_COL);
|
||||
MenuInput_Hex(descs[6], ENV_DEFAULT_SHADOW_COL);
|
||||
MenuInput_Hex(descs[5], ENV_DEFAULT_SUN_COLOR);
|
||||
MenuInput_Hex(descs[6], ENV_DEFAULT_SHADOW_COLOR);
|
||||
MenuInput_Enum(descs[7], Weather_Names, Array_Elems(Weather_Names));
|
||||
MenuInput_Float(descs[8], -100, 100, 1);
|
||||
MenuInput_Int(descs[9], -2048, 2048, World.Height / 2);
|
||||
|
|
|
@ -277,13 +277,13 @@ static void WoM_ParseConfig(struct HttpRequest* item) {
|
|||
if (!String_UNSAFE_Separate(&line, '=', &key, &value)) continue;
|
||||
|
||||
if (String_CaselessEqualsConst(&key, "environment.cloud")) {
|
||||
col = WoM_ParseCol(&value, ENV_DEFAULT_CLOUDS_COL);
|
||||
col = WoM_ParseCol(&value, ENV_DEFAULT_CLOUDS_COLOR);
|
||||
Env_SetCloudsCol(col);
|
||||
} else if (String_CaselessEqualsConst(&key, "environment.sky")) {
|
||||
col = WoM_ParseCol(&value, ENV_DEFAULT_SKY_COL);
|
||||
col = WoM_ParseCol(&value, ENV_DEFAULT_SKY_COLOR);
|
||||
Env_SetSkyCol(col);
|
||||
} else if (String_CaselessEqualsConst(&key, "environment.fog")) {
|
||||
col = WoM_ParseCol(&value, ENV_DEFAULT_FOG_COL);
|
||||
col = WoM_ParseCol(&value, ENV_DEFAULT_FOG_COLOR);
|
||||
Env_SetFogCol(col);
|
||||
} else if (String_CaselessEqualsConst(&key, "environment.level")) {
|
||||
if (Convert_ParseInt(&value, &waterLevel)) {
|
||||
|
@ -1071,17 +1071,17 @@ static void CPE_SetEnvCol(cc_uint8* data) {
|
|||
c = PackedCol_Make(data[2], data[4], data[6], 255);
|
||||
|
||||
if (variable == 0) {
|
||||
Env_SetSkyCol(invalid ? ENV_DEFAULT_SKY_COL : c);
|
||||
Env_SetSkyCol(invalid ? ENV_DEFAULT_SKY_COLOR : c);
|
||||
} else if (variable == 1) {
|
||||
Env_SetCloudsCol(invalid ? ENV_DEFAULT_CLOUDS_COL : c);
|
||||
Env_SetCloudsCol(invalid ? ENV_DEFAULT_CLOUDS_COLOR : c);
|
||||
} else if (variable == 2) {
|
||||
Env_SetFogCol(invalid ? ENV_DEFAULT_FOG_COL : c);
|
||||
Env_SetFogCol(invalid ? ENV_DEFAULT_FOG_COLOR : c);
|
||||
} else if (variable == 3) {
|
||||
Env_SetShadowCol(invalid ? ENV_DEFAULT_SHADOW_COL : c);
|
||||
Env_SetShadowCol(invalid ? ENV_DEFAULT_SHADOW_COLOR : c);
|
||||
} else if (variable == 4) {
|
||||
Env_SetSunCol(invalid ? ENV_DEFAULT_SUN_COL : c);
|
||||
Env_SetSunCol(invalid ? ENV_DEFAULT_SUN_COLOR : c);
|
||||
} else if (variable == 5) {
|
||||
Env_SetSkyboxCol(invalid ? ENV_DEFAULT_SKYBOX_COL : c);
|
||||
Env_SetSkyboxCol(invalid ? ENV_DEFAULT_SKYBOX_COLOR : c);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
12
src/World.c
12
src/World.c
|
@ -165,18 +165,18 @@ void Env_Reset(void) {
|
|||
Env.SkyboxHorSpeed = 0.0f;
|
||||
Env.SkyboxVerSpeed = 0.0f;
|
||||
|
||||
Env.ShadowCol = ENV_DEFAULT_SHADOW_COL;
|
||||
Env.ShadowCol = ENV_DEFAULT_SHADOW_COLOR;
|
||||
PackedCol_GetShaded(Env.ShadowCol, &Env.ShadowXSide,
|
||||
&Env.ShadowZSide, &Env.ShadowYMin);
|
||||
|
||||
Env.SunCol = ENV_DEFAULT_SUN_COL;
|
||||
Env.SunCol = ENV_DEFAULT_SUN_COLOR;
|
||||
PackedCol_GetShaded(Env.SunCol, &Env.SunXSide,
|
||||
&Env.SunZSide, &Env.SunYMin);
|
||||
|
||||
Env.SkyCol = ENV_DEFAULT_SKY_COL;
|
||||
Env.FogCol = ENV_DEFAULT_FOG_COL;
|
||||
Env.CloudsCol = ENV_DEFAULT_CLOUDS_COL;
|
||||
Env.SkyboxCol = ENV_DEFAULT_SKYBOX_COL;
|
||||
Env.SkyCol = ENV_DEFAULT_SKY_COLOR;
|
||||
Env.FogCol = ENV_DEFAULT_FOG_COLOR;
|
||||
Env.CloudsCol = ENV_DEFAULT_CLOUDS_COLOR;
|
||||
Env.SkyboxCol = ENV_DEFAULT_SKYBOX_COLOR;
|
||||
Env.Weather = WEATHER_SUNNY;
|
||||
Env.ExpFog = false;
|
||||
}
|
||||
|
|
12
src/World.h
12
src/World.h
|
@ -125,12 +125,12 @@ CC_VAR extern struct _EnvData {
|
|||
enum Weather_ { WEATHER_SUNNY, WEATHER_RAINY, WEATHER_SNOWY };
|
||||
extern const char* const Weather_Names[3];
|
||||
|
||||
#define ENV_DEFAULT_SKY_COL PackedCol_Make(0x99, 0xCC, 0xFF, 0xFF)
|
||||
#define ENV_DEFAULT_FOG_COL PackedCol_Make(0xFF, 0xFF, 0xFF, 0xFF)
|
||||
#define ENV_DEFAULT_CLOUDS_COL PackedCol_Make(0xFF, 0xFF, 0xFF, 0xFF)
|
||||
#define ENV_DEFAULT_SKYBOX_COL PackedCol_Make(0xFF, 0xFF, 0xFF, 0xFF)
|
||||
#define ENV_DEFAULT_SUN_COL PackedCol_Make(0xFF, 0xFF, 0xFF, 0xFF)
|
||||
#define ENV_DEFAULT_SHADOW_COL PackedCol_Make(0x9B, 0x9B, 0x9B, 0xFF)
|
||||
#define ENV_DEFAULT_SKY_COLOR PackedCol_Make(0x99, 0xCC, 0xFF, 0xFF)
|
||||
#define ENV_DEFAULT_FOG_COLOR PackedCol_Make(0xFF, 0xFF, 0xFF, 0xFF)
|
||||
#define ENV_DEFAULT_CLOUDS_COLOR PackedCol_Make(0xFF, 0xFF, 0xFF, 0xFF)
|
||||
#define ENV_DEFAULT_SKYBOX_COLOR PackedCol_Make(0xFF, 0xFF, 0xFF, 0xFF)
|
||||
#define ENV_DEFAULT_SUN_COLOR PackedCol_Make(0xFF, 0xFF, 0xFF, 0xFF)
|
||||
#define ENV_DEFAULT_SHADOW_COLOR PackedCol_Make(0x9B, 0x9B, 0x9B, 0xFF)
|
||||
|
||||
/* Resets all environment settings to default. */
|
||||
/* NOTE: Unlike Env_Set functions, DOES NOT raise EnvVarChanged event. */
|
||||
|
|
Loading…
Add table
Reference in a new issue