From aa2c0f4b9ff104e4616a2bc02d7a8b93bfa333b3 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Thu, 7 Sep 2023 20:56:47 +1000 Subject: [PATCH] Launcher: If downloading a resource fails, then cancel all subsequent pending resources macOS: Fix on cocoa backend, total video memory and HW acceleration status wasn't being shown on /client gpu on macOS 10.4 and later --- src/Resources.c | 12 +++++++++--- src/interop_cocoa.m | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Resources.c b/src/Resources.c index b6945b54f..b9c5a4019 100644 --- a/src/Resources.c +++ b/src/Resources.c @@ -1109,6 +1109,14 @@ static void Fetcher_Finish(void) { } } +static void Fetcher_Fail(struct HttpRequest* item) { + Http_ClearPending(); + + /* Only show error for first failed download */ + if (!Fetcher_Failed) Fetcher_ErrorCallback(item); + Fetcher_Failed = true; +} + CC_NOINLINE static cc_bool Fetcher_Get(int reqID, struct HttpRequest* item) { if (!Http_GetResult(reqID, item)) return false; @@ -1117,9 +1125,7 @@ CC_NOINLINE static cc_bool Fetcher_Get(int reqID, struct HttpRequest* item) { return true; } - /* Only show error for first failed download */ - if (!Fetcher_Failed) Fetcher_ErrorCallback(item); - Fetcher_Failed = true; + Fetcher_Fail(item); HttpRequest_Free(item); Fetcher_Finish(); diff --git a/src/interop_cocoa.m b/src/interop_cocoa.m index 437dd06b2..9cc2b094f 100644 --- a/src/interop_cocoa.m +++ b/src/interop_cocoa.m @@ -774,8 +774,8 @@ void GLContext_SetFpsLimit(cc_bool vsync, float minFrameMs) { [ctxHandle setValues:&value forParameter: NSOpenGLCPSwapInterval]; } -/* kCGLCPCurrentRendererID is only defined on macOS 10.4 and later */ -#ifdef kCGLCPCurrentRendererID +/* kCGLCPCurrentRendererID is only available on macOS 10.4 and later */ +#if defined MAC_OS_X_VERSION_10_4 static const char* GetAccelerationMode(CGLContextObj ctx) { GLint fGPU, vGPU;