Enumerates custom modes SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Sat, 19 Sep 2009 13:31:41 +0000
branchSDL-1.2
changeset 4196 89c7562eae9b
parent 4195 13de8ea401db
child 4197 1bf6585720e9
Enumerates custom modes
src/video/xbios/SDL_xbios_milan.c
--- 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);
 }