Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void traceSprite(const unsigned char* data, const short* palette, short maskColor, int x, int y, int taillex, int tailley)
- {
- int e=0, i=0, j;
- int result = 0;
- int chang;
- short color;
- for(chang=0;chang<tailley;chang++)
- {
- while(result < taillex)
- {
- result+=data[i]; // result contient la somme des x du tableau
- i+=2; //endroit du data
- }
- result=0;
- for(j=e;j<i;j+=2)
- {
- color = palette[data[j+1]]; // on prend la couleur dans le tableau
- CL_Line(x+result, y+chang,x+data[j]+result-1, y+chang, color);
- result+=data[j];
- }
- /* for(j=e;j<i;j+=2)
- {
- CL_Line(x+result, y+chang,x+data[j]+result-1, y+chang, palette[data[j+1]]);
- result+=data[j];
- } */
- e=i;// conserve la place dans data
- result=0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment