t_bunny_response mainloop(void *_data) { t_data *data; data = (t_data *)_data; display_pos(data); dtraverse(data->tool, display_button, data); start(data); set_color_tool(data); set_bg(data->sup->pixarray, WHITE); dtraverse(data->sup->calc, add_calc, data); display_it(data, data->pixback, 78, 2); display_it(data, data->sup->pixarray, data->sup->pos.x, data->sup->pos.y); display_it(data, data->swatch.pix, WIN_WIDTH - 260, 5); display_it(data, data->swatch.pix2, WIN_WIDTH - 260, 112); display_it(data, data->pixinfo, 0, WIN_HEIGHT - 20); set_bg(data->pixinfocolor, data->tools.color.full); display_it(data, data->pixinfocolor, 7, WIN_HEIGHT - 87); display_it(data, data->square.pix_square, data->square.init_pos.x, data->square.init_pos.y); display_text(data, data->crs.tool, 10, WIN_HEIGHT - 18); display_pos(data); bunny_display(data->window); dtraverse(data->sup->calc, check_button_calc, data); draw(data); return (GO_ON); }
static t_bunny_response loop(void *data) { t_bunny_position pos; t_bunny_position mid; (void)data; bunny_fill(&win->buffer, ALPHA(32, BLACK)); pos.x = win->buffer.width / 2; pos.y = win->buffer.height / 2; pic[0]->rotation = rotation; pic[1]->rotation = rotation + cos(8 * rotation * M_PI / 180.0); pic[0]->scale.x = 2 + cos(scale * M_PI / 180.0); pic[0]->scale.y = 2 + cos(scale * M_PI / 180.0); pic[1]->scale.x = 2.2 + sin(scale2 * M_PI / 180.0); pic[1]->scale.y = 2.2 + sin(scale2 * M_PI / 180.0); rotation += 1; scale += 2; scale2 -= 1; mid.x = win->buffer.width / 2; mid.y = win->buffer.height / 2; bunny->rotation = -rotation * 2; bunny->scale.x = 2 - cos(scale * M_PI / 180.0); bunny->scale.y = 2 + sin(scale * M_PI / 180.0); bunny_blit(&win->buffer, pic[0], &pos); bunny_blit(&win->buffer, bunny, &mid); bunny_blit(&win->buffer, pic[1], &pos); bunny_display(win); return (GO_ON); }
t_bunny_response loop(void *data) { t_wolf *wolf; t_bunny_position pos; wolf = (t_wolf*) data; if (keys_manager(wolf) == EXIT_ON_SUCCESS) return (EXIT_ON_SUCCESS); pos.x = 1920 - 1470; pos.y = 1080 - 550; make_bg(wolf->rendu); if (wolf->left_click == 1) background_manager(wolf); music_manager(wolf); walls_manager(wolf); minimap_manager(wolf); angle_minimap(wolf); if (wolf->left_click == 0) add_pix_pos(wolf, wolf->weapon, &pos); else add_pix_pos(wolf, wolf->no_light, &pos); viseur_maker(wolf); wolf->snow_move = 0; bunny_blit(&wolf->win->buffer, &wolf->rendu->clipable, NULL); bunny_display(wolf->win); return (GO_ON); }
t_bunny_response main_loop(t_data *pic) { if (pic->wolf->left == 1) left(pic); if (pic->wolf->up == 1) if (up(pic) == 1) return (0); if (pic->wolf->down == 1) if (down(pic) == 1) return (0); if (pic->wolf->right == 1) right(pic); if (pic->wolf->player.health < 0) { my_putstr("Game Over\n"); return (0); } bunny_set_key_response(get_mykey); set_background(pic->pix, &pic->color[0]); raycasting(pic->wolf, pic->pix); health(pic->wolf, pic->pix); bunny_blit(&pic->win->buffer, &pic->pix->clipable, NULL); bunny_display(pic->win); return (GO_ON); }
t_bunny_response loop(void *data) { (void)data; bunny_clear(&win->buffer, (inc += 10) | BLACK); bunny_display(win); return (GO_ON); }
t_bunny_response main_loop(void *_ray) { t_ray *ray; ray = _ray; bunny_blit(&ray->win->buffer, &ray->pix->clipable, NULL); bunny_display(ray->win); return (GO_ON); }
t_bunny_response main_loop(void *data) { t_loop *loop; loop = data; bunny_blit(&loop->win->buffer, &loop->pix->clipable, NULL); bunny_display(loop->win); return (GO_ON); }
t_bunny_response main_loop(void *_data) { t_data *data; data = _data; bunny_blit(&data->window->buffer, &data->image->clipable,0); bunny_display(data->window); return (GO_ON); }
t_bunny_response main_loop_palette(void *data) { t_tekpaint *tekpaint; t_palette *palette; tekpaint = (t_tekpaint*) data; palette = &tekpaint->tool.palette; bunny_display(palette->win); return (GO_ON); }
t_bunny_response mainloop(void *_data) { t_fox_window *window; window = _data; bunny_blit(&window->win->buffer, &window->screen->clipable, &window->zero_axis); bunny_display(window->win); return (GO_ON); }
t_bunny_response main_loop(void *_fire) { t_fire *fire; fire = _fire; random_col(fire); set_color(fire); bunny_blit(&fire->win->buffer, &fire->pix->clipable, NULL); bunny_display(fire->win); return (GO_ON); }
int main(void) { t_bunny_loading_screen loading_screen; t_bunny_window *win; int i; memset(&loading_screen, 0, sizeof(loading_screen)); for (i = 0; i < 10; ++i) { char *s; asprintf(&s, "./picture%d.png", i); gl_pictures_to_load[i].file = s; gl_pictures_to_load[i].target = (void**)&gl_pictures[i]; asprintf(&s, "./snd%d.wav", i); gl_effects_to_load[i].file = s; gl_effects_to_load[i].target = (void**)&gl_effects[i]; } loading_screen.head.main_structure = &loading_screen; loading_screen.head.subcontext.display = &display; loading_screen.head.subcontext.async_computation_response = &async; assert(loading_screen.head.screen = (t_bunny_buffer*)(win = bunny_start(400, 300, false, "Loading screen"))); assert(bunny_init_loading_context(&loading_screen)); assert(bunny_add_to_ressource_list (loading_screen.pictures, &gl_pictures_to_load[0], NBRCELL(gl_pictures)) ); assert(bunny_add_to_ressource_list (loading_screen.effects, &gl_effects_to_load[0], NBRCELL(gl_effects)) ); bunny_clear(loading_screen.head.screen, BLACK); bunny_display((t_bunny_window*)loading_screen.head.screen); bunny_set_context(&gl_bunny_loading_context); bunny_loop(win, 25, &loading_screen); bunny_clear_all_loaded_ressources(&loading_screen); bunny_stop((t_bunny_window*)loading_screen.head.screen); for (i = 0; i < 10; ++i) { free((char*)gl_pictures_to_load[i].file); free((char*)gl_effects_to_load[i].file); } return (EXIT_SUCCESS); }
t_bunny_response main_loop(void *data) { t_fire *fire; fire = data; my_fire_back(fire->pix); rand_bottom(fire); calc_whole_pix(fire); transfer_color(fire, fire->feu); bunny_blit(&fire->win->buffer, &fire->pix->clipable, NULL); bunny_display(fire->win); return (GO_ON); }
t_bunny_response mainloop(void *data) { t_win *win; t_bunny_position origin; origin.x = 0; origin.y = 0; win = data; move_me(win); draw_wall(win); bunny_blit(&win->win->buffer, &win->array->clipable, &origin); bunny_display(win->win); return (GO_ON); }
int main() { t_bunny_window *window; window = bunny_start(800, 600, 0, "Ma fenĂȘtre"); if (!window) { return (1); } bunny_display(window); sleep(2); bunny_stop(window); return (0); }
int main() { t_bunny_window *window; window = bunny_start_style(800, 600, TITLEBAR | CLOSE_BUTTON, "Ma fenĂȘtre"); if (!window) { return (1); } bunny_display(window); sleep(2); bunny_stop(window); return (0); }
void kala_afterslam_second(t_kala *data) { data->intro.blit.x = (data->win->buffer.width / 2 - data->logo->buffer.width / 2) + ((rand() % (int)(data->intro.slam + 1)) - data->intro.slam / 2) + data->logo->origin.x; data->intro.blit.y = (data->win->buffer.height / 2 - data->logo->buffer.height / 2) + ((rand() % (int)(data->intro.slam + 1)) - data->intro.slam / 2) + data->logo->origin.y; data->logo->rotation = (rand() % (int)((data->intro.slam / 5) + 1) - data->intro.slam / 10); bunny_blit(&data->win->buffer, data->logo, &data->intro.blit); bunny_display(data->win); data->intro.black.argb[3] += 1; }
t_bunny_response main_loop(void *_visu) { t_visu *visu; visu = _visu; if (visu->start_rendu == 1) { if (move_all_ants(visu) == -1) return (EXIT_ON_SUCCESS); } else { bunny_blit(&visu->win->buffer, &visu->screen->clipable, NULL); bunny_display(visu->win); } return (GO_ON); }
t_bunny_response main_loop_explorer(void *data) { t_tekpaint *tekpaint; t_explorer *explorer; t_bunny_position pos; tekpaint = (t_tekpaint*) data; explorer = tekpaint->tool.explorer; pos.x = 0; pos.y = 0; if (explorer) { bunny_blit(&explorer->win->buffer, &explorer->buffer->clipable, &pos); bunny_display(explorer->win); } return (GO_ON); }
int main(int ac, char av) { t_bunny_window *win; t_bunny_position pos; t_bunny_pixelarray *pix; pos.x = 0; pos.y = 0; win = bunny_start(1000, 1000, 0, "yolo"); pix = bunny_new_pixelarray(1000,1000); fdf_base(100, 100, 3, 1, pix); bunny_blit(&win->buffer, &pix->clipable, &pos); bunny_display(win); usleep(100000000); bunny_delete_clipable(&pix->clipable); bunny_stop(win); }
t_bunny_response loop(void *data) { t_bunny_window *win = data; t_bunny_position screen; t_bunny_position tmp; screen = bunny_get_screen_size(); tmp.x = rand() % screen.x * 0.2 + 50; tmp.y = rand() % screen.y * 0.2 + 50; bunny_resize_window(win, tmp); tmp.x = rand() % (screen.x - win->buffer.width); tmp.y = rand() % (screen.y - win->buffer.height); bunny_move_window(win, tmp); bunny_clear(&win->buffer, rand() | BLACK); bunny_display(win); return (GO_ON); }
int main() { t_bunny_window *window; window = bunny_start(800, 600, 0, "Ma fenĂȘtre"); if (!window) { return (1); } while (1) { bunny_display(window); print_size(window); sleep(1); } bunny_stop(window); return (0); }
void print_bar(t_lapin *lapin) { if (lapin->mouse_click == 1) size_bar(lapin->window_1, lapin->pixelarray_tmp_2, 50, 0); else size_bar(lapin->window_1, lapin->pixelarray_2, 50, 0); if (lapin->option == 1) { size_bar(lapin->window_1, lapin->pixelarray_3, 50, 513); } else if (lapin->option == 2) size_bar(lapin->window_1, lapin->pixelarray_4, 50, 600); else if (lapin->option == 3) size_bar(lapin->window_1, lapin->bmp.Box, 340, 300); else if (lapin->option == 4) size_bar(lapin->window_1, lapin->pixelarray_4, 50, 500); bunny_display(lapin->window_1); }
void aff_text(t_data *data, t_bunny_picture *text) { int i; t_bunny_position pos; pos.x = data->player.x - 100; pos.y = data->player.y - 350; i = 0; while (i < 250) { aff_map(data); player_stop(data); (data->inv.open == 1 ? aff_inventory(data) : (void)0); bunny_blit(&data->win->buffer, text, &pos); bunny_display(data->win); my_sleep(200); i++; } }
t_bunny_response display(void *data) { t_bunny_loading_screen *ld = (t_bunny_loading_screen*)data; t_bunny_position pos[2]; unsigned int col[2] = {WHITE, PINK2}; int limit; int i; bunny_clear(ld->head.screen, BLACK); limit = ld->percent_completion * ld->head.screen->width; for (i = 0; i < limit; ++i) { pos[0].x = pos[1].x = i; pos[0].y = 0; pos[1].y = ld->head.screen->height; bunny_set_line(ld->head.screen, &pos[0], &col[0]); } bunny_display((t_bunny_window*)ld->head.screen); return (GO_ON); }
void kala_end_fade(t_kala *data) { if (data->intro.state == 5) { bunny_fill(&data->bg->buffer, data->intro.black.full); bunny_blit(&data->win->buffer, data->bg, NULL); bunny_display(data->win); data->intro.black.argb[3] += 1; if (data->intro.black.argb[3] >= 70) data->intro.state = 6; } if (data->intro.state == 6) { bunny_delete_clipable(data->logo); bunny_delete_clipable(data->shard); bunny_sound_stop((t_bunny_sound *)data->draa); bunny_delete_sound((t_bunny_sound *)data->draa); bunny_set_loop_main_function((t_bunny_loop)kala_loop); } }
int cam_gen(t_data *data) { t_cam cam; t_cam old; t_bunny_position origin; cam_init_gen(data, &old, &origin); while (cam_path_read(data->path, &cam) == 0) { data->pix = data->big; data->obj.cam = cam; if (my_memcmp(&cam, &old, sizeof(t_cam)) != 0) gen_scene(data); old = cam; if (jif_add(data->jif, data->pix)) return (1); bunny_blit(&data->win->buffer, &data->pix->clipable, &origin); bunny_display(data->win); } return (0); }
static t_bunny_response bunny_vellement(void *my_data) { t_data *data = my_data; // blit_everything(data); data->loop += ABS(data->speed / 4); // manage_core(data); write_score(data->champ[0].score / 10, data->pix, data->font); data->speed = 10 + (data->champ[0].score < 0 ? 0 : data->champ[0].score / 15000); data->font_pos.y += data->speed; if (data->font_pos.y < HEIGHT) { data->pos.x = 0; data->pos.y = 0; data->pos.y = data->font_pos.y - HEIGHT; bunny_blit(&data->win->buffer, &data->newpix->clipable, &data->pos); // bunny_blit(&data->win->buffer, &data->pix->clipable, &data->font_pos); } printf("lol\n"); bunny_display(data->win); return (GO_ON); }
t_bunny_response display_function(void *d) { t_main_data *data = (t_main_data*)d; bunny_fill(&data->win->buffer, ALPHA(64, BLACK)); t_bunny_position circle_position; t_bunny_position circle_size; circle_position.x = data->win->buffer.width / 2; circle_position.y = data->win->buffer.height / 2; circle_size.x = cos(data->step) * data->win->buffer.width / 2; circle_size.y = sin(data->step) * data->win->buffer.height / 2; bunny_set_circle(&data->win->buffer, circle_position, circle_size, RED); unsigned int col[2] = {BLACK, RED}; t_bunny_position pos[2]; double additional_step; pos[0].x = circle_position.x; pos[0].y = circle_position.y; for (additional_step = 0; additional_step < 1; additional_step += 0.05) { pos[1].x = pos[0].x + cos(2.3 * data->step + additional_step) * circle_size.x * (1 - additional_step); pos[1].y = pos[0].y + sin(2.3 *data->step + additional_step) * circle_size.y * (1 - additional_step); bunny_set_line(&data->win->buffer, &pos[0], &col[0]); pos[1].x = pos[0].x - cos(2.3 * data->step + additional_step) * circle_size.x * (1 - additional_step); pos[1].y = pos[0].y - sin(2.3 * data->step + additional_step) * circle_size.y * (1 - additional_step); bunny_set_line(&data->win->buffer, &pos[0], &col[0]); } bunny_display(data->win); return (GO_ON); }
t_bunny_response mainloop(t_data *data) { if (data->player->coef[0] == 0 && data->player->coef[1] == 0) if (to_next_node(data) == - 1) return (EXIT_ON_ERROR); if (data->player->coef[0] != 0 && data->player->coef[1] != 0) move_perso(data); if (data->id_plan == 0) { change_pos(data); change_pos_nuages(data); have_pos(data); } else if (data->id_plan == 1) move_poteau(data); envoi_to_copy(data); tektext(data->pix, data->text); change_pos_perso(data->player->mov[CUR]->calque[0]->pix, data->loop); bunny_blit(&data->win->buffer, &data->pix->clipable, data->pos); bunny_display(data->win); return (GO_ON); }