summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDees Troy <dees_troy@teamw.in>2013-08-24 14:41:42 +0200
committerGerrit Code Review <gerrit@198.50.184.117>2013-08-24 14:41:42 +0200
commit511161112169f49514b24068854bebd2ac097ae2 (patch)
tree94ec503e9f4cca5eec4a69abad22ef81108beff9
parentRemove graphics.c from libguitwrp (diff)
parentgraphics: update BOARD_HAS_FLIPPED_SCREEN function to work with 16bpp or 32bpp (diff)
downloadandroid_bootable_recovery-511161112169f49514b24068854bebd2ac097ae2.tar
android_bootable_recovery-511161112169f49514b24068854bebd2ac097ae2.tar.gz
android_bootable_recovery-511161112169f49514b24068854bebd2ac097ae2.tar.bz2
android_bootable_recovery-511161112169f49514b24068854bebd2ac097ae2.tar.lz
android_bootable_recovery-511161112169f49514b24068854bebd2ac097ae2.tar.xz
android_bootable_recovery-511161112169f49514b24068854bebd2ac097ae2.tar.zst
android_bootable_recovery-511161112169f49514b24068854bebd2ac097ae2.zip
-rw-r--r--minuitwrp/graphics.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/minuitwrp/graphics.c b/minuitwrp/graphics.c
index 627e34392..fc34b6b19 100644
--- a/minuitwrp/graphics.c
+++ b/minuitwrp/graphics.c
@@ -259,10 +259,14 @@ void gr_flip(void)
#ifdef BOARD_HAS_FLIPPED_SCREEN
/* flip buffer 180 degrees for devices with physicaly inverted screens */
unsigned int i;
- for (i = 1; i < (vi.xres * vi.yres); i++) {
- unsigned short tmp = gr_mem_surface.data[i];
- gr_mem_surface.data[i] = gr_mem_surface.data[(vi.xres * vi.yres * 2) - i];
- gr_mem_surface.data[(vi.xres * vi.yres * 2) - i] = tmp;
+ unsigned int j;
+ uint8_t tmp;
+ for (i = 0; i < ((vi.xres_virtual * vi.yres)/2); i++) {
+ for (j = 0; j < PIXEL_SIZE; j++) {
+ tmp = gr_mem_surface.data[i * PIXEL_SIZE + j];
+ gr_mem_surface.data[i * PIXEL_SIZE + j] = gr_mem_surface.data[(vi.xres_virtual * vi.yres * PIXEL_SIZE) - ((i+1) * PIXEL_SIZE) + j];
+ gr_mem_surface.data[(vi.xres_virtual * vi.yres * PIXEL_SIZE) - ((i+1) * PIXEL_SIZE) + j] = tmp;
+ }
}
#endif