Files
source/Utils/Debug Control.cpp
T
majcostaandGitHub 24425a82b1 More unused stuff removal (#49)
* More unused stuff removal

delete:
- giant 'metaheaders' (JA2 All.h, Laptop All.h, etc), preferring to add #includes directly where needed
- unused ExceptionHandling and DbMan translation units
- unused WizShare.h, Bitmap.h, trle.h, video_private.h headers

* remove mentions from vc proj files too

* remove preprocessor conditionals for unused definitions

find . -iname '*.h' -o -iname '*.cpp' -exec unifdef.exe -m -UPRECOMPILED_HEADERS -UJA2_PRECOMPILED_HEADERS -UWIZ8_PRECOMPILED_HEADERS -UPRECOMPILEDHEADERS {} ';'

then manually fixed a couple files the tool errored out on

* yes, the comments too

as title
2023-01-03 15:51:48 +02:00

92 lines
1.6 KiB
C++

#include "types.h"
#include "Debug Control.h"
#include "stdio.h"
#include "sgp_logger.h"
#ifdef _ANIMSUBSYSTEM_DEBUG
void AnimDbgMessage( CHAR8 *strMessage)
{
FILE *OutFile;
if ((OutFile = fopen("AnimDebug.txt", "a+t")) != NULL)
{
fprintf(OutFile, "%s\n", strMessage);
fclose(OutFile);
}
}
#endif
#ifdef _PHYSICSSUBSYSTEM_DEBUG
void PhysicsDbgMessage( CHAR8 *strMessage)
{
FILE *OutFile;
if ((OutFile = fopen("PhysicsDebug.txt", "a+t")) != NULL)
{
fprintf(OutFile, "%s\n", strMessage);
fclose(OutFile);
}
}
#endif
#ifdef _AISUBSYSTEM_DEBUG
void AiDbgMessage( CHAR8 *strMessage)
{
FILE *OutFile;
if ((OutFile = fopen("AiDebug.txt", "a+t")) != NULL)
{
fprintf(OutFile, "%s\n", strMessage);
fclose(OutFile);
}
}
#endif
static struct LiveLog {
sgp::Logger_ID id;
LiveLog() {
id = sgp::Logger::instance().createLogger();
sgp::Logger::instance().connectFile(id, L"LiveLog.txt", false, sgp::Logger::FLUSH_ON_ENDL);
};
} s_LiveLog;
void LiveMessage( CHAR8 *strMessage)
{
#ifndef USE_VFS
FILE *OutFile;
if ((OutFile = fopen("Log.txt", "a+t")) != NULL)
{
fprintf(OutFile, "%s\n", strMessage);
fclose(OutFile);
}
#else
SGP_LOG(s_LiveLog.id, strMessage);
#endif
}
void MPDebugMsg( CHAR8 *strMessage)
{
#ifndef USE_VFS
FILE *OutFile;
if ((OutFile = fopen("MPDebug.txt", "a+t")) != NULL)
{
fprintf(OutFile, "%s\n", strMessage);
fclose(OutFile);
}
#else
static vfs::Log& mpMsg = *vfs::Log::create(L"MPDebug.txt", true);
mpMsg << strMessage << vfs::Log::endl;
#endif
}