Changeset 647

Show
Ignore:
Timestamp:
01/02/08 09:13:06 (9 months ago)
Author:
shanoah
Message:

Quick redraw patch for the gtk port - the term window code could still use work...

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main-gtk.c

    r646 r647  
    3030 *Write all debugger messages to the command line, as well as the debugger window.  
    3131*/ 
    32 /*#define VERBOSE_DEBUG*/ 
     32#define VERBOSE_DEBUG 
    3333 
    3434#ifdef GTK_DEBUG 
     
    129129         
    130130        load_font_by_name(td, td->font.name); 
    131         term_data_resize(td); 
     131        term_data_redraw(td); 
    132132        return(TRUE); 
    133133} 
     
    167167} 
    168168 
    169 static void term_data_resize(term_data *td) 
    170 { 
    171         term *old = Term; 
    172          
    173         /* Activate the term */ 
    174         Term_activate(&td->t); 
    175  
    176         Term_resize(td->cols, td->rows); 
    177          
    178         /* Redraw the contents */ 
    179         Term_redraw(); 
    180  
    181         /* Flush the output */ 
    182         Term_fresh(); 
    183         Term_key_push(KTRL('R')); 
    184         Term_activate(old); 
    185 } 
    186  
    187169void set_row_and_cols(term_data *td) 
    188170{ 
     
    200182         
    201183        if ((cols != td->cols) || (rows != td->rows)) 
    202                 term_data_resize(td); 
     184                term_data_redraw(td); 
    203185} 
    204186 
     
    214196        s = gtk_widget_get_name(widget); 
    215197        sscanf(s, "term_drawing_area_%d", &t); 
    216         /*glog("Configuring '%s'", s);*/ 
     198         
    217199        if (t != -1) 
    218200        { 
     
    248230                        * It may not even do that any more... 
    249231                        */ 
    250                         /*if (((w != 200) && (h != 190)) || ((w <= 100) && (h <= 100))) 
    251                         {*/ 
     232                        if (((w != 200) && (h != 190)) || ((w <= 100) && (h <= 100))) 
     233                        { 
    252234                        if (w != 0) td->size.w = w; 
    253235                        if (h != 0)  td->size.h = h; 
     236                                 
    254237                        set_row_and_cols(td); 
    255                         /*}*/ 
     238                        term_data_redraw(td); 
     239                         
     240                        /* Hack -- Force redraw */ 
     241                        if (game_in_progress) 
     242                        { 
     243                                reset_visuals(TRUE); 
     244                                Term_key_push(KTRL('R')); 
     245                        } 
     246                        } 
    256247                 
    257248                        #ifdef GTK_DEBUG 
     
    558549        /* Activate the term passed to it, not term 0! */ 
    559550        Term_activate(&td->t); 
     551 
     552        Term_resize(td->cols, td->rows); 
    560553 
    561554        /* Redraw the contents */ 
     
    14221415                        cairo_clear(xd->surface, r, TERM_DARK); 
    14231416                } 
     1417                         
     1418                if (xd->event != 0) 
     1419                { 
     1420                        event_signal(xd->event); 
     1421                } 
    14241422        } 
    14251423        return(TRUE); 
     
    17891787                 
    17901788                err = gtk_font_button_set_font_name(GTK_FONT_BUTTON(temp_widget), td->font.name); 
     1789         
     1790                set_window_size(td); 
    17911791        } 
    17921792} 
     
    18071807                /* Activate the window screen */ 
    18081808                Term_activate(&data[i].t); 
    1809                  
    1810                 set_window_size(td); 
    18111809                 
    18121810                if (i == 0) td->visible = TRUE;