summaryrefslogtreecommitdiffstats
path: root/minuitwrp
diff options
context:
space:
mode:
authorHashcode <hashcode0f@gmail.com>2013-07-03 20:19:17 +0200
committerHashcode <hashcode0f@gmail.com>2013-07-03 20:19:17 +0200
commit232b9fd7ed5d65f94fff22130dbd81dbb98dcae4 (patch)
tree06a7f610a041176f9a84958592c2b8325a80d351 /minuitwrp
parentAdd additional build variable checks to Android.mk files (diff)
downloadandroid_bootable_recovery-232b9fd7ed5d65f94fff22130dbd81dbb98dcae4.tar
android_bootable_recovery-232b9fd7ed5d65f94fff22130dbd81dbb98dcae4.tar.gz
android_bootable_recovery-232b9fd7ed5d65f94fff22130dbd81dbb98dcae4.tar.bz2
android_bootable_recovery-232b9fd7ed5d65f94fff22130dbd81dbb98dcae4.tar.lz
android_bootable_recovery-232b9fd7ed5d65f94fff22130dbd81dbb98dcae4.tar.xz
android_bootable_recovery-232b9fd7ed5d65f94fff22130dbd81dbb98dcae4.tar.zst
android_bootable_recovery-232b9fd7ed5d65f94fff22130dbd81dbb98dcae4.zip
Diffstat (limited to 'minuitwrp')
-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