Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/SDLx/Surface.xs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
#include <SDL_gfxPrimitives.h>
#endif

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 */
Expand Down Expand Up @@ -52,14 +60,6 @@ SV * construct_p_matrix ( SDL_Surface *surface )
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;
Expand Down