diff --git a/source/cl_main.c b/source/cl_main.c index 9c4b5e0..80fe47c 100644 --- a/source/cl_main.c +++ b/source/cl_main.c @@ -320,6 +320,7 @@ void CL_CheckForResend (void) connect_time = realtime+t2-t1; // for retransmit requests + VID_SetCaption (va ("Connecting to %s", cls.servername)); Con_Printf ("Connecting to %s...\n", cls.servername); sprintf (data, "%c%c%c%cgetchallenge\n", 255, 255, 255, 255); NET_SendPacket (strlen(data), data, adr); @@ -467,7 +468,7 @@ void CL_Disconnect (void) connect_time = -1; - VID_SetCaption("disconnected"); + VID_SetCaption("Disconnected"); // stop sounds (especially looping!) S_StopAllSounds (true); @@ -891,6 +892,7 @@ void CL_Reconnect_f (void) if (cls.state == ca_connected) { Con_Printf ("reconnecting...\n"); + VID_SetCaption ("Reconnecting"); MSG_WriteChar (&cls.netchan.message, clc_stringcmd); MSG_WriteString (&cls.netchan.message, "new"); return; diff --git a/source/vid_glx.c b/source/vid_glx.c index ce1640e..b2aeec2 100644 --- a/source/vid_glx.c +++ b/source/vid_glx.c @@ -586,17 +586,19 @@ void VID_Init(unsigned char *palette) vid.recalc_refdef = 1; // force a surface cache flush } -void VID_InitCvars() +void +VID_InitCvars (void) +{ + // It may not look like it, but this is important +} + +void +VID_LockBuffer (void) { } void -VID_LockBuffer ( void ) -{ -} - -void -VID_UnlockBuffer ( void ) +VID_UnlockBuffer (void) { } @@ -604,7 +606,9 @@ void VID_SetCaption (char *text) { if (text && *text) { - x11_set_caption (va ("%s %s: %s", PROGRAM, VERSION, text)); + char *temp = strdup (text); + x11_set_caption (va ("%s %s: %s", PROGRAM, VERSION, temp)); + free (temp); } else { x11_set_caption (va ("%s %s", PROGRAM, VERSION)); } diff --git a/source/vid_mgl.c b/source/vid_mgl.c index c614692..9262cc7 100644 --- a/source/vid_mgl.c +++ b/source/vid_mgl.c @@ -3427,9 +3427,11 @@ void VID_MenuKey (int key) void VID_SetCaption (char *text) { if (text && *text) { - SetWindowText(mainwindow,(LPSTR) va ("%s %s: %s", PROGRAM, VERSION, text)); + char *temp = strdup (text); + SetWindowText (mainwindow, (LPSTR) va ("%s %s: %s", PROGRAM, VERSION, text)); + free (temp); } else { - SetWindowText(mainwindow,(LPSTR) va ("%s %s", PROGRAM, VERSION)); + SetWindowText (mainwindow, (LPSTR) va ("%s %s", PROGRAM, VERSION)); } } diff --git a/source/vid_sdl.c b/source/vid_sdl.c index f5bf5d5..6199ca5 100644 --- a/source/vid_sdl.c +++ b/source/vid_sdl.c @@ -519,18 +519,19 @@ IN_Move (usercmd_t *cmd) } -void VID_InitCvars () +void +VID_InitCvars (void) { // It may not look like it, but this is important } void -VID_LockBuffer ( void ) +VID_LockBuffer (void) { } void -VID_UnlockBuffer ( void ) +VID_UnlockBuffer (void) { } @@ -538,9 +539,11 @@ void VID_SetCaption (char *text) { if (text && *text) { - SDL_WM_SetCaption(va ("%s %s: %s", PROGRAM, VERSION, text), NULL); + char *temp = strdup (text); + SDL_WM_SetCaption (va ("%s %s: %s", PROGRAM, VERSION, temp), NULL); + free (temp); } else { - SDL_WM_SetCaption(va ("%s %s", PROGRAM, VERSION), NULL); + SDL_WM_SetCaption (va ("%s %s", PROGRAM, VERSION), NULL); } } diff --git a/source/vid_sgl.c b/source/vid_sgl.c index c1b1d37..d12515a 100644 --- a/source/vid_sgl.c +++ b/source/vid_sgl.c @@ -717,9 +717,11 @@ void VID_SetCaption (char *text) { if (text && *text) { - SDL_WM_SetCaption(va ("%s %s: %s", PROGRAM, VERSION, text), NULL); + char *temp = strdup (text); + SDL_WM_SetCaption (va ("%s %s: %s", PROGRAM, VERSION, temp), NULL); + free (temp); } else { - SDL_WM_SetCaption(va ("%s %s", PROGRAM, VERSION), NULL); + SDL_WM_SetCaption (va ("%s %s", PROGRAM, VERSION), NULL); } } diff --git a/source/vid_x11.c b/source/vid_x11.c index 16d2211..9e480f0 100644 --- a/source/vid_x11.c +++ b/source/vid_x11.c @@ -779,7 +779,7 @@ VID_DitherOn( void ) void -VID_DitherOff( void ) +VID_DitherOff (void) { if (dither) { vid.recalc_refdef = 1; @@ -787,7 +787,8 @@ VID_DitherOff( void ) } } -void VID_InitCvars () +void +VID_InitCvars (void) { // It may not look like it, but this is important } @@ -806,7 +807,9 @@ void VID_SetCaption (char *text) { if (text && *text) { - x11_set_caption (va ("%s %s: %s", PROGRAM, VERSION, text)); + char *temp = strdup (text); + x11_set_caption (va ("%s %s: %s", PROGRAM, VERSION, temp)); + free (temp); } else { x11_set_caption (va ("%s %s", PROGRAM, VERSION)); }