4 // cvar ngmenu_menu_height
7 Gfx_Real_Width = cvar( "vid_conwidth" );
8 Gfx_Real_Height = cvar( "vid_conheight" );
9 Gfx_Menu_Width = cvar( CVAR_SCMENU_MENU_WIDTH );
10 Gfx_Menu_Height = cvar( CVAR_SCMENU_MENU_HEIGHT );
12 if( Gfx_Menu_Width == 0.0 )
13 Gfx_Menu_Width = GFX_MENU_DEFAULT_WIDTH;
14 if( Gfx_Menu_Height == 0.0 )
15 Gfx_Menu_Height = GFX_MENU_DEFAULT_HEIGHT;
20 local string lWidth, lHeight;
22 lWidth = ftos( GFX_MENU_DEFAULT_WIDTH );
23 lHeight = ftos( GFX_MENU_DEFAULT_HEIGHT );
25 registercvar( CVAR_SCMENU_MENU_WIDTH, lWidth, CVAR_SAVE );
26 registercvar( CVAR_SCMENU_MENU_HEIGHT, lHeight, CVAR_SAVE );
53 bool( string pPic ) Gfx_IsCached =
55 return iscachedpic( pPic );
58 bool( string pPic ) Gfx_Precache =
63 if( iscachedpic( pPic ) )
65 if( precache_pic( pPic ) == pPic )
70 void( string pPic ) Gfx_Free
72 // DO NOTHING UNTIL A REF COUNTER IS IMPLEMENTED
75 vector( string pPic ) Gfx_GetImageSize
77 return drawgetimagesize( pPic );
80 vector( vector pPos ) Gfx_ConToMen =
82 pPos_x = pPos_x * Gfx_Menu_Width / Gfx_Real_Width;
83 pPos_y = pPos_y * Gfx_Menu_Height / Gfx_Real_Height;
89 vector( vector pPos ) Gfx_MenToCon =
91 pPos_x = pPos_x * Gfx_Real_Width / Gfx_Menu_Width;
92 pPos_y = pPos_y * Gfx_Real_Height / Gfx_Menu_Height;
98 void() Gfx_ResetClipArea =
103 vector( vector pPosition ) _Gfx_FitCenter =
105 return (pPosition + '0.375 0.375 0');
108 float( vector pPosition, float pCharacter, vector pScale, vector pRGB, float pAlpha, float pFlag )
111 pPosition = _Gfx_FitCenter( Gfx_MenToCon( pPosition ) );
112 pScale = Gfx_MenToCon( pScale );
114 return drawcharacter( pPosition, pCharacter, pScale, pRGB, pAlpha, pFlag );
117 float( vector pPosition, string pText, vector pScale, vector pRGB, float pAlpha, float pFlag )
120 pPosition = _Gfx_FitCenter( Gfx_MenToCon( pPosition ) );
121 pScale = Gfx_MenToCon( pScale );
123 return drawstring( pPosition, pText, pScale, pRGB, pAlpha, pFlag );
126 float( vector pPosition, string pPicture, vector pSize, vector pRGB, float pAlpha, float pFlag )
129 pPosition = _Gfx_FitCenter( Gfx_MenToCon( pPosition ) );
130 pSize = Gfx_MenToCon( pSize );
132 return drawpic( pPosition, pPicture, pSize, pRGB, pAlpha, pFlag );
135 float( vector pPosition, vector pSize, vector pRGB, float pAlpha, float pFlag )
138 pPosition = _Gfx_FitCenter( Gfx_MenToCon( pPosition ) );
139 pSize = Gfx_MenToCon( pSize );
141 return drawfill( pPosition, pSize, pRGB, pAlpha, pFlag );
144 void( float pX, float pY, float pWidth, float pHeight )
147 local vector lPosition, lSize;
155 lPosition = _Gfx_FitCenter( Gfx_MenToCon( lPosition ) );
156 lSize = Gfx_MenToCon( lSize ) + '1 1 0';
158 drawsetcliparea( lPosition_x, lPosition_y, lSize_x, lSize_y );