libtcod
Loading...
Searching...
No Matches
Bresenham lines

Classes

struct  TCOD_bresenham_data_t
 A struct used for computing a bresenham line. More...
class  TCODLineListener
class  TCODLine
class  tcod::BresenhamLine
 Encapsulates a Bresenham line drawing algorithm. More...

Typedefs

typedef bool(* TCOD_line_listener_t) (int x, int y)
 A callback to be passed to TCOD_line.

Functions

void TCOD_line_init (int xFrom, int yFrom, int xTo, int yTo)
bool TCOD_line_step (int *xCur, int *yCur)
 advance one step.
bool TCOD_line (int xFrom, int yFrom, int xTo, int yTo, TCOD_line_listener_t listener)
void TCOD_line_init_mt (int xFrom, int yFrom, int xTo, int yTo, TCOD_bresenham_data_t *data)
bool TCOD_line_step_mt (int *xCur, int *yCur, TCOD_bresenham_data_t *data)
bool TCOD_line_mt (int xFrom, int yFrom, int xTo, int yTo, TCOD_line_listener_t listener, TCOD_bresenham_data_t *data)

Detailed Description

Typedef Documentation

◆ TCOD_line_listener_t

typedef bool(* TCOD_line_listener_t) (int x, int y)

A callback to be passed to TCOD_line.

The points given to the callback include both the starting and ending positions.

Parameters
x
y
Returns
As long as this callback returns true it will be called with the next x,y point on the line.

Function Documentation

◆ TCOD_line_step()

bool TCOD_line_step ( int * xCur,
int * yCur )

advance one step.

returns true if we reach destination