<commit_before>///////////////////////////////////////////////////////////////////////////////
// This source file is part of Zeroth.
//
// Copyright (c) 2014 <NAME>
//
///////////////////////////////////////////////////////////////////////////////
#include <Hect/Core/Configuration.h>
#include <Hect/Graphics/Renderer.h>
#include <Hect/Graphics/Window.h>
#include <Hect/IO/JsonValue.h>
#include <Hect/IO/FileSystem.h>

#include "RegisterComponents.h"
#include "AssetRefreshLoop.h"
#include "ServerLoop.h"

using namespace hect;

#ifdef HECT_WINDOWS
#ifdef HECT_DEBUG
#include <vld.h>
#endif
#endif

int main(int argc, const char* argv[])
{
    argc;
    argv;

    try
    {
        registerComponents();

        // Create file system
        FileSystem fileSystem;

        // Add the working directory as a data source
        Path workingDirectory = fileSystem.workingDirectory();
        fileSystem.addDataSource(workingDirectory);

        // Set the working directory as the write directory
        fileSystem.setWriteDirectory(workingDirectory);

        // Load the settings
        JsonValue settings;
        {
            FileReadStream stream = fileSystem.openFileForRead("zeroth/Settings.json");
            settings.decodeFromJson(stream);
        }

        // Add the data sources listed in the settings
        for (const JsonValue& dataSource : settings["dataSources"])
        {
            fileSystem.addDataSource(dataSource.asString());
        }

        // Load video mode
        VideoMode videoMode;
        videoMode.decodeFromJsonValue(settings["videoMode"]);

        // Create window/renderer
        Window window("Sample", videoMode);
        Renderer renderer(window);

        // Load the input axes from the settings
        InputAxis::Array axes;
        for (const JsonValue& axisValue : settings["inputAxes"])
        {
            InputAxis axis;
            axis.decodeFromJsonValue(axisValue);
            axes.push_back(axis);
        }

        // Create the input system
        InputSystem inputSystem(axes);

        AssetCache assetCache(fileSystem);

        AssetRefreshLoop assetRefreshLoop(assetCache);
        ServerLoop loop(assetCache, inputSystem, window, renderer);

        // Update until the flow is complete
        while (window.pollEvents(inputSystem))
        {
            assetRefreshLoop.tick();
            if (!loop.tick())
            {
                break;
            }
        }
    }
    catch (Error& error)
    {
        Window::showFatalError(error.what());
    }

    return 0;
}<commit_msg>Add support for shader refreshing; improved logging<commit_after>///////////////////////////////////////////////////////////////////////////////
// This source file is part of Zeroth.
//
// Copyright (c) 2014 <NAME>
//
///////////////////////////////////////////////////////////////////////////////
#include <Hect/Core/Configuration.h>
#include <Hect/Graphics/Renderer.h>
#include <Hect/Graphics/Window.h>
#include <Hect/IO/JsonValue.h>
#include <Hect/IO/FileSystem.h>

#include "RegisterComponents.h"
#include "AssetRefreshLoop.h"
#include "ServerLoop.h"

using namespace hect;

#ifdef HECT_WINDOWS
#ifdef HECT_DEBUG_BUILD
#include <vld.h>
#endif
#endif

int main(int argc, const char* argv[])
{
    argc;
    argv;

    try
    {
        registerComponents();

        // Create file system
        FileSystem fileSystem;

        // Add the working directory as a data source
        Path workingDirectory = fileSystem.workingDirectory();
        fileSystem.addDataSource(workingDirectory);

        // Set the working directory as the write directory
        fileSystem.setWriteDirectory(workingDirectory);

        // Load the settings
        JsonValue settings;
        {
            FileReadStream stream = fileSystem.openFileForRead("zeroth/Settings.json");
            settings.decodeFromJson(stream);
        }

        // Add the data sources listed in the settings
        for (const JsonValue& dataSource : settings["dataSources"])
        {
            fileSystem.addDataSource(dataSource.asString());
        }

        // Load video mode
        VideoMode videoMode;
        videoMode.decodeFromJsonValue(settings["videoMode"]);

        // Create window/renderer
        Window window("Sample", videoMode);
        Renderer renderer(window);

        // Load the input axes from the settings
        InputAxis::Array axes;
        for (const JsonValue& axisValue : settings["inputAxes"])
        {
            InputAxis axis;
            axis.decodeFromJsonValue(axisValue);
            axes.push_back(axis);
        }

        // Create the input system
        InputSystem inputSystem(axes);

        AssetCache assetCache(fileSystem);

        AssetRefreshLoop assetRefreshLoop(assetCache);
        ServerLoop loop(assetCache, inputSystem, window, renderer);

        // Update until the flow is complete
        while (window.pollEvents(inputSystem))
        {
            assetRefreshLoop.tick();
            if (!loop.tick())
            {
                break;
            }
        }
    }
    catch (Error& error)
    {
        HECT_ERROR(error.what());
        Window::showFatalError(error.what());
    }

    return 0;
}
{'fraction_non_alphanumeric': 0.15338950593642284, 'fraction_numerical': 0.0019149751053236309, 'mean_word_length': 1.8587848932676518, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '6387299', 'n_tokens_mistral': 1357, 'n_tokens_neox': 1297, 'n_words': 331}