00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include <assert.h>
00017
00018 #include "VidMode.h"
00019
00020
00021
00022 #define WIDTH(V) ((V)>>16)
00023 #define HEIGHT(V) ((V)&0xFFFF)
00024 #define PACK(W,H) (((W)<<16) + (H))
00025
00026 void VidMode_GetResolution (const VidMode V, int *Width, int *Height)
00027 {
00028 int W,H;
00029 assert( Width != NULL );
00030 assert( Height != NULL );
00031 W = WIDTH(V);
00032 H = HEIGHT(V);
00033
00034 assert( W >= 320 );
00035 assert( W < 8000 );
00036 assert( H >= 200 );
00037 assert( H < 8000 );
00038
00039 *Width = W;
00040 *Height = H;
00041 }
00042
00043 geBoolean VidMode_SetResolution (VidMode *V, int Width, int Height)
00044 {
00045 assert( V != NULL );
00046
00047 if ( ( Width < 320 )
00048 || ( Width > 8000 )
00049 || ( Height < 200 )
00050 || ( Height > 8000 )
00051 )
00052 return GE_FALSE;
00053
00054 *V = PACK(Width,Height);
00055 return GE_TRUE;
00056 }
00057