libtcod
Loading...
Searching...
No Matches
bresenham.h File Reference

Bresenham line module. More...

#include "portability.h"

Go to the source code of this file.

Classes

struct  TCOD_bresenham_data_t
 A struct used for computing a bresenham line. 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)
 Initialize a line using a global state.
 
bool TCOD_line_step (int *xCur, int *yCur)
 Advance to the next point in a line, returns true once the line has ended.
 
bool TCOD_line (int xFrom, int yFrom, int xTo, int yTo, TCOD_line_listener_t listener)
 Iterate over a line using a callback.
 
void TCOD_line_init_mt (int xFrom, int yFrom, int xTo, int yTo, TCOD_bresenham_data_t *data)
 Initialize a TCOD_bresenham_data_t struct.
 
bool TCOD_line_step_mt (int *xCur, int *yCur, TCOD_bresenham_data_t *data)
 Get the next point on a line, returns true once the line has ended.
 
bool TCOD_line_mt (int xFrom, int yFrom, int xTo, int yTo, TCOD_line_listener_t listener, TCOD_bresenham_data_t *data)
 Iterate over a line using a callback.
 

Detailed Description

Bresenham line module.