blob: 5043762104b30986056a807ddcccd2663f467a72 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
diff -Naur SDL-2.548.ori/src/SDLx/Surface.xs SDL-2.548/src/SDLx/Surface.xs
--- SDL-2.548.ori/src/SDLx/Surface.xs 2018-05-19 12:55:52.000000000 +0200
+++ SDL-2.548/src/SDLx/Surface.xs 2024-09-02 10:50:59.901033957 +0200
@@ -16,6 +16,14 @@
#include <SDL_gfxPrimitives.h>
#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;
|