summaryrefslogtreecommitdiff
path: root/externals/microprofile/microprofileui.h
diff options
context:
space:
mode:
Diffstat (limited to 'externals/microprofile/microprofileui.h')
-rw-r--r--externals/microprofile/microprofileui.h108
1 files changed, 54 insertions, 54 deletions
diff --git a/externals/microprofile/microprofileui.h b/externals/microprofile/microprofileui.h
index ddaebe55b..fe2410cf4 100644
--- a/externals/microprofile/microprofileui.h
+++ b/externals/microprofile/microprofileui.h
@@ -417,19 +417,19 @@ void MicroProfileToggleDisplayMode()
417} 417}
418 418
419 419
420void MicroProfileStringArrayClear(MicroProfileStringArray* pArray) 420inline void MicroProfileStringArrayClear(MicroProfileStringArray* pArray)
421{ 421{
422 pArray->nNumStrings = 0; 422 pArray->nNumStrings = 0;
423 pArray->pBufferPos = &pArray->Buffer[0]; 423 pArray->pBufferPos = &pArray->Buffer[0];
424} 424}
425 425
426void MicroProfileStringArrayAddLiteral(MicroProfileStringArray* pArray, const char* pLiteral) 426inline void MicroProfileStringArrayAddLiteral(MicroProfileStringArray* pArray, const char* pLiteral)
427{ 427{
428 MP_ASSERT(pArray->nNumStrings < MICROPROFILE_TOOLTIP_MAX_STRINGS); 428 MP_ASSERT(pArray->nNumStrings < MICROPROFILE_TOOLTIP_MAX_STRINGS);
429 pArray->ppStrings[pArray->nNumStrings++] = pLiteral; 429 pArray->ppStrings[pArray->nNumStrings++] = pLiteral;
430} 430}
431 431
432void MicroProfileStringArrayFormat(MicroProfileStringArray* pArray, const char* fmt, ...) 432inline void MicroProfileStringArrayFormat(MicroProfileStringArray* pArray, const char* fmt, ...)
433{ 433{
434 MP_ASSERT(pArray->nNumStrings < MICROPROFILE_TOOLTIP_MAX_STRINGS); 434 MP_ASSERT(pArray->nNumStrings < MICROPROFILE_TOOLTIP_MAX_STRINGS);
435 pArray->ppStrings[pArray->nNumStrings++] = pArray->pBufferPos; 435 pArray->ppStrings[pArray->nNumStrings++] = pArray->pBufferPos;
@@ -439,7 +439,7 @@ void MicroProfileStringArrayFormat(MicroProfileStringArray* pArray, const char*
439 va_end(args); 439 va_end(args);
440 MP_ASSERT(pArray->pBufferPos < pArray->Buffer + MICROPROFILE_TOOLTIP_STRING_BUFFER_SIZE); 440 MP_ASSERT(pArray->pBufferPos < pArray->Buffer + MICROPROFILE_TOOLTIP_STRING_BUFFER_SIZE);
441} 441}
442void MicroProfileStringArrayCopy(MicroProfileStringArray* pDest, MicroProfileStringArray* pSrc) 442inline void MicroProfileStringArrayCopy(MicroProfileStringArray* pDest, MicroProfileStringArray* pSrc)
443{ 443{
444 memcpy(&pDest->ppStrings[0], &pSrc->ppStrings[0], sizeof(pDest->ppStrings)); 444 memcpy(&pDest->ppStrings[0], &pSrc->ppStrings[0], sizeof(pDest->ppStrings));
445 memcpy(&pDest->Buffer[0], &pSrc->Buffer[0], sizeof(pDest->Buffer)); 445 memcpy(&pDest->Buffer[0], &pSrc->Buffer[0], sizeof(pDest->Buffer));
@@ -456,7 +456,7 @@ void MicroProfileStringArrayCopy(MicroProfileStringArray* pDest, MicroProfileStr
456 pDest->nNumStrings = pSrc->nNumStrings; 456 pDest->nNumStrings = pSrc->nNumStrings;
457} 457}
458 458
459void MicroProfileFloatWindowSize(const char** ppStrings, uint32_t nNumStrings, uint32_t* pColors, uint32_t& nWidth, uint32_t& nHeight, uint32_t* pStringLengths = 0) 459inline void MicroProfileFloatWindowSize(const char** ppStrings, uint32_t nNumStrings, uint32_t* pColors, uint32_t& nWidth, uint32_t& nHeight, uint32_t* pStringLengths = 0)
460{ 460{
461 uint32_t* nStringLengths = pStringLengths ? pStringLengths : (uint32_t*)alloca(nNumStrings * sizeof(uint32_t)); 461 uint32_t* nStringLengths = pStringLengths ? pStringLengths : (uint32_t*)alloca(nNumStrings * sizeof(uint32_t));
462 uint32_t nTextCount = nNumStrings/2; 462 uint32_t nTextCount = nNumStrings/2;
@@ -474,7 +474,7 @@ void MicroProfileFloatWindowSize(const char** ppStrings, uint32_t nNumStrings, u
474 nHeight = (MICROPROFILE_TEXT_HEIGHT+1) * nTextCount + 2 * MICROPROFILE_BORDER_SIZE; 474 nHeight = (MICROPROFILE_TEXT_HEIGHT+1) * nTextCount + 2 * MICROPROFILE_BORDER_SIZE;
475} 475}
476 476
477void MicroProfileDrawFloatWindow(uint32_t nX, uint32_t nY, const char** ppStrings, uint32_t nNumStrings, uint32_t nColor, uint32_t* pColors = 0) 477inline void MicroProfileDrawFloatWindow(uint32_t nX, uint32_t nY, const char** ppStrings, uint32_t nNumStrings, uint32_t nColor, uint32_t* pColors = 0)
478{ 478{
479 uint32_t nWidth = 0, nHeight = 0; 479 uint32_t nWidth = 0, nHeight = 0;
480 uint32_t* nStringLengths = (uint32_t*)alloca(nNumStrings * sizeof(uint32_t)); 480 uint32_t* nStringLengths = (uint32_t*)alloca(nNumStrings * sizeof(uint32_t));
@@ -503,7 +503,7 @@ void MicroProfileDrawFloatWindow(uint32_t nX, uint32_t nY, const char** ppString
503 nY += (MICROPROFILE_TEXT_HEIGHT+1); 503 nY += (MICROPROFILE_TEXT_HEIGHT+1);
504 } 504 }
505} 505}
506void MicroProfileDrawTextBox(uint32_t nX, uint32_t nY, const char** ppStrings, uint32_t nNumStrings, uint32_t nColor, uint32_t* pColors = 0) 506inline void MicroProfileDrawTextBox(uint32_t nX, uint32_t nY, const char** ppStrings, uint32_t nNumStrings, uint32_t nColor, uint32_t* pColors = 0)
507{ 507{
508 uint32_t nWidth = 0, nHeight = 0; 508 uint32_t nWidth = 0, nHeight = 0;
509 uint32_t* nStringLengths = (uint32_t*)alloca(nNumStrings * sizeof(uint32_t)); 509 uint32_t* nStringLengths = (uint32_t*)alloca(nNumStrings * sizeof(uint32_t));
@@ -529,7 +529,7 @@ void MicroProfileDrawTextBox(uint32_t nX, uint32_t nY, const char** ppStrings, u
529 529
530 530
531 531
532void MicroProfileToolTipMeta(MicroProfileStringArray* pToolTip) 532inline void MicroProfileToolTipMeta(MicroProfileStringArray* pToolTip)
533{ 533{
534 MicroProfile& S = *MicroProfileGet(); 534 MicroProfile& S = *MicroProfileGet();
535 if(UI.nRangeBeginIndex != UI.nRangeEndIndex && UI.pRangeLog) 535 if(UI.nRangeBeginIndex != UI.nRangeEndIndex && UI.pRangeLog)
@@ -608,7 +608,7 @@ void MicroProfileToolTipMeta(MicroProfileStringArray* pToolTip)
608 } 608 }
609} 609}
610 610
611void MicroProfileDrawFloatTooltip(uint32_t nX, uint32_t nY, uint32_t nToken, uint64_t nTime) 611inline void MicroProfileDrawFloatTooltip(uint32_t nX, uint32_t nY, uint32_t nToken, uint64_t nTime)
612{ 612{
613 MicroProfile& S = *MicroProfileGet(); 613 MicroProfile& S = *MicroProfileGet();
614 614
@@ -718,7 +718,7 @@ void MicroProfileDrawFloatTooltip(uint32_t nX, uint32_t nY, uint32_t nToken, uin
718} 718}
719 719
720 720
721void MicroProfileZoomTo(int64_t nTickStart, int64_t nTickEnd) 721inline void MicroProfileZoomTo(int64_t nTickStart, int64_t nTickEnd)
722{ 722{
723 MicroProfile& S = *MicroProfileGet(); 723 MicroProfile& S = *MicroProfileGet();
724 724
@@ -728,7 +728,7 @@ void MicroProfileZoomTo(int64_t nTickStart, int64_t nTickEnd)
728 UI.fDetailedRangeTarget = MicroProfileLogTickDifference(nTickStart, nTickEnd) * fToMs; 728 UI.fDetailedRangeTarget = MicroProfileLogTickDifference(nTickStart, nTickEnd) * fToMs;
729} 729}
730 730
731void MicroProfileCenter(int64_t nTickCenter) 731inline void MicroProfileCenter(int64_t nTickCenter)
732{ 732{
733 MicroProfile& S = *MicroProfileGet(); 733 MicroProfile& S = *MicroProfileGet();
734 int64_t nStart = S.Frames[S.nFrameCurrent].nFrameStartCpu; 734 int64_t nStart = S.Frames[S.nFrameCurrent].nFrameStartCpu;
@@ -739,7 +739,7 @@ void MicroProfileCenter(int64_t nTickCenter)
739#ifdef MICROPROFILE_DEBUG 739#ifdef MICROPROFILE_DEBUG
740uint64_t* g_pMicroProfileDumpStart = 0; 740uint64_t* g_pMicroProfileDumpStart = 0;
741uint64_t* g_pMicroProfileDumpEnd = 0; 741uint64_t* g_pMicroProfileDumpEnd = 0;
742void MicroProfileDebugDumpRange() 742inline void MicroProfileDebugDumpRange()
743{ 743{
744 MicroProfile& S = *MicroProfileGet(); 744 MicroProfile& S = *MicroProfileGet();
745 if(g_pMicroProfileDumpStart != g_pMicroProfileDumpEnd) 745 if(g_pMicroProfileDumpStart != g_pMicroProfileDumpEnd)
@@ -777,7 +777,7 @@ void MicroProfileDebugDumpRange()
777 777
778#define MICROPROFILE_HOVER_DIST 0.5f 778#define MICROPROFILE_HOVER_DIST 0.5f
779 779
780void MicroProfileDrawDetailedContextSwitchBars(uint32_t nY, uint32_t nThreadId, uint32_t nContextSwitchStart, uint32_t nContextSwitchEnd, int64_t nBaseTicks, uint32_t nBaseY) 780inline void MicroProfileDrawDetailedContextSwitchBars(uint32_t nY, uint32_t nThreadId, uint32_t nContextSwitchStart, uint32_t nContextSwitchEnd, int64_t nBaseTicks, uint32_t nBaseY)
781{ 781{
782 MicroProfile& S = *MicroProfileGet(); 782 MicroProfile& S = *MicroProfileGet();
783 int64_t nTickIn = -1; 783 int64_t nTickIn = -1;
@@ -841,7 +841,7 @@ void MicroProfileDrawDetailedContextSwitchBars(uint32_t nY, uint32_t nThreadId,
841 } 841 }
842} 842}
843 843
844void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY, int nSelectedFrame) 844inline void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY, int nSelectedFrame)
845{ 845{
846 MicroProfile& S = *MicroProfileGet(); 846 MicroProfile& S = *MicroProfileGet();
847 MP_DEBUG_DUMP_RANGE(); 847 MP_DEBUG_DUMP_RANGE();
@@ -1325,7 +1325,7 @@ void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY,
1325} 1325}
1326 1326
1327 1327
1328void MicroProfileDrawDetailedFrameHistory(uint32_t nWidth, uint32_t nHeight, uint32_t nBaseY, uint32_t nSelectedFrame) 1328inline void MicroProfileDrawDetailedFrameHistory(uint32_t nWidth, uint32_t nHeight, uint32_t nBaseY, uint32_t nSelectedFrame)
1329{ 1329{
1330 MicroProfile& S = *MicroProfileGet(); 1330 MicroProfile& S = *MicroProfileGet();
1331 1331
@@ -1379,7 +1379,7 @@ void MicroProfileDrawDetailedFrameHistory(uint32_t nWidth, uint32_t nHeight, uin
1379 } 1379 }
1380 MicroProfileDrawBox(fSelectionStart, nBaseY, fSelectionEnd, nBaseY+MICROPROFILE_FRAME_HISTORY_HEIGHT, MICROPROFILE_FRAME_HISTORY_COLOR_HIGHTLIGHT, MicroProfileBoxTypeFlat); 1380 MicroProfileDrawBox(fSelectionStart, nBaseY, fSelectionEnd, nBaseY+MICROPROFILE_FRAME_HISTORY_HEIGHT, MICROPROFILE_FRAME_HISTORY_COLOR_HIGHTLIGHT, MicroProfileBoxTypeFlat);
1381} 1381}
1382void MicroProfileDrawDetailedView(uint32_t nWidth, uint32_t nHeight) 1382inline void MicroProfileDrawDetailedView(uint32_t nWidth, uint32_t nHeight)
1383{ 1383{
1384 MicroProfile& S = *MicroProfileGet(); 1384 MicroProfile& S = *MicroProfileGet();
1385 1385
@@ -1416,11 +1416,11 @@ void MicroProfileDrawDetailedView(uint32_t nWidth, uint32_t nHeight)
1416 MicroProfileDrawDetailedFrameHistory(nWidth, nHeight, nBaseY, nSelectedFrame); 1416 MicroProfileDrawDetailedFrameHistory(nWidth, nHeight, nBaseY, nSelectedFrame);
1417} 1417}
1418 1418
1419void MicroProfileDrawTextRight(uint32_t nX, uint32_t nY, uint32_t nColor, const char* pStr, uint32_t nStrLen) 1419inline void MicroProfileDrawTextRight(uint32_t nX, uint32_t nY, uint32_t nColor, const char* pStr, uint32_t nStrLen)
1420{ 1420{
1421 MicroProfileDrawText(nX - nStrLen * (MICROPROFILE_TEXT_WIDTH+1), nY, nColor, pStr, nStrLen); 1421 MicroProfileDrawText(nX - nStrLen * (MICROPROFILE_TEXT_WIDTH+1), nY, nColor, pStr, nStrLen);
1422} 1422}
1423void MicroProfileDrawHeader(int32_t nX, uint32_t nWidth, const char* pName) 1423inline void MicroProfileDrawHeader(int32_t nX, uint32_t nWidth, const char* pName)
1424{ 1424{
1425 if(pName) 1425 if(pName)
1426 { 1426 {
@@ -1432,7 +1432,7 @@ void MicroProfileDrawHeader(int32_t nX, uint32_t nWidth, const char* pName)
1432 1432
1433typedef void (*MicroProfileLoopGroupCallback)(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pData); 1433typedef void (*MicroProfileLoopGroupCallback)(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pData);
1434 1434
1435void MicroProfileLoopActiveGroupsDraw(int32_t nX, int32_t nY, const char* pName, MicroProfileLoopGroupCallback CB, void* pData) 1435inline void MicroProfileLoopActiveGroupsDraw(int32_t nX, int32_t nY, const char* pName, MicroProfileLoopGroupCallback CB, void* pData)
1436{ 1436{
1437 MicroProfile& S = *MicroProfileGet(); 1437 MicroProfile& S = *MicroProfileGet();
1438 nY += MICROPROFILE_TEXT_HEIGHT + 2; 1438 nY += MICROPROFILE_TEXT_HEIGHT + 2;
@@ -1465,7 +1465,7 @@ void MicroProfileLoopActiveGroupsDraw(int32_t nX, int32_t nY, const char* pName,
1465} 1465}
1466 1466
1467 1467
1468void MicroProfileCalcTimers(float* pTimers, float* pAverage, float* pMax, float* pCallAverage, float* pExclusive, float* pAverageExclusive, float* pMaxExclusive, uint64_t nGroup, uint32_t nSize) 1468inline void MicroProfileCalcTimers(float* pTimers, float* pAverage, float* pMax, float* pCallAverage, float* pExclusive, float* pAverageExclusive, float* pMaxExclusive, uint64_t nGroup, uint32_t nSize)
1469{ 1469{
1470 MicroProfile& S = *MicroProfileGet(); 1470 MicroProfile& S = *MicroProfileGet();
1471 1471
@@ -1527,7 +1527,7 @@ void MicroProfileCalcTimers(float* pTimers, float* pAverage, float* pMax, float*
1527 1527
1528#define SBUF_MAX 32 1528#define SBUF_MAX 32
1529 1529
1530void MicroProfileDrawBarArrayCallback(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pExtra) 1530inline void MicroProfileDrawBarArrayCallback(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pExtra)
1531{ 1531{
1532 const uint32_t nHeight = MICROPROFILE_TEXT_HEIGHT; 1532 const uint32_t nHeight = MICROPROFILE_TEXT_HEIGHT;
1533 const uint32_t nTextWidth = 6 * (1+MICROPROFILE_TEXT_WIDTH); 1533 const uint32_t nTextWidth = 6 * (1+MICROPROFILE_TEXT_WIDTH);
@@ -1547,7 +1547,7 @@ void MicroProfileDrawBarArrayCallback(uint32_t nTimer, uint32_t nIdx, uint64_t n
1547} 1547}
1548 1548
1549 1549
1550uint32_t MicroProfileDrawBarArray(int32_t nX, int32_t nY, float* pTimers, const char* pName, uint32_t nTotalHeight, float* pTimers2 = NULL) 1550inline uint32_t MicroProfileDrawBarArray(int32_t nX, int32_t nY, float* pTimers, const char* pName, uint32_t nTotalHeight, float* pTimers2 = NULL)
1551{ 1551{
1552 const uint32_t nTextWidth = 6 * (1+MICROPROFILE_TEXT_WIDTH); 1552 const uint32_t nTextWidth = 6 * (1+MICROPROFILE_TEXT_WIDTH);
1553 const uint32_t nWidth = MICROPROFILE_BAR_WIDTH; 1553 const uint32_t nWidth = MICROPROFILE_BAR_WIDTH;
@@ -1559,7 +1559,7 @@ uint32_t MicroProfileDrawBarArray(int32_t nX, int32_t nY, float* pTimers, const
1559 return nWidth + 5 + nTextWidth; 1559 return nWidth + 5 + nTextWidth;
1560 1560
1561} 1561}
1562void MicroProfileDrawBarCallCountCallback(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pExtra) 1562inline void MicroProfileDrawBarCallCountCallback(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pExtra)
1563{ 1563{
1564 MicroProfile& S = *MicroProfileGet(); 1564 MicroProfile& S = *MicroProfileGet();
1565 char sBuffer[SBUF_MAX]; 1565 char sBuffer[SBUF_MAX];
@@ -1567,7 +1567,7 @@ void MicroProfileDrawBarCallCountCallback(uint32_t nTimer, uint32_t nIdx, uint64
1567 MicroProfileDrawText(nX, nY, (uint32_t)-1, sBuffer, nLen); 1567 MicroProfileDrawText(nX, nY, (uint32_t)-1, sBuffer, nLen);
1568} 1568}
1569 1569
1570uint32_t MicroProfileDrawBarCallCount(int32_t nX, int32_t nY, const char* pName) 1570inline uint32_t MicroProfileDrawBarCallCount(int32_t nX, int32_t nY, const char* pName)
1571{ 1571{
1572 MicroProfileLoopActiveGroupsDraw(nX, nY, pName, MicroProfileDrawBarCallCountCallback, 0); 1572 MicroProfileLoopActiveGroupsDraw(nX, nY, pName, MicroProfileDrawBarCallCountCallback, 0);
1573 const uint32_t nTextWidth = 6 * MICROPROFILE_TEXT_WIDTH; 1573 const uint32_t nTextWidth = 6 * MICROPROFILE_TEXT_WIDTH;
@@ -1581,7 +1581,7 @@ struct MicroProfileMetaAverageArgs
1581 float fRcpFrames; 1581 float fRcpFrames;
1582}; 1582};
1583 1583
1584void MicroProfileDrawBarMetaAverageCallback(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pExtra) 1584inline void MicroProfileDrawBarMetaAverageCallback(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pExtra)
1585{ 1585{
1586 MicroProfileMetaAverageArgs* pArgs = (MicroProfileMetaAverageArgs*)pExtra; 1586 MicroProfileMetaAverageArgs* pArgs = (MicroProfileMetaAverageArgs*)pExtra;
1587 uint64_t* pCounters = pArgs->pCounters; 1587 uint64_t* pCounters = pArgs->pCounters;
@@ -1591,7 +1591,7 @@ void MicroProfileDrawBarMetaAverageCallback(uint32_t nTimer, uint32_t nIdx, uint
1591 MicroProfileDrawText(nX - nLen * (MICROPROFILE_TEXT_WIDTH+1), nY, (uint32_t)-1, sBuffer, nLen); 1591 MicroProfileDrawText(nX - nLen * (MICROPROFILE_TEXT_WIDTH+1), nY, (uint32_t)-1, sBuffer, nLen);
1592} 1592}
1593 1593
1594uint32_t MicroProfileDrawBarMetaAverage(int32_t nX, int32_t nY, uint64_t* pCounters, const char* pName, uint32_t nTotalHeight) 1594inline uint32_t MicroProfileDrawBarMetaAverage(int32_t nX, int32_t nY, uint64_t* pCounters, const char* pName, uint32_t nTotalHeight)
1595{ 1595{
1596 if(!pName) 1596 if(!pName)
1597 return 0; 1597 return 0;
@@ -1605,7 +1605,7 @@ uint32_t MicroProfileDrawBarMetaAverage(int32_t nX, int32_t nY, uint64_t* pCount
1605} 1605}
1606 1606
1607 1607
1608void MicroProfileDrawBarMetaCountCallback(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pExtra) 1608inline void MicroProfileDrawBarMetaCountCallback(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pExtra)
1609{ 1609{
1610 uint64_t* pCounters = (uint64_t*)pExtra; 1610 uint64_t* pCounters = (uint64_t*)pExtra;
1611 char sBuffer[SBUF_MAX]; 1611 char sBuffer[SBUF_MAX];
@@ -1613,7 +1613,7 @@ void MicroProfileDrawBarMetaCountCallback(uint32_t nTimer, uint32_t nIdx, uint64
1613 MicroProfileDrawText(nX - nLen * (MICROPROFILE_TEXT_WIDTH+1), nY, (uint32_t)-1, sBuffer, nLen); 1613 MicroProfileDrawText(nX - nLen * (MICROPROFILE_TEXT_WIDTH+1), nY, (uint32_t)-1, sBuffer, nLen);
1614} 1614}
1615 1615
1616uint32_t MicroProfileDrawBarMetaCount(int32_t nX, int32_t nY, uint64_t* pCounters, const char* pName, uint32_t nTotalHeight) 1616inline uint32_t MicroProfileDrawBarMetaCount(int32_t nX, int32_t nY, uint64_t* pCounters, const char* pName, uint32_t nTotalHeight)
1617{ 1617{
1618 if(!pName) 1618 if(!pName)
1619 return 0; 1619 return 0;
@@ -1625,7 +1625,7 @@ uint32_t MicroProfileDrawBarMetaCount(int32_t nX, int32_t nY, uint64_t* pCounter
1625 return 5 + nTextWidth; 1625 return 5 + nTextWidth;
1626} 1626}
1627 1627
1628void MicroProfileDrawBarLegendCallback(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pExtra) 1628inline void MicroProfileDrawBarLegendCallback(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pExtra)
1629{ 1629{
1630 MicroProfile& S = *MicroProfileGet(); 1630 MicroProfile& S = *MicroProfileGet();
1631 if (S.TimerInfo[nTimer].bGraph) 1631 if (S.TimerInfo[nTimer].bGraph)
@@ -1640,7 +1640,7 @@ void MicroProfileDrawBarLegendCallback(uint32_t nTimer, uint32_t nIdx, uint64_t
1640 } 1640 }
1641} 1641}
1642 1642
1643uint32_t MicroProfileDrawBarLegend(int32_t nX, int32_t nY, uint32_t nTotalHeight, uint32_t nMaxWidth) 1643inline uint32_t MicroProfileDrawBarLegend(int32_t nX, int32_t nY, uint32_t nTotalHeight, uint32_t nMaxWidth)
1644{ 1644{
1645 MicroProfileDrawLineVertical(nX-5, nY, nTotalHeight, UI.nOpacityBackground | g_nMicroProfileBackColors[0]|g_nMicroProfileBackColors[1]); 1645 MicroProfileDrawLineVertical(nX-5, nY, nTotalHeight, UI.nOpacityBackground | g_nMicroProfileBackColors[0]|g_nMicroProfileBackColors[1]);
1646 MicroProfileLoopActiveGroupsDraw(nMaxWidth, nY, 0, MicroProfileDrawBarLegendCallback, 0); 1646 MicroProfileLoopActiveGroupsDraw(nMaxWidth, nY, 0, MicroProfileDrawBarLegendCallback, 0);
@@ -1807,7 +1807,7 @@ void MicroProfileDumpTimers()
1807 } 1807 }
1808} 1808}
1809 1809
1810void MicroProfileDrawBarView(uint32_t nScreenWidth, uint32_t nScreenHeight) 1810inline void MicroProfileDrawBarView(uint32_t nScreenWidth, uint32_t nScreenHeight)
1811{ 1811{
1812 MicroProfile& S = *MicroProfileGet(); 1812 MicroProfile& S = *MicroProfileGet();
1813 1813
@@ -1951,7 +1951,7 @@ typedef const char* (*MicroProfileSubmenuCallback)(int, bool* bSelected);
1951typedef void (*MicroProfileClickCallback)(int); 1951typedef void (*MicroProfileClickCallback)(int);
1952 1952
1953 1953
1954const char* MicroProfileUIMenuMode(int nIndex, bool* bSelected) 1954inline const char* MicroProfileUIMenuMode(int nIndex, bool* bSelected)
1955{ 1955{
1956 MicroProfile& S = *MicroProfileGet(); 1956 MicroProfile& S = *MicroProfileGet();
1957 switch(nIndex) 1957 switch(nIndex)
@@ -1979,7 +1979,7 @@ const char* MicroProfileUIMenuMode(int nIndex, bool* bSelected)
1979 } 1979 }
1980} 1980}
1981 1981
1982const char* MicroProfileUIMenuGroups(int nIndex, bool* bSelected) 1982inline const char* MicroProfileUIMenuGroups(int nIndex, bool* bSelected)
1983{ 1983{
1984 MicroProfile& S = *MicroProfileGet(); 1984 MicroProfile& S = *MicroProfileGet();
1985 *bSelected = false; 1985 *bSelected = false;
@@ -2012,7 +2012,7 @@ const char* MicroProfileUIMenuGroups(int nIndex, bool* bSelected)
2012 } 2012 }
2013} 2013}
2014 2014
2015const char* MicroProfileUIMenuAggregate(int nIndex, bool* bSelected) 2015inline const char* MicroProfileUIMenuAggregate(int nIndex, bool* bSelected)
2016{ 2016{
2017 MicroProfile& S = *MicroProfileGet(); 2017 MicroProfile& S = *MicroProfileGet();
2018 if(nIndex < sizeof(g_MicroProfileAggregatePresets)/sizeof(g_MicroProfileAggregatePresets[0])) 2018 if(nIndex < sizeof(g_MicroProfileAggregatePresets)/sizeof(g_MicroProfileAggregatePresets[0]))
@@ -2032,7 +2032,7 @@ const char* MicroProfileUIMenuAggregate(int nIndex, bool* bSelected)
2032 2032
2033} 2033}
2034 2034
2035const char* MicroProfileUIMenuTimers(int nIndex, bool* bSelected) 2035inline const char* MicroProfileUIMenuTimers(int nIndex, bool* bSelected)
2036{ 2036{
2037 MicroProfile& S = *MicroProfileGet(); 2037 MicroProfile& S = *MicroProfileGet();
2038 *bSelected = 0 != (S.nBars & (1 << nIndex)); 2038 *bSelected = 0 != (S.nBars & (1 << nIndex));
@@ -2054,7 +2054,7 @@ const char* MicroProfileUIMenuTimers(int nIndex, bool* bSelected)
2054 return 0; 2054 return 0;
2055} 2055}
2056 2056
2057const char* MicroProfileUIMenuOptions(int nIndex, bool* bSelected) 2057inline const char* MicroProfileUIMenuOptions(int nIndex, bool* bSelected)
2058{ 2058{
2059 MicroProfile& S = *MicroProfileGet(); 2059 MicroProfile& S = *MicroProfileGet();
2060 if(nIndex >= MICROPROFILE_OPTION_SIZE) return 0; 2060 if(nIndex >= MICROPROFILE_OPTION_SIZE) return 0;
@@ -2094,7 +2094,7 @@ const char* MicroProfileUIMenuOptions(int nIndex, bool* bSelected)
2094 return UI.Options[nIndex].Text; 2094 return UI.Options[nIndex].Text;
2095} 2095}
2096 2096
2097const char* MicroProfileUIMenuPreset(int nIndex, bool* bSelected) 2097inline const char* MicroProfileUIMenuPreset(int nIndex, bool* bSelected)
2098{ 2098{
2099 static char buf[128]; 2099 static char buf[128];
2100 *bSelected = false; 2100 *bSelected = false;
@@ -2118,7 +2118,7 @@ const char* MicroProfileUIMenuPreset(int nIndex, bool* bSelected)
2118 } 2118 }
2119} 2119}
2120 2120
2121const char* MicroProfileUIMenuCustom(int nIndex, bool* bSelected) 2121inline const char* MicroProfileUIMenuCustom(int nIndex, bool* bSelected)
2122{ 2122{
2123 if((uint32_t)-1 == UI.nCustomActive) 2123 if((uint32_t)-1 == UI.nCustomActive)
2124 { 2124 {
@@ -2145,13 +2145,13 @@ const char* MicroProfileUIMenuCustom(int nIndex, bool* bSelected)
2145 } 2145 }
2146} 2146}
2147 2147
2148const char* MicroProfileUIMenuEmpty(int nIndex, bool* bSelected) 2148inline const char* MicroProfileUIMenuEmpty(int nIndex, bool* bSelected)
2149{ 2149{
2150 return 0; 2150 return 0;
2151} 2151}
2152 2152
2153 2153
2154void MicroProfileUIClickMode(int nIndex) 2154inline void MicroProfileUIClickMode(int nIndex)
2155{ 2155{
2156 MicroProfile& S = *MicroProfileGet(); 2156 MicroProfile& S = *MicroProfileGet();
2157 switch(nIndex) 2157 switch(nIndex)
@@ -2176,7 +2176,7 @@ void MicroProfileUIClickMode(int nIndex)
2176 } 2176 }
2177} 2177}
2178 2178
2179void MicroProfileUIClickGroups(int nIndex) 2179inline void MicroProfileUIClickGroups(int nIndex)
2180{ 2180{
2181 MicroProfile& S = *MicroProfileGet(); 2181 MicroProfile& S = *MicroProfileGet();
2182 if(nIndex == 0) 2182 if(nIndex == 0)
@@ -2208,7 +2208,7 @@ void MicroProfileUIClickGroups(int nIndex)
2208 } 2208 }
2209} 2209}
2210 2210
2211void MicroProfileUIClickAggregate(int nIndex) 2211inline void MicroProfileUIClickAggregate(int nIndex)
2212{ 2212{
2213 MicroProfile& S = *MicroProfileGet(); 2213 MicroProfile& S = *MicroProfileGet();
2214 S.nAggregateFlip = g_MicroProfileAggregatePresets[nIndex]; 2214 S.nAggregateFlip = g_MicroProfileAggregatePresets[nIndex];
@@ -2218,13 +2218,13 @@ void MicroProfileUIClickAggregate(int nIndex)
2218 } 2218 }
2219} 2219}
2220 2220
2221void MicroProfileUIClickTimers(int nIndex) 2221inline void MicroProfileUIClickTimers(int nIndex)
2222{ 2222{
2223 MicroProfile& S = *MicroProfileGet(); 2223 MicroProfile& S = *MicroProfileGet();
2224 S.nBars ^= (1 << nIndex); 2224 S.nBars ^= (1 << nIndex);
2225} 2225}
2226 2226
2227void MicroProfileUIClickOptions(int nIndex) 2227inline void MicroProfileUIClickOptions(int nIndex)
2228{ 2228{
2229 MicroProfile& S = *MicroProfileGet(); 2229 MicroProfile& S = *MicroProfileGet();
2230 switch(UI.Options[nIndex].nSubType) 2230 switch(UI.Options[nIndex].nSubType)
@@ -2271,7 +2271,7 @@ void MicroProfileUIClickOptions(int nIndex)
2271 } 2271 }
2272} 2272}
2273 2273
2274void MicroProfileUIClickPreset(int nIndex) 2274inline void MicroProfileUIClickPreset(int nIndex)
2275{ 2275{
2276 int nNumPresets = sizeof(g_MicroProfilePresetNames) / sizeof(g_MicroProfilePresetNames[0]); 2276 int nNumPresets = sizeof(g_MicroProfilePresetNames) / sizeof(g_MicroProfilePresetNames[0]);
2277 int nIndexSave = nIndex - nNumPresets - 1; 2277 int nIndexSave = nIndex - nNumPresets - 1;
@@ -2285,7 +2285,7 @@ void MicroProfileUIClickPreset(int nIndex)
2285 } 2285 }
2286} 2286}
2287 2287
2288void MicroProfileUIClickCustom(int nIndex) 2288inline void MicroProfileUIClickCustom(int nIndex)
2289{ 2289{
2290 if(nIndex == 0) 2290 if(nIndex == 0)
2291 { 2291 {
@@ -2298,13 +2298,13 @@ void MicroProfileUIClickCustom(int nIndex)
2298 2298
2299} 2299}
2300 2300
2301void MicroProfileUIClickEmpty(int nIndex) 2301inline void MicroProfileUIClickEmpty(int nIndex)
2302{ 2302{
2303 2303
2304} 2304}
2305 2305
2306 2306
2307void MicroProfileDrawMenu(uint32_t nWidth, uint32_t nHeight) 2307inline void MicroProfileDrawMenu(uint32_t nWidth, uint32_t nHeight)
2308{ 2308{
2309 MicroProfile& S = *MicroProfileGet(); 2309 MicroProfile& S = *MicroProfileGet();
2310 2310
@@ -2489,7 +2489,7 @@ void MicroProfileDrawMenu(uint32_t nWidth, uint32_t nHeight)
2489} 2489}
2490 2490
2491 2491
2492void MicroProfileMoveGraph() 2492inline void MicroProfileMoveGraph()
2493{ 2493{
2494 2494
2495 int nZoom = UI.nMouseWheelDelta; 2495 int nZoom = UI.nMouseWheelDelta;
@@ -2536,7 +2536,7 @@ void MicroProfileMoveGraph()
2536 UI.nOffsetY = 0; 2536 UI.nOffsetY = 0;
2537} 2537}
2538 2538
2539void MicroProfileDrawCustom(uint32_t nWidth, uint32_t nHeight) 2539inline void MicroProfileDrawCustom(uint32_t nWidth, uint32_t nHeight)
2540{ 2540{
2541 if((uint32_t)-1 != UI.nCustomActive) 2541 if((uint32_t)-1 != UI.nCustomActive)
2542 { 2542 {
@@ -2633,7 +2633,7 @@ void MicroProfileDrawCustom(uint32_t nWidth, uint32_t nHeight)
2633 } 2633 }
2634 } 2634 }
2635} 2635}
2636void MicroProfileDraw(uint32_t nWidth, uint32_t nHeight) 2636inline void MicroProfileDraw(uint32_t nWidth, uint32_t nHeight)
2637{ 2637{
2638 MICROPROFILE_SCOPE(g_MicroProfileDraw); 2638 MICROPROFILE_SCOPE(g_MicroProfileDraw);
2639 MicroProfile& S = *MicroProfileGet(); 2639 MicroProfile& S = *MicroProfileGet();
@@ -3226,7 +3226,7 @@ void MicroProfileLoadPreset(const char* pSuffix)
3226 } 3226 }
3227} 3227}
3228 3228
3229uint32_t MicroProfileCustomGroupFind(const char* pCustomName) 3229inline uint32_t MicroProfileCustomGroupFind(const char* pCustomName)
3230{ 3230{
3231 for(uint32_t i = 0; i < UI.nCustomCount; ++i) 3231 for(uint32_t i = 0; i < UI.nCustomCount; ++i)
3232 { 3232 {
@@ -3238,7 +3238,7 @@ uint32_t MicroProfileCustomGroupFind(const char* pCustomName)
3238 return (uint32_t)-1; 3238 return (uint32_t)-1;
3239} 3239}
3240 3240
3241uint32_t MicroProfileCustomGroup(const char* pCustomName) 3241inline uint32_t MicroProfileCustomGroup(const char* pCustomName)
3242{ 3242{
3243 for(uint32_t i = 0; i < UI.nCustomCount; ++i) 3243 for(uint32_t i = 0; i < UI.nCustomCount; ++i)
3244 { 3244 {
@@ -3271,7 +3271,7 @@ void MicroProfileCustomGroup(const char* pCustomName, uint32_t nMaxTimers, uint3
3271 UI.Custom[nIndex].nAggregateFlip = nAggregateFlip; 3271 UI.Custom[nIndex].nAggregateFlip = nAggregateFlip;
3272} 3272}
3273 3273
3274void MicroProfileCustomGroupEnable(uint32_t nIndex) 3274inline void MicroProfileCustomGroupEnable(uint32_t nIndex)
3275{ 3275{
3276 if(nIndex < UI.nCustomCount) 3276 if(nIndex < UI.nCustomCount)
3277 { 3277 {