In file include/csengine/cbuffer.h:

class csCBuffer

The CBuffer

Public Methods

csCBuffer(int sx, int ex, int n_lines)
Create a new c-buffer with the given dimensions.
void DumpLine(int y)
Dump debug information for a scanline.
void Initialize()
Initialize the c-buffer to empty.
bool InsertPolygon(csVector2* verts, int num_verts, bool negative = false)
Take a polygon and insert all spans in the c-buffer
bool IsFull()
Return true if the screen (c-buffer) is full.
bool TestPolygon(csVector2* verts, int num_verts)
Take a polygon and test if it would have changed the c-buffer
~csCBuffer()
Destroy the c-buffer.

Private Fields

csCBufferSpan* first_unused
List of all unused spans on screen.
bool* full
A value for every line indicating if it is full or not.
csCBufferLine* lines
The lines of this c-buffer.
int num_lines
Number of vertical lines.
int startx
Horizontal start and end (inclusive).
csCBufferLine vert_line
A vertical c-buffer line which is used to indicate which horizontal lines of the c-buffer are full

Private Methods

csCBufferSpan* AllocSpan()
Allocate a span (possible from the unused list).
void FreeSpan(csCBufferSpan* span)
Free a span (put in the unused list).
bool InsertSpan(int s_spanx, int e_spanx, int y)
Take a full span and insert it into the c-buffer line
bool IsFull(int y)
Test if a line is full.
bool TestSpan(int s_spanx, int e_spanx, int y)
Take a full span and test if it would have changed the c-buffer line on insertion

Documentation

The CBuffer. Note that all ranges specified in this class are inclusive.
csCBufferLine* lines
The lines of this c-buffer.

int num_lines
Number of vertical lines.

bool* full
A value for every line indicating if it is full or not.

int startx
Horizontal start and end (inclusive).

csCBufferSpan* first_unused
List of all unused spans on screen.

csCBufferLine vert_line
A vertical c-buffer line which is used to indicate which horizontal lines of the c-buffer are full. Again spans indicate not-full regions.

csCBufferSpan* AllocSpan()
Allocate a span (possible from the unused list).

void FreeSpan(csCBufferSpan* span)
Free a span (put in the unused list).

bool TestSpan(int s_spanx, int e_spanx, int y)
Take a full span and test if it would have changed the c-buffer line on insertion. This means that the span is visible.

bool InsertSpan(int s_spanx, int e_spanx, int y)
Take a full span and insert it into the c-buffer line. Return true if the span modified the buffer (i.e. span is visible).

bool IsFull(int y)
Test if a line is full.

csCBuffer(int sx, int ex, int n_lines)
Create a new c-buffer with the given dimensions.

~csCBuffer()
Destroy the c-buffer.

void Initialize()
Initialize the c-buffer to empty.

bool IsFull()
Return true if the screen (c-buffer) is full.

bool TestPolygon(csVector2* verts, int num_verts)
Take a polygon and test if it would have changed the c-buffer. This means that the polygon is visible. Polygon vertices are converted to integer before comparing. Note that this function will work with both clockwise and anti- clockwise oriented polygons and will assume both orientations are visible. Backface culling needs to be done elsewhere.

bool InsertPolygon(csVector2* verts, int num_verts, bool negative = false)
Take a polygon and insert all spans in the c-buffer. Returns true if the polygon is visible. Note that this function will work with both clockwise and anti- clockwise oriented polygons and will assume both orientations are visible. Backface culling needs to be done elsewhere. If 'negative' is true the polygons in inserted inverted.

void DumpLine(int y)
Dump debug information for a scanline.


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de