diff --git a/CREDITS.md b/CREDITS.md new file mode 100644 index 0000000..3da127f --- /dev/null +++ b/CREDITS.md @@ -0,0 +1,12 @@ +Credits +======= + +This project would not be possible without + +- Weather Icon set by Laura Reen (thanks for the free high quality icons!) + - https://www.iconfinder.com/iconsets/the-weather-is-nice-today +- Rapidjson (thanks for the fast json parser!) + - https://rapidjson.org +- libcurl (thanks for being the best and most reliable general purpose network + library!) + - https://curl.se/libcurl/ diff --git a/img/clearday.png b/img/clearday.png new file mode 100644 index 0000000..e5b5641 Binary files /dev/null and b/img/clearday.png differ diff --git a/img/clearnight.png b/img/clearnight.png new file mode 100644 index 0000000..270ad21 Binary files /dev/null and b/img/clearnight.png differ diff --git a/img/cloudyday.png b/img/cloudyday.png new file mode 100644 index 0000000..8e14a0d Binary files /dev/null and b/img/cloudyday.png differ diff --git a/img/cloudynight.png b/img/cloudynight.png new file mode 100644 index 0000000..32d7fd6 Binary files /dev/null and b/img/cloudynight.png differ diff --git a/img/humidday.png b/img/humidday.png new file mode 100644 index 0000000..fe97c56 Binary files /dev/null and b/img/humidday.png differ diff --git a/img/humidnight.png b/img/humidnight.png new file mode 100644 index 0000000..2d15487 Binary files /dev/null and b/img/humidnight.png differ diff --git a/img/lrainday.png b/img/lrainday.png new file mode 100644 index 0000000..11a285e Binary files /dev/null and b/img/lrainday.png differ diff --git a/img/lrainnight.png b/img/lrainnight.png new file mode 100644 index 0000000..9acf61c Binary files /dev/null and b/img/lrainnight.png differ diff --git a/img/rainday.png b/img/rainday.png new file mode 100644 index 0000000..0c8de92 Binary files /dev/null and b/img/rainday.png differ diff --git a/img/rainnight.png b/img/rainnight.png new file mode 100644 index 0000000..7765b95 Binary files /dev/null and b/img/rainnight.png differ diff --git a/img/rainsnow.png b/img/rainsnow.png new file mode 100644 index 0000000..a04c2a5 Binary files /dev/null and b/img/rainsnow.png differ diff --git a/img/shower.png b/img/shower.png new file mode 100644 index 0000000..9bbd463 Binary files /dev/null and b/img/shower.png differ diff --git a/img/snowday.png b/img/snowday.png new file mode 100644 index 0000000..411edb4 Binary files /dev/null and b/img/snowday.png differ diff --git a/img/snownight.png b/img/snownight.png new file mode 100644 index 0000000..71b3866 Binary files /dev/null and b/img/snownight.png differ diff --git a/src/config.cpp b/src/config.cpp index fb968dc..10500a0 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -22,10 +22,28 @@ dashboard::panel::panel* OVERLAY = new dashboard::panel::def_overlay(); // Locations of all static images used const char* IMAGE_LOCATIONS[] = { //"bmp_24.png", - "wifi.png", - "weather_background.png", + //wifi + "wifi.png", "wifi_background.jpg", + + //weather + "weather_background.png", + "clearday.png", + "clearnight.png", + "cloudyday.png", + "cloudynight.png", + "humidday.png", + "humidnight.png", + "lrainday.png", + "lrainnight.png", + "rainday.png", + "rainnight.png", + "rainsnow.png", + "shower.png", + "snowday.png", + "snownight.png", + }; size_t IMAGE_LOCATIONS_LENGTH = sizeof(IMAGE_LOCATIONS)/sizeof(IMAGE_LOCATIONS[0]); diff --git a/src/panel/weather.cpp b/src/panel/weather.cpp index f7232e3..e8f2f64 100644 --- a/src/panel/weather.cpp +++ b/src/panel/weather.cpp @@ -170,6 +170,7 @@ void weather::update_texture(){ SDL_RenderCopy(board::getRenderer(), board::getString(temp.c_str(), { "Roboto_Mono/RobotoMono-Medium.ttf", 50 }), NULL, &tgt); + //tommorow's weather @@ -202,6 +203,16 @@ void weather::update_texture(){ SDL_RenderCopy(board::getRenderer(), board::getString(temp.c_str(), { "Roboto_Mono/RobotoMono-Medium.ttf", 50 }), NULL, &tgt); + //icon + tgt.w = (SCREEN_WIDTH / 3) - 50; + tgt.h = tgt.w; + tgt.y = DEF_OVERLAY_BAR_HEIGHT + 25; + tgt.x = 0; + + SDL_RenderCopy(board::getRenderer(), + board::getImage(weather_tommorow->second), + NULL, &tgt); + //day after's weather TTF_SizeText(board::getFont({ "Roboto_Mono/RobotoMono-Medium.ttf", 50 }), @@ -233,8 +244,17 @@ void weather::update_texture(){ SDL_RenderCopy(board::getRenderer(), board::getString(temp.c_str(), { "Roboto_Mono/RobotoMono-Medium.ttf", 50 }), NULL, &tgt); + //icon + tgt.w = (SCREEN_WIDTH / 3) - 50; + tgt.h = tgt.w; + tgt.y = DEF_OVERLAY_BAR_HEIGHT + 25; + tgt.x = (2*SCREEN_WIDTH / 3); + std::cerr << "WEATHER DAY AFTER " << weather_day_after->second << "\n"; + std::cerr << board::getImage(weather_day_after->second) << "\n"; - + SDL_RenderCopy(board::getRenderer(), + board::getImage(weather_day_after->second), + NULL, &tgt); SDL_SetRenderTarget(board::getRenderer(), NULL); } diff --git a/src/panel/weather_config.hpp b/src/panel/weather_config.hpp index 94f9b2e..83e09f5 100644 --- a/src/panel/weather_config.hpp +++ b/src/panel/weather_config.hpp @@ -8,6 +8,7 @@ #include #include +#include "def_overlay_config.hpp" namespace dashboard::panel { //This will be displayed at the top left on the status bar. Set to a blank @@ -41,14 +42,14 @@ namespace dashboard::panel { {"Clear skies", "clearnight.png"}; const std::pair WEATHER_PCLOUDY_DAY = - {"Slightly cloudy", "pcloudyday.png"}; + {"Slightly cloudy", "cloudyday.png"}; const std::pair WEATHER_PCLOUDY_NIGHT = - {"Slightly cloudy", "pcloudynight.png"}; + {"Slightly cloudy", "cloudynight.png"}; const std::pair WEATHER_MCLOUDY_DAY = - {"Moderately cloudy", "mcloudyday.png"}; + {"Moderately cloudy", "cloudyday.png"}; const std::pair WEATHER_MCLOUDY_NIGHT = - {"Moderately cloudy", "mcloudynight.png"}; + {"Moderately cloudy", "cloudynight.png"}; const std::pair WEATHER_CLOUDY_DAY = {"Very cloudy", "cloudyday.png"}; @@ -71,19 +72,19 @@ namespace dashboard::panel { {"Rain", "rainnight.png"}; const std::pair WEATHER_OSHOWER_DAY = - {"Overcast with showers", "oshowerday.png"}; + {"Overcast with showers", "shower.png"}; const std::pair WEATHER_OSHOWER_NIGHT = - {"Overcast with showers", "oshowernight.png"}; + {"Overcast with showers", "shower.png"}; const std::pair WEATHER_ISHOWER_DAY = - {"Moderate showers", "ishowerday.png"}; + {"Moderate showers", "shower.png"}; const std::pair WEATHER_ISHOWER_NIGHT = - {"Moderate showers", "ishowernight.png"}; + {"Moderate showers", "shower.png"}; const std::pair WEATHER_LSNOW_DAY = - {"Light snow", "lsnowday.png"}; + {"Light snow", "snowday.png"}; const std::pair WEATHER_LSNOW_NIGHT = - {"Light snow", "lsnownight.png"}; + {"Light snow", "snownight.png"}; const std::pair WEATHER_SNOW_DAY = {"Moderate snow", "snowday.png"}; @@ -91,7 +92,7 @@ namespace dashboard::panel { {"Moderate snow", "snownight.png"}; const std::pair WEATHER_RAINSNOW_DAY = - {"Rain and snow", "rainsnowday.png"}; + {"Rain and snow", "rainsnow.png"}; const std::pair WEATHER_RAINSNOW_NIGHT = - {"Rain and snow", "rainsnownight.png"}; + {"Rain and snow", "rainsnow.png"}; }