From 5f3520c8fedd8c36c8fd2db3abc597b4d9e44b5c Mon Sep 17 00:00:00 2001 From: Patrik Gornicz Date: Sat, 15 Nov 2008 18:13:49 -0500 Subject: [PATCH] created DPF --- src/debug.cpp | 30 ++++++++++++++++++++++++++++++ src/debug.h | 3 +++ src/files.mk | 2 ++ src/main.cpp | 25 +++++-------------------- 4 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 src/debug.cpp diff --git a/src/debug.cpp b/src/debug.cpp new file mode 100644 index 0000000..8c13cbe --- /dev/null +++ b/src/debug.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2008 Patrik Gornicz, Gornicz_P (at) hotmail (dot) com. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "debug.h" + +/// ***** Private Method Headers ***** +/// ***** Private Variables ***** + +/// ***** Public Methods ***** + +void DPF(int level, const char* pstr) +{ + cout << pstr << endl; +} + +/// ***** Private Methods ***** diff --git a/src/debug.h b/src/debug.h index d639b8e..d1bc04d 100644 --- a/src/debug.h +++ b/src/debug.h @@ -34,4 +34,7 @@ using std::endl; #define FPSUPS +void DPF(int level, const char* pstr); + + #endif // DEBUG_H diff --git a/src/files.mk b/src/files.mk index 33564c6..6bd3855 100644 --- a/src/files.mk +++ b/src/files.mk @@ -14,6 +14,8 @@ FILES += effectManager.cpp FILES += collisionManager.cpp FILES += CollisionInfo.cpp +FILES += debug.cpp + FILES := $(addprefix ${CURDIR},${FILES}) SRCS += ${FILES} diff --git a/src/main.cpp b/src/main.cpp index 1e9d4ad..84964d2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -101,33 +101,18 @@ void init() installSignal(); graphics::init(); - -#ifdef DEBUGGING - cout << "Graphics initialized" << endl; - cout << "Graphics initialized2" << endl; -#endif + DPF(0, "Graphics initialized"); game::init(); - -#ifdef DEBUGGING - cout << "Game initialized" << endl; -#endif + DPF(0, "Game initialized"); input::init(); - -#ifdef DEBUGGING - cout << "Input initialized" << endl; -#endif + DPF(0, "Input initialized"); cfg::init(); + DPF(0, "Configs initialized"); -#ifdef DEBUGGING - cout << "Configs initialized" << endl; -#endif - -#ifdef DEBUGGING - cout << "Initialization Complete" << endl; -#endif + DPF(0, "Initialization Complete"); } void clean() -- 2.10.2