526 |
|
switch (display_type) { |
527 |
|
case DISPLAY_WINDOW: |
528 |
|
gtk_widget_show(w_frameskip); gtk_widget_show(l_frameskip); |
529 |
– |
gtk_widget_show(w_display_x); gtk_widget_show(l_display_x); |
530 |
– |
gtk_widget_show(w_display_y); gtk_widget_show(l_display_y); |
529 |
|
break; |
530 |
|
case DISPLAY_SCREEN: |
531 |
|
gtk_widget_hide(w_frameskip); gtk_widget_hide(l_frameskip); |
534 |
– |
gtk_widget_hide(w_display_x); gtk_widget_hide(l_display_x); |
535 |
– |
gtk_widget_hide(w_display_y); gtk_widget_hide(l_display_y); |
532 |
|
break; |
533 |
|
} |
534 |
|
} |
572 |
|
if (str) { |
573 |
|
if (sscanf(str, "win/%d/%d", &dis_width, &dis_height) == 2) |
574 |
|
display_type = DISPLAY_WINDOW; |
575 |
< |
else if (strcmp(str, "dga") == 0) |
575 |
> |
else if (sscanf(str, "dga/%d/%d", &dis_width, &dis_height) == 2) |
576 |
|
display_type = DISPLAY_SCREEN; |
577 |
|
} |
578 |
|
} |
594 |
|
sprintf(pref, "win/%d/%d", dis_width, dis_height); |
595 |
|
break; |
596 |
|
case DISPLAY_SCREEN: |
597 |
< |
strcpy(pref, "dga"); |
597 |
> |
sprintf(pref, "dga/%d/%d", dis_width, dis_height); |
598 |
|
break; |
599 |
|
default: |
600 |
|
PrefsRemoveItem("screen"); |
606 |
|
// Create "Graphics/Sound" pane |
607 |
|
static void create_graphics_pane(GtkWidget *top) |
608 |
|
{ |
609 |
< |
GtkWidget *box, *table, *label, *opt, *menu; |
609 |
> |
GtkWidget *box, *table, *label, *opt, *menu, *combo; |
610 |
|
char str[32]; |
611 |
|
|
612 |
|
parse_graphics_prefs(); |
675 |
|
gtk_widget_show(l_display_x); |
676 |
|
gtk_table_attach(GTK_TABLE(table), l_display_x, 0, 1, 2, 3, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4); |
677 |
|
|
678 |
< |
w_display_x = gtk_entry_new(); |
679 |
< |
gtk_widget_show(w_display_x); |
680 |
< |
sprintf(str, "%d", dis_width); |
681 |
< |
gtk_entry_set_text(GTK_ENTRY(w_display_x), str); |
682 |
< |
gtk_table_attach(GTK_TABLE(table), w_display_x, 1, 2, 2, 3, (GtkAttachOptions)GTK_FILL, (GtkAttachOptions)0, 4, 4); |
678 |
> |
combo = gtk_combo_new(); |
679 |
> |
gtk_widget_show(combo); |
680 |
> |
GList *glist1 = NULL; |
681 |
> |
glist1 = g_list_append(glist1, (char *)"512"); |
682 |
> |
glist1 = g_list_append(glist1, (char *)"640"); |
683 |
> |
glist1 = g_list_append(glist1, (char *)"800"); |
684 |
> |
glist1 = g_list_append(glist1, (char *)"1024"); |
685 |
> |
glist1 = g_list_append(glist1, (char *)"MAX"); |
686 |
> |
gtk_combo_set_popdown_strings(GTK_COMBO(combo), glist1); |
687 |
> |
if (dis_width) |
688 |
> |
sprintf(str, "%d", dis_width); |
689 |
> |
else |
690 |
> |
strcpy(str, "MAX"); |
691 |
> |
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo)->entry), str); |
692 |
> |
gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 2, 3, (GtkAttachOptions)GTK_FILL, (GtkAttachOptions)0, 4, 4); |
693 |
> |
w_display_x = GTK_COMBO(combo)->entry; |
694 |
|
|
695 |
|
l_display_y = gtk_label_new(GetString(STR_DISPLAY_Y_CTRL)); |
696 |
|
gtk_widget_show(l_display_y); |
697 |
|
gtk_table_attach(GTK_TABLE(table), l_display_y, 0, 1, 3, 4, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4); |
698 |
|
|
699 |
< |
w_display_y = gtk_entry_new(); |
700 |
< |
gtk_widget_show(w_display_y); |
701 |
< |
sprintf(str, "%d", dis_height); |
702 |
< |
gtk_entry_set_text(GTK_ENTRY(w_display_y), str); |
703 |
< |
gtk_table_attach(GTK_TABLE(table), w_display_y, 1, 2, 3, 4, (GtkAttachOptions)GTK_FILL, (GtkAttachOptions)0, 4, 4); |
699 |
> |
combo = gtk_combo_new(); |
700 |
> |
gtk_widget_show(combo); |
701 |
> |
GList *glist2 = NULL; |
702 |
> |
glist2 = g_list_append(glist2, (char *)"384"); |
703 |
> |
glist2 = g_list_append(glist2, (char *)"480"); |
704 |
> |
glist2 = g_list_append(glist2, (char *)"600"); |
705 |
> |
glist2 = g_list_append(glist2, (char *)"768"); |
706 |
> |
glist2 = g_list_append(glist2, (char *)"MAX"); |
707 |
> |
gtk_combo_set_popdown_strings(GTK_COMBO(combo), glist2); |
708 |
> |
if (dis_height) |
709 |
> |
sprintf(str, "%d", dis_height); |
710 |
> |
else |
711 |
> |
strcpy(str, "MAX"); |
712 |
> |
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo)->entry), str); |
713 |
> |
gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 3, 4, (GtkAttachOptions)GTK_FILL, (GtkAttachOptions)0, 4, 4); |
714 |
> |
w_display_y = GTK_COMBO(combo)->entry; |
715 |
|
|
716 |
|
make_checkbox(box, STR_NOSOUND_CTRL, "nosound", GTK_SIGNAL_FUNC(tb_nosound)); |
717 |
|
|
777 |
|
if (glist) |
778 |
|
g_list_sort(glist, gl_str_cmp); |
779 |
|
else |
780 |
< |
glist = g_list_append(glist, "<none>"); |
780 |
> |
glist = g_list_append(glist, (char *)"<none>"); |
781 |
|
return glist; |
782 |
|
} |
783 |
|
|
813 |
|
if (glist) |
814 |
|
g_list_sort(glist, gl_str_cmp); |
815 |
|
else |
816 |
< |
glist = g_list_append(glist, "<none>"); |
816 |
> |
glist = g_list_append(glist, (char *)"<none>"); |
817 |
|
return glist; |
818 |
|
} |
819 |
|
|