Previous 199869 Revisions Next

r34614 Monday 26th January, 2015 at 09:18:37 UTC by Fabio Priuli
ui: slight improvement on device input ordering + small cleanup. nw.

the ordering is still not optimal, imho, but at least if you launch SMS
with a lphaser and a paddle you don't get anymore their input mixed
in the menu. I will probably get back to this after next release.
[src/emu/ui]inputmap.c sliders.c

trunk/src/emu/ui/inputmap.c
r243125r243126
154154void ui_menu_input_specific::populate()
155155{
156156   input_item_data *itemlist = NULL;
157   ioport_field *field;
158   ioport_port *port;
159157   int suborder[SEQ_TYPE_TOTAL];
160158   astring tempstring;
159   int port_count = 0;
161160
162161   /* create a mini lookup table for sort order based on sequence type */
163162   suborder[SEQ_TYPE_STANDARD] = 0;
r243125r243126
165164   suborder[SEQ_TYPE_INCREMENT] = 2;
166165
167166   /* iterate over the input ports and add menu items */
168   for (port = machine().ioport().first_port(); port != NULL; port = port->next())
169      for (field = port->first_field(); field != NULL; field = field->next())
167   for (ioport_port *port = machine().ioport().first_port(); port != NULL; port = port->next())
168   {
169      port_count++;
170      for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
170171      {
171172         const char *name = field->name();
172173
r243125r243126
182183            {
183184               sortorder = (field->type() << 2) | (field->player() << 12);
184185               if (strcmp(field->device().tag(), ":"))
185                  sortorder |= 0x10000;
186                  sortorder |= (port_count & 0xfff) * 0x10000;
186187            }
187188            else
188189               sortorder = field->type() | 0xf000;
r243125r243126
212213            }
213214         }
214215      }
216   }
215217
216218   /* sort and populate the menu in a standard fashion */
217219   populate_and_sort(itemlist);
trunk/src/emu/ui/sliders.c
r243125r243126
130130
131131void ui_menu_sliders::populate()
132132{
133   const slider_state *curslider;
134133   astring tempstring;
135134
136   /* add all sliders */
137   for (curslider = machine().ui().get_slider_list(); curslider != NULL; curslider = curslider->next)
135   /* add UI sliders */
136   for (const slider_state *curslider = machine().ui().get_slider_list(); curslider != NULL; curslider = curslider->next)
138137   {
139138      INT32 curval = (*curslider->update)(machine(), curslider->arg, &tempstring, SLIDER_NOCHANGE);
140139      UINT32 flags = 0;
r243125r243126
148147         break;
149148   }
150149
151   /* add all sliders */
152   for (curslider = (slider_state*)machine().osd().get_slider_list(); curslider != NULL; curslider = curslider->next)
150   /* add OSD sliders */
151   for (const slider_state *curslider = (slider_state*)machine().osd().get_slider_list(); curslider != NULL; curslider = curslider->next)
153152   {
154153      INT32 curval = (*curslider->update)(machine(), curslider->arg, &tempstring, SLIDER_NOCHANGE);
155154      UINT32 flags = 0;


Previous 199869 Revisions Next


© 1997-2024 The MAME Team