Add proper clock and colors
This commit is contained in:
parent
906a6dc65d
commit
8d8751e4d8
@ -368,27 +368,25 @@ void board::start(){
|
|||||||
SDL_RenderClear(_renderer);
|
SDL_RenderClear(_renderer);
|
||||||
|
|
||||||
//PLACEHOLDER, cycle color
|
//PLACEHOLDER, cycle color
|
||||||
/*
|
|
||||||
{
|
{
|
||||||
static uint8_t red = 0;
|
static uint8_t green = 0;
|
||||||
static bool up = true;
|
static bool up = true;
|
||||||
|
|
||||||
SDL_SetRenderDrawColor(_renderer, red,
|
SDL_SetRenderDrawColor(_renderer, BOARD_RED,
|
||||||
BOARD_GREEN, BOARD_BLUE, SDL_ALPHA_OPAQUE);
|
green, BOARD_BLUE, SDL_ALPHA_OPAQUE);
|
||||||
|
|
||||||
SDL_RenderClear(_renderer);
|
SDL_RenderClear(_renderer);
|
||||||
|
|
||||||
if(up){
|
if(up){
|
||||||
if(red == 254)
|
if(green == 254)
|
||||||
up = false;
|
up = false;
|
||||||
red++;
|
green++;
|
||||||
} else {
|
} else {
|
||||||
if(red == 1)
|
if(green == 1)
|
||||||
up = true;
|
up = true;
|
||||||
red --;
|
green --;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
//END PLACEHOLDER
|
//END PLACEHOLDER
|
||||||
|
|
||||||
|
|
||||||
|
@ -115,8 +115,8 @@ void def_overlay::update_texture() {
|
|||||||
TTF_SizeText(board::getFont({ "Roboto_Mono/RobotoMono-Medium.ttf", 28 }),
|
TTF_SizeText(board::getFont({ "Roboto_Mono/RobotoMono-Medium.ttf", 28 }),
|
||||||
date_time.c_str(),
|
date_time.c_str(),
|
||||||
&tgt.w, &tgt.h);
|
&tgt.w, &tgt.h);
|
||||||
tgt.x = SCREEN_WIDTH - tgt.w - 5;
|
tgt.x = SCREEN_WIDTH - tgt.w + 25;
|
||||||
tgt.y = 0;
|
tgt.y = -5;
|
||||||
SDL_RenderCopy(board::getRenderer(),
|
SDL_RenderCopy(board::getRenderer(),
|
||||||
board::getString(date_time.c_str(),
|
board::getString(date_time.c_str(),
|
||||||
{ "Roboto_Mono/RobotoMono-Medium.ttf", 28 }), NULL, &tgt);
|
{ "Roboto_Mono/RobotoMono-Medium.ttf", 28 }), NULL, &tgt);
|
||||||
@ -124,7 +124,6 @@ void def_overlay::update_texture() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SDL_SetRenderTarget(board::getRenderer(), NULL);
|
SDL_SetRenderTarget(board::getRenderer(), NULL);
|
||||||
|
|
||||||
//reset back to the old render color
|
//reset back to the old render color
|
||||||
|
@ -11,10 +11,10 @@
|
|||||||
namespace dashboard::panel {
|
namespace dashboard::panel {
|
||||||
//How long should we wait between updates? in ms
|
//How long should we wait between updates? in ms
|
||||||
//Default 10 s
|
//Default 10 s
|
||||||
constexpr size_t DEF_OVERLAY_UPDATE_INTERVAL = 10000;
|
constexpr size_t DEF_OVERLAY_UPDATE_INTERVAL = 500;
|
||||||
|
|
||||||
//Height of the bar on the top and bottom, in pixels
|
//Height of the bar on the top and bottom, in pixels
|
||||||
constexpr size_t DEF_OVERLAY_BAR_HEIGHT = 45;
|
constexpr size_t DEF_OVERLAY_BAR_HEIGHT = 60;
|
||||||
|
|
||||||
//Text color
|
//Text color
|
||||||
constexpr uint8_t DEF_OVERLAY_TEXT_RED = 0xCC;
|
constexpr uint8_t DEF_OVERLAY_TEXT_RED = 0xCC;
|
||||||
@ -22,8 +22,8 @@ namespace dashboard::panel {
|
|||||||
constexpr uint8_t DEF_OVERLAY_TEXT_BLUE = 0xCC;
|
constexpr uint8_t DEF_OVERLAY_TEXT_BLUE = 0xCC;
|
||||||
constexpr uint8_t DEF_OVERLAY_TEXT_ALPHA = 0xFF;
|
constexpr uint8_t DEF_OVERLAY_TEXT_ALPHA = 0xFF;
|
||||||
|
|
||||||
constexpr uint8_t DEF_OVERLAY_BAR_RED = 0xAA;
|
constexpr uint8_t DEF_OVERLAY_BAR_RED = 0x00;
|
||||||
constexpr uint8_t DEF_OVERLAY_BAR_GREEN = 0xAA;
|
constexpr uint8_t DEF_OVERLAY_BAR_GREEN = 0x00;
|
||||||
constexpr uint8_t DEF_OVERLAY_BAR_BLUE = 0xAA;
|
constexpr uint8_t DEF_OVERLAY_BAR_BLUE = 0x00;
|
||||||
constexpr uint8_t DEF_OVERLAY_BAR_ALPHA = 0xFF;
|
constexpr uint8_t DEF_OVERLAY_BAR_ALPHA = 0xCC;
|
||||||
}
|
}
|
||||||
|
@ -132,6 +132,6 @@ void weather::initTexture(){
|
|||||||
SDL_TEXTUREACCESS_TARGET,
|
SDL_TEXTUREACCESS_TARGET,
|
||||||
SCREEN_WIDTH, SCREEN_HEIGHT);
|
SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||||
|
|
||||||
SDL_SetTextureBlendMode(_texture, SDL_BLENDMODE_NONE);
|
SDL_SetTextureBlendMode(_texture, SDL_BLENDMODE_BLEND);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user