____                _       __
    / __ )____  _____   | |     / /___ ___________
   / __  / __ \/ ___/   | | /| / / __ `/ ___/ ___/
  / /_/ / /_/ (__  )    | |/ |/ / /_/ / /  (__  )
 /_____/\____/____/     |__/|__/\__,_/_/  /____/

       A futuristic real-time strategy game.
          This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project. Distributed under the "GNU General Public License"

linedraw_gl Namespace Reference


Functions

void DrawPixel (Uint32 color, int x, int y)
void DrawTransPixel (Uint32 color, int x, int y, unsigned char alpha)
void DrawPixelClip (Uint32 color, int x, int y)
void DrawTransPixelClip (Uint32 color, int x, int y, unsigned char alpha)
void DrawHLine (Uint32 color, int x, int y, int width)
void DrawTransHLine (Uint32 color, int x, int y, int width, unsigned char alpha)
void DrawHLineClip (Uint32 color, int x, int y, int width)
void DrawTransHLineClip (Uint32 color, int x, int y, int width, unsigned char alpha)
void DrawVLine (Uint32 color, int x, int y, int height)
void DrawTransVLine (Uint32 color, int x, int y, int height, unsigned char alpha)
void DrawVLineClip (Uint32 color, int x, int y, int height)
void DrawTransVLineClip (Uint32 color, int x, int y, int height, unsigned char alpha)
void DrawLine (Uint32 color, int x1, int y1, int x2, int y2)
static int ClipCodeLine (int x, int y)
static int LineIsUnclippedOnSameSide (int code1, int code2)
static int LineIsUnclipped (int code1, int code2)
void DrawLineClip (Uint32 color, int x1, int y1, int x2, int y2)
void DrawTransLine (Uint32 color, int sx, int sy, int dx, int dy, unsigned char alpha)
void DrawTransLineClip (Uint32 color, int sx, int sy, int dx, int dy, unsigned char alpha)
void DrawRectangle (Uint32 color, int x, int y, int w, int h)
void DrawTransRectangle (Uint32 color, int x, int y, int w, int h, unsigned char alpha)
void DrawRectangleClip (Uint32 color, int x, int y, int w, int h)
void DrawTransRectangleClip (Uint32 color, int x, int y, int w, int h, unsigned char alpha)
void FillRectangle (Uint32 color, int x, int y, int w, int h)
void FillTransRectangle (Uint32 color, int x, int y, int w, int h, unsigned char alpha)
void FillRectangleClip (Uint32 color, int x, int y, int w, int h)
void FillTransRectangleClip (Uint32 color, int x, int y, int w, int h, unsigned char alpha)
void DrawCircle (Uint32 color, int x, int y, int radius)
void DrawCircleClip (Uint32 color, int x, int y, int radius)
void DrawTransCircle (Uint32 color, int x, int y, int radius, unsigned char alpha)
void DrawTransCircleClip (Uint32 color, int x, int y, int radius, unsigned char alpha)
void FillCircle (Uint32 color, int x, int y, int radius)
void FillTransCircle (Uint32 color, int x, int y, int radius, unsigned char alpha)
void FillCircleClip (Uint32 color, int x, int y, int radius)
void FillTransCircleClip (Uint32 color, int x, int y, int radius, unsigned char alpha)
void InitLineDraw (void)
 Simply invalidates whole window or screen.


Function Documentation

static int linedraw_gl::ClipCodeLine ( int  x,
int  y 
) [static]

Delivers bitmask denoting given point is left/right/above/below clip rectangle, used for faster determinination of clipped position.

Parameters:
x pixel's x position (not restricted to screen width)
y pixel's y position (not restricted to screen height)

Definition at line 1273 of file linedraw.cpp.

References ClipCodeAbove, ClipCodeBelow, ClipCodeInside, ClipCodeLeft, ClipCodeRight, ClipX1, ClipX2, ClipY1, and ClipY2.

Referenced by DrawLineClip().

void linedraw_gl::DrawCircle ( Uint32  color,
int  x,
int  y,
int  radius 
)

Draw circle.

Parameters:
color color
x Center x coordinate on the screen
y Center y coordinate on the screen
radius radius of circle

Definition at line 1645 of file linedraw.cpp.

References Assert, and DrawPixel().

Referenced by CVideo::DrawCircle(), and DrawTransCircle().

void linedraw_gl::DrawCircleClip ( Uint32  color,
int  x,
int  y,
int  radius 
)

Draw circle clipped.

Parameters:
color color
x Center x coordinate on the screen
y Center y coordinate on the screen
radius radius of circle

Definition at line 1704 of file linedraw.cpp.

References Assert, and DrawPixelClip().

Referenced by CVideo::DrawCircleClip(), and DrawTransCircleClip().

void linedraw_gl::DrawHLine ( Uint32  color,
int  x,
int  y,
int  width 
)

Draw horizontal line unclipped.

Parameters:
color color
x x coordinate on the screen
y y coordinate on the screen
width width of line (0=don't draw).

Definition at line 1054 of file linedraw.cpp.

References CVideo::GetRGBA(), and Video.

Referenced by CVideo::DrawHLine(), DrawHLineClip(), DrawRectangleClip(), and DrawTransHLine().

void linedraw_gl::DrawHLineClip ( Uint32  color,
int  x,
int  y,
int  width 
)

Draw horizontal line clipped.

Parameters:
color color
x x coordinate on the screen
y y coordinate on the screen
width width of line (0=don't draw).

Definition at line 1095 of file linedraw.cpp.

References ClipX1, ClipX2, ClipY2, and DrawHLine().

Referenced by CVideo::DrawHLineClip(), DrawTransHLineClip(), and FillCircleClip().

void linedraw_gl::DrawLine ( Uint32  color,
int  x1,
int  y1,
int  x2,
int  y2 
)

Draw line unclipped into 32bit framebuffer.

Parameters:
color color
x1 Source x coordinate on the screen
y1 Source y coordinate on the screen
x2 Destination x coordinate on the screen
y2 Destination y coordinate on the screen

Definition at line 1235 of file linedraw.cpp.

References CVideo::GetRGBA(), and Video.

Referenced by CVideo::DrawLine(), DrawLineClip(), and DrawTransLine().

void linedraw_gl::DrawLineClip ( Uint32  color,
int  x1,
int  y1,
int  x2,
int  y2 
)

Draw line clipped. Based on Sutherland-Cohen clipping technique (Replaces Liang/Barksy clipping algorithm in CVS version 1.18, which might be faster, but that one contained some BUGs)

Parameters:
color color
x1 Source x coordinate on the screen
y1 Source y coordinate on the screen
x2 Destination x coordinate on the screen
y2 Destination y coordinate on the screen

Definition at line 1330 of file linedraw.cpp.

References Assert, ClipCodeAbove, ClipCodeBelow, ClipCodeLeft, ClipCodeLine(), ClipX1, ClipX2, ClipY1, ClipY2, DrawLine(), int(), LineIsUnclipped(), and LineIsUnclippedOnSameSide().

Referenced by CVideo::DrawLineClip(), and DrawTransLineClip().

void linedraw_gl::DrawPixel ( Uint32  color,
int  x,
int  y 
)

Draw pixel unclipped.

Parameters:
color color
x x coordinate on the screen
y y coordinate on the screen

Definition at line 982 of file linedraw.cpp.

References CVideo::GetRGBA(), and Video.

Referenced by DrawCircle(), DrawPixelClip(), and DrawTransPixel().

void linedraw_gl::DrawPixelClip ( Uint32  color,
int  x,
int  y 
)

Draw pixel clipped to current clip setting.

Parameters:
color color
x x coordinate on the screen
y y coordinate on the screen

Definition at line 1020 of file linedraw.cpp.

References ClipX2, ClipY2, and DrawPixel().

Referenced by DrawCircleClip(), CVideo::DrawPixelClip(), and DrawTransPixelClip().

void linedraw_gl::DrawRectangle ( Uint32  color,
int  x,
int  y,
int  w,
int  h 
)

Draw rectangle.

Parameters:
color color
x x coordinate on the screen
y y coordinate on the screen
h height of rectangle (0=don't draw).
w width of rectangle (0=don't draw).

Definition at line 1407 of file linedraw.cpp.

References CVideo::GetRGBA(), and Video.

Referenced by CVideo::DrawRectangle(), and DrawTransRectangle().

void linedraw_gl::DrawRectangleClip ( Uint32  color,
int  x,
int  y,
int  w,
int  h 
)

Draw rectangle clipped.

Parameters:
color color
x x coordinate on the screen
y y coordinate on the screen
h height of rectangle (0=don't draw).
w width of rectangle (0=don't draw).

Definition at line 1459 of file linedraw.cpp.

References ClipX1, ClipX2, ClipY1, ClipY2, DrawHLine(), and DrawVLine().

Referenced by CVideo::DrawRectangleClip(), and DrawTransRectangleClip().

void linedraw_gl::DrawTransCircle ( Uint32  color,
int  x,
int  y,
int  radius,
unsigned char  alpha 
)

Draw translucent circle.

Parameters:
color color
x Center x coordinate on the screen
y Center y coordinate on the screen
radius radius of circle
alpha alpha value of pixels.

Definition at line 1764 of file linedraw.cpp.

References DrawCircle(), CVideo::GetRGB(), CVideo::MapRGBA(), and Video.

Referenced by CVideo::DrawTransCircle().

void linedraw_gl::DrawTransCircleClip ( Uint32  color,
int  x,
int  y,
int  radius,
unsigned char  alpha 
)

Draw translucent circle clipped.

Parameters:
color color
x Center x coordinate on the screen
y Center y coordinate on the screen
radius radius of circle
alpha alpha value of pixels.

Definition at line 1783 of file linedraw.cpp.

References DrawCircleClip(), CVideo::GetRGB(), CVideo::MapRGBA(), and Video.

Referenced by CVideo::DrawTransCircleClip().

void linedraw_gl::DrawTransHLine ( Uint32  color,
int  x,
int  y,
int  width,
unsigned char  alpha 
)

Draw translucent horizontal line unclipped.

Parameters:
color color
x x coordinate on the screen
y y coordinate on the screen
width width of line (0=don't draw).
alpha alpha value of pixels.

Definition at line 1077 of file linedraw.cpp.

References DrawHLine(), CVideo::GetRGB(), CVideo::MapRGBA(), and Video.

Referenced by CVideo::DrawTransHLine().

void linedraw_gl::DrawTransHLineClip ( Uint32  color,
int  x,
int  y,
int  width,
unsigned char  alpha 
)

Draw translucent horizontal line clipped.

Parameters:
color Color index
x X pixel coordinate on the screen
y Y c pixeloordinate on the screen
width Width of line (0=don't draw)
alpha Alpha value of pixels

Definition at line 1126 of file linedraw.cpp.

References DrawHLineClip(), CVideo::GetRGB(), CVideo::MapRGBA(), and Video.

Referenced by CVideo::DrawTransHLineClip().

void linedraw_gl::DrawTransLine ( Uint32  color,
int  sx,
int  sy,
int  dx,
int  dy,
unsigned char  alpha 
)

Draw a transparent line

Definition at line 1381 of file linedraw.cpp.

References DrawLine().

Referenced by CVideo::DrawTransLine().

void linedraw_gl::DrawTransLineClip ( Uint32  color,
int  sx,
int  sy,
int  dx,
int  dy,
unsigned char  alpha 
)

Draw a transparent line clipped

Definition at line 1391 of file linedraw.cpp.

References DrawLineClip().

Referenced by CVideo::DrawTransLineClip().

void linedraw_gl::DrawTransPixel ( Uint32  color,
int  x,
int  y,
unsigned char  alpha 
)

Draw translucent pixel unclipped.

Parameters:
color color
x x coordinate on the screen
y y coordinate on the screen
alpha alpha value of pixel.

Definition at line 1003 of file linedraw.cpp.

References DrawPixel(), CVideo::GetRGB(), CVideo::MapRGBA(), and Video.

void linedraw_gl::DrawTransPixelClip ( Uint32  color,
int  x,
int  y,
unsigned char  alpha 
)

Draw translucent pixel clipped to current clip setting.

Parameters:
color color
x x coordinate on the screen
y y coordinate on the screen
alpha alpha value of pixel.

Definition at line 1036 of file linedraw.cpp.

References DrawPixelClip(), CVideo::GetRGB(), CVideo::MapRGBA(), and Video.

Referenced by CVideo::DrawTransPixelClip().

void linedraw_gl::DrawTransRectangle ( Uint32  color,
int  x,
int  y,
int  w,
int  h,
unsigned char  alpha 
)

Draw translucent rectangle.

Parameters:
color color
x x coordinate on the screen
y y coordinate on the screen
h height of rectangle (0=don't draw).
w width of rectangle (0=don't draw).
alpha alpha value of pixel.

Definition at line 1440 of file linedraw.cpp.

References DrawRectangle(), CVideo::GetRGB(), CVideo::MapRGBA(), and Video.

Referenced by CVideo::DrawTransRectangle().

void linedraw_gl::DrawTransRectangleClip ( Uint32  color,
int  x,
int  y,
int  w,
int  h,
unsigned char  alpha 
)

Draw translucent rectangle clipped.

Parameters:
color color
x x coordinate on the screen
y y coordinate on the screen
h height of rectangle (0=don't draw).
w width of rectangle (0=don't draw).
alpha alpha value of pixels.

Definition at line 1545 of file linedraw.cpp.

References DrawRectangleClip(), CVideo::GetRGB(), CVideo::MapRGBA(), and Video.

Referenced by CVideo::DrawTransRectangleClip().

void linedraw_gl::DrawTransVLine ( Uint32  color,
int  x,
int  y,
int  height,
unsigned char  alpha 
)

Draw translucent vertical line unclipped.

Parameters:
color color
x x coordinate on the screen
y y coordinate on the screen
height height of line (0=don't draw).
alpha alpha value of pixels.

Definition at line 1167 of file linedraw.cpp.

References DrawVLine(), CVideo::GetRGB(), CVideo::MapRGBA(), and Video.

Referenced by CVideo::DrawTransVLine().

void linedraw_gl::DrawTransVLineClip ( Uint32  color,
int  x,
int  y,
int  height,
unsigned char  alpha 
)

Draw translucent vertical line clipped.

Parameters:
color color
x x coordinate on the screen
y y coordinate on the screen
height height of line (0=don't draw).
alpha alpha value of pixels.

Definition at line 1216 of file linedraw.cpp.

References DrawVLineClip(), CVideo::GetRGB(), CVideo::MapRGBA(), and Video.

Referenced by CVideo::DrawTransVLineClip().

void linedraw_gl::DrawVLine ( Uint32  color,
int  x,
int  y,
int  height 
)

Draw vertical line unclipped.

Parameters:
color color
x x coordinate on the screen
y y coordinate on the screen
height height of line (0=don't draw).

Definition at line 1144 of file linedraw.cpp.

References CVideo::GetRGBA(), and Video.

Referenced by DrawRectangleClip(), DrawTransVLine(), CVideo::DrawVLine(), DrawVLineClip(), and FillCircle().

void linedraw_gl::DrawVLineClip ( Uint32  color,
int  x,
int  y,
int  height 
)

Draw vertical line clipped.

Parameters:
color color
x x coordinate on the screen
y y coordinate on the screen
height height of line (0=don't draw).

Definition at line 1185 of file linedraw.cpp.

References ClipX2, ClipY1, ClipY2, and DrawVLine().

Referenced by DrawTransVLineClip(), and CVideo::DrawVLineClip().

void linedraw_gl::FillCircle ( Uint32  color,
int  x,
int  y,
int  radius 
)

Fill circle.

Parameters:
color color
x Center x coordinate on the screen
y Center y coordinate on the screen
radius radius of circle

Definition at line 1801 of file linedraw.cpp.

References DrawVLine().

Referenced by CVideo::FillCircle(), and FillTransCircle().

void linedraw_gl::FillCircleClip ( Uint32  color,
int  x,
int  y,
int  radius 
)

Fill circle clipped.

Parameters:
color color
x Center x coordinate on the screen
y Center y coordinate on the screen
radius radius of circle

Definition at line 1862 of file linedraw.cpp.

References DrawHLineClip().

Referenced by CVideo::FillCircleClip(), and FillTransCircleClip().

void linedraw_gl::FillRectangle ( Uint32  color,
int  x,
int  y,
int  w,
int  h 
)

Fill rectangle.

Parameters:
color color
x x coordinate on the screen
y y coordinate on the screen
h height of rectangle (0=don't draw).
w width of rectangle (0=don't draw).

Definition at line 1564 of file linedraw.cpp.

References CVideo::GetRGBA(), and Video.

Referenced by CVideo::FillRectangle(), FillRectangleClip(), and FillTransRectangle().

void linedraw_gl::FillRectangleClip ( Uint32  color,
int  x,
int  y,
int  w,
int  h 
)

Fill rectangle clipped.

Parameters:
color color
x x coordinate on the screen
y y coordinate on the screen
h height of rectangle (0=don't draw).
w width of rectangle (0=don't draw).

Definition at line 1610 of file linedraw.cpp.

References CLIP_RECTANGLE, and FillRectangle().

Referenced by CVideo::FillRectangleClip(), and FillTransRectangleClip().

void linedraw_gl::FillTransCircle ( Uint32  color,
int  x,
int  y,
int  radius,
unsigned char  alpha 
)

Fill translucent circle clipped.

Parameters:
color color
x Center x coordinate on the screen
y Center y coordinate on the screen
radius radius of circle
alpha alpha value of pixels.

Definition at line 1844 of file linedraw.cpp.

References FillCircle(), CVideo::GetRGB(), CVideo::MapRGBA(), and Video.

Referenced by CVideo::FillTransCircle().

void linedraw_gl::FillTransCircleClip ( Uint32  color,
int  x,
int  y,
int  radius,
unsigned char  alpha 
)

Fill translucent circle clipped.

Parameters:
color color
x Center x coordinate on the screen
y Center y coordinate on the screen
radius radius of circle
alpha alpha value of pixels.

Definition at line 1908 of file linedraw.cpp.

References FillCircleClip(), CVideo::GetRGB(), CVideo::MapRGBA(), and Video.

Referenced by CVideo::FillTransCircleClip().

void linedraw_gl::FillTransRectangle ( Uint32  color,
int  x,
int  y,
int  w,
int  h,
unsigned char  alpha 
)

Draw translucent rectangle.

Parameters:
color color
x x coordinate on the screen
y y coordinate on the screen
h height of rectangle (0=don't draw).
w width of rectangle (0=don't draw).
alpha alpha value of pixel.

Definition at line 1591 of file linedraw.cpp.

References FillRectangle(), CVideo::GetRGB(), CVideo::MapRGBA(), and Video.

Referenced by CVideo::FillTransRectangle().

void linedraw_gl::FillTransRectangleClip ( Uint32  color,
int  x,
int  y,
int  w,
int  h,
unsigned char  alpha 
)

Fill rectangle translucent clipped.

Parameters:
color color
x x coordinate on the screen
y y coordinate on the screen
h height of rectangle (0=don't draw).
w width of rectangle (0=don't draw).
alpha alpha value of pixels.

Definition at line 1627 of file linedraw.cpp.

References FillRectangleClip(), CVideo::GetRGB(), CVideo::MapRGBA(), and Video.

Referenced by CVideo::FillTransRectangleClip().

void linedraw_gl::InitLineDraw ( void   ) 

Simply invalidates whole window or screen.

Initialize line draw

Definition at line 1921 of file linedraw.cpp.

Referenced by InitLineDraw().

static int linedraw_gl::LineIsUnclipped ( int  code1,
int  code2 
) [static]

Denotes part of (or entire) line located outside clip rectangle (point 1 and/or 2 is outside clip rectangle)

Parameters:
code1 ClipCode of one point of line
code2 ClipCode of second point of line

Definition at line 1313 of file linedraw.cpp.

Referenced by DrawLineClip().

static int linedraw_gl::LineIsUnclippedOnSameSide ( int  code1,
int  code2 
) [static]

Denotes entire line located at the same side outside clip rectangle (point 1 and 2 are both as left/right/above/below the clip rectangle)

Parameters:
code1 ClipCode of one point of line
code2 ClipCode of second point of line

Definition at line 1301 of file linedraw.cpp.

Referenced by DrawLineClip().


Generated on Sat Feb 21 00:28:27 2009 for Bos Wars by  doxygen 1.5.6