this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Made pixel upload alignment work as a calculation based on the pitch. This seems to fix the odd alignment issues that have appeared since forever.

+9 -7
+9 -7
src/renderer_GL_common.inl
··· 3074 3074 if(image->target != NULL && isCurrentTarget(renderer, image->target)) 3075 3075 renderer->impl->FlushBlitBuffer(renderer); 3076 3076 bindTexture(renderer, image); 3077 - alignment = 1; 3078 - if(newSurface->format->BytesPerPixel == 4) 3079 - alignment = 4; 3077 + alignment = 8; 3078 + while(newSurface->pitch % alignment) 3079 + alignment >>= 1; 3080 3080 glPixelStorei(GL_UNPACK_ALIGNMENT, alignment); 3081 3081 #ifdef SDL_GPU_USE_OPENGL 3082 3082 glPixelStorei(GL_UNPACK_ROW_LENGTH, (newSurface->pitch / newSurface->format->BytesPerPixel)); ··· 3163 3163 if(image->target != NULL && isCurrentTarget(renderer, image->target)) 3164 3164 renderer->impl->FlushBlitBuffer(renderer); 3165 3165 bindTexture(renderer, image); 3166 - alignment = 1; 3166 + alignment = 8; 3167 + while(bytes_per_row % alignment) 3168 + alignment >>= 1; 3167 3169 glPixelStorei(GL_UNPACK_ALIGNMENT, alignment); 3168 3170 #ifdef SDL_GPU_USE_OPENGL 3169 3171 glPixelStorei(GL_UNPACK_ROW_LENGTH, (bytes_per_row / image->bytes_per_pixel)); ··· 3303 3305 3304 3306 3305 3307 // Upload surface pixel data 3306 - alignment = 1; 3307 - if(newSurface->format->BytesPerPixel == 4) 3308 - alignment = 4; 3308 + alignment = 8; 3309 + while(newSurface->pitch % alignment) 3310 + alignment >>= 1; 3309 3311 glPixelStorei(GL_UNPACK_ALIGNMENT, alignment); 3310 3312 #ifdef SDL_GPU_USE_OPENGL 3311 3313 glPixelStorei(GL_UNPACK_ROW_LENGTH, (newSurface->pitch / newSurface->format->BytesPerPixel));