<commit_before>/*********************************************
**	        	 Rakshata v1.1 		        **
**     Licence propritaire, code source    **
**        confidentiel, distribution        **
**          formellement interdite          **
**********************************************/

#include "main.h"

int ecranAccueil()
{
    /*En raison de la taille importante de la page d'acceuil (800kb),
    elle est enregistr une seule fois et on lui colle dessus la trad*/

    SDL_Texture *acceuil = NULL;
	char temp[TAILLE_BUFFER];

    acceuil = IMG_LoadTexture(renderer, "data/acceuil.png");
    SDL_RenderCopy(renderer, acceuil, NULL, NULL);
    SDL_DestroyTextureS(acceuil);

    sprintf(temp, "data/%s/acceuil.png", LANGUAGE_PATH[langue - 1]); //Traduction

    acceuil = IMG_LoadTexture(renderer, temp);
    SDL_RenderCopy(renderer, acceuil, NULL, NULL);
    SDL_DestroyTextureS(acceuil);

    SDL_RenderPresent(renderer); //Refresh screen
    return waitEnter();
}

int showControls()
{
    int retour = 0;
    char temp[TAILLE_BUFFER];
    SDL_Texture *controls = NULL;
//    SDL_Surface *controls = NULL;
    SDL_Event event;

    /***Doit passer par une surface pour redimensionner
        la fentre de la taille de la surface ***/

    crashTemp(temp, TAILLE_BUFFER);
    sprintf(temp, "data/%s/controls.png", LANGUAGE_PATH[langue - 1]);

    controls = IMG_LoadTexture(renderer, temp);

    if(WINDOW_SIZE_H != controls->h)
        updateWindowSize(controls->w, controls->h);
    else
        applyBackground(0, 0, WINDOW_SIZE_W, WINDOW_SIZE_H);

    //controls_texture = SDL_CreateTextureFromSurface(renderer, controls);
    //SDL_FreeSurfaceS(controls);


    SDL_RenderCopy(renderer, controls, NULL, NULL);
    SDL_DestroyTextureS(controls);

    SDL_RenderPresent(renderer);

    while(!retour)
    {
        event.type = -1;
        SDL_WaitEvent(&event);
        switch(event.type)
        {
            case SDL_QUIT:
                retour = PALIER_QUIT;
                break;

            case SDL_KEYDOWN: //If a keyboard letter is pushed
            {<commit_msg>Clean some code after the showControl() improvement<commit_after>/*********************************************
**	        	 Rakshata v1.1 		        **
**     Licence propritaire, code source    **
**        confidentiel, distribution        **
**          formellement interdite          **
**********************************************/

#include "main.h"

int ecranAccueil()
{
    /*En raison de la taille importante de la page d'acceuil (800kb),
    elle est enregistr une seule fois et on lui colle dessus la trad*/

    SDL_Texture *acceuil = NULL;
	char temp[TAILLE_BUFFER];

    acceuil = IMG_LoadTexture(renderer, "data/acceuil.png");
    SDL_RenderCopy(renderer, acceuil, NULL, NULL);
    SDL_DestroyTextureS(acceuil);

    sprintf(temp, "data/%s/acceuil.png", LANGUAGE_PATH[langue - 1]); //Traduction

    acceuil = IMG_LoadTexture(renderer, temp);
    SDL_RenderCopy(renderer, acceuil, NULL, NULL);
    SDL_DestroyTextureS(acceuil);

    SDL_RenderPresent(renderer); //Refresh screen
    return waitEnter();
}

int showControls()
{
    int retour = 0;
    char temp[TAILLE_BUFFER];
    SDL_Texture *controls = NULL;
    SDL_Event event;

    /***Doit passer par une surface pour redimensionner
        la fentre de la taille de la surface ***/

    crashTemp(temp, TAILLE_BUFFER);
    sprintf(temp, "data/%s/controls.png", LANGUAGE_PATH[langue - 1]);

    controls = IMG_LoadTexture(renderer, temp);

    if(WINDOW_SIZE_H != controls->h)
        updateWindowSize(controls->w, controls->h);
    else
        applyBackground(0, 0, WINDOW_SIZE_W, WINDOW_SIZE_H);

    SDL_RenderCopy(renderer, controls, NULL, NULL);
    SDL_DestroyTextureS(controls);

    SDL_RenderPresent(renderer);

    while(!retour)
    {
        event.type = -1;
        SDL_WaitEvent(&event);
        switch(event.type)
        {
            case SDL_QUIT:
                retour = PALIER_QUIT;
                break;

            case SDL_KEYDOWN: //If a keyboard letter is pushed
            {
{'fraction_non_alphanumeric': 0.1482665355298746, 'fraction_numerical': 0.005409392672731743, 'mean_word_length': 2.9040307101727447, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3117018', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1291, 'n_words': 291}