MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / ui_SetScreenMode

Function ui_SetScreenMode

ui/UISystem.cpp:541–563  ·  view source on GitHub ↗

set user interface screen resolution

Source from the content-addressed store, hash-verified

539}
540// set user interface screen resolution
541void ui_SetScreenMode(int w, int h) {
542 int old_w = UI_screen_width;
543 int old_h = UI_screen_height;
544 UI_screen_width = w;
545 UI_screen_height = h;
546 UI_aspect_x = (float)w / (float)FIXED_SCREEN_WIDTH;
547 UI_aspect_y = (float)h / (float)FIXED_SCREEN_HEIGHT;
548 ddio_MouseReset();
549 // ddio_MouseSetLimits(0,0, UI_screen_width, UI_screen_height);
550 ddio_MouseSetVCoords(UI_screen_width, UI_screen_height);
551 UI_input.cur_time = timer_GetTime();
552 // reposition all active open windows to their correct locations in this new resolution
553 //@@ tUIWindowNode *wndnode = UIWindowList;
554 //@@ float scalar_x = -1.0f + (float)w/(float)old_w;
555 //@@ float scalar_y = -1.0f + (float)h/(float)old_h;
556 //@@
557 //@@ while (wndnode)
558 //@@ {
559 //@@ wndnode->wnd->Move(wndnode->wnd->X() + (int)(scalar_x*old_w), wndnode->wnd->Y() + (int)(scalar_y*old_h),
560 //@@ wndnode->wnd->W(), wndnode->wnd->H());
561 //@@ wndnode = wndnode->next;
562 //@@ }
563}
564bool ui_IsCursorVisible() { return UI_cursor_show ? true : false; }

Callers 3

ui_InitFunction · 0.85
SetScreenModeFunction · 0.85
ShowStaticScreenFunction · 0.85

Calls 2

ddio_MouseResetFunction · 0.85
ddio_MouseSetVCoordsFunction · 0.85

Tested by

no test coverage detected