diff --git a/src/image.c b/src/image.c index fb169d29..59b7af36 100644 --- a/src/image.c +++ b/src/image.c @@ -31,6 +31,7 @@ #include #include +#include "checkpoint.h" #include "sao.h" /** @@ -703,6 +704,25 @@ void pixels_blit(const pixel * const orig, pixel * const dst, assert(width <= orig_stride); assert(width <= dst_stride); +#ifdef CHECKPOINTS + for (y = 0; y < height; ++y) { + char buffer[3*width]; + int p; + for (p = 0; p < width; ++p) { + sprintf((buffer + 3*p), "%02X ", orig[y*orig_stride]); + } + buffer[3*width] = 0; + CHECKPOINT("pixels_blit: %04d: %s", y, buffer); + } +#endif //CHECKPOINTS + + if (orig == dst) { + //If we have the same array, then we should have the same stride + assert(orig_stride == dst_stride); + return; + } + assert(orig != dst || orig_stride == dst_stride); + for (y = 0; y < height; ++y) { memcpy(&dst[y*dst_stride], &orig[y*orig_stride], width * sizeof(pixel)); }