project64/Source/Project64-video/TextureEnhancer/TxDbg.h

46 lines
1003 B
C
Raw Normal View History

2021-03-02 02:13:17 +00:00
// Project64 - A Nintendo 64 emulator
// https://www.pj64-emu.com/
2021-03-02 02:13:17 +00:00
// 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
#define DBG_INFO(...) TxDbg::getInstance()->output(__VA_ARGS__)
#define INFO(...) DBG_INFO(__VA_ARGS__)
2013-04-17 10:30:38 +00:00
#else
#define DBG_INFO(...)
2013-04-17 10:30:38 +00:00
#ifdef GHQCHK
#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 */
#define INFO(...) TxDbg::getInstance()->output(__VA_ARGS__)
2013-04-17 10:30:38 +00:00
#else
#define INFO(...) DBG_INFO(__VA_ARGS__)
2013-04-17 10:30:38 +00:00
#endif
#endif
#endif
#endif /* __TXDBG_H__ */