================= Menu_Paint ================= */
| 5988 | ================= |
| 5989 | */ |
| 5990 | void Menu_Paint(menuDef_t *menu, qboolean forcePaint) |
| 5991 | { |
| 5992 | int i; |
| 5993 | |
| 5994 | if (menu == NULL) |
| 5995 | { |
| 5996 | return; |
| 5997 | } |
| 5998 | |
| 5999 | if (menu->window.flags & WINDOW_SCRIPTWAITING) |
| 6000 | { |
| 6001 | if (DC->realTime > menu->window.delayTime) |
| 6002 | { // Time has elapsed, resume running whatever script we saved |
| 6003 | itemDef_t item; |
| 6004 | item.parent = menu; |
| 6005 | item.window.flags = 0; //clear before calling RunScript |
| 6006 | menu->window.flags &= ~WINDOW_SCRIPTWAITING; |
| 6007 | Item_RunScript(&item, menu->window.delayedScript); |
| 6008 | |
| 6009 | // Could have hit another delay. Need to hoist from fake item |
| 6010 | if (item.window.flags & WINDOW_SCRIPTWAITING) |
| 6011 | { |
| 6012 | menu->window.flags |= WINDOW_SCRIPTWAITING; |
| 6013 | menu->window.delayedScript = item.window.delayedScript; |
| 6014 | menu->window.delayTime = item.window.delayTime; |
| 6015 | } |
| 6016 | } |
| 6017 | } |
| 6018 | |
| 6019 | if (!(menu->window.flags & WINDOW_VISIBLE) && !forcePaint) |
| 6020 | { |
| 6021 | return; |
| 6022 | } |
| 6023 | |
| 6024 | // if (menu->window.ownerDrawFlags && DC->ownerDrawVisible && !DC->ownerDrawVisible(menu->window.ownerDrawFlags)) |
| 6025 | // { |
| 6026 | // return; |
| 6027 | // } |
| 6028 | |
| 6029 | if (forcePaint) |
| 6030 | { |
| 6031 | menu->window.flags |= WINDOW_FORCED; |
| 6032 | } |
| 6033 | |
| 6034 | // draw the background if necessary |
| 6035 | if (menu->fullScreen) |
| 6036 | { |
| 6037 | |
| 6038 | vec4_t color; |
| 6039 | color[0] = menu->window.backColor[0]; |
| 6040 | color[1] = menu->window.backColor[1]; |
| 6041 | color[2] = menu->window.backColor[2]; |
| 6042 | color[3] = menu->window.backColor[3]; |
| 6043 | |
| 6044 | ui.R_SetColor( color); |
| 6045 | |
| 6046 | if (menu->window.background==0) // No background shader given? Make it blank |
| 6047 | { |
no test coverage detected