FPS Problems Windows10 + Client 5065

08/30/2015 05:16 Spirited#16
I recently looked into how the client displays custom cursors, and it's actually quite ridiculously inefficient. Basically, if the client specifies a custom cursor to display, it loads that cursor, gets the mouse position, and paints the cursor once every client timer iteration (which has no sleeps, it just calls itself infinitely). This may help explain a few things about Conquer's horrible CPU performance in earlier clients.
08/30/2015 08:13 Xio.#17
Quote:
Originally Posted by Spirited View Post
I recently looked into how the client displays custom cursors, and it's actually quite ridiculously inefficient. Basically, if the client specifies a custom cursor to display, it loads that cursor, gets the mouse position, and paints the cursor once every client timer iteration (which has no sleeps, it just calls itself infinitely). This may help explain a few things about Conquer's horrible CPU performance in earlier clients.
I doubt thats true. How would it be fixed by trails?
08/30/2015 08:40 Spirited#18
Quote:
Originally Posted by Xio. View Post
I doubt thats true. How would it be fixed by trails?
I'm reading directly from the source. Taken, it's a very old source.
The dword tick count you see is checked, but the check isn't active in my version of the source.
Code:
void CMyShellDlg::OnTimer(UINT nIDEvent) 
{
	static DWORD dwTicks = 0;
	dwTicks ++;

	...
	switch (g_uStatus)
	...
	case ( _STATUS_NORMAL ):
	{
		...
		ShowAniCursor(m_szCursorAni);
		...
	}
	...
	CDialog::OnTimer(nIDEvent);
}
Code:
void CMyShellDlg::ShowAniCursor(char* szCursorAni)
{
	if (!szCursorAni && strlen(szCursorAni)<=0)
		return;
	CAni* pCursorAni = g_objGameDataSet.GetDataAni ( ( char * )g_strControlAni, szCursorAni, EXIGENCE_IMMEDIATE ) ;
	if ( pCursorAni )
	{
		CPoint mousePnt;
		CRect rect;
		::GetCursorPos( &mousePnt );
		this->GetWindowRect( rect );
		mousePnt.x -= rect.left;
		mousePnt.y -= rect.top;
		
		int nFrame = (::TimeGet()/200)%pCursorAni->GetFrameAmount();
		pCursorAni->Show ( nFrame,
					mousePnt.x,
					mousePnt.y);
	}
}