-florian66-

test

Feb 3rd, 2015
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.76 KB | None | 0 0
  1. void traceSprite(const unsigned char* data, const short* palette, short maskColor, int x, int y, int taillex, int tailley)
  2. {
  3. int e=0, i=0, j;
  4.  
  5. int result = 0;
  6. int chang;
  7. short color;
  8.  
  9. for(chang=0;chang<tailley;chang++)
  10.     {
  11.     while(result < taillex)
  12.             {
  13.             result+=data[i]; // result contient la somme des x du tableau
  14.             i+=2;   //endroit du data
  15.             }
  16.            
  17.         result=0;
  18.        
  19.         for(j=e;j<i;j+=2)
  20.         {
  21.         color = palette[data[j+1]]; // on prend la couleur dans le tableau
  22.          
  23.             CL_Line(x+result, y+chang,x+data[j]+result-1, y+chang, color);
  24.         result+=data[j];
  25.         }
  26.     /* for(j=e;j<i;j+=2)
  27.         {
  28.         CL_Line(x+result, y+chang,x+data[j]+result-1, y+chang, palette[data[j+1]]);
  29.         result+=data[j];
  30.         } */
  31.     e=i;// conserve la place dans data
  32.     result=0;
  33.     }  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment