Previous 15994 Revisions Next

r1033 Tuesday 25th September, 2007 at 17:56:47 UTC by Cowering
fixing two ASSERT errors for DEBUG builds.. needs checking by core team since this is core file
[src/osd/winui]datamap.c m32opts.c

src/osd/winui/datamap.c
r1032r1033
147147{
148148   datamap_entry *entry;
149149
150   assert(0 <= callback_type < DCT_COUNT);
150   assert(callback_type < DCT_COUNT);
151151
152152   entry = find_entry(map, dlgitem);
153153   entry->callbacks[callback_type] = callback;
r1032r1033
294294      if (map->entries[i].dlgitem == dlgitem)
295295         return &map->entries[i];
296296   }
297   
297
298298   // should not reach here
299299   assert(FALSE);
300300   return NULL;
r1032r1033
512512   const char *string_value;
513513   int selected_index;
514514   int trackbar_pos;
515   
515
516516   // use default read value behavior
517517   switch(get_control_type(control))
518518   {
src/osd/winui/m32opts.c
r1032r1033
99  that you have read the license and understand and accept it fully.
1010
1111 ***************************************************************************/
12
12
1313 /***************************************************************************
1414
1515  m32opts.c
r1032r1033
445445#endif
446446
447447/***************************************************************************
448    External functions 
448    External functions
449449 ***************************************************************************/
450450
451451static void memory_error(const char *message)
r1032r1033
644644
645645const char * GetImageTabLongName(int tab_index)
646646{
647   assert(0 <= tab_index < ARRAY_LENGTH(image_tabs_long_name));
647   assert(tab_index < ARRAY_LENGTH(image_tabs_long_name));
648648   return image_tabs_long_name[tab_index];
649649}
650650
651651const char * GetImageTabShortName(int tab_index)
652652{
653   assert(0 <= tab_index < ARRAY_LENGTH(image_tabs_short_name));
653   assert(tab_index < ARRAY_LENGTH(image_tabs_short_name));
654654   return image_tabs_short_name[tab_index];
655655}
656656
r1032r1033
11051105{
11061106   const char *show_tabs_string;
11071107   int show_tab_flags;
1108   
1108
11091109   show_tabs_string = options_get_string(settings, M32OPTION_HIDE_TABS);
11101110   TabFlagsDecodeString(show_tabs_string, &show_tab_flags);
11111111   return (show_tab_flags & (1 << tab)) != 0;
r1032r1033
11161116   const char *show_tabs_string;
11171117   int show_tab_flags;
11181118   char buffer[10000];
1119   
1119
11201120   show_tabs_string = options_get_string(settings, M32OPTION_HIDE_TABS);
11211121   TabFlagsDecodeString(show_tabs_string, &show_tab_flags);
11221122
r1032r1033
12881288{
12891289   const char *ini_dir;
12901290   const char *s;
1291   
1291
12921292   ini_dir = options_get_string(global, OPTION_INIPATH);
12931293   while((s = strchr(ini_dir, ';')) != NULL)
12941294   {
r1032r1033
15391539   save_default_options = FALSE;
15401540}
15411541
1542/*
1542/*
15431543 * Reset all game, vector and source options to defaults.
15441544 * No reason to reboot if this is done.
15451545 */
r1032r1033
15541554
15551555   /* Walk the ini/source folder deleting all ini's. */
15561556   remove_all_source_options();
1557   
1557
15581558   /* finally vector.ini */
15591559   save_options(OPTIONS_VECTOR, NULL, 0);
15601560}
r1032r1033
19901990{
19911991   options_set_int(settings, M32OPTION_EXEC_WAIT, wait, OPTION_PRIORITY_CMDLINE);
19921992}
1993
1993
19941994BOOL GetHideMouseOnStartup(void)
19951995{
19961996   return options_get_bool(settings, M32OPTION_HIDE_MOUSE);
r1032r1033
20212021   char tmpStr[256];
20222022
20232023   sprintf(tmpStr, "%u", (int) value[0]);
2024   
2024
20252025   strcpy(str, tmpStr);
20262026
20272027   for (i = 1; i < 16; i++)
r1032r1033
20392039
20402040   strcpy(tmpStr, str);
20412041   p = tmpStr;
2042   
2042
20432043   for (i = 0; p && i < 16; i++)
20442044   {
20452045      s = p;
2046     
2046
20472047      if ((p = strchr(s,',')) != NULL && *p == ',')
20482048      {
20492049         *p = '\0';
r1032r1033
20602060   char buffer[100];
20612061
20622062   snprintf(buffer,sizeof(buffer),"%d",value[0]);
2063   
2063
20642064   strcpy(str,buffer);
20652065
20662066    for (i = 1; i < count; i++)
r1032r1033
20812081
20822082   strcpy(tmpStr, str);
20832083   p = tmpStr;
2084   
2084
20852085    for (i = 0; p && i < count; i++)
20862086   {
20872087      s = p;
2088     
2088
20892089      if ((p = strchr(s,',')) != NULL && *p == ',')
20902090      {
20912091         *p = '\0';
r1032r1033
21012101   char tmpStr[100];
21022102
21032103   sprintf(tmpStr, "%d", value[0]);
2104   
2104
21052105   strcpy(str, tmpStr);
21062106
21072107   for (i = 1; i < GetSplitterCount(); i++)
r1032r1033
21192119
21202120   strcpy(tmpStr, str);
21212121   p = tmpStr;
2122   
2122
21232123   for (i = 0; p && i < GetSplitterCount(); i++)
21242124   {
21252125      s = p;
2126     
2126
21272127      if ((p = strchr(s,',')) != NULL && *p == ',')
21282128      {
21292129         *p = '\0';
r1032r1033
21382138{
21392139   char*    ptr;
21402140   TCHAR*     t_ptr;
2141   
2141
21422142   sscanf(str, "%li,%li,%li,%li,%li,%i,%i,%i,%i,%i,%i,%i,%i",
21432143         &f->lfHeight,
21442144         &f->lfWidth,
r1032r1033
21692169   char* utf8_FaceName = utf8_from_tstring(f->lfFaceName);
21702170   if( !utf8_FaceName )
21712171      return;
2172   
2172
21732173   sprintf(str, "%li,%li,%li,%li,%li,%i,%i,%i,%i,%i,%i,%i,%i,%s",
21742174         f->lfHeight,
21752175         f->lfWidth,
r1032r1033
21852185         f->lfQuality,
21862186         f->lfPitchAndFamily,
21872187         utf8_FaceName);
2188         
2188
21892189   free(utf8_FaceName);
21902190}
21912191
r1032r1033
23232323   {
23242324      if (g_folderData[i].m_nFolderId == nID)
23252325      {
2326         
2326
23272327         return g_folderData[i].m_lpTitle;
23282328      }
23292329   }
r1032r1033
23912391
23922392/* MSH 20080813
23932393 * Read the folder filters from MAME32ui.ini.  This must only
2394 * be called AFTER the folders have all been created.
2394 * be called AFTER the folders have all been created.
23952395 */
23962396void LoadFolderFlags(void)
23972397{
r1032r1033
25702570            }
25712571            ptr++;
25722572         }
2573         
2573
25742574         option_name = astring_assemble_2(astring_alloc(), folder_name, "_filters" );
2575         
2575
25762576         // create entry
25772577         entries[0].name = astring_c(option_name);
25782578         options_add_entries(opts, entries);
r1032r1033
26832683   core_options *opts;
26842684   const game_driver *driver = NULL;
26852685
2686   
2686
26872687   opts = options_create(memory_error);
26882688
26892689   if (opts == NULL)
r1032r1033
27072707#ifdef MAME_DEBUG
27082708   ui_parse_ini_file(opts, "debug");
27092709#endif
2710   if (game_num >= 0)
2710   if (game_num >= 0)
27112711   {
27122712      driver = drivers[game_num];
27132713   }
r1032r1033
28752875   return pruned_options;
28762876}
28772877
2878/*
2878/*
28792879 * Save ini file based on game_num and passed in opt_type.  If opts are
28802880 * NULL, the ini wiil be removed.
28812881 *
r1032r1033
28982898      use_opts = FALSE;
28992899   }
29002900
2901   if (game_num >= 0)
2901   if (game_num >= 0)
29022902   {
29032903      driver = drivers[game_num];
29042904   }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team