ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

debug.cpp

Go to the documentation of this file.
00001 /* ResidualVM - A 3D game interpreter
00002  *
00003  * ResidualVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #include "common/debug-channels.h"
00024 
00025 #include "engines/grim/debug.h"
00026 
00027 namespace Grim {
00028 
00029 void Debug::registerDebugChannels() {
00030     DebugMan.addDebugChannel(Info, "info", "");
00031     DebugMan.addDebugChannel(Warning, "warning", "");
00032     DebugMan.addDebugChannel(Error, "error", "");
00033     DebugMan.addDebugChannel(Engine, "engine", "");
00034     DebugMan.addDebugChannel(Lua, "lua", "");
00035     DebugMan.addDebugChannel(Bitmaps, "bitmaps", "");
00036     DebugMan.addDebugChannel(Models, "models", "");
00037     DebugMan.addDebugChannel(Actors, "actors", "");
00038     DebugMan.addDebugChannel(Costumes, "costumes", "");
00039     DebugMan.addDebugChannel(Chores, "chores", "");
00040     DebugMan.addDebugChannel(Fonts, "fonts", "");
00041     DebugMan.addDebugChannel(Keyframes, "keyframes", "");
00042     DebugMan.addDebugChannel(Movie, "movie", "");
00043     DebugMan.addDebugChannel(Sound, "sound", "");
00044     DebugMan.addDebugChannel(Scripts, "scripts", "");
00045     DebugMan.addDebugChannel(Sets, "sets", "");
00046     DebugMan.addDebugChannel(TextObjects, "textobjects", "");
00047     DebugMan.addDebugChannel(Patchr, "patchr", "");
00048     DebugMan.addDebugChannel(Lipsync, "lipsync", "");
00049     DebugMan.addDebugChannel(Sprites, "sprites", "");
00050 }
00051 
00052 bool Debug::isChannelEnabled(DebugChannel chan) {
00053     return DebugMan.isDebugChannelEnabled(chan);
00054 }
00055 
00056 void Debug::debug(DebugChannel channel, const char *s, ...) {
00057     if (isChannelEnabled(channel | Debug::Info)) {
00058         va_list args;
00059         va_start(args, s);
00060         Common::String buf = Common::String::vformat(s, args);
00061         va_end(args);
00062 
00063 		::debug("%s", buf.c_str());
00064     }
00065 }
00066 
00067 void Debug::warning(DebugChannel channel, const char *s, ...) {
00068     if (isChannelEnabled(channel | Debug::Warning)) {
00069         va_list args;
00070         va_start(args, s);
00071         Common::String buf = Common::String::vformat(s, args);
00072         va_end(args);
00073 
00074 		::warning("%s", buf.c_str());
00075     }
00076 }
00077 
00078 void Debug::error(DebugChannel channel, const char *s, ...) {
00079     if (isChannelEnabled(channel | Debug::Error)) {
00080         va_list args;
00081         va_start(args, s);
00082         Common::String buf = Common::String::vformat(s, args);
00083         va_end(args);
00084 
00085 		::error("%s", buf.c_str());
00086     }
00087 }
00088 
00089 void Debug::error(const char *s, ...) {
00090     if (isChannelEnabled(Debug::Error)) {
00091         va_list args;
00092         va_start(args, s);
00093         Common::String buf = Common::String::vformat(s, args);
00094         va_end(args);
00095 
00096 		::error("%s", buf.c_str());
00097     }
00098 }
00099 
00100 }


Generated on Sat Oct 19 2019 05:00:57 for ResidualVM by doxygen 1.7.1
curved edge   curved edge