Enumerates custom modes SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Sat, 19 Sep 2009 13:31:41 +0000
branchSDL-1.2
changeset 419689c7562eae9b
parent 4195 13de8ea401db
child 4197 1bf6585720e9
Enumerates custom modes
src/video/xbios/SDL_xbios_milan.c
     1.1 --- a/src/video/xbios/SDL_xbios_milan.c	Sat Sep 19 13:21:05 2009 +0000
     1.2 +++ b/src/video/xbios/SDL_xbios_milan.c	Sat Sep 19 13:31:41 2009 +0000
     1.3 @@ -57,6 +57,28 @@
     1.4  	8, 15, 16, 32
     1.5  };
     1.6  
     1.7 +/*--- Variables ---*/
     1.8 +
     1.9 +static int enum_actually_add;
    1.10 +static SDL_VideoDevice *enum_this;
    1.11 +
    1.12 +/*--- Functions ---*/
    1.13 +
    1.14 +static unsigned long /*cdecl*/ enumfunc(SCREENINFO *inf, unsigned long flag)
    1.15 +{
    1.16 +	xbiosmode_t modeinfo;
    1.17 +
    1.18 +	modeinfo.number = inf->devID;
    1.19 +	modeinfo.width = inf->scrWidth;
    1.20 +	modeinfo.height = inf->scrHeight;
    1.21 +	modeinfo.depth = inf->scrPlanes;
    1.22 +	modeinfo.doubleline = SDL_FALSE;
    1.23 +
    1.24 +	SDL_XBIOS_AddMode(enum_this, enum_actually_add, &modeinfo);
    1.25 +
    1.26 +	return ENUMMODE_CONT; 
    1.27 +} 
    1.28 +
    1.29  void SDL_XBIOS_ListMilanModes(_THIS, int actually_add)
    1.30  {
    1.31  	int i;
    1.32 @@ -84,4 +106,7 @@
    1.33  	}
    1.34  
    1.35  	/* Read custom created modes */
    1.36 +	enum_this = this;
    1.37 +	enum_actually_add = actually_add;
    1.38 +	VsetScreen(-1, &enumfunc, MI_MAGIC, CMD_ENUMMODES);
    1.39  }