diff --git a/img/rainy.png b/img/rainy.png deleted file mode 100644 index c1f1b80..0000000 Binary files a/img/rainy.png and /dev/null differ diff --git a/img/sky.png b/img/sky.png new file mode 100644 index 0000000..5dc622d Binary files /dev/null and b/img/sky.png differ diff --git a/img/square.png b/img/square.png new file mode 100644 index 0000000..c8eb5fd Binary files /dev/null and b/img/square.png differ diff --git a/img/sunny.png b/img/sunny.png deleted file mode 100644 index 033a92e..0000000 Binary files a/img/sunny.png and /dev/null differ diff --git a/src/config.cpp b/src/config.cpp index 9b0896a..d86fe9e 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -21,6 +21,7 @@ dashboard::panel::panel* OVERLAY = new dashboard::panel::def_overlay(); // Locations of all static images used const char* IMAGE_LOCATIONS[] = { "bmp_24.png", + "sky.png", }; size_t IMAGE_LOCATIONS_LENGTH = sizeof(IMAGE_LOCATIONS)/sizeof(IMAGE_LOCATIONS[0]); diff --git a/src/panel/def_overlay.cpp b/src/panel/def_overlay.cpp index 7459514..e8cf190 100644 --- a/src/panel/def_overlay.cpp +++ b/src/panel/def_overlay.cpp @@ -37,7 +37,6 @@ def_overlay::~def_overlay(){ void def_overlay::draw(){ //create the texture if this is the first time running draw if(_texture == nullptr){ - std::cerr << "IN FIRST SETUP\n"; initTexture(); update(); update_texture(); @@ -89,6 +88,8 @@ void def_overlay::update_texture() { SDL_SetRenderDrawColor(board::getRenderer(), 0x00, 0x00, 0x00, 0x00); + SDL_RenderClear(board::getRenderer()); + //set the new color SDL_SetRenderDrawColor(board::getRenderer(), DEF_OVERLAY_BAR_RED, DEF_OVERLAY_BAR_GREEN, @@ -112,16 +113,14 @@ void def_overlay::update_texture() { DEF_OVERLAY_TEXT_BLUE, DEF_OVERLAY_TEXT_ALPHA); //show the date and time - TTF_SizeText(board::getFont({ "Roboto_Mono/RobotoMono-Medium.ttf", 28 }), + TTF_SizeText(board::getFont({ "Roboto_Mono/RobotoMono-Medium.ttf", 50 }), date_time.c_str(), &tgt.w, &tgt.h); tgt.x = SCREEN_WIDTH - tgt.w + 25; tgt.y = -5; SDL_RenderCopy(board::getRenderer(), board::getString(date_time.c_str(), - { "Roboto_Mono/RobotoMono-Medium.ttf", 28 }), NULL, &tgt); - - + { "Roboto_Mono/RobotoMono-Medium.ttf", 50 }), NULL, &tgt); SDL_SetRenderTarget(board::getRenderer(), NULL); diff --git a/src/panel/def_overlay_config.hpp b/src/panel/def_overlay_config.hpp index 216c4b5..3a49f83 100644 --- a/src/panel/def_overlay_config.hpp +++ b/src/panel/def_overlay_config.hpp @@ -22,8 +22,8 @@ namespace dashboard::panel { constexpr uint8_t DEF_OVERLAY_TEXT_BLUE = 0xCC; constexpr uint8_t DEF_OVERLAY_TEXT_ALPHA = 0xFF; - constexpr uint8_t DEF_OVERLAY_BAR_RED = 0x00; - constexpr uint8_t DEF_OVERLAY_BAR_GREEN = 0x00; - constexpr uint8_t DEF_OVERLAY_BAR_BLUE = 0x00; - constexpr uint8_t DEF_OVERLAY_BAR_ALPHA = 0xCC; + constexpr uint8_t DEF_OVERLAY_BAR_RED = 0xD3; + constexpr uint8_t DEF_OVERLAY_BAR_GREEN = 0xD3; + constexpr uint8_t DEF_OVERLAY_BAR_BLUE = 0xD3; + constexpr uint8_t DEF_OVERLAY_BAR_ALPHA = 0x7F; } diff --git a/src/panel/weather.cpp b/src/panel/weather.cpp index a1b085f..376ce24 100644 --- a/src/panel/weather.cpp +++ b/src/panel/weather.cpp @@ -88,6 +88,10 @@ void weather::update_texture(){ SDL_SetRenderTarget(board::getRenderer(), _texture); SDL_RenderClear(board::getRenderer()); + //background image + SDL_RenderCopy(board::getRenderer(), + board::getImage("sky.png"), NULL, NULL); + //title tgt.x = 50; tgt.y = 50;