<commit_before>/**
 * Atena Game Engine
 * Game.cpp
 *
 * Copyright 2014-present [<NAME> <@rcsole, <EMAIL>>]
 */

#include <cstdio>
#include "./Game.h"
#include "../Examples/Sprite.h"

Game::Game() :
    m_pWindow(0),
    m_pRenderer(0),
    m_Running(false) {}

bool Game::init(const char* title, int xpos, int ypos, int width,
                                    int height, int flags) {
    if (SDL_Init(SDL_INIT_EVERYTHING) == 0) {
        printf("SDL_Init success\n");

        m_pWindow = SDL_CreateWindow(title,
                xpos, ypos,
                width, height,
                flags);

        if (m_pWindow != 0) {
            printf("SDL_CreateWindow success\n");

            m_pRenderer = SDL_CreateRenderer(m_pWindow, -1, 0);

            if (m_pRenderer != 0) {
                printf("SDL_CreateRenderer success\n");
                SDL_SetRenderDrawColor(m_pRenderer, 255, 255, 255, 255);

                m_objectFactory = new GameObjectFactory();

                if (m_objectFactory != NULL) {
                    printf("Object Factory correctly created\n");
					return true;
                } else {
                    printf("GameObjectFactory error\n");
                }
            } else {
                printf("SDL_CreateRenderer error\n");
            }
        } else {
            printf("SDL_CreateWindow error\n");
        }
    } else {
        printf("SDL_Init error\n");
    }

    printf("Init succes\n");
    m_Running = true;

    m_objectFactory->registerType("Sprite", new SpriteCreator());
    GameObject *example = m_objectFactory->create("Sprite");
    example->load(new LoaderParams("Sprites1", "bahamut", 100, 100));
    m_gameObjects.push_back(example);
}<commit_msg>Fixed Game.cpp,<commit_after>/**
 * Atena Game Engine
 * Game.cpp
 *
 * Copyright 2014-present [<NAME> <@rcsole, <EMAIL>>]
 */

#include <cstdio>
#include "./Game.h"
#include "../Examples/Sprite.h"

Game::Game() :
    m_pWindow(0),
    m_pRenderer(0),
    m_Running(false) {}

bool Game::init(const char* title, int xpos, int ypos, int width,
                                    int height, int flags) {
    if (SDL_Init(SDL_INIT_EVERYTHING) == 0) {
        printf("SDL_Init success\n");

        m_pWindow = SDL_CreateWindow(title,
                xpos, ypos,
                width, height,
                flags);

        if (m_pWindow != 0) {
            printf("SDL_CreateWindow success\n");

            m_pRenderer = SDL_CreateRenderer(m_pWindow, -1, 0);

            if (m_pRenderer != 0) {
                printf("SDL_CreateRenderer success\n");
                SDL_SetRenderDrawColor(m_pRenderer, 255, 255, 255, 255);

                m_objectFactory = new GameObjectFactory();

                if (m_objectFactory != NULL) {
                    printf("Object Factory correctly created\n");
                } else {
                    printf("GameObjectFactory error\n");
					return false;
                }
            } else {
                printf("SDL_CreateRenderer error\n");
				return false;
            }
        } else {
            printf("SDL_CreateWindow error\n");
			return false;
        }
    } else {
        printf("SDL_Init error\n");
		return false;
    }

    printf("Init succes\n");
    m_Running = true;

    m_objectFactory->registerType("Sprite", new SpriteCreator());
    GameObject *example = m_objectFactory->create("Sprite");
    example->load(new LoaderParams("Sprites1", "bahamut", 100, 100));
    m_gameObjects.push_back(example);

	return true;
}
{'fraction_non_alphanumeric': 0.12837262141437092, 'fraction_numerical': 0.017040613462084634, 'mean_word_length': 1.935, 'pattern_counts': {'":': 0, '<': 11, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2834635', 'n_tokens_mistral': 1170, 'n_tokens_neox': 1035, 'n_words': 219}