diff --git a/src/d_main.cpp b/src/d_main.cpp index 2b8ff7437..1ea2d2707 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -205,7 +205,10 @@ CUSTOM_CVAR (String, vid_cursor, "None", CVAR_ARCHIVE | CVAR_NOINITCALL) } } -bool disableautoload = false; // [SP] No auto load +// Controlled by startup dialog +CVAR (Bool, disableautoload, false, CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_GLOBALCONFIG) +CVAR (Bool, autoloadbrightmaps, false, CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_GLOBALCONFIG) +CVAR (Bool, autoloadlights, false, CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_GLOBALCONFIG) bool wantToRestart; bool DrawFSHUD; // [RH] Draw fullscreen HUD? @@ -2040,6 +2043,23 @@ static void AddAutoloadFiles(const char *autoname) { LumpFilterIWAD.Format("%s.", autoname); // The '.' is appened to simplify parsing the string + // [SP] Dialog reaction - load lights.pk3 and brightmaps.pk3 based on user choices + if (!(gameinfo.flags & GI_SHAREWARE)) + { + if (autoloadlights) + { + const char *lightswad = BaseFileSearch ("lights.pk3", NULL); + if (lightswad) + D_AddFile (allwads, lightswad); + } + if (autoloadbrightmaps) + { + const char *bmwad = BaseFileSearch ("brightmaps.pk3", NULL); + if (bmwad) + D_AddFile (allwads, bmwad); + } + } + if (!(gameinfo.flags & GI_SHAREWARE) && !Args->CheckParm("-noautoload") && !disableautoload) { FString file; diff --git a/src/win32/i_system.cpp b/src/win32/i_system.cpp index 2dc6c4d3d..f07fb8f1d 100644 --- a/src/win32/i_system.cpp +++ b/src/win32/i_system.cpp @@ -141,7 +141,9 @@ EXTERN_CVAR (Bool, queryiwad); // Used on welcome/IWAD screen. EXTERN_CVAR (Int, vid_renderer) EXTERN_CVAR (Bool, fullscreen) -extern bool disableautoload; +EXTERN_CVAR (Bool, disableautoload) +EXTERN_CVAR (Bool, autoloadlights) +EXTERN_CVAR (Bool, autoloadbrightmaps) extern HWND Window, ConWindow, GameTitleWindow; extern HANDLE StdOut; @@ -1181,7 +1183,11 @@ BOOL CALLBACK IWADBoxCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa // Check the current video settings. SendDlgItemMessage( hDlg, vid_renderer ? IDC_WELCOME_OPENGL : IDC_WELCOME_SOFTWARE, BM_SETCHECK, BST_CHECKED, 0 ); SendDlgItemMessage( hDlg, IDC_WELCOME_FULLSCREEN, BM_SETCHECK, fullscreen ? BST_CHECKED : BST_UNCHECKED, 0 ); + + // [SP] This is our's SendDlgItemMessage( hDlg, IDC_WELCOME_NOAUTOLOAD, BM_SETCHECK, disableautoload ? BST_CHECKED : BST_UNCHECKED, 0 ); + SendDlgItemMessage( hDlg, IDC_WELCOME_LIGHTS, BM_SETCHECK, autoloadlights ? BST_CHECKED : BST_UNCHECKED, 0 ); + SendDlgItemMessage( hDlg, IDC_WELCOME_BRIGHTMAPS, BM_SETCHECK, autoloadbrightmaps ? BST_CHECKED : BST_UNCHECKED, 0 ); // Set up our version string. sprintf(szString, "Version %s.", GetVersionString()); @@ -1226,7 +1232,8 @@ BOOL CALLBACK IWADBoxCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa // [SP] This is our's. disableautoload = SendDlgItemMessage( hDlg, IDC_WELCOME_NOAUTOLOAD, BM_GETCHECK, 0, 0 ) == BST_CHECKED; - + autoloadlights = SendDlgItemMessage( hDlg, IDC_WELCOME_LIGHTS, BM_GETCHECK, 0, 0 ) == BST_CHECKED; + autoloadbrightmaps = SendDlgItemMessage( hDlg, IDC_WELCOME_BRIGHTMAPS, BM_GETCHECK, 0, 0 ) == BST_CHECKED; ctrl = GetDlgItem (hDlg, IDC_IWADLIST); EndDialog(hDlg, SendMessage (ctrl, LB_GETCURSEL, 0, 0)); } diff --git a/src/win32/resource.h b/src/win32/resource.h index 937a73658..cf41b6f1f 100644 --- a/src/win32/resource.h +++ b/src/win32/resource.h @@ -158,7 +158,7 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 150 +#define _APS_NEXT_RESOURCE_VALUE 151 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1084 #define _APS_NEXT_SYMED_VALUE 101 @@ -170,7 +170,8 @@ #define IDC_WELCOME_OPENGL 4020 #define IDC_WELCOME_SOFTWARE 4021 #define IDC_WELCOME_FULLSCREEN 4022 -#define IDI_ICONST 151 // [SP] This is our's. #define IDC_WELCOME_NOAUTOLOAD 4023 +#define IDC_WELCOME_LIGHTS 4024 +#define IDC_WELCOME_BRIGHTMAPS 4025 diff --git a/src/win32/zdoom.rc b/src/win32/zdoom.rc index c5c7bd259..99422e4ad 100644 --- a/src/win32/zdoom.rc +++ b/src/win32/zdoom.rc @@ -120,9 +120,9 @@ BEGIN IDD_IWADDIALOG, DIALOG BEGIN LEFTMARGIN, 5 - RIGHTMARGIN, 205 + RIGHTMARGIN, 222 TOPMARGIN, 7 - BOTTOMMARGIN, 179 + BOTTOMMARGIN, 242 END IDD_EAXPROPERTYLIST, DIALOG @@ -237,33 +237,28 @@ END */ // [SP] Upstreamed from Zandronum IDD_IWADDIALOG DIALOGEX 0, 0, 224, 246 -STYLE DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | - WS_SYSMENU +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_APPWINDOW CAPTION "Welcome" FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - ICON IDI_ICON1,IDC_STATIC,7,7,32,32 - LTEXT "Welcome to QZDoom!",IDC_STATIC,42,8,180,8 - LTEXT "",IDC_WELCOME_VERSION,42,18,180,8 - GROUPBOX "IWAD selection",IDC_STATIC,8,32,224-16,102 - LTEXT "Select which game file (IWAD) to run.", IDC_STATIC,12,32+12,190,8 - LISTBOX IDC_IWADLIST,12,32+24,224-24,72,LBS_NOINTEGRALHEIGHT | - WS_VSCROLL | WS_TABSTOP - GROUPBOX "Video settings",IDC_STATIC,8,138,224-16,48 - LTEXT "Choose how QZDoom will render the game.", IDC_STATIC,12,148,190,8 - CONTROL "Hardware (OpenGL)",IDC_WELCOME_OPENGL,"Button", - BS_AUTORADIOBUTTON,12,170,93,10 - CONTROL "Software (Doom)",IDC_WELCOME_SOFTWARE,"Button", - BS_AUTORADIOBUTTON,12,160,93,10 - CONTROL "Fullscreen",IDC_WELCOME_FULLSCREEN,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP, 124,160,48,10 - CONTROL "Disable autoload",IDC_WELCOME_NOAUTOLOAD,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,72,192,87,10 - CONTROL "Don't ask me this again",IDC_DONTASKIWAD,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,72,202,87,10 - DEFPUSHBUTTON "Play QZDoom",IDOK,8,246-18,90,14 - PUSHBUTTON "Exit",IDCANCEL,224-58,246-18,50,14 + ICON IDI_ICON1,IDC_STATIC,7,7,21,20 + LTEXT "Welcome to QZDoom!",IDC_STATIC,42,8,180,8 + LTEXT "",IDC_WELCOME_VERSION,42,18,180,8 + GROUPBOX "IWAD selection",IDC_STATIC,8,32,208,102 + LTEXT "Select which game file (IWAD) to run.",IDC_STATIC,12,44,190,8 + LISTBOX IDC_IWADLIST,12,56,200,72,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + GROUPBOX "Video settings",IDC_STATIC,8,138,208,48 + LTEXT "Choose how QZDoom will render the game.",IDC_STATIC,12,148,190,8 + CONTROL "Hardware (OpenGL)",IDC_WELCOME_OPENGL,"Button",BS_AUTORADIOBUTTON,12,170,93,10 + CONTROL "Software (Doom)",IDC_WELCOME_SOFTWARE,"Button",BS_AUTORADIOBUTTON,12,160,93,10 + CONTROL "Fullscreen",IDC_WELCOME_FULLSCREEN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,124,160,48,10 + CONTROL "Disable autoload",IDC_WELCOME_NOAUTOLOAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,148,39,65,10 + CONTROL "Lights.pk3",IDC_WELCOME_LIGHTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,46,192,51,10 + CONTROL "Brightmaps.pk3",IDC_WELCOME_BRIGHTMAPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,111,192,65,10 + CONTROL "Don't ask me this again",IDC_DONTASKIWAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,73,211,87,10 + DEFPUSHBUTTON "Play QZDoom",IDOK,8,228,90,14 + PUSHBUTTON "Exit",IDCANCEL,166,228,50,14 END IDD_EAXPROPERTYLIST DIALOGEX 0, 0, 265, 404