From: notaz Date: Sat, 25 Aug 2007 10:59:00 +0000 (+0000) Subject: some skin adjustments X-Git-Tag: v1.85~690 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4f0cc8647c019f149541df380a2d30e14aeb75c;p=picodrive.git some skin adjustments git-svn-id: file:///home/notaz/opt/svn/PicoDrive@226 be3aeb3a-fb24-0410-a615-afba39da0efa --- diff --git a/platform/gp2x/Makefile b/platform/gp2x/Makefile index e9ffd46c..49e13871 100644 --- a/platform/gp2x/Makefile +++ b/platform/gp2x/Makefile @@ -212,7 +212,7 @@ endif rel: PicoDrive.gpe code940/pico940.bin ../readme.txt config.txt PicoDrive.man.txt PicoDrive.png zip -9 -j ../../PicoDrive_$(VER).zip $^ mmuhack.o - zip -9 PicoDrive_$(VER).zip skin + zip -9 -r ../../PicoDrive_$(VER).zip skin -i \*.png -i \*.txt code940/code940.bin: make -C code940/ diff --git a/platform/gp2x/menu.c b/platform/gp2x/menu.c index b45b295d..71ddf688 100644 --- a/platform/gp2x/menu.c +++ b/platform/gp2x/menu.c @@ -45,7 +45,7 @@ static int menu_sel_color = -1; // disabled char menuErrorMsg[40] = {0, }; -static void menu_darken_bg(void *dst, int pixels); +static void menu_darken_bg(void *dst, int pixels, int darker); static void menu_prepare_bg(int use_game_bg); // draws text to current bbp16 screen @@ -562,14 +562,13 @@ static void draw_dirlist(char *curdir, struct dirent **namelist, int n, int sel) start = 12 - sel; n--; // exclude current dir (".") - if (rom_data) - gp2x_pd_clone_buffer2(); - else { - memset(gp2x_screen, 0, 320*240*2); - memset((char *)gp2x_screen + 320*120*2, 0xff, 320*8*2); + gp2x_pd_clone_buffer2(); + + if (rom_data == NULL) { + menu_darken_bg(gp2x_screen, 320*240, 0); } - menu_darken_bg((char *)gp2x_screen + 320*120*2, 320*8); + menu_darken_bg((char *)gp2x_screen + 320*120*2, 320*8, 0); if(start - 2 >= 0) smalltext_out16_lim(14, (start - 2)*10, curdir, 0xffff, 53-2); @@ -1754,7 +1753,7 @@ static void draw_menu_credits(void) text_out16(tl_x, (y+=10), "Dzz: ARM940 sample"); text_out16(tl_x, (y+=10), "GnoStiC / Puck2099: USB joystick"); text_out16(tl_x, (y+=10), "craigix: GP2X hardware"); - text_out16(tl_x, (y+=10), "ketch: skin design"); + text_out16(tl_x, (y+=10), "ketchupgun: skin design"); menu_flip(); } @@ -1918,15 +1917,25 @@ static void menu_loop_root(void) } } -static void menu_darken_bg(void *dst, int pixels) +static void menu_darken_bg(void *dst, int pixels, int darker) { unsigned int *screen = dst; pixels /= 2; - while (pixels--) + if (darker) { - unsigned int p = *screen; - *screen = ((p&0xf79ef79e)>>1) - ((p&0xc618c618)>>3); - screen++; + while (pixels--) + { + unsigned int p = *screen; + *screen++ = ((p&0xf79ef79e)>>1) - ((p&0xc618c618)>>3); + } + } + else + { + while (pixels--) + { + unsigned int p = *screen; + *screen++ = (p&0xf79ef79e)>>1; + } } } @@ -1936,7 +1945,7 @@ static void menu_prepare_bg(int use_game_bg) { // darken the active framebuffer memset(gp2x_screen, 0, 320*8*2); - menu_darken_bg((char *)gp2x_screen + 320*8*2, 320*224); + menu_darken_bg((char *)gp2x_screen + 320*8*2, 320*224, 1); memset((char *)gp2x_screen + 320*232*2, 0, 320*8*2); } else diff --git a/skin/background.png b/platform/gp2x/skin/background.png similarity index 100% rename from skin/background.png rename to platform/gp2x/skin/background.png diff --git a/skin/font.png b/platform/gp2x/skin/font.png similarity index 100% rename from skin/font.png rename to platform/gp2x/skin/font.png diff --git a/platform/gp2x/skin/readme.txt b/platform/gp2x/skin/readme.txt new file mode 100644 index 00000000..dd839639 --- /dev/null +++ b/platform/gp2x/skin/readme.txt @@ -0,0 +1,8 @@ +The skin images can be customized, but there are several limitations: + +background.png - must be 320x240 image with 24bit RGB colors. +font.png - must be 128x160 8bit grayscale image. +selector.png - must be 8x10 8bit grayscale image. + +Font and selector colors can be changed by editing skin.txt. + diff --git a/skin/selector.png b/platform/gp2x/skin/selector.png similarity index 100% rename from skin/selector.png rename to platform/gp2x/skin/selector.png diff --git a/skin/skin.txt b/platform/gp2x/skin/skin.txt similarity index 96% rename from skin/skin.txt rename to platform/gp2x/skin/skin.txt index 1d67ceeb..c2baeb22 100644 --- a/skin/skin.txt +++ b/platform/gp2x/skin/skin.txt @@ -1,4 +1,4 @@ -// html-style hex color codes, ex. ff0000 is red, 0000ff is blue, etc. -text_color=ffffff -selection_color=c00000 - +// html-style hex color codes, ex. ff0000 is red, 0000ff is blue, etc. +text_color=ffffff +selection_color=c00000 + diff --git a/platform/readme.txt b/platform/readme.txt index 4f4df8a6..c91e4bda 100644 --- a/platform/readme.txt +++ b/platform/readme.txt @@ -209,8 +209,11 @@ GP2X: * Dzz for his ARM940 sample code. * GnoStiC & Puck2099 for USB joystick support. * Hermes PS2R, god_at_hell for the CpuCtrl library. +* A_SN for his gamma code. * craigix for supplying the GP2X hardware and making this port possible. * Alex for the icon. +* ketchupgun for the skin. +* All the people from gp32x boards for their support. Symbian: * Peter van Sebille for his various open-source Symbian projects to learn from. @@ -244,7 +247,7 @@ Changelog * Changed key configuration behaviour to the one from gpfce (should be more intuitive). + Added some skinning capabilities to the menu system with default skin by - ketch. Delete skin directory if you want old behaviour. + ketchupgun. Delete skin directory if you want old behaviour. 1.32 + Added some new scaling options.