VIDEO: Add window title to vid_open.

This commit is contained in:
Mark Pizzolato 2016-01-28 11:29:53 -08:00
parent 00e8c80c7b
commit 4f3dd08314
3 changed files with 12 additions and 7 deletions

View file

@ -1023,7 +1023,7 @@ if (dptr->flags & DEV_DIS) {
}
if (!vid_active) {
r = vid_open (dptr, VC_XSIZE, VC_YSIZE, vc_input_captured ? SIM_VID_INPUTCAPTURED : 0);/* display size & capture mode */
r = vid_open (dptr, NULL, VC_XSIZE, VC_YSIZE, vc_input_captured ? SIM_VID_INPUTCAPTURED : 0);/* display size & capture mode */
if (r != SCPE_OK)
return r;
vc_buf = (uint32 *) calloc (VC_MEMSIZE, sizeof (uint32));

View file

@ -285,6 +285,7 @@ int32 vid_flags; /* Open Flags */
int32 vid_width;
int32 vid_height;
t_bool vid_ready;
char vid_title[128];
static void vid_beep_setup (int duration_ms, int tone_frequency);
static void vid_beep_cleanup (void);
#if SDL_MAJOR_VERSION == 1
@ -469,12 +470,16 @@ return SCPE_OK;
}
#endif
t_stat vid_open (DEVICE *dptr, uint32 width, uint32 height, int flags)
t_stat vid_open (DEVICE *dptr, const char *title, uint32 width, uint32 height, int flags)
{
if (!vid_active) {
int wait_count = 0;
t_stat stat;
if ((strlen(sim_name) + 7 + (dptr ? strlen (dptr->name) : 0) + (title ? strlen (title) : 0)) < sizeof (vid_title))
sprintf (vid_title, "%s%s%s%s%s", sim_name, dptr ? " - " : "", dptr ? dptr->name : "", title ? " - " : "", title ? title : "");
else
sprintf (vid_title, "%s", sim_name);
vid_flags = flags;
vid_active = TRUE;
vid_width = width;
@ -1619,7 +1624,7 @@ if (vid_flags & SIM_VID_INPUTCAPTURED) {
char title[150];
memset (title, 0, sizeof(title));
strncpy (title, sim_name, sizeof(title)-1);
strncpy (title, vid_title, sizeof(title)-1);
strncat (title, " ReleaseKey=", sizeof(title)-(1+strlen(title)));
strncat (title, vid_release_key, sizeof(title)-(1+strlen(title)));
#if SDL_MAJOR_VERSION == 1
@ -1630,9 +1635,9 @@ if (vid_flags & SIM_VID_INPUTCAPTURED) {
}
else
#if SDL_MAJOR_VERSION == 1
SDL_WM_SetCaption (sim_name, sim_name);
SDL_WM_SetCaption (vid_title, sim_name);
#else
SDL_SetWindowTitle (vid_window, sim_name);
SDL_SetWindowTitle (vid_window, vid_title);
#endif
vid_ready = TRUE;
@ -2253,7 +2258,7 @@ SDL_Delay (vid_beep_duration + 100);/* Wait for sound to finnish */
uint32 vid_mono_palette[2]; /* Monochrome Color Map */
t_stat vid_open (DEVICE *dptr, uint32 width, uint32 height, int flags)
t_stat vid_open (DEVICE *dptr, const char *title, uint32 width, uint32 height, int flags)
{
return SCPE_NOFNC;
}

View file

@ -171,7 +171,7 @@ struct key_event {
typedef struct mouse_event SIM_MOUSE_EVENT;
typedef struct key_event SIM_KEY_EVENT;
t_stat vid_open (DEVICE *dptr, uint32 width, uint32 height, int flags);
t_stat vid_open (DEVICE *dptr, const char *title, uint32 width, uint32 height, int flags);
#define SIM_VID_INPUTCAPTURED 1 /* Mouse and Keyboard input captured (calling */
/* code responsible for cursor display in video) */
t_stat vid_close (void);