From 5334fecf60a7cbad1ada8268b122bbce4af9b0d5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 3 Mar 2013 01:17:50 +0300 Subject: Add chat command to clean graphics cache. New chat command: /cleangraphics This command can be usefull for item or monster development. --- src/commands.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/commands.cpp') diff --git a/src/commands.cpp b/src/commands.cpp index c86497f15..0850ba909 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -59,10 +59,11 @@ #ifdef DEBUG_DUMP_LEAKS1 #include "resources/image.h" #include "resources/resource.h" -#include "resources/resourcemanager.h" #include "resources/subimage.h" #endif +#include "resources/resourcemanager.h" + #include "utils/gettext.h" #include "utils/process.h" @@ -344,6 +345,15 @@ impHandler0(clear) chatWindow->clearTab(); } +impHandler0(cleanGraphics) +{ + ResourceManager *const resman = ResourceManager::getInstance(); + while(resman->cleanOrphans(true)); + + if (debugChatTab) + debugChatTab->chatLog("cache cleaned"); +} + impHandler(join) { if (!tab) -- cgit v1.2.3-70-g09d2