Skip to content

Commit

Permalink
Merge pull request PerlGameDev#299 from ryandesign/patch-1
Browse files Browse the repository at this point in the history
Fix implicit declaration of _calc_offset
  • Loading branch information
dod38fr authored Jun 9, 2023
2 parents 0f2af3b + 90d7056 commit 3a84fb7
Showing 1 changed file with 8 additions and 8 deletions.
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

0 comments on commit 3a84fb7

Please sign in to comment.