From c943e7ca332d97bf77b12c932fd28e11e783e3c2 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Mon, 16 Dec 2019 14:25:35 +1100 Subject: [PATCH] Release 1.1.1 --- src/Constants.h | 10 +++++----- src/Window.c | 15 ++++++++++----- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/Constants.h b/src/Constants.h index 917ae9a91..6cb5f6eb6 100644 --- a/src/Constants.h +++ b/src/Constants.h @@ -5,18 +5,18 @@ */ #define GAME_MAX_CMDARGS 5 -#define GAME_APP_VER "1.1.0" +#define GAME_APP_VER "1.1.1" #define GAME_API_VER 1 #if defined CC_BUILD_WEB #define GAME_APP_NAME "ClassiCube web client" #define GAME_APP_TITLE "ClassiCube" #elif defined CC_BUILD_COCOA -#define GAME_APP_NAME "ClassiCube 1.1.0 alpha" -#define GAME_APP_TITLE "ClassiCube 1.1.0 alpha" +#define GAME_APP_NAME "ClassiCube 1.1.1 alpha" +#define GAME_APP_TITLE "ClassiCube 1.1.1 alpha" #else -#define GAME_APP_NAME "ClassiCube 1.1.0" -#define GAME_APP_TITLE "ClassiCube 1.1.0" +#define GAME_APP_NAME "ClassiCube 1.1.1" +#define GAME_APP_TITLE "ClassiCube 1.1.1" #endif /* Max number of characters strings can have. */ diff --git a/src/Window.c b/src/Window.c index 80042a031..aa5df895a 100644 --- a/src/Window.c +++ b/src/Window.c @@ -418,24 +418,29 @@ void Window_SetTitle(const String* title) { } void Clipboard_GetText(String* value) { - /* retry up to 50 times */ + cc_bool unicode; + HANDLE hGlobal; + LPVOID src; + SIZE_T size; int i; + /* retry up to 50 times */ for (i = 0; i < 50; i++) { if (!OpenClipboard(win_handle)) { Thread_Sleep(10); continue; } - cc_bool unicode = true; - HANDLE hGlobal = GetClipboardData(CF_UNICODETEXT); + unicode = true; + hGlobal = GetClipboardData(CF_UNICODETEXT); if (!hGlobal) { hGlobal = GetClipboardData(CF_TEXT); unicode = false; } + if (!hGlobal) { CloseClipboard(); return; } - LPVOID src = GlobalLock(hGlobal); - SIZE_T size = GlobalSize(hGlobal); + src = GlobalLock(hGlobal); + size = GlobalSize(hGlobal); /* ignore trailing NULL at end */ /* TODO: Verify it's always there */