diff --git a/src/32x/Window_32x.c b/src/32x/Window_32x.c index 96dcb14d5..808b8b3f2 100644 --- a/src/32x/Window_32x.c +++ b/src/32x/Window_32x.c @@ -21,8 +21,6 @@ #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 200 -static cc_bool launcherMode; - struct _DisplayData DisplayInfo; struct cc_window WindowInfo; @@ -52,12 +50,12 @@ void Window_Free(void) { } void Window_Create2D(int width, int height) { Hw32xScreenClear(); - launcherMode = true; + Window_Main.Is3D = false; } void Window_Create3D(int width, int height) { Hw32xScreenClear(); - launcherMode = false; + Window_Main.Is3D = true; } void Window_Destroy(void) { } diff --git a/src/3ds/Window_3DS.c b/src/3ds/Window_3DS.c index ff6bab4fb..7a11c5764 100644 --- a/src/3ds/Window_3DS.c +++ b/src/3ds/Window_3DS.c @@ -12,7 +12,6 @@ #include <3ds.h> -static cc_bool launcherMode; static u16 top_width, top_height; static u16 btm_width, btm_height; #include "../VirtualKeyboard.h" @@ -58,18 +57,22 @@ void Window_Init(void) { void Window_Free(void) { irrstExit(); } -void Window_Create2D(int width, int height) { +void Window_Create2D(int width, int height) { + Window_Main.Is3D = false; + Window_Alt.Is3D = false; + DisplayInfo.Width = btm_width; Window_Main.Width = btm_width; Window_Alt.Width = top_width; - launcherMode = true; } void Window_Create3D(int width, int height) { + Window_Main.Is3D = true; + Window_Alt.Is3D = true; + DisplayInfo.Width = top_width; Window_Main.Width = top_width; Window_Alt.Width = btm_width; - launcherMode = false; } void Window_Destroy(void) { } @@ -260,7 +263,7 @@ void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { kb_tileWidth = 20; kb_tileHeight = 20; - VirtualKeyboard_Open(args, launcherMode); + VirtualKeyboard_Open(args); } void OnscreenKeyboard_SetText(const cc_string* text) { diff --git a/src/VirtualCursor.h b/src/VirtualCursor.h index 46d121a78..950226eed 100644 --- a/src/VirtualCursor.h +++ b/src/VirtualCursor.h @@ -73,6 +73,6 @@ static void VirtualCursor_SetPosition(int x, int y) { Game.Draw2DHooks[3] = VirtualCursor_Display3D; /* TODO better dirty region tracking */ - if (launcherMode) LBackend_Redraw(); + if (!Window_Main.Is3D) LBackend_Redraw(); } diff --git a/src/VirtualKeyboard.h b/src/VirtualKeyboard.h index 961f787e5..25fb6641d 100644 --- a/src/VirtualKeyboard.h +++ b/src/VirtualKeyboard.h @@ -185,7 +185,7 @@ static void VirtualKeyboard_CalcPosition(int* x, int* y, int width, int height) static int VirtualKeyboard_WindowWidth(void) { #ifdef CC_BUILD_DUALSCREEN - return launcherMode ? Window_Main.Width : Window_Alt.Width; + return Window_Main.Is3D ? Window_Alt.Width : Window_Main.Width; #else return Window_Main.Width; #endif @@ -193,7 +193,7 @@ static int VirtualKeyboard_WindowWidth(void) { static int VirtualKeyboard_WindowHeight(void) { #ifdef CC_BUILD_DUALSCREEN - return launcherMode ? Window_Main.Height : Window_Alt.Height; + return Window_Main.Is3D ? Window_Alt.Height : Window_Main.Height; #else return Window_Main.Height; #endif @@ -439,7 +439,7 @@ static void VirtualKeyboard_Hook(void) { PointerHooks.UpHook = VirtualKeyboard_PointerUp; } -static void VirtualKeyboard_Open(struct OpenKeyboardArgs* args, cc_bool launcher) { +static void VirtualKeyboard_Open(struct OpenKeyboardArgs* args) { VirtualKeyboard_Close(); VirtualKeyboard_Init(); DisplayInfo.ShowingSoftKeyboard = true; @@ -457,10 +457,10 @@ static void VirtualKeyboard_Open(struct OpenKeyboardArgs* args, cc_bool launcher kb_str.length = 0; String_AppendString(&kb_str, args->text); - if (launcher) { - KB_MarkDirty = VirtualKeyboard_MarkDirty2D; - } else { + if (Window_Main.Is3D) { KB_MarkDirty = VirtualKeyboard_MarkDirty3D; + } else { + KB_MarkDirty = VirtualKeyboard_MarkDirty2D; } Window_Main.SoftKeyboardFocus = true; diff --git a/src/Window_N64.c b/src/Window_N64.c index 901d6745c..5e848a3a4 100644 --- a/src/Window_N64.c +++ b/src/Window_N64.c @@ -15,7 +15,6 @@ #include "Options.h" #include -static cc_bool launcherMode; #include "VirtualCursor.h" struct _DisplayData DisplayInfo; @@ -48,8 +47,8 @@ void Window_Init(void) { void Window_Free(void) { } -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_Main.Is3D = false; } +void Window_Create3D(int width, int height) { Window_Main.Is3D = true; } void Window_Destroy(void) { } @@ -212,7 +211,7 @@ void Window_FreeFramebuffer(struct Bitmap* bmp) { void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { kb_tileWidth = KB_TILE_SIZE / 2; kb_tileHeight = KB_TILE_SIZE / 2; - VirtualKeyboard_Open(args, launcherMode); + VirtualKeyboard_Open(args); } void OnscreenKeyboard_SetText(const cc_string* text) { diff --git a/src/Window_ios.m b/src/Window_ios.m index 86424dd35..a89ab036b 100644 --- a/src/Window_ios.m +++ b/src/Window_ios.m @@ -49,7 +49,6 @@ void LogUnhandledNSErrors(NSException* ex); @interface CCViewController : UIViewController @end static UIWindow* win_handle; -static cc_bool launcherMode; static void AddTouch(UITouch* t) { CGPoint loc = [t locationInView:view_handle]; @@ -100,8 +99,8 @@ static CGRect GetViewFrame(void) { // touchesBegan:withEvent - iOS 2.0 for (UITouch* t in touches) AddTouch(t); - // clicking on the background should dismiss onscren keyboard - if (launcherMode) { [view_handle endEditing:NO]; } + // clicking on the background should dismiss onscreen keyboard + if (!Window_Main.Is3D) { [view_handle endEditing:NO]; } } - (void)touchesMoved:(NSSet*)touches withEvent:(UIEvent *)event { @@ -532,7 +531,7 @@ cc_result Window_SaveFileDialog(const struct SaveFileDialogArgs* args) { static void Init3DLayer(void); void Window_Create2D(int width, int height) { - launcherMode = true; + Window_Main.Is3D = false; CGRect bounds = DoCreateWindow(); view_handle = [[UIView alloc] initWithFrame:bounds]; @@ -541,7 +540,7 @@ void Window_Create2D(int width, int height) { } void Window_Create3D(int width, int height) { - launcherMode = false; + Window_Main.Is3D = true; CGRect bounds = DoCreateWindow(); view_handle = [[CC3DView alloc] initWithFrame:bounds]; diff --git a/src/dreamcast/Window_Dreamcast.c b/src/dreamcast/Window_Dreamcast.c index ead8196ed..e5822ebf5 100644 --- a/src/dreamcast/Window_Dreamcast.c +++ b/src/dreamcast/Window_Dreamcast.c @@ -12,7 +12,6 @@ #include "../VirtualKeyboard.h" #include -static cc_bool launcherMode; #include "../VirtualCursor.h" cc_bool window_inited; @@ -48,10 +47,11 @@ void Window_Init(void) { void Window_Free(void) { } void Window_Create2D(int width, int height) { - launcherMode = true; + Window_Main.Is3D = false; } + void Window_Create3D(int width, int height) { - launcherMode = false; + Window_Main.Is3D = true; } void Window_Destroy(void) { } @@ -356,7 +356,7 @@ void Window_FreeFramebuffer(struct Bitmap* bmp) { *#########################################################################################################################*/ void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { if (Input.Sources & INPUT_SOURCE_NORMAL) return; - VirtualKeyboard_Open(args, launcherMode); + VirtualKeyboard_Open(args); } void OnscreenKeyboard_SetText(const cc_string* text) { diff --git a/src/gcwii/Window_GCWii.c b/src/gcwii/Window_GCWii.c index 3c841103b..fd9eb5f95 100644 --- a/src/gcwii/Window_GCWii.c +++ b/src/gcwii/Window_GCWii.c @@ -20,7 +20,6 @@ #endif static cc_bool needsFBUpdate; -static cc_bool launcherMode; static int mouseSupported; #include "../VirtualCursor.h" static void* xfb; @@ -93,11 +92,11 @@ void Window_Free(void) { } void Window_Create2D(int width, int height) { needsFBUpdate = true; - launcherMode = true; + Window_Main.Is3D = false; } void Window_Create3D(int width, int height) { - launcherMode = false; + Window_Main.Is3D = true; } void Window_Destroy(void) { } @@ -582,7 +581,7 @@ void Window_FreeFramebuffer(struct Bitmap* bmp) { *#########################################################################################################################*/ void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { if (Input.Sources & INPUT_SOURCE_NORMAL) return; - VirtualKeyboard_Open(args, launcherMode); + VirtualKeyboard_Open(args); } void OnscreenKeyboard_SetText(const cc_string* text) { diff --git a/src/nds/Window_NDS.c b/src/nds/Window_NDS.c index beb74806a..97a903c5f 100644 --- a/src/nds/Window_NDS.c +++ b/src/nds/Window_NDS.c @@ -127,16 +127,15 @@ static void Console_Init(cc_bool onSub) { /*########################################################################################################################* *------------------------------------------------------General data-------------------------------------------------------* *#########################################################################################################################*/ -static cc_bool launcherMode; static int bg_id; static u16* bg_ptr; struct _DisplayData DisplayInfo; struct cc_window WindowInfo; -static void SetupVideo(cc_bool mode) { - if (launcherMode == mode) return; - launcherMode = mode; +static void SetupVideo(cc_bool is3D) { + if (Window_Main.Is3D == is3D) return; + Window_Main.Is3D = is3D; vramSetBankA(VRAM_A_LCD); vramSetBankB(VRAM_B_LCD); @@ -145,7 +144,7 @@ static void SetupVideo(cc_bool mode) { vramSetBankH(VRAM_H_LCD); vramSetBankI(VRAM_I_LCD); - if (launcherMode) { + if (!is3D) { videoSetModeSub(MODE_5_2D); vramSetBankC(VRAM_C_SUB_BG); @@ -159,11 +158,11 @@ static void SetupVideo(cc_bool mode) { videoSetMode(MODE_0_3D); } - Console_Init(!launcherMode); + Console_Init(is3D); } void Window_PreInit(void) { - SetupVideo(true); + SetupVideo(false); setBrightness(2, 0); } @@ -188,13 +187,13 @@ void Window_Init(void) { void Window_Free(void) { } void Window_Create2D(int width, int height) { - SetupVideo(true); + SetupVideo(false); bg_id = bgInitSub(2, BgType_Bmp16, BgSize_B16_256x256, 2, 0); bg_ptr = bgGetGfxPtr(bg_id); } void Window_Create3D(int width, int height) { - SetupVideo(false); + SetupVideo(true); } void Window_Destroy(void) { } @@ -354,7 +353,7 @@ static void OnKeyPressed(int key) { void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { Keyboard* kbd = keyboardGetDefault(); - if (!launcherMode) videoBgDisableSub(LAYER_CON); + if (Window_Main.Is3D) videoBgDisableSub(LAYER_CON); keyboardInit(kbd, LAYER_KB, BgType_Text4bpp, BgSize_T_256x512, 14, 0, false, true); @@ -374,7 +373,7 @@ void OnscreenKeyboard_Close(void) { if (!DisplayInfo.ShowingSoftKeyboard) return; DisplayInfo.ShowingSoftKeyboard = false; - if (!launcherMode) videoBgEnableSub(LAYER_CON); + if (Window_Main.Is3D) videoBgEnableSub(LAYER_CON); } diff --git a/src/ps1/Window_PS1.c b/src/ps1/Window_PS1.c index ca4623b54..ff3f50226 100644 --- a/src/ps1/Window_PS1.c +++ b/src/ps1/Window_PS1.c @@ -21,7 +21,6 @@ #define SCREEN_XRES 320 #define SCREEN_YRES 240 -static cc_bool launcherMode; struct _DisplayData DisplayInfo; struct cc_window WindowInfo; static int gpu_video_mode; @@ -89,7 +88,7 @@ extern void Gfx_ResetGPU(void); void Window_Create2D(int width, int height) { Gfx_ResetGPU(); - launcherMode = true; + Window_Main.Is3D = false; InitScreen(); ClearScreen(); @@ -97,7 +96,7 @@ void Window_Create2D(int width, int height) { void Window_Create3D(int width, int height) { Gfx_ResetGPU(); - launcherMode = false; + Window_Main.Is3D = true; InitScreen(); } @@ -259,7 +258,7 @@ void Window_FreeFramebuffer(struct Bitmap* bmp) { void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { kb_tileWidth = KB_TILE_SIZE / 2; kb_tileHeight = KB_TILE_SIZE / 2; - VirtualKeyboard_Open(args, launcherMode); + VirtualKeyboard_Open(args); } void OnscreenKeyboard_SetText(const cc_string* text) { diff --git a/src/ps2/Window_PS2.c b/src/ps2/Window_PS2.c index 9c83aaaa4..207e93312 100644 --- a/src/ps2/Window_PS2.c +++ b/src/ps2/Window_PS2.c @@ -24,7 +24,7 @@ #include #include -static cc_bool launcherMode, mouseSupported, kbdSupported; +static cc_bool mouseSupported, kbdSupported; #include "../VirtualCursor.h" struct _DisplayData DisplayInfo; struct cc_window WindowInfo; @@ -112,13 +112,13 @@ static void InitDisplay(framebuffer_t* fb) { void Window_Create2D(int width, int height) { ResetDisplay(); InitDisplay(&fb_colors[0]); - launcherMode = true; + Window_Main.Is3D = false; } void Window_Create3D(int width, int height) { ResetDisplay(); InitDisplay(&fb_colors[0]); - launcherMode = false; + Window_Main.Is3D = true; } void Window_Destroy(void) { } @@ -374,7 +374,7 @@ void Window_FreeFramebuffer(struct Bitmap* bmp) { *#########################################################################################################################*/ void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { if (Input.Sources & INPUT_SOURCE_NORMAL) return; - VirtualKeyboard_Open(args, launcherMode); + VirtualKeyboard_Open(args); } void OnscreenKeyboard_SetText(const cc_string* text) { diff --git a/src/ps3/Window_PS3.c b/src/ps3/Window_PS3.c index 7e5729055..cab179107 100644 --- a/src/ps3/Window_PS3.c +++ b/src/ps3/Window_PS3.c @@ -17,7 +17,6 @@ #include #include -static cc_bool launcherMode; static KbInfo kb_info; static KbData kb_data; static KbConfig kb_config; @@ -70,12 +69,12 @@ void Window_Init(void) { void Window_Free(void) { } void Window_Create2D(int width, int height) { - launcherMode = true; + Window_Main.Is3D = false; Gfx_Create(); // launcher also uses RSX to draw } void Window_Create3D(int width, int height) { - launcherMode = false; + Window_Main.Is3D = true; } void Window_Destroy(void) { } @@ -398,7 +397,7 @@ void Window_FreeFramebuffer(struct Bitmap* bmp) { *#########################################################################################################################*/ void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { if (Input.Sources & INPUT_SOURCE_NORMAL) return; - VirtualKeyboard_Open(args, launcherMode); + VirtualKeyboard_Open(args); } void OnscreenKeyboard_SetText(const cc_string* text) { diff --git a/src/ps4/Window_PS4.c b/src/ps4/Window_PS4.c index 419286db9..ea91398e8 100644 --- a/src/ps4/Window_PS4.c +++ b/src/ps4/Window_PS4.c @@ -13,8 +13,6 @@ #include "../VirtualKeyboard.h" #include -static cc_bool launcherMode; - struct _DisplayData DisplayInfo; struct cc_window WindowInfo; @@ -48,12 +46,11 @@ void Window_Init(void) { void Window_Free(void) { } void Window_Create2D(int width, int height) { - launcherMode = true; - Gfx_Create(); // launcher also uses RSX to draw + Window_Main.Is3D = false; } void Window_Create3D(int width, int height) { - launcherMode = false; + Window_Main.Is3D = true; } void Window_Destroy(void) { } @@ -123,7 +120,7 @@ void Window_FreeFramebuffer(struct Bitmap* bmp) { void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { if (Input.Sources & INPUT_SOURCE_NORMAL) return; - VirtualKeyboard_Open(args, launcherMode); + VirtualKeyboard_Open(args); } void OnscreenKeyboard_SetText(const cc_string* text) { diff --git a/src/psp/Window_PSP.c b/src/psp/Window_PSP.c index 652503976..001a9cbc9 100644 --- a/src/psp/Window_PSP.c +++ b/src/psp/Window_PSP.c @@ -18,7 +18,6 @@ #define BUFFER_WIDTH 512 #define SCREEN_WIDTH 480 #define SCREEN_HEIGHT 272 -static cc_bool launcherMode; struct _DisplayData DisplayInfo; struct cc_window WindowInfo; @@ -46,8 +45,8 @@ void Window_Init(void) { void Window_Free(void) { } -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_Main.Is3D = false; } +void Window_Create3D(int width, int height) { Window_Main.Is3D = true; } void Window_Destroy(void) { } @@ -193,7 +192,7 @@ void Window_FreeFramebuffer(struct Bitmap* bmp) { *------------------------------------------------------Soft keyboard------------------------------------------------------* *#########################################################################################################################*/ void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { - VirtualKeyboard_Open(args, launcherMode); + VirtualKeyboard_Open(args); } void OnscreenKeyboard_SetText(const cc_string* text) { diff --git a/src/psvita/Window_PSVita.c b/src/psvita/Window_PSVita.c index 4648ddfb2..3543bfb9b 100644 --- a/src/psvita/Window_PSVita.c +++ b/src/psvita/Window_PSVita.c @@ -13,7 +13,6 @@ #include -static cc_bool launcherMode; static SceTouchPanelInfo frontPanel, backPanel; struct _DisplayData DisplayInfo; @@ -61,12 +60,12 @@ void Window_Init(void) { void Window_Free(void) { } void Window_Create2D(int width, int height) { - launcherMode = true; - DQ_OnNextFrame = DQ_OnNextFrame2D; + Window_Main.Is3D = false; + DQ_OnNextFrame = DQ_OnNextFrame2D; } void Window_Create3D(int width, int height) { - launcherMode = false; + Window_Main.Is3D = true; } void Window_Destroy(void) { } @@ -315,7 +314,7 @@ cc_result Window_SaveFileDialog(const struct SaveFileDialogArgs* args) { void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { kb_tileWidth = KB_TILE_SIZE * 2; - VirtualKeyboard_Open(args, launcherMode); + VirtualKeyboard_Open(args); } void OnscreenKeyboard_SetText(const cc_string* text) { diff --git a/src/saturn/Window_Saturn.c b/src/saturn/Window_Saturn.c index 52b7ef29d..0ab0d61c4 100644 --- a/src/saturn/Window_Saturn.c +++ b/src/saturn/Window_Saturn.c @@ -18,8 +18,6 @@ #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 224 -static cc_bool launcherMode; - struct _DisplayData DisplayInfo; struct cc_window WindowInfo; @@ -55,7 +53,7 @@ void Window_Init(void) { void Window_Free(void) { } void Window_Create3D(int width, int height) { - launcherMode = false; + Window_Main.Is3D = true; } void Window_Destroy(void) { } @@ -201,7 +199,7 @@ static const vdp2_vram_cycp_t vram_cycp = { }; void Window_Create2D(int width, int height) { - launcherMode = true; + Window_Main.Is3D = false; const vdp2_scrn_bitmap_format_t format = { .scroll_screen = VDP2_SCRN_NBG0, diff --git a/src/switch/Window_Switch.c b/src/switch/Window_Switch.c index 79cace312..bf22d0c5b 100644 --- a/src/switch/Window_Switch.c +++ b/src/switch/Window_Switch.c @@ -14,7 +14,6 @@ #include -static cc_bool launcherMode; static Framebuffer fb; static PadState pad; static AppletHookCookie cookie; @@ -83,10 +82,11 @@ void Window_Free(void) { } void Window_Create2D(int width, int height) { - launcherMode = true; + Window_Main.Is3D = false; } + void Window_Create3D(int width, int height) { - launcherMode = false; + Window_Main.Is3D = true; } void Window_Destroy(void) { } diff --git a/src/symbian/Window_Symbian.cpp b/src/symbian/Window_Symbian.cpp index fe47ec196..6a47daa97 100644 --- a/src/symbian/Window_Symbian.cpp +++ b/src/symbian/Window_Symbian.cpp @@ -42,7 +42,6 @@ extern "C" { class CCContainer; -static cc_bool launcherMode; static cc_bool gameRunning = false; const TUid KUidClassiCube = {0xE212A5C2}; @@ -627,7 +626,8 @@ void CCContainer::SizeChanged() { DisplayInfo.Width = size.iWidth; DisplayInfo.Height = size.iHeight; - if (!launcherMode) { + + if (Window_Main.Is3D) { if (size.iWidth <= 360) { DisplayInfo.ScaleX = 0.5f; DisplayInfo.ScaleY = 0.5f; @@ -636,6 +636,7 @@ void CCContainer::SizeChanged() { DisplayInfo.ScaleY = 1; } } + WindowInfo.Width = size.iWidth; WindowInfo.Height = size.iHeight; Event_RaiseVoid(&WindowEvents.Resized); @@ -660,7 +661,7 @@ CCoeControl* CCContainer::ComponentControl(TInt) const { void CCContainer::Draw(const TRect& aRect) const { #if CC_GFX_BACKEND_IS_GL() - if (!launcherMode) return; + if (Window_Main.Is3D) return; #endif if (iBitmap) { SystemGc().BitBlt(TPoint(0, 0), iBitmap); @@ -822,11 +823,12 @@ void Window_Free(void) { } void Window_Create2D(int width, int height) { - launcherMode = true; + Window_Main.Is3D = false; container->SetExtentToWholeScreen(); } + void Window_Create3D(int width, int height) { - launcherMode = false; + Window_Main.Is3D = true; container->SetExtentToWholeScreen(); } @@ -913,7 +915,7 @@ void ShowDialogCore(const char* title, const char* msg) { void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { #ifdef CC_BUILD_TOUCH - VirtualKeyboard_Open(args, launcherMode); + VirtualKeyboard_Open(args); #endif } diff --git a/src/webclient/interop_web.js b/src/webclient/interop_web.js index a02273bad..34b077fc5 100644 --- a/src/webclient/interop_web.js +++ b/src/webclient/interop_web.js @@ -140,7 +140,7 @@ mergeInto(LibraryManager.library, { var filetype = { description: UTF8ToString(title), - accept: {'applicaion/octet-stream': [UTF8ToString(filter)]} + accept: {'application/octet-stream': [UTF8ToString(filter)]} }; fileTypes.push(filetype); } diff --git a/src/wiiu/Window_WiiU.c b/src/wiiu/Window_WiiU.c index c1444655f..f4f461ad7 100644 --- a/src/wiiu/Window_WiiU.c +++ b/src/wiiu/Window_WiiU.c @@ -29,7 +29,6 @@ #include #include -static cc_bool launcherMode; struct _DisplayData DisplayInfo; struct cc_window WindowInfo; struct cc_window Window_Alt; @@ -112,7 +111,7 @@ void Window_Create2D(int width, int height) { Window_Main.Width = OSSCREEN_DRC_WIDTH; Window_Main.Height = OSSCREEN_DRC_HEIGHT; - launcherMode = true; + Window_Main.Is3D = false; Event_Register_(&WindowEvents.InactiveChanged, NULL, LauncherInactiveChanged); Init2DResources(); } @@ -121,7 +120,7 @@ void Window_Create3D(int width, int height) { Window_Main.Width = DisplayInfo.Width; Window_Main.Height = DisplayInfo.Height; - launcherMode = false; + Window_Main.Is3D = true; Event_Unregister_(&WindowEvents.InactiveChanged, NULL, LauncherInactiveChanged); } @@ -478,7 +477,7 @@ cc_result Window_SaveFileDialog(const struct SaveFileDialogArgs* args) { *#########################################################################################################################*/ void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { if (Input.Sources & INPUT_SOURCE_NORMAL) return; - VirtualKeyboard_Open(args, launcherMode); + VirtualKeyboard_Open(args); } void OnscreenKeyboard_SetText(const cc_string* text) { diff --git a/src/xbox/Window_Xbox.c b/src/xbox/Window_Xbox.c index 348102d98..7b01263b4 100644 --- a/src/xbox/Window_Xbox.c +++ b/src/xbox/Window_Xbox.c @@ -16,7 +16,6 @@ #include #include -static cc_bool launcherMode; struct _DisplayData DisplayInfo; struct cc_window WindowInfo; @@ -49,8 +48,8 @@ void Window_Init(void) { void Window_Free(void) { usbh_core_deinit(); } -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_Main.Is3D = false; } +void Window_Create3D(int width, int height) { Window_Main.Is3D = true; } void Window_Destroy(void) { } @@ -249,7 +248,7 @@ void Window_FreeFramebuffer(struct Bitmap* bmp) { *#########################################################################################################################*/ void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { if (Input.Sources & INPUT_SOURCE_NORMAL) return; - VirtualKeyboard_Open(args, launcherMode); + VirtualKeyboard_Open(args); } void OnscreenKeyboard_SetText(const cc_string* text) { diff --git a/src/xbox360/Window_Xbox360.c b/src/xbox360/Window_Xbox360.c index 75f1c4559..9dd7fbf3b 100644 --- a/src/xbox360/Window_Xbox360.c +++ b/src/xbox360/Window_Xbox360.c @@ -15,8 +15,6 @@ #include #include -static cc_bool launcherMode; - struct _DisplayData DisplayInfo; struct cc_window WindowInfo; @@ -47,8 +45,8 @@ void Window_Init(void) { void Window_Free(void) { } -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_Main.Is3D = false; } +void Window_Create3D(int width, int height) { Window_Main.Is3D = true; } void Window_Destroy(void) { } @@ -207,7 +205,7 @@ void Window_FreeFramebuffer(struct Bitmap* bmp) { *#########################################################################################################################*/ void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { if (Input.Sources & INPUT_SOURCE_NORMAL) return; - VirtualKeyboard_Open(args, launcherMode); + VirtualKeyboard_Open(args); } void OnscreenKeyboard_SetText(const cc_string* text) {