Index: ps/trunk/binaries/data/mods/public/gui/pregame/SplashscreenHandler.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/pregame/SplashscreenHandler.js +++ ps/trunk/binaries/data/mods/public/gui/pregame/SplashscreenHandler.js @@ -32,36 +32,6 @@ if (Engine.ConfigDB_GetValue("user", "gui.splashscreen.enable") === "true" || Engine.ConfigDB_GetValue("user", "gui.splashscreen.version") < Engine.GetFileMTime("gui/splashscreen/splashscreen.txt")) - Engine.PushGuiPage("page_splashscreen.xml", {}, this.showRenderPathMessage); - else - this.showRenderPathMessage(); - } - - showRenderPathMessage() - { - // Warn about removing fixed render path - if (Engine.Renderer_GetRenderPath() != "fixed") - return; - - messageBox( - 600, 300, - "[font=\"sans-bold-16\"]" + - sprintf(translate("%(warning)s You appear to be using non-shader (fixed function) graphics. This option will be removed in a future 0 A.D. release, to allow for more advanced graphics features. We advise upgrading your graphics card to a more recent, shader-compatible model."), { - "warning": coloredText("Warning:", "200 20 20") - }) + - "\n\n" + - // Translation: This is the second paragraph of a warning. The - // warning explains that the user is using “non-shader“ graphics, - // and that in the future this will not be supported by the game, so - // the user will need a better graphics card. - translate("Please press \"Read More\" for more information or \"OK\" to continue."), - translate("WARNING!"), - [translate("OK"), translate("Read More")], - [ - null, - () => { - Engine.OpenURL("https://www.wildfiregames.com/forum/index.php?showtopic=16734"); - } - ]); + Engine.PushGuiPage("page_splashscreen.xml", {}); } } Index: ps/trunk/source/lib/debug.h =================================================================== --- ps/trunk/source/lib/debug.h +++ ps/trunk/source/lib/debug.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -194,15 +194,19 @@ LIB_API ErrorReaction debug_DisplayError(const wchar_t* description, size_t flags, void* context, const wchar_t* lastFuncToSkip, const wchar_t* file, int line, const char* func, atomic_bool* suppress); // simplified version for just displaying an error message -#define DEBUG_DISPLAY_ERROR(description)\ +#define DEBUG_DISPLAY_ERROR_IMPL(description, flags)\ do\ {\ CACHE_ALIGNED(u8) context[DEBUG_CONTEXT_SIZE];\ (void)debug_CaptureContext(context);\ - (void)debug_DisplayError(description, 0, context, L"debug_DisplayError", WIDEN(__FILE__), __LINE__, __func__, 0);\ + (void)debug_DisplayError(description, flags, context, L"debug_DisplayError", WIDEN(__FILE__), __LINE__, __func__, 0);\ }\ while(0) +#define DEBUG_DISPLAY_ERROR(description) DEBUG_DISPLAY_ERROR_IMPL(description, 0) +// disallow continue for the error. +#define DEBUG_DISPLAY_FATAL_ERROR(description) DEBUG_DISPLAY_ERROR_IMPL(description, DE_NO_CONTINUE) + // // filtering Index: ps/trunk/source/lib/sysdep/os/win/wsysdep.cpp =================================================================== --- ps/trunk/source/lib/sysdep/os/win/wsysdep.cpp +++ ps/trunk/source/lib/sysdep/os/win/wsysdep.cpp @@ -182,7 +182,8 @@ static BOOL dlg_OnInitDialog(HWND hDlg, HWND UNUSED(hWndFocus), LPARAM lParam) { - const DialogParams* params = (const DialogParams*)lParam; + const DialogParams* params = reinterpret_cast(lParam); + SetWindowLongPtr(hDlg, DWLP_USER, lParam); HWND hWnd; // need to reset for new instance of dialog @@ -195,6 +196,12 @@ EnableWindow(hWnd, FALSE); } + if(params->flags & DE_NO_CONTINUE) + { + hWnd = GetDlgItem(hDlg, IDC_CONTINUE); + EnableWindow(hWnd, FALSE); + } + // set fixed font for readability hWnd = GetDlgItem(hDlg, IDC_EDIT1); HGDIOBJ hObj = (HGDIOBJ)GetStockObject(SYSTEM_FIXED_FONT); @@ -238,6 +245,19 @@ } +static void dlg_OnClose(HWND hDlg) +{ + const DialogParams* params = reinterpret_cast( + GetWindowLongPtr(hDlg, DWLP_USER)); + if (!params) + return; + + // Interpret close as exit in case we can't continue. + if(params->flags & DE_NO_CONTINUE) + EndDialog(hDlg, ERI_EXIT); +} + + static void dlg_OnSysCommand(HWND hDlg, UINT cmd, int UNUSED(x), int UNUSED(y)) { switch(cmd & 0xFFF0) // NB: lower 4 bits are reserved @@ -275,6 +295,9 @@ case WM_SIZE: return HANDLE_WM_SIZE(hDlg, wParam, lParam, dlg_OnSize); + case WM_CLOSE: + return HANDLE_WM_CLOSE(hDlg, wParam, lParam, dlg_OnClose); + default: // we didn't process the message; caller will perform default action. return FALSE; Index: ps/trunk/source/ps/GameSetup/GameSetup.cpp =================================================================== --- ps/trunk/source/ps/GameSetup/GameSetup.cpp +++ ps/trunk/source/ps/GameSetup/GameSetup.cpp @@ -999,16 +999,20 @@ g_GUI = new CGUIManager(); // (must come after SetVideoMode, since it calls ogl_Init) - if (ogl_HaveExtensions(0, "GL_ARB_vertex_program", "GL_ARB_fragment_program", NULL) != 0 // ARB + CStr8 renderPath = "default"; + CFG_GET_VAL("renderpath", renderPath); + if ((ogl_HaveExtensions(0, "GL_ARB_vertex_program", "GL_ARB_fragment_program", NULL) != 0 // ARB && ogl_HaveExtensions(0, "GL_ARB_vertex_shader", "GL_ARB_fragment_shader", NULL) != 0) // GLSL + || RenderPathEnum::FromString(renderPath) == FIXED) { - DEBUG_DISPLAY_ERROR( + // It doesn't make sense to continue working here, because we're not + // able to display anything. + DEBUG_DISPLAY_FATAL_ERROR( L"Your graphics card doesn't appear to be fully compatible with OpenGL shaders." - L" In the future, the game will not support pre-shader graphics cards." + L" The game does not support pre-shader graphics cards." L" You are advised to try installing newer drivers and/or upgrade your graphics card." L" For more information, please see http://www.wildfiregames.com/forum/index.php?showtopic=16734" ); - // TODO: actually quit once fixed function support is dropped } const char* missing = ogl_HaveExtensions(0, @@ -1172,7 +1176,7 @@ * -autostart-nonvisual disable any graphics and sounds * -autostart-victory=SCRIPTNAME sets the victory conditions with SCRIPTNAME * located in simulation/data/settings/victory_conditions/ - * (default conquest). When the first given SCRIPTNAME is + * (default conquest). When the first given SCRIPTNAME is * "endless", no victory conditions will apply. * -autostart-wonderduration=NUM sets the victory duration NUM for wonder victory condition * (default 10 minutes)