/** * @brief This is called every frame, and can also be called explicitly to flush text to the screen * @sa UI_Draw * @sa CL_ViewRender * @sa SCR_DrawConsole * @sa SCR_DrawCursor */ void SCR_UpdateScreen (void) { if (cls.waitingForStart) return; /* if the screen is disabled (loading plaque is up, or vid mode changing) * do nothing at all */ if (cls.disableScreen) { if (CL_Milliseconds() - cls.disableScreen > 120000 && refdef.ready) { cls.disableScreen = 0; Com_Printf("Loading plaque timed out.\n"); return; } } /* not initialized yet */ if (!screenInitialized) return; R_BeginFrame(); /* draw scene, if it is need */ CL_ViewRender(); /* draw the ui on top of the render view */ UI_Draw(); SCR_DrawConsole(); if (cl_fps->integer) SCR_DrawString(viddef.context.width - 20 - con_fontWidth * 10, 0, va("fps: %3.1f", cls.framerate)); if (scr_rspeed->integer) { if (CL_OnBattlescape()) SCR_DrawString(viddef.context.width - 20 - con_fontWidth * 30, 80, va("brushes: %6i alias: %6i\n", refdef.brushCount, refdef.aliasCount)); else SCR_DrawString(viddef.context.width - 20 - con_fontWidth * 30, 80, va("alias: %6i\n", refdef.aliasCount)); SCR_DrawString(viddef.context.width - 20 - con_fontWidth * 30, 80 + con_fontHeight, va("batches: %6i\n", refdef.batchCount)); if (r_programs->integer) { SCR_DrawString(viddef.context.width - 20 - con_fontWidth * 30, 80 + con_fontHeight * 2, va("FFP->shader switches: %6i\n", refdef.FFPToShaderCount)); SCR_DrawString(viddef.context.width - 20 - con_fontWidth * 30, 80 + con_fontHeight * 3, va("shader->shader switches: %6i\n", refdef.shaderToShaderCount)); SCR_DrawString(viddef.context.width - 20 - con_fontWidth * 30, 80 + con_fontHeight * 4, va("shader->FFP switches: %6i\n", refdef.shaderToFFPCount)); } } SCR_DrawCursor(); R_EndFrame(); }
void MGUI_Redraw() { //gEngfuncs.pfnFillRGBA(0,0,62.5,10,0,188,240,255); if(g_mgui_candraw || g_iMenuActive) { iCanSetMouse = 1; //ShowCursor(false); gExportfuncs.IN_DeactivateMouse(); BTEPanel_BuyMenu_SetTime(); } else { if (iCanSetMouse) { SetCursorPos ( gEngfuncs.GetWindowCenterX(), gEngfuncs.GetWindowCenterY() ); iCanSetMouse = 0; } gExportfuncs.IN_ActivateMouse(); if(g_iMini) UI_Draw(); //ShowCursor(true); return; } if(g_iMenuActive) { UI_Draw(); return; } //MGUI_Base *pNextControl = pRootPanel; MGUI_Panel *pSubPanel = pRootPanel; // Draw Panel while (pSubPanel) { MGUI_Base *pNextControl = pSubPanel; // Draw X if( !(pSubPanel->m_iClosing)) { MGUI_ProcessMessage(pSubPanel); //MH_DrawTGAFunction2(pSubPanel->m_iTexture,pSubPanel->x,pSubPanel->y,pSubPanel->w,pSubPanel->h,255); if(pSubPanel->m_iHaveBg) MH_DrawTGA_9(pSubPanel->m_iTexture, pSubPanel->x, pSubPanel->y, pSubPanel->w, pSubPanel->h, 255); if(pSubPanel->m_bHasClose) { Fonts_SetSize(12,12); Fonts_SetColor(255,0,0,255); Fonts_Draw(L"X",pSubPanel->x+pSubPanel->w-20,pSubPanel->y+20,100,100); } // Set Title if(pSubPanel->m_pTitle) { Fonts_SetSize(pSubPanel->m_iTitleSize,pSubPanel->m_iTitleSize); int iLen = Fonts_GetLen(pSubPanel->m_pTitle); int iStartX = pSubPanel->x+(pSubPanel->w - iLen) / 2; Fonts_SetColor(255,255,255,255); Fonts_Draw(pSubPanel->m_pTitle,iStartX,pSubPanel->y+30,1000,1000); } // Draw Sub Control while(pNextControl->pNext) { MGUI_ProcessMessage(pNextControl->pNext); pNextControl->pNext->Paint(pSubPanel); pNextControl = pNextControl->pNext; } } pSubPanel = pSubPanel->pNextPanel; } int iMousePosX=0; int iMousePoxY=0; gEngfuncs.GetMousePosition( &iMousePosX,&iMousePoxY); MH_DrawTGAFunction2(g_mgui_mouse,iMousePosX,iMousePoxY,g_mouse_w,g_mouse_h,255); }