Example #1
0
void t_interval (int len, f_ptr callback, void *arg, int flags)
{
	if (times == NULL)
		times = v_dinit (sizeof(struct Timer));
	unsigned end;
	if (len)
		end = SDL_GetTicks () + len;
	else
		end = (unsigned) -1;
	struct Timer t = {end, callback, arg, flags};
	v_push (times, &t);
}
Example #2
0
Vector w_lines (char *msg, int line)
{
	if (line <= 0)
		return NULL;
	Vector lines = v_dinit (line+1);
	char *tmp = malloc (line+1);
	int i = 0, len = strlen (msg);
	do
	{
		memcpy (tmp, msg + line*(i++), line);
		v_pstr (lines, tmp);
	}
	while (i*line <= len);
	return lines;
}