Skip to content

Commit 0a28c28

Browse files
committed
Improvements to Debug 'summary'
1 parent 889dabd commit 0a28c28

File tree

1 file changed

+54
-13
lines changed

1 file changed

+54
-13
lines changed

world_debug.cpp

Lines changed: 54 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -864,13 +864,14 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
864864

865865
// work out operating system
866866

867-
char * sVersion = "unknown";
867+
CString sVersion = TFormat ("Unknown (Platform %ld, Major %ld, Minor %ld)",
868+
ver.dwPlatformId, ver.dwMajorVersion, ver.dwMinorVersion);
868869

869870
if (ver.dwPlatformId == 1) // Windows 95-style versions
870871
{
871872
switch (ver.dwMinorVersion)
872873
{
873-
case 0: sVersion = "Windows 95"; break;
874+
case 0: sVersion = "Windows 95"; break;
874875
case 10: sVersion = "Windows 98"; break;
875876
case 90: sVersion = "Windows ME"; break;
876877
} // end of switch on dwMinorVersion
@@ -880,12 +881,12 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
880881
switch (ver.dwMajorVersion)
881882
{
882883
case 3: sVersion = "Windows NT 3.51"; break;
883-
case 4: sVersion = "Windows NT"; break;
884+
case 4: sVersion = "Windows NT"; break;
884885
case 5:
885886
switch (ver.dwMinorVersion)
886887
{
887-
case 0: sVersion = "Windows 2000"; break;
888-
case 1: sVersion = "Windows XP"; break;
888+
case 0: sVersion = "Windows 2000"; break;
889+
case 1: sVersion = "Windows XP"; break;
889890
case 2: sVersion = "Windows Server 2003"; break;
890891
} // end of switch on dwMinorVersion
891892
break; // end case 5 of dwMinorVersion
@@ -894,16 +895,15 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
894895
switch (ver.dwMinorVersion)
895896
{
896897
case 0: sVersion = "Windows Vista"; break;
897-
case 1: sVersion = "Windows 7"; break;
898+
case 1: sVersion = "Windows 7"; break;
898899
} // end of switch on dwMinorVersion
899900
break; // end case 6 of dwMinorVersion
900901

901902
} // end of switch on dwMajorVersion
902903
} // end of dwPlatformId == 2
903904

904905

905-
Note (TFormat ("Operating system: %s", sVersion));
906-
906+
Note (TFormat ("Operating system: %s", (LPCTSTR) sVersion));
907907

908908
// show included library versions
909909
Note (TFormat ("Using: %s, PCRE %s, PNG %s, SQLite3 %s, Zlib %s",
@@ -913,7 +913,6 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
913913
SQLITE_VERSION,
914914
ZLIB_VERSION));
915915

916-
917916
// scripting info
918917

919918
Note (TFormat ("Script language: %s, enabled: %s",
@@ -926,10 +925,8 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
926925
(LPCTSTR) m_strScriptFilename
927926
));
928927

929-
930928
// count triggers, aliases, timers
931929

932-
933930
POSITION pos;
934931
CString strName;
935932
CTrigger * pTrigger;
@@ -1086,13 +1083,15 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
10861083
{
10871084
pPlugin = m_PluginList.GetNext (pos);
10881085
nTotal++;
1086+
1087+
if (pPlugin->m_bEnabled)
1088+
nEnabled++;
1089+
10891090
Note (TFormat ("Plugin: %s, '%s', enabled: %s",
10901091
(LPCTSTR) pPlugin->m_strID,
10911092
(LPCTSTR) pPlugin->m_strName,
10921093
(pPlugin->m_bEnabled ? "yes" : "no")));
10931094

1094-
if (pPlugin->m_bEnabled)
1095-
nEnabled++;
10961095

10971096
}
10981097

@@ -1142,6 +1141,48 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
11421141

11431142
Note (TFormat ("** Commands in command history: %ld", nTotal));
11441143

1144+
// miniwindows
1145+
nTotal = 0;
1146+
nEnabled = 0;
1147+
1148+
for (MiniWindowMapIterator it = m_MiniWindows.begin ();
1149+
it != m_MiniWindows.end ();
1150+
it++)
1151+
{
1152+
CMiniWindow * pWindow = it->second;
1153+
nTotal++;
1154+
int nHotspots = 0;
1155+
1156+
if (pWindow->GetShow ())
1157+
nEnabled++;
1158+
1159+
// count hotspots
1160+
for (HotspotMapIterator hit = pWindow->m_Hotspots.begin ();
1161+
hit != pWindow->m_Hotspots.end ();
1162+
hit++)
1163+
{
1164+
nHotspots++;
1165+
}
1166+
1167+
Note (TFormat ("Window: '%s', at (%ld,%ld,%ld,%ld), enabled: %s",
1168+
it->first.c_str (),
1169+
pWindow->m_rect.left,
1170+
pWindow->m_rect.top,
1171+
pWindow->m_rect.right,
1172+
pWindow->m_rect.bottom,
1173+
(pWindow->GetShow () ? "yes" : "no")));
1174+
1175+
Note (TFormat (" width: %ld, height: %ld, position: %d, hotspots: %ld",
1176+
pWindow->GetWidth (),
1177+
pWindow->GetHeight (),
1178+
pWindow->GetPosition (),
1179+
nHotspots
1180+
));
1181+
1182+
}
1183+
1184+
Note (TFormat ("** Miniwindows: %ld loaded, %ld enabled.", nTotal, nEnabled));
1185+
11451186
Note ("");
11461187
Note ("-------------- End summary --------------");
11471188

0 commit comments

Comments
 (0)