Changeset 213

Show
Ignore:
Timestamp:
03/16/08 11:05:36 (4 months ago)
Author:
mattn
Message:

* fixed ufoai surface plugin (don't give a stack variable pointer to the button callback function but a static array pointer)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • GtkRadiant/branches/ZeroRadiant/plugins/surface_ufoai/surfaceflagsdialog_ufoai.cpp

    r201 r213  
    339339        "stepon", 
    340340        "" 
     341}; 
     342 
     343static const int flagBitMasks[] = { 
     344        1<<0, 
     345        1<<1, 
     346        1<<2, 
     347        1<<3, 
     348        1<<4, 
     349        1<<5, 
     350        1<<6, 
     351        1<<7, 
     352        1<<8, 
     353        1<<9, 
     354        1<<10, 
     355        1<<11, 
     356        1<<12, 
     357        1<<13, 
     358        1<<14, 
     359        1<<15, 
     360        1<<16, 
     361        1<<17, 
     362        1<<18, 
     363        1<<19, 
     364        1<<20, 
     365        1<<21, 
     366        1<<22, 
     367        1<<23, 
     368        1<<24, 
     369        1<<25, 
     370        1<<26, 
     371        1<<27, 
     372        1<<28, 
     373        1<<29, 
     374        1<<30, 
     375        1<<31, 
    341376}; 
    342377 
     
    358393        GtkWidget *table3; 
    359394        GtkWidget *label6; 
    360         int flag = 0; 
    361395        int i, x, y; 
    362396 
     
    388422                        y++; 
    389423                x = i % 4; 
    390                 flag = (1 << i); 
    391424                surface_buttons[i] = gtk_toggle_button_new_with_label (surfaceFlags[i]); 
    392                 gtk_signal_connect(GTK_OBJECT (surface_buttons[i]), "toggled", GTK_SIGNAL_FUNC(on_surface_button_toggled), &flag); 
     425                gtk_signal_connect(GTK_OBJECT (surface_buttons[i]), "toggled", GTK_SIGNAL_FUNC(on_surface_button_toggled), &flagBitMasks[i]); 
    393426                gtk_widget_show(surface_buttons[i]); 
    394427                gtk_table_attach(GTK_TABLE (table4), surface_buttons[i], 0 + x, 1 + x, (0 + y), (1 + y), 
     
    447480                        y++; 
    448481                x = i % 4; 
    449                 flag = (1 << i); 
    450482                content_buttons[i] = gtk_toggle_button_new_with_label(contentFlags[i]); 
    451                 gtk_signal_connect(GTK_OBJECT (content_buttons[i]), "toggled", GTK_SIGNAL_FUNC (on_content_button_toggled), &flag); 
     483                gtk_signal_connect(GTK_OBJECT (content_buttons[i]), "toggled", GTK_SIGNAL_FUNC (on_content_button_toggled), &flagBitMasks[i]); 
    452484                gtk_widget_show(content_buttons[i]); 
    453485                gtk_table_attach(GTK_TABLE (table3), content_buttons[i], 0 + x, 1 + x, (0 + y), (1 + y),