<commit_before>//
// Name:	 app.cpp
// Purpose:  The application class for our wxWindows application.
//
// Copyright (c) 2001-2003 Virtual Terrain Project
// Free for all uses, see license.txt for details.
//

#ifdef __GNUG__
#pragma implementation
#pragma interface
#endif

// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#include "wx/image.h"

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

#include "vtlib/vtlib.h"
#include "vtlib/core/Terrain.h"
#include "vtlib/core/TerrainScene.h"
#include "../Options.h"
#include "EnviroGUI.h"		// for g_App, GetTerrainScene
#include "vtui/Helper.h"	// for LogWindowsVersion
#include "vtdata/vtLog.h"

#include "app.h"
#include "frame.h"
#include "StartupDlg.h"
#include "TParamsDlg.h"

IMPLEMENT_APP(vtApp)


vtApp::vtApp()
{
	m_bShowStartupDialog = true;
}

void vtApp::Args(int argc, wxChar **argv)
{
	for (int i = 0; i < argc; i++)
	{
		wxString2 str = argv[i];
		const char *cstr = str.mb_str();
		g_App.StartupArgument(i, cstr);
		if (!strcmp(cstr, "-no_startup_dialog"))
			m_bShowStartupDialog = false;
		else if (!strcmp(cstr, "-fullscreen"))
			g_Options.m_bFullscreen = true;
		else if(!strncmp(cstr, "-terrain=", 9))
		{
			m_bShowStartupDialog = false;
			g_Options.m_strInitTerrain = cstr+9;
		}
	}
}

//
// Initialize the app object
//
bool vtApp::OnInit()
{
#if WIN32 && defined(_MSC_VER) && DEBUG
	// sometimes, MSVC seems to need to be told to show unfreed memory on exit
	_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif

	g_Options.Read(STRING_APPNAME ".ini");

	g_App.Startup();	// starts log

	VTLOG("Application framework: wxWindows v" wxVERSION_NUM_DOT_STRING "\n");
#if WIN32
	VTLOG(" Running on: ");
	LogWindowsVersion();
#endif<commit_msg>moved cmdline args to enviro base<commit_after>//
// Name:	 app.cpp
// Purpose:  The application class for our wxWindows application.
//
// Copyright (c) 2001-2003 Virtual Terrain Project
// Free for all uses, see license.txt for details.
//

#ifdef __GNUG__
#pragma implementation
#pragma interface
#endif

// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#include "wx/image.h"

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

#include "vtlib/vtlib.h"
#include "vtlib/core/Terrain.h"
#include "vtlib/core/TerrainScene.h"
#include "../Options.h"
#include "EnviroGUI.h"		// for g_App, GetTerrainScene
#include "vtui/Helper.h"	// for LogWindowsVersion
#include "vtdata/vtLog.h"

#include "app.h"
#include "frame.h"
#include "StartupDlg.h"
#include "TParamsDlg.h"

IMPLEMENT_APP(vtApp)


vtApp::vtApp()
{
	m_bShowStartupDialog = true;
}

void vtApp::Args(int argc, wxChar **argv)
{
	for (int i = 0; i < argc; i++)
	{
		wxString2 str = argv[i];
		const char *cstr = str.mb_str();
		if (!strcmp(cstr, "-no_startup_dialog"))
			m_bShowStartupDialog = false;
		else if (!strncmp(str, "-terrain=", 9))
			m_bShowStartupDialog = false;

		// also let the core application check the command line
		g_App.StartupArgument(i, cstr);
	}
}

//
// Initialize the app object
//
bool vtApp::OnInit()
{
#if WIN32 && defined(_MSC_VER) && DEBUG
	// sometimes, MSVC seems to need to be told to show unfreed memory on exit
	_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif

	g_Options.Read(STRING_APPNAME ".ini");

	g_App.Startup();	// starts log

	VTLOG("Application framework: wxWindows v" wxVERSION_NUM_DOT_STRING "\n");
#if WIN32
	VTLOG(" Running on: ");
	LogWindowsVersion();
#endif
{'fraction_non_alphanumeric': 0.1441286247487798, 'fraction_numerical': 0.008900373241458513, 'mean_word_length': 4.335375191424196, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1182067', 'n_tokens_mistral': 1386, 'n_tokens_neox': 1323, 'n_words': 334}