Update to bsnes v037a release.

[No changelog available]
This commit is contained in:
byuu 2008-10-27 15:02:10 +00:00
parent a9bff19b5b
commit 9b03874f32
7 changed files with 54 additions and 39 deletions

View File

@ -1,5 +1,5 @@
bsnes bsnes
Version: 0.037 Version: 0.037a
Author: byuu Author: byuu
======== ========

View File

@ -1,4 +1,4 @@
#define BSNES_VERSION "0.037" #define BSNES_VERSION "0.037a"
#define BSNES_TITLE "bsnes v" BSNES_VERSION #define BSNES_TITLE "bsnes v" BSNES_VERSION
#define BUSCORE sBus #define BUSCORE sBus

View File

@ -1,10 +1,18 @@
void hiro_plistbox_change(pListbox *p) { static void hiro_plistbox_change(pListbox *p) {
//only send message when active item changes
if(p->listbox_selection == p->get_selection()) return; if(p->listbox_selection == p->get_selection()) return;
if(p->self.on_change) p->self.on_change(event_t(event_t::Change, p->listbox_selection = p->get_selection(), &p->self));
p->listbox_selection = p->get_selection();
if(p->self.on_change) {
p->self.on_change(event_t(event_t::Change, p->listbox_selection, &p->self));
}
} }
void hiro_plistbox_activate(pListbox *p) { static void hiro_plistbox_activate(pListbox *p) {
if(p->self.on_activate) p->self.on_activate(event_t(event_t::Activate, p->listbox_selection = p->get_selection(), &p->self)); p->listbox_selection = p->get_selection();
if(p->self.on_activate) {
p->self.on_activate(event_t(event_t::Activate, p->listbox_selection, &p->self));
}
} }
void pListbox::create(unsigned style, unsigned width, unsigned height, const char *columns, const char *text) { void pListbox::create(unsigned style, unsigned width, unsigned height, const char *columns, const char *text) {
@ -35,7 +43,7 @@ void pListbox::create(unsigned style, unsigned width, unsigned height, const cha
gtk_widget_show(listbox); gtk_widget_show(listbox);
gtk_widget_show(scrollbox); gtk_widget_show(scrollbox);
//alternate colors for each listbox entry if there are multiple columns ... //alternate colors for each listbox entry if there are multiple columns
gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(listbox), count(list) >= 2 ? true : false); gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(listbox), count(list) >= 2 ? true : false);
for(unsigned i = 0; i < count(list); i++) { for(unsigned i = 0; i < count(list); i++) {
renderer = gtk_cell_renderer_text_new(); renderer = gtk_cell_renderer_text_new();
@ -72,7 +80,7 @@ lstring list;
split(list, "\t", text); split(list, "\t", text);
gtk_list_store_append(store, &iter); gtk_list_store_append(store, &iter);
for(unsigned i = 0; i < count(list); i++) { for(unsigned i = 0; i < count(list); i++) {
gtk_list_store_set(store, &iter, i, list[i](), -1); gtk_list_store_set(store, &iter, i, (const char*)list[i], -1);
} }
} }
@ -87,18 +95,18 @@ GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(listbox));
lstring list; lstring list;
split(list, "\t", text); split(list, "\t", text);
for(unsigned i = 0; i < count(list); i++) { for(unsigned i = 0; i < count(list); i++) {
gtk_list_store_set(store, &iter, i, list[i](), -1); gtk_list_store_set(store, &iter, i, (const char*)list[i], -1);
} }
} }
int pListbox::get_selection() { int pListbox::get_selection() {
GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(listbox)); GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(listbox));
GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(listbox)); GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(listbox));
if(gtk_tree_model_get_iter_first(model, &iter) == false) { return -1; } if(gtk_tree_model_get_iter_first(model, &iter) == false) return -1;
if(gtk_tree_selection_iter_is_selected(selection, &iter) == true) { return 0; } if(gtk_tree_selection_iter_is_selected(selection, &iter) == true) return 0;
for(unsigned i = 1; i < 100000; i++) { for(unsigned i = 1; i < 100000; i++) {
if(gtk_tree_model_iter_next(model, &iter) == false) { return -1; } if(gtk_tree_model_iter_next(model, &iter) == false) return -1;
if(gtk_tree_selection_iter_is_selected(selection, &iter) == true) { return i; } if(gtk_tree_selection_iter_is_selected(selection, &iter) == true) return i;
} }
return -1; return -1;
} }
@ -108,18 +116,25 @@ int current = get_selection();
GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(listbox)); GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(listbox));
GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(listbox)); GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(listbox));
gtk_tree_selection_unselect_all(selection); gtk_tree_selection_unselect_all(selection);
if(index < 0) { goto end; } if(index < 0) return; //nothing to select?
if(gtk_tree_model_get_iter_first(model, &iter) == false) { goto end; }
if(index == 0) { gtk_tree_selection_select_iter(selection, &iter); goto end; } if(gtk_tree_model_get_iter_first(model, &iter)) {
if(index == 0) {
gtk_tree_selection_select_iter(selection, &iter);
} else {
for(unsigned i = 1; i < 100000; i++) { for(unsigned i = 1; i < 100000; i++) {
if(gtk_tree_model_iter_next(model, &iter) == false) { goto end; } if(gtk_tree_model_iter_next(model, &iter) == false) break;
if(index == i) { gtk_tree_selection_select_iter(selection, &iter); goto end; } if(index == i) {
gtk_tree_selection_select_iter(selection, &iter);
break;
}
}
}
} }
end:
if(current != index); //{ owner->message(Message::Changed, (uintptr_t)this); }
} }
void pListbox::reset() { void pListbox::reset() {
listbox_selection = -1;
gtk_list_store_clear(GTK_LIST_STORE(store)); gtk_list_store_clear(GTK_LIST_STORE(store));
gtk_tree_view_set_model(GTK_TREE_VIEW(listbox), GTK_TREE_MODEL(store)); gtk_tree_view_set_model(GTK_TREE_VIEW(listbox), GTK_TREE_MODEL(store));
} }

