Ignore:
Timestamp:
May 16, 2011, 2:37:27 AM (11 years ago)
Author:
Sam Hocevar
Message:

imlib: started refactoring the dirty rectangle system.

File:
1 edited

Legend:

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

    r667 r670  
    2525{
    2626public :
    27     int16_t dx1, dy1, dx2, dy2;
    28     dirty_rect(int16_t x1, int16_t y1, int16_t x2, int16_t y2)
     27    dirty_rect(vec2i aa, vec2i bb)
    2928    {
    30         dx1 = x1; dy1 = y1; dx2 = x2; dy2 = y2;
    31         if (x2 < x1 || y2 < y1)
     29        m_aa = aa;
     30        m_bb = bb;
     31        if (!(bb >= aa))
    3232            printf("add incorrect dirty\n");
    3333    }
    34     virtual int compare(void *n1) { return ((dirty_rect *)n1)->dy1 > dy1; }
     34    virtual int compare(void *n1)
     35    {
     36        return ((dirty_rect *)n1)->m_aa.y > m_aa.y;
     37    }
     38
     39    vec2i m_aa, m_bb;
    3540};
    3641
    3742class image_descriptor
    3843{
    39 private:
    40     vec2i m_size, m_aa, m_bb;
    41 
    4244public:
    4345    uint8_t keep_dirt,
     
    7880    }
    7981    void ReduceDirties();
    80     void AddDirty(int x1, int y1, int x2, int y2);
    81     void delete_dirty(int x1, int y1, int x2, int y2);
     82    void AddDirty(vec2i aa, vec2i bb);
     83    void DeleteDirty(vec2i aa, vec2i bb);
    8284    void Resize(vec2i size)
    8385    {
     
    8688        m_bb = size;
    8789    }
     90
     91private:
     92    vec2i m_size, m_aa, m_bb;
    8893};
    8994
     
    150155    }
    151156
    152     void AddDirty(int x1, int y1, int x2, int y2)
     157    void AddDirty(vec2i aa, vec2i bb)
    153158    {
    154         if (m_special) m_special->AddDirty(x1, y1, x2, y2);
     159        if (m_special) m_special->AddDirty(aa, bb);
    155160    }
    156     void delete_dirty(int x1, int y1, int x2, int y2)
     161    void DeleteDirty(vec2i aa, vec2i bb)
    157162    {
    158         if(m_special) m_special->delete_dirty(x1, y1, x2, y2);
     163        if(m_special) m_special->DeleteDirty(aa, bb);
    159164    }
    160165    void ClearDirties()
Note: See TracChangeset for help on using the changeset viewer.