MCPcopy Create free account
hub / github.com/JACoders/OpenJK / _UI_MouseEvent

Function _UI_MouseEvent

code/ui/ui_main.cpp:4008–4038  ·  view source on GitHub ↗

================= UI_MouseEvent ================= */ JLFMOUSE CALLED EACH FRAME IN UI

Source from the content-addressed store, hash-verified

4006*/
4007//JLFMOUSE CALLED EACH FRAME IN UI
4008void _UI_MouseEvent( int dx, int dy )
4009{
4010 // update mouse screen position
4011 uiInfo.uiDC.cursorx += dx;
4012 if (uiInfo.uiDC.cursorx < 0)
4013 {
4014 uiInfo.uiDC.cursorx = 0;
4015 }
4016 else if (uiInfo.uiDC.cursorx > SCREEN_WIDTH)
4017 {
4018 uiInfo.uiDC.cursorx = SCREEN_WIDTH;
4019 }
4020
4021 uiInfo.uiDC.cursory += dy;
4022 if (uiInfo.uiDC.cursory < 0)
4023 {
4024 uiInfo.uiDC.cursory = 0;
4025 }
4026 else if (uiInfo.uiDC.cursory > SCREEN_HEIGHT)
4027 {
4028 uiInfo.uiDC.cursory = SCREEN_HEIGHT;
4029 }
4030
4031 if (Menu_Count() > 0)
4032 {
4033 //menuDef_t *menu = Menu_GetFocused();
4034 //Menu_HandleMouseMove(menu, uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory);
4035 Display_MouseMove(NULL, uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory);
4036 }
4037
4038}
4039
4040/*
4041=================

Callers 1

CL_MouseEventFunction · 0.85

Calls 2

Menu_CountFunction · 0.70
Display_MouseMoveFunction · 0.70

Tested by

no test coverage detected