Temporary fix for the menu/fullscreen issue on Linux

This commit is contained in:
Marco Cawthorne 2017-10-22 01:24:11 -05:00
parent 2d764ca306
commit 8931e3cd18
6 changed files with 30 additions and 0 deletions

View file

@ -176,6 +176,9 @@ void CSQC_UpdateView( float fWinWidth, float fWinHeight, float fGameFocus ) {
Nightvision_PostDraw();
if( fGameFocus == TRUE ) {
// temporary
vMousePos = getmousepos();
// The spectator sees things... differently
if ( getplayerkeyvalue( player_localnum, "*spec" ) != "0" ) {
VGUI_DrawSpectatorHUD();

View file

@ -547,6 +547,18 @@ float CSQC_InputEvent( float fEventType, float fKey, float fCharacter, float fDe
} else if ( fEventType == IE_MOUSEDELTA ) {
vMousePos_x += fKey;
vMousePos_y += fCharacter;
if ( vMousePos_x < 0 ) {
vMousePos_x = 0;
} else if ( vMousePos_x > vVideoResolution_x ) {
vMousePos_x = vVideoResolution_x;
}
if ( vMousePos_y < 0 ) {
vMousePos_y = 0;
} else if ( vMousePos_y > vVideoResolution_y ) {
vMousePos_y = vVideoResolution_y;
}
} else {
return FALSE;
}

View file

@ -43,6 +43,9 @@ void m_draw( vector vScreenSize ) {
return;
}
// temporary
vMousePos = getmousepos();
if ( vVideoSize != vScreenSize ) {
vVideoSize = vScreenSize;
vMenuOffset_x = vVideoSize_x / 2 - 320;

View file

@ -128,6 +128,18 @@ float Menu_InputEvent( float fEventType, float fKey, float fCharacter, float fDe
} else if ( fEventType == IE_MOUSEDELTA ) {
vMousePos_x += fKey;
vMousePos_y += fCharacter;
if ( vMousePos_x < 0 ) {
vMousePos_x = 0;
} else if ( vMousePos_x > vVideoSize_x ) {
vMousePos_x = vVideoSize_x;
}
if ( vMousePos_y < 0 ) {
vMousePos_y = 0;
} else if ( vMousePos_y > vVideoSize_y ) {
vMousePos_y = vVideoSize_y;
}
} else {
return FALSE;
}

Binary file not shown.

Binary file not shown.