From b0634ce987ebbf8747c6b9345844e5cc8c926c99 Mon Sep 17 00:00:00 2001 From: BernardoGiordano Date: Fri, 14 Dec 2018 19:20:14 +0100 Subject: [PATCH] Fix #178 --- switch/include/SDLHelper.hpp | 7 ++++--- switch/source/SDLHelper.cpp | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/switch/include/SDLHelper.hpp b/switch/include/SDLHelper.hpp index 4bf7ceb..6190f78 100644 --- a/switch/include/SDLHelper.hpp +++ b/switch/include/SDLHelper.hpp @@ -9,6 +9,7 @@ #include #include #include "SDL_FontCache.h" +#include "colors.hpp" bool SDLH_Init(void); void SDLH_Exit(void); @@ -17,10 +18,10 @@ void SDLH_ClearScreen(SDL_Color color); void SDLH_DrawRect(int x, int y, int w, int h, SDL_Color color); void SDLH_DrawCircle(int x, int y, int r, SDL_Color color); void SDLH_DrawText(int size, int x, int y, SDL_Color color, const char *text); -void SDLH_LoadImage(SDL_Texture **texture, char *path); +void SDLH_LoadImage(SDL_Texture** texture, char* path); void SDLH_LoadImage(SDL_Texture** texture, u8* buff, size_t size); -void SDLH_DrawImage(SDL_Texture *texture, int x, int y); -void SDLH_DrawImageScale(SDL_Texture *texture, int x, int y, int w, int h); +void SDLH_DrawImage(SDL_Texture* texture, int x, int y); +void SDLH_DrawImageScale(SDL_Texture* texture, int x, int y, int w, int h); void SDLH_DrawIcon(std::string icon, int x, int y); void SDLH_GetTextDimensions(int size, const char* text, u32* w, u32* h); void SDLH_DrawTextBox(int size, int x, int y, SDL_Color color, int max, const char* text); diff --git a/switch/source/SDLHelper.cpp b/switch/source/SDLHelper.cpp index 7ea4378..c8d7bf2 100644 --- a/switch/source/SDLHelper.cpp +++ b/switch/source/SDLHelper.cpp @@ -54,6 +54,7 @@ bool SDLH_Init(void) SDLH_LoadImage(&s_flag, "romfs:/flag.png"); SDLH_LoadImage(&s_star, "romfs:/star.png"); SDLH_LoadImage(&s_checkbox, "romfs:/checkbox.png"); + SDL_SetTextureColorMod(s_checkbox, COLOR_GREY_BG.r, COLOR_GREY_BG.g, COLOR_GREY_BG.b); // const int mix_flags = MIX_INIT_OGG; // if ((Mix_Init(mix_flags) & mix_flags) != mix_flags) @@ -186,6 +187,7 @@ void SDLH_DrawIcon(std::string icon, int x, int y) t = s_flag; } else if (icon.compare("checkbox") == 0) { t = s_checkbox; + SDLH_DrawRect(x + 8, y + 8, 24, 24, COLOR_WHITE); } else if (icon.compare("star") == 0) { t = s_star; }