diff options
-rw-r--r-- | common/engine.cpp | 48 | ||||
-rw-r--r-- | scumm/scummvm.cpp | 48 |
2 files changed, 48 insertions, 48 deletions
diff --git a/common/engine.cpp b/common/engine.cpp index 7aa9100f81..5352fd025c 100644 --- a/common/engine.cpp +++ b/common/engine.cpp @@ -103,3 +103,51 @@ Engine *Engine::createFromDetector(GameDetector *detector, OSystem *syst) return engine; } + +void CDECL warning(const char *s, ...) +{ + char buf[1024]; + va_list va; + + va_start(va, s); + vsprintf(buf, s, va); + va_end(va); + + fprintf(stderr, "WARNING: %s!\n", buf); +#if defined( USE_WINDBG ) + sprintf(&buf[strlen(buf)], "\n"); + OutputDebugString(buf); +#endif +} + +uint16 _debugLevel = 1; + +void CDECL debug(int level, const char *s, ...) +{ + char buf[1024]; + va_list va; + + if (level > _debugLevel) + return; + + va_start(va, s); + vsprintf(buf, s, va); + va_end(va); + printf("%s\n", buf); + +#if defined( USE_WINDBG ) + sprintf(&buf[strlen(buf)], "\n"); + OutputDebugString(buf); +#endif + + fflush(stdout); +} + +void checkHeap() +{ +#if defined(WIN32) + if (_heapchk() != _HEAPOK) { + error("Heap is invalid!"); + } +#endif +} diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index e67fbbc311..a3d801c47b 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -1265,54 +1265,6 @@ void NORETURN CDECL error(const char *s, ...) g_scumm->_system->quit(); } -void CDECL warning(const char *s, ...) -{ - char buf[1024]; - va_list va; - - va_start(va, s); - vsprintf(buf, s, va); - va_end(va); - - fprintf(stderr, "WARNING: %s!\n", buf); -#if defined( USE_WINDBG ) - sprintf(&buf[strlen(buf)], "\n"); - OutputDebugString(buf); -#endif -} - -uint16 _debugLevel = 1; - -void CDECL debug(int level, const char *s, ...) -{ - char buf[1024]; - va_list va; - - if (level > _debugLevel) - return; - - va_start(va, s); - vsprintf(buf, s, va); - va_end(va); - printf("%s\n", buf); - -#if defined( USE_WINDBG ) - sprintf(&buf[strlen(buf)], "\n"); - OutputDebugString(buf); -#endif - - fflush(stdout); -} - -void checkHeap() -{ -#if defined(WIN32) - if (_heapchk() != _HEAPOK) { - error("Heap is invalid!"); - } -#endif -} - ScummDebugger g_debugger; void Scumm::waitForTimer(int msec_delay) { |