3DS: Move setting render screen out of Launcher code

This commit is contained in:
UnknownShadow200 2024-02-03 14:45:44 +11:00
parent 61e901ec10
commit a2710e044a
3 changed files with 12 additions and 11 deletions

View file

@ -236,9 +236,6 @@ void Launcher_Run(void) {
Options_Set("update-dirty", NULL);
}
#endif
enum Screen3DS scr = Window_3DS_SetRenderScreen(BOTTOM_SCREEN);
Drawer2D_Component.Init();
SystemFonts_Component.Init();
Drawer2D.BitmappedText = false;
@ -299,8 +296,6 @@ void Launcher_Run(void) {
if (Window_Main.Exists) Window_RequestClose();
#endif
Window_3DS_SetRenderScreen(scr);
}
@ -548,7 +543,7 @@ static void DrawTitleText(struct FontDesc* font, const char* text, struct Contex
#ifdef CC_BUILD_DUALSCREEN
void Launcher_DrawTitle(struct FontDesc* font, const char* text, struct Context2D* ctx) {
/* Put title on top screen */
enum Screen3DS scr = Window_3DS_SetRenderScreen(TOP_SCREEN);
Window_3DS_SetRenderScreen(TOP_SCREEN);
struct Context2D topCtx;
struct Bitmap bmp;
@ -560,10 +555,10 @@ void Launcher_DrawTitle(struct FontDesc* font, const char* text, struct Context2
Launcher_DrawBackgroundAll(ctx);
DrawTitleText(font, text, ctx, ANCHOR_CENTRE, ANCHOR_CENTRE);
Rect2D rect = { 0, 0, bmp.width, bmp.height };
Window_DrawFramebuffer(rect, &bmp);
Window_3DS_SetRenderScreen(scr);
Window_3DS_SetRenderScreen(BOTTOM_SCREEN);
Window_FreeFramebuffer(&bmp);
}
#else

View file

@ -57,7 +57,7 @@ void Platform_Log(const char* msg, int len) {
write(STDOUT_FILENO, msg, len);
write(STDOUT_FILENO, "\n", 1);
// output to debug service (visible in Citra with log level set to "*:Debug", or on console via remote gdb)
// output to debug service (visible in Citra with log level set to "Debug.Emulated:Debug", or on console via remote gdb)
svcOutputDebugString(msg, len);
svcOutputDebugString("\n", 1);
}

View file

@ -69,8 +69,14 @@ enum Screen3DS Window_3DS_SetRenderScreen(enum Screen3DS screen) {
return prev;
}
void Window_Create2D(int width, int height) { launcherMode = true; }
void Window_Create3D(int width, int height) { launcherMode = false; }
void Window_Create2D(int width, int height) {
Window_3DS_SetRenderScreen(BOTTOM_SCREEN);
launcherMode = true;
}
void Window_Create3D(int width, int height) {
Window_3DS_SetRenderScreen(TOP_SCREEN);
launcherMode = false;
}
void Window_SetTitle(const cc_string* title) { }
void Clipboard_GetText(cc_string* value) { }