<commit_before>#include "CLoadState.h"

#include "CMainState.h"
#include "CMainMenuState.h"
#include "CGwenEventForwarder.h"

#include "SciDataManager.h"
#include "CTerrainSceneObject.h"
#include "CVolumeSceneObject.h"


void CLoadStateEventHandler::OnFinish(Gwen::Controls::Base * Control)
{
	CLoadState::get().OnFinish();
}


void CLoadState::addLabel(std::wstring const & Label, Gwen::Color const & Color)
{
	Gwen::Controls::Label * MediumLabel = new Gwen::Controls::Label(Canvas);
	MediumLabel->SetFont(GUIManager->getMediumFont());
	MediumLabel->SetText(Label);
	MediumLabel->SetBounds(20 + Indent, LabelHeight, 1024, 300);
	MediumLabel->SetTextColor(Color);

	GUIManager->draw(true);
	CApplication::get().swapBuffers();

	LabelHeight += 40;
}

CLoadState::CLoadState()
	: LabelHeight(0), Indent(0), GetConfirmation(false)
{
	load();

	LabelHeight = 70;
	Indent = 0;
}

void CLoadState::begin()
{
	// Load References
	CApplication & Application = CApplication::get();
	CMainState & MainState = CMainState::get();
	CMainMenuState & MenuState = CMainMenuState::get();

	GUIManager = Context->GUIContext;
	Canvas = GUIManager->getCanvas();
	
	// Init Canvas
	Canvas->SetBackgroundColor(Gwen::Color(32, 48, 48));
	Canvas->SetDrawBackground(true);

	// Top Label
	Gwen::Controls::Label * BigLabel = new Gwen::Controls::Label(Canvas);
	BigLabel->SetFont(GUIManager->getLargeFont());
	BigLabel->SetText(L"Loading...");
	BigLabel->SetBounds(10, 10, 1590, 300);
	BigLabel->SetTextColor(Gwen::Color(255, 255, 255, 84));

	GUIManager->draw(true);
	CApplication::get().swapBuffers();
	
	addLabel(L"Initializing System...");
	MainState.load();
	MenuState.load();
	CGwenEventForwarder * Forwarder = new CGwenEventForwarder(GUIManager->getCanvas());
	
	addLabel(L"Loading Scene Shaders...");
	Application.getSceneManager().init(true, true);
	loadShaders();
	
	addLabel(L"Loading Scene Objects...");
	loadScene();
	
	Context->DataManager = new SciDataManager();
	addLabel(L"Menu is Starting...");

	if (GetConfirmation)
	{<commit_msg>+ Removed unneeded load commands<commit_after>#include "CLoadState.h"

#include "CMainState.h"
#include "CMainMenuState.h"
#include "CGwenEventForwarder.h"

#include "SciDataManager.h"
#include "CTerrainSceneObject.h"
#include "CVolumeSceneObject.h"


void CLoadStateEventHandler::OnFinish(Gwen::Controls::Base * Control)
{
	CLoadState::get().OnFinish();
}


void CLoadState::addLabel(std::wstring const & Label, Gwen::Color const & Color)
{
	Gwen::Controls::Label * MediumLabel = new Gwen::Controls::Label(Canvas);
	MediumLabel->SetFont(GUIManager->getMediumFont());
	MediumLabel->SetText(Label);
	MediumLabel->SetBounds(20 + Indent, LabelHeight, 1024, 300);
	MediumLabel->SetTextColor(Color);

	GUIManager->draw(true);
	CApplication::get().swapBuffers();

	LabelHeight += 40;
}

CLoadState::CLoadState()
	: LabelHeight(0), Indent(0), GetConfirmation(false)
{
	LabelHeight = 70;
	Indent = 0;
}

void CLoadState::begin()
{
	// Load References
	CApplication & Application = CApplication::get();
	CMainState & MainState = CMainState::get();
	CMainMenuState & MenuState = CMainMenuState::get();

	GUIManager = Context->GUIContext;
	Canvas = GUIManager->getCanvas();
	
	// Init Canvas
	Canvas->SetBackgroundColor(Gwen::Color(32, 48, 48));
	Canvas->SetDrawBackground(true);

	// Top Label
	Gwen::Controls::Label * BigLabel = new Gwen::Controls::Label(Canvas);
	BigLabel->SetFont(GUIManager->getLargeFont());
	BigLabel->SetText(L"Loading...");
	BigLabel->SetBounds(10, 10, 1590, 300);
	BigLabel->SetTextColor(Gwen::Color(255, 255, 255, 84));

	GUIManager->draw(true);
	CApplication::get().swapBuffers();
	
	addLabel(L"Initializing System...");
	CGwenEventForwarder * Forwarder = new CGwenEventForwarder(GUIManager->getCanvas());
	
	addLabel(L"Loading Scene Shaders...");
	Application.getSceneManager().init(true, true);
	loadShaders();
	
	addLabel(L"Loading Scene Objects...");
	loadScene();
	
	Context->DataManager = new SciDataManager();
	addLabel(L"Menu is Starting...");

	if (GetConfirmation)
	{
{'fraction_non_alphanumeric': 0.1652974856858352, 'fraction_numerical': 0.02190689569330346, 'mean_word_length': 6.4684014869888475, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 39, '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': '345062', 'n_tokens_mistral': 1473, 'n_tokens_neox': 1362, 'n_words': 235}