GenesisPlus GX - UI and Ergonomic Modification July 29, 2012 09:25PM | Registered: 15 years ago Posts: 10 |
static void selector_cb(void) { int i; char text[MAXPATHLEN]; int yoffset = 102; //Starlord: 108 /* Initialize directory icon */ gui_image dir_icon; dir_icon.texture = gxTextureOpenPNG(Browser_dir_png,0); dir_icon.w = dir_icon.texture->width; dir_icon.h = dir_icon.texture->height; dir_icon.x = 26; dir_icon.y = (26 - dir_icon.h)/2; /* Initialize selection bar */ gui_image bar_over; bar_over.texture = gxTextureOpenPNG(Overlay_bar_png,0); bar_over.w = bar_over.texture->width + 1; //Starlord: extend the bar +1 bar_over.h = bar_over.texture->height; bar_over.x = 10; //Starlord: 16 bar_over.y = (26 - bar_over.h)/2; /* Draw browser array */ // Starlord: doesn't fit to new UI /* gxDrawRectangle(15, 108, 358, 26, 127, (GXColor)BG_COLOR_1); gxDrawRectangle(15, 134, 358, 26, 127, (GXColor)BG_COLOR_2); gxDrawRectangle(15, 160, 358, 26, 127, (GXColor)BG_COLOR_1); gxDrawRectangle(15, 186, 358, 26, 127, (GXColor)BG_COLOR_2); gxDrawRectangle(15, 212, 358, 26, 127, (GXColor)BG_COLOR_1); gxDrawRectangle(15, 238, 358, 26, 127, (GXColor)BG_COLOR_2); gxDrawRectangle(15, 264, 358, 26, 127, (GXColor)BG_COLOR_1); gxDrawRectangle(15, 290, 358, 26, 127, (GXColor)BG_COLOR_2); gxDrawRectangle(15, 316, 358, 26, 127, (GXColor)BG_COLOR_1); gxDrawRectangle(15, 342, 358, 26, 127, (GXColor)BG_COLOR_2); */ /* Draw Files list */ for (i = offset; (i < (offset + 10)) && (i < maxfiles); i++) { if (i == selection) { /* selection bar */ gxDrawTexture(bar_over.texture,bar_over.x,yoffset+bar_over.y,bar_over.w,bar_over.h,255); /* scrolling text */ if ((string_offset/SCROLL_SPEED) >= strlen(filelist.filename)) { string_offset = 0; } if (string_offset) { sprintf(text,"%s ",filelist.filename+string_offset/SCROLL_SPEED); strncat(text, filelist.filename, string_offset/SCROLL_SPEED); } else { strcpy(text, filelist.filename); } /* print text */ if (filelist.flags) { /* directory icon */ gxDrawTexture(dir_icon.texture,dir_icon.x,yoffset+dir_icon.y,dir_icon.w,dir_icon.h,255); //if (FONT_write(text,18,dir_icon.x+dir_icon.w+6,yoffset+22,bar_over.w-dir_icon.w-26,(GXColor)WHITE)) if (FONT_write(text,18,dir_icon.x+dir_icon.w+6,yoffset+22,bar_over.w-dir_icon.w-26,(GXColor)BLACK)) { /* text scrolling */ string_offset ++; } } else { // if (FONT_write(text,18,dir_icon.x,yoffset+22,bar_over.w-20,(GXColor)WHITE)) if (FONT_write(text,18,dir_icon.x,yoffset+22,bar_over.w-20,(GXColor)BLACK)) { /* text scrolling */ string_offset ++; } } } else { if (filelist.flags) { /* directory icon */ gxDrawTexture(dir_icon.texture,dir_icon.x,yoffset+dir_icon.y,dir_icon.w,dir_icon.h,255); //FONT_write(filelist.filename,18,dir_icon.x+dir_icon.w+6,yoffset+22,bar_over.w-dir_icon.w-26,(GXColor)WHITE); FONT_write(filelist.filename,18,dir_icon.x+dir_icon.w+6,yoffset+22,bar_over.w-dir_icon.w-26,(GXColor)BLACK); } else { //FONT_write(filelist.filename,18,dir_icon.x,yoffset+22,bar_over.w-20,(GXColor)WHITE); FONT_write(filelist.filename,18,dir_icon.x,yoffset+22,bar_over.w-20,(GXColor)BLACK); } } yoffset += 26; } gxTextureClose(&bar_over.texture); gxTextureClose(&dir_icon.texture); }
Re: GenesisPlus GX - UI and Ergonomic Modification July 30, 2012 05:46PM | Registered: 15 years ago Posts: 276 |
Re: GenesisPlus GX - UI and Ergonomic Modification July 30, 2012 06:35PM | Registered: 15 years ago Posts: 10 |
Quote
ekeeke
The rule is actually very simple: what you render first appears at the bottom "layer" so you want to render the overlay bar before the vertical ladder on the right.
Anyway, if you ever get anything out of this mess and decide to release it, the only thing i would ask is that you don't bump the version number like you did in the past and clearly identify this as a "mod" of current version. I don't really understand this need for uniformizing everything or trashing original work already done (and actually think my GUI looks nicer and has much more originality/personality than the other "GX" ones) but I guess there is nothing I can do against users preferences, just that i would like to keep control on the official version for "real emulation" changes.
static gui_menu menu_selector = { "Game Selection", -1,-1, 0,0,15,0, NULL, NULL, bg_filesel, {NULL,NULL}, {&arrow_up,&arrow_down}, selector_cb };
Re: GenesisPlus GX - UI and Ergonomic Modification July 30, 2012 09:39PM | Registered: 15 years ago Posts: 276 |
It will still be a mod, not a separate version. The core will still be Genesis Plus GX and the name of the emulator should not be changed or advertised as a brand new emulator when it it's just packaging redesign.Quote
Paperman
I am going to rename the emulator and to do a separate version.
How is that "quicker" to browse previous directory by always have to go to the top of the ROM window to select the "previous directory" option ? It's actually faster and more natural to use A/B button to navigate through folders, especially since most of the time when you enter ROM directory, that's what you are going to do and rarely exit the browser without having loaded any ROM (?).The Z/HOME button is just a shortcut for this rarely used case and I think this is actually a better design this way. You can say that you are more used to other "gx" emulator's way of doing but saying they are more ergonomic is not true at all, I actually spent lot of time working on the GUI because of that.Quote
Really, I love your emulator extremely.
However concerning usability and user flow, the other ones are a little bit better.
I really like simple and quick flows.
Sometimes the ergonomic realization is not really consistent (from my point of view).
For example: In the whole UI it's possible to go to the previous screen with the B button.
But in the file selection you have to use the z trigger or the Home button.
These are small things, but it makes the emulator better (at least for me ^^).
Quote
Btw back to the problem:
That's what I already thought (FiFo Renedering).
Quote
However is it possible to insert the selection bar into the gui_menu declaration? For example as a button?static gui_menu menu_selector = { "Game Selection", -1,-1, 0,0,15,0, NULL, NULL, bg_filesel, {NULL,NULL}, {&arrow_up,&arrow_down}, selector_cb };
Re: GenesisPlus GX - UI and Ergonomic Modification July 31, 2012 12:24AM | Registered: 15 years ago Posts: 10 |
Quote
ekeeke
[
It will still be a mod, not a separate version. The core will still be Genesis Plus GX and the name of the emulator should not be changed or advertised as a brand new emulator when it it's just packaging redesign.
Quote
How is that "quicker" to browse previous directory by always have to go to the top of the ROM window to select the "previous directory" option ? It's actually faster and more natural to use A/B button to navigate through folders, especially since most of the time when you enter ROM directory, that's what you are going to do and rarely exit the browser without having loaded any ROM (?).The Z/HOME button is just a shortcut for this rarely used case and I think this is actually a better design this way. You can say that you are more used to other "gx" emulator's way of doing but saying they are more ergonomic is not true at all, I actually spent lot of time working on the GUI because of that.
Quote
That's not "fifo rendering", that's the way GX rendering works. Think about it as a piece of paper your draw on. Obviously, what you drawed "first" will be overwritten by what is last written. Really, this is a very simple framebuffer concept.
Quote
You can do anything you want, each "menu" can have a list of background images, a list buttons which are themselves associated with images. You only give pointers to these lists in the menu structures, those pointers pointing to the actual images or buttons with their position, size, effects, etc...
The gui functions (gui.c, gui.h) should be pretty much self-explainable. However, do not expect what you want to achieve to be as simple as changing a few things in the existing code. You might be better rendering everything from scratch using libwiigui, in which case, good luck ^^
static int FileSortCallback(const void *f1, const void *f2) { /* Special case for implicit directories */ if(((FILEENTRIES *)f1)->filename[0] == '.' || ((FILEENTRIES *)f2)->filename[0] == '.') { if(strcmp(((FILEENTRIES *)f1)->filename, ".") == 0) { return -1; } if(strcmp(((FILEENTRIES *)f2)->filename, ".") == 0) { return 1; } if(strcmp(((FILEENTRIES *)f1)->filename, "..") == 0) { return -1; } if(strcmp(((FILEENTRIES *)f2)->filename, "..") == 0) { return 1; } } /* If one is a file and one is a directory the directory is first. */ if(((FILEENTRIES *)f1)->flags && !((FILEENTRIES *)f2)->flags) return -1; if(!((FILEENTRIES *)f1)->flags && ((FILEENTRIES *)f2)->flags) return 1; return stricmp(((FILEENTRIES *)f1)->filename, ((FILEENTRIES *)f2)->filename); }
Re: GenesisPlus GX - UI and Ergonomic Modification July 31, 2012 11:32AM | Registered: 15 years ago Posts: 276 |
You didn't understand, this is not because of the UI design, this is the way the hardware works. What is rendered last in the framebuffer (efb) always appears on top.Quote
Correct me if I am wrong but I thought this is exactly fifo (first in first out). So the first thing you are initiating or requesting is the first thing which is appearing on screen.
You could do the opposite as well. The last image which is initiated/requested is the first thing on screen.
There are different methods of UI realizations. Another one would be to initiate/request all images at once and to assign it afterwards to different fixed layers.
There is a simple function to render single images, externally from common menu rendering. But the arrows are part of the menu rendering. If you want to add a moving ladder like in libwiigui, you must code it yourself.Quote
I have to find a way to draw the arrows after the selection bar. But I dunno how to draw the buttons independent of the menu (in this case gui_menu menu_selector). So I always have to assign buttons to a menu in order to draw and use them.
Not seeing what is so surprising. This is actually code sent from someone else that is used to sort files alphabetically. And yes it is used, and it only filters "." and ".." file entries (this might already be done elsewhere, but as i said, this is the code i was sent and i reused it without modifying it)Quote
But anyway I am little bit surprised about some parts in your code.
You already defined some filters and sorter.
So in general you are already modifying the list but it's not used.
No, i won't. You cannot guess the filetype if the rom is zipped (and you don't want to unzip each listed file to know the uncompressed filename extension because this would be slow as hell). I don't want to filter "supported" file extensions because mega drive ROM files already have multiple existing ones and it seems like people are inventing new ones every full moon, so i don't want to have to keep a supported list up-to-date or dealing with complaints of users not seeing their last downloaded romset. It's up to you to arrange your files correctly, with each system to its own folder/subfolders.Quote
Also the filters (gui_menu menu_load) for the cartridges can be used to filter the games inside the folder.
But I believe you will activate/implement this feature in a later release. :-)