changeset 4196:89c7562eae9b SDL-1.2

Enumerates custom modes
author Patrice Mandin <patmandin@gmail.com>
date Sat, 19 Sep 2009 13:31:41 +0000
parents 13de8ea401db
children 1bf6585720e9
files src/video/xbios/SDL_xbios_milan.c
diffstat 1 files changed, 25 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/xbios/SDL_xbios_milan.c	Sat Sep 19 13:21:05 2009 +0000
+++ b/src/video/xbios/SDL_xbios_milan.c	Sat Sep 19 13:31:41 2009 +0000
@@ -57,6 +57,28 @@
 	8, 15, 16, 32
 };
 
+/*--- Variables ---*/
+
+static int enum_actually_add;
+static SDL_VideoDevice *enum_this;
+
+/*--- Functions ---*/
+
+static unsigned long /*cdecl*/ enumfunc(SCREENINFO *inf, unsigned long flag)
+{
+	xbiosmode_t modeinfo;
+
+	modeinfo.number = inf->devID;
+	modeinfo.width = inf->scrWidth;
+	modeinfo.height = inf->scrHeight;
+	modeinfo.depth = inf->scrPlanes;
+	modeinfo.doubleline = SDL_FALSE;
+
+	SDL_XBIOS_AddMode(enum_this, enum_actually_add, &modeinfo);
+
+	return ENUMMODE_CONT; 
+} 
+
 void SDL_XBIOS_ListMilanModes(_THIS, int actually_add)
 {
 	int i;
@@ -84,4 +106,7 @@
 	}
 
 	/* Read custom created modes */
+	enum_this = this;
+	enum_actually_add = actually_add;
+	VsetScreen(-1, &enumfunc, MI_MAGIC, CMD_ENUMMODES);
 }