| | |
| | | /* |
| | | Simple DirectMedia Layer |
| | | Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org> |
| | | Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> |
| | | |
| | | This software is provided 'as-is', without any express or implied |
| | | warranty. In no event will the authors be held liable for any damages |
| | |
| | | pixel = (Uint8 *)(shape->pixels) + (y*shape->pitch) + (x*shape->format->BytesPerPixel); |
| | | switch(shape->format->BytesPerPixel) { |
| | | case(1): |
| | | pixel_value = *(Uint8*)pixel; |
| | | pixel_value = *pixel; |
| | | break; |
| | | case(2): |
| | | pixel_value = *(Uint16*)pixel; |
| | |
| | | pixel = (Uint8 *)(mask->pixels) + (y*mask->pitch) + (x*mask->format->BytesPerPixel); |
| | | switch(mask->format->BytesPerPixel) { |
| | | case(1): |
| | | pixel_value = *(Uint8*)pixel; |
| | | pixel_value = *pixel; |
| | | break; |
| | | case(2): |
| | | pixel_value = *(Uint16*)pixel; |