]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/bufferable.cpp
Use a member function to set the dirty flag in Bufferable
[libs/gl.git] / source / core / bufferable.cpp
index 374c4eeb3b83ee5d1617b9249383696a9f7aa15f..fcedc5becd666efb16ef780a73c4bc8fa24fe5c5 100644 (file)
@@ -50,7 +50,7 @@ void Bufferable::use_buffer(Buffer *buf, Bufferable *prev)
        }
 
        location_dirty = true;
-       dirty = true;
+       mark_dirty();
        update_offset();
 }
 
@@ -60,13 +60,13 @@ void Bufferable::change_buffer(Buffer *buf)
        {
                b->buffer = buf;
                b->location_dirty = true;
-               b->dirty = true;
+               b->mark_dirty();
        }
        for(Bufferable *b=prev_in_buffer; b; b=b->prev_in_buffer)
        {
                b->buffer = buf;
                b->location_dirty = true;
-               b->dirty = true;
+               b->mark_dirty();
        }
 }
 
@@ -105,7 +105,7 @@ void Bufferable::update_offset()
        {
                offset = new_offset;
                location_dirty = true;
-               dirty = true;
+               mark_dirty();
        }
 
        if(next_in_buffer)
@@ -113,10 +113,15 @@ void Bufferable::update_offset()
        else if(buffer && offset+get_data_size()>buffer->get_size())
        {
                location_dirty = true;
-               dirty = true;
+               mark_dirty();
        }
 }
 
+void Bufferable::mark_dirty()
+{
+       dirty = true;
+}
+
 void Bufferable::upload_data(char *target) const
 {
        if(!buffer)