<commit_before>#include "Engine.h"
#include <cstdio>

#include "Common.h"
#include "WorldState.h"
#include "TransformSystem.h"
#include "RenderSystem.h"
#include "SpriteComponent.h"
#include "DepthComponent.h"

// Memory leak debug
#if defined(_MSC_VER) && defined(_WIN32) && defined(_DEBUG)
    #define _CRTDBG_MAP_ALLOC
    #include <stdlib.h>
    #include <crtdbg.h>

    #ifndef DBG_NEW
        #define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ )
        #define new DBG_NEW
    #endif
#endif

class TestState : public WorldState
{
public:
    TestState(Engine* engine)
        : WorldState(engine)
    {
        world.addSystem<TransformSystem>();
        world.addSystem<RenderSystem>();

        Entity::ID test = world.createEntity();
        world.attachComponent<TransformComponent>(test)->setNextPosition(sf::Vector2f(240.f, 180.f), true);
        world.attachComponent<DepthComponent>(test);

        Spritemap* sprite = &world.attachComponent<SpriteComponent>(test)->sprite;
        sprite->setTexture(engine->textureManager.get("text.png"));

        world.registerEntity(test);
    }

    virtual void activate() { LOG(TRACE) << getName() << " active"; }
    virtual void deactivate() { LOG(TRACE) << getName() << " inactive"; }

    virtual const std::string getName() { return "TestState"; }
};

int main(int argv, char* argc[])
{
#if defined(_MSC_VER) && defined(_WIN32) && defined(_DEBUG)
    // Memory leak debug
    _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
    _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG);
#endif

    init_logging(argv, argc);

    try
    {
        // Run the game
        Engine engine("ECSE Example");
        engine.pushState<TestState>();

        engine.run();
    }
    catch (const std::runtime_error& e)
    {
        LOG(FATAL) << e.what();<commit_msg>I forgot.<commit_after>#include "Engine.h"
#include <cstdio>

#include "Common.h"
#include "WorldState.h"
#include "TransformSystem.h"
#include "RenderSystem.h"
#include "SpriteComponent.h"
#include "DepthComponent.h"

// Memory leak debug
#if defined(_MSC_VER) && defined(_WIN32) && defined(_DEBUG)
    #define _CRTDBG_MAP_ALLOC
    #include <stdlib.h>
    #include <crtdbg.h>

    #ifndef DBG_NEW
        #define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ )
        #define new DBG_NEW
    #endif
#endif

class TestState : public WorldState
{
public:
    TestState(Engine* engine)
        : WorldState(engine)
    {
        world.addSystem<TransformSystem>();
        world.addSystem<RenderSystem>();

        Entity::ID test = world.createEntity();
        world.attachComponent<TransformComponent>(test)->setNextPosition(sf::Vector2f(240.f, 180.f), true);
        world.attachComponent<DepthComponent>(test);

        Spritemap* sprite = &world.attachComponent<SpriteComponent>(test)->sprite;
        sprite->setTexture(engine->textureManager.get("text.png"));

        world.registerEntity(test);
    }

    virtual void activate() { LOG(TRACE) << getName() << " active"; }
    virtual void deactivate() { LOG(TRACE) << getName() << " inactive"; }

    virtual const std::string getName() { return "TestState"; }
};

int main(int argv, char* argc[])
{
#if defined(_MSC_VER) && defined(_WIN32) && defined(_DEBUG)
    // Memory leak debug
    _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
    _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG);
#endif

    init_logging(argv, argc);

    // Window size
    sf::Vector2i size(800, 600);

    try
    {
        // Run the game
        Engine engine(size, "ECSE Example");
        engine.pushState<TestState>();

        engine.run();
    }
    catch (const std::runtime_error& e)
    {
        LOG(FATAL) << e.what();
{'fraction_non_alphanumeric': 0.13906040268456377, 'fraction_numerical': 0.007785234899328859, 'mean_word_length': 3.4729891956782715, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 29, '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': '5333568', 'n_tokens_mistral': 1235, 'n_tokens_neox': 1182, 'n_words': 238}