2022-06-17 05:31:38 +00:00
|
|
|
#ifndef __ANIMATION_H__
|
|
|
|
#define __ANIMATION_H__
|
|
|
|
|
|
|
|
// line_t provides a simplified implementation of Bresenham's line drawing
|
|
|
|
// technique. At this time, it assumes a transition of x = 0 -> 60, and a dy
|
|
|
|
// between -59 and 59. I am not sure I understand Bresenham's algorithm yet,
|
|
|
|
// but I'll need to revisit all of this if I want to expand the boundaries.
|
2022-07-18 03:01:27 +00:00
|
|
|
typedef struct {
|
|
|
|
int y;
|
|
|
|
int de;
|
|
|
|
int error;
|
|
|
|
int inc;
|
|
|
|
int dt;
|
|
|
|
int dy;
|
|
|
|
} time_line_t;
|
2022-06-17 05:31:38 +00:00
|
|
|
|
|
|
|
// Construct a new line object. x1 must be greater than x0, and dy must be less than dx.
|
2022-07-18 03:01:27 +00:00
|
|
|
time_line_t time_line_new(int, int, int, int);
|
2022-06-17 05:31:38 +00:00
|
|
|
|
|
|
|
// Calculate the next y value of the line.
|
2022-07-18 03:01:27 +00:00
|
|
|
int time_line_next(time_line_t *);
|
2022-06-17 05:31:38 +00:00
|
|
|
|
|
|
|
// Diagnostic printout of the current state of line_t.
|
|
|
|
// void line_print(line_t *line);
|
|
|
|
|
|
|
|
#endif
|