2021-03-02 02:13:17 +00:00
|
|
|
// Project64 - A Nintendo 64 emulator
|
|
|
|
// http://www.pj64-emu.com/
|
|
|
|
// Copyright(C) 2001-2021 Project64
|
|
|
|
// Copyright(C) 2007 Hiroshi Morii
|
|
|
|
// Copyright(C) 2003 Rice1964
|
|
|
|
// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html
|
2013-04-17 10:30:38 +00:00
|
|
|
|
|
|
|
#ifndef __TXDBG_H__
|
|
|
|
#define __TXDBG_H__
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include "TxInternal.h"
|
|
|
|
|
|
|
|
class TxDbg
|
|
|
|
{
|
|
|
|
private:
|
2017-04-26 10:23:36 +00:00
|
|
|
FILE* _dbgfile;
|
|
|
|
int _level;
|
|
|
|
TxDbg();
|
2013-04-17 10:30:38 +00:00
|
|
|
public:
|
2017-04-26 10:23:36 +00:00
|
|
|
static TxDbg* getInstance() {
|
|
|
|
static TxDbg txDbg;
|
|
|
|
return &txDbg;
|
|
|
|
}
|
|
|
|
~TxDbg();
|
|
|
|
void output(const int level, const char *format, ...);
|
2013-04-17 10:30:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
2015-10-14 00:20:03 +00:00
|
|
|
#define DBG_INFO(...) TxDbg::getInstance()->output(__VA_ARGS__)
|
|
|
|
#define INFO(...) DBG_INFO(__VA_ARGS__)
|
2013-04-17 10:30:38 +00:00
|
|
|
#else
|
2015-10-14 00:20:03 +00:00
|
|
|
#define DBG_INFO(...)
|
2013-04-17 10:30:38 +00:00
|
|
|
#ifdef GHQCHK
|
2015-10-14 00:20:03 +00:00
|
|
|
#define INFO(...) TxDbg::getInstance()->output(__VA_ARGS__)
|
2013-04-17 10:30:38 +00:00
|
|
|
#else
|
|
|
|
#if 0 /* XXX enable this to log basic hires texture checks */
|
2015-10-14 00:20:03 +00:00
|
|
|
#define INFO(...) TxDbg::getInstance()->output(__VA_ARGS__)
|
2013-04-17 10:30:38 +00:00
|
|
|
#else
|
2015-10-14 00:20:03 +00:00
|
|
|
#define INFO(...) DBG_INFO(__VA_ARGS__)
|
2013-04-17 10:30:38 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* __TXDBG_H__ */
|