+ if (dx > 0)
+ {
+ unsigned char *source = data;
+ for (int y = 0; y < m_buffer.GetHeight(); y++)
+ {
+ unsigned char *dest = source + dx*3;
+ memmove( dest, source, (m_buffer.GetWidth()-dx) * 3 );
+ source += m_buffer.GetWidth()*3;
+ }
+
+ // We update the new buffer area, but there is no need to
+ // blit (last param FALSE) since the ensuing paint event will
+ // do that anyway.
+ Update( m_bufferX, m_bufferY, dx, m_buffer.GetHeight(), FALSE );
+ }
+ else
+ {
+ unsigned char *dest = data;
+ for (int y = 0; y < m_buffer.GetHeight(); y++)
+ {
+ unsigned char *source = dest - dx*3;
+ memmove( dest, source, (m_buffer.GetWidth()+dx) * 3 );
+ dest += m_buffer.GetWidth()*3;
+ }
+
+ // We update the new buffer area, but there is no need to
+ // blit (last param FALSE) since the ensuing paint event will
+ // do that anyway.
+ Update( m_bufferX+m_buffer.GetWidth()+dx, m_bufferY, -dx, m_buffer.GetHeight(), FALSE );
+ }