Skip to content

Commit fc79fb7

Browse files
committed
Add menu animation fps logging
1 parent 9878f02 commit fc79fb7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Src/StartMenu/StartMenuDLL/MenuPaint.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3012,6 +3012,7 @@ void CMenuContainer::AnimateMenu( int flags, int speed, const RECT &rect )
30123012
RECT clipRect=m_bSubMenu?s_MenuLimits:s_MainMenuLimits;
30133013

30143014
bool bUserPic=(!m_bSubMenu && s_bWin7Style && s_UserPicture.m_hWnd && s_UserPictureRect.top<s_UserPictureRect.bottom);
3015+
int frames=0;
30153016

30163017
if ((flags&AW_BLEND) && speed>0)
30173018
{
@@ -3044,6 +3045,7 @@ void CMenuContainer::AnimateMenu( int flags, int speed, const RECT &rect )
30443045
RedrawWindow();
30453046
if (bUserPic)
30463047
s_UserPicture.Update(alpha);
3048+
frames++;
30473049
}
30483050

30493051
SetWindowLong(GWL_EXSTYLE,GetWindowLong(GWL_EXSTYLE)&~WS_EX_LAYERED);
@@ -3142,6 +3144,7 @@ void CMenuContainer::AnimateMenu( int flags, int speed, const RECT &rect )
31423144
POINT pos={s_UserPictureRect.left-dx,s_UserPictureRect.top-dy};
31433145
s_UserPicture.UpdatePartial(pos,&clipRect);
31443146
}
3147+
frames++;
31453148
}
31463149
DeleteObject(clipRgn);
31473150

@@ -3172,4 +3175,7 @@ void CMenuContainer::AnimateMenu( int flags, int speed, const RECT &rect )
31723175
POINT pos={s_UserPictureRect.left,s_UserPictureRect.top};
31733176
s_UserPicture.UpdatePartial(pos,NULL);
31743177
}
3178+
3179+
if (frames)
3180+
LOG_MENU(LOG_OPEN,L"Menu animation %d frames in %dms (%.0f fps)",frames,speed,1000.0*frames/speed);
31753181
}

0 commit comments

Comments
 (0)