Minor fixes
This commit is contained in:
parent
df09e9ed1b
commit
244d058f1b
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
.*/
|
||||
*~
|
||||
*.exe
|
||||
*.o
|
||||
|
@ -9,6 +9,10 @@
|
||||
#define FONT_FACES_MAX 2
|
||||
#endif
|
||||
|
||||
#ifdef __SWITCH__
|
||||
static bool s_plinited;
|
||||
#endif
|
||||
|
||||
static FT_Error s_font_libret=1, s_font_facesret[FONT_FACES_MAX];
|
||||
|
||||
static FT_Library s_font_library;
|
||||
@ -364,7 +368,11 @@ bool fontInitialize(void)
|
||||
PlFontData fonts[PlSharedFontType_Total];
|
||||
|
||||
Result rc=0;
|
||||
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;
|
||||
|
||||
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_libret==0) FT_Done_FreeType(s_font_library);
|
||||
|
||||
#ifdef __SWITCH__
|
||||
if (s_plinited) plExit();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*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);
|
||||
if(R_FAILED(rc)) {
|
||||
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);
|
||||
}
|
||||
|
@ -44,21 +44,17 @@ int main(int argc, char **argv)
|
||||
appletLockExit();
|
||||
appletSetScreenShotPermission(AppletScreenShotPermission_Enable);
|
||||
|
||||
ColorSetId theme;
|
||||
ColorSetId theme = ColorSetId_Light;
|
||||
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)) {
|
||||
rc = plInitialize(PlServiceType_User);
|
||||
if (R_FAILED(rc)) snprintf(errormsg, sizeof(errormsg)-1, "Error: plInitialize() failed: 0x%x.", rc);
|
||||
setsysGetColorSetId(&theme);
|
||||
setsysExit();
|
||||
}
|
||||
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
rc = textInit();
|
||||
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)) {
|
||||
rc = assetsInit();
|
||||
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)) {
|
||||
rc = netloaderInit();
|
||||
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)) {
|
||||
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);
|
||||
}
|
||||
@ -144,7 +140,7 @@ int main(int argc, char **argv)
|
||||
if (!uiUpdate()) break;
|
||||
g_framebuf = framebufferBegin(&g_framebufObj, &g_framebuf_width);
|
||||
#ifdef PERF_LOG
|
||||
start_tick = svcGetSystemTick();
|
||||
start_tick = armGetSystemTick();
|
||||
#endif
|
||||
memset(g_framebuf, 237, g_framebuf_width * FB_HEIGHT);
|
||||
menuLoop();
|
||||
@ -157,7 +153,7 @@ int main(int argc, char **argv)
|
||||
framebufferEnd(&g_framebufObj);
|
||||
|
||||
#ifdef PERF_LOG
|
||||
g_tickdiff_frame = svcGetSystemTick() - start_tick;
|
||||
g_tickdiff_frame = armGetSystemTick() - start_tick;
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
@ -185,8 +181,6 @@ int main(int argc, char **argv)
|
||||
netloaderExit();
|
||||
powerExit();
|
||||
assetsExit();
|
||||
plExit();
|
||||
setsysExit();
|
||||
|
||||
appletUnlockExit();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user