View File

@ -1,6 +1,6 @@
/* /*
hiro hiro
version: 0.007b (2008-10-26) version: 0.008 (2008-10-27)
author: byuu author: byuu
license: public domain license: public domain
*/ */

View File

@ -22,9 +22,9 @@ uintptr_t DriverSelectWindow::input_change(event_t) {
void DriverSelectWindow::setup() { void DriverSelectWindow::setup() {
create(0, 475, 355); create(0, 475, 355);
//this is only displayed if app.crashed_on_last_run == true //this is only displayed if application crashed on last run
crash_message.create(0, 475, 36, string() crash_message.create(0, 475, 36, string()
<< translate["WARNING: bsnes crashed on last startup due to incompatible driver settings."] << "\n" << translate["Warning: bsnes crashed on last startup due to incompatible driver settings."] << "\n"
<< translate["Please select a different driver configuration below."] << translate["Please select a different driver configuration below."]
); );
@ -35,7 +35,7 @@ void DriverSelectWindow::setup() {
split(part, ";", video.driver_list()); split(part, ";", video.driver_list());
for(unsigned i = 0; i < count(part); i++) { for(unsigned i = 0; i < count(part); i++) {
cvideo.add_item(part[i]); cvideo.add_item(translate[string() << "{{videodriver}}" << part[i]]);
if(part[i] == config::system.video) cvideo.set_selection(i); if(part[i] == config::system.video) cvideo.set_selection(i);
} }
@ -44,7 +44,7 @@ void DriverSelectWindow::setup() {
split(part, ";", audio.driver_list()); split(part, ";", audio.driver_list());
for(unsigned i = 0; i < count(part); i++) { for(unsigned i = 0; i < count(part); i++) {
caudio.add_item(part[i]); caudio.add_item(translate[string() << "{{audiodriver}}" << part[i]]);
if(part[i] == config::system.audio) caudio.set_selection(i); if(part[i] == config::system.audio) caudio.set_selection(i);
} }
@ -53,7 +53,7 @@ void DriverSelectWindow::setup() {
split(part, ";", input.driver_list()); split(part, ";", input.driver_list());
for(unsigned i = 0; i < count(part); i++) { for(unsigned i = 0; i < count(part); i++) {
cinput.add_item(part[i]); cinput.add_item(translate[string() << "{{inputdriver}}" << part[i]]);
if(part[i] == config::system.input) cinput.set_selection(i); if(part[i] == config::system.input) cinput.set_selection(i);
} }

View File

@ -184,7 +184,7 @@ uintptr_t InputConfigWindow::set_tick(event_t) {
message = translate["Move mouse or analog joypad axis to assign to $ ..."]; message = translate["Move mouse or analog joypad axis to assign to $ ..."];
} }
replace(message, "$", group->list[pos]->name); replace(message, "$", translate[group->list[pos]->name]);
window_input_capture.label.set_text(message); window_input_capture.label.set_text(message);
bool show_controller_graphic = false; bool show_controller_graphic = false;