Minor fixes
This commit is contained in:
parent
df09e9ed1b
commit
244d058f1b
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
|
.*/
|
||||||
*~
|
*~
|
||||||
*.exe
|
*.exe
|
||||||
*.o
|
*.o
|
||||||
|
@ -9,6 +9,10 @@
|
|||||||
#define FONT_FACES_MAX 2
|
#define FONT_FACES_MAX 2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __SWITCH__
|
||||||
|
static bool s_plinited;
|
||||||
|
#endif
|
||||||
|
|
||||||
static FT_Error s_font_libret=1, s_font_facesret[FONT_FACES_MAX];
|
static FT_Error s_font_libret=1, s_font_facesret[FONT_FACES_MAX];
|
||||||
|
|
||||||
static FT_Library s_font_library;
|
static FT_Library s_font_library;
|
||||||
@ -364,7 +368,11 @@ bool fontInitialize(void)
|
|||||||
PlFontData fonts[PlSharedFontType_Total];
|
PlFontData fonts[PlSharedFontType_Total];
|
||||||
|
|
||||||
Result rc=0;
|
Result rc=0;
|
||||||
rc = plGetSharedFont(textGetLanguageCode(), fonts, FONT_FACES_MAX, &s_font_faces_total);
|
rc = plInitialize(PlServiceType_User);
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
s_plinited = true;
|
||||||
|
rc = plGetSharedFont(textGetLanguageCode(), fonts, FONT_FACES_MAX, &s_font_faces_total);
|
||||||
|
}
|
||||||
if (R_FAILED(rc)) return false;
|
if (R_FAILED(rc)) return false;
|
||||||
|
|
||||||
for (i=0; i<s_font_faces_total; i++) {
|
for (i=0; i<s_font_faces_total; i++) {
|
||||||
@ -410,6 +418,10 @@ void fontExit()
|
|||||||
if (s_font_facesret[i]==0) FT_Done_Face(s_font_faces[i]);
|
if (s_font_facesret[i]==0) FT_Done_Face(s_font_faces[i]);
|
||||||
|
|
||||||
if (s_font_libret==0) FT_Done_FreeType(s_font_library);
|
if (s_font_libret==0) FT_Done_FreeType(s_font_library);
|
||||||
|
|
||||||
|
#ifdef __SWITCH__
|
||||||
|
if (s_plinited) plExit();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Automatically gives you the desired x-coordinate
|
/*Automatically gives you the desired x-coordinate
|
||||||
|
@ -71,7 +71,7 @@ static void launchFile(const char* path, argData_s* args)
|
|||||||
Result rc = envSetNextLoad(path, argBuf);
|
Result rc = envSetNextLoad(path, argBuf);
|
||||||
if(R_FAILED(rc)) {
|
if(R_FAILED(rc)) {
|
||||||
memset(msg, 0, sizeof(msg));
|
memset(msg, 0, sizeof(msg));
|
||||||
snprintf(msg, sizeof(msg)-1, "%s\n0x%x", textGetString(StrId_AppLaunchError), rc);
|
snprintf(msg, sizeof(msg)-1, "%s\n2%03d-%04d", textGetString(StrId_AppLaunchError), R_MODULE(rc), R_DESCRIPTION(rc));
|
||||||
|
|
||||||
menuCreateMsgBox(780, 300, msg);
|
menuCreateMsgBox(780, 300, msg);
|
||||||
}
|
}
|
||||||
|
@ -44,21 +44,17 @@ int main(int argc, char **argv)
|
|||||||
appletLockExit();
|
appletLockExit();
|
||||||
appletSetScreenShotPermission(AppletScreenShotPermission_Enable);
|
appletSetScreenShotPermission(AppletScreenShotPermission_Enable);
|
||||||
|
|
||||||
ColorSetId theme;
|
ColorSetId theme = ColorSetId_Light;
|
||||||
rc = setsysInitialize();
|
rc = setsysInitialize();
|
||||||
if (R_FAILED(rc)) snprintf(errormsg, sizeof(errormsg)-1, "Error: setsysInitialize() failed: 0x%x.", rc);
|
|
||||||
|
|
||||||
if (R_SUCCEEDED(rc)) setsysGetColorSetId(&theme);
|
|
||||||
|
|
||||||
if (R_SUCCEEDED(rc)) {
|
if (R_SUCCEEDED(rc)) {
|
||||||
rc = plInitialize(PlServiceType_User);
|
setsysGetColorSetId(&theme);
|
||||||
if (R_FAILED(rc)) snprintf(errormsg, sizeof(errormsg)-1, "Error: plInitialize() failed: 0x%x.", rc);
|
setsysExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (R_SUCCEEDED(rc)) {
|
if (R_SUCCEEDED(rc)) {
|
||||||
rc = textInit();
|
rc = textInit();
|
||||||
if (R_FAILED(rc)) {
|
if (R_FAILED(rc)) {
|
||||||
snprintf(errormsg, sizeof(errormsg)-1, "Error: textInit() failed: 0x%x.", rc);
|
snprintf(errormsg, sizeof(errormsg)-1, "Error: textInit() failed: 2%03d-%04d", R_MODULE(rc), R_DESCRIPTION(rc));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +63,7 @@ int main(int argc, char **argv)
|
|||||||
if (R_SUCCEEDED(rc)) {
|
if (R_SUCCEEDED(rc)) {
|
||||||
rc = assetsInit();
|
rc = assetsInit();
|
||||||
if (R_FAILED(rc)) {
|
if (R_FAILED(rc)) {
|
||||||
snprintf(errormsg, sizeof(errormsg)-1, "Error: assetsInit() failed: 0x%x.", rc);
|
snprintf(errormsg, sizeof(errormsg)-1, "Error: assetsInit() failed: 2%03d-%04d", R_MODULE(rc), R_DESCRIPTION(rc));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,7 +74,7 @@ int main(int argc, char **argv)
|
|||||||
if (R_SUCCEEDED(rc)) {
|
if (R_SUCCEEDED(rc)) {
|
||||||
rc = netloaderInit();
|
rc = netloaderInit();
|
||||||
if (R_FAILED(rc)) {
|
if (R_FAILED(rc)) {
|
||||||
snprintf(errormsg, sizeof(errormsg)-1, "Error: netloaderInit() failed: 0x%x.", rc);
|
snprintf(errormsg, sizeof(errormsg)-1, "Error: netloaderInit() failed: 2%03d-%04d", R_MODULE(rc), R_DESCRIPTION(rc));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,7 +111,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
if (R_FAILED(lastret)) {
|
if (R_FAILED(lastret)) {
|
||||||
memset(msg, 0, sizeof(msg));
|
memset(msg, 0, sizeof(msg));
|
||||||
snprintf(msg, sizeof(msg)-1, "%s\n0x%x", textGetString(StrId_LastLoadResult), lastret);
|
snprintf(msg, sizeof(msg)-1, "%s\n2%03d-%04d", textGetString(StrId_LastLoadResult), R_MODULE(lastret), R_DESCRIPTION(lastret));
|
||||||
|
|
||||||
menuCreateMsgBox(780, 300, msg);
|
menuCreateMsgBox(780, 300, msg);
|
||||||
}
|
}
|
||||||
@ -144,7 +140,7 @@ int main(int argc, char **argv)
|
|||||||
if (!uiUpdate()) break;
|
if (!uiUpdate()) break;
|
||||||
g_framebuf = framebufferBegin(&g_framebufObj, &g_framebuf_width);
|
g_framebuf = framebufferBegin(&g_framebufObj, &g_framebuf_width);
|
||||||
#ifdef PERF_LOG
|
#ifdef PERF_LOG
|
||||||
start_tick = svcGetSystemTick();
|
start_tick = armGetSystemTick();
|
||||||
#endif
|
#endif
|
||||||
memset(g_framebuf, 237, g_framebuf_width * FB_HEIGHT);
|
memset(g_framebuf, 237, g_framebuf_width * FB_HEIGHT);
|
||||||
menuLoop();
|
menuLoop();
|
||||||
@ -157,7 +153,7 @@ int main(int argc, char **argv)
|
|||||||
framebufferEnd(&g_framebufObj);
|
framebufferEnd(&g_framebufObj);
|
||||||
|
|
||||||
#ifdef PERF_LOG
|
#ifdef PERF_LOG
|
||||||
g_tickdiff_frame = svcGetSystemTick() - start_tick;
|
g_tickdiff_frame = armGetSystemTick() - start_tick;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -185,8 +181,6 @@ int main(int argc, char **argv)
|
|||||||
netloaderExit();
|
netloaderExit();
|
||||||
powerExit();
|
powerExit();
|
||||||
assetsExit();
|
assetsExit();
|
||||||
plExit();
|
|
||||||
setsysExit();
|
|
||||||
|
|
||||||
appletUnlockExit();
|
appletUnlockExit();
|
||||||
|
|
||||||
@ -211,7 +205,7 @@ bool menuUpdate(void) {
|
|||||||
u64 down = menuGetKeysDown();
|
u64 down = menuGetKeysDown();
|
||||||
ThemeLayoutObject *layoutobj = &themeCurrent.layoutObjects[ThemeLayoutId_MenuListTiles];
|
ThemeLayoutObject *layoutobj = &themeCurrent.layoutObjects[ThemeLayoutId_MenuListTiles];
|
||||||
int entries_count = layoutobj->posEnd[0];
|
int entries_count = layoutobj->posEnd[0];
|
||||||
|
|
||||||
handleTouch(menu);
|
handleTouch(menu);
|
||||||
|
|
||||||
if (down & KEY_Y)
|
if (down & KEY_Y)
|
||||||
|
Loading…
Reference in New Issue
Block a user