More win32 cleanups:

"Unused" code for startup dialog now has #ifdef SPLASH_SCREEN.
Removed extra variables which were not used.
This commit is contained in:
Dabb 2000-12-20 18:18:04 +00:00
parent d2e9339f00
commit 20f0e102ce
3 changed files with 23 additions and 9 deletions

View file

@ -427,7 +427,6 @@ HINSTANCE global_hInstance;
int global_nCmdShow;
char *argv[MAX_NUM_ARGVS];
static char *empty_string = "";
HWND hwnd_dialog;
int WINAPI
@ -486,6 +485,7 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
host_parms.argc = com_argc;
host_parms.argv = com_argv;
#ifdef SPLASH_SCREEN
hwnd_dialog =
CreateDialog (hInstance, MAKEINTRESOURCE (IDD_DIALOG1), NULL, NULL);
@ -502,6 +502,8 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
UpdateWindow (hwnd_dialog);
SetForegroundWindow (hwnd_dialog);
}
#endif
// take the greater of all the available memory or half the total memory,
// but at least 8 Mb and no more than 16 Mb, unless they explicitly
// request otherwise

View file

@ -2077,9 +2077,10 @@ VID_Init (unsigned char *palette)
startwindowed = 1;
vid_default = windowed_default;
}
#ifdef SPLASH_SCREEN
if (hwnd_dialog)
DestroyWindow (hwnd_dialog);
#endif
// sound initialization has to go here, preceded by a windowed mode set,
// so there's a window for DirectSound to work with but we're not yet
@ -2132,6 +2133,12 @@ VID_Init_Cvars ()
void
VID_Shutdown (void)
{
#ifdef SPLASH_SCREEN
if (hwnd_dialog)
DestroyWindow (hwnd_dialog);
#endif
if (vid_initialized) {
if (modestate == MS_FULLDIB)
ChangeDisplaySettings (NULL, CDS_FULLSCREEN);
@ -2145,9 +2152,6 @@ VID_Shutdown (void)
DestroyFullscreenWindow ();
DestroyFullDIBWindow ();
if (hwnd_dialog)
DestroyWindow (hwnd_dialog);
if (mainwindow)
DestroyWindow (mainwindow);

View file

@ -92,12 +92,14 @@ const char *gl_renderer;
const char *gl_version;
const char *gl_extensions;
// fixme: Only used by MGL ..
qboolean DDActive;
// If you ever merge screen/gl_screen, don't forget this one
qboolean scr_skipupdate;
static vmode_t modelist[MAX_MODE_LIST];
static int nummodes;
static vmode_t *pcurrentmode;
static vmode_t badmode;
static DEVMODE gdevmode;
@ -788,6 +790,10 @@ VID_Shutdown (void)
HDC hDC;
int i, temp[8192];
#ifdef SPLASH_SCREEN
if(hwnd_dialog)
DestroyWindow (hwnd_dialog);
#endif
if (vid_initialized) {
vid_canalttab = false;
@ -798,7 +804,7 @@ VID_Shutdown (void)
// LordHavoc: free textures before closing (may help NVIDIA)
for (i = 0; i < 8192; i++)
temp[i] = i;
temp[i] = i + 1;
glDeleteTextures (8192, temp);
if (hRC)
@ -1124,7 +1130,6 @@ MainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (mainwindow)
DestroyWindow (mainwindow);
PostQuitMessage (0);
}
break;
@ -1716,7 +1721,10 @@ VID_Init (unsigned char *palette)
vid.colormap = host_colormap;
vid.fullbright = 256 - LittleLong (*((int *) vid.colormap + 2048));
DestroyWindow (hwnd_dialog);
#ifdef SPLASH_SCREEN
if(hwnd_dialog)
DestroyWindow (hwnd_dialog);
#endif
GL_CheckBrightness (palette);
VID_SetPalette (palette);