From 4655f4178977b1b924cb209b8b81091ce11535e8 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Fri, 1 Feb 2019 22:34:18 +1100 Subject: [PATCH] Completely deprecate ClassicalSharp. Rest in peace. --- Launcher2/Gui/Screens/UpdatesScreen.cs | 8 ++++++-- Launcher2/LauncherWindow.cs | 7 +++++-- Launcher2/Utils/Client.cs | 10 +++++----- src/Logger.c | 14 ++++++++++++-- 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/Launcher2/Gui/Screens/UpdatesScreen.cs b/Launcher2/Gui/Screens/UpdatesScreen.cs index c95f5e3c6..ed0368ef0 100644 --- a/Launcher2/Gui/Screens/UpdatesScreen.cs +++ b/Launcher2/Gui/Screens/UpdatesScreen.cs @@ -124,8 +124,12 @@ namespace Launcher.Gui.Screens { } static string GetCExe(bool dx) { - // TODO: OSX, 32 bit linux - if (!OpenTK.Configuration.RunningOnWindows) return "ClassiCube"; + // only a 32 bit build for OSX + if (OpenTK.Configuration.RunningOnMacOS) return "ClassiCube.osx"; + + if (!OpenTK.Configuration.RunningOnWindows) { + return IntPtr.Size == 8 ? "ClassiCube" : "ClassiCube.32"; + } if (IntPtr.Size == 8) { return dx ? "ClassiCube.64.exe" : "ClassiCube.64-opengl.exe"; diff --git a/Launcher2/LauncherWindow.cs b/Launcher2/LauncherWindow.cs index f806ab707..6d0566ed2 100644 --- a/Launcher2/LauncherWindow.cs +++ b/Launcher2/LauncherWindow.cs @@ -87,9 +87,12 @@ namespace Launcher { IDrawer2D.Cols['g'] = new PackedCol(125, 125, 125); - if (Client.CClient && Configuration.RunningOnWindows && Platform.FileExists(Client.GetExeName())) { + if (Platform.FileExists(Client.GetCExeName())) { ErrorHandler.ShowDialog("Deprecated Client", - "ClassicalSharp is deprecated - use " + Client.GetExeName() + " instead"); + "ClassicalSharp is deprecated - use " + Client.GetCExeName() + " instead"); + } else { + ErrorHandler.ShowDialog("Deprecated Client", + "ClassicalSharp is deprecated - update to latest release again and use " + Client.GetCExeName() + " instead"); } } diff --git a/Launcher2/Utils/Client.cs b/Launcher2/Utils/Client.cs index d6515e32a..6e0117789 100644 --- a/Launcher2/Utils/Client.cs +++ b/Launcher2/Utils/Client.cs @@ -14,11 +14,11 @@ namespace Launcher { public static bool CClient; public static string GetExeName() { - if (!CClient) return "ClassicalSharp.exe"; - - if (OpenTK.Configuration.RunningOnWindows) - return "ClassiCube.exe"; - return "ClassiCube"; // TODO: OSX filename + return CClient ? GetCExeName() : "ClassicalSharp.exe"; + } + + public static string GetCExeName() { + return OpenTK.Configuration.RunningOnWindows ? "ClassiCube.exe" : "ClassiCube"; } public static bool Start(ClientStartData data, bool classicubeSkins, ref bool shouldExit) { diff --git a/src/Logger.c b/src/Logger.c index fda5b9cd8..f83d90b8f 100644 --- a/src/Logger.c +++ b/src/Logger.c @@ -484,12 +484,20 @@ void Logger_Log(const String* msg) { Stream_Write(&logStream, msg->buffer, msg->length); } +static void Logger_DumpSpacing(void) { + String msg; char msgBuffer[STRING_SIZE]; + String_InitArray(msg, msgBuffer); + + String_Format2(&msg, "%c----------------------------------------%c", + Platform_NewLine, Platform_NewLine); + Logger_Log(&msg); +} + static void Logger_AbortCommon(ReturnCode result, const char* raw_msg, void* ctx) { String msg; char msgBuffer[3070 + 1]; String_InitArray_NT(msg, msgBuffer); - String_Format4(&msg, "--------------------%cClassiCube crashed.%cMessage: %c%c", - Platform_NewLine, Platform_NewLine, raw_msg, Platform_NewLine); + String_Format3(&msg, "ClassiCube crashed.%cMessage: %c%c", Platform_NewLine, raw_msg, Platform_NewLine); #ifdef CC_COMMIT_SHA String_Format2(&msg, "Commit SHA: %c%c", CC_COMMIT_SHA, Platform_NewLine); #endif @@ -498,7 +506,9 @@ static void Logger_AbortCommon(ReturnCode result, const char* raw_msg, void* ctx String_Format2(&msg, "%h%c", &result, Platform_NewLine); } else { result = 1; } + Logger_DumpSpacing(); Logger_Log(&msg); + Logger_DumpRegisters(ctx); Logger_DumpBacktrace(&msg, ctx); Logger_DumpMisc(ctx);