This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#10283 - Simplify Xobox menu and fix a issue
Attached to Project:
Rockbox
Opened by Teruaki Kawashima (teru) - Saturday, 06 June 2009, 06:45 GMT+2
Last edited by Teruaki Kawashima (teru) - Sunday, 01 November 2009, 15:45 GMT+2
Opened by Teruaki Kawashima (teru) - Saturday, 06 June 2009, 06:45 GMT+2
Last edited by Teruaki Kawashima (teru) - Sunday, 01 November 2009, 15:45 GMT+2
|
Details*Use same menu for both in-game and not in game.
-"Restart Level" and "Start Game" are combined as "Start New Game". "Restart Level" sounds like to restart the level I stoped for me. but it starts game from level 1. -Show message "No game to resume" if "Resume Game" is selecetd while not in game. this is similar to chopper. *fix typo "Difficult" to "Difficulty". *Fix the following issue. pause game and enter menu. then resume game. the menu will stay shown untill game is unpaused. it is confusable. With this patch, redraw the board and show "Paused". another way to fix it would be to force unpausing. i.e. somthing like "pause = false;". or do not allow to enter menu while the game is pausing. I'm not sure which is the best. |
This task depends upon
Closed by Teruaki Kawashima (teru)
Sunday, 01 November 2009, 15:45 GMT+2
Reason for closing: Out of Date
Sunday, 01 November 2009, 15:45 GMT+2
Reason for closing: Out of Date
I think it would be make sense, that you can't enter the menu while the game is paused.
I wrote a patch, which fixes the typos and illogical entrys in the menu.
and i dont like something like
>if(ingame)
> MENUITEM_STRINGLIST(...)
>else
> MENUITEM_STRINGLIST(...)
another approach is using MAKE_MENU, MENUITEM_RETURNVALUE, and menu_callback function.
At least, the change in apps/menu.c won't affect existing code.
It only affects MT_RETURN_ID with menu_callback function. because if menu_callback is not set, current_subitems[n] is n.
And as far as i checked, MT_RETURN_ID is only used by MENUITEM_STRINGLIST and none of MENUITEM_STRINGLIST is used with callback.
I think it's almost ok for MENUITEM_STRINGLIST with menu_callback but I'm not sure.
Could you write the warnings you got if you remember? i haven't got any warning while compiling.
/home/johannes/Rockbox/rockbox/apps/plugins/chopper.c: In function ‘chopMenuCb’:
/home/johannes/Rockbox/rockbox/apps/plugins/chopper.c:707: warning: comparison between pointer and integer"
/home/johannes/Rockbox/rockbox/apps/plugins/calendar.c: In function ‘edit_menu_cb’:
/home/johannes/Rockbox/rockbox/apps/plugins/calendar.c:630: warning: initialization makes integer from pointer without a cast
*apply same chage to solitaire.
*divide fix for xobox and simplifying menu.
apply the attached patch with the 2nd patch of previous comment.
For example in simplify_menus_by_using_stringlist_with_callback_b.5.patch :
- if (action == ACTION_REQUEST_MENUITEM && memos_in_shown_memory <= 0)
+ int i = (intptr_t)this_item;
+ if (action == ACTION_REQUEST_MENUITEM
+ && memos_in_shown_memory <= 0 && (i==0 || i==1))
You cast this_item (which is a pointer) to an integer (intptr_t) and compare it to 0 or 1.
What are you trying to do exactly ?
The commit r21523 contains other uses of intptr_t and I think they all are illegal here.
If you want to check if a pointer is not null, you should do if(pointer != NULL) or even if(!pointer) but not cast it to intptr_t.
In this context, i, 0, and 1 are indexes of the list of text.
I don't know the reason but index is passed as a pointer casted like "(void*)(intptr_t)i" in apps/menu.c at line around 192 if the menu is from MENUITEM_STRINGLIST.
I thought that maybe I can use this value to simplify menu and I need to cast this_item to an integer to compare.
The names you pass to MENUITEM_STRINGLIST don't have an address anyway as they're literal constants (so it can't actually be a pointer). Hence their ID is used. In this case, casting to int_ptr seems weird but correct.