Example #1
0
void CLogOutput::Initialize()
{
    if (initialized) return;

    filePath = CreateFilePath(fileName);
    RotateLogFile();

    /*filelog = new std::ofstream(filePath.c_str());
    if (filelog->bad())
    	SafeDelete(filelog);*/
    const bool flush = configHandler->GetBool("LogFlush");
    log_file_addLogFile(filePath.c_str(), NULL, LOG_LEVEL_ALL, flush);

    initialized = true;
    InitializeSections();

    /*std::vector<std::string>::iterator pili;
    for (pili = preInitLog().begin(); pili != preInitLog().end(); ++pili) {
    	ToFile(*pili);
    }
    preInitLog().clear();*/

    LOG("LogOutput initialized.");
    LOG("Spring %s", SpringVersion::GetFull().c_str());
    LOG("Build date/time: %s", SpringVersion::GetBuildTime().c_str());
    LOG("Build environment: %s", SpringVersion::GetBuildEnvironment().c_str());
    LOG("Compiler: %s", SpringVersion::GetCompiler().c_str());
}
Example #2
0
void CLogOutput::Initialize()
{
	if (initialized) return;

	filePath = CreateFilePath(fileName);
	RotateLogFile();

	filelog = new std::ofstream(filePath.c_str());
	if (filelog->bad())
		SafeDelete(filelog);

	initialized = true;
	InitializeSections();

	std::vector<std::string>::iterator pili;
	for (pili = preInitLog().begin(); pili != preInitLog().end(); ++pili) {
		ToFile(*pili);
	}
	preInitLog().clear();

	LOG("LogOutput initialized.");
	LOG("Spring %s", SpringVersion::GetFull().c_str());
	LOG("Build date/time: %s", SpringVersion::GetBuildTime().c_str());
	LOG("Build environment: %s", SpringVersion::GetBuildEnvironment().c_str());
	LOG("Compiler: %s", SpringVersion::GetCompiler().c_str());
}
Example #3
0
static void DEH_Init(void)
{
    //!
    // @category mod
    //
    // Ignore cheats in dehacked files.
    //

    if (M_CheckParm("-nocheats") > 0) 
    {
	deh_apply_cheats = false;
    }

    // Call init functions for all the section definitions.
    InitializeSections();

    deh_initialized = true;
}
Example #4
0
int DEH_LoadFile(char *filename)
{
    deh_context_t *context;

    if (!deh_initialized)
    {
        InitializeSections();
        deh_initialized = true;
    }

    // Before parsing a new file, reset special override flags to false.
    // Magic comments should only apply to the file in which they were
    // defined, and shouldn't carry over to subsequent files as well.
    deh_allow_long_strings = false;
    deh_allow_long_cheats = false;
    deh_allow_extended_strings = false;

    printf(" loading %s\n", filename);

    context = DEH_OpenFile(filename);

    if (context == NULL)
    {
        fprintf(stderr, "DEH_LoadFile: Unable to open %s\n", filename);
        return 0;
    }

    DEH_ParseContext(context);

    DEH_CloseFile(context);

    if (DEH_HadError(context))
    {
        I_Error("Error parsing dehacked file");
    }

    return 1;
}
Example #5
0
int DEH_LoadLump(int lumpnum, boolean allow_long, boolean allow_error)
{
    deh_context_t *context;

    if (!deh_initialized)
    {
        InitializeSections();
        deh_initialized = true;
    }

    // Reset all special flags to defaults.
    deh_allow_long_strings = allow_long;
    deh_allow_long_cheats = allow_long;
    deh_allow_extended_strings = false;

    context = DEH_OpenLump(lumpnum);

    if (context == NULL)
    {
        fprintf(stderr, "DEH_LoadFile: Unable to open lump %i\n", lumpnum);
        return 0;
    }

    DEH_ParseContext(context);

    DEH_CloseFile(context);

    // If there was an error while parsing, abort with an error, but allow
    // errors to just be ignored if allow_error=true.
    if (!allow_error && DEH_HadError(context))
    {
        I_Error("Error parsing dehacked lump");
    }

    return 1;
}