diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-03-02 01:45:23 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-03-02 01:45:23 +0300 |
commit | 13d827728ad47f6362258175ac1706ceb6bb8b8d (patch) | |
tree | bb8d175a03c8ec671737f247f4979e1921f4672c | |
parent | 490862919d79369112c75955a9c36ff8a081efd3 (diff) | |
download | plus-13d827728ad47f6362258175ac1706ceb6bb8b8d.tar.gz plus-13d827728ad47f6362258175ac1706ceb6bb8b8d.tar.bz2 plus-13d827728ad47f6362258175ac1706ceb6bb8b8d.tar.xz plus-13d827728ad47f6362258175ac1706ceb6bb8b8d.zip |
Add opengl settings dump command.
Chat command: /dumpogl
-rw-r--r-- | src/commandhandler.cpp | 14 | ||||
-rw-r--r-- | src/commandhandler.h | 2 | ||||
-rw-r--r-- | src/gui/chatwindow.cpp | 1 | ||||
-rw-r--r-- | src/openglgraphics.cpp | 20 | ||||
-rw-r--r-- | src/openglgraphics.h | 2 |
5 files changed, 39 insertions, 0 deletions
diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp index 9f832c021..67b03e78c 100644 --- a/src/commandhandler.cpp +++ b/src/commandhandler.cpp @@ -57,6 +57,10 @@ #include "net/playerhandler.h" #include "net/tradehandler.h" +#if defined USE_OPENGL +#include "openglgraphics.h" +#endif + #ifdef DEBUG_DUMP_LEAKS #include "resources/image.h" #include "resources/resource.h" @@ -207,6 +211,8 @@ void CommandHandler::handleCommand(const std::string &command, ChatTab *tab) handleDumpGraphics(args, tab); else if (type == "dumpt") handleDumpTests(args, tab); + else if (type == "dumpogl") + handleDumpOGL(args, tab); else if (tab->handleCommand(type, args)) ; else if (type == "hack") @@ -1347,3 +1353,11 @@ void CommandHandler::replaceVars(std::string &str) } } } + +void CommandHandler::handleDumpOGL(const std::string &args A_UNUSED, + ChatTab *tab A_UNUSED) +{ +#if defined USE_OPENGL + OpenGLGraphics::dumpSettings(); +#endif +} diff --git a/src/commandhandler.h b/src/commandhandler.h index d399accf7..a8f21ac7a 100644 --- a/src/commandhandler.h +++ b/src/commandhandler.h @@ -304,6 +304,8 @@ class CommandHandler void handleDumpTests(const std::string &args, ChatTab *tab); + void handleDumpOGL(const std::string &args, ChatTab *tab); + void outString(ChatTab *tab, const std::string &str, const std::string &def); diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp index ac493b04e..eb8669223 100644 --- a/src/gui/chatwindow.cpp +++ b/src/gui/chatwindow.cpp @@ -307,6 +307,7 @@ void ChatWindow::fillCommands() mCommands.push_back("/serverunignoreall"); mCommands.push_back("/dumpg"); mCommands.push_back("/dumpt"); + mCommands.push_back("/dumpogl"); mCommands.push_back("/pseudoaway "); mCommands.push_back("<PLAYER>"); mCommands.push_back("<MONSTER>"); diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp index d972a738f..14d525163 100644 --- a/src/openglgraphics.cpp +++ b/src/openglgraphics.cpp @@ -1351,4 +1351,24 @@ inline void OpenGLGraphics::drawLineArrayf(int size) glDrawArrays(GL_LINES, 0, size / 2); } +void OpenGLGraphics::dumpSettings() +{ + GLint test[1000]; + logger->log("\n\n"); + logger->log("start opengl dump"); + for (int f = 0; f < 65535; f ++) + { + test[0] = 0; + test[1] = 0; + test[2] = 0; + test[3] = 0; + glGetIntegerv(f, &test[0]); + if (test[0] || test[1] || test[2] || test[3]) + { + logger->log("%d = %d, %d, %d, %d", f, test[0], test[1], test[2], test[3]); + } + } + logger->log("end opengl dump\n\n"); +} + #endif // USE_OPENGL diff --git a/src/openglgraphics.h b/src/openglgraphics.h index 9eeb530ac..02d628af0 100644 --- a/src/openglgraphics.h +++ b/src/openglgraphics.h @@ -131,6 +131,8 @@ class OpenGLGraphics : public Graphics void drawLineArrayf(int size); + static void dumpSettings(); + /** * Takes a screenshot and returns it as SDL surface. */ |