return id;
}
+#if 0
+void DUMP_GADGET_MAP_STATE()
+{
+ struct GadgetInfo *gi = gadget_list_first_entry;
+
+ while (gi)
+ {
+ printf("-XXX-1-> '%s': %s\n",
+ gi->info_text, (gi->mapped ? "mapped" : "not mapped"));
+
+ gi = gi->next;
+ }
+}
+#endif
+
static struct GadgetInfo *getGadgetInfoFromMousePosition(int mx, int my)
{
struct GadgetInfo *gi = gadget_list_first_entry;
{
struct FileInfo *file_list;
int num_suffix_list_entries = 0;
- int list_pos = -1;
+ int list_pos = 0;
int i, j;
file_list = checked_calloc(num_file_list_entries * sizeof(struct FileInfo));
/* always start with reliable default values */
for (i=0; i<num_file_list_entries; i++)
{
- file_list[list_pos].token = NULL;
- file_list[list_pos].default_filename = NULL;
- file_list[list_pos].filename = NULL;
+ file_list[i].token = NULL;
+ file_list[i].default_filename = NULL;
+ file_list[i].filename = NULL;
if (num_suffix_list_entries > 0)
{
if (is_file_entry)
{
- list_pos++;
+ if (i > 0)
+ list_pos++;
if (list_pos >= num_file_list_entries)
Error(ERR_EXIT, "inconsistant config list information -- please fix");
{
for (i=0; i<num_file_list_entries; i++)
{
- file_list[i].filename =
- getStringCopy(getTokenValue(setup_file_list, file_list[i].token));
+ char *filename = getTokenValue(setup_file_list, file_list[i].token);
+
+ if (filename == NULL)
+ filename = file_list[i].default_filename;
+ file_list[i].filename = getStringCopy(filename);
for (j=0; j<num_suffix_list_entries; j++)
{
DrawInitText(draw_init[artwork_info->type].text, 120, FC_GREEN);
#if 0
- printf("DEBUG: reloading %d sounds ...\n", num_file_list_entries);
+ printf("DEBUG: reloading %d artwork files ...\n", num_file_list_entries);
#endif
for(i=0; i<num_file_list_entries; i++)
if (draw_init[artwork_info->type].do_it)
DrawInitText(file_list[i].token, 150, FC_YELLOW);
- if (file_list[i].filename)
- LoadArtworkToList(artwork_info, file_list[i].filename, i);
- else
- LoadArtworkToList(artwork_info, file_list[i].default_filename, i);
+ LoadArtworkToList(artwork_info, file_list[i].filename, i);
}
draw_init[artwork_info->type].do_it = FALSE;