Files
Cyd 2b8ca921cb Initial full mirror of c:\VWE (source + assets + toolchain + outputs) via Git LFS
Complete disaster-recovery snapshot: engine/game source, game data assets,
VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive.
Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false,
no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
2026-06-24 21:28:16 -05:00

109 lines
2.6 KiB
C

#ifdef _DEBUG
#define AssertDebugBreak() _asm { int 3 }
inline BOOL AssertDialog(const char* pcszExpr, const char* pcszfile, int nLine)
{
char szBuf[MAX_PATH * 2];
sprintf(szBuf, "\"%s\" 파일의 %d줄에서 ASSERT!!!\n\n디버깅을 하시겠습니까?", pcszfile, nLine);
#ifdef WIN32
return ::MessageBox(NULL, szBuf, pcszExpr, MB_YESNO) == IDYES;
#else // !WIN32
return FALSE;
#endif // WIN32
}
inline BOOL __cdecl AssertReturnFALSE()
{
return FALSE;
}
#ifndef ASSERT
#define ASSERT(x) { if (!(x)) AssertDialog(#x, THIS_FILE, __LINE__); }
#endif
#define ASSERT_FALSE() ASSERT(AssertReturnFALSE())
#ifndef VERIFY
#define VERIFY(x) { if (!(x)) AssertDialog(#x, THIS_FILE, __LINE__); }
#endif
#ifndef TRACE
inline int __DbgTrace(const char* pcszFormat, ...)
{
va_list ap;
va_start(ap, pcszFormat);
char caBuffer[1024];
vsprintf(caBuffer, pcszFormat, ap);
va_end(ap);
::OutputDebugString(caBuffer);
return 0;
}
#define TRACE __DbgTrace
#endif
#ifndef THIS_FILE
#define THIS_FILE __FILE__
#endif // !THIS_FILE
#ifndef BASED_CODE
#define BASED_CODE
#endif // !BASED_CODE
#ifdef malloc
#undef malloc
#undef calloc
#undef realloc
#undef _expand
#undef free
#undef _msize
#endif
#define malloc(s) _malloc_dbg(s, _NORMAL_BLOCK, THIS_FILE, __LINE__)
#define calloc(c, s) _calloc_dbg(c, s, _NORMAL_BLOCK, THIS_FILE, __LINE__)
#define realloc(p, s) _realloc_dbg(p, s, _NORMAL_BLOCK, THIS_FILE, __LINE__)
#define _expand(p, s) _expand_dbg(p, s, _NORMAL_BLOCK, THIS_FILE, __LINE__)
#define free(p) _free_dbg(p, _NORMAL_BLOCK)
#define _msize(p) _msize_dbg(p, _NORMAL_BLOCK)
//----------------------------------------------------------------------------------------------------------
inline void* __cdecl operator new(size_t nSize, LPCSTR lpszFileName, int nLine)
{
void* p = _malloc_dbg(nSize, _NORMAL_BLOCK, lpszFileName, nLine);
return p;
}
inline void __cdecl operator delete(void* p, LPCSTR lpszFileName, int nLine)
{
_free_dbg(p, _NORMAL_BLOCK);
}
//----------------------------------------------------------------------------------------------------------
#ifndef _AFX
#define DEBUG_NEW new //(THIS_FILE, __LINE__)
#define DEBUG_DELETE delete //(THIS_FILE, __LINE__)
#endif
#else // !_DEBUG
#define ASSERTDLG_PUSH(hWnd)
#define ASSERTDLG_POP()
#ifndef ASSERT
#define ASSERT(x)
#endif
#define ASSERT_FALSE()
#ifndef VERIFY
#define VERIFY(x) x
#endif
#ifndef TRACE
inline int __DbgTraceIgnore(const char* pcszFormat, ...) { &pcszFormat; return 0; }
#define TRACE 1 ? 0: __DbgTraceIgnore
#endif
#endif // _DEBUG