23 Mar 2017

This commit is contained in:
g-cont 2017-03-23 00:00:00 +03:00 committed by Alibek Omarov
parent 35922eadcb
commit eae1b29000
9 changed files with 51 additions and 56 deletions

View File

@ -989,6 +989,7 @@ static ui_enginefuncs_t gEngfuncs =
pfnIsMapValid,
GL_ProcessTexture,
COM_CompareFileTime,
VID_GetModeString,
};
void UI_UnloadProgs( void )

View File

@ -437,6 +437,7 @@ void EmitWaterPolys( glpoly_t *polys, qboolean noCull, qboolean direction );
//
#define GL_CheckForErrors() GL_CheckForErrors_( __FILE__, __LINE__ )
void GL_CheckForErrors_( const char *filename, const int fileline );
const char *VID_GetModeString( int vid_mode );
void *GL_GetProcAddress( const char *name );
void GL_UpdateSwapInterval( void );
qboolean GL_DeleteContext( void );

View File

@ -103,30 +103,30 @@ typedef struct vidmode_s
vidmode_t vidmode[] =
{
{ "Mode 0: 4x3", 640, 480, false },
{ "Mode 1: 4x3", 800, 600, false },
{ "Mode 2: 4x3", 960, 720, false },
{ "Mode 3: 4x3", 1024, 768, false },
{ "Mode 4: 4x3", 1152, 864, false },
{ "Mode 5: 4x3", 1280, 800, false },
{ "Mode 6: 4x3", 1280, 960, false },
{ "Mode 7: 4x3", 1280, 1024, false },
{ "Mode 8: 4x3", 1600, 1200, false },
{ "Mode 9: 4x3", 2048, 1536, false },
{ "Mode 10: 16x9", 800, 480, true },
{ "Mode 11: 16x9", 856, 480, true },
{ "Mode 12: 16x9", 960, 540, true },
{ "Mode 13: 16x9", 1024, 576, true },
{ "Mode 14: 16x9", 1024, 600, true },
{ "Mode 15: 16x9", 1280, 720, true },
{ "Mode 16: 16x9", 1360, 768, true },
{ "Mode 17: 16x9", 1366, 768, true },
{ "Mode 18: 16x9", 1440, 900, true },
{ "Mode 19: 16x9", 1680, 1050, true },
{ "Mode 20: 16x9", 1920, 1080, true },
{ "Mode 21: 16x9", 1920, 1200, true },
{ "Mode 22: 16x9", 2560, 1600, true },
{ "Mode 23: 16x9", 1600, 900, true },
{ "640 x 480", 640, 480, false },
{ "800 x 600", 800, 600, false },
{ "960 x 720", 960, 720, false },
{ "1024 x 768", 1024, 768, false },
{ "1152 x 864", 1152, 864, false },
{ "1280 x 800", 1280, 800, false },
{ "1280 x 960", 1280, 960, false },
{ "1280 x 1024", 1280, 1024, false },
{ "1600 x 1200", 1600, 1200, false },
{ "2048 x 1536", 2048, 1536, false },
{ "800 x 480 (wide)", 800, 480, true },
{ "856 x 480 (wide)", 856, 480, true },
{ "960 x 540 (wide)", 960, 540, true },
{ "1024 x 576 (wide)", 1024, 576, true },
{ "1024 x 600 (wide)", 1024, 600, true },
{ "1280 x 720 (wide)", 1280, 720, true },
{ "1360 x 768 (wide)", 1360, 768, true },
{ "1366 x 768 (wide)", 1366, 768, true },
{ "1440 x 900 (wide)", 1440, 900, true },
{ "1680 x 1050 (wide)", 1680, 1050, true },
{ "1920 x 1080 (wide)", 1920, 1080, true },
{ "1920 x 1200 (wide)", 1920, 1200, true },
{ "2560 x 1600 (wide)", 2560, 1600, true },
{ "1600 x 900 (wide)", 1600, 900, true },
};
static dllfunc_t opengl_110funcs[] =
@ -900,6 +900,18 @@ void VID_InitDefaultResolution( void )
glState.height = 480;
}
/*
=================
VID_GetModeString
=================
*/
const char *VID_GetModeString( int vid_mode )
{
if( vid_mode >= 0 && vid_mode < num_vidmodes )
return vidmode[vid_mode].desc;
return NULL; // out of bounds
}
/*
=================
GL_SetPixelformat

View File

@ -161,6 +161,8 @@ typedef struct ui_enginefuncs_s
int (*pfnIsMapValid)( char *filename );
void (*pfnProcessImage)( int texnum, float gamma, int topColor, int bottomColor );
int (*pfnCompareFileTime)( char *filename1, char *filename2, int *iCompare );
const char *(*pfnGetModeString)( int vid_mode );
} ui_enginefuncs_t;
typedef struct

View File

@ -180,5 +180,6 @@ inline void TextMessageSetColor( int r, int g, int b, int alpha = 255 )
#define RANDOM_FLOAT (*g_engfuncs.pfnRandomFloat)
#define COMPARE_FILE_TIME (*g_engfuncs.pfnCompareFileTime)
#define VID_GET_MODE (*g_engfuncs.pfnGetModeString)
#endif//ENGINECALLBACKS_H

View File

@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static const char *uiCreditsDefault[] =
{
"",
"Copyright XashXT Group 2014 (C)",
"Copyright XashXT Group 2017 (C)",
0
};

View File

@ -35,35 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define ID_VERTICALSYNC 6
#define ID_TABLEHINT 7
#define MAX_VIDMODES (sizeof( uiVideoModes ) / sizeof( uiVideoModes[0] )) + 1
static const char *uiVideoModes[] =
{
"640 x 480",
"800 x 600",
"960 x 720",
"1024 x 768",
"1152 x 864",
"1280 x 800",
"1280 x 960",
"1280 x 1024",
"1600 x 1200",
"2048 x 1536",
"800 x 480 (wide)",
"856 x 480 (wide)",
"960 x 540 (wide)",
"1024 x 576 (wide)",
"1024 x 600 (wide)",
"1280 x 720 (wide)",
"1360 x 768 (wide)",
"1366 x 768 (wide)",
"1440 x 900 (wide)",
"1680 x 1050 (wide)",
"1920 x 1080 (wide)",
"1920 x 1200 (wide)",
"2560 x 1600 (wide)",
"1600 x 900 (wide)",
};
#define MAX_VIDMODES 65
typedef struct
{
@ -92,7 +64,12 @@ UI_VidModes_GetModesList
static void UI_VidModes_GetConfig( void )
{
for( int i = 0; i < MAX_VIDMODES-1; i++ )
uiVidModes.videoModesPtr[i] = uiVideoModes[i];
{
uiVidModes.videoModesPtr[i] = VID_GET_MODE( i );
if( !uiVidModes.videoModesPtr[i] )
break; // end of list
}
uiVidModes.videoModesPtr[i] = NULL; // terminator
uiVidModes.vidList.itemNames = uiVidModes.videoModesPtr;

View File

@ -92,7 +92,6 @@ void UI_DrawTitleAnim()
LerpQuad( TitleLerpQuads[f_idx], TitleLerpQuads[s_idx], frac, &c );
PIC_Set( TransPic, 255, 255, 255, 255 );
PIC_DrawAdditive( c.x, c.y, c.lx, c.ly, &r );
}

View File

@ -103,8 +103,10 @@ inline int UnpackAlpha( unsigned int ulRGBA )
return ((ulRGBA & 0xFF000000) >> 24);
}
// Remap a value in the range [A,B] to [C,D].
inline float RemapVal( float val, float A, float B, float C, float D)
{
if( A == B ) return val >= B ? D : C;
return C + (D - C) * (val - A) / (B - A);
}