Changeset 128 for ttyvaders


Ignore:
Timestamp:
Nov 10, 2003, 4:16:38 PM (16 years ago)
Author:
Sam Hocevar
Message:
  • libee/line.c: + Added code comments.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ttyvaders/trunk/libee/line.c

    r104 r128  
    4141static void draw_thin_line(struct line*);
    4242
     43/**
     44 * \brief Draw a line on the screen using the given character.
     45 *
     46 * \param x1 X coordinate of the first point.
     47 * \param y1 Y coordinate of the first point.
     48 * \param x2 X coordinate of the second point.
     49 * \param y2 Y coordinate of the second point.
     50 * \param c Character to draw the line with.
     51 * \return nothing
     52 */
    4353void ee_draw_line(int x1, int y1, int x2, int y2, char c)
    4454{
     
    5363}
    5464
     65/**
     66 * \brief Draw a thin line on the screen, using ASCII art.
     67 *
     68 * \param x1 X coordinate of the first point.
     69 * \param y1 Y coordinate of the first point.
     70 * \param x2 X coordinate of the second point.
     71 * \param y2 Y coordinate of the second point.
     72 * \return nothing
     73 */
    5574void ee_draw_thin_line(int x1, int y1, int x2, int y2)
    5675{
     
    6483}
    6584
     85/**
     86 * \brief Generic Cohen-Sutherland line clipping function.
     87 *
     88 * \param s a line structure
     89 * \return nothing
     90 */
    6691static void clip_line(struct line* s)
    6792{
     
    115140}
    116141
     142/**
     143 * \brief Helper function for clip_line().
     144 *
     145 * \param x X coordinate of the point.
     146 * \param y Y coordinate of the point.
     147 * \return b The clipping bits for the given point.
     148 */
    117149static uint8_t clip_bits(int x, int y)
    118150{
     
    132164}
    133165
     166/**
     167 * \brief Solid line drawing function, using Bresenham's mid-point line
     168 *        scan-conversion algorithm.
     169 *
     170 * \param s a line structure
     171 * \return nothing
     172 */
    134173static void draw_solid_line(struct line* s)
    135174{
     
    194233}
    195234
     235/**
     236 * \brief Thin line drawing function, using Bresenham's mid-point line
     237 *        scan-conversion algorithm and ASCII art graphics.
     238 *
     239 * \param s a line structure
     240 * \return nothing
     241 */
    196242static void draw_thin_line(struct line* s)
    197243{
Note: See TracChangeset for help on using the changeset viewer.