From faf499d26a928d19f62023413c86e3ac2a297a11 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Tue, 24 Aug 2021 21:45:12 +1000 Subject: [PATCH] Change 'col' to 'color' in EnvSettings menu and some other places --- src/Formats.c | 12 ++++++------ src/Menus.c | 50 +++++++++++++++++++++++++------------------------- src/Protocol.c | 18 +++++++++--------- src/World.c | 12 ++++++------ src/World.h | 12 ++++++------ 5 files changed, 52 insertions(+), 52 deletions(-) diff --git a/src/Formats.c b/src/Formats.c index 8c34dd83f..6843de942 100644 --- a/src/Formats.c +++ b/src/Formats.c @@ -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; } } diff --git a/src/Menus.c b/src/Menus.c index ea783e19f..504aedab0 100644 --- a/src/Menus.c +++ b/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); diff --git a/src/Protocol.c b/src/Protocol.c index 1c24b685f..e714bf7d2 100644 --- a/src/Protocol.c +++ b/src/Protocol.c @@ -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); } } diff --git a/src/World.c b/src/World.c index b0f71b76e..1f7377f8e 100644 --- a/src/World.c +++ b/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; } diff --git a/src/World.h b/src/World.h index 05793b22e..94ef89c60 100644 --- a/src/World.h +++ b/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. */