mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
menu adjustments (L, R for range controls)
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@723 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
d1faa779b0
commit
4b973b8919
2 changed files with 9 additions and 5 deletions
|
@ -455,8 +455,9 @@ static void me_draw(const menu_entry *entries, int sel, void (*draw_more)(void))
|
|||
plat_video_menu_end();
|
||||
}
|
||||
|
||||
static int me_process(menu_entry *entry, int is_next)
|
||||
static int me_process(menu_entry *entry, int is_next, int is_lr)
|
||||
{
|
||||
int c;
|
||||
switch (entry->beh)
|
||||
{
|
||||
case MB_OPT_ONOFF:
|
||||
|
@ -465,7 +466,8 @@ static int me_process(menu_entry *entry, int is_next)
|
|||
return 1;
|
||||
case MB_OPT_RANGE:
|
||||
case MB_OPT_CUSTRANGE:
|
||||
*(int *)entry->var += is_next ? 1 : -1;
|
||||
c = is_lr ? 10 : 1;
|
||||
*(int *)entry->var += is_next ? c : -c;
|
||||
if (*(int *)entry->var < (int)entry->min)
|
||||
*(int *)entry->var = (int)entry->max;
|
||||
if (*(int *)entry->var > (int)entry->max)
|
||||
|
@ -524,8 +526,9 @@ static void me_loop(menu_entry *menu, int *menu_sel, void (*draw_more)(void))
|
|||
if ((inp & (PBTN_L|PBTN_R)) == (PBTN_L|PBTN_R))
|
||||
debug_menu_loop();
|
||||
|
||||
if (inp & (PBTN_LEFT|PBTN_RIGHT)) { /* multi choice */
|
||||
if (me_process(&menu[sel], (inp & PBTN_RIGHT) ? 1 : 0))
|
||||
if (inp & (PBTN_LEFT|PBTN_RIGHT|PBTN_L|PBTN_R)) { /* multi choice */
|
||||
if (me_process(&menu[sel], (inp & (PBTN_RIGHT|PBTN_R)) ? 1 : 0,
|
||||
inp & (PBTN_L|PBTN_R)))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifdef __GP2X_H__
|
||||
#ifdef __GP2X__
|
||||
|
||||
#include <time.h>
|
||||
#include "soc.h"
|
||||
|
@ -103,5 +103,6 @@ static const char *mgn_aopt_gamma(menu_id id, int *offs)
|
|||
#define MENU_GP2X_OPTIONS_GFX
|
||||
#define MENU_GP2X_OPTIONS_ADV
|
||||
#define mgn_opt_renderer NULL /* TODO */
|
||||
#define menu_main_plat_draw NULL
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue