void scrolling(t_bunny_pixelarray *pix, int *i) { static t_scrolling **scroll = NULL; static unsigned int *pixel[NB_SCROLLS]; int x; int k; int p; *i = (*i - 1 + WIDTH) % WIDTH; full_color(pix, BLACK); if (scroll == NULL) { if ((scroll = bunny_malloc(sizeof(t_scrolling*) * (NB_SCROLLS + 1))) == NULL) return ; k = -1; while (++k < NB_SCROLLS && (scroll[k] = init_scroll(k))) pixel[k] = (unsigned int *)scroll[k]->pix->pixels; } k = -1; while (++k < NB_SCROLLS && (p = -1)) while (++p <= WIDTH / scroll[k]->pix->clipable.clip_width && (x = -1)) while (++x < scroll[k]->pix->clipable.clip_width * (scroll[k]->pix->clipable.clip_height - 1)) t_tekpixel(pix, scroll[k]->pos + x / scroll[k]->pix->clipable.clip_width, ((*i * scroll[k]->vit) + x % scroll[k]->pix->clipable.clip_width + p * scroll[k]->pix->clipable.clip_width) % WIDTH, pixel[k][x]); }
int main( void ){ // Initialization int i,j; bst_t* tree = NULL; SystemInit(); init_scroll(); GLCD_Clear( Blue ); tree = malloc(sizeof(bst_t)); bst_init(tree); // Insertion for (i=0; i<100; i++) bst_insert(tree, value_array[i]); printf("0 | %d, %d\n",bst_min(tree), bst_max(tree)); // Deletion for (i=0; i<5; i++){ for (j=0; j<20; j++) bst_erase(tree, erase_array[i][j]); printf("%d | %d, %d\n", i+1, bst_min(tree), bst_max(tree)); } // Destruction bst_destroy(tree); while ( 1 ) { /* An emebedded system does not terminate... */ } }
void print_scroll(char *s) { //teks_layar4(x, y, " "); //teks_layar4(x, y, s); y = y+10; if (y > 238) init_scroll(); }
void print_scroll(char *s) { y = y+10; if (y > 238) init_scroll(); }