mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-10 23:02:01 +00:00
Merge pull request #36 from petr666/feature/menu-cursor
Fix team arena cursor; prevent crashes caused by invalid pointer when switching to TA and back
This commit is contained in:
commit
271ce70f86
3 changed files with 20 additions and 17 deletions
|
@ -933,9 +933,6 @@ void UI_MouseEvent( int dx, int dy )
|
|||
else if (uis.cursory > SCREEN_HEIGHT+16)
|
||||
uis.cursory = SCREEN_HEIGHT+16;
|
||||
|
||||
vr->menuCursorX = &uis.cursorx;
|
||||
vr->menuCursorY = &uis.cursory;
|
||||
|
||||
// region test the active menu items
|
||||
for (i=0; i<uis.activemenu->nitems; i++)
|
||||
{
|
||||
|
|
|
@ -50,13 +50,17 @@ Q_EXPORT intptr_t vmMain( int command, int arg0, int arg1, int arg2, int arg3, i
|
|||
case UI_INIT: {
|
||||
int ptr[2] = {arg1, arg2};
|
||||
vr = (vr_clientinfo_t *) (*(long *) (ptr));
|
||||
|
||||
UI_Init();
|
||||
vr->menuCursorX = &uis.cursorx;
|
||||
vr->menuCursorY = &uis.cursory;
|
||||
}
|
||||
return 0;
|
||||
|
||||
case UI_SHUTDOWN:
|
||||
UI_Shutdown();
|
||||
case UI_SHUTDOWN: {
|
||||
vr->menuCursorX = NULL;
|
||||
vr->menuCursorY = NULL;
|
||||
UI_Shutdown();
|
||||
}
|
||||
return 0;
|
||||
|
||||
case UI_KEY_EVENT:
|
||||
|
|
|
@ -163,15 +163,20 @@ Q_EXPORT intptr_t vmMain( int command, int arg0, int arg1, int arg2, int arg3, i
|
|||
return UI_API_VERSION;
|
||||
|
||||
case UI_INIT: {
|
||||
int ptr[2] = {arg1, arg2};
|
||||
vr = (vr_clientinfo_t *) (*(long *) (ptr));
|
||||
_UI_Init(arg0);
|
||||
}
|
||||
return 0;
|
||||
int ptr[2] = {arg1, arg2};
|
||||
vr = (vr_clientinfo_t *) (*(long *) (ptr));
|
||||
_UI_Init(arg0);
|
||||
vr->menuCursorX = &uiInfo.uiDC.cursorx;
|
||||
vr->menuCursorY = &uiInfo.uiDC.cursory;
|
||||
}
|
||||
return 0;
|
||||
|
||||
case UI_SHUTDOWN:
|
||||
_UI_Shutdown();
|
||||
return 0;
|
||||
case UI_SHUTDOWN: {
|
||||
vr->menuCursorX = NULL;
|
||||
vr->menuCursorY = NULL;
|
||||
_UI_Shutdown();
|
||||
}
|
||||
return 0;
|
||||
|
||||
case UI_KEY_EVENT:
|
||||
_UI_KeyEvent( arg0, arg1 );
|
||||
|
@ -5272,9 +5277,6 @@ void _UI_MouseEvent( int dx, int dy )
|
|||
else if (uiInfo.uiDC.cursory > SCREEN_HEIGHT+16)
|
||||
uiInfo.uiDC.cursory = SCREEN_HEIGHT+16;
|
||||
|
||||
vr->menuCursorX = &uiInfo.uiDC.cursorx;
|
||||
vr->menuCursorY = &uiInfo.uiDC.cursory;
|
||||
|
||||
if (Menu_Count() > 0) {
|
||||
//menuDef_t *menu = Menu_GetFocused();
|
||||
//Menu_HandleMouseMove(menu, uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory);
|
||||
|
|
Loading…
Reference in a new issue