engine: add safe ParseFile to menu extended API

This commit is contained in:
Alibek Omarov 2021-10-03 03:35:49 +03:00 committed by a1batross
parent 29a8bfb1dc
commit f3fedbfdba
3 changed files with 10 additions and 6 deletions

View File

@ -1232,7 +1232,8 @@ static ui_extendedfuncs_t gExtendedfuncs =
Con_UtfMoveLeft,
Con_UtfMoveRight,
pfnGetRenderers,
Sys_DoubleTime
Sys_DoubleTime,
_COM_ParseFileSafe
};
void UI_UnloadProgs( void )

View File

@ -31,6 +31,10 @@ typedef int HIMAGE; // handle to a graphic
#define PIC_KEEP_SOURCE (1<<1) // some images keep source
#define PIC_NOFLIP_TGA (1<<2) // Steam background completely ignore tga attribute 0x20
// flags for COM_ParseFileSafe
#define PFILE_IGNOREBRACKET (1<<0)
#define PFILE_HANDLECOLON (1<<1)
typedef struct ui_globalvars_s
{
float time; // unclamped host.realtime
@ -206,6 +210,8 @@ typedef struct ui_extendedfuncs_s {
int (*pfnGetRenderers)( unsigned int num, char *shortName, size_t size1, char *readableName, size_t size2 );
double (*pfnDoubleTime)( void );
char *(*pfnParseFile)( char *data, char *buf, const int size, unsigned int flags, int *len );
} ui_extendedfuncs_t;
// deprecated export from old engine

View File

@ -38,11 +38,8 @@ enum
TIME_FILENAME,
};
enum
{
PFILE_IGNOREBRACKET = BIT( 0 ),
PFILE_HANDLECOLON = BIT( 1 )
};
#define PFILE_IGNOREBRACKET BIT( 0 )
#define PFILE_HANDLECOLON BIT( 1 )
//
// crtlib.c