------------------------------------------------------------------------------- FIll statistics UI
| 800 | //------------------------------------------------------------------------------- |
| 801 | // FIll statistics UI |
| 802 | int CDisplay::FillDefaultStatistics(void) |
| 803 | { |
| 804 | if (!g_pcAsset) |
| 805 | { |
| 806 | // clear all stats edit controls |
| 807 | SetDlgItemText(g_hDlg,IDC_EVERT,"0"); |
| 808 | SetDlgItemText(g_hDlg,IDC_EFACE,"0"); |
| 809 | SetDlgItemText(g_hDlg,IDC_EMAT,"0"); |
| 810 | SetDlgItemText(g_hDlg,IDC_EMESH,"0"); |
| 811 | SetDlgItemText(g_hDlg,IDC_ENODEWND,"0"); |
| 812 | SetDlgItemText(g_hDlg,IDC_ESHADER,"0"); |
| 813 | SetDlgItemText(g_hDlg,IDC_ELOAD,""); |
| 814 | SetDlgItemText(g_hDlg,IDC_ETEX,"0"); |
| 815 | return 1; |
| 816 | } |
| 817 | |
| 818 | // get the number of vertices/faces in the model |
| 819 | unsigned int iNumVert = 0; |
| 820 | unsigned int iNumFaces = 0; |
| 821 | for (unsigned int i = 0; i < g_pcAsset->pcScene->mNumMeshes;++i) |
| 822 | { |
| 823 | iNumVert += g_pcAsset->pcScene->mMeshes[i]->mNumVertices; |
| 824 | iNumFaces += g_pcAsset->pcScene->mMeshes[i]->mNumFaces; |
| 825 | } |
| 826 | // and fill the statistic edit controls |
| 827 | char szOut[1024]; |
| 828 | ai_snprintf(szOut,1024,"%i",(int)iNumVert); |
| 829 | SetDlgItemText(g_hDlg,IDC_EVERT,szOut); |
| 830 | ai_snprintf(szOut, 1024,"%i",(int)iNumFaces); |
| 831 | SetDlgItemText(g_hDlg,IDC_EFACE,szOut); |
| 832 | ai_snprintf(szOut, 1024,"%i",(int)g_pcAsset->pcScene->mNumMaterials); |
| 833 | SetDlgItemText(g_hDlg,IDC_EMAT,szOut); |
| 834 | ai_snprintf(szOut, 1024,"%i",(int)g_pcAsset->pcScene->mNumMeshes); |
| 835 | SetDlgItemText(g_hDlg,IDC_EMESH,szOut); |
| 836 | |
| 837 | // need to get the number of nodes |
| 838 | iNumVert = 0; |
| 839 | GetNodeCount(g_pcAsset->pcScene->mRootNode,&iNumVert); |
| 840 | ai_snprintf(szOut, 1024,"%i",(int)iNumVert); |
| 841 | SetDlgItemText(g_hDlg,IDC_ENODEWND,szOut); |
| 842 | |
| 843 | // now get the number of unique shaders generated for the asset |
| 844 | // (even if the environment changes this number won't change) |
| 845 | ai_snprintf(szOut, 1024,"%i", CMaterialManager::Instance().GetShaderCount()); |
| 846 | SetDlgItemText(g_hDlg,IDC_ESHADER,szOut); |
| 847 | |
| 848 | sprintf(szOut,"%.5f",(float)g_fLoadTime); |
| 849 | SetDlgItemText(g_hDlg,IDC_ELOAD,szOut); |
| 850 | |
| 851 | UpdateColorFieldsInUI(); |
| 852 | UpdateWindow(g_hDlg); |
| 853 | return 1; |
| 854 | } |
| 855 | //------------------------------------------------------------------------------- |
| 856 | // Reset UI |
| 857 | int CDisplay::Reset(void) |
no test coverage detected