int copier_element_partiel (element_nom nom_el, short x_el, short y_el, short w_el, short h_el, short x, short y, int num_ecran) { int id; rectangle r; id = element[nom_el]; if (element_existe(liste_el,id)) r = obtenir_rectangle_element (liste_el, id); else { fprintf(stderr,"L'element demande (%d) n'existe pas! (id:%d)",nom_el,id); return 1; } ChoisirEcran(num_ecran); if(w_el<=0) w_el=r.w; if(h_el<=0) h_el=r.h; CopierZone(SCR_ELEMENT,num_ecran,r.x+x_el,r.y+y_el,w_el,h_el,x,y); return 0; }
void printScreen(int snake[TAILLE_SNAKE][2], int len_snake, int pommes[20][2], int len_pommes, unsigned long int time, int score){ EffacerEcran(CouleurParNom("black")); printTerrain(snake, len_snake, pommes, len_pommes); ChoisirCouleurDessin(CouleurParNom("white")); printScore(score); printTime(time); CopierZone(1,0,0,0,60*TAILLE_CASE+2*BORD,40*TAILLE_CASE+BORD+40,0,0); }
void buff_save_zone (int x, int y, int w, int h, int x_buff, int y_buff) { // Restaure un morceau du save (rect: x y w h) dans buffer (position x_buff y_buff) CopierZone(SCR_SAVE,SCR_BUFF,x,y,w,h,x_buff,y_buff); }
void save_buff_zone (int x, int y, int w, int h, int x_save, int y_save) { // Sauvegarde un morceau du buffer (rect: x y w h) dans save (position x_save y_save) CopierZone(SCR_BUFF,SCR_SAVE,x,y,w,h,x_save,y_save); }