comparison src/video/gem/SDL_gemvideo.c @ 1069:8b1c83edcde2

Restore and save menu bar when entering and exiting fullscreen mode
author Patrice Mandin <patmandin@gmail.com>
date Mon, 06 Jun 2005 10:27:22 +0000
parents 671bbd773c8a
children 75e8378103a9
comparison
equal deleted inserted replaced
1068:adb547913775 1069:8b1c83edcde2
441 /* Setup VDI fill functions */ 441 /* Setup VDI fill functions */
442 vsf_color(VDI_handle,0); 442 vsf_color(VDI_handle,0);
443 vsf_interior(VDI_handle,1); 443 vsf_interior(VDI_handle,1);
444 vsf_perimeter(VDI_handle,0); 444 vsf_perimeter(VDI_handle,0);
445 445
446 /* Menu bar save buffer */
447 menubar_size = GEM_desk_w * GEM_desk_y * VDI_pixelsize;
448 GEM_menubar=Atari_SysMalloc(menubar_size,MX_PREFTTRAM);
449
446 /* Fill video modes list */ 450 /* Fill video modes list */
447 SDL_modelist[0] = malloc(sizeof(SDL_Rect)); 451 SDL_modelist[0] = malloc(sizeof(SDL_Rect));
448 SDL_modelist[0]->x = 0; 452 SDL_modelist[0]->x = 0;
449 SDL_modelist[0]->y = 0; 453 SDL_modelist[0]->y = 0;
450 SDL_modelist[0]->w = VDI_w; 454 SDL_modelist[0]->w = VDI_w;
523 wind_update(BEG_UPDATE); 527 wind_update(BEG_UPDATE);
524 wind_update(BEG_MCTRL); 528 wind_update(BEG_MCTRL);
525 /* Reserve memory space, used to be sure of compatibility */ 529 /* Reserve memory space, used to be sure of compatibility */
526 form_dial( FMD_START, 0,0,0,0, 0,0,VDI_w,VDI_h); 530 form_dial( FMD_START, 0,0,0,0, 0,0,VDI_w,VDI_h);
527 531
532 /* Save menu bar */
533 if (GEM_menubar) {
534 MFDB mfdb_src;
535 short blitcoords[8];
536
537 mfdb_src.fd_addr=GEM_menubar;
538 mfdb_src.fd_w=GEM_desk_w;
539 mfdb_src.fd_h=GEM_desk_y;
540 mfdb_src.fd_wdwidth= (GEM_desk_w*VDI_pixelsize) >> 4;
541 mfdb_src.fd_nplanes=VDI_bpp;
542 mfdb_src.fd_stand=
543 mfdb_src.fd_r1=
544 mfdb_src.fd_r2=
545 mfdb_src.fd_r3= 0;
546
547 blitcoords[0] = blitcoords[4] = 0;
548 blitcoords[1] = blitcoords[5] = 0;
549 blitcoords[2] = blitcoords[6] = GEM_desk_w-1;
550 blitcoords[3] = blitcoords[7] = GEM_desk_y-1;
551
552 vro_cpyfm(VDI_handle, S_ONLY, blitcoords, &VDI_dst_mfdb, &mfdb_src);
553 }
554
528 GEM_locked=SDL_TRUE; 555 GEM_locked=SDL_TRUE;
529 } 556 }
530 } 557 }
531 558
532 static void GEM_UnlockScreen(_THIS) 559 static void GEM_UnlockScreen(_THIS)
533 { 560 {
534 if (GEM_locked) { 561 if (GEM_locked) {
562 /* Restore menu bar */
563 if (GEM_menubar) {
564 MFDB mfdb_src;
565 short blitcoords[8];
566
567 mfdb_src.fd_addr=GEM_menubar;
568 mfdb_src.fd_w=GEM_desk_w;
569 mfdb_src.fd_h=GEM_desk_y;
570 mfdb_src.fd_wdwidth= (GEM_desk_w*VDI_pixelsize) >> 4;
571 mfdb_src.fd_nplanes=VDI_bpp;
572 mfdb_src.fd_stand=
573 mfdb_src.fd_r1=
574 mfdb_src.fd_r2=
575 mfdb_src.fd_r3= 0;
576
577 blitcoords[0] = blitcoords[4] = 0;
578 blitcoords[1] = blitcoords[5] = 0;
579 blitcoords[2] = blitcoords[6] = GEM_desk_w-1;
580 blitcoords[3] = blitcoords[7] = GEM_desk_y-1;
581
582 vro_cpyfm(VDI_handle, S_ONLY, blitcoords, &mfdb_src, &VDI_dst_mfdb);
583 }
584
535 /* Restore screen memory, and send REDRAW to all apps */ 585 /* Restore screen memory, and send REDRAW to all apps */
536 form_dial( FMD_FINISH, 0,0,0,0, 0,0,VDI_w,VDI_h); 586 form_dial( FMD_FINISH, 0,0,0,0, 0,0,VDI_w,VDI_h);
537 /* Unlock AES */ 587 /* Unlock AES */
538 wind_update(END_MCTRL); 588 wind_update(END_MCTRL);
539 wind_update(END_UPDATE); 589 wind_update(END_UPDATE);
1066 wind_delete(GEM_handle); 1116 wind_delete(GEM_handle);
1067 GEM_handle=-1; 1117 GEM_handle=-1;
1068 } 1118 }
1069 1119
1070 GEM_UnlockScreen(this); 1120 GEM_UnlockScreen(this);
1121 if (GEM_menubar) {
1122 Mfree(GEM_menubar);
1123 GEM_menubar=NULL;
1124 }
1071 1125
1072 appl_exit(); 1126 appl_exit();
1073 1127
1074 /* Restore palette */ 1128 /* Restore palette */
1075 if (VDI_oldnumcolors) { 1129 if (VDI_oldnumcolors) {