From fee0e5f8f77747ed42b1fb2e46a1a92b24b475d4 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 1 Feb 2020 21:17:24 +1100 Subject: [PATCH] Don't even show the Direct3D9 buttons or 'direct3d9 is recommended' on macOS/linux in launcher updates menu --- src/LScreens.c | 20 ++++++++++++-------- src/Platform.c | 25 +++++++++---------------- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/src/LScreens.c b/src/LScreens.c index e75a6d363..90fdc5d99 100644 --- a/src/LScreens.c +++ b/src/LScreens.c @@ -1513,18 +1513,22 @@ static void UpdatesScreen_Init(struct LScreen* s_) { LLine_Init(s_, &s->seps[0], 320); LLine_Init(s_, &s->seps[1], 320); - LLabel_Init(s_, &s->lblRel, "Latest release: Checking.."); - LButton_Init(s_, &s->btnRel[0], 130, 35, "Direct3D 9"); - LButton_Init(s_, &s->btnRel[1], 130, 35, "OpenGL"); - + LLabel_Init(s_, &s->lblRel, "Latest release: Checking.."); LLabel_Init(s_, &s->lblDev, "Latest dev build: Checking.."); - LButton_Init(s_, &s->btnDev[0], 130, 35, "Direct3D 9"); - LButton_Init(s_, &s->btnDev[1], 130, 35, "OpenGL"); - - LLabel_Init(s_, &s->lblInfo, "&eDirect3D 9 is recommended for Windows"); LLabel_Init(s_, &s->lblStatus, ""); LButton_Init(s_, &s->btnBack, 80, 35, "Back"); + if (Updater_D3D9) { + LButton_Init(s_, &s->btnRel[0], 130, 35, "Direct3D 9"); + LButton_Init(s_, &s->btnDev[0], 130, 35, "Direct3D 9"); + LLabel_Init(s_, &s->lblInfo, "&eDirect3D 9 is recommended"); + } + + if (Updater_OGL) { + LButton_Init(s_, &s->btnRel[1], 130, 35, "OpenGL"); + LButton_Init(s_, &s->btnDev[1], 130, 35, "OpenGL"); + } + s->btnRel[0].OnClick = UpdatesScreen_RelD3D9; s->btnRel[1].OnClick = UpdatesScreen_RelOpenGL; s->btnDev[0].OnClick = UpdatesScreen_DevD3D9; diff --git a/src/Platform.c b/src/Platform.c index 9a6f51367..ad347e880 100644 --- a/src/Platform.c +++ b/src/Platform.c @@ -1329,34 +1329,27 @@ cc_result Updater_GetBuildTime(TimeMS* time) { return ERR_NOT_SUPPORTED; } #elif defined CC_BUILD_POSIX cc_bool Updater_Clean(void) { return true; } +const char* Updater_D3D9 = NULL; #if defined CC_BUILD_LINUX #if __x86_64__ -const char* Updater_D3D9 = "ClassiCube"; -const char* Updater_OGL = "ClassiCube"; +const char* Updater_OGL = "ClassiCube"; #elif __i386__ -const char* Updater_D3D9 = "ClassiCube.32"; -const char* Updater_OGL = "ClassiCube.32"; +const char* Updater_OGL = "ClassiCube.32"; #elif CC_BUILD_RPI -const char* Updater_D3D9 = "ClassiCube.rpi"; -const char* Updater_OGL = "ClassiCube.rpi"; +const char* Updater_OGL = "ClassiCube.rpi"; #else -const char* Updater_D3D9 = "ClassiCube.unknown"; -const char* Updater_OGL = "ClassiCube.unknown"; +const char* Updater_OGL = "ClassiCube.unknown"; #endif #elif defined CC_BUILD_OSX #if __x86_64__ -const char* Updater_D3D9 = "ClassiCube.64.osx"; -const char* Updater_OGL = "ClassiCube.64.osx"; +const char* Updater_OGL = "ClassiCube.64.osx"; #elif __i386__ -const char* Updater_D3D9 = "ClassiCube.osx"; -const char* Updater_OGL = "ClassiCube.osx"; +const char* Updater_OGL = "ClassiCube.osx"; #else -const char* Updater_D3D9 = "ClassiCube.unknown"; -const char* Updater_OGL = "ClassiCube.unknown"; +const char* Updater_OGL = "ClassiCube.unknown"; #endif #else -const char* Updater_D3D9 = "ClassiCube.unknown"; -const char* Updater_OGL = "ClassiCube.unknown"; +const char* Updater_OGL = "ClassiCube.unknown"; #endif cc_result Updater_Start(void) {