moved warning, debug, checkheap to engine

svn-id: r4965
This commit is contained in:
Paweł Kołodziejski 2002-09-18 10:56:23 +00:00
parent 462d26937c
commit e6352e3a32
2 changed files with 48 additions and 48 deletions

View File

@ -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
}

View File

@ -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) {