make VID_SetCaption consistent wherever appropriate (ie possibly windowed

environments). caption is "PROGRAM VERSION[: text]".
This commit is contained in:
Bill Currie 2000-10-04 05:45:48 +00:00
parent 46cbb108da
commit 065abe9464
9 changed files with 36 additions and 16 deletions

View file

@ -466,7 +466,7 @@ void CL_Disconnect (void)
connect_time = -1;
VID_SetCaption(PROGRAM ": disconnected");
VID_SetCaption("disconnected");
// stop sounds (especially looping!)
S_StopAllSounds (true);

View file

@ -167,12 +167,8 @@ void CL_PredictMove (void)
// we can now render a frame
if (cls.state == ca_onserver)
{ // first update is the final signon stage
char text[1024];
snprintf (text, sizeof(text), "%s: %s", PROGRAM, cls.servername);
VID_SetCaption(text);
cls.state = ca_active;
VID_SetCaption(cls.servername);
cls.state = ca_active;
}
if (cl_nopred->value)

View file

@ -322,7 +322,7 @@ x11_create_window(int width, int height)
x_vis, mask, &attr);
// Set window title
XStoreName (x_disp, x_win, va ("%s %s", PROGRAM, VERSION));
x11_set_caption (va ("%s %s", PROGRAM, VERSION));
// Set icon name
XSetIconName (x_disp, x_win, PROGRAM);

View file

@ -609,5 +609,9 @@ VID_UnlockBuffer ( void )
void
VID_SetCaption (char *text)
{
x11_set_caption (text);
if (text && *text) {
x11_set_caption (va ("%s %s: %s", PROGRAM, VERSION, text));
} else {
x11_set_caption (va ("%s %s", PROGRAM, VERSION));
}
}

View file

@ -3426,6 +3426,10 @@ void VID_MenuKey (int key)
void VID_SetCaption (char *text)
{
SetWindowText(mainwindow,(LPSTR) text);
if (text && *text) {
SetWindowText(mainwindow,(LPSTR) va ("%s %s: %s", PROGRAM, VERSION, text));
} else {
SetWindowText(mainwindow,(LPSTR) va ("%s %s", PROGRAM, VERSION));
}
}

View file

@ -1,5 +1,5 @@
/*
vid_sdl.c
vid_sdl.c
Video driver for Sam Lantinga's Simple DirectMedia Layer
@ -149,7 +149,7 @@ void VID_Init (unsigned char *palette)
if (!(screen = SDL_SetVideoMode(vid.width, vid.height, 8, flags)))
Sys_Error("VID: Couldn't set video mode: %s\n", SDL_GetError());
VID_SetPalette(palette);
VID_SetCaption("sdlquakeworld");
VID_SetCaption("");
// now know everything we need to know about the buffer
VGA_width = vid.conwidth = vid.width;
@ -524,6 +524,10 @@ VID_UnlockBuffer ( void )
void
VID_SetCaption (char *text)
{
SDL_WM_SetCaption(text, NULL);
if (text && *text) {
SDL_WM_SetCaption(va ("%s %s: %s", PROGRAM, VERSION, text), NULL);
} else {
SDL_WM_SetCaption(va ("%s %s", PROGRAM, VERSION), NULL);
}
}

View file

@ -703,6 +703,10 @@ VID_UnlockBuffer ( void )
void
VID_SetCaption (char *text)
{
SDL_WM_SetCaption(text, NULL);
if (text && *text) {
SDL_WM_SetCaption(va ("%s %s: %s", PROGRAM, VERSION, text), NULL);
} else {
SDL_WM_SetCaption(va ("%s %s", PROGRAM, VERSION), NULL);
}
}

View file

@ -1939,5 +1939,9 @@ void VID_MenuKey (int key)
void VID_SetCaption (char *text)
{
SetWindowText(mainwindow,(LPSTR) text);
if (text && *text) {
SetWindowText(mainwindow,(LPSTR) va ("%s %s: %s", PROGRAM, VERSION, text));
} else {
SetWindowText(mainwindow,(LPSTR) va ("%s %s", PROGRAM, VERSION));
}
}

View file

@ -806,5 +806,9 @@ VID_UnlockBuffer ( void )
void
VID_SetCaption (char *text)
{
x11_set_caption (text);
if (text && *text) {
x11_set_caption (va ("%s %s: %s", PROGRAM, VERSION, text));
} else {
x11_set_caption (va ("%s %s", PROGRAM, VERSION));
}
}