diff --git a/Package/Environment/Common/Layouts/Default 16x9/Lato-Black.ttf b/Package/Environment/Common/Layouts/Default 16x9/Lato-Black.ttf deleted file mode 100644 index a87109f..0000000 Binary files a/Package/Environment/Common/Layouts/Default 16x9/Lato-Black.ttf and /dev/null differ diff --git a/Package/Environment/Common/Layouts/Default 16x9/Layout.xml b/Package/Environment/Common/Layouts/Default 16x9/Layout.xml index 10be7ab..64ac1af 100644 --- a/Package/Environment/Common/Layouts/Default 16x9/Layout.xml +++ b/Package/Environment/Common/Layouts/Default 16x9/Layout.xml @@ -1,15 +1,12 @@ - + - + - - - diff --git a/Package/Environment/Common/Layouts/Default 16x9/Roboto-Bold.ttf b/Package/Environment/Common/Layouts/Default 16x9/Roboto-Bold.ttf new file mode 100644 index 0000000..aaf374d Binary files /dev/null and b/Package/Environment/Common/Layouts/Default 16x9/Roboto-Bold.ttf differ diff --git a/Package/Environment/Common/Layouts/Default 16x9/Splash.xml b/Package/Environment/Common/Layouts/Default 16x9/Splash.xml deleted file mode 100644 index 71953ce..0000000 --- a/Package/Environment/Common/Layouts/Default 16x9/Splash.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Package/Environment/Common/Layouts/Splash/Lato-Regular.ttf b/Package/Environment/Common/Layouts/Splash/Lato-Regular.ttf new file mode 100644 index 0000000..f01f558 Binary files /dev/null and b/Package/Environment/Common/Layouts/Splash/Lato-Regular.ttf differ diff --git a/RetroFE/Source/Graphics/Font.cpp b/RetroFE/Source/Graphics/Font.cpp index 608d5eb..be002c2 100644 --- a/RetroFE/Source/Graphics/Font.cpp +++ b/RetroFE/Source/Graphics/Font.cpp @@ -50,7 +50,7 @@ bool Font::GetRect(unsigned int charCode, GlyphInfo &glyph) return false; } -bool Font::Initialize(std::string fontPath, SDL_Color color) +bool Font::Initialize(std::string fontPath) { TTF_Font *font = TTF_OpenFont(fontPath.c_str(), 128); @@ -70,6 +70,11 @@ bool Font::Initialize(std::string fontPath, SDL_Color color) GlyphInfoBuild *info = new GlyphInfoBuild; memset(info, sizeof(GlyphInfoBuild), 0); + SDL_Color color; + color.r = 255; + color.g = 255; + color.b = 255; + color.a = 255; info->Surface = TTF_RenderGlyph_Blended(font, i, color); TTF_GlyphMetrics(font, i, &info->Glyph.MinX, &info->Glyph.MaxX, &info->Glyph.MinY, &info->Glyph.MaxY, &info->Glyph.Advance); @@ -114,7 +119,9 @@ bool Font::Initialize(std::string fontPath, SDL_Color color) bmask = 0x00ff0000; amask = 0xff000000; #endif + SDL_Surface *atlasSurface = SDL_CreateRGBSurface(0, atlasWidth, atlasHeight, 24, rmask, gmask, bmask, amask); + SDL_FillRect(atlasSurface, NULL, SDL_MapRGB(atlasSurface->format, 0, 0, 0)); std::map::iterator it; for(it = Atlas.begin(); it != Atlas.end(); it++) @@ -126,7 +133,7 @@ bool Font::Initialize(std::string fontPath, SDL_Color color) } SDL_LockMutex(SDL::GetMutex()); - SDL_SetColorKey(atlasSurface, SDL_TRUE, SDL_MapRGB(atlasSurface->format, 0, 0, 0)); + SDL_SetColorKey(atlasSurface, SDL_TRUE, SDL_MapRGB(atlasSurface->format, 0x00, 0x00, 0x00)); Texture = SDL_CreateTextureFromSurface(SDL::GetRenderer(), atlasSurface); SDL_FreeSurface(atlasSurface); SDL_UnlockMutex(SDL::GetMutex()); diff --git a/RetroFE/Source/Graphics/Font.h b/RetroFE/Source/Graphics/Font.h index 83cad32..6c11350 100644 --- a/RetroFE/Source/Graphics/Font.h +++ b/RetroFE/Source/Graphics/Font.h @@ -22,7 +22,7 @@ public: Font(); virtual ~Font(); - bool Initialize(std::string fontPath, SDL_Color color); + bool Initialize(std::string fontPath); void DeInitialize(); SDL_Texture *GetTexture(); bool GetRect(unsigned int charCode, GlyphInfo &glyph); diff --git a/RetroFE/Source/Graphics/FontCache.cpp b/RetroFE/Source/Graphics/FontCache.cpp index ee5b715..e627542 100644 --- a/RetroFE/Source/Graphics/FontCache.cpp +++ b/RetroFE/Source/Graphics/FontCache.cpp @@ -66,14 +66,14 @@ Font *FontCache::GetFont(std::string fontPath) return t; } -bool FontCache::LoadFont(std::string fontPath, SDL_Color color) +bool FontCache::LoadFont(std::string fontPath) { std::map::iterator it = FontFaceMap.find(fontPath); if(it == FontFaceMap.end()) { Font *f = new Font(); - f->Initialize(fontPath, color); + f->Initialize(fontPath); FontFaceMap[fontPath] = f; } diff --git a/RetroFE/Source/Graphics/FontCache.h b/RetroFE/Source/Graphics/FontCache.h index c2fe4db..51a0d3c 100644 --- a/RetroFE/Source/Graphics/FontCache.h +++ b/RetroFE/Source/Graphics/FontCache.h @@ -13,7 +13,7 @@ public: void Initialize(); void DeInitialize(); FontCache(); - bool LoadFont(std::string font, SDL_Color color); + bool LoadFont(std::string font); Font *GetFont(std::string font); virtual ~FontCache(); diff --git a/RetroFE/Source/Graphics/PageBuilder.cpp b/RetroFE/Source/Graphics/PageBuilder.cpp index 5ae4c83..eb10907 100644 --- a/RetroFE/Source/Graphics/PageBuilder.cpp +++ b/RetroFE/Source/Graphics/PageBuilder.cpp @@ -363,7 +363,7 @@ bool PageBuilder::BuildComponents(xml_node<> *layout, Page *page) } else { - FC->LoadFont(Font, FontColor); + FC->LoadFont(Font); Text *c = new Text(value->value(), FC->GetFont(Font), FontColor, ScaleX, ScaleY); ViewInfo *v = c->GetBaseViewInfo(); @@ -427,7 +427,7 @@ void PageBuilder::LoadReloadableImages(xml_node<> *layout, std::string tagName, { if(type) { - FC->LoadFont(Font, FontColor); + FC->LoadFont(Font); c = new ReloadableText(type->value(), FC->GetFont(Font), FontColor, LayoutKey, Collection, ScaleX, ScaleY); } } @@ -500,7 +500,7 @@ ScrollingList * PageBuilder::BuildMenu(xml_node<> *menuXml) } // on default, text will be rendered to the menu. Preload it into cache. - FC->LoadFont(Font, FontColor); + FC->LoadFont(Font); menu = new ScrollingList(Config, ScaleX, ScaleY, FC->GetFont(Font), FontColor, LayoutKey, Collection, imageType);