Changeset 442

Show
Ignore:
Timestamp:
08/04/07 16:15:41 (1 year ago)
Author:
ajps
Message:

Make main-sdl.c C89ish

Files:

Legend:

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

    r346 r442  
    523523        TTF_Font *ttf_font; 
    524524         
    525         /* Free any old data */ 
    526         if (font->data) sdl_FontFree(font); 
    527          
    528525        /* Our temporary glyph will be rendered in white */ 
    529526        SDL_Color white = { 255, 255, 255, 0 }; 
     
    534531        /* But we need an extra space to store the total pixel count */ 
    535532        int num_pixels = NUM_GLYPHS + 1; 
     533         
     534        /* Free any old data */ 
     535        if (font->data) sdl_FontFree(font); 
    536536         
    537537        /* Build the path */ 
     
    12521252        int i; 
    12531253        Uint32 colour = SDL_MapRGB(AppWin->format, 160, 160, 60); 
    1254         //Uint32 ccolour = SDL_MapRGB(AppWin->format, 160, 40, 40); 
     1254        /* int32 ccolour = SDL_MapRGB(AppWin->format, 160, 40, 40); */ 
    12551255        SDL_FillRect(AppWin, NULL, back_colour); 
    12561256         
     
    12711271                        SizingSpot.x = win->left + win->width - 10; 
    12721272                        SizingSpot.y = win->top + win->height - 10; 
    1273                         //SDL_FillRect(AppWin, &SizingSpot, ccolour); 
     1273                        /* SDL_FillRect(AppWin, &SizingSpot, ccolour); */ 
    12741274                         
    12751275                        if (Sizing) 
     
    13841384{ 
    13851385        int i, maxl = 0; 
     1386        int width = maxl * StatusBar.font.width + 20; 
     1387        int height = ANGBAND_TERM_MAX * (StatusBar.font.height + 1); 
     1388 
    13861389        for (i = 0; i < ANGBAND_TERM_MAX; i++) 
    13871390        { 
     
    13891392                if (l > maxl) maxl = l; 
    13901393        } 
    1391         int width = maxl * StatusBar.font.width + 20; 
    1392         int height = ANGBAND_TERM_MAX * (StatusBar.font.height + 1); 
    13931394         
    13941395        sdl_WindowInit(&PopUp, width, height, AppWin, StatusBar.font.name); 
     
    14711472{ 
    14721473        int i, maxl = 0; 
     1474        int width = maxl * StatusBar.font.width + 20; 
     1475        int height = num_fonts * (StatusBar.font.height + 1); 
     1476 
    14731477        for (i = 0; i < num_fonts; i++) 
    14741478        { 
     
    14761480                if (l > maxl) maxl = l; 
    14771481        } 
    1478         int width = maxl * StatusBar.font.width + 20; 
    1479         int height = num_fonts * (StatusBar.font.height + 1); 
    14801482         
    14811483        sdl_WindowInit(&PopUp, width, height, AppWin, StatusBar.font.name); 
     
    22722274                                        Moving = TRUE; 
    22732275                                         
    2274                                         //BringToTop(idx); 
     2276                                        /* BringToTop(idx); */ 
    22752277                                         
    22762278                                        /* Remember where we started */ 
     
    23262328                                else if (idx != -1) 
    23272329                                { 
     2330                                        int x, y; 
    23282331                                        win = &windows[idx]; 
    23292332                                         
    23302333                                        /* Calculate the 'cell' coords */ 
    2331                                         int x = (mouse.x - win->left - win->border) / win->tile_wid; 
    2332                                         int y = (mouse.y - win->top - win->title_height) / win->tile_hgt; 
     2334                                        x = (mouse.x - win->left - win->border) / win->tile_wid; 
     2335                                        y = (mouse.y - win->top - win->title_height) / win->tile_hgt; 
    23332336                                         
    23342337                                        /* Bounds check */ 
     
    24202423        if (key_sym == SDLK_PRINT) 
    24212424        { 
    2422                 //sdl_print_screen(); 
     2425                /* sdl_print_screen();*/ 
    24232426                return; 
    24242427        } 
     
    28172820        SDL_Rect rc; 
    28182821         
    2819         //if (use_bigtile) n*=2; 
     2822        /*if (use_bigtile) n*=2;*/ 
    28202823        /* Build the area to black out */ 
    28212824        rc.x = col * win->tile_wid; 
     
    31093112        char buf[128]; 
    31103113        sdl_Button *button; 
     3114        int x; 
     3115 
    31113116        popped = FALSE; 
    3112         int x; 
    31133117         
    31143118        /* Make sure */