ref: add enum for screen rotation

This commit is contained in:
mittorn 2019-11-04 20:27:46 +07:00
parent 0e7013eeb0
commit 1365020302
4 changed files with 15 additions and 4 deletions

View File

@ -332,7 +332,8 @@ rserr_t R_ChangeDisplaySettings( int width, int height, qboolean fullscreen )
Android_GetScreenRes(&width, &height);
render_w = width, render_h = height;
render_w = width;
render_h = height;
Con_Reportf( "R_ChangeDisplaySettings: forced resolution to %dx%d)\n", width, height);

View File

@ -125,7 +125,9 @@ rserr_t R_ChangeDisplaySettings( int width, int height, qboolean fullscreen )
uint rotate = vid_rotate->value;
FB_GetScreenRes( &width, &height );
render_w = width, render_h = height;
render_w = width;
render_h = height;
Con_Reportf( "R_ChangeDisplaySettings: forced resolution to %dx%d)\n", width, height );

View File

@ -212,6 +212,14 @@ enum
REF_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008
};
typedef enum ref_screen_rotation_e
{
REF_ROTATE_NONE = 0,
REF_ROTATE_CW = 1,
REF_ROTATE_UD = 2,
REF_ROTATE_CCW = 3,
} ref_screen_rotation_t;
typedef struct remap_info_s
{
unsigned short textures[MAX_SKINS];// alias textures
@ -436,7 +444,7 @@ typedef struct ref_interface_s
// const char *(*R_GetInitError)( void );
void (*R_Shutdown)( void );
const char *(*R_GetConfigName)( void ); // returns config name without extension
qboolean (*R_SetDisplayTransform)( uint rotate, int x, int y, float scale_x, float scale_y );
qboolean (*R_SetDisplayTransform)( ref_screen_rotation_t rotate, int x, int y, float scale_x, float scale_y );
// only called for GL contexts
void (*GL_SetupAttributes)( int safegl );

View File

@ -308,7 +308,7 @@ void R_ProcessEntData( qboolean allocate )
gEngfuncs.drawFuncs->R_ProcessEntData( allocate );
}
qboolean R_SetDisplayTransform( uint rotate, int offset_x, int offset_y, float scale_x, float scale_y )
qboolean R_SetDisplayTransform( ref_screen_rotation_t rotate, int offset_x, int offset_y, float scale_x, float scale_y )
{
qboolean ret = true;
if( rotate > 0 )