<commit_before>#include "Splash.h"
#include "README.h"

#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <math.h>
#include <string>

int splashscreen(std::shared_ptr<std::vector<sf::Texture>> textures, sf::Font font)
{
    sf::Texture readMeTex;
    sf::Vector2i readMePos(30, SPLASH_WIDTH - 30);
    bool readmeSelected = false;
    if(! readMeTex.loadFromFile("data/README.png"))
        std::cerr << "Failed to load Textuer from data/README.png" << std::endl;

    int selectedBubble = -1;
    char *TEXT_OUT[6] = {"2", "3", "4", "Cancel", "Choose Player Number", "BUBBLES"};
    std::shared_ptr<sf::RenderWindow> win = std::make_shared<sf::RenderWindow>(sf::VideoMode(SPLASH_WIDTH, SPLASH_HEIGHT), TEXT_OUT[5]);
    int result = -1;

    std::vector<Besucher> besucher = std::vector<Besucher>();
    std::vector<float> fandom = std::vector<float>();

    std::vector<sf::CircleShape> bubbles = std::vector<sf::CircleShape>(4);
    std::vector<sf::Text> text = std::vector<sf::Text>(6);
    //std::cerr << "Init 1. Part" << std::endl;
    sf::Vector2f position;
    for(int i = 0; i < 4; i++)
    {
        bool correct = false;
        while(!correct)
        {
            position.x = 15.f + rand() % (SPLASH_WIDTH - 30 - BUBBLE_SIZE*2);
            position.y = 100.f + rand() % (SPLASH_HEIGHT - 215 - BUBBLE_SIZE * 2);
            correct = true;
            for(int j = i - 1; j >= 0; j --)
            {
                if(vecLen(position - bubbles[j].getPosition()) < BUBBLE_SIZE * 2)
                {
                    correct = false;
                    break;
                }
            }
        }

        bubbles[i] = sf::CircleShape(BUBBLE_SIZE);
        bubbles[i].setPosition( position);
        bubbles[i].setFillColor(BUBBLE_COLOR[i]);

        text[i].setFont(font);
        text[i].setCharacterSize(i != 3 ? 50 : 30);
        text[i].setFillColor(sf::Color::Black);
        text[i].setString(TEXT_OUT[i]);
        text[i].setPosition(bubbles[i].getPosition().x + BUBBLE_SIZE - text[i].getGlobalBounds().width / 2,
                            bubbles[i].getPosition().y + BUBBLE_SIZE - text[i].getGlobalBounds().height);
    }
    for (int i = 0; i < NUM_BUBBLES; ++i) {
        bool correct = false;
        while(!correct)
        {
            correct = true;
            position.x = 20 + rand() % (SPLASH_WIDTH - 40);
            position.y = 20 + rand() % (SPLASH_HEIGHT - 40);
            for(int j = 0; j < 4; j++)
            {
                if(     vecLen(bubbles[j].getPosition() + sf::Vector2f(BUBBLE_SIZE, BUBBLE_SIZE) - position - sf::Vector2f(20.f, 20.f))
                   <    BUBBLE_SIZE + 30)
                {
                    correct = false;
                    //break;
                }
            }
            for(int j = i - 1; j >= 0; j--)
            {
                if(vecLen(position - besucher[j].position ) < 50 )
                {
                    correct = false;
                    //break;
                }
            }
        }
        besucher.push_back(Besucher(sf::Vector2f(rand() % SPLASH_WIDTH - 25, rand() % SPLASH_HEIGHT - 25), 20,
                               sf::Color(rand() % 256, rand() % 256, rand() % 256), sf::Vector2f(0.f, 0.f), 0, 0, fandom, textures));
        besucher[i].mood = rand() % 5 - 1;
    }
    text[4].setFont(font);
    text[4].setCharacterSize(40);
    text[4].setFillColor(sf::Color::Green);
    text[4].setString(TEXT_OUT[4]);
    text[4].setPosition(20, SPLASH_WIDTH / 2 - text[4].getGlobalBounds().width/2);
    std::cerr << "Finished Build" << std::endl;
    while (win->isOpen()) { //y * U horizontal, X & V Vertikal
        sf::Event event;
        while (win->pollEvent(event)) {
            switch (event.type) {
                case sf::Event::Closed:
                    win->close();
                    break;
                case sf::Event::JoystickButtonPressed:
                    switch(event.joystickButton.button)
                    {
                        case 0: result = 2; break;
                        case 2: result = 3; break;
                        case 1: result = 4; break;
                        case 3: result = -1; break;
                    }
                    if(event.joystickButton.button <= 3)
                        win->close();
                case sf::Event::MouseButtonPressed:
                    if(readmeSelected && event.mouseButton.button == sf::Mouse::Left)
                        showReadMe();<commit_msg>changed title colour<commit_after>#include "Splash.h"
#include "README.h"

#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <math.h>
#include <string>

int splashscreen(std::shared_ptr<std::vector<sf::Texture>> textures, sf::Font font)
{
    sf::Texture readMeTex;
    sf::Vector2i readMePos(30, SPLASH_WIDTH - 30);
    bool readmeSelected = false;
    if(! readMeTex.loadFromFile("data/README.png"))
        std::cerr << "Failed to load Textuer from data/README.png" << std::endl;

    int selectedBubble = -1;
    char *TEXT_OUT[6] = {"2", "3", "4", "Cancel", "Choose Player Number", "BUBBLES"};
    std::shared_ptr<sf::RenderWindow> win = std::make_shared<sf::RenderWindow>(sf::VideoMode(SPLASH_WIDTH, SPLASH_HEIGHT), TEXT_OUT[5]);
    int result = -1;

    std::vector<Besucher> besucher = std::vector<Besucher>();
    std::vector<float> fandom = std::vector<float>();

    std::vector<sf::CircleShape> bubbles = std::vector<sf::CircleShape>(4);
    std::vector<sf::Text> text = std::vector<sf::Text>(6);
    //std::cerr << "Init 1. Part" << std::endl;
    sf::Vector2f position;
    for(int i = 0; i < 4; i++)
    {
        bool correct = false;
        while(!correct)
        {
            position.x = 15.f + rand() % (SPLASH_WIDTH - 30 - BUBBLE_SIZE*2);
            position.y = 100.f + rand() % (SPLASH_HEIGHT - 215 - BUBBLE_SIZE * 2);
            correct = true;
            for(int j = i - 1; j >= 0; j --)
            {
                if(vecLen(position - bubbles[j].getPosition()) < BUBBLE_SIZE * 2)
                {
                    correct = false;
                    break;
                }
            }
        }

        bubbles[i] = sf::CircleShape(BUBBLE_SIZE);
        bubbles[i].setPosition( position);
        bubbles[i].setFillColor(BUBBLE_COLOR[i]);

        text[i].setFont(font);
        text[i].setCharacterSize(i != 3 ? 50 : 30);
        text[i].setFillColor(sf::Color::Black);
        text[i].setString(TEXT_OUT[i]);
        text[i].setPosition(bubbles[i].getPosition().x + BUBBLE_SIZE - text[i].getGlobalBounds().width / 2,
                            bubbles[i].getPosition().y + BUBBLE_SIZE - text[i].getGlobalBounds().height);
    }
    for (int i = 0; i < NUM_BUBBLES; ++i) {
        bool correct = false;
        while(!correct)
        {
            correct = true;
            position.x = 20 + rand() % (SPLASH_WIDTH - 40);
            position.y = 20 + rand() % (SPLASH_HEIGHT - 40);
            for(int j = 0; j < 4; j++)
            {
                if(     vecLen(bubbles[j].getPosition() + sf::Vector2f(BUBBLE_SIZE, BUBBLE_SIZE) - position - sf::Vector2f(20.f, 20.f))
                   <    BUBBLE_SIZE + 30)
                {
                    correct = false;
                    //break;
                }
            }
            for(int j = i - 1; j >= 0; j--)
            {
                if(vecLen(position - besucher[j].position ) < 50 )
                {
                    correct = false;
                    //break;
                }
            }
        }
        besucher.push_back(Besucher(sf::Vector2f(rand() % SPLASH_WIDTH - 25, rand() % SPLASH_HEIGHT - 25), 20,
                               sf::Color(rand() % 256, rand() % 256, rand() % 256), sf::Vector2f(0.f, 0.f), 0, 0, fandom, textures));
        besucher[i].mood = rand() % 5 - 1;
    }
    text[4].setFont(font);
    text[4].setCharacterSize(40);
    text[4].setFillColor(sf::Color(0xFF, 0xFF, 0x30));
    text[4].setOutlineColor(sf::Color::Black);
    text[4].setOutlineThickness(2);
    text[4].setString(TEXT_OUT[4]);
    text[4].setPosition(20, SPLASH_WIDTH / 2 - text[4].getGlobalBounds().width/2);
    std::cerr << "Finished Build" << std::endl;
    while (win->isOpen()) { //y * U horizontal, X & V Vertikal
        sf::Event event;
        while (win->pollEvent(event)) {
            switch (event.type) {
                case sf::Event::Closed:
                    win->close();
                    break;
                case sf::Event::JoystickButtonPressed:
                    switch(event.joystickButton.button)
                    {
                        case 0: result = 2; break;
                        case 2: result = 3; break;
                        case 1: result = 4; break;
                        case 3: result = -1; break;
                    }
                    if(event.joystickButton.button <= 3)
                        win->close();
                case sf::Event::MouseButtonPressed:
                    if(readmeSelected && event.mouseButton.button == sf::Mouse::Left)
                        showReadMe();
{'fraction_non_alphanumeric': 0.15408286624903836, 'fraction_numerical': 0.024398285525881965, 'mean_word_length': 1.7517387360145147, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 0, '>': 47, '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': '4504490', 'n_tokens_mistral': 3136, 'n_tokens_neox': 2877, 'n_words': 551}