mirror of
https://github.com/wiiu-env/NotificationModule.git
synced 2024-11-23 11:59:15 +01:00
Improve font system init logic
This commit is contained in:
parent
e19f9ba398
commit
209f2c1805
16
src/main.cpp
16
src/main.cpp
@ -40,20 +40,20 @@ WUMS_INITIALIZE() {
|
|||||||
if (gContextState == nullptr) {
|
if (gContextState == nullptr) {
|
||||||
OSFatal("NotificationModule: Failed to allocate gContextState");
|
OSFatal("NotificationModule: Failed to allocate gContextState");
|
||||||
} else {
|
} else {
|
||||||
DEBUG_FUNCTION_LINE("Allocated %d bytes for gCont extState", sizeof(GX2ContextState));
|
DEBUG_FUNCTION_LINE_VERBOSE("Allocated %d bytes for gContextState", sizeof(GX2ContextState));
|
||||||
}
|
}
|
||||||
|
|
||||||
void *font = nullptr;
|
void *font = nullptr;
|
||||||
uint32_t size = 0;
|
uint32_t size = 0;
|
||||||
OSGetSharedData(OS_SHAREDDATATYPE_FONT_STANDARD, 0, &font, &size);
|
if (OSGetSharedData(OS_SHAREDDATATYPE_FONT_STANDARD, 0, &font, &size) && font && size > 0) {
|
||||||
if (font && size) {
|
|
||||||
gFontSystem = new (std::nothrow) SchriftGX2((uint8_t *) font, (int32_t) size);
|
gFontSystem = new (std::nothrow) SchriftGX2((uint8_t *) font, (int32_t) size);
|
||||||
if (gFontSystem) {
|
|
||||||
GuiText::setPresetFont(gFontSystem);
|
|
||||||
} else {
|
|
||||||
DEBUG_FUNCTION_LINE_ERR("Failed to init font system");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (gFontSystem != nullptr) {
|
||||||
|
GuiText::setPresetFont(gFontSystem);
|
||||||
|
} else {
|
||||||
|
OSFatal("NotificationModule: Failed to init font system");
|
||||||
|
}
|
||||||
|
|
||||||
OSMemoryBarrier();
|
OSMemoryBarrier();
|
||||||
deinitLogging();
|
deinitLogging();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user