From b7d822adfd3a84d1e99f255d3fbcdd88aacfebee Mon Sep 17 00:00:00 2001 From: Andrei Drexler Date: Tue, 23 Jun 2009 15:30:34 +0000 Subject: [PATCH] More wide screen stuff. --- reaction/ta_ui/ui_main.c | 21 +++++++++++++-------- reaction/ta_ui/ui_shared.c | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/reaction/ta_ui/ui_main.c b/reaction/ta_ui/ui_main.c index f766e047..097a37f5 100644 --- a/reaction/ta_ui/ui_main.c +++ b/reaction/ta_ui/ui_main.c @@ -8371,6 +8371,11 @@ UI_MouseEvent */ void _UI_MouseEvent(int dx, int dy) { + const int MIN_X = (int)(0.5f * (SCREEN_WIDTH - SCREEN_HEIGHT * uiInfo.uiDC.glconfig.vidWidth / (float)uiInfo.uiDC.glconfig.vidHeight)); + const int MAX_X = SCREEN_WIDTH - MIN_X; + const int MIN_Y = 0; + const int MAX_Y = SCREEN_HEIGHT; + //Makro - added tablet code if (ui_RQ3_tabletMode.integer) { @@ -8384,15 +8389,15 @@ void _UI_MouseEvent(int dx, int dy) uiInfo.uiDC.cursory += dy; } - if (uiInfo.uiDC.cursorx < 0) - uiInfo.uiDC.cursorx = 0; - else if (uiInfo.uiDC.cursorx > SCREEN_WIDTH) - uiInfo.uiDC.cursorx = SCREEN_WIDTH; + if (uiInfo.uiDC.cursorx < MIN_X) + uiInfo.uiDC.cursorx = MIN_X; + else if (uiInfo.uiDC.cursorx > MAX_X) + uiInfo.uiDC.cursorx = MAX_X; - if (uiInfo.uiDC.cursory < 0) - uiInfo.uiDC.cursory = 0; - else if (uiInfo.uiDC.cursory > SCREEN_HEIGHT) - uiInfo.uiDC.cursory = SCREEN_HEIGHT; + if (uiInfo.uiDC.cursory < MIN_Y) + uiInfo.uiDC.cursory = MIN_Y; + else if (uiInfo.uiDC.cursory > MAX_Y) + uiInfo.uiDC.cursory = MAX_Y; if (Menu_Count() > 0) { //menuDef_t *menu = Menu_GetFocused(); diff --git a/reaction/ta_ui/ui_shared.c b/reaction/ta_ui/ui_shared.c index d11a38e1..c119a05c 100644 --- a/reaction/ta_ui/ui_shared.c +++ b/reaction/ta_ui/ui_shared.c @@ -6614,7 +6614,7 @@ void Menu_Paint(menuDef_t * menu, qboolean forcePaint) if (menu->fullScreen) { // implies a background shader // FIXME: make sure we have a default shader if fullscreen is set with no background - DC->drawHandlePic(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, menu->window.background); + DC->drawStretchPic(0, 0, DC->glconfig.vidWidth, DC->glconfig.vidHeight, 0.f, 0.f, 1.f, 1.f, menu->window.background, qfalse); } else if (menu->window.background) { // this allows a background shader without being full screen //UI_DrawHandlePic(menu->window.rect.x, menu->window.rect.y, menu->window.rect.w, menu->window.rect.h, menu->backgroundShader);