/** * Renders the stats data * * @param RI the render interface to draw with * @param X the X location to start rendering at * @param Y the Y location to start rendering at */ void RenderStats(class FCanvas* Canvas,int32 X,int32 Y) { FGameThreadHudData* ViewData = FHUDGroupGameThreadRenderer::Get().Latest; if (!ViewData) { return; } if (FMath::IsNearlyZero(StatGlobals.StatFontScale)) { StatGlobals.StatFontScale = 1.0f; int32 StatFontHeight = STAT_FONT->GetMaxCharHeight(); float CheckFontHeight = float(IDEAL_FONT_HEIGHT); if (StatFontHeight > CheckFontHeight) { StatGlobals.StatFontScale = CheckFontHeight / StatFontHeight; } } float SavedFontScale = STAT_FONT->GetFontScalingFactor(); STAT_FONT->SetFontScalingFactor(StatGlobals.StatFontScale); StatGlobals.Initialize(); RenderGroupedWithHierarchy(*ViewData, Canvas,X,Y); STAT_FONT->SetFontScalingFactor(SavedFontScale); }
/** * Renders the stats data * * @param Viewport The viewport to render to * @param Canvas Canvas object to use for rendering * @param X the X location to start rendering at * @param Y the Y location to start rendering at */ void RenderStats(FViewport* Viewport, class FCanvas* Canvas, int32 X, int32 Y) { FGameThreadHudData* ViewData = FHUDGroupGameThreadRenderer::Get().Latest; if (!ViewData) { return; } GetStatRenderGlobals().Initialize( Viewport->GetSizeXY() ); if( !ViewData->bDrawOnlyRawStats ) { RenderGroupedWithHierarchy(*ViewData, Viewport, Canvas, X, Y); } else { // Render all counters. for( int32 RowIndex = 0; RowIndex < ViewData->GroupDescriptions.Num(); ++RowIndex ) { Canvas->DrawShadowedString(X, Y, *ViewData->GroupDescriptions[RowIndex], GetStatRenderGlobals().StatFont, GetStatRenderGlobals().StatColor); Y += GetStatRenderGlobals().GetFontHeight(); } } }