Checked in 4 more patches by Magliocchetti Riccardo
Those are mostly fixes for gtk and gtk-glade ports. See patch descriptions on sourceforge for details: patches ID: 2149139 2149460 2149470 2149537
This commit is contained in:
parent
edfb5bd1ac
commit
cca9563a85
|
@ -334,11 +334,18 @@ int NDS_LoadROM( const char *filename, int bmtype, u32 bmsize,
|
|||
|
||||
if (!file)
|
||||
{
|
||||
reader->DeInit(file);
|
||||
free(noext);
|
||||
return -1;
|
||||
}
|
||||
size = reader->Size(file);
|
||||
|
||||
if (size < 1) {
|
||||
reader->DeInit(file);
|
||||
free(noext);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(type == ROM_DSGBA)
|
||||
{
|
||||
reader->Seek(file, DSGBA_LOADER_SIZE, SEEK_SET);
|
||||
|
|
|
@ -173,7 +173,7 @@ int init_GL_free(GtkWidget * widget) {
|
|||
|
||||
void init_GL_capabilities( int use_software_convert) {
|
||||
|
||||
uint16_t blank_texture[256 * 512];
|
||||
uint16_t blank_texture[256 * 512];
|
||||
my_glConfig = gdk_gl_config_new_by_mode (
|
||||
(GdkGLConfigMode) (GDK_GL_MODE_RGBA
|
||||
| GDK_GL_MODE_DEPTH
|
||||
|
@ -191,11 +191,12 @@ void init_GL_capabilities( int use_software_convert) {
|
|||
glGenTextures(2, Textures);
|
||||
|
||||
/* Generate The Texture */
|
||||
glBindTexture( GL_TEXTURE_2D, Textures[0]);
|
||||
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, 256, 512,
|
||||
0, GL_RGBA,
|
||||
GL_UNSIGNED_SHORT_1_5_5_5_REV,
|
||||
blank_texture);
|
||||
glBindTexture( GL_TEXTURE_2D, Textures[0]);
|
||||
memset(blank_texture, 0x001f, sizeof(blank_texture));
|
||||
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, 256, 512,
|
||||
0, GL_RGBA,
|
||||
GL_UNSIGNED_SHORT_1_5_5_5_REV,
|
||||
blank_texture);
|
||||
my_gl_End(0);
|
||||
|
||||
// initialize 2nd drawing area (sharing context)
|
||||
|
|
|
@ -447,13 +447,14 @@ static void Pause()
|
|||
/* Choose a file then load it */
|
||||
static void *Open_Select(GtkWidget* widget, gpointer data)
|
||||
{
|
||||
Pause();
|
||||
|
||||
GtkFileFilter *pFilter_nds, *pFilter_dsgba, *pFilter_any;
|
||||
GtkWidget *pFileSelection;
|
||||
GtkWidget *pParent;
|
||||
gchar *sChemin;
|
||||
|
||||
if (desmume_running())
|
||||
Pause();
|
||||
|
||||
pParent = GTK_WIDGET(data);
|
||||
|
||||
pFilter_nds = gtk_file_filter_new();
|
||||
|
@ -503,6 +504,9 @@ static void *Open_Select(GtkWidget* widget, gpointer data)
|
|||
"Unable to load :\n%s", sChemin);
|
||||
gtk_dialog_run(GTK_DIALOG(pDialog));
|
||||
gtk_widget_destroy(pDialog);
|
||||
} else {
|
||||
gtk_action_set_sensitive(gtk_action_group_get_action(action_group, "run"), TRUE);
|
||||
gtk_action_set_sensitive(gtk_action_group_get_action(action_group, "reset"), TRUE);
|
||||
}
|
||||
|
||||
//Launch(NULL, pWindow);
|
||||
|
@ -513,10 +517,6 @@ static void *Open_Select(GtkWidget* widget, gpointer data)
|
|||
break;
|
||||
}
|
||||
gtk_widget_destroy(pFileSelection);
|
||||
|
||||
// FIXME: should be set sensitive only if a file was really loaded
|
||||
gtk_action_set_sensitive(gtk_action_group_get_action(action_group, "run"), TRUE);
|
||||
gtk_action_set_sensitive(gtk_action_group_get_action(action_group, "reset"), TRUE);
|
||||
}
|
||||
|
||||
static void Close()
|
||||
|
@ -554,9 +554,7 @@ gtk_init_main_gl_area(GtkWidget *widget,
|
|||
|
||||
//printf("Doing GL init\n");
|
||||
|
||||
for ( i = 0; i < 256 * 512; i++) {
|
||||
blank_texture[i] = 0x001f;
|
||||
}
|
||||
memset(blank_texture, 0x001f, sizeof(blank_texture));
|
||||
|
||||
/* Enable Texture Mapping */
|
||||
glEnable( GL_TEXTURE_2D );
|
||||
|
@ -1019,7 +1017,7 @@ void Modify_Key_Press(GtkWidget *w, GdkEventKey *e)
|
|||
{
|
||||
char YouPressed[128];
|
||||
Modify_Key_Chosen = e->keyval;
|
||||
sprintf(YouPressed, "You pressed : %d\nClick OK to keep this key.", e->keyval);
|
||||
sprintf(YouPressed, "You pressed : %s\nClick OK to keep this key.", gdk_keyval_name(e->keyval));
|
||||
gtk_label_set(GTK_LABEL(mkLabel), YouPressed);
|
||||
}
|
||||
|
||||
|
@ -1084,7 +1082,7 @@ void Edit_Controls(GtkWidget* widget, gpointer data)
|
|||
|
||||
for(i = 0; i < NB_KEYS; i++)
|
||||
{
|
||||
sprintf(Key_Label, "%s (%d)", key_names[i], Keypad_Temp[i]);
|
||||
sprintf(Key_Label, "%s (%s)", key_names[i], gdk_keyval_name(Keypad_Temp[i]));
|
||||
ecKey = gtk_button_new_with_label(Key_Label);
|
||||
g_signal_connect(G_OBJECT(ecKey), "clicked", G_CALLBACK(Modify_Key), GINT_TO_POINTER(i));
|
||||
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(ecDialog)->vbox), ecKey,TRUE, FALSE, 0);
|
||||
|
|
Loading…
Reference in New Issue