aboutsummaryrefslogtreecommitdiff
path: root/ui_ani.c
blob: 40a07e91609a4c5126b1ea7784b095f3441a2455 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <stdlib.h>

#include "ui_ani.h"

#define ANIC_INITSTATE '\0'


struct anic *
init_anic(unsigned int x, unsigned int y)
{
  struct anic *a = calloc(1, sizeof(struct anic));

  a->x = x;
  a->y = y;
  a->state = ANIC_INITSTATE;
  return (a);
}

void
free_anic(struct anic *a)
{
  free(a);
}

int
anic_cb(WINDOW *win, void *data)
{
  struct anic *a = (struct anic *) data;

  switch (a->state) {
    default:
    case '|': return ('/');
    case '/': return ('-');
    case '-': return ('\\');
    case '\\': return ('|');
  }
}