Added
Link Here
|
1 |
--- sdlscreen.c.orig 2023-04-11 14:41:38 UTC |
2 |
+++ sdlscreen.c |
3 |
@@ -373,17 +373,11 @@ byte * Surface_to_bytefield(SDL_Surface *source, byte |
4 |
byte *src; |
5 |
byte *dest_ptr; |
6 |
int y; |
7 |
- int remainder; |
8 |
|
9 |
// Support seulement des images 256 couleurs |
10 |
if (source->format->BytesPerPixel != 1) |
11 |
return NULL; |
12 |
|
13 |
- if (source->w & 3) |
14 |
- remainder=4-(source->w&3); |
15 |
- else |
16 |
- remainder=0; |
17 |
- |
18 |
if (dest==NULL) |
19 |
dest=(byte *)malloc(source->w*source->h); |
20 |
|
21 |
@@ -393,7 +387,7 @@ byte * Surface_to_bytefield(SDL_Surface *source, byte |
22 |
{ |
23 |
memcpy(dest_ptr, src,source->w); |
24 |
dest_ptr += source->w; |
25 |
- src += source->w + remainder; |
26 |
+ src += source->pitch; |
27 |
} |
28 |
return dest; |
29 |
|