notaz.gp2x.de
/
libpicofe.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
21082d0
)
add a pitch variable
author
notaz
<notasas@gmail.com>
Sat, 5 Apr 2014 19:02:55 +0000
(22:02 +0300)
committer
notaz
<notasas@gmail.com>
Sun, 24 Dec 2017 13:42:20 +0000
(15:42 +0200)
menu.c
patch
|
blob
|
blame
|
history
menu.h
patch
|
blob
|
blame
|
history
diff --git
a/menu.c
b/menu.c
index
c145f26
..
bf5c864
100644
(file)
--- a/
menu.c
+++ b/
menu.c
@@
-33,6
+33,7
@@
void *g_menubg_ptr;
\r
int g_menuscreen_w;
\r
int g_menuscreen_h;
\r
\r
int g_menuscreen_w;
\r
int g_menuscreen_h;
\r
+int g_menuscreen_pp;
\r
\r
int g_autostateld_opt;
\r
\r
\r
int g_autostateld_opt;
\r
\r
@@
-53,11
+54,17
@@
static int g_menu_filter_off;
static int g_border_style;
\r
static int border_left, border_right, border_top, border_bottom;
\r
\r
static int g_border_style;
\r
static int border_left, border_right, border_top, border_bottom;
\r
\r
+void menuscreen_memset_lines(unsigned short *dst, int c, int l)
\r
+{
\r
+ for (; l > 0; l--, dst += g_menuscreen_pp)
\r
+ memset(dst, c, g_menuscreen_w * 2);
\r
+}
\r
+
\r
// draws text to current bbp16 screen
\r
static void text_out16_(int x, int y, const char *text, int color)
\r
{
\r
int i, lh, tr, tg, tb, len;
\r
// draws text to current bbp16 screen
\r
static void text_out16_(int x, int y, const char *text, int color)
\r
{
\r
int i, lh, tr, tg, tb, len;
\r
- unsigned short *dest = (unsigned short *)g_menuscreen_ptr + x + y * g_menuscreen_
w
;
\r
+ unsigned short *dest = (unsigned short *)g_menuscreen_ptr + x + y * g_menuscreen_
pp
;
\r
tr = (color & 0xf800) >> 8;
\r
tg = (color & 0x07e0) >> 3;
\r
tb = (color & 0x001f) << 3;
\r
tr = (color & 0xf800) >> 8;
\r
tg = (color & 0x07e0) >> 3;
\r
tb = (color & 0x001f) << 3;
\r
@@
-86,7
+93,7
@@
static void text_out16_(int x, int y, const char *text, int color)
unsigned short *dst = dest;
\r
int u, l;
\r
\r
unsigned short *dst = dest;
\r
int u, l;
\r
\r
- for (l = 0; l < lh; l++, dst += g_menuscreen_
w
- me_mfont_w)
\r
+ for (l = 0; l < lh; l++, dst += g_menuscreen_
pp
- me_mfont_w)
\r
{
\r
for (u = me_mfont_w / 2; u > 0; u--, src++)
\r
{
\r
{
\r
for (u = me_mfont_w / 2; u > 0; u--, src++)
\r
{
\r
@@
-159,7
+166,7
@@
static void smalltext_out16_(int x, int y, const char *texto, int color)
break;
\r
\r
src = fontdata6x8[c];
\r
break;
\r
\r
src = fontdata6x8[c];
\r
- dst = (unsigned short *)g_menuscreen_ptr + x + y * g_menuscreen_
w
;
\r
+ dst = (unsigned short *)g_menuscreen_ptr + x + y * g_menuscreen_
pp
;
\r
\r
while (h--)
\r
{
\r
\r
while (h--)
\r
{
\r
@@
-174,7
+181,7
@@
static void smalltext_out16_(int x, int y, const char *texto, int color)
dst += multiplier;
\r
}
\r
\r
dst += multiplier;
\r
}
\r
\r
- dst += g_menuscreen_
w
- me_sfont_w;
\r
+ dst += g_menuscreen_
pp
- me_sfont_w;
\r
}
\r
src++;
\r
}
\r
}
\r
src++;
\r
}
\r
@@
-207,13
+214,13
@@
static void menu_draw_selection(int x, int y, int w)
if (menu_sel_color < 0) return; // no selection hilight
\r
\r
if (y > 0) y--;
\r
if (menu_sel_color < 0) return; // no selection hilight
\r
\r
if (y > 0) y--;
\r
- dest = (unsigned short *)g_menuscreen_ptr + x + y * g_menuscreen_
w
+ me_mfont_w * 2 - 2;
\r
+ dest = (unsigned short *)g_menuscreen_ptr + x + y * g_menuscreen_
pp
+ me_mfont_w * 2 - 2;
\r
for (h = me_mfont_h + 1; h > 0; h--)
\r
{
\r
dst = dest;
\r
for (i = w - (me_mfont_w * 2 - 2); i > 0; i--)
\r
*dst++ = menu_sel_color;
\r
for (h = me_mfont_h + 1; h > 0; h--)
\r
{
\r
dst = dest;
\r
for (i = w - (me_mfont_w * 2 - 2); i > 0; i--)
\r
*dst++ = menu_sel_color;
\r
- dest += g_menuscreen_
w
;
\r
+ dest += g_menuscreen_
pp
;
\r
}
\r
}
\r
\r
}
\r
}
\r
\r
@@
-381,10
+388,10
@@
static void menu_darken_text_bg(void)
ymax = g_menuscreen_h - 1;
\r
\r
for (x = xmin; x <= xmax; x++)
\r
ymax = g_menuscreen_h - 1;
\r
\r
for (x = xmin; x <= xmax; x++)
\r
- screen[y * g_menuscreen_
w
+ x] = 0xa514;
\r
+ screen[y * g_menuscreen_
pp
+ x] = 0xa514;
\r
for (y++; y < ymax; y++)
\r
{
\r
for (y++; y < ymax; y++)
\r
{
\r
- ls = y * g_menuscreen_
w
;
\r
+ ls = y * g_menuscreen_
pp
;
\r
screen[ls + xmin] = 0xffff;
\r
for (x = xmin + 1; x < xmax; x++)
\r
{
\r
screen[ls + xmin] = 0xffff;
\r
for (x = xmin + 1; x < xmax; x++)
\r
{
\r
@@
-394,7
+401,7
@@
static void menu_darken_text_bg(void)
}
\r
screen[ls + xmax] = 0xffff;
\r
}
\r
}
\r
screen[ls + xmax] = 0xffff;
\r
}
\r
- ls = y * g_menuscreen_
w
;
\r
+ ls = y * g_menuscreen_
pp
;
\r
for (x = xmin; x <= xmax; x++)
\r
screen[ls + x] = 0xffff;
\r
}
\r
for (x = xmin; x <= xmax; x++)
\r
screen[ls + x] = 0xffff;
\r
}
\r
@@
-411,6
+418,8
@@
static void menu_reset_borders(void)
\r
static void menu_draw_begin(int need_bg, int no_borders)
\r
{
\r
\r
static void menu_draw_begin(int need_bg, int no_borders)
\r
{
\r
+ int y;
\r
+
\r
plat_video_menu_begin();
\r
\r
menu_reset_borders();
\r
plat_video_menu_begin();
\r
\r
menu_reset_borders();
\r
@@
-418,12
+427,14
@@
static void menu_draw_begin(int need_bg, int no_borders)
\r
if (need_bg) {
\r
if (g_border_style && no_borders) {
\r
\r
if (need_bg) {
\r
if (g_border_style && no_borders) {
\r
- menu_darken_bg(g_menuscreen_ptr, g_menubg_ptr,
\r
- g_menuscreen_w * g_menuscreen_h, 1);
\r
+ for (y = 0; y < g_menuscreen_h; y++)
\r
+ menu_darken_bg((short *)g_menuscreen_ptr + g_menuscreen_pp * y,
\r
+ g_menubg_ptr + g_menuscreen_w * y, g_menuscreen_w, 1);
\r
}
\r
else {
\r
}
\r
else {
\r
- memcpy(g_menuscreen_ptr, g_menubg_ptr,
\r
- g_menuscreen_w * g_menuscreen_h * 2);
\r
+ for (y = 0; y < g_menuscreen_h; y++)
\r
+ memcpy((short *)g_menuscreen_ptr + g_menuscreen_pp * y,
\r
+ g_menubg_ptr + g_menuscreen_w * y, g_menuscreen_w * 2);
\r
}
\r
}
\r
}
\r
}
\r
}
\r
}
\r
@@
-871,8
+882,8
@@
static void draw_dirlist(char *curdir, struct dirent **namelist,
// if (!rom_loaded)
\r
// menu_darken_bg(gp2x_screen, 320*240, 0);
\r
\r
// if (!rom_loaded)
\r
// menu_darken_bg(gp2x_screen, 320*240, 0);
\r
\r
- darken_ptr = (short *)g_menuscreen_ptr + g_menuscreen_
w
* max_cnt/2 * me_sfont_h;
\r
- menu_darken_bg(darken_ptr, darken_ptr, g_menuscreen_
w
* me_sfont_h * 8 / 10, 0);
\r
+ darken_ptr = (short *)g_menuscreen_ptr + g_menuscreen_
pp
* max_cnt/2 * me_sfont_h;
\r
+ menu_darken_bg(darken_ptr, darken_ptr, g_menuscreen_
pp
* me_sfont_h * 8 / 10, 0);
\r
\r
x = 5 + me_mfont_w + 1;
\r
if (start - 2 >= 0)
\r
\r
x = 5 + me_mfont_w + 1;
\r
if (start - 2 >= 0)
\r
@@
-893,9
+904,9
@@
static void draw_dirlist(char *curdir, struct dirent **namelist,
\r
if (show_help) {
\r
darken_ptr = (short *)g_menuscreen_ptr
\r
\r
if (show_help) {
\r
darken_ptr = (short *)g_menuscreen_ptr
\r
- + g_menuscreen_
w
* (g_menuscreen_h - me_sfont_h * 5 / 2);
\r
+ + g_menuscreen_
pp
* (g_menuscreen_h - me_sfont_h * 5 / 2);
\r
menu_darken_bg(darken_ptr, darken_ptr,
\r
menu_darken_bg(darken_ptr, darken_ptr,
\r
- g_menuscreen_
w
* (me_sfont_h * 5 / 2), 1);
\r
+ g_menuscreen_
pp
* (me_sfont_h * 5 / 2), 1);
\r
\r
snprintf(buff, sizeof(buff), "%s - select, %s - back",
\r
in_get_key_name(-1, -PBTN_MOK), in_get_key_name(-1, -PBTN_MBACK));
\r
\r
snprintf(buff, sizeof(buff), "%s - select, %s - back",
\r
in_get_key_name(-1, -PBTN_MOK), in_get_key_name(-1, -PBTN_MBACK));
\r
diff --git
a/menu.h
b/menu.h
index
4dfe130
..
2597ab0
100644
(file)
--- a/
menu.h
+++ b/
menu.h
@@
-117,6
+117,7
@@
extern void *g_menubg_ptr;
extern void *g_menuscreen_ptr;
extern int g_menuscreen_w;
extern int g_menuscreen_h;
extern void *g_menuscreen_ptr;
extern int g_menuscreen_w;
extern int g_menuscreen_h;
+extern int g_menuscreen_pp; // pitch (in pixels)
extern int g_autostateld_opt;
extern int g_autostateld_opt;