summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-26 18:33:37 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-26 18:33:37 +0300
commit2f345a6bf8385bf0874b976d0da9790faa4ee0ff (patch)
tree741ea8e5a165dbe8adb8437ed876fe82ae77d9fe /src/actions
parent662ea582cd57827475062fb6b728da6c21c14181 (diff)
downloadmanaplus-2f345a6bf8385bf0874b976d0da9790faa4ee0ff.tar.gz
manaplus-2f345a6bf8385bf0874b976d0da9790faa4ee0ff.tar.bz2
manaplus-2f345a6bf8385bf0874b976d0da9790faa4ee0ff.tar.xz
manaplus-2f345a6bf8385bf0874b976d0da9790faa4ee0ff.zip
Move chat command /cacheinfo into actions.
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/actions.cpp39
-rw-r--r--src/actions/actions.h1
2 files changed, 40 insertions, 0 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index 97c792470..dba8da43f 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -635,4 +635,43 @@ impHandler0(priceSave)
return false;
}
+impHandler0(cacheInfo)
+{
+ if (!chatWindow || !debugChatTab)
+ return false;
+
+/*
+ Font *const font = chatWindow->getFont();
+ if (!font)
+ return;
+
+ const TextChunkList *const cache = font->getCache();
+ if (!cache)
+ return;
+
+ unsigned int all = 0;
+ debugChatTab->chatLog(_("font cache size"));
+ std::string str;
+ for (int f = 0; f < 256; f ++)
+ {
+ if (!cache[f].size)
+ {
+ const unsigned int sz = static_cast<int>(cache[f].size);
+ all += sz;
+ str.append(strprintf("%d: %u, ", f, sz));
+ }
+ }
+ debugChatTab->chatLog(str);
+ debugChatTab->chatLog(strprintf("%s %d", _("Cache size:"), all));
+#ifdef DEBUG_FONT_COUNTERS
+ debugChatTab->chatLog("");
+ debugChatTab->chatLog(strprintf("%s %d",
+ _("Created:"), font->getCreateCounter()));
+ debugChatTab->chatLog(strprintf("%s %d",
+ _("Deleted:"), font->getDeleteCounter()));
+#endif
+*/
+ return true;
+}
+
} // namespace Actions
diff --git a/src/actions/actions.h b/src/actions/actions.h
index 4e0155556..691892bd8 100644
--- a/src/actions/actions.h
+++ b/src/actions/actions.h
@@ -63,6 +63,7 @@ namespace Actions
decHandler(trade);
decHandler(priceLoad);
decHandler(priceSave);
+ decHandler(cacheInfo);
} // namespace Actions
#undef decHandler