Exemplo n.º 1
0
void v_rptr (Vector vec, void *data)
{
	uintptr_t p = (uintptr_t) data;
	p -= (uintptr_t) vec->data;
	p /= vec->siz;
	if (p < 0 || p >= vec->len)
		return;
	v_rem (vec, p);
}
Exemplo n.º 2
0
void t_flush ()
{
	if (times == NULL)
		return;
	int i;
	for (i = 0; i < times->len; ++ i)
	{
		struct Timer *t = v_at (times, i);
		if ((t->flags & TMR_STOP) == 0)
			continue;
		t->callback (t->arg);
		v_rem (times, i);
		-- i;
	}
}
Exemplo n.º 3
0
void t_idle ()
{
	if (times == NULL)
		return;
	int i, current = SDL_GetTicks ();
	for (i = 0; i < times->len; ++ i)
	{
		struct Timer *t = v_at (times, i);
		if (t->time >= current)
			continue;
		t->callback (t->arg);
		v_rem (times, i);
		-- i;
	}
}