Exemplo n.º 1
0
void		put_pause_selector(t_main_menu *menu)
{
  if (menu->options.select == 1)
    display_bmp(menu, 2, 15, 175);
  else if (menu->options.select == 2)
    display_bmp(menu, 2, 15, 325);
}
/* display pictures */
static int display_pictures(fb_info fb_inf)
{
    picture_t *tmp = pic;

    if (tmp == NULL)
    {
        return 0;
    }
    else
    {
        for ( ; tmp != NULL; tmp = tmp->next)
        {
            if (tmp->type == BMP)
            {
                display_bmp(tmp->name, fb_inf);
                sleep(1);
            }
            else
            {
                display_jpeg(tmp->name, fb_inf);
                sleep(1);
            }
        }
    }

    return 0;
}
Exemplo n.º 3
0
void		*display_state(void *all_philos)
{
  int		pars;
  t_allin	*allin;
  t_philo	*aff_all;

  pars = 0;
  allin = (t_allin *)all_philos;
  aff_all = allin->philos;
  if (pthread_create(&allin->event, NULL, event_SDL, allin) != 0)
    return (NULL);
  while (INFINITE_LOOP)
    {
      if (allin->go_out == TRUE)
	return (NULL);
      SDL_FillRect(allin->screen, NULL, 0x000000);
      system("clear");
      pars = 0;
      while (pars < allin->nb_philo)
	{
	  display_bmp(aff_all[pars].state, allin, pars);
	  display_philosopher(&aff_all[pars]);
	  ++pars;
	}
      sleep(ACTION_TIME);
    }
  return (NULL);
}
/* display bmp various */ 
int display_bmp_various(const char *bmpname, fb_info fb_inf)
{
    static int num = 0;

    switch(num++ % 4)
    {
        case 0:
            display_bmp(bmpname, fb_inf);
            sleep(1);
            break;

        default:
            display_bmp(bmpname, fb_inf);
            sleep(1);
            break;
    }

    return 0; 
}