#include <stdio.h>
#include <stdlib.h>

#include "SDL.h"
//#include "SDL_image.h"

// structure piece
typedef struct Piece Piece;
struct Piece
{
       long partied;
       long partieg;
       long partieh;
       long partieb;

       int imagep;


};

//chargement depuis le fichier texte
void chargementpiece(Piece* piece)
{
   FILE* fichier = NULL;
   long nbpiece = 256;
   long cpt;

   fichier = fopen("piece sans ext.txt", "r");

   if (fichier != NULL)
   {
      for(cpt=0 ; cpt < nbpiece ; cpt++)
      {

         fscanf(fichier, "%ld\t%ld\t%ld\t%ld", &piece[cpt].partieh, &piece[cpt].partied, &piece[cpt].partieb, &piece[cpt].partieg);
         printf("%ld %ld %ld %ld\n", piece[cpt].partieh, piece[cpt].partied, piece[cpt].partieb, piece[cpt].partieg);

      }

      fclose(fichier);
    }

    for(cpt=0 ; cpt < nbpiece ; cpt++)
    {
    //    piece[cpt].imagep = IMG_Load("Piece/$cpt.jpg");
    }
}





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


    Piece* piece[256];

    chargementpiece(piece);    return 0;
}
