Skip to content

Commit 5ff45e1

Browse files
committed
ANDROID: Fix POINT returning transposed red + blue
1 parent 5dcd012 commit 5ff45e1

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

ChangeLog

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
2019-14-23 (0.12.15)
1+
2019-02-26 (0.12.15)
2+
ANDROID: Fix POINT returning transposed red + blue
3+
4+
2019-02-14 (0.12.15)
25
ANDROID: fix crash entering c,v in edit control mode
36

4-
2019-14-02 (0.12.15)
7+
2019-02-14 (0.12.15)
58
ANDROID: fix crash passing negative duration to SOUND command
69

7-
2019-11-02 (0.12.15)
10+
2019-02-11 (0.12.15)
811
UI: ALT+F4 from edit/run now returns to edit
912
UI: avoid flicker from with ALT+F4 -e edit startup
1013

src/ui/graphics.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,17 @@ void Graphics::drawRGB(const MAPoint2d *dstPoint, const void *src,
297297
dX < _drawTarget->w()) {
298298
// get RGBA components
299299
uint8_t r,g,b,a;
300+
#if defined(PIXELFORMAT_RGBA8888)
301+
b = image[4 * y * w + 4 * x + 0]; // blue
302+
g = image[4 * y * w + 4 * x + 1]; // green
303+
r = image[4 * y * w + 4 * x + 2]; // red
304+
a = image[4 * y * w + 4 * x + 3]; // alpha
305+
#else
300306
r = image[4 * y * w + 4 * x + 0]; // red
301307
g = image[4 * y * w + 4 * x + 1]; // green
302308
b = image[4 * y * w + 4 * x + 2]; // blue
303309
a = image[4 * y * w + 4 * x + 3]; // alpha
304-
310+
#endif
305311
uint8_t dR, dG, dB;
306312
GET_RGB(line[dX], dR, dG, dB);
307313
if (opacity > 0 && opacity < 100 && a > 64) {

src/ui/rgb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ inline void GET_ARGB(pixel_t c, uint8_t &a, uint8_t &r, uint8_t &g, uint8_t &b)
4545
#define SET_RGB(r, g, b) ((0xff000000) | (r << 16) | (g << 8) | (b))
4646
#define SET_ARGB(a, r, g, b) (a << 24 | (r << 16) | (g << 8) | (b))
4747
#define GET_RGB RGB888_to_RGB
48-
#define GET_RGB2 RGB888_to_RGB
48+
#define GET_RGB2 RGB888_BE_to_RGB
4949
#define GET_FROM_RGB888 RGB888_to_RGBA8888
5050
#else
5151
#define SET_RGB(r, g, b) ((r << 16) | (g << 8) | (b))

0 commit comments

Comments
 (0)