From 00904e8e2386eb0d044f47398c81839b0e448696 Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop <dudesuchamazing@gmail.com> Date: Tue, 24 Oct 2023 06:58:46 +0300 Subject: [PATCH] Set UNPACK_ALIGNMENT properly for RGB bitmaps, --- common/gal/opengl/opengl_gal.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 4ce077cadf..19702c1b00 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -185,6 +185,8 @@ GLuint GL_BITMAP_CACHE::cacheBitmap( const BITMAP_BASE* aBitmap ) m_freedTextureIds.pop_front(); } + glPixelStorei( GL_UNPACK_ALIGNMENT, 1 ); + if( imgData.HasAlpha() || imgData.HasMask() ) { bmp.size = bmp.w * bmp.h * 4;