summaryrefslogtreecommitdiff
path: root/apps/plugins/xworld
diff options
context:
space:
mode:
authorFranklin Wei <frankhwei536@gmail.com>2014-12-23 21:07:10 -0500
committerMichael Giacomelli <giac2000@hotmail.com>2014-12-24 03:12:03 +0100
commit37817268abbb23598be2781fcf01b0895d9f3003 (patch)
tree2f7704c8bc889e8a99fa738c89e809cf40f8bc97 /apps/plugins/xworld
parent1bc3964f96752f3567b681617bf87c5078c893f0 (diff)
downloadrockbox-37817268abbb23598be2781fcf01b0895d9f3003.zip
rockbox-37817268abbb23598be2781fcf01b0895d9f3003.tar.gz
rockbox-37817268abbb23598be2781fcf01b0895d9f3003.tar.bz2
rockbox-37817268abbb23598be2781fcf01b0895d9f3003.tar.xz
fix xworld building with 24-bit lcd
also fix a couple unused vars Change-Id: Ib05d2e22dd7477bc9bd193232bd3de8a0816beb2 Reviewed-on: http://gerrit.rockbox.org/1079 Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
Diffstat (limited to 'apps/plugins/xworld')
-rw-r--r--apps/plugins/xworld/sys.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/plugins/xworld/sys.c b/apps/plugins/xworld/sys.c
index 4bcdfaf..0af13ef 100644
--- a/apps/plugins/xworld/sys.c
+++ b/apps/plugins/xworld/sys.c
@@ -290,7 +290,6 @@ void sys_menu(struct System* sys)
sys->loaded = engine_loadGameState(sys->e, 0);
rb->lcd_update();
mainmenu_sysptr = sys;
- int sel = 0;
MENUITEM_STRINGLIST(menu, "XWorld Menu", mainmenu_cb,
"Resume Game", /* 0 */
"Start New Game", /* 1 */
@@ -307,8 +306,7 @@ void sys_menu(struct System* sys)
bool quit = false;
while(!quit)
{
- int item;
- switch(item = rb->do_menu(&menu, &sel, NULL, false))
+ switch(rb->do_menu(&menu, NULL, NULL, false))
{
case 0:
quit = true;
@@ -569,10 +567,17 @@ void sys_copyRect(struct System* sys, uint16_t x, uint16_t y, uint16_t w, uint16
#ifdef HAVE_LCD_COLOR
int r, g, b;
fb_data pix = rb->lcd_framebuffer[y * LCD_WIDTH + x];
+#if (LCD_DEPTH == 24)
+ r = pix.r;
+ g = pix.g;
+ b = pix.b;
+ rb->lcd_framebuffer[y * LCD_WIDTH + x] = (fb_data) { b, g, r };
+#else
r = RGB_UNPACK_RED (pix);
g = RGB_UNPACK_GREEN(pix);
b = RGB_UNPACK_BLUE (pix);
rb->lcd_framebuffer[y * LCD_WIDTH + x] = LCD_RGBPACK(0xff - r, 0xff - g, 0xff - b);
+#endif
#else
rb->lcd_framebuffer[y * LCD_WIDTH + x] = LCD_BRIGHTNESS(0xff - rb->lcd_framebuffer[y * LCD_WIDTH + x]);
#endif