| 800 | float UI_LastPoll = 0l; |
| 801 | #define MIN_FRAMETIME .033 |
| 802 | int PollUI(void) { |
| 803 | // this should poll UI_frame_result. |
| 804 | int result = -1; |
| 805 | |
| 806 | ui_ShowCursor(); |
| 807 | |
| 808 | // Limit this to a fixed framerate |
| 809 | if (UI_LastPoll) { |
| 810 | if ((timer_GetTime() - UI_LastPoll) < MIN_FRAMETIME) |
| 811 | Sleep((timer_GetTime() - UI_LastPoll) * 1000); |
| 812 | } |
| 813 | |
| 814 | UI_LastPoll = timer_GetTime(); |
| 815 | |
| 816 | Descent->defer(); |
| 817 | DoUIFrame(); |
| 818 | rend_Flip(); |
| 819 | result = GetUIFrameResult(); |
| 820 | if (result != -1) { |
| 821 | ui_HideCursor(); |
| 822 | ui_Flush(); |
| 823 | ddio_KeyFlush(); |
| 824 | } |
| 825 | return result; |
| 826 | } |
| 827 | void *CreateNewUITextItem(const char *newtext, uint32_t color, int font) { |
| 828 | UITextItem *new_text_item; |
| 829 | if (font == -1) { |
no test coverage detected