As awesome as the project was, there was a teeny tiny bug while testing the some basic zoom x-axis and y-axis functionality.
| Zoom Table | |
|---|---|
| zoomX | zoomY |
| 1 | 1 |
| -1 | 1 |
| 1 | -1 |
| -1 | -1 |
It was when zoomY is negative, SDL_gfx crashed.
Looking it through the debugger, it stopped at:
SDL_gfx-2.0.20 :: SDL_rotozoom.c :: line 230
The line:
if (flipy) csp += (src->pitch*(src->h-1));
needed to be changed to:
if (flipy) csp += ((src->pitch/sizeof(tColorRGBA))*(src->h-1));
The negative y zoom calculations were using the sizeof( struct tColorRGBA ) offsets instead of basic address offsets -- i.e. (char*).
The bug fix was submitted to project maintainer Andreas Schiffler.