--- a/src/SDLx/Surface.xs +++ b/src/SDLx/Surface.xs @@ -16,6 +16,14 @@ #include #endif +static int _calc_offset ( SDL_Surface* surface, int x, int y ) +{ + int offset; + offset = (surface->pitch * y) / surface->format->BytesPerPixel; + offset += x; + return offset; +} + SV * get_pixel32 (SDL_Surface *surface, int x, int y) { /* Convert the pixels to 32 bit */ @@ -52,14 +60,6 @@ return newRV_noinc((SV *)matrix); } -int _calc_offset ( SDL_Surface* surface, int x, int y ) -{ - int offset; - offset = (surface->pitch * y) / surface->format->BytesPerPixel; - offset += x; - return offset; -} - unsigned int _get_pixel(SDL_Surface * surface, int offset) { unsigned int value;