Switch all images to dynamic lookup in the atlas by string ID.
SLN fix It works, but with the wrong images and the wrong characters! Fix another bug in atlastool's binary output Get Android building again. Oops, didn't mean to disable this permanently. Error checking Minor cleanup Gotta tweak my git ignores... Regenerate metadata
This commit is contained in:
parent
7e9578e49d
commit
45d94c4877
51 changed files with 676 additions and 476 deletions
|
@ -51,6 +51,7 @@
|
|||
#include "file/zip_read.h"
|
||||
#include "net/http_client.h"
|
||||
#include "net/resolve.h"
|
||||
#include "gfx/texture_atlas.h"
|
||||
#include "gfx_es2/draw_text.h"
|
||||
#include "gfx_es2/gpu_features.h"
|
||||
#include "i18n/i18n.h"
|
||||
|
@ -90,7 +91,6 @@
|
|||
#include "Core/WebServer.h"
|
||||
#include "GPU/GPUInterface.h"
|
||||
|
||||
#include "ui_atlas.h"
|
||||
#include "UI/EmuScreen.h"
|
||||
#include "UI/GameInfoCache.h"
|
||||
#include "UI/HostTypes.h"
|
||||
|
@ -121,6 +121,8 @@
|
|||
|
||||
static UI::Theme ui_theme;
|
||||
|
||||
Atlas g_ui_atlas;
|
||||
|
||||
#if defined(ARM) && defined(__ANDROID__)
|
||||
#include "../../android/jni/ArmEmitterTest.h"
|
||||
#elif defined(ARM64) && defined(__ANDROID__)
|
||||
|
@ -750,20 +752,20 @@ static UI::Style MakeStyle(uint32_t fg, uint32_t bg) {
|
|||
|
||||
static void UIThemeInit() {
|
||||
#if defined(USING_WIN_UI) || PPSSPP_PLATFORM(UWP) || defined(USING_QT_UI)
|
||||
ui_theme.uiFont = UI::FontStyle(UBUNTU24, g_Config.sFont.c_str(), 22);
|
||||
ui_theme.uiFontSmall = UI::FontStyle(UBUNTU24, g_Config.sFont.c_str(), 15);
|
||||
ui_theme.uiFontSmaller = UI::FontStyle(UBUNTU24, g_Config.sFont.c_str(), 12);
|
||||
ui_theme.uiFont = UI::FontStyle(FontID("UBUNTU24"), g_Config.sFont.c_str(), 22);
|
||||
ui_theme.uiFontSmall = UI::FontStyle(FontID("UBUNTU24"), g_Config.sFont.c_str(), 15);
|
||||
ui_theme.uiFontSmaller = UI::FontStyle(FontID("UBUNTU24"), g_Config.sFont.c_str(), 12);
|
||||
#else
|
||||
ui_theme.uiFont = UI::FontStyle(UBUNTU24, "", 20);
|
||||
ui_theme.uiFontSmall = UI::FontStyle(UBUNTU24, "", 14);
|
||||
ui_theme.uiFontSmaller = UI::FontStyle(UBUNTU24, "", 11);
|
||||
ui_theme.uiFont = UI::FontStyle(FontID("UBUNTU24"), "", 20);
|
||||
ui_theme.uiFontSmall = UI::FontStyle(FontID("UBUNTU24"), "", 14);
|
||||
ui_theme.uiFontSmaller = UI::FontStyle(FontID("UBUNTU24"), "", 11);
|
||||
#endif
|
||||
|
||||
ui_theme.checkOn = I_CHECKEDBOX;
|
||||
ui_theme.checkOff = I_SQUARE;
|
||||
ui_theme.whiteImage = I_SOLIDWHITE;
|
||||
ui_theme.sliderKnob = I_CIRCLE;
|
||||
ui_theme.dropShadow4Grid = I_DROP_SHADOW;
|
||||
ui_theme.checkOn = ImageID("I_CHECKEDBOX");
|
||||
ui_theme.checkOff = ImageID("I_SQUARE");
|
||||
ui_theme.whiteImage = ImageID("I_SOLIDWHITE");
|
||||
ui_theme.sliderKnob = ImageID("I_CIRCLE");
|
||||
ui_theme.dropShadow4Grid = ImageID("I_DROP_SHADOW");
|
||||
|
||||
ui_theme.itemStyle = MakeStyle(g_Config.uItemStyleFg, g_Config.uItemStyleBg);
|
||||
ui_theme.itemFocusedStyle = MakeStyle(g_Config.uItemFocusedStyleFg, g_Config.uItemFocusedStyleBg);
|
||||
|
@ -799,8 +801,17 @@ bool NativeInitGraphics(GraphicsContext *graphicsContext) {
|
|||
_assert_msg_(G3D, g_draw, "No draw context available!");
|
||||
_assert_msg_(G3D, g_draw->GetVshaderPreset(VS_COLOR_2D) != nullptr, "Failed to compile presets");
|
||||
|
||||
ui_draw2d.SetAtlas(&ui_atlas);
|
||||
ui_draw2d_front.SetAtlas(&ui_atlas);
|
||||
// Load the atlas.
|
||||
|
||||
size_t atlas_data_size = 0;
|
||||
if (!g_ui_atlas.IsMetadataLoaded()) {
|
||||
const uint8_t *atlas_data = VFSReadFile("ui_atlas.meta", &atlas_data_size);
|
||||
bool load_success = g_ui_atlas.Load(atlas_data, atlas_data_size);
|
||||
_assert_msg_(G3D, load_success, "Failed to load ui_atlas.meta");
|
||||
delete[] atlas_data;
|
||||
}
|
||||
ui_draw2d.SetAtlas(&g_ui_atlas);
|
||||
ui_draw2d_front.SetAtlas(&g_ui_atlas);
|
||||
|
||||
UIThemeInit();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue