~ubuntu-branches/ubuntu/natty/libsdl1.2/natty

« back to all changes in this revision

Viewing changes to src/video/gem/SDL_gemvideo.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-12-05 20:29:43 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20071205202943-ryogi07hodn5cdif
Tags: 1.2.12-1ubuntu1
* Merge with Debian; remaining changes:
  - Remove svgalib support.
  - Prefer libgl1-mesa-dev build-dependency over xlibmesa-gl-dev.
  - Build for lpia as for i386.
* Link using -Wl,-Bsymbolic-functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
197
197
        if (!(device->hidden->use_dev_mouse)) {
198
198
                vectors_mask |= ATARI_XBIOS_MOUSEEVENTS;        /* XBIOS mouse events */
199
199
        }
200
 
        if (Getcookie(C_MiNT, &dummy)==C_FOUND) {
 
200
/*      if (Getcookie(C_MiNT, &dummy)==C_FOUND) {
201
201
                vectors_mask = 0;
202
 
        }
 
202
        }*/
203
203
 
204
204
        SDL_AtariXbios_InstallVectors(vectors_mask);
205
205
 
467
467
        SDL_AtariGL_InitPointers(this);
468
468
#endif
469
469
 
 
470
        this->info.wm_available = 1;
 
471
 
470
472
        /* We're done! */
471
473
        return(0);
472
474
}
619
621
SDL_Surface *GEM_SetVideoMode(_THIS, SDL_Surface *current,
620
622
                                int width, int height, int bpp, Uint32 flags)
621
623
{
622
 
        int maxwidth, maxheight;
623
624
        Uint32 modeflags, screensize;
624
625
        SDL_bool use_shadow1, use_shadow2;
625
626
 
626
 
        /*--- Verify if asked mode can be used ---*/
627
 
        if (flags & SDL_FULLSCREEN) {
628
 
                maxwidth=VDI_w;
629
 
                maxheight=VDI_h;
630
 
        } else {
631
 
                /* Windowed mode */
632
 
                maxwidth=GEM_desk_w;
633
 
                maxheight=GEM_desk_h;
634
 
        }
635
 
 
636
627
        /* width must be multiple of 16, for vro_cpyfm() and c2p_convert() */
637
628
        if ((width & 15) != 0) {
638
629
                width = (width | 15) +1;
639
630
        }
640
631
 
641
 
        if ((maxwidth < width) || (maxheight < height) || (VDI_bpp != bpp)) {
642
 
                SDL_SetError("Couldn't find requested mode in list");
 
632
        /*--- Verify if asked mode can be used ---*/
 
633
        if (VDI_bpp != bpp) {
 
634
                SDL_SetError("%d bpp mode not supported", bpp);
643
635
                return(NULL);
644
636
        }
645
637
 
 
638
        if (flags & SDL_FULLSCREEN) {
 
639
                if ((VDI_w < width) || (VDI_h < height)) {
 
640
                        SDL_SetError("%dx%d mode is too large", width, height);
 
641
                        return(NULL);
 
642
                }
 
643
        }
 
644
 
646
645
        /*--- Allocate the new pixel format for the screen ---*/
647
646
        if ( ! SDL_ReallocFormat(current, VDI_bpp, VDI_redmask, VDI_greenmask, VDI_bluemask, VDI_alphamask) ) {
648
647
                SDL_SetError("Couldn't allocate new pixel format for requested mode");
748
747
                        }
749
748
 
750
749
                        /* Center window */
751
 
                        x2 = GEM_desk_x+((GEM_desk_w-w2)>>1);
752
 
                        y2 = GEM_desk_y+((GEM_desk_h-h2)>>1);
 
750
                        x2 = (GEM_desk_w-w2)>>1;
 
751
                        y2 = (GEM_desk_h-h2)>>1;
 
752
                        if (x2<0) {
 
753
                                x2 = 0;
 
754
                        }
 
755
                        if (y2<0) {
 
756
                                y2 = 0;
 
757
                        }
 
758
                        x2 += GEM_desk_x;
 
759
                        y2 += GEM_desk_y;
753
760
 
754
761
                        /* Destroy existing window */
755
762
                        if (GEM_handle >= 0) {
776
783
                        /* Open the window */
777
784
                        wind_open(GEM_handle,x2,y2,w2,h2);
778
785
                } else {
779
 
                        /* Resize window if needed, to fit asked video mode */
780
 
                        if (modeflags & SDL_RESIZABLE) {
781
 
                                wind_get (GEM_handle, WF_WORKXYWH, &x2,&y2,&w2,&h2);
782
 
                                if ((w2&15)!=0) {
783
 
                                        w2=(w2|15)+1;
784
 
                                }
785
 
                                if ((w2!=width) || (h2!=height)) {
786
 
                                        if (wind_calc(WC_BORDER, GEM_win_type, x2,y2,width,height, &x2,&y2,&w2,&h2)) {
787
 
                                                wind_set (GEM_handle, WF_CURRXYWH, x2,y2,w2,h2);
788
 
                                        }
789
 
                                }
 
786
                        /* Resize window to fit asked video mode */
 
787
                        wind_get (GEM_handle, WF_WORKXYWH, &x2,&y2,&w2,&h2);
 
788
                        if (wind_calc(WC_BORDER, GEM_win_type, x2,y2,width,height, &x2,&y2,&w2,&h2)) {
 
789
                                wind_set (GEM_handle, WF_CURRXYWH, x2,y2,w2,h2);
790
790
                        }
791
791
                }
792
792