comparison src/video/x11/SDL_x11modes.c @ 4154:db4007f17bc8 SDL-1.2

Correct fix for Bugzilla #602.
author Ryan C. Gordon <icculus@icculus.org>
date Mon, 15 Sep 2008 20:47:55 +0000
parents 0e44c6f90b95
children a1b03ba2fcd0
comparison
equal deleted inserted replaced
4153:e66db1af0714 4154:db4007f17bc8
50 #endif 50 #endif
51 51
52 #if SDL_VIDEO_DRIVER_X11_VIDMODE 52 #if SDL_VIDEO_DRIVER_X11_VIDMODE
53 Bool SDL_NAME(XF86VidModeGetModeInfo)(Display *dpy, int scr, SDL_NAME(XF86VidModeModeInfo) *info) 53 Bool SDL_NAME(XF86VidModeGetModeInfo)(Display *dpy, int scr, SDL_NAME(XF86VidModeModeInfo) *info)
54 { 54 {
55 SDL_NAME(XF86VidModeModeLine) *l = (SDL_NAME(XF86VidModeModeLine)*)((char*)info + sizeof info->dotclock); 55 Bool retval;
56 return SDL_NAME(XF86VidModeGetModeLine)(dpy, scr, (int*)&info->dotclock, l); 56 int dotclock;
57 SDL_NAME(XF86VidModeModeLine) l;
58 SDL_memset(&l, 0, sizeof(l));
59 retval = SDL_NAME(XF86VidModeGetModeLine)(dpy, scr, &dotclock, &l);
60 info->dotclock = dotclock;
61 info->hdisplay = l.hdisplay;
62 info->hsyncstart = l.hsyncstart;
63 info->hsyncend = l.hsyncend;
64 info->htotal = l.htotal;
65 info->hskew = l.hskew;
66 info->vdisplay = l.vdisplay;
67 info->vsyncstart = l.vsyncstart;
68 info->vsyncend = l.vsyncend;
69 info->vtotal = l.vtotal;
70 info->flags = l.flags;
71 info->privsize = l.privsize;
72 info->private = l.private;
73 return retval;
57 } 74 }
58 #endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */ 75 #endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */
59 76
60 #if SDL_VIDEO_DRIVER_X11_VIDMODE 77 #if SDL_VIDEO_DRIVER_X11_VIDMODE
61 static void save_mode(_THIS) 78 static void save_mode(_THIS)