mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2024-11-22 03:41:27 +00:00
We need to pass the XF86VidModeModeInfo pointers to XF86VidModeSwitchToMode
so checking modes in VID_CheckVMode and converting them to our own format isn't really useful.
This commit is contained in:
parent
c0b5b95349
commit
bc1a8fa188
2 changed files with 4 additions and 32 deletions
|
@ -79,13 +79,12 @@ VID_CheckDGA(Display *dpy, int *maj_ver, int *min_ver, int *hasvideo)
|
|||
Check for the presence of the XFree86-VidMode X server extension
|
||||
*/
|
||||
int
|
||||
VID_CheckVMode(Display *dpy, int *maj_ver, int *min_ver, int *num_modes,
|
||||
struct qfvm_modes **modes)
|
||||
VID_CheckVMode(Display *dpy, int *maj_ver, int *min_ver)
|
||||
{
|
||||
#ifdef HAS_DGA
|
||||
XF86VidModeModeInfo **vidmodes;
|
||||
int event_base, error_base;
|
||||
int ret, dummy, i;
|
||||
int dummy;
|
||||
|
||||
if (! XF86VidModeQueryExtension(dpy, &event_base, &error_base)) {
|
||||
return 0;
|
||||
|
@ -98,27 +97,7 @@ VID_CheckVMode(Display *dpy, int *maj_ver, int *min_ver, int *num_modes,
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (! XF86VidModeGetAllModeLines(dpy, DefaultScreen(dpy),
|
||||
num_modes, &vidmodes)) {
|
||||
return 0;
|
||||
}
|
||||
if (*num_modes <= 0) return 0;
|
||||
|
||||
ret = 0;
|
||||
*modes = malloc(sizeof(struct qfvm_modes) * *num_modes);
|
||||
if (*modes) {
|
||||
ret = 1;
|
||||
for (i = 0; i < *num_modes; i++) {
|
||||
(*modes)[i].x = vidmodes[i]->hdisplay;
|
||||
(*modes)[i].y = vidmodes[i]->vdisplay;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < *num_modes; i++) {
|
||||
if (vidmodes[i]->private) XFree(vidmodes[i]->private);
|
||||
}
|
||||
XFree(vidmodes);
|
||||
|
||||
return ret;
|
||||
return 1;
|
||||
#else
|
||||
return 0;
|
||||
#endif // HAS_DGA
|
||||
|
|
|
@ -44,13 +44,6 @@ int VID_CheckDGA(Display *dpy, int *maj_ver, int *min_ver, int *hasvideo);
|
|||
|
||||
Check for the presence of the XFree86-VMode X server extension
|
||||
*/
|
||||
|
||||
struct qfvm_modes {
|
||||
int x;
|
||||
int y;
|
||||
};
|
||||
|
||||
int VID_CheckVMode(Display *dpy, int *maj_ver, int *min_ver, int *num_modes,
|
||||
struct qfvm_modes **modes);
|
||||
int VID_CheckVMode(Display *dpy, int *maj_ver, int *min_ver);
|
||||
|
||||
#endif /* DGA_CHECK_H */
|
||||
|
|
Loading…
Reference in a new issue