set user interface screen resolution
| 539 | } |
| 540 | // set user interface screen resolution |
| 541 | void 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 | } |
| 564 | bool ui_IsCursorVisible() { return UI_cursor_show ? true : false; } |
no test coverage detected