Changeset 325


Ignore:
Timestamp:
Jan 7, 2004, 7:15:10 PM (16 years ago)
Author:
Sam Hocevar
Message:
  • src/io.c: + Do not report mouse motions if the coordinates did not change.
  • src/bitmap.c: + More documentation.
Location:
libcaca/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/NEWS

    r322 r325  
    44----------------------------
    55
     6  * many bugfixes in the event handling
    67  * cacaball, a metaball animation example
    78
  • libcaca/trunk/src/bitmap.c

    r322 r325  
    171171 * \brief Create an internal bitmap object.
    172172 *
    173  * \param bpp The bitmap depth in bits per pixel.
    174  * \param w The bitmap width in pixels.
    175  * \param h The bitmap height in pixels.
    176  * \param pitch The bitmap pitch in bytes.
    177  * \param rmask The bitmask for red values.
    178  * \param gmask The bitmask for green values.
    179  * \param bmask The bitmask for blue values.
    180  * \param amask The bitmask for alpha values.
    181  * \return A bitmap object or NULL upon error.
     173 * Create a bitmap structure from its coordinates (depth, width, height and
     174 * pitch) and pixel mask values. If the depth is 8 bits per pixel, the mask
     175 * values are ignored and the colour palette should be set using the
     176 * caca_set_bitmap_palette() function. For depths greater than 8 bits per
     177 * pixel, a zero alpha mask causes the alpha values to be ignored.
     178 *
     179 * \param bpp Bitmap depth in bits per pixel.
     180 * \param w Bitmap width in pixels.
     181 * \param h Bitmap height in pixels.
     182 * \param pitch Bitmap pitch in bytes.
     183 * \param rmask Bitmask for red values.
     184 * \param gmask Bitmask for green values.
     185 * \param bmask Bitmask for blue values.
     186 * \param amask Bitmask for alpha values.
     187 * \return Bitmap object, or NULL upon error.
    182188 */
    183189struct caca_bitmap *caca_create_bitmap(unsigned int bpp, unsigned int w,
     
    238244 * \brief Set the palette of an 8bpp bitmap object.
    239245 *
    240  * \param bitmap The bitmap object.
    241  * \param red An array of 256 red values.
    242  * \param green An array of 256 green values.
    243  * \param blue An array of 256 blue values.
    244  * \param alpha An array of 256 alpha values.
     246 * Set the palette of an 8 bits per pixel bitmap. Values should be between
     247 * 0 and 4095 (0xfff).
     248 *
     249 * \param bitmap Bitmap object.
     250 * \param red Array of 256 red values.
     251 * \param green Array of 256 green values.
     252 * \param blue Array of 256 blue values.
     253 * \param alpha Array of 256 alpha values.
    245254 */
    246255void caca_set_bitmap_palette(struct caca_bitmap *bitmap,
     
    277286 * \brief Free the memory associated with a bitmap.
    278287 *
    279  * \param bitmap The bitmap object to be freed.
    280  * \return void
     288 * Free the memory allocated by caca_create_bitmap().
     289 *
     290 * \param bitmap Bitmap object.
    281291 */
    282292void caca_free_bitmap(struct caca_bitmap *bitmap)
     
    378388 * \brief Draw a bitmap on the screen.
    379389 *
     390 * Draw a bitmap at the given coordinates. The bitmap can be of any size and
     391 * will be stretched to the text area.
     392 *
    380393 * \param x1 X coordinate of the upper-left corner of the drawing area.
    381394 * \param y1 Y coordinate of the upper-left corner of the drawing area.
    382395 * \param x2 X coordinate of the lower-right corner of the drawing area.
    383396 * \param y2 Y coordinate of the lower-right corner of the drawing area.
    384  * \param bitmap The bitmap object to be drawn.
    385  * \param pixels A pointer to the bitmap's pixels.
    386  * \return void
     397 * \param bitmap Bitmap object to be drawn.
     398 * \param pixels Bitmap's pixels.
    387399 */
    388400void caca_draw_bitmap(int x1, int y1, int x2, int y2,
  • libcaca/trunk/src/io.c

    r324 r325  
    139139                unsigned int newy = xevent.xmotion.y / x11_font_height;
    140140
    141                 if(x11_x == newx && x11_y == newy)
    142                     continue;
    143 
    144141                if(newx >= _caca_width)
    145142                    newx = _caca_width - 1;
    146143                if(newy >= _caca_height)
    147144                    newy = _caca_height - 1;
     145
     146                if(x11_x == newx && x11_y == newy)
     147                    continue;
    148148
    149149                x11_x = newx & 0xfff;
Note: See TracChangeset for help on using the changeset viewer.