w += correction;
}
- // Compute a pointer to the corresponding element of m_changeFlags.
- // FIXME: Provide an inline function for that?
- bool *pChangeFlags = &m_changeFlags[(y / 32) * m_widthTiles + (x / 32)];
-
// Read a row from the screen. Note that getFullRow() may be more
// efficient than getRow() which is more general.
// FIXME: Move the logic to getRow()?
getRow(x, y, w);
}
- // Compute pointers to images to be compared.
+ // Compute a pointer to the initial element of m_changeFlags.
+ bool *pChangeFlags = &m_changeFlags[getTileIndex(x, y)];
+
+ // Compute pointers to image data to be compared.
char *ptr_old = m_image->locatePixel(x, y);
char *ptr_new = m_rowImage->xim->data;
m_offsetLeft + x, m_offsetTop + y, 1, h);
}
+ inline int getTileIndex(int x, int y) {
+ int tile_x = x / 32;
+ int tile_y = y / 32;
+ return tile_y * m_widthTiles + tile_x;
+ }
+
int checkRow(int x, int y, int w);
int checkColumn(int x, int y, int h, bool *pChangeFlags);
int sendChanges();