Ignore:
Timestamp:
Apr 20, 2011, 12:39:27 AM (11 years ago)
Author:
Sam Hocevar
Message:

imlib: use vec2i for image::size and unroll all necessary changes
everywhere else in the code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/imlib/image.h

    r494 r512  
    119119private:
    120120    uint8_t *data;
    121     int16_t w, h;
     121    vec2i size;
    122122    void make_page(int16_t width, int16_t height, uint8_t *page_buffer);
    123123    void delete_page();
     
    140140    uint8_t *scan_line(int16_t y)
    141141    {
    142         return data + y * w;
     142        return data + y * size.x;
    143143    }
    144144    uint8_t *next_line(int16_t lasty, uint8_t *last_scan)
    145145    {
    146         return last_scan + w;
     146        return last_scan + size.x;
    147147    }
    148148    int32_t total_pixels(uint8_t background=0);
     
    150150    void clear(int16_t color = -1); // -1 is background color
    151151    void to_24bit(palette &pal);
    152     int16_t width()
    153     {
    154         return (int16_t)w;
    155     }
    156     int16_t height()
    157     {
    158         return (int16_t)h;
    159     }
    160     int16_t pitch()
    161     {
    162         return (int16_t)w; // FIXME: for now, pitch == width
    163     }
     152
     153    vec2i Size() const { return size; }
     154    int Pitch() const { return size.x; } // FIXME: for now, pitch == width
     155
    164156    void scroll(int16_t x1, int16_t y1, int16_t x2, int16_t y2,
    165157                int16_t xd, int16_t yd);
Note: See TracChangeset for help on using the changeset viewer.