Fix audio device problems #1
@@ -180,6 +180,16 @@ void Home::render(SDL_Renderer *renderer)
|
|||||||
SDL_RenderFillRect(renderer, &line);
|
SDL_RenderFillRect(renderer, &line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Large bold reminder to connect WiFi, drawn below the menu while no
|
||||||
|
// network is joined (refreshed every 5s in update()).
|
||||||
|
if (wifiNote_.texture && ssid_.empty())
|
||||||
|
{
|
||||||
|
float noteX = (fw - wifiNote_.width) / 2.0f;
|
||||||
|
float noteY = settingsY_ + settings_.height + 40.0f;
|
||||||
|
SDL_FRect noteDst{noteX, noteY, wifiNote_.width, wifiNote_.height};
|
||||||
|
SDL_RenderTexture(renderer, wifiNote_.texture, nullptr, ¬eDst);
|
||||||
|
}
|
||||||
|
|
||||||
// Bottom-right status footer (20pt, aligned to a virtual rectangle:
|
// Bottom-right status footer (20pt, aligned to a virtual rectangle:
|
||||||
// names left-aligned at the rect's left edge, values right-aligned at
|
// names left-aligned at the rect's left edge, values right-aligned at
|
||||||
// the rect's right edge; the longest name's colon sits 4 spaces from its
|
// the rect's right edge; the longest name's colon sits 4 spaces from its
|
||||||
@@ -352,6 +362,15 @@ void Home::createTextures(AppState &state)
|
|||||||
|
|
||||||
TTF_CloseFont(font);
|
TTF_CloseFont(font);
|
||||||
|
|
||||||
|
font = TTF_OpenFont("assets/fonts/Roboto-Regular.ttf", 48);
|
||||||
|
if (font)
|
||||||
|
{
|
||||||
|
TTF_SetFontStyle(font, TTF_STYLE_BOLD);
|
||||||
|
wifiNote_ = renderText(state.renderer, font, "Please connect to WiFi", white);
|
||||||
|
TTF_SetFontStyle(font, TTF_STYLE_NORMAL);
|
||||||
|
TTF_CloseFont(font);
|
||||||
|
}
|
||||||
|
|
||||||
SDL_Surface *bgSurface = IMG_Load("assets/images/RWT-Circular-Color-ForOnDark-NoText.png");
|
SDL_Surface *bgSurface = IMG_Load("assets/images/RWT-Circular-Color-ForOnDark-NoText.png");
|
||||||
if (bgSurface)
|
if (bgSurface)
|
||||||
{
|
{
|
||||||
@@ -410,6 +429,11 @@ void Home::destroyTextures()
|
|||||||
SDL_DestroyTexture(settings_.texture);
|
SDL_DestroyTexture(settings_.texture);
|
||||||
settings_.texture = nullptr;
|
settings_.texture = nullptr;
|
||||||
}
|
}
|
||||||
|
if (wifiNote_.texture)
|
||||||
|
{
|
||||||
|
SDL_DestroyTexture(wifiNote_.texture);
|
||||||
|
wifiNote_.texture = nullptr;
|
||||||
|
}
|
||||||
for (auto &t : footerNames_)
|
for (auto &t : footerNames_)
|
||||||
t.destroy();
|
t.destroy();
|
||||||
for (auto &t : footerValues_)
|
for (auto &t : footerValues_)
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ private:
|
|||||||
TextLine play_;
|
TextLine play_;
|
||||||
TextLine settings_;
|
TextLine settings_;
|
||||||
TextLine bg_;
|
TextLine bg_;
|
||||||
|
TextLine wifiNote_;
|
||||||
|
|
||||||
AppState* state_ = nullptr;
|
AppState* state_ = nullptr;
|
||||||
float playY_ = 0;
|
float playY_ = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user